summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--.travis.yml8
-rw-r--r--MANIFEST.in8
-rw-r--r--bscript12
-rw-r--r--doc/HOWTO_RELEASE.rst.txt47
-rw-r--r--doc/cython/MANIFEST2
-rw-r--r--doc/cython/Makefile37
-rw-r--r--doc/cython/README.txt20
-rw-r--r--doc/cython/c_numpy.pxd137
-rw-r--r--doc/cython/c_python.pxd62
-rw-r--r--doc/cython/numpyx.pyx127
-rwxr-xr-xdoc/cython/run_test.py5
-rwxr-xr-xdoc/cython/setup.py51
-rw-r--r--doc/f2py/f2py.12
-rw-r--r--doc/neps/deferred-ufunc-evaluation.rst5
-rw-r--r--doc/neps/math_config_clean.rst (renamed from doc/neps/math_config_clean.txt)0
-rw-r--r--doc/neps/missing-data.rst5
-rw-r--r--doc/neps/new-iterator-ufunc.rst5
-rw-r--r--doc/neps/newbugtracker.rst6
-rw-r--r--doc/neps/npy-format.rst292
-rw-r--r--doc/neps/npy-format.txt293
-rw-r--r--doc/neps/pep_buffer.txt869
-rw-r--r--doc/neps/structured_array_extensions.rst (renamed from doc/neps/structured_array_extensions.txt)3
-rw-r--r--doc/neps/warnfix.rst (renamed from doc/neps/warnfix.txt)9
-rw-r--r--doc/numpybook/Figures/contiguous.eps374
-rw-r--r--doc/numpybook/Figures/contiguous.fig133
-rw-r--r--doc/numpybook/Figures/contiguous.pdfbin5700 -> 0 bytes
-rw-r--r--doc/numpybook/Figures/fig1.eps4577
-rw-r--r--doc/numpybook/Figures/fig1bw.eps4575
-rw-r--r--doc/numpybook/Figures/fig2.eps4921
-rw-r--r--doc/numpybook/Figures/fig2bw.eps4919
-rw-r--r--doc/numpybook/Figures/hierarchy.diabin4332 -> 0 bytes
-rw-r--r--doc/numpybook/Figures/hierarchy.eps5596
-rw-r--r--doc/numpybook/Figures/hierarchy.figbin2163 -> 0 bytes
-rw-r--r--doc/numpybook/Figures/hierarchy.pdfbin62320 -> 0 bytes
-rw-r--r--doc/numpybook/Figures/hierarchy.pngbin32014 -> 0 bytes
-rw-r--r--doc/numpybook/Figures/threefundamental.eps246
-rw-r--r--doc/numpybook/Figures/threefundamental.fig57
-rw-r--r--doc/numpybook/Figures/threefundamental.pngbin4696 -> 0 bytes
-rw-r--r--doc/numpybook/capi.lyx24240
-rw-r--r--doc/numpybook/comparison/ctypes/code.c60
-rw-r--r--doc/numpybook/comparison/ctypes/filter.py25
-rw-r--r--doc/numpybook/comparison/ctypes/interface.py59
-rw-r--r--doc/numpybook/comparison/ctypes/newfile.datbin800 -> 0 bytes
-rwxr-xr-xdoc/numpybook/comparison/ctypes/timeme2
-rw-r--r--doc/numpybook/comparison/f2py/add.f45
-rw-r--r--doc/numpybook/comparison/f2py/add.pyf34
-rw-r--r--doc/numpybook/comparison/f2py/filter.f20
-rw-r--r--doc/numpybook/comparison/f2py/filter.pyf16
-rw-r--r--doc/numpybook/comparison/f2py/filtermodule.c293
-rwxr-xr-xdoc/numpybook/comparison/f2py/timeme1
-rw-r--r--doc/numpybook/comparison/pyrex/add.c560
-rw-r--r--doc/numpybook/comparison/pyrex/add.pyx75
-rw-r--r--doc/numpybook/comparison/pyrex/c_numpy.pxd107
-rw-r--r--doc/numpybook/comparison/pyrex/filter.c388
-rw-r--r--doc/numpybook/comparison/pyrex/filter.pyx44
-rw-r--r--doc/numpybook/comparison/pyrex/setup.py30
-rwxr-xr-xdoc/numpybook/comparison/pyrex/timeme2
-rw-r--r--doc/numpybook/comparison/timing.py62
-rw-r--r--doc/numpybook/comparison/weave/filter.py24
-rw-r--r--doc/numpybook/comparison/weave/inline.py51
-rwxr-xr-xdoc/numpybook/comparison/weave/timeme2
-rw-r--r--doc/numpybook/graphics/note.eps116
-rw-r--r--doc/numpybook/graphics/note.fig16
-rw-r--r--doc/numpybook/graphics/note.pngbin1984 -> 0 bytes
-rw-r--r--doc/numpybook/graphics/tip.eps127
-rw-r--r--doc/numpybook/graphics/tip.fig14
-rw-r--r--doc/numpybook/graphics/tip.pngbin2685 -> 0 bytes
-rw-r--r--doc/numpybook/graphics/tip.xfig.fig12
-rw-r--r--doc/numpybook/graphics/warning.eps125
-rw-r--r--doc/numpybook/graphics/warning.fig15
-rw-r--r--doc/numpybook/graphics/warning.pngbin1690 -> 0 bytes
-rw-r--r--doc/numpybook/mybook.layout177
-rw-r--r--doc/numpybook/numpybook.lyx27837
-rw-r--r--doc/numpybook/runcode.py151
-rw-r--r--doc/pyrex/MANIFEST2
-rw-r--r--doc/pyrex/Makefile9
-rw-r--r--doc/pyrex/README.txt3
-rw-r--r--doc/pyrex/c_numpy.pxd126
-rw-r--r--doc/pyrex/c_python.pxd20
-rw-r--r--doc/pyrex/notes3
-rw-r--r--doc/pyrex/numpyx.c1037
-rw-r--r--doc/pyrex/numpyx.pyx101
-rwxr-xr-xdoc/pyrex/run_test.py5
-rw-r--r--doc/pyrex/setup.py50
-rw-r--r--doc/release/1.8.0-notes.rst8
-rw-r--r--doc/release/1.8.1-notes.rst95
-rw-r--r--doc/release/1.9.0-notes.rst418
m---------doc/scipy-sphinx-theme0
-rw-r--r--doc/source/_templates/indexcontent.html13
-rw-r--r--doc/source/contents.rst1
-rw-r--r--doc/source/f2py/python-usage.rst140
-rw-r--r--doc/source/f2py/usage.rst2
-rw-r--r--doc/source/neps/datetime-proposal.rst1
-rw-r--r--doc/source/neps/datetime-proposal3.rst1
-rw-r--r--doc/source/neps/deferred-ufunc-evaluation.rst1
-rw-r--r--doc/source/neps/generalized-ufuncs.rst1
-rw-r--r--doc/source/neps/groupby_additions.rst1
-rw-r--r--doc/source/neps/index.rst37
-rw-r--r--doc/source/neps/math_config_clean.rst1
-rw-r--r--doc/source/neps/missing-data.rst1
-rw-r--r--doc/source/neps/new-iterator-ufunc.rst1
-rw-r--r--doc/source/neps/newbugtracker.rst1
-rw-r--r--doc/source/neps/npy-format.rst1
-rw-r--r--doc/source/neps/structured_array_extensions.rst1
-rw-r--r--doc/source/neps/ufunc-overrides.rst1
-rw-r--r--doc/source/neps/warnfix.rst1
-rw-r--r--doc/source/reference/arrays.dtypes.rst12
-rw-r--r--doc/source/reference/arrays.indexing.rst402
-rw-r--r--doc/source/reference/arrays.ndarray.rst1
-rw-r--r--doc/source/reference/c-api.array.rst39
-rw-r--r--doc/source/reference/c-api.generalized-ufuncs.rst26
-rw-r--r--doc/source/reference/c-api.iterator.rst24
-rw-r--r--doc/source/reference/c-api.types-and-structures.rst16
-rw-r--r--doc/source/reference/maskedarray.baseclass.rst1
-rw-r--r--doc/source/reference/routines.array-creation.rst2
-rw-r--r--doc/source/reference/routines.ma.rst2
-rw-r--r--doc/source/reference/routines.rst2
-rw-r--r--doc/source/reference/routines.testing.rst3
-rw-r--r--doc/source/reference/swig.interface-file.rst2
-rw-r--r--doc/source/user/c-info.how-to-extend.rst2
-rw-r--r--doc/source/user/c-info.python-as-glue.rst2
-rw-r--r--doc/source/user/install.rst6
-rw-r--r--doc/source/user/whatisnumpy.rst24
m---------doc/sphinxext0
-rw-r--r--numpy/__init__.py17
-rw-r--r--numpy/_import_tools.py4
-rw-r--r--numpy/add_newdocs.py173
-rw-r--r--numpy/compat/py3k.py2
-rw-r--r--numpy/compat/tests/test_compat.py19
-rw-r--r--numpy/core/__init__.py6
-rw-r--r--numpy/core/_methods.py46
-rw-r--r--numpy/core/bento.info4
-rw-r--r--numpy/core/bscript11
-rw-r--r--numpy/core/code_generators/cversions.txt16
-rw-r--r--numpy/core/code_generators/genapi.py53
-rw-r--r--numpy/core/code_generators/generate_numpy_api.py29
-rw-r--r--numpy/core/code_generators/generate_ufunc_api.py10
-rw-r--r--numpy/core/code_generators/generate_umath.py2
-rw-r--r--numpy/core/code_generators/numpy_api.py695
-rw-r--r--numpy/core/code_generators/ufunc_docstrings.py443
-rw-r--r--numpy/core/cversions.py (renamed from numpy/core/code_generators/cversions.py)7
-rw-r--r--numpy/core/fromnumeric.py20
-rw-r--r--numpy/core/function_base.py4
-rw-r--r--numpy/core/include/numpy/_numpyconfig.h.in2
-rw-r--r--numpy/core/include/numpy/ndarraytypes.h84
-rw-r--r--numpy/core/include/numpy/npy_3kcompat.h98
-rw-r--r--numpy/core/include/numpy/npy_common.h59
-rw-r--r--numpy/core/include/numpy/npy_cpu.h5
-rw-r--r--numpy/core/include/numpy/npy_endian.h4
-rw-r--r--numpy/core/include/numpy/numpyconfig.h1
-rw-r--r--numpy/core/include/numpy/ufuncobject.h4
-rw-r--r--numpy/core/memmap.py5
-rw-r--r--numpy/core/numeric.py153
-rw-r--r--numpy/core/numerictypes.py7
-rw-r--r--numpy/core/setup.py29
-rw-r--r--numpy/core/setup_common.py27
-rw-r--r--numpy/core/src/dummymodule.c1
-rw-r--r--numpy/core/src/multiarray/alloc.c241
-rw-r--r--numpy/core/src/multiarray/alloc.h22
-rw-r--r--numpy/core/src/multiarray/array_assign_array.c12
-rw-r--r--numpy/core/src/multiarray/array_assign_scalar.c26
-rw-r--r--numpy/core/src/multiarray/arrayobject.c90
-rw-r--r--numpy/core/src/multiarray/arraytypes.c.src189
-rw-r--r--numpy/core/src/multiarray/buffer.c15
-rw-r--r--numpy/core/src/multiarray/common.c134
-rw-r--r--numpy/core/src/multiarray/common.h58
-rw-r--r--numpy/core/src/multiarray/conversion_utils.c13
-rw-r--r--numpy/core/src/multiarray/convert.c17
-rw-r--r--numpy/core/src/multiarray/convert_datatype.c235
-rw-r--r--numpy/core/src/multiarray/ctors.c142
-rw-r--r--numpy/core/src/multiarray/datetime.c2
-rw-r--r--numpy/core/src/multiarray/datetime_busdaycal.c7
-rw-r--r--numpy/core/src/multiarray/datetime_strings.c3
-rw-r--r--numpy/core/src/multiarray/descriptor.c124
-rw-r--r--numpy/core/src/multiarray/dtype_transfer.c56
-rw-r--r--numpy/core/src/multiarray/einsum.c.src213
-rw-r--r--numpy/core/src/multiarray/getset.c6
-rw-r--r--numpy/core/src/multiarray/item_selection.c410
-rw-r--r--numpy/core/src/multiarray/iterators.c20
-rw-r--r--numpy/core/src/multiarray/lowlevel_strided_loops.c.src416
-rw-r--r--numpy/core/src/multiarray/mapping.c3713
-rw-r--r--numpy/core/src/multiarray/mapping.h40
-rw-r--r--numpy/core/src/multiarray/methods.c29
-rw-r--r--numpy/core/src/multiarray/multiarray_tests.c.src139
-rw-r--r--numpy/core/src/multiarray/multiarraymodule.c390
-rw-r--r--numpy/core/src/multiarray/multiarraymodule_onefile.c1
-rw-r--r--numpy/core/src/multiarray/nditer_api.c59
-rw-r--r--numpy/core/src/multiarray/nditer_constr.c87
-rw-r--r--numpy/core/src/multiarray/nditer_pywrap.c34
-rw-r--r--numpy/core/src/multiarray/nditer_templ.c.src10
-rw-r--r--numpy/core/src/multiarray/number.c54
-rw-r--r--numpy/core/src/multiarray/number.h4
-rw-r--r--numpy/core/src/multiarray/numpymemoryview.c15
-rw-r--r--numpy/core/src/multiarray/refcount.c2
-rw-r--r--numpy/core/src/multiarray/scalarapi.c13
-rw-r--r--numpy/core/src/multiarray/scalartypes.c.src117
-rw-r--r--numpy/core/src/multiarray/sequence.c6
-rw-r--r--numpy/core/src/multiarray/shape.c8
-rw-r--r--numpy/core/src/npymath/ieee754.c.src11
-rw-r--r--numpy/core/src/npymath/npy_math.c.src66
-rw-r--r--numpy/core/src/npymath/npy_math_private.h3
-rw-r--r--numpy/core/src/npysort/binsearch.c.src240
-rw-r--r--numpy/core/src/npysort/selection.c.src25
-rw-r--r--numpy/core/src/private/lowlevel_strided_loops.h22
-rw-r--r--numpy/core/src/private/npy_binsearch.h.src140
-rw-r--r--numpy/core/src/private/npy_config.h11
-rw-r--r--numpy/core/src/private/npy_fpmath.h5
-rw-r--r--numpy/core/src/private/npy_partition.h.src37
-rw-r--r--numpy/core/src/private/ufunc_override.h232
-rw-r--r--numpy/core/src/umath/loops.c.src182
-rw-r--r--numpy/core/src/umath/loops.h2728
-rw-r--r--numpy/core/src/umath/loops.h.src39
-rw-r--r--numpy/core/src/umath/simd.inc.src191
-rw-r--r--numpy/core/src/umath/test_rational.c.src6
-rw-r--r--numpy/core/src/umath/ufunc_object.c211
-rw-r--r--numpy/core/src/umath/ufunc_type_resolution.c66
-rw-r--r--numpy/core/src/umath/ufunc_type_resolution.h7
-rw-r--r--numpy/core/src/umath/umathmodule.c129
-rw-r--r--numpy/core/tests/test_abc.py45
-rw-r--r--numpy/core/tests/test_api.py6
-rw-r--r--numpy/core/tests/test_datetime.py9
-rw-r--r--numpy/core/tests/test_defchararray.py8
-rw-r--r--numpy/core/tests/test_deprecations.py194
-rw-r--r--numpy/core/tests/test_dtype.py65
-rw-r--r--numpy/core/tests/test_einsum.py71
-rw-r--r--numpy/core/tests/test_function_base.py58
-rw-r--r--numpy/core/tests/test_indexing.py494
-rw-r--r--numpy/core/tests/test_item_selection.py5
-rw-r--r--numpy/core/tests/test_memmap.py11
-rw-r--r--numpy/core/tests/test_multiarray.py406
-rw-r--r--numpy/core/tests/test_nditer.py44
-rw-r--r--numpy/core/tests/test_numeric.py245
-rw-r--r--numpy/core/tests/test_numerictypes.py2
-rw-r--r--numpy/core/tests/test_regression.py112
-rw-r--r--numpy/core/tests/test_scalarinherit.py34
-rw-r--r--numpy/core/tests/test_scalarmath.py12
-rw-r--r--numpy/core/tests/test_shape_base.py2
-rw-r--r--numpy/core/tests/test_ufunc.py21
-rw-r--r--numpy/core/tests/test_umath.py210
-rw-r--r--numpy/distutils/command/config.py10
-rw-r--r--numpy/distutils/command/install.py9
-rw-r--r--numpy/distutils/exec_command.py2
-rw-r--r--numpy/distutils/fcompiler/gnu.py6
-rw-r--r--numpy/distutils/fcompiler/intel.py4
-rw-r--r--numpy/distutils/system_info.py66
-rw-r--r--numpy/doc/broadcasting.py6
-rw-r--r--numpy/doc/byteswapping.py8
-rw-r--r--numpy/doc/misc.py55
-rw-r--r--numpy/f2py/__init__.py26
-rw-r--r--numpy/f2py/cfuncs.py4
-rwxr-xr-xnumpy/f2py/f2py2e.py4
-rw-r--r--numpy/f2py/src/fortranobject.c16
-rw-r--r--numpy/f2py/src/fortranobject.h5
-rw-r--r--numpy/f2py/tests/test_array_from_pyobj.py82
-rw-r--r--numpy/f2py/tests/test_callback.py24
-rw-r--r--numpy/fft/fftpack.py31
-rw-r--r--numpy/fft/fftpack_litemodule.c24
-rw-r--r--numpy/fft/tests/test_fftpack.py48
-rw-r--r--numpy/lib/__init__.py1
-rw-r--r--numpy/lib/_version.py155
-rw-r--r--numpy/lib/arraysetops.py73
-rw-r--r--numpy/lib/bscript6
-rw-r--r--numpy/lib/financial.py20
-rw-r--r--numpy/lib/format.py175
-rw-r--r--numpy/lib/function_base.py474
-rw-r--r--numpy/lib/nanfunctions.py339
-rw-r--r--numpy/lib/npyio.py80
-rw-r--r--numpy/lib/polynomial.py10
-rw-r--r--numpy/lib/shape_base.py32
-rw-r--r--numpy/lib/src/_compiled_base.c148
-rw-r--r--numpy/lib/stride_tricks.py3
-rw-r--r--numpy/lib/tests/test__version.py57
-rw-r--r--numpy/lib/tests/test_arraysetops.py64
-rw-r--r--numpy/lib/tests/test_financial.py15
-rw-r--r--numpy/lib/tests/test_format.py84
-rw-r--r--numpy/lib/tests/test_function_base.py309
-rw-r--r--numpy/lib/tests/test_io.py111
-rw-r--r--numpy/lib/tests/test_nanfunctions.py266
-rw-r--r--numpy/lib/tests/test_stride_tricks.py17
-rw-r--r--numpy/lib/tests/test_twodim_base.py80
-rw-r--r--numpy/lib/tests/test_utils.py9
-rw-r--r--numpy/lib/twodim_base.py175
-rw-r--r--numpy/lib/utils.py7
-rw-r--r--numpy/linalg/lapack_lite/python_xerbla.c10
-rw-r--r--numpy/linalg/lapack_litemodule.c591
-rw-r--r--numpy/linalg/linalg.py9
-rw-r--r--numpy/linalg/tests/test_build.py10
-rw-r--r--numpy/linalg/tests/test_linalg.py10
-rw-r--r--numpy/linalg/tests/test_regression.py17
-rw-r--r--numpy/linalg/umath_linalg.c.src31
-rw-r--r--numpy/ma/core.py173
-rw-r--r--numpy/ma/extras.py96
-rw-r--r--numpy/ma/mrecords.py4
-rw-r--r--numpy/ma/tests/test_core.py145
-rw-r--r--numpy/ma/tests/test_extras.py26
-rw-r--r--numpy/ma/tests/test_old_ma.py14
-rw-r--r--numpy/ma/tests/test_subclassing.py43
-rw-r--r--numpy/matrixlib/tests/test_defmatrix.py4
-rw-r--r--numpy/polynomial/_polybase.py964
-rw-r--r--numpy/polynomial/chebyshev.py64
-rw-r--r--numpy/polynomial/hermite.py66
-rw-r--r--numpy/polynomial/hermite_e.py64
-rw-r--r--numpy/polynomial/laguerre.py64
-rw-r--r--numpy/polynomial/legendre.py64
-rw-r--r--numpy/polynomial/polynomial.py95
-rw-r--r--numpy/polynomial/polytemplate.py39
-rw-r--r--numpy/polynomial/polyutils.py57
-rw-r--r--numpy/polynomial/tests/test_classes.py76
-rw-r--r--numpy/random/__init__.py10
-rw-r--r--numpy/random/mtrand/distributions.c29
-rw-r--r--numpy/random/mtrand/initarray.h1
-rw-r--r--numpy/random/mtrand/mtrand.c26337
-rw-r--r--numpy/random/mtrand/mtrand.pyx933
-rw-r--r--numpy/random/mtrand/numpy.pxd10
-rw-r--r--numpy/random/tests/test_random.py161
-rw-r--r--numpy/testing/__init__.py1
-rw-r--r--numpy/testing/nosetester.py49
-rw-r--r--numpy/testing/numpytest.py36
-rw-r--r--numpy/testing/tests/test_utils.py76
-rw-r--r--numpy/testing/utils.py149
-rw-r--r--pavement.py29
-rwxr-xr-xsetup.py51
-rw-r--r--site.cfg.example15
-rw-r--r--tools/allocation_tracking/track_allocations.py10
-rwxr-xr-xtools/cythonize.py199
-rw-r--r--tools/swig/Makefile (renamed from doc/swig/Makefile)0
-rw-r--r--tools/swig/README (renamed from doc/swig/README)6
-rw-r--r--tools/swig/numpy.i (renamed from doc/swig/numpy.i)74
-rw-r--r--tools/swig/pyfragments.swg (renamed from doc/swig/pyfragments.swg)0
-rw-r--r--tools/swig/test/Array.i (renamed from doc/swig/test/Array.i)0
-rw-r--r--tools/swig/test/Array1.cxx (renamed from doc/swig/test/Array1.cxx)0
-rw-r--r--tools/swig/test/Array1.h (renamed from doc/swig/test/Array1.h)0
-rw-r--r--tools/swig/test/Array2.cxx (renamed from doc/swig/test/Array2.cxx)0
-rw-r--r--tools/swig/test/Array2.h (renamed from doc/swig/test/Array2.h)0
-rw-r--r--tools/swig/test/Farray.cxx (renamed from doc/swig/test/Farray.cxx)0
-rw-r--r--tools/swig/test/Farray.h (renamed from doc/swig/test/Farray.h)0
-rw-r--r--tools/swig/test/Farray.i (renamed from doc/swig/test/Farray.i)0
-rw-r--r--tools/swig/test/Fortran.cxx (renamed from doc/swig/test/Fortran.cxx)0
-rw-r--r--tools/swig/test/Fortran.h (renamed from doc/swig/test/Fortran.h)0
-rw-r--r--tools/swig/test/Fortran.i (renamed from doc/swig/test/Fortran.i)0
-rw-r--r--tools/swig/test/Makefile (renamed from doc/swig/test/Makefile)0
-rw-r--r--tools/swig/test/Matrix.cxx (renamed from doc/swig/test/Matrix.cxx)0
-rw-r--r--tools/swig/test/Matrix.h (renamed from doc/swig/test/Matrix.h)0
-rw-r--r--tools/swig/test/Matrix.i (renamed from doc/swig/test/Matrix.i)0
-rw-r--r--tools/swig/test/SuperTensor.cxx (renamed from doc/swig/test/SuperTensor.cxx)0
-rw-r--r--tools/swig/test/SuperTensor.h (renamed from doc/swig/test/SuperTensor.h)0
-rw-r--r--tools/swig/test/SuperTensor.i (renamed from doc/swig/test/SuperTensor.i)0
-rw-r--r--tools/swig/test/Tensor.cxx (renamed from doc/swig/test/Tensor.cxx)0
-rw-r--r--tools/swig/test/Tensor.h (renamed from doc/swig/test/Tensor.h)0
-rw-r--r--tools/swig/test/Tensor.i (renamed from doc/swig/test/Tensor.i)0
-rw-r--r--tools/swig/test/Vector.cxx (renamed from doc/swig/test/Vector.cxx)0
-rw-r--r--tools/swig/test/Vector.h (renamed from doc/swig/test/Vector.h)0
-rw-r--r--tools/swig/test/Vector.i (renamed from doc/swig/test/Vector.i)0
-rwxr-xr-xtools/swig/test/setup.py (renamed from doc/swig/test/setup.py)0
-rwxr-xr-xtools/swig/test/testArray.py (renamed from doc/swig/test/testArray.py)0
-rwxr-xr-xtools/swig/test/testFarray.py (renamed from doc/swig/test/testFarray.py)0
-rw-r--r--tools/swig/test/testFortran.py (renamed from doc/swig/test/testFortran.py)0
-rwxr-xr-xtools/swig/test/testMatrix.py (renamed from doc/swig/test/testMatrix.py)0
-rw-r--r--tools/swig/test/testSuperTensor.py (renamed from doc/swig/test/testSuperTensor.py)0
-rwxr-xr-xtools/swig/test/testTensor.py (renamed from doc/swig/test/testTensor.py)0
-rwxr-xr-xtools/swig/test/testVector.py (renamed from doc/swig/test/testVector.py)0
-rwxr-xr-xtools/travis-test.sh51
-rw-r--r--tools/win32build/README.txt2
-rw-r--r--tools/win32build/build-cpucaps.py15
365 files changed, 16201 insertions, 118325 deletions
diff --git a/.gitignore b/.gitignore
index a98742ffe..abba1fdc0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -112,11 +112,15 @@ numpy/core/src/multiarray/scalartypes.c
numpy/core/src/npymath/ieee754.c
numpy/core/src/npymath/npy_math.c
numpy/core/src/npymath/npy_math_complex.c
+numpy/core/src/npysort/binsearch.c
numpy/core/src/npysort/heapsort.c
numpy/core/src/npysort/mergesort.c
numpy/core/src/npysort/quicksort.c
numpy/core/src/npysort/selection.c
numpy/core/src/npysort/sort.c
+numpy/core/src/private/npy_binsearch.h
+numpy/core/src/private/npy_partition.h
+numpy/core/src/private/scalarmathmodule.h
numpy/core/src/scalarmathmodule.c
numpy/core/src/umath/funcs.inc
numpy/core/src/umath/loops.c
@@ -128,3 +132,6 @@ numpy/core/src/umath/umath_tests.c
numpy/distutils/__config__.py
numpy/linalg/umath_linalg.c
doc/source/reference/generated
+# cythonized files
+cythonize.dat
+numpy/random/mtrand/mtrand.c
diff --git a/.travis.yml b/.travis.yml
index cfff49b42..deabf611e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,6 +8,10 @@ python:
- 3.3
matrix:
include:
+ - python: 3.3
+ env: USE_CHROOT=1 ARCH=i386 DIST=trusty PYTHON=3.4
+ - python: 3.2
+ env: USE_DEBUG=1
- python: 2.7
env: NPY_SEPARATE_COMPILATION=0
- python: 3.3
@@ -19,7 +23,7 @@ matrix:
- python: 2.7
env: USE_BENTO=1
- python: 2.7
- env: USE_CHROOT=1 ARCH=i386 DIST=saucy
+ env: USE_WHEEL=1
before_install:
- uname -a
- free -m
@@ -30,6 +34,8 @@ before_install:
- pip install nose
# pip install coverage
- python -V
+ - pip install --upgrade pip setuptools
+ - pip install --find-links http://wheels.astropy.org/ --find-links http://wheels2.astropy.org/ --use-wheel Cython
- sudo apt-get install -qq libatlas-dev libatlas-base-dev gfortran
- popd
diff --git a/MANIFEST.in b/MANIFEST.in
index 322094980..5b0691b20 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -8,7 +8,6 @@ include COMPATIBILITY
include *.txt
include setupegg.py
include site.cfg.example
-include tools/py3tool.py
include numpy/random/mtrand/generate_mtrand_c.py
recursive-include numpy/random/mtrand *.pyx *.pxd
# Adding scons build related files not found by distutils
@@ -20,7 +19,8 @@ include doc/Makefile doc/postprocess.py
recursive-include doc/release *
recursive-include doc/source *
recursive-include doc/sphinxext *
-recursive-include doc/cython *
-recursive-include doc/pyrex *
-recursive-include doc/swig *
+recursive-include tools/swig *
recursive-include doc/scipy-sphinx-theme *
+recursive-include doc/f2py *
+
+global-exclude *.pyc *.pyo *.pyd
diff --git a/bscript b/bscript
index 12fc345b4..e5d1a89c5 100644
--- a/bscript
+++ b/bscript
@@ -61,6 +61,16 @@ def _register_metadata(context):
context.register_metadata("is_released", _SETUP_PY.ISRELEASED)
context.register_metadata("full_version", full_version)
+def _generate_cython():
+ print("Cythonizing sources")
+ cwd = os.path.abspath(os.path.dirname(__file__))
+ p = subprocess.call([sys.executable,
+ os.path.join(cwd, 'tools', 'cythonize.py'),
+ 'numpy'],
+ cwd=cwd)
+ if p != 0:
+ raise RuntimeError("Running cythonize failed!")
+
@hooks.post_configure
def post_configure(context):
conf = context.waf_context
@@ -76,6 +86,8 @@ def post_configure(context):
blas_lapack.check_blas_lapack(context)
+ _generate_cython()
+
@hooks.pre_build
def pre_build(context):
_register_metadata(context)
diff --git a/doc/HOWTO_RELEASE.rst.txt b/doc/HOWTO_RELEASE.rst.txt
index 9742d3a15..98e7aac8f 100644
--- a/doc/HOWTO_RELEASE.rst.txt
+++ b/doc/HOWTO_RELEASE.rst.txt
@@ -244,13 +244,42 @@ removed.
Check the C API version number
------------------------------
-The C API version number is recorded in core/code_generators/cversions.txt.
-Before every release this number should be updated by running
-core/code_generators/cversions.py, and main changes noted in a comment. If
-this is done correctly, compiling the release should not give a warning "API
-mismatch detected ..." at the beginning of the build.
-
-The C ABI version number should only be updated for a major release.
+The C API version needs to be tracked in three places
+
+- numpy/core/setup_common.py
+- numpy/core/code_generators/cversions.txt
+- numpy/core/include/numpy/numpyconfig.h
+
+There are three steps to the process.
+
+1. If the API has changed, increment the C_API_VERSION in setup_common.py. The
+ API is unchanged only if any code compiled against the current API will be
+ backward compatible with the last released NumPy version. Any changes to
+ C structures or additions to the public interface will make the new API
+ not backward compatible.
+
+2. If the C_API_VERSION in the first step has changed, or if the hash of
+ the API has changed, the cversions.txt file needs to be updated. To
+ check the hash, run the script numpy/core/cversions.py and note the api hash
+ that is printed. If that hash does not match the last hash in cversions.txt
+ the hash has changed. Using both the appropriate C_API_VERSION and hash,
+ add a new entry to cversions.txt. If the API version was not changed, but
+ the hash differs, you will need to comment out the previous entry for that
+ API version. For instance, in NumPy 1.9 annotations were added, which
+ changed the hash, but the API was the same as in 1.8. The hash serves as a
+ check for API changes, but it is not definitive.
+
+ If steps 1 and 2 are done correctly, compiling the release should not give
+ a warning "API mismatch detect at the beginning of the build.
+
+3. The numpy/core/include/numpy/numpyconfig.h will need a new
+ NPY_X_Y_API_VERSION macro, where X and Y are the major and minor version
+ numbers of the release. The value given to that macro only needs to be
+ increased from the previous version if some of the functions or macros in
+ the include files were deprecated.
+
+The C ABI version number in numpy/core/setup_common.py should only be
+updated for a major release.
Check the release notes
-----------------------
@@ -263,8 +292,8 @@ following:
- for SciPy, supported NumPy version(s)
- outlook for the near future
-Also make sure that as soon as the branch is made, there is a new release notes
-file in trunk for the next release.
+Also make sure that as soon as the branch is made, there is a new release
+notes file in trunk for the next release.
Update the release status and create a release "tag"
----------------------------------------------------
diff --git a/doc/cython/MANIFEST b/doc/cython/MANIFEST
deleted file mode 100644
index feb3ec22a..000000000
--- a/doc/cython/MANIFEST
+++ /dev/null
@@ -1,2 +0,0 @@
-numpyx.pyx
-setup.py
diff --git a/doc/cython/Makefile b/doc/cython/Makefile
deleted file mode 100644
index 7c9c72981..000000000
--- a/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/doc/cython/README.txt b/doc/cython/README.txt
deleted file mode 100644
index f527e358b..000000000
--- a/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).
diff --git a/doc/cython/c_numpy.pxd b/doc/cython/c_numpy.pxd
deleted file mode 100644
index e178b8e33..000000000
--- a/doc/cython/c_numpy.pxd
+++ /dev/null
@@ -1,137 +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
- cdef int flags
- 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/doc/cython/c_python.pxd b/doc/cython/c_python.pxd
deleted file mode 100644
index 46d2fd1a7..000000000
--- a/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/doc/cython/numpyx.pyx b/doc/cython/numpyx.pyx
deleted file mode 100644
index cbc786ef0..000000000
--- a/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/doc/cython/run_test.py b/doc/cython/run_test.py
deleted file mode 100755
index 5ffd7e80f..000000000
--- a/doc/cython/run_test.py
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env python
-from __future__ import division, absolute_import, print_function
-
-from numpyx import test
-test()
diff --git a/doc/cython/setup.py b/doc/cython/setup.py
deleted file mode 100755
index fe122d4db..000000000
--- a/doc/cython/setup.py
+++ /dev/null
@@ -1,51 +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 __future__ import division, print_function
-
-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/doc/f2py/f2py.1 b/doc/f2py/f2py.1
index 279647424..7f51ea29d 100644
--- a/doc/f2py/f2py.1
+++ b/doc/f2py/f2py.1
@@ -53,7 +53,7 @@ Do [not] lower the cases in <fortran files>. By default, \-\-lower is
assumed with \-h key, and \-\-no\-lower without \-h key.
.TP
.B \-\-build\-dir <dirname>
-All f2py generated files are created in <dirname>. Default is tempfile.mktemp().
+All f2py generated files are created in <dirname>. Default is tempfile.mkdtemp().
.TP
.B \-\-overwrite\-signature
Overwrite existing signature file.
diff --git a/doc/neps/deferred-ufunc-evaluation.rst b/doc/neps/deferred-ufunc-evaluation.rst
index 634a1f238..b00c0dd2d 100644
--- a/doc/neps/deferred-ufunc-evaluation.rst
+++ b/doc/neps/deferred-ufunc-evaluation.rst
@@ -1,4 +1,7 @@
-:Title: Deferred UFunc Evaluation
+=========================
+Deferred UFunc Evaluation
+=========================
+
:Author: Mark Wiebe <mwwiebe@gmail.com>
:Content-Type: text/x-rst
:Created: 30-Nov-2010
diff --git a/doc/neps/math_config_clean.txt b/doc/neps/math_config_clean.rst
index 26511d7bf..26511d7bf 100644
--- a/doc/neps/math_config_clean.txt
+++ b/doc/neps/math_config_clean.rst
diff --git a/doc/neps/missing-data.rst b/doc/neps/missing-data.rst
index 0d03d7774..f561a88b8 100644
--- a/doc/neps/missing-data.rst
+++ b/doc/neps/missing-data.rst
@@ -1,4 +1,7 @@
-:Title: Missing Data Functionality in NumPy
+===================================
+Missing Data Functionality in NumPy
+===================================
+
:Author: Mark Wiebe <mwwiebe@gmail.com>
:Copyright: Copyright 2011 by Enthought, Inc
:License: CC By-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/)
diff --git a/doc/neps/new-iterator-ufunc.rst b/doc/neps/new-iterator-ufunc.rst
index b253e874b..6d132f9a5 100644
--- a/doc/neps/new-iterator-ufunc.rst
+++ b/doc/neps/new-iterator-ufunc.rst
@@ -1,4 +1,7 @@
-:Title: Optimizing Iterator/UFunc Performance
+=====================================
+Optimizing Iterator/UFunc Performance
+=====================================
+
:Author: Mark Wiebe <mwwiebe@gmail.com>
:Content-Type: text/x-rst
:Created: 25-Nov-2010
diff --git a/doc/neps/newbugtracker.rst b/doc/neps/newbugtracker.rst
index 8bee7ad13..f4b029b47 100644
--- a/doc/neps/newbugtracker.rst
+++ b/doc/neps/newbugtracker.rst
@@ -1,3 +1,9 @@
+===========================================
+Replacing Trac with a different bug tracker
+===========================================
+
+:Author: David Cournapeau, Stefan van der Walt
+
Some release managers of both numpy and scipy are becoming more and more
disatisfied with the current development workflow, in particular for bug
tracking. This document is a tentative to explain some problematic scenario,
diff --git a/doc/neps/npy-format.rst b/doc/neps/npy-format.rst
new file mode 100644
index 000000000..f7bb799f2
--- /dev/null
+++ b/doc/neps/npy-format.rst
@@ -0,0 +1,292 @@
+=====================================
+A Simple File Format for NumPy Arrays
+=====================================
+
+Author: Robert Kern <robert.kern@gmail.com>
+Status: Draft
+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 to 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 included in the 1.0.5 release of numpy.
+
+ http://github.com/numpy/numpy/blob/v1.5.0/numpy/lib/format.py
+
+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.
+
diff --git a/doc/neps/npy-format.txt b/doc/neps/npy-format.txt
deleted file mode 100644
index 98a0c1aaf..000000000
--- a/doc/neps/npy-format.txt
+++ /dev/null
@@ -1,293 +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 to 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 included in the 1.0.5 release of numpy.
-
- http://github.com/numpy/numpy/blob/v1.5.0/numpy/lib/format.py
-
- 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/doc/neps/pep_buffer.txt b/doc/neps/pep_buffer.txt
deleted file mode 100644
index a154d2792..000000000
--- a/doc/neps/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/doc/neps/structured_array_extensions.txt b/doc/neps/structured_array_extensions.rst
index 716b98a76..a4248362c 100644
--- a/doc/neps/structured_array_extensions.txt
+++ b/doc/neps/structured_array_extensions.rst
@@ -1,3 +1,6 @@
+===========================
+Structured array extensions
+===========================
1. Create with-style context that makes "named-columns" available as names in the namespace.
diff --git a/doc/neps/warnfix.txt b/doc/neps/warnfix.rst
index b6f307bcb..93ef26488 100644
--- a/doc/neps/warnfix.txt
+++ b/doc/neps/warnfix.rst
@@ -1,7 +1,6 @@
-===========================================================
-A proposal to build numpy without warning with a big set of
-warning flags
-===========================================================
+=========================================================================
+A proposal to build numpy without warning with a big set of warning flags
+=========================================================================
:Author: David Cournapeau
:Contact: david@ar.media.kyoto-u.ac.jp
@@ -12,7 +11,7 @@ Executive summary
When building numpy and scipy, we are limited to a quite restricted set of
warning compilers, thus missing a large class of potential bugs which could be
-detected with stronger warning flags. The goal of this PEP is present the
+detected with stronger warning flags. The goal of this NEP is present the
various methods used to clean the code and implement some policy to make numpy
buildable with a bigger set of warning flags, while keeping the build warnings
free.
diff --git a/doc/numpybook/Figures/contiguous.eps b/doc/numpybook/Figures/contiguous.eps
deleted file mode 100644
index 006babe7a..000000000
--- a/doc/numpybook/Figures/contiguous.eps
+++ /dev/null
@@ -1,374 +0,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Title: contiguous.fig
-%%Creator: fig2dev Version 3.2 Patchlevel 4
-%%CreationDate: Thu Aug 18 12:08:29 2005
-%%For: oliphant@oliphant (Travis Oliphant)
-%%BoundingBox: 0 0 434 215
-%%Magnification: 1.0000
-%%EndComments
-/$F2psDict 200 dict def
-$F2psDict begin
-$F2psDict /mtrx matrix put
-/col-1 {0 setgray} bind def
-/col0 {0.000 0.000 0.000 srgb} bind def
-/col1 {0.000 0.000 1.000 srgb} bind def
-/col2 {0.000 1.000 0.000 srgb} bind def
-/col3 {0.000 1.000 1.000 srgb} bind def
-/col4 {1.000 0.000 0.000 srgb} bind def
-/col5 {1.000 0.000 1.000 srgb} bind def
-/col6 {1.000 1.000 0.000 srgb} bind def
-/col7 {1.000 1.000 1.000 srgb} bind def
-/col8 {0.000 0.000 0.560 srgb} bind def
-/col9 {0.000 0.000 0.690 srgb} bind def
-/col10 {0.000 0.000 0.820 srgb} bind def
-/col11 {0.530 0.810 1.000 srgb} bind def
-/col12 {0.000 0.560 0.000 srgb} bind def
-/col13 {0.000 0.690 0.000 srgb} bind def
-/col14 {0.000 0.820 0.000 srgb} bind def
-/col15 {0.000 0.560 0.560 srgb} bind def
-/col16 {0.000 0.690 0.690 srgb} bind def
-/col17 {0.000 0.820 0.820 srgb} bind def
-/col18 {0.560 0.000 0.000 srgb} bind def
-/col19 {0.690 0.000 0.000 srgb} bind def
-/col20 {0.820 0.000 0.000 srgb} bind def
-/col21 {0.560 0.000 0.560 srgb} bind def
-/col22 {0.690 0.000 0.690 srgb} bind def
-/col23 {0.820 0.000 0.820 srgb} bind def
-/col24 {0.500 0.190 0.000 srgb} bind def
-/col25 {0.630 0.250 0.000 srgb} bind def
-/col26 {0.750 0.380 0.000 srgb} bind def
-/col27 {1.000 0.500 0.500 srgb} bind def
-/col28 {1.000 0.630 0.630 srgb} bind def
-/col29 {1.000 0.750 0.750 srgb} bind def
-/col30 {1.000 0.880 0.880 srgb} bind def
-/col31 {1.000 0.840 0.000 srgb} bind def
-
-end
-save
-newpath 0 215 moveto 0 0 lineto 434 0 lineto 434 215 lineto closepath clip newpath
--197.3 306.7 translate
-1 -1 scale
-
-/cp {closepath} bind def
-/ef {eofill} bind def
-/gr {grestore} bind def
-/gs {gsave} bind def
-/sa {save} bind def
-/rs {restore} bind def
-/l {lineto} bind def
-/m {moveto} bind def
-/rm {rmoveto} bind def
-/n {newpath} bind def
-/s {stroke} bind def
-/sh {show} bind def
-/slc {setlinecap} bind def
-/slj {setlinejoin} bind def
-/slw {setlinewidth} bind def
-/srgb {setrgbcolor} bind def
-/rot {rotate} bind def
-/sc {scale} bind def
-/sd {setdash} bind def
-/ff {findfont} bind def
-/sf {setfont} bind def
-/scf {scalefont} bind def
-/sw {stringwidth} bind def
-/tr {translate} bind def
-/tnt {dup dup currentrgbcolor
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
- bind def
-/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
- 4 -2 roll mul srgb} bind def
-/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
-/$F2psEnd {$F2psEnteredState restore end} def
-
-$F2psBegin
-10 setmiterlimit
-0 slj 0 slc
- 0.06000 0.06000 sc
-%
-% Fig objects follow
-%
-%
-% here starts figure with depth 50
-% Polyline
-30.000 slw
-n 5700 1575 m 6900 1575 l 6900 2175 l 5700 2175 l
- cp gs col0 s gr
-% Polyline
-n 7500 1575 m 8700 1575 l 8700 2175 l 7500 2175 l
- cp gs col0 s gr
-% Polyline
-7.500 slw
-n 3300 1575 m 10500 1575 l 10500 2175 l 3300 2175 l
- cp gs col0 s gr
-% Polyline
-n 3900 1575 m
- 3900 2175 l gs col0 s gr
-% Polyline
-n 4500 1575 m
- 4500 2175 l gs col0 s gr
-% Polyline
-n 5100 1575 m
- 5100 2175 l gs col0 s gr
-% Polyline
-n 5700 1575 m
- 5700 2175 l gs col0 s gr
-% Polyline
-n 6300 1575 m
- 6300 2175 l gs col0 s gr
-% Polyline
-n 6900 1575 m
- 6900 2175 l gs col0 s gr
-% Polyline
-n 7500 1575 m
- 7500 2175 l gs col0 s gr
-% Polyline
-n 8100 1575 m
- 8100 2175 l gs col0 s gr
-% Polyline
-n 8700 1575 m
- 8700 2175 l gs col0 s gr
-% Polyline
-n 9300 1575 m
- 9300 2175 l gs col0 s gr
-% Polyline
-n 9900 1575 m
- 9900 2175 l gs col0 s gr
-/Helvetica-Bold ff 180.00 scf sf
-10125 1950 m
-gs 1 -1 sc (11) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-9525 1950 m
-gs 1 -1 sc (10) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-9000 1950 m
-gs 1 -1 sc (9) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8400 1950 m
-gs 1 -1 sc (8) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-7800 1950 m
-gs 1 -1 sc (7) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-7200 1950 m
-gs 1 -1 sc (6) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-6600 1950 m
-gs 1 -1 sc (5) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-6000 1950 m
-gs 1 -1 sc (4) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-5400 1950 m
-gs 1 -1 sc (3) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4800 1950 m
-gs 1 -1 sc (2) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4200 1950 m
-gs 1 -1 sc (1) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-3600 1950 m
-gs 1 -1 sc (0) col0 sh gr
-% Polyline
-30.000 slw
-n 4200 3300 m 5400 3300 l 5400 4500 l 4200 4500 l
- cp gs col0 s gr
-% Polyline
-7.500 slw
-n 4200 2700 m
- 4200 5100 l gs col0 s gr
-% Polyline
-n 4800 2700 m
- 4800 5100 l gs col0 s gr
-% Polyline
-n 3600 3300 m
- 5400 3300 l gs col0 s gr
-% Polyline
-n 3600 3900 m
- 5400 3900 l gs col0 s gr
-% Polyline
-n 3600 2700 m 5400 2700 l 5400 5100 l 3600 5100 l
- cp gs col0 s gr
-% Polyline
-n 3600 4500 m
- 5400 4500 l gs col0 s gr
-/Helvetica-Bold ff 240.00 scf sf
-5625 3975 m
-gs 1 -1 sc (C) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-5175 4725 m
-gs 1 -1 sc (11) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4575 4725 m
-gs 1 -1 sc (10) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4050 4725 m
-gs 1 -1 sc (9) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-5250 4125 m
-gs 1 -1 sc (8) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4650 4125 m
-gs 1 -1 sc (7) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4050 4125 m
-gs 1 -1 sc (6) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-5250 3525 m
-gs 1 -1 sc (5) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4650 3525 m
-gs 1 -1 sc (4) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4050 3525 m
-gs 1 -1 sc (3) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-5250 2925 m
-gs 1 -1 sc (2) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4650 2925 m
-gs 1 -1 sc (1) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4050 2925 m
-gs 1 -1 sc (0) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-3675 3225 m
-gs 1 -1 sc (\(0,0\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4875 3225 m
-gs 1 -1 sc (\(0,2\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-3675 3825 m
-gs 1 -1 sc (\(1,0\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4875 3825 m
-gs 1 -1 sc (\(1,2\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4275 3825 m
-gs 1 -1 sc (\(1,1\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4875 4425 m
-gs 1 -1 sc (\(2,2\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4875 5025 m
-gs 1 -1 sc (\(3,2\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4275 3225 m
-gs 1 -1 sc (\(0,1\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-3675 4425 m
-gs 1 -1 sc (\(2,0\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-3675 5025 m
-gs 1 -1 sc (\(3,0\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4275 4425 m
-gs 1 -1 sc (\(2,1\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-4275 5025 m
-gs 1 -1 sc (\(3,1\)) col0 sh gr
-% Polyline
-30.000 slw
-n 7650 3375 m 8850 3375 l 8850 4575 l 7650 4575 l
- cp gs col0 s gr
-% Polyline
-7.500 slw
-n 7050 3975 m
- 9450 3975 l gs col0 s gr
-% Polyline
-n 7050 3375 m
- 9450 3375 l gs col0 s gr
-% Polyline
-n 7650 4575 m
- 7650 2775 l gs col0 s gr
-% Polyline
-n 8250 4575 m
- 8250 2775 l gs col0 s gr
-% Polyline
-n 8850 4575 m
- 8850 2775 l gs col0 s gr
-% Polyline
-n 7050 4575 m 7050 2775 l 9450 2775 l 9450 4575 l
- cp gs col0 s gr
-/Helvetica-Bold ff 240.00 scf sf
-9600 3750 m
-gs 1 -1 sc (Fortran) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-9225 4200 m
-gs 1 -1 sc (11) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-9225 3600 m
-gs 1 -1 sc (10) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-9300 3000 m
-gs 1 -1 sc (9) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8625 4200 m
-gs 1 -1 sc (8) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8625 3600 m
-gs 1 -1 sc (7) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8625 3000 m
-gs 1 -1 sc (6) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8100 4200 m
-gs 1 -1 sc (5) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8100 3600 m
-gs 1 -1 sc (4) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8100 3000 m
-gs 1 -1 sc (3) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-7500 4200 m
-gs 1 -1 sc (2) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-7500 3600 m
-gs 1 -1 sc (1) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-7500 3000 m
-gs 1 -1 sc (0) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-7125 3300 m
-gs 1 -1 sc (\(0,0\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-7725 3300 m
-gs 1 -1 sc (\(0,1\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8325 3300 m
-gs 1 -1 sc (\(0,2\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-7125 3900 m
-gs 1 -1 sc (\(1,0\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-7725 3900 m
-gs 1 -1 sc (\(1,1\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8325 3900 m
-gs 1 -1 sc (\(1,2\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-7125 4500 m
-gs 1 -1 sc (\(2,0\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-7725 4500 m
-gs 1 -1 sc (\(2,1\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8325 4500 m
-gs 1 -1 sc (\(2,2\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8925 3900 m
-gs 1 -1 sc (\(1,3\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8925 4500 m
-gs 1 -1 sc (\(2,3\)) col0 sh gr
-/Helvetica-Bold ff 180.00 scf sf
-8925 3300 m
-gs 1 -1 sc (\(0,3\)) col0 sh gr
-% here ends figure;
-$F2psEnd
-rs
-showpage
diff --git a/doc/numpybook/Figures/contiguous.fig b/doc/numpybook/Figures/contiguous.fig
deleted file mode 100644
index c2416dafa..000000000
--- a/doc/numpybook/Figures/contiguous.fig
+++ /dev/null
@@ -1,133 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter
-100.00
-Single
--2
-1200 2
-6 3300 1500 10500 2250
-2 2 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 5700 1575 6900 1575 6900 2175 5700 2175 5700 1575
-2 2 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 7500 1575 8700 1575 8700 2175 7500 2175 7500 1575
-2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 3300 1575 10500 1575 10500 2175 3300 2175 3300 1575
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 3900 1575 3900 2175
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 4500 1575 4500 2175
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 5100 1575 5100 2175
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 5700 1575 5700 2175
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 6300 1575 6300 2175
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 6900 1575 6900 2175
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 7500 1575 7500 2175
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 8100 1575 8100 2175
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 8700 1575 8700 2175
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 9300 1575 9300 2175
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 9900 1575 9900 2175
-4 0 0 50 -1 18 12 0.0000 4 135 210 10125 1950 11\001
-4 0 0 50 -1 18 12 0.0000 4 135 210 9525 1950 10\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 9000 1950 9\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 8400 1950 8\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 7800 1950 7\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 7200 1950 6\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 6600 1950 5\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 6000 1950 4\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 5400 1950 3\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 4800 1950 2\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 4200 1950 1\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 3600 1950 0\001
--6
-6 3600 2700 5850 5100
-2 2 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 4200 3300 5400 3300 5400 4500 4200 4500 4200 3300
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 4200 2700 4200 5100
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 4800 2700 4800 5100
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 3600 3300 5400 3300
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 3600 3900 5400 3900
-2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 3600 2700 5400 2700 5400 5100 3600 5100 3600 2700
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 3600 4500 5400 4500
-4 0 0 50 -1 18 16 0.0000 4 180 180 5625 3975 C\001
-4 0 0 50 -1 18 12 0.0000 4 135 210 5175 4725 11\001
-4 0 0 50 -1 18 12 0.0000 4 135 210 4575 4725 10\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 4050 4725 9\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 5250 4125 8\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 4650 4125 7\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 4050 4125 6\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 5250 3525 5\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 4650 3525 4\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 4050 3525 3\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 5250 2925 2\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 4650 2925 1\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 4050 2925 0\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 3675 3225 (0,0)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 4875 3225 (0,2)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 3675 3825 (1,0)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 4875 3825 (1,2)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 4275 3825 (1,1)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 4875 4425 (2,2)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 4875 5025 (3,2)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 4275 3225 (0,1)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 3675 4425 (2,0)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 3675 5025 (3,0)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 4275 4425 (2,1)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 4275 5025 (3,1)\001
--6
-6 7050 2775 10500 4650
-2 2 0 3 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 7650 3375 8850 3375 8850 4575 7650 4575 7650 3375
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 7050 3975 9450 3975
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 7050 3375 9450 3375
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 7650 4575 7650 2775
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 8250 4575 8250 2775
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 8850 4575 8850 2775
-2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 7050 4575 7050 2775 9450 2775 9450 4575 7050 4575
-4 0 0 50 -1 18 16 0.0000 4 180 840 9600 3750 Fortran\001
-4 0 0 50 -1 18 12 0.0000 4 135 210 9225 4200 11\001
-4 0 0 50 -1 18 12 0.0000 4 135 210 9225 3600 10\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 9300 3000 9\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 8625 4200 8\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 8625 3600 7\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 8625 3000 6\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 8100 4200 5\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 8100 3600 4\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 8100 3000 3\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 7500 4200 2\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 7500 3600 1\001
-4 0 0 50 -1 18 12 0.0000 4 135 105 7500 3000 0\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 7125 3300 (0,0)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 7725 3300 (0,1)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 8325 3300 (0,2)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 7125 3900 (1,0)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 7725 3900 (1,1)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 8325 3900 (1,2)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 7125 4500 (2,0)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 7725 4500 (2,1)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 8325 4500 (2,2)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 8925 3900 (1,3)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 8925 4500 (2,3)\001
-4 0 0 50 -1 18 12 0.0000 4 180 450 8925 3300 (0,3)\001
--6
diff --git a/doc/numpybook/Figures/contiguous.pdf b/doc/numpybook/Figures/contiguous.pdf
deleted file mode 100644
index 3e3a55e64..000000000
--- a/doc/numpybook/Figures/contiguous.pdf
+++ /dev/null
Binary files differ
diff --git a/doc/numpybook/Figures/fig1.eps b/doc/numpybook/Figures/fig1.eps
deleted file mode 100644
index 6b77676c8..000000000
--- a/doc/numpybook/Figures/fig1.eps
+++ /dev/null
@@ -1,4577 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Title: fig1.eps
-%%Creator: matplotlib version 0.85.1.cvs, http://matplotlib.sourceforge.net/
-%%CreationDate: Fri Jan 6 00:09:47 2006
-%%BoundingBox: 13 175 598 616
-%%EndComments
-%%BeginProlog
-/mpldict 7 dict def
-mpldict begin
-/m { moveto } bind def
-/l { lineto } bind def
-/r { rlineto } bind def
-/box {
-m
-1 index 0 r
-0 exch r
-neg 0 r
-closepath
-} bind def
-/clipbox {
-box
-clip
-newpath
-} bind def
-/ellipse {
-newpath
-matrix currentmatrix 7 1 roll
-translate
-scale
-0 0 1 5 3 roll arc
-setmatrix
-closepath
-} bind def
-%%BeginFont: Verdana
-%!PS-TrueType-1.0-1.0
-8 dict begin
-/FontName /Verdana def
-/FontMatrix [1 0 0 1 0 0] def
-/FontType 42 def
-/Encoding StandardEncoding def
-/FontBBox [-102 -423 2963 2049] def
-/PaintType 0 def
-/FontInfo 7 dict dup begin
-/Notice (Typeface and data © 1996 Microsoft Corporation. All Rights Reserved) def
-/FamilyName (Verdana) def
-/FullName (Verdana) def
-/version (Version 2.35) def
-/isFixedPitch false def
-/UnderlinePosition -180 def
-/UnderlineThickness 120 def
-end readonly def
-/sfnts [
-<00010000001301000004003044534947CD5006A400020D64000014144C5453485694D82F
-00001530000003814F532F32477590C3000001B80000005656444D5874F17C6D000018B4
-000005E0636D6170E84D8B8B000007A80000068C637674204CA740E3000022AC00000198
-6670676DEE371553000021740000013867617370001700090000021000000010676C7966
-01F195F700009EC000013BB668646D7809490ECD0000323800006C8868656164C748722C
-0000013C0000003668686561133B09D00000017400000024686D7478C905723E00002444
-00000DF46B65726E75BF7E53000200CC00000C966C6F63616784B57700000E34000006FC
-6D617870086A023E00000198000000206E616D65A93B95720000022000000587706F7374
-C58F55450001DA7800002651707265701240C02F00001E94000002E00001000000010000
-16FBFC3A5F0F3CF5001B080000000000AA7E442900000000B26DE2ABFF9AFE590B930801
-00000009000200000000000000010000080BFE5200000C2CFF9AFBD40B93000100000000
-00000000000000000000037D00010000037D00620007006B000500020010002F00380000
-0495013F0003000100010411019000050000059A053300000125059A0533000003A00078
-02A70800020B0604030504040204000002870000000000000000000000004D5320200040
-0020FB02061EFE5900CA080B01AE2000019F000000000000000000030008000200100001
-FFFF00030000002801E60001000000000000004300000001000000000001000700430001
-0000000000020007004A0001000000000003002F00510001000000000004000700800001
-000000000005000C00870001000000000006000700930001000000000007002F009A0003
-000104030002000C00C90003000104050002001000D50003000104060002000C00E50003
-000104070002001000F10003000104080002001001010003000104090000008601110003
-000104090001000E01970003000104090002000E01A50003000104090003005E01B30003
-000104090004000E021100030001040900050018021F0003000104090006000E02370003
-000104090007005E024500030001040A0002000C02A300030001040B0002001002AF0003
-0001040C0002000C02BF00030001040E0002000C02CB0003000104100002000E02D70003
-000104130002001202E50003000104140002000C02F70003000104150002001003030003
-000104160002000C03130003000104190002000E031F00030001041B00020010032D0003
-0001041D0002000C033D00030001041F0002000C03490003000104240002000E03550003
-0001042D0002000E036300030001080A0002000C03710003000108160002000C037D0003
-00010C0A0002000C0389000300010C0C0002000C0395547970656661636520616E642064
-61746120A92031393936204D6963726F736F667420436F72706F726174696F6E2E20416C
-6C2052696768747320526573657276656456657264616E61526567756C61724D6963726F
-736F66743A56657264616E6120526567756C61723A56657273696F6E203120284D696372
-6F736F66742956657264616E6156657273696F6E20322E333556657264616E6156657264
-616E6120697320612074726164656D61726B206F66204D6963726F736F667420436F7270
-6F726174696F6E004E006F0072006D0061006C006F00620079010D0065006A006E00E900
-6E006F0072006D0061006C005300740061006E0064006100720064039A03B103BD03BF03
-BD03B903BA03AC0054007900700065006600610063006500200061006E00640020006400
-6100740061002000A9002000310039003900360020004D006900630072006F0073006F00
-66007400200043006F00720070006F0072006100740069006F006E002E00200041006C00
-6C0020005200690067006800740073002000520065007300650072007600650064005600
-65007200640061006E00610052006500670075006C00610072004D006900630072006F00
-73006F00660074003A00560065007200640061006E006100200052006500670075006C00
-610072003A00560065007200730069006F006E0020003100200028004D00690063007200
-6F0073006F00660074002900560065007200640061006E00610056006500720073006900
-6F006E00200032002E0033003500560065007200640061006E0061005600650072006400
-61006E006100200069007300200061002000740072006100640065006D00610072006B00
-20006F00660020004D006900630072006F0073006F0066007400200043006F0072007000
-6F0072006100740069006F006E004E006F0072006D0061006C004E006F0072006D006100
-61006C0069004E006F0072006D0061006C004E006F0072006D00E1006C004E006F007200
-6D0061006C0065005300740061006E00640061006100720064004E006F0072006D006100
-6C004E006F0072006D0061006C006E0079004E006F0072006D0061006C041E0431044B04
-47043D044B0439004E006F0072006D00E1006C006E0065004E006F0072006D0061006C00
-4E006F0072006D0061006C004E0061007600610064006E006F0041007200720075006E00
-740061004E006F0072006D0061006C004E006F0072006D0061006C004E006F0072006D00
-61006C004E006F0072006D0061006C00000000020001000000000014000300010000011A
-000001060000010000000000000001020000000200000000000000000000000000000001
-0000030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324
-25262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60610062636465666768696A6B
-6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F
-909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAAB03ACADAEAFB0B1B2
-B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD000D1D2D3D4D5
-D6D7D8D9DADBDCDDDEDF0004057200000084008000060004007E017F019201A101B001FF
-02C702C902DD0301030303090323037E038A038C03A103CE040C044F045C045F04911E85
-1EF92015201E2022202620302033203A203C203E2044207F20A420A720AC210521132116
-21222126212E215E22022206220F22122215221A221E222B22482260226525A125AB25CA
-25CF25E6F002F00DFB02FFFF0000002000A0019201A001AF01FA02C602C902D803000303
-03090323037E0384038C038E03A30401040E0451045E04901E801EA02013201720202026
-203020322039203C203E2044207F20A320A720AB21052113211621222126212E215B2202
-2206220F221122152219221E222B22482260226425A125AA25CA25CF25E6F001F004FB01
-FFFFFFE30000FF1400A60099FF8A0000FE0F0000FF4C0078FF41FF28FCA00000FE170000
-0000FDD9FDD8FDD7FDD6FDA6E30B0000000000000000E085E095E109E084E0F9E156E077
-E0B70000E0900000E038E02BE123DF6ADF79E068E03CDE96DEA2DE8B0000DEA60000DE74
-DE71DE5FDE2FDE30DB9EDB96DAEEDB73DB5D10BE000005BE000100000082000000000000
-000002380000023800000000000000000000023800000242026800000000000000000000
-000002B203640368037600000000000000000000000000000000036A0000036A00000000
-000000000000000000000000000000000358000003580000000000000000000000000000
-0000000000000000034400000000000300A300840085037C009600E60086008E008B009D
-00A900A40010008A01000083009300F000F1008D00970088010100DC00EF009E00AA00F3
-00F200F400A200AC00C800C600AD006200630090006400CA006500C700C900CE00CB00CC
-00CD00E7006600D100CF00D000AE006700EE009100D400D200D3006800E900EB0089006A
-0069006B006D006C006E00A0006F0071007000720073007500740076007700E80078007A
-0079007B007D007C00B700A1007F007E0080008100EA00EC00B901440145010201030104
-010500FB00FC014601470148014900FD00FE01060107010800FF014A014B014C014D014E
-014F0109010A010B010C0150015100F600F701520153015401550156015701580159015A
-015B015C015D015E015F0160016100F800D50138013901620163016401650166010D010E
-01670168010F01100111011200E000E1011301140169016A01150116013A016B016C016D
-016E016F01700117011800AF00B00119011A01710172011B011C011D011E0173017400F9
-00FA00E200E3011F01200121012201750176017701780179017A017B017C012301240125
-0126017D017E017F01800181018200BA012701280129012A00E400E5018300D600DF00D9
-00DA00DB00DE00D700DD019D019E019F018A01A001A101A201A401A501A601A701A8012B
-01A901AA01AB01AC012C01AD01AE01AF01B001B101B201B301B401B501B601B701B8012D
-01B901BA01BB01BC01BD01BE01BF01C001C101C2012E01C301C4012F013001C501C601C7
-01C801C901CA01CB01CC01CD01CE023A01CF01D00131013201D1013301D201D301D401D5
-01D601D701D801D9025D025E025F0260026102620263026402650266026702680269026A
-026B026C026D026E026F0270027102720273027402750276027702780279027A027B027C
-027D027E027F028002810282028302840285028602870288034C034D034E034F03500351
-03520353035403550356035703580359035A035B035C035D035E035F0360036103620363
-036403650366036703680369036A036B036C036D036E036F037003710191019203740375
-037603770378037900B100B20238013400B500B600C3019300B300B400C4008200C10087
-00F50195037A00BC009900ED00C200A5019B019C023B023C023D023E023F024002410242
-0000001F001F001F001F00470070010401C0025F033C035503A203F10461049604C004DE
-04F50520057F05B9063806DB072D07A70830086B090B099309B509F10A350A640AAA0B13
-0BF80C600CDC0D4F0DA00DD60E060E7A0EAE0EDB0F180F860FA61000104C10B8111711AE
-122012B812DF132C13881407148814DF15221544156F159015C815DE15FE168916E71747
-17A01803184F18D11912193D198C19E51A001A761AB61B011B5D1BB81BF51C8B1CDB1D1B
-1D741DD91E641EC21F041F631F7E1FDC203B205520FE21AA21BD21D021E9220222142226
-2238225322652278230A231C232E234023562369237C23B423EE2400241224242436244C
-245E24702482249424AB24E62520259A260826EB270B274327C928832929297B299C29C2
-2A2D2A912B412BCD2C0D2C5A2CA82D0C2D4C2DCB2E3D2E722E9F2EE92F5E2F9F301130E7
-316D31D831FF3223326032DF336433A233F33443346D3480349334A6350E35AD35C735DD
-361C365B368036A736E33728373F37593777382D3858388438E139313986399E39C43A03
-3AD73AEA3AFD3B103B243B373B4A3B5D3B773B8A3B9D3BB03BC33BD63BE93BFC3C173C47
-3C8E3CA63CEC3D003D493D7D3DB53DEA3E1B3E5B3E923EA53EB73ECA3EDC3F043F6B3FFF
-40124024408840E441014135416941BB4239425A427E42AA42F643024314432743F044AF
-44C244D444E744F9456F4586459E45B145C3465F47144727479D47A54806489348A648B8
-48CB48F0492B4961499249BC49CF49E149F44A064A1A4A2D4A404A534A664A794A8C4A9E
-4AEE4B6C4B7F4BEC4C354C484C5C4C6F4C824C954CA84CBA4CDA4D584DDD4E3C4EC24F58
-4FB24FE1505D5081509D50E951DF51EF52085268528B52CA538353FD5425543F54665491
-54EA54FC550D551F55345546555B556D557E559055A455B655C755D955EE5600561556B8
-575B576D578757DE583458A458FC593F596C59C05A035A595AB15AC85B225B335B495BA2
-5BEB5C305C465C5C5CD25D2E5D405D515D635D745D855DEA5DFC5E105E4E5EBA5ECC5EDD
-5EEF5F005F125F235FA2600E6020603260446055608561656246625C626E6285629A62B1
-62C362D562E762F963166332634963606388639E6422648E64AA64D76504653065556589
-65A265DD65F36611662F664F666E668E66B16700670867106752675A6762676A6772677A
-67C367CB67D36812681A6840684868DA68E268EA68F2695D69DC69F66A106A216A376A48
-6A5B6A6F6AFD6B4A6BBD6BFF6C866C8E6D226D7A6DC16DC96E726E7A6ECF6F3B6F7A6FEA
-705A70F370FB7112712371347146715A71C571DD7255725D7265727F7287731C738773DE
-73F3749074C174C97521752975497594759C765676F2773A77AE783B7892789A78A278AA
-78D078D878E078E8795979DE79E67A167A5D7A907ACD7B297B907BE47C5F7CCD7D367D3E
-7DCA7E4C7E6C7EBC7EC47F7D8015804D80B18126817B81D38203820B82308238829A82C9
-82D1836C837483AC83EF8425846784C3852B858085F4865386BD86D38757876887D587DD
-87E587ED87F5888B88F9894F896489EE8A258A4E8A7B8A918B238B488B6C8BBD8C398C73
-8CD88D0C8D8E8D8E8D8E8D8E8D8E8E208E8D8EF48F598F9F8FB58FBD8FC59006904590BD
-9126916491A19209927292C09334938093D1944E94D395479558956C9586959B95B195C7
-95DD95F3960B96219633964996659683969596AA96BC96D196E396F8970A971F973E9759
-976A977B979697AE97C497D597ED97FF98179829983F985598679879989898B198C998DB
-98ED98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF9911
-9922994099549970998999A199B399CB99E499FC9A159A359A4E9A659A769A909AA59ABB
-9ACC9AE29AF99B0B9B1C9B2D9B3E9B549B659B7C9B949BAF9BC79BDD9BEE9C009C119C22
-9C339C4E9C649C759C8B9CA49CB89CCE9CDF9D639D6B9DDB0000037D01011C1C300E0E0B
-0E010A01010E0E010F01010B0B0B0B0B0B0B0B0B0B01010E0E0E0B0C320E101923150E0F
-740A0E2D240E0D0D0D0E322C1D322E1C111C0101010101010D0D0E0D0D1C0D0BB4010EB4
-110B100D0D2A11110B0A100F0A11010E0101323210230E0D1D0D0D0D0D0D0D0E0D0D0D0D
-B4B4B4B40B10101010100B0B0B0B0B010B0B01010B0101010101010E330D010E0E0E0B10
-010101010B0101010E100B300E010B010127270132320D011C0B01010101010E010A1101
-01010101010B010101013223322323747474740D0D0D1D1D1DB401010101010101010101
-0AD732111C110E1001110A0D0D0E01010101010101010E0D743211100E100E0D0101320D
-320D190D10230D230D2DB42D322D010E0B0E0B0D100E2A0E2A32112C112C111D0B1D0B1C
-111C11100D130D2612181110010D010A0A110E01240A121901011901320D100E100E230D
-230D230D0E0D0E0D0E0D0F0B0F0B74B474B474B474B40A010E0E0E2DB40E0B0E0B0D100D
-100E2A32112C111D0B1D0B1D491D182E10110A01320D330E0D10012E102E102E10110A01
-010B01010101012E010101320E1C10160C27B4320E01231C0F740E0A240E300D0F0D1E2C
-111C111474110D120BB40B0B0F0D0B0DB40D0A130A011010010B0C1010B40B100B10230A
-100D3274740A0C0E010E1111320E0E10012311010E0E0E12240F0D0F0D102C11131C2D22
-11111F2D0E0D01100D240A010D0D301210100B011D1010100D0F110A170F270D11320C11
-0C0E0D0A0D0B010E11B4B4010A0E0B0B0A10100A01011001010101010101010101012D10
-282001010101010101010101010101010101010101320D320D320D320D320D320D320D32
-0D320D320D320D320D230D230D230D230D230D230D230D230D74B474B401010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-01010101010101010D100D100D100D100D100D100D102D102D102D102D102D101D0B1D0B
-28202820282028202820110A110A110A110A0D010B00000000000001000101010101000C
-00F808FF00080008FFFE0009000AFFFE000A000AFFFE000B000BFFFE000C000CFFFE000D
-000DFFFD000E000EFFFD000F000FFFFD0010000FFFFD00110011FFFD00120012FFFC0013
-0013FFFC00140015FFFC00150015FFFC00160016FFFC00170017FFFB00180018FFFB0019
-001AFFFB001A001BFFFB001B001BFFFB001C001CFFFA001D001DFFFA001E001EFFFA001F
-0020FFFA00200020FFFA00210021FFF900220022FFF900230023FFF900240025FFF90025
-0026FFF900260026FFF800270027FFF800280028FFF800290029FFF8002A002BFFF8002B
-002BFFF7002C002CFFF7002D002DFFF7002E002EFFF7002F0030FFF700300031FFF60031
-0031FFF600320032FFF600330033FFF600340034FFF600350036FFF500360036FFF50037
-0037FFF500380038FFF500390039FFF5003A003BFFF4003B003CFFF4003C003DFFF4003D
-003DFFF4003E003EFFF4003F003FFFF300400041FFF300410041FFF300420042FFF30043
-0043FFF300440044FFF200450046FFF200460047FFF200470047FFF200480048FFF20049
-0049FFF1004A004AFFF1004B004CFFF1004C004DFFF1004D004DFFF1004E004EFFF0004F
-004FFFF000500051FFF000510052FFF000520052FFEF00530053FFEF00540054FFEF0055
-0055FFEF00560057FFEF00570058FFEE00580058FFEE00590059FFEE005A005AFFEE005B
-005CFFEE005C005DFFEC005D005DFFEC005E005EFFEC005F005FFFEC00600060FFEC0061
-0062FFEB00620062FFEB00630063FFEB00640064FFEB00650065FFEB00660067FFEA0067
-0068FFEA00680068FFEA00690069FFEA006A006AFFEA006B006BFFE9006C006DFFE9006D
-006DFFE9006E006EFFE9006F006FFFE900700070FFE800710072FFE800720072FFE80073
-0073FFE800740074FFE800750075FFE700760076FFE700770078FFE700780078FFE70079
-0079FFE7007A007AFFE6007B007BFFE6007C007DFFE6007D007DFFE6007E007EFFE6007F
-007FFFE500800080FFE500810082FFE500820083FFE500830083FFE500840084FFE40085
-0085FFE400860086FFE400870088FFE400880088FFE400890089FFE3008A008AFFE3008B
-008BFFE3008C008DFFE3008D008EFFE3008E008EFFE2008F008FFFE200900090FFE20091
-0091FFE200920093FFE200930093FFE100940094FFE100950095FFE100960096FFE10097
-0098FFE100980099FFE000990099FFE0009A009BFFE0009B009BFFE0009C009CFFE0009D
-009EFFDF009E009EFFDF009F00A0FFDF00A000A0FFDF00A100A1FFDF00A200A3FFDE00A3
-00A4FFDE00A400A4FFDE00A500A6FFDE00A600A6FFDE00A700A7FFDD00A800A9FFDD00A9
-00A9FFDD00AA00ABFFDD00AB00ABFFDD00AC00ACFFDC00AD00AEFFDC00AE00AFFFDC00AF
-00B0FFDC00B000B0FFDC00B100B1FFDB00B200B2FFDB00B300B4FFDB00B400B5FFDB00B5
-00B6FFDB00B600B6FFDA00B700B7FFDA00B800B9FFDA00B900BAFFDA00BA00BBFFDA00BB
-00BBFFD900BC00BCFFD900BD00BDFFD900BE00BFFFD900BF00C0FFD900C000C1FFD800C1
-00C1FFD800C200C2FFD800C300C4FFD800C400C5FFD800C500C5FFD700C600C6FFD700C7
-00C7FFD700C800C8FFD700C900CAFFD700CA00CBFFD600CB00CCFFD600CC00CCFFD600CD
-00CDFFD600CE00CFFFD600CF00D0FFD500D000D0FFD500D100D1FFD500D200D2FFD500D3
-00D3FFD500D400D5FFD400D500D5FFD400D600D7FFD400D700D7FFD400D800D8FFD400D9
-00DAFFD300DA00DBFFD300DB00DCFFD300DC00DCFFD300DD00DDFFD300DE00DEFFD200DF
-00E0FFD200E000E0FFD200E100E2FFD200E200E2FFD200E300E3FFD100E400E5FFD100E5
-00E6FFD100E600E7FFD100E700E7FFD100E800E8FFD000E900E9FFD000EA00EBFFD000EB
-00EBFFD000EC00ECFFD000ED00EDFFCF00EE00EEFFCF00EF00F0FFCF00F000F1FFCF00F1
-00F2FFCF00F200F2FFCE00F300F3FFCE00F400F4FFCE00F500F6FFCE00F600F7FFCE00F7
-00F7FFCD00F800F8FFCD00F900F9FFCD00FA00FBFFCD00FB00FCFFCC00FC00FDFFCC00FD
-00FEFFCC00FE00FEFFCC00FF00FFFFCCB8FFC0401EB229323610B220B240B250B270B280
-B2A0B2B0B2D0B2E0B20AC0B2F0B202B8FFC04070B51718361F44010F561F56024F555F55
-026F54019F54AF54025153170452531604535215044A4952044649370447493204484932
-04493539043C3F32043D3F3D043E3F2104433F1D04423F5204413F5204403F52043F3532
-0432336404333534043534540434351E04D034E034F03403B8FFEEB3B4254836B8FFE0B3
-B4102336B8FFEE400DB4090F36B41A480476B386B302B8FFF0B3B3254836B8FFFA40FFB3
-092436B314480489881304706C7078020F9CDF9E02409D161936409C161B364097171936
-4096171B368685131F0F840F850F8E0F8F0F901F841F8E1F8F2F8E808580888F91908590
-8790880F40820910360F721F72024071090C360F6D0120C80120C7013FC6EFC60220C540
-C50200620100621062024061A061020F5B012D1411042C1425042B1439042A1413042914
-15041F141E042120430420143C04C91A45041A1B47041B1A3C041A143204151439041314
-480412141A0411141A0470140140144143360F0E2A1F0006010DC34B1F0CC24B1F0AC04B
-1F09C04B1F05BC4B1F04BD4B1F03B94B1F02BA4B1F01B64B1F00B74B1FC3C22A1FC0BF2A
-1FBD4056BC211FBAB9211FB7B6211FC2C3C40DBFC0C10DBCBDBE0CB9BABB0CB6B7B80C10
-BC80BC0240B980B9020FB63FB64FB67FB6040FB62FB63FB66FB67FB6BFB6CFB6FFB6080A
-0937040C0D02050402030202010002500501B801FF858D8D1DB0964B5258B0801D59B808
-004B5458B001B0018E59B0084B5358B001B0018E59002B2B2B2B2B737473732B2B2B2B2B
-2B2B2B2B2B2B2B2B2B2B2B2B2B2B2BB00345B006456861B006234473B00345B00E456861
-B00E2344B00E45B00F456861B00F23442B01B0144568B01423442B732B2B2B2B2B2B2B2B
-2B2B2B2B2B2B2B2B7373737373737373732B732B732B2B2B2B2B73732B2B2B2B732B2B2B
-2B00752B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B73747373742B73742B400C3736
-26251F13120D0C0504022C20B003254523452361688A204568208A234460442D2C4B5258
-45441B2121592D2C202045684420B001602045B0467668188A4560442D2CB0122BB00225
-45B00225456AB0408B60B0022523442121212D2CB0132BB0022545B00225456AB8FFC08C
-60B0022523442121212D2CB100032545685458B0032545B0032545606820B004252344B0
-042523441BB00325204568208A2344B00325456860B003252344592D2CB0032520456820
-8A2344B00325456860B0032523442D2C4B525845441B2121592D2C462346608A8A462320
-468A608A61B8FF8062232010238AB14B4B8A70456020B0005058B00161B8FFBA8B1BB046
-8C59B0106068013A2D2C2045B003254652583F1B2111592D2C4B53234B515A5820458A60
-441B2121592D2C4B53234B515A58381B2121592D061E061405F005D1047C045D03DD0010
-0000FFE7FFE1FE78FE64FE590394001FFFFF009600AA00B900C600CEFFFFFFFFFFFFFFFF
-00BC00C2FFFFFFFF007600B200C000CBFFFFFFFFFFFFFFFFFFFFFFFF0081009400A600CC
-00DA00EFFFFFFFFFFFFFFFFF0098009E00AB00B0FFFFFFFFFFFFFFFFFFFFFFFF00900098
-009E00A400A900AE00B300BA00C3FFFF00880091009800A500ACFFFFFFFFFFFFFFFFFFFF
-006F0087008F009B00A000D3011DFFFFFFFFFFFF00C3021401C2FFFFFFFF00E9000C02D1
-0173018E001A002C0044005C0073007E008600B200C8014C001A003D00440050005C0072
-0078009200B200B900C8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF003D0056005D006A
-006E00B100B900C1FFFFFFFF002A003D00540064006A00B100B9FFFFFFFFFFFF0071007A
-008900A100A700BB006F007A00870091009AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-008102210221007400E500B900CA019502C600AC00A700850614000A000005D1001F0000
-045D001F00000000FFE10000FE64FFF50000036202F402A2029100AF026A004C08000100
-0000000002D0000002D000000326012303AC00A8068C00C30516009B089C009505D00073
-022600A403A200B503A20093051600A7068C00D202E9009303A2009902E900FD03A2FFE2
-0516008905160116051600A1051600A70516004D051600BB051600890516009A0516007A
-0516007103A2015A03A200E6068C00FE068C00F5068C010C045D00A0080000B00578001A
-057C00C805960073062A00C8050F00C8049900C806340073060300C8035E008903A3002C
-058B00CD047400C806BE00C805FC00C8064C007304D300C8064C0073059000C805780086
-04EE000005DB00B20578001A07E9005C057B004404EC0006057B007E03A200EF03A20046
-03A200AB068C00BA0516FFFC0516015404CE006804FC00B9042B006904FC006C04C4006A
-02D0004404FC006C051000B9023200AF02C1FFC204BC00C1023200BB07C800B9051000B9
-04DB006A04FC00B904FC006C036A00B9042B006E0327003E051000B104BC003D068C0056
-04BC003C04BC003D0434005D051400AD03A2017A051400BB068C00BB0578001A0578001A
-05960073050F00C805FC00C8064C007005DB00B204CE006804CE006804CE006804CE0068
-04CE006804CE0068042B006904C4006A04C4006A04C4006A04C4006A023200A00232FFEB
-0232FFF502320005051000B904DB006A04DB006A04DB006A04DB006A04DB006A051000B1
-051000B1051000B1051000B1051600BB0456009A0516009F05160089051600AC045D00B9
-0516008904F600B90800009F0800009F07D000AA0516021D0516015A068C00F507E0000E
-064C0073080000A1068C00D7068C00FE068C010C0516006C052200BE0516009505D100BB
-068C009005A900710516008A045D0097045D0079068C006B07A4006804DB005D045D0071
-03260123068C00D2068C00860516FFDC068C00F305D10032052800A6052800AE068C00B2
-0578001A0578001A064C0073088F007807DA006A051600990800009903ACFFED03AC0096
-0226FFED022600A0068C00D2068C00AC04BC003D04EC000602E4FF9A0516000003A200BA
-03A200C20500004405020044051600BB02E900FD0226FFF603ACFFF60C2C00950578001A
-050F00C80578001A050F00C8050F00C8035E0089035E005D035E007E035E0089064C0073
-064C0073064C007305DB00B205DB00B205DB00B2023200BB05160136051600ED05160118
-05160113051602210516012D05160161051601560516019F05160132047E001802460018
-05780086042B006E057B007E0434005D03A2017A0634000E04E5006A04EC000604BC003D
-04D800C804FC00B9068C00DC068C012304560123045600CF045600CF080000AB080000AB
-0800008C0516003C0634007304FC006C035E008905780086042B006E05960073042B0069
-05960073042B006904FC006C0516FFFC02E900FD0578001A04CE00680578001A04CE0068
-062A00C8052E006C0634000E050F00C804C4006A050F00C804C4006A047400C8023200AB
-047400C8025E00BB047400C803AB00BB05FC00C8051000B905FC00C8051000B9064C0073
-04DB006A059000C8036A00B9059000C8036A009205780086042B006E04EE00000327003E
-04EE00000327003E05DB00B2051000B105DB00B2051000B1057B007E0434005D057B007E
-0434005D048800C8064C0073068D006904FC006C04DD006A041A006D050B006A03F8000A
-065200680516FFFC04FF0123045D009A094F00C806F7008904E900AF05D8000002E400D5
-047500D5089C00950296000F04D5009202D6008302D6008304D500B102D600700578001A
-04CE006805960073042B006905960073042B0069050F00C804C4006A050F00C804C4006A
-050F00C804C4006A0634007304FC006C0634007304FC006C0634007304FC006C060300C8
-051000B90603002005100013035E002C0232FFF2035E005F0232FFFC035E008002320001
-035E00890232008E03A3002C02C1FFC2058B00CD04BC00C104BC00C1047400C802320005
-05FC00C8051000B905FC00C8051000B9064C007304DB006A064C007304DB006A059000C8
-036A001B05780086042B006E04EE00000327003E05DB00B2051000B105DB00B2051000B1
-05DB00B2050B00B105DB00B2050B00B107E9005C068C005604EC000604BC003D026700B9
-0578001A04CE006807E0000E07A40068064C007304DB005D03A2015A07E9005C068C0056
-07E9005C068C005607E9005C068C005604EC000604BC003D0226FFED0516FFD005160089
-05BE00B1080000AB0800008C0800008A0800009901B00061051601610516021205160100
-057800070602000006F6000004510000070C000006070000074300000232FFCB0578001A
-057C00C805A0001A050F00C8057B007E060300C8035E0089058B00CD057C001A06BE00C8
-05FC00C805310072064C0073060300C804D300C80561007604EE000004EC0006057B0044
-06F700B3068C006C035E007E04EC000604FC006C041A006D051000B9023200A0050D00B1
-04F600B904BC003D03A9006C051000B904FE0089023200BB04BC00C104BC003D051E00B9
-04BC003D0406006804DB006A050000B904100069050D00B104B80030069300B006820071
-02320005050D00B104DB006A050D00B106820071050F00C80657FFFF048800C8059B0073
-05780086035E0089035E007E03A3002C08F2001208D300C8068BFFFF058B00CD04EC0006
-060300C80578001A057C00C8057C00C8048800C805F7000A050F00C807C9002004ED0051
-060100C8060100C8058B00CD05E0001206BE00C8060300C8064C0073060300C804D300C8
-0596007304EE000004EC0006068D0069057B0044061700C805B2008E083E00C8085C00C8
-06440000075D00C8057200C8059C0061084600C805A6002C04CE006804EA007404C200B9
-03C500B904F9000904C4006A0662003404320041051F00B9051F00B904BC00C104F7001D
-059200B9051900B904DB006A051900B904FC00B90446006A03F8000A04BC003D06BA006F
-04BC003C052800B904D8008E070200B9071A00B90520000A065B00B9049100B904600053
-06B600B904CC004304C4006A0510001303C500B90460006A042B006E023200AF02320005
-02C1FFC20750001D075000B90510001304BC00C104BC003D051900B9048800C803C500B9
-080000CB096000C8051900B904560119045600EF045600E6045600B3045600E6045600F3
-045600C5000000000000000000000000000000000674007304DB006A060D00B2054700B1
-0000020900000221000001540000021D0516013605160003051601360516012505160142
-051601420516014205160125051602090516013605160142051601420516014205160142
-051601360578001A04CE00680578001A04CE00680578001A04CE00680578001A04CEFFE3
-0578001A04CE00680578001A04CE00680578001A04CE00680578001A04CE00680578001A
-04CE00680578001A04CE00680578001A04CE00680578001A04CE0068050F00C804C4006A
-050F00C804C4006A050F00C804C4006A050F00C804C4006A050F002904C4FFFC050F00C8
-04C4006A050F00C804C4006A050F00C804C4006A035E008902320096035E0089023200AF
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000064C007304DB006A064C0073
-04DB006A064C007304DB006A064C007304DBFFE5064C007304DB006A064C007304DB006A
-064C007304DB006A0674007304DB006A0674007304DB006A0674007304DB006A06740073
-04DB006A0674007304DB006A05DB00B2051000B105DB00B2051000B1060D00B2054700B1
-060D00B2054700B1060D00B2054700B1060D00B2054700B1060D00B2054700B104EC0006
-04BC003D04EC000604BC003D04EC000604BC003D04EC000604BC003D04FC006C000000ED
-0516008A0000001F00000380090E09000303050507070B07030404070703050304070707
-070707070707070404070707060A08070808070608080505070609080907090707070808
-090707070404040706060606060606030606030306030906060606040604060607060605
-060506070808080708090806060606060606060606060303030306060606060606060606
-07050707060507060909090606070A090907070707060607070607050507090606050707
-0707070606070808090A0907090404020207070607030604040606070302040E08070807
-070505050509090908080803060606060606060606060603070607050508060706070607
-070505050909090608060507060806080606060308060806080608070607060603060306
-040806080609060704070407060704070408060806070507050609070606050605090606
-050B09060703050B03050303050308060806080607060706070608060806080608060806
-050305030503050305030706060603080608060906090607040706070408060806080608
-06090707060308060A090906040907090709070706020607060909090902060606080809
-060908090308070607070805070809080709080706070707090905070605060306060505
-060603060606060506060506050907030606060707080608070505050A0A070707070807
-070607070906080807070908090807080707070708070909080907080907060606040606
-070506060606070606060606050609060705090907080606080606060406060303030909
-060606060505090B06050505050505050000000009060806000000000606060606060606
-060606060606060806080608060806080608060806080608060806080608060706070607
-060706070607060706070605030503000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000090609060906
-090609060906090609060906090609060906080608060806080608060806080607060706
-07060706060007000A0F0A000404040508070B0703050507080405040507070707070707
-0707070505080808060A070708080606080805050706090709070908070708070B070707
-0505050806060707050707040707030307030B0707070704060407060707060606050608
-070708060709080707070707070507070707030303030707070707070707070707050707
-060507060A0A0A0606080A090A080808070706070807070505080A070604080807080706
-06080707090B0A070A0505030308080607040605050606070403050F0706070606050505
-050909090808080306060606060606060606060307060706050806070607070808050505
-0A0A0A060807050706080508050706040707070708070806070607060306030605070707
-0709070804080407060704070408070807070607060609090707050705090606050C0906
-0704060B0306040406040707080508050607060706070807080708070807080705030503
-0503050305030707070603070707070907090708040706070408070807080708070B0707
-060307070A0A0907050B070B070B070706030607070A0A0A0A0206060607070906090909
-030707070607080507070907070908070707070709090507070507030707070507070307
-0607060507070507060909030707070906080608070505050B0B08070708070707060706
-0906080807070908090807080707090709070B0B080907080A0707070605060707050707
-0706070707070705050609070706090A0708060608060707050606030303090907070607
-06050A0C0705050505050505000000000907080700000000060606060606060606060606
-060606070707070707070707070707070707070707070707070707060706070607060706
-070607060706070503050300000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000009070907090709070907
-090709070907090709070907090708070807080708070807080708070706070607060706
-070007000B110B000404040509070C080305050709040504050707070707070707070705
-05090909060A080809090706090805050806090809070908080708080B08070805050509
-07070707060707040707030407030B070707070506040707090707060705070908080907
-080908070707070707060707070703030303070707070707070707070706070707060707
-0B0B0B0707090B090B090909070707080908070606090B07060409090709080707090808
-090C0B070B05050303090907070407050507070704030511080708070705050505090909
-08080803070707070707070707070603080608060509070707070709090606060B0B0B07
-090705080609060906070704080708070907090707070706030603060508070807090708
-05080508060704070408070807080608060609090707060705090707060D0A070804060C
-040704040704080709060906070707070707090709070907080708070503050305030503
-05040807070603080708070907090708050806070408070807080708070B090707030807
-0B0B0907050B090B090B090707030707080B0B0B0B02070707080809060A090903080808
-070808050808090807090807070707080909050707060703070707050707030707070706
-07070607070909030707070907090609080505050D0C090808080808080608070B070808
-08080908090807090708090809080B0C090A07090B080707070508070906070707070707
-07070706050709070807090A080907070A0707070507060303040A0B0707070706050B0D
-070606060606060600000000090708070000000007070707070707070707070707070708
-070807080708070807080708070807080708070807080707070707070707070707070707
-070707050305030000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000907090709070907090709070907
-090709070907090709070807080708070807080708070807070707070707070707000700
-0C120C00040405060A080D09030505080904050405080808080808080808080505090909
-070C0808090908070909050508070A090A080A08080709080D0807080505050A08080808
-060808040808030407030B0808080805070508070B0707070805080A08080908090A0908
-08080808080608080808030303030808080808080808080808070808080708070C0C0C08
-08090C0A0C090909080808090A080807070A0B080705090A080A0908080A08080A0D0D08
-0C06060303090A070704080505080808040306120808080808050505050A0A0A09090903
-0808080808080808080807030807080705090707070808090A0707070C0C0C0809080508
-07090609060808040808080809090908080808070307040706090809080A080805080508
-07070507050908090808070807070A0B0808060807090808070E0A070904070D04070404
-070408080906090608080808080809080908090809080908050305030503050305040807
-070703090809080A080A0808050807070509080908090809080D0B07070408080C0B0A08
-050D0B0D0B0D0B0707030808090C0C0C0C0308080808090A060B090B0308080808080905
-08080A09080A0908080707080B0A05070806080308070706080803080708070608080608
-070B0B030808080B080A0709080505050D0D0A0808090808080709080D07090908090A09
-0A09080907080B0809090D0E090B08090C080808070608080B0608080707080808080806
-07070B0709080B0C080907080B0708080608070303040B0B0807070807060C0E08070707
-07070707000000000A080908000000000808080808080808080808080808080808080808
-080808080808080808080808080808080808080808080808080808080808080808080805
-030503000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000A080A080A080A080A080A080A080A080A08
-0A080A080A0809080908090809080908090809080707070707070707080008000D140D00
-050505050A080D09030606090905070506080808080808080808080606090909070D0908
-090908080909050608070B090A080A08090909090D0909090606060B0808080808080805
-0808030407030B0808080805070608080B0708070807080B09090908090A090808080808
-080808080808030303030808080808080808080808070808080708080D0D0D0808090C0A
-0D090909080808090B090807070B0B080705090B080B0908080B09090A0E0D080D060603
-03090B080905080606080808050306140908090808050505050A0A0A0909090308080808
-08080808080807030907090707090809080808090B0707070D0D0D080908050907090809
-080808050908090809080908080808070307040706090809080A08080508050907090609
-060908090809070907070A0B08080708070B0808070F0B080A05070E0408050508050908
-090809080808080808080908090809080908090805030503050305030604080707070309
-0809080A080A0808050907090609080908090809080D0B09080409080C0B0A08060D0B0D
-0B0D0B0908030808090D0D0D0D0308080809090A060B0A0C030908090809090508090B09
-080A0908090909090B0B05090807080308080906080803080808080708080708080B0B03
-0808080B080A0709090505060F0D0B080909090808070A080D080909080A0B090A090809
-09090B090A090D0E0A0C08090D080808080608080B070808080809080808080807080B07
-09080B0C080907080B0808080608070303040C0D0808080807060D0F0807070707070707
-000000000A08090900000000080808080808080808080808080808090809080908090809
-080908090809080908090809080908080808080808080808080808080808080503050300
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000A080A080A080A080A080A080A080A080A080A080A08
-0A0809080908090909090909090909090908090809080908080008000E150E0005050606
-0B090F0A040606090B050705060909090909090909090906060B0B0B080E0A0A0A0B0908
-0B0A05060A080B0A0B080B0A0A090A0A0F0A090A0606060B090908090709080509090305
-08030D0909090906080609080B0908080906090B0A0A0A090A0B0A080808080808070808
-0808030303030909090909090909090909080909090809090E0E0E09090B0E0B0E0B0B0B
-0909090A0B0A0908080B0D0908060B0B090B0A09090B0A0A0B0F0E090E060604040B0B08
-0905090606090909050406150A090A0909050505050B0B0B0A0A0A030909090909090909
-090908030A080A08060B09090808090B0B0808080E0E0E090B09050A080A070A07090905
-0A080A080B090B090809080803080408060A090A090B090A060A060A08090609060A090A
-090A080A08080B0B09090709070B090908100C080A05080F0508050508050A080A070A07
-0908090809080B090B090B090A090A09050305030503050306050A080808030A090A090B
-090B090A060A0809060A090A090A090A090F0B0908040A080E0D0B09060F0B0F0B0F0B09
-080409090A0E0E0E0E030909090A0B0C070C0B0C030A0A0A090A0A050A0A0B0A090B0A08
-0909090A0B0B05090907090309090906090903080809080709090709080B0B030909090B
-090B080A0A050506100F0B0A090B0A0A0A080A090F090B0B0A0A0B0A0B0A080A09090B0A
-0B0A0D0E0B0D0A0A0E0A0809080709080B07090908090A090909090807080B090A080B0C
-090B08080C0808090708080303050D0D0908080908070E10090808080808080800000000
-0B090B0A000000000909090909090909090909090909090A080A080A080A080A080A080A
-080A080A080A080A080A0809080908090809080908090809080908050305030000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000B090B090B090B090B090B090B090B090B090B090B090B090A09
-0A090B0A0B0A0B0A0B0A0B0A0908090809080908090009000F170F00050506070C0A100B
-0407070A0C050705070A0A0A0A0A0A0A0A0A0A07070C0C0C080F0A0A0B0B09090C0B0507
-0A080D0B0C090C0A0A090B0A0F0A090A0707070C0A0A0909080909050909030509030F09
-0A090906080609090D0909090A070A0C0A0A0B090B0C0B09090909090908090909090303
-0303090A0A0A0A0A090909090A080A0A0A080A090F0F0F0A0A0C0F0C0F0C0C0C0A090A0B
-0C0B0A08080C0E0A08060C0C0A0C0B0A0A0C0A0A0C100F0A0F070704040C0C0909050A07
-0709090A050407170A090A0909050505050C0C0C0B0B0B030A0A0A0A0A0A0A0A0A0A0803
-0A080A09070B09090909090C0C0808080F0F0F0A0C09050A080B080B08090A050A090A09
-0B0A0B090909090803080408070B090B090C0A0A060A060A08090609060B090B090A090A
-09090C0D090A080A070B0A0908110D080B0508100509050509050A090B080B0809090909
-09090C090C090C090B090B09050305030503050307050A090908030B090B090C0A0C0A0A
-060A0809060B090B090B090B080F0D0909050A090F0E0C0A070F0D0F0D0F0D0909040A0A
-0B0F0F0F0F030A0A0A0A0B0D070D0B0D030A0A0B090A0B050A0A0D0B0A0C0B090A09090A
-0D0C0509090809030909090709090309090909080A0A0809090B0D03090A090D090C090B
-0A05050711110C0A0A0B0A0A0A090B090F090B0B0A0B0D0B0C0B090B090A0D0A0B0B0F10
-0C0E0A0B100A0909090709090D08090909090A090A09090807090D090A090D0E0A0C0908
-0D0909090708080303050E0E0909090909070F120908080808080808000000000C0A0C0A
-000000000A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A090A090A090A090A090A090A090A090A
-090A090A090A090909090909090909090909090909090905030503000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0B090B090C0A
-0C0A0C0A0C0A0C0A090909090909090909000A0010181000060606070D0A110C0407070A
-0D060706070A0A0A0A0A0A0A0A0A0A07070D0D0D09100B0B0B0C0A090C0C07070B090D0C
-0D0A0D0B0A0A0C0B110B0B0B0707070D0A0A0A0A080A0A060A0A050609050F0A0A0A0A06
-09070A090D0909090A070A0D0B0B0B0A0C0D0C0A0A0A0A0A0A080A0A0A0A050505050A0A
-0A0A0A0A0A0A0A0A0A090A0A0A090A0A1010100A0A0D100D100D0D0D0A0A0A0C0D0B0A09
-090D0F0A09060D0D0A0D0C0A0A0D0B0B0D11100A10070704040D0D090B060A07070A0A0A
-060407180B0A0B0A0A070707070D0D0D0C0C0C050A0A0A0A0A0A0A0A0A0A09030A090B09
-070C0A0B090A0A0D0D0909091010100A0C0A070A090B080B080A0A060B0A0B0A0C0A0C0A
-0A0A0A0905090509070C0A0C0A0D0A0B060B060A090A070A070C0A0C0A0B090B09090D0D
-0A0A090A070D0A0A09130E0B0C060911050A06060A060B0A0B080B080A0A0A0A0A0A0C0A
-0C0A0C0A0C0A0C0A070507050705070507060B090909050C0A0C0A0D0A0D0A0B060A090A
-070C0A0C0A0C0A0C0A110D0B09050B0A100F0D0A07110D110D110D0B09040A0A0B101010
-10030A0A0A0B0C0E090E0C0E050B0B0B0A0B0C070B0B0D0C0A0D0C0A0B0A0B0B0D0D070B
-0A090A050A0A09070A0A0509090A09080A0A080A090D0D050A0A0A0D0A0D090B0A070707
-12120D0B0B0B0B0B0B090C0A110A0C0C0B0C0D0C0D0C0A0B0A0B0D0B0C0B0F100D0E0B0B
-110B0A0A0A080A0A0D090A0A090A0B0A0A0A0A0907090D090A0A0D0E0A0C09090D0A0A0A
-0809090505060F0F0A09090A090810130A09090909090909000000000D0A0D0B00000000
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B
-0A0B0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0705070500000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0C0A0C0A0D0B0D0B0D0B
-0D0B0D0B0B090B090B090B090A000A00111A1100060607080E0B120C0508080B0E060806
-080B0B0B0B0B0B0B0B0B0B08080E0E0E09110C0C0C0D0B0A0D0D08080C090E0D0D0A0D0C
-0C0A0C0C110C0A0C0808080E0B0B0A0B090B0A060B0B05060A05110B0A0B0B0709070B0A
-0E0A0A090B080B0E0C0C0C0B0D0D0C0A0A0A0A0A0A090A0A0A0A050505050B0A0A0A0A0A
-0B0B0B0B0B090B0B0B090B0B1111110B0B0E110D110E0E0E0B0B0B0C0E0C0B09090E100A
-09070E0E0B0E0C0B0B0E0C0C0D12110B11080805050E0E0A0A060B08080B0B0B0605081A
-0C0B0C0B0B080808080D0D0D0C0C0C050B0B0B0B0B0B0B0B0B0B0A050C090C09080D0A0A
-0A0A0B0E0E0909091111110B0D0B080C090C090C090B0B060C0A0C0A0D0B0D0B0A0B0A09
-05090509080D0B0D0B0D0A0C070C070C090A070A070C0B0C0B0C090C090A0D0E0B0A080B
-080D0B0B09140F0A0C060912060A06060A060C0A0C090C090B0A0B0A0B0A0D0B0D0B0D0B
-0D0B0D0B080508050805080508060C0A0A09050D0B0D0B0D0A0D0A0C070C090A070C0B0C
-0B0C0B0C0B110E0A0A050C0A11100D0A08110E110E110E0A0A050B0B0C11111111040B0B
-0B0C0D0F090F0D10050C0C0C0B0C0D080C0C0E0D0B0D0D0A0B0A0A0C0F0E080A0B080B05
-0B0B0A080B0B050A0A0B0A090A0B090B0A0E0E050B0A0B0E0B0D0A0C0C08080813130E0C
-0A0D0C0C0C0A0D0B110A0D0D0C0D0E0D0D0D0A0C0A0A0E0C0D0C12120D100C0C120C0A0A
-0A080B0A0E080B0B0A0B0C0B0A0B0B09080A0D0A0C0A0F0F0B0E0A090E0A0A0B08090905
-050610100B0A0A0B0A0811140B09090909090909000000000D0A0D0B000000000B0B0B0B
-0B0B0B0B0B0B0B0B0B0B0B0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0B
-0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A080508050000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000D0A
-0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0C0B0C0B0D0B0D0B0D0B0D0B0D0B
-0A0A0A0A0A0A0A0A0B000B00121B1200060607080F0B130D0508080B0F070807080B0B0B
-0B0B0B0B0B0B0B08080F0F0F0A120C0C0D0E0B0A0E0E08080C0A0F0D0E0B0E0D0C0B0D0C
-120C0B0C0808080F0B0B0B0B090B0B060B0B05060B05120B0B0B0B0809070B0B0F0B0B09
-0B080B0F0C0C0D0B0D0E0D0B0B0B0B0B0B090B0B0B0B050505050B0B0B0B0B0B0B0B0B0B
-0B0A0B0B0B0A0B0B1212120B0B0F120E120F0F0F0B0C0B0D0F0D0B0A0A0F110B0A070F0F
-0B0F0D0C0C0F0C0C0E13120B12080805050F0F0B0B070B08080B0B0B0705081B0C0B0C0B
-0B080808080E0E0E0D0D0D050B0B0B0B0B0B0B0B0B0B0A050C090C09080E0B0B0B0B0B0F
-0F0A0A0A1212120B0E0B080C090D090D090B0B070C0B0C0B0E0C0E0B0B0B0B0A050A050A
-080D0B0D0B0E0B0D080D080C090B070B070D0B0D0B0C090C090A0E0E0B0B090B090E0B0B
-0A15100B0D070A13060B06060B060C0B0D090D090B0B0B0B0B0B0E0B0E0B0E0B0E0B0E0B
-080508050805080508060C0B0B0A050D0B0D0B0E0B0E0B0D080C090B070D0B0D0B0D0B0D
-0B120F0B0B050C0B12110E0B08120F120F120F0B0B050B0B0D12121212040B0B0B0C0E10
-0A100E10050C0C0D0B0C0E080C0C0F0D0C0E0E0B0C0B0B0C100E080B0B090B050B0B0B08
-0B0B050B0B0B0B090B0B090B0B0F0F050B0B0B0F0B0E0A0D0C08080814140F0C0B0E0C0C
-0C0A0D0B120B0E0E0C0D0F0E0E0E0B0D0B0B0E0C0E0D13130E110C0D130D0B0B0B080B0B
-0E090C0C0B0B0D0B0B0B0B0A090B0F0B0C0B10100C0E0A0A0F0B0B0B080A090505061010
-0B0B0B0B0A0812150B0A0A0A0A0A0A0A000000000E0B0D0B000000000B0B0B0B0B0B0B0B
-0B0B0B0B0B0B0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0B0B0B0B0B
-0B0B0B0B0B0B0B0B0B0B0B08050805000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000000E0B0E0B0E0B
-0E0B0E0B0E0B0E0B0E0B0E0B0E0B0E0B0E0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0B0B0B0B
-0B0B0B0B0B000B00131D130007070709100C140E0509090C10070907090C0C0C0C0C0C0C
-0C0C0C09091010100A130D0D0D0F0C0B0F0E08090D0B100E0F0B0F0D0D0C0E0D130D0C0D
-090909100C0C0B0C0A0C0B070C0C06070B06120C0C0C0C080A070C0B100B0B0A0C090C10
-0D0D0D0C0E0F0E0B0B0B0B0B0B0A0B0B0B0B060606060C0C0C0C0C0C0C0C0C0C0C0A0C0C
-0C0A0C0C1313130C0C10130F131010100C0C0C0E100D0C0A0A10120C0A0710100C100E0C
-0C100D0D0F14130C130909050510100B0C070C09090C0C0C0705091D0D0C0D0C0C080808
-080F0F0F0E0E0E060C0C0C0C0C0C0C0C0C0C0B060D0A0D0A090F0C0C0B0C0C10100A0A0A
-1313130C0F0C080D0A0D0A0D0A0C0C070D0B0D0B0F0C0F0C0B0C0B0B060B060B090E0C0E
-0C0F0C0D080D080D0A0C070C070E0C0E0C0D0A0D0A0B0F100C0C0A0C090F0C0C0A16110C
-0E070B14060B07070B070D0B0D0A0D0A0C0B0C0B0C0B0F0C0F0C0F0C0E0C0E0C08060806
-0806080609070D0B0B0B060E0C0E0C0F0C0F0C0D080D0A0C070E0C0E0C0E0C0E0C13100C
-0B060D0B13120F0C091310131013100C0B050C0C0E13131313040C0C0C0D0E110A110E11
-060D0D0D0C0D0E080D0D100E0C0F0E0B0D0C0C0D110F080C0C0A0C060C0C0B090C0C060B
-0B0C0B0A0C0C0A0C0B100F060C0C0C0F0C0F0B0D0D0808091515100D0C0E0D0D0D0B0E0C
-120C0E0E0D0E100E0F0E0B0D0C0C100D0E0E14140F110D0D140D0B0C0B090C0B0F0A0C0C
-0B0C0D0C0C0C0C0A090B100B0D0C11110C0F0B0A100B0B0C090A0A06060711110C0B0B0C
-0B0913160C0A0A0A0A0A0A0A000000000F0C0E0C000000000C0C0C0C0C0C0C0C0C0C0C0C
-0C0C0C0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0C0B0C0B0C0B0C0B0C
-0B0C0B0C0B0C0B0806080600000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000F0C0F0C0F0C0F0C0F0C
-0F0C0F0C0F0C0F0C0F0C0F0C0F0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0C0B0C0B0C0B0C0B
-0C000C00141E140007070809100D160F0509090D10070907090D0D0D0D0D0D0D0D0D0D09
-091010100B140E0E0E0F0D0C100F08090E0B110F100C100E0E0C0F0E140E0C0E09090910
-0D0D0C0C0A0C0C070C0D06070C06130D0C0C0C090A080D0C100C0C0B0D090D100E0E0E0D
-0F100F0C0C0C0C0C0C0A0C0C0C0C060606060D0C0C0C0C0C0D0D0D0D0D0B0D0D0D0B0D0C
-1414140D0D101310141010100D0D0D0F100E0D0B0B10130C0B0810100D100F0D0D100E0E
-1015140D140909050510100C0C070D09090D0D0D0705091E0E0D0E0D0D08080808101010
-0F0F0F060D0D0D0D0D0D0D0D0D0D0B060E0A0E0B09100C0C0C0C0C10100B0B0B1414140D
-100C080E0A0E0A0E0A0C0D070E0C0E0C0F0D100D0C0D0C0B060B060B090F0D0F0D100C0E
-090E090E0A0C080C080F0D0F0D0E0B0E0B0B10100C0C0A0D0A100D0C0B17110C0F070B16
-060C07070C070E0C0E0A0E0A0D0C0D0C0D0C100C100C100C0F0D0F0D0806080608060806
-09070E0C0C0B060F0D0F0D100C100C0E090E0A0C080F0D0F0D0F0D0F0D14100C0C060E0C
-1313100C091410141014100C0C050D0D0E14141414040D0D0D0E0F110B120F12060E0E0E
-0D0E0F080E0E110F0D100F0C0D0C0C0E1110080C0C0A0D060D0C0C090D0C060C0C0D0C0A
-0C0D0A0D0C1010060D0C0D100D100B0E0E0808091616100E0C0F0E0E0E0B0F0D130C0F0F
-0E0F110F100F0C0E0C0C100E0F0E151510120E0E150E0C0C0C090C0C100A0D0D0C0C0E0D
-0C0D0C0B0A0C110C0D0C12120D100B0B110C0C0D090B0A06060712120D0C0C0D0B091417
-0D0B0B0B0B0B0B0B00000000110C0F0D000000000D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0E
-0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0D0C0D0C0D0C0D0C0D0C0D0C0D
-0C0D0C080608060000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000100C100C100C100C100C100C100C
-110C110C110C110C110C0F0D0F0D0F0D0F0D0F0D0F0D0F0D0C0C0C0C0C0C0C0C0C000D00
-152015000707080A110D170F060A0A0D11080A080A0D0D0D0D0D0D0D0D0D0D0A0A111111
-0B150E0E0F100D0C1010080A0F0C1210110D110F0E0D0F0E150E0D0E0A0A0A110D0D0D0D
-0B0D0D070D0D06070C06140D0D0D0D090B080D0C110C0C0B0D0A0D110E0E0F0D10110F0D
-0D0D0D0D0D0B0D0D0D0D060606060D0D0D0D0D0D0D0D0D0D0D0B0D0D0D0B0D0D1515150D
-0D111411151111110D0D0D0F110F0D0B0B11140D0B0811110D110F0E0E110E0E1116150D
-150A0A060611110C0D080D0A0A0D0D0D08060A200E0D0E0D0D080808081111110F0F0F06
-0D0D0D0D0D0D0D0D0D0D0C060E0B0E0B0A100D0D0C0D0D11110B0B0B1515150D100D080E
-0B0F0B0F0B0D0D080E0D0E0D100E100D0D0D0D0C060C060C0A100D100D110D0F090F090E
-0B0D080D080F0D0F0D0E0B0E0B0C11110D0D0B0D0A110D0D0B18120D0F080C17070D0707
-0D070E0D0F0B0F0B0D0D0D0D0D0D100D100D100D100D100D08060806080608060A070F0C
-0C0C06100D100D110D110D0F090E0B0D080F0D0F0D0F0D0F0D15110D0C060E0D1414110D
-0A1511151115110D0C060D0D0F15151515040D0D0D0E10120B131013060E0E0F0D0E1008
-0F0E12100E11100D0E0D0D0E1211080D0D0B0D060D0D0C0A0D0D060C0C0D0C0B0D0D0B0D
-0C1111060D0D0D110D110C0F0E08080A1717110F0D100E0E0E0C100D140D10100F0F1210
-11100D0F0D0D110E100F161610130E0F160F0D0D0C0A0D0D110B0D0D0C0D0F0D0D0D0D0B
-0A0C120C0E0D12130D110C0B120D0D0D0A0B0B06060713130D0C0C0D0C0A15190D0B0B0B
-0B0B0B0B00000000120D100D000000000D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0E0D0E0D0E
-0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D08
-060806000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000110D110D110D110D110D110D110D120D120D
-120D120D120D0F0D0F0D100D100D100D100D100D0D0C0D0C0D0C0D0C0D000D0016211600
-0808090A120E1810060A0A0E12080A080A0E0E0E0E0E0E0E0E0E0E0A0A1212120C160F0F
-0F110E0D11110A0A0F0C1310110D110F0F0E100F160F0E0F0A0A0A120E0E0D0E0B0E0D08
-0E0E06080D06150E0D0E0E090B090E0D120D0D0C0E0A0E120F0F0F0E1011100D0D0D0D0D
-0D0B0D0D0D0D060606060E0D0D0D0D0D0E0E0E0E0E0C0E0E0E0C0E0E1616150E0E121511
-161212120E0E0E1012100E0C0C12150D0C0912120E12100E0E120F0F1118160E160A0A06
-0612120D0E080E0A0A0E0E0E08060A210F0E0F0E0E0A0A0A0A111111101010060E0E0E0E
-0E0E0E0E0E0E0C060F0B0F0C0A110D0E0D0D0E12120C0C0C1616160E110E0A0F0B0F0B0F
-0B0E0E080F0D0F0D110E110E0D0E0D0C060C070C0A100E100E110D0F090F090F0B0E090E
-09100E100E0F0C0F0C0C11120E0D0B0E0B110E0E0C1A130E10080C18070D08080D080F0D
-0F0B0F0B0E0D0E0D0E0D110E110E110E110E110E0A060A060A060A060A080F0D0D0C0610
-0E100E110D110D0F090F0B0E09100E100E100E100E16120E0D070F0D1515110D0A161216
-1216120E0D060E0E1016161616050E0E0E0F11130C131114060F0F0F0E0F110A0F0F1310
-0E11110D0F0E0E0F13120A0E0E0B0E060E0E0D0A0E0E060D0D0E0D0B0D0E0B0E0D121206
-0E0D0E120E110C0F0F0A0A0A1918120F0E110F0F0F0C100E150E11110F10131111110D0F
-0E0E120F1110171711140F0F17100D0E0D0A0E0D120C0E0E0D0E0F0E0D0E0E0C0B0D130D
-0E0D13140E110D0C120D0D0E0A0C0B06060814140E0D0D0E0C0A161A0E0C0C0C0C0C0C0C
-00000000120D110F000000000E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0F0D0F0D0F0D0F0D0F
-0D0F0D0F0D0F0D0F0D0F0D0F0D0F0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0A060A0600
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000110D110D110D110D110D110D110D120D120D120D120D
-120D100E100E110F110F110F110F110F0E0D0E0D0E0D0E0D0E000E00172317000808090B
-130F1911060A0A0F13080A080A0F0F0F0F0F0F0F0F0F0F0A0A1313130D17101010120F0D
-12110A0A100D1311120E1210100E111017100E100A0A0A130F0F0E0E0C0E0E080E0F0608
-0E06160F0E0E0E0A0C090F0E130E0E0C0F0A0F131010100F1112110E0E0E0E0E0E0C0E0E
-0E0E060606060F0E0E0E0E0E0F0F0F0F0F0C0F0F0F0D0F0E1717160F0F13161217131313
-0F0F0F1113100F0D0D13160E0D0913130F13110F0F1310101219170F170B0B060613130E
-0E080F0A0A0E0E0F08060B23100F100F0F0A0A0A0A121212111111060F0F0F0F0F0F0F0F
-0F0F0D06100C100C0A120E0E0E0E0E13130C0C0C1717170F120E0A100C100C100C0E0F08
-100E100E120F120F0E0F0E0D060D070D0B110F110F120E100A100A100C0E090E09110F11
-0F100C100C0D12130E0E0C0F0B120F0E0D1B140E11080D19070E08080E08100E100C100C
-0F0E0F0E0F0E120E120E120E110F110F0A060A060A060A060A08100E0E0D06110F110F12
-0E120E100A100C0E09110F110F110F110F17130E0E07100E1616120E0A1713171317130E
-0E060F0F1117171717050F0F0F1011140C141115061010100F10110A101013110F12110E
-0F0E0E1014130A0E0E0C0F060F0E0E0B0F0E060E0E0F0E0C0E0E0C0F0E1313060F0E0F13
-0F120D10100A0A0A1A1913100E111010100D110F160E11111011131112110E100E0E1310
-121018181215101018100E0E0E0B0E0E120C0F0F0E0E100F0E0F0E0C0B0E130E0F0E1414
-0F120D0D130E0E0F0B0D0C06060815150F0E0E0F0D0B171B0F0C0C0C0C0C0C0C00000000
-130E1110000000000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F100E100E100E100E100E100E10
-0E100E100E100E100E100E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0A060A060000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000120E120E120E120E120E120E120E130E130E130E130E130E110F
-110F111011101110111011100E0E0E0E0E0E0E0E0E000F00182518000808090B140F1A11
-060B0B0F14090B090B0F0F0F0F0F0F0F0F0F0F0B0B1414140D18101011130F0E13120A0B
-110D1412130E1311100F121018100F100B0B0B140F0F0E0F0D0F0E080F0F06080E06170F
-0F0F0F0A0D090F0E140E0E0D0F0B0F141010110F1213120E0E0E0E0E0E0D0E0E0E0E0606
-06060F0F0F0F0F0F0F0F0F0F0F0D0F0F0F0D0F0F1818170F0F141713181414140F0F0F11
-14110F0D0D14170F0D0914140F14110F0F141010131A180F180B0B060614140E0F090F0B
-0B0F0F0F09060B25100F100F0F0A0A0A0A131313121212060F0F0F0F0F0F0F0F0F0F0D06
-100D100D0B130F0F0E0F0F14140D0D0D1818180F130F0A100D110D110D0F0F09100E100E
-1310130F0E0F0E0D060D070D0B120F120F130F110A110A100D0F090F09120F120F100D10
-0D0E13140F0F0C0F0C130F0F0D1C150F12090D1A080F09090F09100E110D110D0F0E0F0E
-0F0E130F130F130F120F120F0A060A060A060A060B08110E0E0D06120F120F130F130F11
-0A100D0F09120F120F120F120F18140F0E07100E1717130F0B1814181418140F0E060F0F
-1118181818050F0F0F1012150D151216061010110F10120A111014121013120E100F0F10
-15140A0F0F0C0F060F0F0E0B0F0F060E0E0F0E0C0F0F0C0F0E1414060F0F0F140F130E11
-100A0A0B1B1A14110F121010100E120F170F12121112141213120E110F0F141012111919
-1316101119110E0F0E0B0F0E130D0F0F0E0F110F0F0F0F0D0C0E140E0F0F15150F130E0D
-140E0E0F0B0D0D06060816160F0E0E0F0E0B181C0F0D0D0D0D0D0D0D00000000130F1210
-000000000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F100E100E100E100E100E100E100E100E10
-0E100E100E100E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0A060A06000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000130F130F130F130F130F130F130F130F130F130F130F130F120F120F1210
-12101210121012100F0E0F0E0F0E0F0E0F000F001B291B000A0A0B0C16111D14070C0C11
-160A0C0A0C111111111111111111110C0C1616160F1B12131315111015140B0C130F1714
-15101513121114121B1311130C0C0C16111110110E11100A1111070910071A111011110C
-0E0B11101610100E110C1116121213111415141010101010100E10101010070707071110
-1010101011111111110F1111110F11111B1B1A1111161B151B161616111111141613110F
-0F161A100F0B16161116141111161212151D1B111B0C0C0707161610110A110C0C111111
-0A070C2912111211110B0B0B0B15151514141407111111111111111111110F07120E130E
-0C15111110101116160F0F0F1B1B1B1115110B120E130E130E11110A1210121015111511
-1011100F070F080F0C141114111510130C130C120E110B110B14111411130E130E0F1516
-11100E110D1511110F1F1811140A0F1D09100A0A100A1210130E130E1110111011101511
-15111511141114110B070B070B070B070C091310100F071411141115101510130C120E11
-0B14111411141114111B1611100812101B1A15100C1B161B161B161110071111131B1B1B
-1B061111111214180F181419071213131113140B13131714121514101211111318160B11
-110E11071111100C111107101011100E10110E11101616071110111611150F13120B0B0C
-1E1E161311141213130F14111A11141413141714151410131111161315131C1C15191213
-1C131011100D1110160E1111101113111011110E0D1017101110181811150F0F17101011
-0D0F0E0707091919111010110F0D1B20110F0F0F0F0F0F0F000000001610141200000000
-111111111111111111111111111111121012101210121012101210121012101210121012
-101210111011101110111011101110111011100B070B0700000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000015101510151015101510151015101610161016101610161014111411141214121412
-141214121110111011101110110011001D2C1D000A0A0B0D18121F15080D0D12180B0D0B
-0D121212121212121212120D0D181818101D14141416121116160D0D1410181617111714
-141215141D1412140D0D0D18121211120F12110A1212090A11091C121212120C0F0B1211
-1811110F120D1218141414121617151111111111110F1111111109090909121212121212
-1212121212101212121012121D1D1C1212181D171D181818121312151815121010181C12
-100B18181218151313181414171F1C121D0D0D0808181811120A120D0D1212120B080D2C
-14121412120D0D0D0D17171715151509121212121212121212121009140F140F0D161212
-11121218181010101D1D1D1216120D140F140F140F12120B141114111613161211121110
-091009100D161216121712140C140C140F120B120B15121512140F140F10171812120F12
-0E17121210221912150A101F09120A0A120A1411140F140F121112111211161216121612
-161216120D090D090D090D090D0A14111110091612161217121712140C140F120B151215
-12151215121D1812110914111D1C17120D1D181D181D181211081212151D1D1D1D061212
-12141619101A161A091414141214160D14141816131716111412121419180D12120F1209
-1212110D121209111113110F12120F12111818091212121812171014140D0D0D20201814
-12161414141016121C12161614151816171611141212181416151E1E171B14141E141112
-110E1211170F1313111214121212120F0E1118111312191A13171110181111120E100F09
-090A1B1B12111112100E1D22121010101010101000000000171216130000000012121212
-121212121212121212121214111411141114111411141114111411141114111411141112
-1112111211121112111211121112110D090D090000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000001712
-171217121712171217121712171217121712171217121512151216131613161316131613
-121112111211121112001200203120000B0B0D0F1A142217090F0F141A0C0F0C0F141414
-141414141414140F0F1A1A1A112016161619141219180D0F16121B181913191616141716
-201614160F0F0F1A141413141114130B1414090B13091F141314140E110D14131A131311
-140F141A1616161418191713131313131311131313130909090914131313131314141414
-141114141411141420201F14141A1F19201A1A1A141514171A171411111A1F13110D1A1A
-141A1715151A161619221F14200F0F09091A1A13140C140F0F1414140C090F3116141614
-140D0D0D0D19191917171709141414141414141414141209161116110F1914141313141A
-1A1111112020201419140D16111611161114140C16131613191519141314131209120912
-0F181418141913160E160E1611140D140D171417141611161112191A1413101410191414
-11251C14170C12220A130B0B130B16131611161114131413141319141914191418141814
-0D090D090D090D090F0B16131312091814181419131913160E1611140D17141714171417
-14201A14130A16131F1F19130F201A201A201A141309141417202020200714141416181C
-111C181D091616171416180D16161B1815191813161414161C1A0D14141014091414130F
-141409131314131013141014131A1A091413141A14191216160D0D0F24231A1614181616
-161218141F14181816181B181918131614141A1618172121191D161621171314130F1413
-1A111414131416141314141110131B1315131C1C151912121B1313140F121109090B1D1D
-14131314120F20261411111111111111000000001A131815000000001414141414141414
-141414141414141613161316131613161316131613161316131613161316131413141314
-13141314131413141314130D090D09000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000191319131913
-19131913191319131A131A131A131A131A13171417141815181518151815181514131413
-1413141314001400213221000C0C0D0F1B152418090F0F151B0C0F0C0F15151515151515
-1515150F0F1B1B1B12211717171915131A190D0F17121C191A141A171714181721171417
-0F0F0F1B151514151115140C1515090B140920151415150E110D15141B141411150F151B
-17171715191A181414141414141114141414090909091514141414141515151515121515
-1512151421212015151B201A211B1B1B151515181B171512121B2014120D1B1B151B1815
-151B17171A232015210F0F09091B1B14140C150F0F1515150C090F3217151715150D0D0D
-0D1A1A1A18181809151515151515151515151309171117110F1A14141414151B1B121212
-212121151A150D17111711171115150C1714171419151A151415141209120A120F191519
-151A14170E170E1711140D140D1815181517111711131A1B15141115101A151512261D14
-180C12240B140C0C140C1714171117111514151415141A151A151A15191519150D090D09
-0D090D090F0B1714141209191519151A141A14170E1711140D1815181518151815211B14
-140A171420201A140F211B211B211B141409151518212121210715151517191D121D191E
-091717171517190D17171C19151A1914161414171D1B0D14151115091514140F15150914
-1415141114151115131B1B091514151B151A1317170D0D0F25241B171419171717131915
-2014191917181C191A19141714141B17191822221A1E161722171414141015141A111515
-141417151415151210141C1415141D1D151A13121C14141510121109090B1E1E15141415
-131021271512121212121212000000001B14191600000000151515151515151515151515
-151515171417141714171417141714171417141714171417141714151415141514151415
-141514151415140D090D0900000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000001A141A141A141A141A14
-1A141A141B141B141B141B141B1418151815191619161916191619161414141414141414
-15001500253825000D0D0F111E18281B0A1111181E0D110D111818181818181818181811
-111E1E1E142519191A1D17151D1C10111A151F1C1D161D1A19171B19251917191111111E
-181816171317160D17170A0D160A241716171710130F17161E1616131711171E19191A17
-1C1D1B16161616161613161616160A0A0A0A171616161616171717171814181818141817
-25252418181E241D251E1E1E1818181B1E1A1814141E2316140F1E1E181E1B18181E1919
-1D2824182511110A0A1E1E16170D1811111717180D0A11381917191717101010101D1D1D
-1B1B1B0A18181818181818181818150A19131913111D17171616171E1E14141425252518
-1D171019131A131A1317180D191619161D181D17161716150A150B15111C171C171D161A
-101A101913170F170F1B171B1719131913151D1E17171317121D1817142B20171B0D1528
-0C160D0D160D19161A131A131716171617161D171D171D171C171C17100A100A100A100A
-110D1A1616150A1C171C171D161D161A101913170F1B171B171B171B17251E17160B1916
-24231D1611251E251E251E17160A18181B2525252508181818191C2014211C220A19191A
-17191C101A191F1C181D1C1619171719201E10171713170A1717161117170A1616181613
-16171317161E1E0A1716171E171D151A1910101129291E1A171C191919151C1724171C1C
-1A1B1F1C1D1C161A17171E191C1A26271D22191A261A1617161117161E13181816171A18
-1618171412161F1618162021181D15141F1616171114130A0A0D2222171616181511252B
-1814141414141414000000001E161C180000000018181818181818181818181818181819
-161916191619161916191619161916191619161916191617161716171617161716171617
-161716100A100A0000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000001D161D161D161D161D161D161D16
-1E161E161E161E161E161B171B171C181C181C181C181C18171617161716171617001800
-2A402A000F0F1113221B2D1F0B13131B220F130F131B1B1B1B1B1B1B1B1B1B1313222222
-172A1D1D1D201B18212012131D17231F2119211D1D1A1F1D2A1D1A1D131313221B1B191A
-161A190F1A1B0C0E190C291B191A1A1216111B19221919161B131B221D1D1D1B1F211F19
-191919191916191919190C0C0C0C1B19191919191B1B1B1B1B171B1B1B171B1A2A2A291B
-1B222A212A2222221B1B1B1F221E1B1717222819171122221B221F1B1B221D1D212D291B
-2A13130B0B2222191A0F1B13131A1A1B0F0B13401D1B1D1B1B121212122121211F1F1F0C
-1B1B1B1B1B1B1B1B1B1B180C1D161D1613211A1A19191A22221717172A2A2A1B211A121D
-161D161D161A1B0F1D191D19201B211B191B19170C170C17131F1B1F1B21191D121D121D
-161A111A111F1B1F1B1D161D161821221A1A161A15211B1A1731251A1F0F172D0E190F0F
-190F1D191D161D161B191B191B19211A211A211A201B201B120C120C120C120C130E1D19
-19170C1F1B1F1B211921191D121D161A111F1B1F1B1F1B1F1A2A221A190D1D192A282119
-132A222A222A221A190B1B1B1E2A2A2A2A091B1B1B1D2025172520260C1D1D1E1B1D2012
-1D1D231F1B2120191C1A1A1D2522121A1A161B0C1B1A19131B1A0C19191B1915191A151B
-1923220C1B191B221B21181D1D1212132F2E221D1A201D1D1D181F1B291A20201D1F2320
-2120191D1A1A221D201E2B2C21271D1D2B1E191A19141A1922161B1B191A1D1B191B1A16
-151923191B1925251B2118172319191B1417160C0C0E26261B19191B18142A311B171717
-17171717000000002219201C000000001B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1D191D191D
-191D191D191D191D191D191D191D191D191D191B191B191B191B191B191B191B191B1912
-0C120C000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000211921192119211921192119211922192219
-2219221922191F1B1F1B201C201C201C201C201C1A191A191A191A191A001B002E462E00
-10101215261D32210C15151D26111511151D1D1D1D1D1D1D1D1D1D1515262626192E1F20
-20231D1A24231215201A2722241C24201F1C221F2D201C20151515261D1D1C1D181D1B10
-1D1D0C101B0C2D1D1C1D1D1418121D1B261B1B181D151D261F1F201D2224221C1C1C1C1C
-1C181B1B1B1B0C0C0C0C1D1C1C1C1C1C1D1D1D1D1D191D1D1D191D1D2E2E2D1D1D262E24
-2E2626261D1E1D2126211D1919262C1C191226261D26211E1E261F1F24312D1D2E15150C
-0C26261B1C111D15151D1D1D110C15461F1D1F1D1D121212122424242222220C1D1D1D1D
-1D1D1D1D1D1D1A0C1F18201815241C1C1B1C1D26261919192E2E2E1D241D121F18201820
-181D1D111F1C1F1C231E241D1B1D1B1A0C1A0E1A15221D221D241C201420141F181C121C
-12221D221D201820181A24261D1C181D17241D1D1936281C22111A320F1C10101C101F1C
-201820181D1B1D1B1D1B241D241D241D231D231D120C120C120C120C1510201B1B1A0C22
-1D221D241C241C20141F181C12221D221D221D221D2D261C1B0E1F1C2E2C241C152D262D
-262D261C1B0C1D1D212E2E2E2E0A1D1D1D1F23281929232A0C1F20201D20231220202722
-1E24231C1F1C1C202826121C1D181D0C1D1D1B151D1D0C1B1B1D1B171C1D171D1B26250C
-1D1C1D251D241A201F121215333326201C231F20201A221D2D1C23232022272324231C20
-1C1C262023212F30242A1F2030201C1C1B161D1B25181D1D1B1D201D1C1D1D19171B271B
-1E1C28291D251A19271C1B1D1619180C0C102A2A1D1B1B1D1A162E361D19191919191919
-00000000251C231E000000001D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1F1C1F1C1F1C1F1C1F
-1C1F1C1F1C1F1C1F1C1F1C1F1C1F1C1D1B1D1B1D1B1D1B1D1B1D1B1D1B1D1B120C120C00
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000241C241C241C241C241C241C241C251C251C251C251C
-251C221D221D231E231E231E231E231E1C1B1C1B1C1B1C1B1D001D00324C320012121417
-292036240D17172029121712172020202020202020202017172929291B3222222327201D
-27261517231C2A25271E2723221F252231221F221717172920201E1F1A1F1E121F200F11
-1E0F31201E1F1F151A14201E291E1E1A20172029222223202527251E1E1E1E1E1E1A1E1E
-1E1E0F0F0F0F201E1E1E1E1E20202020201B2020201B201F323231202029322732292929
-202020242923201B1B29301E1B1429292029242020292222273531203217170D0D29291E
-1F122017171F1F20120D174C2220222020151515152727272525250F2020202020202020
-20201C0F221A221A17271F1F1E1E1F29291B1B1B32323220271F15221A231A231A1F2012
-221E221E272027201E201E1C0F1C0F1C1725202520271E23152315221A1F141F14252025
-20221A221A1C27291F1E1A201928201F1B3A2C1F25121C36101E12121E12221E231A231A
-201E201E201E271F271F271F26202620150F150F150F150F1711231E1E1C0F2520252027
-1E271E2315221A1F14252025202520252031291F1E0F221E3230271E173129312931291F
-1E0D202024323232320B20202022262C1B2C262D0F2222232022261523222A252027261E
-221F1F222C29151F1F1A200F201F1E17201F0F1E1E201E191E1F19201E29290F201E2029
-20281C2322151517383729231F262222221C2520311F262623252A2627261E231F1F2922
-26243434272E222334231E1F1E181F1E281A20201E1F23201E201F1B191E2A1E201E2C2C
-20281D1B2A1E1E20181B1A0F0F112E2E201E1E201C18323B201B1B1B1B1B1B1B00000000
-281E262100000000202020202020202020202020202020221E221E221E221E221E221E22
-1E221E221E221E221E221E201E201E201E201E201E201E201E201E150F150F0000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000271E271E271E271E271E271E271E281E281E281E281E281E2520
-2520262126212621262126211F1E1F1E1F1E1F1E1F00200036523600131315192C223A27
-0F1919222C141914192222222222222222222219192C2C2C1D362525262A221F2A291719
-251E2E282B212B2625212825352521251919192C222220221C22201322220F13200F3522
-212222171C1522202C20201C2219222C25252622282B282020202020201C202020200F0F
-0F0F22212121212122222222221D2222221D222136363522222C362B362C2C2C22232227
-2C26221D1D2C34211D152C2C222C2723232C25252B3A35223619190F0F2C2C2021142219
-19222222140F19522522252222171717172B2B2B2828280F222222222222222222221E0F
-251C251C192A21212021222C2C1D1D1D363636222A2217251C261C261C22221425202520
-2A232A222022201E0F1E101E19282228222B2126172617251C2115211528222822251C25
-1C1F2B2C22211C221B2B22221D3F2F2127141E3A1121131321132520261C261C22202220
-22202A222A222A2229222922170F170F170F170F19132520201E0F282228222B212B2126
-17251C21152822282228222822352C212010252036342B2119352C352C352C21200F2222
-27363636360B22222225292F1D3029310F2525262225291725252E28232B292124212125
-2F2C1721221C220F2221201922220F202023201B21221B22202C2C0F2221222C222B1F26
-251717193C3C2C2521292525251F28223521292925282E292B29212621212C2529263838
-2A32252638262021201922202B1C2323202226222122221D1B202D2023212F30232B1F1E
-2D202022191E1C0F0F133131222020221F19363F221D1D1D1D1D1D1D000000002C212924
-000000002222222222222222222222222222222520252025202520252025202520252025
-2025202520252022202220222022202220222022202220170F170F000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000002B212B212B212B212B212B212B212C212C212C212C212C21282228222924
-29242924292429242120212021202120220022003A583A001414171B2F253E2A101A1A25
-2F151A151A252525252525252525251A1A2F2F2F203A2828292D25212D2C181A2820312B
-2E232E2828242A28392824281A1A1A2F252523241E24231424250F14220F382523242419
-1E1725222F22221E251A252F282829252B2E2A2323232323231E232323230F0F0F0F2523
-2323232325252525251F2525252025243A3A3925252F392E3A2F2F2F2525252A2F292520
-202F372320172F2F252F2A25252F28282E3E39253A1B1B10102F2F222415251A1A242425
-15101B582825282525181818182E2E2E2A2A2A0F25252525252525252525210F281E281E
-1A2D23242223242F2F1F1F1F3A3A3A252D2418281E291E291E242515282328232D262D25
-232523200F2011201B2B252B252E2328192819281E241724172A252A25281E281E212E30
-24231E251D2E2524204333242A15203E1323151523152823291E291E2523252325232D24
-2D242D242C252C25180F180F180F180F1A14282222200F2B252B252E232E232819281E24
-172A252A252A252A25392F242211282339372E231A392F392F392F24221025252A3A3A3A
-3A0C252525282C321F332C350F28282925282C182828312B262E2C2327242428332F1824
-241E250F2524221B25240F222225221D23241D2522302F0F2523252F252E21292818181A
-41402F28242C282828212B2538242C2C282B312C2E2C2329242430282C293C3D2D352729
-3C292324231B24232E1E2525222428252325241F1D22312225233333252E212031232325
-1B201E0F0F14353525222225211B3A44251F1F1F1F1F1F1F000000002F232C2600000000
-252525252525252525252525252525282328232823282328232823282328232823282328
-23282325232523252325232523252325232523180F180F00000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00002E232E232E232E232E232E232E232F232F232F232F232F232A252A252C262C262C26
-2C262C262422242224222422240025004366430018181A1F372B4831121E1E2B37181E18
-1E2B2B2B2B2B2B2B2B2B2B1E1E37373725432E2E2F342A2734321D1E2E2538323528352F
-2E29312E422E292E1E1E1E372B2B282A232A28182A2A12172812412A292A2A1D231A2A28
-372828232B1E2B372E2E2F2A3235312828282828282328282828121212122A2929292929
-2A2A2A2A2B242B2B2B252B2A4343412B2B374335433737372B2B2B31372F2B2525374029
-251A37372B37312B2B372E2E3548422B431F1F121237372829182B1E1E2A2A2B18121F66
-2E2A2E2A2A1D1D1D1D353535313131122B2B2B2B2B2B2B2B2B2B26122E232E231E342929
-28292A37372424244343432B342A1D2E232F232F232A2B182E282E28342B342A282A2825
-122514251F322A322A35292F1D2F1D2E23291A291A312A312A2E232E232635372A29222A
-21352B2A254E3A29311825481628181828182E282F232F232A282A282A28342A342A342A
-322A322A1D121D121D121D121E172E28282512322A322A352935292F1D2E23291A312A31
-2A312A312A42372928142E28434035291E4237423742372928122B2B30434343430E2B2B
-2B2E323A243B323D122E2E2F2A2E321D2E2E38322B3532282D29292E3A371D292A222A12
-2A2A281F2A2A1228282B2822292A222A283737122A292A372A35262F2E1D1D1E4B4A372E
-29322E2E2E26322A412932322E3138323532282F2929372E33304546343E2E2F452F2829
-28202A2835232B2B282A2F2B292B2A24212838282B293B3B2B3526253828282A20252312
-12173D3D2A28282B2620434F2B24242424242424000000003629332C000000002B2B2B2B
-2B2B2B2B2B2B2B2B2B2B2B2E282E282E282E282E282E282E282E282E282E282E282E282A
-282A282A282A282A282A282A282A281D121D120000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000003529
-35293529352935293529352936293629362936293629312A312A332C332C332C332C332C
-29282928292829282A002B004B724B001A1A1E223D305137142222303D1B221B22303030
-3030303030303022223D3D3D294B3333343A2F2B3A381F22342A3F383B2D3B34332E3733
-4A332E332222223D30302D2F272F2D1A2F2F151A2C15492F2E2F2F20271E2F2C3D2C2C27
-3022303D3333342F383B372D2D2D2D2D2D272D2D2D2D151515152F2E2E2E2E2E2F2F2F2F
-302930303029302F4B4B4930303D4A3B4B3D3D3D303030373D353029293D482E291E3D3D
-303D3730303D33333B504A304B222214143D3D2C2E1B3022222F2F301B142272332F332F
-2F1F1F1F1F3B3B3B37373715303030303030303030302A1533273327223A2E2E2C2D2F3D
-3D2929294B4B4B303A2F1F3327342734272F301B332D332D3A313A2F2D2F2D2A152A162A
-22382F382F3B2E3420342033272E1E2E1E372F372F332733272A3B3D2F2E262F253B302F
-2957412E371B2A51182D1B1B2D1B332D342734272F2D2F2D2F2D3A2F3A2F3A2F382F382F
-1F151F151F151F15221A342C2C2A15382F382F3B2E3B2E342033272E1E372F372F372F37
-2F4A3D2E2C17332D4A483B2E224A3D4A3D4A3D2E2C143030364B4B4B4B10303030333841
-28423944153333352F33381F34333F38313B382D322E2E33413D1F2E2F262F152F2F2C22
-2F2F152C2C302C262E2F262F2C3E3D152F2E2F3D2F3B2A35331F1F2254533D342E383333
-332A382F492E383834373F383B382D342E2E3D3339354D4E3B4533354E352D2E2D232F2D
-3C2730302C2F34302E302F28252C3F2C302D4243303C2B293F2D2D2F23292715151A4545
-2F2C2C302A234B583029292929292929000000003D2E3931000000003030303030303030
-30303030303030332D332D332D332D332D332D332D332D332D332D332D332D2F2D2F2D2F
-2D2F2D2F2D2F2D2F2D2F2D1F151F15000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000003B2E3B2E3B2E
-3B2E3B2E3B2E3B2E3D2E3D2E3D2E3D2E3D2E372F372F393139313931393139312E2C2E2C
-2E2C2E2C2F003000537E53001D1D21264435593C16262635441E261E2635353535353535
-35353526264444442D5339393A403430403E22263A2E463E4132413A39333D3952393339
-26262644353532342B34311D3435181D31185135323434232B2135314431312C35263544
-39393A343E413D3232323232322B313131311818181835323232323235353535352D3535
-352D35335353513535445241534444443535353C443B352D2D444F322D21444435443C36
-36443939415951355326261616444431331E3526263434351E16267E3934393434222222
-224141413D3D3D18353535353535353535352F18392B392C2640333331323444442D2D2D
-53535335403422392B3A2B3A2B34351E39323932403640343134312E182E192E263E353E
-3541323A233A23392B332133213D353D35392C392C2F414434322B34294235342D614833
-3D1E2E591B321D1D321D39323A2B3A2B3431343134314034403440343E353E3522182218
-22182218261D3A31312E183E353E35413241323A23392B33213D353D353D353D34524433
-31193932524F41322652445244524433311635353C5353535312353535393E482D493F4B
-1839393A34393E223A39463E36413E323833333948442233342B35183433312635341831
-3135312A32342A34314444183432344434422F3A392222265D5C443A333E3939392F3E34
-51333E3E3A3D463E413E323A333344393F3B5657414C393A563B323331273431422C3535
-31343A353235342C293146313632494A35422F2D46323135272D2B18181D4C4C35313135
-2F275361352D2D2D2D2D2D2D0000000043323F3700000000353535353535353535353535
-353535393239323932393239323932393239323932393239323932343134313431343134
-313431343134312218221800000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000041324132413241324132
-41324132433243324332433243323D353D353F373F373F373F373F373331333133313331
-340035005C8C5C002020242A4B3A6343192A2A3A4B212A212A3A3A3A3A3A3A3A3A3A3A2A
-2A4B4B4B325C3F3F40473A354745272A40334E45483748403F39433F5B3F393F2A2A2A4B
-3A3A373930393720393A18203618593A3839392730243A364B3636303A2A3A4B3F3F403A
-4548433737373737373037373737181818183A38383838383A3A3A3A3A323A3A3A323A39
-5C5C5A3A3A4B5B485C4B4B4B3A3B3A434B413A32324B583832244B4B3A4B433B3B4B3F3F
-48625A3A5C2A2A19194B4B3639213A2A2A3A3A3A21192A8C3F3A3F3A3A27272727484848
-434343183A3A3A3A3A3A3A3A3A3A34183F303F302A4738393638394B4B3232325C5C5C3A
-4739273F3040304030393A213F373F37473C473A373A373318331B332A453A453A483840
-2740273F3039243924433A433A3F303F3034484B39382F3A2E493A39326B503843213363
-1E38212138213F37403040303A373A373A37473947394739453A453A2718271827182718
-2A204036363318453A453A4838483840273F303924433A433A433A433A5B4B39361C3F37
-5B5848382A5B4B5B4B5B4B3936193A3A425C5C5C5C133A3A3A3F455032514554183F3F41
-3A3F4527403F4E453C4845373E39393F504B2739392F3A183A39362A3A391836363B362E
-383A2F3A364C4B183A383A4B3A4934403F27272A67654B4039453F3F3F34453A5A394545
-40444E454845374039394B3F46425F6048553F415F413739372B393749303B3B3639403B
-383B39312E364D363B3851523B4935324D37373A2B323018182054543A36363B342B5C6C
-3B32323232323232000000004A38463D000000003A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3F
-373F373F373F373F373F373F373F373F373F373F373F373A373A373A373A373A373A373A
-373A37271827180000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000004838483848384838483848384838
-4A384A384A384A384A38433A433A463D463D463D463D463D393639363936393639003A00
-649864002323272E52406C491B2D2D4052242D242D404040404040404040402D2D525252
-37644445464D3F394E4B2A2D4538544B4F3C4F46443E494463453E452D2D2D5240403C3E
-343E3C233E3F1B223B1B613F3D3E3E2B34273F3B523B3B353F2D3F524444463F4B4F493C
-3C3C3C3C3C343C3C3C3C1B1B1B1B3F3D3D3D3D3D3F3F3F3F403640404037403E64646240
-4052634F6452525240404049524740373752603D3727525240524940405244444F6B6240
-642E2E1B1B52523B3E24402D2D3F3F40241B2E98443F443F3F2A2A2A2A4F4F4F4949491B
-40404040404040404040381B443445352D4E3D3E3B3D3E5252363636646464404E3E2A44
-34463446343E4024443C443C4D414E3F3C3F3C381B381E382E4B3F4B3F4F3D462B462B44
-343E273E27493F493F45354535394F523E3D333F324F403E3774573D4924386C203C2323
-3C23443C463446343F3C3F3C3F3C4E3E4E3E4E3E4B3F4B3F2A1B2A1B2A1B2A1B2D22453B
-3B381B4B3F4B3F4F3D4F3D462B44343E27493F493F493F493F63523E3B1E443C63604F3D
-2D6352635263523E3B1B4040486464646415404040444B5736584B5B1B4445463F454B2A
-4545544B414F4B3C433E3E4557522A3E3E333F1B3F3E3B2E3F3E1B3B3B403B323D3F333F
-3B52511B3F3D3F513F4F3946442A2A2D706E52453E4B444545394B3F613E4B4B4549544B
-4F4B3C463E3E52454C4767694E5C444667473C3D3B2F3E3C503440403B3E46403D403E35
-323B543B403D5859404F3937543C3C3F2F37341B1B225B5B3F3B3B40392F647540363636
-3636363600000000513D4C4200000000404040404040404040404040404040443C443C44
-3C443C443C443C443C443C443C443C443C443C3F3C3F3C3F3C3F3C3F3C3F3C3F3C3F3C2A
-1B2A1B000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000004F3D4F3D4F3D4F3D4F3D4F3D4F3D513D513D
-513D513D513D493F493F4C424C424C424C424C423E3B3E3B3E3B3E3B3E00400000020100
-000007000600000300070014B706020400060204002FCDDDCD002FCDDDCD313021112111
-2521112101000600FA800500FB000600FA0080050000000201230000020305D100030007
-0027401703030202075505080F0901005D042B035D0F051F0502052F5DE4FDE45D003FED
-332F3F3130010323031323353302031AAA1CD6CCCC05D1FBC90437FA2FD3000200A803D1
-0304061400030007002640150206060307010F09400902032C0040000100042C072FED33
-5D2FED5D003F3C332F3C3130010323032303230303042B842BA82B842B0614FDBD0243FD
-BD024300000200C3000005C905D1001B001F00B1407140215609740570097B137B167B17
-7B1A080A091E1D160F1501671501151E0C0F1013140B1407081F1C17001801681801181E
-0502011A06190662191462700B010B03110B111903040D001B011B1B0D171A011D0410B5
-131E020509040CB50F070F1318040B00140114030F0B4F0B020B08003F5D3F5D1217392F
-ED17392FED1739012F332F5D1217392F2F2F5DE42FE4313087C0C0C0C0FD5D71C0C0C0C0
-C08710C0C0C0C0FD5D71C0C0C0C0C0015D01210321152103231321032313213521132135
-2113330321133303210521032105C9FEB35C0134FEA9688168FEF2688168FED6014D5CFE
-CC0157698169010E698169012AFE35FEEE5E011203A4FE8887FE5B01A5FE5B01A5870178
-8701A6FE5A01A6FE5A85FE840003009BFE9704880628002C0033003A00BC408D7D087E16
-70197620702C7A36060E16012B1B16122B230D350D3C163C24352B430D4A164C24432B5A
-08532053335A356B0865206529632B6A30643A171D40090B371D382E11221D2226471B18
-312D1227373400030A067F1E011E050A11470A05060F3C1F3C0221210334207F00010031
-201818063F094F09020900112D1B1E263706031E0930064006700603062F5D33ED173932
-2F5D12392FED2F5DED12392F5D002F3333ED2F2F2F5D121739ED33332F1139392F2B3130
-5D5D011406071123112E012735331E01171E0117112E01272E01353436371133111E0117
-15232E0127111E01171E0125110E0115141601342627113E010488F2C47684E855101362
-2E348B4F28441DA38EE9D17665D4480E4BA3851E461A95A3FDD46B926C02007584788101
-7C9BCD13FE960165013127C60E351113210301B1080F0829A57994CC110110FEF2022C1D
-C42E4709FE51051105209CE8019D08655A5B5CFE585E5719FE620C6200050095FFE30807
-05ED000B000F001B00270033009C40720908060A0918061A0F351808170A1818171A2908
-260A2918261A460D480F4035560D580F680E13791F7625792B76310425512F034F030203
-031F5109020F030E082B51201940190219193151130A4F0C400E020C0E2E2A0016011616
-282A0C0E060F10401002101C2A0F00010000222A10062F33ED332F5DED2F5D123939ED33
-2F5DED2F2F5D003FED332F5DED3F3F3FED332F5DED5D3130015D01140623222635343633
-321625012309011406232226353436333216013426232206151416333236013426232206
-1514163332360374BDB2B6BABEB2B5BA02B3FCF4A5030C0285BEB2B5BABDB2B6BAFABB59
-64665858666459049359646658586664590434E0DADADFE0DADCC0FA2F05D1FBCCE0DADC
-DDE0DADA01B8AC8888ADAD8787FE17AC8888ADAD878700030073FFE1061305F0000B0018
-004500E1406F090F190F3C0C3015301D352D3E3D4F1A471D4F44791C0B6A25603F7B0576
-087B0F761D7A25703E703F090508062A06371408161D142A1437153F290C2A1D26373008
-300A4008400A490C41144F1C431D46204C21412D413C5108590D5B25690566086B0F601D
-1E3F0C161D20231903B8FFC0403B12173703AA190D2C093E05233502163F230A1E082C0D
-3E032F00143806142F3F0C4513201D2F38041A26001E011E1E45140D1A011A1A13152673
-4610F6ED332F5DED332F5D11121739111239392FED2FED121739003F3FED3F121739ED2B
-2F12393912393931305D5D015D013426232206151416173E0113010E01070E0115141633
-323601151406070123270E01232224353436373E01372E01353436373E01333216151406
-070E0107013E0137362635031871585C744F836265C2FE221F3E1F1C24AB9D5DB7016B32
-3C017AF6E573F07FD0FEED34232368356E61353532A161ADD6181D20765E01730E0E0102
-0104A75F6D7B594B744F2387FD0001D20F312A276E4592B35B02AE6060F06DFE90E08E71
-F3C55C86312F531F48926F437932303CAF862C6F2C315A20FE96286034388A30000100A4
-03D10182061400030015400A020203010F0501002C032FED5D003F332F31300103230301
-822B882B0614FDBD0243000100B5FE64030F061400150048403709010907190119072803
-28054F01480348054F075F015F076F016F077F01780278067F07120701010C7A04010830
-000100000F1F04881610F4ED332F5D3C5D003F3F3130015D012326021110123733150E01
-070602151412171E0117030FE5B1C4C4B1E551933F3C4B493E3C9A4DFE64CB01E0012D01
-2D01E0CB0A49BF7F7BFED8A4ABFEE4807BC7450000010093FE6402ED06140015004E403D
-060306131503151326012603261326154701400340134715500350136003601379007602
-700370137614151201040C750001123F040104040B1F00921710F6ED332F5D3C5D003F3F
-3130015D0110020723353E01373612353402272E01273533161202EDC4B1E54D9B3B3E49
-4A3D3F9351E5B1C4023CFED3FE20CB0A45C77B80011CABA401287B7FBF490ACBFE200001
-00A70276047106140011009040094F1301114009103708B8FFC040580910375B025B0554
-0B540E6B026B05640B640E7B027B05730B730E0C01060F0A0B0E08110502060C064F0450
-0402040A0F0C01040C010F131F130200110D4010011008070C4F090109100E020304050B
-060D2809700C010C2F5D33ED1739322F5D1239392F5D1239395D003F335D332F5D331217
-392F332F3331305D012B2B5D01072513231305272D013705033303251705047140FE9606
-8105FE9741017DFE8341016A068107016B40FE8403776ED5FE980168D66ECFCF6ED50167
-FE99D46ECD00000100D2001B05BA04FD000B0039402303AC01045408AC0A0F070107400D
-01300D400D0200AB0A800101012A05AB07400401042F5D3CE4FD5D3CE45D5D002F5D3CE4
-FD3CE4313001211123112135211133112105BAFDDFA6FDDF0221A60221023CFDDF0221A0
-0221FDDF00010093FE8E023F011D0003003540261A012A012B0235003902450048025500
-590264007400C5030C0202035604000004021A0202022F5D332F0010F4322F3130015D09
-012313023FFEE692AE011DFD71028F00000100990231030902E600030020401401420F02
-01020F054F004F055F005F05050000022F332F5D002F5DED3130012135210309FD900270
-0231B500000100FD000001EC011D00030016400C02560108002D2F013F0102012F5DED00
-3FED31302123113301ECEFEF011D0001FFE2FED0035C0614000300364025030100050116
-01250138004900440156016701770186010A011202032F02010200010000022F332F003F
-2F5D31300187ED5D87C009012301035CFD33AD02CA0614F8BC07440000020089FFE1048F
-05EF000B0023004140303601390B340C3B123B18341E4501490B440C4B124B18441E0C15
-4909022149030A0F21009E250F251F25021B2106982410F6ED5D10F6ED003FED3FED3130
-5D011002212002111012212012013E01353426272E01232206070E01151416171E013332
-36048FFBFEF8FEF4F7FA0109010CF7FEF92319192423795F5E7B24221916242179645E7C
-02E9FE6FFE89017C018A018D017BFE7FFCB551DB9A98E04E4D4E4E4F4AEE8E9CD2534E52
-4E00000101160000043C05D6000F003A4023054606060C030E034801080F111F11020502
-1F0F010F0F0C0E20023F036F03700303032F5D33ED39322F5D2F335D003FFD323F332FED
-3130290135211121353236373E0137331121043CFCDA0136FECA3F90252E35049B013098
-03E6881514194D41FAC2000100A10000049105F000200097407B501F601F020503061116
-03151124113B05380D350E3F1D3F1E391F4B05480D450E4F1D4F1E491F5F035D045D055B
-0956115F195E1B5D1C5F1D5F1E6A036406651162156F1E700274117F1A7F1C7F1E25000F
-100F2D082F1C300F400F060F0F0B4A1302021F4A01081F0208211616209E220F221F2202
-101002992110F6322F5D10F6322FED1239003FFD323FED332F5D31305D015D2901353E01
-373E013534262322060723353E01333204151406070E01070E0107210491FC1069D35BC0
-8E99895BD4650A47ED6FE501042B2A27694B6BE4630321D15AB459BADB7F74834042D223
-3ADDBD5593423E784969C554000100A7FFE1047C05F0003D009540700B0B052F1A0B152F
-290B262F293C3C0B35143122342F4A0B45144322432F56015905590B552F6A0B662F6A3C
-780B762F74357B3C1A343A443A023B3A1E491F012D112D022D2D294A1F0931020F0D1F0D
-020D0D114A090A2321371E2E1621032E1E3A37040C03A03F0F3F1F3F020C9A3E10E65D10
-E611173910ED2F2F2FED003FED332F5D3F1239ED332F5D2FFD39395D31305D011E011514
-06070E012322262735331E01333236373E01353426272E012B0135333236353426272E01
-2322060723353E01333216171E0115140607151E01040E303E4A434BCB797CF04D0F55E6
-6B3F8E2C2E2D332D2D804A5A4698B52E292B623E5FD65F0A47ED6F6DA643484AAF77307C
-02CD2B826766AA3F46433B23D1384A2A292C6A5150691E1F17A67F7A36511A1A14443ED1
-233B282C30885B7CB9180E0833000002004D000004B305D1000A000D00684041040D140D
-240D340D440D700D060C0D480606070C0607090D4901050503070303083F0A4F0A020A0F
-0F1F0F02070C04200A090D064F060101010F061F063F0603062F5D332F5D12393333ED39
-395D2F5D003F3F12392F3CFD321239393130018710FD04C0015D01231123112135013311
-3321110104B3DDC0FD3702D1B8DDFE63FDBF01A3FE5D01A3E60348FC7202A0FD60000001
-00BBFFE1048505D1002A0070404E0A081A082B083D0835113D164B0844115A0854296A08
-7A080C1D1D1A490F251F2540250325214A25061E020F0A1F0A020A0A0E4A060A2022204F
-1D011D142100201D09009F2C0F2C1F2C02099B2B10E65D10E611393910ED2F5DED2F003F
-ED332F5D3F1239ED2F5DFD322F31305D011406070E012322262735331E01333236373E01
-353426272E012322060711211521113E01333216171E0104854C4248C7837AE24E0E52DC
-6A4785342C2D352F34955C58A33B0380FD412B5A2179B64C505801D968BE41464B3324D3
-344928322B784F4D6A20261F180C02FFAFFE740404293437AE0000020089FFE104A705ED
-0022003700644044060D160D3925333133374925423143375F01560D5020502165217531
-0E1A0329491D1313174A1D030F023549030A1A2C2F122321001209009C390F391F39022F
-2109983810F6ED5D10E6113910ED2F123939003FED3F1239FD322F2FED123931305D0114
-002322262726023534123736243332161715232E01232200073E01333216171E01073426
-272E01232206070E01151416171E0133323604A7FED5D96EB445565D555D580116B93B50
-290A1C713BD7FF001554A36B5F914C5859CB373F2E703D55924D020241392E6B3F91A601
-E3E3FEE14443530112C1C6013277717F0A0DBF0F1BFEF3E5333523353DBA8D5D7A2D2014
-282A16291F9EB7352C29B1000001009A0000049505D10006004F403209010A0224014801
-4B0258027903070301000120020203000002034A050302080F081F087B02030300020204
-0F00010000042F332F5D12392F12395D003F3FFD11392F3130018710ED87C0015D090123
-012135210495FD5ED602CDFCB003FB04F2FB0E0522AF0003007AFFDE049C05F300190028
-0037009440702D2B3415332234273433441541224427453350155B195A1B5A1F54225F2B
-592C5F31543354376008620E6212621960236027760E76127B2C86121DA926A62F022616
-0A2F04031D4710023548030A1A200013011313002F0A0D292100162620009D390F391F39
-0220210D0D322106973810F6ED332FED5D10E411393910ED11393911332F71ED003FED3F
-ED1217395D31305D01140023222435343637352E0135342433320415140607151E010334
-26232206151416171E01173E01133426272E01270E01151416333236049CFED3E4F2FEE1
-908378730114D5DF010A7E7A8C94EDA5807EA15152258B42634C1F51762F705D5A6DBA8F
-92AF019FC1FF00FAC37CC93B06409872A8E0D6A565C337063CB0024F6B7F786648692912
-3A13428EFD735C6F3816262231A86A87B09600020071FFE3048F05EF0022003700644045
-0804190429043C253C2B352E4C254C2B432E58045F175D18521B70017B250F111D324914
-294914061D020A0A0E4A060A351109232100091A009E390F391F39022C211A963810F6ED
-5D10E6113910ED2F3939003FFD322F3F1239ED2FED123931305D01140207060423222627
-35331E01333212370E01232226272E01353400333216171612073426272E012322061514
-16171E01333236373E01048F595A5BFEEEB9345C240A1D6A41DDFB145DA4615C954B5859
-012CD86CB845555CCA40382F6C3F90A736402D6C424EA04601030342C3FEC270727C0B0C
-BF0F1B0109E9383024343DBC83E4011E434353FEFBA49BBC342D27B4A35F782D1F152A28
-15290002015A00000249045D00030007001E4010015602050656050807002D0600010101
-2F5D3CFD3C003FED3FED313001231133112311330249EFEFEFEF0340011DFBA3011D0002
-00E6FE8E0292045D00030007004C40370A050A061A051A062A052B063504390645044806
-5504590664047404C5070F01560205060607560806063F044F04020404002D000101012F
-5DFD322F5D332F0010F4322F3FED3130015D01231133130123130249EFEF49FEE692AE03
-40011DFCC0FD71028F00000100FE004D058004CB0006005E401073050105045403020306
-540001002C00B8FFE240260A1837031E0A1837031F002F0002030F000100400801300840
-080204050100004001500102012F5D332F1239395D5D002F5D335D2F2B2B31304B535887
-10FD8710FD05C059015D250135011509010580FB7E0482FC72038E4D02017C0201B4FE75
-FE75000200F5016A059703AE00030007003540200554060154060F020102400901300940
-09020405012F004000020000400101012F5D332F5D1239395D5D002F5D33ED2FED313001
-213521112135210597FB5E04A2FB5E04A2030EA0FDBCA0000001010C004D058E04CB0006
-006040107C030103045405050602540101002C01B8FFE240280A1837051E0A1837051F01
-2F0102050F010101400801300840080203050100002F013001400103012F5D332F123939
-5D5D002F5D335D2F2B2B31304B53588710FD8710FD05C059015D09013509013501058EFB
-7E038EFC720482024EFDFFB4018B018BB4FDFF00000200A0000003ED05EF001C00200069
-40470F221F2224140335184F024F034F0544185C0554186904691064187418741C0C0870
-090109061A1E161612341A02081F551E08202B1F1F061F7F0901090F1509172000010000
-172F332F5D1239ED2F5DED332FED003FED333FFD322F111239395D2F31305D015D011406
-070E01071523113E01373E013534262322060723353E013332160123353303ED46393892
-52B34197303A4099796CC1380A46D760D7F9FE75CCCC047362993B39642FE1013125582D
-346F56716F4423CC1B2BD1FAE2D3000200B0FF1E074E05EF0042004F00D640A206020F04
-0B050A090F1B0E1C0F3F0F4016021F041C051F1B1F1C142214271F3F1F4125022C042C05
-2F1B2F1C242220272F3F2F414740444856481D0A05052759496E09650D691A6821652766
-3F664174167B1B70277439743B0F120511081247520E1440151B371404044D53082D2D2A
-510E083D311E51313D020F2D012D051143122D144A123F0B010B0F512051021829140B37
-0F0020007F000300002429376B5010F6ED332F5D123939ED5D2F5DED2F33FD32322F5D00
-3F33ED2F123939ED332F2FED332FCD2B2FED331239392F31305D015D0114020721270E01
-23222635341233321617353311333E013534022726242322040706021514121716043332
-3637150E0123222427260235341237362433320417161201112E01232206151416333236
-074E514BFE481B4A8858A8C9F6AB4970419FF32A2B5B5858FEFCA5A0FEF75F606D685F63
-010A9D56B75461A859BAFEC2727380867474013EB5C401346A6A71FD8F3F64398192747B
-438602978BFEFC6B743C40FEE4E3010E212130FCB64BE159A4010C606067746262FEEF9A
-A5FEEF61656716188E150F7F72730142C3B9013F7575867C7070FEC5FE4002061D19B4A6
-A3A73E000002001A0000055E05D10007000A009840694009014A0645070209090A080287
-01010114000700090A0387040104140505067C067307020334300A400A700A030A090A06
-03017A050105080F0C0106070903050C002400390042005A006A0074000700006E0C0F0C
-010A052B0536054D05550565057B050705640B10E65D5D10F62F5D1217395D003F5D3C3F
-39392F5DED3130015D8710FD5DC0C0C08710FD5DC0C008C0015D005D2123032103230121
-130901055ED392FD7C92C9021E01087CFEFBFEFA019FFE6105D1FC7802DBFD25000300C8
-0000052B05D100150024003300524033050C150C270C550256157F190612112C341E1E07
-1D3408032D3407081615122C0F0F0725150071350F354035021E2C14076C3410F6FD325D
-10F6ED12392F1239ED003FED3FED12392FED39393130015D011406070E01232111213216
-171E0115140607151E01013426272E012B0111213236373E01133426272E012321112132
-36373E01052B544754C99BFDF001B9A3A24A524A6C5A97AEFEB324282F8663EC01005D6E
-2F2F277F3647308962FEC9010682A635383401CA6FAA37423805D118262B875E6A952D08
-1FCB0204364A171B0DFE52131E1E5FFD9A5A6A25190FFDD61B24276400010073FFE50546
-05EC002A0061404A05010D09061416011B0914152515361543145B08580A580E5B105B28
-600361147002760F70141316161A3412022A2A2634060A1600712C0F2C010F2C1F2C2F2C
-3F2C6F2C0520150C682B10F6ED5D5D10F63C003FED332F3FED332F3130015D250E01070E
-012322242726023534123736243332161715232E01232206070E01151416171E01333236
-373305463759483D8F56A2FEF762606C68625F010DA478EF920F7BF28A71B547454D5543
-46BB688FFA6D0E6C182A17131B5B615F0125C2B801226461663A49EB675E494D4BE5969D
-E2474A476262000200C8000005B205D1000E001D003A4027391249126902680D04163408
-03173407087600010F1500741F0F1F2F1F401F601F041714076C1E10F6ED5D10F6ED5D00
-3FED3FED3130015D011402070E01232111213204171612073426272E012B011133323637
-3E0105B2B19366FBCDFE880174DA01015998AACF7A7958C68ABABA8FD5596F6F02E7CBFE
-B65B3F3805D13F375FFEC4D6AFF0453227FB832A3947E800000100C80000049D05D1000B
-003B402309350006100602060601053502030A350108040008010800730D0F0D01060914
-016C0C10F6FD325D10F63C5D3C003FED3FED12392F71ED31302901112115211121152111
-21049DFC2B03D5FCF1030FFCF1030F05D1B0FE68B0FDD700000100C80000047F05D10009
-0034401E053502020701350803070800034F0B02030300640B0F0B01020514076C0A10F6
-FD325D10F4322F5D003F3FED12392FED313001211121152111231121047FFD0F0287FD79
-C603B70521FE5CB0FD3305D100010073FFE305A205EC00240069404907010906060E1D06
-130E210E350E4901410E510E6506650B630E740E741C0F223540230123230C0310101734
-0C021D34030A7609012210220910216C0075260F264026021A1509682510F6ED5D10F6ED
-3312392F2F5D003FED3FED332F1112392F5DED3130015D25060423222427260235100021
-32041715232E01272E01232200111000213236371121352105A27AFEDF87AEFEDE666770
-01A1016C7F010999121F763945AF6FFAFEDD0130010660BF48FE7102536E385360606101
-23C30165019D3D49EB184E1A1F29FEBFFEEEFEDFFEBF261E016DAE00000100C80000053B
-05D1000B003A4023033500081008020808050A070301050809021400780D0F0D400D500D
-03080314056C0C10F6FD325D10F6FD32003F3C3F3C12392F71ED31302123112111231133
-11211133053BC6FD19C6C602E7C602D9FD2705D1FDB8024800010089000002D505D1000B
-002E401909043206030A033201080D6D0A080B5A0A140305025A036D0C10F6F43210FDF4
-3210E6003FFD323FFD32313029013533112335211523113302D5FDB4C3C3024CC3C39804
-A19898FB5F000001002CFFEB02EA05D100150030401C6A017C01021233150307070B3403
-09131312140077170F170106651610E65D10F6ED332F003FFD322F3FED31305D01140623
-22262735331E01333236373E01351121352102EAEFC930A0360B29783F5C6D1A1B0FFEC5
-02010183C4D4110CB90E1E2A2728744C03659E00000100CD0000057505D1000B00A74075
-190956015C09030509280938094A0968098A09D809070F010A091E0119022A012B093901
-3909350B49014909450B5C01650B72007908100202038801C8010201B3000B000809B302
-0B0A030A840A010802050A07030105080B02030A0A0F0D20003000400004500001006E0D
-400D01080314056C0C10F6FD325D10F65D5D322F123939003F3C3F3C1239393130015D87
-10C0C07AFD1804C00187107AFD5D1808C0015D71722901010711231133110133010575FE
-FFFDB394C6C602D3F0FD6702979EFE0705D1FCF70309FD44000100C80000047605D10005
-002040110203043501080000070F07010414016C0610F6ED5D11332F003FED3F31302901
-113311210476FC52C602E805D1FADF00000100C8000005F605D1000C00794059560A0138
-023805360A6F0260036F05600A7F0270037F05700A0B5509560A5A0B0364037403750903
-050A020309000410043404440454046A04060404070B0903010708090A0B030502140078
-0E0F0E1F0E500E030513076C0D10F6ED5D10F6ED111739003F3C3F3C12392F5D12173931
-30015D72005D722123110123011123112109012105F6C6FE6276FE65B9010E018D018001
-130503FC970369FAFD05D1FCC3033D00000100C80000053805D10009006B404E0C071F07
-34074507510761077107077606010F0102061F0115063406440653066B0160067F017006
-0B0C010406025A01550602020701080603010408060102071300780B0F0B400B02021304
-6C0A10F6ED5D10F6FD113939003F3C3F3C12393931300172715D5D005D21230111231121
-0111330538F5FD3EB901330284B90534FACC05D1FB4004C000020073FFE105DA05F00017
-002300564042040004060B0C0B1217001706190C19125701570553075F0B580D58115F13
-53171076097915021B3415022134090A18150373250F25010F251F253F25031E150F6824
-10F6ED5D5D10F6ED003FED3FED5D3130015D011612151402070E01232224272602353412
-373624333216131000232200111000333200051E5B6163595CFBA19DFEFF5A5A61605C58
-01059AA0FF47FEFCE1E3FEFD0108DEDE0107052664FEDEB8B8FEDD6165666863630120B9
-B6012167626869FD610122013BFEC5FEDEFEDBFEC9013700000200C80000049605D10010
-001F0056403D3A143D1D4B144B1D500E540F650F071934000710070207070918340A0309
-080F211F21021115200030004000700004006F210F213F2102190714096C2010F6FD325D
-10F45DED5D003F3FED12392F5DED3130015D011406070E012B01112311213216171E0107
-3426272E012B0111333236373E010496453E4DD2A0C6C6019486BA48555DCE3637307B5E
-C4A778962F2F27040F63A93E4D4DFDD505D12D3039AA874D72241F1BFDAD2B2F306A0002
-0073FE7705F805F000250031008640610B0C0B120418041D190C19121518161D5C0B590D
-59115C1353175719571D742010551F651F751D742D0425252135030B29341E0609760979
-150215022F34090A1E130600337326151B0009061D030F1B73330F33010F331F333F3303
-2C150F683210F6ED5D5D10E61117393210EDE62F2FED003FED3F5D123939ED3FFD322F31
-305D015D010E01232226270E01232224272602353412373624333216171612151002071E
-01333236373303100023220011100033320005F83C753DAED309182D159DFEFF5A5A6160
-5C5801059AA0FF595B61DFBC0464842971181BECFEFCE1E3FEFD0108DEDE0107FE930F0D
-BFB204036863630120B9B60121676268696164FEDEB8FEEFFE8A4B727E190A039F012201
-3BFEC5FEDEFEDBFEC9013700000200C80000059805D10010001F007A405408011D012D01
-3A01391D450F4814481D5A01560F59146F016902600A650B7E01750B110201B300100010
-071A34400201020205183407030105080F211F2140210311150F0D010D0D102000010019
-031400056C2010F632FD322F5D39392F5DED5D003F3C3FED12392F5DED12393130018710
-7AFD18C0015D29010121112311213216171E0115140607133426272E012B011133323637
-3E010598FEFFFE0EFEE9C601A187B448515BA28E612D342B7650E9C85E8C312D2B0250FD
-B005D1232D339B77A1D93701A34063221D17FDCE212D2A6D00010086FFE5050205EC0030
-009A40790B09031F00231B08141F29082818241F242F390836103813351F362A4A084510
-4913451F4A27442A5802551B551F552D6B19661B651F662B602F7B16701F7020742A742D
-86122309400E103708400E103700111A28041D06212125341D020A0A0E34060A2128151A
-111500211A090074320F32703202096A3110E65D10E611393910ED2FED2F003FED332F3F
-ED332F1112173931302B2B5D011406070E012322242735331604333236353426272E0127
-2E013534243332041715232624232206151416171E01171E010502514950D596A1FEFF85
-0E71012882B8CD61634BAF62C6BF013CF39D0106650E55FEEB919FC1607940EC52A6A801
-A957AA3B40483C3BF85E668A73635E1A141A142ACBA3BBEF3C2CEA485F84685D6A1C0E28
-152CB20000010000000004EE05D1000700274018010435060303080F091F094F0903005B
-0114045B4F0501052F5DF4FDE45D003F3FFD323130012111231121352104EEFDECC6FDEC
-04EE0521FADF0521B000000100B2FFE1052905D1001D003A4029231223183D033D094C03
-4C0977137717081C0D031534060A1B1400761F0F1F1F1F401F030F140C6B1E10F6ED5D10
-F6ED003FED3F3C31305D011406070E01232226272E01351133111416171E01333236373E
-01351133052947514DCE898CD0475147C621272C976A6B962D2721C60256A2F1504C464A
-4852E8A9037BFC7B798C394142414239936D038A0001001A0000055E05D10006008C4066
-470148020205040507065706860603061400000105070457048604030414030203080144
-014B02580273017C02060005027503010303020845004A0302020103040024003A005A00
-6A00740006006E080F08010F08010B032B033503550365037B030603640710E65D5D5D10
-F65D1139395D003F3F5D1239393130015D8710FD5DC08710FD5D08C0015D090121013309
-01055EFDE2FEF8FDE2D401D301D305D1FA2F05D1FAE2051E0001005C0000078D05D1000C
-00BB409E470367037903030D010B020404020505080C0B1701190318051908190B290329
-08290B3B023903320434083C09330A3A0B4B02440444084C09430A4B0B55015A0255045A
-0557075909550A65016A0265046A056A09650A7F02700473087C09720A7C0B2E0C140001
-000714060506030301000300090205080B03090C0602060302083B0034064B0044067A00
-75060600720E1F0E3F0E5F0E7F0E0406670D10EE5D10E65D003F3F1217395D5D31300187
-10FD8710FD015D005D09012309012301330901330901078DFE7DDFFEC7FECEDAFE76CB01
-390134C90137013705D1FA2F04D4FB2C05D1FB2A04D6FB1E04E2000100440000053805D1
-000B00C2409775017A07020A04050A1A04150A2C04230A37094D04420A58035F04580557
-09500A570B68036D0468056709600A670B7B04730A170B14000100091408070803140201
-020514060607050407010A0B0602080302080F0D01060216022602360247020509081908
-290839084808050208070A04010406020D00160026003600470050000600660D08090619
-062906390648065F060606660C10F65D3210F65D321117392F2F5D5D5D003F3F12173931
-30018710ED8710ED8710ED8710ED005D015D09022309012309013309010538FDFE0201E5
-FE6AFE60D80207FE05E40191019A05D1FD20FD0F0265FD9B02E802E9FDA3025D00010006
-000004E605D10008007C405D2C012C04280735074001400440075007680470070A160619
-08270628085606590865066A08080814000100061405040502000D050200010004000703
-040107080402050302080F0A1F0A4F0A7F0A04005B01070114045B4F057F0502052F5DF4
-ED3910E45D003F3F1217395D3130015D8710ED8710ED015D005D09011123110133090104
-E6FDF4C6FDF2DB0197019B05D1FCBCFD7302780359FD66029A000001007E0000050805D1
-000900594036030708060813082608360846085608660876080808B30202030707033506
-03020208350108040803020707040209730B0F0B0102690A10E65D10E61139392F123939
-2F003FFD322F3FFD322F31300187107AED5D1887C0290135012135211501210508FB7603
-91FC910452FC6603B0B80469B0B3FB92000100EFFE7802F706140007001C400E05520201
-0652010B030000061F012FED332F3C003FED3FED3130012111211521112102F7FDF80208
-FEA6015AFE78079C8FF9820000010046FED003C006140003003A40280301020A0119012A
-0138014B01590168017801890109011200032F000100030100006002700202022F5D332F
-003F2F5D31300187ED5D87C00123013303C0ADFD33B0FED00744000100ABFE7802B30614
-0007001C400E045207010352010B031F000005012F3C332FED003FED3FED313001213521
-1121352102B3FDF8015AFEA60208FE788F067E8F000100BA02AA05D205D1000600474034
-3B0133034B0145035F0150036F0160037F0170030A69027B02020102050F031F033F035F
-036F0305030305030000004F000200042F335D2F003F332F5D12393931305D015D012309
-0123013305D2C6FE39FE3AC5024D7E02AC0273FD8B0327000001FFFCFED4051AFF4C0003
-0011B6015002000005022F11332F002FED313001213521051AFAE2051EFED47800010154
-051602FA068C000300244016480159026902790204500360037003030303010000022F33
-2F002F332F5D3130015D0123013302FA95FEEFF30516017600020068FFE1041D04780026
-0033007A40540C0A0423190A152304590E511E5C2C690E601D6F2D7B0A7A14701D7B2C0A
-0208283D3011401102111120084F1C011C1C183F20043141080A01080F1D011D1127021A
-001D0B0091350F351F353F35032E1B0B853410F6ED5D10E6113910FD32322F5D003F3FED
-3FED332F5D1112392F5DED123931305D015D2123350E01070E0123222635343637362437
-353426272E012322060723353E01333216171E011503110E01070E01151416333236041D
-BB1955282F7A5297D26D6566011EA42D2A28703D4AB6610A37D06576AF403F42BB56E944
-5164747763A477113D12171FC89B7F9D2D2D20081D40541817102725BF0F24272F2E926C
-FE1D013705141317615560614D00000200B9FFE10490061400130020005140393402350F
-3B1530204402450F4B154020571267127F087B1C0C0E0906174211040C011E40060A0B08
-141B0090221F223F22020E1B091A0C882110F6FD32325D10F4ED003F3FED3F3FED123939
-31305D011406070E012322262707231133113E0133321203342623220607111E01333236
-04904F4347AA665F8E450CB0BC4FB26FC6E5C2849352A8485073499CB102378CE04C4F4F
-2D26340614FDD44153FED0FEE6C8CF4738FD80241CCD00010069FFE703F3047700210057
-40410F234F23022B01220E2A1624183A01350E3A16351849014F0A440E4F164118590155
-0E6901650E7A01730E131010143F0C0421211A3F03090F008D23171B09852210F6ED10F6
-3C003FED332F3FED332F31305D015D250E01232226272E013510003332161715232E0123
-2206151416333236373E01373303F35EA95F79CA484950012DF760B94D0A56B757A0B9B5
-A439762F2948150A462D32474848DC93011201383627D14348D7D0CAD91E18152F110002
-006CFFE10443061400130020004B40333C1A301C38204F1A421C48205806680670100912
-0102110518410E0401081E42050A1114021A0092221F223F22021B1B08852110F6ED5D10
-F6FD3232003FED3F3FED1239393F31305D2123350E01232202113436373E013332161711
-3303112E012322061514163332360443BC51B067C8EB514544B56158884BBCBC4C78479E
-B0889650A475464E013401118EDE4E4C50252701E4FAFF0281221ADCCAC7CF470002006A
-FFE60460047C0018001F005A404026042B0D30043B0D3C1E43044B0D4B1E5A0D50166A0D
-6017780D7A1E0E013C1F1F0F1C3D15040B0B073F0F090C0C191A008F210F211F213F2103
-1F011B12852010F6FD325D10F4ED332F003FED332F3FED12392FED31305D01211416171E
-013332363733150E0123200011100033321215272E01232206070460FCC93E36348F5672
-E7310A5FC66DFEEAFEC8012BF4E2F5B701939697B30C021B67993130305B2CCD2836012D
-011501120142FEF8F32A94A2B2840001004400000312061E0018004B402D081439147505
-030000043F15000B0E3E0811050D080009400902090F090E00080B1A0F11000E400D1037
-0E891910F62B323232FD322F12392F2F5D003F3F33FD323FFD322F3130015D01232E0123
-22061D012115211123112335333534363332161703120A1F6426796D0153FEB3BC7F7FC6
-BB3F652A055E09136B8C269EFC4103BF9E25C7D50C080002006CFE590443047C00230030
-006E404E3D133E2A322C3A3044094B134C2A422C4B305B015D055A166A016C056A167C05
-702011220512211528401E0407070B40030D2E4115070F0601062124121A000618009232
-1F323F32022B1B18853110F4ED5D10E4113910FD32322F5D003FED3FED332F3FED123939
-3F31305D2510002122262735331E01333236373E013D010E01232202113436373E013332
-1617373303112E012322061514163332360443FEFEFEF459A9520A2EC864607E23231E55
-9B78C8EB514641BA5C6183490CB0BC4B81409BB2849952A57FFEE4FEF61917C012352E29
-276E446644430121010790D14C474F272830FCD60261221DD0C6BCC23F00000100B90000
-045F061400160037402203151615751503100D084213040E01010D08021A0091181F1860
-1802100B1A0D881710F6FD325D10F6ED003F3C3F3FED123931305D2123113426272E0123
-22060711231133113E0133321615045FBC1218195E4B4DA84DBCBC58BC63B5BE027C4D87
-262A294C3BFCBE0614FDCD4952DACD00000200AF0000018305DB000300070030401E0144
-02400B0D370203060505087F090109920060041A01607F050105880810F65DE4FDE4E65D
-003F3F3F2BED313001233533032311330183D4D40CBCBC0518C3FA25045D0002FFC2FE59
-021505DB000300190049402E0A051C0502014402400B0D370203163E19050B0B0F40070D
-4F1701177F0A010A0160161A00600A1770190119921B10F65D3232E4FDE42F5D2F5D003F
-FD322F3FED3F2BED31305D012335330314062322262735331E01333236373E0135112335
-210215D4D40CC8A828832C0A1C5F2D485816160DE901A50518C3FA0AC4C8100CB30B1C28
-2828715103849E00000100C1000004AF0614000B007D40512802D801DB090309010F0D1F
-011D021F0D2D012F0D300B400B540B69027A010C020203011A000B000809B4020B0A030A
-0802050A0507010105080B02600A700A020A0A00000D200D400D0208031A05890C10F6FD
-325D11332F332F5D3939003F3C3F3F1239393130018710C0C07AF51804C0018710FD08C0
-015D7121230107112311331101330104AFF8FE407ABCBC021FEDFDF901E974FE8B0614FC
-1A022FFDFC00000100BB0000017706140003001E4011020101087F05010592001A7F0101
-01880410F65DFDE65D003F3F3130212311330177BCBC0614000100B900000717047C002B
-006A4048032403291324132944204426B72A07B62501251F1D1C0817422822041D050110
-1C08402D011F2D302D402D502D702D05001A016110250B1C0F1A101F1A1A1C611F104010
-801003102F5DF4FD3210FD11393910F4ED5D5D003F3C3C3F3F3CFD32111239395D31305D
-2123113426272E01232206071E01151123113426272E012322060711231133153E013332
-16173E01333216150717BC0D151756514F9E4F0304BC0D151756514D9B4DBCBC58AF6372
-9F2772BC6BB8AF027C4886282B2C4F3D173D1EFD35027C4A85282B2B4C3BFCBE045D7C49
-5260556055DFC800000100B90000045F047C00160037402203151615751503100D084213
-040E05010D08021A0091181F18601802100B1A0D881710F6FD325D10F6ED003F3C3F3FED
-123931305D2123113426272E012322060711231133153E0133321615045FBC1218195E4B
-4DA84DBCBC58BC63B5BE027C4D87262A294C3BFCBE045D7C4952DACD0002006AFFE10471
-047C000B0017003E402C3B0E341034143B164B0E441044144B16080F3F0904153F030A0C
-1B0090190F191F193F196F1904121B06851810F6ED5D10F6ED003FED3FED3130015D0110
-002322001110003332000334262322061514163332360471FEE8EBEDFEE90117EDEB0118
-C2AA9799A9AA9896AB022EFEEFFEC4013C01110111013DFEC3FEEFD9D3D3D9D2D9D70002
-00B9FE640490047C00130020004D4035320239153220430249154220561267127E087C1C
-0A0E0906174211040C051E4006090B0C141B0090221F223F22020E1B091A0C882110F6FD
-32325D10F4ED003F3FED3F3FED12393931305D011406070E012322262711231133153E01
-33321203342623220607111E0133323604904E4742B364578D49BCBC4BBB6ACAE1C28A8F
-51A44B5073499DB0023C88E14E4A512628FE2C05F9753F55FECFFEECCAC84639FD87241A
-D4000002006CFE640443047C00130020004B40333B033D1A301C3A204C034B1A461C4A20
-701009120502110418400E04010C1E4205091114021A0092221F223F22021B1B08852110
-F6ED5D10F4FD3232003FED3F3FED1239393F31305D0123110E01232202113436373E0133
-321617373303112E012322061514163332360443BC57AC64C7ED534442B2635A8B480CB0
-BC4E7846A3AA899352A4FE64021A4B490133010E90DD4B4950282730FCBF0278231CDDC2
-C4D34700000100B900000372045D001200384021000D100D200D030C090F000004430A0F
-05090800001440147014020C071A09881310F6FD325D11332F003F3F3CFD322F11123931
-305D01232E012322060711231133153E013332161703720A2A4F3657A24BBCBC70AB5931
-2C2C03900A094D3DFCE7045DA55A4B0507000001006EFFE503D704780033009340710602
-091B1502191B26092A2432093C2442094C245E055D165321562F54326F056C166020642F
-6532147A057F1174207928742B8A01880D851A872894019A1B0B000E1829041E03802201
-2222263E1E0407070B3E030921291B180E1B00211807008E350F351F353F355F357F3505
-07863410E65D10E611393910ED2FED2F003FED332F3FED332F5D1112173931305D015D01
-14062322262735331E0133323635342726272E01272E01353436373E013332161715232E
-0123220615141716171E011716171603D7FDDB7CCF460A59DA647C8C26266C288135937B
-393A38AD6B64CD440A48CE63678E2B2A5E34812B834747014299C43B23D3434F50564222
-221809180E27976E457A302F373123C935494F4E452323160C180A1E494A0001003EFFEA
-02FD059E001B0048402C0C051A052B05030B10073E0D0B0A051B1B173F03094F1D7F1D02
-0E008C1D080D101A0A0807400D103707881C10F62B3232FD322F10F6325D003FFD322F3F
-3333FD322F31305D250E012322263511233533113311211521111416171E013332363733
-02FD357D31ABB27F7FBC0184FE7C0818164D4F2E64160A0A0E12B8CB02529E0141FEBF9E
-FE0358632B28251B0900000100B1FFE10457045D0016003740220B0619077A0703020515
-09051142050A010814021A0092181F186018020B1A08871710F6ED5D10F6FD32003F3FED
-3F3C123931305D2123350E01232226351133111416171E013332363711330457BC5FAE69
-B0C4BC101A1B565249AD4BBC7C4B50D7D002D5FD8455792B2C284C3B03420001003D0000
-047F045D000600864041260429063604390646044906062905390540055105600505061A
-000100041A03020328002703380037034A00470375017A02080005027503010305020802
-010300B8FFC0401E0910370C001C006A007A0004008D080F080103031303650375030403
-820710E65D5D10F45D2B113939003F3F5D1239393130015D8710FD8710FD005D015D0901
-2301330901047FFE3CBDFE3FCC015A0157045DFBA3045DFC870379000001005600000636
-045D000C0088406D0D031D032C012A0229032504260524082B0B34013B0544014B055701
-58045905570B6D02620464086A09640A6B0B79017D02720474087B09730A7A0B1E0C1A00
-0100071A060506000910090205080B03090C0602060502080F061F062F0603008E0E100E
-3F0E6F0E030006830D10F6325D10E65D003F3F1217395D3130018710FD8710FD015D0901
-23090123013313013301130636FEDDAEFEE1FEE3ADFEDAC4CD01179B011EC2045DFBA303
-5DFCA3045DFC9F0361FC9F0361000001003C00000480045D000B00DA408C090B1B011403
-14071B09270327073C003B0134033404340634073B093D0A4C004B014403440444064407
-4B094D0A5A0155035A0555075A09550B6F016003690560076F09660B230F0200083F0230
-084F0240087D02700808091A0A0B0A071A060506011A000B00031A0405040102050B0809
-06047A047506020605040809060106020D010502080B04040A00B8FFC0401C0910370600
-01008D0D0F0D010F0D1F0D400D5F0D040602040104820C10F65D325D5D10F65D2B321117
-395D2F5D003F3F5D1217393130018710ED8710ED8710ED8710ED005D015D212309012309
-0133090133010480EDFEC3FEC1DB01B4FE50ED013B013CDCFE4901ADFE53022D0230FE5A
-01A6FDDA0001003DFE64047F045D0007008C404104063406440650066006700606090307
-0519031705460149035800570179030902071A000100051A040304490046040200030204
-05020C02680101010203030400B8FFC040220910370C001C004A006A007A0005008D090F
-0901030413044504650475040504820810E45D5D10F65D2B1117395D2F003F3F12393931
-30015D8710FD8710FDC0015D005D0901231301330901047FFD74C9D0FE43CC0157015A04
-5DFA0701D20427FCC4033C000001005D000003E3045D00090056403A15083A0335084A03
-45085C03540860087F0370080A0707033E06050202083E01080408030207070402098E0B
-1F0B3F0B5F0B6F0B7F0B0502840A10E65D10E41139392F1239392F003FFD322F3FFD322F
-3130015D2901350121352115012103E3FC7A028BFD830367FD72029F8B03359D86FCC800
-000100ADFE78045906140025005640382F1D3A074A07562367237523063A1D4A1D021D1C
-09533F0A4F0A020A0A01145112012451010B140F00400002000919201F0E000940050105
-2F5D33333CFD3C2F2F5D3C003FED3FED12392F5DFD39395D3130015D012322263D013426
-2B01353332363D0134363B01152322061D01140607151E011D0114163B01045996B3DFA6
-AB3333ABA6DFB39672887B9A89899A7B8872FE78C7BC95A9BF9CBFA995BCC78A7E8CAF8B
-BD371837BD8BAF8C7E000001017AFE78022806140003001B400F0F054F05020201010B00
-1F4F0101012F5DED003F3F3130015D012311330228AEAEFE78079C00000100BBFE780467
-0614002500544034211235023112400240127A0C06131200533F254F25022525091B511C
-010A51090B1B0009010900170E1F050509004F200120202710D62F5D33333C10FD3C2F2F
-5D3C003FED3FED12392F5DFD39393130015D012322061D0114062B01353332363D013436
-37352E013D0134262B01353332161D0114163B01046733ABA6DFB39672887B9A89899A7B
-887296B3DFA6AB3301F8BFA995BCC78A7E8CAF8BBD371837BD8BAF8C7E8AC7BC95A9BF00
-000100BB018B05D1039F001F0056404206030609091309191908170A1518191A3B083418
-4B0844185A035A0A550D541B5B1D60056E14611875047A147518170F1C54060C54061F16
-1F2A000001000F2A00102F33ED2F5DED002F3333ED2FED333130015D010E01070E012322
-26272E0123220607233E01373E01333216171E013332363705D102292D2E82645E925466
-5C325E6409A702292C2B8A605D935550663D676103039F63C04B4D584F667D40AFC464BD
-4D4A5B4D68625BCAA900FFFF001A0000055E07500236002400000117008E002F0175001A
-40130320113011401170118011050200110E060725012B355D350003001A0000055E0801
-0012001E002100DF40442B2040205A18551A501E55206918651A651E09180B170D4A0646
-125906561278027703082020211F02870101011400120020210387040104140505067B06
-74120216510CB8FFC0405D0D10370C033470210121212006120405001C011C0301050813
-114F0F500F600F030F191140095F096F0903090F230106090F1204050C00240039004200
-5A006A0074000700006E230F23010A052B0536054D05550565057B050705642210E65D5D
-10F62F5D1217395D2F5DED2F5DED003F3C3F5D1217392F5DED2F2BED3130015D8710FD5D
-C0C0C08710FD5DC0C008C0015D005D212303210323012E01353436333216151406071334
-26232206151416333236130901055ED394FD8094C90207596BCC9293CB69592C72565672
-7355567236FEFEFEFD019FFE61057F2C9F668FC2C28F64A32A012F56737455567373FBF1
-02CBFD3500010073FE59054605EC00410097406F0A20032B1C20152B250B222B3402330B
-342B4302430B452B5D1F582158255A275E3F6102602B70027626702B160B0B1B0B022D2D
-313429021A061D41413D341D0A101014320C0D0F0F172A0009100920090309091D234371
-2C0071430F43010F431F432F433F436F4305371523684210F6ED5D5D10F43CE41239392F
-5DED332F003FFD322F3FED332F1239393FED332F31305D015D250E01070E01071E011514
-062322262735331E01333236353426270E01232224272602353412373624333216171523
-2E01232206070E01151416171E01333236373305463759480B1A120203BB9326772D091A
-5B326A620202132B12A2FEF762606C68625F010DA478EF920F7BF28A71B547454D554346
-BB688FFA6D0E6C182A17030903133317A2AC0E0CA20A1C5056132D1402025B615F0125C2
-B801226461663A49EB675E494D4BE5969DE2474A47626200FFFF00C80000049D08010236
-002800000117008D001E0175000BB601000D0D020325012B3500FFFF00C80000053807C8
-023600310000011700D7008C0175000BB60100170A050925012B3500FFFF0070FFE105D7
-075002360032FD000117008E009601750018401103002930295029702904020029240F03
-25012B355D35FFFF00B2FFE1052907500236003800000117008E00620175001840110210
-24202440246024040100241E0D1D25012B355D35FFFF0068FFE1041D068C023600440000
-0116008DE300000BB6020036371D2625012B3500FFFF0068FFE1041D068C023600440000
-01160043E800000BB6020035371D2325012B3500FFFF0068FFE1041D068C023600440000
-011600D6E000000BB6020038341D2625012B3500FFFF0068FFE1041D05DB023600440000
-0116008EE000001E4016030F39703902020039103920394039040039341D2625012B5D35
-5D35FFFF0068FFE1041D0653023600440000011600D7E200000BB6020041341D2525012B
-3500FFFF0068FFE1041D07B1023600440000011600DBD300000DB70302003A341D262501
-2B35350000010069FE5903F3047700380080405B0F3A4F3A022A012A0726252A2D252F3B
-01390735253B2D342F4B014F2140254F2D402F590153256C0166257A017525150B081B08
-0227272B3F230417031A3838313F1A090D0D113D090D0C0C142A06061A2026008D3A2E1B
-20853910F6ED10F63C1139392FED332F003FFD322F3FED332F1239393FED332F31305D5D
-015D250E01071E011514062322262735331E01333236353426270E01232226272E013510
-003332161715232E01232206151416333236373E01373303F3214D1D0305B79225742D09
-1A583268620302101D1979CA484950012DF760B94D0A56B757A0B9B5A439762F2948150A
-460F1F0913391CA2AC0E0CA00A1A4E58162E140204474848DC93011201383627D14348D7
-D0CAD91E18152F11FFFF006AFFE60460068C0236004800000116008DFD00000BB6020022
-21121825012B3500FFFF006AFFE60460068C02360048000001160043FD00000BB6020021
-20121825012B3500FFFF006AFFE60460068C023600480000011600D6F900000BB6020024
-20120025012B3500FFFF006AFFE6046005DB0236004800000116008EF9000014400D0330
-2560250202002520120025012B355D35FFFF00A000000246068C023600D500000117008D
-FE830000000BB601000505020325012B3500FFFFFFEB00000191068C023600D500000117
-0043FE970000000BB601000505020325012B35000002FFF50000023C068C0006000A003D
-40247A0174037A057406040201030505030905080800047F0C01000C92071A047F080108
-880B10FD5D32FDE4335D2F2F003F3F2F332F1239393130015D01230B0123133303231133
-023C978F8E93B2E313BCBC0511010BFEF5017BF974045D00000300050000022D05DB0003
-0007000B0041402702010744600401040A050908011A7F000100041A700501057F0D0100
-0D92081A057F090109880C10F65D32FDE4335D2F5DED2F5DED003F3F2F5DED3939313001
-2335330523353313231133022DBDBDFE95BDBDB5BCBC0518C3C3C3FA25045D00FFFF00B9
-0000045F0653023600510000011600D70700000BB6010024170E1525012B3500FFFF006A
-FFE10471068C0236005200000116008DE200000BB602001919060025012B3500FFFF006A
-FFE10471068C02360052000001160043E200000BB602001919060025012B3500FFFF006A
-FFE10471068C023600520000011600D6E200000BB602001C18060025012B3500FFFF006A
-FFE1047105DB0236005200000116008EE2000014400D03301D501D0202001D1806002501
-2B355D35FFFF006AFFE104710653023600520000011600D7E200000BB602002518060025
-012B3500FFFF00B1FFE10457068C0236005800000116008DEE00000BB601001918101225
-012B3500FFFF00B1FFE10457068C023600580000011600430200000BB601001818091625
-012B3500FFFF00B1FFE10457068C023600580000011600D6F800000BB601001B17091625
-012B3500FFFF00B1FFE1045705DB0236005800000116008EFD000016400F02301C501C60
-1C0301001C17091625012B355D35000100BB0087045B0614000B003C4026070A0B000104
-0605AA0606080308010F0D1F0D02006302040708090A010602280563700301032F5DE6ED
-173910E65D003F2F12392FED17393130012513231305350503330325045BFE6D058405FE
-6D01930584050193040A05FC780388058105018EFE7205000002009A02CC03BC05EC000B
-0017002840186A0F65157A0F751504155403030F5409020C2A0000122A062FED332FED00
-3FED332FED5D313001140623222635343633321607342623220615141633323603BCE8A9
-A9E8E8A9AAE7A58666668689636686045CA8E8E7A9A8E8E8A8668B8B6668898C0002009F
-FE97046005C3001C0023007B40553C0A3F2030224B0A4F2040225A0153116C0164117901
-7611791F76230E1D1E180D3F134F130213130D1747060C030F0505201C301C401C031C18
-471C05030F251F2502130021202F090109001D0C0F1804031E09062F33ED1739322F5DED
-2F3C5D002F3333ED2F5D2F3F123939ED33332F5D2F11393931305D250E01071123112600
-353400371133111E011715232E0127113E01373305110E01151416046047B46876E3FEFB
-010BDD7668BA410B37AE7378AD330BFE2787A2984A1E2F03FE9D0167150120FAF2012B16
-0163FEA1032C1FCB2C5209FCB90A552985034214D2BDB5D2000100890000048B05EE0021
-00774050201D3415321D03031E151E251E410E530E5B16630E7302730E091B1805460F08
-1F084F0803081010144908010C0202204A01080F231F23021F02181B20080519060F0605
-190F040220004000020000022F332F5D1217392F2F2F2F33FD3211395D003FFD323F1239
-ED332F2F5DED393931305D015D2901353E01352335331134123332161715232E01232206
-1511211521151406071521048BFBFE7667B0B0FDCD6998400A3E98568C8B019FFE617C62
-0345CF20BDB98A0136C801012211CE2A30A590FEDD8A3D7EBB390B00000200ACFE7F0468
-05EF0043006100A9407F05050A2714051D273E2030424D104F20433240425C105E165132
-63096E106A2B63321152055F205F255F275B2D5B3950426B1F6A20653D654061427C097C
-10742B7431107B50745F0218075F50293A062F0D3333373F2F021111153F0F0D1F0D020D
-181B5F045607333A1B50262911471A1129330704221000010000561A222FED332F5D1217
-39ED2F2F3939ED2F2F123939ED002F5DFD322F3FFD322F111217395D31305D015D011406
-07151E01151406070E012322262735331E01333236353426272E01272627263534363735
-2E01353436373E013332161715232E01232206151416171E0117161716033E0135342627
-2E01272E01270E01070E01151416171E01171E01173E01046876636158424148C27C57A7
-5C0A4FB46C86A2272D299052D6525372666554404340C78057A85B0A3ABD797FA92B2B2B
-845BC85A59F71C1E211D1C4E2C275D46123E1618261F1D1B512C266043144202596AA237
-072E915A4D8A3238361B1FC2253261573841191725143451518162A93907309259518334
-323A1C1DC21B3C5C573947171725152E4F4FFEAB21413A334617181F0C0B1514092D181A
-563132461817200B0A18130B2F00000100B9012103A4040B000B0013B703030900000688
-0C10F6322F002F332F313001140623222635343633321603A4DC9A9ADBDB9A9ADC02969A
-DBDB9A9ADBDB00010089FE95045205D1000D003B40245308610802010F0501054F060106
-0602AA0C030F0F1F0F020529040402290F0D010D0D092F332F5DED332FED5D003FED332F
-5D2F5D3C31305D012311231123112E013534243321045294D695CEFC0104F301D2FE9506
-BAF94603BC05F8CCCFE8000100B9FFE8048D061E0036006D4048052E152E2E132C343913
-39343736490E4636532166217B1B0C3433143D151E3C15032D0007070B3D03092608181B
-303400140C061C060206111B000614300325009038251A26883710F6ED10E611173910ED
-2F5D2F12392FED003F3FFD322F3F1239ED2FED39393130015D0114002322262735331E01
-333236373E0135342623353236353426272E01232206070E01151123113436373E013332
-1615140607151E01048DFEF1DB2C73240A2A63384A6E21231FD3C69D9A161E1B583D395C
-28252DBC48403CB35EB7E58E71A4BE01E1D6FEDD0F0DA518123A31347F4CA6A996778123
-421F1D231D2724845FFBC104387CB73E3A3BAE9770B2200925DF0004009FFF2E076105F0
-000B00170028003700AD407A7C0D7C11701370177A1A74277336070D1A04231E1A122314
-282C0E231022142C16211824233F1936234919472252186B0E641064146B166A19151A19
-2A182818292A25252818311B2A001D101D4F1D0318001D01901D011D0CAD1D06000012AD
-06281AAA31311E19401D011D30AA1E15501D1E0903030F500902003FED332F123939ED2F
-ED2F5D3C12392FED39012FED332F1239ED2F5D71335DFD3C2F39392FED8710FDC0313001
-5D005D011000212000111000212000031000212000111000212000072301231123112132
-16171E0115140607373426272E012B0111333236373E010761FE05FE9AFE9AFE0501FB01
-66016601FB74FE49FECAFECAFE4901B70136013601B7C0DFFEB5A2A501385E7A3B3F3B71
-63201C211F4635957F3E5A1D1F19028FFE9AFE0501FB0166016601FBFE05FE9A013601BC
-FE44FECAFECAFE4401BC820163FE9D0393101F226149618126FD243812110AFECB131719
-3C000003009FFF2E076105F0000B001700330096406D7C0D7C117013701779197223062C
-0E231022142C1633183324332A332E44184124442A442E54185424542A542E6B0E641064
-146B1662186A1D642417257F1801182C2A181E0CAD1E06000012AD06103320330233332F
-521B1F252F2502252529522115501B210903030F500902003FED332F123939ED2FFD322F
-5D2FFD322F5D012FED332F1239ED2F33ED2F5D3C3130015D005D01100021200011100021
-2000031000212000111000212000050E012322243534003332161715232E012322061514
-1633323637330761FE05FE9AFE9AFE0501FB0166016601FB74FE49FECAFECAFE4901B701
-36013601B7FE72569F4EE3FEF8010DDE59AC3E1036A9598E9F9994539D4810028FFE9AFE
-0501FB0166016601FBFE05FE9A013601BCFE44FECAFECAFE4401BC572727F6EAE1010230
-1CB52846ABA59FAE3A34000200AA031106F105D1000E0016005240217B0478057A060379
-0C010B0C0D01030406080815121210135015030D280B0F370BB8FFC440110B0F37022800
-000728090FAE102814AE132FE4FDE42FED332FED2B2B003FFD3C332F1217395D3130005D
-0123112303230323112311331B0133052311231123352106F17C14ED4FEF197BEEBFBFE3
-FC02E57FE5024903110269FE3D01CAFD9002C0FE82017E75FDB5024B75000001021D0516
-03C3068C000300244016470156006600760004500360037003030303010000022F332F00
-2F332F5D3130015D0901231303C3FEEF95B3068CFE8A01760002015A051803BE05DB0003
-000700264015020644016005010500140F010101041401000501052F5D33ED2F5DED002F
-5D3CFD3C3130012335330523353303BEC7C7FE63C7C70518C3C3C300000100F5001B0597
-04FD0013008840541612010C0B080704030E111201020D80029002A002B0020402290303
-0C030D030112045307110E08530D070F0B010B40150130154015020407080B0112110E08
-030D0309030D1004062F004000020000400601062F5D332F5D1217392F2F1217395D5D00
-2F5D3333ED39392FED3939322F2F3130018710FD5D87C0C0C0C010C0C0C0C0C0015D0121
-0323132135211321352113330321152103210597FDA0689968FE5701DA54FDD2025E6999
-6901ABFE2453022F016AFEB1014F9C010C9C014FFEB19CFEF4000002000E0000076D05D1
-000F00130079404F04030B061B041B052A042B053B064A044A054D064D120B1213030414
-05050675057C06020A100E140115730601080B0440000100000F05010564140334130D35
-0A0A13050835123406030E35010508003F3CED3FEDED1239392FED2FED300110F65D322F
-5D1739E62FED393931305D8710FDC0C0C0015D2901112103230121152111211521112101
-112303076DFC50FDF4D4CF0252050DFD1302EDFD1302EDFC50DBEF022CFDD405D1B0FE68
-B0FDD702230259FDA70000030073FF6E05DA064B001D002A003700A640850203000B0A0D
-0C120F1A051C1103190D1F121F1A151C550254045A08590D59115B135017551C792A140B
-090318061B1F0A1F0B1118161B2609272F75037F097F0A7F0B7F0C791270187019701A70
-1B132A2F1E2E043221340C09181B040615023234060A2A2F1E2E04272B15000C09181B04
-0F0073390F39010F391F393F390327150F683810F6ED5D5D10E411173910ED111739003F
-ED3F121739FD11173931305D015D011402070E0123222627072313260235341237362433
-3216173733031612012E01232206070E011514161701342627011E01333236373E0105DA
-63595CFBA173C94F9F84CD656D605C5801059A76C2528E84BC656FFE6F3990596EB44240
-453B3A035C3C3AFD683C91596EB73E434202E8B8FEDD6165663A37E4012664012CC4B601
-216762683737C9FEF464FED7013A2E2D4D4E4CE5938CE04C01B88BE44BFC432D2E504C52
-E100000300A1009D075F047C00170026003500724054051608311526192F2923262C3B34
-441C4B34510256075F0A5F0E5A1351165918553063026D0A631669236C24642C642D1821
-AF33AF0306120F09092AAF1BAF150F7B18743002272A0030180C0099371E2A0C993610F6
-ED10E411393910ED5D002F3CEDED332F1239393CEDED3130015D011402232226270E0123
-2202353412333216173E01333212052E01232206151416333236373E0125342623220607
-0E01071E01333236075FF5CF85DE454FD38FBFE2FACA86DE444FD58DBFE2FC683FB8608A
-9C7F776E7C392225030C807658814A1E33133CBB608A9C0297EFFEF599929794010FD6EE
-010C9A919695FEF1947575A79A85A6615E39470186A5477830672C7377A6000100D700B3
-05B505B6000F004540290E03540F010101010D045408AC0A070C401101301140110200AB
-0A800D010D2A040105AB07400401042F5D3CF43C10FD5D3CF45D5D3C002F3CE4FD3C322F
-5DFD3C31302521352111213521113311211521112105B5FB22021CFDE4021CA6021CFDE4
-021CB39E01A69E0221FDDF9EFE5A000200FE0000058005710006000A0061401605045403
-020306540001002C26012902360139020400B8FFE240240B1837031E0B18370954080303
-00400C01300C400C020504090A040100004001500102012F5D332F1217395D5D002F332F
-2FED2B2B31305D4B53588710FD8710FD05C05909013501150901112135210580FB7E0482
-FC870379FB7E0482012F01E37C01E3B7FE96FE96FE1AA0000002010C0000058E05710006
-000A0063401603045405050602540101002C26002906360039060401B8FFE240260B1837
-051E0B1837095408050501400C01300C400C020503090A040100002F013001400103012F
-5D332F1217395D5D002F332F2FED2B2B31305D4B53588710FD8710FD05C0590901350901
-350111213521058EFB7E0379FC870482FB7E04820312FE1DB7016A016AB7FE1DFC72A000
-0001006C000004A705D1001000834020300E3F10420E4F10540E5B10650E6A10730E7C10
-0A0020090B371020090B370EB8FFE0B3090B370DB8FFE04033090B374601550F700F0305
-0208320B0B0C010F0005070D0307080F121F1202030A005C0501030F05130D5C0C0A0F08
-BF0802082F5D3333E4ED39323210E42F2F5D003F3F1217392FED393931305D012B2B2B2B
-5D090115211521112311213521350133090104A7FE400174FE8EBCFE8E0174FE3DD4014C
-015005D1FCC15E8AFE5601AA8A490354FD6D0293000100BEFE640464045D001500384020
-080205140B051042050900080A0C0102131A0092171F176017020D091A0A881610F6FD3C
-5D10F4FD3939003F3F3FED3F3C12393931302123270E012322262711231133111E013332
-363711330464B20A3B815B567F42BCBC209B5B5D8536BC76414A4640FDF305F9FCBA2752
-433C034000020095FFE0047905EF00220031006640481502151B162E2904241B310A351B
-410A431B560A551A561F5020562A641A661E642A632E751B702E140F06263F0C0C061D19
-19153F1D022C3F060A1A0F232912141A0900002914092FED332F1239ED1139392F003FED
-3FFD322F1112392FED123931305D011402070E01232226353400333216173E0135342623
-22060723353E01333216171E01032E01232206151416333236373E0104794E5255CB71C0
-F3010DCA5A9F4F02029E984EB74E0B51C96089CD3E2A1DCB3C98488DA8877080A322060B
-0345A4FE987B7C62FDCBE4012134411A3B1AD9CA3F37C22C2D6D7C56CEFEC42F36B6AA91
-99C2BE215000000100BBFF43055905D1000C00A9406A01030F08450B8B03D903D30B0601
-08010B2B033208320B5D03660A600B08030203080908B3040304030B0A0BB30202030302
-03080908B3040304030B0A0BB30202030303610A010A07040304070A04020C0C0203090A
-0A6B090109040202040309040B0835050301350B002FED3FED1117392F2F2F5D332F1239
-012F332F1217392F2F2F5D332F313087107AED87C0018710ED8708C00187107AED87C001
-8710ED8708C0015D71052135090135211521011501210559FB6202A1FD69046DFC850288
-FD6603B4BDBF029C0277BCB0FDA748FD730000010090FF3F05FC05D1000B003B40250307
-050009350A0270007F09020414005A6F017F010201010D0514095A00086008700803082F
-5DE4ED11332F5DE4ED5D003FFD3C3C2F3C313001231123112111231123352105FCC8C6FD
-B0C6C8056C0523FA1C05E4FA1C05E4AE0001007100000541045D000B002B401703070500
-093E0A05041A00B001010D051A09B0100801082F5DE4ED11332FE4ED003FFD3C3C2F3C31
-300123112311211123112335210541CABCFE3CBCCA04D003BFFC4103BFFC4103BF9E0001
-008AFE590490061E0021002C4018000004401E00111115400D0D0F231F2302001000091A
-10192F33FD322F2F5D003FFD322F3FFD322F313001232E01232207061511140706232226
-2735331E013332373635113437363332161704900A2073208134356869BC346D310A216C
-228135346868BD3A6636055708153D3D95FB9DCE6D6E0B0AB208153D3D950463CC6F6E0B
-0A0000020097021303B005F000230030005740370A0A06211B0916212E0925215529600E
-6029700E70290B02082552111120081C1C1853200201012E5308061D1125022A1D0B002B
-2A000B2F33ED2F1239FD32322F003FED332F3FFD322F1112392FED12393130015D012335
-0E01070E01232226353436373E0137353426272E012322060723353E013332161503350E
-01070E0115141633323603B0AA1C312C2D514980AF5D4D4EEF88242122573054A8270E2D
-B84DD9BEAA45B736404E5B5E5283022A5E1425131415AA846A8724241F0612354013120A
-300EAC0D20A99FFE74F504100F124D444C4C430000020079021303E405F0000B00170031
-40205D015D055207520B046A0F6515020F530902155303060C2A40000100122A00062F33
-ED2F5DED003FED3FED5D31305D0114022322023534123332120734262322061514163332
-3603E4F4C1C9EDEDC9C1F4B687787A86867A78870401EBFEFD0109E5E5010AFEFCEBACAC
-AEAAAAADAB000001006B0000062105F00027006240440909090D1A091A0D2C092C0D3403
-300530113413460346136A1A641D64216A24101925140204160B341F0226183501160825
-1202191214081502141C272222290E15171C2FC4ED11332FC4123939ED2FED2FED003F3C
-FD3C3FED12173931305D2901113E01373E01353426232206151416171E01171121352135
-26023510002120001114020715210621FDA443842D2F38F8E2E2F83A2F2F7F44FDA401B4
-A8D90172013601360172D9A801B40185275A373A9970C8FDFDC86E9E38395727FE7BAE7C
-580132CC0116015AFEA6FEEACCFECE587C0000030068FFE3073F047C00390043005200B9
-40840B190B1D1C192604200D3604320D383D34414204420D4A3D4241520D5237554B630D
-6137654B13161D4B2A512E622E7B0D7E137C1E7D24732E73387C4B0B47013C2170430143
-124333033018403D36042C2C283F30040B0B073F0F0A5041180A433A011A474412213304
-00470F2D012D0C0C3A1A00472D1B008F544054014D1B001B855310F632ED5D10E4113939
-10ED332F2F5D2F1217392FFD1139003FED3FED332F3FED332F3FED111217392F5D33FD32
-31305D015D01211416171E013332363733150E01232226270E01070E0123222635343637
-362437353426272E012322060723353E01333216173E0133321215272E01272E01232206>
-<07032E01350E01070E01151416333236073FFCCD3C37348E566FD5420C4ED56DA6ED4C15
-5C323F947396D36C655F0124A22E2928703C4FB35A0D37CE659FD33945CA7DD9FBB60525
-20226D4F85B41991141569C0524F61747663C1022F72A234302D5334CD233B686713501C
-242FC2987C992A271C033D41551717112A24BF0F265D5B5268FF00FB3E446625272C968C
-FE6B35844B030915145B535F5C560003005DFF6C047104D900170021002B007840560008
-0F140A19292604001800250200180025020914001800253D1D322B4D1D422B0721261825
-04291B3E0609121504030F04293E030A21261825041E221B0009061215040C00902D0F2D
-1F2D3F2D6F2D041E1B0C852C10F6ED5D10E411173910ED111739003FED3F121739FD1117
-3931305D5D5D015D011000232226270723132E01351000333216173733071E01252E0123
-22061514161701342627011E013332360471FEE8EB548F3B856EAB4B530117ED578E3674
-6F9B4C54FEBC2563379BAA222302442322FE40275F3B96AE022EFEEFFEC42A27C601004D
-E2930111013D2C23ACE74CE0DC1D1DDCD2619436012B619836FD611F1ED900020071FFE2
-03BE05D100030020006D404C0F221F2202131E231E3A053A144B05400D400E400F43165C
-05520F6F05650E651A7A057A0910127F1301131007120155030320201C34070A022B0303
-101F70130113130A200401041915040A2F33ED2F5D12392F5DED332FED003FFD322F3FED
-331239395D2F31305D015D01233533130E01232226353436373E01373533110E01070E01
-151416333236373302C8CCCCF653BA70D7F9453B3A9D44B33C9E2E3644997967C5390A04
-FED3FA571E28D1AB62963E3E6529E1FECF2161282F7C4E716F4225000002012300000203
-05D1000300070027401707070055030305080F0901045D032B055D0F02200202022F5DE4
-FDE45D003F3FED332F3130012335331323133301F9CCCC0AE01AAA04FED3FA2F04370001
-00D2003905B002FA000500294018000002540F0401044007013007400702012A40000100
-00042F332F5DED5D5D002F5DFD322F313025231121352105B0ABFBCD04DE390221A00001
-0086FF6906C906FC0008004A402C15073307440772070407070806140302030207090829
-08590869080408000100010100040351060607080208002F2F1239392FED012F2F332F31
-308710DD5DC0C08710FD08C0005D09012301233521090106C9FC9066FE80ED0189013902
-DA06FCF86D03E18BFCCB065C0001FFDCFF37050005EF002B0077404D070B001F2E08270C
-270F2E212925350D300F400E410F59226607660C0E0C0B0807201D1E21221D220F2D1F2D
-020920201D2209041600160B081E462121281200000449280216161A4900120112002F5D
-FD322F3FFD322F1112392FED393930012F2F1217392F2F5D8710C0C0C0FDC0C0C0313001
-5D01232E012322060F01211521030E01070E012322262735331E01333236371323353337
-3E01373E013332161705000A1D7229797E232A0141FEA3671D5C4041985C2950340A215E
-2C7F812367D9F52A1A5C3E3E99573A4F3405290A1A77A0C28AFE1686B034352A0709B40E
-1480A701EA8AC67BA833332C0A08000200F300CA0598045000190033006D40490A010606
-050E08130A1B06200528082D5B0452115B1E522B680B6432790B743210272730541D1A23
-541D1A002A012A0D0D1654030009542A0300101929000033291A0C290D26291A272F33ED
-3CED2FED332FED002F333333ED2F2FED332F2F5D3333ED2F2FED332F31305D010E012322
-26272E0123220607233E01333216171E0133323637130E01232226272E0123220607233E
-01333216171E0133323637059714B69E4D8C3841682C4B541C9B17B39F488E3B3D6B2D4C
-59139E19AEA348903927802E4E56149D13B79E4D8A3A237C364B541B0450C2C64B2D3437
-607CB6C44A2E303B6D7DFDFCB8C34B2D1F4C6E7CC0C84A2E1C4F637A000200320000059E
-05D100030006004F403148024703025A056A050205041A000003061A010102390236036B
-0264037B02750306020305030000080105010203065401002FED3F1239012F11332F1739
-5D31308710FD8710FD04C0005D015D290101210902059EFA94023201080127FE50FE5105
-D1FAD7047BFB8500000200A600A2047A04760006000D005940107305730C0204400C1037
-0B400C103706B8FFC0B30C10370DB8FFC0401B0C103703000300070A0A07040500010100
-000C0B084007010707082F332F5D123939332F332F123939002F332F1239392F2F31302B
-2B2B2B015D2501350115090105013501150901047AFDF00210FE9B0165FE52FDDA0226FE
-8D0173BF01A35501A2BCFEEFFEEFD901BE5901BDC4FEDAFEDA00000200AE00A204820476
-0006000D005740107C037C0A0204400C10370B400C103702B8FFC0B30C103709B8FFC040
-1A0C10370C080C080505010403014000010000010A0B08070107082F33332F1239392F33
-2F5D123939002F332F39392F2F31302B2B2B2B015D090135090135010501350901350104
-82FDDA0173FE8D0226FE3CFDF00165FE9B02100260FE42C401260126C4FE4357FE5DBC01
-110111BCFE5E000300B2000005DA00DF00030007000B0025401405010206040A55090800
-2B0101042B0505082B092FED332FED332FED003FED173931302123353305233533052335
-3305DACCCCFDD2CCCCFDD2CCCCDFDFDFDFDFFFFF001A0000055E08010236002400000117
-004300640175000BB602000C0E050025012B3500FFFF001A0000055E07C8023600240000
-011700D700330175000BB60200180B050025012B3500FFFF0073FFE105DA07C802360032
-0000011700D7008B0175000BB6020031240F0325012B3500000200780000081C05D10016
-002500554039001C0022301C3022401C40227204720A721C741D72230B14351111011834
-10350D0317341535010811141417170E1203070073271F1507682610F6ED10E61117392F
-FD32003FEDED3FEDED12392FED3130015D29012224272602353412373E01332115211121
-152111210511232206070E01151416171E0133081CFBCEC4FEFD6791B3AE984FF9E8042E
-FD0502FBFD0502FBFC407A92B55F7481716D5BD09236415B0146CFD7013C603344B0FE68
-B0FDD7040479203642F8ABABEE4439280003006AFFE10776047C0024002B00370094406C
-2604200D3204300D32293B2E323032343B364004400D40294D2E403040344D36530D5314
-5C165C1A531C5322620D621C6222700D72221B013C2B121E2B030F283D21042F3F1B040B
-0B073F0F0A353F150A1E122B011A7F2C012C0C0C251A002C18008F393F3901321B188538
-10F6ED5D10E4113910ED332F2F5DFD323939003FED3FED332F3FED3FED1217392FED3130
-015D01211416171E013332363733150E01232226270E01232200111000333216173E0133
-321215272E012322060F0134262322061514163332360776FCDC3C34348D526DCD460C62
-BF69A8E84A45D183E9FEEF0117E38CC84447D78FE1ECB703918D8BAF10B8A49399A0A792
-92A5021B689831312F4F38CD2A347A686F78013C01110115013979726A81FEF4EF2A9B9B
-A4927DD7D5E0CCD4D7D500010099023C047D02DC00030018400C0154020000050F051F05
-02022F5D11332F002FED313001213521047DFC1C03E4023CA00000010099023C076702DC
-00030011B6015402000005022F11332F002FED3130012135210767F93206CE023CA00002
-FFED03E503160614000300070052B502180D103701B8FFE8B3090C3700B8FFE840090910
-3706180D103705B8FFE8B3090C3704B8FFE8401309103701000501050502060100B10202
-04B1062FED332FED003F3C332F5D3C3130012B2B2B2B2B2B0123013303230133031686FE
-F1F0EF86FEF1F003E5022FFDD1022F000002009603E503BF0614000300070050B90004FF
-E8400E0D10370518090C37061809103700B8FFE840200D10370118090C37021809103701
-000501050503070100B1020204B1000601062F5DED332FED003F3C332F5D3C3130012B2B
-2B2B2B2B090123132301231303BFFEF186A5A4FEF186A50614FDD1022FFDD1022F000001
-FFED03E5018606140003002EB502180D103701B8FFE8B3090C3700B8FFE8400D09103701
-00010101020100B1022FED003F335D2F3130012B2B2B0123013301868AFEF1F403E5022F
-000100A003E5023906140003002FB90000FFE8401A0D10370118090C3702180910370100
-010101030100B1000201022F5DED003F335D2F3130012B2B2B090123130239FEF18AA506
-14FDD1022F00000300D2000705BA051100030007000B00414029000B010B5608AC045407
-0F0101015602AC0F070107400D01300D400D0204AB000B2D05AB01400A010A2F5D3CE4FD
-3CE45D5D002F5DF4ED5D10FDF4ED5D313001231133012135210123113303BDEEEE01FDFB
-1804E8FE03EEEE03FE0113FD2BA0FD2B0113000200ACFFC805E00554000300070057403B
-4804470658045706680467067F047006087F057007020705000301000330036003900304
-03B200023002600290020402B220010406020002000201192F3333182F2F123939002F1A
-19FE5DEE5D11173931305D015D090705E0FD66FD66029A01BDFE43FE4301BD028EFD3A02
-C602C6FD3A01DDFE23FE2300FFFF003DFE64047F05DB0236005C00000116008EDD000016
-400F02100E600E700E0301000E0B040025012B355D35FFFF0006000004E607500236003C
-00000117008EFFED01750019401302000E400E500E600E700E0501000E090500252B355D
-35000001FF9A0000034B05D10003001D401138034803680065016903050100030000022F
-332F003F2F3130015D09012301034BFCF4A5030C05D1FA2F05D100010000FFE504CA05EC
-003300CC408758040102B52F0103B81D010237184718571867187718E718F71807013A00
-4A005A006A007A00FA0006032C06502998090109230F5020F71201081218122812581204
-00121203151827190119191D341502002833010133332F34030A272001022320292C0400
-0F12090604260C082A182A282A03002A21210C18007135103407073426150C683410F4ED
-12392F103C10F63C11392FC45F5D111217391117395F5D003FED332F5F5D333FED332F5D
-331112392F5F5D5D3CFD3CDD5D3CFD3C5F5D5F5D5F5D5F5D31305F5D250E012322000323
-37332E013534363723373312003332161715232E01232204072107210E01151416172107
-211604333236373304CA6CB97EF3FE8331862C4B02020202772C5D3A0174F38DBF541050
-C67C9DFF003001DB2CFE3C02030202017C2CFEC4310108969DB2440F3E3326012E010476
-152F161A34187601010128292DD1413DCFB17618341A172E1576B6D13F3D000100BA00AC
-02E0046C0006002C400972050104400C103706B8FFC0400C0C1037030300040501000001
-2F332F123939002F332F31302B2B015D2501350115090102E0FDDA0226FE8D0173AC01B4
-5901B3C7FEE7FEE7000100C200AC02E8046C0006002C40097D030104400C103702B8FFC0
-400C0C10370505010403010000012F332F123939002F332F31302B2B015D090135090135
-0102E8FDDA0173FE8D02260260FE4CC701190119C7FE4D000002004400000453061E0003
-001E005B40370B103A10601A741A04014402031515193F1100070A3E1D0D050509080B14
-0160051A006004140A0492201D071A0B0D0A400D10370A891F10F62B3232FD3210E61139
-10E4FDE42F2F003F3C3F33FD323FFD322F3FED3130015D01233533032311211123112335
-333534363332161715232E012322061D01210453D0D011BCFDF9BC7F7FC8B73E65290A1C
-6A22796A02C90518C3FA2503C2FC3E03BF9E31C1CF0D07AA08146B8C2800000100440000
-0447061E001A004E402D6C077A0702191A191A053E16000C0F3E091205010E08100A011A
-000A0F00921C090C1A10120F400D10370F891B10F62B3232FD3210E6113910ED2F2F003F
-3C3F33FD323FED33332F2F31305D2123112E012322061D01211521112311233533353436
-33321617370447BC2B8B35A2850149FEBDBC7F7FE9DE45902CBC056D080C6C8C2C9EFC41
-03BF9E31BFD10E040800000100BB007C045B06140013005740390B0E0F1011080609AA0A
-0712130001040605AA060A060C030C010F151F150210630063020407080B0C0D0E111201
-0A022803090563700301032F5DF63C10ED173910E6E65D003F2F1239392FED17392FED17
-3931300125132313053505110535050333032515251125045BFE6D058405FE6D0193FE6D
-01930584050193FE6D019301FB05FE7C018405810501A20581050184FE7C058105FE5E05
-000100FD01FF01EC031A00030016400C02560108002D2F013F0102012F5DED003FED3130
-0123113301ECEFEF01FF011B0001FFF6FEEC018F011B0003002EB90000FFE840190D1037
-0118090C370218091037010F0301011F03010300B1022FED002F5D335D2F3130012B2B2B
-09012313018FFEF18AA5011BFDD1022F0002FFF6FEEC031F011B000300070051B90004FF
-E8400E0D10370518090C37061809103700B8FFE840210D10370118090C37021809103701
-0005010505030F071F07020700B1020204B1062FED332FED002F5D3C332F5D3C3130012B
-2B2B2B2B2B0901231323012313031FFEF186A5A4FEF186A5011BFDD1022FFDD1022F0007
-0095FFE30B9305ED000B000F001B00270033003F004B00C640900908060A0918061A083C
-073E1808170A1818171A193C163E2908260A2918261A283C253E460D480F560D580F680E
-17791F7625792B7631794376490625512F034F030203031F5109020F030E08432B513D20
-19401902191949315137130A4F0C400E020C0E462A003A013A402A3A003401342E2A0016
-01163416282A0C0E060F10401002101C2A0F00010000222A10062F33ED332F5DED2F5D12
-3939ED33332F5DED2F5D33ED2F5DED2F2F5D003F3CFD3C332F5D3CFD3C3F3F3FED332F5D
-ED5D3130015D011406232226353436333216250123090114062322263534363332160134
-262322061514163332360134262322061514163332362514062322263534363332160734
-262322061514163332360374BDB2B6BABEB2B5BA02B3FCF4A5030C0285BEB2B5BABDB2B6
-BAFABB596466585866645904935964665858666459043EBEB2B5BABDB2B6BAB259646658
-586664590434E0DADADFE0DADCC0FA2F05D1FBCCE0DADCDDE0DADA01B8AC8888ADAD8787
-FE17AC8888ADAD8787AEE0DADCDDE0DADADFAC8888ADAD878700FFFF001A0000055E0801
-023600240000011700D600280175000BB602000F0B050025012B3500FFFF00C80000049D
-0801023600280000011700D600260175000BB60100100C020325012B3500FFFF001A0000
-055E08010236002400000117008DFFF80175000BB602000C0C050025012B3500FFFF00C8
-0000049D07500236002800000117008E00500175000DB7020100110C020325012B353500
-FFFF00C80000049D080102360028000001170043003C0175000BB601000D0D020325012B
-3500FFFF0089000002D508010236002C00000117008DFF120175000BB601000D0D040925
-012B3500FFFF005D0000030808010236002C0000011700D6FF270175000BB60100100C04
-0925012B3500FFFF007E000002E207500236002C00000117008EFF240175001940130200
-104010501060107010050100100D0409252B355D3500FFFF0089000002D508010236002C
-000001170043FF3E0175000BB601000D0D040925012B3500FFFF0073FFE105DA08010236
-003200000117008D00780175000BB6020025250F0325012B3500FFFF0073FFE105DA0801
-023600320000011700D6008F0175000BB6020028240F0325012B3500FFFF0073FFE105DA
-08010236003200000117004300AA0175000BB6020025250F0325012B3500FFFF00B2FFE1
-052908010236003800000117008D006E0175000BB60100201F0D1D25012B3500FFFF00B2
-FFE105290801023600380000011700D6005B0175000BB60100221E0D1D25012B3500FFFF
-00B2FFE1052908010236003800000117004300AA0175000BB601001F1F0D1D25012B3500
-000100BB00000177045D0003001E4011020501087F05010592001A7F010101880410F65D
-FDE65D003F3F3130212311330177BCBC045D00010136051103E1068C0006003A40275905
-5606690566067A0573060601020350056005700503050560030103500060007000030000
-042F332F5D002F5D332F5D1239393130015D01230B0123133303E19FB9B89BE4E3051101
-00FF00017B00000100ED051D042C06530019003940233902350E4902450E04190D190952
-0F101F1002101652100D600301031928000C28000D2F33ED2FED002F5D3333ED2F5DED33
-2F2F31305D010E01232226272E0123220607233E01333216171E0133323637042C0B846F
-365C292F412734340483088E67325D2A2F49213339030653989A27252B2B5A4C979A2724
-29295C4600010118053703FE05D10003001440090253100101010000022F332F002F5DED
-31300121352103FEFD1A02E605379A0000010113050E0402068C000D0056403A6508650C
-7508750C040D5006600670060306060AAA094003F00302D19003E003029003E003028B00
-03018950030150030159030D2A00072A00062F33ED2FED002F5E71725E5D5E5D715E5D5E
-ED332F5D3C31305D010E0123222627331E013332363704020AC5A9A9C509A60C6B5B596B
-0E068CA8D6D6A8847878840000010221051802F505DB0003000EB50244010015012FED00
-2FED31300123353302F5D4D40518C3000002012D050903E907B1000B00170045402E0F51
-090009300902313009015009600970090309091551030C29200030000200003000600003
-D0000100001229062FED332F5D7172ED002FED332F5D725E715EED313001140623222635
-343633321607342623220615141633323603E9CC9290CECC9293CB917558587576575875
-065E8FC6C5908FC4C48F567776575776760000010161FE59037000140014002440150B02
-1B012B013901041207070B53030D0E2A0000062F332FED003FFD322F2F31305D05140623
-22262735331E0133323635342627331E010370B79225742D091A58326862060399020659
-A2AC0E0CA00A1A4E581D491913340002015605160477068C000300070042B54500450402
-00B8FFE8B30E103704B8FFE840190E10370750036003700303030305019F000100000204
-0204062F33332F2F332F5D002F33332F5D333130012B2B5D09012313230123130477FEFE
-8BA9B0FEFE8BA9068CFE8A0176FE8A0176000001019FFE5F037C000A0014002440150E04
-1E042B043B04040A14141053030D000D2A00062F33ED2F003FFD322F2F31305D010E0123
-222635343637330E011514163332363733037C344B2A8BA90D069B0606535A24511108FE
-790E0C9E8F263E1A1B3C1E524E1B080000010132051103DD068C0006003A402754015902
-64016B0274017B020606050250036003700303030360020102500060007000030000032F
-332F5D002F5D332F5D1239393130015D01032303331B0103DDE4E3E49FB9B8068CFE8501
-7BFF00010000000100180000048005D1000D0047402A3B0B4B0A5A0A7A0A04020B050804
-090309090106030C3501080A030A00000F0F0F01080B140503026C0E10F63232FD325D11
-332F392F2F003FED3F12392F2F12173931305D29011107353711331101150111210480FC
-52BABAC6015DFEA302E8021798A395031AFD78011BA3FEE8FE0700010018000002360614
-000B003D4023490559056905030407010A040B05050B0B030801030800050D92000A011A
-050704880C10F43232FD3232E62F2F003F3F12392F332F12173931305D01071123110735
-37113311370236B5BCADADBCB5037A91FD1702608D9F8A0318FD7194FFFF0086FFE50502
-0801023600360000011700DF004D0175000BB6010034311A0025012B3500FFFF006EFFE5
-03D7068C023600560000011600DFAE00000BB601003734180025012B3500FFFF007E0000
-050808010236003D0000011700DF00320175000BB601000D0A020625012B3500FFFF005D
-000003E3068C0236005D0000011600DF9400000BB601000D0A050625012B35000002017A
-FE780228061400030007002940160F094F090201060106050201050B00041F014F050105
-2F5D3CFD3C003F3F1239392F2F3130015D01231133112311330228AEAEAEAE02F6031EF8
-64031E000002000E000005BC05D100120025005240333816481666026811041B1E083C0B
-0B071A340C031F3407087600011D1D0713150074270F274027602703091B1E140B09076C
-2610F63232FD322F5D10F6ED12392F5D003FED3FED12392FFD393931305D011402070E01
-23211123353311213204171612073426272E012B011121152111333236373E0105BCB193
-66FBCDFE88C4C40174DA01025898AACF7A7958C68ABC0169FE97BC8FD5596F6F02E7CBFE
-B65B3F3802E48F025E3F375FFEC4D6AFF0453227FE4C8FFDC62A3947E8000002006AFFE1
-0471061E001F00310084405B190D290D32013420392B362D45014C0D44204A2B442D5A2B
-542D6F05741E7421100C03293F090F121A1D041B10100903161B1B3F164F160216022F3E
-030A1C111A1D1C030011120F0C26051F162F160216231316090000092C14062FED11332F
-1239ED2F5D17391217392F2F003FED3F5D332F111239392F1217392FED123931305D0110
-00232200353400333216172E01270527372E012735211E01173717071612013E01353426
-272E012322061514163332360471FEE4F1E5FEEB0112CA6C9B56208757FEF842ED54905D
-0127236225D242BA99A6FEDE313403024BA55693A9A98F427B027DFEBCFEA8010EF5E201
-08353570D64AA2618E43512F1019431A80616D93FE9BFD8A3BA99620371E2D2BAF98B4AE
-2C00FFFF0006000004E608010236003C00000117008DFFE40175000BB601000B0A050025
-012B3500FFFF003DFE64047F068C0236005C00000116008DDD00000BB601000A09040025
-012B3500000200C80000049605D100120021005C403E391F491F551180108011051B3400
-0701071A34200C010C0C07090A0309080F231F23021315200030004000700004006F230F
-233F23020C1B071400096C2210F632FD32325D10F65DED5D003F3F1239392F5DED2F5DED
-3130015D011406070E012B011123113311333216171E01073426272E012B011133323637
-3E010496463C4EDB97C6C6C6CD85C243535ECE343830805AC4A777982F2C2903135CA939
-4B48FEBE05D1FEF22D2C35AA7D486B231E19FDCD292D2966000200B9FE64049006140013
-0020004D4035320239153220430249154220561267127E087C1C0A0E0906174211040C01
-1E4006090B0C141B0090221F223F22020E1B091A0C882110F6FD32325D10F4ED003F3FED
-3F3FED12393931305D011406070E012322262711231133113E0133321203342623220607
-111E0133323604904E4742B364578D49BCBC4BBB6ACAE1C28A8F51A44B5073499DB0023C
-88E14E4A512628FE2C07B0FDD43F55FECFFEECCAC84639FD87241AD4000100DC023C05B0
-02DC0003001E401100540F02010240050130054005020000012F332F5D5D002F5DED3130
-0121352105B0FB2C04D4023CA000000101230069056904AF000B00264017D702D80802A7
-0201D705D80B02A80B0105840294020202192F5D002F3130015D71005D71250709012709
-01370901170105696FFE4CFE4C6F01B8FE486F01B401B46FFE48D86F01B8FE486F01B401
-B46FFE4801B86FFE4C00000101230236039205D5000F002E4018055006060C030E03AA01
-0E0505020F0F0C0E2A02100301032F5D33ED39322F2F332F003FFD323F332FED31300121
-35331123353236373E01373311330392FD99EAF22D6C1E252C0387DD02367A0238700D0C
-102C28FCDB00000100CF023603C705EF001D0045402D24152518361535184C105E106D10
-651866197D1075180B0F0F0B521302021C52010E00001C02082A16101610022F33332F2F
-ED1239332F003FFD323FED332F3130015D0121353E01373E013534262322060723353E01
-333216151406070E01072103C7FD0864A733834A6B5A59AC300D47AF57B4BB6173379B42
-022002369C3E6E29676754454C3D1FB41A239D7D63975A2B6629000100CF020F03BC05F0
-002E007740162A033903450C4A1F540C5C1F6B0864237D0874230A27B8FFC040390B0E37
-2C2B15520F16010F161F164F165F16CF16FF16061621211D52160625020A0A0E52060F1A
-2A281622112A2216282C04091000010000092F332F5D121739ED2F2F2FED003FED332F3F
-1239ED332F2F5D71ED393931302B5D011406070E012322262735331E013332363534262B
-01353332363534262322060723353E0133321615140607151E0103BC42383994595EA54A
-0E29C35D648576708F80706B63684DC32C0E4AAD5AAFC16E595F8303314B712223211E1C
-B3243B474B553C8D4D443D473E24B21B23886A59721A08116F00FFFF00AB000007A305D5
-0036023B9200003700BB023700000117023C0404FDC300204015020E08020E400E600E02
-010B2B0B5B0B6B0B7F0B045D11355D1135003F35FFFF00AB0000074105D50036023B9200
-003700BB023700000117023E0384FDC3002640190302100803020E1F0E5F0E7F0E03010B
-2B0B5B0B6B0B7F0B045D11355D113535003F3535FFFF008C0000077905ED0026023DA600
-002700BB029100000107023E03BCFDC30036402603023608030236103630367F36030131
-003134314B315F316B317B3106000900093F094F09035D11355D11355D113535003F3535
-0001003C0000047405D10011005840330C0F09512F063F060206060B02344F0501050510
-0B01341003200301080803032F00010000130E01050A140F0E2F0B3F0B020B2F5D3333FD
-32322F11332F5D332F392F5D003FED2F12392F5DED12392F5DED39393130012111211521
-1121152111231123353311210474FD3E028AFD76014AFEB6C0B6B603820526FE55ABFEEF
-8BFECC01348B0412FFFF0073FFE305A208010236002A0000001700D900CF0175FFFF006C
-FE590443068C0236004A0000011600D9FE00000BB6020037311A2325012B3500FFFF0089
-000002D507500236002C0000011700DAFF240175000BB601000D0C040925012B35000001
-0086FE59050205EC004700C240990B0B0A1F0036003A1B0B1B1F13362F0B2A1F292F2436
-24463F0B391F3427392A34363441481F4427482A43364B3E44415F035A05523257365544
-6B026F046A30643264366642604679057A2D703670377541754486292B20400E10371F40
-0E10371A060028313F06341D38383C343402212125341D0A101014530C0D0F0F172A0937
-3F153128150031371D0904200074490F49704902206A4810E65D10E611173910ED2FED2F
-2FED332F003FFD322F3FED332F3FED332F1112173931302B2B5D011406070E01071E0115
-14062322262735331E01333236353426270E012322242735331604333236353426272E01
-272E013534243332041715232624232206151416171E01171E01050251492C683E0303B3
-9A25742D091A523868620302142515A1FEFF850E71012882B8CD61634BAF62C6BF013CF3
-9D0106650E55FEEB919FC1607940EC52A6A801A957AA3B233711162C199DB10E0CA20A1C
-4E5818291201023C3BF85E668A73635E1A141A142ACBA3BBEF3C2CEA485F84685D6A1C0E
-28152CB20001006EFE5903D70478004A00AA40810820090C37090204321902173224202B
-3B34203A3B43204B3B5A1C5C2D5237534652496B1C6B2D6237624662497C1C7C28743779
-3F74428B0188248531873F1D170300252F4006351A80390139393D3E35041E1E223E1A09
-0D0D1153090D0C0C142A0638401B2F251B002F381A06041D008E4C0F4C1F4C3F4C5F4C7F
-4C051D864B10E65D10E611173910ED2FED2F2FED332F003FFD322F3FED332F3FED332F5D
-1112173931305D2B011406071E011514062322262735331E01333236353426270E012322
-262735331E0133323635342726272E01272E01353436373E013332161715232E01232206
-15141716171E011716171603D77F6F0205B79225742D091A5832686203021528177CCF46
-0A59DA647C8C26266C288135937B393A38AD6B64CD440A48CE63678E2B2A5E34812B8347
-4701426BA32A13361AA2AC0E0CA00A1A4E58182D0F02023B23D3434F5056422222180918
-0E27976E457A302F373123C935494F4E452323160C180A1E494AFFFF0073FFE505460801
-0236002600000117008D006E0175000BB601002D2C0C1525012B3500FFFF0069FFE703F3
-068C0236004600000116008DCE00000BB601002423090F25012B3500FFFF0073FFE50546
-0801023600260000011700DF00A80175000BB601002E2B0E1525012B3500FFFF0069FFE7
-03F3068C023600460000011600DFF600000BB601002522090F25012B35000002006CFFE1
-04FB0614001B0028006F404A3B05380C3C2232243E284B054A0C4E2245244F2859086908
-70120D0114511A17171018011304072041100403082642070A160088011617131C041A1A
-01922A1F2A3F2A02231B010A852910F632ED5D10F632FD3232323210E42F003FED3F3FED
-1239393F12392F3CFD3C31305D01231123350E01232202113436373E0133321617352135
-213533153301112E0123220615141633323604FBB8BC4DAD6EC6ED524444B66059864CFE
-95016BBCB8FE8C4F73499CB2879750A404F4FB0C754252012E01118EDB4D4C4F2427CE86
-9A9AFB9902792218D6CCC3CD47000001FFFC0684051A06FC00030011B601500200000502
-2F11332F002FED313001212721051AFAE705051E06847800000100FD01FF01EC031A0003
-0016400C02560108002D2F013F0102012F5DED003FED31300123113301ECEFEF01FF011B
-FFFF001A0000055E0801023600240000011700D900310175000BB60200110B050025012B
-3500FFFF0068FFE1041D068C023600440000011600D9D600000BB602003A340B2625012B
-35000002001AFE5F062B05D1001B001E00C840900F051F052E053E05401D700806381C4A
-0E450F590E570F051D1E1D1C0A77098709020914100F101D1E0B770C870C020C140D0D0E
-570E580F7D0E730F040B34301E401E701E031E091E1D030D0E031B1B1753030D107A0D01
-0D080000142A060F20010E0F1D06040D0C102410391042105A106A1074100710106E200F
-20010A0D2B0D360D4D0D550D650D7C0D070D641F10E65D5D10F42F5D1217395D2FED332F
-003F5D3C3FFD322F3F1217392F5DED3130015D8710FD5DC0C0C08710FD5DC0C008C0015D
-005D010E012322263534363703210323012101230E0115141633323637330902062B344B
-2A8BA91E0679FD7C92C9021E0108021E610607535A24511108FD91FEFBFEFAFE790E0C9D
-90406A150154FE6105D1FA2F1B351B524E1B08033102DBFD250000020068FE5F052E0478
-003A00470099406A0B11052B1A12162B2A0544225F25544065166C2562407B127B1D7F25
-703F0F0C041B04390559166916053A3A3653030D0A103C3D301940190219192810242420
-3F28044541100A3009080000332A060F25012506193B091A2F25132F91490F491F493F49
-03421B13854810F6ED5D10E4113910FD3232322F5D2FED332F003F3C3FED3FED332F1112
-392F5DED12393FFD322F31305D015D010E0123222635343637350E01070E012322263534
-3637362437353426272E012322060723353E01333216171E011511230E01151416333236
-373301110E01070E01151416333236052E344B2A8BA90D041955282F7A5297D26D656601
-1EA42D2A28703D4AB6610A37D06576AF403F421D0607535A24511108FE3456E944516474
-7763A4FE790E0C9E8F263B1377113D12171FC89B7F9D2D2D20081D40541817102725BF0F
-24272F2E926CFD0A1B321E524E1B0801FB013705141317615560614DFFFF00C8000005B2
-0801023600270000011700DF00280175000BB60200211E080F25012B35000003006CFFE1
-062706140003001700240072B90000FFC0404A0E10370118090D3702180910373D073D1E
-34203B244D074F1E45204B245A0A6A0A70140B02020316011506091C4112040508224209
-0A0000021618061A02041F263F26021F1B040C852510F632ED5D2F33FD32322F332F003F
-ED3F3FED1239393F33332F31305D012B2B2B010323130123350E01232202113436373E01
-33321617113303112E012322061514163332360627FA7F98FEFDBC51B067C8EB514544B5
-6158884BBCBC4C78479EB0889650A40614FE0701F9F9EC75464E013401118EDE4E4C5025
-2701E4FAFF0281221ADCCAC7CF47FFFF000E000005BC05D1021600E70000000100C8FE5F
-04CD05D10020005C40390C041C042D043D04041235000F100F020F0F090E350B03133516
-090820201C53030D00192A0006060C10030A1473220F22010F1314140A6C2110F432FD32
-5D10E61117392F33ED2F003FFD322F3F3CED3FED12392F71ED31305D010E012322263534
-3637211121152111211521112115230E01151416333236373304CD344B2A8BA90B06FDC7
-03D5FCF1030FFCF1030FFE0607535A24511108FE790E0C9E8F24331D05D1B0FE68B0FDD7
-B01B351B524E1B080002006AFE5F0460047C002C0033007B40560D1E1A1E2604290D2B1E
-34043A0D3C1E3B3244044B0D4B32590D502A6C0D602B790D783212191915531D0D013C33
-3323303D29040F230B0B073F2309122A20201A1A0C0C2D1A008F350F351F353F35033301
-1B26853410F6FD325D10F4ED332F3C11332FED003FED332F12393FED12392FED3FFD322F
-31305D01211416171E013332363733150E01070E011514163332363733150E0123222635
-343637260011100033321215272E01232206070460FCC93E36348F5672E7310A4A9B5102
-03535A24511108344B2A8BA90604F8FEEB012BF4E2F5B701939697B30C021B6799313030
-5B2CCD1F3109143012524E1B089F0E0C9E8F18321212012A010401120142FEF8F32A94A2
-B284FFFF00C80000049D0801023600280000011700DF00220175000BB601000F0C020325
-012B3500FFFF006AFFE60460068C023600480000011600DFFD00000BB602002320120025
-012B3500FFFF00C80000047608010236002F00000117008DFEC00175000BB60100080702
-0325012B3500FFFF00AB0000025108010236004F00000117008DFE8E0175002FB5700270
-030203B8FFC0B3090C3702B8FFC04011090C3701044F049F040201000605020325012B35
-005D11352B2B5D00000200C80000047606140005000900464016070C0B0D370808090102
-030435010800000B0F0B0106B8FFEA40110E1037080C0B1037060608041408016C0A10F6
-32ED2F332F2B2B5D11332F003FED3F3F332F3130012B2901113311210B0123130476FC52
-C602E8C3FA7F9805D1FADF0564FE0701F900000200BB000003540614000300070042400D
-010C0B0D370202030601050800B8FFEA40190E1037020C0B103700000F021F0202020204
-1A7F050105880810F65DFD322F5D332F2B2B003F3F33332F3130012B0103231303231133
-0354FA7F98FCBCBC0614FE0701F9F9EC0614000200C80000047605D1000500090036401E
-07562F0801080801020304350108062D07070100000B0F0B010414016C0A10F6ED5D1133
-2F12392FED003FED3F12392F5DED3130290111331121032311330476FC52C602E89CE9E9
-05D1FADF0157010B000200BB00000362061400030007002D401A05560606010201010807
-2D6F067006020606001A7F010101880810F65DED332F5DED003F3F12392FED3130212311
-33012311330177BCBC01EBE7E70614FBF4010900FFFF00C8000005380801023600310000
-0117008D00780175000BB601000C0B050925012B3500FFFF00B90000045F068C02360051
-00000116008D0000000BB6010019180E1625012B3500FFFF00C800000538080102360031
-0000011700DF00A20175000BB601000D0A050925012B3500FFFF00B90000045F068C0236
-00510000011600DF1C00000BB601001A170E0225012B3500FFFF0073FFE105DA08010236
-00320000011700DD008C0175000DB703020029260F0325012B353500FFFF006AFFE10471
-068C023600520000011600DDD800000DB70302001D1A060025012B353500FFFF00C80000
-059808010236003500000117008DFFF60175000BB602002221060B25012B3500FFFF00B9
-00000372068C0236005500000117008DFF380000000BB6010015130A1225012B3500FFFF
-00C8000005980801023600350000011700DF000A0175000BB602002320060B25012B3500
-FFFF009200000372068C023600550000011700DFFF600000000BB6010016130A0325012B
-3500FFFF0086FFE5050208010236003600000117008D00140175000BB6010033321A1F25
-012B3500FFFF006EFFE503D7068C0236005600000116008D9400000BB601003635063225
-012B350000010000FE5904EE05D1001B0048402E0C071C072C073C07040C0C1053080D01
-18351A030216080B0B132A050F1D1F1D4F1D03005B050114185B4F1901192F5DF4FD32E4
-5D2FED332F003F333FFD323FFD322F31305D0121111E011514062322262735331E013332
-3635342627231121352104EEFDEC0309B79225742D091A58326862050332FDEC04EE0521
-FB04144822A2AC0E0CA00A1A4E581E36170521B00001003EFE5902FD059E0030006F4046
-0C080D1A19081E1A2B082F1A3C08070D0D1153090D20251C3E22201F0503171830302C3F
-18094F327F32020C0C142A06182306031C008C321D22251A1F1D4F1C7F1C021C883110F6
-5D3232FD322F10E61117392FED332F5D003FFD322F1239393F3333FD322F3FFD322F3130
-5D250E01071E011514062322262735331E01333236353426272322263511233533113311
-211521111416171E01333236373302FD0C1C100204B79225742D091A58326862030214AB
-B27F7FBC0184FE7C0818164D4F2E64160A0A030703122C18A2AC0E0CA00A1A4E58172F10
-B7CB02529E0141FEBF9EFE0358632B28251B0900FFFF0000000004EE0801023600370000
-011700DFFFEE0175000BB601000B08060725012B35000002003EFFEA037A0705001B001F
-0073404C0B041C042A042A1D2A1E3A1D3A1E4A1D4A1E551C641C691E741C791E0E1F1F1E
-0B10073E1E0D0B0A051B1B173F03094F217F21021C1C1E1E100E008C21080D101A0A0800
-4F077F070207882010F65D323232FD322F10F63211392F332F5D003FFD322F3F333333FD
-322F2F332F3130015D250E012322263511233533113311211521111416171E0133323637
-331303231302FD357D31ABB27F7FBC0184FE7C0818164D4F2E64160A7DFA7F980A0E12B8
-CB02529E0141FEBF9EFE0358632B28251B090652FE1101EFFFFF00B2FFE1052908010236
-00380000011600DB63500079405B02010900210140215021A02103EF102101902101BD00
-210150218021028B10214021702103B021C021F021039021C02102599021C021E0210310
-21602190210331002101E021010F211F214021502180210521020100241E0D1D25012B35
-3500115D71725E71725E5D71725E5D725E5D725E5D715E353500FFFF00B1FFE1045707B1
-023600580000011600DB0000000DB70201001D17091625012B353500FFFF00B2FFE10529
-0801023600380000011700DD00780175000DB7020100241F0D1D25012B353500FFFF00B1
-FFE10481068C023600580000011600DD0A00000DB70201001D18091625012B353500FFFF
-007E0000050808010236003D00000117008D00070175000BB601000B0D050625012B3500
-FFFF005D000003E3068C0236005D00000117008DFF680000000BB601000B0D050625012B
-3500FFFF007E0000050807500236003D0000011700DA00390175000BB601000B0A050625
-012B3500FFFF005D000003E305DB0236005D0000011600DA9200000BB601000B0A050625
-012B3500000100C80000048A05D10005001F401003013504030000070F07010214036C06
-10F6ED5D11332F003FED2F3130012111231121048AFD04C603C20521FADF05D100030073
-FFE105DA05F0001700230027006D404F040004060B0C0B1217001706190C191257015705
-53075F0B580D58115F13531710253560260126260976097915021B3415022134090A2726
-27260F18150373290F29010F291F293F29031E150F682810F6ED5D5D10F6ED1239392F2F
-003FED3FED5D12392F5DED3130015D011612151402070E01232224272602353412373624
-33321613100023220011100033320003213521051E5B6163595CFBA19DFEFF5A5A61605C
-5801059AA0FF47FEFCE1E3FEFD0108DEDE0107ACFD8D0273052664FEDEB8B8FEDD616566
-6863630120B9B6012167626869FD610122013BFEC5FEDEFEDBFEC901370106B300030069
-FFF0062405E1001D002A00370058403624182C321525062B32091509081603082A1E2532
-65006A0F041E150032150F00072B1518250407140F080839381F393F396F399039045D11
-12392FC4ED173910C42FED2FED5D002F3F1239392FED39392FED39393130011406070E01
-071523352E01272E01353436373E01373533151E01171E01073426272E0127113E01373E
-0101110E01070E01151416171E010624594F55F48AC586F6574F59564C51F395C594F64F
-4B57CE403B3A8E6A5E9A324142FD8E6A8E3A3A414340319B02F38CD9494F5D03A6A6035A
-524AD88C88CC4C515E049B9B03624E49D07F63A639383402FC8602392F3CAEFEAC037A01
-363737AA6170B63A2D3C0002006CFFE10443047C00130020005740162A032A203C1A301C
-38204F1A421C4820580668060A10B8FFC040230B1037120502110518410E0401081E4205
-0A1114021A0092221F223F22021B1B08852110F6ED5D10F6FD3232003FED3F3FED123939
-3F31302B5D2123350E01232202113436373E0133321617353303112E0123220615141633
-32360443BC51B067C8EB514544B56158884BBCBC4C78479EB0889650A475464E01340111
-8EDE4E4C502C2734FCB6027C221FDCCAC7CF47000002006AFFE104730614001900280086
-4029031C0520171526153B0A3A0E3A1C3E214C0A490E4A1C4F2153176B0E7B0E7A207B21
-1136264626021DB8FFE04034121C371D180A11371D171D0C050F133E1001263F030A1111
-001D0C0F1A1B00140F00902A0F2A1F2A3F2A6F2A040F0F231B06852910F6ED332F5D10E4
-113910ED11393911332F003FED3FFD323F33332F2B2B5D31305D01100023220011343637
-3E01372E012735211521151E01171E01073426270E01070E011514163332360473FEEBEE
-F1FEEB564045B45C4CB466032AFDCF44DE5D9676C26E6E4291423F55AA9C99A60227FEF0
-FECA012F01068DC5404852113F8748B39E0A2E9C5488FBA487E45608303532AE7FC9D0D3
-0001006DFFE603EE0478003D007C40432612263B363B49014418590154186A016F0B6418
-79017A0B7418792274350F0C2C3F2B2B03161A1A1E3E16043D3D393F0309192B40090C37
-2B241B10100C2B19040900B8FFC0401009143700003F7F3F803F02331B09863E10F6ED5D
-11332F2B1217392FED2F2B2F003FED332F3FED332F1112392FED3931305D250E01232226
-272E0135343637352E01353436373E013332161715232E01232206070E01151416171E01
-3B0115232206070E01151416171E01333236373303EE6BCE734FA446455771795B6C5F41
-40A24F62A45A0D42C3642D4E2A233338302D68356F9E3E642A2931342925653866E8470D
-40302A2028277F5E6090260718845C5975222120211CCF33380B140F432C3D440F0E03A6
-0911114A3B354A151314483E0002006AFFE1050F047C0011001D004D40163A15351B4A15
-451B040E3F0D05153E09041B3F030A0FB8FFC040190B0D370E0E090C0F0306121B00901F
-1F1F6F1F02181B06851E10F6ED5D10F4ED121739332F2B003FED3FED3FED5D3130011000
-232200111000333216172115211E010734262322061514163332360471FEE7E9F1FEEC01
-1AED376A1D01E0FEE03E44C2A49AA1A4A79C98A8022EFEE7FECC013C01110113013B1609
-A549C27FD7D6E0CDD1DAD7000001000A000003EE045D0007003840230301043F06054000
-4F0502000500021A05A003B00302030309080F093F094F097009045D1112392F5D33FD32
-2F2F5D003FFD322F3130012111231121352103EEFE6CBCFE6C03E403B8FC4803B8A50002
-0068FE6405EA047A001D0024007840163515740F022110090C37213E1A040F0522037717
-0117B8FFF0400F090C37173E0609050C75147A1E0211B8FFC040250D103711112217041A
-05050C1E1B3A0001008F260F261F264F266026040F2601141B0C852510F6ED5D5D10F45D
-ED12392FED3939332F2B5D003F3FED2B5D39393F3FED2B31305D011000051123112E0127
-2E01353412373315060215141617113E0133200003342623113E0105EAFEA9FEF3BB82DD
-51555E7685E58894E1BD214B270130015DC3E0C1CED30240FEFDFEC40FFE72018E065145
-4AC4869F01128A1163FEF6A7BDE60603E80201FED5FEFBB8DBFCB20AE8000002FFFCFE59
-051AFFAE000300070020400F02500101080650050D0400000905022F3311332F33003FED
-12392FED31300521352111213521051AFAE2051EFAE2051ECA78FEAB7800FFFF01230000
-03DC05D10036000400000117000401D90000001E40140302200D5F0D6F0D030D01000005
-10057F0503052F5D35352F5D35350001009A022A03C605F00016004DB90014FFE0B3090C
-3715B8FFE0B3090C3713B8FFF84017171B370110130D0D085313020E03012A000018100B
-2A0DB8FFC0B3090A370D2F2BFD3211332FED003F3FED332F1239332B31302B012B012311
-3426272E012322060711231133153E013332161503C6AC0E15164D40418D41ABAB4BA254
-9AA6022A0215466A2424234332FD4503AB683E45B9AB000200C8FFE508CA05D1004E005D
-00E240210B18044D19012E18204D55316A186631654D791375487952735A0D05200E1037
-3DB8FFE040310E103711001A46043B033F400B0D373F3F433E3B4F3501353B351E37213E
-34243134032C573450290129292B56342C0307B8FFC0403C0B0D3707070E3E0309202B3A
-4F4A4F0237341F1A20201A330606461A381D3E1A3E1A3E111A00005F0F5F014F13225F33
-7F33023333572A13702B012B2F5DFD32332F5D39ED5D11332FED33332F2F123939ED332F
-1112392FED39395D002F2F3FED332F2B3FED12392F5DED1217392FED393933332F5D2FED
-332F2B1112173931302B2B5D0114062322262735331E01171E01333236353426272E0127
-2E013534363723112311230E01070E012B01112311333216171E011733353315213E0133
-32161715232E01232206151416171E01171E01013426272E012B0111333236373E0108CA
-E2BE6ABA3D0917472D356145667943552A62377E6E0F12DDB57C0C3B2F4DCCA030BCF486
-B44847580A78B5017F24733155B53E0940B15B59723B562E642E7284FA5E36372F83572E
-1178962F2F2701429BC23C22D31331161A1E4C5A4844160B131026956E254426FC4E03B2
-45792F4D4DFDD505D12D302F9364DCDC12183024C935494E4F4648170C180C1E8E024F4D
-75241F1DFDA32D2F306DFFFF0089FFEB063E05D10036002C00000117002D035400000005
-B20F23015D00FFFF00AFFE59043D05DB0036004C00000117004D02280000001840115023
-60237F23030302500C600C7F0C030C2F5D35355D000200000000052706140016001A0065
-B90017FFE8403F0D10371818090C3719180910370315161575150318181701100D084213
-040E05010D08171740190119100B1A19300D500D700DAF0DCF0D050D0D021A00911C10F6
-ED332F5D33FD322F5D332F003F3C3F3FED12393F332F31305D012B2B2B2123113426272E
-012322060711231133153E0133321615090123130527BC1218195E4B4DA84DBCBC58BC63
-B5BEFC72FEF18AA5027C4D87262A294C3BFCBE045D7C4952DACD033FFDD1022F000100D5
-0366028705D100030027B90000FFE840140D10370118090C3702180910370101030300B1
-022FED003F332F3130012B2B2B090123130287FED688C205D1FD95026B00000200D50366
-041805D1000300070050B90004FFE8400E0D10370518090C37061809103700B8FFE84020
-0D10370118090C37021809103746000101050503070304B13F0601060600B1022FED332F
-5DED003F3C332F3C3130015D2B2B2B2B2B2B09012313210123130287FED688C20281FED6
-88C205D1FD95026BFD95026B00040095FFE3080705ED001B001F002B003700CA400C471D
-481F561D591F681E050BB8FFE040160E103701200E10371F1D1C071D171D021D291E1E1F
-29B8FFF44012090B37230C090B374F0D401B7A2F75350417B8FFE8404A0E103711180E10
-371F031B1B17512F034F0302030D030D115109022F51202940290229293551230A1E0840
-1E011C1E322A00260126262C2A1C1E062020390F39010D2000010000142A062FED332F5D
-335D11332F123939ED332F5DED2F2F5D003F3FED332F5DED3FED33332F2F5DED332F3F2B
-2B5D2B2B3130018710ED5D87C0002B2B015D010E012322263534363332161715232E0123
-220615141633323637330901230901140623222635343633321607342623220615141633
-3236032D1E934EC0D9DDBC417F3F0E3C73396D7F7B71497A250E02F5FCF4A5030C028ABE
-B2B5BABDB2B6BAB2596466585866645902BE1232E6D2C9F22121AD3233959C9698422302
-68FA2F05D1FBCCE0DADCDDE0DADADFAC8888ADAD87870002000FFFE8028605D3001B002B
-006E400D531D621D701C0316180B113705B8FFF040310B0F37001A010B1C051B1B051612
-120F5216092550050347080112121F2908401114372F0801081C1B001A0008030B2A01B8
-FFC0B3101437012F2BED17332F33322F5D2BED332F5D003FED3FED332F1112392F17392B
-2B31305D13371134363332161514020711141633323637150E012322263D0107133E0135
-3426272E01232206070E01150FB17B6F607C78A51D1B1A44693771395C6B4FF8622F0D0D
-0A190F0F19060B0C01A6EB01C7E299826D5CFEF7E6FE61592B214AA22C2B727FE162022B
-A980371E30110C0D0C0E156E5800000200920000044203B0000300070025401507CB0101
-05CB0307CB010105CB00031003300303032F5DED332FED002FED332FED31301321112113
-1121119203B0FC504C031803B0FC500364FCE80318000001008301BD0252038C00030017
-400B02020300000002300202022F5D332F002F332F3130011121110252FE31038CFE3101
-CF000002008301BD0252038C000300070023401306CB020205CB0304CB000006CB000230
-0202022F5DED332FED002FED332FED313001112111052111210252FE310183FEC9013703
-8CFE3101CF4CFEC9000100B10088042203F9000B0021401409090F032F034F0303030606
-00009000A00003002F5D332F002F5D332F3130133400333200151400232200B10102B7B6
-0102FEFEB6B7FEFE0240B70102FEFEB7B6FEFE0102000002007001AA026603A0000B0017
-0065400B06102326370610171A3700B8FFF0B323263700B8FFF04015171A3712CB06060C
-CB000910171A3709100B0E3703B8FFF0B3171A3703B8FFF040130B0E3715CB03030FCB00
-0920093009600904092F5DED332FED2B2B2B2B002FED332FED2B2B2B2B31300132161514
-06232226353436172206151416333236353426016B689393686893926949666748486766
-03A093686893936868934C674849666649486700FFFF001A0000055E073C023600240000
-011700D80031016B000AB602000C0B0607252B35FFFF0068FFE1041D05D1023600440000
-011600D8D900000AB6020036371D26252B35FFFF0073FFE5054608010236002600000117
-00D600A90175000AB601002F2B0F15252B35FFFF0069FFE703F3068C0236004600000116
-00D6F4000011400C014026502602002622060F252B5D3500FFFF0073FFE5054607500236
-00260000011700DA00A80175000AB601002C2B0F15252B35FFFF0069FFE703F305DB0236
-00460000011600DAF5000011400C012024302402002425060F252B5D3500FFFF00C80000
-049D073C023600280000011700D80033016B000AB601000E0F0203252B35FFFF006AFFE6
-046005D1023600480000011600D8F700000AB6020022231200252B35FFFF00C80000049D
-0801023600280000011700D900400175000AB60100120C0203252B35FFFF006AFFE60460
-068C023600480000011600D9FE00000F400A027026010026201515252B5D3500FFFF00C8
-0000049D0750023600280000011700DA004F0175000AB601000E0F0203252B35FFFF006A
-FFE6046005DB023600480000011600DA0000000AB6020022231218252B35FFFF0073FFE3
-05A208010236002A0000011700D600D00175000AB601002925070F252B35FFFF006CFE59
-0443068C0236004A0000011600D6FB000011400C0230354035020035311A23252B5D3500
-FFFF0073FFE305A207500236002A0000011700DA00CE0175000AB601002728070F252B35
-FFFF006CFE59044305DB0236004A0000011600DAF5000011400C0250336033020033341A
-23252B5D350000010073FE5905A205EC0038009540200906060E07261D06130E210E350E
-4901410E510E6506650B630E740E741C0F2CB8FFE04043090C37323236532E0D28032235
-40230123230C03101017340C021D34030A3131002A0F2B1F2B022B760901221022042B27
-040910216C25753A0F3A403A021A1509683910F4ED5D10F4ED331217392F2F5D2F5DED33
-2F003FED3FED332F1112392F5DED12393FFD322F3130012B5D0534262722242726023510
-002132041715232E01272E012322001110002132363711213521110E01071E0115140623
-22262735331E0133323603820302ADFEE066677001A1016C7F010999121F763945AF6FFA
-FEDD0130010660BF48FE7102535AD45E0103B79225742D091A583268626B152B0F5F6061
-0123C30165019D3D49EB184E1A1F29FEBFFEEEFEDFFEBF261E016DAEFD8129460F0E2516
-A2AC0E0CA00A1A4E0003006CFE590443068C002300300034009F406F243234320233200D
-10373D133E2A322C3A3044094B134C2A422C4B305B015D055A166A016C056A167C057020
-112F343F344F3403343433331E220512211528401E0407070B40030D2E41150731315033
-603302333300180F0601062124121A0006180092361F363F36022B1B18853510F6ED5D10
-E4113910FD32322F5D1112392F5D332F003FED3FED332F3FED1239393F11332F332F5D31
-305D012B5D2510002122262735331E01333236373E013D010E01232202113436373E0133
-321617373303112E01232206151416333236130323010443FEFEFEF459A9520A2EC86460
-7E23231E559B78C8EB514641BA5C6183490CB0BC4B81409BB2849952A534B3F301117FFE
-E4FEF61917C012352E29276E446644430121010790D14C474F272830FCD60261221DD0C6
-BCC23F058EFE8A017600FFFF00C80000053B08010236002B0000011700D600760175000A
-B60100100C060B252B35FFFF00B90000045F08010236004B0000011700D600220175001A
-4012014F1B6F1B9F1B031B112601001B170808252B35002B5D3500020020000005E305D1
-001300170060403D0E1201160408520B400C0F370B0B0C05350017101702170B10170304
-070C03070000120F150303140278190F19401950190309090B0E16030614076C1810F6ED
-1739332F5D10F6ED1739332F002F3F1217392F71ED12392F2BED17393130012311231121
-11231123353335331521353315330135211505E3A8C6FD19C6A8A8C602E7C6A8FE92FD19
-0455FBAB02D9FD2704558CF0F0F0F0FEA8CCCC00000100130000045F0614001E00504030
-031D161D751D0317140E51111112180D08421B041201010D08150F021A0091201F206020
-02141517030B1A110F0D881F10F63232FD17325D10F6ED2F2F003F3C3F3FED123912392F
-ED393931305D2123113426272E0123220607112311233533353315211521113E01333216
-15045FBC1218195E4B4DA84DBCA6A6BC0141FEBF58BC63B5BE027C4D87262A294C3BFCBE
-04F4869A9A86FEED4952DACD0002002C0000033307C8000B0025006DB9001BFFD040400B
-10370E300B10370C0C15520F1C1F1C021C191C192252700F010F0F09043206030A033201
-0825280F0C1F0C020C1828190C276D080B5A0A1405025A19036D2610F432ED32FDED32E4
-332FED2F5DED003FED323FED32332F5DED33332F2F5DED332F31302B2B29013533112335
-2115231133130E01232226272E0123220607233E01333216171E013332363702D5FDB4C3
-C3024CC3C35E077D663453262D3C20302D0288037E683351282A431D2E31019804A19898
-FB5F0730989724262B2A5B4B88A6242528295B470002FFF200000241063C0003001D0054
-40347C0673130204040DAA1440090C37141114111AAA0707020501081DAD0440090F3704
-10AD117F1F011F9204001A117F010101881E10F65D32FD32ED5D2FED2F2BED003F3F332F
-ED33332F2F2BED332F31305D21231133131406232226272E012322061523343633321617
-1E01333236350177BCBCCA6750283A1E202D17232170684E2F3220212C162421045D01DF
-81821A202322454181821B1F2322483E0002005F000002FF073C000B000F004D40150E32
-0D0D09043206030A033201082F0F3F0F020F0EB8FFC040150B0D370E0F116D0A080B5A0A
-140305025A0E036D1010F632F43210FDF43210E6332F2B2F5D003FFD323FFD32332FED31
-302901353311233521152311331321352102D5FDB4C3C3024CC3C32AFD6002A09804A198
-98FB5F060A9A0002FFFC0000023605D1000300070032401D025301010605057F00700202
-00027F0901099200041A027F050105880810F65D32FD32E65D2F2F5D002F3F332FED3130
-01213521032311330236FDC6023ABFBCBC05379AFA2F045D00020080000002DF07D3000B
-00190059401F0C701201121216AA0F0F09043206030A0332010819290C400B0E370C1329
-12B8FFC040130B0F37120C1B6D080B5A0A1405025A12036D1A10F432ED32FDED32E4332F
-2BED2F2BED003FED323FED32332FED332F5D333130290135331123352115231133131406
-232226353314163332363502D5FDB4C3C3024CC3C30A939C99979E454D49489804A19898
-FB5F073BA8CFCFA886726E8A00020001000002300668000D0011004840150006060A5003
-0310050F0D2900400B103700072906B8FFC040130B1037067F13011392000E1A067F0F01
-0F881210F65D32FD32E65D2F2BED2F2BED002F3F332FED332F3331300114062322263533
-1416333236350323113302308B8C8A8E924145414427BCBC06689AC0BE9C7A6B6283F998
-045D00010089FE5F031C05D10020004F402D1C20090C3709043206030A03320C01081717
-13531B0D1818102A1E1E0B02226D0A080B5A0A140305025A036D2110F4F43210FDF43210
-E61112392FED332F003FFD322F3F33FD323FFD3231302B21233533112335211523113315
-230E011514163332363733150E012322263534360174EBC3C3024CC3C3C2060942582141
-1309245122879A099804A19898FB5F981C29265150130B9E0A0BA08C22350002008EFE5F
-024605DB0003001B0056401C0820090C371B1753070D014402400B0D3702030E050D1104
-04142A0AB8FFC040170B17370A0A0E7F1D011D9200600F1A01607F0E010E881C10F65DE4
-FDE4E65D11332F2BED332F002F333F3F2BED3FFD3231302B01233533130E012322263534
-3637113311230E0115141633323637330183D4D4C3245122859C2508BC3C060742582141
-13090518C3F8990A0B9E8E3F6F19040BFBA31A361B5150130B00FFFF002CFFEB034D0801
-0236002D0000011700D6FF6C01750014B1011AB8FFC040090B0E37001A160415252B2B35
-0002FFC2FE5902AF068C0015001C005540340A011C0102551B651B751B0318161A1B1B1A
-1A123E150507070B40030D1A1A4F1301137F06010616121A1306160370150115921E10F4
-5D1732ED2F2F5D2F5D332F003FFD322F3FED332F332F1239395D31305D05140623222627
-35331E01333236373E01351123352137230B012313330209C8A828832C0A1C5F2D485816
-160DE901A5A69FB9B89BE4E31BC4C8100CB30B1C282828715103849EB40100FF00017B00
-FFFF00CDFE59057505D10236002E0000011600DCFB00000AB601001A0C0500252B35FFFF
-00C1FE5904AF06140236004E0000011700DCFF7C00000011400C01301A401A02001A0C05
-0A252B5D3500000100C1000004AF045D000B007D40512802D801DB090309010F0D1F011D
-021F0D2D012F0D300B400B540B69027A010C020203011A000B000809B4020B0A030A0802
-050A0507050105080B02600A700A020A0A00000D200D400D0208031A05890C10F4FD325D
-11332F332F5D3939003F3C3F3F1239393130018710C0C07AF51804C0018710FD08C0015D
-7121230107112311331101330104AFF8FE407ABCBC021FEDFDF901E974FE8B045DFDD102
-2FFDFC00000100C8FE59047605D1001A003F40240C20090C37111115530D0D0203043507
-01081010182A0A0A0105051C0F1C010414016C1B10F4ED5D11332F12392FED332F003F3C
-ED3F3FFD322F31302B29011133112115211E011514062322262735331E01333236353426
-02BFFE09C602E8FEE30204B79225742D091A583268620605D1FADFB0122F18A2AC0E0CA0
-0A1A4E581E3E00010005FE5901E906140018003D40240A20090C370F0F13530B0D020104
-01080E0E082A1616017F1A011A92041A7F010101881910F45DFDE45D12392FFD322F003F
-2F3F3FFD322F31302B2123113311331E011514062322262735331E013332363534260149
-8EBC6C0105AE8525642809184E285E52010614FA00123724A2AC0C0CA00B174F57153300
-FFFF00C8FE59053805D1023600310000011600DCFE000013400E01201630164016030016
-0A0400252B5D3500FFFF00B9FE59045F047C023600510000011600DC8B000013400E0100
-2310232023030023170D00252B5D3500000100C8FE59053805D10016009D401F00076107
-7107A107040C070B0C1B0736074607540765077507B001B0070A07B8FFC040510B113776
-06010F0102061F01150626013601340646014406560153066006790170060E0406015A01
-550602111115530D0D0207040806030A0104080110100A06010207130A78180F18401802
-0213046C1710F4ED5D10F4FD11393911332F2F003F33333F3C1239393FFD322F31300172
-715D5D002B5D71043501112311210111331114062322262735331E0133320480FD01B901
-330284B9CEB42751250B163A1E7F948A053EFACC05D1FBA00460FA18BFD10806A8050A00
-000100B9FE59045F047C00260045402B03150C191615751504100D084213040E050D081E
-1E22531A0D1D1D021A1791281F28602802100B1A0D882710F4FD325D10F6ED332F003FFD
-322F3F3F3FED123931305D0435113426272E012322060711231133153E01333216151114
-062322262735331E01333236373603A31218195E4B4DA84DBCBC58BC63B5BECCB4274E26
-0B163C1A4C6117162556024B4D87262A294C3BFCBE045D7C4952DACDFD0FBFCC0706A805
-0A262626FFFF0073FFE105DA0746023600320000011700D8009B0175000AB6020026270F
-03252B35FFFF006AFFE1047105D1023600520000011600D8E300000AB602001A1B060025
-2B35FFFF0073FFE105DA0801023600320000011700D9009C0175000AB602002A240F0325
-2B35FFFF006AFFE10471068C023600520000011600D9E400000AB602001E180600252B35
-FFFF00C8FE59059805D1023600350000011600DCF600000AB602002420050D252B350001
-001BFE590372045D002700574034000D100D200D032120090C370C090F131317430A0F05
-1C090826260253220D25251F2A05050913132940297029020C1B1A09882810F4FD325D11
-332F11392FFD322F003FFD322F3F2F3F3CFD322F11123931302B5D1E0133323635342627
-231133153E013332161715232E012322060711331E011514062322262735333C4E285E52
-0102A6BC70AB59312C2C0A2A4F3657A24B840105AE8525642809FA174F57153323045DA5
-5A4B0507C10A094D3DFCFB123724A2AC0C0CA000FFFF0086FFE505020801023600360000
-011700D6004A0175000AB6010035311A00252B35FFFF006EFFE503D7068C023600560000
-011600D6AF00000F400A017F38010038341A00252B5D350000010000000004EE05D1000F
-004140250D0A003203030F09043506030F0F111F114F11030B020B085B090D0009140204
-5B4F0501052F5DF432ED393910E4332F2F5D002F3FFD3212392FED393931300121352111
-21352115211121152111230214FEB4014CFDEC04EEFDEC014CFEB4C602E48F01AEB0B0FE
-528FFD1C0001003EFFEA02FD059E0023006E40210420090D37181507510A0A0E030F140B
-3E110F0E0523231F3F03094F257F250216B8FFC0401E090B3716160713008C250909070C
-0A0E111504181A0C07400D103707882410F62B32ED17392F12392F10F63211392F2B5D00
-3FFD322F3F3333FD322F1112392FED393931302B250E012322263D012335331123353311
-331121152111211521151416171E01333236373302FD357D31ABB27F7F7F7FBC0184FE7C
-012DFED30818164D4F2E64160A0A0E12B8CBA88601249E0141FEBF9EFEDC865358632B28
-251B0900FFFF00B2FFE1052907C8023600380000011700D700610175000AB601002B1E0D
-1D252B35FFFF00B1FFE104570653023600580000011600D70600000AB601002417091625
-2B35FFFF00B2FFE105290746023600380000011700D800630175000AB6010020210D1D25
-2B35FFFF00B1FFE1045705D1023600580000011600D80100000AB60100191A0916252B35
-FFFF00B2FFE105290801023600380000011700D900630175000AB60100241E0D1D252B35
-FFFF00B1FFE10457068C023600580000011600D90100000AB601001D170916252B350001
-00B2FE5F052905D1003400634044231223183D093D2139224C094C214B22771377170A33
-20090C372E2E2A53320D1C24060D031534060A2F2F272A00060023030C1B141E76360F36
-1F364036030F140C6B3510F4ED5D10F6ED1217392FED332F003FED3F1239393FFD322F31
-302B5D053436372206232226272E01351133111416171E01333236373E01351133111406
-070E01070E011514163332363733150E012322260314050509190F8CD0475147C621272C
-976A6B962D2721C647512D683D0405535A24511108344B2A8CA8741A271601494852E8A9
-037BFC7B798C394142414239936D038AFC85A2F1502C3B10143C17524E1B089F0E0C9F00
-000100B1FE5F0567045D002A005C40220B0619077A07032720090C370205150905114205
-0A010822221E53260D23231B2A29B8FFC04015091037292914021A17922C1F2C602C020B
-1A08872B10F4ED5D10F4FD32322F2BED332F003FFD322F3F3FED3F3C123931302B5D0437
-350E01232226351133111416171E0133323637113311230E011514163332363733150E01
-23222635340395065FAE69B0C4BC101A1B565249AD4BBC1E0607535A24511108344B2A8C
-A81D1D7C4B50D7D002D5FD8455792B2C284C3B0342FBA31B351B524E1B089F0E0CA08D24
-FFFF005C0000078D08010236003A0000011700D601690175000AB60100110D0600252B35
-FFFF005600000636068C0236005A0000011700D600BB0000000AB60100110D0600252B35
-FFFF0006000004E608010236003C0000011700D6FFEE0175000AB601000D090500252B35
-FFFF003DFE64047F068C0236005C0000011600D6DD00000AB601000C080400252B350001
-00B900000308061E0010002440140000043F0D0009080000081A6F097F090209891110F6
-5DED332F003F3FFD322F313001232E012322061511231134363332161703080A1F642679
-67BCC2BF3F652A055E09136B8CFB7D0482C2DA0C08000004001A0000055E08000012001E
-00210025013F40862B20372040205A18551A501E55206918651A651E0A180B170D4A0646
-125906561278027703082020211F02370187010201140012002021033704870402041405
-05060606091226062912370638124606491258127A0675120B24240C702501251651A00C
-F00C02060C160C3F0CF00C040C03340F2170210221212006120405201C401C020C1CB8FF
-C0406C393937501C701C021C01050824400E10370F242F240222222440090D372413290F
-0F2F0F4F0F8F0F9F0F050F19290009200940098009900905090F270106090F122405050C
-0024003A0042005A006A0074000700006E270F27010A052B0535054D05550565057B0507
-05642610E65D5D10E62F5D1217395D2F5DED2F5DED2F2B332F5D2B003F3C2F5D2B335D12
-17392F5DED2F5D72ED2F5D12392F3130015D8710FD5DC0C0C08710FD5DC0C008C0015D00
-5D212303210323012E013534363332161514060727342623220615141633323613090207
-2337055ED394FD8094C901F83139A17373A039302A47393948493838487DFEFEFEFD021D
-F39595019FFE6105571F65406D90906D40651FC4364B4A37394B4CFC6602CBFD3505B7CD
-CD0000040068FFE1041D07330032003F004B004F00D6B50C0A190A0230B8FFC040880B0E
-37590E51215C38690E63216F397B0A7A1474207B380A0208343D3011401102111149084F
-4F4E4E43AA062916299F290329400B0D37292F0123494F1F011F291F184149043D41080A
-01084E400D10374C4C4E40090C374E4E2640292F2C3F2C022C2C26297F468F4602464600
-0F1F011F1134021A001F0B0091510F511F513F51033A1B0B855010F6ED5D10E6113910FD
-32322F5D12392F5DED332F5DED12392F2B332F2B003F3FED3FED33332F5D123911392F2B
-5DED332F332F1112392F5DED123931305D012B5D2123350E01070E012322263534363736
-2437353426272E01232206070E010723353E01372E01353436333216151406071E011503
-110E01070E0115141633323603342623220615141633323613032313041DBB1955282F7A
-5297D26D6566011EA42E29296D3F3A692A3150130A2369311C259F73739E2E237D87BB56
-E9445164747763A443473939484938384895F3959577113D12171FC89B7F9D2D2D20081D
-4156171811140B0D1D07BF0914081E532E6D90906D335B1F22AA9AFE1D01370514131761
-5560614D042C364B4A37394C4D0262FEEE011200FFFF000E0000076D0801023600900000
-0117008D01DE01750011400C020F164F16020016140607252B5D3500FFFF0068FFE3073F
-068C023600A000000117008D01690000000AB6030055541B00252B35FFFF0073FF6E05DA
-08010236009100000117008D007801750013400E03303A403A603A03003A3B0F00252B5D
-3500FFFF005DFF6C0471068C023600A100000116008DE2000011400C03302E402E02002E
-2F0C00252B5D35000001015A03400249045D00030014400A01560205032D000201022F5D
-ED003FED3130012311330249EFEF0340011DFFFF005C0000078D08010236003A00000117
-004301730175000AB60100100D0600252B35FFFF005600000636068C0236005A00000117
-004300C30000000AB60100100D0600252B35FFFF005C0000078D08010236003A00000117
-008D01690175000AB601000F100600252B35FFFF005600000636068C0236005A00000117
-008D00BF0000000AB601000F100600252B35FFFF005C0000078D07500236003A00000117
-008E016C01750020B10213B8FFC040120D10370F13010100135F13020013100600252B5D
-355D2B35FFFF00560000063605DB0236005A00000117008E00BF0000001EB10213B8FFC0
-40100D10370F1301010013010013100600252B5D355D2B35FFFF0006000004E608010236
-003C000001170043000A01750014B1010AB8FFC040090D1037000A0A0500252B2B35FFFF
-003DFE64047F068C0236005C000001160043FF000015401001200B300B600B700B04000B
-090400252B5D35000001FFED03E40186061300030032B90003FFE4B70D10370101030100
-B8FFAEB30D103700B8FFE840090A0C3700007F0201022F5D332F2B2B003F332F3130012B
-010323010186A5F4010F0613FDD1022F0001FFD00685051606FD00030011B60150020000
-05022F11332F002FED3130012135210516FABA0546068578000100890000048B05EE0028
-00934063411253125B1A6312730273129024B603B6240923200551000810082008030808
-1F1C09510F0C1F0C3F0C4F0C040C141418490C01100202284A01080F2A1F2A022327021C
-1F20050C08215F1D6F1D7F1D031D0A061306081D13040220004000020000022F332F5D12
-17392F2F332F5D332F3333FD321139395D003FFD323F1239ED332F2F5DED3939332F5DED
-393931305D2901353E0137233533352335333534123332161715232E012322061D012115
-21152115210E01071521048BFBFE67620E9DA4A4A3FDCD6998400A3E98568C8B016CFE93
-016DFE8F0F705A0345CF1B817B868C86A7C801012211CE2A30A59094868C86659F2C0B00
-000200B1FFE60511053200180022005F4013380D391C491C580D6A217A21060C100B0D37
-07B8FFF0402A090A37191F290F2615690F790F05013222220F1F32150B0B07330F090C0C
-1913260001000024220114122FFD3211332F5DED332F003FED332F2FED12392FED5D2B2B
-31305D01211416171E013332363733150E0123200011100021320011272E01272E012322
-06070511FC66423C3AA3607AEA590D82C07FFEC9FEAD01420113FF010CBE02262928875A
-9FD50D027884B53E3C3B5648D53637015B0141013A0176FECDFEE92A549133333AD4B100
-FFFF00ABFFE1078305D50036023B9200003700BB023700000117024103F2FDC60016400C
-040302100A010B400B7F0B025D1135003F353535FFFF008CFFE107A405ED0036023DA600
-003700BB02910000011702410413FDC600384026040302360A0403023900392039403980
-39FF3905013100315B317B3103000900093F094F09035D11355D11355D11353535003F35
-3535FFFF008AFFE107A405DA0036023FA400003700BB02910000011702410413FDC60038
-4026040302320A040302350035203540358035FF3505012D002D5B2D7B2D03000900093F
-094F09035D11355D11355D11353535003F353535FFFF0099FFE1076F05DA00360240A600
-003700BB023100000117024103DEFDC6003640240403020E0A040302116F118011FF1103
-01092B093B0944095B097F0905000400043F04025D11355D11355D11353535003F353535
-00010061FE5901FA00880003002CB90002FFE840170D10370318090C3700180910370F01
-010101000D0202002F332F003F332F5D3130012B2B2B1B01330161A5F4FEF1FE59022FFD
-D10000010161FE59037000140014002440150B021B012B013901041207070B53030D0E2A
-0000062F332FED003FFD322F2F31305D0514062322262735331E0133323635342627331E
-010370B79225742D091A58326862060399020659A2AC0E0CA00A1A4E581D491913340001
-0212050C0305068C000300144009030302002D100301032F5DED002F332F313001032303
-0305319131068CFE8001800000030100050C0418068C00030007000B003F401506050AAF
-090902000002072B0640090A37060A2B0BB8FFC0400C090B370B06002D0B100301032F5D
-33FD322F2BED2F2BED002F332F12392FED3939313001032303012335330523353302FD31
-803101FDBFBFFDA7BFBF068CFE800180FE8CC3C3C300FFFF00070000055E05D102360024
-00000117019DFDF5FF450012400A020E03020E1F0E4F0E025D1135003F35FFFF00000000
-059005D10037002800F300000117019DFDEEFF4500204014010F030F111011401103011F
-0C010C00400101012F5D352F5D355D003F35FFFF00000000062E05D10037002B00F30000
-0117019DFDEEFF4500204014010F030F112011401103011F0C010C00400501052F5D352F
-5D355D003F35FFFF0000000003C805D10037002C00F300000117019DFDEEFF4500244018
-010F03011F0C010C00400201020F111F11401150116011055D2F5D352F5D35003F35FFFF
-0000FFE1069905F00037003200BF00000117019DFDEEFF45002240150227030F29010227
-1F270101000F000F100F700F035D1135355D11355D003F35FFFF00000000060105D10037
-003C011B00000117019DFDEEFF45002440180109030F0E1F0E2F0E03011F090109001F04
-4004700403042F5D352F5D355D003F35FFFF0000000006D705F0003701BB00B700000117
-019DFDEEFF45002A401E012B03011F2B012B00001C101C201C031C0F2D202D502D602D70
-2D8F2D065D2F5D35115D35003F350004FFCB00000267068C00030007000B000F005C401D
-0A090FAF0C0C06070706060205010B2A0A40090F370A0A0404000E2A0FB8FFC04015090F
-370F0F0707017F11011192001A7F010101881010F65DFDED5D11332F332F2BED11332F33
-2F2BED002F3F332F332F12392FED39393130212311331303230301233533052335330177
-BCBC0438543801B0ABABFE0FABAB045D022FFE800180FE8CC3C3C300FFFF001A0000055E
-05D1021600240000FFFF00C80000052B05D10216002500000002001A0000058605D10003
-00060058403C49056A050205041A000003061A01010215001A0125002A0145004A014B02
-4403590256036B0264037B0275030E020305030000080105010203065401002FED3F1239
-012F11332F17395D31308710FD8710FD04C0005D2901012109020586FA94023201080127
-FE50FE5105D1FAD7047BFB85FFFF00C80000049D05D1021600280000FFFF007E00000508
-05D10216003D0000FFFF00C80000053B05D10216002B0000FFFF0089000002D505D10216
-002C0000FFFF00CD0000057505D10216002E00000001001A0000056205D10006006C404E
-0902390258020378017703020203020114000600020314040405490546067C0573060405
-030405002400390042005A006A007400070000080F08010F08010A042B0436044D045504
-65047B0407042F5D5D5D11332F5D002F3F3130015D8710FDC08710FD08C0015D005D2123
-09012301330562D5FE2CFE2CCB022CF00505FAFB05D1FFFF00C8000005F605D102160030
-0000FFFF00C80000053805D102160031000000030072000004BF05D100030007000B0047
-40130535060609013502030A350908054009133704B8FFC0401609133704050504030204
-0908720D0F0D1F0D0209680C10E65D10E41117392F2F2B2B003FED3FED12392FED313001
-213521032135211321352104BFFBB3044D34FC1B03E534FBB3044D0521B0FD08B0FC77B0
-FFFF0073FFE105DA05F0021600320000000100C80000053B05D100070027401703350603
-010501140078090F0940095009030414056C0810F6ED5D10F6ED002F333FED3130212311
-2111231121053BC6FD19C604730521FADF05D100FFFF00C80000049605D1021600330000
-000100760000050005D1000C00EB404709040908450B540B6409640A660B9309930A960B
-A409A30AA70B0D0608060B1608160B28032708340A340B430A430B5903550B670B760B8B
-0399049908B804B808EB04EB08150BB8FFC0B32529370AB8FFC0B325293709B8FFC0B325
-293708B8FFC04030262937030203080908B3040304030B0A0BB302030264048D02020403
-0203080B3501083505030403A009B009D0090309B8FFC04023191E371009200960097209
-D009E00906090703040B0908070602000010000200000E022F11332F5D1217392F2F5D2B
-71332F003FED2FED11173931305D011087ED87C01087ED8708C0012B2B2B2B5D71290135
-090135211521011501210500FB76026CFDA80448FCC0024AFD8A039AB80258020EB3B0FE
-061AFDA3FFFF0000000004EE05D1021600370000FFFF0006000004E605D10216003C0000
-FFFF00440000053805D10216003B0000000100B30000064405D10023006240402515251E
-021B067518011834380948096F090309192209030810030822142311141023071B180714
-108008A008B0080320255025702503080825240F253F25025D1112392F5D5DC4ED393910
-C42FED2FED002F3F1217392F5DED5D393931305D011406070E01071123112E01272E0135
-1133111416171E01171133113E01373E013511330644514D50E197C59AE24B4E51C63B34
-359A62C5619C353836C6038E9DD74345460AFEBE01420B484245D69C0243FDA66D8E2C2D
-2F0703E4FC1C082D2E318571025A0001006C0000062005F00027007D40125B195B256C1A
-641D64216C24791A79240821B8FFC0B3090B371DB8FFC0403B090B373002301440024014
-041925140204160B341F02261835011608251202191214081502141C272222290F29010F
-291F299029A029040E15171C2FC4ED5D5D11332FC4123939ED2FED2FED003F3CFD3C3FED
-1217395D31302B2B5D2901113E01373E01353426232206151416171E0117112135213526
-023510002120001114020715210620FDC03C772C2D34FEDCDCFE342D2D763CFDC0019A9D
-CB0177013101310177CB9D019A01832658393B9F6ACEF9F9CE6A9F3B395826FE7DAE7C5A
-0138C20114015EFEA2FEECC2FEC85A7CFFFF007E000002E207500236002C00000117008E
-FF240175001940130200104010501060107010050100100D0409252B355D3500FFFF0006
-000004E607500236003C00000117008EFFED01750019401302000E400E500E600E700E05
-01000E090500252B355D3500FFFF006CFFE10443068C0236012E00000116019DE200000A
-B6020024210800252B35FFFF006DFFE603EE068C0236013000000116019DCC000013400E
-014041504170410300413E1219252B5D3500FFFF00B9FE64045F068C023601C600000116
-019D1D00000AB601001A170E16252B35FFFF00A000000193068C023600D500000117019D
-FE8E0000000BB601000704020325012B3500FFFF00B1FFE2045C068C023601D100000116
-019EFB00000F400903020100221F0717252B35353500000200B9FE64048D061400180037
-0077404F16200D1037070F4A1B4326433756267929062E200D0F3733200D103705200D10
-371615203E5F21012121032B3E0C0135400309080C15120F200120281B12122008191B00
-90391F390132071A08883810F6FD325D10F6ED1239392FED2F5D1239003F3FED3FED1239
-2F5DED393931302B2B2B5D012B011400232226271123113436333216171E011514060715
-1E01073426272E012B0135333236373E01353426232206070E0115111E01333236048DFE
-F3CD4FB03FBCFDDF5A953B39448B7F9FBCC2453A3B924924244282272E2D8A6D49682120
-1E42964895A101BCCAFEF82C2AFE2405D2E0FE2B2E2B8A5B7FBD25111AC797596F1F2016
-A01D1E2262557074352C2C753EFCA2261F9D0001003DFE64047F045D0008006940497507
-01070607081A00010007061A04050505030C0A001A002A004A0059006900750007000505
-15052505450556056605730507050001011A059004A0040204040A091F0A4F0A5F0A035D
-1112392F5DC4ED10C42F5D2F5D003F3F31300187FDC08710FD08C0005D09011123110133
-0901047FFE37BCFE43CC0157015A045DFBDBFE2C01D40425FCC4033C0001006CFE6403D6
-0614002F0058401D4600570065287F1178207D21061D1A3E1B012D3F0F070C1A1A19121C
-07B8FFE04018090C37000701071C070BB40303310F313F3102231B12853010F6ED5D1133
-2FED33332F5D2B2F1239392F003F2FED3FED3931305D251E011514060723353E01353426
-2B012226353412373E013735213521150E01070602151416171E01171E013B013216039A
-201C5A43B35A4C3D2F91E5DE5C4E4BC56CFE3402E875E55A5972060C0A31272479385647
-664B285B2854A93F0E4F7745394CE8E58C01007770CD5E099E874ECE7875FEE88F224828
-264B18160534000100B9FE64045F047C00160038402303151615731503100D084213040E
-05010C0D08021A0091181F18601802100B1A0D881710F6FD325D10F6ED003F3F3F3FED12
-3931305D0123113426272E012322060711231133153E0133321615045FBC1218195E4B4D
-A84DBCBC58BC63B5BEFE6404184D87262A294C3BFCBE045D7C4952DACD0000030089FFE1
-04750614001700240031006CB9002FFFD6B30A0D3729B8FFD640400A0D37212A0B0D371B
-2A0B0D37662C01263E0F241F24022424061E3E3A124A120212012C3E3506450602060A25
-181A0000331F333F330224261A800C900C020C2F5DFD325D11332FFD32003F5DED3F5DED
-12392F5DED5D31302B2B2B2B011406070E01232226272E01353412373E01333216171612
-072E01272E01232206070E010705211416171E01333236373E0104752E243AD29898D23A
-252D2D2639D39797D339252EBD043120296C4F4F6C29222F040272FD8E2E2428704F4F70
-28242E0300BEFD548789898754FDBEAE010753828A8A8254FEFA548FD6364639394637D5
-8FA18EE93E453E3E453EE900FFFF00BB00000177045D021600D50000000100C1000004A8
-045F001800D3403B0601060216182618451856186618071C023A0169027A029701A602A6
-18C70208020203C60101860101011A001800090801F90801080B0A03090109B8FFEE4040
-10183709B402181703177F0301091808020305010C1010143F0C05060505011A172A1736
-178017A417051517251777179417E917F917060917180201050F0F00B8FFF04013090E37
-00001A0F1A1F1A3F1A0308031A05891910F6FD3C5D11332F2B332F17395D71002F2F3F3F
-FD322F111217395D3130018710C0C07AF52B7118C0C004C07172018710FD5D7108C0015D
-71212301071123113311013E013332163315232E01232206070304A8F8FE3D70BCBC0180
-487F3F1C3C070B102F0D2F4D1DFB01E96DFE84045DFDDA01A14F3802A602022F21FEF100
-0001003D0000047F061400070085401305040502020306011A07000002031A04040505B8
-FFF0401C0C10372B002604200703050402030601000806680701070506030400B8FFC040
-260910370C001C004B005A006A00790006008D090F090103041304440455046504760406
-04820810E65D5D10F65D2B1117395D2F003F3F17393130015D2B8710FDC01087FDC008C0
-08C0012123090123010333047FCDFEB8FE97C401D1D7D3033DFCC3042001F400000100B9
-FE640465045D00150046402C12200B0D3703200B0D37080205140B051042050900080A0C
-0102131A0092171F1760179017030D091A0A881610F6FD3C5D10F6FD3939003F3F3FED3F
-3C12393931302B2B2123350E012322262711231133111E013332363711330465BA4A874E
-4B7854BCBC209E5B5D8836BC764E3D3650FDF305F9FCBA2752433C034000FFFF003D0000
-047F045D02160059000000010068FE64041106140046008A403C0F020F06090E1B0E241E
-24283415361E36284428473C562D563C691779170F1918333F32320C24213D22013F3F0C
-030C191C3232232121122B1B1C04B8FFD6400E090C37040408B4231C1280000100B8FFC0
-400B090C370000483A1B12854710F4ED11332F2B5D123939ED332F2B2FED12392F2F332F
-1239003F2FED3FFD3212392FED393931305D0514060723353E013534262B012226272E01
-353436373E0137352E01353436373523352115212206070E01151416171E013B01152122
-06070E01151416171E013B013216171E0104115B42B45C4B3A2E8C8CB93F424532302C89
-4C7D96575AE40338FF00446D302D3641332D7650AAFED942692F2B334B403F995A1C4467
-211F226055A83F0E4F7844374E36393C97584E84353145130B1CA56853873A069A9E1D22
-2066434F621A1716A52827256A3B66721919072F25235F00FFFF006AFFE10471047C0216
-00520000000200B9FE640494047C0011001E0042402C3A17351E4A17431E560D05060315
-3E0F041C400309080C121B3A004A00020090201F206F200219071A08881F10F4FD325D10
-F65DED003F3FED3FED123931305D011000232226271123113436373E0133320003342623
-220615111E013332360494FEEBDE41A348BC47423EBB66F30100C2A0929E8D49774BA2B0
-0241FEFEFEAB242BFE2B04227BB9423E42FEDAFEDFDACCC0B6FE6D221DDE00010069FE64
-03FA04770029005C40120C020C06201325233614362340237A1F0817B8FFE040140E1037
-3F194F190219191D3F1504030C263F0B04B8FFD64011090C370418180408B400002B201B
-12852A10F4ED11332FED33332F2F2B002FED3F3FED332F5D31302B5D0514060723353E01
-3534262B012226272E013510002132161715232E01232206151416171E013B01321603FA
-5E3EB1564D3C2D5C75C64B49530137010354A0430C5E9D44A6BD393232814B64738E6057
-AA3B0E4B7947364F3C4342D092010E0144251BD33E32EEC1708E2D2C2799000100B1FFE2
-045C045D00170030401F1607050F3E0903560366037903880305030A151A0091191F1901
-091A06871810F6ED5D10F6ED003F5DED3F333130011406232226351133111416171E0133
-3236373E01351133045CF4E2DFF6BC14201F6B5C56731E1D15BC0197DADBD7DE02C6FD7F
-5D782E2B2B2C2C2C7B5A028100010030FE640488045D000B00A240492A02250839023408
-4B02440879020710091A0A0B0A071A060506011A000B00031A04050402050B080A000606
-0A0405064A0445066A0465067A04770608040C0605080B050204040A00B8FFE040100A10
-3700000D2F0D010604200A1037042F2BC45D11332F2BC4121739003F3F5D111739313001
-8710ED8710ED8710ED8710ED4B535840140B030A070002030A0601080409070005040906
-010F0F0F0F59005D0123090123090133090133010488D5FEA6FEA2CB01BCFE4FD5014F01
-53CBFE4FFE64026BFD95030202F7FDA80258FD11000100B0FE6405E3045D0023006B4047
-1B062618751802183D39094909020919220903081005080C221A3F237F230223111A3010
-7010021023071B18071A109008C008025025602502080825240F25010F251F253F25035D
-5D1112392F5D5DC4ED393910C42F5DED2F5DED003F3F1217392F5DED5D39393130011406
-070E01071123112E01272E01351133111416171E01171133113E01373E0135113305E360
-4F52C873BB73C753505FBC4B34388643BB4386383B44BC01BE72A835373705FE68019806
-343936A772029FFD9C718723261E0403C7FC39051C27287B7802640000010071FFE20611
-045D003D0079402D361F3632441F4432551F55326804680F691A69377D1A7D370C283B28
-0903061605210D303E060A3A400C0E3718B8FFC040240C0E37361B001B1B13003A29090A
-291A18139028A028C0280328283F3E1F3F3F3F6F3F035D1112392F5DC4C4ED393910C4C4
-2FED2FED2B2B003FED39393F1217392F31305D011406070E0123222627230E0123222627
-2E013534123733150602151416171E01333236373E01371133111E01171E01333236373E
-01353402273533161206112F33379D7360A2250627946671A333332F7290E4879F101E1A
-5D47334714161D06BA091C1518393A465E1B19169D89E4907201F760C14B505963434462
-5D4C4CBF61AA0115A7116CFECCB742713F37491911122C0F0248FDB8112C111316473937
-7A41B601346D11A7FEEBFFFF00050000022D05DB021600770000FFFF00B1FFE2045C05DB
-023601D100000116008EFB000015400F02301D501D601D0301001D180717252B355D3500
-FFFF006AFFE10471068C0236005200000116019DE200000AB602001B180600252B35FFFF
-00B1FFE2045C068C023601D100000116019DFB00000AB601001B180717252B35FFFF0071
-FFE20611068C023601D400000117019D00B60000000AB60100413E1300252B35FFFF00C8
-0000049D07500236002800000117008E00500175000DB7020100110C020325012B353500
-0001FFFF0000060705D1002500614025652476240216341F1F061E1A351B03093506182F
-073F074F077F0704070717590F010F1500B8FFC04014090D370000270F27011A1F1D011D
-1D1F17141A182F33FD32322F5D2F5D11332F2BED5D12392F5D002F2FED3FFD3212392FED
-31305D011406070E012B0135333236373E01353426272E01232111231121352115211121
-3216171E010607534957AF8A6E5D5B782F38343135329583FEEBC6FE520468FE0C015398
-BF554C4901CC6CB13A4530B11022286F4E4B73232213FD220521B0B0FE6824423BAEFFFF
-00C80000048A07ED023601EB00000117008D003501610015401001300840086008700804
-0008070405252B5D350000010073FFE5053905EC002A006A400C3A1C491C58057606790C
-0511B8FFE040370A103701200A103720341D1D0F032A2A26340309131317340F021E1E13
-000010000200002C0F2C010F2C1F2C2F2C3F2C041D206C09682B10F6FD325D5D11332F5D
-33332F003FED332F3FED332F1112392FED31302B2B5D250E012322242726023534123736
-243332161715232E01232206070E01072115211416171E013332363733053963EC91A9FE
-EE61616969625F0112A98CF65F104EF98D6DAE4846580F0334FCC258474AC4708AF75010
-4127356863630120B7AF011F66626C3427DF40523A3B3BAD72AD8BD94648494A4300FFFF
-0086FFE5050205EC021600360000FFFF0089000002D505D10216002C0000FFFF007E0000
-02E207500236002C00000117008EFF240175001940130200104010501060107010050100
-100D0409252B355D3500FFFF002CFFEB02EA05D10216002D000000020012FFFD08A205D1
-000E003D0066B3460C0130B8FFACB30A10371EB8FFC0401D0B0E37073437371618353503
-28282C352408341637081416163500150FB8FFF440110E11370F713F2F3F011813003501
-3535282F332F5DED5D10F62BFD11392FFD32002FED2FFD322F3FED12392FED31302B2B5D
-013426272E01232111213236373E01371406070E01232111210E01070602070E01070E01
-2322262335331E01333236373612133612372111213216171E0107D33235379083FEEC01
-0F858F363834CF554754C098FDEEFDF0030B0308251D1D492F306544153C0C0E0A1E0F24
-401647430E050B040391015298C0554C4901C94B72232510FDCB1A252769556CB0374238
-052171D955D6FEEC595A6B2B2C2603C001021617470146012D62014487FDB823423BAE00
-000200C80000088305D1000E002700554020171E07342121161F1B030834161A560F0120
-1F081400166F160216161900150FB8FFF4400F0E11370F71294029011D19141A6C2810F6
-FD325D10F62BFD11392F5DED39395D002F2FED3F3312392FED39393130013426272E0123
-2111213236373E01371406070E0123211121112311331121113311213216171E0107B432
-35379083FEEC010F858F363834CF554754C098FDEEFD65C6C6029BC6015298C0554C4901
-C94B72232510FDCB1A252769556CB037423802DEFD2205D1FDB80248FDB823423BAE0001
-FFFF000005FD05D1001D00504032000E48175817600E620F700E700F0708011A350B0B01
-07033504031301131412121F5F067F0602060306070014037F0101012F5D33FD32322F2F
-5D11332FED002F333FFD3212392FED123931305D2123112135211521113E01333216171E
-01151123113426272E01232206070273C6FE520468FE0C5FF66765AA3D3D45C6161E2079
-646AC3660521B0B0FE2D1F33323534A373FE11018C4A8C2B2E312622FFFF00CD00000575
-07ED023601F200000117008D003C01610010400A01702301002321050025012B5D350002
-0006FFF904E6078F001A002800AF405A29033801461955140419191A1814171617161716
-191A130001001617181A010500070B0B0F35071B0F21702102212175250125AA0F1E011E
-1E0003281A1B221A702101211B2100700A010A360156016501760104160A01031700B8FF
-E0401409103700002A502A012A400910371720091037172F2B2B5D11332F2B1217395D2F
-5D1139392F5DED2FED003F332F5DED5D332F5D332FED322F11121739018710FDC008C001
-8710FD08C03130005D09010E01070E012322262735331E01333236373E013F0101330901
-030E0123222627331E013332363704E6FDCA225D3634612D2872100E0F462D14481C203F
-1624FDD6DB01B301862105C9A8A8C905B602605E5F5F0205D1FB1B4C621B19110801B902
-09060B0C34324F044FFC92036E01BEA6A8A8A67063627100000100C8FEAF053B05D1000B
-0032401C060203043409000B0913000002061407780D400D700D020314026C0C10F6ED5D
-10F6ED12392FED002F2F33ED3F33313029011133112111331121112302A4FE24C602E7C6
-FE24BB05D1FADB0525FA2FFEAF00FFFF001A0000055E05D1021600240000000200C80000
-052C05D100120021003E40256311011A340C0C070B3508031B3407080A0A131556000100
-71230F234023020C1B14076C2210F6FD325D10F45DED332F003FED3FED12392FED31305D
-011406070E0123211121152111213216171E01073426272E01232111213236373E01052C
-554754C098FDE403E5FCE1015C98C0554C49CF3235379083FEE20119858F36383401CD6C
-B037423805D1B0FE6823423BAE724B72232510FDCB1A25276900FFFF00C80000052B05D1
-021600250000000100C80000048A05D10005001F401003013504030000070F0701021403
-6C0610F6ED5D11332F003FED2F3130012111231121048AFD04C603C20521FADF05D10002
-000AFEAF059E05D1000D00130049402A09121A124A110310340A030C1307340301051013
-0A0A070E140C0C0113200001000015131307070413052FED392FED11332F5DED392FED12
-392FED002F332FFD32323FED31305D01231121112311333612112111332111210A010705
-9EBCFBE4BC78829B03728DFEADFE0E0E9476FEAF0155FEAB0201D602B1019AFADF0475FE
-9BFDAFBFFFFF00C80000049D05D102160028000000010020000007A805D1003700C7402E
-093318332933401D40244135541D54247518711D73240B27133333351A130E0C0E020116
-09103701130037000708B8FFEA405A091037081309090A271F1A032C223237070A0C0E33
-35072C02142D350409021521052C03002F0A20375F0A50376F0A6037062C2C0137022733
-350600C5220414051515080A070C0E1A0609C51F0505393810393F395F397F39045D1112
-392F33F41739322F10FD32F41739322F5D002F3F1739FD322F121739FD111739018710FD
-2BC08710FD2BC08710FD8710FD3130005D21230123112311230123012E01272E01272E01
-2B0135333216171E01171E01171133113E01373E01373E013B0115232206070E01070E01
-0707A8F2FDF469C46BFDF4E6025158682013251C1B533C3C47A7B23D0B1E0F2C8F56C45C
-912E121D093CB5A5473C424B1E1D25132A7D3E02A9FD5702A9FD5702FE3A9C693D571C1B
-18B17FAD1E5824696608029DFD610663702C5519AC80B1171C1B5B3A8587270000010051
-FFE5048505EC0040007F40145401583B6701693B7F0B7F0C7031703274380932B8FFE040
-3F0B10370B200B10373E3D1D3420200934703001303029343402100D7F0D020D0D113409
-0A3D1E0B0D37171E0B0D37236C3A1E1E3D3A030C171503734231310C2F332F10F6ED1217
-392F2FED2B2B003FED332F5D3FED332F5D1112392FED393931302B2B5D011E0115140607
-0E012322262735331E01333236373E01353426272E012B0135333236353426272E012322
-06070E010723353E01333216171E0115140607151E010416303F5B4650E68593FB4A0F63
-F97148A83436313C33339159C9B3ADD2352E2D6F4C4E843B3064170D4BF87E7BB14B4E52
-A37D347602CD2A816669AA3C4444371EDE3B4B2A292D6F454F651F1E1BA97F7836521818
-151E1411340DDB2036272C30885A7FB01B0F092F000100C80000053905D1000900644023
-0B020407190703070715075B0253076C0262077F0270077608C802E602E707F6070D07B8
-FFE840240B0F3702100C0F3707060102040308030308030807021400780B0F0B400B0207
-14046C0A10F6ED5D10F6FD113939003F3F1217392B2B31305D7121231101231133110133
-0539C5FD1CC8C502DBD104A9FB5705D1FB690497000200C800000539078F000900170093
-40320B020407190703070715075B0253076C0262077F0270077608C802E602E707F6070D
-0A0F10701002101014AA0F0D010D0D07B8FFE840330B0F3702100C0F3707060102040308
-030308171A500A600A020A111A100A10000403080702140078190F194019020714046C18
-10F6ED5D10F6ED113939111239392FED2F5DED003F3F1217392B2B332F5DED332F5D3331
-305D7121231101231133110133030E0123222627331E01333236370539C5FD1CC8C502DB
-D1B505C9A8A8C905B602605E5F5F0204A9FB5705D1FB69049701BEA6A8A8A67063627100
-000100CD0000057505D1002000AF407909011F01290127203A0137204B0147205C016500
-6720760074200D1F200A0D370C200A0D370202038801C8010201B30020001E661B861B02
-1B13120D120D121B1E04152002322F08010808000716351503070305000D121B1E200504
-4F150115150F2220003000400004500001006E22402201080414056C2110F6FD325D10F6
-5D5D322F5D121739002F2F3F3FED1112392F5DFD39121739018710FD5DC031300187107A
-FD5D1808C0012B2B5D2123012311231133113E01373E01373E01373E013B011523220607
-0E01070E01070575FEFDA387C6C6335A28284E1E0D231245B9B44F53454E1F1D2B17346B
-5A02A7FD5905D1FD6401121917553E1B522DA686B1191D1A583B847C2E0000010012FFFD
-051805D10021003DB9001BFFACB309103709B8FFC0401A0B0E370335200301131317350F
-01140078238F230103132020122F332FED5D10F6ED002FFD322F2F3FED31302B2B212311
-210E01070602070E01070E012322262335331E0133323637361213361237210518C6FDE6
-030B0308251D1D492F306544153C0C0E0A1E0F24401647430E050B04039B052171D955D6
-FEEC595A6B2B2C2603C001021617470146012D6201448700FFFF00C8000005F605D10216
-00300000FFFF00C80000053B05D10216002B0000FFFF0073FFE105DA05F0021600320000
-000100C80000053B05D100070027401703350603010501140078090F0940095009030414
-056C0810F6ED5D10F6ED002F333FED31302123112111231121053BC6FD19C604730521FA
-DF05D100FFFF00C80000049605D1021600330000FFFF0073FFE5054605EC021600260000
-FFFF0000000004EE05D102160037000000010006FFF904E605D1001A0080403C29033801
-461955140419191A1814171617161716191A130001001617181A010500070B0B0F350700
-03700A010A360156016501760104160A01031700B8FFE0401409103700001C501C011C40
-0910371720091037172F2B2B5D11332F2B1217395D2F5D003F2FFD322F11121739018710
-FDC008C0018710FD08C03130005D09010E01070E012322262735331E01333236373E013F
-010133090104E6FDCA225D3634612D2872100E0F462D14481C203F1624FDD6DB01B30186
-05D1FB1B4C621B19110801B90209060B0C34324F044FFC92036E00030069FFF0062405E1
-001D002A00370058403624182C321525062B32091509081603082A1E253265006A0F041E
-150032150F00072B1518250407140F080839381F393F396F399039045D1112392FC4ED17
-3910C42FED2FED5D002F3F1239392FED39392FED39393130011406070E01071523352E01
-272E01353436373E01373533151E01171E01073426272E0127113E01373E0101110E0107
-0E01151416171E010624594F55F48AC586F6574F59564C51F395C594F64F4B57CE403B3A
-8E6A5E9A324142FD8E6A8E3A3A414340319B02F38CD9494F5D03A6A6035A524AD88C88CC
-4C515E049B9B03624E49D07F63A639383402FC8602392F3CAEFEAC037A01363737AA6170
-B63A2D3CFFFF00440000053805D10216003B0000000100C8FEAF05BE05D1000B0032401C
-0602030B08043501080514080800130D40090B370A0A0D0414016C0C10F6ED11332F2BED
-392FED003FFD322F3F3331302901113311211133113311230502FBC6C602DDC68DBC05D1
-FADD0523FADDFE010001008E000004EA05D10019003B40243511451154116C0974160502
-0C1435050500180C030017011400781B0F1B010D140C6A1A10F6ED5D10F6FD32002F3F33
-12392FED123931305D2123110E01232226272E01351133111416171E0133323637113304
-EAC681DD6463AC3F3F47C6142323726B71D652C60276282A313535A47201FCFE67577930
-2F2F281E02B1000100C80000077605D1000B003640200A06020308043401091400C60814
-05041401C605050D0C1F0D3F0D500D700D045D1112392FF4ED10FDF4ED002FFD323F3333
-31302901113311211133112111330776F952C6022EC6022EC605D1FADB0525FADB052500
-000100C8FEAF080305D1000F004140260A0602030C080434010F0D13000009140CC60814
-05041401C6050511101F113F1150117011045D1112392FF4ED10FDF4ED332FED002F2FFD
-32323F33333130290111331121113311211133113311230747F981C6022EC6022EC68DBC
-05D1FADB0525FADB0525FADBFE0300020000000005F405D1000E00210046401D07341B1B
-1618351903083416560F011B08144F167F160216161900150FB8FFF4400A0E11370F7123
-0F2301192F5D10F62BFD11392F5DFD325D002FED3FED12392FED3130013426272E012321
-11213236373E01371406070E0123211121352111213216171E0105253235379083FEEC01
-0F858F363834CF554754C098FDEEFE660260015298C0554C4901C94B72232510FDCB1A25
-2769556CB03742380521B0FDB823423BAE00000300C80000069505D1000E001F00230055
-4016440D0107341919161703083416220321560F0100150FB8FFF4B30E11370FB8FFC040
-150C10370F0F21142078250F25702502190814166C2410F6FD325D10F6FD322F2B2BED5D
-002F3F2FED3F12392FED31305D013426272E01232111213236373E01371406070E012321
-113311213216171E010123113304533235379083FEEC010F858F363834CF554754C098FD
-EEC6015298C0554C490173C6C601C94B72232510FDCB1A252769556CB037423805D1FDB8
-23423BAEFDC505D1000200C80000052205D1000E001F003C401007341919161703083416
-560F0100150FB8FFF440110E11370F71210F21402102190814166C2010F6FD325D10F62B
-ED5D002FED3F12392FED3130013426272E01232111213236373E01371406070E01232111
-3311213216171E0104533235379083FEEC010F858F363834CF554754C098FDEEC6015298
-C0554C4901C94B72232510FDCB1A252769556CB037423805D1FDB823423BAE0000010061
-FFE5052905EC002A0070400A3A1C491C640676060426B8FFE0403E0A10370B200A103718
-34191928092424203428020D0D11340909060316035603031A24171403732C0F2C010F2C
-1F2C2F2C3F2C04241824180F0C1F0C020C2F5D33332F2F5D5D10F6ED11395D003FED332F
-3FED332F1112392FED31302B2B5D0116121514020706042322262735331E01333236373E
-01352135212E01272E012322060723353E0133320404616068696366FEEFA38DFE571051
-F78D7BCC444849FCD303230E5C4747B46689F057115DFE85AC010F052C60FEE4C2ACFEDF
-676A6B3625DB414D574B50C980AD77AF3939374D43DC27356000000200C8FFE107D305F0
-000B001E006240427814010903060915161A1C5616591C7916761C080C34131E1314031C
-03341602100309341C090F13190615180C3F0C580C6F0C040C0C0F0015197320120E140F
-6C1F10F6FD3210F6ED12392F5DED1239002F3FED3F3FED1217392FED5D31305D01100023
-2200111000333200012311231133113312002120001110002120000705FEFFDBDDFEFE01
-03DCDB0101FB79F0C6C6F924016A0113013F016CFE90FEC5FECCFE9102E801280135FECC
-FED7FEDBFEC90136010EFD3005D1FDAC012D0146FE63FE95FE93FE6601890002002C0000
-04DE05D10010001F0066400C28033506471C5A0759170504B8FFE8403209103703041305
-0506060F113440030103030012340F03000519150904060309045F050105120114007821
-0F2140216021035D10F6FD322F5D17392FED002F2F3FED12392F5DED12393130018710FD
-C02B005D212311210123012E01353436373E0133210311212206070E01151416171E0133
-04DEC6FEBFFE43EE01DE96A55F4E47BE7301EAC6FED256682B2E3425292D82560250FDB0
-026E33D5B372A5373228FD240232161D1F7043506A292C1EFFFF0068FFE1041D04780216
-0044000000020074FFE1047C061D00270039006440160C1F35043D29303940044B294039
-6512751273330A33B8FFC0402B0B0D3722062B41002510250225250619411800373F060A
-223118180C281B03903B1F3B3F3B02311B0C863A10F6ED5D10F6ED12392F1239003FED3F
-ED12392F5DED123931302B5D011E01151400232226272602353436373E01373E01373E01
-37150E01070E01070E01073E01333216133426232206070E01151416171E0133323603EE
-4648FED4DB6CB640504F0E19144D3548EBC24F883642814080CF303535084BB3655EAE0F
-B29257A04802033A352E6C3E97AA03B846C786FAFEB6494C5F0121D04B9B6C5DAC354959
-11070904AD0408060B3E3135AB4D36493EFE22B9B7372E19431CAED840362DDA000300B9
-00000453045D0015002400330061400C0A0305141A0315147623050CB8FFD6402F090C37
-12112C3C4F1E011E1E071D3D08052D3D0708161B122C0F0F07251B00100D10370090350F
-35011E2C1A07883410F6FD325D10F42BED12392F1239ED003FED3FED12392F71ED393931
-302B5D011406070E01232111213216171E0115140607151E01033426272E012B01113332
-36373E01133426272E012B0111333236373E010453413940977BFE3201B07D7F383F3B5E
-4A6381FD1F202A694DC4EB4A4724261D3B243D26584EF1B270792C2C2B0152517E2A2F2A
-045D111D216A48537A220A1889017D243A101505FECE0B161841FE4237451D1207FE930F
-19194800000100B9000003BB045D0005001F4010013F040503700001000007021A038806
-10F6ED11332F5D002F3FED313001211123112103BBFDBABC030203B8FC48045D00020009
-FEF404AF045D000D00130053401C3B124A12020105103E0A050C13073E0310C90A0A070E
-1A0C0C01C900B8FFC040120B0E370000152F153F1502131A070704C9052FED392FED5D11
-332F2BED392FED12392FED002FFD32323FED2F3331305D01231121112311333612112111
-3321112106020704AFAFFCB8AF79757302BE87FEBDFEAF0D8053FEF4010FFEF101ACC101
-F90103FC43031FFBFE628600FFFF006AFFE60460047C0216004800000001003400000632
-045D003100D840123A0E3A2D4A0E4A2D5F0C5F2F6F0C6F2F0826B8FFE0B3090B3715B8FF
-E0401A090B3724B42D2D2F17B40E0C0E020116091037011A0031000708B8FFEA405E0910
-37081A09090A241C1703291F3C31070A0C0E2F2D072902112A3F040902121D052905002E
-0A21315E0A51316F0A60317F0A7031082929013102242D2F0600C71F041A051212080A07
-0C0E170609C71C0505333210333F334F336F33045D1112392F33F41739322F10FD32F417
-39322F5D002F3F1739FD322F121739FD111739018710FD2BC08710FD2BC08710FD8710FD
-3130002B2B5D21230123112311230123012E01272E012B0135333216171E01171E011711
-33113E01373E01373E013B0115232206070E01070632E3FE9A5BBA51FE8AD901AF314B1F
-1B4A5435457C962D091B0A216740BA4069210B1B082C947D4535554B191C4D2D01FEFE02
-01FEFE0202491A60615542A2647D1A43174C3F0401E4FE1C04404B1942197B66A2465159
-631900010041FFE603C20478003D007FB7263475127D3C032FB8FFE0404C0D103708200D
-10373B1B3FAF1CBF1C021C1C06313F2D902DA02D032D2D293E3104200A300A020A0A0E3F
-06091C2E231B372E1C373B0409141B00903F7F3F803F02800990090209400B0F37092F2B
-5D5D10F6ED1217392FED2F2F003FED332F5D3FED332F5D1112392F5DED3931302B2B5D01
-1406070E012322262735331E01333236373E01353426272E012B0135333236373E013534
-26272E012322060723353E01333216171E0115140607151E0103C2574444A45274D2660D
-49E26A326A272A32312A297430A371288128343D3024255B2366C5430D53BE5F4E9B4342
-546D5C677A01395E822827242C2ECE4046131518433A3C48121208A2060D113E442F3D11
-110C3734CF1B221C2222755658851D071989000100B900000466045D00090044402D0B02
-0407020D030103380B103702380E10370706010204030805030808021A00920B1F0B600B
-0203071A04880A10F6ED395D10F4FD39003F3F12173931302B2B5D712123110123113311
-01330466BAFDB7AABA0243B00347FCB9045DFCC5033B000200B900000466061500090017
-0073404C0B020407020D030103380B103702380E10370A0F1001101014500D0D07060102
-04030805030817C91F0A2F0A020A11C900101010201003100A100408021A0092191F1960
-190203071A04881810F6ED395D10F6FD391239392F5DED2F5DED003F3F121739332FED33
-2F5D3331302B2B5D7121231101231133110133030E0123222627331E01333236370466BA
-FDB7AABA0243B06B05B1A9A9B105AB015B58595A010347FCB9045DFCC5033B01B894A6A6
-94695E5C6B00000100C1000004A9045D001A0093404D0120090E371B02271A360E321635
-1A0502011A001A000A1B0F2B0F020FB41618160A0F181604121A023C2F08010808000713
-3F12050705010508561A9600961AB600B61A05021A181604121200B8FFC04011090E3700
-001C0F1C1F1C0208031A05891B10F6FD325D11332F2B332F17395D003F3C3F3FED111239
-2F5DFD39121739018710FD71C03130018710FDC0015D2B2123012311231133113236373E
-01373E013B0115232206070E010704A9F6FE3066BCBC5D72280E1B0D349C9256534F5924
-2859320200FE00045DFE1E434A1B3D1C7170A243545E5D180001001DFFFE043E045D0021
-003FB9001BFFACB30D103709B8FFC0401C0D1037023E2105001313173F0F011A00922303
-1A20203020022020122F332F5DED10F6ED002FFD322F2F3FED31302B2B212311210E0107
-0E01070E01070E012322262335333216333236373E01373E013721043EBCFE5F03060307
-201A183B2222533111410A0A081E0A183312333E0A040703030103BF539A3EA7C7423E4D
-1F1E1E02A4020E1332EEE152E166000100B9000004D9045D000C0078401335093A0B4503
-4A0470037F04060B400D103709B8FFC0403D0D10377B027B05790A030A2A090B37050A02
-030904400E103704200D0F373F04010404070B09050107090A0B0305021A00920E0F0E20
-0E02051A07880D10F6ED5D10F6ED111739002F333F3312392F5D2B2B1217393130002B5D
-012B2B5D2123110123011123113309013304D9BAFEEA8CFEECB0E301300126E70372FDC2
-023EFC8E045DFD8F0271000100B900000460045D000B0032401C033F0808050A07050105
-0809021A00920D1F0D600D0208031A05880C10F6FD325D10F6FD32003F333F3312392FED
-31302123112111231133112111330460BCFDD1BCBC022FBC01F7FE09045DFE3C01C4FFFF
-006AFFE10471047C021600520000000100B900000460045D000700254015033F06050005
-011A0092091F09600902041A05880810F6ED5D10F6ED002F333FED313021231121112311
-210460BCFDD1BC03A703BBFC45045D00FFFF00B9FE640490047C0216005300000001006A
-FFE703FD04770021005A40430F234F235F23032B01220E2A1624183A01350E3A16351849
-014F0A440E4F1641185901550E6901650E7A01730E131010143F0C0421211A3F03090F00
-0023171B09852210F6ED11332F3C003FED332F3FED332F31305D015D250E01232226272E
-013510002132161715232E01232206151416333236373E01373303FD73A5527ACC494951
-0128010161BB4E0B5DB555A7B7B6A83B75302651100B463629474848DC93010B013F3627
-D14744E0C7C7DC1E1813350D0001000A000003EE045D0007003840230301043F06054000
-4F0502000500021A05A003B00302030309080F093F094F097009045D1112392F5D33FD32
-2F2F5D003FFD322F3130012111231121352103EEFE6CBCFE6C03E403B8FC4803B8A5FFFF
-003DFE64047F045D0216005C00000003006FFE64064B061400230030003D007A40105622
-011D011B1E0C09040627353F2118B8FFF040400E0F3718043B2E3F0F06100E0F3706090B
-0C392436384924463804241B00C809311B1E2B04091A0C381B12C8800C900C020C0C3F3E
-0F3F1F3F3F3F503F803F055D1112392F5DFDED10ED173910FDED5D003F3F2B33FD323F2B
-33FD321217393F31305D011406070E01232226271123110E01232202113436373E013332
-16171133113E0133321203342623220607111E0133323605112E01232206151416333236
-064B4C3F3EA259436327BA3D4F54C1F04E3F3DA5523C6331BA2E7C3FC6E2C18888374A3F
-2F3F3A8D9BFD7627503187A18F87355B024C95E54A4A4E2E13FE3301CD1E23012E010D8D
-DD4B494D251E01E1FE1F1B28FED5FEECBFDE1219FD171619D9AA02E91219CED2C3E01D00
-FFFF003C00000480045D0216005B0000000100B9FEF404DE045D000B0041400F0602050B
-08043F01051A080800C90AB8FFC04015090D370A0A0D0D40090E378F0DAF0D02041A0188
-0C10F6ED5D2B11332F2BED392FED002FFD322F3F33313029011133112111331133112304
-2FFC8ABC0226BC87AF045DFC4503BBFC45FE52000001008E0000041F045D0016003C4025
-0C061C062C06750E040209113F0505001509050014011A0092183F18010A1A0009100902
-092F5DED5D10F6FD32002F3F3312392FED123931305D2123110E01232226351133111416
-171E01333236371133041FBC5BA662B4BEBC101A1A5E5445A23CBC01AD1C22B1A70196FE
-CA40652524261B12021D000100B900000649045D000B003D40260A06020508043F010809
-1A00CA081A05041A01CA8005A0050205050D0C0F0D200D500D700D045D1112392F5DF4ED
-10FDF4ED003FFD323F333331302901113311211133112111330649FA70BC01AEBC01AEBC
-045DFC4503BBFC4503BB000100B9FEF406D0045D000F004A402E0A0602050C08043F0108
-0E0DC90000091A0CCA081A05041A01CA80059005A00503050511100F111F113F116F1104
-5D1112392F5DF4ED10FDF4ED392FED002F3FFD32323F3333313029011133112111331121
-1133113311230621FA98BC01AEBC01AEBC87AF045DFC4503BBFC4503BBFC45FE52000002
-000A000004C4045D000E0021004A4015750D01073D4F1B9F1B021B1B16183F1905083D16
-0FB8FFF04016090B371B081A161619001B0F8F230F231F232F2303192F5D10F6FD11392F
-FD322B002FED3FED12392F5DED31305D013426272E012B0111333236373E01371406070E
-0123211121352111333216171E01040223282A6B64B0AC646E282925C24138429676FE55
-FEB80204F47E8B453A3A0157334D18190AFE8411181A473A518429322A03B8A5FE4D1A33
-2B86000300B9000005A2045D000E001F0023005A4016200523073D4F199F190219191617
-05083D167900010FB8FFF04022090B37001B500F600F700F030F0F231A2292250F253025
-402570250419081A16882410F6FD325D10F6FD322F5DED2B5D002FED3F12392F5DED2F3F
-3130013426272E012B0111333236373E01371406070E012321113311333216171E011333
-1123036923282A6B64B0AC646E282925C24138429676FE55BCF47E8B453A3ABBBCBC0157
-334D18190AFE8411181A473A518429322A045DFE4D1A332B8602B1FBA300000200B90000
-0435045D000E001F00424013073D4F199F19021919161705083D167900010FB8FFF04013
-090B37001B0F8F210F212F210219081A16882010F6FD325D10F6ED2B5D002FED3F12392F
-5DED3130013426272E012B0111333236373E01371406070E012321113311333216171E01
-037323282A6B64BAB6646E282925C24138429676FE4BBCFE7E8B453A3A0157334D18190A
-FE8411181A473A518429322A045DFE4D1A332B8600010053FFE703F604770021007DB532
-0442040210B8FFD640090B0D37152A0B0D371DB8FFD6403F0B1037082A0B1037123D1313
-061F1B1B173E1F049F0A010A0A0E3E0609141C111A0390232340090D371C2F133F134F13
-03131C1380099009020940090C37092F2B5D33332F5D2F2B10F6ED1139003FED332F5D3F
-ED332F1112392FED31302B2B2B2B5D011E011510002122262735331E0133323637213521
-2E012322060723353E01333216035D4950FEC9FEFC66BF430D3CC66D9DC40CFDCC023314
-BE8E5BB4570D3FC2677CC803ED46D290FEEAFEB8301BCE2F49C0BA979E9F3D43CE193A44
-000200B9FFE1064C047C000B001E005640363A0335094A034509040C3E131E1314031C03
-3F16041005093F1C0A0F1319061A2F0C010C0C0F001B1990202F203F2002120E1A0F881F
-10F6FD325D10F6ED12392F5DED1239002F3FED3F3FED1217392FED5D3130013426232206
-15141633323625231123113311333624333200111000232200058AA69399A1A89292A7FC
-D3E8BCBCED190111C7E70112FEF2EBDEFEF5022ED7D5DFCDD4D7D5A2FE06045DFE3BE7FD
-FEC4FEEEFEF1FEC201200002004300000413045D0010001F0069B3721C0104B8FFE8403D
-0910370304B4050506060F113C030300123D0F0500050909190902191B70090109040603
-09040A051A054A055A0580059005060512011A0092210F21015D10F6FD322F5D17392F5D
-ED5D002F2F3FED12392FED12393130018710FDC02B015D212311230123012E0135343637
-3E0133210311232206070E01151416171E01330413BCDDFEA6DD01789186503D3C9C5C01
-AEBCED4D442827251724256A4101BBFE4501CD28A586597C27261BFDF201780A16164B2C
-37441E1D1500FFFF006AFFE6046005DB0236004800000116008EF9000014400D03302560
-250202002520120025012B355D3500010013FE6D046206140035006A4044051C1E261E28
-59056905721D0617140E51111112180D08421B0412012F3E2A2A012A0D150F5F2E6F2E7F
-2E032E2E0D001A2191371F37603702141517030B1A110F0D883610F63232FD17325D10F6
-ED12392F5D2F2F002F2F5DED3F3FED123912392FED393931305D0026272E01272E012322
-0607112311233533353315211521113E01333216171416151406070602070E01232A0127
-35333236133E013503A501010113191A594650AC4CBCA6A6BC0141FEBF58C162B1BB0303
-020103544746B96A17182A44BB9C09010102064B2B5080292B294D3AFCBE04F4869A9A86
-FEED4952DEC92F6B4B3A703AB0FEFF50504E029EF60150224B2EFFFF00B9000003BB0682
-0236020B00000116008D9AF6000AB6010009070405252B350001006AFFE7040A04770021
-006EB53B0A4B0A021BB8FFD640090B0D37162A0B0D370EB8FFD640340B1037012A0B1037
-193D1818030C1010143E0C0421211D3E03092018301840180318171810031A008E232340
-090D371A1A09852210F6ED2B10E61117392F5D003FED332F3FED332F1112392FED31302B
-2B2B2B5D250E01232226272E013510002132161715232E01232206072115211E01333236
-3733040A4E9F7B7DD14C4C52012B010D68BB450C40C2658FC719023CFDC10AC4A46CBD3E
-0C302029474849DC92010501453620CB324E9CA197B2C8443200FFFF006EFFE503D70478
-021600560000FFFF00AF0000018305DB0216004C0000FFFF00050000022D05DB02160077
-0000FFFFFFC2FE59021505DB0216004D00000002001DFFFE06F4045D000E003D0072B900
-30FFACB30D10371EB8FFC0401D0D1037073D4F379F3702373716183E350528282C3F2409
-3D167900010FB8FFF0401E090B3737081A161635001B890F010F8F3F0F3F0118C9203530
-35023535282F332F5DED5D10F45DFD11392FFD322B5D002FED2FFD322F3FED12392F5DED
-31302B2B00353426272E012B01113332363736371406070E01232111210E01070E01070E
-01070E012322262335333216333236373E01373E01372111333216171E01063223282A6B
-64B0AC646E2829E74138429676FE55FE5F03060307201A183B2222533111410A0A081E0A
-183312333E0A0407030301F47E8B453A3A012037334D18190AFE8411181A81518429322A
-03BF539A3EA7C7423E4D1F1E1E02A4020E1332EEE152E166FE4D1A332B86000200B90000
-06F4045D000E0027005D4017171E073D4F219F21022121161C20051A083D167900010FB8
-FFF0401F090B37211E081A16161A001B890F010F8F290F292F294F29031D191A1A882810
-F6FD325D10F65DED11392FED39392B5D002FED2F3F3312392F5DED39393130013426272E
-012B0111333236373E01371406070E0123211121112311331121113311333216171E0106
-3223282A6B64B0AC646E282925C24138429676FE55FDF3BCBC020DBCF47E8B453A3A0157
-334D18190AFE8411181A473A518429322A0210FDF0045DFE4D01B3FE4D1A332B86000001
-00130000045F0614001E00504030031D161D751D0317140E51111112180D08421B041201
-010D08150F021A0091201F20602002141517030B1A110F0D881F10F63232FD17325D10F6
-ED2F2F003F3C3F3FED123912392FED393931305D2123113426272E012322060711231123
-3533353315211521113E0133321615045FBC1218195E4B4DA84DBCA6A6BC0141FEBF58BC
-63B5BE027C4D87262A294C3BFCBE04F4869A9A86FEED4952DACDFFFF00C1000004A90682
-0236021200000116008DF9F60011400C01001D401D02001D1C0611252B5D35000002003D
-FE64047F06150007001500BD404C04063406440650066006700606090307051903170546
-0149035800570179030902071A000100051A0403044900460402080F0E010E0E12500B0B
-0003020405020C15C908400B0E37080FC90EB8FFC040110B0E370E080E04026801010102
-03030400B8FFC040220910370C001C004A006A007A0005008D170F170103041304450465
-0475040504821610E65D5D10F65D2B1117395D2F1139392F2BED2F2BED003F3F12393933
-2FED332F5D333130015D8710FD8710FDC0015D005D0901231301330901130E0123222627
-331E0133323637047FFD74C9D0FE43CC0157015A0805B1A9A9B105AB015B58595A01045D
-FA0701D20427FCC4033C01B894A6A694695E5C6B000100B9FEF40460045D000B003F4027
-0A060520030103083E00050802C93F034F037F0303030305091A00920D1F0D600D02081A
-05880C10F6ED5D10F6ED12392F5DED003F33ED2F5D3F3331302901112311211133112111
-330460FE84AEFE83BC022FBCFEF4010C045DFC4403BC000100C80000048A076B0007002B
-B90006FFC040140D10370606003503030205130606090114026C0810F6ED11332FED002F
-3FED332F2B31300111231121113311018EC60308BA0521FADF05D1019AFDB600000100B9
-000003BB05CE00070033B90006FFC0401A0E10370606003F03050205C97006010606090F
-0901011A02870810F6ED5D11332F5DED002F3FED332F2B313001112311211133110175BC
-0254AE03B8FC48045D0171FDEA00000100CB023C073502DC00030011B601540200000501
-2F11332F002FED3130012135210735F996066A023CA0000400C8000008B905ED00090015
-0021002500A7403E080718073A014901440646075801540656076F0160067F0170060D09
-0D0613190D16137A19751F0625533F224F220222221F401214371F51300D010D0D19B8FF
-C040321214371951130202030807040106030100220F2302232223220A1CC910100A0006
-0102071300000416C90A0A270213046C2610F6ED11332FED12392FFD1139391112392FED
-1239392F2F5D002F3F1217393FED2B332F5DED2B332F5DED5D3130015D21230111231121
-0111330114062322263534363332160734262322061514163332360121152104FFF5FD72
-B401330250B403BABDB2B6BABEB2B5BAB25865675757676558FE6201B8FE480534FACC05
-D1FB4004C0FE63E0DADADFE0DADCDDAC8888ADAD8787FDE89E00000100B900000460045D
-000700254015033F06050005011A0092091F09600902041A05880810F6ED5D10F6ED002F
-333FED313021231121112311210460BCFDD1BC03A703BBFC45045D00000101190235028F
-05D5000800214011035004040703010E0307002A03000101012F5D33ED392F003F3F332F
-ED3130012311233532363733028FA5D1667E0989023502A9752C5600000100EF023D039F
-05ED001D0043B90011FFE040250D10370F0F0B521302021C51010E00001C01082A261636
-166616761604160F160F000101012F5D33332F2F5DED1239332F003FFD323FED332F3130
-2B0121353E01373E013534262322060723353E01333216151406070E010721039FFD505B
-86276D40584C468F290F41974D9DA9526A318D3701F2023D94456825676D52464A3C20B3
-1B229E7A5D945E2B6A29000100E6021C037305ED002E0074400F6C096C227E097E220455
-0C5A1F0226B8FFE0403B0B0E3703200B0D372C2B15510F16010F161F164F165F16CF16FF
-16061621211D51160625020A0A0E51060F1A2A281622112A2216282C04090000092F332F
-121739ED2F2F2FED003FED332F3F1239ED332F2F5D71ED393931302B2B5D015D01140607
-0E012322262735331E013332363534262B01353332363534262322060723353E01333216
-15140607151E0103733C30357B4F528F4111259A4F546E645B8C7D575F52574299251140
-964F98AA614D5075033A47702225201E1CAF233B4948533B8B4C423C473E23AF1B228C62
-57711A08106D000200B3023D03BD05ED000A000D003A401E6D067E06020609010D51050C
-05030702030E00070B042A09000D060101062F332F12393333FD39392F003F3F1239392F
-ED3939323130015D012315233521350133113321110103BDA396FE2F01D295A3FECBFE9F
-0319DCDCB9021BFDB10190FE7000000100E6021C037505DA002A004840176F087F08021D
-1D1A5125250621511E030A0A0E51060F00B8FFEA400F090C371F21291E1F1E09142A0000
-092F332FED1239392FED2F2B003FED332F3FED12392FFD322F31305D011406070E012322
-262735331E01333236373E01353426272E012322060711211521153E01333216171E0103
-75322F3088574E953C1025924E2C521C1D171F1D1E59353B6C260255FE4814310E547634
-373C0363457A2A2B331C1A9F1436171C1D43272A391415110E0601F08BCF02021722246F
-000100F3023503A505DA000600414025560101030100012A020203630073000200000351
-0503020E030002100910370202040000042F332F12392F2B1239003F3FFD322F3130015D
-8710ED87C0015D0901230121352103A5FE2AB901F0FDED02B2054EFCE7031A8B000300C5
-021B039105EE001900280037005D40420F0B0F151F0B1F152A022A0439023904492B582B
-0A0F251F2526103610042F09261604031D5110023551030F1A2A13202A0D292A090D1316
-04067000010000322A062FED332F5D121739ED2FED2FED003FED3FED1217395D31305D01
-140623222635343637352E0135343633321615140607151E01033426232206151416171E
-01173E01133426272E01270E011514163332360391CB9BA7BF5E595246B99095B5505261
-5BBE574F465D302D17482E392618374217582A3A387650516D033579A19F784F78260429
-64476A8D87683F7D2304276B016433483F36263D140A1F0B254FFE79323B1E0A1C0F205D
-304A5F4E00020073FFE1068B05F0002800340075400978180176097915021BB8FFC04045
-0910371B694F0001002302031A090A0905151A0915155A095515062C3415023234090A22
-1E2926151B00030F291503360F361F3680369036BF36CF36060F36012F150F683510F6ED
-5D5D10D6ED121739D4FDC4003FED3FED5D1239393FDD5DED2B5D31305D011E0115140207
-0E01232224272602353412373624333216171E01173E013534262735331E011514060110
-0023220011100033320005A11F1A63595CFBA19DFEFF5A5A61605C5801059AA0FF591819
-144F43160CA00D0B78FEF9FEFCE1E3FEFD0108DEDE0107044958A663B8FEDD6165666863
-630120B9B6012167626869611B2121044044245B17092F46326C82FE8D0122013BFEC5FE
-DEFEDBFEC90137000002006AFFE104C30584001D0029005640391A20090C373A2135274A
-21452704151B690D050003213F0904273F030A14102918090C1B03061E1B00902B0F2B1F
-2B3F2B6F2B04241B06852A10F6ED5D10F6ED121739DCFDC4003FED3FED12393FFDCD5D31
-302B011000232200111000333216173332363534262735331E01151406071E0107342623
-22061514163332360471FEE8EBEDFEE90117ED33602B5D5A4A160CA00D0B736C4548C2AA
-9799A9AA9896AB022EFEEFFEC4013C01110111013D0F104147245B17092F46326A80144D
-D98BD9D3D3D9D2D9D700000100B2FFE1067506F8002B004C40342A20090F37252B6A1C03
-0D032615390649067615041534060A2420290F2801281B14002D0F2D402D6F2D7F2D902D
-050F140C6B2C10F6ED5D10DEEDD45DFDC4003FED5D3F3FFDC431302B011406070E012322
-26272E01351133111416171E01333236373E0135113332363534262735331E0115140623
-052947514DCE898CD0475147C621272C976A6B962D2721D85A4A160CA00D0BACA00256A2
-F1504C464A4852E8A9037BFC7B798C394142414239936D038A4147245B17092F46328384
-000100B1FFE105A505840025005C403E0B0619077A070323200910371E246A1505020509
-051142050A011D19290F21012114021A40000100270F276F27025F279027A027C027EF27
-050B1A08872610F6ED5D7110D671ED32D45DFDC4002F3FED3F12393FFDC431302B5D2123
-350E01232226351133111416171E0133323637113332363534262735331E011514062B01
-0457BC5FAE69B0C4BC101A1B565249AD4BD05A4A160CA00D0BACA0027C4B50D7D002D5FD
-8455792B2C284C3B03424147245B17092F46328384000001020905110342068C00160042
-4029BF0301030606050C50146005010504ADC005D005020540090D370505110940111437
-09290F000100112FDD5DED2B12392F2B5DED002F5DD4ED12392FC55D3130011406071523
-353E013534262322060723353E01333216034242426E2F3026211F251803134926516605
-F8404E1544790C27271827090969060C560000010221FE8202F5FF450003001340090144
-8F0201020015012FED002F5DED31300123353302F5D4D4FE82C3FFFF0154051602FA068C
-001600430000FFFF021D051603C3068C0016008D00000002013605110514068C0006000A
-004DB90006FFF040100E103705100E10370802010708040305B8FFC040110E1037050560
-0301036007700702070900B8FFC0B50E10370000042F332F2BD6CD5D002F5D332F2B1217
-392F3130012B2B01230B012313332103231303E19FB9B89BE4E30217DA817C05110100FF
-00017BFEF6010A0000020003051103E1068C0006000A004AB90006FFF040100E10370510
-0E10370802010809040305B8FFC040180E1037050560030103006F097F0902090704400E
-103700042F332BD6CD5D2F002F5D332F2B1217392F3130012B2B01230B01231333012303
-3303E19FB9B89BE4E3FE6181DADF05110100FF00017BFEF6010A00020136051104C00752
-0006001D008EB90006FFF040120E103705100E1037BF0A010A0D0D0C13501BB8FFC0400B
-0E10371B0C02010C030305B8FFC0402A0E10370505600301030BADC00CD00C020C400910
-370C0C18104011143710290F07010718400C10371800B8FFC040090E1037000060040104
-2F5D332F2BD42BDD5DED2B12392F2B5DED002F5D332F2B1217392FD42BED12392FC55D31
-30012B2B01230B01231333251406071523353E013534262322060723353E0133321603E1
-9FB9B89BE4E301C342426E2F3026211F251803134926516605110100FF00017B32404E15
-44790C27271827090969060C560000020125051103F307DE000600200064B90006FFF040
-200E103705100E10370710520F171F17A0170317141D520A400D11370A01020305B8FFC0
-40110E10370505600301032029070013291400B8FFC0B40E103700042F332BD6ED2FD6ED
-002F5D332F2B123939D62BED3CDD5DED3C3130012B2B01230B01231333130E0123222627
-2E0123220607233E01333216171E013332363703E19FB9B89BE4E3F606865F35491C183A
-192B22058C05875F36491C163B192A240405110100FF00017B015289902919162D3E4788
-912A19142E3E47000002014204E703D506FB000D0011003C40251110400F1A3710001006
-0AAA3F030103600E700E020E100D2A100F001F008F000300072A062FEDD45D39ED2FCD5D
-002F5DEDCD39392F2BCD313001140623222635331416333236353703231303D5B29897B2
-A2555253555EDA817C0646A3BCBCA37C64647CB5FEF6010A0002014204E703D506FB000D
-0011003C4025100F400F1A370F000F060AAA3F0301036F107F1002100E0D2A0E0F001F00
-8F000300072A062FEDD45D39ED2FCD5D002F5DEDCD39392F2BCD31300114062322263533
-1416333236350723033303D5B29897B2A2555253555281DADF0646A3BCBCA37C64647C55
-010A0002014204E703D5071E000D002400634040111414131A0F2201221340091A371300
-13060AAA3F0301031213400910371313001F101F201F031F1728500E600E700E030E0D2A
-0E0F001F008F000300072A062FEDD45D39ED2F5DEDCD5D392F2BCD002F5DEDCD39392F2B
-D45DCD12392FC531300114062322263533141633323635271406071523353E0135342623
-22060723353E0133321603D5B29897B2A2555253551237375C272822191C1E1402103C21
-42570646A3BCBCA37C64647C5B34431238650A2120191D080757060A45000002012504E7
-03F307DE000D0027005840100E17520F1E1F1E021E1B245220110111B8FFC04025090C37
-11006006700602060AAA3F0301031A291B0627290E0D2A0F001F008F000300072A062FED
-D45DEDD4ED10D6ED002F5DEDDD5D39D62B71ED3CDD5DED3C313001140623222635331416
-33323635130E01232226272E0123220607233E01333216171E013332363703D5B29897B2
-A255525355C006865F35491C183A192B22058C05875F36491C163B192A24040646A3BCBC
-A37C64647C019889902919162D3E4788912A19142E3E47000001020905110342068C0016
-00524035BF0301030606050C50501460147014031409900501C76005010504ADC005D005
-020540091037050511094011143709290F000100112FDD5DED2B12392F2B5DED002F5D5E
-5D5ED45DED12392FC55D3130011406071523353E013534262322060723353E0133321603
-4242426E2F3026211F251803134926516605F8404E1544790C27271827090969060C5600
-00020136065403E1080100060020007D404A0702170202141D50200A010A1050076F1701
-0F1770170217010205400D1137050920039003A003B003045910032003C00303C003D003
-0231D003E003025003010F037003020320280700B8FFC040090E10370013281400042F33
-D6ED2F2BD6ED002F5D71725E71725E715ECD2B39392F5D713CEDDD71ED3C31305D012327
-07233733130E01232226272E0123220607233E01333216171E013332363703E1A9AFAEA5
-F8BBEC0B705025491C1B3E141D2806860A6F5227432122301A1B2B0506545959AD010052
-6B190D0D1A202D4E6F17101016232A0000020142064803D50801000D0011005A403E5010
-6010020A50FF03015F030103007F0601060F109F10026F10FF1002106F11010F11701102
-11590E690E720E030E100D2A100F001F008F000300072A062FEDD45D39ED2FCD5D002F5D
-71DD5D71D45D3CDD7172ED5D313001140623222635331416333236353707233703D5AB9E
-9EACA24B5D5A4D4FC681680738589899573058592FC9D8D800020142064803D50801000D
-001100644033500E600E020A50FF03015F030103007F0601060F0E9F0E026F0EFF0E020E
-6F11010F1170110211561066107D1003100E0D2A0EB8FFC0400F090D370E0F001F008F00
-0300072A062FEDD45D392BED2FCD5D002F5D71DD5D71D45D3CDD7172ED5D313001140623
-222635331416333236350723273303D5AB9E9EACA24B5D5A4D5681C6DF07385898995730
-58592F0FD80000020142064803D50801000D0024008E4062111414131A6F22010F227022
-02223F134F13021340111537130013060A5009900301B0030159700301310F033F037003
-CF0304031213400915371313501F601F701F03001F101F201F301F401F051F17C00E010E
-0D2A0E0F001F008F000300072A062FEDD45D39ED2F5DCDCD5D71392F2BCD002F5D5E715E
-5D715EEDCD39392F2B712F5D71CD12392FC5313001140623222635331416333236352714
-06071523353E013534262322060723353E0133321603D5AB9E9EACA24B5D5A4D2E2E2E4D
-231F1C15191A0E020E321B364A0738589899573058592F612B380F2F54091E1817160805
-4905083900020142064803D50801000D0027009240111B2450DF1101110E17506F1E010F
-1E011EB8FFC040520D10371E00060A50099003B00302F0030159200330034003C003D003
-E003066003700302C003D0030231A003B003025003E003020F033F03CF0303031A281B1B
-0627280E0E0D2A0F001F008F000300072A062FEDD45DED3C10ED103C10ED002F5D71725E
-5D71725E5D715EEDCD322F2B5D71ED3CDD71ED3C31300114062322263533141633323635
-370E01232226272E0123220607233E01333216171E013332363703D5AE9B9BAFA26C3C3C
-6BA20B705025491C1B3E141D2806860A6F5227432122301A1B2B050706546A67572E2828
-2EFB526B190D0D1A202D4E6F17101016232A000201360668051008010006001D0088B900
-06FFF0401A0E103705100E1037BF0A010A0D0D0C400E10370C13500F1B011BB8FFC0403A
-0D10371B0102030F0570050205050F0301030BADC00CD00C020C400910370C0C18104011
-143710290F07010750006000700003180000600401042F5D332FD45DDD5DED2B12392F2B
-5DED002F5D332F5D1239392F2B5DEDC42B392FC55D3130012B2B01232707231333051406
-071523353E013534262322060723353E0133321603E19FB9B89BE4E3021342426E2F3026
-211F25180313492651660668CECE014944404E1544790C27271827090969060C5600FFFF
-001AFE82055E05D10236002400000116024B2F00000AB602000D0E0500252B35FFFF0068
-FE82041D04780236004400000116024BBA00000F400A027F36010036370B00252B5D3500
-FFFF001A0000055E080102360024000001170256002F0175001A401202501C0102101C40
-1C701C03001C0B0500252B5D35005D35FFFF0068FFE1041D068C0236004400000116024A
-BA000011400C025F457F45021D45340B00252B5D3500FFFF001A0000055E07ED02360024
-00000117024E002F01610011400B0302400F01000F0B0500252B5D353500FFFF0068FFE1
-04F4068C0236004400000116024EE0000013400D030240385038022938340B00252B5D35
-3500FFFF001A0000055E07ED0236002400000117024F002F01610011400B03020F0F0100
-0F0B0500252B5D353500FFFFFFE3FFE1041D068C0236004400000116024FE0000013400D
-030240385038022938340B00252B5D353500FFFF001A0000055E08010236002400000116
-025C2F00001740110302400FA00FB00FC00F04000F0B0500252B5D353500FFFF0068FFE1
-04A0075202360044000001160250E0000013400D030240385038022938340B00252B5D35
-3500FFFF001A0000055E0801023600240000011602572F00000CB70302000F0B0500252B
-3535FFFF0068FFE1041D07DE02360044000001160251E0000013400D0302403850380229
-38340B00252B5D353500FFFF001AFE82055E07ED023600240000003700D6002F01610116
-024B2F00001840110300141505002502400F01000F0B0500252B5D352B35FFFF0068FE82
-041D068C023600440000003600D6E0000116024BBA00001E4016037F3D01003D3E0B0025
-0240385038022938340B00252B5D352B5D35FFFF001A0000055E08010236002400000116
-02582F00000CB7030200110B0500252B3535FFFF0068FFE1041D06FB0236004400000116
-0252E0000011400B0302403A01293A340B00252B5D353500FFFF001A0000055E08010236
-00240000011602592F00000CB7030200110B0500252B3535FFFF0068FFE1041D06FB0236
-0044000001160253E0000011400B0302403A01293A340B00252B5D353500FFFF001A0000
-055E08010236002400000116025A2F00000CB7030200110B0500252B3535FFFF0068FFE1
-041D071E02360044000001160254E0000011400B0302403A01293A340B00252B5D353500
-FFFF001A0000055E08010236002400000116025B2F00000CB7030200110B0500252B3535
-FFFF0068FFE1041D07DE02360044000001160255E0000011400B0302403A01293A340B00
-252B5D353500FFFF001AFE82055E0801023600240000003700D9002F01750116024B2F00
-001D4013025011011103001B1C0500250200110B0500252B352B3500115D3500FFFF0068
-FE82041D068C023600440000003600D9DD000116024BBA0000184011037F44010044450B
-002502293A340B00252B352B5D35FFFF00C8FE82049D05D10236002800000116024B2600
-000AB601000E0F0100252B35FFFF006AFE820460047C0236004800000116024BF900000A
-B6021F22231218252B35FFFF00C80000049D08010236002800000117025600260175001C
-401401501D0101001D201D501D601D04001D0C0203252B5D35005D35FFFF006AFFE60460
-068C0236004800000116024AF9000018B4026F310131B8FFC040090A1137323120120025
-2B2B5D35FFFF00C80000049D07C8023600280000011700D7002601750012400B01501901
-0100190C0203252B35005D35FFFF006AFFE604600653023600480000011600D7F900000A
-B602002D201200252B35FFFF00C80000053A08010236002800000117024E002601750016
-400D0201501001020100100C0203252B3535005D3535FFFF006AFFE6050D068C02360048
-00000116024EF900000CB703021E24201200252B3535FFFF00290000049D080102360028
-00000117024F002601750016400D0201501001020100100C0203252B3535005D3535FFFF
-FFFCFFE60460068C0236004800000116024FF900000CB703021E24201200252B3535FFFF
-00C80000053608010236002800000116025C26000013400D0201101020100200100C0203
-252B5D353500FFFF006AFFE604B9075202360048000001160250F9000013400D03020024
-2024021E24201200252B5D353500FFFF00C80000049D0801023600280000011602572600
-000CB7020100100C0203252B3535FFFF006AFFE6046007DE02360048000001160251F900
-000CB703021E24201200252B3535FFFF00C8FE82049D0801023600280000003700D60026
-01750116024B2600001D40130110501001020015160203250100100C0203252B352B3500
-5D113500FFFF006AFE820460068C023600480000003600D6F9000116024BF9000014400E
-031E292A120025021E24201200252B352B35FFFF0089000002D508010236002C00000117
-0256FF2401750016400E01501101015011010011100409252B5D35005D35FFFF00960000
-01CF068C023600D500000117024AFE8D0000000AB6010009080203252B35FFFF0089FE82
-02D505D10236002C00000117024BFF240000000AB601000E0F0409252B35FFFF00AFFE82
-018305DB0236004C00000117024BFE8E0000000AB602000A0B0203252B35FFFF0073FE82
-05DA05F00236003200000117024B009B0000000AB6020026270F03252B35FFFF006AFE82
-0471047C0236005200000116024BE200000AB602001A1B0600252B35FFFF0073FFE105DA
-080102360032000001170256009601750022400B0250340102503470340234B8FFC04009
-090B370034240F03252B2B5D35005D35FFFF006AFFE10471068C0236005200000116024A
-E200000F400A02701D01001D1C0600252B5D3500FFFF0073FFE105DA0801023600320000
-0117024E00960175001E401403025028010302202850288028030028240F03252B5D3535
-005D3535FFFF006AFFE104F6068C0236005200000116024EE200001940130302001C201C
-501C801CB01C05001C180600252B5D353500FFFF0073FFE105DA08010236003200000117
-024F009601750016400D030250280103020028240F03252B3535005D3535FFFFFFE5FFE1
-0471068C0236005200000116024FE200000CB70302001C180600252B3535FFFF0073FFE1
-05DA08010236003200000117025C009600000015400F0302202850288028030028240F03
-252B5D353500FFFF006AFFE104A2075202360052000001160250E200001940130302001C
-201C501C801CB01C05001C180600252B5D353500FFFF0073FFE105DA0801023600320000
-01170257009600000015400F0302202850288028030028240F03252B5D353500FFFF006A
-FFE1047107DE02360052000001160251E200001940130302001C201C501C801CB01C0500
-1C180600252B5D353500FFFF0073FE8205DA0801023600320000003700D6009601750117
-024B00960000001D4013025028012803002D2E0F0325020028240F03252B352B3500115D
-3500FFFF006AFE820471068C023600520000003600D6E2000116024BE2000014400E0300
-212206002502001C180600252B352B35FFFF0073FFE1068B08010236024600000117008D
-007801750014400D025036603602020036360F03252B35005D35FFFF006AFFE104C3068C
-0236024700000116008DE200000AB602002B2B0600252B35FFFF0073FFE1068B08010236
-024600000117004300AA0175001A40120250366036020250367036020036360F03252B5D
-35005D35FFFF006AFFE104C3068C02360247000001160043E2000011400C02502B602B02
-002B2B0600252B5D3500FFFF0073FFE1068B080102360246000001170256008F01750012
-400B02503A0102003A390F03252B35005D35FFFF006AFFE104C3068C0236024700000116
-024AE200000AB602002F2E0600252B35FFFF0073FFE1068B07C8023602460000011700D7
-008B01750012400B02504201020042350F03252B35005D35FFFF006AFFE104C306530236
-02470000011600D7C400001540100210372037403750370400372A0600252B5D3500FFFF
-0073FE82068B05F00236024600000117024B009A0000000AB6020037380F03252B35FFFF
-006AFE8204C305840236024700000116024BE200000AB602002C2D0600252B35FFFF00B2
-FE82052905D10236003800000116024B6200000AB6010020210C00252B35FFFF00B1FE82
-0457045D0236005800000116024BFD00000AB60100191A0916252B35FFFF00B2FFE10529
-080102360038000001170256006201750012400B01502301010023220C00252B35005D35
-FFFF00B1FFE10457068C0236005800000116024AFD00000AB601001C1B0916252B35FFFF
-00B2FFE1067508010236024800000117008D007C01750014400D01502E602E0201002E2D
-0C00252B35005D35FFFF00B1FFE105A5068C0236024900000116008DEE00001840100160
-28010130284028020028290900252B5D35005D35FFFF00B2FFE106750801023602480000
-0117004300AA0175001C401401502D602D0201402D602D802D03002D2D0C00252B5D3500
-5D35FFFF00B1FFE105A5068C023602490000011600430200001840100160270101502760
-27020027270800252B5D35005D35FFFF00B2FFE106750801023602480000011702560062
-01750012400B01503101010031300C00252B35005D35FFFF00B1FFE105A5068C02360249
-00000116024AFD00000AB601002B2A0800252B35FFFF00B2FFE1067507BE023602480000
-011700D70062016B000AB60100392C0C00252B35FFFF00B1FFE105A50653023602490000
-011600D7FD00000AB6010033260800252B35FFFF00B2FE82067506F80236024800000116
-024B6200000AB601002E2F0D00252B35FFFF00B1FE8205A505840236024900000116024B
-FD00000AB6010028290800252B35FFFF0006000004E608010236003C000001170043FFE4
-0175001B400A01500A600A0201500A01B8FFD3B40A0A0401252B5D35005D3500FFFF003D
-FE64047F068C0236005C000001160043DD000013B5016009700902B8FFDDB40909040025
-2B5D3500FFFF0006FE8204E605D10236003C00000116024BEC00000AB601000A09040125
-2B35FFFF003DFE64047F045D0236005C00000117024B010400000012400D010A0F0A2F0A
-4F0A6F0A7F0A055D1135FFFF0006000004E608010236003C000001170256FFEC01750018
-401001500E0101C00ED00E02000E0D0302252B5D35005D35FFFF003DFE64047F068C0236
-005C00000116024AC900000F400A01500D01000D0C0400252B5D3500FFFF0006000004E6
-07C80236003C0000011700D7FFEC01750012400B01501601010016090500252B35005D35
-FFFF003DFE64047F06530236005C0000011600D7DD00000AB6010015080400252B350003
-006CFEBD04FB0614001B0028002C007E40523B05380C3C2232243E284B054A0C4E224524
-4F285908690870120D2AB52B0114511A17171018011304072041100403082642070A2C2B
-2C2B010A1600881617131C041A1A01922E1F2E3F2E02231B010A852D10F632ED5D10F632
-ED32323232ED2F111239392F2F003FED3F3FED1239393F12392F3CFD3C2FED31305D0123
-1123350E01232202113436373E0133321617352135213533153301112E01232206151416
-3332361321352104FBB8BC4DAD6EC6ED524444B66059864CFE95016BBCB8FE8C4F73499C
-B2879750A4EAFCB4034C04F4FB0C754252012E01118EDB4D4C4F2427CE869A9AFB990279
-2218D6CCC3CD47FDE286FFFF00ED051D042C0653001600D700000002008A009104900498
-0023002F004D40332D290B0802231D1A141108172F0501052729050F1701170F311F3102
-24290B0802231D1A1411080E202001202A29200F0E010E2F5D33ED2F5D121739ED5D002F
-5D33ED2F5D121739ED31300107270E01232226270727372E01353436372737173E013332
-16173717071E011514060727342623220615141633323604906EEC2C4A342E5724EC6DE9
-1718161AEA6FEB24572D2C5825EA71EB1818191765694B496B694B496B01016EEA1A1619
-17EC71EA25592B34492BED6EEB17191817EA6DED2653302D5824A949706E4B4A6F6D0000
-0002000000000000FF4C00780000000000000000000000000000000000000000037D0000
-01020103010401050106010701080109010A010B010C010D010E010F0110011101120113
-011401150116011701180119011A011B011C011D011E011F012001210122012301240125
-0126012701280129012A012B012C012D012E012F01300131013201330134013501360137
-01380139013A013B013C013D013E013F0140014101420143014401450146014701480149
-014A014B014C014D014E014F0150015101520153015401550156015701580159015A015B
-015C015D015E015F0160016101620163016401650166016701680169016A016B016C016D
-016E016F0170017101720173017401750176017701780179017A017B017C017D017E017F
-0180018101820183018401850186018701880189018A018B018C018D018E018F01900191
-01920193019401950196019701980199019A019B019C019D019E019F01A001A101A201A3
-01A401A501A601A701A801A901AA01AB01AC01AD01AE01AF01B001B101B201B301B401B5
-01B601B701B801B901BA01BB01BC01BD01BE01BF01C001C101C201C301C401C501C601C7
-01C801C901CA01CB01CC01CD01CE01CF01D001D101D201D301D401D501D601D701D801D9
-01DA01DB01DC01DD01DE01DF01E001E101E201E301E401E501E601E701E801E901EA01EB
-01EC01ED01EE01EF01F001F101F201F301F401F501F601F701F801F901FA01FB01FC01FD
-01FE01FF0200020102020203020402050206020702080209020A020B020C020D020E020F
-0210021102120213021402150216021702180219021A021B021C021D021E021F02200221
-02220223022402250226022702280229022A022B022C022D022E022F0230023102320233
-023402350236023702380239023A023B023C023D023E023F024002410242024302440245
-0246024702480249024A024B024C024D024E024F02500251025202530254025502560257
-02580259025A025B025C025D025E025F0260026102620263026402650266026702680269
-026A026B026C026D026E026F0270027102720273027402750276027702780279027A027B
-027C027D027E027F0280028102820283028402850286028702880289028A028B028C028D
-028E028F0290029102920293029402950296029702980299029A029B029C029D029E029F
-02A002A102A202A302A402A502A602A702A802A902AA02AB02AC02AD02AE02AF02B002B1
-02B202B302B402B502B602B702B802B902BA02BB02BC02BD02BE02BF02C002C102C202C3
-02C402C502C602C702C802C902CA02CB02CC02CD02CE02CF02D002D102D202D302D402D5
-02D602D702D802D902DA02DB02DC02DD02DE02DF02E002E102E202E302E402E502E602E7
-02E802E902EA02EB02EC02ED02EE02EF02F002F102F202F302F402F502F602F702F802F9
-02FA02FB02FC02FD02FE02FF0300030103020303030403050306030703080309030A030B
-030C030D030E030F0310031103120313031403150316031703180319031A031B031C031D
-031E031F0320032103220323032403250326032703280329032A032B032C032D032E032F
-0330033103320333033403350336033703380339033A033B033C033D033E033F03400341
-03420343034403450346034703480349034A034B034C034D034E034F0350035103520353
-035403550356035703580359035A035B035C035D035E035F036003610362036303640365
-0366036703680369036A036B036C036D036E036F03700371037203730374037503760377
-03780379037A037B037C037D037E037F0380038103820383038403850386038703880389
-038A038B038C038D038E038F0390039103920393039403950396039703980399039A039B
-039C039D039E039F03A003A103A203A303A403A503A603A703A803A903AA03AB03AC03AD
-03AE03AF03B003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF
-03C003C103C203C303C403C503C603C703C803C903CA03CB03CC03CD03CE03CF03D003D1
-03D203D303D403D503D603D703D803D903DA03DB03DC03DD03DE03DF03E003E103E203E3
-03E403E503E603E703E803E903EA03EB03EC03ED03EE03EF03F003F103F203F303F403F5
-03F603F703F803F903FA03FB03FC03FD03FE03FF04000401040204030404040504060407
-04080409040A040B040C040D040E040F0410041104120413041404150416041704180419
-041A041B041C041D041E041F0420042104220423042404250426042704280429042A042B
-042C042D042E042F0430043104320433043404350436043704380439043A043B043C043D
-043E043F0440044104420443044404450446044704480449044A044B044C044D044E044F
-0450045104520453045404550456045704580459045A045B045C045D045E045F04600461
-04620463046404650466046704680469046A046B046C046D046E046F0470047104720473
-047404750476047704780479047A047B047C047D052E6E756C6C106E6F6E6D61726B696E
-6772657475726E057370616365066578636C616D0871756F746564626C0A6E756D626572
-7369676E06646F6C6C61720770657263656E7409616D70657273616E640B71756F746573
-696E676C6509706172656E6C6566740A706172656E726967687408617374657269736B04
-706C757305636F6D6D610668797068656E06706572696F6405736C617368047A65726F03
-6F6E650374776F05746872656504666F757204666976650373697805736576656E056569
-676874046E696E6505636F6C6F6E0973656D69636F6C6F6E046C65737305657175616C07
-67726561746572087175657374696F6E0261740141014201430144014501460147014801
-49014A014B014C014D014E014F0150015101520153015401550156015701580159015A0B
-627261636B65746C656674096261636B736C6173680C627261636B657472696768740B61
-7363696963697263756D0A756E64657273636F7265056772617665016101620163016401
-650166016701680169016A016B016C016D016E016F017001710172017301740175017601
-7701780179017A0962726163656C656674036261720A627261636572696768740A617363
-696974696C646509416469657265736973054172696E670843636564696C6C6106456163
-757465064E74696C6465094F646965726573697309556469657265736973066161637574
-65066167726176650B6163697263756D666C657809616469657265736973066174696C64
-65056172696E670863636564696C6C6106656163757465066567726176650B6563697263
-756D666C65780965646965726573697306696163757465066967726176650B6963697263
-756D666C657809696469657265736973066E74696C6465066F6163757465066F67726176
-650B6F63697263756D666C6578096F6469657265736973066F74696C6465067561637574
-65067567726176650B7563697263756D666C657809756469657265736973066461676765
-72066465677265650463656E7408737465726C696E670773656374696F6E0662756C6C65
-74097061726167726170680A6765726D616E64626C730A7265676973746572656409636F
-707972696768740974726164656D61726B056163757465086469657265736973086E6F74
-657175616C024145064F736C61736808696E66696E69747909706C75736D696E7573096C
-657373657175616C0C67726561746572657175616C0379656E036D75310B706172746961
-6C646966660973756D6D6174696F6E0770726F647563740370693108696E74656772616C
-0B6F726466656D696E696E650C6F72646D617363756C696E65034F686D026165066F736C
-6173680C7175657374696F6E646F776E0A6578636C616D646F776E0A6C6F676963616C6E
-6F74077261646963616C06666C6F72696E0B617070726F78657175616C09696E6372656D
-656E740D6775696C6C656D6F746C6566740E6775696C6C656D6F74726967687408656C6C
-697073697306416772617665064174696C6465064F74696C6465024F45026F6506656E64
-61736806656D646173680C71756F746564626C6C6566740D71756F746564626C72696768
-740971756F74656C6566740A71756F7465726967687406646976696465076C6F7A656E67
-650979646965726573697309596469657265736973086672616374696F6E044575726F0D
-6775696C73696E676C6C6566740E6775696C73696E676C726967687402666902666C0964
-616767657264626C0E706572696F6463656E74657265640E71756F746573696E676C6261
-73650C71756F746564626C626173650B70657274686F7573616E640B4163697263756D66
-6C65780B4563697263756D666C6578064161637574650945646965726573697306456772
-617665064961637574650B4963697263756D666C65780949646965726573697306496772
-617665064F61637574650B4F63697263756D666C6578064F677261766506556163757465
-0B5563697263756D666C65780655677261766508646F746C657373690A63697263756D66
-6C65780574696C6465066D6163726F6E05627265766509646F74616363656E740472696E
-6707636564696C6C610C68756E676172756D6C617574066F676F6E656B056361726F6E06
-4C736C617368066C736C61736806536361726F6E06736361726F6E065A6361726F6E067A
-6361726F6E0962726F6B656E626172034574680365746806596163757465067961637574
-650554686F726E0574686F726E056D696E7573086D756C7469706C790B6F6E6573757065
-72696F720B74776F7375706572696F720D74687265657375706572696F72076F6E656861
-6C660A6F6E65717561727465720D74687265657175617274657273056672616E63064762
-72657665066762726576650449646F740853636564696C6C610873636564696C6C610643
-61637574650663616375746506436361726F6E06636361726F6E07646D6163726F6E096F
-76657273636F7265066D6964646F74064162726576650661627265766507416F676F6E65
-6B07616F676F6E656B06446361726F6E06646361726F6E0644736C61736807456F676F6E
-656B07656F676F6E656B06456361726F6E06656361726F6E064C6163757465066C616375
-7465064C6361726F6E066C6361726F6E044C646F74046C646F74064E6163757465066E61
-63757465064E6361726F6E066E6361726F6E094F64626C6163757465096F64626C616375
-7465065261637574650672616375746506526361726F6E06726361726F6E065361637574
-65067361637574650854636564696C6C610874636564696C6C6106546361726F6E067463
-61726F6E055572696E67057572696E67095564626C6163757465097564626C6163757465
-065A6163757465067A6163757465045A646F74047A646F740547616D6D61055468657461
-0350686905616C7068610564656C746107657073696C6F6E057369676D61037461750370
-68690D756E64657273636F726564626C096578636C616D64626C096E7375706572696F72
-0670657365746102494A02696A0B6E61706F7374726F706865066D696E75746506736563
-6F6E64096166696936313234380961666969363132383906483232303733064831383534
-3306483138353531064831383533330A6F70656E62756C6C657407416D6163726F6E0761
-6D6163726F6E0B4363697263756D666C65780B6363697263756D666C65780443646F7404
-63646F7407456D6163726F6E07656D6163726F6E06456272657665066562726576650445
-646F740465646F740B4763697263756D666C65780B6763697263756D666C65780447646F
-740467646F740847636564696C6C610867636564696C6C610B4863697263756D666C6578
-0B6863697263756D666C657804486261720468626172064974696C6465066974696C6465
-07496D6163726F6E07696D6163726F6E064962726576650669627265766507496F676F6E
-656B07696F676F6E656B0B4A63697263756D666C65780B6A63697263756D666C6578084B
-636564696C6C61086B636564696C6C610C6B677265656E6C616E646963084C636564696C
-6C61086C636564696C6C61084E636564696C6C61086E636564696C6C6103456E6703656E
-67074F6D6163726F6E076F6D6163726F6E064F6272657665066F62726576650852636564
-696C6C610872636564696C6C610B5363697263756D666C65780B7363697263756D666C65
-7804546261720474626172065574696C6465067574696C646507556D6163726F6E07756D
-6163726F6E065562726576650675627265766507556F676F6E656B07756F676F6E656B0B
-5763697263756D666C65780B7763697263756D666C65780B5963697263756D666C65780B
-7963697263756D666C6578056C6F6E67730A4172696E6761637574650A6172696E676163
-757465074145616375746507616561637574650B4F736C61736861637574650B6F736C61
-7368616375746509616E6F74656C65696106576772617665067767726176650657616375
-746506776163757465095764696572657369730977646965726573697306596772617665
-067967726176650D71756F74657265766572736564097261646963616C65780961666969
-303839343109657374696D61746564096F6E656569676874680C74687265656569676874
-68730B66697665656967687468730C736576656E656967687468730B636F6D6D61616363
-656E7410756E646572636F6D6D61616363656E7405746F6E6F730D646965726573697374
-6F6E6F730A416C706861746F6E6F730C457073696C6F6E746F6E6F7308457461746F6E6F
-7309496F7461746F6E6F730C4F6D6963726F6E746F6E6F730C557073696C6F6E746F6E6F
-730A4F6D656761746F6E6F7311696F74616469657265736973746F6E6F7305416C706861
-04426574610544656C746107457073696C6F6E045A6574610345746104496F7461054B61
-707061064C616D626461024D75024E75025869074F6D6963726F6E0250690352686F0553
-69676D610354617507557073696C6F6E0343686903507369054F6D6567610C496F746164
-696572657369730F557073696C6F6E64696572657369730A616C706861746F6E6F730C65
-7073696C6F6E746F6E6F7308657461746F6E6F7309696F7461746F6E6F7314757073696C
-6F6E6469657265736973746F6E6F7304626574610567616D6D61047A6574610365746105
-746865746104696F7461056B61707061066C616D626461026D75026E75027869076F6D69
-63726F6E0372686F067369676D613107757073696C6F6E0363686903707369056F6D6567
-610C696F746164696572657369730F757073696C6F6E64696572657369730C6F6D696372
-6F6E746F6E6F730C757073696C6F6E746F6E6F730A6F6D656761746F6E6F730961666969
-313030323309616669693130303531096166696931303035320961666969313030353309
-616669693130303534096166696931303035350961666969313030353609616669693130
-303537096166696931303035380961666969313030353909616669693130303630096166
-696931303036310961666969313030363209616669693130313435096166696931303031
-370961666969313030313809616669693130303139096166696931303032300961666969
-313030323109616669693130303232096166696931303032340961666969313030323509
-616669693130303236096166696931303032370961666969313030323809616669693130
-303239096166696931303033300961666969313030333109616669693130303332096166
-696931303033330961666969313030333409616669693130303335096166696931303033
-360961666969313030333709616669693130303338096166696931303033390961666969
-313030343009616669693130303431096166696931303034320961666969313030343309
-616669693130303434096166696931303034350961666969313030343609616669693130
-303437096166696931303034380961666969313030343909616669693130303635096166
-696931303036360961666969313030363709616669693130303638096166696931303036
-390961666969313030373009616669693130303732096166696931303037330961666969
-313030373409616669693130303735096166696931303037360961666969313030373709
-616669693130303738096166696931303037390961666969313030383009616669693130
-303831096166696931303038320961666969313030383309616669693130303834096166
-696931303038350961666969313030383609616669693130303837096166696931303038
-380961666969313030383909616669693130303930096166696931303039310961666969
-313030393209616669693130303933096166696931303039340961666969313030393509
-616669693130303936096166696931303039370961666969313030373109616669693130
-303939096166696931303130300961666969313031303109616669693130313032096166
-696931303130330961666969313031303409616669693130313035096166696931303130
-360961666969313031303709616669693130313038096166696931303130390961666969
-313031313009616669693130313933096166696931303035300961666969313030393809
-616669693030323038096166696936313335320270690C6F6E656E756D657261746F720C
-74776F6E756D657261746F720E74687265656E756D657261746F720D666F75726E756D65
-7261746F720D666976656E756D657261746F720E736576656E6E756D657261746F720E65
-696768746E756D657261746F7210446F6E74436F6D707265737348544D5808676C797068
-35373908676C79706835383008676C797068353831054F686F726E056F686F726E055568
-6F726E0575686F726E0D686F6F6B61626F7665636F6D620C646F7462656C6F77636F6D62
-096772617665636F6D62096163757465636F6D6208676C79706835393008676C79706835
-393108676C79706835393208676C79706835393308676C79706835393408676C79706835
-393508676C79706835393608676C79706835393708676C79706835393808676C79706835
-393908676C79706836303008676C79706836303108676C79706836303208676C79706836
-303308676C7970683630340941646F7462656C6F770961646F7462656C6F770A41686F6F
-6B61626F76650A61686F6F6B61626F7665104163697263756D666C657861637574651061
-63697263756D666C65786163757465104163697263756D666C6578677261766510616369
-7263756D666C65786772617665144163697263756D666C6578686F6F6B61626F76651461
-63697263756D666C6578686F6F6B61626F7665104163697263756D666C657874696C6465
-106163697263756D666C657874696C6465134163697263756D666C6578646F7462656C6F
-77136163697263756D666C6578646F7462656C6F770B41627265766561637574650B6162
-7265766561637574650B41627265766567726176650B61627265766567726176650F4162
-72657665686F6F6B61626F76650F616272657665686F6F6B61626F76650B416272657665
-74696C64650B61627265766574696C64650E416272657665646F7462656C6F770E616272
-657665646F7462656C6F770945646F7462656C6F770965646F7462656C6F770A45686F6F
-6B61626F76650A65686F6F6B61626F7665064574696C6465066574696C64651045636972
-63756D666C65786163757465106563697263756D666C6578616375746510456369726375
-6D666C65786772617665106563697263756D666C65786772617665144563697263756D66
-6C6578686F6F6B61626F7665146563697263756D666C6578686F6F6B61626F7665104563
-697263756D666C657874696C6465106563697263756D666C657874696C64651345636972
-63756D666C6578646F7462656C6F77136563697263756D666C6578646F7462656C6F770A
-49686F6F6B61626F76650A69686F6F6B61626F76650949646F7462656C6F770969646F74
-62656C6F7708676C79706836343908676C79706836353008676C79706836353108676C79
-70683635320573686576610A68617461667365676F6C0A686174616670617461680B6861
-74616671616D617473056869726971057473657265057365676F6C057061746168067161
-6D61747305686F6C616D0671756275747306646167657368056D65746567056D61716166
-0472616665057061736571077368696E646F740673696E646F7408736F66706173757104
-616C6566036265740567696D656C0564616C657402686503766176057A6179696E036865
-740374657403796F640866696E616C6B6166036B6166056C616D65640866696E616C6D65
-6D036D656D0866696E616C6E756E036E756E0673616D656B68046179696E0766696E616C
-70650270650A66696E616C747361646905747361646903716F660472657368047368696E
-0374617609646F75626C6576617606766176796F6409646F75626C65796F640667657265
-73680967657273686179696D0D6E657773686571656C7369676E0A7661767368696E646F
-740D66696E616C6B616673686576610E66696E616C6B616671616D6174730A6C616D6564
-686F6C616D106C616D6564686F6C616D64616765736807616C746179696E0B7368696E73
-68696E646F740A7368696E73696E646F74117368696E6461676573687368696E646F7410
-7368696E64616765736873696E646F7409616C656670617461680A616C656671616D6174
-7309616C65666D61706971096265746461676573680B67696D656C6461676573680B6461
-6C6574646167657368086865646167657368097661766461676573680B7A6179696E6461
-676573680974657464616765736809796F646461676573680E66696E616C6B6166646167
-657368096B61666461676573680B6C616D6564646167657368096D656D64616765736809
-6E756E6461676573680C73616D656B686461676573680D66696E616C7065646167657368
-0870656461676573680B747361646964616765736809716F666461676573680A72657368
-6461676573680A7368696E64616765736808746176646167657308766176686F6C616D07
-62657472616665076B6166726166650670657261666509616C65666C616D6564127A6572
-6F77696474686E6F6E6A6F696E65720F7A65726F77696474686A6F696E65720F6C656674
-746F72696768746D61726B0F7269676874746F6C6566746D61726B096166696935373338
-380961666969353734303309616669693537343037096166696935373430390961666969
-353734343009616669693537343531096166696935373435320961666969353734353309
-616669693537343534096166696935373435350961666969353734353609616669693537
-343537096166696935373435380961666969353733393209616669693537333933096166
-696935373339340961666969353733393509616669693537333936096166696935373339
-370961666969353733393809616669693537333939096166696935373430300961666969
-353734303109616669693537333831096166696935373436310961666969363331363709
-616669693537343539096166696935373534330961666969353735333409616669693537
-343934096166696936323834330961666969363238343409616669693632383435096166
-696936343234300961666969363432343109616669693633393534096166696935373338
-320961666969363432343209616669693632383831096166696935373530340961666969
-353733363909616669693537333730096166696935373337310961666969353733373209
-616669693537333733096166696935373337340961666969353733373509616669693537
-333931096166696935373437310961666969353734363009616669693532323538096166
-696935373530360961666969363239353809616669693632393536096166696935323935
-370961666969353735303509616669693632383839096166696936323838370961666969
-363238383809616669693537353037096166696936323936310961666969363239353909
-616669693632393630096166696935373530380961666969363239363209616669693537
-353637096166696936323936340961666969353233303509616669693532333036096166
-696935373530390961666969363239363709616669693632393635096166696936323936
-360961666969353735353509616669693532333634096166696936333735330961666969
-363337353409616669693633373539096166696936333736330961666969363337393509
-616669693632383931096166696936333830380961666969363239333809616669693633
-383130096166696936323934320961666969363239343709616669693633383133096166
-696936333832330961666969363338323409616669693633383333096166696936333834
-340961666969363238383209616669693632383833096166696936323838340961666969
-363238383509616669693632383836094F646F7462656C6F77096F646F7462656C6F770A
-4F686F6F6B61626F76650A6F686F6F6B61626F7665104F63697263756D666C6578616375
-7465106F63697263756D666C65786163757465104F63697263756D666C65786772617665
-106F63697263756D666C65786772617665144F63697263756D666C6578686F6F6B61626F
-7665146F63697263756D666C6578686F6F6B61626F7665104F63697263756D666C657874
-696C6465106F63697263756D666C657874696C6465134F63697263756D666C6578646F74
-62656C6F77136F63697263756D666C6578646F7462656C6F770A4F686F726E6163757465
-0A6F686F726E61637574650A4F686F726E67726176650A6F686F726E67726176650E4F68
-6F726E686F6F6B61626F76650E6F686F726E686F6F6B61626F76650A4F686F726E74696C
-64650A6F686F726E74696C64650D4F686F726E646F7462656C6F770D6F686F726E646F74
-62656C6F770955646F7462656C6F770975646F7462656C6F770A55686F6F6B61626F7665>
-<0A75686F6F6B61626F76650A55686F726E61637574650A75686F726E61637574650A5568
-6F726E67726176650A75686F726E67726176650E55686F726E686F6F6B61626F76650E75
-686F726E686F6F6B61626F76650A55686F726E74696C64650A75686F726E74696C64650D
-55686F726E646F7462656C6F770D75686F726E646F7462656C6F7708676C797068383832
-08676C7970683838330959646F7462656C6F770979646F7462656C6F770A59686F6F6B61
-626F76650A79686F6F6B61626F7665065974696C6465067974696C646504646F6E670974
-696C6465636F6D620863757272656E63790000000000000100000C92000102160C000009
-0084000400B4FF9C000400B6FF9C000A0024FF9C000A0090FF9C000F00B4FF2E000F00B6
-FF2E00100024FFCE0010002CFFE20010002DFF9C00100036FFEC00100037FF6A00100039
-FFCE0010003AFFCE0010003BFFB00010003CFF740010003DFFE200100044FFEC00100059
-FFD80010005AFFEC0010005BFFCE0010005CFFD80010005DFFD800100090FFCE001000A0
-FFEC0011000FFF7E00110010FF60001100B1FF88001100B2FF88001100B4FF2E001100B6
-FF2E001D00B2FF7400240010FFCE00240036FFF600240037FF8800240038FFF600240039
-FFC40024003AFFCE0024003CFFB000240057FFEC00240058FFF600240059FFCE0024005A
-FFE20024005CFFCE002400B1FFCE002400B2FFCE002400B3FFCE002400B4FF88002400B5
-FFCE002400B6FF880025000FFFEC00250010000A00250011FFEC00250037FFC4002500AB
-FFEC002500B1000A002500B2000A00260010FFCE002600AFFFE7002600B1FFCE002600B2
-FFCE0027000FFFCE00270011FFCE00270037FFCE0027003AFFEC0027003BFFF60027003C
-FFEC0027003DFFEC002700ABFFCE0029000FFED400290011FED40029001DFFC40029001E
-FFC400290022003C00290024FF9C00290037001E00290044FF9C00290048FFCE00290052
-FFCE00290090FF92002900A0FF9C002900A1FFCE002900ABFED4002900B0FFCE002C0010
-FFE2002C00B1FFE2002C00B2FFE2002D000FFFEC002D0011FFEC002D0024FFF6002D0090
-FFF6002D00ABFFEC002E0010FF92002E0032FFEC002E0044FFC4002E0048FFBA002E0052
-FFBA002E0058FFCE002E0059FFB0002E005AFFBA002E005CFFB0002E0091FFEC002E00A0
-FFC4002E00A1FFBA002E00AFFFEC002E00B0FFBA002E00B1FF92002E00B2FF92002F000A
-FF88002F0010FF60002F0026FFEC002F002AFFEC002F002D0064002F0032FFEC002F0037
-FF56002F0039FF92002F003AFF9C002F003CFF60002F0059FF92002F005CFF92002F0064
-FFEC002F0091FFEC002F00AFFFEC002F00B1FF60002F00B2FF60002F00B4FF60002F00B6
-FF600032000FFFE200320011FFE200320037FFCE0032003BFFF60032003CFFEC0032003D
-FFEC003200ABFFE20033000FFED400330011FED400330024FFCE0033003C001400330044
-FFCE00330048FFCE00330052FFCE00330090FFBA003300A0FFCE003300A1FFCE003300AB
-FED4003300B0FFCE0034000FFFE200340011FFE2003400ABFFE200350010FF9C00350037
-FFC40035003CFFEC00350044FFD800350048FFCE00350052FFCE00350058FFEC0035005C
-FFC9003500A0FFCE003500A1FFCE003500B0FFC4003500B1FF9C003500B2FF9C003500B4
-FFBA003500B6FFBA0036000FFFEC00360011FFEC00360024FFEC00360036FFEA00360059
-FFE20036005AFFEC0036005CFFE200360090FFEC003600ABFFEC0037000FFEDE00370010
-FF6A00370011FEDE0037001DFF380037001EFF3800370022003C00370024FF8800370026
-FFD80037002AFFD800370032FFCE00370036FFF400370037FFBA00370044FF1000370046
-FF2400370048FF240037004AFF2E00370052FF2400370055FF3800370056FF4C00370058
-FF3800370059FF380037005AFF380037005CFF380037005DFF5600370064FFD800370090
-FF7E00370091FFCE003700A0FF10003700A1FF24003700ABFEDE003700AFFFCE003700B0
-FF24003700B1FF6A003700B2FF6A0038000FFFEC00380011FFEC00380024FFF600380090
-FFEC003800ABFFEC0039000FFEDE00390010FFCE00390011FEDE0039001DFFB00039001E
-FFB000390024FFC400390044FF9C00390048FF9C00390052FF9C00390058FFC40039005C
-FFBF00390090FFBA003900A0FF9C003900A1FF9C003900ABFEDE003900B0FF9C003900B1
-FFCE003900B2FFCE003A000FFEDE003A0010FFCE003A0011FF24003A001DFFB0003A001E
-FFB0003A0024FFCE003A0044FF9C003A0048FF9C003A0052FF9C003A0055FFC4003A0058
-FFC4003A005CFFBF003A0090FFC4003A00A0FF9C003A00A1FF9C003A00ABFF24003A00B0
-FF9C003A00B1FFCE003A00B2FFCE003B0010FFB0003B0026FFF6003B002AFFF6003B0032
-FFF6003B0044FFCE003B0048FFC4003B0052FFC4003B0058FFE2003B005CFFB0003B0064
-FFF6003B0091FFF6003B00A0FFCE003B00A1FFC4003B00AFFFF6003B00B0FFC4003B00B1
-FFB0003B00B2FFB0003C000FFEDE003C0010FF74003C0011FEDE003C001DFF38003C001E
-FF38003C0024FFB0003C0032FFEC003C0044FF74003C0047FF88003C0048FF7E003C004A
-FF7E003C0050FF9C003C0051FF9C003C0052FF7E003C0053FF9C003C0054FF7E003C0055
-FF9C003C0056FF92003C0058FF92003C0059FF9C003C0090FFB0003C0091FFEC003C00A0
-FF74003C00A1FF7E003C00ABFEDE003C00AFFFEC003C00B0FF7E003C00B1FF74003C00B2
-FF74003D0010FFC4003D0026FFEC003D002AFFEC003D0032FFEC003D003DFFF6003D0044
-FFCE003D0048FFC4003D0052FFC4003D005AFFD8003D005CFFBF003D0064FFEC003D0091
-FFEC003D00A0FFCE003D00A1FFC4003D00AFFFEC003D00B0FFC4003D00B1FFCE003D00B2
-FFCE00440059FFF00044005AFFF60044005CFFF00045000FFFE200450011FFEC0045005C
-FFFB004500ABFFEC00460010FFEC00460037FFC4004600B1FFEC004600B2FFEC00480037
-FF7400490005003C0049000A003C0049000C00640049000D00320049000FFF7E00490010
-FFCE00490011FF8800490022006E0049003F00640049004000640049005CFFF600490060
-0064004900ABFF88004900B1FFCE004900B2FFCE004900B40032004900B60032004B0059
-FFEC004B005AFFF6004B005CFFEC004E0010FF9C004E0048FFEC004E0052FFEC004E00A1
-FFEC004E00B0FFEC004E00B1FF9C004E00B2FF9C00500059FFEC0050005AFFF60050005C
-FFEC00510059FFEC0051005AFFF60051005CFFEC0052000FFFE200520011FFEC00520059
-FFF10052005BFFEC0052005CFFF1005200ABFFEC0053000FFFE200530011FFEC0053005C
-FFFB005300ABFFEC0055000FFEDE00550010FFEC00550011FEDE00550044FFDC005500A0
-FFD8005500ABFEDE005500B1FFEC005500B2FFEC005500B4001E005500B6001E00570010
-FFD80057005CFFF6005700B1FFD8005700B2FFD8005700B40014005700B600140059000F
-FF4C00590010FFD800590011FF4C00590044FFD800590048FFEE00590052FFEE005900A0
-FFD8005900A1FFEE005900ABFF4C005900B0FFF1005900B1FFD8005900B2FFD8005A000F
-FFBA005A0010FFEC005A0011FFBA005A0044FFEC005A00A0FFEC005A00ABFFBA005A00B1
-FFEC005A00B2FFEC005B0010FFCE005B0046FFEC005B0047FFF6005B0048FFE8005B004A
-FFF6005B0052FFE8005B006FFFEC005B00A1FFE8005B00B0FFEC005B00B1FFCE005B00B2
-FFCE005C000FFF42005C0010FFD8005C0011FF42005C0044FFD8005C0046FFEE005C0047
-FFF6005C0048FFEE005C004AFFF6005C0052FFEE005C0054FFF6005C006FFFEE005C00A0
-FFD8005C00A1FFEE005C00ABFF4C005C00B0FFF1005C00B1FFD8005C00B2FFD8005D0010
-FFEC005D0046FFF6005D0047FFF6005D0048FFF4005D004AFFF6005D0052FFF4005D0054
-FFF6005D006FFFF6005D00A1FFF4005D00B1FFEC005D00B2FFEC00640010FFCE006400AF
-FFE7006400B1FFCE006400B2FFCE006F0010FFEC006F00B1FFEC006F00B2FFEC0091000F
-FFE200910011FFE200910037FFCE0091003BFFF60091003CFFEC0091003DFFEC009100AB
-FFE200A1000FFFE200A10011FFEC00A10059FFF100A1005BFFEC00A1005CFFF100A100AB
-FFEC00AB00B4FF2E00AB00B6FF2E00B10024FFCE00B1002CFFE200B1002DFF9C00B10036
-FFEC00B10037FF6A00B10039FFCE00B1003AFFCE00B1003BFFB000B1003CFF7400B1003D
-FFF600B10044FFEC00B10059FFD800B1005AFFEC00B1005BFFCE00B1005CFFD800B1005D
-FFD800B10090FFCE00B100A0FFEC00B20024FFCE00B2002CFFE200B2002DFF9C00B20036
-FFEC00B20037FF6A00B20039FFCE00B2003AFFCE00B2003BFFB000B2003CFF7400B2003D
-FFF600B20044FFEC00B20059FFD800B2005AFFEC00B2005BFFCE00B2005CFFD800B2005D
-FFD800B20090FFCE00B200A0FFEC00B30024FF9C00B30090FF9C00B4000FFF2E00B40011
-FF2E00B40024FF9C00B40037006E00B40039006400B4003A003C00B4003C006E00B40056
-FFBA00B40057002800B40090FF9C00B400ABFF2E00B50024FF9C00B50090FF9C00B6000F
-FF2E00B60011FF2E00B60024FF9C00B60037006E00B60039006400B6003A003C00B6003C
-006E00B60056FFBA00B60057002800B60090FF9C00B600ABFF2E00C30037FF2E00C30039
-FF2E00C3003AFF9C00C3003CFF2E00C40037FF2E00C40039FF2E00C4003AFF9C00C4003C
-FF2E0000000000010001000100000001000013FF0000001400000000000013F7308213F3
-06092A864886F70D010702A08213E4308213E0020101310E300C06082A864886F70D0205
-05003060060A2B060104018237020104A0523050302C060A2B06010401823702011CA21E
-801C003C003C003C004F00620073006F006C006500740065003E003E003E3020300C0608
-2A864886F70D020505000410503EEC935CE1D8D33511E69A791E4594A0820F3F308202C0
-3082022902141389B4D18AE8A7C4BD35C79B8D88CA1FCA535691300D06092A864886F70D
-010104050030819E311F301D060355040A1316566572695369676E205472757374204E65
-74776F726B31173015060355040B130E566572695369676E2C20496E632E312C302A0603
-55040B1323566572695369676E2054696D65205374616D70696E67205365727669636520
-526F6F7431343032060355040B132B4E4F204C494142494C495459204143434550544544
-2C20286329393720566572695369676E2C20496E632E301E170D39373035313230373030
-30305A170D3939313233313037303030305A30819E311F301D060355040A131656657269
-5369676E205472757374204E6574776F726B31173015060355040B130E56657269536967
-6E2C20496E632E312C302A060355040B1323566572695369676E2054696D65205374616D
-70696E67205365727669636520526F6F7431343032060355040B132B4E4F204C49414249
-4C4954592041434345505445442C20286329393720566572695369676E2C20496E632E30
-819F300D06092A864886F70D010101050003818D0030818902818100D32E20F0687C2C2D
-2E811CB106B2A70BB7110D57DA53D875E3C9332AB2D4F6095B34F3E990FE090CD0DB1B5A
-B9CDE7F688B19DC08725EB7D5810736A78CB7115FDC658F629AB585E9604FD2D62115881
-1CCA7194D522582FD5CC14058436BA94AAB44D4AE9EE3B22AD56997E219C6C86C04A4797
-6AB4A636D5FC092DD3B4399B0203010001300D06092A864886F70D010104050003818100
-3A119C85053ED2E980FB7BD5A9F4AC79FC05FC953D7123A92B28DF8C136589FE2C87018F
-5A9A62CA11A780F4B7BE14B7D156996B086245C6A2A5DA357F0522DE722D048605A77C09
-16931443F0F7164DD6078E9B106C58FE0A3597CA899FDF04709C2A7D618EC1E80B719AA8
-C76662423D959422329822898AFA640824F5D2FA308202CD30820236021500BD119ADA43
-ED21FB46588489CA46889025EE1460300D06092A864886F70D010104050030819E311F30
-1D060355040A1316566572695369676E205472757374204E6574776F726B311730150603
-55040B130E566572695369676E2C20496E632E312C302A060355040B1323566572695369
-676E2054696D65205374616D70696E67205365727669636520526F6F7431343032060355
-040B132B4E4F204C494142494C4954592041434345505445442C20286329393720566572
-695369676E2C20496E632E301E170D3937303531323037303030305A170D393931323331
-3037303030305A3081AC31273025060355040B131E566572695369676E2054696D652053
-74616D70696E672053657276696365311F301D060355040B1316566572695369676E2054
-72757374204E6574776F726B31343032060355040B132B4E4F204C494142494C49545920
-41434345505445442C20286329393720566572695369676E2C20496E632E311730150603
-55040A130E566572695369676E2C20496E632E3111300F06035504071308496E7465726E
-657430819D300D06092A864886F70D010101050003818B0030818702818100AB61EDB4AD
-8D904790DCB4115E69DC0A7F62900631CDCEFF889146D7493A94E9D4063F9DADA2785AEC
-F9FC63454FB80B6E30EFA236AB2D09DFF16F27AB0D516005354F7FCE544FD0B72C42D80B
-D08DB85EFFB680D0E396B47F224942106CD398B00156A3C3CF2E9F3AF47FA858A6D72265
-E58CAB789CBCD94742685B2D7DFDB5020103300D06092A864886F70D0101040500038181
-006D60FB995FA469B3D37B702B62231E442051AF2315C77402F949F2271A5CAC86713508
-2BF68FDEE0B596E88BA74BE373C848099DB0DA8BDA1592CA03E509255606E74EA447A5D1
-5746D43856F521CDC3263B2D2532CE9BE2BF4047EAD86D4776E5C030A30F80CE7FD83B7E
-A0F9952A312B15FAC814EDDDB0E9554170462D2C7E308209A63082090FA0030201020210
-7966966E83B0D0B601126E9DC0B46571300D06092A864886F70D01010205003061311130
-0F06035504071308496E7465726E657431173015060355040A130E566572695369676E2C
-20496E632E31333031060355040B132A566572695369676E20436F6D6D65726369616C20
-536F667477617265205075626C697368657273204341301E170D39383034313630303030
-30305A170D3939303431363233353935395A3082015D3111300F06035504071308496E74
-65726E657431173015060355040A130E566572695369676E2C20496E632E313330310603
-55040B132A566572695369676E20436F6D6D65726369616C20536F667477617265205075
-626C69736865727320434131463044060355040B133D7777772E766572697369676E2E63
-6F6D2F7265706F7369746F72792F43505320496E636F72702E206279205265662E2C4C49
-41422E4C54442863293936313E303C060355040B13354469676974616C20494420436C61
-73732033202D204D6963726F736F667420536F6674776172652056616C69646174696F6E
-207632310B3009060355040613025553311330110603550408130A57617368696E67746F
-6E3110300E060355040713075265646D6F6E64311E301C060355040314154D6963726F73
-6F667420436F72706F726174696F6E311E301C060355040B14154D6963726F736F667420
-436F72706F726174696F6E30820120300D06092A864886F70D01010105000382010D0030
-8201080282010100B490D226A864E6EB15C3FF6D7B414F0AF96F2A71CE2E1853A63236E0
-D468E135FD4912D896FC65CF531420BE04C97AF5C9706D94ECCCB3AF2A309A32587CB6A9
-6B256799C0E277EA05E5EFE396F7AD0B19A6AE3C8470E2F86F5C4F7D6F0F52458A15D765
-DC3B2005E33DA16C973A0E0B2513ED21CB208E397A628305C9231AFC529DAC9D4C96D73C
-4E583D827BEE093556B568C04245A23B31A3FBD895FB55C72CA8A3C3294FCEF493F0031F
-7BF1153AA9F8AA5083056D62F08B138838D9E31C0E73C10640BA28C3EBCD9271C7BE66B2
-A15422D60B677CF8877989AC660AAA51FAFD7221FC865DC6F44A0EEC5861234DD0B13A64
-E0139E5EC8856D4C16AF3D07020103A38205DD308205D930090603551D1304023000300B
-0603551D0F0404030205A03081880603551D01048180307E80107B96E4D143FD6898F338
-CC6E3BF20B82A16330613111300F06035504071308496E7465726E657431173015060355
-040A130E566572695369676E2C20496E632E31333031060355040B132A56657269536967
-6E20436F6D6D65726369616C20536F667477617265205075626C69736865727320434182
-0502B400000130210603551D040101FF04173014300E300C060A2B060104018237020116
-0302078000300D0603551D0A040630040302064030820436060A2B06010401823702010A
-0101FF048204233082041FA029802768747470733A2F2F7777772E766572697369676E2E
-636F6D2F7265706F7369746F72792F435053A18203B8818203B454686973206365727469
-66696361746520696E636F72706F7261746573206279207265666572656E63652C20616E
-642069747320757365206973207374726963746C790A7375626A65637420746F2C207468
-6520566572695369676E2043657274696669636174696F6E205072616374696365205374
-6174656D656E742028435053290A76657273696F6E20312E302C20617661696C61626C65
-20696E2074686520566572695369676E207265706F7369746F72792061743A0A68747470
-733A2F2F7777772E766572697369676E2E636F6D3B20627920452D6D61696C2061742043
-50532D726571756573747340766572697369676E2E636F6D3B206F720A6279206D61696C
-20617420566572695369676E2C20496E632E2C203235393320436F617374204176652E2C
-204D6F756E7461696E20566965772C2043412039343034330A55534120436F7079726967
-6874202863293139393620566572695369676E2C20496E632E2020416C6C205269676874
-732052657365727665642E204345525441494E0A57415252414E5449455320444953434C
-41494D454420414E44204C494142494C495459204C494D495445442E0A0A5741524E494E
-473A2054484520555345204F462054484953204345525449464943415445204953205354
-524943544C59205355424A45435420544F205448450A564552495349474E204345525449
-4649434154494F4E2050524143544943452053544154454D454E542E2020544845204953
-5355494E4720415554484F524954590A444953434C41494D53204345525441494E20494D
-504C49454420414E4420455850524553532057415252414E544945532C20494E434C5544
-494E472057415252414E544945530A4F46204D45524348414E544142494C495459204F52
-204649544E45535320464F52204120504152544943554C415220505552504F53452C2041
-4E442057494C4C204E4F540A4245204C4941424C4520464F5220434F4E53455155454E54
-49414C2C2050554E49544956452C20414E44204345525441494E204F544845522044414D
-414745532E205345450A5448452043505320464F522044455441494C532E0A0A436F6E74
-656E7473206F662074686520566572695369676E2072656769737465726564206E6F6E76
-657269666965645375626A656374417474726962757465730A657874656E73696F6E2076
-616C7565207368616C6C206E6F7420626520636F6E736964657265642061732061636375
-7261746520696E666F726D6174696F6E0A76616C69646174656420627920746865204941
-2E0AA336803468747470733A2F2F7777772E766572697369676E2E636F6D2F7265706F73
-69746F72792F766572697369676E6C6F676F2E6769663081AF0603551D200481A7308030
-80060B6086480186F845010701013080302806082B06010505070201161C68747470733A
-2F2F7777772E766572697369676E2E636F6D2F435053306206082B060105050702023056
-3015160E566572695369676E2C20496E632E30030201011A3D566572695369676E277320
-43505320696E636F72702E206279207265666572656E6365206C6961622E206C74642E20
-286329393720566572695369676E0000000000003016060A2B06010401823702011B0408
-30060101FF0101FF300D06092A864886F70D010102050003818100954CA27955DA745C8B
-25C2A620F06CB8B37B467B9E9F7ABA710648151265CC5D29F8513B8971B1F4143878DA8F
-AE0B8036905D4897C500380A53BF4037FF8A13276D004734F7484C2E72F2C6D37EFD446F
-228FD1929FE394EDE7FF00C9C2EE721CD99C036EB6C1637B3278443B9E858AFB84863728
-2EE7A638373EBAFCF382233182042430820420020101307530613111300F060355040713
-08496E7465726E657431173015060355040A130E566572695369676E2C20496E632E3133
-3031060355040B132A566572695369676E20436F6D6D65726369616C20536F6674776172
-65205075626C69736865727320434102107966966E83B0D0B601126E9DC0B46571300C06
-082A864886F70D02050500A081AE301906092A864886F70D010903310C060A2B06010401
-8237020104301C060A2B06010401823702010B310E300C060A2B06010401823702011630
-1F06092A864886F70D010904311204105BA6237427F8290EF09CCF5B63F749F83052060A
-2B06010401823702010C31443042A01A801800560065007200640061006E006100200046
-006F006E0074A1248022687474703A2F2F7777772E6D6963726F736F66742E636F6D2F74
-727565747970652F300D06092A864886F70D0101010500048201003EFBA519B6A00C823F
-B823EA3A1E5E6EBDBBF2C647D1F1093C66910B72FEA26B78E409E7750E62A559DAAC12F7
-CCA36B0725F8BB2E0409AEE1156BE3736F46D1B116DF2B18ABCF394DCF0EF8EE01A758E5
-E4872882FFDD5F04C39F3258358C3DE27BE8FC410AC11736DD19609E3BACBB2257C5E4A4
-836F811D07EC80DAB42FE9AC33537823FA2AC0D406166130C356085818B3CEC8A53763BF
-88191B4E52ED790B57C924CEA670505AA2621C1121663215F15D1A9E89A6BC2AA35F5B1F
-86E4FDEC2280203A57D736DD2C29A4D2D29F00BAF260927AB3B36EF1C4CC5100CAC54BAA
-0AFB74D0101FBEC53815E46B3814DF7E5DFC4A121257608F59AA76D5F333A3A18201D030
-8201CC06092A864886F70D010906318201BD308201B90201013081B830819E311F301D06
-0355040A1316566572695369676E205472757374204E6574776F726B3117301506035504
-0B130E566572695369676E2C20496E632E312C302A060355040B1323566572695369676E
-2054696D65205374616D70696E67205365727669636520526F6F7431343032060355040B
-132B4E4F204C494142494C4954592041434345505445442C202863293937205665726953
-69676E2C20496E632E021500BD119ADA43ED21FB46588489CA46889025EE1460300C0608
-2A864886F70D02050500A059301806092A864886F70D010903310B06092A864886F70D01
-0701301C06092A864886F70D010905310F170D3938313131323135313835305A301F0609
-2A864886F70D01090431120410641EED59DAFC3103655C9A2A4309D288300D06092A8648
-86F70D01010105000481809092A6C858A52E216E3E56A1C40477C3C63030D247298EF8EA
-BFA1C4D5DDE8C375555276DDBB2761ADFC914D772AD331C04DDD675B9736F7D136CAA72D
-41CF9F8377C51611E0D1B6EDD8C5AB73694109FD5312908B17319E96C22CCEDD65C9D342
-DC0E3B159C36E0FDA54B21C8DD968B90621C263E94F737AC1997B9D84E517C0000>
-] def
-/CharStrings 893 dict dup begin
-/.notdef 0 def /.null 1 def /nonmarkingreturn 2 def /space 3 def /exclam 4 def
-/quotedbl 5 def /numbersign 6 def /dollar 7 def /percent 8 def
-/ampersand 9 def /quotesingle 10 def /parenleft 11 def /parenright 12 def
-/asterisk 13 def /plus 14 def /comma 15 def /hyphen 16 def
-/period 17 def /slash 18 def /zero 19 def /one 20 def
-/two 21 def /three 22 def /four 23 def /five 24 def
-/six 25 def /seven 26 def /eight 27 def /nine 28 def
-/colon 29 def /semicolon 30 def /less 31 def /equal 32 def
-/greater 33 def /question 34 def /at 35 def /A 36 def
-/B 37 def /C 38 def /D 39 def /E 40 def
-/F 41 def /G 42 def /H 43 def /I 44 def
-/J 45 def /K 46 def /L 47 def /M 48 def
-/N 49 def /O 50 def /P 51 def /Q 52 def
-/R 53 def /S 54 def /T 55 def /U 56 def
-/V 57 def /W 58 def /X 59 def /Y 60 def
-/Z 61 def /bracketleft 62 def /backslash 63 def /bracketright 64 def
-/asciicircum 65 def /underscore 66 def /grave 67 def /a 68 def
-/b 69 def /c 70 def /d 71 def /e 72 def
-/f 73 def /g 74 def /h 75 def /i 76 def
-/j 77 def /k 78 def /l 79 def /m 80 def
-/n 81 def /o 82 def /p 83 def /q 84 def
-/r 85 def /s 86 def /t 87 def /u 88 def
-/v 89 def /w 90 def /x 91 def /y 92 def
-/z 93 def /braceleft 94 def /bar 95 def /braceright 96 def
-/asciitilde 97 def /Adieresis 98 def /Aring 99 def /Ccedilla 100 def
-/Eacute 101 def /Ntilde 102 def /Odieresis 103 def /Udieresis 104 def
-/aacute 105 def /agrave 106 def /acircumflex 107 def /adieresis 108 def
-/atilde 109 def /aring 110 def /ccedilla 111 def /eacute 112 def
-/egrave 113 def /ecircumflex 114 def /edieresis 115 def /iacute 116 def
-/igrave 117 def /icircumflex 118 def /idieresis 119 def /ntilde 120 def
-/oacute 121 def /ograve 122 def /ocircumflex 123 def /odieresis 124 def
-/otilde 125 def /uacute 126 def /ugrave 127 def /ucircumflex 128 def
-/udieresis 129 def /dagger 130 def /degree 131 def /cent 132 def
-/sterling 133 def /section 134 def /bullet 135 def /paragraph 136 def
-/germandbls 137 def /registered 138 def /copyright 139 def /trademark 140 def
-/acute 141 def /dieresis 142 def /notequal 143 def /AE 144 def
-/Oslash 145 def /infinity 146 def /plusminus 147 def /lessequal 148 def
-/greaterequal 149 def /yen 150 def /mu1 151 def /partialdiff 152 def
-/summation 153 def /product 154 def /pi1 155 def /integral 156 def
-/ordfeminine 157 def /ordmasculine 158 def /Ohm 159 def /ae 160 def
-/oslash 161 def /questiondown 162 def /exclamdown 163 def /logicalnot 164 def
-/radical 165 def /florin 166 def /approxequal 167 def /increment 168 def
-/guillemotleft 169 def /guillemotright 170 def /ellipsis 171 def /Agrave 172 def
-/Atilde 173 def /Otilde 174 def /OE 175 def /oe 176 def
-/endash 177 def /emdash 178 def /quotedblleft 179 def /quotedblright 180 def
-/quoteleft 181 def /quoteright 182 def /divide 183 def /lozenge 184 def
-/ydieresis 185 def /Ydieresis 186 def /fraction 187 def /Euro 188 def
-/guilsinglleft 189 def /guilsinglright 190 def /fi 191 def /fl 192 def
-/daggerdbl 193 def /periodcentered 194 def /quotesinglbase 195 def /quotedblbase 196 def
-/perthousand 197 def /Acircumflex 198 def /Ecircumflex 199 def /Aacute 200 def
-/Edieresis 201 def /Egrave 202 def /Iacute 203 def /Icircumflex 204 def
-/Idieresis 205 def /Igrave 206 def /Oacute 207 def /Ocircumflex 208 def
-/Ograve 209 def /Uacute 210 def /Ucircumflex 211 def /Ugrave 212 def
-/dotlessi 213 def /circumflex 214 def /tilde 215 def /macron 216 def
-/breve 217 def /dotaccent 218 def /ring 219 def /cedilla 220 def
-/hungarumlaut 221 def /ogonek 222 def /caron 223 def /Lslash 224 def
-/lslash 225 def /Scaron 226 def /scaron 227 def /Zcaron 228 def
-/zcaron 229 def /brokenbar 230 def /Eth 231 def /eth 232 def
-/Yacute 233 def /yacute 234 def /Thorn 235 def /thorn 236 def
-/minus 237 def /multiply 238 def /onesuperior 239 def /twosuperior 240 def
-/threesuperior 241 def /onehalf 242 def /onequarter 243 def /threequarters 244 def
-/franc 245 def /Gbreve 246 def /gbreve 247 def /Idot 248 def
-/Scedilla 249 def /scedilla 250 def /Cacute 251 def /cacute 252 def
-/Ccaron 253 def /ccaron 254 def /dmacron 255 def /overscore 256 def
-/middot 257 def /Abreve 258 def /abreve 259 def /Aogonek 260 def
-/aogonek 261 def /Dcaron 262 def /dcaron 263 def /Dslash 264 def
-/Eogonek 265 def /eogonek 266 def /Ecaron 267 def /ecaron 268 def
-/Lacute 269 def /lacute 270 def /Lcaron 271 def /lcaron 272 def
-/Ldot 273 def /ldot 274 def /Nacute 275 def /nacute 276 def
-/Ncaron 277 def /ncaron 278 def /Odblacute 279 def /odblacute 280 def
-/Racute 281 def /racute 282 def /Rcaron 283 def /rcaron 284 def
-/Sacute 285 def /sacute 286 def /Tcedilla 287 def /tcedilla 288 def
-/Tcaron 289 def /tcaron 290 def /Uring 291 def /uring 292 def
-/Udblacute 293 def /udblacute 294 def /Zacute 295 def /zacute 296 def
-/Zdot 297 def /zdot 298 def /Gamma 299 def /Theta 300 def
-/Phi 301 def /alpha 302 def /delta 303 def /epsilon 304 def
-/sigma 305 def /tau 306 def /phi 307 def /underscoredbl 308 def
-/exclamdbl 309 def /nsuperior 310 def /peseta 311 def /IJ 312 def
-/ij 313 def /napostrophe 314 def /minute 315 def /second 316 def
-/afii61248 317 def /afii61289 318 def /H22073 319 def /H18543 320 def
-/H18551 321 def /H18533 322 def /openbullet 323 def /Amacron 324 def
-/amacron 325 def /Ccircumflex 326 def /ccircumflex 327 def /Cdot 328 def
-/cdot 329 def /Emacron 330 def /emacron 331 def /Ebreve 332 def
-/ebreve 333 def /Edot 334 def /edot 335 def /Gcircumflex 336 def
-/gcircumflex 337 def /Gdot 338 def /gdot 339 def /Gcedilla 340 def
-/gcedilla 341 def /Hcircumflex 342 def /hcircumflex 343 def /Hbar 344 def
-/hbar 345 def /Itilde 346 def /itilde 347 def /Imacron 348 def
-/imacron 349 def /Ibreve 350 def /ibreve 351 def /Iogonek 352 def
-/iogonek 353 def /Jcircumflex 354 def /jcircumflex 355 def /Kcedilla 356 def
-/kcedilla 357 def /kgreenlandic 358 def /Lcedilla 359 def /lcedilla 360 def
-/Ncedilla 361 def /ncedilla 362 def /Eng 363 def /eng 364 def
-/Omacron 365 def /omacron 366 def /Obreve 367 def /obreve 368 def
-/Rcedilla 369 def /rcedilla 370 def /Scircumflex 371 def /scircumflex 372 def
-/Tbar 373 def /tbar 374 def /Utilde 375 def /utilde 376 def
-/Umacron 377 def /umacron 378 def /Ubreve 379 def /ubreve 380 def
-/Uogonek 381 def /uogonek 382 def /Wcircumflex 383 def /wcircumflex 384 def
-/Ycircumflex 385 def /ycircumflex 386 def /longs 387 def /Aringacute 388 def
-/aringacute 389 def /AEacute 390 def /aeacute 391 def /Oslashacute 392 def
-/oslashacute 393 def /anoteleia 394 def /Wgrave 395 def /wgrave 396 def
-/Wacute 397 def /wacute 398 def /Wdieresis 399 def /wdieresis 400 def
-/Ygrave 401 def /ygrave 402 def /quotereversed 403 def /radicalex 404 def
-/afii08941 405 def /estimated 406 def /oneeighth 407 def /threeeighths 408 def
-/fiveeighths 409 def /seveneighths 410 def /commaaccent 411 def /undercommaaccent 412 def
-/tonos 413 def /dieresistonos 414 def /Alphatonos 415 def /Epsilontonos 416 def
-/Etatonos 417 def /Iotatonos 418 def /Omicrontonos 419 def /Upsilontonos 420 def
-/Omegatonos 421 def /iotadieresistonos 422 def /Alpha 423 def /Beta 424 def
-/Delta 425 def /Epsilon 426 def /Zeta 427 def /Eta 428 def
-/Iota 429 def /Kappa 430 def /Lambda 431 def /Mu 432 def
-/Nu 433 def /Xi 434 def /Omicron 435 def /Pi 436 def
-/Rho 437 def /Sigma 438 def /Tau 439 def /Upsilon 440 def
-/Chi 441 def /Psi 442 def /Omega 443 def /Iotadieresis 444 def
-/Upsilondieresis 445 def /alphatonos 446 def /epsilontonos 447 def /etatonos 448 def
-/iotatonos 449 def /upsilondieresistonos 450 def /beta 451 def /gamma 452 def
-/zeta 453 def /eta 454 def /theta 455 def /iota 456 def
-/kappa 457 def /lambda 458 def /mu 459 def /nu 460 def
-/xi 461 def /omicron 462 def /rho 463 def /sigma1 464 def
-/upsilon 465 def /chi 466 def /psi 467 def /omega 468 def
-/iotadieresis 469 def /upsilondieresis 470 def /omicrontonos 471 def /upsilontonos 472 def
-/omegatonos 473 def /afii10023 474 def /afii10051 475 def /afii10052 476 def
-/afii10053 477 def /afii10054 478 def /afii10055 479 def /afii10056 480 def
-/afii10057 481 def /afii10058 482 def /afii10059 483 def /afii10060 484 def
-/afii10061 485 def /afii10062 486 def /afii10145 487 def /afii10017 488 def
-/afii10018 489 def /afii10019 490 def /afii10020 491 def /afii10021 492 def
-/afii10022 493 def /afii10024 494 def /afii10025 495 def /afii10026 496 def
-/afii10027 497 def /afii10028 498 def /afii10029 499 def /afii10030 500 def
-/afii10031 501 def /afii10032 502 def /afii10033 503 def /afii10034 504 def
-/afii10035 505 def /afii10036 506 def /afii10037 507 def /afii10038 508 def
-/afii10039 509 def /afii10040 510 def /afii10041 511 def /afii10042 512 def
-/afii10043 513 def /afii10044 514 def /afii10045 515 def /afii10046 516 def
-/afii10047 517 def /afii10048 518 def /afii10049 519 def /afii10065 520 def
-/afii10066 521 def /afii10067 522 def /afii10068 523 def /afii10069 524 def
-/afii10070 525 def /afii10072 526 def /afii10073 527 def /afii10074 528 def
-/afii10075 529 def /afii10076 530 def /afii10077 531 def /afii10078 532 def
-/afii10079 533 def /afii10080 534 def /afii10081 535 def /afii10082 536 def
-/afii10083 537 def /afii10084 538 def /afii10085 539 def /afii10086 540 def
-/afii10087 541 def /afii10088 542 def /afii10089 543 def /afii10090 544 def
-/afii10091 545 def /afii10092 546 def /afii10093 547 def /afii10094 548 def
-/afii10095 549 def /afii10096 550 def /afii10097 551 def /afii10071 552 def
-/afii10099 553 def /afii10100 554 def /afii10101 555 def /afii10102 556 def
-/afii10103 557 def /afii10104 558 def /afii10105 559 def /afii10106 560 def
-/afii10107 561 def /afii10108 562 def /afii10109 563 def /afii10110 564 def
-/afii10193 565 def /afii10050 566 def /afii10098 567 def /afii00208 568 def
-/afii61352 569 def /pi 570 def /onenumerator 571 def /twonumerator 572 def
-/threenumerator 573 def /fournumerator 574 def /fivenumerator 575 def /sevennumerator 576 def
-/eightnumerator 577 def /DontCompressHTMX 578 def /glyph579 579 def /glyph580 580 def
-/glyph581 581 def /Ohorn 582 def /ohorn 583 def /Uhorn 584 def
-/uhorn 585 def /hookabovecomb 586 def /dotbelowcomb 587 def /gravecomb 588 def
-/acutecomb 589 def /glyph590 590 def /glyph591 591 def /glyph592 592 def
-/glyph593 593 def /glyph594 594 def /glyph595 595 def /glyph596 596 def
-/glyph597 597 def /glyph598 598 def /glyph599 599 def /glyph600 600 def
-/glyph601 601 def /glyph602 602 def /glyph603 603 def /glyph604 604 def
-/Adotbelow 605 def /adotbelow 606 def /Ahookabove 607 def /ahookabove 608 def
-/Acircumflexacute 609 def /acircumflexacute 610 def /Acircumflexgrave 611 def /acircumflexgrave 612 def
-/Acircumflexhookabove 613 def /acircumflexhookabove 614 def /Acircumflextilde 615 def /acircumflextilde 616 def
-/Acircumflexdotbelow 617 def /acircumflexdotbelow 618 def /Abreveacute 619 def /abreveacute 620 def
-/Abrevegrave 621 def /abrevegrave 622 def /Abrevehookabove 623 def /abrevehookabove 624 def
-/Abrevetilde 625 def /abrevetilde 626 def /Abrevedotbelow 627 def /abrevedotbelow 628 def
-/Edotbelow 629 def /edotbelow 630 def /Ehookabove 631 def /ehookabove 632 def
-/Etilde 633 def /etilde 634 def /Ecircumflexacute 635 def /ecircumflexacute 636 def
-/Ecircumflexgrave 637 def /ecircumflexgrave 638 def /Ecircumflexhookabove 639 def /ecircumflexhookabove 640 def
-/Ecircumflextilde 641 def /ecircumflextilde 642 def /Ecircumflexdotbelow 643 def /ecircumflexdotbelow 644 def
-/Ihookabove 645 def /ihookabove 646 def /Idotbelow 647 def /idotbelow 648 def
-/glyph649 649 def /glyph650 650 def /glyph651 651 def /glyph652 652 def
-/sheva 653 def /hatafsegol 654 def /hatafpatah 655 def /hatafqamats 656 def
-/hiriq 657 def /tsere 658 def /segol 659 def /patah 660 def
-/qamats 661 def /holam 662 def /qubuts 663 def /dagesh 664 def
-/meteg 665 def /maqaf 666 def /rafe 667 def /paseq 668 def
-/shindot 669 def /sindot 670 def /sofpasuq 671 def /alef 672 def
-/bet 673 def /gimel 674 def /dalet 675 def /he 676 def
-/vav 677 def /zayin 678 def /het 679 def /tet 680 def
-/yod 681 def /finalkaf 682 def /kaf 683 def /lamed 684 def
-/finalmem 685 def /mem 686 def /finalnun 687 def /nun 688 def
-/samekh 689 def /ayin 690 def /finalpe 691 def /pe 692 def
-/finaltsadi 693 def /tsadi 694 def /qof 695 def /resh 696 def
-/shin 697 def /tav 698 def /doublevav 699 def /vavyod 700 def
-/doubleyod 701 def /geresh 702 def /gershayim 703 def /newsheqelsign 704 def
-/vavshindot 705 def /finalkafsheva 706 def /finalkafqamats 707 def /lamedholam 708 def
-/lamedholamdagesh 709 def /altayin 710 def /shinshindot 711 def /shinsindot 712 def
-/shindageshshindot 713 def /shindageshsindot 714 def /alefpatah 715 def /alefqamats 716 def
-/alefmapiq 717 def /betdagesh 718 def /gimeldagesh 719 def /daletdagesh 720 def
-/hedagesh 721 def /vavdagesh 722 def /zayindagesh 723 def /tetdagesh 724 def
-/yoddagesh 725 def /finalkafdagesh 726 def /kafdagesh 727 def /lameddagesh 728 def
-/memdagesh 729 def /nundagesh 730 def /samekhdagesh 731 def /finalpedagesh 732 def
-/pedagesh 733 def /tsadidagesh 734 def /qofdagesh 735 def /reshdagesh 736 def
-/shindagesh 737 def /tavdages 738 def /vavholam 739 def /betrafe 740 def
-/kafrafe 741 def /perafe 742 def /aleflamed 743 def /zerowidthnonjoiner 744 def
-/zerowidthjoiner 745 def /lefttorightmark 746 def /righttoleftmark 747 def /afii57388 748 def
-/afii57403 749 def /afii57407 750 def /afii57409 751 def /afii57440 752 def
-/afii57451 753 def /afii57452 754 def /afii57453 755 def /afii57454 756 def
-/afii57455 757 def /afii57456 758 def /afii57457 759 def /afii57458 760 def
-/afii57392 761 def /afii57393 762 def /afii57394 763 def /afii57395 764 def
-/afii57396 765 def /afii57397 766 def /afii57398 767 def /afii57399 768 def
-/afii57400 769 def /afii57401 770 def /afii57381 771 def /afii57461 772 def
-/afii63167 773 def /afii57459 774 def /afii57543 775 def /afii57534 776 def
-/afii57494 777 def /afii62843 778 def /afii62844 779 def /afii62845 780 def
-/afii64240 781 def /afii64241 782 def /afii63954 783 def /afii57382 784 def
-/afii64242 785 def /afii62881 786 def /afii57504 787 def /afii57369 788 def
-/afii57370 789 def /afii57371 790 def /afii57372 791 def /afii57373 792 def
-/afii57374 793 def /afii57375 794 def /afii57391 795 def /afii57471 796 def
-/afii57460 797 def /afii52258 798 def /afii57506 799 def /afii62958 800 def
-/afii62956 801 def /afii52957 802 def /afii57505 803 def /afii62889 804 def
-/afii62887 805 def /afii62888 806 def /afii57507 807 def /afii62961 808 def
-/afii62959 809 def /afii62960 810 def /afii57508 811 def /afii62962 812 def
-/afii57567 813 def /afii62964 814 def /afii52305 815 def /afii52306 816 def
-/afii57509 817 def /afii62967 818 def /afii62965 819 def /afii62966 820 def
-/afii57555 821 def /afii52364 822 def /afii63753 823 def /afii63754 824 def
-/afii63759 825 def /afii63763 826 def /afii63795 827 def /afii62891 828 def
-/afii63808 829 def /afii62938 830 def /afii63810 831 def /afii62942 832 def
-/afii62947 833 def /afii63813 834 def /afii63823 835 def /afii63824 836 def
-/afii63833 837 def /afii63844 838 def /afii62882 839 def /afii62883 840 def
-/afii62884 841 def /afii62885 842 def /afii62886 843 def /Odotbelow 844 def
-/odotbelow 845 def /Ohookabove 846 def /ohookabove 847 def /Ocircumflexacute 848 def
-/ocircumflexacute 849 def /Ocircumflexgrave 850 def /ocircumflexgrave 851 def /Ocircumflexhookabove 852 def
-/ocircumflexhookabove 853 def /Ocircumflextilde 854 def /ocircumflextilde 855 def /Ocircumflexdotbelow 856 def
-/ocircumflexdotbelow 857 def /Ohornacute 858 def /ohornacute 859 def /Ohorngrave 860 def
-/ohorngrave 861 def /Ohornhookabove 862 def /ohornhookabove 863 def /Ohorntilde 864 def
-/ohorntilde 865 def /Ohorndotbelow 866 def /ohorndotbelow 867 def /Udotbelow 868 def
-/udotbelow 869 def /Uhookabove 870 def /uhookabove 871 def /Uhornacute 872 def
-/uhornacute 873 def /Uhorngrave 874 def /uhorngrave 875 def /Uhornhookabove 876 def
-/uhornhookabove 877 def /Uhorntilde 878 def /uhorntilde 879 def /Uhorndotbelow 880 def
-/uhorndotbelow 881 def /glyph882 882 def /glyph883 883 def /Ydotbelow 884 def
-/ydotbelow 885 def /Yhookabove 886 def /yhookabove 887 def /Ytilde 888 def
-/ytilde 889 def /dong 890 def /tildecomb 891 def /currency 892 def
-
-end readonly def
-FontName currentdict end definefont pop
-%%EndFont
-%%EndProlog
-mpldict begin
-13.5 175.5 translate
-585 441 0 0 clipbox
-% polygon
-1.000 setgray
-1.000 setlinewidth
-0 setlinejoin
-2 setlinecap
-[] 0 setdash
-0 0 m
-0 441 l
-585 441 l
-585 0 l
-closepath
-gsave
-fill
-grestore
-stroke
-% polygon
-0.000 setgray
-73.125 44.1 m
-73.125 396.9 l
-526.5 396.9 l
-526.5 44.1 l
-closepath
-gsave
-1.000 setgray
-fill
-grestore
-stroke
-% draw_lines
-0.000 0.000 1.000 setrgbcolor
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 44.100 m
-82.192 44.625 l
-91.260 46.237 l
-100.328 49.043 l
-109.395 53.206 l
-118.463 58.937 l
-127.530 66.464 l
-136.597 76.012 l
-145.665 87.777 l
-154.733 101.897 l
-163.800 118.431 l
-172.868 137.336 l
-181.935 158.456 l
-191.002 181.511 l
-200.070 206.100 l
-209.138 231.707 l
-218.205 257.720 l
-227.273 283.450 l
-236.340 308.160 l
-245.408 331.100 l
-254.475 351.539 l
-263.543 368.804 l
-272.610 382.309 l
-281.678 391.584 l
-290.745 396.306 l
-299.812 396.306 l
-308.880 391.584 l
-317.948 382.309 l
-327.015 368.804 l
-336.083 351.539 l
-345.150 331.100 l
-354.218 308.160 l
-363.285 283.450 l
-372.353 257.720 l
-381.420 231.707 l
-390.488 206.100 l
-399.555 181.511 l
-408.623 158.456 l
-417.690 137.336 l
-426.758 118.431 l
-435.825 101.897 l
-444.893 87.777 l
-453.960 76.012 l
-463.028 66.464 l
-472.095 58.937 l
-481.163 53.206 l
-490.230 49.043 l
-499.298 46.237 l
-508.365 44.625 l
-517.433 44.100 l
-stroke
-grestore
-% draw_lines
-1.000 0.000 0.000 setrgbcolor
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 44.100 m
-82.192 58.500 l
-91.260 72.900 l
-100.328 87.300 l
-109.395 101.700 l
-118.463 116.100 l
-127.530 130.500 l
-136.597 144.900 l
-145.665 159.300 l
-154.733 173.700 l
-163.800 188.100 l
-172.868 202.500 l
-181.935 216.900 l
-191.002 231.300 l
-200.070 245.700 l
-209.138 260.100 l
-218.205 274.500 l
-227.273 288.900 l
-236.340 303.300 l
-245.408 317.700 l
-254.475 332.100 l
-263.543 346.500 l
-272.610 360.900 l
-281.678 375.300 l
-290.745 389.700 l
-299.812 389.700 l
-308.880 375.300 l
-317.948 360.900 l
-327.015 346.500 l
-336.083 332.100 l
-345.150 317.700 l
-354.218 303.300 l
-363.285 288.900 l
-372.353 274.500 l
-381.420 260.100 l
-390.488 245.700 l
-399.555 231.300 l
-408.623 216.900 l
-417.690 202.500 l
-426.758 188.100 l
-435.825 173.700 l
-444.893 159.300 l
-453.960 144.900 l
-463.028 130.500 l
-472.095 116.100 l
-481.163 101.700 l
-490.230 87.300 l
-499.298 72.900 l
-508.365 58.500 l
-517.433 44.100 l
-stroke
-grestore
-% draw_lines
-0.000 0.500 0.000 setrgbcolor
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 44.100 m
-82.192 45.548 l
-91.260 49.869 l
-100.328 56.992 l
-109.395 66.799 l
-118.463 79.131 l
-127.530 93.783 l
-136.597 110.516 l
-145.665 129.056 l
-154.733 149.096 l
-163.800 170.309 l
-172.868 192.347 l
-181.935 214.846 l
-191.002 237.438 l
-200.070 259.753 l
-209.138 281.422 l
-218.205 302.092 l
-227.273 321.421 l
-236.340 339.094 l
-245.408 354.819 l
-254.475 368.339 l
-263.543 379.431 l
-272.610 387.913 l
-281.678 393.647 l
-290.745 396.538 l
-299.812 396.538 l
-308.880 393.647 l
-317.948 387.913 l
-327.015 379.431 l
-336.083 368.339 l
-345.150 354.819 l
-354.218 339.094 l
-363.285 321.421 l
-372.353 302.092 l
-381.420 281.422 l
-390.488 259.753 l
-399.555 237.438 l
-408.623 214.846 l
-417.690 192.347 l
-426.758 170.309 l
-435.825 149.096 l
-444.893 129.056 l
-453.960 110.516 l
-463.028 93.783 l
-472.095 79.131 l
-481.163 66.799 l
-490.230 56.992 l
-499.298 49.869 l
-508.365 45.548 l
-517.433 44.100 l
-stroke
-grestore
-% draw_lines
-0.750 0.000 0.750 setrgbcolor
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 72.324 m
-82.192 73.656 l
-91.260 77.632 l
-100.328 84.185 l
-109.395 93.207 l
-118.463 104.552 l
-127.530 118.033 l
-136.597 133.427 l
-145.665 150.483 l
-154.733 168.921 l
-163.800 188.437 l
-172.868 208.711 l
-181.935 229.410 l
-191.002 250.195 l
-200.070 270.724 l
-209.138 290.661 l
-218.205 309.676 l
-227.273 327.460 l
-236.340 343.718 l
-245.408 358.186 l
-254.475 370.624 l
-263.543 380.828 l
-272.610 388.632 l
-281.678 393.907 l
-290.745 396.567 l
-299.812 396.567 l
-308.880 393.907 l
-317.948 388.632 l
-327.015 380.828 l
-336.083 370.624 l
-345.150 358.186 l
-354.218 343.718 l
-363.285 327.460 l
-372.353 309.676 l
-381.420 290.661 l
-390.488 270.724 l
-399.555 250.195 l
-408.623 229.410 l
-417.690 208.711 l
-426.758 188.437 l
-435.825 168.921 l
-444.893 150.483 l
-453.960 133.427 l
-463.028 118.033 l
-472.095 104.552 l
-481.163 93.207 l
-490.230 84.185 l
-499.298 77.632 l
-508.365 73.656 l
-517.433 72.324 l
-stroke
-grestore
-% text
-0.000 setgray
-/Verdana findfont
-18.000 scalefont
-setfont
-144.812 403.956 m
-0 4 rmoveto
-(Smoothing window in time-domain) show
-% text
-/Verdana findfont
-14.000 scalefont
-setfont
-69.469 30.1 m
-(0) show
-% line
-0.500 setlinewidth
-0 setlinecap
-163.800 44.100 m 163.800 48.100 l
-stroke
-% line
-163.800 392.900 m 163.800 396.900 l
-stroke
-% text
-155.769 30.1 m
-(10) show
-% line
-254.475 44.100 m 254.475 48.100 l
-stroke
-% line
-254.475 392.900 m 254.475 396.900 l
-stroke
-% text
-246.444 30.1 m
-(20) show
-% line
-345.150 44.100 m 345.150 48.100 l
-stroke
-% line
-345.150 392.900 m 345.150 396.900 l
-stroke
-% text
-337.619 30.1 m
-(30) show
-% line
-435.825 44.100 m 435.825 48.100 l
-stroke
-% line
-435.825 392.900 m 435.825 396.900 l
-stroke
-% text
-427.731 30.1 m
-(40) show
-% text
-518.844 30.1 m
-(50) show
-% text
-296.656 17.1 m
-(n) show
-% text
-47.812 39.1 m
-(0.0) show
-% line
-73.125 114.660 m 77.125 114.660 l
-stroke
-% line
-522.500 114.660 m 526.500 114.660 l
-stroke
-% text
-47.875 109.66 m
-(0.2) show
-% line
-73.125 185.220 m 77.125 185.220 l
-stroke
-% line
-522.500 185.220 m 526.500 185.220 l
-stroke
-% text
-47.125 180.22 m
-(0.4) show
-% line
-73.125 255.780 m 77.125 255.780 l
-stroke
-% line
-522.500 255.780 m 526.500 255.780 l
-stroke
-% text
-47.812 250.78 m
-(0.6) show
-% line
-73.125 326.340 m 77.125 326.340 l
-stroke
-% line
-522.500 326.340 m 526.500 326.340 l
-stroke
-% text
-47.797 321.34 m
-(0.8) show
-% text
-48.062 391.9 m
-(1.0) show
-% polygon
-1.000 setlinewidth
-2 setlinecap
-214.291 51.156 m
-214.291 161.736 l
-385.334 161.736 l
-385.334 51.156 l
-closepath
-gsave
-1.000 setgray
-fill
-grestore
-stroke
-% draw_lines
-0.000 0.000 1.000 setrgbcolor
-230.344 143.521 m
-237.901 143.521 l
-245.457 143.521 l
-253.013 143.521 l
-stroke
-% draw_lines
-1.000 0.000 0.000 setrgbcolor
-230.344 121.605 m
-237.901 121.605 l
-245.457 121.605 l
-253.013 121.605 l
-stroke
-% draw_lines
-0.000 0.500 0.000 setrgbcolor
-230.344 97.688 m
-237.901 97.688 l
-245.457 97.688 l
-253.013 97.688 l
-stroke
-% draw_lines
-0.750 0.000 0.750 setrgbcolor
-230.344 71.371 m
-237.901 71.371 l
-245.457 71.371 l
-253.013 71.371 l
-stroke
-% text
-0.000 setgray
-/Verdana findfont
-24.000 scalefont
-setfont
-262.081 134.521 m
-(Blackman) show
-% text
-262.081 112.605 m
-(Bartlett) show
-% text
-262.081 86.688 m
-0 5 rmoveto
-(Hanning) show
-% text
-262.081 60.371 m
-0 5 rmoveto
-(Hamming) show
-
-end
-showpage
diff --git a/doc/numpybook/Figures/fig1bw.eps b/doc/numpybook/Figures/fig1bw.eps
deleted file mode 100644
index 3353edcb4..000000000
--- a/doc/numpybook/Figures/fig1bw.eps
+++ /dev/null
@@ -1,4575 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Title: fig1bw.eps
-%%Creator: matplotlib version 0.85.1.cvs, http://matplotlib.sourceforge.net/
-%%CreationDate: Fri Jan 6 00:30:28 2006
-%%BoundingBox: 13 175 598 616
-%%EndComments
-%%BeginProlog
-/mpldict 7 dict def
-mpldict begin
-/m { moveto } bind def
-/l { lineto } bind def
-/r { rlineto } bind def
-/box {
-m
-1 index 0 r
-0 exch r
-neg 0 r
-closepath
-} bind def
-/clipbox {
-box
-clip
-newpath
-} bind def
-/ellipse {
-newpath
-matrix currentmatrix 7 1 roll
-translate
-scale
-0 0 1 5 3 roll arc
-setmatrix
-closepath
-} bind def
-%%BeginFont: Verdana
-%!PS-TrueType-1.0-1.0
-8 dict begin
-/FontName /Verdana def
-/FontMatrix [1 0 0 1 0 0] def
-/FontType 42 def
-/Encoding StandardEncoding def
-/FontBBox [-102 -423 2963 2049] def
-/PaintType 0 def
-/FontInfo 7 dict dup begin
-/Notice (Typeface and data © 1996 Microsoft Corporation. All Rights Reserved) def
-/FamilyName (Verdana) def
-/FullName (Verdana) def
-/version (Version 2.35) def
-/isFixedPitch false def
-/UnderlinePosition -180 def
-/UnderlineThickness 120 def
-end readonly def
-/sfnts [
-<00010000001301000004003044534947CD5006A400020D64000014144C5453485694D82F
-00001530000003814F532F32477590C3000001B80000005656444D5874F17C6D000018B4
-000005E0636D6170E84D8B8B000007A80000068C637674204CA740E3000022AC00000198
-6670676DEE371553000021740000013867617370001700090000021000000010676C7966
-01F195F700009EC000013BB668646D7809490ECD0000323800006C8868656164C748722C
-0000013C0000003668686561133B09D00000017400000024686D7478C905723E00002444
-00000DF46B65726E75BF7E53000200CC00000C966C6F63616784B57700000E34000006FC
-6D617870086A023E00000198000000206E616D65A93B95720000022000000587706F7374
-C58F55450001DA7800002651707265701240C02F00001E94000002E00001000000010000
-16FBFC3A5F0F3CF5001B080000000000AA7E442900000000B26DE2ABFF9AFE590B930801
-00000009000200000000000000010000080BFE5200000C2CFF9AFBD40B93000100000000
-00000000000000000000037D00010000037D00620007006B000500020010002F00380000
-0495013F0003000100010411019000050000059A053300000125059A0533000003A00078
-02A70800020B0604030504040204000002870000000000000000000000004D5320200040
-0020FB02061EFE5900CA080B01AE2000019F000000000000000000030008000200100001
-FFFF00030000002801E60001000000000000004300000001000000000001000700430001
-0000000000020007004A0001000000000003002F00510001000000000004000700800001
-000000000005000C00870001000000000006000700930001000000000007002F009A0003
-000104030002000C00C90003000104050002001000D50003000104060002000C00E50003
-000104070002001000F10003000104080002001001010003000104090000008601110003
-000104090001000E01970003000104090002000E01A50003000104090003005E01B30003
-000104090004000E021100030001040900050018021F0003000104090006000E02370003
-000104090007005E024500030001040A0002000C02A300030001040B0002001002AF0003
-0001040C0002000C02BF00030001040E0002000C02CB0003000104100002000E02D70003
-000104130002001202E50003000104140002000C02F70003000104150002001003030003
-000104160002000C03130003000104190002000E031F00030001041B00020010032D0003
-0001041D0002000C033D00030001041F0002000C03490003000104240002000E03550003
-0001042D0002000E036300030001080A0002000C03710003000108160002000C037D0003
-00010C0A0002000C0389000300010C0C0002000C0395547970656661636520616E642064
-61746120A92031393936204D6963726F736F667420436F72706F726174696F6E2E20416C
-6C2052696768747320526573657276656456657264616E61526567756C61724D6963726F
-736F66743A56657264616E6120526567756C61723A56657273696F6E203120284D696372
-6F736F66742956657264616E6156657273696F6E20322E333556657264616E6156657264
-616E6120697320612074726164656D61726B206F66204D6963726F736F667420436F7270
-6F726174696F6E004E006F0072006D0061006C006F00620079010D0065006A006E00E900
-6E006F0072006D0061006C005300740061006E0064006100720064039A03B103BD03BF03
-BD03B903BA03AC0054007900700065006600610063006500200061006E00640020006400
-6100740061002000A9002000310039003900360020004D006900630072006F0073006F00
-66007400200043006F00720070006F0072006100740069006F006E002E00200041006C00
-6C0020005200690067006800740073002000520065007300650072007600650064005600
-65007200640061006E00610052006500670075006C00610072004D006900630072006F00
-73006F00660074003A00560065007200640061006E006100200052006500670075006C00
-610072003A00560065007200730069006F006E0020003100200028004D00690063007200
-6F0073006F00660074002900560065007200640061006E00610056006500720073006900
-6F006E00200032002E0033003500560065007200640061006E0061005600650072006400
-61006E006100200069007300200061002000740072006100640065006D00610072006B00
-20006F00660020004D006900630072006F0073006F0066007400200043006F0072007000
-6F0072006100740069006F006E004E006F0072006D0061006C004E006F0072006D006100
-61006C0069004E006F0072006D0061006C004E006F0072006D00E1006C004E006F007200
-6D0061006C0065005300740061006E00640061006100720064004E006F0072006D006100
-6C004E006F0072006D0061006C006E0079004E006F0072006D0061006C041E0431044B04
-47043D044B0439004E006F0072006D00E1006C006E0065004E006F0072006D0061006C00
-4E006F0072006D0061006C004E0061007600610064006E006F0041007200720075006E00
-740061004E006F0072006D0061006C004E006F0072006D0061006C004E006F0072006D00
-61006C004E006F0072006D0061006C00000000020001000000000014000300010000011A
-000001060000010000000000000001020000000200000000000000000000000000000001
-0000030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324
-25262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60610062636465666768696A6B
-6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F
-909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAAB03ACADAEAFB0B1B2
-B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD000D1D2D3D4D5
-D6D7D8D9DADBDCDDDEDF0004057200000084008000060004007E017F019201A101B001FF
-02C702C902DD0301030303090323037E038A038C03A103CE040C044F045C045F04911E85
-1EF92015201E2022202620302033203A203C203E2044207F20A420A720AC210521132116
-21222126212E215E22022206220F22122215221A221E222B22482260226525A125AB25CA
-25CF25E6F002F00DFB02FFFF0000002000A0019201A001AF01FA02C602C902D803000303
-03090323037E0384038C038E03A30401040E0451045E04901E801EA02013201720202026
-203020322039203C203E2044207F20A320A720AB21052113211621222126212E215B2202
-2206220F221122152219221E222B22482260226425A125AA25CA25CF25E6F001F004FB01
-FFFFFFE30000FF1400A60099FF8A0000FE0F0000FF4C0078FF41FF28FCA00000FE170000
-0000FDD9FDD8FDD7FDD6FDA6E30B0000000000000000E085E095E109E084E0F9E156E077
-E0B70000E0900000E038E02BE123DF6ADF79E068E03CDE96DEA2DE8B0000DEA60000DE74
-DE71DE5FDE2FDE30DB9EDB96DAEEDB73DB5D10BE000005BE000100000082000000000000
-000002380000023800000000000000000000023800000242026800000000000000000000
-000002B203640368037600000000000000000000000000000000036A0000036A00000000
-000000000000000000000000000000000358000003580000000000000000000000000000
-0000000000000000034400000000000300A300840085037C009600E60086008E008B009D
-00A900A40010008A01000083009300F000F1008D00970088010100DC00EF009E00AA00F3
-00F200F400A200AC00C800C600AD006200630090006400CA006500C700C900CE00CB00CC
-00CD00E7006600D100CF00D000AE006700EE009100D400D200D3006800E900EB0089006A
-0069006B006D006C006E00A0006F0071007000720073007500740076007700E80078007A
-0079007B007D007C00B700A1007F007E0080008100EA00EC00B901440145010201030104
-010500FB00FC014601470148014900FD00FE01060107010800FF014A014B014C014D014E
-014F0109010A010B010C0150015100F600F701520153015401550156015701580159015A
-015B015C015D015E015F0160016100F800D50138013901620163016401650166010D010E
-01670168010F01100111011200E000E1011301140169016A01150116013A016B016C016D
-016E016F01700117011800AF00B00119011A01710172011B011C011D011E0173017400F9
-00FA00E200E3011F01200121012201750176017701780179017A017B017C012301240125
-0126017D017E017F01800181018200BA012701280129012A00E400E5018300D600DF00D9
-00DA00DB00DE00D700DD019D019E019F018A01A001A101A201A401A501A601A701A8012B
-01A901AA01AB01AC012C01AD01AE01AF01B001B101B201B301B401B501B601B701B8012D
-01B901BA01BB01BC01BD01BE01BF01C001C101C2012E01C301C4012F013001C501C601C7
-01C801C901CA01CB01CC01CD01CE023A01CF01D00131013201D1013301D201D301D401D5
-01D601D701D801D9025D025E025F0260026102620263026402650266026702680269026A
-026B026C026D026E026F0270027102720273027402750276027702780279027A027B027C
-027D027E027F028002810282028302840285028602870288034C034D034E034F03500351
-03520353035403550356035703580359035A035B035C035D035E035F0360036103620363
-036403650366036703680369036A036B036C036D036E036F037003710191019203740375
-037603770378037900B100B20238013400B500B600C3019300B300B400C4008200C10087
-00F50195037A00BC009900ED00C200A5019B019C023B023C023D023E023F024002410242
-0000001F001F001F001F00470070010401C0025F033C035503A203F10461049604C004DE
-04F50520057F05B9063806DB072D07A70830086B090B099309B509F10A350A640AAA0B13
-0BF80C600CDC0D4F0DA00DD60E060E7A0EAE0EDB0F180F860FA61000104C10B8111711AE
-122012B812DF132C13881407148814DF15221544156F159015C815DE15FE168916E71747
-17A01803184F18D11912193D198C19E51A001A761AB61B011B5D1BB81BF51C8B1CDB1D1B
-1D741DD91E641EC21F041F631F7E1FDC203B205520FE21AA21BD21D021E9220222142226
-2238225322652278230A231C232E234023562369237C23B423EE2400241224242436244C
-245E24702482249424AB24E62520259A260826EB270B274327C928832929297B299C29C2
-2A2D2A912B412BCD2C0D2C5A2CA82D0C2D4C2DCB2E3D2E722E9F2EE92F5E2F9F301130E7
-316D31D831FF3223326032DF336433A233F33443346D3480349334A6350E35AD35C735DD
-361C365B368036A736E33728373F37593777382D3858388438E139313986399E39C43A03
-3AD73AEA3AFD3B103B243B373B4A3B5D3B773B8A3B9D3BB03BC33BD63BE93BFC3C173C47
-3C8E3CA63CEC3D003D493D7D3DB53DEA3E1B3E5B3E923EA53EB73ECA3EDC3F043F6B3FFF
-40124024408840E441014135416941BB4239425A427E42AA42F643024314432743F044AF
-44C244D444E744F9456F4586459E45B145C3465F47144727479D47A54806489348A648B8
-48CB48F0492B4961499249BC49CF49E149F44A064A1A4A2D4A404A534A664A794A8C4A9E
-4AEE4B6C4B7F4BEC4C354C484C5C4C6F4C824C954CA84CBA4CDA4D584DDD4E3C4EC24F58
-4FB24FE1505D5081509D50E951DF51EF52085268528B52CA538353FD5425543F54665491
-54EA54FC550D551F55345546555B556D557E559055A455B655C755D955EE5600561556B8
-575B576D578757DE583458A458FC593F596C59C05A035A595AB15AC85B225B335B495BA2
-5BEB5C305C465C5C5CD25D2E5D405D515D635D745D855DEA5DFC5E105E4E5EBA5ECC5EDD
-5EEF5F005F125F235FA2600E6020603260446055608561656246625C626E6285629A62B1
-62C362D562E762F963166332634963606388639E6422648E64AA64D76504653065556589
-65A265DD65F36611662F664F666E668E66B16700670867106752675A6762676A6772677A
-67C367CB67D36812681A6840684868DA68E268EA68F2695D69DC69F66A106A216A376A48
-6A5B6A6F6AFD6B4A6BBD6BFF6C866C8E6D226D7A6DC16DC96E726E7A6ECF6F3B6F7A6FEA
-705A70F370FB7112712371347146715A71C571DD7255725D7265727F7287731C738773DE
-73F3749074C174C97521752975497594759C765676F2773A77AE783B7892789A78A278AA
-78D078D878E078E8795979DE79E67A167A5D7A907ACD7B297B907BE47C5F7CCD7D367D3E
-7DCA7E4C7E6C7EBC7EC47F7D8015804D80B18126817B81D38203820B82308238829A82C9
-82D1836C837483AC83EF8425846784C3852B858085F4865386BD86D38757876887D587DD
-87E587ED87F5888B88F9894F896489EE8A258A4E8A7B8A918B238B488B6C8BBD8C398C73
-8CD88D0C8D8E8D8E8D8E8D8E8D8E8E208E8D8EF48F598F9F8FB58FBD8FC59006904590BD
-9126916491A19209927292C09334938093D1944E94D395479558956C9586959B95B195C7
-95DD95F3960B96219633964996659683969596AA96BC96D196E396F8970A971F973E9759
-976A977B979697AE97C497D597ED97FF98179829983F985598679879989898B198C998DB
-98ED98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF9911
-9922994099549970998999A199B399CB99E499FC9A159A359A4E9A659A769A909AA59ABB
-9ACC9AE29AF99B0B9B1C9B2D9B3E9B549B659B7C9B949BAF9BC79BDD9BEE9C009C119C22
-9C339C4E9C649C759C8B9CA49CB89CCE9CDF9D639D6B9DDB0000037D01011C1C300E0E0B
-0E010A01010E0E010F01010B0B0B0B0B0B0B0B0B0B01010E0E0E0B0C320E101923150E0F
-740A0E2D240E0D0D0D0E322C1D322E1C111C0101010101010D0D0E0D0D1C0D0BB4010EB4
-110B100D0D2A11110B0A100F0A11010E0101323210230E0D1D0D0D0D0D0D0D0E0D0D0D0D
-B4B4B4B40B10101010100B0B0B0B0B010B0B01010B0101010101010E330D010E0E0E0B10
-010101010B0101010E100B300E010B010127270132320D011C0B01010101010E010A1101
-01010101010B010101013223322323747474740D0D0D1D1D1DB401010101010101010101
-0AD732111C110E1001110A0D0D0E01010101010101010E0D743211100E100E0D0101320D
-320D190D10230D230D2DB42D322D010E0B0E0B0D100E2A0E2A32112C112C111D0B1D0B1C
-111C11100D130D2612181110010D010A0A110E01240A121901011901320D100E100E230D
-230D230D0E0D0E0D0E0D0F0B0F0B74B474B474B474B40A010E0E0E2DB40E0B0E0B0D100D
-100E2A32112C111D0B1D0B1D491D182E10110A01320D330E0D10012E102E102E10110A01
-010B01010101012E010101320E1C10160C27B4320E01231C0F740E0A240E300D0F0D1E2C
-111C111474110D120BB40B0B0F0D0B0DB40D0A130A011010010B0C1010B40B100B10230A
-100D3274740A0C0E010E1111320E0E10012311010E0E0E12240F0D0F0D102C11131C2D22
-11111F2D0E0D01100D240A010D0D301210100B011D1010100D0F110A170F270D11320C11
-0C0E0D0A0D0B010E11B4B4010A0E0B0B0A10100A01011001010101010101010101012D10
-282001010101010101010101010101010101010101320D320D320D320D320D320D320D32
-0D320D320D320D320D230D230D230D230D230D230D230D230D74B474B401010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-01010101010101010D100D100D100D100D100D100D102D102D102D102D102D101D0B1D0B
-28202820282028202820110A110A110A110A0D010B00000000000001000101010101000C
-00F808FF00080008FFFE0009000AFFFE000A000AFFFE000B000BFFFE000C000CFFFE000D
-000DFFFD000E000EFFFD000F000FFFFD0010000FFFFD00110011FFFD00120012FFFC0013
-0013FFFC00140015FFFC00150015FFFC00160016FFFC00170017FFFB00180018FFFB0019
-001AFFFB001A001BFFFB001B001BFFFB001C001CFFFA001D001DFFFA001E001EFFFA001F
-0020FFFA00200020FFFA00210021FFF900220022FFF900230023FFF900240025FFF90025
-0026FFF900260026FFF800270027FFF800280028FFF800290029FFF8002A002BFFF8002B
-002BFFF7002C002CFFF7002D002DFFF7002E002EFFF7002F0030FFF700300031FFF60031
-0031FFF600320032FFF600330033FFF600340034FFF600350036FFF500360036FFF50037
-0037FFF500380038FFF500390039FFF5003A003BFFF4003B003CFFF4003C003DFFF4003D
-003DFFF4003E003EFFF4003F003FFFF300400041FFF300410041FFF300420042FFF30043
-0043FFF300440044FFF200450046FFF200460047FFF200470047FFF200480048FFF20049
-0049FFF1004A004AFFF1004B004CFFF1004C004DFFF1004D004DFFF1004E004EFFF0004F
-004FFFF000500051FFF000510052FFF000520052FFEF00530053FFEF00540054FFEF0055
-0055FFEF00560057FFEF00570058FFEE00580058FFEE00590059FFEE005A005AFFEE005B
-005CFFEE005C005DFFEC005D005DFFEC005E005EFFEC005F005FFFEC00600060FFEC0061
-0062FFEB00620062FFEB00630063FFEB00640064FFEB00650065FFEB00660067FFEA0067
-0068FFEA00680068FFEA00690069FFEA006A006AFFEA006B006BFFE9006C006DFFE9006D
-006DFFE9006E006EFFE9006F006FFFE900700070FFE800710072FFE800720072FFE80073
-0073FFE800740074FFE800750075FFE700760076FFE700770078FFE700780078FFE70079
-0079FFE7007A007AFFE6007B007BFFE6007C007DFFE6007D007DFFE6007E007EFFE6007F
-007FFFE500800080FFE500810082FFE500820083FFE500830083FFE500840084FFE40085
-0085FFE400860086FFE400870088FFE400880088FFE400890089FFE3008A008AFFE3008B
-008BFFE3008C008DFFE3008D008EFFE3008E008EFFE2008F008FFFE200900090FFE20091
-0091FFE200920093FFE200930093FFE100940094FFE100950095FFE100960096FFE10097
-0098FFE100980099FFE000990099FFE0009A009BFFE0009B009BFFE0009C009CFFE0009D
-009EFFDF009E009EFFDF009F00A0FFDF00A000A0FFDF00A100A1FFDF00A200A3FFDE00A3
-00A4FFDE00A400A4FFDE00A500A6FFDE00A600A6FFDE00A700A7FFDD00A800A9FFDD00A9
-00A9FFDD00AA00ABFFDD00AB00ABFFDD00AC00ACFFDC00AD00AEFFDC00AE00AFFFDC00AF
-00B0FFDC00B000B0FFDC00B100B1FFDB00B200B2FFDB00B300B4FFDB00B400B5FFDB00B5
-00B6FFDB00B600B6FFDA00B700B7FFDA00B800B9FFDA00B900BAFFDA00BA00BBFFDA00BB
-00BBFFD900BC00BCFFD900BD00BDFFD900BE00BFFFD900BF00C0FFD900C000C1FFD800C1
-00C1FFD800C200C2FFD800C300C4FFD800C400C5FFD800C500C5FFD700C600C6FFD700C7
-00C7FFD700C800C8FFD700C900CAFFD700CA00CBFFD600CB00CCFFD600CC00CCFFD600CD
-00CDFFD600CE00CFFFD600CF00D0FFD500D000D0FFD500D100D1FFD500D200D2FFD500D3
-00D3FFD500D400D5FFD400D500D5FFD400D600D7FFD400D700D7FFD400D800D8FFD400D9
-00DAFFD300DA00DBFFD300DB00DCFFD300DC00DCFFD300DD00DDFFD300DE00DEFFD200DF
-00E0FFD200E000E0FFD200E100E2FFD200E200E2FFD200E300E3FFD100E400E5FFD100E5
-00E6FFD100E600E7FFD100E700E7FFD100E800E8FFD000E900E9FFD000EA00EBFFD000EB
-00EBFFD000EC00ECFFD000ED00EDFFCF00EE00EEFFCF00EF00F0FFCF00F000F1FFCF00F1
-00F2FFCF00F200F2FFCE00F300F3FFCE00F400F4FFCE00F500F6FFCE00F600F7FFCE00F7
-00F7FFCD00F800F8FFCD00F900F9FFCD00FA00FBFFCD00FB00FCFFCC00FC00FDFFCC00FD
-00FEFFCC00FE00FEFFCC00FF00FFFFCCB8FFC0401EB229323610B220B240B250B270B280
-B2A0B2B0B2D0B2E0B20AC0B2F0B202B8FFC04070B51718361F44010F561F56024F555F55
-026F54019F54AF54025153170452531604535215044A4952044649370447493204484932
-04493539043C3F32043D3F3D043E3F2104433F1D04423F5204413F5204403F52043F3532
-0432336404333534043534540434351E04D034E034F03403B8FFEEB3B4254836B8FFE0B3
-B4102336B8FFEE400DB4090F36B41A480476B386B302B8FFF0B3B3254836B8FFFA40FFB3
-092436B314480489881304706C7078020F9CDF9E02409D161936409C161B364097171936
-4096171B368685131F0F840F850F8E0F8F0F901F841F8E1F8F2F8E808580888F91908590
-8790880F40820910360F721F72024071090C360F6D0120C80120C7013FC6EFC60220C540
-C50200620100621062024061A061020F5B012D1411042C1425042B1439042A1413042914
-15041F141E042120430420143C04C91A45041A1B47041B1A3C041A143204151439041314
-480412141A0411141A0470140140144143360F0E2A1F0006010DC34B1F0CC24B1F0AC04B
-1F09C04B1F05BC4B1F04BD4B1F03B94B1F02BA4B1F01B64B1F00B74B1FC3C22A1FC0BF2A
-1FBD4056BC211FBAB9211FB7B6211FC2C3C40DBFC0C10DBCBDBE0CB9BABB0CB6B7B80C10
-BC80BC0240B980B9020FB63FB64FB67FB6040FB62FB63FB66FB67FB6BFB6CFB6FFB6080A
-0937040C0D02050402030202010002500501B801FF858D8D1DB0964B5258B0801D59B808
-004B5458B001B0018E59B0084B5358B001B0018E59002B2B2B2B2B737473732B2B2B2B2B
-2B2B2B2B2B2B2B2B2B2B2B2B2B2B2BB00345B006456861B006234473B00345B00E456861
-B00E2344B00E45B00F456861B00F23442B01B0144568B01423442B732B2B2B2B2B2B2B2B
-2B2B2B2B2B2B2B2B7373737373737373732B732B732B2B2B2B2B73732B2B2B2B732B2B2B
-2B00752B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B73747373742B73742B400C3736
-26251F13120D0C0504022C20B003254523452361688A204568208A234460442D2C4B5258
-45441B2121592D2C202045684420B001602045B0467668188A4560442D2CB0122BB00225
-45B00225456AB0408B60B0022523442121212D2CB0132BB0022545B00225456AB8FFC08C
-60B0022523442121212D2CB100032545685458B0032545B0032545606820B004252344B0
-042523441BB00325204568208A2344B00325456860B003252344592D2CB0032520456820
-8A2344B00325456860B0032523442D2C4B525845441B2121592D2C462346608A8A462320
-468A608A61B8FF8062232010238AB14B4B8A70456020B0005058B00161B8FFBA8B1BB046
-8C59B0106068013A2D2C2045B003254652583F1B2111592D2C4B53234B515A5820458A60
-441B2121592D2C4B53234B515A58381B2121592D061E061405F005D1047C045D03DD0010
-0000FFE7FFE1FE78FE64FE590394001FFFFF009600AA00B900C600CEFFFFFFFFFFFFFFFF
-00BC00C2FFFFFFFF007600B200C000CBFFFFFFFFFFFFFFFFFFFFFFFF0081009400A600CC
-00DA00EFFFFFFFFFFFFFFFFF0098009E00AB00B0FFFFFFFFFFFFFFFFFFFFFFFF00900098
-009E00A400A900AE00B300BA00C3FFFF00880091009800A500ACFFFFFFFFFFFFFFFFFFFF
-006F0087008F009B00A000D3011DFFFFFFFFFFFF00C3021401C2FFFFFFFF00E9000C02D1
-0173018E001A002C0044005C0073007E008600B200C8014C001A003D00440050005C0072
-0078009200B200B900C8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF003D0056005D006A
-006E00B100B900C1FFFFFFFF002A003D00540064006A00B100B9FFFFFFFFFFFF0071007A
-008900A100A700BB006F007A00870091009AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-008102210221007400E500B900CA019502C600AC00A700850614000A000005D1001F0000
-045D001F00000000FFE10000FE64FFF50000036202F402A2029100AF026A004C08000100
-0000000002D0000002D000000326012303AC00A8068C00C30516009B089C009505D00073
-022600A403A200B503A20093051600A7068C00D202E9009303A2009902E900FD03A2FFE2
-0516008905160116051600A1051600A70516004D051600BB051600890516009A0516007A
-0516007103A2015A03A200E6068C00FE068C00F5068C010C045D00A0080000B00578001A
-057C00C805960073062A00C8050F00C8049900C806340073060300C8035E008903A3002C
-058B00CD047400C806BE00C805FC00C8064C007304D300C8064C0073059000C805780086
-04EE000005DB00B20578001A07E9005C057B004404EC0006057B007E03A200EF03A20046
-03A200AB068C00BA0516FFFC0516015404CE006804FC00B9042B006904FC006C04C4006A
-02D0004404FC006C051000B9023200AF02C1FFC204BC00C1023200BB07C800B9051000B9
-04DB006A04FC00B904FC006C036A00B9042B006E0327003E051000B104BC003D068C0056
-04BC003C04BC003D0434005D051400AD03A2017A051400BB068C00BB0578001A0578001A
-05960073050F00C805FC00C8064C007005DB00B204CE006804CE006804CE006804CE0068
-04CE006804CE0068042B006904C4006A04C4006A04C4006A04C4006A023200A00232FFEB
-0232FFF502320005051000B904DB006A04DB006A04DB006A04DB006A04DB006A051000B1
-051000B1051000B1051000B1051600BB0456009A0516009F05160089051600AC045D00B9
-0516008904F600B90800009F0800009F07D000AA0516021D0516015A068C00F507E0000E
-064C0073080000A1068C00D7068C00FE068C010C0516006C052200BE0516009505D100BB
-068C009005A900710516008A045D0097045D0079068C006B07A4006804DB005D045D0071
-03260123068C00D2068C00860516FFDC068C00F305D10032052800A6052800AE068C00B2
-0578001A0578001A064C0073088F007807DA006A051600990800009903ACFFED03AC0096
-0226FFED022600A0068C00D2068C00AC04BC003D04EC000602E4FF9A0516000003A200BA
-03A200C20500004405020044051600BB02E900FD0226FFF603ACFFF60C2C00950578001A
-050F00C80578001A050F00C8050F00C8035E0089035E005D035E007E035E0089064C0073
-064C0073064C007305DB00B205DB00B205DB00B2023200BB05160136051600ED05160118
-05160113051602210516012D05160161051601560516019F05160132047E001802460018
-05780086042B006E057B007E0434005D03A2017A0634000E04E5006A04EC000604BC003D
-04D800C804FC00B9068C00DC068C012304560123045600CF045600CF080000AB080000AB
-0800008C0516003C0634007304FC006C035E008905780086042B006E05960073042B0069
-05960073042B006904FC006C0516FFFC02E900FD0578001A04CE00680578001A04CE0068
-062A00C8052E006C0634000E050F00C804C4006A050F00C804C4006A047400C8023200AB
-047400C8025E00BB047400C803AB00BB05FC00C8051000B905FC00C8051000B9064C0073
-04DB006A059000C8036A00B9059000C8036A009205780086042B006E04EE00000327003E
-04EE00000327003E05DB00B2051000B105DB00B2051000B1057B007E0434005D057B007E
-0434005D048800C8064C0073068D006904FC006C04DD006A041A006D050B006A03F8000A
-065200680516FFFC04FF0123045D009A094F00C806F7008904E900AF05D8000002E400D5
-047500D5089C00950296000F04D5009202D6008302D6008304D500B102D600700578001A
-04CE006805960073042B006905960073042B0069050F00C804C4006A050F00C804C4006A
-050F00C804C4006A0634007304FC006C0634007304FC006C0634007304FC006C060300C8
-051000B90603002005100013035E002C0232FFF2035E005F0232FFFC035E008002320001
-035E00890232008E03A3002C02C1FFC2058B00CD04BC00C104BC00C1047400C802320005
-05FC00C8051000B905FC00C8051000B9064C007304DB006A064C007304DB006A059000C8
-036A001B05780086042B006E04EE00000327003E05DB00B2051000B105DB00B2051000B1
-05DB00B2050B00B105DB00B2050B00B107E9005C068C005604EC000604BC003D026700B9
-0578001A04CE006807E0000E07A40068064C007304DB005D03A2015A07E9005C068C0056
-07E9005C068C005607E9005C068C005604EC000604BC003D0226FFED0516FFD005160089
-05BE00B1080000AB0800008C0800008A0800009901B00061051601610516021205160100
-057800070602000006F6000004510000070C000006070000074300000232FFCB0578001A
-057C00C805A0001A050F00C8057B007E060300C8035E0089058B00CD057C001A06BE00C8
-05FC00C805310072064C0073060300C804D300C80561007604EE000004EC0006057B0044
-06F700B3068C006C035E007E04EC000604FC006C041A006D051000B9023200A0050D00B1
-04F600B904BC003D03A9006C051000B904FE0089023200BB04BC00C104BC003D051E00B9
-04BC003D0406006804DB006A050000B904100069050D00B104B80030069300B006820071
-02320005050D00B104DB006A050D00B106820071050F00C80657FFFF048800C8059B0073
-05780086035E0089035E007E03A3002C08F2001208D300C8068BFFFF058B00CD04EC0006
-060300C80578001A057C00C8057C00C8048800C805F7000A050F00C807C9002004ED0051
-060100C8060100C8058B00CD05E0001206BE00C8060300C8064C0073060300C804D300C8
-0596007304EE000004EC0006068D0069057B0044061700C805B2008E083E00C8085C00C8
-06440000075D00C8057200C8059C0061084600C805A6002C04CE006804EA007404C200B9
-03C500B904F9000904C4006A0662003404320041051F00B9051F00B904BC00C104F7001D
-059200B9051900B904DB006A051900B904FC00B90446006A03F8000A04BC003D06BA006F
-04BC003C052800B904D8008E070200B9071A00B90520000A065B00B9049100B904600053
-06B600B904CC004304C4006A0510001303C500B90460006A042B006E023200AF02320005
-02C1FFC20750001D075000B90510001304BC00C104BC003D051900B9048800C803C500B9
-080000CB096000C8051900B904560119045600EF045600E6045600B3045600E6045600F3
-045600C5000000000000000000000000000000000674007304DB006A060D00B2054700B1
-0000020900000221000001540000021D0516013605160003051601360516012505160142
-051601420516014205160125051602090516013605160142051601420516014205160142
-051601360578001A04CE00680578001A04CE00680578001A04CE00680578001A04CEFFE3
-0578001A04CE00680578001A04CE00680578001A04CE00680578001A04CE00680578001A
-04CE00680578001A04CE00680578001A04CE00680578001A04CE0068050F00C804C4006A
-050F00C804C4006A050F00C804C4006A050F00C804C4006A050F002904C4FFFC050F00C8
-04C4006A050F00C804C4006A050F00C804C4006A035E008902320096035E0089023200AF
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000064C007304DB006A064C0073
-04DB006A064C007304DB006A064C007304DBFFE5064C007304DB006A064C007304DB006A
-064C007304DB006A0674007304DB006A0674007304DB006A0674007304DB006A06740073
-04DB006A0674007304DB006A05DB00B2051000B105DB00B2051000B1060D00B2054700B1
-060D00B2054700B1060D00B2054700B1060D00B2054700B1060D00B2054700B104EC0006
-04BC003D04EC000604BC003D04EC000604BC003D04EC000604BC003D04FC006C000000ED
-0516008A0000001F00000380090E09000303050507070B07030404070703050304070707
-070707070707070404070707060A08070808070608080505070609080907090707070808
-090707070404040706060606060606030606030306030906060606040604060607060605
-060506070808080708090806060606060606060606060303030306060606060606060606
-07050707060507060909090606070A090907070707060607070607050507090606050707
-0707070606070808090A0907090404020207070607030604040606070302040E08070807
-070505050509090908080803060606060606060606060603070607050508060706070607
-070505050909090608060507060806080606060308060806080608070607060603060306
-040806080609060704070407060704070408060806070507050609070606050605090606
-050B09060703050B03050303050308060806080607060706070608060806080608060806
-050305030503050305030706060603080608060906090607040706070408060806080608
-06090707060308060A090906040907090709070706020607060909090902060606080809
-060908090308070607070805070809080709080706070707090905070605060306060505
-060603060606060506060506050907030606060707080608070505050A0A070707070807
-070607070906080807070908090807080707070708070909080907080907060606040606
-070506060606070606060606050609060705090907080606080606060406060303030909
-060606060505090B06050505050505050000000009060806000000000606060606060606
-060606060606060806080608060806080608060806080608060806080608060706070607
-060706070607060706070605030503000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000090609060906
-090609060906090609060906090609060906080608060806080608060806080607060706
-07060706060007000A0F0A000404040508070B0703050507080405040507070707070707
-0707070505080808060A070708080606080805050706090709070908070708070B070707
-0505050806060707050707040707030307030B0707070704060407060707060606050608
-070708060709080707070707070507070707030303030707070707070707070707050707
-060507060A0A0A0606080A090A080808070706070807070505080A070604080807080706
-06080707090B0A070A0505030308080607040605050606070403050F0706070606050505
-050909090808080306060606060606060606060307060706050806070607070808050505
-0A0A0A060807050706080508050706040707070708070806070607060306030605070707
-0709070804080407060704070408070807070607060609090707050705090606050C0906
-0704060B0306040406040707080508050607060706070807080708070807080705030503
-0503050305030707070603070707070907090708040706070408070807080708070B0707
-060307070A0A0907050B070B070B070706030607070A0A0A0A0206060607070906090909
-030707070607080507070907070908070707070709090507070507030707070507070307
-0607060507070507060909030707070906080608070505050B0B08070708070707060706
-0906080807070908090807080707090709070B0B080907080A0707070605060707050707
-0706070707070705050609070706090A0708060608060707050606030303090907070607
-06050A0C0705050505050505000000000907080700000000060606060606060606060606
-060606070707070707070707070707070707070707070707070707060706070607060706
-070607060706070503050300000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000009070907090709070907
-090709070907090709070907090708070807080708070807080708070706070607060706
-070007000B110B000404040509070C080305050709040504050707070707070707070705
-05090909060A080809090706090805050806090809070908080708080B08070805050509
-07070707060707040707030407030B070707070506040707090707060705070908080907
-080908070707070707060707070703030303070707070707070707070706070707060707
-0B0B0B0707090B090B090909070707080908070606090B07060409090709080707090808
-090C0B070B05050303090907070407050507070704030511080708070705050505090909
-08080803070707070707070707070603080608060509070707070709090606060B0B0B07
-090705080609060906070704080708070907090707070706030603060508070807090708
-05080508060704070408070807080608060609090707060705090707060D0A070804060C
-040704040704080709060906070707070707090709070907080708070503050305030503
-05040807070603080708070907090708050806070408070807080708070B090707030807
-0B0B0907050B090B090B090707030707080B0B0B0B02070707080809060A090903080808
-070808050808090807090807070707080909050707060703070707050707030707070706
-07070607070909030707070907090609080505050D0C090808080808080608070B070808
-08080908090807090708090809080B0C090A07090B080707070508070906070707070707
-07070706050709070807090A080907070A0707070507060303040A0B0707070706050B0D
-070606060606060600000000090708070000000007070707070707070707070707070708
-070807080708070807080708070807080708070807080707070707070707070707070707
-070707050305030000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000907090709070907090709070907
-090709070907090709070807080708070807080708070807070707070707070707000700
-0C120C00040405060A080D09030505080904050405080808080808080808080505090909
-070C0808090908070909050508070A090A080A08080709080D0807080505050A08080808
-060808040808030407030B0808080805070508070B0707070805080A08080908090A0908
-08080808080608080808030303030808080808080808080808070808080708070C0C0C08
-08090C0A0C090909080808090A080807070A0B080705090A080A0908080A08080A0D0D08
-0C06060303090A070704080505080808040306120808080808050505050A0A0A09090903
-0808080808080808080807030807080705090707070808090A0707070C0C0C0809080508
-07090609060808040808080809090908080808070307040706090809080A080805080508
-07070507050908090808070807070A0B0808060807090808070E0A070904070D04070404
-070408080906090608080808080809080908090809080908050305030503050305040807
-070703090809080A080A0808050807070509080908090809080D0B07070408080C0B0A08
-050D0B0D0B0D0B0707030808090C0C0C0C0308080808090A060B090B0308080808080905
-08080A09080A0908080707080B0A05070806080308070706080803080708070608080608
-070B0B030808080B080A0709080505050D0D0A0808090808080709080D07090908090A09
-0A09080907080B0809090D0E090B08090C080808070608080B0608080707080808080806
-07070B0709080B0C080907080B0708080608070303040B0B0807070807060C0E08070707
-07070707000000000A080908000000000808080808080808080808080808080808080808
-080808080808080808080808080808080808080808080808080808080808080808080805
-030503000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000A080A080A080A080A080A080A080A080A08
-0A080A080A0809080908090809080908090809080707070707070707080008000D140D00
-050505050A080D09030606090905070506080808080808080808080606090909070D0908
-090908080909050608070B090A080A08090909090D0909090606060B0808080808080805
-0808030407030B0808080805070608080B0708070807080B09090908090A090808080808
-080808080808030303030808080808080808080808070808080708080D0D0D0808090C0A
-0D090909080808090B090807070B0B080705090B080B0908080B09090A0E0D080D060603
-03090B080905080606080808050306140908090808050505050A0A0A0909090308080808
-08080808080807030907090707090809080808090B0707070D0D0D080908050907090809
-080808050908090809080908080808070307040706090809080A08080508050907090609
-060908090809070907070A0B08080708070B0808070F0B080A05070E0408050508050908
-090809080808080808080908090809080908090805030503050305030604080707070309
-0809080A080A0808050907090609080908090809080D0B09080409080C0B0A08060D0B0D
-0B0D0B0908030808090D0D0D0D0308080809090A060B0A0C030908090809090508090B09
-080A0908090909090B0B05090807080308080906080803080808080708080708080B0B03
-0808080B080A0709090505060F0D0B080909090808070A080D080909080A0B090A090809
-09090B090A090D0E0A0C08090D080808080608080B070808080809080808080807080B07
-09080B0C080907080B0808080608070303040C0D0808080807060D0F0807070707070707
-000000000A08090900000000080808080808080808080808080808090809080908090809
-080908090809080908090809080908080808080808080808080808080808080503050300
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000A080A080A080A080A080A080A080A080A080A080A08
-0A0809080908090909090909090909090908090809080908080008000E150E0005050606
-0B090F0A040606090B050705060909090909090909090906060B0B0B080E0A0A0A0B0908
-0B0A05060A080B0A0B080B0A0A090A0A0F0A090A0606060B090908090709080509090305
-08030D0909090906080609080B0908080906090B0A0A0A090A0B0A080808080808070808
-0808030303030909090909090909090909080909090809090E0E0E09090B0E0B0E0B0B0B
-0909090A0B0A0908080B0D0908060B0B090B0A09090B0A0A0B0F0E090E060604040B0B08
-0905090606090909050406150A090A0909050505050B0B0B0A0A0A030909090909090909
-090908030A080A08060B09090808090B0B0808080E0E0E090B09050A080A070A07090905
-0A080A080B090B090809080803080408060A090A090B090A060A060A08090609060A090A
-090A080A08080B0B09090709070B090908100C080A05080F0508050508050A080A070A07
-0908090809080B090B090B090A090A09050305030503050306050A080808030A090A090B
-090B090A060A0809060A090A090A090A090F0B0908040A080E0D0B09060F0B0F0B0F0B09
-080409090A0E0E0E0E030909090A0B0C070C0B0C030A0A0A090A0A050A0A0B0A090B0A08
-0909090A0B0B05090907090309090906090903080809080709090709080B0B030909090B
-090B080A0A050506100F0B0A090B0A0A0A080A090F090B0B0A0A0B0A0B0A080A09090B0A
-0B0A0D0E0B0D0A0A0E0A0809080709080B07090908090A090909090807080B090A080B0C
-090B08080C0808090708080303050D0D0908080908070E10090808080808080800000000
-0B090B0A000000000909090909090909090909090909090A080A080A080A080A080A080A
-080A080A080A080A080A0809080908090809080908090809080908050305030000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000B090B090B090B090B090B090B090B090B090B090B090B090A09
-0A090B0A0B0A0B0A0B0A0B0A0908090809080908090009000F170F00050506070C0A100B
-0407070A0C050705070A0A0A0A0A0A0A0A0A0A07070C0C0C080F0A0A0B0B09090C0B0507
-0A080D0B0C090C0A0A090B0A0F0A090A0707070C0A0A0909080909050909030509030F09
-0A090906080609090D0909090A070A0C0A0A0B090B0C0B09090909090908090909090303
-0303090A0A0A0A0A090909090A080A0A0A080A090F0F0F0A0A0C0F0C0F0C0C0C0A090A0B
-0C0B0A08080C0E0A08060C0C0A0C0B0A0A0C0A0A0C100F0A0F070704040C0C0909050A07
-0709090A050407170A090A0909050505050C0C0C0B0B0B030A0A0A0A0A0A0A0A0A0A0803
-0A080A09070B09090909090C0C0808080F0F0F0A0C09050A080B080B08090A050A090A09
-0B0A0B090909090803080408070B090B090C0A0A060A060A08090609060B090B090A090A
-09090C0D090A080A070B0A0908110D080B0508100509050509050A090B080B0809090909
-09090C090C090C090B090B09050305030503050307050A090908030B090B090C0A0C0A0A
-060A0809060B090B090B090B080F0D0909050A090F0E0C0A070F0D0F0D0F0D0909040A0A
-0B0F0F0F0F030A0A0A0A0B0D070D0B0D030A0A0B090A0B050A0A0D0B0A0C0B090A09090A
-0D0C0509090809030909090709090309090909080A0A0809090B0D03090A090D090C090B
-0A05050711110C0A0A0B0A0A0A090B090F090B0B0A0B0D0B0C0B090B090A0D0A0B0B0F10
-0C0E0A0B100A0909090709090D08090909090A090A09090807090D090A090D0E0A0C0908
-0D0909090708080303050E0E0909090909070F120908080808080808000000000C0A0C0A
-000000000A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A090A090A090A090A090A090A090A090A
-090A090A090A090909090909090909090909090909090905030503000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0B090B090C0A
-0C0A0C0A0C0A0C0A090909090909090909000A0010181000060606070D0A110C0407070A
-0D060706070A0A0A0A0A0A0A0A0A0A07070D0D0D09100B0B0B0C0A090C0C07070B090D0C
-0D0A0D0B0A0A0C0B110B0B0B0707070D0A0A0A0A080A0A060A0A050609050F0A0A0A0A06
-09070A090D0909090A070A0D0B0B0B0A0C0D0C0A0A0A0A0A0A080A0A0A0A050505050A0A
-0A0A0A0A0A0A0A0A0A090A0A0A090A0A1010100A0A0D100D100D0D0D0A0A0A0C0D0B0A09
-090D0F0A09060D0D0A0D0C0A0A0D0B0B0D11100A10070704040D0D090B060A07070A0A0A
-060407180B0A0B0A0A070707070D0D0D0C0C0C050A0A0A0A0A0A0A0A0A0A09030A090B09
-070C0A0B090A0A0D0D0909091010100A0C0A070A090B080B080A0A060B0A0B0A0C0A0C0A
-0A0A0A0905090509070C0A0C0A0D0A0B060B060A090A070A070C0A0C0A0B090B09090D0D
-0A0A090A070D0A0A09130E0B0C060911050A06060A060B0A0B080B080A0A0A0A0A0A0C0A
-0C0A0C0A0C0A0C0A070507050705070507060B090909050C0A0C0A0D0A0D0A0B060A090A
-070C0A0C0A0C0A0C0A110D0B09050B0A100F0D0A07110D110D110D0B09040A0A0B101010
-10030A0A0A0B0C0E090E0C0E050B0B0B0A0B0C070B0B0D0C0A0D0C0A0B0A0B0B0D0D070B
-0A090A050A0A09070A0A0509090A09080A0A080A090D0D050A0A0A0D0A0D090B0A070707
-12120D0B0B0B0B0B0B090C0A110A0C0C0B0C0D0C0D0C0A0B0A0B0D0B0C0B0F100D0E0B0B
-110B0A0A0A080A0A0D090A0A090A0B0A0A0A0A0907090D090A0A0D0E0A0C09090D0A0A0A
-0809090505060F0F0A09090A090810130A09090909090909000000000D0A0D0B00000000
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B
-0A0B0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0705070500000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0C0A0C0A0D0B0D0B0D0B
-0D0B0D0B0B090B090B090B090A000A00111A1100060607080E0B120C0508080B0E060806
-080B0B0B0B0B0B0B0B0B0B08080E0E0E09110C0C0C0D0B0A0D0D08080C090E0D0D0A0D0C
-0C0A0C0C110C0A0C0808080E0B0B0A0B090B0A060B0B05060A05110B0A0B0B0709070B0A
-0E0A0A090B080B0E0C0C0C0B0D0D0C0A0A0A0A0A0A090A0A0A0A050505050B0A0A0A0A0A
-0B0B0B0B0B090B0B0B090B0B1111110B0B0E110D110E0E0E0B0B0B0C0E0C0B09090E100A
-09070E0E0B0E0C0B0B0E0C0C0D12110B11080805050E0E0A0A060B08080B0B0B0605081A
-0C0B0C0B0B080808080D0D0D0C0C0C050B0B0B0B0B0B0B0B0B0B0A050C090C09080D0A0A
-0A0A0B0E0E0909091111110B0D0B080C090C090C090B0B060C0A0C0A0D0B0D0B0A0B0A09
-05090509080D0B0D0B0D0A0C070C070C090A070A070C0B0C0B0C090C090A0D0E0B0A080B
-080D0B0B09140F0A0C060912060A06060A060C0A0C090C090B0A0B0A0B0A0D0B0D0B0D0B
-0D0B0D0B080508050805080508060C0A0A09050D0B0D0B0D0A0D0A0C070C090A070C0B0C
-0B0C0B0C0B110E0A0A050C0A11100D0A08110E110E110E0A0A050B0B0C11111111040B0B
-0B0C0D0F090F0D10050C0C0C0B0C0D080C0C0E0D0B0D0D0A0B0A0A0C0F0E080A0B080B05
-0B0B0A080B0B050A0A0B0A090A0B090B0A0E0E050B0A0B0E0B0D0A0C0C08080813130E0C
-0A0D0C0C0C0A0D0B110A0D0D0C0D0E0D0D0D0A0C0A0A0E0C0D0C12120D100C0C120C0A0A
-0A080B0A0E080B0B0A0B0C0B0A0B0B09080A0D0A0C0A0F0F0B0E0A090E0A0A0B08090905
-050610100B0A0A0B0A0811140B09090909090909000000000D0A0D0B000000000B0B0B0B
-0B0B0B0B0B0B0B0B0B0B0B0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0B
-0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A080508050000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000D0A
-0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0C0B0C0B0D0B0D0B0D0B0D0B0D0B
-0A0A0A0A0A0A0A0A0B000B00121B1200060607080F0B130D0508080B0F070807080B0B0B
-0B0B0B0B0B0B0B08080F0F0F0A120C0C0D0E0B0A0E0E08080C0A0F0D0E0B0E0D0C0B0D0C
-120C0B0C0808080F0B0B0B0B090B0B060B0B05060B05120B0B0B0B0809070B0B0F0B0B09
-0B080B0F0C0C0D0B0D0E0D0B0B0B0B0B0B090B0B0B0B050505050B0B0B0B0B0B0B0B0B0B
-0B0A0B0B0B0A0B0B1212120B0B0F120E120F0F0F0B0C0B0D0F0D0B0A0A0F110B0A070F0F
-0B0F0D0C0C0F0C0C0E13120B12080805050F0F0B0B070B08080B0B0B0705081B0C0B0C0B
-0B080808080E0E0E0D0D0D050B0B0B0B0B0B0B0B0B0B0A050C090C09080E0B0B0B0B0B0F
-0F0A0A0A1212120B0E0B080C090D090D090B0B070C0B0C0B0E0C0E0B0B0B0B0A050A050A
-080D0B0D0B0E0B0D080D080C090B070B070D0B0D0B0C090C090A0E0E0B0B090B090E0B0B
-0A15100B0D070A13060B06060B060C0B0D090D090B0B0B0B0B0B0E0B0E0B0E0B0E0B0E0B
-080508050805080508060C0B0B0A050D0B0D0B0E0B0E0B0D080C090B070D0B0D0B0D0B0D
-0B120F0B0B050C0B12110E0B08120F120F120F0B0B050B0B0D12121212040B0B0B0C0E10
-0A100E10050C0C0D0B0C0E080C0C0F0D0C0E0E0B0C0B0B0C100E080B0B090B050B0B0B08
-0B0B050B0B0B0B090B0B090B0B0F0F050B0B0B0F0B0E0A0D0C08080814140F0C0B0E0C0C
-0C0A0D0B120B0E0E0C0D0F0E0E0E0B0D0B0B0E0C0E0D13130E110C0D130D0B0B0B080B0B
-0E090C0C0B0B0D0B0B0B0B0A090B0F0B0C0B10100C0E0A0A0F0B0B0B080A090505061010
-0B0B0B0B0A0812150B0A0A0A0A0A0A0A000000000E0B0D0B000000000B0B0B0B0B0B0B0B
-0B0B0B0B0B0B0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0B0B0B0B0B
-0B0B0B0B0B0B0B0B0B0B0B08050805000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000000E0B0E0B0E0B
-0E0B0E0B0E0B0E0B0E0B0E0B0E0B0E0B0E0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0B0B0B0B
-0B0B0B0B0B000B00131D130007070709100C140E0509090C10070907090C0C0C0C0C0C0C
-0C0C0C09091010100A130D0D0D0F0C0B0F0E08090D0B100E0F0B0F0D0D0C0E0D130D0C0D
-090909100C0C0B0C0A0C0B070C0C06070B06120C0C0C0C080A070C0B100B0B0A0C090C10
-0D0D0D0C0E0F0E0B0B0B0B0B0B0A0B0B0B0B060606060C0C0C0C0C0C0C0C0C0C0C0A0C0C
-0C0A0C0C1313130C0C10130F131010100C0C0C0E100D0C0A0A10120C0A0710100C100E0C
-0C100D0D0F14130C130909050510100B0C070C09090C0C0C0705091D0D0C0D0C0C080808
-080F0F0F0E0E0E060C0C0C0C0C0C0C0C0C0C0B060D0A0D0A090F0C0C0B0C0C10100A0A0A
-1313130C0F0C080D0A0D0A0D0A0C0C070D0B0D0B0F0C0F0C0B0C0B0B060B060B090E0C0E
-0C0F0C0D080D080D0A0C070C070E0C0E0C0D0A0D0A0B0F100C0C0A0C090F0C0C0A16110C
-0E070B14060B07070B070D0B0D0A0D0A0C0B0C0B0C0B0F0C0F0C0F0C0E0C0E0C08060806
-0806080609070D0B0B0B060E0C0E0C0F0C0F0C0D080D0A0C070E0C0E0C0E0C0E0C13100C
-0B060D0B13120F0C091310131013100C0B050C0C0E13131313040C0C0C0D0E110A110E11
-060D0D0D0C0D0E080D0D100E0C0F0E0B0D0C0C0D110F080C0C0A0C060C0C0B090C0C060B
-0B0C0B0A0C0C0A0C0B100F060C0C0C0F0C0F0B0D0D0808091515100D0C0E0D0D0D0B0E0C
-120C0E0E0D0E100E0F0E0B0D0C0C100D0E0E14140F110D0D140D0B0C0B090C0B0F0A0C0C
-0B0C0D0C0C0C0C0A090B100B0D0C11110C0F0B0A100B0B0C090A0A06060711110C0B0B0C
-0B0913160C0A0A0A0A0A0A0A000000000F0C0E0C000000000C0C0C0C0C0C0C0C0C0C0C0C
-0C0C0C0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0C0B0C0B0C0B0C0B0C
-0B0C0B0C0B0C0B0806080600000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000F0C0F0C0F0C0F0C0F0C
-0F0C0F0C0F0C0F0C0F0C0F0C0F0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0C0B0C0B0C0B0C0B
-0C000C00141E140007070809100D160F0509090D10070907090D0D0D0D0D0D0D0D0D0D09
-091010100B140E0E0E0F0D0C100F08090E0B110F100C100E0E0C0F0E140E0C0E09090910
-0D0D0C0C0A0C0C070C0D06070C06130D0C0C0C090A080D0C100C0C0B0D090D100E0E0E0D
-0F100F0C0C0C0C0C0C0A0C0C0C0C060606060D0C0C0C0C0C0D0D0D0D0D0B0D0D0D0B0D0C
-1414140D0D101310141010100D0D0D0F100E0D0B0B10130C0B0810100D100F0D0D100E0E
-1015140D140909050510100C0C070D09090D0D0D0705091E0E0D0E0D0D08080808101010
-0F0F0F060D0D0D0D0D0D0D0D0D0D0B060E0A0E0B09100C0C0C0C0C10100B0B0B1414140D
-100C080E0A0E0A0E0A0C0D070E0C0E0C0F0D100D0C0D0C0B060B060B090F0D0F0D100C0E
-090E090E0A0C080C080F0D0F0D0E0B0E0B0B10100C0C0A0D0A100D0C0B17110C0F070B16
-060C07070C070E0C0E0A0E0A0D0C0D0C0D0C100C100C100C0F0D0F0D0806080608060806
-09070E0C0C0B060F0D0F0D100C100C0E090E0A0C080F0D0F0D0F0D0F0D14100C0C060E0C
-1313100C091410141014100C0C050D0D0E14141414040D0D0D0E0F110B120F12060E0E0E
-0D0E0F080E0E110F0D100F0C0D0C0C0E1110080C0C0A0D060D0C0C090D0C060C0C0D0C0A
-0C0D0A0D0C1010060D0C0D100D100B0E0E0808091616100E0C0F0E0E0E0B0F0D130C0F0F
-0E0F110F100F0C0E0C0C100E0F0E151510120E0E150E0C0C0C090C0C100A0D0D0C0C0E0D
-0C0D0C0B0A0C110C0D0C12120D100B0B110C0C0D090B0A06060712120D0C0C0D0B091417
-0D0B0B0B0B0B0B0B00000000110C0F0D000000000D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0E
-0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0D0C0D0C0D0C0D0C0D0C0D0C0D
-0C0D0C080608060000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000100C100C100C100C100C100C100C
-110C110C110C110C110C0F0D0F0D0F0D0F0D0F0D0F0D0F0D0C0C0C0C0C0C0C0C0C000D00
-152015000707080A110D170F060A0A0D11080A080A0D0D0D0D0D0D0D0D0D0D0A0A111111
-0B150E0E0F100D0C1010080A0F0C1210110D110F0E0D0F0E150E0D0E0A0A0A110D0D0D0D
-0B0D0D070D0D06070C06140D0D0D0D090B080D0C110C0C0B0D0A0D110E0E0F0D10110F0D
-0D0D0D0D0D0B0D0D0D0D060606060D0D0D0D0D0D0D0D0D0D0D0B0D0D0D0B0D0D1515150D
-0D111411151111110D0D0D0F110F0D0B0B11140D0B0811110D110F0E0E110E0E1116150D
-150A0A060611110C0D080D0A0A0D0D0D08060A200E0D0E0D0D080808081111110F0F0F06
-0D0D0D0D0D0D0D0D0D0D0C060E0B0E0B0A100D0D0C0D0D11110B0B0B1515150D100D080E
-0B0F0B0F0B0D0D080E0D0E0D100E100D0D0D0D0C060C060C0A100D100D110D0F090F090E
-0B0D080D080F0D0F0D0E0B0E0B0C11110D0D0B0D0A110D0D0B18120D0F080C17070D0707
-0D070E0D0F0B0F0B0D0D0D0D0D0D100D100D100D100D100D08060806080608060A070F0C
-0C0C06100D100D110D110D0F090E0B0D080F0D0F0D0F0D0F0D15110D0C060E0D1414110D
-0A1511151115110D0C060D0D0F15151515040D0D0D0E10120B131013060E0E0F0D0E1008
-0F0E12100E11100D0E0D0D0E1211080D0D0B0D060D0D0C0A0D0D060C0C0D0C0B0D0D0B0D
-0C1111060D0D0D110D110C0F0E08080A1717110F0D100E0E0E0C100D140D10100F0F1210
-11100D0F0D0D110E100F161610130E0F160F0D0D0C0A0D0D110B0D0D0C0D0F0D0D0D0D0B
-0A0C120C0E0D12130D110C0B120D0D0D0A0B0B06060713130D0C0C0D0C0A15190D0B0B0B
-0B0B0B0B00000000120D100D000000000D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0E0D0E0D0E
-0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D08
-060806000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000110D110D110D110D110D110D110D120D120D
-120D120D120D0F0D0F0D100D100D100D100D100D0D0C0D0C0D0C0D0C0D000D0016211600
-0808090A120E1810060A0A0E12080A080A0E0E0E0E0E0E0E0E0E0E0A0A1212120C160F0F
-0F110E0D11110A0A0F0C1310110D110F0F0E100F160F0E0F0A0A0A120E0E0D0E0B0E0D08
-0E0E06080D06150E0D0E0E090B090E0D120D0D0C0E0A0E120F0F0F0E1011100D0D0D0D0D
-0D0B0D0D0D0D060606060E0D0D0D0D0D0E0E0E0E0E0C0E0E0E0C0E0E1616150E0E121511
-161212120E0E0E1012100E0C0C12150D0C0912120E12100E0E120F0F1118160E160A0A06
-0612120D0E080E0A0A0E0E0E08060A210F0E0F0E0E0A0A0A0A111111101010060E0E0E0E
-0E0E0E0E0E0E0C060F0B0F0C0A110D0E0D0D0E12120C0C0C1616160E110E0A0F0B0F0B0F
-0B0E0E080F0D0F0D110E110E0D0E0D0C060C070C0A100E100E110D0F090F090F0B0E090E
-09100E100E0F0C0F0C0C11120E0D0B0E0B110E0E0C1A130E10080C18070D08080D080F0D
-0F0B0F0B0E0D0E0D0E0D110E110E110E110E110E0A060A060A060A060A080F0D0D0C0610
-0E100E110D110D0F090F0B0E09100E100E100E100E16120E0D070F0D1515110D0A161216
-1216120E0D060E0E1016161616050E0E0E0F11130C131114060F0F0F0E0F110A0F0F1310
-0E11110D0F0E0E0F13120A0E0E0B0E060E0E0D0A0E0E060D0D0E0D0B0D0E0B0E0D121206
-0E0D0E120E110C0F0F0A0A0A1918120F0E110F0F0F0C100E150E11110F10131111110D0F
-0E0E120F1110171711140F0F17100D0E0D0A0E0D120C0E0E0D0E0F0E0D0E0E0C0B0D130D
-0E0D13140E110D0C120D0D0E0A0C0B06060814140E0D0D0E0C0A161A0E0C0C0C0C0C0C0C
-00000000120D110F000000000E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0F0D0F0D0F0D0F0D0F
-0D0F0D0F0D0F0D0F0D0F0D0F0D0F0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0A060A0600
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000110D110D110D110D110D110D110D120D120D120D120D
-120D100E100E110F110F110F110F110F0E0D0E0D0E0D0E0D0E000E00172317000808090B
-130F1911060A0A0F13080A080A0F0F0F0F0F0F0F0F0F0F0A0A1313130D17101010120F0D
-12110A0A100D1311120E1210100E111017100E100A0A0A130F0F0E0E0C0E0E080E0F0608
-0E06160F0E0E0E0A0C090F0E130E0E0C0F0A0F131010100F1112110E0E0E0E0E0E0C0E0E
-0E0E060606060F0E0E0E0E0E0F0F0F0F0F0C0F0F0F0D0F0E1717160F0F13161217131313
-0F0F0F1113100F0D0D13160E0D0913130F13110F0F1310101219170F170B0B060613130E
-0E080F0A0A0E0E0F08060B23100F100F0F0A0A0A0A121212111111060F0F0F0F0F0F0F0F
-0F0F0D06100C100C0A120E0E0E0E0E13130C0C0C1717170F120E0A100C100C100C0E0F08
-100E100E120F120F0E0F0E0D060D070D0B110F110F120E100A100A100C0E090E09110F11
-0F100C100C0D12130E0E0C0F0B120F0E0D1B140E11080D19070E08080E08100E100C100C
-0F0E0F0E0F0E120E120E120E110F110F0A060A060A060A060A08100E0E0D06110F110F12
-0E120E100A100C0E09110F110F110F110F17130E0E07100E1616120E0A1713171317130E
-0E060F0F1117171717050F0F0F1011140C141115061010100F10110A101013110F12110E
-0F0E0E1014130A0E0E0C0F060F0E0E0B0F0E060E0E0F0E0C0E0E0C0F0E1313060F0E0F13
-0F120D10100A0A0A1A1913100E111010100D110F160E11111011131112110E100E0E1310
-121018181215101018100E0E0E0B0E0E120C0F0F0E0E100F0E0F0E0C0B0E130E0F0E1414
-0F120D0D130E0E0F0B0D0C06060815150F0E0E0F0D0B171B0F0C0C0C0C0C0C0C00000000
-130E1110000000000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F100E100E100E100E100E100E10
-0E100E100E100E100E100E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0A060A060000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000120E120E120E120E120E120E120E130E130E130E130E130E110F
-110F111011101110111011100E0E0E0E0E0E0E0E0E000F00182518000808090B140F1A11
-060B0B0F14090B090B0F0F0F0F0F0F0F0F0F0F0B0B1414140D18101011130F0E13120A0B
-110D1412130E1311100F121018100F100B0B0B140F0F0E0F0D0F0E080F0F06080E06170F
-0F0F0F0A0D090F0E140E0E0D0F0B0F141010110F1213120E0E0E0E0E0E0D0E0E0E0E0606
-06060F0F0F0F0F0F0F0F0F0F0F0D0F0F0F0D0F0F1818170F0F141713181414140F0F0F11
-14110F0D0D14170F0D0914140F14110F0F141010131A180F180B0B060614140E0F090F0B
-0B0F0F0F09060B25100F100F0F0A0A0A0A131313121212060F0F0F0F0F0F0F0F0F0F0D06
-100D100D0B130F0F0E0F0F14140D0D0D1818180F130F0A100D110D110D0F0F09100E100E
-1310130F0E0F0E0D060D070D0B120F120F130F110A110A100D0F090F09120F120F100D10
-0D0E13140F0F0C0F0C130F0F0D1C150F12090D1A080F09090F09100E110D110D0F0E0F0E
-0F0E130F130F130F120F120F0A060A060A060A060B08110E0E0D06120F120F130F130F11
-0A100D0F09120F120F120F120F18140F0E07100E1717130F0B1814181418140F0E060F0F
-1118181818050F0F0F1012150D151216061010110F10120A111014121013120E100F0F10
-15140A0F0F0C0F060F0F0E0B0F0F060E0E0F0E0C0F0F0C0F0E1414060F0F0F140F130E11
-100A0A0B1B1A14110F121010100E120F170F12121112141213120E110F0F141012111919
-1316101119110E0F0E0B0F0E130D0F0F0E0F110F0F0F0F0D0C0E140E0F0F15150F130E0D
-140E0E0F0B0D0D06060816160F0E0E0F0E0B181C0F0D0D0D0D0D0D0D00000000130F1210
-000000000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F100E100E100E100E100E100E100E100E10
-0E100E100E100E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0A060A06000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000130F130F130F130F130F130F130F130F130F130F130F130F120F120F1210
-12101210121012100F0E0F0E0F0E0F0E0F000F001B291B000A0A0B0C16111D14070C0C11
-160A0C0A0C111111111111111111110C0C1616160F1B12131315111015140B0C130F1714
-15101513121114121B1311130C0C0C16111110110E11100A1111070910071A111011110C
-0E0B11101610100E110C1116121213111415141010101010100E10101010070707071110
-1010101011111111110F1111110F11111B1B1A1111161B151B161616111111141613110F
-0F161A100F0B16161116141111161212151D1B111B0C0C0707161610110A110C0C111111
-0A070C2912111211110B0B0B0B15151514141407111111111111111111110F07120E130E
-0C15111110101116160F0F0F1B1B1B1115110B120E130E130E11110A1210121015111511
-1011100F070F080F0C141114111510130C130C120E110B110B14111411130E130E0F1516
-11100E110D1511110F1F1811140A0F1D09100A0A100A1210130E130E1110111011101511
-15111511141114110B070B070B070B070C091310100F071411141115101510130C120E11
-0B14111411141114111B1611100812101B1A15100C1B161B161B161110071111131B1B1B
-1B061111111214180F181419071213131113140B13131714121514101211111318160B11
-110E11071111100C111107101011100E10110E11101616071110111611150F13120B0B0C
-1E1E161311141213130F14111A11141413141714151410131111161315131C1C15191213
-1C131011100D1110160E1111101113111011110E0D1017101110181811150F0F17101011
-0D0F0E0707091919111010110F0D1B20110F0F0F0F0F0F0F000000001610141200000000
-111111111111111111111111111111121012101210121012101210121012101210121012
-101210111011101110111011101110111011100B070B0700000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000015101510151015101510151015101610161016101610161014111411141214121412
-141214121110111011101110110011001D2C1D000A0A0B0D18121F15080D0D12180B0D0B
-0D121212121212121212120D0D181818101D14141416121116160D0D1410181617111714
-141215141D1412140D0D0D18121211120F12110A1212090A11091C121212120C0F0B1211
-1811110F120D1218141414121617151111111111110F1111111109090909121212121212
-1212121212101212121012121D1D1C1212181D171D181818121312151815121010181C12
-100B18181218151313181414171F1C121D0D0D0808181811120A120D0D1212120B080D2C
-14121412120D0D0D0D17171715151509121212121212121212121009140F140F0D161212
-11121218181010101D1D1D1216120D140F140F140F12120B141114111613161211121110
-091009100D161216121712140C140C140F120B120B15121512140F140F10171812120F12
-0E17121210221912150A101F09120A0A120A1411140F140F121112111211161216121612
-161216120D090D090D090D090D0A14111110091612161217121712140C140F120B151215
-12151215121D1812110914111D1C17120D1D181D181D181211081212151D1D1D1D061212
-12141619101A161A091414141214160D14141816131716111412121419180D12120F1209
-1212110D121209111113110F12120F12111818091212121812171014140D0D0D20201814
-12161414141016121C12161614151816171611141212181416151E1E171B14141E141112
-110E1211170F1313111214121212120F0E1118111312191A13171110181111120E100F09
-090A1B1B12111112100E1D22121010101010101000000000171216130000000012121212
-121212121212121212121214111411141114111411141114111411141114111411141112
-1112111211121112111211121112110D090D090000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000001712
-171217121712171217121712171217121712171217121512151216131613161316131613
-121112111211121112001200203120000B0B0D0F1A142217090F0F141A0C0F0C0F141414
-141414141414140F0F1A1A1A112016161619141219180D0F16121B181913191616141716
-201614160F0F0F1A141413141114130B1414090B13091F141314140E110D14131A131311
-140F141A1616161418191713131313131311131313130909090914131313131314141414
-141114141411141420201F14141A1F19201A1A1A141514171A171411111A1F13110D1A1A
-141A1715151A161619221F14200F0F09091A1A13140C140F0F1414140C090F3116141614
-140D0D0D0D19191917171709141414141414141414141209161116110F1914141313141A
-1A1111112020201419140D16111611161114140C16131613191519141314131209120912
-0F181418141913160E160E1611140D140D171417141611161112191A1413101410191414
-11251C14170C12220A130B0B130B16131611161114131413141319141914191418141814
-0D090D090D090D090F0B16131312091814181419131913160E1611140D17141714171417
-14201A14130A16131F1F19130F201A201A201A141309141417202020200714141416181C
-111C181D091616171416180D16161B1815191813161414161C1A0D14141014091414130F
-141409131314131013141014131A1A091413141A14191216160D0D0F24231A1614181616
-161218141F14181816181B181918131614141A1618172121191D161621171314130F1413
-1A111414131416141314141110131B1315131C1C151912121B1313140F121109090B1D1D
-14131314120F20261411111111111111000000001A131815000000001414141414141414
-141414141414141613161316131613161316131613161316131613161316131413141314
-13141314131413141314130D090D09000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000191319131913
-19131913191319131A131A131A131A131A13171417141815181518151815181514131413
-1413141314001400213221000C0C0D0F1B152418090F0F151B0C0F0C0F15151515151515
-1515150F0F1B1B1B12211717171915131A190D0F17121C191A141A171714181721171417
-0F0F0F1B151514151115140C1515090B140920151415150E110D15141B141411150F151B
-17171715191A181414141414141114141414090909091514141414141515151515121515
-1512151421212015151B201A211B1B1B151515181B171512121B2014120D1B1B151B1815
-151B17171A232015210F0F09091B1B14140C150F0F1515150C090F3217151715150D0D0D
-0D1A1A1A18181809151515151515151515151309171117110F1A14141414151B1B121212
-212121151A150D17111711171115150C1714171419151A151415141209120A120F191519
-151A14170E170E1711140D140D1815181517111711131A1B15141115101A151512261D14
-180C12240B140C0C140C1714171117111514151415141A151A151A15191519150D090D09
-0D090D090F0B1714141209191519151A141A14170E1711140D1815181518151815211B14
-140A171420201A140F211B211B211B141409151518212121210715151517191D121D191E
-091717171517190D17171C19151A1914161414171D1B0D14151115091514140F15150914
-1415141114151115131B1B091514151B151A1317170D0D0F25241B171419171717131915
-2014191917181C191A19141714141B17191822221A1E161722171414141015141A111515
-141417151415151210141C1415141D1D151A13121C14141510121109090B1E1E15141415
-131021271512121212121212000000001B14191600000000151515151515151515151515
-151515171417141714171417141714171417141714171417141714151415141514151415
-141514151415140D090D0900000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000001A141A141A141A141A14
-1A141A141B141B141B141B141B1418151815191619161916191619161414141414141414
-15001500253825000D0D0F111E18281B0A1111181E0D110D111818181818181818181811
-111E1E1E142519191A1D17151D1C10111A151F1C1D161D1A19171B19251917191111111E
-181816171317160D17170A0D160A241716171710130F17161E1616131711171E19191A17
-1C1D1B16161616161613161616160A0A0A0A171616161616171717171814181818141817
-25252418181E241D251E1E1E1818181B1E1A1814141E2316140F1E1E181E1B18181E1919
-1D2824182511110A0A1E1E16170D1811111717180D0A11381917191717101010101D1D1D
-1B1B1B0A18181818181818181818150A19131913111D17171616171E1E14141425252518
-1D171019131A131A1317180D191619161D181D17161716150A150B15111C171C171D161A
-101A101913170F170F1B171B1719131913151D1E17171317121D1817142B20171B0D1528
-0C160D0D160D19161A131A131716171617161D171D171D171C171C17100A100A100A100A
-110D1A1616150A1C171C171D161D161A101913170F1B171B171B171B17251E17160B1916
-24231D1611251E251E251E17160A18181B2525252508181818191C2014211C220A19191A
-17191C101A191F1C181D1C1619171719201E10171713170A1717161117170A1616181613
-16171317161E1E0A1716171E171D151A1910101129291E1A171C191919151C1724171C1C
-1A1B1F1C1D1C161A17171E191C1A26271D22191A261A1617161117161E13181816171A18
-1618171412161F1618162021181D15141F1616171114130A0A0D2222171616181511252B
-1814141414141414000000001E161C180000000018181818181818181818181818181819
-161916191619161916191619161916191619161916191617161716171617161716171617
-161716100A100A0000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000001D161D161D161D161D161D161D16
-1E161E161E161E161E161B171B171C181C181C181C181C18171617161716171617001800
-2A402A000F0F1113221B2D1F0B13131B220F130F131B1B1B1B1B1B1B1B1B1B1313222222
-172A1D1D1D201B18212012131D17231F2119211D1D1A1F1D2A1D1A1D131313221B1B191A
-161A190F1A1B0C0E190C291B191A1A1216111B19221919161B131B221D1D1D1B1F211F19
-191919191916191919190C0C0C0C1B19191919191B1B1B1B1B171B1B1B171B1A2A2A291B
-1B222A212A2222221B1B1B1F221E1B1717222819171122221B221F1B1B221D1D212D291B
-2A13130B0B2222191A0F1B13131A1A1B0F0B13401D1B1D1B1B121212122121211F1F1F0C
-1B1B1B1B1B1B1B1B1B1B180C1D161D1613211A1A19191A22221717172A2A2A1B211A121D
-161D161D161A1B0F1D191D19201B211B191B19170C170C17131F1B1F1B21191D121D121D
-161A111A111F1B1F1B1D161D161821221A1A161A15211B1A1731251A1F0F172D0E190F0F
-190F1D191D161D161B191B191B19211A211A211A201B201B120C120C120C120C130E1D19
-19170C1F1B1F1B211921191D121D161A111F1B1F1B1F1B1F1A2A221A190D1D192A282119
-132A222A222A221A190B1B1B1E2A2A2A2A091B1B1B1D2025172520260C1D1D1E1B1D2012
-1D1D231F1B2120191C1A1A1D2522121A1A161B0C1B1A19131B1A0C19191B1915191A151B
-1923220C1B191B221B21181D1D1212132F2E221D1A201D1D1D181F1B291A20201D1F2320
-2120191D1A1A221D201E2B2C21271D1D2B1E191A19141A1922161B1B191A1D1B191B1A16
-151923191B1925251B2118172319191B1417160C0C0E26261B19191B18142A311B171717
-17171717000000002219201C000000001B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1D191D191D
-191D191D191D191D191D191D191D191D191D191B191B191B191B191B191B191B191B1912
-0C120C000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000211921192119211921192119211922192219
-2219221922191F1B1F1B201C201C201C201C201C1A191A191A191A191A001B002E462E00
-10101215261D32210C15151D26111511151D1D1D1D1D1D1D1D1D1D1515262626192E1F20
-20231D1A24231215201A2722241C24201F1C221F2D201C20151515261D1D1C1D181D1B10
-1D1D0C101B0C2D1D1C1D1D1418121D1B261B1B181D151D261F1F201D2224221C1C1C1C1C
-1C181B1B1B1B0C0C0C0C1D1C1C1C1C1C1D1D1D1D1D191D1D1D191D1D2E2E2D1D1D262E24
-2E2626261D1E1D2126211D1919262C1C191226261D26211E1E261F1F24312D1D2E15150C
-0C26261B1C111D15151D1D1D110C15461F1D1F1D1D121212122424242222220C1D1D1D1D
-1D1D1D1D1D1D1A0C1F18201815241C1C1B1C1D26261919192E2E2E1D241D121F18201820
-181D1D111F1C1F1C231E241D1B1D1B1A0C1A0E1A15221D221D241C201420141F181C121C
-12221D221D201820181A24261D1C181D17241D1D1936281C22111A320F1C10101C101F1C
-201820181D1B1D1B1D1B241D241D241D231D231D120C120C120C120C1510201B1B1A0C22
-1D221D241C241C20141F181C12221D221D221D221D2D261C1B0E1F1C2E2C241C152D262D
-262D261C1B0C1D1D212E2E2E2E0A1D1D1D1F23281929232A0C1F20201D20231220202722
-1E24231C1F1C1C202826121C1D181D0C1D1D1B151D1D0C1B1B1D1B171C1D171D1B26250C
-1D1C1D251D241A201F121215333326201C231F20201A221D2D1C23232022272324231C20
-1C1C262023212F30242A1F2030201C1C1B161D1B25181D1D1B1D201D1C1D1D19171B271B
-1E1C28291D251A19271C1B1D1619180C0C102A2A1D1B1B1D1A162E361D19191919191919
-00000000251C231E000000001D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1F1C1F1C1F1C1F1C1F
-1C1F1C1F1C1F1C1F1C1F1C1F1C1F1C1D1B1D1B1D1B1D1B1D1B1D1B1D1B1D1B120C120C00
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000241C241C241C241C241C241C241C251C251C251C251C
-251C221D221D231E231E231E231E231E1C1B1C1B1C1B1C1B1D001D00324C320012121417
-292036240D17172029121712172020202020202020202017172929291B3222222327201D
-27261517231C2A25271E2723221F252231221F221717172920201E1F1A1F1E121F200F11
-1E0F31201E1F1F151A14201E291E1E1A20172029222223202527251E1E1E1E1E1E1A1E1E
-1E1E0F0F0F0F201E1E1E1E1E20202020201B2020201B201F323231202029322732292929
-202020242923201B1B29301E1B1429292029242020292222273531203217170D0D29291E
-1F122017171F1F20120D174C2220222020151515152727272525250F2020202020202020
-20201C0F221A221A17271F1F1E1E1F29291B1B1B32323220271F15221A231A231A1F2012
-221E221E272027201E201E1C0F1C0F1C1725202520271E23152315221A1F141F14252025
-20221A221A1C27291F1E1A201928201F1B3A2C1F25121C36101E12121E12221E231A231A
-201E201E201E271F271F271F26202620150F150F150F150F1711231E1E1C0F2520252027
-1E271E2315221A1F14252025202520252031291F1E0F221E3230271E173129312931291F
-1E0D202024323232320B20202022262C1B2C262D0F2222232022261523222A252027261E
-221F1F222C29151F1F1A200F201F1E17201F0F1E1E201E191E1F19201E29290F201E2029
-20281C2322151517383729231F262222221C2520311F262623252A2627261E231F1F2922
-26243434272E222334231E1F1E181F1E281A20201E1F23201E201F1B191E2A1E201E2C2C
-20281D1B2A1E1E20181B1A0F0F112E2E201E1E201C18323B201B1B1B1B1B1B1B00000000
-281E262100000000202020202020202020202020202020221E221E221E221E221E221E22
-1E221E221E221E221E221E201E201E201E201E201E201E201E201E150F150F0000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000271E271E271E271E271E271E271E281E281E281E281E281E2520
-2520262126212621262126211F1E1F1E1F1E1F1E1F00200036523600131315192C223A27
-0F1919222C141914192222222222222222222219192C2C2C1D362525262A221F2A291719
-251E2E282B212B2625212825352521251919192C222220221C22201322220F13200F3522
-212222171C1522202C20201C2219222C25252622282B282020202020201C202020200F0F
-0F0F22212121212122222222221D2222221D222136363522222C362B362C2C2C22232227
-2C26221D1D2C34211D152C2C222C2723232C25252B3A35223619190F0F2C2C2021142219
-19222222140F19522522252222171717172B2B2B2828280F222222222222222222221E0F
-251C251C192A21212021222C2C1D1D1D363636222A2217251C261C261C22221425202520
-2A232A222022201E0F1E101E19282228222B2126172617251C2115211528222822251C25
-1C1F2B2C22211C221B2B22221D3F2F2127141E3A1121131321132520261C261C22202220
-22202A222A222A2229222922170F170F170F170F19132520201E0F282228222B212B2126
-17251C21152822282228222822352C212010252036342B2119352C352C352C21200F2222
-27363636360B22222225292F1D3029310F2525262225291725252E28232B292124212125
-2F2C1721221C220F2221201922220F202023201B21221B22202C2C0F2221222C222B1F26
-251717193C3C2C2521292525251F28223521292925282E292B29212621212C2529263838
-2A32252638262021201922202B1C2323202226222122221D1B202D2023212F30232B1F1E
-2D202022191E1C0F0F133131222020221F19363F221D1D1D1D1D1D1D000000002C212924
-000000002222222222222222222222222222222520252025202520252025202520252025
-2025202520252022202220222022202220222022202220170F170F000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000002B212B212B212B212B212B212B212C212C212C212C212C21282228222924
-29242924292429242120212021202120220022003A583A001414171B2F253E2A101A1A25
-2F151A151A252525252525252525251A1A2F2F2F203A2828292D25212D2C181A2820312B
-2E232E2828242A28392824281A1A1A2F252523241E24231424250F14220F382523242419
-1E1725222F22221E251A252F282829252B2E2A2323232323231E232323230F0F0F0F2523
-2323232325252525251F2525252025243A3A3925252F392E3A2F2F2F2525252A2F292520
-202F372320172F2F252F2A25252F28282E3E39253A1B1B10102F2F222415251A1A242425
-15101B582825282525181818182E2E2E2A2A2A0F25252525252525252525210F281E281E
-1A2D23242223242F2F1F1F1F3A3A3A252D2418281E291E291E242515282328232D262D25
-232523200F2011201B2B252B252E2328192819281E241724172A252A25281E281E212E30
-24231E251D2E2524204333242A15203E1323151523152823291E291E2523252325232D24
-2D242D242C252C25180F180F180F180F1A14282222200F2B252B252E232E232819281E24
-172A252A252A252A25392F242211282339372E231A392F392F392F24221025252A3A3A3A
-3A0C252525282C321F332C350F28282925282C182828312B262E2C2327242428332F1824
-241E250F2524221B25240F222225221D23241D2522302F0F2523252F252E21292818181A
-41402F28242C282828212B2538242C2C282B312C2E2C2329242430282C293C3D2D352729
-3C292324231B24232E1E2525222428252325241F1D22312225233333252E212031232325
-1B201E0F0F14353525222225211B3A44251F1F1F1F1F1F1F000000002F232C2600000000
-252525252525252525252525252525282328232823282328232823282328232823282328
-23282325232523252325232523252325232523180F180F00000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00002E232E232E232E232E232E232E232F232F232F232F232F232A252A252C262C262C26
-2C262C262422242224222422240025004366430018181A1F372B4831121E1E2B37181E18
-1E2B2B2B2B2B2B2B2B2B2B1E1E37373725432E2E2F342A2734321D1E2E2538323528352F
-2E29312E422E292E1E1E1E372B2B282A232A28182A2A12172812412A292A2A1D231A2A28
-372828232B1E2B372E2E2F2A3235312828282828282328282828121212122A2929292929
-2A2A2A2A2B242B2B2B252B2A4343412B2B374335433737372B2B2B31372F2B2525374029
-251A37372B37312B2B372E2E3548422B431F1F121237372829182B1E1E2A2A2B18121F66
-2E2A2E2A2A1D1D1D1D353535313131122B2B2B2B2B2B2B2B2B2B26122E232E231E342929
-28292A37372424244343432B342A1D2E232F232F232A2B182E282E28342B342A282A2825
-122514251F322A322A35292F1D2F1D2E23291A291A312A312A2E232E232635372A29222A
-21352B2A254E3A29311825481628181828182E282F232F232A282A282A28342A342A342A
-322A322A1D121D121D121D121E172E28282512322A322A352935292F1D2E23291A312A31
-2A312A312A42372928142E28434035291E4237423742372928122B2B30434343430E2B2B
-2B2E323A243B323D122E2E2F2A2E321D2E2E38322B3532282D29292E3A371D292A222A12
-2A2A281F2A2A1228282B2822292A222A283737122A292A372A35262F2E1D1D1E4B4A372E
-29322E2E2E26322A412932322E3138323532282F2929372E33304546343E2E2F452F2829
-28202A2835232B2B282A2F2B292B2A24212838282B293B3B2B3526253828282A20252312
-12173D3D2A28282B2620434F2B24242424242424000000003629332C000000002B2B2B2B
-2B2B2B2B2B2B2B2B2B2B2B2E282E282E282E282E282E282E282E282E282E282E282E282A
-282A282A282A282A282A282A282A281D121D120000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000003529
-35293529352935293529352936293629362936293629312A312A332C332C332C332C332C
-29282928292829282A002B004B724B001A1A1E223D305137142222303D1B221B22303030
-3030303030303022223D3D3D294B3333343A2F2B3A381F22342A3F383B2D3B34332E3733
-4A332E332222223D30302D2F272F2D1A2F2F151A2C15492F2E2F2F20271E2F2C3D2C2C27
-3022303D3333342F383B372D2D2D2D2D2D272D2D2D2D151515152F2E2E2E2E2E2F2F2F2F
-302930303029302F4B4B4930303D4A3B4B3D3D3D303030373D353029293D482E291E3D3D
-303D3730303D33333B504A304B222214143D3D2C2E1B3022222F2F301B142272332F332F
-2F1F1F1F1F3B3B3B37373715303030303030303030302A1533273327223A2E2E2C2D2F3D
-3D2929294B4B4B303A2F1F3327342734272F301B332D332D3A313A2F2D2F2D2A152A162A
-22382F382F3B2E3420342033272E1E2E1E372F372F332733272A3B3D2F2E262F253B302F
-2957412E371B2A51182D1B1B2D1B332D342734272F2D2F2D2F2D3A2F3A2F3A2F382F382F
-1F151F151F151F15221A342C2C2A15382F382F3B2E3B2E342033272E1E372F372F372F37
-2F4A3D2E2C17332D4A483B2E224A3D4A3D4A3D2E2C143030364B4B4B4B10303030333841
-28423944153333352F33381F34333F38313B382D322E2E33413D1F2E2F262F152F2F2C22
-2F2F152C2C302C262E2F262F2C3E3D152F2E2F3D2F3B2A35331F1F2254533D342E383333
-332A382F492E383834373F383B382D342E2E3D3339354D4E3B4533354E352D2E2D232F2D
-3C2730302C2F34302E302F28252C3F2C302D4243303C2B293F2D2D2F23292715151A4545
-2F2C2C302A234B583029292929292929000000003D2E3931000000003030303030303030
-30303030303030332D332D332D332D332D332D332D332D332D332D332D332D2F2D2F2D2F
-2D2F2D2F2D2F2D2F2D2F2D1F151F15000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000003B2E3B2E3B2E
-3B2E3B2E3B2E3B2E3D2E3D2E3D2E3D2E3D2E372F372F393139313931393139312E2C2E2C
-2E2C2E2C2F003000537E53001D1D21264435593C16262635441E261E2635353535353535
-35353526264444442D5339393A403430403E22263A2E463E4132413A39333D3952393339
-26262644353532342B34311D3435181D31185135323434232B2135314431312C35263544
-39393A343E413D3232323232322B313131311818181835323232323235353535352D3535
-352D35335353513535445241534444443535353C443B352D2D444F322D21444435443C36
-36443939415951355326261616444431331E3526263434351E16267E3934393434222222
-224141413D3D3D18353535353535353535352F18392B392C2640333331323444442D2D2D
-53535335403422392B3A2B3A2B34351E39323932403640343134312E182E192E263E353E
-3541323A233A23392B332133213D353D35392C392C2F414434322B34294235342D614833
-3D1E2E591B321D1D321D39323A2B3A2B3431343134314034403440343E353E3522182218
-22182218261D3A31312E183E353E35413241323A23392B33213D353D353D353D34524433
-31193932524F41322652445244524433311635353C5353535312353535393E482D493F4B
-1839393A34393E223A39463E36413E323833333948442233342B35183433312635341831
-3135312A32342A34314444183432344434422F3A392222265D5C443A333E3939392F3E34
-51333E3E3A3D463E413E323A333344393F3B5657414C393A563B323331273431422C3535
-31343A353235342C293146313632494A35422F2D46323135272D2B18181D4C4C35313135
-2F275361352D2D2D2D2D2D2D0000000043323F3700000000353535353535353535353535
-353535393239323932393239323932393239323932393239323932343134313431343134
-313431343134312218221800000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000041324132413241324132
-41324132433243324332433243323D353D353F373F373F373F373F373331333133313331
-340035005C8C5C002020242A4B3A6343192A2A3A4B212A212A3A3A3A3A3A3A3A3A3A3A2A
-2A4B4B4B325C3F3F40473A354745272A40334E45483748403F39433F5B3F393F2A2A2A4B
-3A3A373930393720393A18203618593A3839392730243A364B3636303A2A3A4B3F3F403A
-4548433737373737373037373737181818183A38383838383A3A3A3A3A323A3A3A323A39
-5C5C5A3A3A4B5B485C4B4B4B3A3B3A434B413A32324B583832244B4B3A4B433B3B4B3F3F
-48625A3A5C2A2A19194B4B3639213A2A2A3A3A3A21192A8C3F3A3F3A3A27272727484848
-434343183A3A3A3A3A3A3A3A3A3A34183F303F302A4738393638394B4B3232325C5C5C3A
-4739273F3040304030393A213F373F37473C473A373A373318331B332A453A453A483840
-2740273F3039243924433A433A3F303F3034484B39382F3A2E493A39326B503843213363
-1E38212138213F37403040303A373A373A37473947394739453A453A2718271827182718
-2A204036363318453A453A4838483840273F303924433A433A433A433A5B4B39361C3F37
-5B5848382A5B4B5B4B5B4B3936193A3A425C5C5C5C133A3A3A3F455032514554183F3F41
-3A3F4527403F4E453C4845373E39393F504B2739392F3A183A39362A3A391836363B362E
-383A2F3A364C4B183A383A4B3A4934403F27272A67654B4039453F3F3F34453A5A394545
-40444E454845374039394B3F46425F6048553F415F413739372B393749303B3B3639403B
-383B39312E364D363B3851523B4935324D37373A2B323018182054543A36363B342B5C6C
-3B32323232323232000000004A38463D000000003A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3F
-373F373F373F373F373F373F373F373F373F373F373F373A373A373A373A373A373A373A
-373A37271827180000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000004838483848384838483848384838
-4A384A384A384A384A38433A433A463D463D463D463D463D393639363936393639003A00
-649864002323272E52406C491B2D2D4052242D242D404040404040404040402D2D525252
-37644445464D3F394E4B2A2D4538544B4F3C4F46443E494463453E452D2D2D5240403C3E
-343E3C233E3F1B223B1B613F3D3E3E2B34273F3B523B3B353F2D3F524444463F4B4F493C
-3C3C3C3C3C343C3C3C3C1B1B1B1B3F3D3D3D3D3D3F3F3F3F403640404037403E64646240
-4052634F6452525240404049524740373752603D3727525240524940405244444F6B6240
-642E2E1B1B52523B3E24402D2D3F3F40241B2E98443F443F3F2A2A2A2A4F4F4F4949491B
-40404040404040404040381B443445352D4E3D3E3B3D3E5252363636646464404E3E2A44
-34463446343E4024443C443C4D414E3F3C3F3C381B381E382E4B3F4B3F4F3D462B462B44
-343E273E27493F493F45354535394F523E3D333F324F403E3774573D4924386C203C2323
-3C23443C463446343F3C3F3C3F3C4E3E4E3E4E3E4B3F4B3F2A1B2A1B2A1B2A1B2D22453B
-3B381B4B3F4B3F4F3D4F3D462B44343E27493F493F493F493F63523E3B1E443C63604F3D
-2D6352635263523E3B1B4040486464646415404040444B5736584B5B1B4445463F454B2A
-4545544B414F4B3C433E3E4557522A3E3E333F1B3F3E3B2E3F3E1B3B3B403B323D3F333F
-3B52511B3F3D3F513F4F3946442A2A2D706E52453E4B444545394B3F613E4B4B4549544B
-4F4B3C463E3E52454C4767694E5C444667473C3D3B2F3E3C503440403B3E46403D403E35
-323B543B403D5859404F3937543C3C3F2F37341B1B225B5B3F3B3B40392F647540363636
-3636363600000000513D4C4200000000404040404040404040404040404040443C443C44
-3C443C443C443C443C443C443C443C443C443C3F3C3F3C3F3C3F3C3F3C3F3C3F3C3F3C2A
-1B2A1B000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000004F3D4F3D4F3D4F3D4F3D4F3D4F3D513D513D
-513D513D513D493F493F4C424C424C424C424C423E3B3E3B3E3B3E3B3E00400000020100
-000007000600000300070014B706020400060204002FCDDDCD002FCDDDCD313021112111
-2521112101000600FA800500FB000600FA0080050000000201230000020305D100030007
-0027401703030202075505080F0901005D042B035D0F051F0502052F5DE4FDE45D003FED
-332F3F3130010323031323353302031AAA1CD6CCCC05D1FBC90437FA2FD3000200A803D1
-0304061400030007002640150206060307010F09400902032C0040000100042C072FED33
-5D2FED5D003F3C332F3C3130010323032303230303042B842BA82B842B0614FDBD0243FD
-BD024300000200C3000005C905D1001B001F00B1407140215609740570097B137B167B17
-7B1A080A091E1D160F1501671501151E0C0F1013140B1407081F1C17001801681801181E
-0502011A06190662191462700B010B03110B111903040D001B011B1B0D171A011D0410B5
-131E020509040CB50F070F1318040B00140114030F0B4F0B020B08003F5D3F5D1217392F
-ED17392FED1739012F332F5D1217392F2F2F5DE42FE4313087C0C0C0C0FD5D71C0C0C0C0
-C08710C0C0C0C0FD5D71C0C0C0C0C0015D01210321152103231321032313213521132135
-2113330321133303210521032105C9FEB35C0134FEA9688168FEF2688168FED6014D5CFE
-CC0157698169010E698169012AFE35FEEE5E011203A4FE8887FE5B01A5FE5B01A5870178
-8701A6FE5A01A6FE5A85FE840003009BFE9704880628002C0033003A00BC408D7D087E16
-70197620702C7A36060E16012B1B16122B230D350D3C163C24352B430D4A164C24432B5A
-08532053335A356B0865206529632B6A30643A171D40090B371D382E11221D2226471B18
-312D1227373400030A067F1E011E050A11470A05060F3C1F3C0221210334207F00010031
-201818063F094F09020900112D1B1E263706031E0930064006700603062F5D33ED173932
-2F5D12392FED2F5DED12392F5D002F3333ED2F2F2F5D121739ED33332F1139392F2B3130
-5D5D011406071123112E012735331E01171E0117112E01272E01353436371133111E0117
-15232E0127111E01171E0125110E0115141601342627113E010488F2C47684E855101362
-2E348B4F28441DA38EE9D17665D4480E4BA3851E461A95A3FDD46B926C02007584788101
-7C9BCD13FE960165013127C60E351113210301B1080F0829A57994CC110110FEF2022C1D
-C42E4709FE51051105209CE8019D08655A5B5CFE585E5719FE620C6200050095FFE30807
-05ED000B000F001B00270033009C40720908060A0918061A0F351808170A1818171A2908
-260A2918261A460D480F4035560D580F680E13791F7625792B76310425512F034F030203
-031F5109020F030E082B51201940190219193151130A4F0C400E020C0E2E2A0016011616
-282A0C0E060F10401002101C2A0F00010000222A10062F33ED332F5DED2F5D123939ED33
-2F5DED2F2F5D003FED332F5DED3F3F3FED332F5DED5D3130015D01140623222635343633
-321625012309011406232226353436333216013426232206151416333236013426232206
-1514163332360374BDB2B6BABEB2B5BA02B3FCF4A5030C0285BEB2B5BABDB2B6BAFABB59
-64665858666459049359646658586664590434E0DADADFE0DADCC0FA2F05D1FBCCE0DADC
-DDE0DADA01B8AC8888ADAD8787FE17AC8888ADAD878700030073FFE1061305F0000B0018
-004500E1406F090F190F3C0C3015301D352D3E3D4F1A471D4F44791C0B6A25603F7B0576
-087B0F761D7A25703E703F090508062A06371408161D142A1437153F290C2A1D26373008
-300A4008400A490C41144F1C431D46204C21412D413C5108590D5B25690566086B0F601D
-1E3F0C161D20231903B8FFC0403B12173703AA190D2C093E05233502163F230A1E082C0D
-3E032F00143806142F3F0C4513201D2F38041A26001E011E1E45140D1A011A1A13152673
-4610F6ED332F5DED332F5D11121739111239392FED2FED121739003F3FED3F121739ED2B
-2F12393912393931305D5D015D013426232206151416173E0113010E01070E0115141633
-323601151406070123270E01232224353436373E01372E01353436373E01333216151406
-070E0107013E0137362635031871585C744F836265C2FE221F3E1F1C24AB9D5DB7016B32
-3C017AF6E573F07FD0FEED34232368356E61353532A161ADD6181D20765E01730E0E0102
-0104A75F6D7B594B744F2387FD0001D20F312A276E4592B35B02AE6060F06DFE90E08E71
-F3C55C86312F531F48926F437932303CAF862C6F2C315A20FE96286034388A30000100A4
-03D10182061400030015400A020203010F0501002C032FED5D003F332F31300103230301
-822B882B0614FDBD0243000100B5FE64030F061400150048403709010907190119072803
-28054F01480348054F075F015F076F016F077F01780278067F07120701010C7A04010830
-000100000F1F04881610F4ED332F5D3C5D003F3F3130015D012326021110123733150E01
-070602151412171E0117030FE5B1C4C4B1E551933F3C4B493E3C9A4DFE64CB01E0012D01
-2D01E0CB0A49BF7F7BFED8A4ABFEE4807BC7450000010093FE6402ED06140015004E403D
-060306131503151326012603261326154701400340134715500350136003601379007602
-700370137614151201040C750001123F040104040B1F00921710F6ED332F5D3C5D003F3F
-3130015D0110020723353E01373612353402272E01273533161202EDC4B1E54D9B3B3E49
-4A3D3F9351E5B1C4023CFED3FE20CB0A45C77B80011CABA401287B7FBF490ACBFE200001
-00A70276047106140011009040094F1301114009103708B8FFC040580910375B025B0554
-0B540E6B026B05640B640E7B027B05730B730E0C01060F0A0B0E08110502060C064F0450
-0402040A0F0C01040C010F131F130200110D4010011008070C4F090109100E020304050B
-060D2809700C010C2F5D33ED1739322F5D1239392F5D1239395D003F335D332F5D331217
-392F332F3331305D012B2B5D01072513231305272D013705033303251705047140FE9606
-8105FE9741017DFE8341016A068107016B40FE8403776ED5FE980168D66ECFCF6ED50167
-FE99D46ECD00000100D2001B05BA04FD000B0039402303AC01045408AC0A0F070107400D
-01300D400D0200AB0A800101012A05AB07400401042F5D3CE4FD5D3CE45D5D002F5D3CE4
-FD3CE4313001211123112135211133112105BAFDDFA6FDDF0221A60221023CFDDF0221A0
-0221FDDF00010093FE8E023F011D0003003540261A012A012B0235003902450048025500
-590264007400C5030C0202035604000004021A0202022F5D332F0010F4322F3130015D09
-012313023FFEE692AE011DFD71028F00000100990231030902E600030020401401420F02
-01020F054F004F055F005F05050000022F332F5D002F5DED3130012135210309FD900270
-0231B500000100FD000001EC011D00030016400C02560108002D2F013F0102012F5DED00
-3FED31302123113301ECEFEF011D0001FFE2FED0035C0614000300364025030100050116
-01250138004900440156016701770186010A011202032F02010200010000022F332F003F
-2F5D31300187ED5D87C009012301035CFD33AD02CA0614F8BC07440000020089FFE1048F
-05EF000B0023004140303601390B340C3B123B18341E4501490B440C4B124B18441E0C15
-4909022149030A0F21009E250F251F25021B2106982410F6ED5D10F6ED003FED3FED3130
-5D011002212002111012212012013E01353426272E01232206070E01151416171E013332
-36048FFBFEF8FEF4F7FA0109010CF7FEF92319192423795F5E7B24221916242179645E7C
-02E9FE6FFE89017C018A018D017BFE7FFCB551DB9A98E04E4D4E4E4F4AEE8E9CD2534E52
-4E00000101160000043C05D6000F003A4023054606060C030E034801080F111F11020502
-1F0F010F0F0C0E20023F036F03700303032F5D33ED39322F5D2F335D003FFD323F332FED
-3130290135211121353236373E0137331121043CFCDA0136FECA3F90252E35049B013098
-03E6881514194D41FAC2000100A10000049105F000200097407B501F601F020503061116
-03151124113B05380D350E3F1D3F1E391F4B05480D450E4F1D4F1E491F5F035D045D055B
-0956115F195E1B5D1C5F1D5F1E6A036406651162156F1E700274117F1A7F1C7F1E25000F
-100F2D082F1C300F400F060F0F0B4A1302021F4A01081F0208211616209E220F221F2202
-101002992110F6322F5D10F6322FED1239003FFD323FED332F5D31305D015D2901353E01
-373E013534262322060723353E01333204151406070E01070E0107210491FC1069D35BC0
-8E99895BD4650A47ED6FE501042B2A27694B6BE4630321D15AB459BADB7F74834042D223
-3ADDBD5593423E784969C554000100A7FFE1047C05F0003D009540700B0B052F1A0B152F
-290B262F293C3C0B35143122342F4A0B45144322432F56015905590B552F6A0B662F6A3C
-780B762F74357B3C1A343A443A023B3A1E491F012D112D022D2D294A1F0931020F0D1F0D
-020D0D114A090A2321371E2E1621032E1E3A37040C03A03F0F3F1F3F020C9A3E10E65D10
-E611173910ED2F2F2FED003FED332F5D3F1239ED332F5D2FFD39395D31305D011E011514
-06070E012322262735331E01333236373E01353426272E012B0135333236353426272E01
-2322060723353E01333216171E0115140607151E01040E303E4A434BCB797CF04D0F55E6
-6B3F8E2C2E2D332D2D804A5A4698B52E292B623E5FD65F0A47ED6F6DA643484AAF77307C
-02CD2B826766AA3F46433B23D1384A2A292C6A5150691E1F17A67F7A36511A1A14443ED1
-233B282C30885B7CB9180E0833000002004D000004B305D1000A000D00684041040D140D
-240D340D440D700D060C0D480606070C0607090D4901050503070303083F0A4F0A020A0F
-0F1F0F02070C04200A090D064F060101010F061F063F0603062F5D332F5D12393333ED39
-395D2F5D003F3F12392F3CFD321239393130018710FD04C0015D01231123112135013311
-3321110104B3DDC0FD3702D1B8DDFE63FDBF01A3FE5D01A3E60348FC7202A0FD60000001
-00BBFFE1048505D1002A0070404E0A081A082B083D0835113D164B0844115A0854296A08
-7A080C1D1D1A490F251F2540250325214A25061E020F0A1F0A020A0A0E4A060A2022204F
-1D011D142100201D09009F2C0F2C1F2C02099B2B10E65D10E611393910ED2F5DED2F003F
-ED332F5D3F1239ED2F5DFD322F31305D011406070E012322262735331E01333236373E01
-353426272E012322060711211521113E01333216171E0104854C4248C7837AE24E0E52DC
-6A4785342C2D352F34955C58A33B0380FD412B5A2179B64C505801D968BE41464B3324D3
-344928322B784F4D6A20261F180C02FFAFFE740404293437AE0000020089FFE104A705ED
-0022003700644044060D160D3925333133374925423143375F01560D5020502165217531
-0E1A0329491D1313174A1D030F023549030A1A2C2F122321001209009C390F391F39022F
-2109983810F6ED5D10E6113910ED2F123939003FED3F1239FD322F2FED123931305D0114
-002322262726023534123736243332161715232E01232200073E01333216171E01073426
-272E01232206070E01151416171E0133323604A7FED5D96EB445565D555D580116B93B50
-290A1C713BD7FF001554A36B5F914C5859CB373F2E703D55924D020241392E6B3F91A601
-E3E3FEE14443530112C1C6013277717F0A0DBF0F1BFEF3E5333523353DBA8D5D7A2D2014
-282A16291F9EB7352C29B1000001009A0000049505D10006004F403209010A0224014801
-4B0258027903070301000120020203000002034A050302080F081F087B02030300020204
-0F00010000042F332F5D12392F12395D003F3FFD11392F3130018710ED87C0015D090123
-012135210495FD5ED602CDFCB003FB04F2FB0E0522AF0003007AFFDE049C05F300190028
-0037009440702D2B3415332234273433441541224427453350155B195A1B5A1F54225F2B
-592C5F31543354376008620E6212621960236027760E76127B2C86121DA926A62F022616
-0A2F04031D4710023548030A1A200013011313002F0A0D292100162620009D390F391F39
-0220210D0D322106973810F6ED332FED5D10E411393910ED11393911332F71ED003FED3F
-ED1217395D31305D01140023222435343637352E0135342433320415140607151E010334
-26232206151416171E01173E01133426272E01270E01151416333236049CFED3E4F2FEE1
-908378730114D5DF010A7E7A8C94EDA5807EA15152258B42634C1F51762F705D5A6DBA8F
-92AF019FC1FF00FAC37CC93B06409872A8E0D6A565C337063CB0024F6B7F786648692912
-3A13428EFD735C6F3816262231A86A87B09600020071FFE3048F05EF0022003700644045
-0804190429043C253C2B352E4C254C2B432E58045F175D18521B70017B250F111D324914
-294914061D020A0A0E4A060A351109232100091A009E390F391F39022C211A963810F6ED
-5D10E6113910ED2F3939003FFD322F3F1239ED2FED123931305D01140207060423222627
-35331E01333212370E01232226272E01353400333216171612073426272E012322061514
-16171E01333236373E01048F595A5BFEEEB9345C240A1D6A41DDFB145DA4615C954B5859
-012CD86CB845555CCA40382F6C3F90A736402D6C424EA04601030342C3FEC270727C0B0C
-BF0F1B0109E9383024343DBC83E4011E434353FEFBA49BBC342D27B4A35F782D1F152A28
-15290002015A00000249045D00030007001E4010015602050656050807002D0600010101
-2F5D3CFD3C003FED3FED313001231133112311330249EFEFEFEF0340011DFBA3011D0002
-00E6FE8E0292045D00030007004C40370A050A061A051A062A052B063504390645044806
-5504590664047404C5070F01560205060607560806063F044F04020404002D000101012F
-5DFD322F5D332F0010F4322F3FED3130015D01231133130123130249EFEF49FEE692AE03
-40011DFCC0FD71028F00000100FE004D058004CB0006005E401073050105045403020306
-540001002C00B8FFE240260A1837031E0A1837031F002F0002030F000100400801300840
-080204050100004001500102012F5D332F1239395D5D002F5D335D2F2B2B31304B535887
-10FD8710FD05C059015D250135011509010580FB7E0482FC72038E4D02017C0201B4FE75
-FE75000200F5016A059703AE00030007003540200554060154060F020102400901300940
-09020405012F004000020000400101012F5D332F5D1239395D5D002F5D33ED2FED313001
-213521112135210597FB5E04A2FB5E04A2030EA0FDBCA0000001010C004D058E04CB0006
-006040107C030103045405050602540101002C01B8FFE240280A1837051E0A1837051F01
-2F0102050F010101400801300840080203050100002F013001400103012F5D332F123939
-5D5D002F5D335D2F2B2B31304B53588710FD8710FD05C059015D09013509013501058EFB
-7E038EFC720482024EFDFFB4018B018BB4FDFF00000200A0000003ED05EF001C00200069
-40470F221F2224140335184F024F034F0544185C0554186904691064187418741C0C0870
-090109061A1E161612341A02081F551E08202B1F1F061F7F0901090F1509172000010000
-172F332F5D1239ED2F5DED332FED003FED333FFD322F111239395D2F31305D015D011406
-070E01071523113E01373E013534262322060723353E013332160123353303ED46393892
-52B34197303A4099796CC1380A46D760D7F9FE75CCCC047362993B39642FE1013125582D
-346F56716F4423CC1B2BD1FAE2D3000200B0FF1E074E05EF0042004F00D640A206020F04
-0B050A090F1B0E1C0F3F0F4016021F041C051F1B1F1C142214271F3F1F4125022C042C05
-2F1B2F1C242220272F3F2F414740444856481D0A05052759496E09650D691A6821652766
-3F664174167B1B70277439743B0F120511081247520E1440151B371404044D53082D2D2A
-510E083D311E51313D020F2D012D051143122D144A123F0B010B0F512051021829140B37
-0F0020007F000300002429376B5010F6ED332F5D123939ED5D2F5DED2F33FD32322F5D00
-3F33ED2F123939ED332F2FED332FCD2B2FED331239392F31305D015D0114020721270E01
-23222635341233321617353311333E013534022726242322040706021514121716043332
-3637150E0123222427260235341237362433320417161201112E01232206151416333236
-074E514BFE481B4A8858A8C9F6AB4970419FF32A2B5B5858FEFCA5A0FEF75F606D685F63
-010A9D56B75461A859BAFEC2727380867474013EB5C401346A6A71FD8F3F64398192747B
-438602978BFEFC6B743C40FEE4E3010E212130FCB64BE159A4010C606067746262FEEF9A
-A5FEEF61656716188E150F7F72730142C3B9013F7575867C7070FEC5FE4002061D19B4A6
-A3A73E000002001A0000055E05D10007000A009840694009014A0645070209090A080287
-01010114000700090A0387040104140505067C067307020334300A400A700A030A090A06
-03017A050105080F0C0106070903050C002400390042005A006A0074000700006E0C0F0C
-010A052B0536054D05550565057B050705640B10E65D5D10F62F5D1217395D003F5D3C3F
-39392F5DED3130015D8710FD5DC0C0C08710FD5DC0C008C0015D005D2123032103230121
-130901055ED392FD7C92C9021E01087CFEFBFEFA019FFE6105D1FC7802DBFD25000300C8
-0000052B05D100150024003300524033050C150C270C550256157F190612112C341E1E07
-1D3408032D3407081615122C0F0F0725150071350F354035021E2C14076C3410F6FD325D
-10F6ED12392F1239ED003FED3FED12392FED39393130015D011406070E01232111213216
-171E0115140607151E01013426272E012B0111213236373E01133426272E012321112132
-36373E01052B544754C99BFDF001B9A3A24A524A6C5A97AEFEB324282F8663EC01005D6E
-2F2F277F3647308962FEC9010682A635383401CA6FAA37423805D118262B875E6A952D08
-1FCB0204364A171B0DFE52131E1E5FFD9A5A6A25190FFDD61B24276400010073FFE50546
-05EC002A0061404A05010D09061416011B0914152515361543145B08580A580E5B105B28
-600361147002760F70141316161A3412022A2A2634060A1600712C0F2C010F2C1F2C2F2C
-3F2C6F2C0520150C682B10F6ED5D5D10F63C003FED332F3FED332F3130015D250E01070E
-012322242726023534123736243332161715232E01232206070E01151416171E01333236
-373305463759483D8F56A2FEF762606C68625F010DA478EF920F7BF28A71B547454D5543
-46BB688FFA6D0E6C182A17131B5B615F0125C2B801226461663A49EB675E494D4BE5969D
-E2474A476262000200C8000005B205D1000E001D003A4027391249126902680D04163408
-03173407087600010F1500741F0F1F2F1F401F601F041714076C1E10F6ED5D10F6ED5D00
-3FED3FED3130015D011402070E01232111213204171612073426272E012B011133323637
-3E0105B2B19366FBCDFE880174DA01015998AACF7A7958C68ABABA8FD5596F6F02E7CBFE
-B65B3F3805D13F375FFEC4D6AFF0453227FB832A3947E800000100C80000049D05D1000B
-003B402309350006100602060601053502030A350108040008010800730D0F0D01060914
-016C0C10F6FD325D10F63C5D3C003FED3FED12392F71ED31302901112115211121152111
-21049DFC2B03D5FCF1030FFCF1030F05D1B0FE68B0FDD700000100C80000047F05D10009
-0034401E053502020701350803070800034F0B02030300640B0F0B01020514076C0A10F6
-FD325D10F4322F5D003F3FED12392FED313001211121152111231121047FFD0F0287FD79
-C603B70521FE5CB0FD3305D100010073FFE305A205EC00240069404907010906060E1D06
-130E210E350E4901410E510E6506650B630E740E741C0F223540230123230C0310101734
-0C021D34030A7609012210220910216C0075260F264026021A1509682510F6ED5D10F6ED
-3312392F2F5D003FED3FED332F1112392F5DED3130015D25060423222427260235100021
-32041715232E01272E01232200111000213236371121352105A27AFEDF87AEFEDE666770
-01A1016C7F010999121F763945AF6FFAFEDD0130010660BF48FE7102536E385360606101
-23C30165019D3D49EB184E1A1F29FEBFFEEEFEDFFEBF261E016DAE00000100C80000053B
-05D1000B003A4023033500081008020808050A070301050809021400780D0F0D400D500D
-03080314056C0C10F6FD325D10F6FD32003F3C3F3C12392F71ED31302123112111231133
-11211133053BC6FD19C6C602E7C602D9FD2705D1FDB8024800010089000002D505D1000B
-002E401909043206030A033201080D6D0A080B5A0A140305025A036D0C10F6F43210FDF4
-3210E6003FFD323FFD32313029013533112335211523113302D5FDB4C3C3024CC3C39804
-A19898FB5F000001002CFFEB02EA05D100150030401C6A017C01021233150307070B3403
-09131312140077170F170106651610E65D10F6ED332F003FFD322F3FED31305D01140623
-22262735331E01333236373E01351121352102EAEFC930A0360B29783F5C6D1A1B0FFEC5
-02010183C4D4110CB90E1E2A2728744C03659E00000100CD0000057505D1000B00A74075
-190956015C09030509280938094A0968098A09D809070F010A091E0119022A012B093901
-3909350B49014909450B5C01650B72007908100202038801C8010201B3000B000809B302
-0B0A030A840A010802050A07030105080B02030A0A0F0D20003000400004500001006E0D
-400D01080314056C0C10F6FD325D10F65D5D322F123939003F3C3F3C1239393130015D87
-10C0C07AFD1804C00187107AFD5D1808C0015D71722901010711231133110133010575FE
-FFFDB394C6C602D3F0FD6702979EFE0705D1FCF70309FD44000100C80000047605D10005
-002040110203043501080000070F07010414016C0610F6ED5D11332F003FED3F31302901
-113311210476FC52C602E805D1FADF00000100C8000005F605D1000C00794059560A0138
-023805360A6F0260036F05600A7F0270037F05700A0B5509560A5A0B0364037403750903
-050A020309000410043404440454046A04060404070B0903010708090A0B030502140078
-0E0F0E1F0E500E030513076C0D10F6ED5D10F6ED111739003F3C3F3C12392F5D12173931
-30015D72005D722123110123011123112109012105F6C6FE6276FE65B9010E018D018001
-130503FC970369FAFD05D1FCC3033D00000100C80000053805D10009006B404E0C071F07
-34074507510761077107077606010F0102061F0115063406440653066B0160067F017006
-0B0C010406025A01550602020701080603010408060102071300780B0F0B400B02021304
-6C0A10F6ED5D10F6FD113939003F3C3F3C12393931300172715D5D005D21230111231121
-0111330538F5FD3EB901330284B90534FACC05D1FB4004C000020073FFE105DA05F00017
-002300564042040004060B0C0B1217001706190C19125701570553075F0B580D58115F13
-53171076097915021B3415022134090A18150373250F25010F251F253F25031E150F6824
-10F6ED5D5D10F6ED003FED3FED5D3130015D011612151402070E01232224272602353412
-373624333216131000232200111000333200051E5B6163595CFBA19DFEFF5A5A61605C58
-01059AA0FF47FEFCE1E3FEFD0108DEDE0107052664FEDEB8B8FEDD6165666863630120B9
-B6012167626869FD610122013BFEC5FEDEFEDBFEC9013700000200C80000049605D10010
-001F0056403D3A143D1D4B144B1D500E540F650F071934000710070207070918340A0309
-080F211F21021115200030004000700004006F210F213F2102190714096C2010F6FD325D
-10F45DED5D003F3FED12392F5DED3130015D011406070E012B01112311213216171E0107
-3426272E012B0111333236373E010496453E4DD2A0C6C6019486BA48555DCE3637307B5E
-C4A778962F2F27040F63A93E4D4DFDD505D12D3039AA874D72241F1BFDAD2B2F306A0002
-0073FE7705F805F000250031008640610B0C0B120418041D190C19121518161D5C0B590D
-59115C1353175719571D742010551F651F751D742D0425252135030B29341E0609760979
-150215022F34090A1E130600337326151B0009061D030F1B73330F33010F331F333F3303
-2C150F683210F6ED5D5D10E61117393210EDE62F2FED003FED3F5D123939ED3FFD322F31
-305D015D010E01232226270E01232224272602353412373624333216171612151002071E
-01333236373303100023220011100033320005F83C753DAED309182D159DFEFF5A5A6160
-5C5801059AA0FF595B61DFBC0464842971181BECFEFCE1E3FEFD0108DEDE0107FE930F0D
-BFB204036863630120B9B60121676268696164FEDEB8FEEFFE8A4B727E190A039F012201
-3BFEC5FEDEFEDBFEC9013700000200C80000059805D10010001F007A405408011D012D01
-3A01391D450F4814481D5A01560F59146F016902600A650B7E01750B110201B300100010
-071A34400201020205183407030105080F211F2140210311150F0D010D0D102000010019
-031400056C2010F632FD322F5D39392F5DED5D003F3C3FED12392F5DED12393130018710
-7AFD18C0015D29010121112311213216171E0115140607133426272E012B011133323637
-3E010598FEFFFE0EFEE9C601A187B448515BA28E612D342B7650E9C85E8C312D2B0250FD
-B005D1232D339B77A1D93701A34063221D17FDCE212D2A6D00010086FFE5050205EC0030
-009A40790B09031F00231B08141F29082818241F242F390836103813351F362A4A084510
-4913451F4A27442A5802551B551F552D6B19661B651F662B602F7B16701F7020742A742D
-86122309400E103708400E103700111A28041D06212125341D020A0A0E34060A2128151A
-111500211A090074320F32703202096A3110E65D10E611393910ED2FED2F003FED332F3F
-ED332F1112173931302B2B5D011406070E012322242735331604333236353426272E0127
-2E013534243332041715232624232206151416171E01171E010502514950D596A1FEFF85
-0E71012882B8CD61634BAF62C6BF013CF39D0106650E55FEEB919FC1607940EC52A6A801
-A957AA3B40483C3BF85E668A73635E1A141A142ACBA3BBEF3C2CEA485F84685D6A1C0E28
-152CB20000010000000004EE05D1000700274018010435060303080F091F094F0903005B
-0114045B4F0501052F5DF4FDE45D003F3FFD323130012111231121352104EEFDECC6FDEC
-04EE0521FADF0521B000000100B2FFE1052905D1001D003A4029231223183D033D094C03
-4C0977137717081C0D031534060A1B1400761F0F1F1F1F401F030F140C6B1E10F6ED5D10
-F6ED003FED3F3C31305D011406070E01232226272E01351133111416171E01333236373E
-01351133052947514DCE898CD0475147C621272C976A6B962D2721C60256A2F1504C464A
-4852E8A9037BFC7B798C394142414239936D038A0001001A0000055E05D10006008C4066
-470148020205040507065706860603061400000105070457048604030414030203080144
-014B02580273017C02060005027503010303020845004A0302020103040024003A005A00
-6A00740006006E080F08010F08010B032B033503550365037B030603640710E65D5D5D10
-F65D1139395D003F3F5D1239393130015D8710FD5DC08710FD5D08C0015D090121013309
-01055EFDE2FEF8FDE2D401D301D305D1FA2F05D1FAE2051E0001005C0000078D05D1000C
-00BB409E470367037903030D010B020404020505080C0B1701190318051908190B290329
-08290B3B023903320434083C09330A3A0B4B02440444084C09430A4B0B55015A0255045A
-0557075909550A65016A0265046A056A09650A7F02700473087C09720A7C0B2E0C140001
-000714060506030301000300090205080B03090C0602060302083B0034064B0044067A00
-75060600720E1F0E3F0E5F0E7F0E0406670D10EE5D10E65D003F3F1217395D5D31300187
-10FD8710FD015D005D09012309012301330901330901078DFE7DDFFEC7FECEDAFE76CB01
-390134C90137013705D1FA2F04D4FB2C05D1FB2A04D6FB1E04E2000100440000053805D1
-000B00C2409775017A07020A04050A1A04150A2C04230A37094D04420A58035F04580557
-09500A570B68036D0468056709600A670B7B04730A170B14000100091408070803140201
-020514060607050407010A0B0602080302080F0D01060216022602360247020509081908
-290839084808050208070A04010406020D00160026003600470050000600660D08090619
-062906390648065F060606660C10F65D3210F65D321117392F2F5D5D5D003F3F12173931
-30018710ED8710ED8710ED8710ED005D015D09022309012309013309010538FDFE0201E5
-FE6AFE60D80207FE05E40191019A05D1FD20FD0F0265FD9B02E802E9FDA3025D00010006
-000004E605D10008007C405D2C012C04280735074001400440075007680470070A160619
-08270628085606590865066A08080814000100061405040502000D050200010004000703
-040107080402050302080F0A1F0A4F0A7F0A04005B01070114045B4F057F0502052F5DF4
-ED3910E45D003F3F1217395D3130015D8710ED8710ED015D005D09011123110133090104
-E6FDF4C6FDF2DB0197019B05D1FCBCFD7302780359FD66029A000001007E0000050805D1
-000900594036030708060813082608360846085608660876080808B30202030707033506
-03020208350108040803020707040209730B0F0B0102690A10E65D10E61139392F123939
-2F003FFD322F3FFD322F31300187107AED5D1887C0290135012135211501210508FB7603
-91FC910452FC6603B0B80469B0B3FB92000100EFFE7802F706140007001C400E05520201
-0652010B030000061F012FED332F3C003FED3FED3130012111211521112102F7FDF80208
-FEA6015AFE78079C8FF9820000010046FED003C006140003003A40280301020A0119012A
-0138014B01590168017801890109011200032F000100030100006002700202022F5D332F
-003F2F5D31300187ED5D87C00123013303C0ADFD33B0FED00744000100ABFE7802B30614
-0007001C400E045207010352010B031F000005012F3C332FED003FED3FED313001213521
-1121352102B3FDF8015AFEA60208FE788F067E8F000100BA02AA05D205D1000600474034
-3B0133034B0145035F0150036F0160037F0170030A69027B02020102050F031F033F035F
-036F0305030305030000004F000200042F335D2F003F332F5D12393931305D015D012309
-0123013305D2C6FE39FE3AC5024D7E02AC0273FD8B0327000001FFFCFED4051AFF4C0003
-0011B6015002000005022F11332F002FED313001213521051AFAE2051EFED47800010154
-051602FA068C000300244016480159026902790204500360037003030303010000022F33
-2F002F332F5D3130015D0123013302FA95FEEFF30516017600020068FFE1041D04780026
-0033007A40540C0A0423190A152304590E511E5C2C690E601D6F2D7B0A7A14701D7B2C0A
-0208283D3011401102111120084F1C011C1C183F20043141080A01080F1D011D1127021A
-001D0B0091350F351F353F35032E1B0B853410F6ED5D10E6113910FD32322F5D003F3FED
-3FED332F5D1112392F5DED123931305D015D2123350E01070E0123222635343637362437
-353426272E012322060723353E01333216171E011503110E01070E01151416333236041D
-BB1955282F7A5297D26D6566011EA42D2A28703D4AB6610A37D06576AF403F42BB56E944
-5164747763A477113D12171FC89B7F9D2D2D20081D40541817102725BF0F24272F2E926C
-FE1D013705141317615560614D00000200B9FFE10490061400130020005140393402350F
-3B1530204402450F4B154020571267127F087B1C0C0E0906174211040C011E40060A0B08
-141B0090221F223F22020E1B091A0C882110F6FD32325D10F4ED003F3FED3F3FED123939
-31305D011406070E012322262707231133113E0133321203342623220607111E01333236
-04904F4347AA665F8E450CB0BC4FB26FC6E5C2849352A8485073499CB102378CE04C4F4F
-2D26340614FDD44153FED0FEE6C8CF4738FD80241CCD00010069FFE703F3047700210057
-40410F234F23022B01220E2A1624183A01350E3A16351849014F0A440E4F164118590155
-0E6901650E7A01730E131010143F0C0421211A3F03090F008D23171B09852210F6ED10F6
-3C003FED332F3FED332F31305D015D250E01232226272E013510003332161715232E0123
-2206151416333236373E01373303F35EA95F79CA484950012DF760B94D0A56B757A0B9B5
-A439762F2948150A462D32474848DC93011201383627D14348D7D0CAD91E18152F110002
-006CFFE10443061400130020004B40333C1A301C38204F1A421C48205806680670100912
-0102110518410E0401081E42050A1114021A0092221F223F22021B1B08852110F6ED5D10
-F6FD3232003FED3F3FED1239393F31305D2123350E01232202113436373E013332161711
-3303112E012322061514163332360443BC51B067C8EB514544B56158884BBCBC4C78479E
-B0889650A475464E013401118EDE4E4C50252701E4FAFF0281221ADCCAC7CF470002006A
-FFE60460047C0018001F005A404026042B0D30043B0D3C1E43044B0D4B1E5A0D50166A0D
-6017780D7A1E0E013C1F1F0F1C3D15040B0B073F0F090C0C191A008F210F211F213F2103
-1F011B12852010F6FD325D10F4ED332F003FED332F3FED12392FED31305D01211416171E
-013332363733150E0123200011100033321215272E01232206070460FCC93E36348F5672
-E7310A5FC66DFEEAFEC8012BF4E2F5B701939697B30C021B67993130305B2CCD2836012D
-011501120142FEF8F32A94A2B2840001004400000312061E0018004B402D081439147505
-030000043F15000B0E3E0811050D080009400902090F090E00080B1A0F11000E400D1037
-0E891910F62B323232FD322F12392F2F5D003F3F33FD323FFD322F3130015D01232E0123
-22061D012115211123112335333534363332161703120A1F6426796D0153FEB3BC7F7FC6
-BB3F652A055E09136B8C269EFC4103BF9E25C7D50C080002006CFE590443047C00230030
-006E404E3D133E2A322C3A3044094B134C2A422C4B305B015D055A166A016C056A167C05
-702011220512211528401E0407070B40030D2E4115070F0601062124121A000618009232
-1F323F32022B1B18853110F4ED5D10E4113910FD32322F5D003FED3FED332F3FED123939
-3F31305D2510002122262735331E01333236373E013D010E01232202113436373E013332
-1617373303112E012322061514163332360443FEFEFEF459A9520A2EC864607E23231E55
-9B78C8EB514641BA5C6183490CB0BC4B81409BB2849952A57FFEE4FEF61917C012352E29
-276E446644430121010790D14C474F272830FCD60261221DD0C6BCC23F00000100B90000
-045F061400160037402203151615751503100D084213040E01010D08021A0091181F1860
-1802100B1A0D881710F6FD325D10F6ED003F3C3F3FED123931305D2123113426272E0123
-22060711231133113E0133321615045FBC1218195E4B4DA84DBCBC58BC63B5BE027C4D87
-262A294C3BFCBE0614FDCD4952DACD00000200AF0000018305DB000300070030401E0144
-02400B0D370203060505087F090109920060041A01607F050105880810F65DE4FDE4E65D
-003F3F3F2BED313001233533032311330183D4D40CBCBC0518C3FA25045D0002FFC2FE59
-021505DB000300190049402E0A051C0502014402400B0D370203163E19050B0B0F40070D
-4F1701177F0A010A0160161A00600A1770190119921B10F65D3232E4FDE42F5D2F5D003F
-FD322F3FED3F2BED31305D012335330314062322262735331E01333236373E0135112335
-210215D4D40CC8A828832C0A1C5F2D485816160DE901A50518C3FA0AC4C8100CB30B1C28
-2828715103849E00000100C1000004AF0614000B007D40512802D801DB090309010F0D1F
-011D021F0D2D012F0D300B400B540B69027A010C020203011A000B000809B4020B0A030A
-0802050A0507010105080B02600A700A020A0A00000D200D400D0208031A05890C10F6FD
-325D11332F332F5D3939003F3C3F3F1239393130018710C0C07AF51804C0018710FD08C0
-015D7121230107112311331101330104AFF8FE407ABCBC021FEDFDF901E974FE8B0614FC
-1A022FFDFC00000100BB0000017706140003001E4011020101087F05010592001A7F0101
-01880410F65DFDE65D003F3F3130212311330177BCBC0614000100B900000717047C002B
-006A4048032403291324132944204426B72A07B62501251F1D1C0817422822041D050110
-1C08402D011F2D302D402D502D702D05001A016110250B1C0F1A101F1A1A1C611F104010
-801003102F5DF4FD3210FD11393910F4ED5D5D003F3C3C3F3F3CFD32111239395D31305D
-2123113426272E01232206071E01151123113426272E012322060711231133153E013332
-16173E01333216150717BC0D151756514F9E4F0304BC0D151756514D9B4DBCBC58AF6372
-9F2772BC6BB8AF027C4886282B2C4F3D173D1EFD35027C4A85282B2B4C3BFCBE045D7C49
-5260556055DFC800000100B90000045F047C00160037402203151615751503100D084213
-040E05010D08021A0091181F18601802100B1A0D881710F6FD325D10F6ED003F3C3F3FED
-123931305D2123113426272E012322060711231133153E0133321615045FBC1218195E4B
-4DA84DBCBC58BC63B5BE027C4D87262A294C3BFCBE045D7C4952DACD0002006AFFE10471
-047C000B0017003E402C3B0E341034143B164B0E441044144B16080F3F0904153F030A0C
-1B0090190F191F193F196F1904121B06851810F6ED5D10F6ED003FED3FED3130015D0110
-002322001110003332000334262322061514163332360471FEE8EBEDFEE90117EDEB0118
-C2AA9799A9AA9896AB022EFEEFFEC4013C01110111013DFEC3FEEFD9D3D3D9D2D9D70002
-00B9FE640490047C00130020004D4035320239153220430249154220561267127E087C1C
-0A0E0906174211040C051E4006090B0C141B0090221F223F22020E1B091A0C882110F6FD
-32325D10F4ED003F3FED3F3FED12393931305D011406070E012322262711231133153E01
-33321203342623220607111E0133323604904E4742B364578D49BCBC4BBB6ACAE1C28A8F
-51A44B5073499DB0023C88E14E4A512628FE2C05F9753F55FECFFEECCAC84639FD87241A
-D4000002006CFE640443047C00130020004B40333B033D1A301C3A204C034B1A461C4A20
-701009120502110418400E04010C1E4205091114021A0092221F223F22021B1B08852110
-F6ED5D10F4FD3232003FED3F3FED1239393F31305D0123110E01232202113436373E0133
-321617373303112E012322061514163332360443BC57AC64C7ED534442B2635A8B480CB0
-BC4E7846A3AA899352A4FE64021A4B490133010E90DD4B4950282730FCBF0278231CDDC2
-C4D34700000100B900000372045D001200384021000D100D200D030C090F000004430A0F
-05090800001440147014020C071A09881310F6FD325D11332F003F3F3CFD322F11123931
-305D01232E012322060711231133153E013332161703720A2A4F3657A24BBCBC70AB5931
-2C2C03900A094D3DFCE7045DA55A4B0507000001006EFFE503D704780033009340710602
-091B1502191B26092A2432093C2442094C245E055D165321562F54326F056C166020642F
-6532147A057F1174207928742B8A01880D851A872894019A1B0B000E1829041E03802201
-2222263E1E0407070B3E030921291B180E1B00211807008E350F351F353F355F357F3505
-07863410E65D10E611393910ED2FED2F003FED332F3FED332F5D1112173931305D015D01
-14062322262735331E0133323635342726272E01272E01353436373E013332161715232E
-0123220615141716171E011716171603D7FDDB7CCF460A59DA647C8C26266C288135937B
-393A38AD6B64CD440A48CE63678E2B2A5E34812B834747014299C43B23D3434F50564222
-221809180E27976E457A302F373123C935494F4E452323160C180A1E494A0001003EFFEA
-02FD059E001B0048402C0C051A052B05030B10073E0D0B0A051B1B173F03094F1D7F1D02
-0E008C1D080D101A0A0807400D103707881C10F62B3232FD322F10F6325D003FFD322F3F
-3333FD322F31305D250E012322263511233533113311211521111416171E013332363733
-02FD357D31ABB27F7FBC0184FE7C0818164D4F2E64160A0A0E12B8CB02529E0141FEBF9E
-FE0358632B28251B0900000100B1FFE10457045D0016003740220B0619077A0703020515
-09051142050A010814021A0092181F186018020B1A08871710F6ED5D10F6FD32003F3FED
-3F3C123931305D2123350E01232226351133111416171E013332363711330457BC5FAE69
-B0C4BC101A1B565249AD4BBC7C4B50D7D002D5FD8455792B2C284C3B03420001003D0000
-047F045D000600864041260429063604390646044906062905390540055105600505061A
-000100041A03020328002703380037034A00470375017A02080005027503010305020802
-010300B8FFC0401E0910370C001C006A007A0004008D080F080103031303650375030403
-820710E65D5D10F45D2B113939003F3F5D1239393130015D8710FD8710FD005D015D0901
-2301330901047FFE3CBDFE3FCC015A0157045DFBA3045DFC870379000001005600000636
-045D000C0088406D0D031D032C012A0229032504260524082B0B34013B0544014B055701
-58045905570B6D02620464086A09640A6B0B79017D02720474087B09730A7A0B1E0C1A00
-0100071A060506000910090205080B03090C0602060502080F061F062F0603008E0E100E
-3F0E6F0E030006830D10F6325D10E65D003F3F1217395D3130018710FD8710FD015D0901
-23090123013313013301130636FEDDAEFEE1FEE3ADFEDAC4CD01179B011EC2045DFBA303
-5DFCA3045DFC9F0361FC9F0361000001003C00000480045D000B00DA408C090B1B011403
-14071B09270327073C003B0134033404340634073B093D0A4C004B014403440444064407
-4B094D0A5A0155035A0555075A09550B6F016003690560076F09660B230F0200083F0230
-084F0240087D02700808091A0A0B0A071A060506011A000B00031A0405040102050B0809
-06047A047506020605040809060106020D010502080B04040A00B8FFC0401C0910370600
-01008D0D0F0D010F0D1F0D400D5F0D040602040104820C10F65D325D5D10F65D2B321117
-395D2F5D003F3F5D1217393130018710ED8710ED8710ED8710ED005D015D212309012309
-0133090133010480EDFEC3FEC1DB01B4FE50ED013B013CDCFE4901ADFE53022D0230FE5A
-01A6FDDA0001003DFE64047F045D0007008C404104063406440650066006700606090307
-0519031705460149035800570179030902071A000100051A040304490046040200030204
-05020C02680101010203030400B8FFC040220910370C001C004A006A007A0005008D090F
-0901030413044504650475040504820810E45D5D10F65D2B1117395D2F003F3F12393931
-30015D8710FD8710FDC0015D005D0901231301330901047FFD74C9D0FE43CC0157015A04
-5DFA0701D20427FCC4033C000001005D000003E3045D00090056403A15083A0335084A03
-45085C03540860087F0370080A0707033E06050202083E01080408030207070402098E0B
-1F0B3F0B5F0B6F0B7F0B0502840A10E65D10E41139392F1239392F003FFD322F3FFD322F
-3130015D2901350121352115012103E3FC7A028BFD830367FD72029F8B03359D86FCC800
-000100ADFE78045906140025005640382F1D3A074A07562367237523063A1D4A1D021D1C
-09533F0A4F0A020A0A01145112012451010B140F00400002000919201F0E000940050105
-2F5D33333CFD3C2F2F5D3C003FED3FED12392F5DFD39395D3130015D012322263D013426
-2B01353332363D0134363B01152322061D01140607151E011D0114163B01045996B3DFA6
-AB3333ABA6DFB39672887B9A89899A7B8872FE78C7BC95A9BF9CBFA995BCC78A7E8CAF8B
-BD371837BD8BAF8C7E000001017AFE78022806140003001B400F0F054F05020201010B00
-1F4F0101012F5DED003F3F3130015D012311330228AEAEFE78079C00000100BBFE780467
-0614002500544034211235023112400240127A0C06131200533F254F25022525091B511C
-010A51090B1B0009010900170E1F050509004F200120202710D62F5D33333C10FD3C2F2F
-5D3C003FED3FED12392F5DFD39393130015D012322061D0114062B01353332363D013436
-37352E013D0134262B01353332161D0114163B01046733ABA6DFB39672887B9A89899A7B
-887296B3DFA6AB3301F8BFA995BCC78A7E8CAF8BBD371837BD8BAF8C7E8AC7BC95A9BF00
-000100BB018B05D1039F001F0056404206030609091309191908170A1518191A3B083418
-4B0844185A035A0A550D541B5B1D60056E14611875047A147518170F1C54060C54061F16
-1F2A000001000F2A00102F33ED2F5DED002F3333ED2FED333130015D010E01070E012322
-26272E0123220607233E01373E01333216171E013332363705D102292D2E82645E925466
-5C325E6409A702292C2B8A605D935550663D676103039F63C04B4D584F667D40AFC464BD
-4D4A5B4D68625BCAA900FFFF001A0000055E07500236002400000117008E002F0175001A
-40130320113011401170118011050200110E060725012B355D350003001A0000055E0801
-0012001E002100DF40442B2040205A18551A501E55206918651A651E09180B170D4A0646
-125906561278027703082020211F02870101011400120020210387040104140505067B06
-74120216510CB8FFC0405D0D10370C033470210121212006120405001C011C0301050813
-114F0F500F600F030F191140095F096F0903090F230106090F1204050C00240039004200
-5A006A0074000700006E230F23010A052B0536054D05550565057B050705642210E65D5D
-10F62F5D1217395D2F5DED2F5DED003F3C3F5D1217392F5DED2F2BED3130015D8710FD5D
-C0C0C08710FD5DC0C008C0015D005D212303210323012E01353436333216151406071334
-26232206151416333236130901055ED394FD8094C90207596BCC9293CB69592C72565672
-7355567236FEFEFEFD019FFE61057F2C9F668FC2C28F64A32A012F56737455567373FBF1
-02CBFD3500010073FE59054605EC00410097406F0A20032B1C20152B250B222B3402330B
-342B4302430B452B5D1F582158255A275E3F6102602B70027626702B160B0B1B0B022D2D
-313429021A061D41413D341D0A101014320C0D0F0F172A0009100920090309091D234371
-2C0071430F43010F431F432F433F436F4305371523684210F6ED5D5D10F43CE41239392F
-5DED332F003FFD322F3FED332F1239393FED332F31305D015D250E01070E01071E011514
-062322262735331E01333236353426270E01232224272602353412373624333216171523
-2E01232206070E01151416171E01333236373305463759480B1A120203BB9326772D091A
-5B326A620202132B12A2FEF762606C68625F010DA478EF920F7BF28A71B547454D554346
-BB688FFA6D0E6C182A17030903133317A2AC0E0CA20A1C5056132D1402025B615F0125C2
-B801226461663A49EB675E494D4BE5969DE2474A47626200FFFF00C80000049D08010236
-002800000117008D001E0175000BB601000D0D020325012B3500FFFF00C80000053807C8
-023600310000011700D7008C0175000BB60100170A050925012B3500FFFF0070FFE105D7
-075002360032FD000117008E009601750018401103002930295029702904020029240F03
-25012B355D35FFFF00B2FFE1052907500236003800000117008E00620175001840110210
-24202440246024040100241E0D1D25012B355D35FFFF0068FFE1041D068C023600440000
-0116008DE300000BB6020036371D2625012B3500FFFF0068FFE1041D068C023600440000
-01160043E800000BB6020035371D2325012B3500FFFF0068FFE1041D068C023600440000
-011600D6E000000BB6020038341D2625012B3500FFFF0068FFE1041D05DB023600440000
-0116008EE000001E4016030F39703902020039103920394039040039341D2625012B5D35
-5D35FFFF0068FFE1041D0653023600440000011600D7E200000BB6020041341D2525012B
-3500FFFF0068FFE1041D07B1023600440000011600DBD300000DB70302003A341D262501
-2B35350000010069FE5903F3047700380080405B0F3A4F3A022A012A0726252A2D252F3B
-01390735253B2D342F4B014F2140254F2D402F590153256C0166257A017525150B081B08
-0227272B3F230417031A3838313F1A090D0D113D090D0C0C142A06061A2026008D3A2E1B
-20853910F6ED10F63C1139392FED332F003FFD322F3FED332F1239393FED332F31305D5D
-015D250E01071E011514062322262735331E01333236353426270E01232226272E013510
-003332161715232E01232206151416333236373E01373303F3214D1D0305B79225742D09
-1A583268620302101D1979CA484950012DF760B94D0A56B757A0B9B5A439762F2948150A
-460F1F0913391CA2AC0E0CA00A1A4E58162E140204474848DC93011201383627D14348D7
-D0CAD91E18152F11FFFF006AFFE60460068C0236004800000116008DFD00000BB6020022
-21121825012B3500FFFF006AFFE60460068C02360048000001160043FD00000BB6020021
-20121825012B3500FFFF006AFFE60460068C023600480000011600D6F900000BB6020024
-20120025012B3500FFFF006AFFE6046005DB0236004800000116008EF9000014400D0330
-2560250202002520120025012B355D35FFFF00A000000246068C023600D500000117008D
-FE830000000BB601000505020325012B3500FFFFFFEB00000191068C023600D500000117
-0043FE970000000BB601000505020325012B35000002FFF50000023C068C0006000A003D
-40247A0174037A057406040201030505030905080800047F0C01000C92071A047F080108
-880B10FD5D32FDE4335D2F2F003F3F2F332F1239393130015D01230B0123133303231133
-023C978F8E93B2E313BCBC0511010BFEF5017BF974045D00000300050000022D05DB0003
-0007000B0041402702010744600401040A050908011A7F000100041A700501057F0D0100
-0D92081A057F090109880C10F65D32FDE4335D2F5DED2F5DED003F3F2F5DED3939313001
-2335330523353313231133022DBDBDFE95BDBDB5BCBC0518C3C3C3FA25045D00FFFF00B9
-0000045F0653023600510000011600D70700000BB6010024170E1525012B3500FFFF006A
-FFE10471068C0236005200000116008DE200000BB602001919060025012B3500FFFF006A
-FFE10471068C02360052000001160043E200000BB602001919060025012B3500FFFF006A
-FFE10471068C023600520000011600D6E200000BB602001C18060025012B3500FFFF006A
-FFE1047105DB0236005200000116008EE2000014400D03301D501D0202001D1806002501
-2B355D35FFFF006AFFE104710653023600520000011600D7E200000BB602002518060025
-012B3500FFFF00B1FFE10457068C0236005800000116008DEE00000BB601001918101225
-012B3500FFFF00B1FFE10457068C023600580000011600430200000BB601001818091625
-012B3500FFFF00B1FFE10457068C023600580000011600D6F800000BB601001B17091625
-012B3500FFFF00B1FFE1045705DB0236005800000116008EFD000016400F02301C501C60
-1C0301001C17091625012B355D35000100BB0087045B0614000B003C4026070A0B000104
-0605AA0606080308010F0D1F0D02006302040708090A010602280563700301032F5DE6ED
-173910E65D003F2F12392FED17393130012513231305350503330325045BFE6D058405FE
-6D01930584050193040A05FC780388058105018EFE7205000002009A02CC03BC05EC000B
-0017002840186A0F65157A0F751504155403030F5409020C2A0000122A062FED332FED00
-3FED332FED5D313001140623222635343633321607342623220615141633323603BCE8A9
-A9E8E8A9AAE7A58666668689636686045CA8E8E7A9A8E8E8A8668B8B6668898C0002009F
-FE97046005C3001C0023007B40553C0A3F2030224B0A4F2040225A0153116C0164117901
-7611791F76230E1D1E180D3F134F130213130D1747060C030F0505201C301C401C031C18
-471C05030F251F2502130021202F090109001D0C0F1804031E09062F33ED1739322F5DED
-2F3C5D002F3333ED2F5D2F3F123939ED33332F5D2F11393931305D250E01071123112600
-353400371133111E011715232E0127113E01373305110E01151416046047B46876E3FEFB
-010BDD7668BA410B37AE7378AD330BFE2787A2984A1E2F03FE9D0167150120FAF2012B16
-0163FEA1032C1FCB2C5209FCB90A552985034214D2BDB5D2000100890000048B05EE0021
-00774050201D3415321D03031E151E251E410E530E5B16630E7302730E091B1805460F08
-1F084F0803081010144908010C0202204A01080F231F23021F02181B20080519060F0605
-190F040220004000020000022F332F5D1217392F2F2F2F33FD3211395D003FFD323F1239
-ED332F2F5DED393931305D015D2901353E01352335331134123332161715232E01232206
-1511211521151406071521048BFBFE7667B0B0FDCD6998400A3E98568C8B019FFE617C62
-0345CF20BDB98A0136C801012211CE2A30A590FEDD8A3D7EBB390B00000200ACFE7F0468
-05EF0043006100A9407F05050A2714051D273E2030424D104F20433240425C105E165132
-63096E106A2B63321152055F205F255F275B2D5B3950426B1F6A20653D654061427C097C
-10742B7431107B50745F0218075F50293A062F0D3333373F2F021111153F0F0D1F0D020D
-181B5F045607333A1B50262911471A1129330704221000010000561A222FED332F5D1217
-39ED2F2F3939ED2F2F123939ED002F5DFD322F3FFD322F111217395D31305D015D011406
-07151E01151406070E012322262735331E01333236353426272E01272627263534363735
-2E01353436373E013332161715232E01232206151416171E0117161716033E0135342627
-2E01272E01270E01070E01151416171E01171E01173E01046876636158424148C27C57A7
-5C0A4FB46C86A2272D299052D6525372666554404340C78057A85B0A3ABD797FA92B2B2B
-845BC85A59F71C1E211D1C4E2C275D46123E1618261F1D1B512C266043144202596AA237
-072E915A4D8A3238361B1FC2253261573841191725143451518162A93907309259518334
-323A1C1DC21B3C5C573947171725152E4F4FFEAB21413A334617181F0C0B1514092D181A
-563132461817200B0A18130B2F00000100B9012103A4040B000B0013B703030900000688
-0C10F6322F002F332F313001140623222635343633321603A4DC9A9ADBDB9A9ADC02969A
-DBDB9A9ADBDB00010089FE95045205D1000D003B40245308610802010F0501054F060106
-0602AA0C030F0F1F0F020529040402290F0D010D0D092F332F5DED332FED5D003FED332F
-5D2F5D3C31305D012311231123112E013534243321045294D695CEFC0104F301D2FE9506
-BAF94603BC05F8CCCFE8000100B9FFE8048D061E0036006D4048052E152E2E132C343913
-39343736490E4636532166217B1B0C3433143D151E3C15032D0007070B3D03092608181B
-303400140C061C060206111B000614300325009038251A26883710F6ED10E611173910ED
-2F5D2F12392FED003F3FFD322F3F1239ED2FED39393130015D0114002322262735331E01
-333236373E0135342623353236353426272E01232206070E01151123113436373E013332
-1615140607151E01048DFEF1DB2C73240A2A63384A6E21231FD3C69D9A161E1B583D395C
-28252DBC48403CB35EB7E58E71A4BE01E1D6FEDD0F0DA518123A31347F4CA6A996778123
-421F1D231D2724845FFBC104387CB73E3A3BAE9770B2200925DF0004009FFF2E076105F0
-000B00170028003700AD407A7C0D7C11701370177A1A74277336070D1A04231E1A122314
-282C0E231022142C16211824233F1936234919472252186B0E641064146B166A19151A19
-2A182818292A25252818311B2A001D101D4F1D0318001D01901D011D0CAD1D06000012AD
-06281AAA31311E19401D011D30AA1E15501D1E0903030F500902003FED332F123939ED2F
-ED2F5D3C12392FED39012FED332F1239ED2F5D71335DFD3C2F39392FED8710FDC0313001
-5D005D011000212000111000212000031000212000111000212000072301231123112132
-16171E0115140607373426272E012B0111333236373E010761FE05FE9AFE9AFE0501FB01
-66016601FB74FE49FECAFECAFE4901B70136013601B7C0DFFEB5A2A501385E7A3B3F3B71
-63201C211F4635957F3E5A1D1F19028FFE9AFE0501FB0166016601FBFE05FE9A013601BC
-FE44FECAFECAFE4401BC820163FE9D0393101F226149618126FD243812110AFECB131719
-3C000003009FFF2E076105F0000B001700330096406D7C0D7C117013701779197223062C
-0E231022142C1633183324332A332E44184124442A442E54185424542A542E6B0E641064
-146B1662186A1D642417257F1801182C2A181E0CAD1E06000012AD06103320330233332F
-521B1F252F2502252529522115501B210903030F500902003FED332F123939ED2FFD322F
-5D2FFD322F5D012FED332F1239ED2F33ED2F5D3C3130015D005D01100021200011100021
-2000031000212000111000212000050E012322243534003332161715232E012322061514
-1633323637330761FE05FE9AFE9AFE0501FB0166016601FB74FE49FECAFECAFE4901B701
-36013601B7FE72569F4EE3FEF8010DDE59AC3E1036A9598E9F9994539D4810028FFE9AFE
-0501FB0166016601FBFE05FE9A013601BCFE44FECAFECAFE4401BC572727F6EAE1010230
-1CB52846ABA59FAE3A34000200AA031106F105D1000E0016005240217B0478057A060379
-0C010B0C0D01030406080815121210135015030D280B0F370BB8FFC440110B0F37022800
-000728090FAE102814AE132FE4FDE42FED332FED2B2B003FFD3C332F1217395D3130005D
-0123112303230323112311331B0133052311231123352106F17C14ED4FEF197BEEBFBFE3
-FC02E57FE5024903110269FE3D01CAFD9002C0FE82017E75FDB5024B75000001021D0516
-03C3068C000300244016470156006600760004500360037003030303010000022F332F00
-2F332F5D3130015D0901231303C3FEEF95B3068CFE8A01760002015A051803BE05DB0003
-000700264015020644016005010500140F010101041401000501052F5D33ED2F5DED002F
-5D3CFD3C3130012335330523353303BEC7C7FE63C7C70518C3C3C300000100F5001B0597
-04FD0013008840541612010C0B080704030E111201020D80029002A002B0020402290303
-0C030D030112045307110E08530D070F0B010B40150130154015020407080B0112110E08
-030D0309030D1004062F004000020000400601062F5D332F5D1217392F2F1217395D5D00
-2F5D3333ED39392FED3939322F2F3130018710FD5D87C0C0C0C010C0C0C0C0C0015D0121
-0323132135211321352113330321152103210597FDA0689968FE5701DA54FDD2025E6999
-6901ABFE2453022F016AFEB1014F9C010C9C014FFEB19CFEF4000002000E0000076D05D1
-000F00130079404F04030B061B041B052A042B053B064A044A054D064D120B1213030414
-05050675057C06020A100E140115730601080B0440000100000F05010564140334130D35
-0A0A13050835123406030E35010508003F3CED3FEDED1239392FED2FED300110F65D322F
-5D1739E62FED393931305D8710FDC0C0C0015D2901112103230121152111211521112101
-112303076DFC50FDF4D4CF0252050DFD1302EDFD1302EDFC50DBEF022CFDD405D1B0FE68
-B0FDD702230259FDA70000030073FF6E05DA064B001D002A003700A640850203000B0A0D
-0C120F1A051C1103190D1F121F1A151C550254045A08590D59115B135017551C792A140B
-090318061B1F0A1F0B1118161B2609272F75037F097F0A7F0B7F0C791270187019701A70
-1B132A2F1E2E043221340C09181B040615023234060A2A2F1E2E04272B15000C09181B04
-0F0073390F39010F391F393F390327150F683810F6ED5D5D10E411173910ED111739003F
-ED3F121739FD11173931305D015D011402070E0123222627072313260235341237362433
-3216173733031612012E01232206070E011514161701342627011E01333236373E0105DA
-63595CFBA173C94F9F84CD656D605C5801059A76C2528E84BC656FFE6F3990596EB44240
-453B3A035C3C3AFD683C91596EB73E434202E8B8FEDD6165663A37E4012664012CC4B601
-216762683737C9FEF464FED7013A2E2D4D4E4CE5938CE04C01B88BE44BFC432D2E504C52
-E100000300A1009D075F047C00170026003500724054051608311526192F2923262C3B34
-441C4B34510256075F0A5F0E5A1351165918553063026D0A631669236C24642C642D1821
-AF33AF0306120F09092AAF1BAF150F7B18743002272A0030180C0099371E2A0C993610F6
-ED10E411393910ED5D002F3CEDED332F1239393CEDED3130015D011402232226270E0123
-2202353412333216173E01333212052E01232206151416333236373E0125342623220607
-0E01071E01333236075FF5CF85DE454FD38FBFE2FACA86DE444FD58DBFE2FC683FB8608A
-9C7F776E7C392225030C807658814A1E33133CBB608A9C0297EFFEF599929794010FD6EE
-010C9A919695FEF1947575A79A85A6615E39470186A5477830672C7377A6000100D700B3
-05B505B6000F004540290E03540F010101010D045408AC0A070C401101301140110200AB
-0A800D010D2A040105AB07400401042F5D3CF43C10FD5D3CF45D5D3C002F3CE4FD3C322F
-5DFD3C31302521352111213521113311211521112105B5FB22021CFDE4021CA6021CFDE4
-021CB39E01A69E0221FDDF9EFE5A000200FE0000058005710006000A0061401605045403
-020306540001002C26012902360139020400B8FFE240240B1837031E0B18370954080303
-00400C01300C400C020504090A040100004001500102012F5D332F1217395D5D002F332F
-2FED2B2B31305D4B53588710FD8710FD05C05909013501150901112135210580FB7E0482
-FC870379FB7E0482012F01E37C01E3B7FE96FE96FE1AA0000002010C0000058E05710006
-000A0063401603045405050602540101002C26002906360039060401B8FFE240260B1837
-051E0B1837095408050501400C01300C400C020503090A040100002F013001400103012F
-5D332F1217395D5D002F332F2FED2B2B31305D4B53588710FD8710FD05C0590901350901
-350111213521058EFB7E0379FC870482FB7E04820312FE1DB7016A016AB7FE1DFC72A000
-0001006C000004A705D1001000834020300E3F10420E4F10540E5B10650E6A10730E7C10
-0A0020090B371020090B370EB8FFE0B3090B370DB8FFE04033090B374601550F700F0305
-0208320B0B0C010F0005070D0307080F121F1202030A005C0501030F05130D5C0C0A0F08
-BF0802082F5D3333E4ED39323210E42F2F5D003F3F1217392FED393931305D012B2B2B2B
-5D090115211521112311213521350133090104A7FE400174FE8EBCFE8E0174FE3DD4014C
-015005D1FCC15E8AFE5601AA8A490354FD6D0293000100BEFE640464045D001500384020
-080205140B051042050900080A0C0102131A0092171F176017020D091A0A881610F6FD3C
-5D10F4FD3939003F3F3FED3F3C12393931302123270E012322262711231133111E013332
-363711330464B20A3B815B567F42BCBC209B5B5D8536BC76414A4640FDF305F9FCBA2752
-433C034000020095FFE0047905EF00220031006640481502151B162E2904241B310A351B
-410A431B560A551A561F5020562A641A661E642A632E751B702E140F06263F0C0C061D19
-19153F1D022C3F060A1A0F232912141A0900002914092FED332F1239ED1139392F003FED
-3FFD322F1112392FED123931305D011402070E01232226353400333216173E0135342623
-22060723353E01333216171E01032E01232206151416333236373E0104794E5255CB71C0
-F3010DCA5A9F4F02029E984EB74E0B51C96089CD3E2A1DCB3C98488DA8877080A322060B
-0345A4FE987B7C62FDCBE4012134411A3B1AD9CA3F37C22C2D6D7C56CEFEC42F36B6AA91
-99C2BE215000000100BBFF43055905D1000C00A9406A01030F08450B8B03D903D30B0601
-08010B2B033208320B5D03660A600B08030203080908B3040304030B0A0BB30202030302
-03080908B3040304030B0A0BB30202030303610A010A07040304070A04020C0C0203090A
-0A6B090109040202040309040B0835050301350B002FED3FED1117392F2F2F5D332F1239
-012F332F1217392F2F2F5D332F313087107AED87C0018710ED8708C00187107AED87C001
-8710ED8708C0015D71052135090135211521011501210559FB6202A1FD69046DFC850288
-FD6603B4BDBF029C0277BCB0FDA748FD730000010090FF3F05FC05D1000B003B40250307
-050009350A0270007F09020414005A6F017F010201010D0514095A00086008700803082F
-5DE4ED11332F5DE4ED5D003FFD3C3C2F3C313001231123112111231123352105FCC8C6FD
-B0C6C8056C0523FA1C05E4FA1C05E4AE0001007100000541045D000B002B401703070500
-093E0A05041A00B001010D051A09B0100801082F5DE4ED11332FE4ED003FFD3C3C2F3C31
-300123112311211123112335210541CABCFE3CBCCA04D003BFFC4103BFFC4103BF9E0001
-008AFE590490061E0021002C4018000004401E00111115400D0D0F231F2302001000091A
-10192F33FD322F2F5D003FFD322F3FFD322F313001232E01232207061511140706232226
-2735331E013332373635113437363332161704900A2073208134356869BC346D310A216C
-228135346868BD3A6636055708153D3D95FB9DCE6D6E0B0AB208153D3D950463CC6F6E0B
-0A0000020097021303B005F000230030005740370A0A06211B0916212E0925215529600E
-6029700E70290B02082552111120081C1C1853200201012E5308061D1125022A1D0B002B
-2A000B2F33ED2F1239FD32322F003FED332F3FFD322F1112392FED12393130015D012335
-0E01070E01232226353436373E0137353426272E012322060723353E013332161503350E
-01070E0115141633323603B0AA1C312C2D514980AF5D4D4EEF88242122573054A8270E2D
-B84DD9BEAA45B736404E5B5E5283022A5E1425131415AA846A8724241F0612354013120A
-300EAC0D20A99FFE74F504100F124D444C4C430000020079021303E405F0000B00170031
-40205D015D055207520B046A0F6515020F530902155303060C2A40000100122A00062F33
-ED2F5DED003FED3FED5D31305D0114022322023534123332120734262322061514163332
-3603E4F4C1C9EDEDC9C1F4B687787A86867A78870401EBFEFD0109E5E5010AFEFCEBACAC
-AEAAAAADAB000001006B0000062105F00027006240440909090D1A091A0D2C092C0D3403
-300530113413460346136A1A641D64216A24101925140204160B341F0226183501160825
-1202191214081502141C272222290E15171C2FC4ED11332FC4123939ED2FED2FED003F3C
-FD3C3FED12173931305D2901113E01373E01353426232206151416171E01171121352135
-26023510002120001114020715210621FDA443842D2F38F8E2E2F83A2F2F7F44FDA401B4
-A8D90172013601360172D9A801B40185275A373A9970C8FDFDC86E9E38395727FE7BAE7C
-580132CC0116015AFEA6FEEACCFECE587C0000030068FFE3073F047C00390043005200B9
-40840B190B1D1C192604200D3604320D383D34414204420D4A3D4241520D5237554B630D
-6137654B13161D4B2A512E622E7B0D7E137C1E7D24732E73387C4B0B47013C2170430143
-124333033018403D36042C2C283F30040B0B073F0F0A5041180A433A011A474412213304
-00470F2D012D0C0C3A1A00472D1B008F544054014D1B001B855310F632ED5D10E4113939
-10ED332F2F5D2F1217392FFD1139003FED3FED332F3FED332F3FED111217392F5D33FD32
-31305D015D01211416171E013332363733150E01232226270E01070E0123222635343637
-362437353426272E012322060723353E01333216173E0133321215272E01272E01232206>
-<07032E01350E01070E01151416333236073FFCCD3C37348E566FD5420C4ED56DA6ED4C15
-5C323F947396D36C655F0124A22E2928703C4FB35A0D37CE659FD33945CA7DD9FBB60525
-20226D4F85B41991141569C0524F61747663C1022F72A234302D5334CD233B686713501C
-242FC2987C992A271C033D41551717112A24BF0F265D5B5268FF00FB3E446625272C968C
-FE6B35844B030915145B535F5C560003005DFF6C047104D900170021002B007840560008
-0F140A19292604001800250200180025020914001800253D1D322B4D1D422B0721261825
-04291B3E0609121504030F04293E030A21261825041E221B0009061215040C00902D0F2D
-1F2D3F2D6F2D041E1B0C852C10F6ED5D10E411173910ED111739003FED3F121739FD1117
-3931305D5D5D015D011000232226270723132E01351000333216173733071E01252E0123
-22061514161701342627011E013332360471FEE8EB548F3B856EAB4B530117ED578E3674
-6F9B4C54FEBC2563379BAA222302442322FE40275F3B96AE022EFEEFFEC42A27C601004D
-E2930111013D2C23ACE74CE0DC1D1DDCD2619436012B619836FD611F1ED900020071FFE2
-03BE05D100030020006D404C0F221F2202131E231E3A053A144B05400D400E400F43165C
-05520F6F05650E651A7A057A0910127F1301131007120155030320201C34070A022B0303
-101F70130113130A200401041915040A2F33ED2F5D12392F5DED332FED003FFD322F3FED
-331239395D2F31305D015D01233533130E01232226353436373E01373533110E01070E01
-151416333236373302C8CCCCF653BA70D7F9453B3A9D44B33C9E2E3644997967C5390A04
-FED3FA571E28D1AB62963E3E6529E1FECF2161282F7C4E716F4225000002012300000203
-05D1000300070027401707070055030305080F0901045D032B055D0F02200202022F5DE4
-FDE45D003F3FED332F3130012335331323133301F9CCCC0AE01AAA04FED3FA2F04370001
-00D2003905B002FA000500294018000002540F0401044007013007400702012A40000100
-00042F332F5DED5D5D002F5DFD322F313025231121352105B0ABFBCD04DE390221A00001
-0086FF6906C906FC0008004A402C15073307440772070407070806140302030207090829
-08590869080408000100010100040351060607080208002F2F1239392FED012F2F332F31
-308710DD5DC0C08710FD08C0005D09012301233521090106C9FC9066FE80ED0189013902
-DA06FCF86D03E18BFCCB065C0001FFDCFF37050005EF002B0077404D070B001F2E08270C
-270F2E212925350D300F400E410F59226607660C0E0C0B0807201D1E21221D220F2D1F2D
-020920201D2209041600160B081E462121281200000449280216161A4900120112002F5D
-FD322F3FFD322F1112392FED393930012F2F1217392F2F5D8710C0C0C0FDC0C0C0313001
-5D01232E012322060F01211521030E01070E012322262735331E01333236371323353337
-3E01373E013332161705000A1D7229797E232A0141FEA3671D5C4041985C2950340A215E
-2C7F812367D9F52A1A5C3E3E99573A4F3405290A1A77A0C28AFE1686B034352A0709B40E
-1480A701EA8AC67BA833332C0A08000200F300CA0598045000190033006D40490A010606
-050E08130A1B06200528082D5B0452115B1E522B680B6432790B743210272730541D1A23
-541D1A002A012A0D0D1654030009542A0300101929000033291A0C290D26291A272F33ED
-3CED2FED332FED002F333333ED2F2FED332F2F5D3333ED2F2FED332F31305D010E012322
-26272E0123220607233E01333216171E0133323637130E01232226272E0123220607233E
-01333216171E0133323637059714B69E4D8C3841682C4B541C9B17B39F488E3B3D6B2D4C
-59139E19AEA348903927802E4E56149D13B79E4D8A3A237C364B541B0450C2C64B2D3437
-607CB6C44A2E303B6D7DFDFCB8C34B2D1F4C6E7CC0C84A2E1C4F637A000200320000059E
-05D100030006004F403148024703025A056A050205041A000003061A010102390236036B
-0264037B02750306020305030000080105010203065401002FED3F1239012F11332F1739
-5D31308710FD8710FD04C0005D015D290101210902059EFA94023201080127FE50FE5105
-D1FAD7047BFB8500000200A600A2047A04760006000D005940107305730C0204400C1037
-0B400C103706B8FFC0B30C10370DB8FFC0401B0C103703000300070A0A07040500010100
-000C0B084007010707082F332F5D123939332F332F123939002F332F1239392F2F31302B
-2B2B2B015D2501350115090105013501150901047AFDF00210FE9B0165FE52FDDA0226FE
-8D0173BF01A35501A2BCFEEFFEEFD901BE5901BDC4FEDAFEDA00000200AE00A204820476
-0006000D005740107C037C0A0204400C10370B400C103702B8FFC0B30C103709B8FFC040
-1A0C10370C080C080505010403014000010000010A0B08070107082F33332F1239392F33
-2F5D123939002F332F39392F2F31302B2B2B2B015D090135090135010501350901350104
-82FDDA0173FE8D0226FE3CFDF00165FE9B02100260FE42C401260126C4FE4357FE5DBC01
-110111BCFE5E000300B2000005DA00DF00030007000B0025401405010206040A55090800
-2B0101042B0505082B092FED332FED332FED003FED173931302123353305233533052335
-3305DACCCCFDD2CCCCFDD2CCCCDFDFDFDFDFFFFF001A0000055E08010236002400000117
-004300640175000BB602000C0E050025012B3500FFFF001A0000055E07C8023600240000
-011700D700330175000BB60200180B050025012B3500FFFF0073FFE105DA07C802360032
-0000011700D7008B0175000BB6020031240F0325012B3500000200780000081C05D10016
-002500554039001C0022301C3022401C40227204720A721C741D72230B14351111011834
-10350D0317341535010811141417170E1203070073271F1507682610F6ED10E61117392F
-FD32003FEDED3FEDED12392FED3130015D29012224272602353412373E01332115211121
-152111210511232206070E01151416171E0133081CFBCEC4FEFD6791B3AE984FF9E8042E
-FD0502FBFD0502FBFC407A92B55F7481716D5BD09236415B0146CFD7013C603344B0FE68
-B0FDD7040479203642F8ABABEE4439280003006AFFE10776047C0024002B00370094406C
-2604200D3204300D32293B2E323032343B364004400D40294D2E403040344D36530D5314
-5C165C1A531C5322620D621C6222700D72221B013C2B121E2B030F283D21042F3F1B040B
-0B073F0F0A353F150A1E122B011A7F2C012C0C0C251A002C18008F393F3901321B188538
-10F6ED5D10E4113910ED332F2F5DFD323939003FED3FED332F3FED3FED1217392FED3130
-015D01211416171E013332363733150E01232226270E01232200111000333216173E0133
-321215272E012322060F0134262322061514163332360776FCDC3C34348D526DCD460C62
-BF69A8E84A45D183E9FEEF0117E38CC84447D78FE1ECB703918D8BAF10B8A49399A0A792
-92A5021B689831312F4F38CD2A347A686F78013C01110115013979726A81FEF4EF2A9B9B
-A4927DD7D5E0CCD4D7D500010099023C047D02DC00030018400C0154020000050F051F05
-02022F5D11332F002FED313001213521047DFC1C03E4023CA00000010099023C076702DC
-00030011B6015402000005022F11332F002FED3130012135210767F93206CE023CA00002
-FFED03E503160614000300070052B502180D103701B8FFE8B3090C3700B8FFE840090910
-3706180D103705B8FFE8B3090C3704B8FFE8401309103701000501050502060100B10202
-04B1062FED332FED003F3C332F5D3C3130012B2B2B2B2B2B0123013303230133031686FE
-F1F0EF86FEF1F003E5022FFDD1022F000002009603E503BF0614000300070050B90004FF
-E8400E0D10370518090C37061809103700B8FFE840200D10370118090C37021809103701
-000501050503070100B1020204B1000601062F5DED332FED003F3C332F5D3C3130012B2B
-2B2B2B2B090123132301231303BFFEF186A5A4FEF186A50614FDD1022FFDD1022F000001
-FFED03E5018606140003002EB502180D103701B8FFE8B3090C3700B8FFE8400D09103701
-00010101020100B1022FED003F335D2F3130012B2B2B0123013301868AFEF1F403E5022F
-000100A003E5023906140003002FB90000FFE8401A0D10370118090C3702180910370100
-010101030100B1000201022F5DED003F335D2F3130012B2B2B090123130239FEF18AA506
-14FDD1022F00000300D2000705BA051100030007000B00414029000B010B5608AC045407
-0F0101015602AC0F070107400D01300D400D0204AB000B2D05AB01400A010A2F5D3CE4FD
-3CE45D5D002F5DF4ED5D10FDF4ED5D313001231133012135210123113303BDEEEE01FDFB
-1804E8FE03EEEE03FE0113FD2BA0FD2B0113000200ACFFC805E00554000300070057403B
-4804470658045706680467067F047006087F057007020705000301000330036003900304
-03B200023002600290020402B220010406020002000201192F3333182F2F123939002F1A
-19FE5DEE5D11173931305D015D090705E0FD66FD66029A01BDFE43FE4301BD028EFD3A02
-C602C6FD3A01DDFE23FE2300FFFF003DFE64047F05DB0236005C00000116008EDD000016
-400F02100E600E700E0301000E0B040025012B355D35FFFF0006000004E607500236003C
-00000117008EFFED01750019401302000E400E500E600E700E0501000E090500252B355D
-35000001FF9A0000034B05D10003001D401138034803680065016903050100030000022F
-332F003F2F3130015D09012301034BFCF4A5030C05D1FA2F05D100010000FFE504CA05EC
-003300CC408758040102B52F0103B81D010237184718571867187718E718F71807013A00
-4A005A006A007A00FA0006032C06502998090109230F5020F71201081218122812581204
-00121203151827190119191D341502002833010133332F34030A272001022320292C0400
-0F12090604260C082A182A282A03002A21210C18007135103407073426150C683410F4ED
-12392F103C10F63C11392FC45F5D111217391117395F5D003FED332F5F5D333FED332F5D
-331112392F5F5D5D3CFD3CDD5D3CFD3C5F5D5F5D5F5D5F5D31305F5D250E012322000323
-37332E013534363723373312003332161715232E01232204072107210E01151416172107
-211604333236373304CA6CB97EF3FE8331862C4B02020202772C5D3A0174F38DBF541050
-C67C9DFF003001DB2CFE3C02030202017C2CFEC4310108969DB2440F3E3326012E010476
-152F161A34187601010128292DD1413DCFB17618341A172E1576B6D13F3D000100BA00AC
-02E0046C0006002C400972050104400C103706B8FFC0400C0C1037030300040501000001
-2F332F123939002F332F31302B2B015D2501350115090102E0FDDA0226FE8D0173AC01B4
-5901B3C7FEE7FEE7000100C200AC02E8046C0006002C40097D030104400C103702B8FFC0
-400C0C10370505010403010000012F332F123939002F332F31302B2B015D090135090135
-0102E8FDDA0173FE8D02260260FE4CC701190119C7FE4D000002004400000453061E0003
-001E005B40370B103A10601A741A04014402031515193F1100070A3E1D0D050509080B14
-0160051A006004140A0492201D071A0B0D0A400D10370A891F10F62B3232FD3210E61139
-10E4FDE42F2F003F3C3F33FD323FFD322F3FED3130015D01233533032311211123112335
-333534363332161715232E012322061D01210453D0D011BCFDF9BC7F7FC8B73E65290A1C
-6A22796A02C90518C3FA2503C2FC3E03BF9E31C1CF0D07AA08146B8C2800000100440000
-0447061E001A004E402D6C077A0702191A191A053E16000C0F3E091205010E08100A011A
-000A0F00921C090C1A10120F400D10370F891B10F62B3232FD3210E6113910ED2F2F003F
-3C3F33FD323FED33332F2F31305D2123112E012322061D01211521112311233533353436
-33321617370447BC2B8B35A2850149FEBDBC7F7FE9DE45902CBC056D080C6C8C2C9EFC41
-03BF9E31BFD10E040800000100BB007C045B06140013005740390B0E0F1011080609AA0A
-0712130001040605AA060A060C030C010F151F150210630063020407080B0C0D0E111201
-0A022803090563700301032F5DF63C10ED173910E6E65D003F2F1239392FED17392FED17
-3931300125132313053505110535050333032515251125045BFE6D058405FE6D0193FE6D
-01930584050193FE6D019301FB05FE7C018405810501A20581050184FE7C058105FE5E05
-000100FD01FF01EC031A00030016400C02560108002D2F013F0102012F5DED003FED3130
-0123113301ECEFEF01FF011B0001FFF6FEEC018F011B0003002EB90000FFE840190D1037
-0118090C370218091037010F0301011F03010300B1022FED002F5D335D2F3130012B2B2B
-09012313018FFEF18AA5011BFDD1022F0002FFF6FEEC031F011B000300070051B90004FF
-E8400E0D10370518090C37061809103700B8FFE840210D10370118090C37021809103701
-0005010505030F071F07020700B1020204B1062FED332FED002F5D3C332F5D3C3130012B
-2B2B2B2B2B0901231323012313031FFEF186A5A4FEF186A5011BFDD1022FFDD1022F0007
-0095FFE30B9305ED000B000F001B00270033003F004B00C640900908060A0918061A083C
-073E1808170A1818171A193C163E2908260A2918261A283C253E460D480F560D580F680E
-17791F7625792B7631794376490625512F034F030203031F5109020F030E08432B513D20
-19401902191949315137130A4F0C400E020C0E462A003A013A402A3A003401342E2A0016
-01163416282A0C0E060F10401002101C2A0F00010000222A10062F33ED332F5DED2F5D12
-3939ED33332F5DED2F5D33ED2F5DED2F2F5D003F3CFD3C332F5D3CFD3C3F3F3FED332F5D
-ED5D3130015D011406232226353436333216250123090114062322263534363332160134
-262322061514163332360134262322061514163332362514062322263534363332160734
-262322061514163332360374BDB2B6BABEB2B5BA02B3FCF4A5030C0285BEB2B5BABDB2B6
-BAFABB596466585866645904935964665858666459043EBEB2B5BABDB2B6BAB259646658
-586664590434E0DADADFE0DADCC0FA2F05D1FBCCE0DADCDDE0DADA01B8AC8888ADAD8787
-FE17AC8888ADAD8787AEE0DADCDDE0DADADFAC8888ADAD878700FFFF001A0000055E0801
-023600240000011700D600280175000BB602000F0B050025012B3500FFFF00C80000049D
-0801023600280000011700D600260175000BB60100100C020325012B3500FFFF001A0000
-055E08010236002400000117008DFFF80175000BB602000C0C050025012B3500FFFF00C8
-0000049D07500236002800000117008E00500175000DB7020100110C020325012B353500
-FFFF00C80000049D080102360028000001170043003C0175000BB601000D0D020325012B
-3500FFFF0089000002D508010236002C00000117008DFF120175000BB601000D0D040925
-012B3500FFFF005D0000030808010236002C0000011700D6FF270175000BB60100100C04
-0925012B3500FFFF007E000002E207500236002C00000117008EFF240175001940130200
-104010501060107010050100100D0409252B355D3500FFFF0089000002D508010236002C
-000001170043FF3E0175000BB601000D0D040925012B3500FFFF0073FFE105DA08010236
-003200000117008D00780175000BB6020025250F0325012B3500FFFF0073FFE105DA0801
-023600320000011700D6008F0175000BB6020028240F0325012B3500FFFF0073FFE105DA
-08010236003200000117004300AA0175000BB6020025250F0325012B3500FFFF00B2FFE1
-052908010236003800000117008D006E0175000BB60100201F0D1D25012B3500FFFF00B2
-FFE105290801023600380000011700D6005B0175000BB60100221E0D1D25012B3500FFFF
-00B2FFE1052908010236003800000117004300AA0175000BB601001F1F0D1D25012B3500
-000100BB00000177045D0003001E4011020501087F05010592001A7F010101880410F65D
-FDE65D003F3F3130212311330177BCBC045D00010136051103E1068C0006003A40275905
-5606690566067A0573060601020350056005700503050560030103500060007000030000
-042F332F5D002F5D332F5D1239393130015D01230B0123133303E19FB9B89BE4E3051101
-00FF00017B00000100ED051D042C06530019003940233902350E4902450E04190D190952
-0F101F1002101652100D600301031928000C28000D2F33ED2FED002F5D3333ED2F5DED33
-2F2F31305D010E01232226272E0123220607233E01333216171E0133323637042C0B846F
-365C292F412734340483088E67325D2A2F49213339030653989A27252B2B5A4C979A2724
-29295C4600010118053703FE05D10003001440090253100101010000022F332F002F5DED
-31300121352103FEFD1A02E605379A0000010113050E0402068C000D0056403A6508650C
-7508750C040D5006600670060306060AAA094003F00302D19003E003029003E003028B00
-03018950030150030159030D2A00072A00062F33ED2FED002F5E71725E5D5E5D715E5D5E
-ED332F5D3C31305D010E0123222627331E013332363704020AC5A9A9C509A60C6B5B596B
-0E068CA8D6D6A8847878840000010221051802F505DB0003000EB50244010015012FED00
-2FED31300123353302F5D4D40518C3000002012D050903E907B1000B00170045402E0F51
-090009300902313009015009600970090309091551030C29200030000200003000600003
-D0000100001229062FED332F5D7172ED002FED332F5D725E715EED313001140623222635
-343633321607342623220615141633323603E9CC9290CECC9293CB917558587576575875
-065E8FC6C5908FC4C48F567776575776760000010161FE59037000140014002440150B02
-1B012B013901041207070B53030D0E2A0000062F332FED003FFD322F2F31305D05140623
-22262735331E0133323635342627331E010370B79225742D091A58326862060399020659
-A2AC0E0CA00A1A4E581D491913340002015605160477068C000300070042B54500450402
-00B8FFE8B30E103704B8FFE840190E10370750036003700303030305019F000100000204
-0204062F33332F2F332F5D002F33332F5D333130012B2B5D09012313230123130477FEFE
-8BA9B0FEFE8BA9068CFE8A0176FE8A0176000001019FFE5F037C000A0014002440150E04
-1E042B043B04040A14141053030D000D2A00062F33ED2F003FFD322F2F31305D010E0123
-222635343637330E011514163332363733037C344B2A8BA90D069B0606535A24511108FE
-790E0C9E8F263E1A1B3C1E524E1B080000010132051103DD068C0006003A402754015902
-64016B0274017B020606050250036003700303030360020102500060007000030000032F
-332F5D002F5D332F5D1239393130015D01032303331B0103DDE4E3E49FB9B8068CFE8501
-7BFF00010000000100180000048005D1000D0047402A3B0B4B0A5A0A7A0A04020B050804
-090309090106030C3501080A030A00000F0F0F01080B140503026C0E10F63232FD325D11
-332F392F2F003FED3F12392F2F12173931305D29011107353711331101150111210480FC
-52BABAC6015DFEA302E8021798A395031AFD78011BA3FEE8FE0700010018000002360614
-000B003D4023490559056905030407010A040B05050B0B030801030800050D92000A011A
-050704880C10F43232FD3232E62F2F003F3F12392F332F12173931305D01071123110735
-37113311370236B5BCADADBCB5037A91FD1702608D9F8A0318FD7194FFFF0086FFE50502
-0801023600360000011700DF004D0175000BB6010034311A0025012B3500FFFF006EFFE5
-03D7068C023600560000011600DFAE00000BB601003734180025012B3500FFFF007E0000
-050808010236003D0000011700DF00320175000BB601000D0A020625012B3500FFFF005D
-000003E3068C0236005D0000011600DF9400000BB601000D0A050625012B35000002017A
-FE780228061400030007002940160F094F090201060106050201050B00041F014F050105
-2F5D3CFD3C003F3F1239392F2F3130015D01231133112311330228AEAEAEAE02F6031EF8
-64031E000002000E000005BC05D100120025005240333816481666026811041B1E083C0B
-0B071A340C031F3407087600011D1D0713150074270F274027602703091B1E140B09076C
-2610F63232FD322F5D10F6ED12392F5D003FED3FED12392FFD393931305D011402070E01
-23211123353311213204171612073426272E012B011121152111333236373E0105BCB193
-66FBCDFE88C4C40174DA01025898AACF7A7958C68ABC0169FE97BC8FD5596F6F02E7CBFE
-B65B3F3802E48F025E3F375FFEC4D6AFF0453227FE4C8FFDC62A3947E8000002006AFFE1
-0471061E001F00310084405B190D290D32013420392B362D45014C0D44204A2B442D5A2B
-542D6F05741E7421100C03293F090F121A1D041B10100903161B1B3F164F160216022F3E
-030A1C111A1D1C030011120F0C26051F162F160216231316090000092C14062FED11332F
-1239ED2F5D17391217392F2F003FED3F5D332F111239392F1217392FED123931305D0110
-00232200353400333216172E01270527372E012735211E01173717071612013E01353426
-272E012322061514163332360471FEE4F1E5FEEB0112CA6C9B56208757FEF842ED54905D
-0127236225D242BA99A6FEDE313403024BA55693A9A98F427B027DFEBCFEA8010EF5E201
-08353570D64AA2618E43512F1019431A80616D93FE9BFD8A3BA99620371E2D2BAF98B4AE
-2C00FFFF0006000004E608010236003C00000117008DFFE40175000BB601000B0A050025
-012B3500FFFF003DFE64047F068C0236005C00000116008DDD00000BB601000A09040025
-012B3500000200C80000049605D100120021005C403E391F491F551180108011051B3400
-0701071A34200C010C0C07090A0309080F231F23021315200030004000700004006F230F
-233F23020C1B071400096C2210F632FD32325D10F65DED5D003F3F1239392F5DED2F5DED
-3130015D011406070E012B011123113311333216171E01073426272E012B011133323637
-3E010496463C4EDB97C6C6C6CD85C243535ECE343830805AC4A777982F2C2903135CA939
-4B48FEBE05D1FEF22D2C35AA7D486B231E19FDCD292D2966000200B9FE64049006140013
-0020004D4035320239153220430249154220561267127E087C1C0A0E0906174211040C01
-1E4006090B0C141B0090221F223F22020E1B091A0C882110F6FD32325D10F4ED003F3FED
-3F3FED12393931305D011406070E012322262711231133113E0133321203342623220607
-111E0133323604904E4742B364578D49BCBC4BBB6ACAE1C28A8F51A44B5073499DB0023C
-88E14E4A512628FE2C07B0FDD43F55FECFFEECCAC84639FD87241AD4000100DC023C05B0
-02DC0003001E401100540F02010240050130054005020000012F332F5D5D002F5DED3130
-0121352105B0FB2C04D4023CA000000101230069056904AF000B00264017D702D80802A7
-0201D705D80B02A80B0105840294020202192F5D002F3130015D71005D71250709012709
-01370901170105696FFE4CFE4C6F01B8FE486F01B401B46FFE48D86F01B8FE486F01B401
-B46FFE4801B86FFE4C00000101230236039205D5000F002E4018055006060C030E03AA01
-0E0505020F0F0C0E2A02100301032F5D33ED39322F2F332F003FFD323F332FED31300121
-35331123353236373E01373311330392FD99EAF22D6C1E252C0387DD02367A0238700D0C
-102C28FCDB00000100CF023603C705EF001D0045402D24152518361535184C105E106D10
-651866197D1075180B0F0F0B521302021C52010E00001C02082A16101610022F33332F2F
-ED1239332F003FFD323FED332F3130015D0121353E01373E013534262322060723353E01
-333216151406070E01072103C7FD0864A733834A6B5A59AC300D47AF57B4BB6173379B42
-022002369C3E6E29676754454C3D1FB41A239D7D63975A2B6629000100CF020F03BC05F0
-002E007740162A033903450C4A1F540C5C1F6B0864237D0874230A27B8FFC040390B0E37
-2C2B15520F16010F161F164F165F16CF16FF16061621211D52160625020A0A0E52060F1A
-2A281622112A2216282C04091000010000092F332F5D121739ED2F2F2FED003FED332F3F
-1239ED332F2F5D71ED393931302B5D011406070E012322262735331E013332363534262B
-01353332363534262322060723353E0133321615140607151E0103BC42383994595EA54A
-0E29C35D648576708F80706B63684DC32C0E4AAD5AAFC16E595F8303314B712223211E1C
-B3243B474B553C8D4D443D473E24B21B23886A59721A08116F00FFFF00AB000007A305D5
-0036023B9200003700BB023700000117023C0404FDC300204015020E08020E400E600E02
-010B2B0B5B0B6B0B7F0B045D11355D1135003F35FFFF00AB0000074105D50036023B9200
-003700BB023700000117023E0384FDC3002640190302100803020E1F0E5F0E7F0E03010B
-2B0B5B0B6B0B7F0B045D11355D113535003F3535FFFF008C0000077905ED0026023DA600
-002700BB029100000107023E03BCFDC30036402603023608030236103630367F36030131
-003134314B315F316B317B3106000900093F094F09035D11355D11355D113535003F3535
-0001003C0000047405D10011005840330C0F09512F063F060206060B02344F0501050510
-0B01341003200301080803032F00010000130E01050A140F0E2F0B3F0B020B2F5D3333FD
-32322F11332F5D332F392F5D003FED2F12392F5DED12392F5DED39393130012111211521
-1121152111231123353311210474FD3E028AFD76014AFEB6C0B6B603820526FE55ABFEEF
-8BFECC01348B0412FFFF0073FFE305A208010236002A0000001700D900CF0175FFFF006C
-FE590443068C0236004A0000011600D9FE00000BB6020037311A2325012B3500FFFF0089
-000002D507500236002C0000011700DAFF240175000BB601000D0C040925012B35000001
-0086FE59050205EC004700C240990B0B0A1F0036003A1B0B1B1F13362F0B2A1F292F2436
-24463F0B391F3427392A34363441481F4427482A43364B3E44415F035A05523257365544
-6B026F046A30643264366642604679057A2D703670377541754486292B20400E10371F40
-0E10371A060028313F06341D38383C343402212125341D0A101014530C0D0F0F172A0937
-3F153128150031371D0904200074490F49704902206A4810E65D10E611173910ED2FED2F
-2FED332F003FFD322F3FED332F3FED332F1112173931302B2B5D011406070E01071E0115
-14062322262735331E01333236353426270E012322242735331604333236353426272E01
-272E013534243332041715232624232206151416171E01171E01050251492C683E0303B3
-9A25742D091A523868620302142515A1FEFF850E71012882B8CD61634BAF62C6BF013CF3
-9D0106650E55FEEB919FC1607940EC52A6A801A957AA3B233711162C199DB10E0CA20A1C
-4E5818291201023C3BF85E668A73635E1A141A142ACBA3BBEF3C2CEA485F84685D6A1C0E
-28152CB20001006EFE5903D70478004A00AA40810820090C37090204321902173224202B
-3B34203A3B43204B3B5A1C5C2D5237534652496B1C6B2D6237624662497C1C7C28743779
-3F74428B0188248531873F1D170300252F4006351A80390139393D3E35041E1E223E1A09
-0D0D1153090D0C0C142A0638401B2F251B002F381A06041D008E4C0F4C1F4C3F4C5F4C7F
-4C051D864B10E65D10E611173910ED2FED2F2FED332F003FFD322F3FED332F3FED332F5D
-1112173931305D2B011406071E011514062322262735331E01333236353426270E012322
-262735331E0133323635342726272E01272E01353436373E013332161715232E01232206
-15141716171E011716171603D77F6F0205B79225742D091A5832686203021528177CCF46
-0A59DA647C8C26266C288135937B393A38AD6B64CD440A48CE63678E2B2A5E34812B8347
-4701426BA32A13361AA2AC0E0CA00A1A4E58182D0F02023B23D3434F5056422222180918
-0E27976E457A302F373123C935494F4E452323160C180A1E494AFFFF0073FFE505460801
-0236002600000117008D006E0175000BB601002D2C0C1525012B3500FFFF0069FFE703F3
-068C0236004600000116008DCE00000BB601002423090F25012B3500FFFF0073FFE50546
-0801023600260000011700DF00A80175000BB601002E2B0E1525012B3500FFFF0069FFE7
-03F3068C023600460000011600DFF600000BB601002522090F25012B35000002006CFFE1
-04FB0614001B0028006F404A3B05380C3C2232243E284B054A0C4E2245244F2859086908
-70120D0114511A17171018011304072041100403082642070A160088011617131C041A1A
-01922A1F2A3F2A02231B010A852910F632ED5D10F632FD3232323210E42F003FED3F3FED
-1239393F12392F3CFD3C31305D01231123350E01232202113436373E0133321617352135
-213533153301112E0123220615141633323604FBB8BC4DAD6EC6ED524444B66059864CFE
-95016BBCB8FE8C4F73499CB2879750A404F4FB0C754252012E01118EDB4D4C4F2427CE86
-9A9AFB9902792218D6CCC3CD47000001FFFC0684051A06FC00030011B601500200000502
-2F11332F002FED313001212721051AFAE705051E06847800000100FD01FF01EC031A0003
-0016400C02560108002D2F013F0102012F5DED003FED31300123113301ECEFEF01FF011B
-FFFF001A0000055E0801023600240000011700D900310175000BB60200110B050025012B
-3500FFFF0068FFE1041D068C023600440000011600D9D600000BB602003A340B2625012B
-35000002001AFE5F062B05D1001B001E00C840900F051F052E053E05401D700806381C4A
-0E450F590E570F051D1E1D1C0A77098709020914100F101D1E0B770C870C020C140D0D0E
-570E580F7D0E730F040B34301E401E701E031E091E1D030D0E031B1B1753030D107A0D01
-0D080000142A060F20010E0F1D06040D0C102410391042105A106A1074100710106E200F
-20010A0D2B0D360D4D0D550D650D7C0D070D641F10E65D5D10F42F5D1217395D2FED332F
-003F5D3C3FFD322F3F1217392F5DED3130015D8710FD5DC0C0C08710FD5DC0C008C0015D
-005D010E012322263534363703210323012101230E0115141633323637330902062B344B
-2A8BA91E0679FD7C92C9021E0108021E610607535A24511108FD91FEFBFEFAFE790E0C9D
-90406A150154FE6105D1FA2F1B351B524E1B08033102DBFD250000020068FE5F052E0478
-003A00470099406A0B11052B1A12162B2A0544225F25544065166C2562407B127B1D7F25
-703F0F0C041B04390559166916053A3A3653030D0A103C3D301940190219192810242420
-3F28044541100A3009080000332A060F25012506193B091A2F25132F91490F491F493F49
-03421B13854810F6ED5D10E4113910FD3232322F5D2FED332F003F3C3FED3FED332F1112
-392F5DED12393FFD322F31305D015D010E0123222635343637350E01070E012322263534
-3637362437353426272E012322060723353E01333216171E011511230E01151416333236
-373301110E01070E01151416333236052E344B2A8BA90D041955282F7A5297D26D656601
-1EA42D2A28703D4AB6610A37D06576AF403F421D0607535A24511108FE3456E944516474
-7763A4FE790E0C9E8F263B1377113D12171FC89B7F9D2D2D20081D40541817102725BF0F
-24272F2E926CFD0A1B321E524E1B0801FB013705141317615560614DFFFF00C8000005B2
-0801023600270000011700DF00280175000BB60200211E080F25012B35000003006CFFE1
-062706140003001700240072B90000FFC0404A0E10370118090D3702180910373D073D1E
-34203B244D074F1E45204B245A0A6A0A70140B02020316011506091C4112040508224209
-0A0000021618061A02041F263F26021F1B040C852510F632ED5D2F33FD32322F332F003F
-ED3F3FED1239393F33332F31305D012B2B2B010323130123350E01232202113436373E01
-33321617113303112E012322061514163332360627FA7F98FEFDBC51B067C8EB514544B5
-6158884BBCBC4C78479EB0889650A40614FE0701F9F9EC75464E013401118EDE4E4C5025
-2701E4FAFF0281221ADCCAC7CF47FFFF000E000005BC05D1021600E70000000100C8FE5F
-04CD05D10020005C40390C041C042D043D04041235000F100F020F0F090E350B03133516
-090820201C53030D00192A0006060C10030A1473220F22010F1314140A6C2110F432FD32
-5D10E61117392F33ED2F003FFD322F3F3CED3FED12392F71ED31305D010E012322263534
-3637211121152111211521112115230E01151416333236373304CD344B2A8BA90B06FDC7
-03D5FCF1030FFCF1030FFE0607535A24511108FE790E0C9E8F24331D05D1B0FE68B0FDD7
-B01B351B524E1B080002006AFE5F0460047C002C0033007B40560D1E1A1E2604290D2B1E
-34043A0D3C1E3B3244044B0D4B32590D502A6C0D602B790D783212191915531D0D013C33
-3323303D29040F230B0B073F2309122A20201A1A0C0C2D1A008F350F351F353F35033301
-1B26853410F6FD325D10F4ED332F3C11332FED003FED332F12393FED12392FED3FFD322F
-31305D01211416171E013332363733150E01070E011514163332363733150E0123222635
-343637260011100033321215272E01232206070460FCC93E36348F5672E7310A4A9B5102
-03535A24511108344B2A8BA90604F8FEEB012BF4E2F5B701939697B30C021B6799313030
-5B2CCD1F3109143012524E1B089F0E0C9E8F18321212012A010401120142FEF8F32A94A2
-B284FFFF00C80000049D0801023600280000011700DF00220175000BB601000F0C020325
-012B3500FFFF006AFFE60460068C023600480000011600DFFD00000BB602002320120025
-012B3500FFFF00C80000047608010236002F00000117008DFEC00175000BB60100080702
-0325012B3500FFFF00AB0000025108010236004F00000117008DFE8E0175002FB5700270
-030203B8FFC0B3090C3702B8FFC04011090C3701044F049F040201000605020325012B35
-005D11352B2B5D00000200C80000047606140005000900464016070C0B0D370808090102
-030435010800000B0F0B0106B8FFEA40110E1037080C0B1037060608041408016C0A10F6
-32ED2F332F2B2B5D11332F003FED3F3F332F3130012B2901113311210B0123130476FC52
-C602E8C3FA7F9805D1FADF0564FE0701F900000200BB000003540614000300070042400D
-010C0B0D370202030601050800B8FFEA40190E1037020C0B103700000F021F0202020204
-1A7F050105880810F65DFD322F5D332F2B2B003F3F33332F3130012B0103231303231133
-0354FA7F98FCBCBC0614FE0701F9F9EC0614000200C80000047605D1000500090036401E
-07562F0801080801020304350108062D07070100000B0F0B010414016C0A10F6ED5D1133
-2F12392FED003FED3F12392F5DED3130290111331121032311330476FC52C602E89CE9E9
-05D1FADF0157010B000200BB00000362061400030007002D401A05560606010201010807
-2D6F067006020606001A7F010101880810F65DED332F5DED003F3F12392FED3130212311
-33012311330177BCBC01EBE7E70614FBF4010900FFFF00C8000005380801023600310000
-0117008D00780175000BB601000C0B050925012B3500FFFF00B90000045F068C02360051
-00000116008D0000000BB6010019180E1625012B3500FFFF00C800000538080102360031
-0000011700DF00A20175000BB601000D0A050925012B3500FFFF00B90000045F068C0236
-00510000011600DF1C00000BB601001A170E0225012B3500FFFF0073FFE105DA08010236
-00320000011700DD008C0175000DB703020029260F0325012B353500FFFF006AFFE10471
-068C023600520000011600DDD800000DB70302001D1A060025012B353500FFFF00C80000
-059808010236003500000117008DFFF60175000BB602002221060B25012B3500FFFF00B9
-00000372068C0236005500000117008DFF380000000BB6010015130A1225012B3500FFFF
-00C8000005980801023600350000011700DF000A0175000BB602002320060B25012B3500
-FFFF009200000372068C023600550000011700DFFF600000000BB6010016130A0325012B
-3500FFFF0086FFE5050208010236003600000117008D00140175000BB6010033321A1F25
-012B3500FFFF006EFFE503D7068C0236005600000116008D9400000BB601003635063225
-012B350000010000FE5904EE05D1001B0048402E0C071C072C073C07040C0C1053080D01
-18351A030216080B0B132A050F1D1F1D4F1D03005B050114185B4F1901192F5DF4FD32E4
-5D2FED332F003F333FFD323FFD322F31305D0121111E011514062322262735331E013332
-3635342627231121352104EEFDEC0309B79225742D091A58326862050332FDEC04EE0521
-FB04144822A2AC0E0CA00A1A4E581E36170521B00001003EFE5902FD059E0030006F4046
-0C080D1A19081E1A2B082F1A3C08070D0D1153090D20251C3E22201F0503171830302C3F
-18094F327F32020C0C142A06182306031C008C321D22251A1F1D4F1C7F1C021C883110F6
-5D3232FD322F10E61117392FED332F5D003FFD322F1239393F3333FD322F3FFD322F3130
-5D250E01071E011514062322262735331E01333236353426272322263511233533113311
-211521111416171E01333236373302FD0C1C100204B79225742D091A58326862030214AB
-B27F7FBC0184FE7C0818164D4F2E64160A0A030703122C18A2AC0E0CA00A1A4E58172F10
-B7CB02529E0141FEBF9EFE0358632B28251B0900FFFF0000000004EE0801023600370000
-011700DFFFEE0175000BB601000B08060725012B35000002003EFFEA037A0705001B001F
-0073404C0B041C042A042A1D2A1E3A1D3A1E4A1D4A1E551C641C691E741C791E0E1F1F1E
-0B10073E1E0D0B0A051B1B173F03094F217F21021C1C1E1E100E008C21080D101A0A0800
-4F077F070207882010F65D323232FD322F10F63211392F332F5D003FFD322F3F333333FD
-322F2F332F3130015D250E012322263511233533113311211521111416171E0133323637
-331303231302FD357D31ABB27F7FBC0184FE7C0818164D4F2E64160A7DFA7F980A0E12B8
-CB02529E0141FEBF9EFE0358632B28251B090652FE1101EFFFFF00B2FFE1052908010236
-00380000011600DB63500079405B02010900210140215021A02103EF102101902101BD00
-210150218021028B10214021702103B021C021F021039021C02102599021C021E0210310
-21602190210331002101E021010F211F214021502180210521020100241E0D1D25012B35
-3500115D71725E71725E5D71725E5D725E5D725E5D715E353500FFFF00B1FFE1045707B1
-023600580000011600DB0000000DB70201001D17091625012B353500FFFF00B2FFE10529
-0801023600380000011700DD00780175000DB7020100241F0D1D25012B353500FFFF00B1
-FFE10481068C023600580000011600DD0A00000DB70201001D18091625012B353500FFFF
-007E0000050808010236003D00000117008D00070175000BB601000B0D050625012B3500
-FFFF005D000003E3068C0236005D00000117008DFF680000000BB601000B0D050625012B
-3500FFFF007E0000050807500236003D0000011700DA00390175000BB601000B0A050625
-012B3500FFFF005D000003E305DB0236005D0000011600DA9200000BB601000B0A050625
-012B3500000100C80000048A05D10005001F401003013504030000070F07010214036C06
-10F6ED5D11332F003FED2F3130012111231121048AFD04C603C20521FADF05D100030073
-FFE105DA05F0001700230027006D404F040004060B0C0B1217001706190C191257015705
-53075F0B580D58115F13531710253560260126260976097915021B3415022134090A2726
-27260F18150373290F29010F291F293F29031E150F682810F6ED5D5D10F6ED1239392F2F
-003FED3FED5D12392F5DED3130015D011612151402070E01232224272602353412373624
-33321613100023220011100033320003213521051E5B6163595CFBA19DFEFF5A5A61605C
-5801059AA0FF47FEFCE1E3FEFD0108DEDE0107ACFD8D0273052664FEDEB8B8FEDD616566
-6863630120B9B6012167626869FD610122013BFEC5FEDEFEDBFEC901370106B300030069
-FFF0062405E1001D002A00370058403624182C321525062B32091509081603082A1E2532
-65006A0F041E150032150F00072B1518250407140F080839381F393F396F399039045D11
-12392FC4ED173910C42FED2FED5D002F3F1239392FED39392FED39393130011406070E01
-071523352E01272E01353436373E01373533151E01171E01073426272E0127113E01373E
-0101110E01070E01151416171E010624594F55F48AC586F6574F59564C51F395C594F64F
-4B57CE403B3A8E6A5E9A324142FD8E6A8E3A3A414340319B02F38CD9494F5D03A6A6035A
-524AD88C88CC4C515E049B9B03624E49D07F63A639383402FC8602392F3CAEFEAC037A01
-363737AA6170B63A2D3C0002006CFFE10443047C00130020005740162A032A203C1A301C
-38204F1A421C4820580668060A10B8FFC040230B1037120502110518410E0401081E4205
-0A1114021A0092221F223F22021B1B08852110F6ED5D10F6FD3232003FED3F3FED123939
-3F31302B5D2123350E01232202113436373E0133321617353303112E0123220615141633
-32360443BC51B067C8EB514544B56158884BBCBC4C78479EB0889650A475464E01340111
-8EDE4E4C502C2734FCB6027C221FDCCAC7CF47000002006AFFE104730614001900280086
-4029031C0520171526153B0A3A0E3A1C3E214C0A490E4A1C4F2153176B0E7B0E7A207B21
-1136264626021DB8FFE04034121C371D180A11371D171D0C050F133E1001263F030A1111
-001D0C0F1A1B00140F00902A0F2A1F2A3F2A6F2A040F0F231B06852910F6ED332F5D10E4
-113910ED11393911332F003FED3FFD323F33332F2B2B5D31305D01100023220011343637
-3E01372E012735211521151E01171E01073426270E01070E011514163332360473FEEBEE
-F1FEEB564045B45C4CB466032AFDCF44DE5D9676C26E6E4291423F55AA9C99A60227FEF0
-FECA012F01068DC5404852113F8748B39E0A2E9C5488FBA487E45608303532AE7FC9D0D3
-0001006DFFE603EE0478003D007C40432612263B363B49014418590154186A016F0B6418
-79017A0B7418792274350F0C2C3F2B2B03161A1A1E3E16043D3D393F0309192B40090C37
-2B241B10100C2B19040900B8FFC0401009143700003F7F3F803F02331B09863E10F6ED5D
-11332F2B1217392FED2F2B2F003FED332F3FED332F1112392FED3931305D250E01232226
-272E0135343637352E01353436373E013332161715232E01232206070E01151416171E01
-3B0115232206070E01151416171E01333236373303EE6BCE734FA446455771795B6C5F41
-40A24F62A45A0D42C3642D4E2A233338302D68356F9E3E642A2931342925653866E8470D
-40302A2028277F5E6090260718845C5975222120211CCF33380B140F432C3D440F0E03A6
-0911114A3B354A151314483E0002006AFFE1050F047C0011001D004D40163A15351B4A15
-451B040E3F0D05153E09041B3F030A0FB8FFC040190B0D370E0E090C0F0306121B00901F
-1F1F6F1F02181B06851E10F6ED5D10F4ED121739332F2B003FED3FED3FED5D3130011000
-232200111000333216172115211E010734262322061514163332360471FEE7E9F1FEEC01
-1AED376A1D01E0FEE03E44C2A49AA1A4A79C98A8022EFEE7FECC013C01110113013B1609
-A549C27FD7D6E0CDD1DAD7000001000A000003EE045D0007003840230301043F06054000
-4F0502000500021A05A003B00302030309080F093F094F097009045D1112392F5D33FD32
-2F2F5D003FFD322F3130012111231121352103EEFE6CBCFE6C03E403B8FC4803B8A50002
-0068FE6405EA047A001D0024007840163515740F022110090C37213E1A040F0522037717
-0117B8FFF0400F090C37173E0609050C75147A1E0211B8FFC040250D103711112217041A
-05050C1E1B3A0001008F260F261F264F266026040F2601141B0C852510F6ED5D5D10F45D
-ED12392FED3939332F2B5D003F3FED2B5D39393F3FED2B31305D011000051123112E0127
-2E01353412373315060215141617113E0133200003342623113E0105EAFEA9FEF3BB82DD
-51555E7685E58894E1BD214B270130015DC3E0C1CED30240FEFDFEC40FFE72018E065145
-4AC4869F01128A1163FEF6A7BDE60603E80201FED5FEFBB8DBFCB20AE8000002FFFCFE59
-051AFFAE000300070020400F02500101080650050D0400000905022F3311332F33003FED
-12392FED31300521352111213521051AFAE2051EFAE2051ECA78FEAB7800FFFF01230000
-03DC05D10036000400000117000401D90000001E40140302200D5F0D6F0D030D01000005
-10057F0503052F5D35352F5D35350001009A022A03C605F00016004DB90014FFE0B3090C
-3715B8FFE0B3090C3713B8FFF84017171B370110130D0D085313020E03012A000018100B
-2A0DB8FFC0B3090A370D2F2BFD3211332FED003F3FED332F1239332B31302B012B012311
-3426272E012322060711231133153E013332161503C6AC0E15164D40418D41ABAB4BA254
-9AA6022A0215466A2424234332FD4503AB683E45B9AB000200C8FFE508CA05D1004E005D
-00E240210B18044D19012E18204D55316A186631654D791375487952735A0D05200E1037
-3DB8FFE040310E103711001A46043B033F400B0D373F3F433E3B4F3501353B351E37213E
-34243134032C573450290129292B56342C0307B8FFC0403C0B0D3707070E3E0309202B3A
-4F4A4F0237341F1A20201A330606461A381D3E1A3E1A3E111A00005F0F5F014F13225F33
-7F33023333572A13702B012B2F5DFD32332F5D39ED5D11332FED33332F2F123939ED332F
-1112392FED39395D002F2F3FED332F2B3FED12392F5DED1217392FED393933332F5D2FED
-332F2B1112173931302B2B5D0114062322262735331E01171E01333236353426272E0127
-2E013534363723112311230E01070E012B01112311333216171E011733353315213E0133
-32161715232E01232206151416171E01171E01013426272E012B0111333236373E0108CA
-E2BE6ABA3D0917472D356145667943552A62377E6E0F12DDB57C0C3B2F4DCCA030BCF486
-B44847580A78B5017F24733155B53E0940B15B59723B562E642E7284FA5E36372F83572E
-1178962F2F2701429BC23C22D31331161A1E4C5A4844160B131026956E254426FC4E03B2
-45792F4D4DFDD505D12D302F9364DCDC12183024C935494E4F4648170C180C1E8E024F4D
-75241F1DFDA32D2F306DFFFF0089FFEB063E05D10036002C00000117002D035400000005
-B20F23015D00FFFF00AFFE59043D05DB0036004C00000117004D02280000001840115023
-60237F23030302500C600C7F0C030C2F5D35355D000200000000052706140016001A0065
-B90017FFE8403F0D10371818090C3719180910370315161575150318181701100D084213
-040E05010D08171740190119100B1A19300D500D700DAF0DCF0D050D0D021A00911C10F6
-ED332F5D33FD322F5D332F003F3C3F3FED12393F332F31305D012B2B2B2123113426272E
-012322060711231133153E0133321615090123130527BC1218195E4B4DA84DBCBC58BC63
-B5BEFC72FEF18AA5027C4D87262A294C3BFCBE045D7C4952DACD033FFDD1022F000100D5
-0366028705D100030027B90000FFE840140D10370118090C3702180910370101030300B1
-022FED003F332F3130012B2B2B090123130287FED688C205D1FD95026B00000200D50366
-041805D1000300070050B90004FFE8400E0D10370518090C37061809103700B8FFE84020
-0D10370118090C37021809103746000101050503070304B13F0601060600B1022FED332F
-5DED003F3C332F3C3130015D2B2B2B2B2B2B09012313210123130287FED688C20281FED6
-88C205D1FD95026BFD95026B00040095FFE3080705ED001B001F002B003700CA400C471D
-481F561D591F681E050BB8FFE040160E103701200E10371F1D1C071D171D021D291E1E1F
-29B8FFF44012090B37230C090B374F0D401B7A2F75350417B8FFE8404A0E103711180E10
-371F031B1B17512F034F0302030D030D115109022F51202940290229293551230A1E0840
-1E011C1E322A00260126262C2A1C1E062020390F39010D2000010000142A062FED332F5D
-335D11332F123939ED332F5DED2F2F5D003F3FED332F5DED3FED33332F2F5DED332F3F2B
-2B5D2B2B3130018710ED5D87C0002B2B015D010E012322263534363332161715232E0123
-220615141633323637330901230901140623222635343633321607342623220615141633
-3236032D1E934EC0D9DDBC417F3F0E3C73396D7F7B71497A250E02F5FCF4A5030C028ABE
-B2B5BABDB2B6BAB2596466585866645902BE1232E6D2C9F22121AD3233959C9698422302
-68FA2F05D1FBCCE0DADCDDE0DADADFAC8888ADAD87870002000FFFE8028605D3001B002B
-006E400D531D621D701C0316180B113705B8FFF040310B0F37001A010B1C051B1B051612
-120F5216092550050347080112121F2908401114372F0801081C1B001A0008030B2A01B8
-FFC0B3101437012F2BED17332F33322F5D2BED332F5D003FED3FED332F1112392F17392B
-2B31305D13371134363332161514020711141633323637150E012322263D0107133E0135
-3426272E01232206070E01150FB17B6F607C78A51D1B1A44693771395C6B4FF8622F0D0D
-0A190F0F19060B0C01A6EB01C7E299826D5CFEF7E6FE61592B214AA22C2B727FE162022B
-A980371E30110C0D0C0E156E5800000200920000044203B0000300070025401507CB0101
-05CB0307CB010105CB00031003300303032F5DED332FED002FED332FED31301321112113
-1121119203B0FC504C031803B0FC500364FCE80318000001008301BD0252038C00030017
-400B02020300000002300202022F5D332F002F332F3130011121110252FE31038CFE3101
-CF000002008301BD0252038C000300070023401306CB020205CB0304CB000006CB000230
-0202022F5DED332FED002FED332FED313001112111052111210252FE310183FEC9013703
-8CFE3101CF4CFEC9000100B10088042203F9000B0021401409090F032F034F0303030606
-00009000A00003002F5D332F002F5D332F3130133400333200151400232200B10102B7B6
-0102FEFEB6B7FEFE0240B70102FEFEB7B6FEFE0102000002007001AA026603A0000B0017
-0065400B06102326370610171A3700B8FFF0B323263700B8FFF04015171A3712CB06060C
-CB000910171A3709100B0E3703B8FFF0B3171A3703B8FFF040130B0E3715CB03030FCB00
-0920093009600904092F5DED332FED2B2B2B2B002FED332FED2B2B2B2B31300132161514
-06232226353436172206151416333236353426016B689393686893926949666748486766
-03A093686893936868934C674849666649486700FFFF001A0000055E073C023600240000
-011700D80031016B000AB602000C0B0607252B35FFFF0068FFE1041D05D1023600440000
-011600D8D900000AB6020036371D26252B35FFFF0073FFE5054608010236002600000117
-00D600A90175000AB601002F2B0F15252B35FFFF0069FFE703F3068C0236004600000116
-00D6F4000011400C014026502602002622060F252B5D3500FFFF0073FFE5054607500236
-00260000011700DA00A80175000AB601002C2B0F15252B35FFFF0069FFE703F305DB0236
-00460000011600DAF5000011400C012024302402002425060F252B5D3500FFFF00C80000
-049D073C023600280000011700D80033016B000AB601000E0F0203252B35FFFF006AFFE6
-046005D1023600480000011600D8F700000AB6020022231200252B35FFFF00C80000049D
-0801023600280000011700D900400175000AB60100120C0203252B35FFFF006AFFE60460
-068C023600480000011600D9FE00000F400A027026010026201515252B5D3500FFFF00C8
-0000049D0750023600280000011700DA004F0175000AB601000E0F0203252B35FFFF006A
-FFE6046005DB023600480000011600DA0000000AB6020022231218252B35FFFF0073FFE3
-05A208010236002A0000011700D600D00175000AB601002925070F252B35FFFF006CFE59
-0443068C0236004A0000011600D6FB000011400C0230354035020035311A23252B5D3500
-FFFF0073FFE305A207500236002A0000011700DA00CE0175000AB601002728070F252B35
-FFFF006CFE59044305DB0236004A0000011600DAF5000011400C0250336033020033341A
-23252B5D350000010073FE5905A205EC0038009540200906060E07261D06130E210E350E
-4901410E510E6506650B630E740E741C0F2CB8FFE04043090C37323236532E0D28032235
-40230123230C03101017340C021D34030A3131002A0F2B1F2B022B760901221022042B27
-040910216C25753A0F3A403A021A1509683910F4ED5D10F4ED331217392F2F5D2F5DED33
-2F003FED3FED332F1112392F5DED12393FFD322F3130012B5D0534262722242726023510
-002132041715232E01272E012322001110002132363711213521110E01071E0115140623
-22262735331E0133323603820302ADFEE066677001A1016C7F010999121F763945AF6FFA
-FEDD0130010660BF48FE7102535AD45E0103B79225742D091A583268626B152B0F5F6061
-0123C30165019D3D49EB184E1A1F29FEBFFEEEFEDFFEBF261E016DAEFD8129460F0E2516
-A2AC0E0CA00A1A4E0003006CFE590443068C002300300034009F406F243234320233200D
-10373D133E2A322C3A3044094B134C2A422C4B305B015D055A166A016C056A167C057020
-112F343F344F3403343433331E220512211528401E0407070B40030D2E41150731315033
-603302333300180F0601062124121A0006180092361F363F36022B1B18853510F6ED5D10
-E4113910FD32322F5D1112392F5D332F003FED3FED332F3FED1239393F11332F332F5D31
-305D012B5D2510002122262735331E01333236373E013D010E01232202113436373E0133
-321617373303112E01232206151416333236130323010443FEFEFEF459A9520A2EC86460
-7E23231E559B78C8EB514641BA5C6183490CB0BC4B81409BB2849952A534B3F301117FFE
-E4FEF61917C012352E29276E446644430121010790D14C474F272830FCD60261221DD0C6
-BCC23F058EFE8A017600FFFF00C80000053B08010236002B0000011700D600760175000A
-B60100100C060B252B35FFFF00B90000045F08010236004B0000011700D600220175001A
-4012014F1B6F1B9F1B031B112601001B170808252B35002B5D3500020020000005E305D1
-001300170060403D0E1201160408520B400C0F370B0B0C05350017101702170B10170304
-070C03070000120F150303140278190F19401950190309090B0E16030614076C1810F6ED
-1739332F5D10F6ED1739332F002F3F1217392F71ED12392F2BED17393130012311231121
-11231123353335331521353315330135211505E3A8C6FD19C6A8A8C602E7C6A8FE92FD19
-0455FBAB02D9FD2704558CF0F0F0F0FEA8CCCC00000100130000045F0614001E00504030
-031D161D751D0317140E51111112180D08421B041201010D08150F021A0091201F206020
-02141517030B1A110F0D881F10F63232FD17325D10F6ED2F2F003F3C3F3FED123912392F
-ED393931305D2123113426272E0123220607112311233533353315211521113E01333216
-15045FBC1218195E4B4DA84DBCA6A6BC0141FEBF58BC63B5BE027C4D87262A294C3BFCBE
-04F4869A9A86FEED4952DACD0002002C0000033307C8000B0025006DB9001BFFD040400B
-10370E300B10370C0C15520F1C1F1C021C191C192252700F010F0F09043206030A033201
-0825280F0C1F0C020C1828190C276D080B5A0A1405025A19036D2610F432ED32FDED32E4
-332FED2F5DED003FED323FED32332F5DED33332F2F5DED332F31302B2B29013533112335
-2115231133130E01232226272E0123220607233E01333216171E013332363702D5FDB4C3
-C3024CC3C35E077D663453262D3C20302D0288037E683351282A431D2E31019804A19898
-FB5F0730989724262B2A5B4B88A6242528295B470002FFF200000241063C0003001D0054
-40347C0673130204040DAA1440090C37141114111AAA0707020501081DAD0440090F3704
-10AD117F1F011F9204001A117F010101881E10F65D32FD32ED5D2FED2F2BED003F3F332F
-ED33332F2F2BED332F31305D21231133131406232226272E012322061523343633321617
-1E01333236350177BCBCCA6750283A1E202D17232170684E2F3220212C162421045D01DF
-81821A202322454181821B1F2322483E0002005F000002FF073C000B000F004D40150E32
-0D0D09043206030A033201082F0F3F0F020F0EB8FFC040150B0D370E0F116D0A080B5A0A
-140305025A0E036D1010F632F43210FDF43210E6332F2B2F5D003FFD323FFD32332FED31
-302901353311233521152311331321352102D5FDB4C3C3024CC3C32AFD6002A09804A198
-98FB5F060A9A0002FFFC0000023605D1000300070032401D025301010605057F00700202
-00027F0901099200041A027F050105880810F65D32FD32E65D2F2F5D002F3F332FED3130
-01213521032311330236FDC6023ABFBCBC05379AFA2F045D00020080000002DF07D3000B
-00190059401F0C701201121216AA0F0F09043206030A0332010819290C400B0E370C1329
-12B8FFC040130B0F37120C1B6D080B5A0A1405025A12036D1A10F432ED32FDED32E4332F
-2BED2F2BED003FED323FED32332FED332F5D333130290135331123352115231133131406
-232226353314163332363502D5FDB4C3C3024CC3C30A939C99979E454D49489804A19898
-FB5F073BA8CFCFA886726E8A00020001000002300668000D0011004840150006060A5003
-0310050F0D2900400B103700072906B8FFC040130B1037067F13011392000E1A067F0F01
-0F881210F65D32FD32E65D2F2BED2F2BED002F3F332FED332F3331300114062322263533
-1416333236350323113302308B8C8A8E924145414427BCBC06689AC0BE9C7A6B6283F998
-045D00010089FE5F031C05D10020004F402D1C20090C3709043206030A03320C01081717
-13531B0D1818102A1E1E0B02226D0A080B5A0A140305025A036D2110F4F43210FDF43210
-E61112392FED332F003FFD322F3F33FD323FFD3231302B21233533112335211523113315
-230E011514163332363733150E012322263534360174EBC3C3024CC3C3C2060942582141
-1309245122879A099804A19898FB5F981C29265150130B9E0A0BA08C22350002008EFE5F
-024605DB0003001B0056401C0820090C371B1753070D014402400B0D3702030E050D1104
-04142A0AB8FFC040170B17370A0A0E7F1D011D9200600F1A01607F0E010E881C10F65DE4
-FDE4E65D11332F2BED332F002F333F3F2BED3FFD3231302B01233533130E012322263534
-3637113311230E0115141633323637330183D4D4C3245122859C2508BC3C060742582141
-13090518C3F8990A0B9E8E3F6F19040BFBA31A361B5150130B00FFFF002CFFEB034D0801
-0236002D0000011700D6FF6C01750014B1011AB8FFC040090B0E37001A160415252B2B35
-0002FFC2FE5902AF068C0015001C005540340A011C0102551B651B751B0318161A1B1B1A
-1A123E150507070B40030D1A1A4F1301137F06010616121A1306160370150115921E10F4
-5D1732ED2F2F5D2F5D332F003FFD322F3FED332F332F1239395D31305D05140623222627
-35331E01333236373E01351123352137230B012313330209C8A828832C0A1C5F2D485816
-160DE901A5A69FB9B89BE4E31BC4C8100CB30B1C282828715103849EB40100FF00017B00
-FFFF00CDFE59057505D10236002E0000011600DCFB00000AB601001A0C0500252B35FFFF
-00C1FE5904AF06140236004E0000011700DCFF7C00000011400C01301A401A02001A0C05
-0A252B5D3500000100C1000004AF045D000B007D40512802D801DB090309010F0D1F011D
-021F0D2D012F0D300B400B540B69027A010C020203011A000B000809B4020B0A030A0802
-050A0507050105080B02600A700A020A0A00000D200D400D0208031A05890C10F4FD325D
-11332F332F5D3939003F3C3F3F1239393130018710C0C07AF51804C0018710FD08C0015D
-7121230107112311331101330104AFF8FE407ABCBC021FEDFDF901E974FE8B045DFDD102
-2FFDFC00000100C8FE59047605D1001A003F40240C20090C37111115530D0D0203043507
-01081010182A0A0A0105051C0F1C010414016C1B10F4ED5D11332F12392FED332F003F3C
-ED3F3FFD322F31302B29011133112115211E011514062322262735331E01333236353426
-02BFFE09C602E8FEE30204B79225742D091A583268620605D1FADFB0122F18A2AC0E0CA0
-0A1A4E581E3E00010005FE5901E906140018003D40240A20090C370F0F13530B0D020104
-01080E0E082A1616017F1A011A92041A7F010101881910F45DFDE45D12392FFD322F003F
-2F3F3FFD322F31302B2123113311331E011514062322262735331E013332363534260149
-8EBC6C0105AE8525642809184E285E52010614FA00123724A2AC0C0CA00B174F57153300
-FFFF00C8FE59053805D1023600310000011600DCFE000013400E01201630164016030016
-0A0400252B5D3500FFFF00B9FE59045F047C023600510000011600DC8B000013400E0100
-2310232023030023170D00252B5D3500000100C8FE59053805D10016009D401F00076107
-7107A107040C070B0C1B0736074607540765077507B001B0070A07B8FFC040510B113776
-06010F0102061F01150626013601340646014406560153066006790170060E0406015A01
-550602111115530D0D0207040806030A0104080110100A06010207130A78180F18401802
-0213046C1710F4ED5D10F4FD11393911332F2F003F33333F3C1239393FFD322F31300172
-715D5D002B5D71043501112311210111331114062322262735331E0133320480FD01B901
-330284B9CEB42751250B163A1E7F948A053EFACC05D1FBA00460FA18BFD10806A8050A00
-000100B9FE59045F047C00260045402B03150C191615751504100D084213040E050D081E
-1E22531A0D1D1D021A1791281F28602802100B1A0D882710F4FD325D10F6ED332F003FFD
-322F3F3F3FED123931305D0435113426272E012322060711231133153E01333216151114
-062322262735331E01333236373603A31218195E4B4DA84DBCBC58BC63B5BECCB4274E26
-0B163C1A4C6117162556024B4D87262A294C3BFCBE045D7C4952DACDFD0FBFCC0706A805
-0A262626FFFF0073FFE105DA0746023600320000011700D8009B0175000AB6020026270F
-03252B35FFFF006AFFE1047105D1023600520000011600D8E300000AB602001A1B060025
-2B35FFFF0073FFE105DA0801023600320000011700D9009C0175000AB602002A240F0325
-2B35FFFF006AFFE10471068C023600520000011600D9E400000AB602001E180600252B35
-FFFF00C8FE59059805D1023600350000011600DCF600000AB602002420050D252B350001
-001BFE590372045D002700574034000D100D200D032120090C370C090F131317430A0F05
-1C090826260253220D25251F2A05050913132940297029020C1B1A09882810F4FD325D11
-332F11392FFD322F003FFD322F3F2F3F3CFD322F11123931302B5D1E0133323635342627
-231133153E013332161715232E012322060711331E011514062322262735333C4E285E52
-0102A6BC70AB59312C2C0A2A4F3657A24B840105AE8525642809FA174F57153323045DA5
-5A4B0507C10A094D3DFCFB123724A2AC0C0CA000FFFF0086FFE505020801023600360000
-011700D6004A0175000AB6010035311A00252B35FFFF006EFFE503D7068C023600560000
-011600D6AF00000F400A017F38010038341A00252B5D350000010000000004EE05D1000F
-004140250D0A003203030F09043506030F0F111F114F11030B020B085B090D0009140204
-5B4F0501052F5DF432ED393910E4332F2F5D002F3FFD3212392FED393931300121352111
-21352115211121152111230214FEB4014CFDEC04EEFDEC014CFEB4C602E48F01AEB0B0FE
-528FFD1C0001003EFFEA02FD059E0023006E40210420090D37181507510A0A0E030F140B
-3E110F0E0523231F3F03094F257F250216B8FFC0401E090B3716160713008C250909070C
-0A0E111504181A0C07400D103707882410F62B32ED17392F12392F10F63211392F2B5D00
-3FFD322F3F3333FD322F1112392FED393931302B250E012322263D012335331123353311
-331121152111211521151416171E01333236373302FD357D31ABB27F7F7F7FBC0184FE7C
-012DFED30818164D4F2E64160A0A0E12B8CBA88601249E0141FEBF9EFEDC865358632B28
-251B0900FFFF00B2FFE1052907C8023600380000011700D700610175000AB601002B1E0D
-1D252B35FFFF00B1FFE104570653023600580000011600D70600000AB601002417091625
-2B35FFFF00B2FFE105290746023600380000011700D800630175000AB6010020210D1D25
-2B35FFFF00B1FFE1045705D1023600580000011600D80100000AB60100191A0916252B35
-FFFF00B2FFE105290801023600380000011700D900630175000AB60100241E0D1D252B35
-FFFF00B1FFE10457068C023600580000011600D90100000AB601001D170916252B350001
-00B2FE5F052905D1003400634044231223183D093D2139224C094C214B22771377170A33
-20090C372E2E2A53320D1C24060D031534060A2F2F272A00060023030C1B141E76360F36
-1F364036030F140C6B3510F4ED5D10F6ED1217392FED332F003FED3F1239393FFD322F31
-302B5D053436372206232226272E01351133111416171E01333236373E01351133111406
-070E01070E011514163332363733150E012322260314050509190F8CD0475147C621272C
-976A6B962D2721C647512D683D0405535A24511108344B2A8CA8741A271601494852E8A9
-037BFC7B798C394142414239936D038AFC85A2F1502C3B10143C17524E1B089F0E0C9F00
-000100B1FE5F0567045D002A005C40220B0619077A07032720090C370205150905114205
-0A010822221E53260D23231B2A29B8FFC04015091037292914021A17922C1F2C602C020B
-1A08872B10F4ED5D10F4FD32322F2BED332F003FFD322F3F3FED3F3C123931302B5D0437
-350E01232226351133111416171E0133323637113311230E011514163332363733150E01
-23222635340395065FAE69B0C4BC101A1B565249AD4BBC1E0607535A24511108344B2A8C
-A81D1D7C4B50D7D002D5FD8455792B2C284C3B0342FBA31B351B524E1B089F0E0CA08D24
-FFFF005C0000078D08010236003A0000011700D601690175000AB60100110D0600252B35
-FFFF005600000636068C0236005A0000011700D600BB0000000AB60100110D0600252B35
-FFFF0006000004E608010236003C0000011700D6FFEE0175000AB601000D090500252B35
-FFFF003DFE64047F068C0236005C0000011600D6DD00000AB601000C080400252B350001
-00B900000308061E0010002440140000043F0D0009080000081A6F097F090209891110F6
-5DED332F003F3FFD322F313001232E012322061511231134363332161703080A1F642679
-67BCC2BF3F652A055E09136B8CFB7D0482C2DA0C08000004001A0000055E08000012001E
-00210025013F40862B20372040205A18551A501E55206918651A651E0A180B170D4A0646
-125906561278027703082020211F02370187010201140012002021033704870402041405
-05060606091226062912370638124606491258127A0675120B24240C702501251651A00C
-F00C02060C160C3F0CF00C040C03340F2170210221212006120405201C401C020C1CB8FF
-C0406C393937501C701C021C01050824400E10370F242F240222222440090D372413290F
-0F2F0F4F0F8F0F9F0F050F19290009200940098009900905090F270106090F122405050C
-0024003A0042005A006A0074000700006E270F27010A052B0535054D05550565057B0507
-05642610E65D5D10E62F5D1217395D2F5DED2F5DED2F2B332F5D2B003F3C2F5D2B335D12
-17392F5DED2F5D72ED2F5D12392F3130015D8710FD5DC0C0C08710FD5DC0C008C0015D00
-5D212303210323012E013534363332161514060727342623220615141633323613090207
-2337055ED394FD8094C901F83139A17373A039302A47393948493838487DFEFEFEFD021D
-F39595019FFE6105571F65406D90906D40651FC4364B4A37394B4CFC6602CBFD3505B7CD
-CD0000040068FFE1041D07330032003F004B004F00D6B50C0A190A0230B8FFC040880B0E
-37590E51215C38690E63216F397B0A7A1474207B380A0208343D3011401102111149084F
-4F4E4E43AA062916299F290329400B0D37292F0123494F1F011F291F184149043D41080A
-01084E400D10374C4C4E40090C374E4E2640292F2C3F2C022C2C26297F468F4602464600
-0F1F011F1134021A001F0B0091510F511F513F51033A1B0B855010F6ED5D10E6113910FD
-32322F5D12392F5DED332F5DED12392F2B332F2B003F3FED3FED33332F5D123911392F2B
-5DED332F332F1112392F5DED123931305D012B5D2123350E01070E012322263534363736
-2437353426272E01232206070E010723353E01372E01353436333216151406071E011503
-110E01070E0115141633323603342623220615141633323613032313041DBB1955282F7A
-5297D26D6566011EA42E29296D3F3A692A3150130A2369311C259F73739E2E237D87BB56
-E9445164747763A443473939484938384895F3959577113D12171FC89B7F9D2D2D20081D
-4156171811140B0D1D07BF0914081E532E6D90906D335B1F22AA9AFE1D01370514131761
-5560614D042C364B4A37394C4D0262FEEE011200FFFF000E0000076D0801023600900000
-0117008D01DE01750011400C020F164F16020016140607252B5D3500FFFF0068FFE3073F
-068C023600A000000117008D01690000000AB6030055541B00252B35FFFF0073FF6E05DA
-08010236009100000117008D007801750013400E03303A403A603A03003A3B0F00252B5D
-3500FFFF005DFF6C0471068C023600A100000116008DE2000011400C03302E402E02002E
-2F0C00252B5D35000001015A03400249045D00030014400A01560205032D000201022F5D
-ED003FED3130012311330249EFEF0340011DFFFF005C0000078D08010236003A00000117
-004301730175000AB60100100D0600252B35FFFF005600000636068C0236005A00000117
-004300C30000000AB60100100D0600252B35FFFF005C0000078D08010236003A00000117
-008D01690175000AB601000F100600252B35FFFF005600000636068C0236005A00000117
-008D00BF0000000AB601000F100600252B35FFFF005C0000078D07500236003A00000117
-008E016C01750020B10213B8FFC040120D10370F13010100135F13020013100600252B5D
-355D2B35FFFF00560000063605DB0236005A00000117008E00BF0000001EB10213B8FFC0
-40100D10370F1301010013010013100600252B5D355D2B35FFFF0006000004E608010236
-003C000001170043000A01750014B1010AB8FFC040090D1037000A0A0500252B2B35FFFF
-003DFE64047F068C0236005C000001160043FF000015401001200B300B600B700B04000B
-090400252B5D35000001FFED03E40186061300030032B90003FFE4B70D10370101030100
-B8FFAEB30D103700B8FFE840090A0C3700007F0201022F5D332F2B2B003F332F3130012B
-010323010186A5F4010F0613FDD1022F0001FFD00685051606FD00030011B60150020000
-05022F11332F002FED3130012135210516FABA0546068578000100890000048B05EE0028
-00934063411253125B1A6312730273129024B603B6240923200551000810082008030808
-1F1C09510F0C1F0C3F0C4F0C040C141418490C01100202284A01080F2A1F2A022327021C
-1F20050C08215F1D6F1D7F1D031D0A061306081D13040220004000020000022F332F5D12
-17392F2F332F5D332F3333FD321139395D003FFD323F1239ED332F2F5DED3939332F5DED
-393931305D2901353E0137233533352335333534123332161715232E012322061D012115
-21152115210E01071521048BFBFE67620E9DA4A4A3FDCD6998400A3E98568C8B016CFE93
-016DFE8F0F705A0345CF1B817B868C86A7C801012211CE2A30A59094868C86659F2C0B00
-000200B1FFE60511053200180022005F4013380D391C491C580D6A217A21060C100B0D37
-07B8FFF0402A090A37191F290F2615690F790F05013222220F1F32150B0B07330F090C0C
-1913260001000024220114122FFD3211332F5DED332F003FED332F2FED12392FED5D2B2B
-31305D01211416171E013332363733150E0123200011100021320011272E01272E012322
-06070511FC66423C3AA3607AEA590D82C07FFEC9FEAD01420113FF010CBE02262928875A
-9FD50D027884B53E3C3B5648D53637015B0141013A0176FECDFEE92A549133333AD4B100
-FFFF00ABFFE1078305D50036023B9200003700BB023700000117024103F2FDC60016400C
-040302100A010B400B7F0B025D1135003F353535FFFF008CFFE107A405ED0036023DA600
-003700BB02910000011702410413FDC600384026040302360A0403023900392039403980
-39FF3905013100315B317B3103000900093F094F09035D11355D11355D11353535003F35
-3535FFFF008AFFE107A405DA0036023FA400003700BB02910000011702410413FDC60038
-4026040302320A040302350035203540358035FF3505012D002D5B2D7B2D03000900093F
-094F09035D11355D11355D11353535003F353535FFFF0099FFE1076F05DA00360240A600
-003700BB023100000117024103DEFDC6003640240403020E0A040302116F118011FF1103
-01092B093B0944095B097F0905000400043F04025D11355D11355D11353535003F353535
-00010061FE5901FA00880003002CB90002FFE840170D10370318090C3700180910370F01
-010101000D0202002F332F003F332F5D3130012B2B2B1B01330161A5F4FEF1FE59022FFD
-D10000010161FE59037000140014002440150B021B012B013901041207070B53030D0E2A
-0000062F332FED003FFD322F2F31305D0514062322262735331E0133323635342627331E
-010370B79225742D091A58326862060399020659A2AC0E0CA00A1A4E581D491913340001
-0212050C0305068C000300144009030302002D100301032F5DED002F332F313001032303
-0305319131068CFE8001800000030100050C0418068C00030007000B003F401506050AAF
-090902000002072B0640090A37060A2B0BB8FFC0400C090B370B06002D0B100301032F5D
-33FD322F2BED2F2BED002F332F12392FED3939313001032303012335330523353302FD31
-803101FDBFBFFDA7BFBF068CFE800180FE8CC3C3C300FFFF00070000055E05D102360024
-00000117019DFDF5FF450012400A020E03020E1F0E4F0E025D1135003F35FFFF00000000
-059005D10037002800F300000117019DFDEEFF4500204014010F030F111011401103011F
-0C010C00400101012F5D352F5D355D003F35FFFF00000000062E05D10037002B00F30000
-0117019DFDEEFF4500204014010F030F112011401103011F0C010C00400501052F5D352F
-5D355D003F35FFFF0000000003C805D10037002C00F300000117019DFDEEFF4500244018
-010F03011F0C010C00400201020F111F11401150116011055D2F5D352F5D35003F35FFFF
-0000FFE1069905F00037003200BF00000117019DFDEEFF45002240150227030F29010227
-1F270101000F000F100F700F035D1135355D11355D003F35FFFF00000000060105D10037
-003C011B00000117019DFDEEFF45002440180109030F0E1F0E2F0E03011F090109001F04
-4004700403042F5D352F5D355D003F35FFFF0000000006D705F0003701BB00B700000117
-019DFDEEFF45002A401E012B03011F2B012B00001C101C201C031C0F2D202D502D602D70
-2D8F2D065D2F5D35115D35003F350004FFCB00000267068C00030007000B000F005C401D
-0A090FAF0C0C06070706060205010B2A0A40090F370A0A0404000E2A0FB8FFC04015090F
-370F0F0707017F11011192001A7F010101881010F65DFDED5D11332F332F2BED11332F33
-2F2BED002F3F332F332F12392FED39393130212311331303230301233533052335330177
-BCBC0438543801B0ABABFE0FABAB045D022FFE800180FE8CC3C3C300FFFF001A0000055E
-05D1021600240000FFFF00C80000052B05D10216002500000002001A0000058605D10003
-00060058403C49056A050205041A000003061A01010215001A0125002A0145004A014B02
-4403590256036B0264037B0275030E020305030000080105010203065401002FED3F1239
-012F11332F17395D31308710FD8710FD04C0005D2901012109020586FA94023201080127
-FE50FE5105D1FAD7047BFB85FFFF00C80000049D05D1021600280000FFFF007E00000508
-05D10216003D0000FFFF00C80000053B05D10216002B0000FFFF0089000002D505D10216
-002C0000FFFF00CD0000057505D10216002E00000001001A0000056205D10006006C404E
-0902390258020378017703020203020114000600020314040405490546067C0573060405
-030405002400390042005A006A007400070000080F08010F08010A042B0436044D045504
-65047B0407042F5D5D5D11332F5D002F3F3130015D8710FDC08710FD08C0015D005D2123
-09012301330562D5FE2CFE2CCB022CF00505FAFB05D1FFFF00C8000005F605D102160030
-0000FFFF00C80000053805D102160031000000030072000004BF05D100030007000B0047
-40130535060609013502030A350908054009133704B8FFC0401609133704050504030204
-0908720D0F0D1F0D0209680C10E65D10E41117392F2F2B2B003FED3FED12392FED313001
-213521032135211321352104BFFBB3044D34FC1B03E534FBB3044D0521B0FD08B0FC77B0
-FFFF0073FFE105DA05F0021600320000000100C80000053B05D100070027401703350603
-010501140078090F0940095009030414056C0810F6ED5D10F6ED002F333FED3130212311
-2111231121053BC6FD19C604730521FADF05D100FFFF00C80000049605D1021600330000
-000100760000050005D1000C00EB404709040908450B540B6409640A660B9309930A960B
-A409A30AA70B0D0608060B1608160B28032708340A340B430A430B5903550B670B760B8B
-0399049908B804B808EB04EB08150BB8FFC0B32529370AB8FFC0B325293709B8FFC0B325
-293708B8FFC04030262937030203080908B3040304030B0A0BB302030264048D02020403
-0203080B3501083505030403A009B009D0090309B8FFC04023191E371009200960097209
-D009E00906090703040B0908070602000010000200000E022F11332F5D1217392F2F5D2B
-71332F003FED2FED11173931305D011087ED87C01087ED8708C0012B2B2B2B5D71290135
-090135211521011501210500FB76026CFDA80448FCC0024AFD8A039AB80258020EB3B0FE
-061AFDA3FFFF0000000004EE05D1021600370000FFFF0006000004E605D10216003C0000
-FFFF00440000053805D10216003B0000000100B30000064405D10023006240402515251E
-021B067518011834380948096F090309192209030810030822142311141023071B180714
-108008A008B0080320255025702503080825240F253F25025D1112392F5D5DC4ED393910
-C42FED2FED002F3F1217392F5DED5D393931305D011406070E01071123112E01272E0135
-1133111416171E01171133113E01373E013511330644514D50E197C59AE24B4E51C63B34
-359A62C5619C353836C6038E9DD74345460AFEBE01420B484245D69C0243FDA66D8E2C2D
-2F0703E4FC1C082D2E318571025A0001006C0000062005F00027007D40125B195B256C1A
-641D64216C24791A79240821B8FFC0B3090B371DB8FFC0403B090B373002301440024014
-041925140204160B341F02261835011608251202191214081502141C272222290F29010F
-291F299029A029040E15171C2FC4ED5D5D11332FC4123939ED2FED2FED003F3CFD3C3FED
-1217395D31302B2B5D2901113E01373E01353426232206151416171E0117112135213526
-023510002120001114020715210620FDC03C772C2D34FEDCDCFE342D2D763CFDC0019A9D
-CB0177013101310177CB9D019A01832658393B9F6ACEF9F9CE6A9F3B395826FE7DAE7C5A
-0138C20114015EFEA2FEECC2FEC85A7CFFFF007E000002E207500236002C00000117008E
-FF240175001940130200104010501060107010050100100D0409252B355D3500FFFF0006
-000004E607500236003C00000117008EFFED01750019401302000E400E500E600E700E05
-01000E090500252B355D3500FFFF006CFFE10443068C0236012E00000116019DE200000A
-B6020024210800252B35FFFF006DFFE603EE068C0236013000000116019DCC000013400E
-014041504170410300413E1219252B5D3500FFFF00B9FE64045F068C023601C600000116
-019D1D00000AB601001A170E16252B35FFFF00A000000193068C023600D500000117019D
-FE8E0000000BB601000704020325012B3500FFFF00B1FFE2045C068C023601D100000116
-019EFB00000F400903020100221F0717252B35353500000200B9FE64048D061400180037
-0077404F16200D1037070F4A1B4326433756267929062E200D0F3733200D103705200D10
-371615203E5F21012121032B3E0C0135400309080C15120F200120281B12122008191B00
-90391F390132071A08883810F6FD325D10F6ED1239392FED2F5D1239003F3FED3FED1239
-2F5DED393931302B2B2B5D012B011400232226271123113436333216171E011514060715
-1E01073426272E012B0135333236373E01353426232206070E0115111E01333236048DFE
-F3CD4FB03FBCFDDF5A953B39448B7F9FBCC2453A3B924924244282272E2D8A6D49682120
-1E42964895A101BCCAFEF82C2AFE2405D2E0FE2B2E2B8A5B7FBD25111AC797596F1F2016
-A01D1E2262557074352C2C753EFCA2261F9D0001003DFE64047F045D0008006940497507
-01070607081A00010007061A04050505030C0A001A002A004A0059006900750007000505
-15052505450556056605730507050001011A059004A0040204040A091F0A4F0A5F0A035D
-1112392F5DC4ED10C42F5D2F5D003F3F31300187FDC08710FD08C0005D09011123110133
-0901047FFE37BCFE43CC0157015A045DFBDBFE2C01D40425FCC4033C0001006CFE6403D6
-0614002F0058401D4600570065287F1178207D21061D1A3E1B012D3F0F070C1A1A19121C
-07B8FFE04018090C37000701071C070BB40303310F313F3102231B12853010F6ED5D1133
-2FED33332F5D2B2F1239392F003F2FED3FED3931305D251E011514060723353E01353426
-2B012226353412373E013735213521150E01070602151416171E01171E013B013216039A
-201C5A43B35A4C3D2F91E5DE5C4E4BC56CFE3402E875E55A5972060C0A31272479385647
-664B285B2854A93F0E4F7745394CE8E58C01007770CD5E099E874ECE7875FEE88F224828
-264B18160534000100B9FE64045F047C00160038402303151615731503100D084213040E
-05010C0D08021A0091181F18601802100B1A0D881710F6FD325D10F6ED003F3F3F3FED12
-3931305D0123113426272E012322060711231133153E0133321615045FBC1218195E4B4D
-A84DBCBC58BC63B5BEFE6404184D87262A294C3BFCBE045D7C4952DACD0000030089FFE1
-04750614001700240031006CB9002FFFD6B30A0D3729B8FFD640400A0D37212A0B0D371B
-2A0B0D37662C01263E0F241F24022424061E3E3A124A120212012C3E3506450602060A25
-181A0000331F333F330224261A800C900C020C2F5DFD325D11332FFD32003F5DED3F5DED
-12392F5DED5D31302B2B2B2B011406070E01232226272E01353412373E01333216171612
-072E01272E01232206070E010705211416171E01333236373E0104752E243AD29898D23A
-252D2D2639D39797D339252EBD043120296C4F4F6C29222F040272FD8E2E2428704F4F70
-28242E0300BEFD548789898754FDBEAE010753828A8A8254FEFA548FD6364639394637D5
-8FA18EE93E453E3E453EE900FFFF00BB00000177045D021600D50000000100C1000004A8
-045F001800D3403B0601060216182618451856186618071C023A0169027A029701A602A6
-18C70208020203C60101860101011A001800090801F90801080B0A03090109B8FFEE4040
-10183709B402181703177F0301091808020305010C1010143F0C05060505011A172A1736
-178017A417051517251777179417E917F917060917180201050F0F00B8FFF04013090E37
-00001A0F1A1F1A3F1A0308031A05891910F6FD3C5D11332F2B332F17395D71002F2F3F3F
-FD322F111217395D3130018710C0C07AF52B7118C0C004C07172018710FD5D7108C0015D
-71212301071123113311013E013332163315232E01232206070304A8F8FE3D70BCBC0180
-487F3F1C3C070B102F0D2F4D1DFB01E96DFE84045DFDDA01A14F3802A602022F21FEF100
-0001003D0000047F061400070085401305040502020306011A07000002031A04040505B8
-FFF0401C0C10372B002604200703050402030601000806680701070506030400B8FFC040
-260910370C001C004B005A006A00790006008D090F090103041304440455046504760406
-04820810E65D5D10F65D2B1117395D2F003F3F17393130015D2B8710FDC01087FDC008C0
-08C0012123090123010333047FCDFEB8FE97C401D1D7D3033DFCC3042001F400000100B9
-FE640465045D00150046402C12200B0D3703200B0D37080205140B051042050900080A0C
-0102131A0092171F1760179017030D091A0A881610F6FD3C5D10F6FD3939003F3F3FED3F
-3C12393931302B2B2123350E012322262711231133111E013332363711330465BA4A874E
-4B7854BCBC209E5B5D8836BC764E3D3650FDF305F9FCBA2752433C034000FFFF003D0000
-047F045D02160059000000010068FE64041106140046008A403C0F020F06090E1B0E241E
-24283415361E36284428473C562D563C691779170F1918333F32320C24213D22013F3F0C
-030C191C3232232121122B1B1C04B8FFD6400E090C37040408B4231C1280000100B8FFC0
-400B090C370000483A1B12854710F4ED11332F2B5D123939ED332F2B2FED12392F2F332F
-1239003F2FED3FFD3212392FED393931305D0514060723353E013534262B012226272E01
-353436373E0137352E01353436373523352115212206070E01151416171E013B01152122
-06070E01151416171E013B013216171E0104115B42B45C4B3A2E8C8CB93F424532302C89
-4C7D96575AE40338FF00446D302D3641332D7650AAFED942692F2B334B403F995A1C4467
-211F226055A83F0E4F7844374E36393C97584E84353145130B1CA56853873A069A9E1D22
-2066434F621A1716A52827256A3B66721919072F25235F00FFFF006AFFE10471047C0216
-00520000000200B9FE640494047C0011001E0042402C3A17351E4A17431E560D05060315
-3E0F041C400309080C121B3A004A00020090201F206F200219071A08881F10F4FD325D10
-F65DED003F3FED3FED123931305D011000232226271123113436373E0133320003342623
-220615111E013332360494FEEBDE41A348BC47423EBB66F30100C2A0929E8D49774BA2B0
-0241FEFEFEAB242BFE2B04227BB9423E42FEDAFEDFDACCC0B6FE6D221DDE00010069FE64
-03FA04770029005C40120C020C06201325233614362340237A1F0817B8FFE040140E1037
-3F194F190219191D3F1504030C263F0B04B8FFD64011090C370418180408B400002B201B
-12852A10F4ED11332FED33332F2F2B002FED3F3FED332F5D31302B5D0514060723353E01
-3534262B012226272E013510002132161715232E01232206151416171E013B01321603FA
-5E3EB1564D3C2D5C75C64B49530137010354A0430C5E9D44A6BD393232814B64738E6057
-AA3B0E4B7947364F3C4342D092010E0144251BD33E32EEC1708E2D2C2799000100B1FFE2
-045C045D00170030401F1607050F3E0903560366037903880305030A151A0091191F1901
-091A06871810F6ED5D10F6ED003F5DED3F333130011406232226351133111416171E0133
-3236373E01351133045CF4E2DFF6BC14201F6B5C56731E1D15BC0197DADBD7DE02C6FD7F
-5D782E2B2B2C2C2C7B5A028100010030FE640488045D000B00A240492A02250839023408
-4B02440879020710091A0A0B0A071A060506011A000B00031A04050402050B080A000606
-0A0405064A0445066A0465067A04770608040C0605080B050204040A00B8FFE040100A10
-3700000D2F0D010604200A1037042F2BC45D11332F2BC4121739003F3F5D111739313001
-8710ED8710ED8710ED8710ED4B535840140B030A070002030A0601080409070005040906
-010F0F0F0F59005D0123090123090133090133010488D5FEA6FEA2CB01BCFE4FD5014F01
-53CBFE4FFE64026BFD95030202F7FDA80258FD11000100B0FE6405E3045D0023006B4047
-1B062618751802183D39094909020919220903081005080C221A3F237F230223111A3010
-7010021023071B18071A109008C008025025602502080825240F25010F251F253F25035D
-5D1112392F5D5DC4ED393910C42F5DED2F5DED003F3F1217392F5DED5D39393130011406
-070E01071123112E01272E01351133111416171E01171133113E01373E0135113305E360
-4F52C873BB73C753505FBC4B34388643BB4386383B44BC01BE72A835373705FE68019806
-343936A772029FFD9C718723261E0403C7FC39051C27287B7802640000010071FFE20611
-045D003D0079402D361F3632441F4432551F55326804680F691A69377D1A7D370C283B28
-0903061605210D303E060A3A400C0E3718B8FFC040240C0E37361B001B1B13003A29090A
-291A18139028A028C0280328283F3E1F3F3F3F6F3F035D1112392F5DC4C4ED393910C4C4
-2FED2FED2B2B003FED39393F1217392F31305D011406070E0123222627230E0123222627
-2E013534123733150602151416171E01333236373E01371133111E01171E01333236373E
-01353402273533161206112F33379D7360A2250627946671A333332F7290E4879F101E1A
-5D47334714161D06BA091C1518393A465E1B19169D89E4907201F760C14B505963434462
-5D4C4CBF61AA0115A7116CFECCB742713F37491911122C0F0248FDB8112C111316473937
-7A41B601346D11A7FEEBFFFF00050000022D05DB021600770000FFFF00B1FFE2045C05DB
-023601D100000116008EFB000015400F02301D501D601D0301001D180717252B355D3500
-FFFF006AFFE10471068C0236005200000116019DE200000AB602001B180600252B35FFFF
-00B1FFE2045C068C023601D100000116019DFB00000AB601001B180717252B35FFFF0071
-FFE20611068C023601D400000117019D00B60000000AB60100413E1300252B35FFFF00C8
-0000049D07500236002800000117008E00500175000DB7020100110C020325012B353500
-0001FFFF0000060705D1002500614025652476240216341F1F061E1A351B03093506182F
-073F074F077F0704070717590F010F1500B8FFC04014090D370000270F27011A1F1D011D
-1D1F17141A182F33FD32322F5D2F5D11332F2BED5D12392F5D002F2FED3FFD3212392FED
-31305D011406070E012B0135333236373E01353426272E01232111231121352115211121
-3216171E010607534957AF8A6E5D5B782F38343135329583FEEBC6FE520468FE0C015398
-BF554C4901CC6CB13A4530B11022286F4E4B73232213FD220521B0B0FE6824423BAEFFFF
-00C80000048A07ED023601EB00000117008D003501610015401001300840086008700804
-0008070405252B5D350000010073FFE5053905EC002A006A400C3A1C491C58057606790C
-0511B8FFE040370A103701200A103720341D1D0F032A2A26340309131317340F021E1E13
-000010000200002C0F2C010F2C1F2C2F2C3F2C041D206C09682B10F6FD325D5D11332F5D
-33332F003FED332F3FED332F1112392FED31302B2B5D250E012322242726023534123736
-243332161715232E01232206070E01072115211416171E013332363733053963EC91A9FE
-EE61616969625F0112A98CF65F104EF98D6DAE4846580F0334FCC258474AC4708AF75010
-4127356863630120B7AF011F66626C3427DF40523A3B3BAD72AD8BD94648494A4300FFFF
-0086FFE5050205EC021600360000FFFF0089000002D505D10216002C0000FFFF007E0000
-02E207500236002C00000117008EFF240175001940130200104010501060107010050100
-100D0409252B355D3500FFFF002CFFEB02EA05D10216002D000000020012FFFD08A205D1
-000E003D0066B3460C0130B8FFACB30A10371EB8FFC0401D0B0E37073437371618353503
-28282C352408341637081416163500150FB8FFF440110E11370F713F2F3F011813003501
-3535282F332F5DED5D10F62BFD11392FFD32002FED2FFD322F3FED12392FED31302B2B5D
-013426272E01232111213236373E01371406070E01232111210E01070602070E01070E01
-2322262335331E01333236373612133612372111213216171E0107D33235379083FEEC01
-0F858F363834CF554754C098FDEEFDF0030B0308251D1D492F306544153C0C0E0A1E0F24
-401647430E050B040391015298C0554C4901C94B72232510FDCB1A252769556CB0374238
-052171D955D6FEEC595A6B2B2C2603C001021617470146012D62014487FDB823423BAE00
-000200C80000088305D1000E002700554020171E07342121161F1B030834161A560F0120
-1F081400166F160216161900150FB8FFF4400F0E11370F71294029011D19141A6C2810F6
-FD325D10F62BFD11392F5DED39395D002F2FED3F3312392FED39393130013426272E0123
-2111213236373E01371406070E0123211121112311331121113311213216171E0107B432
-35379083FEEC010F858F363834CF554754C098FDEEFD65C6C6029BC6015298C0554C4901
-C94B72232510FDCB1A252769556CB037423802DEFD2205D1FDB80248FDB823423BAE0001
-FFFF000005FD05D1001D00504032000E48175817600E620F700E700F0708011A350B0B01
-07033504031301131412121F5F067F0602060306070014037F0101012F5D33FD32322F2F
-5D11332FED002F333FFD3212392FED123931305D2123112135211521113E01333216171E
-01151123113426272E01232206070273C6FE520468FE0C5FF66765AA3D3D45C6161E2079
-646AC3660521B0B0FE2D1F33323534A373FE11018C4A8C2B2E312622FFFF00CD00000575
-07ED023601F200000117008D003C01610010400A01702301002321050025012B5D350002
-0006FFF904E6078F001A002800AF405A29033801461955140419191A1814171617161716
-191A130001001617181A010500070B0B0F35071B0F21702102212175250125AA0F1E011E
-1E0003281A1B221A702101211B2100700A010A360156016501760104160A01031700B8FF
-E0401409103700002A502A012A400910371720091037172F2B2B5D11332F2B1217395D2F
-5D1139392F5DED2FED003F332F5DED5D332F5D332FED322F11121739018710FDC008C001
-8710FD08C03130005D09010E01070E012322262735331E01333236373E013F0101330901
-030E0123222627331E013332363704E6FDCA225D3634612D2872100E0F462D14481C203F
-1624FDD6DB01B301862105C9A8A8C905B602605E5F5F0205D1FB1B4C621B19110801B902
-09060B0C34324F044FFC92036E01BEA6A8A8A67063627100000100C8FEAF053B05D1000B
-0032401C060203043409000B0913000002061407780D400D700D020314026C0C10F6ED5D
-10F6ED12392FED002F2F33ED3F33313029011133112111331121112302A4FE24C602E7C6
-FE24BB05D1FADB0525FA2FFEAF00FFFF001A0000055E05D1021600240000000200C80000
-052C05D100120021003E40256311011A340C0C070B3508031B3407080A0A131556000100
-71230F234023020C1B14076C2210F6FD325D10F45DED332F003FED3FED12392FED31305D
-011406070E0123211121152111213216171E01073426272E01232111213236373E01052C
-554754C098FDE403E5FCE1015C98C0554C49CF3235379083FEE20119858F36383401CD6C
-B037423805D1B0FE6823423BAE724B72232510FDCB1A25276900FFFF00C80000052B05D1
-021600250000000100C80000048A05D10005001F401003013504030000070F0701021403
-6C0610F6ED5D11332F003FED2F3130012111231121048AFD04C603C20521FADF05D10002
-000AFEAF059E05D1000D00130049402A09121A124A110310340A030C1307340301051013
-0A0A070E140C0C0113200001000015131307070413052FED392FED11332F5DED392FED12
-392FED002F332FFD32323FED31305D01231121112311333612112111332111210A010705
-9EBCFBE4BC78829B03728DFEADFE0E0E9476FEAF0155FEAB0201D602B1019AFADF0475FE
-9BFDAFBFFFFF00C80000049D05D102160028000000010020000007A805D1003700C7402E
-093318332933401D40244135541D54247518711D73240B27133333351A130E0C0E020116
-09103701130037000708B8FFEA405A091037081309090A271F1A032C223237070A0C0E33
-35072C02142D350409021521052C03002F0A20375F0A50376F0A6037062C2C0137022733
-350600C5220414051515080A070C0E1A0609C51F0505393810393F395F397F39045D1112
-392F33F41739322F10FD32F41739322F5D002F3F1739FD322F121739FD111739018710FD
-2BC08710FD2BC08710FD8710FD3130005D21230123112311230123012E01272E01272E01
-2B0135333216171E01171E01171133113E01373E01373E013B0115232206070E01070E01
-0707A8F2FDF469C46BFDF4E6025158682013251C1B533C3C47A7B23D0B1E0F2C8F56C45C
-912E121D093CB5A5473C424B1E1D25132A7D3E02A9FD5702A9FD5702FE3A9C693D571C1B
-18B17FAD1E5824696608029DFD610663702C5519AC80B1171C1B5B3A8587270000010051
-FFE5048505EC0040007F40145401583B6701693B7F0B7F0C7031703274380932B8FFE040
-3F0B10370B200B10373E3D1D3420200934703001303029343402100D7F0D020D0D113409
-0A3D1E0B0D37171E0B0D37236C3A1E1E3D3A030C171503734231310C2F332F10F6ED1217
-392F2FED2B2B003FED332F5D3FED332F5D1112392FED393931302B2B5D011E0115140607
-0E012322262735331E01333236373E01353426272E012B0135333236353426272E012322
-06070E010723353E01333216171E0115140607151E010416303F5B4650E68593FB4A0F63
-F97148A83436313C33339159C9B3ADD2352E2D6F4C4E843B3064170D4BF87E7BB14B4E52
-A37D347602CD2A816669AA3C4444371EDE3B4B2A292D6F454F651F1E1BA97F7836521818
-151E1411340DDB2036272C30885A7FB01B0F092F000100C80000053905D1000900644023
-0B020407190703070715075B0253076C0262077F0270077608C802E602E707F6070D07B8
-FFE840240B0F3702100C0F3707060102040308030308030807021400780B0F0B400B0207
-14046C0A10F6ED5D10F6FD113939003F3F1217392B2B31305D7121231101231133110133
-0539C5FD1CC8C502DBD104A9FB5705D1FB690497000200C800000539078F000900170093
-40320B020407190703070715075B0253076C0262077F0270077608C802E602E707F6070D
-0A0F10701002101014AA0F0D010D0D07B8FFE840330B0F3702100C0F3707060102040308
-030308171A500A600A020A111A100A10000403080702140078190F194019020714046C18
-10F6ED5D10F6ED113939111239392FED2F5DED003F3F1217392B2B332F5DED332F5D3331
-305D7121231101231133110133030E0123222627331E01333236370539C5FD1CC8C502DB
-D1B505C9A8A8C905B602605E5F5F0204A9FB5705D1FB69049701BEA6A8A8A67063627100
-000100CD0000057505D1002000AF407909011F01290127203A0137204B0147205C016500
-6720760074200D1F200A0D370C200A0D370202038801C8010201B30020001E661B861B02
-1B13120D120D121B1E04152002322F08010808000716351503070305000D121B1E200504
-4F150115150F2220003000400004500001006E22402201080414056C2110F6FD325D10F6
-5D5D322F5D121739002F2F3F3FED1112392F5DFD39121739018710FD5DC031300187107A
-FD5D1808C0012B2B5D2123012311231133113E01373E01373E01373E013B011523220607
-0E01070E01070575FEFDA387C6C6335A28284E1E0D231245B9B44F53454E1F1D2B17346B
-5A02A7FD5905D1FD6401121917553E1B522DA686B1191D1A583B847C2E0000010012FFFD
-051805D10021003DB9001BFFACB309103709B8FFC0401A0B0E370335200301131317350F
-01140078238F230103132020122F332FED5D10F6ED002FFD322F2F3FED31302B2B212311
-210E01070602070E01070E012322262335331E0133323637361213361237210518C6FDE6
-030B0308251D1D492F306544153C0C0E0A1E0F24401647430E050B04039B052171D955D6
-FEEC595A6B2B2C2603C001021617470146012D6201448700FFFF00C8000005F605D10216
-00300000FFFF00C80000053B05D10216002B0000FFFF0073FFE105DA05F0021600320000
-000100C80000053B05D100070027401703350603010501140078090F0940095009030414
-056C0810F6ED5D10F6ED002F333FED31302123112111231121053BC6FD19C604730521FA
-DF05D100FFFF00C80000049605D1021600330000FFFF0073FFE5054605EC021600260000
-FFFF0000000004EE05D102160037000000010006FFF904E605D1001A0080403C29033801
-461955140419191A1814171617161716191A130001001617181A010500070B0B0F350700
-03700A010A360156016501760104160A01031700B8FFE0401409103700001C501C011C40
-0910371720091037172F2B2B5D11332F2B1217395D2F5D003F2FFD322F11121739018710
-FDC008C0018710FD08C03130005D09010E01070E012322262735331E01333236373E013F
-010133090104E6FDCA225D3634612D2872100E0F462D14481C203F1624FDD6DB01B30186
-05D1FB1B4C621B19110801B90209060B0C34324F044FFC92036E00030069FFF0062405E1
-001D002A00370058403624182C321525062B32091509081603082A1E253265006A0F041E
-150032150F00072B1518250407140F080839381F393F396F399039045D1112392FC4ED17
-3910C42FED2FED5D002F3F1239392FED39392FED39393130011406070E01071523352E01
-272E01353436373E01373533151E01171E01073426272E0127113E01373E0101110E0107
-0E01151416171E010624594F55F48AC586F6574F59564C51F395C594F64F4B57CE403B3A
-8E6A5E9A324142FD8E6A8E3A3A414340319B02F38CD9494F5D03A6A6035A524AD88C88CC
-4C515E049B9B03624E49D07F63A639383402FC8602392F3CAEFEAC037A01363737AA6170
-B63A2D3CFFFF00440000053805D10216003B0000000100C8FEAF05BE05D1000B0032401C
-0602030B08043501080514080800130D40090B370A0A0D0414016C0C10F6ED11332F2BED
-392FED003FFD322F3F3331302901113311211133113311230502FBC6C602DDC68DBC05D1
-FADD0523FADDFE010001008E000004EA05D10019003B40243511451154116C0974160502
-0C1435050500180C030017011400781B0F1B010D140C6A1A10F6ED5D10F6FD32002F3F33
-12392FED123931305D2123110E01232226272E01351133111416171E0133323637113304
-EAC681DD6463AC3F3F47C6142323726B71D652C60276282A313535A47201FCFE67577930
-2F2F281E02B1000100C80000077605D1000B003640200A06020308043401091400C60814
-05041401C605050D0C1F0D3F0D500D700D045D1112392FF4ED10FDF4ED002FFD323F3333
-31302901113311211133112111330776F952C6022EC6022EC605D1FADB0525FADB052500
-000100C8FEAF080305D1000F004140260A0602030C080434010F0D13000009140CC60814
-05041401C6050511101F113F1150117011045D1112392FF4ED10FDF4ED332FED002F2FFD
-32323F33333130290111331121113311211133113311230747F981C6022EC6022EC68DBC
-05D1FADB0525FADB0525FADBFE0300020000000005F405D1000E00210046401D07341B1B
-1618351903083416560F011B08144F167F160216161900150FB8FFF4400A0E11370F7123
-0F2301192F5D10F62BFD11392F5DFD325D002FED3FED12392FED3130013426272E012321
-11213236373E01371406070E0123211121352111213216171E0105253235379083FEEC01
-0F858F363834CF554754C098FDEEFE660260015298C0554C4901C94B72232510FDCB1A25
-2769556CB03742380521B0FDB823423BAE00000300C80000069505D1000E001F00230055
-4016440D0107341919161703083416220321560F0100150FB8FFF4B30E11370FB8FFC040
-150C10370F0F21142078250F25702502190814166C2410F6FD325D10F6FD322F2B2BED5D
-002F3F2FED3F12392FED31305D013426272E01232111213236373E01371406070E012321
-113311213216171E010123113304533235379083FEEC010F858F363834CF554754C098FD
-EEC6015298C0554C490173C6C601C94B72232510FDCB1A252769556CB037423805D1FDB8
-23423BAEFDC505D1000200C80000052205D1000E001F003C401007341919161703083416
-560F0100150FB8FFF440110E11370F71210F21402102190814166C2010F6FD325D10F62B
-ED5D002FED3F12392FED3130013426272E01232111213236373E01371406070E01232111
-3311213216171E0104533235379083FEEC010F858F363834CF554754C098FDEEC6015298
-C0554C4901C94B72232510FDCB1A252769556CB037423805D1FDB823423BAE0000010061
-FFE5052905EC002A0070400A3A1C491C640676060426B8FFE0403E0A10370B200A103718
-34191928092424203428020D0D11340909060316035603031A24171403732C0F2C010F2C
-1F2C2F2C3F2C04241824180F0C1F0C020C2F5D33332F2F5D5D10F6ED11395D003FED332F
-3FED332F1112392FED31302B2B5D0116121514020706042322262735331E01333236373E
-01352135212E01272E012322060723353E0133320404616068696366FEEFA38DFE571051
-F78D7BCC444849FCD303230E5C4747B46689F057115DFE85AC010F052C60FEE4C2ACFEDF
-676A6B3625DB414D574B50C980AD77AF3939374D43DC27356000000200C8FFE107D305F0
-000B001E006240427814010903060915161A1C5616591C7916761C080C34131E1314031C
-03341602100309341C090F13190615180C3F0C580C6F0C040C0C0F0015197320120E140F
-6C1F10F6FD3210F6ED12392F5DED1239002F3FED3F3FED1217392FED5D31305D01100023
-2200111000333200012311231133113312002120001110002120000705FEFFDBDDFEFE01
-03DCDB0101FB79F0C6C6F924016A0113013F016CFE90FEC5FECCFE9102E801280135FECC
-FED7FEDBFEC90136010EFD3005D1FDAC012D0146FE63FE95FE93FE6601890002002C0000
-04DE05D10010001F0066400C28033506471C5A0759170504B8FFE8403209103703041305
-0506060F113440030103030012340F03000519150904060309045F050105120114007821
-0F2140216021035D10F6FD322F5D17392FED002F2F3FED12392F5DED12393130018710FD
-C02B005D212311210123012E01353436373E0133210311212206070E01151416171E0133
-04DEC6FEBFFE43EE01DE96A55F4E47BE7301EAC6FED256682B2E3425292D82560250FDB0
-026E33D5B372A5373228FD240232161D1F7043506A292C1EFFFF0068FFE1041D04780216
-0044000000020074FFE1047C061D00270039006440160C1F35043D29303940044B294039
-6512751273330A33B8FFC0402B0B0D3722062B41002510250225250619411800373F060A
-223118180C281B03903B1F3B3F3B02311B0C863A10F6ED5D10F6ED12392F1239003FED3F
-ED12392F5DED123931302B5D011E01151400232226272602353436373E01373E01373E01
-37150E01070E01070E01073E01333216133426232206070E01151416171E0133323603EE
-4648FED4DB6CB640504F0E19144D3548EBC24F883642814080CF303535084BB3655EAE0F
-B29257A04802033A352E6C3E97AA03B846C786FAFEB6494C5F0121D04B9B6C5DAC354959
-11070904AD0408060B3E3135AB4D36493EFE22B9B7372E19431CAED840362DDA000300B9
-00000453045D0015002400330061400C0A0305141A0315147623050CB8FFD6402F090C37
-12112C3C4F1E011E1E071D3D08052D3D0708161B122C0F0F07251B00100D10370090350F
-35011E2C1A07883410F6FD325D10F42BED12392F1239ED003FED3FED12392F71ED393931
-302B5D011406070E01232111213216171E0115140607151E01033426272E012B01113332
-36373E01133426272E012B0111333236373E010453413940977BFE3201B07D7F383F3B5E
-4A6381FD1F202A694DC4EB4A4724261D3B243D26584EF1B270792C2C2B0152517E2A2F2A
-045D111D216A48537A220A1889017D243A101505FECE0B161841FE4237451D1207FE930F
-19194800000100B9000003BB045D0005001F4010013F040503700001000007021A038806
-10F6ED11332F5D002F3FED313001211123112103BBFDBABC030203B8FC48045D00020009
-FEF404AF045D000D00130053401C3B124A12020105103E0A050C13073E0310C90A0A070E
-1A0C0C01C900B8FFC040120B0E370000152F153F1502131A070704C9052FED392FED5D11
-332F2BED392FED12392FED002FFD32323FED2F3331305D01231121112311333612112111
-3321112106020704AFAFFCB8AF79757302BE87FEBDFEAF0D8053FEF4010FFEF101ACC101
-F90103FC43031FFBFE628600FFFF006AFFE60460047C0216004800000001003400000632
-045D003100D840123A0E3A2D4A0E4A2D5F0C5F2F6F0C6F2F0826B8FFE0B3090B3715B8FF
-E0401A090B3724B42D2D2F17B40E0C0E020116091037011A0031000708B8FFEA405E0910
-37081A09090A241C1703291F3C31070A0C0E2F2D072902112A3F040902121D052905002E
-0A21315E0A51316F0A60317F0A7031082929013102242D2F0600C71F041A051212080A07
-0C0E170609C71C0505333210333F334F336F33045D1112392F33F41739322F10FD32F417
-39322F5D002F3F1739FD322F121739FD111739018710FD2BC08710FD2BC08710FD8710FD
-3130002B2B5D21230123112311230123012E01272E012B0135333216171E01171E011711
-33113E01373E01373E013B0115232206070E01070632E3FE9A5BBA51FE8AD901AF314B1F
-1B4A5435457C962D091B0A216740BA4069210B1B082C947D4535554B191C4D2D01FEFE02
-01FEFE0202491A60615542A2647D1A43174C3F0401E4FE1C04404B1942197B66A2465159
-631900010041FFE603C20478003D007FB7263475127D3C032FB8FFE0404C0D103708200D
-10373B1B3FAF1CBF1C021C1C06313F2D902DA02D032D2D293E3104200A300A020A0A0E3F
-06091C2E231B372E1C373B0409141B00903F7F3F803F02800990090209400B0F37092F2B
-5D5D10F6ED1217392FED2F2F003FED332F5D3FED332F5D1112392F5DED3931302B2B5D01
-1406070E012322262735331E01333236373E01353426272E012B0135333236373E013534
-26272E012322060723353E01333216171E0115140607151E0103C2574444A45274D2660D
-49E26A326A272A32312A297430A371288128343D3024255B2366C5430D53BE5F4E9B4342
-546D5C677A01395E822827242C2ECE4046131518433A3C48121208A2060D113E442F3D11
-110C3734CF1B221C2222755658851D071989000100B900000466045D00090044402D0B02
-0407020D030103380B103702380E10370706010204030805030808021A00920B1F0B600B
-0203071A04880A10F6ED395D10F4FD39003F3F12173931302B2B5D712123110123113311
-01330466BAFDB7AABA0243B00347FCB9045DFCC5033B000200B900000466061500090017
-0073404C0B020407020D030103380B103702380E10370A0F1001101014500D0D07060102
-04030805030817C91F0A2F0A020A11C900101010201003100A100408021A0092191F1960
-190203071A04881810F6ED395D10F6FD391239392F5DED2F5DED003F3F121739332FED33
-2F5D3331302B2B5D7121231101231133110133030E0123222627331E01333236370466BA
-FDB7AABA0243B06B05B1A9A9B105AB015B58595A010347FCB9045DFCC5033B01B894A6A6
-94695E5C6B00000100C1000004A9045D001A0093404D0120090E371B02271A360E321635
-1A0502011A001A000A1B0F2B0F020FB41618160A0F181604121A023C2F08010808000713
-3F12050705010508561A9600961AB600B61A05021A181604121200B8FFC04011090E3700
-001C0F1C1F1C0208031A05891B10F6FD325D11332F2B332F17395D003F3C3F3FED111239
-2F5DFD39121739018710FD71C03130018710FDC0015D2B2123012311231133113236373E
-01373E013B0115232206070E010704A9F6FE3066BCBC5D72280E1B0D349C9256534F5924
-2859320200FE00045DFE1E434A1B3D1C7170A243545E5D180001001DFFFE043E045D0021
-003FB9001BFFACB30D103709B8FFC0401C0D1037023E2105001313173F0F011A00922303
-1A20203020022020122F332F5DED10F6ED002FFD322F2F3FED31302B2B212311210E0107
-0E01070E01070E012322262335333216333236373E01373E013721043EBCFE5F03060307
-201A183B2222533111410A0A081E0A183312333E0A040703030103BF539A3EA7C7423E4D
-1F1E1E02A4020E1332EEE152E166000100B9000004D9045D000C0078401335093A0B4503
-4A0470037F04060B400D103709B8FFC0403D0D10377B027B05790A030A2A090B37050A02
-030904400E103704200D0F373F04010404070B09050107090A0B0305021A00920E0F0E20
-0E02051A07880D10F6ED5D10F6ED111739002F333F3312392F5D2B2B1217393130002B5D
-012B2B5D2123110123011123113309013304D9BAFEEA8CFEECB0E301300126E70372FDC2
-023EFC8E045DFD8F0271000100B900000460045D000B0032401C033F0808050A07050105
-0809021A00920D1F0D600D0208031A05880C10F6FD325D10F6FD32003F333F3312392FED
-31302123112111231133112111330460BCFDD1BCBC022FBC01F7FE09045DFE3C01C4FFFF
-006AFFE10471047C021600520000000100B900000460045D000700254015033F06050005
-011A0092091F09600902041A05880810F6ED5D10F6ED002F333FED313021231121112311
-210460BCFDD1BC03A703BBFC45045D00FFFF00B9FE640490047C0216005300000001006A
-FFE703FD04770021005A40430F234F235F23032B01220E2A1624183A01350E3A16351849
-014F0A440E4F1641185901550E6901650E7A01730E131010143F0C0421211A3F03090F00
-0023171B09852210F6ED11332F3C003FED332F3FED332F31305D015D250E01232226272E
-013510002132161715232E01232206151416333236373E01373303FD73A5527ACC494951
-0128010161BB4E0B5DB555A7B7B6A83B75302651100B463629474848DC93010B013F3627
-D14744E0C7C7DC1E1813350D0001000A000003EE045D0007003840230301043F06054000
-4F0502000500021A05A003B00302030309080F093F094F097009045D1112392F5D33FD32
-2F2F5D003FFD322F3130012111231121352103EEFE6CBCFE6C03E403B8FC4803B8A5FFFF
-003DFE64047F045D0216005C00000003006FFE64064B061400230030003D007A40105622
-011D011B1E0C09040627353F2118B8FFF040400E0F3718043B2E3F0F06100E0F3706090B
-0C392436384924463804241B00C809311B1E2B04091A0C381B12C8800C900C020C0C3F3E
-0F3F1F3F3F3F503F803F055D1112392F5DFDED10ED173910FDED5D003F3F2B33FD323F2B
-33FD321217393F31305D011406070E01232226271123110E01232202113436373E013332
-16171133113E0133321203342623220607111E0133323605112E01232206151416333236
-064B4C3F3EA259436327BA3D4F54C1F04E3F3DA5523C6331BA2E7C3FC6E2C18888374A3F
-2F3F3A8D9BFD7627503187A18F87355B024C95E54A4A4E2E13FE3301CD1E23012E010D8D
-DD4B494D251E01E1FE1F1B28FED5FEECBFDE1219FD171619D9AA02E91219CED2C3E01D00
-FFFF003C00000480045D0216005B0000000100B9FEF404DE045D000B0041400F0602050B
-08043F01051A080800C90AB8FFC04015090D370A0A0D0D40090E378F0DAF0D02041A0188
-0C10F6ED5D2B11332F2BED392FED002FFD322F3F33313029011133112111331133112304
-2FFC8ABC0226BC87AF045DFC4503BBFC45FE52000001008E0000041F045D0016003C4025
-0C061C062C06750E040209113F0505001509050014011A0092183F18010A1A0009100902
-092F5DED5D10F6FD32002F3F3312392FED123931305D2123110E01232226351133111416
-171E01333236371133041FBC5BA662B4BEBC101A1A5E5445A23CBC01AD1C22B1A70196FE
-CA40652524261B12021D000100B900000649045D000B003D40260A06020508043F010809
-1A00CA081A05041A01CA8005A0050205050D0C0F0D200D500D700D045D1112392F5DF4ED
-10FDF4ED003FFD323F333331302901113311211133112111330649FA70BC01AEBC01AEBC
-045DFC4503BBFC4503BB000100B9FEF406D0045D000F004A402E0A0602050C08043F0108
-0E0DC90000091A0CCA081A05041A01CA80059005A00503050511100F111F113F116F1104
-5D1112392F5DF4ED10FDF4ED392FED002F3FFD32323F3333313029011133112111331121
-1133113311230621FA98BC01AEBC01AEBC87AF045DFC4503BBFC4503BBFC45FE52000002
-000A000004C4045D000E0021004A4015750D01073D4F1B9F1B021B1B16183F1905083D16
-0FB8FFF04016090B371B081A161619001B0F8F230F231F232F2303192F5D10F6FD11392F
-FD322B002FED3FED12392F5DED31305D013426272E012B0111333236373E01371406070E
-0123211121352111333216171E01040223282A6B64B0AC646E282925C24138429676FE55
-FEB80204F47E8B453A3A0157334D18190AFE8411181A473A518429322A03B8A5FE4D1A33
-2B86000300B9000005A2045D000E001F0023005A4016200523073D4F199F190219191617
-05083D167900010FB8FFF04022090B37001B500F600F700F030F0F231A2292250F253025
-402570250419081A16882410F6FD325D10F6FD322F5DED2B5D002FED3F12392F5DED2F3F
-3130013426272E012B0111333236373E01371406070E012321113311333216171E011333
-1123036923282A6B64B0AC646E282925C24138429676FE55BCF47E8B453A3ABBBCBC0157
-334D18190AFE8411181A473A518429322A045DFE4D1A332B8602B1FBA300000200B90000
-0435045D000E001F00424013073D4F199F19021919161705083D167900010FB8FFF04013
-090B37001B0F8F210F212F210219081A16882010F6FD325D10F6ED2B5D002FED3F12392F
-5DED3130013426272E012B0111333236373E01371406070E012321113311333216171E01
-037323282A6B64BAB6646E282925C24138429676FE4BBCFE7E8B453A3A0157334D18190A
-FE8411181A473A518429322A045DFE4D1A332B8600010053FFE703F604770021007DB532
-0442040210B8FFD640090B0D37152A0B0D371DB8FFD6403F0B1037082A0B1037123D1313
-061F1B1B173E1F049F0A010A0A0E3E0609141C111A0390232340090D371C2F133F134F13
-03131C1380099009020940090C37092F2B5D33332F5D2F2B10F6ED1139003FED332F5D3F
-ED332F1112392FED31302B2B2B2B5D011E011510002122262735331E0133323637213521
-2E012322060723353E01333216035D4950FEC9FEFC66BF430D3CC66D9DC40CFDCC023314
-BE8E5BB4570D3FC2677CC803ED46D290FEEAFEB8301BCE2F49C0BA979E9F3D43CE193A44
-000200B9FFE1064C047C000B001E005640363A0335094A034509040C3E131E1314031C03
-3F16041005093F1C0A0F1319061A2F0C010C0C0F001B1990202F203F2002120E1A0F881F
-10F6FD325D10F6ED12392F5DED1239002F3FED3F3FED1217392FED5D3130013426232206
-15141633323625231123113311333624333200111000232200058AA69399A1A89292A7FC
-D3E8BCBCED190111C7E70112FEF2EBDEFEF5022ED7D5DFCDD4D7D5A2FE06045DFE3BE7FD
-FEC4FEEEFEF1FEC201200002004300000413045D0010001F0069B3721C0104B8FFE8403D
-0910370304B4050506060F113C030300123D0F0500050909190902191B70090109040603
-09040A051A054A055A0580059005060512011A0092210F21015D10F6FD322F5D17392F5D
-ED5D002F2F3FED12392FED12393130018710FDC02B015D212311230123012E0135343637
-3E0133210311232206070E01151416171E01330413BCDDFEA6DD01789186503D3C9C5C01
-AEBCED4D442827251724256A4101BBFE4501CD28A586597C27261BFDF201780A16164B2C
-37441E1D1500FFFF006AFFE6046005DB0236004800000116008EF9000014400D03302560
-250202002520120025012B355D3500010013FE6D046206140035006A4044051C1E261E28
-59056905721D0617140E51111112180D08421B0412012F3E2A2A012A0D150F5F2E6F2E7F
-2E032E2E0D001A2191371F37603702141517030B1A110F0D883610F63232FD17325D10F6
-ED12392F5D2F2F002F2F5DED3F3FED123912392FED393931305D0026272E01272E012322
-0607112311233533353315211521113E01333216171416151406070602070E01232A0127
-35333236133E013503A501010113191A594650AC4CBCA6A6BC0141FEBF58C162B1BB0303
-020103544746B96A17182A44BB9C09010102064B2B5080292B294D3AFCBE04F4869A9A86
-FEED4952DEC92F6B4B3A703AB0FEFF50504E029EF60150224B2EFFFF00B9000003BB0682
-0236020B00000116008D9AF6000AB6010009070405252B350001006AFFE7040A04770021
-006EB53B0A4B0A021BB8FFD640090B0D37162A0B0D370EB8FFD640340B1037012A0B1037
-193D1818030C1010143E0C0421211D3E03092018301840180318171810031A008E232340
-090D371A1A09852210F6ED2B10E61117392F5D003FED332F3FED332F1112392FED31302B
-2B2B2B5D250E01232226272E013510002132161715232E01232206072115211E01333236
-3733040A4E9F7B7DD14C4C52012B010D68BB450C40C2658FC719023CFDC10AC4A46CBD3E
-0C302029474849DC92010501453620CB324E9CA197B2C8443200FFFF006EFFE503D70478
-021600560000FFFF00AF0000018305DB0216004C0000FFFF00050000022D05DB02160077
-0000FFFFFFC2FE59021505DB0216004D00000002001DFFFE06F4045D000E003D0072B900
-30FFACB30D10371EB8FFC0401D0D1037073D4F379F3702373716183E350528282C3F2409
-3D167900010FB8FFF0401E090B3737081A161635001B890F010F8F3F0F3F0118C9203530
-35023535282F332F5DED5D10F45DFD11392FFD322B5D002FED2FFD322F3FED12392F5DED
-31302B2B00353426272E012B01113332363736371406070E01232111210E01070E01070E
-01070E012322262335333216333236373E01373E01372111333216171E01063223282A6B
-64B0AC646E2829E74138429676FE55FE5F03060307201A183B2222533111410A0A081E0A
-183312333E0A0407030301F47E8B453A3A012037334D18190AFE8411181A81518429322A
-03BF539A3EA7C7423E4D1F1E1E02A4020E1332EEE152E166FE4D1A332B86000200B90000
-06F4045D000E0027005D4017171E073D4F219F21022121161C20051A083D167900010FB8
-FFF0401F090B37211E081A16161A001B890F010F8F290F292F294F29031D191A1A882810
-F6FD325D10F65DED11392FED39392B5D002FED2F3F3312392F5DED39393130013426272E
-012B0111333236373E01371406070E0123211121112311331121113311333216171E0106
-3223282A6B64B0AC646E282925C24138429676FE55FDF3BCBC020DBCF47E8B453A3A0157
-334D18190AFE8411181A473A518429322A0210FDF0045DFE4D01B3FE4D1A332B86000001
-00130000045F0614001E00504030031D161D751D0317140E51111112180D08421B041201
-010D08150F021A0091201F20602002141517030B1A110F0D881F10F63232FD17325D10F6
-ED2F2F003F3C3F3FED123912392FED393931305D2123113426272E012322060711231123
-3533353315211521113E0133321615045FBC1218195E4B4DA84DBCA6A6BC0141FEBF58BC
-63B5BE027C4D87262A294C3BFCBE04F4869A9A86FEED4952DACDFFFF00C1000004A90682
-0236021200000116008DF9F60011400C01001D401D02001D1C0611252B5D35000002003D
-FE64047F06150007001500BD404C04063406440650066006700606090307051903170546
-0149035800570179030902071A000100051A0403044900460402080F0E010E0E12500B0B
-0003020405020C15C908400B0E37080FC90EB8FFC040110B0E370E080E04026801010102
-03030400B8FFC040220910370C001C004A006A007A0005008D170F170103041304450465
-0475040504821610E65D5D10F65D2B1117395D2F1139392F2BED2F2BED003F3F12393933
-2FED332F5D333130015D8710FD8710FDC0015D005D0901231301330901130E0123222627
-331E0133323637047FFD74C9D0FE43CC0157015A0805B1A9A9B105AB015B58595A01045D
-FA0701D20427FCC4033C01B894A6A694695E5C6B000100B9FEF40460045D000B003F4027
-0A060520030103083E00050802C93F034F037F0303030305091A00920D1F0D600D02081A
-05880C10F6ED5D10F6ED12392F5DED003F33ED2F5D3F3331302901112311211133112111
-330460FE84AEFE83BC022FBCFEF4010C045DFC4403BC000100C80000048A076B0007002B
-B90006FFC040140D10370606003503030205130606090114026C0810F6ED11332FED002F
-3FED332F2B31300111231121113311018EC60308BA0521FADF05D1019AFDB600000100B9
-000003BB05CE00070033B90006FFC0401A0E10370606003F03050205C97006010606090F
-0901011A02870810F6ED5D11332F5DED002F3FED332F2B313001112311211133110175BC
-0254AE03B8FC48045D0171FDEA00000100CB023C073502DC00030011B601540200000501
-2F11332F002FED3130012135210735F996066A023CA0000400C8000008B905ED00090015
-0021002500A7403E080718073A014901440646075801540656076F0160067F0170060D09
-0D0613190D16137A19751F0625533F224F220222221F401214371F51300D010D0D19B8FF
-C040321214371951130202030807040106030100220F2302232223220A1CC910100A0006
-0102071300000416C90A0A270213046C2610F6ED11332FED12392FFD1139391112392FED
-1239392F2F5D002F3F1217393FED2B332F5DED2B332F5DED5D3130015D21230111231121
-0111330114062322263534363332160734262322061514163332360121152104FFF5FD72
-B401330250B403BABDB2B6BABEB2B5BAB25865675757676558FE6201B8FE480534FACC05
-D1FB4004C0FE63E0DADADFE0DADCDDAC8888ADAD8787FDE89E00000100B900000460045D
-000700254015033F06050005011A0092091F09600902041A05880810F6ED5D10F6ED002F
-333FED313021231121112311210460BCFDD1BC03A703BBFC45045D00000101190235028F
-05D5000800214011035004040703010E0307002A03000101012F5D33ED392F003F3F332F
-ED3130012311233532363733028FA5D1667E0989023502A9752C5600000100EF023D039F
-05ED001D0043B90011FFE040250D10370F0F0B521302021C51010E00001C01082A261636
-166616761604160F160F000101012F5D33332F2F5DED1239332F003FFD323FED332F3130
-2B0121353E01373E013534262322060723353E01333216151406070E010721039FFD505B
-86276D40584C468F290F41974D9DA9526A318D3701F2023D94456825676D52464A3C20B3
-1B229E7A5D945E2B6A29000100E6021C037305ED002E0074400F6C096C227E097E220455
-0C5A1F0226B8FFE0403B0B0E3703200B0D372C2B15510F16010F161F164F165F16CF16FF
-16061621211D51160625020A0A0E51060F1A2A281622112A2216282C04090000092F332F
-121739ED2F2F2FED003FED332F3F1239ED332F2F5D71ED393931302B2B5D015D01140607
-0E012322262735331E013332363534262B01353332363534262322060723353E01333216
-15140607151E0103733C30357B4F528F4111259A4F546E645B8C7D575F52574299251140
-964F98AA614D5075033A47702225201E1CAF233B4948533B8B4C423C473E23AF1B228C62
-57711A08106D000200B3023D03BD05ED000A000D003A401E6D067E06020609010D51050C
-05030702030E00070B042A09000D060101062F332F12393333FD39392F003F3F1239392F
-ED3939323130015D012315233521350133113321110103BDA396FE2F01D295A3FECBFE9F
-0319DCDCB9021BFDB10190FE7000000100E6021C037505DA002A004840176F087F08021D
-1D1A5125250621511E030A0A0E51060F00B8FFEA400F090C371F21291E1F1E09142A0000
-092F332FED1239392FED2F2B003FED332F3FED12392FFD322F31305D011406070E012322
-262735331E01333236373E01353426272E012322060711211521153E01333216171E0103
-75322F3088574E953C1025924E2C521C1D171F1D1E59353B6C260255FE4814310E547634
-373C0363457A2A2B331C1A9F1436171C1D43272A391415110E0601F08BCF02021722246F
-000100F3023503A505DA000600414025560101030100012A020203630073000200000351
-0503020E030002100910370202040000042F332F12392F2B1239003F3FFD322F3130015D
-8710ED87C0015D0901230121352103A5FE2AB901F0FDED02B2054EFCE7031A8B000300C5
-021B039105EE001900280037005D40420F0B0F151F0B1F152A022A0439023904492B582B
-0A0F251F2526103610042F09261604031D5110023551030F1A2A13202A0D292A090D1316
-04067000010000322A062FED332F5D121739ED2FED2FED003FED3FED1217395D31305D01
-140623222635343637352E0135343633321615140607151E01033426232206151416171E
-01173E01133426272E01270E011514163332360391CB9BA7BF5E595246B99095B5505261
-5BBE574F465D302D17482E392618374217582A3A387650516D033579A19F784F78260429
-64476A8D87683F7D2304276B016433483F36263D140A1F0B254FFE79323B1E0A1C0F205D
-304A5F4E00020073FFE1068B05F0002800340075400978180176097915021BB8FFC04045
-0910371B694F0001002302031A090A0905151A0915155A095515062C3415023234090A22
-1E2926151B00030F291503360F361F3680369036BF36CF36060F36012F150F683510F6ED
-5D5D10D6ED121739D4FDC4003FED3FED5D1239393FDD5DED2B5D31305D011E0115140207
-0E01232224272602353412373624333216171E01173E013534262735331E011514060110
-0023220011100033320005A11F1A63595CFBA19DFEFF5A5A61605C5801059AA0FF591819
-144F43160CA00D0B78FEF9FEFCE1E3FEFD0108DEDE0107044958A663B8FEDD6165666863
-630120B9B6012167626869611B2121044044245B17092F46326C82FE8D0122013BFEC5FE
-DEFEDBFEC90137000002006AFFE104C30584001D0029005640391A20090C373A2135274A
-21452704151B690D050003213F0904273F030A14102918090C1B03061E1B00902B0F2B1F
-2B3F2B6F2B04241B06852A10F6ED5D10F6ED121739DCFDC4003FED3FED12393FFDCD5D31
-302B011000232200111000333216173332363534262735331E01151406071E0107342623
-22061514163332360471FEE8EBEDFEE90117ED33602B5D5A4A160CA00D0B736C4548C2AA
-9799A9AA9896AB022EFEEFFEC4013C01110111013D0F104147245B17092F46326A80144D
-D98BD9D3D3D9D2D9D700000100B2FFE1067506F8002B004C40342A20090F37252B6A1C03
-0D032615390649067615041534060A2420290F2801281B14002D0F2D402D6F2D7F2D902D
-050F140C6B2C10F6ED5D10DEEDD45DFDC4003FED5D3F3FFDC431302B011406070E012322
-26272E01351133111416171E01333236373E0135113332363534262735331E0115140623
-052947514DCE898CD0475147C621272C976A6B962D2721D85A4A160CA00D0BACA00256A2
-F1504C464A4852E8A9037BFC7B798C394142414239936D038A4147245B17092F46328384
-000100B1FFE105A505840025005C403E0B0619077A070323200910371E246A1505020509
-051142050A011D19290F21012114021A40000100270F276F27025F279027A027C027EF27
-050B1A08872610F6ED5D7110D671ED32D45DFDC4002F3FED3F12393FFDC431302B5D2123
-350E01232226351133111416171E0133323637113332363534262735331E011514062B01
-0457BC5FAE69B0C4BC101A1B565249AD4BD05A4A160CA00D0BACA0027C4B50D7D002D5FD
-8455792B2C284C3B03424147245B17092F46328384000001020905110342068C00160042
-4029BF0301030606050C50146005010504ADC005D005020540090D370505110940111437
-09290F000100112FDD5DED2B12392F2B5DED002F5DD4ED12392FC55D3130011406071523
-353E013534262322060723353E01333216034242426E2F3026211F251803134926516605
-F8404E1544790C27271827090969060C560000010221FE8202F5FF450003001340090144
-8F0201020015012FED002F5DED31300123353302F5D4D4FE82C3FFFF0154051602FA068C
-001600430000FFFF021D051603C3068C0016008D00000002013605110514068C0006000A
-004DB90006FFF040100E103705100E10370802010708040305B8FFC040110E1037050560
-0301036007700702070900B8FFC0B50E10370000042F332F2BD6CD5D002F5D332F2B1217
-392F3130012B2B01230B012313332103231303E19FB9B89BE4E30217DA817C05110100FF
-00017BFEF6010A0000020003051103E1068C0006000A004AB90006FFF040100E10370510
-0E10370802010809040305B8FFC040180E1037050560030103006F097F0902090704400E
-103700042F332BD6CD5D2F002F5D332F2B1217392F3130012B2B01230B01231333012303
-3303E19FB9B89BE4E3FE6181DADF05110100FF00017BFEF6010A00020136051104C00752
-0006001D008EB90006FFF040120E103705100E1037BF0A010A0D0D0C13501BB8FFC0400B
-0E10371B0C02010C030305B8FFC0402A0E10370505600301030BADC00CD00C020C400910
-370C0C18104011143710290F07010718400C10371800B8FFC040090E1037000060040104
-2F5D332F2BD42BDD5DED2B12392F2B5DED002F5D332F2B1217392FD42BED12392FC55D31
-30012B2B01230B01231333251406071523353E013534262322060723353E0133321603E1
-9FB9B89BE4E301C342426E2F3026211F251803134926516605110100FF00017B32404E15
-44790C27271827090969060C560000020125051103F307DE000600200064B90006FFF040
-200E103705100E10370710520F171F17A0170317141D520A400D11370A01020305B8FFC0
-40110E10370505600301032029070013291400B8FFC0B40E103700042F332BD6ED2FD6ED
-002F5D332F2B123939D62BED3CDD5DED3C3130012B2B01230B01231333130E0123222627
-2E0123220607233E01333216171E013332363703E19FB9B89BE4E3F606865F35491C183A
-192B22058C05875F36491C163B192A240405110100FF00017B015289902919162D3E4788
-912A19142E3E47000002014204E703D506FB000D0011003C40251110400F1A3710001006
-0AAA3F030103600E700E020E100D2A100F001F008F000300072A062FEDD45D39ED2FCD5D
-002F5DEDCD39392F2BCD313001140623222635331416333236353703231303D5B29897B2
-A2555253555EDA817C0646A3BCBCA37C64647CB5FEF6010A0002014204E703D506FB000D
-0011003C4025100F400F1A370F000F060AAA3F0301036F107F1002100E0D2A0E0F001F00
-8F000300072A062FEDD45D39ED2FCD5D002F5DEDCD39392F2BCD31300114062322263533
-1416333236350723033303D5B29897B2A2555253555281DADF0646A3BCBCA37C64647C55
-010A0002014204E703D5071E000D002400634040111414131A0F2201221340091A371300
-13060AAA3F0301031213400910371313001F101F201F031F1728500E600E700E030E0D2A
-0E0F001F008F000300072A062FEDD45D39ED2F5DEDCD5D392F2BCD002F5DEDCD39392F2B
-D45DCD12392FC531300114062322263533141633323635271406071523353E0135342623
-22060723353E0133321603D5B29897B2A2555253551237375C272822191C1E1402103C21
-42570646A3BCBCA37C64647C5B34431238650A2120191D080757060A45000002012504E7
-03F307DE000D0027005840100E17520F1E1F1E021E1B245220110111B8FFC04025090C37
-11006006700602060AAA3F0301031A291B0627290E0D2A0F001F008F000300072A062FED
-D45DEDD4ED10D6ED002F5DEDDD5D39D62B71ED3CDD5DED3C313001140623222635331416
-33323635130E01232226272E0123220607233E01333216171E013332363703D5B29897B2
-A255525355C006865F35491C183A192B22058C05875F36491C163B192A24040646A3BCBC
-A37C64647C019889902919162D3E4788912A19142E3E47000001020905110342068C0016
-00524035BF0301030606050C50501460147014031409900501C76005010504ADC005D005
-020540091037050511094011143709290F000100112FDD5DED2B12392F2B5DED002F5D5E
-5D5ED45DED12392FC55D3130011406071523353E013534262322060723353E0133321603
-4242426E2F3026211F251803134926516605F8404E1544790C27271827090969060C5600
-00020136065403E1080100060020007D404A0702170202141D50200A010A1050076F1701
-0F1770170217010205400D1137050920039003A003B003045910032003C00303C003D003
-0231D003E003025003010F037003020320280700B8FFC040090E10370013281400042F33
-D6ED2F2BD6ED002F5D71725E71725E715ECD2B39392F5D713CEDDD71ED3C31305D012327
-07233733130E01232226272E0123220607233E01333216171E013332363703E1A9AFAEA5
-F8BBEC0B705025491C1B3E141D2806860A6F5227432122301A1B2B0506545959AD010052
-6B190D0D1A202D4E6F17101016232A0000020142064803D50801000D0011005A403E5010
-6010020A50FF03015F030103007F0601060F109F10026F10FF1002106F11010F11701102
-11590E690E720E030E100D2A100F001F008F000300072A062FEDD45D39ED2FCD5D002F5D
-71DD5D71D45D3CDD7172ED5D313001140623222635331416333236353707233703D5AB9E
-9EACA24B5D5A4D4FC681680738589899573058592FC9D8D800020142064803D50801000D
-001100644033500E600E020A50FF03015F030103007F0601060F0E9F0E026F0EFF0E020E
-6F11010F1170110211561066107D1003100E0D2A0EB8FFC0400F090D370E0F001F008F00
-0300072A062FEDD45D392BED2FCD5D002F5D71DD5D71D45D3CDD7172ED5D313001140623
-222635331416333236350723273303D5AB9E9EACA24B5D5A4D5681C6DF07385898995730
-58592F0FD80000020142064803D50801000D0024008E4062111414131A6F22010F227022
-02223F134F13021340111537130013060A5009900301B0030159700301310F033F037003
-CF0304031213400915371313501F601F701F03001F101F201F301F401F051F17C00E010E
-0D2A0E0F001F008F000300072A062FEDD45D39ED2F5DCDCD5D71392F2BCD002F5D5E715E
-5D715EEDCD39392F2B712F5D71CD12392FC5313001140623222635331416333236352714
-06071523353E013534262322060723353E0133321603D5AB9E9EACA24B5D5A4D2E2E2E4D
-231F1C15191A0E020E321B364A0738589899573058592F612B380F2F54091E1817160805
-4905083900020142064803D50801000D0027009240111B2450DF1101110E17506F1E010F
-1E011EB8FFC040520D10371E00060A50099003B00302F0030159200330034003C003D003
-E003066003700302C003D0030231A003B003025003E003020F033F03CF0303031A281B1B
-0627280E0E0D2A0F001F008F000300072A062FEDD45DED3C10ED103C10ED002F5D71725E
-5D71725E5D715EEDCD322F2B5D71ED3CDD71ED3C31300114062322263533141633323635
-370E01232226272E0123220607233E01333216171E013332363703D5AE9B9BAFA26C3C3C
-6BA20B705025491C1B3E141D2806860A6F5227432122301A1B2B050706546A67572E2828
-2EFB526B190D0D1A202D4E6F17101016232A000201360668051008010006001D0088B900
-06FFF0401A0E103705100E1037BF0A010A0D0D0C400E10370C13500F1B011BB8FFC0403A
-0D10371B0102030F0570050205050F0301030BADC00CD00C020C400910370C0C18104011
-143710290F07010750006000700003180000600401042F5D332FD45DDD5DED2B12392F2B
-5DED002F5D332F5D1239392F2B5DEDC42B392FC55D3130012B2B01232707231333051406
-071523353E013534262322060723353E0133321603E19FB9B89BE4E3021342426E2F3026
-211F25180313492651660668CECE014944404E1544790C27271827090969060C5600FFFF
-001AFE82055E05D10236002400000116024B2F00000AB602000D0E0500252B35FFFF0068
-FE82041D04780236004400000116024BBA00000F400A027F36010036370B00252B5D3500
-FFFF001A0000055E080102360024000001170256002F0175001A401202501C0102101C40
-1C701C03001C0B0500252B5D35005D35FFFF0068FFE1041D068C0236004400000116024A
-BA000011400C025F457F45021D45340B00252B5D3500FFFF001A0000055E07ED02360024
-00000117024E002F01610011400B0302400F01000F0B0500252B5D353500FFFF0068FFE1
-04F4068C0236004400000116024EE0000013400D030240385038022938340B00252B5D35
-3500FFFF001A0000055E07ED0236002400000117024F002F01610011400B03020F0F0100
-0F0B0500252B5D353500FFFFFFE3FFE1041D068C0236004400000116024FE0000013400D
-030240385038022938340B00252B5D353500FFFF001A0000055E08010236002400000116
-025C2F00001740110302400FA00FB00FC00F04000F0B0500252B5D353500FFFF0068FFE1
-04A0075202360044000001160250E0000013400D030240385038022938340B00252B5D35
-3500FFFF001A0000055E0801023600240000011602572F00000CB70302000F0B0500252B
-3535FFFF0068FFE1041D07DE02360044000001160251E0000013400D0302403850380229
-38340B00252B5D353500FFFF001AFE82055E07ED023600240000003700D6002F01610116
-024B2F00001840110300141505002502400F01000F0B0500252B5D352B35FFFF0068FE82
-041D068C023600440000003600D6E0000116024BBA00001E4016037F3D01003D3E0B0025
-0240385038022938340B00252B5D352B5D35FFFF001A0000055E08010236002400000116
-02582F00000CB7030200110B0500252B3535FFFF0068FFE1041D06FB0236004400000116
-0252E0000011400B0302403A01293A340B00252B5D353500FFFF001A0000055E08010236
-00240000011602592F00000CB7030200110B0500252B3535FFFF0068FFE1041D06FB0236
-0044000001160253E0000011400B0302403A01293A340B00252B5D353500FFFF001A0000
-055E08010236002400000116025A2F00000CB7030200110B0500252B3535FFFF0068FFE1
-041D071E02360044000001160254E0000011400B0302403A01293A340B00252B5D353500
-FFFF001A0000055E08010236002400000116025B2F00000CB7030200110B0500252B3535
-FFFF0068FFE1041D07DE02360044000001160255E0000011400B0302403A01293A340B00
-252B5D353500FFFF001AFE82055E0801023600240000003700D9002F01750116024B2F00
-001D4013025011011103001B1C0500250200110B0500252B352B3500115D3500FFFF0068
-FE82041D068C023600440000003600D9DD000116024BBA0000184011037F44010044450B
-002502293A340B00252B352B5D35FFFF00C8FE82049D05D10236002800000116024B2600
-000AB601000E0F0100252B35FFFF006AFE820460047C0236004800000116024BF900000A
-B6021F22231218252B35FFFF00C80000049D08010236002800000117025600260175001C
-401401501D0101001D201D501D601D04001D0C0203252B5D35005D35FFFF006AFFE60460
-068C0236004800000116024AF9000018B4026F310131B8FFC040090A1137323120120025
-2B2B5D35FFFF00C80000049D07C8023600280000011700D7002601750012400B01501901
-0100190C0203252B35005D35FFFF006AFFE604600653023600480000011600D7F900000A
-B602002D201200252B35FFFF00C80000053A08010236002800000117024E002601750016
-400D0201501001020100100C0203252B3535005D3535FFFF006AFFE6050D068C02360048
-00000116024EF900000CB703021E24201200252B3535FFFF00290000049D080102360028
-00000117024F002601750016400D0201501001020100100C0203252B3535005D3535FFFF
-FFFCFFE60460068C0236004800000116024FF900000CB703021E24201200252B3535FFFF
-00C80000053608010236002800000116025C26000013400D0201101020100200100C0203
-252B5D353500FFFF006AFFE604B9075202360048000001160250F9000013400D03020024
-2024021E24201200252B5D353500FFFF00C80000049D0801023600280000011602572600
-000CB7020100100C0203252B3535FFFF006AFFE6046007DE02360048000001160251F900
-000CB703021E24201200252B3535FFFF00C8FE82049D0801023600280000003700D60026
-01750116024B2600001D40130110501001020015160203250100100C0203252B352B3500
-5D113500FFFF006AFE820460068C023600480000003600D6F9000116024BF9000014400E
-031E292A120025021E24201200252B352B35FFFF0089000002D508010236002C00000117
-0256FF2401750016400E01501101015011010011100409252B5D35005D35FFFF00960000
-01CF068C023600D500000117024AFE8D0000000AB6010009080203252B35FFFF0089FE82
-02D505D10236002C00000117024BFF240000000AB601000E0F0409252B35FFFF00AFFE82
-018305DB0236004C00000117024BFE8E0000000AB602000A0B0203252B35FFFF0073FE82
-05DA05F00236003200000117024B009B0000000AB6020026270F03252B35FFFF006AFE82
-0471047C0236005200000116024BE200000AB602001A1B0600252B35FFFF0073FFE105DA
-080102360032000001170256009601750022400B0250340102503470340234B8FFC04009
-090B370034240F03252B2B5D35005D35FFFF006AFFE10471068C0236005200000116024A
-E200000F400A02701D01001D1C0600252B5D3500FFFF0073FFE105DA0801023600320000
-0117024E00960175001E401403025028010302202850288028030028240F03252B5D3535
-005D3535FFFF006AFFE104F6068C0236005200000116024EE200001940130302001C201C
-501C801CB01C05001C180600252B5D353500FFFF0073FFE105DA08010236003200000117
-024F009601750016400D030250280103020028240F03252B3535005D3535FFFFFFE5FFE1
-0471068C0236005200000116024FE200000CB70302001C180600252B3535FFFF0073FFE1
-05DA08010236003200000117025C009600000015400F0302202850288028030028240F03
-252B5D353500FFFF006AFFE104A2075202360052000001160250E200001940130302001C
-201C501C801CB01C05001C180600252B5D353500FFFF0073FFE105DA0801023600320000
-01170257009600000015400F0302202850288028030028240F03252B5D353500FFFF006A
-FFE1047107DE02360052000001160251E200001940130302001C201C501C801CB01C0500
-1C180600252B5D353500FFFF0073FE8205DA0801023600320000003700D6009601750117
-024B00960000001D4013025028012803002D2E0F0325020028240F03252B352B3500115D
-3500FFFF006AFE820471068C023600520000003600D6E2000116024BE2000014400E0300
-212206002502001C180600252B352B35FFFF0073FFE1068B08010236024600000117008D
-007801750014400D025036603602020036360F03252B35005D35FFFF006AFFE104C3068C
-0236024700000116008DE200000AB602002B2B0600252B35FFFF0073FFE1068B08010236
-024600000117004300AA0175001A40120250366036020250367036020036360F03252B5D
-35005D35FFFF006AFFE104C3068C02360247000001160043E2000011400C02502B602B02
-002B2B0600252B5D3500FFFF0073FFE1068B080102360246000001170256008F01750012
-400B02503A0102003A390F03252B35005D35FFFF006AFFE104C3068C0236024700000116
-024AE200000AB602002F2E0600252B35FFFF0073FFE1068B07C8023602460000011700D7
-008B01750012400B02504201020042350F03252B35005D35FFFF006AFFE104C306530236
-02470000011600D7C400001540100210372037403750370400372A0600252B5D3500FFFF
-0073FE82068B05F00236024600000117024B009A0000000AB6020037380F03252B35FFFF
-006AFE8204C305840236024700000116024BE200000AB602002C2D0600252B35FFFF00B2
-FE82052905D10236003800000116024B6200000AB6010020210C00252B35FFFF00B1FE82
-0457045D0236005800000116024BFD00000AB60100191A0916252B35FFFF00B2FFE10529
-080102360038000001170256006201750012400B01502301010023220C00252B35005D35
-FFFF00B1FFE10457068C0236005800000116024AFD00000AB601001C1B0916252B35FFFF
-00B2FFE1067508010236024800000117008D007C01750014400D01502E602E0201002E2D
-0C00252B35005D35FFFF00B1FFE105A5068C0236024900000116008DEE00001840100160
-28010130284028020028290900252B5D35005D35FFFF00B2FFE106750801023602480000
-0117004300AA0175001C401401502D602D0201402D602D802D03002D2D0C00252B5D3500
-5D35FFFF00B1FFE105A5068C023602490000011600430200001840100160270101502760
-27020027270800252B5D35005D35FFFF00B2FFE106750801023602480000011702560062
-01750012400B01503101010031300C00252B35005D35FFFF00B1FFE105A5068C02360249
-00000116024AFD00000AB601002B2A0800252B35FFFF00B2FFE1067507BE023602480000
-011700D70062016B000AB60100392C0C00252B35FFFF00B1FFE105A50653023602490000
-011600D7FD00000AB6010033260800252B35FFFF00B2FE82067506F80236024800000116
-024B6200000AB601002E2F0D00252B35FFFF00B1FE8205A505840236024900000116024B
-FD00000AB6010028290800252B35FFFF0006000004E608010236003C000001170043FFE4
-0175001B400A01500A600A0201500A01B8FFD3B40A0A0401252B5D35005D3500FFFF003D
-FE64047F068C0236005C000001160043DD000013B5016009700902B8FFDDB40909040025
-2B5D3500FFFF0006FE8204E605D10236003C00000116024BEC00000AB601000A09040125
-2B35FFFF003DFE64047F045D0236005C00000117024B010400000012400D010A0F0A2F0A
-4F0A6F0A7F0A055D1135FFFF0006000004E608010236003C000001170256FFEC01750018
-401001500E0101C00ED00E02000E0D0302252B5D35005D35FFFF003DFE64047F068C0236
-005C00000116024AC900000F400A01500D01000D0C0400252B5D3500FFFF0006000004E6
-07C80236003C0000011700D7FFEC01750012400B01501601010016090500252B35005D35
-FFFF003DFE64047F06530236005C0000011600D7DD00000AB6010015080400252B350003
-006CFEBD04FB0614001B0028002C007E40523B05380C3C2232243E284B054A0C4E224524
-4F285908690870120D2AB52B0114511A17171018011304072041100403082642070A2C2B
-2C2B010A1600881617131C041A1A01922E1F2E3F2E02231B010A852D10F632ED5D10F632
-ED32323232ED2F111239392F2F003FED3F3FED1239393F12392F3CFD3C2FED31305D0123
-1123350E01232202113436373E0133321617352135213533153301112E01232206151416
-3332361321352104FBB8BC4DAD6EC6ED524444B66059864CFE95016BBCB8FE8C4F73499C
-B2879750A4EAFCB4034C04F4FB0C754252012E01118EDB4D4C4F2427CE869A9AFB990279
-2218D6CCC3CD47FDE286FFFF00ED051D042C0653001600D700000002008A009104900498
-0023002F004D40332D290B0802231D1A141108172F0501052729050F1701170F311F3102
-24290B0802231D1A1411080E202001202A29200F0E010E2F5D33ED2F5D121739ED5D002F
-5D33ED2F5D121739ED31300107270E01232226270727372E01353436372737173E013332
-16173717071E011514060727342623220615141633323604906EEC2C4A342E5724EC6DE9
-1718161AEA6FEB24572D2C5825EA71EB1818191765694B496B694B496B01016EEA1A1619
-17EC71EA25592B34492BED6EEB17191817EA6DED2653302D5824A949706E4B4A6F6D0000
-0002000000000000FF4C00780000000000000000000000000000000000000000037D0000
-01020103010401050106010701080109010A010B010C010D010E010F0110011101120113
-011401150116011701180119011A011B011C011D011E011F012001210122012301240125
-0126012701280129012A012B012C012D012E012F01300131013201330134013501360137
-01380139013A013B013C013D013E013F0140014101420143014401450146014701480149
-014A014B014C014D014E014F0150015101520153015401550156015701580159015A015B
-015C015D015E015F0160016101620163016401650166016701680169016A016B016C016D
-016E016F0170017101720173017401750176017701780179017A017B017C017D017E017F
-0180018101820183018401850186018701880189018A018B018C018D018E018F01900191
-01920193019401950196019701980199019A019B019C019D019E019F01A001A101A201A3
-01A401A501A601A701A801A901AA01AB01AC01AD01AE01AF01B001B101B201B301B401B5
-01B601B701B801B901BA01BB01BC01BD01BE01BF01C001C101C201C301C401C501C601C7
-01C801C901CA01CB01CC01CD01CE01CF01D001D101D201D301D401D501D601D701D801D9
-01DA01DB01DC01DD01DE01DF01E001E101E201E301E401E501E601E701E801E901EA01EB
-01EC01ED01EE01EF01F001F101F201F301F401F501F601F701F801F901FA01FB01FC01FD
-01FE01FF0200020102020203020402050206020702080209020A020B020C020D020E020F
-0210021102120213021402150216021702180219021A021B021C021D021E021F02200221
-02220223022402250226022702280229022A022B022C022D022E022F0230023102320233
-023402350236023702380239023A023B023C023D023E023F024002410242024302440245
-0246024702480249024A024B024C024D024E024F02500251025202530254025502560257
-02580259025A025B025C025D025E025F0260026102620263026402650266026702680269
-026A026B026C026D026E026F0270027102720273027402750276027702780279027A027B
-027C027D027E027F0280028102820283028402850286028702880289028A028B028C028D
-028E028F0290029102920293029402950296029702980299029A029B029C029D029E029F
-02A002A102A202A302A402A502A602A702A802A902AA02AB02AC02AD02AE02AF02B002B1
-02B202B302B402B502B602B702B802B902BA02BB02BC02BD02BE02BF02C002C102C202C3
-02C402C502C602C702C802C902CA02CB02CC02CD02CE02CF02D002D102D202D302D402D5
-02D602D702D802D902DA02DB02DC02DD02DE02DF02E002E102E202E302E402E502E602E7
-02E802E902EA02EB02EC02ED02EE02EF02F002F102F202F302F402F502F602F702F802F9
-02FA02FB02FC02FD02FE02FF0300030103020303030403050306030703080309030A030B
-030C030D030E030F0310031103120313031403150316031703180319031A031B031C031D
-031E031F0320032103220323032403250326032703280329032A032B032C032D032E032F
-0330033103320333033403350336033703380339033A033B033C033D033E033F03400341
-03420343034403450346034703480349034A034B034C034D034E034F0350035103520353
-035403550356035703580359035A035B035C035D035E035F036003610362036303640365
-0366036703680369036A036B036C036D036E036F03700371037203730374037503760377
-03780379037A037B037C037D037E037F0380038103820383038403850386038703880389
-038A038B038C038D038E038F0390039103920393039403950396039703980399039A039B
-039C039D039E039F03A003A103A203A303A403A503A603A703A803A903AA03AB03AC03AD
-03AE03AF03B003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF
-03C003C103C203C303C403C503C603C703C803C903CA03CB03CC03CD03CE03CF03D003D1
-03D203D303D403D503D603D703D803D903DA03DB03DC03DD03DE03DF03E003E103E203E3
-03E403E503E603E703E803E903EA03EB03EC03ED03EE03EF03F003F103F203F303F403F5
-03F603F703F803F903FA03FB03FC03FD03FE03FF04000401040204030404040504060407
-04080409040A040B040C040D040E040F0410041104120413041404150416041704180419
-041A041B041C041D041E041F0420042104220423042404250426042704280429042A042B
-042C042D042E042F0430043104320433043404350436043704380439043A043B043C043D
-043E043F0440044104420443044404450446044704480449044A044B044C044D044E044F
-0450045104520453045404550456045704580459045A045B045C045D045E045F04600461
-04620463046404650466046704680469046A046B046C046D046E046F0470047104720473
-047404750476047704780479047A047B047C047D052E6E756C6C106E6F6E6D61726B696E
-6772657475726E057370616365066578636C616D0871756F746564626C0A6E756D626572
-7369676E06646F6C6C61720770657263656E7409616D70657273616E640B71756F746573
-696E676C6509706172656E6C6566740A706172656E726967687408617374657269736B04
-706C757305636F6D6D610668797068656E06706572696F6405736C617368047A65726F03
-6F6E650374776F05746872656504666F757204666976650373697805736576656E056569
-676874046E696E6505636F6C6F6E0973656D69636F6C6F6E046C65737305657175616C07
-67726561746572087175657374696F6E0261740141014201430144014501460147014801
-49014A014B014C014D014E014F0150015101520153015401550156015701580159015A0B
-627261636B65746C656674096261636B736C6173680C627261636B657472696768740B61
-7363696963697263756D0A756E64657273636F7265056772617665016101620163016401
-650166016701680169016A016B016C016D016E016F017001710172017301740175017601
-7701780179017A0962726163656C656674036261720A627261636572696768740A617363
-696974696C646509416469657265736973054172696E670843636564696C6C6106456163
-757465064E74696C6465094F646965726573697309556469657265736973066161637574
-65066167726176650B6163697263756D666C657809616469657265736973066174696C64
-65056172696E670863636564696C6C6106656163757465066567726176650B6563697263
-756D666C65780965646965726573697306696163757465066967726176650B6963697263
-756D666C657809696469657265736973066E74696C6465066F6163757465066F67726176
-650B6F63697263756D666C6578096F6469657265736973066F74696C6465067561637574
-65067567726176650B7563697263756D666C657809756469657265736973066461676765
-72066465677265650463656E7408737465726C696E670773656374696F6E0662756C6C65
-74097061726167726170680A6765726D616E64626C730A7265676973746572656409636F
-707972696768740974726164656D61726B056163757465086469657265736973086E6F74
-657175616C024145064F736C61736808696E66696E69747909706C75736D696E7573096C
-657373657175616C0C67726561746572657175616C0379656E036D75310B706172746961
-6C646966660973756D6D6174696F6E0770726F647563740370693108696E74656772616C
-0B6F726466656D696E696E650C6F72646D617363756C696E65034F686D026165066F736C
-6173680C7175657374696F6E646F776E0A6578636C616D646F776E0A6C6F676963616C6E
-6F74077261646963616C06666C6F72696E0B617070726F78657175616C09696E6372656D
-656E740D6775696C6C656D6F746C6566740E6775696C6C656D6F74726967687408656C6C
-697073697306416772617665064174696C6465064F74696C6465024F45026F6506656E64
-61736806656D646173680C71756F746564626C6C6566740D71756F746564626C72696768
-740971756F74656C6566740A71756F7465726967687406646976696465076C6F7A656E67
-650979646965726573697309596469657265736973086672616374696F6E044575726F0D
-6775696C73696E676C6C6566740E6775696C73696E676C726967687402666902666C0964
-616767657264626C0E706572696F6463656E74657265640E71756F746573696E676C6261
-73650C71756F746564626C626173650B70657274686F7573616E640B4163697263756D66
-6C65780B4563697263756D666C6578064161637574650945646965726573697306456772
-617665064961637574650B4963697263756D666C65780949646965726573697306496772
-617665064F61637574650B4F63697263756D666C6578064F677261766506556163757465
-0B5563697263756D666C65780655677261766508646F746C657373690A63697263756D66
-6C65780574696C6465066D6163726F6E05627265766509646F74616363656E740472696E
-6707636564696C6C610C68756E676172756D6C617574066F676F6E656B056361726F6E06
-4C736C617368066C736C61736806536361726F6E06736361726F6E065A6361726F6E067A
-6361726F6E0962726F6B656E626172034574680365746806596163757465067961637574
-650554686F726E0574686F726E056D696E7573086D756C7469706C790B6F6E6573757065
-72696F720B74776F7375706572696F720D74687265657375706572696F72076F6E656861
-6C660A6F6E65717561727465720D74687265657175617274657273056672616E63064762
-72657665066762726576650449646F740853636564696C6C610873636564696C6C610643
-61637574650663616375746506436361726F6E06636361726F6E07646D6163726F6E096F
-76657273636F7265066D6964646F74064162726576650661627265766507416F676F6E65
-6B07616F676F6E656B06446361726F6E06646361726F6E0644736C61736807456F676F6E
-656B07656F676F6E656B06456361726F6E06656361726F6E064C6163757465066C616375
-7465064C6361726F6E066C6361726F6E044C646F74046C646F74064E6163757465066E61
-63757465064E6361726F6E066E6361726F6E094F64626C6163757465096F64626C616375
-7465065261637574650672616375746506526361726F6E06726361726F6E065361637574
-65067361637574650854636564696C6C610874636564696C6C6106546361726F6E067463
-61726F6E055572696E67057572696E67095564626C6163757465097564626C6163757465
-065A6163757465067A6163757465045A646F74047A646F740547616D6D61055468657461
-0350686905616C7068610564656C746107657073696C6F6E057369676D61037461750370
-68690D756E64657273636F726564626C096578636C616D64626C096E7375706572696F72
-0670657365746102494A02696A0B6E61706F7374726F706865066D696E75746506736563
-6F6E64096166696936313234380961666969363132383906483232303733064831383534
-3306483138353531064831383533330A6F70656E62756C6C657407416D6163726F6E0761
-6D6163726F6E0B4363697263756D666C65780B6363697263756D666C65780443646F7404
-63646F7407456D6163726F6E07656D6163726F6E06456272657665066562726576650445
-646F740465646F740B4763697263756D666C65780B6763697263756D666C65780447646F
-740467646F740847636564696C6C610867636564696C6C610B4863697263756D666C6578
-0B6863697263756D666C657804486261720468626172064974696C6465066974696C6465
-07496D6163726F6E07696D6163726F6E064962726576650669627265766507496F676F6E
-656B07696F676F6E656B0B4A63697263756D666C65780B6A63697263756D666C6578084B
-636564696C6C61086B636564696C6C610C6B677265656E6C616E646963084C636564696C
-6C61086C636564696C6C61084E636564696C6C61086E636564696C6C6103456E6703656E
-67074F6D6163726F6E076F6D6163726F6E064F6272657665066F62726576650852636564
-696C6C610872636564696C6C610B5363697263756D666C65780B7363697263756D666C65
-7804546261720474626172065574696C6465067574696C646507556D6163726F6E07756D
-6163726F6E065562726576650675627265766507556F676F6E656B07756F676F6E656B0B
-5763697263756D666C65780B7763697263756D666C65780B5963697263756D666C65780B
-7963697263756D666C6578056C6F6E67730A4172696E6761637574650A6172696E676163
-757465074145616375746507616561637574650B4F736C61736861637574650B6F736C61
-7368616375746509616E6F74656C65696106576772617665067767726176650657616375
-746506776163757465095764696572657369730977646965726573697306596772617665
-067967726176650D71756F74657265766572736564097261646963616C65780961666969
-303839343109657374696D61746564096F6E656569676874680C74687265656569676874
-68730B66697665656967687468730C736576656E656967687468730B636F6D6D61616363
-656E7410756E646572636F6D6D61616363656E7405746F6E6F730D646965726573697374
-6F6E6F730A416C706861746F6E6F730C457073696C6F6E746F6E6F7308457461746F6E6F
-7309496F7461746F6E6F730C4F6D6963726F6E746F6E6F730C557073696C6F6E746F6E6F
-730A4F6D656761746F6E6F7311696F74616469657265736973746F6E6F7305416C706861
-04426574610544656C746107457073696C6F6E045A6574610345746104496F7461054B61
-707061064C616D626461024D75024E75025869074F6D6963726F6E0250690352686F0553
-69676D610354617507557073696C6F6E0343686903507369054F6D6567610C496F746164
-696572657369730F557073696C6F6E64696572657369730A616C706861746F6E6F730C65
-7073696C6F6E746F6E6F7308657461746F6E6F7309696F7461746F6E6F7314757073696C
-6F6E6469657265736973746F6E6F7304626574610567616D6D61047A6574610365746105
-746865746104696F7461056B61707061066C616D626461026D75026E75027869076F6D69
-63726F6E0372686F067369676D613107757073696C6F6E0363686903707369056F6D6567
-610C696F746164696572657369730F757073696C6F6E64696572657369730C6F6D696372
-6F6E746F6E6F730C757073696C6F6E746F6E6F730A6F6D656761746F6E6F730961666969
-313030323309616669693130303531096166696931303035320961666969313030353309
-616669693130303534096166696931303035350961666969313030353609616669693130
-303537096166696931303035380961666969313030353909616669693130303630096166
-696931303036310961666969313030363209616669693130313435096166696931303031
-370961666969313030313809616669693130303139096166696931303032300961666969
-313030323109616669693130303232096166696931303032340961666969313030323509
-616669693130303236096166696931303032370961666969313030323809616669693130
-303239096166696931303033300961666969313030333109616669693130303332096166
-696931303033330961666969313030333409616669693130303335096166696931303033
-360961666969313030333709616669693130303338096166696931303033390961666969
-313030343009616669693130303431096166696931303034320961666969313030343309
-616669693130303434096166696931303034350961666969313030343609616669693130
-303437096166696931303034380961666969313030343909616669693130303635096166
-696931303036360961666969313030363709616669693130303638096166696931303036
-390961666969313030373009616669693130303732096166696931303037330961666969
-313030373409616669693130303735096166696931303037360961666969313030373709
-616669693130303738096166696931303037390961666969313030383009616669693130
-303831096166696931303038320961666969313030383309616669693130303834096166
-696931303038350961666969313030383609616669693130303837096166696931303038
-380961666969313030383909616669693130303930096166696931303039310961666969
-313030393209616669693130303933096166696931303039340961666969313030393509
-616669693130303936096166696931303039370961666969313030373109616669693130
-303939096166696931303130300961666969313031303109616669693130313032096166
-696931303130330961666969313031303409616669693130313035096166696931303130
-360961666969313031303709616669693130313038096166696931303130390961666969
-313031313009616669693130313933096166696931303035300961666969313030393809
-616669693030323038096166696936313335320270690C6F6E656E756D657261746F720C
-74776F6E756D657261746F720E74687265656E756D657261746F720D666F75726E756D65
-7261746F720D666976656E756D657261746F720E736576656E6E756D657261746F720E65
-696768746E756D657261746F7210446F6E74436F6D707265737348544D5808676C797068
-35373908676C79706835383008676C797068353831054F686F726E056F686F726E055568
-6F726E0575686F726E0D686F6F6B61626F7665636F6D620C646F7462656C6F77636F6D62
-096772617665636F6D62096163757465636F6D6208676C79706835393008676C79706835
-393108676C79706835393208676C79706835393308676C79706835393408676C79706835
-393508676C79706835393608676C79706835393708676C79706835393808676C79706835
-393908676C79706836303008676C79706836303108676C79706836303208676C79706836
-303308676C7970683630340941646F7462656C6F770961646F7462656C6F770A41686F6F
-6B61626F76650A61686F6F6B61626F7665104163697263756D666C657861637574651061
-63697263756D666C65786163757465104163697263756D666C6578677261766510616369
-7263756D666C65786772617665144163697263756D666C6578686F6F6B61626F76651461
-63697263756D666C6578686F6F6B61626F7665104163697263756D666C657874696C6465
-106163697263756D666C657874696C6465134163697263756D666C6578646F7462656C6F
-77136163697263756D666C6578646F7462656C6F770B41627265766561637574650B6162
-7265766561637574650B41627265766567726176650B61627265766567726176650F4162
-72657665686F6F6B61626F76650F616272657665686F6F6B61626F76650B416272657665
-74696C64650B61627265766574696C64650E416272657665646F7462656C6F770E616272
-657665646F7462656C6F770945646F7462656C6F770965646F7462656C6F770A45686F6F
-6B61626F76650A65686F6F6B61626F7665064574696C6465066574696C64651045636972
-63756D666C65786163757465106563697263756D666C6578616375746510456369726375
-6D666C65786772617665106563697263756D666C65786772617665144563697263756D66
-6C6578686F6F6B61626F7665146563697263756D666C6578686F6F6B61626F7665104563
-697263756D666C657874696C6465106563697263756D666C657874696C64651345636972
-63756D666C6578646F7462656C6F77136563697263756D666C6578646F7462656C6F770A
-49686F6F6B61626F76650A69686F6F6B61626F76650949646F7462656C6F770969646F74
-62656C6F7708676C79706836343908676C79706836353008676C79706836353108676C79
-70683635320573686576610A68617461667365676F6C0A686174616670617461680B6861
-74616671616D617473056869726971057473657265057365676F6C057061746168067161
-6D61747305686F6C616D0671756275747306646167657368056D65746567056D61716166
-0472616665057061736571077368696E646F740673696E646F7408736F66706173757104
-616C6566036265740567696D656C0564616C657402686503766176057A6179696E036865
-740374657403796F640866696E616C6B6166036B6166056C616D65640866696E616C6D65
-6D036D656D0866696E616C6E756E036E756E0673616D656B68046179696E0766696E616C
-70650270650A66696E616C747361646905747361646903716F660472657368047368696E
-0374617609646F75626C6576617606766176796F6409646F75626C65796F640667657265
-73680967657273686179696D0D6E657773686571656C7369676E0A7661767368696E646F
-740D66696E616C6B616673686576610E66696E616C6B616671616D6174730A6C616D6564
-686F6C616D106C616D6564686F6C616D64616765736807616C746179696E0B7368696E73
-68696E646F740A7368696E73696E646F74117368696E6461676573687368696E646F7410
-7368696E64616765736873696E646F7409616C656670617461680A616C656671616D6174
-7309616C65666D61706971096265746461676573680B67696D656C6461676573680B6461
-6C6574646167657368086865646167657368097661766461676573680B7A6179696E6461
-676573680974657464616765736809796F646461676573680E66696E616C6B6166646167
-657368096B61666461676573680B6C616D6564646167657368096D656D64616765736809
-6E756E6461676573680C73616D656B686461676573680D66696E616C7065646167657368
-0870656461676573680B747361646964616765736809716F666461676573680A72657368
-6461676573680A7368696E64616765736808746176646167657308766176686F6C616D07
-62657472616665076B6166726166650670657261666509616C65666C616D6564127A6572
-6F77696474686E6F6E6A6F696E65720F7A65726F77696474686A6F696E65720F6C656674
-746F72696768746D61726B0F7269676874746F6C6566746D61726B096166696935373338
-380961666969353734303309616669693537343037096166696935373430390961666969
-353734343009616669693537343531096166696935373435320961666969353734353309
-616669693537343534096166696935373435350961666969353734353609616669693537
-343537096166696935373435380961666969353733393209616669693537333933096166
-696935373339340961666969353733393509616669693537333936096166696935373339
-370961666969353733393809616669693537333939096166696935373430300961666969
-353734303109616669693537333831096166696935373436310961666969363331363709
-616669693537343539096166696935373534330961666969353735333409616669693537
-343934096166696936323834330961666969363238343409616669693632383435096166
-696936343234300961666969363432343109616669693633393534096166696935373338
-320961666969363432343209616669693632383831096166696935373530340961666969
-353733363909616669693537333730096166696935373337310961666969353733373209
-616669693537333733096166696935373337340961666969353733373509616669693537
-333931096166696935373437310961666969353734363009616669693532323538096166
-696935373530360961666969363239353809616669693632393536096166696935323935
-370961666969353735303509616669693632383839096166696936323838370961666969
-363238383809616669693537353037096166696936323936310961666969363239353909
-616669693632393630096166696935373530380961666969363239363209616669693537
-353637096166696936323936340961666969353233303509616669693532333036096166
-696935373530390961666969363239363709616669693632393635096166696936323936
-360961666969353735353509616669693532333634096166696936333735330961666969
-363337353409616669693633373539096166696936333736330961666969363337393509
-616669693632383931096166696936333830380961666969363239333809616669693633
-383130096166696936323934320961666969363239343709616669693633383133096166
-696936333832330961666969363338323409616669693633383333096166696936333834
-340961666969363238383209616669693632383833096166696936323838340961666969
-363238383509616669693632383836094F646F7462656C6F77096F646F7462656C6F770A
-4F686F6F6B61626F76650A6F686F6F6B61626F7665104F63697263756D666C6578616375
-7465106F63697263756D666C65786163757465104F63697263756D666C65786772617665
-106F63697263756D666C65786772617665144F63697263756D666C6578686F6F6B61626F
-7665146F63697263756D666C6578686F6F6B61626F7665104F63697263756D666C657874
-696C6465106F63697263756D666C657874696C6465134F63697263756D666C6578646F74
-62656C6F77136F63697263756D666C6578646F7462656C6F770A4F686F726E6163757465
-0A6F686F726E61637574650A4F686F726E67726176650A6F686F726E67726176650E4F68
-6F726E686F6F6B61626F76650E6F686F726E686F6F6B61626F76650A4F686F726E74696C
-64650A6F686F726E74696C64650D4F686F726E646F7462656C6F770D6F686F726E646F74
-62656C6F770955646F7462656C6F770975646F7462656C6F770A55686F6F6B61626F7665>
-<0A75686F6F6B61626F76650A55686F726E61637574650A75686F726E61637574650A5568
-6F726E67726176650A75686F726E67726176650E55686F726E686F6F6B61626F76650E75
-686F726E686F6F6B61626F76650A55686F726E74696C64650A75686F726E74696C64650D
-55686F726E646F7462656C6F770D75686F726E646F7462656C6F7708676C797068383832
-08676C7970683838330959646F7462656C6F770979646F7462656C6F770A59686F6F6B61
-626F76650A79686F6F6B61626F7665065974696C6465067974696C646504646F6E670974
-696C6465636F6D620863757272656E63790000000000000100000C92000102160C000009
-0084000400B4FF9C000400B6FF9C000A0024FF9C000A0090FF9C000F00B4FF2E000F00B6
-FF2E00100024FFCE0010002CFFE20010002DFF9C00100036FFEC00100037FF6A00100039
-FFCE0010003AFFCE0010003BFFB00010003CFF740010003DFFE200100044FFEC00100059
-FFD80010005AFFEC0010005BFFCE0010005CFFD80010005DFFD800100090FFCE001000A0
-FFEC0011000FFF7E00110010FF60001100B1FF88001100B2FF88001100B4FF2E001100B6
-FF2E001D00B2FF7400240010FFCE00240036FFF600240037FF8800240038FFF600240039
-FFC40024003AFFCE0024003CFFB000240057FFEC00240058FFF600240059FFCE0024005A
-FFE20024005CFFCE002400B1FFCE002400B2FFCE002400B3FFCE002400B4FF88002400B5
-FFCE002400B6FF880025000FFFEC00250010000A00250011FFEC00250037FFC4002500AB
-FFEC002500B1000A002500B2000A00260010FFCE002600AFFFE7002600B1FFCE002600B2
-FFCE0027000FFFCE00270011FFCE00270037FFCE0027003AFFEC0027003BFFF60027003C
-FFEC0027003DFFEC002700ABFFCE0029000FFED400290011FED40029001DFFC40029001E
-FFC400290022003C00290024FF9C00290037001E00290044FF9C00290048FFCE00290052
-FFCE00290090FF92002900A0FF9C002900A1FFCE002900ABFED4002900B0FFCE002C0010
-FFE2002C00B1FFE2002C00B2FFE2002D000FFFEC002D0011FFEC002D0024FFF6002D0090
-FFF6002D00ABFFEC002E0010FF92002E0032FFEC002E0044FFC4002E0048FFBA002E0052
-FFBA002E0058FFCE002E0059FFB0002E005AFFBA002E005CFFB0002E0091FFEC002E00A0
-FFC4002E00A1FFBA002E00AFFFEC002E00B0FFBA002E00B1FF92002E00B2FF92002F000A
-FF88002F0010FF60002F0026FFEC002F002AFFEC002F002D0064002F0032FFEC002F0037
-FF56002F0039FF92002F003AFF9C002F003CFF60002F0059FF92002F005CFF92002F0064
-FFEC002F0091FFEC002F00AFFFEC002F00B1FF60002F00B2FF60002F00B4FF60002F00B6
-FF600032000FFFE200320011FFE200320037FFCE0032003BFFF60032003CFFEC0032003D
-FFEC003200ABFFE20033000FFED400330011FED400330024FFCE0033003C001400330044
-FFCE00330048FFCE00330052FFCE00330090FFBA003300A0FFCE003300A1FFCE003300AB
-FED4003300B0FFCE0034000FFFE200340011FFE2003400ABFFE200350010FF9C00350037
-FFC40035003CFFEC00350044FFD800350048FFCE00350052FFCE00350058FFEC0035005C
-FFC9003500A0FFCE003500A1FFCE003500B0FFC4003500B1FF9C003500B2FF9C003500B4
-FFBA003500B6FFBA0036000FFFEC00360011FFEC00360024FFEC00360036FFEA00360059
-FFE20036005AFFEC0036005CFFE200360090FFEC003600ABFFEC0037000FFEDE00370010
-FF6A00370011FEDE0037001DFF380037001EFF3800370022003C00370024FF8800370026
-FFD80037002AFFD800370032FFCE00370036FFF400370037FFBA00370044FF1000370046
-FF2400370048FF240037004AFF2E00370052FF2400370055FF3800370056FF4C00370058
-FF3800370059FF380037005AFF380037005CFF380037005DFF5600370064FFD800370090
-FF7E00370091FFCE003700A0FF10003700A1FF24003700ABFEDE003700AFFFCE003700B0
-FF24003700B1FF6A003700B2FF6A0038000FFFEC00380011FFEC00380024FFF600380090
-FFEC003800ABFFEC0039000FFEDE00390010FFCE00390011FEDE0039001DFFB00039001E
-FFB000390024FFC400390044FF9C00390048FF9C00390052FF9C00390058FFC40039005C
-FFBF00390090FFBA003900A0FF9C003900A1FF9C003900ABFEDE003900B0FF9C003900B1
-FFCE003900B2FFCE003A000FFEDE003A0010FFCE003A0011FF24003A001DFFB0003A001E
-FFB0003A0024FFCE003A0044FF9C003A0048FF9C003A0052FF9C003A0055FFC4003A0058
-FFC4003A005CFFBF003A0090FFC4003A00A0FF9C003A00A1FF9C003A00ABFF24003A00B0
-FF9C003A00B1FFCE003A00B2FFCE003B0010FFB0003B0026FFF6003B002AFFF6003B0032
-FFF6003B0044FFCE003B0048FFC4003B0052FFC4003B0058FFE2003B005CFFB0003B0064
-FFF6003B0091FFF6003B00A0FFCE003B00A1FFC4003B00AFFFF6003B00B0FFC4003B00B1
-FFB0003B00B2FFB0003C000FFEDE003C0010FF74003C0011FEDE003C001DFF38003C001E
-FF38003C0024FFB0003C0032FFEC003C0044FF74003C0047FF88003C0048FF7E003C004A
-FF7E003C0050FF9C003C0051FF9C003C0052FF7E003C0053FF9C003C0054FF7E003C0055
-FF9C003C0056FF92003C0058FF92003C0059FF9C003C0090FFB0003C0091FFEC003C00A0
-FF74003C00A1FF7E003C00ABFEDE003C00AFFFEC003C00B0FF7E003C00B1FF74003C00B2
-FF74003D0010FFC4003D0026FFEC003D002AFFEC003D0032FFEC003D003DFFF6003D0044
-FFCE003D0048FFC4003D0052FFC4003D005AFFD8003D005CFFBF003D0064FFEC003D0091
-FFEC003D00A0FFCE003D00A1FFC4003D00AFFFEC003D00B0FFC4003D00B1FFCE003D00B2
-FFCE00440059FFF00044005AFFF60044005CFFF00045000FFFE200450011FFEC0045005C
-FFFB004500ABFFEC00460010FFEC00460037FFC4004600B1FFEC004600B2FFEC00480037
-FF7400490005003C0049000A003C0049000C00640049000D00320049000FFF7E00490010
-FFCE00490011FF8800490022006E0049003F00640049004000640049005CFFF600490060
-0064004900ABFF88004900B1FFCE004900B2FFCE004900B40032004900B60032004B0059
-FFEC004B005AFFF6004B005CFFEC004E0010FF9C004E0048FFEC004E0052FFEC004E00A1
-FFEC004E00B0FFEC004E00B1FF9C004E00B2FF9C00500059FFEC0050005AFFF60050005C
-FFEC00510059FFEC0051005AFFF60051005CFFEC0052000FFFE200520011FFEC00520059
-FFF10052005BFFEC0052005CFFF1005200ABFFEC0053000FFFE200530011FFEC0053005C
-FFFB005300ABFFEC0055000FFEDE00550010FFEC00550011FEDE00550044FFDC005500A0
-FFD8005500ABFEDE005500B1FFEC005500B2FFEC005500B4001E005500B6001E00570010
-FFD80057005CFFF6005700B1FFD8005700B2FFD8005700B40014005700B600140059000F
-FF4C00590010FFD800590011FF4C00590044FFD800590048FFEE00590052FFEE005900A0
-FFD8005900A1FFEE005900ABFF4C005900B0FFF1005900B1FFD8005900B2FFD8005A000F
-FFBA005A0010FFEC005A0011FFBA005A0044FFEC005A00A0FFEC005A00ABFFBA005A00B1
-FFEC005A00B2FFEC005B0010FFCE005B0046FFEC005B0047FFF6005B0048FFE8005B004A
-FFF6005B0052FFE8005B006FFFEC005B00A1FFE8005B00B0FFEC005B00B1FFCE005B00B2
-FFCE005C000FFF42005C0010FFD8005C0011FF42005C0044FFD8005C0046FFEE005C0047
-FFF6005C0048FFEE005C004AFFF6005C0052FFEE005C0054FFF6005C006FFFEE005C00A0
-FFD8005C00A1FFEE005C00ABFF4C005C00B0FFF1005C00B1FFD8005C00B2FFD8005D0010
-FFEC005D0046FFF6005D0047FFF6005D0048FFF4005D004AFFF6005D0052FFF4005D0054
-FFF6005D006FFFF6005D00A1FFF4005D00B1FFEC005D00B2FFEC00640010FFCE006400AF
-FFE7006400B1FFCE006400B2FFCE006F0010FFEC006F00B1FFEC006F00B2FFEC0091000F
-FFE200910011FFE200910037FFCE0091003BFFF60091003CFFEC0091003DFFEC009100AB
-FFE200A1000FFFE200A10011FFEC00A10059FFF100A1005BFFEC00A1005CFFF100A100AB
-FFEC00AB00B4FF2E00AB00B6FF2E00B10024FFCE00B1002CFFE200B1002DFF9C00B10036
-FFEC00B10037FF6A00B10039FFCE00B1003AFFCE00B1003BFFB000B1003CFF7400B1003D
-FFF600B10044FFEC00B10059FFD800B1005AFFEC00B1005BFFCE00B1005CFFD800B1005D
-FFD800B10090FFCE00B100A0FFEC00B20024FFCE00B2002CFFE200B2002DFF9C00B20036
-FFEC00B20037FF6A00B20039FFCE00B2003AFFCE00B2003BFFB000B2003CFF7400B2003D
-FFF600B20044FFEC00B20059FFD800B2005AFFEC00B2005BFFCE00B2005CFFD800B2005D
-FFD800B20090FFCE00B200A0FFEC00B30024FF9C00B30090FF9C00B4000FFF2E00B40011
-FF2E00B40024FF9C00B40037006E00B40039006400B4003A003C00B4003C006E00B40056
-FFBA00B40057002800B40090FF9C00B400ABFF2E00B50024FF9C00B50090FF9C00B6000F
-FF2E00B60011FF2E00B60024FF9C00B60037006E00B60039006400B6003A003C00B6003C
-006E00B60056FFBA00B60057002800B60090FF9C00B600ABFF2E00C30037FF2E00C30039
-FF2E00C3003AFF9C00C3003CFF2E00C40037FF2E00C40039FF2E00C4003AFF9C00C4003C
-FF2E0000000000010001000100000001000013FF0000001400000000000013F7308213F3
-06092A864886F70D010702A08213E4308213E0020101310E300C06082A864886F70D0205
-05003060060A2B060104018237020104A0523050302C060A2B06010401823702011CA21E
-801C003C003C003C004F00620073006F006C006500740065003E003E003E3020300C0608
-2A864886F70D020505000410503EEC935CE1D8D33511E69A791E4594A0820F3F308202C0
-3082022902141389B4D18AE8A7C4BD35C79B8D88CA1FCA535691300D06092A864886F70D
-010104050030819E311F301D060355040A1316566572695369676E205472757374204E65
-74776F726B31173015060355040B130E566572695369676E2C20496E632E312C302A0603
-55040B1323566572695369676E2054696D65205374616D70696E67205365727669636520
-526F6F7431343032060355040B132B4E4F204C494142494C495459204143434550544544
-2C20286329393720566572695369676E2C20496E632E301E170D39373035313230373030
-30305A170D3939313233313037303030305A30819E311F301D060355040A131656657269
-5369676E205472757374204E6574776F726B31173015060355040B130E56657269536967
-6E2C20496E632E312C302A060355040B1323566572695369676E2054696D65205374616D
-70696E67205365727669636520526F6F7431343032060355040B132B4E4F204C49414249
-4C4954592041434345505445442C20286329393720566572695369676E2C20496E632E30
-819F300D06092A864886F70D010101050003818D0030818902818100D32E20F0687C2C2D
-2E811CB106B2A70BB7110D57DA53D875E3C9332AB2D4F6095B34F3E990FE090CD0DB1B5A
-B9CDE7F688B19DC08725EB7D5810736A78CB7115FDC658F629AB585E9604FD2D62115881
-1CCA7194D522582FD5CC14058436BA94AAB44D4AE9EE3B22AD56997E219C6C86C04A4797
-6AB4A636D5FC092DD3B4399B0203010001300D06092A864886F70D010104050003818100
-3A119C85053ED2E980FB7BD5A9F4AC79FC05FC953D7123A92B28DF8C136589FE2C87018F
-5A9A62CA11A780F4B7BE14B7D156996B086245C6A2A5DA357F0522DE722D048605A77C09
-16931443F0F7164DD6078E9B106C58FE0A3597CA899FDF04709C2A7D618EC1E80B719AA8
-C76662423D959422329822898AFA640824F5D2FA308202CD30820236021500BD119ADA43
-ED21FB46588489CA46889025EE1460300D06092A864886F70D010104050030819E311F30
-1D060355040A1316566572695369676E205472757374204E6574776F726B311730150603
-55040B130E566572695369676E2C20496E632E312C302A060355040B1323566572695369
-676E2054696D65205374616D70696E67205365727669636520526F6F7431343032060355
-040B132B4E4F204C494142494C4954592041434345505445442C20286329393720566572
-695369676E2C20496E632E301E170D3937303531323037303030305A170D393931323331
-3037303030305A3081AC31273025060355040B131E566572695369676E2054696D652053
-74616D70696E672053657276696365311F301D060355040B1316566572695369676E2054
-72757374204E6574776F726B31343032060355040B132B4E4F204C494142494C49545920
-41434345505445442C20286329393720566572695369676E2C20496E632E311730150603
-55040A130E566572695369676E2C20496E632E3111300F06035504071308496E7465726E
-657430819D300D06092A864886F70D010101050003818B0030818702818100AB61EDB4AD
-8D904790DCB4115E69DC0A7F62900631CDCEFF889146D7493A94E9D4063F9DADA2785AEC
-F9FC63454FB80B6E30EFA236AB2D09DFF16F27AB0D516005354F7FCE544FD0B72C42D80B
-D08DB85EFFB680D0E396B47F224942106CD398B00156A3C3CF2E9F3AF47FA858A6D72265
-E58CAB789CBCD94742685B2D7DFDB5020103300D06092A864886F70D0101040500038181
-006D60FB995FA469B3D37B702B62231E442051AF2315C77402F949F2271A5CAC86713508
-2BF68FDEE0B596E88BA74BE373C848099DB0DA8BDA1592CA03E509255606E74EA447A5D1
-5746D43856F521CDC3263B2D2532CE9BE2BF4047EAD86D4776E5C030A30F80CE7FD83B7E
-A0F9952A312B15FAC814EDDDB0E9554170462D2C7E308209A63082090FA0030201020210
-7966966E83B0D0B601126E9DC0B46571300D06092A864886F70D01010205003061311130
-0F06035504071308496E7465726E657431173015060355040A130E566572695369676E2C
-20496E632E31333031060355040B132A566572695369676E20436F6D6D65726369616C20
-536F667477617265205075626C697368657273204341301E170D39383034313630303030
-30305A170D3939303431363233353935395A3082015D3111300F06035504071308496E74
-65726E657431173015060355040A130E566572695369676E2C20496E632E313330310603
-55040B132A566572695369676E20436F6D6D65726369616C20536F667477617265205075
-626C69736865727320434131463044060355040B133D7777772E766572697369676E2E63
-6F6D2F7265706F7369746F72792F43505320496E636F72702E206279205265662E2C4C49
-41422E4C54442863293936313E303C060355040B13354469676974616C20494420436C61
-73732033202D204D6963726F736F667420536F6674776172652056616C69646174696F6E
-207632310B3009060355040613025553311330110603550408130A57617368696E67746F
-6E3110300E060355040713075265646D6F6E64311E301C060355040314154D6963726F73
-6F667420436F72706F726174696F6E311E301C060355040B14154D6963726F736F667420
-436F72706F726174696F6E30820120300D06092A864886F70D01010105000382010D0030
-8201080282010100B490D226A864E6EB15C3FF6D7B414F0AF96F2A71CE2E1853A63236E0
-D468E135FD4912D896FC65CF531420BE04C97AF5C9706D94ECCCB3AF2A309A32587CB6A9
-6B256799C0E277EA05E5EFE396F7AD0B19A6AE3C8470E2F86F5C4F7D6F0F52458A15D765
-DC3B2005E33DA16C973A0E0B2513ED21CB208E397A628305C9231AFC529DAC9D4C96D73C
-4E583D827BEE093556B568C04245A23B31A3FBD895FB55C72CA8A3C3294FCEF493F0031F
-7BF1153AA9F8AA5083056D62F08B138838D9E31C0E73C10640BA28C3EBCD9271C7BE66B2
-A15422D60B677CF8877989AC660AAA51FAFD7221FC865DC6F44A0EEC5861234DD0B13A64
-E0139E5EC8856D4C16AF3D07020103A38205DD308205D930090603551D1304023000300B
-0603551D0F0404030205A03081880603551D01048180307E80107B96E4D143FD6898F338
-CC6E3BF20B82A16330613111300F06035504071308496E7465726E657431173015060355
-040A130E566572695369676E2C20496E632E31333031060355040B132A56657269536967
-6E20436F6D6D65726369616C20536F667477617265205075626C69736865727320434182
-0502B400000130210603551D040101FF04173014300E300C060A2B060104018237020116
-0302078000300D0603551D0A040630040302064030820436060A2B06010401823702010A
-0101FF048204233082041FA029802768747470733A2F2F7777772E766572697369676E2E
-636F6D2F7265706F7369746F72792F435053A18203B8818203B454686973206365727469
-66696361746520696E636F72706F7261746573206279207265666572656E63652C20616E
-642069747320757365206973207374726963746C790A7375626A65637420746F2C207468
-6520566572695369676E2043657274696669636174696F6E205072616374696365205374
-6174656D656E742028435053290A76657273696F6E20312E302C20617661696C61626C65
-20696E2074686520566572695369676E207265706F7369746F72792061743A0A68747470
-733A2F2F7777772E766572697369676E2E636F6D3B20627920452D6D61696C2061742043
-50532D726571756573747340766572697369676E2E636F6D3B206F720A6279206D61696C
-20617420566572695369676E2C20496E632E2C203235393320436F617374204176652E2C
-204D6F756E7461696E20566965772C2043412039343034330A55534120436F7079726967
-6874202863293139393620566572695369676E2C20496E632E2020416C6C205269676874
-732052657365727665642E204345525441494E0A57415252414E5449455320444953434C
-41494D454420414E44204C494142494C495459204C494D495445442E0A0A5741524E494E
-473A2054484520555345204F462054484953204345525449464943415445204953205354
-524943544C59205355424A45435420544F205448450A564552495349474E204345525449
-4649434154494F4E2050524143544943452053544154454D454E542E2020544845204953
-5355494E4720415554484F524954590A444953434C41494D53204345525441494E20494D
-504C49454420414E4420455850524553532057415252414E544945532C20494E434C5544
-494E472057415252414E544945530A4F46204D45524348414E544142494C495459204F52
-204649544E45535320464F52204120504152544943554C415220505552504F53452C2041
-4E442057494C4C204E4F540A4245204C4941424C4520464F5220434F4E53455155454E54
-49414C2C2050554E49544956452C20414E44204345525441494E204F544845522044414D
-414745532E205345450A5448452043505320464F522044455441494C532E0A0A436F6E74
-656E7473206F662074686520566572695369676E2072656769737465726564206E6F6E76
-657269666965645375626A656374417474726962757465730A657874656E73696F6E2076
-616C7565207368616C6C206E6F7420626520636F6E736964657265642061732061636375
-7261746520696E666F726D6174696F6E0A76616C69646174656420627920746865204941
-2E0AA336803468747470733A2F2F7777772E766572697369676E2E636F6D2F7265706F73
-69746F72792F766572697369676E6C6F676F2E6769663081AF0603551D200481A7308030
-80060B6086480186F845010701013080302806082B06010505070201161C68747470733A
-2F2F7777772E766572697369676E2E636F6D2F435053306206082B060105050702023056
-3015160E566572695369676E2C20496E632E30030201011A3D566572695369676E277320
-43505320696E636F72702E206279207265666572656E6365206C6961622E206C74642E20
-286329393720566572695369676E0000000000003016060A2B06010401823702011B0408
-30060101FF0101FF300D06092A864886F70D010102050003818100954CA27955DA745C8B
-25C2A620F06CB8B37B467B9E9F7ABA710648151265CC5D29F8513B8971B1F4143878DA8F
-AE0B8036905D4897C500380A53BF4037FF8A13276D004734F7484C2E72F2C6D37EFD446F
-228FD1929FE394EDE7FF00C9C2EE721CD99C036EB6C1637B3278443B9E858AFB84863728
-2EE7A638373EBAFCF382233182042430820420020101307530613111300F060355040713
-08496E7465726E657431173015060355040A130E566572695369676E2C20496E632E3133
-3031060355040B132A566572695369676E20436F6D6D65726369616C20536F6674776172
-65205075626C69736865727320434102107966966E83B0D0B601126E9DC0B46571300C06
-082A864886F70D02050500A081AE301906092A864886F70D010903310C060A2B06010401
-8237020104301C060A2B06010401823702010B310E300C060A2B06010401823702011630
-1F06092A864886F70D010904311204105BA6237427F8290EF09CCF5B63F749F83052060A
-2B06010401823702010C31443042A01A801800560065007200640061006E006100200046
-006F006E0074A1248022687474703A2F2F7777772E6D6963726F736F66742E636F6D2F74
-727565747970652F300D06092A864886F70D0101010500048201003EFBA519B6A00C823F
-B823EA3A1E5E6EBDBBF2C647D1F1093C66910B72FEA26B78E409E7750E62A559DAAC12F7
-CCA36B0725F8BB2E0409AEE1156BE3736F46D1B116DF2B18ABCF394DCF0EF8EE01A758E5
-E4872882FFDD5F04C39F3258358C3DE27BE8FC410AC11736DD19609E3BACBB2257C5E4A4
-836F811D07EC80DAB42FE9AC33537823FA2AC0D406166130C356085818B3CEC8A53763BF
-88191B4E52ED790B57C924CEA670505AA2621C1121663215F15D1A9E89A6BC2AA35F5B1F
-86E4FDEC2280203A57D736DD2C29A4D2D29F00BAF260927AB3B36EF1C4CC5100CAC54BAA
-0AFB74D0101FBEC53815E46B3814DF7E5DFC4A121257608F59AA76D5F333A3A18201D030
-8201CC06092A864886F70D010906318201BD308201B90201013081B830819E311F301D06
-0355040A1316566572695369676E205472757374204E6574776F726B3117301506035504
-0B130E566572695369676E2C20496E632E312C302A060355040B1323566572695369676E
-2054696D65205374616D70696E67205365727669636520526F6F7431343032060355040B
-132B4E4F204C494142494C4954592041434345505445442C202863293937205665726953
-69676E2C20496E632E021500BD119ADA43ED21FB46588489CA46889025EE1460300C0608
-2A864886F70D02050500A059301806092A864886F70D010903310B06092A864886F70D01
-0701301C06092A864886F70D010905310F170D3938313131323135313835305A301F0609
-2A864886F70D01090431120410641EED59DAFC3103655C9A2A4309D288300D06092A8648
-86F70D01010105000481809092A6C858A52E216E3E56A1C40477C3C63030D247298EF8EA
-BFA1C4D5DDE8C375555276DDBB2761ADFC914D772AD331C04DDD675B9736F7D136CAA72D
-41CF9F8377C51611E0D1B6EDD8C5AB73694109FD5312908B17319E96C22CCEDD65C9D342
-DC0E3B159C36E0FDA54B21C8DD968B90621C263E94F737AC1997B9D84E517C0000>
-] def
-/CharStrings 893 dict dup begin
-/.notdef 0 def /.null 1 def /nonmarkingreturn 2 def /space 3 def /exclam 4 def
-/quotedbl 5 def /numbersign 6 def /dollar 7 def /percent 8 def
-/ampersand 9 def /quotesingle 10 def /parenleft 11 def /parenright 12 def
-/asterisk 13 def /plus 14 def /comma 15 def /hyphen 16 def
-/period 17 def /slash 18 def /zero 19 def /one 20 def
-/two 21 def /three 22 def /four 23 def /five 24 def
-/six 25 def /seven 26 def /eight 27 def /nine 28 def
-/colon 29 def /semicolon 30 def /less 31 def /equal 32 def
-/greater 33 def /question 34 def /at 35 def /A 36 def
-/B 37 def /C 38 def /D 39 def /E 40 def
-/F 41 def /G 42 def /H 43 def /I 44 def
-/J 45 def /K 46 def /L 47 def /M 48 def
-/N 49 def /O 50 def /P 51 def /Q 52 def
-/R 53 def /S 54 def /T 55 def /U 56 def
-/V 57 def /W 58 def /X 59 def /Y 60 def
-/Z 61 def /bracketleft 62 def /backslash 63 def /bracketright 64 def
-/asciicircum 65 def /underscore 66 def /grave 67 def /a 68 def
-/b 69 def /c 70 def /d 71 def /e 72 def
-/f 73 def /g 74 def /h 75 def /i 76 def
-/j 77 def /k 78 def /l 79 def /m 80 def
-/n 81 def /o 82 def /p 83 def /q 84 def
-/r 85 def /s 86 def /t 87 def /u 88 def
-/v 89 def /w 90 def /x 91 def /y 92 def
-/z 93 def /braceleft 94 def /bar 95 def /braceright 96 def
-/asciitilde 97 def /Adieresis 98 def /Aring 99 def /Ccedilla 100 def
-/Eacute 101 def /Ntilde 102 def /Odieresis 103 def /Udieresis 104 def
-/aacute 105 def /agrave 106 def /acircumflex 107 def /adieresis 108 def
-/atilde 109 def /aring 110 def /ccedilla 111 def /eacute 112 def
-/egrave 113 def /ecircumflex 114 def /edieresis 115 def /iacute 116 def
-/igrave 117 def /icircumflex 118 def /idieresis 119 def /ntilde 120 def
-/oacute 121 def /ograve 122 def /ocircumflex 123 def /odieresis 124 def
-/otilde 125 def /uacute 126 def /ugrave 127 def /ucircumflex 128 def
-/udieresis 129 def /dagger 130 def /degree 131 def /cent 132 def
-/sterling 133 def /section 134 def /bullet 135 def /paragraph 136 def
-/germandbls 137 def /registered 138 def /copyright 139 def /trademark 140 def
-/acute 141 def /dieresis 142 def /notequal 143 def /AE 144 def
-/Oslash 145 def /infinity 146 def /plusminus 147 def /lessequal 148 def
-/greaterequal 149 def /yen 150 def /mu1 151 def /partialdiff 152 def
-/summation 153 def /product 154 def /pi1 155 def /integral 156 def
-/ordfeminine 157 def /ordmasculine 158 def /Ohm 159 def /ae 160 def
-/oslash 161 def /questiondown 162 def /exclamdown 163 def /logicalnot 164 def
-/radical 165 def /florin 166 def /approxequal 167 def /increment 168 def
-/guillemotleft 169 def /guillemotright 170 def /ellipsis 171 def /Agrave 172 def
-/Atilde 173 def /Otilde 174 def /OE 175 def /oe 176 def
-/endash 177 def /emdash 178 def /quotedblleft 179 def /quotedblright 180 def
-/quoteleft 181 def /quoteright 182 def /divide 183 def /lozenge 184 def
-/ydieresis 185 def /Ydieresis 186 def /fraction 187 def /Euro 188 def
-/guilsinglleft 189 def /guilsinglright 190 def /fi 191 def /fl 192 def
-/daggerdbl 193 def /periodcentered 194 def /quotesinglbase 195 def /quotedblbase 196 def
-/perthousand 197 def /Acircumflex 198 def /Ecircumflex 199 def /Aacute 200 def
-/Edieresis 201 def /Egrave 202 def /Iacute 203 def /Icircumflex 204 def
-/Idieresis 205 def /Igrave 206 def /Oacute 207 def /Ocircumflex 208 def
-/Ograve 209 def /Uacute 210 def /Ucircumflex 211 def /Ugrave 212 def
-/dotlessi 213 def /circumflex 214 def /tilde 215 def /macron 216 def
-/breve 217 def /dotaccent 218 def /ring 219 def /cedilla 220 def
-/hungarumlaut 221 def /ogonek 222 def /caron 223 def /Lslash 224 def
-/lslash 225 def /Scaron 226 def /scaron 227 def /Zcaron 228 def
-/zcaron 229 def /brokenbar 230 def /Eth 231 def /eth 232 def
-/Yacute 233 def /yacute 234 def /Thorn 235 def /thorn 236 def
-/minus 237 def /multiply 238 def /onesuperior 239 def /twosuperior 240 def
-/threesuperior 241 def /onehalf 242 def /onequarter 243 def /threequarters 244 def
-/franc 245 def /Gbreve 246 def /gbreve 247 def /Idot 248 def
-/Scedilla 249 def /scedilla 250 def /Cacute 251 def /cacute 252 def
-/Ccaron 253 def /ccaron 254 def /dmacron 255 def /overscore 256 def
-/middot 257 def /Abreve 258 def /abreve 259 def /Aogonek 260 def
-/aogonek 261 def /Dcaron 262 def /dcaron 263 def /Dslash 264 def
-/Eogonek 265 def /eogonek 266 def /Ecaron 267 def /ecaron 268 def
-/Lacute 269 def /lacute 270 def /Lcaron 271 def /lcaron 272 def
-/Ldot 273 def /ldot 274 def /Nacute 275 def /nacute 276 def
-/Ncaron 277 def /ncaron 278 def /Odblacute 279 def /odblacute 280 def
-/Racute 281 def /racute 282 def /Rcaron 283 def /rcaron 284 def
-/Sacute 285 def /sacute 286 def /Tcedilla 287 def /tcedilla 288 def
-/Tcaron 289 def /tcaron 290 def /Uring 291 def /uring 292 def
-/Udblacute 293 def /udblacute 294 def /Zacute 295 def /zacute 296 def
-/Zdot 297 def /zdot 298 def /Gamma 299 def /Theta 300 def
-/Phi 301 def /alpha 302 def /delta 303 def /epsilon 304 def
-/sigma 305 def /tau 306 def /phi 307 def /underscoredbl 308 def
-/exclamdbl 309 def /nsuperior 310 def /peseta 311 def /IJ 312 def
-/ij 313 def /napostrophe 314 def /minute 315 def /second 316 def
-/afii61248 317 def /afii61289 318 def /H22073 319 def /H18543 320 def
-/H18551 321 def /H18533 322 def /openbullet 323 def /Amacron 324 def
-/amacron 325 def /Ccircumflex 326 def /ccircumflex 327 def /Cdot 328 def
-/cdot 329 def /Emacron 330 def /emacron 331 def /Ebreve 332 def
-/ebreve 333 def /Edot 334 def /edot 335 def /Gcircumflex 336 def
-/gcircumflex 337 def /Gdot 338 def /gdot 339 def /Gcedilla 340 def
-/gcedilla 341 def /Hcircumflex 342 def /hcircumflex 343 def /Hbar 344 def
-/hbar 345 def /Itilde 346 def /itilde 347 def /Imacron 348 def
-/imacron 349 def /Ibreve 350 def /ibreve 351 def /Iogonek 352 def
-/iogonek 353 def /Jcircumflex 354 def /jcircumflex 355 def /Kcedilla 356 def
-/kcedilla 357 def /kgreenlandic 358 def /Lcedilla 359 def /lcedilla 360 def
-/Ncedilla 361 def /ncedilla 362 def /Eng 363 def /eng 364 def
-/Omacron 365 def /omacron 366 def /Obreve 367 def /obreve 368 def
-/Rcedilla 369 def /rcedilla 370 def /Scircumflex 371 def /scircumflex 372 def
-/Tbar 373 def /tbar 374 def /Utilde 375 def /utilde 376 def
-/Umacron 377 def /umacron 378 def /Ubreve 379 def /ubreve 380 def
-/Uogonek 381 def /uogonek 382 def /Wcircumflex 383 def /wcircumflex 384 def
-/Ycircumflex 385 def /ycircumflex 386 def /longs 387 def /Aringacute 388 def
-/aringacute 389 def /AEacute 390 def /aeacute 391 def /Oslashacute 392 def
-/oslashacute 393 def /anoteleia 394 def /Wgrave 395 def /wgrave 396 def
-/Wacute 397 def /wacute 398 def /Wdieresis 399 def /wdieresis 400 def
-/Ygrave 401 def /ygrave 402 def /quotereversed 403 def /radicalex 404 def
-/afii08941 405 def /estimated 406 def /oneeighth 407 def /threeeighths 408 def
-/fiveeighths 409 def /seveneighths 410 def /commaaccent 411 def /undercommaaccent 412 def
-/tonos 413 def /dieresistonos 414 def /Alphatonos 415 def /Epsilontonos 416 def
-/Etatonos 417 def /Iotatonos 418 def /Omicrontonos 419 def /Upsilontonos 420 def
-/Omegatonos 421 def /iotadieresistonos 422 def /Alpha 423 def /Beta 424 def
-/Delta 425 def /Epsilon 426 def /Zeta 427 def /Eta 428 def
-/Iota 429 def /Kappa 430 def /Lambda 431 def /Mu 432 def
-/Nu 433 def /Xi 434 def /Omicron 435 def /Pi 436 def
-/Rho 437 def /Sigma 438 def /Tau 439 def /Upsilon 440 def
-/Chi 441 def /Psi 442 def /Omega 443 def /Iotadieresis 444 def
-/Upsilondieresis 445 def /alphatonos 446 def /epsilontonos 447 def /etatonos 448 def
-/iotatonos 449 def /upsilondieresistonos 450 def /beta 451 def /gamma 452 def
-/zeta 453 def /eta 454 def /theta 455 def /iota 456 def
-/kappa 457 def /lambda 458 def /mu 459 def /nu 460 def
-/xi 461 def /omicron 462 def /rho 463 def /sigma1 464 def
-/upsilon 465 def /chi 466 def /psi 467 def /omega 468 def
-/iotadieresis 469 def /upsilondieresis 470 def /omicrontonos 471 def /upsilontonos 472 def
-/omegatonos 473 def /afii10023 474 def /afii10051 475 def /afii10052 476 def
-/afii10053 477 def /afii10054 478 def /afii10055 479 def /afii10056 480 def
-/afii10057 481 def /afii10058 482 def /afii10059 483 def /afii10060 484 def
-/afii10061 485 def /afii10062 486 def /afii10145 487 def /afii10017 488 def
-/afii10018 489 def /afii10019 490 def /afii10020 491 def /afii10021 492 def
-/afii10022 493 def /afii10024 494 def /afii10025 495 def /afii10026 496 def
-/afii10027 497 def /afii10028 498 def /afii10029 499 def /afii10030 500 def
-/afii10031 501 def /afii10032 502 def /afii10033 503 def /afii10034 504 def
-/afii10035 505 def /afii10036 506 def /afii10037 507 def /afii10038 508 def
-/afii10039 509 def /afii10040 510 def /afii10041 511 def /afii10042 512 def
-/afii10043 513 def /afii10044 514 def /afii10045 515 def /afii10046 516 def
-/afii10047 517 def /afii10048 518 def /afii10049 519 def /afii10065 520 def
-/afii10066 521 def /afii10067 522 def /afii10068 523 def /afii10069 524 def
-/afii10070 525 def /afii10072 526 def /afii10073 527 def /afii10074 528 def
-/afii10075 529 def /afii10076 530 def /afii10077 531 def /afii10078 532 def
-/afii10079 533 def /afii10080 534 def /afii10081 535 def /afii10082 536 def
-/afii10083 537 def /afii10084 538 def /afii10085 539 def /afii10086 540 def
-/afii10087 541 def /afii10088 542 def /afii10089 543 def /afii10090 544 def
-/afii10091 545 def /afii10092 546 def /afii10093 547 def /afii10094 548 def
-/afii10095 549 def /afii10096 550 def /afii10097 551 def /afii10071 552 def
-/afii10099 553 def /afii10100 554 def /afii10101 555 def /afii10102 556 def
-/afii10103 557 def /afii10104 558 def /afii10105 559 def /afii10106 560 def
-/afii10107 561 def /afii10108 562 def /afii10109 563 def /afii10110 564 def
-/afii10193 565 def /afii10050 566 def /afii10098 567 def /afii00208 568 def
-/afii61352 569 def /pi 570 def /onenumerator 571 def /twonumerator 572 def
-/threenumerator 573 def /fournumerator 574 def /fivenumerator 575 def /sevennumerator 576 def
-/eightnumerator 577 def /DontCompressHTMX 578 def /glyph579 579 def /glyph580 580 def
-/glyph581 581 def /Ohorn 582 def /ohorn 583 def /Uhorn 584 def
-/uhorn 585 def /hookabovecomb 586 def /dotbelowcomb 587 def /gravecomb 588 def
-/acutecomb 589 def /glyph590 590 def /glyph591 591 def /glyph592 592 def
-/glyph593 593 def /glyph594 594 def /glyph595 595 def /glyph596 596 def
-/glyph597 597 def /glyph598 598 def /glyph599 599 def /glyph600 600 def
-/glyph601 601 def /glyph602 602 def /glyph603 603 def /glyph604 604 def
-/Adotbelow 605 def /adotbelow 606 def /Ahookabove 607 def /ahookabove 608 def
-/Acircumflexacute 609 def /acircumflexacute 610 def /Acircumflexgrave 611 def /acircumflexgrave 612 def
-/Acircumflexhookabove 613 def /acircumflexhookabove 614 def /Acircumflextilde 615 def /acircumflextilde 616 def
-/Acircumflexdotbelow 617 def /acircumflexdotbelow 618 def /Abreveacute 619 def /abreveacute 620 def
-/Abrevegrave 621 def /abrevegrave 622 def /Abrevehookabove 623 def /abrevehookabove 624 def
-/Abrevetilde 625 def /abrevetilde 626 def /Abrevedotbelow 627 def /abrevedotbelow 628 def
-/Edotbelow 629 def /edotbelow 630 def /Ehookabove 631 def /ehookabove 632 def
-/Etilde 633 def /etilde 634 def /Ecircumflexacute 635 def /ecircumflexacute 636 def
-/Ecircumflexgrave 637 def /ecircumflexgrave 638 def /Ecircumflexhookabove 639 def /ecircumflexhookabove 640 def
-/Ecircumflextilde 641 def /ecircumflextilde 642 def /Ecircumflexdotbelow 643 def /ecircumflexdotbelow 644 def
-/Ihookabove 645 def /ihookabove 646 def /Idotbelow 647 def /idotbelow 648 def
-/glyph649 649 def /glyph650 650 def /glyph651 651 def /glyph652 652 def
-/sheva 653 def /hatafsegol 654 def /hatafpatah 655 def /hatafqamats 656 def
-/hiriq 657 def /tsere 658 def /segol 659 def /patah 660 def
-/qamats 661 def /holam 662 def /qubuts 663 def /dagesh 664 def
-/meteg 665 def /maqaf 666 def /rafe 667 def /paseq 668 def
-/shindot 669 def /sindot 670 def /sofpasuq 671 def /alef 672 def
-/bet 673 def /gimel 674 def /dalet 675 def /he 676 def
-/vav 677 def /zayin 678 def /het 679 def /tet 680 def
-/yod 681 def /finalkaf 682 def /kaf 683 def /lamed 684 def
-/finalmem 685 def /mem 686 def /finalnun 687 def /nun 688 def
-/samekh 689 def /ayin 690 def /finalpe 691 def /pe 692 def
-/finaltsadi 693 def /tsadi 694 def /qof 695 def /resh 696 def
-/shin 697 def /tav 698 def /doublevav 699 def /vavyod 700 def
-/doubleyod 701 def /geresh 702 def /gershayim 703 def /newsheqelsign 704 def
-/vavshindot 705 def /finalkafsheva 706 def /finalkafqamats 707 def /lamedholam 708 def
-/lamedholamdagesh 709 def /altayin 710 def /shinshindot 711 def /shinsindot 712 def
-/shindageshshindot 713 def /shindageshsindot 714 def /alefpatah 715 def /alefqamats 716 def
-/alefmapiq 717 def /betdagesh 718 def /gimeldagesh 719 def /daletdagesh 720 def
-/hedagesh 721 def /vavdagesh 722 def /zayindagesh 723 def /tetdagesh 724 def
-/yoddagesh 725 def /finalkafdagesh 726 def /kafdagesh 727 def /lameddagesh 728 def
-/memdagesh 729 def /nundagesh 730 def /samekhdagesh 731 def /finalpedagesh 732 def
-/pedagesh 733 def /tsadidagesh 734 def /qofdagesh 735 def /reshdagesh 736 def
-/shindagesh 737 def /tavdages 738 def /vavholam 739 def /betrafe 740 def
-/kafrafe 741 def /perafe 742 def /aleflamed 743 def /zerowidthnonjoiner 744 def
-/zerowidthjoiner 745 def /lefttorightmark 746 def /righttoleftmark 747 def /afii57388 748 def
-/afii57403 749 def /afii57407 750 def /afii57409 751 def /afii57440 752 def
-/afii57451 753 def /afii57452 754 def /afii57453 755 def /afii57454 756 def
-/afii57455 757 def /afii57456 758 def /afii57457 759 def /afii57458 760 def
-/afii57392 761 def /afii57393 762 def /afii57394 763 def /afii57395 764 def
-/afii57396 765 def /afii57397 766 def /afii57398 767 def /afii57399 768 def
-/afii57400 769 def /afii57401 770 def /afii57381 771 def /afii57461 772 def
-/afii63167 773 def /afii57459 774 def /afii57543 775 def /afii57534 776 def
-/afii57494 777 def /afii62843 778 def /afii62844 779 def /afii62845 780 def
-/afii64240 781 def /afii64241 782 def /afii63954 783 def /afii57382 784 def
-/afii64242 785 def /afii62881 786 def /afii57504 787 def /afii57369 788 def
-/afii57370 789 def /afii57371 790 def /afii57372 791 def /afii57373 792 def
-/afii57374 793 def /afii57375 794 def /afii57391 795 def /afii57471 796 def
-/afii57460 797 def /afii52258 798 def /afii57506 799 def /afii62958 800 def
-/afii62956 801 def /afii52957 802 def /afii57505 803 def /afii62889 804 def
-/afii62887 805 def /afii62888 806 def /afii57507 807 def /afii62961 808 def
-/afii62959 809 def /afii62960 810 def /afii57508 811 def /afii62962 812 def
-/afii57567 813 def /afii62964 814 def /afii52305 815 def /afii52306 816 def
-/afii57509 817 def /afii62967 818 def /afii62965 819 def /afii62966 820 def
-/afii57555 821 def /afii52364 822 def /afii63753 823 def /afii63754 824 def
-/afii63759 825 def /afii63763 826 def /afii63795 827 def /afii62891 828 def
-/afii63808 829 def /afii62938 830 def /afii63810 831 def /afii62942 832 def
-/afii62947 833 def /afii63813 834 def /afii63823 835 def /afii63824 836 def
-/afii63833 837 def /afii63844 838 def /afii62882 839 def /afii62883 840 def
-/afii62884 841 def /afii62885 842 def /afii62886 843 def /Odotbelow 844 def
-/odotbelow 845 def /Ohookabove 846 def /ohookabove 847 def /Ocircumflexacute 848 def
-/ocircumflexacute 849 def /Ocircumflexgrave 850 def /ocircumflexgrave 851 def /Ocircumflexhookabove 852 def
-/ocircumflexhookabove 853 def /Ocircumflextilde 854 def /ocircumflextilde 855 def /Ocircumflexdotbelow 856 def
-/ocircumflexdotbelow 857 def /Ohornacute 858 def /ohornacute 859 def /Ohorngrave 860 def
-/ohorngrave 861 def /Ohornhookabove 862 def /ohornhookabove 863 def /Ohorntilde 864 def
-/ohorntilde 865 def /Ohorndotbelow 866 def /ohorndotbelow 867 def /Udotbelow 868 def
-/udotbelow 869 def /Uhookabove 870 def /uhookabove 871 def /Uhornacute 872 def
-/uhornacute 873 def /Uhorngrave 874 def /uhorngrave 875 def /Uhornhookabove 876 def
-/uhornhookabove 877 def /Uhorntilde 878 def /uhorntilde 879 def /Uhorndotbelow 880 def
-/uhorndotbelow 881 def /glyph882 882 def /glyph883 883 def /Ydotbelow 884 def
-/ydotbelow 885 def /Yhookabove 886 def /yhookabove 887 def /Ytilde 888 def
-/ytilde 889 def /dong 890 def /tildecomb 891 def /currency 892 def
-
-end readonly def
-FontName currentdict end definefont pop
-%%EndFont
-%%EndProlog
-mpldict begin
-13.5 175.5 translate
-585 441 0 0 clipbox
-% polygon
-1.000 setgray
-1.000 setlinewidth
-0 setlinejoin
-2 setlinecap
-[] 0 setdash
-0 0 m
-0 441 l
-585 441 l
-585 0 l
-closepath
-gsave
-fill
-grestore
-stroke
-% polygon
-0.000 setgray
-73.125 44.1 m
-73.125 396.9 l
-526.5 396.9 l
-526.5 44.1 l
-closepath
-gsave
-1.000 setgray
-fill
-grestore
-stroke
-% draw_lines
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 44.100 m
-82.192 44.625 l
-91.260 46.237 l
-100.328 49.043 l
-109.395 53.206 l
-118.463 58.937 l
-127.530 66.464 l
-136.597 76.012 l
-145.665 87.777 l
-154.733 101.897 l
-163.800 118.431 l
-172.868 137.336 l
-181.935 158.456 l
-191.002 181.511 l
-200.070 206.100 l
-209.138 231.707 l
-218.205 257.720 l
-227.273 283.450 l
-236.340 308.160 l
-245.408 331.100 l
-254.475 351.539 l
-263.543 368.804 l
-272.610 382.309 l
-281.678 391.584 l
-290.745 396.306 l
-299.812 396.306 l
-308.880 391.584 l
-317.948 382.309 l
-327.015 368.804 l
-336.083 351.539 l
-345.150 331.100 l
-354.218 308.160 l
-363.285 283.450 l
-372.353 257.720 l
-381.420 231.707 l
-390.488 206.100 l
-399.555 181.511 l
-408.623 158.456 l
-417.690 137.336 l
-426.758 118.431 l
-435.825 101.897 l
-444.893 87.777 l
-453.960 76.012 l
-463.028 66.464 l
-472.095 58.937 l
-481.163 53.206 l
-490.230 49.043 l
-499.298 46.237 l
-508.365 44.625 l
-517.433 44.100 l
-stroke
-grestore
-% draw_lines
-0 setlinecap
-[6 6] 0 setdash
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 44.100 m
-82.192 58.500 l
-91.260 72.900 l
-100.328 87.300 l
-109.395 101.700 l
-118.463 116.100 l
-127.530 130.500 l
-136.597 144.900 l
-145.665 159.300 l
-154.733 173.700 l
-163.800 188.100 l
-172.868 202.500 l
-181.935 216.900 l
-191.002 231.300 l
-200.070 245.700 l
-209.138 260.100 l
-218.205 274.500 l
-227.273 288.900 l
-236.340 303.300 l
-245.408 317.700 l
-254.475 332.100 l
-263.543 346.500 l
-272.610 360.900 l
-281.678 375.300 l
-290.745 389.700 l
-299.812 389.700 l
-308.880 375.300 l
-317.948 360.900 l
-327.015 346.500 l
-336.083 332.100 l
-345.150 317.700 l
-354.218 303.300 l
-363.285 288.900 l
-372.353 274.500 l
-381.420 260.100 l
-390.488 245.700 l
-399.555 231.300 l
-408.623 216.900 l
-417.690 202.500 l
-426.758 188.100 l
-435.825 173.700 l
-444.893 159.300 l
-453.960 144.900 l
-463.028 130.500 l
-472.095 116.100 l
-481.163 101.700 l
-490.230 87.300 l
-499.298 72.900 l
-508.365 58.500 l
-517.433 44.100 l
-stroke
-grestore
-% draw_lines
-[3 5 1 5] 0 setdash
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 44.100 m
-82.192 45.548 l
-91.260 49.869 l
-100.328 56.992 l
-109.395 66.799 l
-118.463 79.131 l
-127.530 93.783 l
-136.597 110.516 l
-145.665 129.056 l
-154.733 149.096 l
-163.800 170.309 l
-172.868 192.347 l
-181.935 214.846 l
-191.002 237.438 l
-200.070 259.753 l
-209.138 281.422 l
-218.205 302.092 l
-227.273 321.421 l
-236.340 339.094 l
-245.408 354.819 l
-254.475 368.339 l
-263.543 379.431 l
-272.610 387.913 l
-281.678 393.647 l
-290.745 396.538 l
-299.812 396.538 l
-308.880 393.647 l
-317.948 387.913 l
-327.015 379.431 l
-336.083 368.339 l
-345.150 354.819 l
-354.218 339.094 l
-363.285 321.421 l
-372.353 302.092 l
-381.420 281.422 l
-390.488 259.753 l
-399.555 237.438 l
-408.623 214.846 l
-417.690 192.347 l
-426.758 170.309 l
-435.825 149.096 l
-444.893 129.056 l
-453.960 110.516 l
-463.028 93.783 l
-472.095 79.131 l
-481.163 66.799 l
-490.230 56.992 l
-499.298 49.869 l
-508.365 45.548 l
-517.433 44.100 l
-stroke
-grestore
-% draw_lines
-[1 3] 0 setdash
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 72.324 m
-82.192 73.656 l
-91.260 77.632 l
-100.328 84.185 l
-109.395 93.207 l
-118.463 104.552 l
-127.530 118.033 l
-136.597 133.427 l
-145.665 150.483 l
-154.733 168.921 l
-163.800 188.437 l
-172.868 208.711 l
-181.935 229.410 l
-191.002 250.195 l
-200.070 270.724 l
-209.138 290.661 l
-218.205 309.676 l
-227.273 327.460 l
-236.340 343.718 l
-245.408 358.186 l
-254.475 370.624 l
-263.543 380.828 l
-272.610 388.632 l
-281.678 393.907 l
-290.745 396.567 l
-299.812 396.567 l
-308.880 393.907 l
-317.948 388.632 l
-327.015 380.828 l
-336.083 370.624 l
-345.150 358.186 l
-354.218 343.718 l
-363.285 327.460 l
-372.353 309.676 l
-381.420 290.661 l
-390.488 270.724 l
-399.555 250.195 l
-408.623 229.410 l
-417.690 208.711 l
-426.758 188.437 l
-435.825 168.921 l
-444.893 150.483 l
-453.960 133.427 l
-463.028 118.033 l
-472.095 104.552 l
-481.163 93.207 l
-490.230 84.185 l
-499.298 77.632 l
-508.365 73.656 l
-517.433 72.324 l
-stroke
-grestore
-% text
-/Verdana findfont
-18.000 scalefont
-setfont
-144.812 403.956 m
-0 4 rmoveto
-(Smoothing window in time-domain) show
-% text
-/Verdana findfont
-14.000 scalefont
-setfont
-69.469 30.1 m
-(0) show
-% line
-0.500 setlinewidth
-[] 0 setdash
-163.800 44.100 m 163.800 48.100 l
-stroke
-% line
-163.800 392.900 m 163.800 396.900 l
-stroke
-% text
-155.769 30.1 m
-(10) show
-% line
-254.475 44.100 m 254.475 48.100 l
-stroke
-% line
-254.475 392.900 m 254.475 396.900 l
-stroke
-% text
-246.444 30.1 m
-(20) show
-% line
-345.150 44.100 m 345.150 48.100 l
-stroke
-% line
-345.150 392.900 m 345.150 396.900 l
-stroke
-% text
-337.619 30.1 m
-(30) show
-% line
-435.825 44.100 m 435.825 48.100 l
-stroke
-% line
-435.825 392.900 m 435.825 396.900 l
-stroke
-% text
-427.731 30.1 m
-(40) show
-% text
-518.844 30.1 m
-(50) show
-% text
-296.656 17.1 m
-(n) show
-% text
-47.812 39.1 m
-(0.0) show
-% line
-73.125 114.660 m 77.125 114.660 l
-stroke
-% line
-522.500 114.660 m 526.500 114.660 l
-stroke
-% text
-47.875 109.66 m
-(0.2) show
-% line
-73.125 185.220 m 77.125 185.220 l
-stroke
-% line
-522.500 185.220 m 526.500 185.220 l
-stroke
-% text
-47.125 180.22 m
-(0.4) show
-% line
-73.125 255.780 m 77.125 255.780 l
-stroke
-% line
-522.500 255.780 m 526.500 255.780 l
-stroke
-% text
-47.812 250.78 m
-(0.6) show
-% line
-73.125 326.340 m 77.125 326.340 l
-stroke
-% line
-522.500 326.340 m 526.500 326.340 l
-stroke
-% text
-47.797 321.34 m
-(0.8) show
-% text
-48.062 391.9 m
-(1.0) show
-% polygon
-1.000 setlinewidth
-2 setlinecap
-214.291 51.156 m
-214.291 161.736 l
-385.334 161.736 l
-385.334 51.156 l
-closepath
-gsave
-1.000 setgray
-fill
-grestore
-stroke
-% draw_lines
-230.344 143.521 m
-237.901 143.521 l
-245.457 143.521 l
-253.013 143.521 l
-stroke
-% draw_lines
-0 setlinecap
-[6 6] 0 setdash
-230.344 121.605 m
-237.901 121.605 l
-245.457 121.605 l
-253.013 121.605 l
-stroke
-% draw_lines
-[3 5 1 5] 0 setdash
-230.344 97.688 m
-237.901 97.688 l
-245.457 97.688 l
-253.013 97.688 l
-stroke
-% draw_lines
-[1 3] 0 setdash
-230.344 71.371 m
-237.901 71.371 l
-245.457 71.371 l
-253.013 71.371 l
-stroke
-% text
-/Verdana findfont
-24.000 scalefont
-setfont
-262.081 134.521 m
-(Blackman) show
-% text
-262.081 112.605 m
-(Bartlett) show
-% text
-262.081 86.688 m
-0 5 rmoveto
-(Hanning) show
-% text
-262.081 60.371 m
-0 5 rmoveto
-(Hamming) show
-
-end
-showpage
diff --git a/doc/numpybook/Figures/fig2.eps b/doc/numpybook/Figures/fig2.eps
deleted file mode 100644
index 20797dc71..000000000
--- a/doc/numpybook/Figures/fig2.eps
+++ /dev/null
@@ -1,4921 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Title: fig2.eps
-%%Creator: matplotlib version 0.85.1.cvs, http://matplotlib.sourceforge.net/
-%%CreationDate: Fri Jan 6 00:11:32 2006
-%%BoundingBox: 13 175 598 616
-%%EndComments
-%%BeginProlog
-/mpldict 7 dict def
-mpldict begin
-/m { moveto } bind def
-/l { lineto } bind def
-/r { rlineto } bind def
-/box {
-m
-1 index 0 r
-0 exch r
-neg 0 r
-closepath
-} bind def
-/clipbox {
-box
-clip
-newpath
-} bind def
-/ellipse {
-newpath
-matrix currentmatrix 7 1 roll
-translate
-scale
-0 0 1 5 3 roll arc
-setmatrix
-closepath
-} bind def
-%%BeginFont: Verdana
-%!PS-TrueType-1.0-1.0
-8 dict begin
-/FontName /Verdana def
-/FontMatrix [1 0 0 1 0 0] def
-/FontType 42 def
-/Encoding StandardEncoding def
-/FontBBox [-102 -423 2963 2049] def
-/PaintType 0 def
-/FontInfo 7 dict dup begin
-/Notice (Typeface and data © 1996 Microsoft Corporation. All Rights Reserved) def
-/FamilyName (Verdana) def
-/FullName (Verdana) def
-/version (Version 2.35) def
-/isFixedPitch false def
-/UnderlinePosition -180 def
-/UnderlineThickness 120 def
-end readonly def
-/sfnts [
-<00010000001301000004003044534947CD5006A400020D64000014144C5453485694D82F
-00001530000003814F532F32477590C3000001B80000005656444D5874F17C6D000018B4
-000005E0636D6170E84D8B8B000007A80000068C637674204CA740E3000022AC00000198
-6670676DEE371553000021740000013867617370001700090000021000000010676C7966
-01F195F700009EC000013BB668646D7809490ECD0000323800006C8868656164C748722C
-0000013C0000003668686561133B09D00000017400000024686D7478C905723E00002444
-00000DF46B65726E75BF7E53000200CC00000C966C6F63616784B57700000E34000006FC
-6D617870086A023E00000198000000206E616D65A93B95720000022000000587706F7374
-C58F55450001DA7800002651707265701240C02F00001E94000002E00001000000010000
-16FBFC3A5F0F3CF5001B080000000000AA7E442900000000B26DE2ABFF9AFE590B930801
-00000009000200000000000000010000080BFE5200000C2CFF9AFBD40B93000100000000
-00000000000000000000037D00010000037D00620007006B000500020010002F00380000
-0495013F0003000100010411019000050000059A053300000125059A0533000003A00078
-02A70800020B0604030504040204000002870000000000000000000000004D5320200040
-0020FB02061EFE5900CA080B01AE2000019F000000000000000000030008000200100001
-FFFF00030000002801E60001000000000000004300000001000000000001000700430001
-0000000000020007004A0001000000000003002F00510001000000000004000700800001
-000000000005000C00870001000000000006000700930001000000000007002F009A0003
-000104030002000C00C90003000104050002001000D50003000104060002000C00E50003
-000104070002001000F10003000104080002001001010003000104090000008601110003
-000104090001000E01970003000104090002000E01A50003000104090003005E01B30003
-000104090004000E021100030001040900050018021F0003000104090006000E02370003
-000104090007005E024500030001040A0002000C02A300030001040B0002001002AF0003
-0001040C0002000C02BF00030001040E0002000C02CB0003000104100002000E02D70003
-000104130002001202E50003000104140002000C02F70003000104150002001003030003
-000104160002000C03130003000104190002000E031F00030001041B00020010032D0003
-0001041D0002000C033D00030001041F0002000C03490003000104240002000E03550003
-0001042D0002000E036300030001080A0002000C03710003000108160002000C037D0003
-00010C0A0002000C0389000300010C0C0002000C0395547970656661636520616E642064
-61746120A92031393936204D6963726F736F667420436F72706F726174696F6E2E20416C
-6C2052696768747320526573657276656456657264616E61526567756C61724D6963726F
-736F66743A56657264616E6120526567756C61723A56657273696F6E203120284D696372
-6F736F66742956657264616E6156657273696F6E20322E333556657264616E6156657264
-616E6120697320612074726164656D61726B206F66204D6963726F736F667420436F7270
-6F726174696F6E004E006F0072006D0061006C006F00620079010D0065006A006E00E900
-6E006F0072006D0061006C005300740061006E0064006100720064039A03B103BD03BF03
-BD03B903BA03AC0054007900700065006600610063006500200061006E00640020006400
-6100740061002000A9002000310039003900360020004D006900630072006F0073006F00
-66007400200043006F00720070006F0072006100740069006F006E002E00200041006C00
-6C0020005200690067006800740073002000520065007300650072007600650064005600
-65007200640061006E00610052006500670075006C00610072004D006900630072006F00
-73006F00660074003A00560065007200640061006E006100200052006500670075006C00
-610072003A00560065007200730069006F006E0020003100200028004D00690063007200
-6F0073006F00660074002900560065007200640061006E00610056006500720073006900
-6F006E00200032002E0033003500560065007200640061006E0061005600650072006400
-61006E006100200069007300200061002000740072006100640065006D00610072006B00
-20006F00660020004D006900630072006F0073006F0066007400200043006F0072007000
-6F0072006100740069006F006E004E006F0072006D0061006C004E006F0072006D006100
-61006C0069004E006F0072006D0061006C004E006F0072006D00E1006C004E006F007200
-6D0061006C0065005300740061006E00640061006100720064004E006F0072006D006100
-6C004E006F0072006D0061006C006E0079004E006F0072006D0061006C041E0431044B04
-47043D044B0439004E006F0072006D00E1006C006E0065004E006F0072006D0061006C00
-4E006F0072006D0061006C004E0061007600610064006E006F0041007200720075006E00
-740061004E006F0072006D0061006C004E006F0072006D0061006C004E006F0072006D00
-61006C004E006F0072006D0061006C00000000020001000000000014000300010000011A
-000001060000010000000000000001020000000200000000000000000000000000000001
-0000030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324
-25262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60610062636465666768696A6B
-6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F
-909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAAB03ACADAEAFB0B1B2
-B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD000D1D2D3D4D5
-D6D7D8D9DADBDCDDDEDF0004057200000084008000060004007E017F019201A101B001FF
-02C702C902DD0301030303090323037E038A038C03A103CE040C044F045C045F04911E85
-1EF92015201E2022202620302033203A203C203E2044207F20A420A720AC210521132116
-21222126212E215E22022206220F22122215221A221E222B22482260226525A125AB25CA
-25CF25E6F002F00DFB02FFFF0000002000A0019201A001AF01FA02C602C902D803000303
-03090323037E0384038C038E03A30401040E0451045E04901E801EA02013201720202026
-203020322039203C203E2044207F20A320A720AB21052113211621222126212E215B2202
-2206220F221122152219221E222B22482260226425A125AA25CA25CF25E6F001F004FB01
-FFFFFFE30000FF1400A60099FF8A0000FE0F0000FF4C0078FF41FF28FCA00000FE170000
-0000FDD9FDD8FDD7FDD6FDA6E30B0000000000000000E085E095E109E084E0F9E156E077
-E0B70000E0900000E038E02BE123DF6ADF79E068E03CDE96DEA2DE8B0000DEA60000DE74
-DE71DE5FDE2FDE30DB9EDB96DAEEDB73DB5D10BE000005BE000100000082000000000000
-000002380000023800000000000000000000023800000242026800000000000000000000
-000002B203640368037600000000000000000000000000000000036A0000036A00000000
-000000000000000000000000000000000358000003580000000000000000000000000000
-0000000000000000034400000000000300A300840085037C009600E60086008E008B009D
-00A900A40010008A01000083009300F000F1008D00970088010100DC00EF009E00AA00F3
-00F200F400A200AC00C800C600AD006200630090006400CA006500C700C900CE00CB00CC
-00CD00E7006600D100CF00D000AE006700EE009100D400D200D3006800E900EB0089006A
-0069006B006D006C006E00A0006F0071007000720073007500740076007700E80078007A
-0079007B007D007C00B700A1007F007E0080008100EA00EC00B901440145010201030104
-010500FB00FC014601470148014900FD00FE01060107010800FF014A014B014C014D014E
-014F0109010A010B010C0150015100F600F701520153015401550156015701580159015A
-015B015C015D015E015F0160016100F800D50138013901620163016401650166010D010E
-01670168010F01100111011200E000E1011301140169016A01150116013A016B016C016D
-016E016F01700117011800AF00B00119011A01710172011B011C011D011E0173017400F9
-00FA00E200E3011F01200121012201750176017701780179017A017B017C012301240125
-0126017D017E017F01800181018200BA012701280129012A00E400E5018300D600DF00D9
-00DA00DB00DE00D700DD019D019E019F018A01A001A101A201A401A501A601A701A8012B
-01A901AA01AB01AC012C01AD01AE01AF01B001B101B201B301B401B501B601B701B8012D
-01B901BA01BB01BC01BD01BE01BF01C001C101C2012E01C301C4012F013001C501C601C7
-01C801C901CA01CB01CC01CD01CE023A01CF01D00131013201D1013301D201D301D401D5
-01D601D701D801D9025D025E025F0260026102620263026402650266026702680269026A
-026B026C026D026E026F0270027102720273027402750276027702780279027A027B027C
-027D027E027F028002810282028302840285028602870288034C034D034E034F03500351
-03520353035403550356035703580359035A035B035C035D035E035F0360036103620363
-036403650366036703680369036A036B036C036D036E036F037003710191019203740375
-037603770378037900B100B20238013400B500B600C3019300B300B400C4008200C10087
-00F50195037A00BC009900ED00C200A5019B019C023B023C023D023E023F024002410242
-0000001F001F001F001F00470070010401C0025F033C035503A203F10461049604C004DE
-04F50520057F05B9063806DB072D07A70830086B090B099309B509F10A350A640AAA0B13
-0BF80C600CDC0D4F0DA00DD60E060E7A0EAE0EDB0F180F860FA61000104C10B8111711AE
-122012B812DF132C13881407148814DF15221544156F159015C815DE15FE168916E71747
-17A01803184F18D11912193D198C19E51A001A761AB61B011B5D1BB81BF51C8B1CDB1D1B
-1D741DD91E641EC21F041F631F7E1FDC203B205520FE21AA21BD21D021E9220222142226
-2238225322652278230A231C232E234023562369237C23B423EE2400241224242436244C
-245E24702482249424AB24E62520259A260826EB270B274327C928832929297B299C29C2
-2A2D2A912B412BCD2C0D2C5A2CA82D0C2D4C2DCB2E3D2E722E9F2EE92F5E2F9F301130E7
-316D31D831FF3223326032DF336433A233F33443346D3480349334A6350E35AD35C735DD
-361C365B368036A736E33728373F37593777382D3858388438E139313986399E39C43A03
-3AD73AEA3AFD3B103B243B373B4A3B5D3B773B8A3B9D3BB03BC33BD63BE93BFC3C173C47
-3C8E3CA63CEC3D003D493D7D3DB53DEA3E1B3E5B3E923EA53EB73ECA3EDC3F043F6B3FFF
-40124024408840E441014135416941BB4239425A427E42AA42F643024314432743F044AF
-44C244D444E744F9456F4586459E45B145C3465F47144727479D47A54806489348A648B8
-48CB48F0492B4961499249BC49CF49E149F44A064A1A4A2D4A404A534A664A794A8C4A9E
-4AEE4B6C4B7F4BEC4C354C484C5C4C6F4C824C954CA84CBA4CDA4D584DDD4E3C4EC24F58
-4FB24FE1505D5081509D50E951DF51EF52085268528B52CA538353FD5425543F54665491
-54EA54FC550D551F55345546555B556D557E559055A455B655C755D955EE5600561556B8
-575B576D578757DE583458A458FC593F596C59C05A035A595AB15AC85B225B335B495BA2
-5BEB5C305C465C5C5CD25D2E5D405D515D635D745D855DEA5DFC5E105E4E5EBA5ECC5EDD
-5EEF5F005F125F235FA2600E6020603260446055608561656246625C626E6285629A62B1
-62C362D562E762F963166332634963606388639E6422648E64AA64D76504653065556589
-65A265DD65F36611662F664F666E668E66B16700670867106752675A6762676A6772677A
-67C367CB67D36812681A6840684868DA68E268EA68F2695D69DC69F66A106A216A376A48
-6A5B6A6F6AFD6B4A6BBD6BFF6C866C8E6D226D7A6DC16DC96E726E7A6ECF6F3B6F7A6FEA
-705A70F370FB7112712371347146715A71C571DD7255725D7265727F7287731C738773DE
-73F3749074C174C97521752975497594759C765676F2773A77AE783B7892789A78A278AA
-78D078D878E078E8795979DE79E67A167A5D7A907ACD7B297B907BE47C5F7CCD7D367D3E
-7DCA7E4C7E6C7EBC7EC47F7D8015804D80B18126817B81D38203820B82308238829A82C9
-82D1836C837483AC83EF8425846784C3852B858085F4865386BD86D38757876887D587DD
-87E587ED87F5888B88F9894F896489EE8A258A4E8A7B8A918B238B488B6C8BBD8C398C73
-8CD88D0C8D8E8D8E8D8E8D8E8D8E8E208E8D8EF48F598F9F8FB58FBD8FC59006904590BD
-9126916491A19209927292C09334938093D1944E94D395479558956C9586959B95B195C7
-95DD95F3960B96219633964996659683969596AA96BC96D196E396F8970A971F973E9759
-976A977B979697AE97C497D597ED97FF98179829983F985598679879989898B198C998DB
-98ED98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF9911
-9922994099549970998999A199B399CB99E499FC9A159A359A4E9A659A769A909AA59ABB
-9ACC9AE29AF99B0B9B1C9B2D9B3E9B549B659B7C9B949BAF9BC79BDD9BEE9C009C119C22
-9C339C4E9C649C759C8B9CA49CB89CCE9CDF9D639D6B9DDB0000037D01011C1C300E0E0B
-0E010A01010E0E010F01010B0B0B0B0B0B0B0B0B0B01010E0E0E0B0C320E101923150E0F
-740A0E2D240E0D0D0D0E322C1D322E1C111C0101010101010D0D0E0D0D1C0D0BB4010EB4
-110B100D0D2A11110B0A100F0A11010E0101323210230E0D1D0D0D0D0D0D0D0E0D0D0D0D
-B4B4B4B40B10101010100B0B0B0B0B010B0B01010B0101010101010E330D010E0E0E0B10
-010101010B0101010E100B300E010B010127270132320D011C0B01010101010E010A1101
-01010101010B010101013223322323747474740D0D0D1D1D1DB401010101010101010101
-0AD732111C110E1001110A0D0D0E01010101010101010E0D743211100E100E0D0101320D
-320D190D10230D230D2DB42D322D010E0B0E0B0D100E2A0E2A32112C112C111D0B1D0B1C
-111C11100D130D2612181110010D010A0A110E01240A121901011901320D100E100E230D
-230D230D0E0D0E0D0E0D0F0B0F0B74B474B474B474B40A010E0E0E2DB40E0B0E0B0D100D
-100E2A32112C111D0B1D0B1D491D182E10110A01320D330E0D10012E102E102E10110A01
-010B01010101012E010101320E1C10160C27B4320E01231C0F740E0A240E300D0F0D1E2C
-111C111474110D120BB40B0B0F0D0B0DB40D0A130A011010010B0C1010B40B100B10230A
-100D3274740A0C0E010E1111320E0E10012311010E0E0E12240F0D0F0D102C11131C2D22
-11111F2D0E0D01100D240A010D0D301210100B011D1010100D0F110A170F270D11320C11
-0C0E0D0A0D0B010E11B4B4010A0E0B0B0A10100A01011001010101010101010101012D10
-282001010101010101010101010101010101010101320D320D320D320D320D320D320D32
-0D320D320D320D320D230D230D230D230D230D230D230D230D74B474B401010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-01010101010101010D100D100D100D100D100D100D102D102D102D102D102D101D0B1D0B
-28202820282028202820110A110A110A110A0D010B00000000000001000101010101000C
-00F808FF00080008FFFE0009000AFFFE000A000AFFFE000B000BFFFE000C000CFFFE000D
-000DFFFD000E000EFFFD000F000FFFFD0010000FFFFD00110011FFFD00120012FFFC0013
-0013FFFC00140015FFFC00150015FFFC00160016FFFC00170017FFFB00180018FFFB0019
-001AFFFB001A001BFFFB001B001BFFFB001C001CFFFA001D001DFFFA001E001EFFFA001F
-0020FFFA00200020FFFA00210021FFF900220022FFF900230023FFF900240025FFF90025
-0026FFF900260026FFF800270027FFF800280028FFF800290029FFF8002A002BFFF8002B
-002BFFF7002C002CFFF7002D002DFFF7002E002EFFF7002F0030FFF700300031FFF60031
-0031FFF600320032FFF600330033FFF600340034FFF600350036FFF500360036FFF50037
-0037FFF500380038FFF500390039FFF5003A003BFFF4003B003CFFF4003C003DFFF4003D
-003DFFF4003E003EFFF4003F003FFFF300400041FFF300410041FFF300420042FFF30043
-0043FFF300440044FFF200450046FFF200460047FFF200470047FFF200480048FFF20049
-0049FFF1004A004AFFF1004B004CFFF1004C004DFFF1004D004DFFF1004E004EFFF0004F
-004FFFF000500051FFF000510052FFF000520052FFEF00530053FFEF00540054FFEF0055
-0055FFEF00560057FFEF00570058FFEE00580058FFEE00590059FFEE005A005AFFEE005B
-005CFFEE005C005DFFEC005D005DFFEC005E005EFFEC005F005FFFEC00600060FFEC0061
-0062FFEB00620062FFEB00630063FFEB00640064FFEB00650065FFEB00660067FFEA0067
-0068FFEA00680068FFEA00690069FFEA006A006AFFEA006B006BFFE9006C006DFFE9006D
-006DFFE9006E006EFFE9006F006FFFE900700070FFE800710072FFE800720072FFE80073
-0073FFE800740074FFE800750075FFE700760076FFE700770078FFE700780078FFE70079
-0079FFE7007A007AFFE6007B007BFFE6007C007DFFE6007D007DFFE6007E007EFFE6007F
-007FFFE500800080FFE500810082FFE500820083FFE500830083FFE500840084FFE40085
-0085FFE400860086FFE400870088FFE400880088FFE400890089FFE3008A008AFFE3008B
-008BFFE3008C008DFFE3008D008EFFE3008E008EFFE2008F008FFFE200900090FFE20091
-0091FFE200920093FFE200930093FFE100940094FFE100950095FFE100960096FFE10097
-0098FFE100980099FFE000990099FFE0009A009BFFE0009B009BFFE0009C009CFFE0009D
-009EFFDF009E009EFFDF009F00A0FFDF00A000A0FFDF00A100A1FFDF00A200A3FFDE00A3
-00A4FFDE00A400A4FFDE00A500A6FFDE00A600A6FFDE00A700A7FFDD00A800A9FFDD00A9
-00A9FFDD00AA00ABFFDD00AB00ABFFDD00AC00ACFFDC00AD00AEFFDC00AE00AFFFDC00AF
-00B0FFDC00B000B0FFDC00B100B1FFDB00B200B2FFDB00B300B4FFDB00B400B5FFDB00B5
-00B6FFDB00B600B6FFDA00B700B7FFDA00B800B9FFDA00B900BAFFDA00BA00BBFFDA00BB
-00BBFFD900BC00BCFFD900BD00BDFFD900BE00BFFFD900BF00C0FFD900C000C1FFD800C1
-00C1FFD800C200C2FFD800C300C4FFD800C400C5FFD800C500C5FFD700C600C6FFD700C7
-00C7FFD700C800C8FFD700C900CAFFD700CA00CBFFD600CB00CCFFD600CC00CCFFD600CD
-00CDFFD600CE00CFFFD600CF00D0FFD500D000D0FFD500D100D1FFD500D200D2FFD500D3
-00D3FFD500D400D5FFD400D500D5FFD400D600D7FFD400D700D7FFD400D800D8FFD400D9
-00DAFFD300DA00DBFFD300DB00DCFFD300DC00DCFFD300DD00DDFFD300DE00DEFFD200DF
-00E0FFD200E000E0FFD200E100E2FFD200E200E2FFD200E300E3FFD100E400E5FFD100E5
-00E6FFD100E600E7FFD100E700E7FFD100E800E8FFD000E900E9FFD000EA00EBFFD000EB
-00EBFFD000EC00ECFFD000ED00EDFFCF00EE00EEFFCF00EF00F0FFCF00F000F1FFCF00F1
-00F2FFCF00F200F2FFCE00F300F3FFCE00F400F4FFCE00F500F6FFCE00F600F7FFCE00F7
-00F7FFCD00F800F8FFCD00F900F9FFCD00FA00FBFFCD00FB00FCFFCC00FC00FDFFCC00FD
-00FEFFCC00FE00FEFFCC00FF00FFFFCCB8FFC0401EB229323610B220B240B250B270B280
-B2A0B2B0B2D0B2E0B20AC0B2F0B202B8FFC04070B51718361F44010F561F56024F555F55
-026F54019F54AF54025153170452531604535215044A4952044649370447493204484932
-04493539043C3F32043D3F3D043E3F2104433F1D04423F5204413F5204403F52043F3532
-0432336404333534043534540434351E04D034E034F03403B8FFEEB3B4254836B8FFE0B3
-B4102336B8FFEE400DB4090F36B41A480476B386B302B8FFF0B3B3254836B8FFFA40FFB3
-092436B314480489881304706C7078020F9CDF9E02409D161936409C161B364097171936
-4096171B368685131F0F840F850F8E0F8F0F901F841F8E1F8F2F8E808580888F91908590
-8790880F40820910360F721F72024071090C360F6D0120C80120C7013FC6EFC60220C540
-C50200620100621062024061A061020F5B012D1411042C1425042B1439042A1413042914
-15041F141E042120430420143C04C91A45041A1B47041B1A3C041A143204151439041314
-480412141A0411141A0470140140144143360F0E2A1F0006010DC34B1F0CC24B1F0AC04B
-1F09C04B1F05BC4B1F04BD4B1F03B94B1F02BA4B1F01B64B1F00B74B1FC3C22A1FC0BF2A
-1FBD4056BC211FBAB9211FB7B6211FC2C3C40DBFC0C10DBCBDBE0CB9BABB0CB6B7B80C10
-BC80BC0240B980B9020FB63FB64FB67FB6040FB62FB63FB66FB67FB6BFB6CFB6FFB6080A
-0937040C0D02050402030202010002500501B801FF858D8D1DB0964B5258B0801D59B808
-004B5458B001B0018E59B0084B5358B001B0018E59002B2B2B2B2B737473732B2B2B2B2B
-2B2B2B2B2B2B2B2B2B2B2B2B2B2B2BB00345B006456861B006234473B00345B00E456861
-B00E2344B00E45B00F456861B00F23442B01B0144568B01423442B732B2B2B2B2B2B2B2B
-2B2B2B2B2B2B2B2B7373737373737373732B732B732B2B2B2B2B73732B2B2B2B732B2B2B
-2B00752B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B73747373742B73742B400C3736
-26251F13120D0C0504022C20B003254523452361688A204568208A234460442D2C4B5258
-45441B2121592D2C202045684420B001602045B0467668188A4560442D2CB0122BB00225
-45B00225456AB0408B60B0022523442121212D2CB0132BB0022545B00225456AB8FFC08C
-60B0022523442121212D2CB100032545685458B0032545B0032545606820B004252344B0
-042523441BB00325204568208A2344B00325456860B003252344592D2CB0032520456820
-8A2344B00325456860B0032523442D2C4B525845441B2121592D2C462346608A8A462320
-468A608A61B8FF8062232010238AB14B4B8A70456020B0005058B00161B8FFBA8B1BB046
-8C59B0106068013A2D2C2045B003254652583F1B2111592D2C4B53234B515A5820458A60
-441B2121592D2C4B53234B515A58381B2121592D061E061405F005D1047C045D03DD0010
-0000FFE7FFE1FE78FE64FE590394001FFFFF009600AA00B900C600CEFFFFFFFFFFFFFFFF
-00BC00C2FFFFFFFF007600B200C000CBFFFFFFFFFFFFFFFFFFFFFFFF0081009400A600CC
-00DA00EFFFFFFFFFFFFFFFFF0098009E00AB00B0FFFFFFFFFFFFFFFFFFFFFFFF00900098
-009E00A400A900AE00B300BA00C3FFFF00880091009800A500ACFFFFFFFFFFFFFFFFFFFF
-006F0087008F009B00A000D3011DFFFFFFFFFFFF00C3021401C2FFFFFFFF00E9000C02D1
-0173018E001A002C0044005C0073007E008600B200C8014C001A003D00440050005C0072
-0078009200B200B900C8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF003D0056005D006A
-006E00B100B900C1FFFFFFFF002A003D00540064006A00B100B9FFFFFFFFFFFF0071007A
-008900A100A700BB006F007A00870091009AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-008102210221007400E500B900CA019502C600AC00A700850614000A000005D1001F0000
-045D001F00000000FFE10000FE64FFF50000036202F402A2029100AF026A004C08000100
-0000000002D0000002D000000326012303AC00A8068C00C30516009B089C009505D00073
-022600A403A200B503A20093051600A7068C00D202E9009303A2009902E900FD03A2FFE2
-0516008905160116051600A1051600A70516004D051600BB051600890516009A0516007A
-0516007103A2015A03A200E6068C00FE068C00F5068C010C045D00A0080000B00578001A
-057C00C805960073062A00C8050F00C8049900C806340073060300C8035E008903A3002C
-058B00CD047400C806BE00C805FC00C8064C007304D300C8064C0073059000C805780086
-04EE000005DB00B20578001A07E9005C057B004404EC0006057B007E03A200EF03A20046
-03A200AB068C00BA0516FFFC0516015404CE006804FC00B9042B006904FC006C04C4006A
-02D0004404FC006C051000B9023200AF02C1FFC204BC00C1023200BB07C800B9051000B9
-04DB006A04FC00B904FC006C036A00B9042B006E0327003E051000B104BC003D068C0056
-04BC003C04BC003D0434005D051400AD03A2017A051400BB068C00BB0578001A0578001A
-05960073050F00C805FC00C8064C007005DB00B204CE006804CE006804CE006804CE0068
-04CE006804CE0068042B006904C4006A04C4006A04C4006A04C4006A023200A00232FFEB
-0232FFF502320005051000B904DB006A04DB006A04DB006A04DB006A04DB006A051000B1
-051000B1051000B1051000B1051600BB0456009A0516009F05160089051600AC045D00B9
-0516008904F600B90800009F0800009F07D000AA0516021D0516015A068C00F507E0000E
-064C0073080000A1068C00D7068C00FE068C010C0516006C052200BE0516009505D100BB
-068C009005A900710516008A045D0097045D0079068C006B07A4006804DB005D045D0071
-03260123068C00D2068C00860516FFDC068C00F305D10032052800A6052800AE068C00B2
-0578001A0578001A064C0073088F007807DA006A051600990800009903ACFFED03AC0096
-0226FFED022600A0068C00D2068C00AC04BC003D04EC000602E4FF9A0516000003A200BA
-03A200C20500004405020044051600BB02E900FD0226FFF603ACFFF60C2C00950578001A
-050F00C80578001A050F00C8050F00C8035E0089035E005D035E007E035E0089064C0073
-064C0073064C007305DB00B205DB00B205DB00B2023200BB05160136051600ED05160118
-05160113051602210516012D05160161051601560516019F05160132047E001802460018
-05780086042B006E057B007E0434005D03A2017A0634000E04E5006A04EC000604BC003D
-04D800C804FC00B9068C00DC068C012304560123045600CF045600CF080000AB080000AB
-0800008C0516003C0634007304FC006C035E008905780086042B006E05960073042B0069
-05960073042B006904FC006C0516FFFC02E900FD0578001A04CE00680578001A04CE0068
-062A00C8052E006C0634000E050F00C804C4006A050F00C804C4006A047400C8023200AB
-047400C8025E00BB047400C803AB00BB05FC00C8051000B905FC00C8051000B9064C0073
-04DB006A059000C8036A00B9059000C8036A009205780086042B006E04EE00000327003E
-04EE00000327003E05DB00B2051000B105DB00B2051000B1057B007E0434005D057B007E
-0434005D048800C8064C0073068D006904FC006C04DD006A041A006D050B006A03F8000A
-065200680516FFFC04FF0123045D009A094F00C806F7008904E900AF05D8000002E400D5
-047500D5089C00950296000F04D5009202D6008302D6008304D500B102D600700578001A
-04CE006805960073042B006905960073042B0069050F00C804C4006A050F00C804C4006A
-050F00C804C4006A0634007304FC006C0634007304FC006C0634007304FC006C060300C8
-051000B90603002005100013035E002C0232FFF2035E005F0232FFFC035E008002320001
-035E00890232008E03A3002C02C1FFC2058B00CD04BC00C104BC00C1047400C802320005
-05FC00C8051000B905FC00C8051000B9064C007304DB006A064C007304DB006A059000C8
-036A001B05780086042B006E04EE00000327003E05DB00B2051000B105DB00B2051000B1
-05DB00B2050B00B105DB00B2050B00B107E9005C068C005604EC000604BC003D026700B9
-0578001A04CE006807E0000E07A40068064C007304DB005D03A2015A07E9005C068C0056
-07E9005C068C005607E9005C068C005604EC000604BC003D0226FFED0516FFD005160089
-05BE00B1080000AB0800008C0800008A0800009901B00061051601610516021205160100
-057800070602000006F6000004510000070C000006070000074300000232FFCB0578001A
-057C00C805A0001A050F00C8057B007E060300C8035E0089058B00CD057C001A06BE00C8
-05FC00C805310072064C0073060300C804D300C80561007604EE000004EC0006057B0044
-06F700B3068C006C035E007E04EC000604FC006C041A006D051000B9023200A0050D00B1
-04F600B904BC003D03A9006C051000B904FE0089023200BB04BC00C104BC003D051E00B9
-04BC003D0406006804DB006A050000B904100069050D00B104B80030069300B006820071
-02320005050D00B104DB006A050D00B106820071050F00C80657FFFF048800C8059B0073
-05780086035E0089035E007E03A3002C08F2001208D300C8068BFFFF058B00CD04EC0006
-060300C80578001A057C00C8057C00C8048800C805F7000A050F00C807C9002004ED0051
-060100C8060100C8058B00CD05E0001206BE00C8060300C8064C0073060300C804D300C8
-0596007304EE000004EC0006068D0069057B0044061700C805B2008E083E00C8085C00C8
-06440000075D00C8057200C8059C0061084600C805A6002C04CE006804EA007404C200B9
-03C500B904F9000904C4006A0662003404320041051F00B9051F00B904BC00C104F7001D
-059200B9051900B904DB006A051900B904FC00B90446006A03F8000A04BC003D06BA006F
-04BC003C052800B904D8008E070200B9071A00B90520000A065B00B9049100B904600053
-06B600B904CC004304C4006A0510001303C500B90460006A042B006E023200AF02320005
-02C1FFC20750001D075000B90510001304BC00C104BC003D051900B9048800C803C500B9
-080000CB096000C8051900B904560119045600EF045600E6045600B3045600E6045600F3
-045600C5000000000000000000000000000000000674007304DB006A060D00B2054700B1
-0000020900000221000001540000021D0516013605160003051601360516012505160142
-051601420516014205160125051602090516013605160142051601420516014205160142
-051601360578001A04CE00680578001A04CE00680578001A04CE00680578001A04CEFFE3
-0578001A04CE00680578001A04CE00680578001A04CE00680578001A04CE00680578001A
-04CE00680578001A04CE00680578001A04CE00680578001A04CE0068050F00C804C4006A
-050F00C804C4006A050F00C804C4006A050F00C804C4006A050F002904C4FFFC050F00C8
-04C4006A050F00C804C4006A050F00C804C4006A035E008902320096035E0089023200AF
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000064C007304DB006A064C0073
-04DB006A064C007304DB006A064C007304DBFFE5064C007304DB006A064C007304DB006A
-064C007304DB006A0674007304DB006A0674007304DB006A0674007304DB006A06740073
-04DB006A0674007304DB006A05DB00B2051000B105DB00B2051000B1060D00B2054700B1
-060D00B2054700B1060D00B2054700B1060D00B2054700B1060D00B2054700B104EC0006
-04BC003D04EC000604BC003D04EC000604BC003D04EC000604BC003D04FC006C000000ED
-0516008A0000001F00000380090E09000303050507070B07030404070703050304070707
-070707070707070404070707060A08070808070608080505070609080907090707070808
-090707070404040706060606060606030606030306030906060606040604060607060605
-060506070808080708090806060606060606060606060303030306060606060606060606
-07050707060507060909090606070A090907070707060607070607050507090606050707
-0707070606070808090A0907090404020207070607030604040606070302040E08070807
-070505050509090908080803060606060606060606060603070607050508060706070607
-070505050909090608060507060806080606060308060806080608070607060603060306
-040806080609060704070407060704070408060806070507050609070606050605090606
-050B09060703050B03050303050308060806080607060706070608060806080608060806
-050305030503050305030706060603080608060906090607040706070408060806080608
-06090707060308060A090906040907090709070706020607060909090902060606080809
-060908090308070607070805070809080709080706070707090905070605060306060505
-060603060606060506060506050907030606060707080608070505050A0A070707070807
-070607070906080807070908090807080707070708070909080907080907060606040606
-070506060606070606060606050609060705090907080606080606060406060303030909
-060606060505090B06050505050505050000000009060806000000000606060606060606
-060606060606060806080608060806080608060806080608060806080608060706070607
-060706070607060706070605030503000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000090609060906
-090609060906090609060906090609060906080608060806080608060806080607060706
-07060706060007000A0F0A000404040508070B0703050507080405040507070707070707
-0707070505080808060A070708080606080805050706090709070908070708070B070707
-0505050806060707050707040707030307030B0707070704060407060707060606050608
-070708060709080707070707070507070707030303030707070707070707070707050707
-060507060A0A0A0606080A090A080808070706070807070505080A070604080807080706
-06080707090B0A070A0505030308080607040605050606070403050F0706070606050505
-050909090808080306060606060606060606060307060706050806070607070808050505
-0A0A0A060807050706080508050706040707070708070806070607060306030605070707
-0709070804080407060704070408070807070607060609090707050705090606050C0906
-0704060B0306040406040707080508050607060706070807080708070807080705030503
-0503050305030707070603070707070907090708040706070408070807080708070B0707
-060307070A0A0907050B070B070B070706030607070A0A0A0A0206060607070906090909
-030707070607080507070907070908070707070709090507070507030707070507070307
-0607060507070507060909030707070906080608070505050B0B08070708070707060706
-0906080807070908090807080707090709070B0B080907080A0707070605060707050707
-0706070707070705050609070706090A0708060608060707050606030303090907070607
-06050A0C0705050505050505000000000907080700000000060606060606060606060606
-060606070707070707070707070707070707070707070707070707060706070607060706
-070607060706070503050300000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000009070907090709070907
-090709070907090709070907090708070807080708070807080708070706070607060706
-070007000B110B000404040509070C080305050709040504050707070707070707070705
-05090909060A080809090706090805050806090809070908080708080B08070805050509
-07070707060707040707030407030B070707070506040707090707060705070908080907
-080908070707070707060707070703030303070707070707070707070706070707060707
-0B0B0B0707090B090B090909070707080908070606090B07060409090709080707090808
-090C0B070B05050303090907070407050507070704030511080708070705050505090909
-08080803070707070707070707070603080608060509070707070709090606060B0B0B07
-090705080609060906070704080708070907090707070706030603060508070807090708
-05080508060704070408070807080608060609090707060705090707060D0A070804060C
-040704040704080709060906070707070707090709070907080708070503050305030503
-05040807070603080708070907090708050806070408070807080708070B090707030807
-0B0B0907050B090B090B090707030707080B0B0B0B02070707080809060A090903080808
-070808050808090807090807070707080909050707060703070707050707030707070706
-07070607070909030707070907090609080505050D0C090808080808080608070B070808
-08080908090807090708090809080B0C090A07090B080707070508070906070707070707
-07070706050709070807090A080907070A0707070507060303040A0B0707070706050B0D
-070606060606060600000000090708070000000007070707070707070707070707070708
-070807080708070807080708070807080708070807080707070707070707070707070707
-070707050305030000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000907090709070907090709070907
-090709070907090709070807080708070807080708070807070707070707070707000700
-0C120C00040405060A080D09030505080904050405080808080808080808080505090909
-070C0808090908070909050508070A090A080A08080709080D0807080505050A08080808
-060808040808030407030B0808080805070508070B0707070805080A08080908090A0908
-08080808080608080808030303030808080808080808080808070808080708070C0C0C08
-08090C0A0C090909080808090A080807070A0B080705090A080A0908080A08080A0D0D08
-0C06060303090A070704080505080808040306120808080808050505050A0A0A09090903
-0808080808080808080807030807080705090707070808090A0707070C0C0C0809080508
-07090609060808040808080809090908080808070307040706090809080A080805080508
-07070507050908090808070807070A0B0808060807090808070E0A070904070D04070404
-070408080906090608080808080809080908090809080908050305030503050305040807
-070703090809080A080A0808050807070509080908090809080D0B07070408080C0B0A08
-050D0B0D0B0D0B0707030808090C0C0C0C0308080808090A060B090B0308080808080905
-08080A09080A0908080707080B0A05070806080308070706080803080708070608080608
-070B0B030808080B080A0709080505050D0D0A0808090808080709080D07090908090A09
-0A09080907080B0809090D0E090B08090C080808070608080B0608080707080808080806
-07070B0709080B0C080907080B0708080608070303040B0B0807070807060C0E08070707
-07070707000000000A080908000000000808080808080808080808080808080808080808
-080808080808080808080808080808080808080808080808080808080808080808080805
-030503000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000A080A080A080A080A080A080A080A080A08
-0A080A080A0809080908090809080908090809080707070707070707080008000D140D00
-050505050A080D09030606090905070506080808080808080808080606090909070D0908
-090908080909050608070B090A080A08090909090D0909090606060B0808080808080805
-0808030407030B0808080805070608080B0708070807080B09090908090A090808080808
-080808080808030303030808080808080808080808070808080708080D0D0D0808090C0A
-0D090909080808090B090807070B0B080705090B080B0908080B09090A0E0D080D060603
-03090B080905080606080808050306140908090808050505050A0A0A0909090308080808
-08080808080807030907090707090809080808090B0707070D0D0D080908050907090809
-080808050908090809080908080808070307040706090809080A08080508050907090609
-060908090809070907070A0B08080708070B0808070F0B080A05070E0408050508050908
-090809080808080808080908090809080908090805030503050305030604080707070309
-0809080A080A0808050907090609080908090809080D0B09080409080C0B0A08060D0B0D
-0B0D0B0908030808090D0D0D0D0308080809090A060B0A0C030908090809090508090B09
-080A0908090909090B0B05090807080308080906080803080808080708080708080B0B03
-0808080B080A0709090505060F0D0B080909090808070A080D080909080A0B090A090809
-09090B090A090D0E0A0C08090D080808080608080B070808080809080808080807080B07
-09080B0C080907080B0808080608070303040C0D0808080807060D0F0807070707070707
-000000000A08090900000000080808080808080808080808080808090809080908090809
-080908090809080908090809080908080808080808080808080808080808080503050300
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000A080A080A080A080A080A080A080A080A080A080A08
-0A0809080908090909090909090909090908090809080908080008000E150E0005050606
-0B090F0A040606090B050705060909090909090909090906060B0B0B080E0A0A0A0B0908
-0B0A05060A080B0A0B080B0A0A090A0A0F0A090A0606060B090908090709080509090305
-08030D0909090906080609080B0908080906090B0A0A0A090A0B0A080808080808070808
-0808030303030909090909090909090909080909090809090E0E0E09090B0E0B0E0B0B0B
-0909090A0B0A0908080B0D0908060B0B090B0A09090B0A0A0B0F0E090E060604040B0B08
-0905090606090909050406150A090A0909050505050B0B0B0A0A0A030909090909090909
-090908030A080A08060B09090808090B0B0808080E0E0E090B09050A080A070A07090905
-0A080A080B090B090809080803080408060A090A090B090A060A060A08090609060A090A
-090A080A08080B0B09090709070B090908100C080A05080F0508050508050A080A070A07
-0908090809080B090B090B090A090A09050305030503050306050A080808030A090A090B
-090B090A060A0809060A090A090A090A090F0B0908040A080E0D0B09060F0B0F0B0F0B09
-080409090A0E0E0E0E030909090A0B0C070C0B0C030A0A0A090A0A050A0A0B0A090B0A08
-0909090A0B0B05090907090309090906090903080809080709090709080B0B030909090B
-090B080A0A050506100F0B0A090B0A0A0A080A090F090B0B0A0A0B0A0B0A080A09090B0A
-0B0A0D0E0B0D0A0A0E0A0809080709080B07090908090A090909090807080B090A080B0C
-090B08080C0808090708080303050D0D0908080908070E10090808080808080800000000
-0B090B0A000000000909090909090909090909090909090A080A080A080A080A080A080A
-080A080A080A080A080A0809080908090809080908090809080908050305030000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000B090B090B090B090B090B090B090B090B090B090B090B090A09
-0A090B0A0B0A0B0A0B0A0B0A0908090809080908090009000F170F00050506070C0A100B
-0407070A0C050705070A0A0A0A0A0A0A0A0A0A07070C0C0C080F0A0A0B0B09090C0B0507
-0A080D0B0C090C0A0A090B0A0F0A090A0707070C0A0A0909080909050909030509030F09
-0A090906080609090D0909090A070A0C0A0A0B090B0C0B09090909090908090909090303
-0303090A0A0A0A0A090909090A080A0A0A080A090F0F0F0A0A0C0F0C0F0C0C0C0A090A0B
-0C0B0A08080C0E0A08060C0C0A0C0B0A0A0C0A0A0C100F0A0F070704040C0C0909050A07
-0709090A050407170A090A0909050505050C0C0C0B0B0B030A0A0A0A0A0A0A0A0A0A0803
-0A080A09070B09090909090C0C0808080F0F0F0A0C09050A080B080B08090A050A090A09
-0B0A0B090909090803080408070B090B090C0A0A060A060A08090609060B090B090A090A
-09090C0D090A080A070B0A0908110D080B0508100509050509050A090B080B0809090909
-09090C090C090C090B090B09050305030503050307050A090908030B090B090C0A0C0A0A
-060A0809060B090B090B090B080F0D0909050A090F0E0C0A070F0D0F0D0F0D0909040A0A
-0B0F0F0F0F030A0A0A0A0B0D070D0B0D030A0A0B090A0B050A0A0D0B0A0C0B090A09090A
-0D0C0509090809030909090709090309090909080A0A0809090B0D03090A090D090C090B
-0A05050711110C0A0A0B0A0A0A090B090F090B0B0A0B0D0B0C0B090B090A0D0A0B0B0F10
-0C0E0A0B100A0909090709090D08090909090A090A09090807090D090A090D0E0A0C0908
-0D0909090708080303050E0E0909090909070F120908080808080808000000000C0A0C0A
-000000000A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A090A090A090A090A090A090A090A090A
-090A090A090A090909090909090909090909090909090905030503000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0B090B090C0A
-0C0A0C0A0C0A0C0A090909090909090909000A0010181000060606070D0A110C0407070A
-0D060706070A0A0A0A0A0A0A0A0A0A07070D0D0D09100B0B0B0C0A090C0C07070B090D0C
-0D0A0D0B0A0A0C0B110B0B0B0707070D0A0A0A0A080A0A060A0A050609050F0A0A0A0A06
-09070A090D0909090A070A0D0B0B0B0A0C0D0C0A0A0A0A0A0A080A0A0A0A050505050A0A
-0A0A0A0A0A0A0A0A0A090A0A0A090A0A1010100A0A0D100D100D0D0D0A0A0A0C0D0B0A09
-090D0F0A09060D0D0A0D0C0A0A0D0B0B0D11100A10070704040D0D090B060A07070A0A0A
-060407180B0A0B0A0A070707070D0D0D0C0C0C050A0A0A0A0A0A0A0A0A0A09030A090B09
-070C0A0B090A0A0D0D0909091010100A0C0A070A090B080B080A0A060B0A0B0A0C0A0C0A
-0A0A0A0905090509070C0A0C0A0D0A0B060B060A090A070A070C0A0C0A0B090B09090D0D
-0A0A090A070D0A0A09130E0B0C060911050A06060A060B0A0B080B080A0A0A0A0A0A0C0A
-0C0A0C0A0C0A0C0A070507050705070507060B090909050C0A0C0A0D0A0D0A0B060A090A
-070C0A0C0A0C0A0C0A110D0B09050B0A100F0D0A07110D110D110D0B09040A0A0B101010
-10030A0A0A0B0C0E090E0C0E050B0B0B0A0B0C070B0B0D0C0A0D0C0A0B0A0B0B0D0D070B
-0A090A050A0A09070A0A0509090A09080A0A080A090D0D050A0A0A0D0A0D090B0A070707
-12120D0B0B0B0B0B0B090C0A110A0C0C0B0C0D0C0D0C0A0B0A0B0D0B0C0B0F100D0E0B0B
-110B0A0A0A080A0A0D090A0A090A0B0A0A0A0A0907090D090A0A0D0E0A0C09090D0A0A0A
-0809090505060F0F0A09090A090810130A09090909090909000000000D0A0D0B00000000
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B
-0A0B0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0705070500000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0C0A0C0A0D0B0D0B0D0B
-0D0B0D0B0B090B090B090B090A000A00111A1100060607080E0B120C0508080B0E060806
-080B0B0B0B0B0B0B0B0B0B08080E0E0E09110C0C0C0D0B0A0D0D08080C090E0D0D0A0D0C
-0C0A0C0C110C0A0C0808080E0B0B0A0B090B0A060B0B05060A05110B0A0B0B0709070B0A
-0E0A0A090B080B0E0C0C0C0B0D0D0C0A0A0A0A0A0A090A0A0A0A050505050B0A0A0A0A0A
-0B0B0B0B0B090B0B0B090B0B1111110B0B0E110D110E0E0E0B0B0B0C0E0C0B09090E100A
-09070E0E0B0E0C0B0B0E0C0C0D12110B11080805050E0E0A0A060B08080B0B0B0605081A
-0C0B0C0B0B080808080D0D0D0C0C0C050B0B0B0B0B0B0B0B0B0B0A050C090C09080D0A0A
-0A0A0B0E0E0909091111110B0D0B080C090C090C090B0B060C0A0C0A0D0B0D0B0A0B0A09
-05090509080D0B0D0B0D0A0C070C070C090A070A070C0B0C0B0C090C090A0D0E0B0A080B
-080D0B0B09140F0A0C060912060A06060A060C0A0C090C090B0A0B0A0B0A0D0B0D0B0D0B
-0D0B0D0B080508050805080508060C0A0A09050D0B0D0B0D0A0D0A0C070C090A070C0B0C
-0B0C0B0C0B110E0A0A050C0A11100D0A08110E110E110E0A0A050B0B0C11111111040B0B
-0B0C0D0F090F0D10050C0C0C0B0C0D080C0C0E0D0B0D0D0A0B0A0A0C0F0E080A0B080B05
-0B0B0A080B0B050A0A0B0A090A0B090B0A0E0E050B0A0B0E0B0D0A0C0C08080813130E0C
-0A0D0C0C0C0A0D0B110A0D0D0C0D0E0D0D0D0A0C0A0A0E0C0D0C12120D100C0C120C0A0A
-0A080B0A0E080B0B0A0B0C0B0A0B0B09080A0D0A0C0A0F0F0B0E0A090E0A0A0B08090905
-050610100B0A0A0B0A0811140B09090909090909000000000D0A0D0B000000000B0B0B0B
-0B0B0B0B0B0B0B0B0B0B0B0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0B
-0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A080508050000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000D0A
-0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0C0B0C0B0D0B0D0B0D0B0D0B0D0B
-0A0A0A0A0A0A0A0A0B000B00121B1200060607080F0B130D0508080B0F070807080B0B0B
-0B0B0B0B0B0B0B08080F0F0F0A120C0C0D0E0B0A0E0E08080C0A0F0D0E0B0E0D0C0B0D0C
-120C0B0C0808080F0B0B0B0B090B0B060B0B05060B05120B0B0B0B0809070B0B0F0B0B09
-0B080B0F0C0C0D0B0D0E0D0B0B0B0B0B0B090B0B0B0B050505050B0B0B0B0B0B0B0B0B0B
-0B0A0B0B0B0A0B0B1212120B0B0F120E120F0F0F0B0C0B0D0F0D0B0A0A0F110B0A070F0F
-0B0F0D0C0C0F0C0C0E13120B12080805050F0F0B0B070B08080B0B0B0705081B0C0B0C0B
-0B080808080E0E0E0D0D0D050B0B0B0B0B0B0B0B0B0B0A050C090C09080E0B0B0B0B0B0F
-0F0A0A0A1212120B0E0B080C090D090D090B0B070C0B0C0B0E0C0E0B0B0B0B0A050A050A
-080D0B0D0B0E0B0D080D080C090B070B070D0B0D0B0C090C090A0E0E0B0B090B090E0B0B
-0A15100B0D070A13060B06060B060C0B0D090D090B0B0B0B0B0B0E0B0E0B0E0B0E0B0E0B
-080508050805080508060C0B0B0A050D0B0D0B0E0B0E0B0D080C090B070D0B0D0B0D0B0D
-0B120F0B0B050C0B12110E0B08120F120F120F0B0B050B0B0D12121212040B0B0B0C0E10
-0A100E10050C0C0D0B0C0E080C0C0F0D0C0E0E0B0C0B0B0C100E080B0B090B050B0B0B08
-0B0B050B0B0B0B090B0B090B0B0F0F050B0B0B0F0B0E0A0D0C08080814140F0C0B0E0C0C
-0C0A0D0B120B0E0E0C0D0F0E0E0E0B0D0B0B0E0C0E0D13130E110C0D130D0B0B0B080B0B
-0E090C0C0B0B0D0B0B0B0B0A090B0F0B0C0B10100C0E0A0A0F0B0B0B080A090505061010
-0B0B0B0B0A0812150B0A0A0A0A0A0A0A000000000E0B0D0B000000000B0B0B0B0B0B0B0B
-0B0B0B0B0B0B0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0B0B0B0B0B
-0B0B0B0B0B0B0B0B0B0B0B08050805000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000000E0B0E0B0E0B
-0E0B0E0B0E0B0E0B0E0B0E0B0E0B0E0B0E0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0B0B0B0B
-0B0B0B0B0B000B00131D130007070709100C140E0509090C10070907090C0C0C0C0C0C0C
-0C0C0C09091010100A130D0D0D0F0C0B0F0E08090D0B100E0F0B0F0D0D0C0E0D130D0C0D
-090909100C0C0B0C0A0C0B070C0C06070B06120C0C0C0C080A070C0B100B0B0A0C090C10
-0D0D0D0C0E0F0E0B0B0B0B0B0B0A0B0B0B0B060606060C0C0C0C0C0C0C0C0C0C0C0A0C0C
-0C0A0C0C1313130C0C10130F131010100C0C0C0E100D0C0A0A10120C0A0710100C100E0C
-0C100D0D0F14130C130909050510100B0C070C09090C0C0C0705091D0D0C0D0C0C080808
-080F0F0F0E0E0E060C0C0C0C0C0C0C0C0C0C0B060D0A0D0A090F0C0C0B0C0C10100A0A0A
-1313130C0F0C080D0A0D0A0D0A0C0C070D0B0D0B0F0C0F0C0B0C0B0B060B060B090E0C0E
-0C0F0C0D080D080D0A0C070C070E0C0E0C0D0A0D0A0B0F100C0C0A0C090F0C0C0A16110C
-0E070B14060B07070B070D0B0D0A0D0A0C0B0C0B0C0B0F0C0F0C0F0C0E0C0E0C08060806
-0806080609070D0B0B0B060E0C0E0C0F0C0F0C0D080D0A0C070E0C0E0C0E0C0E0C13100C
-0B060D0B13120F0C091310131013100C0B050C0C0E13131313040C0C0C0D0E110A110E11
-060D0D0D0C0D0E080D0D100E0C0F0E0B0D0C0C0D110F080C0C0A0C060C0C0B090C0C060B
-0B0C0B0A0C0C0A0C0B100F060C0C0C0F0C0F0B0D0D0808091515100D0C0E0D0D0D0B0E0C
-120C0E0E0D0E100E0F0E0B0D0C0C100D0E0E14140F110D0D140D0B0C0B090C0B0F0A0C0C
-0B0C0D0C0C0C0C0A090B100B0D0C11110C0F0B0A100B0B0C090A0A06060711110C0B0B0C
-0B0913160C0A0A0A0A0A0A0A000000000F0C0E0C000000000C0C0C0C0C0C0C0C0C0C0C0C
-0C0C0C0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0C0B0C0B0C0B0C0B0C
-0B0C0B0C0B0C0B0806080600000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000F0C0F0C0F0C0F0C0F0C
-0F0C0F0C0F0C0F0C0F0C0F0C0F0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0C0B0C0B0C0B0C0B
-0C000C00141E140007070809100D160F0509090D10070907090D0D0D0D0D0D0D0D0D0D09
-091010100B140E0E0E0F0D0C100F08090E0B110F100C100E0E0C0F0E140E0C0E09090910
-0D0D0C0C0A0C0C070C0D06070C06130D0C0C0C090A080D0C100C0C0B0D090D100E0E0E0D
-0F100F0C0C0C0C0C0C0A0C0C0C0C060606060D0C0C0C0C0C0D0D0D0D0D0B0D0D0D0B0D0C
-1414140D0D101310141010100D0D0D0F100E0D0B0B10130C0B0810100D100F0D0D100E0E
-1015140D140909050510100C0C070D09090D0D0D0705091E0E0D0E0D0D08080808101010
-0F0F0F060D0D0D0D0D0D0D0D0D0D0B060E0A0E0B09100C0C0C0C0C10100B0B0B1414140D
-100C080E0A0E0A0E0A0C0D070E0C0E0C0F0D100D0C0D0C0B060B060B090F0D0F0D100C0E
-090E090E0A0C080C080F0D0F0D0E0B0E0B0B10100C0C0A0D0A100D0C0B17110C0F070B16
-060C07070C070E0C0E0A0E0A0D0C0D0C0D0C100C100C100C0F0D0F0D0806080608060806
-09070E0C0C0B060F0D0F0D100C100C0E090E0A0C080F0D0F0D0F0D0F0D14100C0C060E0C
-1313100C091410141014100C0C050D0D0E14141414040D0D0D0E0F110B120F12060E0E0E
-0D0E0F080E0E110F0D100F0C0D0C0C0E1110080C0C0A0D060D0C0C090D0C060C0C0D0C0A
-0C0D0A0D0C1010060D0C0D100D100B0E0E0808091616100E0C0F0E0E0E0B0F0D130C0F0F
-0E0F110F100F0C0E0C0C100E0F0E151510120E0E150E0C0C0C090C0C100A0D0D0C0C0E0D
-0C0D0C0B0A0C110C0D0C12120D100B0B110C0C0D090B0A06060712120D0C0C0D0B091417
-0D0B0B0B0B0B0B0B00000000110C0F0D000000000D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0E
-0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0D0C0D0C0D0C0D0C0D0C0D0C0D
-0C0D0C080608060000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000100C100C100C100C100C100C100C
-110C110C110C110C110C0F0D0F0D0F0D0F0D0F0D0F0D0F0D0C0C0C0C0C0C0C0C0C000D00
-152015000707080A110D170F060A0A0D11080A080A0D0D0D0D0D0D0D0D0D0D0A0A111111
-0B150E0E0F100D0C1010080A0F0C1210110D110F0E0D0F0E150E0D0E0A0A0A110D0D0D0D
-0B0D0D070D0D06070C06140D0D0D0D090B080D0C110C0C0B0D0A0D110E0E0F0D10110F0D
-0D0D0D0D0D0B0D0D0D0D060606060D0D0D0D0D0D0D0D0D0D0D0B0D0D0D0B0D0D1515150D
-0D111411151111110D0D0D0F110F0D0B0B11140D0B0811110D110F0E0E110E0E1116150D
-150A0A060611110C0D080D0A0A0D0D0D08060A200E0D0E0D0D080808081111110F0F0F06
-0D0D0D0D0D0D0D0D0D0D0C060E0B0E0B0A100D0D0C0D0D11110B0B0B1515150D100D080E
-0B0F0B0F0B0D0D080E0D0E0D100E100D0D0D0D0C060C060C0A100D100D110D0F090F090E
-0B0D080D080F0D0F0D0E0B0E0B0C11110D0D0B0D0A110D0D0B18120D0F080C17070D0707
-0D070E0D0F0B0F0B0D0D0D0D0D0D100D100D100D100D100D08060806080608060A070F0C
-0C0C06100D100D110D110D0F090E0B0D080F0D0F0D0F0D0F0D15110D0C060E0D1414110D
-0A1511151115110D0C060D0D0F15151515040D0D0D0E10120B131013060E0E0F0D0E1008
-0F0E12100E11100D0E0D0D0E1211080D0D0B0D060D0D0C0A0D0D060C0C0D0C0B0D0D0B0D
-0C1111060D0D0D110D110C0F0E08080A1717110F0D100E0E0E0C100D140D10100F0F1210
-11100D0F0D0D110E100F161610130E0F160F0D0D0C0A0D0D110B0D0D0C0D0F0D0D0D0D0B
-0A0C120C0E0D12130D110C0B120D0D0D0A0B0B06060713130D0C0C0D0C0A15190D0B0B0B
-0B0B0B0B00000000120D100D000000000D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0E0D0E0D0E
-0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D08
-060806000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000110D110D110D110D110D110D110D120D120D
-120D120D120D0F0D0F0D100D100D100D100D100D0D0C0D0C0D0C0D0C0D000D0016211600
-0808090A120E1810060A0A0E12080A080A0E0E0E0E0E0E0E0E0E0E0A0A1212120C160F0F
-0F110E0D11110A0A0F0C1310110D110F0F0E100F160F0E0F0A0A0A120E0E0D0E0B0E0D08
-0E0E06080D06150E0D0E0E090B090E0D120D0D0C0E0A0E120F0F0F0E1011100D0D0D0D0D
-0D0B0D0D0D0D060606060E0D0D0D0D0D0E0E0E0E0E0C0E0E0E0C0E0E1616150E0E121511
-161212120E0E0E1012100E0C0C12150D0C0912120E12100E0E120F0F1118160E160A0A06
-0612120D0E080E0A0A0E0E0E08060A210F0E0F0E0E0A0A0A0A111111101010060E0E0E0E
-0E0E0E0E0E0E0C060F0B0F0C0A110D0E0D0D0E12120C0C0C1616160E110E0A0F0B0F0B0F
-0B0E0E080F0D0F0D110E110E0D0E0D0C060C070C0A100E100E110D0F090F090F0B0E090E
-09100E100E0F0C0F0C0C11120E0D0B0E0B110E0E0C1A130E10080C18070D08080D080F0D
-0F0B0F0B0E0D0E0D0E0D110E110E110E110E110E0A060A060A060A060A080F0D0D0C0610
-0E100E110D110D0F090F0B0E09100E100E100E100E16120E0D070F0D1515110D0A161216
-1216120E0D060E0E1016161616050E0E0E0F11130C131114060F0F0F0E0F110A0F0F1310
-0E11110D0F0E0E0F13120A0E0E0B0E060E0E0D0A0E0E060D0D0E0D0B0D0E0B0E0D121206
-0E0D0E120E110C0F0F0A0A0A1918120F0E110F0F0F0C100E150E11110F10131111110D0F
-0E0E120F1110171711140F0F17100D0E0D0A0E0D120C0E0E0D0E0F0E0D0E0E0C0B0D130D
-0E0D13140E110D0C120D0D0E0A0C0B06060814140E0D0D0E0C0A161A0E0C0C0C0C0C0C0C
-00000000120D110F000000000E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0F0D0F0D0F0D0F0D0F
-0D0F0D0F0D0F0D0F0D0F0D0F0D0F0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0A060A0600
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000110D110D110D110D110D110D110D120D120D120D120D
-120D100E100E110F110F110F110F110F0E0D0E0D0E0D0E0D0E000E00172317000808090B
-130F1911060A0A0F13080A080A0F0F0F0F0F0F0F0F0F0F0A0A1313130D17101010120F0D
-12110A0A100D1311120E1210100E111017100E100A0A0A130F0F0E0E0C0E0E080E0F0608
-0E06160F0E0E0E0A0C090F0E130E0E0C0F0A0F131010100F1112110E0E0E0E0E0E0C0E0E
-0E0E060606060F0E0E0E0E0E0F0F0F0F0F0C0F0F0F0D0F0E1717160F0F13161217131313
-0F0F0F1113100F0D0D13160E0D0913130F13110F0F1310101219170F170B0B060613130E
-0E080F0A0A0E0E0F08060B23100F100F0F0A0A0A0A121212111111060F0F0F0F0F0F0F0F
-0F0F0D06100C100C0A120E0E0E0E0E13130C0C0C1717170F120E0A100C100C100C0E0F08
-100E100E120F120F0E0F0E0D060D070D0B110F110F120E100A100A100C0E090E09110F11
-0F100C100C0D12130E0E0C0F0B120F0E0D1B140E11080D19070E08080E08100E100C100C
-0F0E0F0E0F0E120E120E120E110F110F0A060A060A060A060A08100E0E0D06110F110F12
-0E120E100A100C0E09110F110F110F110F17130E0E07100E1616120E0A1713171317130E
-0E060F0F1117171717050F0F0F1011140C141115061010100F10110A101013110F12110E
-0F0E0E1014130A0E0E0C0F060F0E0E0B0F0E060E0E0F0E0C0E0E0C0F0E1313060F0E0F13
-0F120D10100A0A0A1A1913100E111010100D110F160E11111011131112110E100E0E1310
-121018181215101018100E0E0E0B0E0E120C0F0F0E0E100F0E0F0E0C0B0E130E0F0E1414
-0F120D0D130E0E0F0B0D0C06060815150F0E0E0F0D0B171B0F0C0C0C0C0C0C0C00000000
-130E1110000000000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F100E100E100E100E100E100E10
-0E100E100E100E100E100E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0A060A060000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000120E120E120E120E120E120E120E130E130E130E130E130E110F
-110F111011101110111011100E0E0E0E0E0E0E0E0E000F00182518000808090B140F1A11
-060B0B0F14090B090B0F0F0F0F0F0F0F0F0F0F0B0B1414140D18101011130F0E13120A0B
-110D1412130E1311100F121018100F100B0B0B140F0F0E0F0D0F0E080F0F06080E06170F
-0F0F0F0A0D090F0E140E0E0D0F0B0F141010110F1213120E0E0E0E0E0E0D0E0E0E0E0606
-06060F0F0F0F0F0F0F0F0F0F0F0D0F0F0F0D0F0F1818170F0F141713181414140F0F0F11
-14110F0D0D14170F0D0914140F14110F0F141010131A180F180B0B060614140E0F090F0B
-0B0F0F0F09060B25100F100F0F0A0A0A0A131313121212060F0F0F0F0F0F0F0F0F0F0D06
-100D100D0B130F0F0E0F0F14140D0D0D1818180F130F0A100D110D110D0F0F09100E100E
-1310130F0E0F0E0D060D070D0B120F120F130F110A110A100D0F090F09120F120F100D10
-0D0E13140F0F0C0F0C130F0F0D1C150F12090D1A080F09090F09100E110D110D0F0E0F0E
-0F0E130F130F130F120F120F0A060A060A060A060B08110E0E0D06120F120F130F130F11
-0A100D0F09120F120F120F120F18140F0E07100E1717130F0B1814181418140F0E060F0F
-1118181818050F0F0F1012150D151216061010110F10120A111014121013120E100F0F10
-15140A0F0F0C0F060F0F0E0B0F0F060E0E0F0E0C0F0F0C0F0E1414060F0F0F140F130E11
-100A0A0B1B1A14110F121010100E120F170F12121112141213120E110F0F141012111919
-1316101119110E0F0E0B0F0E130D0F0F0E0F110F0F0F0F0D0C0E140E0F0F15150F130E0D
-140E0E0F0B0D0D06060816160F0E0E0F0E0B181C0F0D0D0D0D0D0D0D00000000130F1210
-000000000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F100E100E100E100E100E100E100E100E10
-0E100E100E100E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0A060A06000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000130F130F130F130F130F130F130F130F130F130F130F130F120F120F1210
-12101210121012100F0E0F0E0F0E0F0E0F000F001B291B000A0A0B0C16111D14070C0C11
-160A0C0A0C111111111111111111110C0C1616160F1B12131315111015140B0C130F1714
-15101513121114121B1311130C0C0C16111110110E11100A1111070910071A111011110C
-0E0B11101610100E110C1116121213111415141010101010100E10101010070707071110
-1010101011111111110F1111110F11111B1B1A1111161B151B161616111111141613110F
-0F161A100F0B16161116141111161212151D1B111B0C0C0707161610110A110C0C111111
-0A070C2912111211110B0B0B0B15151514141407111111111111111111110F07120E130E
-0C15111110101116160F0F0F1B1B1B1115110B120E130E130E11110A1210121015111511
-1011100F070F080F0C141114111510130C130C120E110B110B14111411130E130E0F1516
-11100E110D1511110F1F1811140A0F1D09100A0A100A1210130E130E1110111011101511
-15111511141114110B070B070B070B070C091310100F071411141115101510130C120E11
-0B14111411141114111B1611100812101B1A15100C1B161B161B161110071111131B1B1B
-1B061111111214180F181419071213131113140B13131714121514101211111318160B11
-110E11071111100C111107101011100E10110E11101616071110111611150F13120B0B0C
-1E1E161311141213130F14111A11141413141714151410131111161315131C1C15191213
-1C131011100D1110160E1111101113111011110E0D1017101110181811150F0F17101011
-0D0F0E0707091919111010110F0D1B20110F0F0F0F0F0F0F000000001610141200000000
-111111111111111111111111111111121012101210121012101210121012101210121012
-101210111011101110111011101110111011100B070B0700000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000015101510151015101510151015101610161016101610161014111411141214121412
-141214121110111011101110110011001D2C1D000A0A0B0D18121F15080D0D12180B0D0B
-0D121212121212121212120D0D181818101D14141416121116160D0D1410181617111714
-141215141D1412140D0D0D18121211120F12110A1212090A11091C121212120C0F0B1211
-1811110F120D1218141414121617151111111111110F1111111109090909121212121212
-1212121212101212121012121D1D1C1212181D171D181818121312151815121010181C12
-100B18181218151313181414171F1C121D0D0D0808181811120A120D0D1212120B080D2C
-14121412120D0D0D0D17171715151509121212121212121212121009140F140F0D161212
-11121218181010101D1D1D1216120D140F140F140F12120B141114111613161211121110
-091009100D161216121712140C140C140F120B120B15121512140F140F10171812120F12
-0E17121210221912150A101F09120A0A120A1411140F140F121112111211161216121612
-161216120D090D090D090D090D0A14111110091612161217121712140C140F120B151215
-12151215121D1812110914111D1C17120D1D181D181D181211081212151D1D1D1D061212
-12141619101A161A091414141214160D14141816131716111412121419180D12120F1209
-1212110D121209111113110F12120F12111818091212121812171014140D0D0D20201814
-12161414141016121C12161614151816171611141212181416151E1E171B14141E141112
-110E1211170F1313111214121212120F0E1118111312191A13171110181111120E100F09
-090A1B1B12111112100E1D22121010101010101000000000171216130000000012121212
-121212121212121212121214111411141114111411141114111411141114111411141112
-1112111211121112111211121112110D090D090000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000001712
-171217121712171217121712171217121712171217121512151216131613161316131613
-121112111211121112001200203120000B0B0D0F1A142217090F0F141A0C0F0C0F141414
-141414141414140F0F1A1A1A112016161619141219180D0F16121B181913191616141716
-201614160F0F0F1A141413141114130B1414090B13091F141314140E110D14131A131311
-140F141A1616161418191713131313131311131313130909090914131313131314141414
-141114141411141420201F14141A1F19201A1A1A141514171A171411111A1F13110D1A1A
-141A1715151A161619221F14200F0F09091A1A13140C140F0F1414140C090F3116141614
-140D0D0D0D19191917171709141414141414141414141209161116110F1914141313141A
-1A1111112020201419140D16111611161114140C16131613191519141314131209120912
-0F181418141913160E160E1611140D140D171417141611161112191A1413101410191414
-11251C14170C12220A130B0B130B16131611161114131413141319141914191418141814
-0D090D090D090D090F0B16131312091814181419131913160E1611140D17141714171417
-14201A14130A16131F1F19130F201A201A201A141309141417202020200714141416181C
-111C181D091616171416180D16161B1815191813161414161C1A0D14141014091414130F
-141409131314131013141014131A1A091413141A14191216160D0D0F24231A1614181616
-161218141F14181816181B181918131614141A1618172121191D161621171314130F1413
-1A111414131416141314141110131B1315131C1C151912121B1313140F121109090B1D1D
-14131314120F20261411111111111111000000001A131815000000001414141414141414
-141414141414141613161316131613161316131613161316131613161316131413141314
-13141314131413141314130D090D09000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000191319131913
-19131913191319131A131A131A131A131A13171417141815181518151815181514131413
-1413141314001400213221000C0C0D0F1B152418090F0F151B0C0F0C0F15151515151515
-1515150F0F1B1B1B12211717171915131A190D0F17121C191A141A171714181721171417
-0F0F0F1B151514151115140C1515090B140920151415150E110D15141B141411150F151B
-17171715191A181414141414141114141414090909091514141414141515151515121515
-1512151421212015151B201A211B1B1B151515181B171512121B2014120D1B1B151B1815
-151B17171A232015210F0F09091B1B14140C150F0F1515150C090F3217151715150D0D0D
-0D1A1A1A18181809151515151515151515151309171117110F1A14141414151B1B121212
-212121151A150D17111711171115150C1714171419151A151415141209120A120F191519
-151A14170E170E1711140D140D1815181517111711131A1B15141115101A151512261D14
-180C12240B140C0C140C1714171117111514151415141A151A151A15191519150D090D09
-0D090D090F0B1714141209191519151A141A14170E1711140D1815181518151815211B14
-140A171420201A140F211B211B211B141409151518212121210715151517191D121D191E
-091717171517190D17171C19151A1914161414171D1B0D14151115091514140F15150914
-1415141114151115131B1B091514151B151A1317170D0D0F25241B171419171717131915
-2014191917181C191A19141714141B17191822221A1E161722171414141015141A111515
-141417151415151210141C1415141D1D151A13121C14141510121109090B1E1E15141415
-131021271512121212121212000000001B14191600000000151515151515151515151515
-151515171417141714171417141714171417141714171417141714151415141514151415
-141514151415140D090D0900000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000001A141A141A141A141A14
-1A141A141B141B141B141B141B1418151815191619161916191619161414141414141414
-15001500253825000D0D0F111E18281B0A1111181E0D110D111818181818181818181811
-111E1E1E142519191A1D17151D1C10111A151F1C1D161D1A19171B19251917191111111E
-181816171317160D17170A0D160A241716171710130F17161E1616131711171E19191A17
-1C1D1B16161616161613161616160A0A0A0A171616161616171717171814181818141817
-25252418181E241D251E1E1E1818181B1E1A1814141E2316140F1E1E181E1B18181E1919
-1D2824182511110A0A1E1E16170D1811111717180D0A11381917191717101010101D1D1D
-1B1B1B0A18181818181818181818150A19131913111D17171616171E1E14141425252518
-1D171019131A131A1317180D191619161D181D17161716150A150B15111C171C171D161A
-101A101913170F170F1B171B1719131913151D1E17171317121D1817142B20171B0D1528
-0C160D0D160D19161A131A131716171617161D171D171D171C171C17100A100A100A100A
-110D1A1616150A1C171C171D161D161A101913170F1B171B171B171B17251E17160B1916
-24231D1611251E251E251E17160A18181B2525252508181818191C2014211C220A19191A
-17191C101A191F1C181D1C1619171719201E10171713170A1717161117170A1616181613
-16171317161E1E0A1716171E171D151A1910101129291E1A171C191919151C1724171C1C
-1A1B1F1C1D1C161A17171E191C1A26271D22191A261A1617161117161E13181816171A18
-1618171412161F1618162021181D15141F1616171114130A0A0D2222171616181511252B
-1814141414141414000000001E161C180000000018181818181818181818181818181819
-161916191619161916191619161916191619161916191617161716171617161716171617
-161716100A100A0000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000001D161D161D161D161D161D161D16
-1E161E161E161E161E161B171B171C181C181C181C181C18171617161716171617001800
-2A402A000F0F1113221B2D1F0B13131B220F130F131B1B1B1B1B1B1B1B1B1B1313222222
-172A1D1D1D201B18212012131D17231F2119211D1D1A1F1D2A1D1A1D131313221B1B191A
-161A190F1A1B0C0E190C291B191A1A1216111B19221919161B131B221D1D1D1B1F211F19
-191919191916191919190C0C0C0C1B19191919191B1B1B1B1B171B1B1B171B1A2A2A291B
-1B222A212A2222221B1B1B1F221E1B1717222819171122221B221F1B1B221D1D212D291B
-2A13130B0B2222191A0F1B13131A1A1B0F0B13401D1B1D1B1B121212122121211F1F1F0C
-1B1B1B1B1B1B1B1B1B1B180C1D161D1613211A1A19191A22221717172A2A2A1B211A121D
-161D161D161A1B0F1D191D19201B211B191B19170C170C17131F1B1F1B21191D121D121D
-161A111A111F1B1F1B1D161D161821221A1A161A15211B1A1731251A1F0F172D0E190F0F
-190F1D191D161D161B191B191B19211A211A211A201B201B120C120C120C120C130E1D19
-19170C1F1B1F1B211921191D121D161A111F1B1F1B1F1B1F1A2A221A190D1D192A282119
-132A222A222A221A190B1B1B1E2A2A2A2A091B1B1B1D2025172520260C1D1D1E1B1D2012
-1D1D231F1B2120191C1A1A1D2522121A1A161B0C1B1A19131B1A0C19191B1915191A151B
-1923220C1B191B221B21181D1D1212132F2E221D1A201D1D1D181F1B291A20201D1F2320
-2120191D1A1A221D201E2B2C21271D1D2B1E191A19141A1922161B1B191A1D1B191B1A16
-151923191B1925251B2118172319191B1417160C0C0E26261B19191B18142A311B171717
-17171717000000002219201C000000001B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1D191D191D
-191D191D191D191D191D191D191D191D191D191B191B191B191B191B191B191B191B1912
-0C120C000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000211921192119211921192119211922192219
-2219221922191F1B1F1B201C201C201C201C201C1A191A191A191A191A001B002E462E00
-10101215261D32210C15151D26111511151D1D1D1D1D1D1D1D1D1D1515262626192E1F20
-20231D1A24231215201A2722241C24201F1C221F2D201C20151515261D1D1C1D181D1B10
-1D1D0C101B0C2D1D1C1D1D1418121D1B261B1B181D151D261F1F201D2224221C1C1C1C1C
-1C181B1B1B1B0C0C0C0C1D1C1C1C1C1C1D1D1D1D1D191D1D1D191D1D2E2E2D1D1D262E24
-2E2626261D1E1D2126211D1919262C1C191226261D26211E1E261F1F24312D1D2E15150C
-0C26261B1C111D15151D1D1D110C15461F1D1F1D1D121212122424242222220C1D1D1D1D
-1D1D1D1D1D1D1A0C1F18201815241C1C1B1C1D26261919192E2E2E1D241D121F18201820
-181D1D111F1C1F1C231E241D1B1D1B1A0C1A0E1A15221D221D241C201420141F181C121C
-12221D221D201820181A24261D1C181D17241D1D1936281C22111A320F1C10101C101F1C
-201820181D1B1D1B1D1B241D241D241D231D231D120C120C120C120C1510201B1B1A0C22
-1D221D241C241C20141F181C12221D221D221D221D2D261C1B0E1F1C2E2C241C152D262D
-262D261C1B0C1D1D212E2E2E2E0A1D1D1D1F23281929232A0C1F20201D20231220202722
-1E24231C1F1C1C202826121C1D181D0C1D1D1B151D1D0C1B1B1D1B171C1D171D1B26250C
-1D1C1D251D241A201F121215333326201C231F20201A221D2D1C23232022272324231C20
-1C1C262023212F30242A1F2030201C1C1B161D1B25181D1D1B1D201D1C1D1D19171B271B
-1E1C28291D251A19271C1B1D1619180C0C102A2A1D1B1B1D1A162E361D19191919191919
-00000000251C231E000000001D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1F1C1F1C1F1C1F1C1F
-1C1F1C1F1C1F1C1F1C1F1C1F1C1F1C1D1B1D1B1D1B1D1B1D1B1D1B1D1B1D1B120C120C00
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000241C241C241C241C241C241C241C251C251C251C251C
-251C221D221D231E231E231E231E231E1C1B1C1B1C1B1C1B1D001D00324C320012121417
-292036240D17172029121712172020202020202020202017172929291B3222222327201D
-27261517231C2A25271E2723221F252231221F221717172920201E1F1A1F1E121F200F11
-1E0F31201E1F1F151A14201E291E1E1A20172029222223202527251E1E1E1E1E1E1A1E1E
-1E1E0F0F0F0F201E1E1E1E1E20202020201B2020201B201F323231202029322732292929
-202020242923201B1B29301E1B1429292029242020292222273531203217170D0D29291E
-1F122017171F1F20120D174C2220222020151515152727272525250F2020202020202020
-20201C0F221A221A17271F1F1E1E1F29291B1B1B32323220271F15221A231A231A1F2012
-221E221E272027201E201E1C0F1C0F1C1725202520271E23152315221A1F141F14252025
-20221A221A1C27291F1E1A201928201F1B3A2C1F25121C36101E12121E12221E231A231A
-201E201E201E271F271F271F26202620150F150F150F150F1711231E1E1C0F2520252027
-1E271E2315221A1F14252025202520252031291F1E0F221E3230271E173129312931291F
-1E0D202024323232320B20202022262C1B2C262D0F2222232022261523222A252027261E
-221F1F222C29151F1F1A200F201F1E17201F0F1E1E201E191E1F19201E29290F201E2029
-20281C2322151517383729231F262222221C2520311F262623252A2627261E231F1F2922
-26243434272E222334231E1F1E181F1E281A20201E1F23201E201F1B191E2A1E201E2C2C
-20281D1B2A1E1E20181B1A0F0F112E2E201E1E201C18323B201B1B1B1B1B1B1B00000000
-281E262100000000202020202020202020202020202020221E221E221E221E221E221E22
-1E221E221E221E221E221E201E201E201E201E201E201E201E201E150F150F0000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000271E271E271E271E271E271E271E281E281E281E281E281E2520
-2520262126212621262126211F1E1F1E1F1E1F1E1F00200036523600131315192C223A27
-0F1919222C141914192222222222222222222219192C2C2C1D362525262A221F2A291719
-251E2E282B212B2625212825352521251919192C222220221C22201322220F13200F3522
-212222171C1522202C20201C2219222C25252622282B282020202020201C202020200F0F
-0F0F22212121212122222222221D2222221D222136363522222C362B362C2C2C22232227
-2C26221D1D2C34211D152C2C222C2723232C25252B3A35223619190F0F2C2C2021142219
-19222222140F19522522252222171717172B2B2B2828280F222222222222222222221E0F
-251C251C192A21212021222C2C1D1D1D363636222A2217251C261C261C22221425202520
-2A232A222022201E0F1E101E19282228222B2126172617251C2115211528222822251C25
-1C1F2B2C22211C221B2B22221D3F2F2127141E3A1121131321132520261C261C22202220
-22202A222A222A2229222922170F170F170F170F19132520201E0F282228222B212B2126
-17251C21152822282228222822352C212010252036342B2119352C352C352C21200F2222
-27363636360B22222225292F1D3029310F2525262225291725252E28232B292124212125
-2F2C1721221C220F2221201922220F202023201B21221B22202C2C0F2221222C222B1F26
-251717193C3C2C2521292525251F28223521292925282E292B29212621212C2529263838
-2A32252638262021201922202B1C2323202226222122221D1B202D2023212F30232B1F1E
-2D202022191E1C0F0F133131222020221F19363F221D1D1D1D1D1D1D000000002C212924
-000000002222222222222222222222222222222520252025202520252025202520252025
-2025202520252022202220222022202220222022202220170F170F000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000002B212B212B212B212B212B212B212C212C212C212C212C21282228222924
-29242924292429242120212021202120220022003A583A001414171B2F253E2A101A1A25
-2F151A151A252525252525252525251A1A2F2F2F203A2828292D25212D2C181A2820312B
-2E232E2828242A28392824281A1A1A2F252523241E24231424250F14220F382523242419
-1E1725222F22221E251A252F282829252B2E2A2323232323231E232323230F0F0F0F2523
-2323232325252525251F2525252025243A3A3925252F392E3A2F2F2F2525252A2F292520
-202F372320172F2F252F2A25252F28282E3E39253A1B1B10102F2F222415251A1A242425
-15101B582825282525181818182E2E2E2A2A2A0F25252525252525252525210F281E281E
-1A2D23242223242F2F1F1F1F3A3A3A252D2418281E291E291E242515282328232D262D25
-232523200F2011201B2B252B252E2328192819281E241724172A252A25281E281E212E30
-24231E251D2E2524204333242A15203E1323151523152823291E291E2523252325232D24
-2D242D242C252C25180F180F180F180F1A14282222200F2B252B252E232E232819281E24
-172A252A252A252A25392F242211282339372E231A392F392F392F24221025252A3A3A3A
-3A0C252525282C321F332C350F28282925282C182828312B262E2C2327242428332F1824
-241E250F2524221B25240F222225221D23241D2522302F0F2523252F252E21292818181A
-41402F28242C282828212B2538242C2C282B312C2E2C2329242430282C293C3D2D352729
-3C292324231B24232E1E2525222428252325241F1D22312225233333252E212031232325
-1B201E0F0F14353525222225211B3A44251F1F1F1F1F1F1F000000002F232C2600000000
-252525252525252525252525252525282328232823282328232823282328232823282328
-23282325232523252325232523252325232523180F180F00000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00002E232E232E232E232E232E232E232F232F232F232F232F232A252A252C262C262C26
-2C262C262422242224222422240025004366430018181A1F372B4831121E1E2B37181E18
-1E2B2B2B2B2B2B2B2B2B2B1E1E37373725432E2E2F342A2734321D1E2E2538323528352F
-2E29312E422E292E1E1E1E372B2B282A232A28182A2A12172812412A292A2A1D231A2A28
-372828232B1E2B372E2E2F2A3235312828282828282328282828121212122A2929292929
-2A2A2A2A2B242B2B2B252B2A4343412B2B374335433737372B2B2B31372F2B2525374029
-251A37372B37312B2B372E2E3548422B431F1F121237372829182B1E1E2A2A2B18121F66
-2E2A2E2A2A1D1D1D1D353535313131122B2B2B2B2B2B2B2B2B2B26122E232E231E342929
-28292A37372424244343432B342A1D2E232F232F232A2B182E282E28342B342A282A2825
-122514251F322A322A35292F1D2F1D2E23291A291A312A312A2E232E232635372A29222A
-21352B2A254E3A29311825481628181828182E282F232F232A282A282A28342A342A342A
-322A322A1D121D121D121D121E172E28282512322A322A352935292F1D2E23291A312A31
-2A312A312A42372928142E28434035291E4237423742372928122B2B30434343430E2B2B
-2B2E323A243B323D122E2E2F2A2E321D2E2E38322B3532282D29292E3A371D292A222A12
-2A2A281F2A2A1228282B2822292A222A283737122A292A372A35262F2E1D1D1E4B4A372E
-29322E2E2E26322A412932322E3138323532282F2929372E33304546343E2E2F452F2829
-28202A2835232B2B282A2F2B292B2A24212838282B293B3B2B3526253828282A20252312
-12173D3D2A28282B2620434F2B24242424242424000000003629332C000000002B2B2B2B
-2B2B2B2B2B2B2B2B2B2B2B2E282E282E282E282E282E282E282E282E282E282E282E282A
-282A282A282A282A282A282A282A281D121D120000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000003529
-35293529352935293529352936293629362936293629312A312A332C332C332C332C332C
-29282928292829282A002B004B724B001A1A1E223D305137142222303D1B221B22303030
-3030303030303022223D3D3D294B3333343A2F2B3A381F22342A3F383B2D3B34332E3733
-4A332E332222223D30302D2F272F2D1A2F2F151A2C15492F2E2F2F20271E2F2C3D2C2C27
-3022303D3333342F383B372D2D2D2D2D2D272D2D2D2D151515152F2E2E2E2E2E2F2F2F2F
-302930303029302F4B4B4930303D4A3B4B3D3D3D303030373D353029293D482E291E3D3D
-303D3730303D33333B504A304B222214143D3D2C2E1B3022222F2F301B142272332F332F
-2F1F1F1F1F3B3B3B37373715303030303030303030302A1533273327223A2E2E2C2D2F3D
-3D2929294B4B4B303A2F1F3327342734272F301B332D332D3A313A2F2D2F2D2A152A162A
-22382F382F3B2E3420342033272E1E2E1E372F372F332733272A3B3D2F2E262F253B302F
-2957412E371B2A51182D1B1B2D1B332D342734272F2D2F2D2F2D3A2F3A2F3A2F382F382F
-1F151F151F151F15221A342C2C2A15382F382F3B2E3B2E342033272E1E372F372F372F37
-2F4A3D2E2C17332D4A483B2E224A3D4A3D4A3D2E2C143030364B4B4B4B10303030333841
-28423944153333352F33381F34333F38313B382D322E2E33413D1F2E2F262F152F2F2C22
-2F2F152C2C302C262E2F262F2C3E3D152F2E2F3D2F3B2A35331F1F2254533D342E383333
-332A382F492E383834373F383B382D342E2E3D3339354D4E3B4533354E352D2E2D232F2D
-3C2730302C2F34302E302F28252C3F2C302D4243303C2B293F2D2D2F23292715151A4545
-2F2C2C302A234B583029292929292929000000003D2E3931000000003030303030303030
-30303030303030332D332D332D332D332D332D332D332D332D332D332D332D2F2D2F2D2F
-2D2F2D2F2D2F2D2F2D2F2D1F151F15000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000003B2E3B2E3B2E
-3B2E3B2E3B2E3B2E3D2E3D2E3D2E3D2E3D2E372F372F393139313931393139312E2C2E2C
-2E2C2E2C2F003000537E53001D1D21264435593C16262635441E261E2635353535353535
-35353526264444442D5339393A403430403E22263A2E463E4132413A39333D3952393339
-26262644353532342B34311D3435181D31185135323434232B2135314431312C35263544
-39393A343E413D3232323232322B313131311818181835323232323235353535352D3535
-352D35335353513535445241534444443535353C443B352D2D444F322D21444435443C36
-36443939415951355326261616444431331E3526263434351E16267E3934393434222222
-224141413D3D3D18353535353535353535352F18392B392C2640333331323444442D2D2D
-53535335403422392B3A2B3A2B34351E39323932403640343134312E182E192E263E353E
-3541323A233A23392B332133213D353D35392C392C2F414434322B34294235342D614833
-3D1E2E591B321D1D321D39323A2B3A2B3431343134314034403440343E353E3522182218
-22182218261D3A31312E183E353E35413241323A23392B33213D353D353D353D34524433
-31193932524F41322652445244524433311635353C5353535312353535393E482D493F4B
-1839393A34393E223A39463E36413E323833333948442233342B35183433312635341831
-3135312A32342A34314444183432344434422F3A392222265D5C443A333E3939392F3E34
-51333E3E3A3D463E413E323A333344393F3B5657414C393A563B323331273431422C3535
-31343A353235342C293146313632494A35422F2D46323135272D2B18181D4C4C35313135
-2F275361352D2D2D2D2D2D2D0000000043323F3700000000353535353535353535353535
-353535393239323932393239323932393239323932393239323932343134313431343134
-313431343134312218221800000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000041324132413241324132
-41324132433243324332433243323D353D353F373F373F373F373F373331333133313331
-340035005C8C5C002020242A4B3A6343192A2A3A4B212A212A3A3A3A3A3A3A3A3A3A3A2A
-2A4B4B4B325C3F3F40473A354745272A40334E45483748403F39433F5B3F393F2A2A2A4B
-3A3A373930393720393A18203618593A3839392730243A364B3636303A2A3A4B3F3F403A
-4548433737373737373037373737181818183A38383838383A3A3A3A3A323A3A3A323A39
-5C5C5A3A3A4B5B485C4B4B4B3A3B3A434B413A32324B583832244B4B3A4B433B3B4B3F3F
-48625A3A5C2A2A19194B4B3639213A2A2A3A3A3A21192A8C3F3A3F3A3A27272727484848
-434343183A3A3A3A3A3A3A3A3A3A34183F303F302A4738393638394B4B3232325C5C5C3A
-4739273F3040304030393A213F373F37473C473A373A373318331B332A453A453A483840
-2740273F3039243924433A433A3F303F3034484B39382F3A2E493A39326B503843213363
-1E38212138213F37403040303A373A373A37473947394739453A453A2718271827182718
-2A204036363318453A453A4838483840273F303924433A433A433A433A5B4B39361C3F37
-5B5848382A5B4B5B4B5B4B3936193A3A425C5C5C5C133A3A3A3F455032514554183F3F41
-3A3F4527403F4E453C4845373E39393F504B2739392F3A183A39362A3A391836363B362E
-383A2F3A364C4B183A383A4B3A4934403F27272A67654B4039453F3F3F34453A5A394545
-40444E454845374039394B3F46425F6048553F415F413739372B393749303B3B3639403B
-383B39312E364D363B3851523B4935324D37373A2B323018182054543A36363B342B5C6C
-3B32323232323232000000004A38463D000000003A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3F
-373F373F373F373F373F373F373F373F373F373F373F373A373A373A373A373A373A373A
-373A37271827180000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000004838483848384838483848384838
-4A384A384A384A384A38433A433A463D463D463D463D463D393639363936393639003A00
-649864002323272E52406C491B2D2D4052242D242D404040404040404040402D2D525252
-37644445464D3F394E4B2A2D4538544B4F3C4F46443E494463453E452D2D2D5240403C3E
-343E3C233E3F1B223B1B613F3D3E3E2B34273F3B523B3B353F2D3F524444463F4B4F493C
-3C3C3C3C3C343C3C3C3C1B1B1B1B3F3D3D3D3D3D3F3F3F3F403640404037403E64646240
-4052634F6452525240404049524740373752603D3727525240524940405244444F6B6240
-642E2E1B1B52523B3E24402D2D3F3F40241B2E98443F443F3F2A2A2A2A4F4F4F4949491B
-40404040404040404040381B443445352D4E3D3E3B3D3E5252363636646464404E3E2A44
-34463446343E4024443C443C4D414E3F3C3F3C381B381E382E4B3F4B3F4F3D462B462B44
-343E273E27493F493F45354535394F523E3D333F324F403E3774573D4924386C203C2323
-3C23443C463446343F3C3F3C3F3C4E3E4E3E4E3E4B3F4B3F2A1B2A1B2A1B2A1B2D22453B
-3B381B4B3F4B3F4F3D4F3D462B44343E27493F493F493F493F63523E3B1E443C63604F3D
-2D6352635263523E3B1B4040486464646415404040444B5736584B5B1B4445463F454B2A
-4545544B414F4B3C433E3E4557522A3E3E333F1B3F3E3B2E3F3E1B3B3B403B323D3F333F
-3B52511B3F3D3F513F4F3946442A2A2D706E52453E4B444545394B3F613E4B4B4549544B
-4F4B3C463E3E52454C4767694E5C444667473C3D3B2F3E3C503440403B3E46403D403E35
-323B543B403D5859404F3937543C3C3F2F37341B1B225B5B3F3B3B40392F647540363636
-3636363600000000513D4C4200000000404040404040404040404040404040443C443C44
-3C443C443C443C443C443C443C443C443C443C3F3C3F3C3F3C3F3C3F3C3F3C3F3C3F3C2A
-1B2A1B000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000004F3D4F3D4F3D4F3D4F3D4F3D4F3D513D513D
-513D513D513D493F493F4C424C424C424C424C423E3B3E3B3E3B3E3B3E00400000020100
-000007000600000300070014B706020400060204002FCDDDCD002FCDDDCD313021112111
-2521112101000600FA800500FB000600FA0080050000000201230000020305D100030007
-0027401703030202075505080F0901005D042B035D0F051F0502052F5DE4FDE45D003FED
-332F3F3130010323031323353302031AAA1CD6CCCC05D1FBC90437FA2FD3000200A803D1
-0304061400030007002640150206060307010F09400902032C0040000100042C072FED33
-5D2FED5D003F3C332F3C3130010323032303230303042B842BA82B842B0614FDBD0243FD
-BD024300000200C3000005C905D1001B001F00B1407140215609740570097B137B167B17
-7B1A080A091E1D160F1501671501151E0C0F1013140B1407081F1C17001801681801181E
-0502011A06190662191462700B010B03110B111903040D001B011B1B0D171A011D0410B5
-131E020509040CB50F070F1318040B00140114030F0B4F0B020B08003F5D3F5D1217392F
-ED17392FED1739012F332F5D1217392F2F2F5DE42FE4313087C0C0C0C0FD5D71C0C0C0C0
-C08710C0C0C0C0FD5D71C0C0C0C0C0015D01210321152103231321032313213521132135
-2113330321133303210521032105C9FEB35C0134FEA9688168FEF2688168FED6014D5CFE
-CC0157698169010E698169012AFE35FEEE5E011203A4FE8887FE5B01A5FE5B01A5870178
-8701A6FE5A01A6FE5A85FE840003009BFE9704880628002C0033003A00BC408D7D087E16
-70197620702C7A36060E16012B1B16122B230D350D3C163C24352B430D4A164C24432B5A
-08532053335A356B0865206529632B6A30643A171D40090B371D382E11221D2226471B18
-312D1227373400030A067F1E011E050A11470A05060F3C1F3C0221210334207F00010031
-201818063F094F09020900112D1B1E263706031E0930064006700603062F5D33ED173932
-2F5D12392FED2F5DED12392F5D002F3333ED2F2F2F5D121739ED33332F1139392F2B3130
-5D5D011406071123112E012735331E01171E0117112E01272E01353436371133111E0117
-15232E0127111E01171E0125110E0115141601342627113E010488F2C47684E855101362
-2E348B4F28441DA38EE9D17665D4480E4BA3851E461A95A3FDD46B926C02007584788101
-7C9BCD13FE960165013127C60E351113210301B1080F0829A57994CC110110FEF2022C1D
-C42E4709FE51051105209CE8019D08655A5B5CFE585E5719FE620C6200050095FFE30807
-05ED000B000F001B00270033009C40720908060A0918061A0F351808170A1818171A2908
-260A2918261A460D480F4035560D580F680E13791F7625792B76310425512F034F030203
-031F5109020F030E082B51201940190219193151130A4F0C400E020C0E2E2A0016011616
-282A0C0E060F10401002101C2A0F00010000222A10062F33ED332F5DED2F5D123939ED33
-2F5DED2F2F5D003FED332F5DED3F3F3FED332F5DED5D3130015D01140623222635343633
-321625012309011406232226353436333216013426232206151416333236013426232206
-1514163332360374BDB2B6BABEB2B5BA02B3FCF4A5030C0285BEB2B5BABDB2B6BAFABB59
-64665858666459049359646658586664590434E0DADADFE0DADCC0FA2F05D1FBCCE0DADC
-DDE0DADA01B8AC8888ADAD8787FE17AC8888ADAD878700030073FFE1061305F0000B0018
-004500E1406F090F190F3C0C3015301D352D3E3D4F1A471D4F44791C0B6A25603F7B0576
-087B0F761D7A25703E703F090508062A06371408161D142A1437153F290C2A1D26373008
-300A4008400A490C41144F1C431D46204C21412D413C5108590D5B25690566086B0F601D
-1E3F0C161D20231903B8FFC0403B12173703AA190D2C093E05233502163F230A1E082C0D
-3E032F00143806142F3F0C4513201D2F38041A26001E011E1E45140D1A011A1A13152673
-4610F6ED332F5DED332F5D11121739111239392FED2FED121739003F3FED3F121739ED2B
-2F12393912393931305D5D015D013426232206151416173E0113010E01070E0115141633
-323601151406070123270E01232224353436373E01372E01353436373E01333216151406
-070E0107013E0137362635031871585C744F836265C2FE221F3E1F1C24AB9D5DB7016B32
-3C017AF6E573F07FD0FEED34232368356E61353532A161ADD6181D20765E01730E0E0102
-0104A75F6D7B594B744F2387FD0001D20F312A276E4592B35B02AE6060F06DFE90E08E71
-F3C55C86312F531F48926F437932303CAF862C6F2C315A20FE96286034388A30000100A4
-03D10182061400030015400A020203010F0501002C032FED5D003F332F31300103230301
-822B882B0614FDBD0243000100B5FE64030F061400150048403709010907190119072803
-28054F01480348054F075F015F076F016F077F01780278067F07120701010C7A04010830
-000100000F1F04881610F4ED332F5D3C5D003F3F3130015D012326021110123733150E01
-070602151412171E0117030FE5B1C4C4B1E551933F3C4B493E3C9A4DFE64CB01E0012D01
-2D01E0CB0A49BF7F7BFED8A4ABFEE4807BC7450000010093FE6402ED06140015004E403D
-060306131503151326012603261326154701400340134715500350136003601379007602
-700370137614151201040C750001123F040104040B1F00921710F6ED332F5D3C5D003F3F
-3130015D0110020723353E01373612353402272E01273533161202EDC4B1E54D9B3B3E49
-4A3D3F9351E5B1C4023CFED3FE20CB0A45C77B80011CABA401287B7FBF490ACBFE200001
-00A70276047106140011009040094F1301114009103708B8FFC040580910375B025B0554
-0B540E6B026B05640B640E7B027B05730B730E0C01060F0A0B0E08110502060C064F0450
-0402040A0F0C01040C010F131F130200110D4010011008070C4F090109100E020304050B
-060D2809700C010C2F5D33ED1739322F5D1239392F5D1239395D003F335D332F5D331217
-392F332F3331305D012B2B5D01072513231305272D013705033303251705047140FE9606
-8105FE9741017DFE8341016A068107016B40FE8403776ED5FE980168D66ECFCF6ED50167
-FE99D46ECD00000100D2001B05BA04FD000B0039402303AC01045408AC0A0F070107400D
-01300D400D0200AB0A800101012A05AB07400401042F5D3CE4FD5D3CE45D5D002F5D3CE4
-FD3CE4313001211123112135211133112105BAFDDFA6FDDF0221A60221023CFDDF0221A0
-0221FDDF00010093FE8E023F011D0003003540261A012A012B0235003902450048025500
-590264007400C5030C0202035604000004021A0202022F5D332F0010F4322F3130015D09
-012313023FFEE692AE011DFD71028F00000100990231030902E600030020401401420F02
-01020F054F004F055F005F05050000022F332F5D002F5DED3130012135210309FD900270
-0231B500000100FD000001EC011D00030016400C02560108002D2F013F0102012F5DED00
-3FED31302123113301ECEFEF011D0001FFE2FED0035C0614000300364025030100050116
-01250138004900440156016701770186010A011202032F02010200010000022F332F003F
-2F5D31300187ED5D87C009012301035CFD33AD02CA0614F8BC07440000020089FFE1048F
-05EF000B0023004140303601390B340C3B123B18341E4501490B440C4B124B18441E0C15
-4909022149030A0F21009E250F251F25021B2106982410F6ED5D10F6ED003FED3FED3130
-5D011002212002111012212012013E01353426272E01232206070E01151416171E013332
-36048FFBFEF8FEF4F7FA0109010CF7FEF92319192423795F5E7B24221916242179645E7C
-02E9FE6FFE89017C018A018D017BFE7FFCB551DB9A98E04E4D4E4E4F4AEE8E9CD2534E52
-4E00000101160000043C05D6000F003A4023054606060C030E034801080F111F11020502
-1F0F010F0F0C0E20023F036F03700303032F5D33ED39322F5D2F335D003FFD323F332FED
-3130290135211121353236373E0137331121043CFCDA0136FECA3F90252E35049B013098
-03E6881514194D41FAC2000100A10000049105F000200097407B501F601F020503061116
-03151124113B05380D350E3F1D3F1E391F4B05480D450E4F1D4F1E491F5F035D045D055B
-0956115F195E1B5D1C5F1D5F1E6A036406651162156F1E700274117F1A7F1C7F1E25000F
-100F2D082F1C300F400F060F0F0B4A1302021F4A01081F0208211616209E220F221F2202
-101002992110F6322F5D10F6322FED1239003FFD323FED332F5D31305D015D2901353E01
-373E013534262322060723353E01333204151406070E01070E0107210491FC1069D35BC0
-8E99895BD4650A47ED6FE501042B2A27694B6BE4630321D15AB459BADB7F74834042D223
-3ADDBD5593423E784969C554000100A7FFE1047C05F0003D009540700B0B052F1A0B152F
-290B262F293C3C0B35143122342F4A0B45144322432F56015905590B552F6A0B662F6A3C
-780B762F74357B3C1A343A443A023B3A1E491F012D112D022D2D294A1F0931020F0D1F0D
-020D0D114A090A2321371E2E1621032E1E3A37040C03A03F0F3F1F3F020C9A3E10E65D10
-E611173910ED2F2F2FED003FED332F5D3F1239ED332F5D2FFD39395D31305D011E011514
-06070E012322262735331E01333236373E01353426272E012B0135333236353426272E01
-2322060723353E01333216171E0115140607151E01040E303E4A434BCB797CF04D0F55E6
-6B3F8E2C2E2D332D2D804A5A4698B52E292B623E5FD65F0A47ED6F6DA643484AAF77307C
-02CD2B826766AA3F46433B23D1384A2A292C6A5150691E1F17A67F7A36511A1A14443ED1
-233B282C30885B7CB9180E0833000002004D000004B305D1000A000D00684041040D140D
-240D340D440D700D060C0D480606070C0607090D4901050503070303083F0A4F0A020A0F
-0F1F0F02070C04200A090D064F060101010F061F063F0603062F5D332F5D12393333ED39
-395D2F5D003F3F12392F3CFD321239393130018710FD04C0015D01231123112135013311
-3321110104B3DDC0FD3702D1B8DDFE63FDBF01A3FE5D01A3E60348FC7202A0FD60000001
-00BBFFE1048505D1002A0070404E0A081A082B083D0835113D164B0844115A0854296A08
-7A080C1D1D1A490F251F2540250325214A25061E020F0A1F0A020A0A0E4A060A2022204F
-1D011D142100201D09009F2C0F2C1F2C02099B2B10E65D10E611393910ED2F5DED2F003F
-ED332F5D3F1239ED2F5DFD322F31305D011406070E012322262735331E01333236373E01
-353426272E012322060711211521113E01333216171E0104854C4248C7837AE24E0E52DC
-6A4785342C2D352F34955C58A33B0380FD412B5A2179B64C505801D968BE41464B3324D3
-344928322B784F4D6A20261F180C02FFAFFE740404293437AE0000020089FFE104A705ED
-0022003700644044060D160D3925333133374925423143375F01560D5020502165217531
-0E1A0329491D1313174A1D030F023549030A1A2C2F122321001209009C390F391F39022F
-2109983810F6ED5D10E6113910ED2F123939003FED3F1239FD322F2FED123931305D0114
-002322262726023534123736243332161715232E01232200073E01333216171E01073426
-272E01232206070E01151416171E0133323604A7FED5D96EB445565D555D580116B93B50
-290A1C713BD7FF001554A36B5F914C5859CB373F2E703D55924D020241392E6B3F91A601
-E3E3FEE14443530112C1C6013277717F0A0DBF0F1BFEF3E5333523353DBA8D5D7A2D2014
-282A16291F9EB7352C29B1000001009A0000049505D10006004F403209010A0224014801
-4B0258027903070301000120020203000002034A050302080F081F087B02030300020204
-0F00010000042F332F5D12392F12395D003F3FFD11392F3130018710ED87C0015D090123
-012135210495FD5ED602CDFCB003FB04F2FB0E0522AF0003007AFFDE049C05F300190028
-0037009440702D2B3415332234273433441541224427453350155B195A1B5A1F54225F2B
-592C5F31543354376008620E6212621960236027760E76127B2C86121DA926A62F022616
-0A2F04031D4710023548030A1A200013011313002F0A0D292100162620009D390F391F39
-0220210D0D322106973810F6ED332FED5D10E411393910ED11393911332F71ED003FED3F
-ED1217395D31305D01140023222435343637352E0135342433320415140607151E010334
-26232206151416171E01173E01133426272E01270E01151416333236049CFED3E4F2FEE1
-908378730114D5DF010A7E7A8C94EDA5807EA15152258B42634C1F51762F705D5A6DBA8F
-92AF019FC1FF00FAC37CC93B06409872A8E0D6A565C337063CB0024F6B7F786648692912
-3A13428EFD735C6F3816262231A86A87B09600020071FFE3048F05EF0022003700644045
-0804190429043C253C2B352E4C254C2B432E58045F175D18521B70017B250F111D324914
-294914061D020A0A0E4A060A351109232100091A009E390F391F39022C211A963810F6ED
-5D10E6113910ED2F3939003FFD322F3F1239ED2FED123931305D01140207060423222627
-35331E01333212370E01232226272E01353400333216171612073426272E012322061514
-16171E01333236373E01048F595A5BFEEEB9345C240A1D6A41DDFB145DA4615C954B5859
-012CD86CB845555CCA40382F6C3F90A736402D6C424EA04601030342C3FEC270727C0B0C
-BF0F1B0109E9383024343DBC83E4011E434353FEFBA49BBC342D27B4A35F782D1F152A28
-15290002015A00000249045D00030007001E4010015602050656050807002D0600010101
-2F5D3CFD3C003FED3FED313001231133112311330249EFEFEFEF0340011DFBA3011D0002
-00E6FE8E0292045D00030007004C40370A050A061A051A062A052B063504390645044806
-5504590664047404C5070F01560205060607560806063F044F04020404002D000101012F
-5DFD322F5D332F0010F4322F3FED3130015D01231133130123130249EFEF49FEE692AE03
-40011DFCC0FD71028F00000100FE004D058004CB0006005E401073050105045403020306
-540001002C00B8FFE240260A1837031E0A1837031F002F0002030F000100400801300840
-080204050100004001500102012F5D332F1239395D5D002F5D335D2F2B2B31304B535887
-10FD8710FD05C059015D250135011509010580FB7E0482FC72038E4D02017C0201B4FE75
-FE75000200F5016A059703AE00030007003540200554060154060F020102400901300940
-09020405012F004000020000400101012F5D332F5D1239395D5D002F5D33ED2FED313001
-213521112135210597FB5E04A2FB5E04A2030EA0FDBCA0000001010C004D058E04CB0006
-006040107C030103045405050602540101002C01B8FFE240280A1837051E0A1837051F01
-2F0102050F010101400801300840080203050100002F013001400103012F5D332F123939
-5D5D002F5D335D2F2B2B31304B53588710FD8710FD05C059015D09013509013501058EFB
-7E038EFC720482024EFDFFB4018B018BB4FDFF00000200A0000003ED05EF001C00200069
-40470F221F2224140335184F024F034F0544185C0554186904691064187418741C0C0870
-090109061A1E161612341A02081F551E08202B1F1F061F7F0901090F1509172000010000
-172F332F5D1239ED2F5DED332FED003FED333FFD322F111239395D2F31305D015D011406
-070E01071523113E01373E013534262322060723353E013332160123353303ED46393892
-52B34197303A4099796CC1380A46D760D7F9FE75CCCC047362993B39642FE1013125582D
-346F56716F4423CC1B2BD1FAE2D3000200B0FF1E074E05EF0042004F00D640A206020F04
-0B050A090F1B0E1C0F3F0F4016021F041C051F1B1F1C142214271F3F1F4125022C042C05
-2F1B2F1C242220272F3F2F414740444856481D0A05052759496E09650D691A6821652766
-3F664174167B1B70277439743B0F120511081247520E1440151B371404044D53082D2D2A
-510E083D311E51313D020F2D012D051143122D144A123F0B010B0F512051021829140B37
-0F0020007F000300002429376B5010F6ED332F5D123939ED5D2F5DED2F33FD32322F5D00
-3F33ED2F123939ED332F2FED332FCD2B2FED331239392F31305D015D0114020721270E01
-23222635341233321617353311333E013534022726242322040706021514121716043332
-3637150E0123222427260235341237362433320417161201112E01232206151416333236
-074E514BFE481B4A8858A8C9F6AB4970419FF32A2B5B5858FEFCA5A0FEF75F606D685F63
-010A9D56B75461A859BAFEC2727380867474013EB5C401346A6A71FD8F3F64398192747B
-438602978BFEFC6B743C40FEE4E3010E212130FCB64BE159A4010C606067746262FEEF9A
-A5FEEF61656716188E150F7F72730142C3B9013F7575867C7070FEC5FE4002061D19B4A6
-A3A73E000002001A0000055E05D10007000A009840694009014A0645070209090A080287
-01010114000700090A0387040104140505067C067307020334300A400A700A030A090A06
-03017A050105080F0C0106070903050C002400390042005A006A0074000700006E0C0F0C
-010A052B0536054D05550565057B050705640B10E65D5D10F62F5D1217395D003F5D3C3F
-39392F5DED3130015D8710FD5DC0C0C08710FD5DC0C008C0015D005D2123032103230121
-130901055ED392FD7C92C9021E01087CFEFBFEFA019FFE6105D1FC7802DBFD25000300C8
-0000052B05D100150024003300524033050C150C270C550256157F190612112C341E1E07
-1D3408032D3407081615122C0F0F0725150071350F354035021E2C14076C3410F6FD325D
-10F6ED12392F1239ED003FED3FED12392FED39393130015D011406070E01232111213216
-171E0115140607151E01013426272E012B0111213236373E01133426272E012321112132
-36373E01052B544754C99BFDF001B9A3A24A524A6C5A97AEFEB324282F8663EC01005D6E
-2F2F277F3647308962FEC9010682A635383401CA6FAA37423805D118262B875E6A952D08
-1FCB0204364A171B0DFE52131E1E5FFD9A5A6A25190FFDD61B24276400010073FFE50546
-05EC002A0061404A05010D09061416011B0914152515361543145B08580A580E5B105B28
-600361147002760F70141316161A3412022A2A2634060A1600712C0F2C010F2C1F2C2F2C
-3F2C6F2C0520150C682B10F6ED5D5D10F63C003FED332F3FED332F3130015D250E01070E
-012322242726023534123736243332161715232E01232206070E01151416171E01333236
-373305463759483D8F56A2FEF762606C68625F010DA478EF920F7BF28A71B547454D5543
-46BB688FFA6D0E6C182A17131B5B615F0125C2B801226461663A49EB675E494D4BE5969D
-E2474A476262000200C8000005B205D1000E001D003A4027391249126902680D04163408
-03173407087600010F1500741F0F1F2F1F401F601F041714076C1E10F6ED5D10F6ED5D00
-3FED3FED3130015D011402070E01232111213204171612073426272E012B011133323637
-3E0105B2B19366FBCDFE880174DA01015998AACF7A7958C68ABABA8FD5596F6F02E7CBFE
-B65B3F3805D13F375FFEC4D6AFF0453227FB832A3947E800000100C80000049D05D1000B
-003B402309350006100602060601053502030A350108040008010800730D0F0D01060914
-016C0C10F6FD325D10F63C5D3C003FED3FED12392F71ED31302901112115211121152111
-21049DFC2B03D5FCF1030FFCF1030F05D1B0FE68B0FDD700000100C80000047F05D10009
-0034401E053502020701350803070800034F0B02030300640B0F0B01020514076C0A10F6
-FD325D10F4322F5D003F3FED12392FED313001211121152111231121047FFD0F0287FD79
-C603B70521FE5CB0FD3305D100010073FFE305A205EC00240069404907010906060E1D06
-130E210E350E4901410E510E6506650B630E740E741C0F223540230123230C0310101734
-0C021D34030A7609012210220910216C0075260F264026021A1509682510F6ED5D10F6ED
-3312392F2F5D003FED3FED332F1112392F5DED3130015D25060423222427260235100021
-32041715232E01272E01232200111000213236371121352105A27AFEDF87AEFEDE666770
-01A1016C7F010999121F763945AF6FFAFEDD0130010660BF48FE7102536E385360606101
-23C30165019D3D49EB184E1A1F29FEBFFEEEFEDFFEBF261E016DAE00000100C80000053B
-05D1000B003A4023033500081008020808050A070301050809021400780D0F0D400D500D
-03080314056C0C10F6FD325D10F6FD32003F3C3F3C12392F71ED31302123112111231133
-11211133053BC6FD19C6C602E7C602D9FD2705D1FDB8024800010089000002D505D1000B
-002E401909043206030A033201080D6D0A080B5A0A140305025A036D0C10F6F43210FDF4
-3210E6003FFD323FFD32313029013533112335211523113302D5FDB4C3C3024CC3C39804
-A19898FB5F000001002CFFEB02EA05D100150030401C6A017C01021233150307070B3403
-09131312140077170F170106651610E65D10F6ED332F003FFD322F3FED31305D01140623
-22262735331E01333236373E01351121352102EAEFC930A0360B29783F5C6D1A1B0FFEC5
-02010183C4D4110CB90E1E2A2728744C03659E00000100CD0000057505D1000B00A74075
-190956015C09030509280938094A0968098A09D809070F010A091E0119022A012B093901
-3909350B49014909450B5C01650B72007908100202038801C8010201B3000B000809B302
-0B0A030A840A010802050A07030105080B02030A0A0F0D20003000400004500001006E0D
-400D01080314056C0C10F6FD325D10F65D5D322F123939003F3C3F3C1239393130015D87
-10C0C07AFD1804C00187107AFD5D1808C0015D71722901010711231133110133010575FE
-FFFDB394C6C602D3F0FD6702979EFE0705D1FCF70309FD44000100C80000047605D10005
-002040110203043501080000070F07010414016C0610F6ED5D11332F003FED3F31302901
-113311210476FC52C602E805D1FADF00000100C8000005F605D1000C00794059560A0138
-023805360A6F0260036F05600A7F0270037F05700A0B5509560A5A0B0364037403750903
-050A020309000410043404440454046A04060404070B0903010708090A0B030502140078
-0E0F0E1F0E500E030513076C0D10F6ED5D10F6ED111739003F3C3F3C12392F5D12173931
-30015D72005D722123110123011123112109012105F6C6FE6276FE65B9010E018D018001
-130503FC970369FAFD05D1FCC3033D00000100C80000053805D10009006B404E0C071F07
-34074507510761077107077606010F0102061F0115063406440653066B0160067F017006
-0B0C010406025A01550602020701080603010408060102071300780B0F0B400B02021304
-6C0A10F6ED5D10F6FD113939003F3C3F3C12393931300172715D5D005D21230111231121
-0111330538F5FD3EB901330284B90534FACC05D1FB4004C000020073FFE105DA05F00017
-002300564042040004060B0C0B1217001706190C19125701570553075F0B580D58115F13
-53171076097915021B3415022134090A18150373250F25010F251F253F25031E150F6824
-10F6ED5D5D10F6ED003FED3FED5D3130015D011612151402070E01232224272602353412
-373624333216131000232200111000333200051E5B6163595CFBA19DFEFF5A5A61605C58
-01059AA0FF47FEFCE1E3FEFD0108DEDE0107052664FEDEB8B8FEDD6165666863630120B9
-B6012167626869FD610122013BFEC5FEDEFEDBFEC9013700000200C80000049605D10010
-001F0056403D3A143D1D4B144B1D500E540F650F071934000710070207070918340A0309
-080F211F21021115200030004000700004006F210F213F2102190714096C2010F6FD325D
-10F45DED5D003F3FED12392F5DED3130015D011406070E012B01112311213216171E0107
-3426272E012B0111333236373E010496453E4DD2A0C6C6019486BA48555DCE3637307B5E
-C4A778962F2F27040F63A93E4D4DFDD505D12D3039AA874D72241F1BFDAD2B2F306A0002
-0073FE7705F805F000250031008640610B0C0B120418041D190C19121518161D5C0B590D
-59115C1353175719571D742010551F651F751D742D0425252135030B29341E0609760979
-150215022F34090A1E130600337326151B0009061D030F1B73330F33010F331F333F3303
-2C150F683210F6ED5D5D10E61117393210EDE62F2FED003FED3F5D123939ED3FFD322F31
-305D015D010E01232226270E01232224272602353412373624333216171612151002071E
-01333236373303100023220011100033320005F83C753DAED309182D159DFEFF5A5A6160
-5C5801059AA0FF595B61DFBC0464842971181BECFEFCE1E3FEFD0108DEDE0107FE930F0D
-BFB204036863630120B9B60121676268696164FEDEB8FEEFFE8A4B727E190A039F012201
-3BFEC5FEDEFEDBFEC9013700000200C80000059805D10010001F007A405408011D012D01
-3A01391D450F4814481D5A01560F59146F016902600A650B7E01750B110201B300100010
-071A34400201020205183407030105080F211F2140210311150F0D010D0D102000010019
-031400056C2010F632FD322F5D39392F5DED5D003F3C3FED12392F5DED12393130018710
-7AFD18C0015D29010121112311213216171E0115140607133426272E012B011133323637
-3E010598FEFFFE0EFEE9C601A187B448515BA28E612D342B7650E9C85E8C312D2B0250FD
-B005D1232D339B77A1D93701A34063221D17FDCE212D2A6D00010086FFE5050205EC0030
-009A40790B09031F00231B08141F29082818241F242F390836103813351F362A4A084510
-4913451F4A27442A5802551B551F552D6B19661B651F662B602F7B16701F7020742A742D
-86122309400E103708400E103700111A28041D06212125341D020A0A0E34060A2128151A
-111500211A090074320F32703202096A3110E65D10E611393910ED2FED2F003FED332F3F
-ED332F1112173931302B2B5D011406070E012322242735331604333236353426272E0127
-2E013534243332041715232624232206151416171E01171E010502514950D596A1FEFF85
-0E71012882B8CD61634BAF62C6BF013CF39D0106650E55FEEB919FC1607940EC52A6A801
-A957AA3B40483C3BF85E668A73635E1A141A142ACBA3BBEF3C2CEA485F84685D6A1C0E28
-152CB20000010000000004EE05D1000700274018010435060303080F091F094F0903005B
-0114045B4F0501052F5DF4FDE45D003F3FFD323130012111231121352104EEFDECC6FDEC
-04EE0521FADF0521B000000100B2FFE1052905D1001D003A4029231223183D033D094C03
-4C0977137717081C0D031534060A1B1400761F0F1F1F1F401F030F140C6B1E10F6ED5D10
-F6ED003FED3F3C31305D011406070E01232226272E01351133111416171E01333236373E
-01351133052947514DCE898CD0475147C621272C976A6B962D2721C60256A2F1504C464A
-4852E8A9037BFC7B798C394142414239936D038A0001001A0000055E05D10006008C4066
-470148020205040507065706860603061400000105070457048604030414030203080144
-014B02580273017C02060005027503010303020845004A0302020103040024003A005A00
-6A00740006006E080F08010F08010B032B033503550365037B030603640710E65D5D5D10
-F65D1139395D003F3F5D1239393130015D8710FD5DC08710FD5D08C0015D090121013309
-01055EFDE2FEF8FDE2D401D301D305D1FA2F05D1FAE2051E0001005C0000078D05D1000C
-00BB409E470367037903030D010B020404020505080C0B1701190318051908190B290329
-08290B3B023903320434083C09330A3A0B4B02440444084C09430A4B0B55015A0255045A
-0557075909550A65016A0265046A056A09650A7F02700473087C09720A7C0B2E0C140001
-000714060506030301000300090205080B03090C0602060302083B0034064B0044067A00
-75060600720E1F0E3F0E5F0E7F0E0406670D10EE5D10E65D003F3F1217395D5D31300187
-10FD8710FD015D005D09012309012301330901330901078DFE7DDFFEC7FECEDAFE76CB01
-390134C90137013705D1FA2F04D4FB2C05D1FB2A04D6FB1E04E2000100440000053805D1
-000B00C2409775017A07020A04050A1A04150A2C04230A37094D04420A58035F04580557
-09500A570B68036D0468056709600A670B7B04730A170B14000100091408070803140201
-020514060607050407010A0B0602080302080F0D01060216022602360247020509081908
-290839084808050208070A04010406020D00160026003600470050000600660D08090619
-062906390648065F060606660C10F65D3210F65D321117392F2F5D5D5D003F3F12173931
-30018710ED8710ED8710ED8710ED005D015D09022309012309013309010538FDFE0201E5
-FE6AFE60D80207FE05E40191019A05D1FD20FD0F0265FD9B02E802E9FDA3025D00010006
-000004E605D10008007C405D2C012C04280735074001400440075007680470070A160619
-08270628085606590865066A08080814000100061405040502000D050200010004000703
-040107080402050302080F0A1F0A4F0A7F0A04005B01070114045B4F057F0502052F5DF4
-ED3910E45D003F3F1217395D3130015D8710ED8710ED015D005D09011123110133090104
-E6FDF4C6FDF2DB0197019B05D1FCBCFD7302780359FD66029A000001007E0000050805D1
-000900594036030708060813082608360846085608660876080808B30202030707033506
-03020208350108040803020707040209730B0F0B0102690A10E65D10E61139392F123939
-2F003FFD322F3FFD322F31300187107AED5D1887C0290135012135211501210508FB7603
-91FC910452FC6603B0B80469B0B3FB92000100EFFE7802F706140007001C400E05520201
-0652010B030000061F012FED332F3C003FED3FED3130012111211521112102F7FDF80208
-FEA6015AFE78079C8FF9820000010046FED003C006140003003A40280301020A0119012A
-0138014B01590168017801890109011200032F000100030100006002700202022F5D332F
-003F2F5D31300187ED5D87C00123013303C0ADFD33B0FED00744000100ABFE7802B30614
-0007001C400E045207010352010B031F000005012F3C332FED003FED3FED313001213521
-1121352102B3FDF8015AFEA60208FE788F067E8F000100BA02AA05D205D1000600474034
-3B0133034B0145035F0150036F0160037F0170030A69027B02020102050F031F033F035F
-036F0305030305030000004F000200042F335D2F003F332F5D12393931305D015D012309
-0123013305D2C6FE39FE3AC5024D7E02AC0273FD8B0327000001FFFCFED4051AFF4C0003
-0011B6015002000005022F11332F002FED313001213521051AFAE2051EFED47800010154
-051602FA068C000300244016480159026902790204500360037003030303010000022F33
-2F002F332F5D3130015D0123013302FA95FEEFF30516017600020068FFE1041D04780026
-0033007A40540C0A0423190A152304590E511E5C2C690E601D6F2D7B0A7A14701D7B2C0A
-0208283D3011401102111120084F1C011C1C183F20043141080A01080F1D011D1127021A
-001D0B0091350F351F353F35032E1B0B853410F6ED5D10E6113910FD32322F5D003F3FED
-3FED332F5D1112392F5DED123931305D015D2123350E01070E0123222635343637362437
-353426272E012322060723353E01333216171E011503110E01070E01151416333236041D
-BB1955282F7A5297D26D6566011EA42D2A28703D4AB6610A37D06576AF403F42BB56E944
-5164747763A477113D12171FC89B7F9D2D2D20081D40541817102725BF0F24272F2E926C
-FE1D013705141317615560614D00000200B9FFE10490061400130020005140393402350F
-3B1530204402450F4B154020571267127F087B1C0C0E0906174211040C011E40060A0B08
-141B0090221F223F22020E1B091A0C882110F6FD32325D10F4ED003F3FED3F3FED123939
-31305D011406070E012322262707231133113E0133321203342623220607111E01333236
-04904F4347AA665F8E450CB0BC4FB26FC6E5C2849352A8485073499CB102378CE04C4F4F
-2D26340614FDD44153FED0FEE6C8CF4738FD80241CCD00010069FFE703F3047700210057
-40410F234F23022B01220E2A1624183A01350E3A16351849014F0A440E4F164118590155
-0E6901650E7A01730E131010143F0C0421211A3F03090F008D23171B09852210F6ED10F6
-3C003FED332F3FED332F31305D015D250E01232226272E013510003332161715232E0123
-2206151416333236373E01373303F35EA95F79CA484950012DF760B94D0A56B757A0B9B5
-A439762F2948150A462D32474848DC93011201383627D14348D7D0CAD91E18152F110002
-006CFFE10443061400130020004B40333C1A301C38204F1A421C48205806680670100912
-0102110518410E0401081E42050A1114021A0092221F223F22021B1B08852110F6ED5D10
-F6FD3232003FED3F3FED1239393F31305D2123350E01232202113436373E013332161711
-3303112E012322061514163332360443BC51B067C8EB514544B56158884BBCBC4C78479E
-B0889650A475464E013401118EDE4E4C50252701E4FAFF0281221ADCCAC7CF470002006A
-FFE60460047C0018001F005A404026042B0D30043B0D3C1E43044B0D4B1E5A0D50166A0D
-6017780D7A1E0E013C1F1F0F1C3D15040B0B073F0F090C0C191A008F210F211F213F2103
-1F011B12852010F6FD325D10F4ED332F003FED332F3FED12392FED31305D01211416171E
-013332363733150E0123200011100033321215272E01232206070460FCC93E36348F5672
-E7310A5FC66DFEEAFEC8012BF4E2F5B701939697B30C021B67993130305B2CCD2836012D
-011501120142FEF8F32A94A2B2840001004400000312061E0018004B402D081439147505
-030000043F15000B0E3E0811050D080009400902090F090E00080B1A0F11000E400D1037
-0E891910F62B323232FD322F12392F2F5D003F3F33FD323FFD322F3130015D01232E0123
-22061D012115211123112335333534363332161703120A1F6426796D0153FEB3BC7F7FC6
-BB3F652A055E09136B8C269EFC4103BF9E25C7D50C080002006CFE590443047C00230030
-006E404E3D133E2A322C3A3044094B134C2A422C4B305B015D055A166A016C056A167C05
-702011220512211528401E0407070B40030D2E4115070F0601062124121A000618009232
-1F323F32022B1B18853110F4ED5D10E4113910FD32322F5D003FED3FED332F3FED123939
-3F31305D2510002122262735331E01333236373E013D010E01232202113436373E013332
-1617373303112E012322061514163332360443FEFEFEF459A9520A2EC864607E23231E55
-9B78C8EB514641BA5C6183490CB0BC4B81409BB2849952A57FFEE4FEF61917C012352E29
-276E446644430121010790D14C474F272830FCD60261221DD0C6BCC23F00000100B90000
-045F061400160037402203151615751503100D084213040E01010D08021A0091181F1860
-1802100B1A0D881710F6FD325D10F6ED003F3C3F3FED123931305D2123113426272E0123
-22060711231133113E0133321615045FBC1218195E4B4DA84DBCBC58BC63B5BE027C4D87
-262A294C3BFCBE0614FDCD4952DACD00000200AF0000018305DB000300070030401E0144
-02400B0D370203060505087F090109920060041A01607F050105880810F65DE4FDE4E65D
-003F3F3F2BED313001233533032311330183D4D40CBCBC0518C3FA25045D0002FFC2FE59
-021505DB000300190049402E0A051C0502014402400B0D370203163E19050B0B0F40070D
-4F1701177F0A010A0160161A00600A1770190119921B10F65D3232E4FDE42F5D2F5D003F
-FD322F3FED3F2BED31305D012335330314062322262735331E01333236373E0135112335
-210215D4D40CC8A828832C0A1C5F2D485816160DE901A50518C3FA0AC4C8100CB30B1C28
-2828715103849E00000100C1000004AF0614000B007D40512802D801DB090309010F0D1F
-011D021F0D2D012F0D300B400B540B69027A010C020203011A000B000809B4020B0A030A
-0802050A0507010105080B02600A700A020A0A00000D200D400D0208031A05890C10F6FD
-325D11332F332F5D3939003F3C3F3F1239393130018710C0C07AF51804C0018710FD08C0
-015D7121230107112311331101330104AFF8FE407ABCBC021FEDFDF901E974FE8B0614FC
-1A022FFDFC00000100BB0000017706140003001E4011020101087F05010592001A7F0101
-01880410F65DFDE65D003F3F3130212311330177BCBC0614000100B900000717047C002B
-006A4048032403291324132944204426B72A07B62501251F1D1C0817422822041D050110
-1C08402D011F2D302D402D502D702D05001A016110250B1C0F1A101F1A1A1C611F104010
-801003102F5DF4FD3210FD11393910F4ED5D5D003F3C3C3F3F3CFD32111239395D31305D
-2123113426272E01232206071E01151123113426272E012322060711231133153E013332
-16173E01333216150717BC0D151756514F9E4F0304BC0D151756514D9B4DBCBC58AF6372
-9F2772BC6BB8AF027C4886282B2C4F3D173D1EFD35027C4A85282B2B4C3BFCBE045D7C49
-5260556055DFC800000100B90000045F047C00160037402203151615751503100D084213
-040E05010D08021A0091181F18601802100B1A0D881710F6FD325D10F6ED003F3C3F3FED
-123931305D2123113426272E012322060711231133153E0133321615045FBC1218195E4B
-4DA84DBCBC58BC63B5BE027C4D87262A294C3BFCBE045D7C4952DACD0002006AFFE10471
-047C000B0017003E402C3B0E341034143B164B0E441044144B16080F3F0904153F030A0C
-1B0090190F191F193F196F1904121B06851810F6ED5D10F6ED003FED3FED3130015D0110
-002322001110003332000334262322061514163332360471FEE8EBEDFEE90117EDEB0118
-C2AA9799A9AA9896AB022EFEEFFEC4013C01110111013DFEC3FEEFD9D3D3D9D2D9D70002
-00B9FE640490047C00130020004D4035320239153220430249154220561267127E087C1C
-0A0E0906174211040C051E4006090B0C141B0090221F223F22020E1B091A0C882110F6FD
-32325D10F4ED003F3FED3F3FED12393931305D011406070E012322262711231133153E01
-33321203342623220607111E0133323604904E4742B364578D49BCBC4BBB6ACAE1C28A8F
-51A44B5073499DB0023C88E14E4A512628FE2C05F9753F55FECFFEECCAC84639FD87241A
-D4000002006CFE640443047C00130020004B40333B033D1A301C3A204C034B1A461C4A20
-701009120502110418400E04010C1E4205091114021A0092221F223F22021B1B08852110
-F6ED5D10F4FD3232003FED3F3FED1239393F31305D0123110E01232202113436373E0133
-321617373303112E012322061514163332360443BC57AC64C7ED534442B2635A8B480CB0
-BC4E7846A3AA899352A4FE64021A4B490133010E90DD4B4950282730FCBF0278231CDDC2
-C4D34700000100B900000372045D001200384021000D100D200D030C090F000004430A0F
-05090800001440147014020C071A09881310F6FD325D11332F003F3F3CFD322F11123931
-305D01232E012322060711231133153E013332161703720A2A4F3657A24BBCBC70AB5931
-2C2C03900A094D3DFCE7045DA55A4B0507000001006EFFE503D704780033009340710602
-091B1502191B26092A2432093C2442094C245E055D165321562F54326F056C166020642F
-6532147A057F1174207928742B8A01880D851A872894019A1B0B000E1829041E03802201
-2222263E1E0407070B3E030921291B180E1B00211807008E350F351F353F355F357F3505
-07863410E65D10E611393910ED2FED2F003FED332F3FED332F5D1112173931305D015D01
-14062322262735331E0133323635342726272E01272E01353436373E013332161715232E
-0123220615141716171E011716171603D7FDDB7CCF460A59DA647C8C26266C288135937B
-393A38AD6B64CD440A48CE63678E2B2A5E34812B834747014299C43B23D3434F50564222
-221809180E27976E457A302F373123C935494F4E452323160C180A1E494A0001003EFFEA
-02FD059E001B0048402C0C051A052B05030B10073E0D0B0A051B1B173F03094F1D7F1D02
-0E008C1D080D101A0A0807400D103707881C10F62B3232FD322F10F6325D003FFD322F3F
-3333FD322F31305D250E012322263511233533113311211521111416171E013332363733
-02FD357D31ABB27F7FBC0184FE7C0818164D4F2E64160A0A0E12B8CB02529E0141FEBF9E
-FE0358632B28251B0900000100B1FFE10457045D0016003740220B0619077A0703020515
-09051142050A010814021A0092181F186018020B1A08871710F6ED5D10F6FD32003F3FED
-3F3C123931305D2123350E01232226351133111416171E013332363711330457BC5FAE69
-B0C4BC101A1B565249AD4BBC7C4B50D7D002D5FD8455792B2C284C3B03420001003D0000
-047F045D000600864041260429063604390646044906062905390540055105600505061A
-000100041A03020328002703380037034A00470375017A02080005027503010305020802
-010300B8FFC0401E0910370C001C006A007A0004008D080F080103031303650375030403
-820710E65D5D10F45D2B113939003F3F5D1239393130015D8710FD8710FD005D015D0901
-2301330901047FFE3CBDFE3FCC015A0157045DFBA3045DFC870379000001005600000636
-045D000C0088406D0D031D032C012A0229032504260524082B0B34013B0544014B055701
-58045905570B6D02620464086A09640A6B0B79017D02720474087B09730A7A0B1E0C1A00
-0100071A060506000910090205080B03090C0602060502080F061F062F0603008E0E100E
-3F0E6F0E030006830D10F6325D10E65D003F3F1217395D3130018710FD8710FD015D0901
-23090123013313013301130636FEDDAEFEE1FEE3ADFEDAC4CD01179B011EC2045DFBA303
-5DFCA3045DFC9F0361FC9F0361000001003C00000480045D000B00DA408C090B1B011403
-14071B09270327073C003B0134033404340634073B093D0A4C004B014403440444064407
-4B094D0A5A0155035A0555075A09550B6F016003690560076F09660B230F0200083F0230
-084F0240087D02700808091A0A0B0A071A060506011A000B00031A0405040102050B0809
-06047A047506020605040809060106020D010502080B04040A00B8FFC0401C0910370600
-01008D0D0F0D010F0D1F0D400D5F0D040602040104820C10F65D325D5D10F65D2B321117
-395D2F5D003F3F5D1217393130018710ED8710ED8710ED8710ED005D015D212309012309
-0133090133010480EDFEC3FEC1DB01B4FE50ED013B013CDCFE4901ADFE53022D0230FE5A
-01A6FDDA0001003DFE64047F045D0007008C404104063406440650066006700606090307
-0519031705460149035800570179030902071A000100051A040304490046040200030204
-05020C02680101010203030400B8FFC040220910370C001C004A006A007A0005008D090F
-0901030413044504650475040504820810E45D5D10F65D2B1117395D2F003F3F12393931
-30015D8710FD8710FDC0015D005D0901231301330901047FFD74C9D0FE43CC0157015A04
-5DFA0701D20427FCC4033C000001005D000003E3045D00090056403A15083A0335084A03
-45085C03540860087F0370080A0707033E06050202083E01080408030207070402098E0B
-1F0B3F0B5F0B6F0B7F0B0502840A10E65D10E41139392F1239392F003FFD322F3FFD322F
-3130015D2901350121352115012103E3FC7A028BFD830367FD72029F8B03359D86FCC800
-000100ADFE78045906140025005640382F1D3A074A07562367237523063A1D4A1D021D1C
-09533F0A4F0A020A0A01145112012451010B140F00400002000919201F0E000940050105
-2F5D33333CFD3C2F2F5D3C003FED3FED12392F5DFD39395D3130015D012322263D013426
-2B01353332363D0134363B01152322061D01140607151E011D0114163B01045996B3DFA6
-AB3333ABA6DFB39672887B9A89899A7B8872FE78C7BC95A9BF9CBFA995BCC78A7E8CAF8B
-BD371837BD8BAF8C7E000001017AFE78022806140003001B400F0F054F05020201010B00
-1F4F0101012F5DED003F3F3130015D012311330228AEAEFE78079C00000100BBFE780467
-0614002500544034211235023112400240127A0C06131200533F254F25022525091B511C
-010A51090B1B0009010900170E1F050509004F200120202710D62F5D33333C10FD3C2F2F
-5D3C003FED3FED12392F5DFD39393130015D012322061D0114062B01353332363D013436
-37352E013D0134262B01353332161D0114163B01046733ABA6DFB39672887B9A89899A7B
-887296B3DFA6AB3301F8BFA995BCC78A7E8CAF8BBD371837BD8BAF8C7E8AC7BC95A9BF00
-000100BB018B05D1039F001F0056404206030609091309191908170A1518191A3B083418
-4B0844185A035A0A550D541B5B1D60056E14611875047A147518170F1C54060C54061F16
-1F2A000001000F2A00102F33ED2F5DED002F3333ED2FED333130015D010E01070E012322
-26272E0123220607233E01373E01333216171E013332363705D102292D2E82645E925466
-5C325E6409A702292C2B8A605D935550663D676103039F63C04B4D584F667D40AFC464BD
-4D4A5B4D68625BCAA900FFFF001A0000055E07500236002400000117008E002F0175001A
-40130320113011401170118011050200110E060725012B355D350003001A0000055E0801
-0012001E002100DF40442B2040205A18551A501E55206918651A651E09180B170D4A0646
-125906561278027703082020211F02870101011400120020210387040104140505067B06
-74120216510CB8FFC0405D0D10370C033470210121212006120405001C011C0301050813
-114F0F500F600F030F191140095F096F0903090F230106090F1204050C00240039004200
-5A006A0074000700006E230F23010A052B0536054D05550565057B050705642210E65D5D
-10F62F5D1217395D2F5DED2F5DED003F3C3F5D1217392F5DED2F2BED3130015D8710FD5D
-C0C0C08710FD5DC0C008C0015D005D212303210323012E01353436333216151406071334
-26232206151416333236130901055ED394FD8094C90207596BCC9293CB69592C72565672
-7355567236FEFEFEFD019FFE61057F2C9F668FC2C28F64A32A012F56737455567373FBF1
-02CBFD3500010073FE59054605EC00410097406F0A20032B1C20152B250B222B3402330B
-342B4302430B452B5D1F582158255A275E3F6102602B70027626702B160B0B1B0B022D2D
-313429021A061D41413D341D0A101014320C0D0F0F172A0009100920090309091D234371
-2C0071430F43010F431F432F433F436F4305371523684210F6ED5D5D10F43CE41239392F
-5DED332F003FFD322F3FED332F1239393FED332F31305D015D250E01070E01071E011514
-062322262735331E01333236353426270E01232224272602353412373624333216171523
-2E01232206070E01151416171E01333236373305463759480B1A120203BB9326772D091A
-5B326A620202132B12A2FEF762606C68625F010DA478EF920F7BF28A71B547454D554346
-BB688FFA6D0E6C182A17030903133317A2AC0E0CA20A1C5056132D1402025B615F0125C2
-B801226461663A49EB675E494D4BE5969DE2474A47626200FFFF00C80000049D08010236
-002800000117008D001E0175000BB601000D0D020325012B3500FFFF00C80000053807C8
-023600310000011700D7008C0175000BB60100170A050925012B3500FFFF0070FFE105D7
-075002360032FD000117008E009601750018401103002930295029702904020029240F03
-25012B355D35FFFF00B2FFE1052907500236003800000117008E00620175001840110210
-24202440246024040100241E0D1D25012B355D35FFFF0068FFE1041D068C023600440000
-0116008DE300000BB6020036371D2625012B3500FFFF0068FFE1041D068C023600440000
-01160043E800000BB6020035371D2325012B3500FFFF0068FFE1041D068C023600440000
-011600D6E000000BB6020038341D2625012B3500FFFF0068FFE1041D05DB023600440000
-0116008EE000001E4016030F39703902020039103920394039040039341D2625012B5D35
-5D35FFFF0068FFE1041D0653023600440000011600D7E200000BB6020041341D2525012B
-3500FFFF0068FFE1041D07B1023600440000011600DBD300000DB70302003A341D262501
-2B35350000010069FE5903F3047700380080405B0F3A4F3A022A012A0726252A2D252F3B
-01390735253B2D342F4B014F2140254F2D402F590153256C0166257A017525150B081B08
-0227272B3F230417031A3838313F1A090D0D113D090D0C0C142A06061A2026008D3A2E1B
-20853910F6ED10F63C1139392FED332F003FFD322F3FED332F1239393FED332F31305D5D
-015D250E01071E011514062322262735331E01333236353426270E01232226272E013510
-003332161715232E01232206151416333236373E01373303F3214D1D0305B79225742D09
-1A583268620302101D1979CA484950012DF760B94D0A56B757A0B9B5A439762F2948150A
-460F1F0913391CA2AC0E0CA00A1A4E58162E140204474848DC93011201383627D14348D7
-D0CAD91E18152F11FFFF006AFFE60460068C0236004800000116008DFD00000BB6020022
-21121825012B3500FFFF006AFFE60460068C02360048000001160043FD00000BB6020021
-20121825012B3500FFFF006AFFE60460068C023600480000011600D6F900000BB6020024
-20120025012B3500FFFF006AFFE6046005DB0236004800000116008EF9000014400D0330
-2560250202002520120025012B355D35FFFF00A000000246068C023600D500000117008D
-FE830000000BB601000505020325012B3500FFFFFFEB00000191068C023600D500000117
-0043FE970000000BB601000505020325012B35000002FFF50000023C068C0006000A003D
-40247A0174037A057406040201030505030905080800047F0C01000C92071A047F080108
-880B10FD5D32FDE4335D2F2F003F3F2F332F1239393130015D01230B0123133303231133
-023C978F8E93B2E313BCBC0511010BFEF5017BF974045D00000300050000022D05DB0003
-0007000B0041402702010744600401040A050908011A7F000100041A700501057F0D0100
-0D92081A057F090109880C10F65D32FDE4335D2F5DED2F5DED003F3F2F5DED3939313001
-2335330523353313231133022DBDBDFE95BDBDB5BCBC0518C3C3C3FA25045D00FFFF00B9
-0000045F0653023600510000011600D70700000BB6010024170E1525012B3500FFFF006A
-FFE10471068C0236005200000116008DE200000BB602001919060025012B3500FFFF006A
-FFE10471068C02360052000001160043E200000BB602001919060025012B3500FFFF006A
-FFE10471068C023600520000011600D6E200000BB602001C18060025012B3500FFFF006A
-FFE1047105DB0236005200000116008EE2000014400D03301D501D0202001D1806002501
-2B355D35FFFF006AFFE104710653023600520000011600D7E200000BB602002518060025
-012B3500FFFF00B1FFE10457068C0236005800000116008DEE00000BB601001918101225
-012B3500FFFF00B1FFE10457068C023600580000011600430200000BB601001818091625
-012B3500FFFF00B1FFE10457068C023600580000011600D6F800000BB601001B17091625
-012B3500FFFF00B1FFE1045705DB0236005800000116008EFD000016400F02301C501C60
-1C0301001C17091625012B355D35000100BB0087045B0614000B003C4026070A0B000104
-0605AA0606080308010F0D1F0D02006302040708090A010602280563700301032F5DE6ED
-173910E65D003F2F12392FED17393130012513231305350503330325045BFE6D058405FE
-6D01930584050193040A05FC780388058105018EFE7205000002009A02CC03BC05EC000B
-0017002840186A0F65157A0F751504155403030F5409020C2A0000122A062FED332FED00
-3FED332FED5D313001140623222635343633321607342623220615141633323603BCE8A9
-A9E8E8A9AAE7A58666668689636686045CA8E8E7A9A8E8E8A8668B8B6668898C0002009F
-FE97046005C3001C0023007B40553C0A3F2030224B0A4F2040225A0153116C0164117901
-7611791F76230E1D1E180D3F134F130213130D1747060C030F0505201C301C401C031C18
-471C05030F251F2502130021202F090109001D0C0F1804031E09062F33ED1739322F5DED
-2F3C5D002F3333ED2F5D2F3F123939ED33332F5D2F11393931305D250E01071123112600
-353400371133111E011715232E0127113E01373305110E01151416046047B46876E3FEFB
-010BDD7668BA410B37AE7378AD330BFE2787A2984A1E2F03FE9D0167150120FAF2012B16
-0163FEA1032C1FCB2C5209FCB90A552985034214D2BDB5D2000100890000048B05EE0021
-00774050201D3415321D03031E151E251E410E530E5B16630E7302730E091B1805460F08
-1F084F0803081010144908010C0202204A01080F231F23021F02181B20080519060F0605
-190F040220004000020000022F332F5D1217392F2F2F2F33FD3211395D003FFD323F1239
-ED332F2F5DED393931305D015D2901353E01352335331134123332161715232E01232206
-1511211521151406071521048BFBFE7667B0B0FDCD6998400A3E98568C8B019FFE617C62
-0345CF20BDB98A0136C801012211CE2A30A590FEDD8A3D7EBB390B00000200ACFE7F0468
-05EF0043006100A9407F05050A2714051D273E2030424D104F20433240425C105E165132
-63096E106A2B63321152055F205F255F275B2D5B3950426B1F6A20653D654061427C097C
-10742B7431107B50745F0218075F50293A062F0D3333373F2F021111153F0F0D1F0D020D
-181B5F045607333A1B50262911471A1129330704221000010000561A222FED332F5D1217
-39ED2F2F3939ED2F2F123939ED002F5DFD322F3FFD322F111217395D31305D015D011406
-07151E01151406070E012322262735331E01333236353426272E01272627263534363735
-2E01353436373E013332161715232E01232206151416171E0117161716033E0135342627
-2E01272E01270E01070E01151416171E01171E01173E01046876636158424148C27C57A7
-5C0A4FB46C86A2272D299052D6525372666554404340C78057A85B0A3ABD797FA92B2B2B
-845BC85A59F71C1E211D1C4E2C275D46123E1618261F1D1B512C266043144202596AA237
-072E915A4D8A3238361B1FC2253261573841191725143451518162A93907309259518334
-323A1C1DC21B3C5C573947171725152E4F4FFEAB21413A334617181F0C0B1514092D181A
-563132461817200B0A18130B2F00000100B9012103A4040B000B0013B703030900000688
-0C10F6322F002F332F313001140623222635343633321603A4DC9A9ADBDB9A9ADC02969A
-DBDB9A9ADBDB00010089FE95045205D1000D003B40245308610802010F0501054F060106
-0602AA0C030F0F1F0F020529040402290F0D010D0D092F332F5DED332FED5D003FED332F
-5D2F5D3C31305D012311231123112E013534243321045294D695CEFC0104F301D2FE9506
-BAF94603BC05F8CCCFE8000100B9FFE8048D061E0036006D4048052E152E2E132C343913
-39343736490E4636532166217B1B0C3433143D151E3C15032D0007070B3D03092608181B
-303400140C061C060206111B000614300325009038251A26883710F6ED10E611173910ED
-2F5D2F12392FED003F3FFD322F3F1239ED2FED39393130015D0114002322262735331E01
-333236373E0135342623353236353426272E01232206070E01151123113436373E013332
-1615140607151E01048DFEF1DB2C73240A2A63384A6E21231FD3C69D9A161E1B583D395C
-28252DBC48403CB35EB7E58E71A4BE01E1D6FEDD0F0DA518123A31347F4CA6A996778123
-421F1D231D2724845FFBC104387CB73E3A3BAE9770B2200925DF0004009FFF2E076105F0
-000B00170028003700AD407A7C0D7C11701370177A1A74277336070D1A04231E1A122314
-282C0E231022142C16211824233F1936234919472252186B0E641064146B166A19151A19
-2A182818292A25252818311B2A001D101D4F1D0318001D01901D011D0CAD1D06000012AD
-06281AAA31311E19401D011D30AA1E15501D1E0903030F500902003FED332F123939ED2F
-ED2F5D3C12392FED39012FED332F1239ED2F5D71335DFD3C2F39392FED8710FDC0313001
-5D005D011000212000111000212000031000212000111000212000072301231123112132
-16171E0115140607373426272E012B0111333236373E010761FE05FE9AFE9AFE0501FB01
-66016601FB74FE49FECAFECAFE4901B70136013601B7C0DFFEB5A2A501385E7A3B3F3B71
-63201C211F4635957F3E5A1D1F19028FFE9AFE0501FB0166016601FBFE05FE9A013601BC
-FE44FECAFECAFE4401BC820163FE9D0393101F226149618126FD243812110AFECB131719
-3C000003009FFF2E076105F0000B001700330096406D7C0D7C117013701779197223062C
-0E231022142C1633183324332A332E44184124442A442E54185424542A542E6B0E641064
-146B1662186A1D642417257F1801182C2A181E0CAD1E06000012AD06103320330233332F
-521B1F252F2502252529522115501B210903030F500902003FED332F123939ED2FFD322F
-5D2FFD322F5D012FED332F1239ED2F33ED2F5D3C3130015D005D01100021200011100021
-2000031000212000111000212000050E012322243534003332161715232E012322061514
-1633323637330761FE05FE9AFE9AFE0501FB0166016601FB74FE49FECAFECAFE4901B701
-36013601B7FE72569F4EE3FEF8010DDE59AC3E1036A9598E9F9994539D4810028FFE9AFE
-0501FB0166016601FBFE05FE9A013601BCFE44FECAFECAFE4401BC572727F6EAE1010230
-1CB52846ABA59FAE3A34000200AA031106F105D1000E0016005240217B0478057A060379
-0C010B0C0D01030406080815121210135015030D280B0F370BB8FFC440110B0F37022800
-000728090FAE102814AE132FE4FDE42FED332FED2B2B003FFD3C332F1217395D3130005D
-0123112303230323112311331B0133052311231123352106F17C14ED4FEF197BEEBFBFE3
-FC02E57FE5024903110269FE3D01CAFD9002C0FE82017E75FDB5024B75000001021D0516
-03C3068C000300244016470156006600760004500360037003030303010000022F332F00
-2F332F5D3130015D0901231303C3FEEF95B3068CFE8A01760002015A051803BE05DB0003
-000700264015020644016005010500140F010101041401000501052F5D33ED2F5DED002F
-5D3CFD3C3130012335330523353303BEC7C7FE63C7C70518C3C3C300000100F5001B0597
-04FD0013008840541612010C0B080704030E111201020D80029002A002B0020402290303
-0C030D030112045307110E08530D070F0B010B40150130154015020407080B0112110E08
-030D0309030D1004062F004000020000400601062F5D332F5D1217392F2F1217395D5D00
-2F5D3333ED39392FED3939322F2F3130018710FD5D87C0C0C0C010C0C0C0C0C0015D0121
-0323132135211321352113330321152103210597FDA0689968FE5701DA54FDD2025E6999
-6901ABFE2453022F016AFEB1014F9C010C9C014FFEB19CFEF4000002000E0000076D05D1
-000F00130079404F04030B061B041B052A042B053B064A044A054D064D120B1213030414
-05050675057C06020A100E140115730601080B0440000100000F05010564140334130D35
-0A0A13050835123406030E35010508003F3CED3FEDED1239392FED2FED300110F65D322F
-5D1739E62FED393931305D8710FDC0C0C0015D2901112103230121152111211521112101
-112303076DFC50FDF4D4CF0252050DFD1302EDFD1302EDFC50DBEF022CFDD405D1B0FE68
-B0FDD702230259FDA70000030073FF6E05DA064B001D002A003700A640850203000B0A0D
-0C120F1A051C1103190D1F121F1A151C550254045A08590D59115B135017551C792A140B
-090318061B1F0A1F0B1118161B2609272F75037F097F0A7F0B7F0C791270187019701A70
-1B132A2F1E2E043221340C09181B040615023234060A2A2F1E2E04272B15000C09181B04
-0F0073390F39010F391F393F390327150F683810F6ED5D5D10E411173910ED111739003F
-ED3F121739FD11173931305D015D011402070E0123222627072313260235341237362433
-3216173733031612012E01232206070E011514161701342627011E01333236373E0105DA
-63595CFBA173C94F9F84CD656D605C5801059A76C2528E84BC656FFE6F3990596EB44240
-453B3A035C3C3AFD683C91596EB73E434202E8B8FEDD6165663A37E4012664012CC4B601
-216762683737C9FEF464FED7013A2E2D4D4E4CE5938CE04C01B88BE44BFC432D2E504C52
-E100000300A1009D075F047C00170026003500724054051608311526192F2923262C3B34
-441C4B34510256075F0A5F0E5A1351165918553063026D0A631669236C24642C642D1821
-AF33AF0306120F09092AAF1BAF150F7B18743002272A0030180C0099371E2A0C993610F6
-ED10E411393910ED5D002F3CEDED332F1239393CEDED3130015D011402232226270E0123
-2202353412333216173E01333212052E01232206151416333236373E0125342623220607
-0E01071E01333236075FF5CF85DE454FD38FBFE2FACA86DE444FD58DBFE2FC683FB8608A
-9C7F776E7C392225030C807658814A1E33133CBB608A9C0297EFFEF599929794010FD6EE
-010C9A919695FEF1947575A79A85A6615E39470186A5477830672C7377A6000100D700B3
-05B505B6000F004540290E03540F010101010D045408AC0A070C401101301140110200AB
-0A800D010D2A040105AB07400401042F5D3CF43C10FD5D3CF45D5D3C002F3CE4FD3C322F
-5DFD3C31302521352111213521113311211521112105B5FB22021CFDE4021CA6021CFDE4
-021CB39E01A69E0221FDDF9EFE5A000200FE0000058005710006000A0061401605045403
-020306540001002C26012902360139020400B8FFE240240B1837031E0B18370954080303
-00400C01300C400C020504090A040100004001500102012F5D332F1217395D5D002F332F
-2FED2B2B31305D4B53588710FD8710FD05C05909013501150901112135210580FB7E0482
-FC870379FB7E0482012F01E37C01E3B7FE96FE96FE1AA0000002010C0000058E05710006
-000A0063401603045405050602540101002C26002906360039060401B8FFE240260B1837
-051E0B1837095408050501400C01300C400C020503090A040100002F013001400103012F
-5D332F1217395D5D002F332F2FED2B2B31305D4B53588710FD8710FD05C0590901350901
-350111213521058EFB7E0379FC870482FB7E04820312FE1DB7016A016AB7FE1DFC72A000
-0001006C000004A705D1001000834020300E3F10420E4F10540E5B10650E6A10730E7C10
-0A0020090B371020090B370EB8FFE0B3090B370DB8FFE04033090B374601550F700F0305
-0208320B0B0C010F0005070D0307080F121F1202030A005C0501030F05130D5C0C0A0F08
-BF0802082F5D3333E4ED39323210E42F2F5D003F3F1217392FED393931305D012B2B2B2B
-5D090115211521112311213521350133090104A7FE400174FE8EBCFE8E0174FE3DD4014C
-015005D1FCC15E8AFE5601AA8A490354FD6D0293000100BEFE640464045D001500384020
-080205140B051042050900080A0C0102131A0092171F176017020D091A0A881610F6FD3C
-5D10F4FD3939003F3F3FED3F3C12393931302123270E012322262711231133111E013332
-363711330464B20A3B815B567F42BCBC209B5B5D8536BC76414A4640FDF305F9FCBA2752
-433C034000020095FFE0047905EF00220031006640481502151B162E2904241B310A351B
-410A431B560A551A561F5020562A641A661E642A632E751B702E140F06263F0C0C061D19
-19153F1D022C3F060A1A0F232912141A0900002914092FED332F1239ED1139392F003FED
-3FFD322F1112392FED123931305D011402070E01232226353400333216173E0135342623
-22060723353E01333216171E01032E01232206151416333236373E0104794E5255CB71C0
-F3010DCA5A9F4F02029E984EB74E0B51C96089CD3E2A1DCB3C98488DA8877080A322060B
-0345A4FE987B7C62FDCBE4012134411A3B1AD9CA3F37C22C2D6D7C56CEFEC42F36B6AA91
-99C2BE215000000100BBFF43055905D1000C00A9406A01030F08450B8B03D903D30B0601
-08010B2B033208320B5D03660A600B08030203080908B3040304030B0A0BB30202030302
-03080908B3040304030B0A0BB30202030303610A010A07040304070A04020C0C0203090A
-0A6B090109040202040309040B0835050301350B002FED3FED1117392F2F2F5D332F1239
-012F332F1217392F2F2F5D332F313087107AED87C0018710ED8708C00187107AED87C001
-8710ED8708C0015D71052135090135211521011501210559FB6202A1FD69046DFC850288
-FD6603B4BDBF029C0277BCB0FDA748FD730000010090FF3F05FC05D1000B003B40250307
-050009350A0270007F09020414005A6F017F010201010D0514095A00086008700803082F
-5DE4ED11332F5DE4ED5D003FFD3C3C2F3C313001231123112111231123352105FCC8C6FD
-B0C6C8056C0523FA1C05E4FA1C05E4AE0001007100000541045D000B002B401703070500
-093E0A05041A00B001010D051A09B0100801082F5DE4ED11332FE4ED003FFD3C3C2F3C31
-300123112311211123112335210541CABCFE3CBCCA04D003BFFC4103BFFC4103BF9E0001
-008AFE590490061E0021002C4018000004401E00111115400D0D0F231F2302001000091A
-10192F33FD322F2F5D003FFD322F3FFD322F313001232E01232207061511140706232226
-2735331E013332373635113437363332161704900A2073208134356869BC346D310A216C
-228135346868BD3A6636055708153D3D95FB9DCE6D6E0B0AB208153D3D950463CC6F6E0B
-0A0000020097021303B005F000230030005740370A0A06211B0916212E0925215529600E
-6029700E70290B02082552111120081C1C1853200201012E5308061D1125022A1D0B002B
-2A000B2F33ED2F1239FD32322F003FED332F3FFD322F1112392FED12393130015D012335
-0E01070E01232226353436373E0137353426272E012322060723353E013332161503350E
-01070E0115141633323603B0AA1C312C2D514980AF5D4D4EEF88242122573054A8270E2D
-B84DD9BEAA45B736404E5B5E5283022A5E1425131415AA846A8724241F0612354013120A
-300EAC0D20A99FFE74F504100F124D444C4C430000020079021303E405F0000B00170031
-40205D015D055207520B046A0F6515020F530902155303060C2A40000100122A00062F33
-ED2F5DED003FED3FED5D31305D0114022322023534123332120734262322061514163332
-3603E4F4C1C9EDEDC9C1F4B687787A86867A78870401EBFEFD0109E5E5010AFEFCEBACAC
-AEAAAAADAB000001006B0000062105F00027006240440909090D1A091A0D2C092C0D3403
-300530113413460346136A1A641D64216A24101925140204160B341F0226183501160825
-1202191214081502141C272222290E15171C2FC4ED11332FC4123939ED2FED2FED003F3C
-FD3C3FED12173931305D2901113E01373E01353426232206151416171E01171121352135
-26023510002120001114020715210621FDA443842D2F38F8E2E2F83A2F2F7F44FDA401B4
-A8D90172013601360172D9A801B40185275A373A9970C8FDFDC86E9E38395727FE7BAE7C
-580132CC0116015AFEA6FEEACCFECE587C0000030068FFE3073F047C00390043005200B9
-40840B190B1D1C192604200D3604320D383D34414204420D4A3D4241520D5237554B630D
-6137654B13161D4B2A512E622E7B0D7E137C1E7D24732E73387C4B0B47013C2170430143
-124333033018403D36042C2C283F30040B0B073F0F0A5041180A433A011A474412213304
-00470F2D012D0C0C3A1A00472D1B008F544054014D1B001B855310F632ED5D10E4113939
-10ED332F2F5D2F1217392FFD1139003FED3FED332F3FED332F3FED111217392F5D33FD32
-31305D015D01211416171E013332363733150E01232226270E01070E0123222635343637
-362437353426272E012322060723353E01333216173E0133321215272E01272E01232206>
-<07032E01350E01070E01151416333236073FFCCD3C37348E566FD5420C4ED56DA6ED4C15
-5C323F947396D36C655F0124A22E2928703C4FB35A0D37CE659FD33945CA7DD9FBB60525
-20226D4F85B41991141569C0524F61747663C1022F72A234302D5334CD233B686713501C
-242FC2987C992A271C033D41551717112A24BF0F265D5B5268FF00FB3E446625272C968C
-FE6B35844B030915145B535F5C560003005DFF6C047104D900170021002B007840560008
-0F140A19292604001800250200180025020914001800253D1D322B4D1D422B0721261825
-04291B3E0609121504030F04293E030A21261825041E221B0009061215040C00902D0F2D
-1F2D3F2D6F2D041E1B0C852C10F6ED5D10E411173910ED111739003FED3F121739FD1117
-3931305D5D5D015D011000232226270723132E01351000333216173733071E01252E0123
-22061514161701342627011E013332360471FEE8EB548F3B856EAB4B530117ED578E3674
-6F9B4C54FEBC2563379BAA222302442322FE40275F3B96AE022EFEEFFEC42A27C601004D
-E2930111013D2C23ACE74CE0DC1D1DDCD2619436012B619836FD611F1ED900020071FFE2
-03BE05D100030020006D404C0F221F2202131E231E3A053A144B05400D400E400F43165C
-05520F6F05650E651A7A057A0910127F1301131007120155030320201C34070A022B0303
-101F70130113130A200401041915040A2F33ED2F5D12392F5DED332FED003FFD322F3FED
-331239395D2F31305D015D01233533130E01232226353436373E01373533110E01070E01
-151416333236373302C8CCCCF653BA70D7F9453B3A9D44B33C9E2E3644997967C5390A04
-FED3FA571E28D1AB62963E3E6529E1FECF2161282F7C4E716F4225000002012300000203
-05D1000300070027401707070055030305080F0901045D032B055D0F02200202022F5DE4
-FDE45D003F3FED332F3130012335331323133301F9CCCC0AE01AAA04FED3FA2F04370001
-00D2003905B002FA000500294018000002540F0401044007013007400702012A40000100
-00042F332F5DED5D5D002F5DFD322F313025231121352105B0ABFBCD04DE390221A00001
-0086FF6906C906FC0008004A402C15073307440772070407070806140302030207090829
-08590869080408000100010100040351060607080208002F2F1239392FED012F2F332F31
-308710DD5DC0C08710FD08C0005D09012301233521090106C9FC9066FE80ED0189013902
-DA06FCF86D03E18BFCCB065C0001FFDCFF37050005EF002B0077404D070B001F2E08270C
-270F2E212925350D300F400E410F59226607660C0E0C0B0807201D1E21221D220F2D1F2D
-020920201D2209041600160B081E462121281200000449280216161A4900120112002F5D
-FD322F3FFD322F1112392FED393930012F2F1217392F2F5D8710C0C0C0FDC0C0C0313001
-5D01232E012322060F01211521030E01070E012322262735331E01333236371323353337
-3E01373E013332161705000A1D7229797E232A0141FEA3671D5C4041985C2950340A215E
-2C7F812367D9F52A1A5C3E3E99573A4F3405290A1A77A0C28AFE1686B034352A0709B40E
-1480A701EA8AC67BA833332C0A08000200F300CA0598045000190033006D40490A010606
-050E08130A1B06200528082D5B0452115B1E522B680B6432790B743210272730541D1A23
-541D1A002A012A0D0D1654030009542A0300101929000033291A0C290D26291A272F33ED
-3CED2FED332FED002F333333ED2F2FED332F2F5D3333ED2F2FED332F31305D010E012322
-26272E0123220607233E01333216171E0133323637130E01232226272E0123220607233E
-01333216171E0133323637059714B69E4D8C3841682C4B541C9B17B39F488E3B3D6B2D4C
-59139E19AEA348903927802E4E56149D13B79E4D8A3A237C364B541B0450C2C64B2D3437
-607CB6C44A2E303B6D7DFDFCB8C34B2D1F4C6E7CC0C84A2E1C4F637A000200320000059E
-05D100030006004F403148024703025A056A050205041A000003061A010102390236036B
-0264037B02750306020305030000080105010203065401002FED3F1239012F11332F1739
-5D31308710FD8710FD04C0005D015D290101210902059EFA94023201080127FE50FE5105
-D1FAD7047BFB8500000200A600A2047A04760006000D005940107305730C0204400C1037
-0B400C103706B8FFC0B30C10370DB8FFC0401B0C103703000300070A0A07040500010100
-000C0B084007010707082F332F5D123939332F332F123939002F332F1239392F2F31302B
-2B2B2B015D2501350115090105013501150901047AFDF00210FE9B0165FE52FDDA0226FE
-8D0173BF01A35501A2BCFEEFFEEFD901BE5901BDC4FEDAFEDA00000200AE00A204820476
-0006000D005740107C037C0A0204400C10370B400C103702B8FFC0B30C103709B8FFC040
-1A0C10370C080C080505010403014000010000010A0B08070107082F33332F1239392F33
-2F5D123939002F332F39392F2F31302B2B2B2B015D090135090135010501350901350104
-82FDDA0173FE8D0226FE3CFDF00165FE9B02100260FE42C401260126C4FE4357FE5DBC01
-110111BCFE5E000300B2000005DA00DF00030007000B0025401405010206040A55090800
-2B0101042B0505082B092FED332FED332FED003FED173931302123353305233533052335
-3305DACCCCFDD2CCCCFDD2CCCCDFDFDFDFDFFFFF001A0000055E08010236002400000117
-004300640175000BB602000C0E050025012B3500FFFF001A0000055E07C8023600240000
-011700D700330175000BB60200180B050025012B3500FFFF0073FFE105DA07C802360032
-0000011700D7008B0175000BB6020031240F0325012B3500000200780000081C05D10016
-002500554039001C0022301C3022401C40227204720A721C741D72230B14351111011834
-10350D0317341535010811141417170E1203070073271F1507682610F6ED10E61117392F
-FD32003FEDED3FEDED12392FED3130015D29012224272602353412373E01332115211121
-152111210511232206070E01151416171E0133081CFBCEC4FEFD6791B3AE984FF9E8042E
-FD0502FBFD0502FBFC407A92B55F7481716D5BD09236415B0146CFD7013C603344B0FE68
-B0FDD7040479203642F8ABABEE4439280003006AFFE10776047C0024002B00370094406C
-2604200D3204300D32293B2E323032343B364004400D40294D2E403040344D36530D5314
-5C165C1A531C5322620D621C6222700D72221B013C2B121E2B030F283D21042F3F1B040B
-0B073F0F0A353F150A1E122B011A7F2C012C0C0C251A002C18008F393F3901321B188538
-10F6ED5D10E4113910ED332F2F5DFD323939003FED3FED332F3FED3FED1217392FED3130
-015D01211416171E013332363733150E01232226270E01232200111000333216173E0133
-321215272E012322060F0134262322061514163332360776FCDC3C34348D526DCD460C62
-BF69A8E84A45D183E9FEEF0117E38CC84447D78FE1ECB703918D8BAF10B8A49399A0A792
-92A5021B689831312F4F38CD2A347A686F78013C01110115013979726A81FEF4EF2A9B9B
-A4927DD7D5E0CCD4D7D500010099023C047D02DC00030018400C0154020000050F051F05
-02022F5D11332F002FED313001213521047DFC1C03E4023CA00000010099023C076702DC
-00030011B6015402000005022F11332F002FED3130012135210767F93206CE023CA00002
-FFED03E503160614000300070052B502180D103701B8FFE8B3090C3700B8FFE840090910
-3706180D103705B8FFE8B3090C3704B8FFE8401309103701000501050502060100B10202
-04B1062FED332FED003F3C332F5D3C3130012B2B2B2B2B2B0123013303230133031686FE
-F1F0EF86FEF1F003E5022FFDD1022F000002009603E503BF0614000300070050B90004FF
-E8400E0D10370518090C37061809103700B8FFE840200D10370118090C37021809103701
-000501050503070100B1020204B1000601062F5DED332FED003F3C332F5D3C3130012B2B
-2B2B2B2B090123132301231303BFFEF186A5A4FEF186A50614FDD1022FFDD1022F000001
-FFED03E5018606140003002EB502180D103701B8FFE8B3090C3700B8FFE8400D09103701
-00010101020100B1022FED003F335D2F3130012B2B2B0123013301868AFEF1F403E5022F
-000100A003E5023906140003002FB90000FFE8401A0D10370118090C3702180910370100
-010101030100B1000201022F5DED003F335D2F3130012B2B2B090123130239FEF18AA506
-14FDD1022F00000300D2000705BA051100030007000B00414029000B010B5608AC045407
-0F0101015602AC0F070107400D01300D400D0204AB000B2D05AB01400A010A2F5D3CE4FD
-3CE45D5D002F5DF4ED5D10FDF4ED5D313001231133012135210123113303BDEEEE01FDFB
-1804E8FE03EEEE03FE0113FD2BA0FD2B0113000200ACFFC805E00554000300070057403B
-4804470658045706680467067F047006087F057007020705000301000330036003900304
-03B200023002600290020402B220010406020002000201192F3333182F2F123939002F1A
-19FE5DEE5D11173931305D015D090705E0FD66FD66029A01BDFE43FE4301BD028EFD3A02
-C602C6FD3A01DDFE23FE2300FFFF003DFE64047F05DB0236005C00000116008EDD000016
-400F02100E600E700E0301000E0B040025012B355D35FFFF0006000004E607500236003C
-00000117008EFFED01750019401302000E400E500E600E700E0501000E090500252B355D
-35000001FF9A0000034B05D10003001D401138034803680065016903050100030000022F
-332F003F2F3130015D09012301034BFCF4A5030C05D1FA2F05D100010000FFE504CA05EC
-003300CC408758040102B52F0103B81D010237184718571867187718E718F71807013A00
-4A005A006A007A00FA0006032C06502998090109230F5020F71201081218122812581204
-00121203151827190119191D341502002833010133332F34030A272001022320292C0400
-0F12090604260C082A182A282A03002A21210C18007135103407073426150C683410F4ED
-12392F103C10F63C11392FC45F5D111217391117395F5D003FED332F5F5D333FED332F5D
-331112392F5F5D5D3CFD3CDD5D3CFD3C5F5D5F5D5F5D5F5D31305F5D250E012322000323
-37332E013534363723373312003332161715232E01232204072107210E01151416172107
-211604333236373304CA6CB97EF3FE8331862C4B02020202772C5D3A0174F38DBF541050
-C67C9DFF003001DB2CFE3C02030202017C2CFEC4310108969DB2440F3E3326012E010476
-152F161A34187601010128292DD1413DCFB17618341A172E1576B6D13F3D000100BA00AC
-02E0046C0006002C400972050104400C103706B8FFC0400C0C1037030300040501000001
-2F332F123939002F332F31302B2B015D2501350115090102E0FDDA0226FE8D0173AC01B4
-5901B3C7FEE7FEE7000100C200AC02E8046C0006002C40097D030104400C103702B8FFC0
-400C0C10370505010403010000012F332F123939002F332F31302B2B015D090135090135
-0102E8FDDA0173FE8D02260260FE4CC701190119C7FE4D000002004400000453061E0003
-001E005B40370B103A10601A741A04014402031515193F1100070A3E1D0D050509080B14
-0160051A006004140A0492201D071A0B0D0A400D10370A891F10F62B3232FD3210E61139
-10E4FDE42F2F003F3C3F33FD323FFD322F3FED3130015D01233533032311211123112335
-333534363332161715232E012322061D01210453D0D011BCFDF9BC7F7FC8B73E65290A1C
-6A22796A02C90518C3FA2503C2FC3E03BF9E31C1CF0D07AA08146B8C2800000100440000
-0447061E001A004E402D6C077A0702191A191A053E16000C0F3E091205010E08100A011A
-000A0F00921C090C1A10120F400D10370F891B10F62B3232FD3210E6113910ED2F2F003F
-3C3F33FD323FED33332F2F31305D2123112E012322061D01211521112311233533353436
-33321617370447BC2B8B35A2850149FEBDBC7F7FE9DE45902CBC056D080C6C8C2C9EFC41
-03BF9E31BFD10E040800000100BB007C045B06140013005740390B0E0F1011080609AA0A
-0712130001040605AA060A060C030C010F151F150210630063020407080B0C0D0E111201
-0A022803090563700301032F5DF63C10ED173910E6E65D003F2F1239392FED17392FED17
-3931300125132313053505110535050333032515251125045BFE6D058405FE6D0193FE6D
-01930584050193FE6D019301FB05FE7C018405810501A20581050184FE7C058105FE5E05
-000100FD01FF01EC031A00030016400C02560108002D2F013F0102012F5DED003FED3130
-0123113301ECEFEF01FF011B0001FFF6FEEC018F011B0003002EB90000FFE840190D1037
-0118090C370218091037010F0301011F03010300B1022FED002F5D335D2F3130012B2B2B
-09012313018FFEF18AA5011BFDD1022F0002FFF6FEEC031F011B000300070051B90004FF
-E8400E0D10370518090C37061809103700B8FFE840210D10370118090C37021809103701
-0005010505030F071F07020700B1020204B1062FED332FED002F5D3C332F5D3C3130012B
-2B2B2B2B2B0901231323012313031FFEF186A5A4FEF186A5011BFDD1022FFDD1022F0007
-0095FFE30B9305ED000B000F001B00270033003F004B00C640900908060A0918061A083C
-073E1808170A1818171A193C163E2908260A2918261A283C253E460D480F560D580F680E
-17791F7625792B7631794376490625512F034F030203031F5109020F030E08432B513D20
-19401902191949315137130A4F0C400E020C0E462A003A013A402A3A003401342E2A0016
-01163416282A0C0E060F10401002101C2A0F00010000222A10062F33ED332F5DED2F5D12
-3939ED33332F5DED2F5D33ED2F5DED2F2F5D003F3CFD3C332F5D3CFD3C3F3F3FED332F5D
-ED5D3130015D011406232226353436333216250123090114062322263534363332160134
-262322061514163332360134262322061514163332362514062322263534363332160734
-262322061514163332360374BDB2B6BABEB2B5BA02B3FCF4A5030C0285BEB2B5BABDB2B6
-BAFABB596466585866645904935964665858666459043EBEB2B5BABDB2B6BAB259646658
-586664590434E0DADADFE0DADCC0FA2F05D1FBCCE0DADCDDE0DADA01B8AC8888ADAD8787
-FE17AC8888ADAD8787AEE0DADCDDE0DADADFAC8888ADAD878700FFFF001A0000055E0801
-023600240000011700D600280175000BB602000F0B050025012B3500FFFF00C80000049D
-0801023600280000011700D600260175000BB60100100C020325012B3500FFFF001A0000
-055E08010236002400000117008DFFF80175000BB602000C0C050025012B3500FFFF00C8
-0000049D07500236002800000117008E00500175000DB7020100110C020325012B353500
-FFFF00C80000049D080102360028000001170043003C0175000BB601000D0D020325012B
-3500FFFF0089000002D508010236002C00000117008DFF120175000BB601000D0D040925
-012B3500FFFF005D0000030808010236002C0000011700D6FF270175000BB60100100C04
-0925012B3500FFFF007E000002E207500236002C00000117008EFF240175001940130200
-104010501060107010050100100D0409252B355D3500FFFF0089000002D508010236002C
-000001170043FF3E0175000BB601000D0D040925012B3500FFFF0073FFE105DA08010236
-003200000117008D00780175000BB6020025250F0325012B3500FFFF0073FFE105DA0801
-023600320000011700D6008F0175000BB6020028240F0325012B3500FFFF0073FFE105DA
-08010236003200000117004300AA0175000BB6020025250F0325012B3500FFFF00B2FFE1
-052908010236003800000117008D006E0175000BB60100201F0D1D25012B3500FFFF00B2
-FFE105290801023600380000011700D6005B0175000BB60100221E0D1D25012B3500FFFF
-00B2FFE1052908010236003800000117004300AA0175000BB601001F1F0D1D25012B3500
-000100BB00000177045D0003001E4011020501087F05010592001A7F010101880410F65D
-FDE65D003F3F3130212311330177BCBC045D00010136051103E1068C0006003A40275905
-5606690566067A0573060601020350056005700503050560030103500060007000030000
-042F332F5D002F5D332F5D1239393130015D01230B0123133303E19FB9B89BE4E3051101
-00FF00017B00000100ED051D042C06530019003940233902350E4902450E04190D190952
-0F101F1002101652100D600301031928000C28000D2F33ED2FED002F5D3333ED2F5DED33
-2F2F31305D010E01232226272E0123220607233E01333216171E0133323637042C0B846F
-365C292F412734340483088E67325D2A2F49213339030653989A27252B2B5A4C979A2724
-29295C4600010118053703FE05D10003001440090253100101010000022F332F002F5DED
-31300121352103FEFD1A02E605379A0000010113050E0402068C000D0056403A6508650C
-7508750C040D5006600670060306060AAA094003F00302D19003E003029003E003028B00
-03018950030150030159030D2A00072A00062F33ED2FED002F5E71725E5D5E5D715E5D5E
-ED332F5D3C31305D010E0123222627331E013332363704020AC5A9A9C509A60C6B5B596B
-0E068CA8D6D6A8847878840000010221051802F505DB0003000EB50244010015012FED00
-2FED31300123353302F5D4D40518C3000002012D050903E907B1000B00170045402E0F51
-090009300902313009015009600970090309091551030C29200030000200003000600003
-D0000100001229062FED332F5D7172ED002FED332F5D725E715EED313001140623222635
-343633321607342623220615141633323603E9CC9290CECC9293CB917558587576575875
-065E8FC6C5908FC4C48F567776575776760000010161FE59037000140014002440150B02
-1B012B013901041207070B53030D0E2A0000062F332FED003FFD322F2F31305D05140623
-22262735331E0133323635342627331E010370B79225742D091A58326862060399020659
-A2AC0E0CA00A1A4E581D491913340002015605160477068C000300070042B54500450402
-00B8FFE8B30E103704B8FFE840190E10370750036003700303030305019F000100000204
-0204062F33332F2F332F5D002F33332F5D333130012B2B5D09012313230123130477FEFE
-8BA9B0FEFE8BA9068CFE8A0176FE8A0176000001019FFE5F037C000A0014002440150E04
-1E042B043B04040A14141053030D000D2A00062F33ED2F003FFD322F2F31305D010E0123
-222635343637330E011514163332363733037C344B2A8BA90D069B0606535A24511108FE
-790E0C9E8F263E1A1B3C1E524E1B080000010132051103DD068C0006003A402754015902
-64016B0274017B020606050250036003700303030360020102500060007000030000032F
-332F5D002F5D332F5D1239393130015D01032303331B0103DDE4E3E49FB9B8068CFE8501
-7BFF00010000000100180000048005D1000D0047402A3B0B4B0A5A0A7A0A04020B050804
-090309090106030C3501080A030A00000F0F0F01080B140503026C0E10F63232FD325D11
-332F392F2F003FED3F12392F2F12173931305D29011107353711331101150111210480FC
-52BABAC6015DFEA302E8021798A395031AFD78011BA3FEE8FE0700010018000002360614
-000B003D4023490559056905030407010A040B05050B0B030801030800050D92000A011A
-050704880C10F43232FD3232E62F2F003F3F12392F332F12173931305D01071123110735
-37113311370236B5BCADADBCB5037A91FD1702608D9F8A0318FD7194FFFF0086FFE50502
-0801023600360000011700DF004D0175000BB6010034311A0025012B3500FFFF006EFFE5
-03D7068C023600560000011600DFAE00000BB601003734180025012B3500FFFF007E0000
-050808010236003D0000011700DF00320175000BB601000D0A020625012B3500FFFF005D
-000003E3068C0236005D0000011600DF9400000BB601000D0A050625012B35000002017A
-FE780228061400030007002940160F094F090201060106050201050B00041F014F050105
-2F5D3CFD3C003F3F1239392F2F3130015D01231133112311330228AEAEAEAE02F6031EF8
-64031E000002000E000005BC05D100120025005240333816481666026811041B1E083C0B
-0B071A340C031F3407087600011D1D0713150074270F274027602703091B1E140B09076C
-2610F63232FD322F5D10F6ED12392F5D003FED3FED12392FFD393931305D011402070E01
-23211123353311213204171612073426272E012B011121152111333236373E0105BCB193
-66FBCDFE88C4C40174DA01025898AACF7A7958C68ABC0169FE97BC8FD5596F6F02E7CBFE
-B65B3F3802E48F025E3F375FFEC4D6AFF0453227FE4C8FFDC62A3947E8000002006AFFE1
-0471061E001F00310084405B190D290D32013420392B362D45014C0D44204A2B442D5A2B
-542D6F05741E7421100C03293F090F121A1D041B10100903161B1B3F164F160216022F3E
-030A1C111A1D1C030011120F0C26051F162F160216231316090000092C14062FED11332F
-1239ED2F5D17391217392F2F003FED3F5D332F111239392F1217392FED123931305D0110
-00232200353400333216172E01270527372E012735211E01173717071612013E01353426
-272E012322061514163332360471FEE4F1E5FEEB0112CA6C9B56208757FEF842ED54905D
-0127236225D242BA99A6FEDE313403024BA55693A9A98F427B027DFEBCFEA8010EF5E201
-08353570D64AA2618E43512F1019431A80616D93FE9BFD8A3BA99620371E2D2BAF98B4AE
-2C00FFFF0006000004E608010236003C00000117008DFFE40175000BB601000B0A050025
-012B3500FFFF003DFE64047F068C0236005C00000116008DDD00000BB601000A09040025
-012B3500000200C80000049605D100120021005C403E391F491F551180108011051B3400
-0701071A34200C010C0C07090A0309080F231F23021315200030004000700004006F230F
-233F23020C1B071400096C2210F632FD32325D10F65DED5D003F3F1239392F5DED2F5DED
-3130015D011406070E012B011123113311333216171E01073426272E012B011133323637
-3E010496463C4EDB97C6C6C6CD85C243535ECE343830805AC4A777982F2C2903135CA939
-4B48FEBE05D1FEF22D2C35AA7D486B231E19FDCD292D2966000200B9FE64049006140013
-0020004D4035320239153220430249154220561267127E087C1C0A0E0906174211040C01
-1E4006090B0C141B0090221F223F22020E1B091A0C882110F6FD32325D10F4ED003F3FED
-3F3FED12393931305D011406070E012322262711231133113E0133321203342623220607
-111E0133323604904E4742B364578D49BCBC4BBB6ACAE1C28A8F51A44B5073499DB0023C
-88E14E4A512628FE2C07B0FDD43F55FECFFEECCAC84639FD87241AD4000100DC023C05B0
-02DC0003001E401100540F02010240050130054005020000012F332F5D5D002F5DED3130
-0121352105B0FB2C04D4023CA000000101230069056904AF000B00264017D702D80802A7
-0201D705D80B02A80B0105840294020202192F5D002F3130015D71005D71250709012709
-01370901170105696FFE4CFE4C6F01B8FE486F01B401B46FFE48D86F01B8FE486F01B401
-B46FFE4801B86FFE4C00000101230236039205D5000F002E4018055006060C030E03AA01
-0E0505020F0F0C0E2A02100301032F5D33ED39322F2F332F003FFD323F332FED31300121
-35331123353236373E01373311330392FD99EAF22D6C1E252C0387DD02367A0238700D0C
-102C28FCDB00000100CF023603C705EF001D0045402D24152518361535184C105E106D10
-651866197D1075180B0F0F0B521302021C52010E00001C02082A16101610022F33332F2F
-ED1239332F003FFD323FED332F3130015D0121353E01373E013534262322060723353E01
-333216151406070E01072103C7FD0864A733834A6B5A59AC300D47AF57B4BB6173379B42
-022002369C3E6E29676754454C3D1FB41A239D7D63975A2B6629000100CF020F03BC05F0
-002E007740162A033903450C4A1F540C5C1F6B0864237D0874230A27B8FFC040390B0E37
-2C2B15520F16010F161F164F165F16CF16FF16061621211D52160625020A0A0E52060F1A
-2A281622112A2216282C04091000010000092F332F5D121739ED2F2F2FED003FED332F3F
-1239ED332F2F5D71ED393931302B5D011406070E012322262735331E013332363534262B
-01353332363534262322060723353E0133321615140607151E0103BC42383994595EA54A
-0E29C35D648576708F80706B63684DC32C0E4AAD5AAFC16E595F8303314B712223211E1C
-B3243B474B553C8D4D443D473E24B21B23886A59721A08116F00FFFF00AB000007A305D5
-0036023B9200003700BB023700000117023C0404FDC300204015020E08020E400E600E02
-010B2B0B5B0B6B0B7F0B045D11355D1135003F35FFFF00AB0000074105D50036023B9200
-003700BB023700000117023E0384FDC3002640190302100803020E1F0E5F0E7F0E03010B
-2B0B5B0B6B0B7F0B045D11355D113535003F3535FFFF008C0000077905ED0026023DA600
-002700BB029100000107023E03BCFDC30036402603023608030236103630367F36030131
-003134314B315F316B317B3106000900093F094F09035D11355D11355D113535003F3535
-0001003C0000047405D10011005840330C0F09512F063F060206060B02344F0501050510
-0B01341003200301080803032F00010000130E01050A140F0E2F0B3F0B020B2F5D3333FD
-32322F11332F5D332F392F5D003FED2F12392F5DED12392F5DED39393130012111211521
-1121152111231123353311210474FD3E028AFD76014AFEB6C0B6B603820526FE55ABFEEF
-8BFECC01348B0412FFFF0073FFE305A208010236002A0000001700D900CF0175FFFF006C
-FE590443068C0236004A0000011600D9FE00000BB6020037311A2325012B3500FFFF0089
-000002D507500236002C0000011700DAFF240175000BB601000D0C040925012B35000001
-0086FE59050205EC004700C240990B0B0A1F0036003A1B0B1B1F13362F0B2A1F292F2436
-24463F0B391F3427392A34363441481F4427482A43364B3E44415F035A05523257365544
-6B026F046A30643264366642604679057A2D703670377541754486292B20400E10371F40
-0E10371A060028313F06341D38383C343402212125341D0A101014530C0D0F0F172A0937
-3F153128150031371D0904200074490F49704902206A4810E65D10E611173910ED2FED2F
-2FED332F003FFD322F3FED332F3FED332F1112173931302B2B5D011406070E01071E0115
-14062322262735331E01333236353426270E012322242735331604333236353426272E01
-272E013534243332041715232624232206151416171E01171E01050251492C683E0303B3
-9A25742D091A523868620302142515A1FEFF850E71012882B8CD61634BAF62C6BF013CF3
-9D0106650E55FEEB919FC1607940EC52A6A801A957AA3B233711162C199DB10E0CA20A1C
-4E5818291201023C3BF85E668A73635E1A141A142ACBA3BBEF3C2CEA485F84685D6A1C0E
-28152CB20001006EFE5903D70478004A00AA40810820090C37090204321902173224202B
-3B34203A3B43204B3B5A1C5C2D5237534652496B1C6B2D6237624662497C1C7C28743779
-3F74428B0188248531873F1D170300252F4006351A80390139393D3E35041E1E223E1A09
-0D0D1153090D0C0C142A0638401B2F251B002F381A06041D008E4C0F4C1F4C3F4C5F4C7F
-4C051D864B10E65D10E611173910ED2FED2F2FED332F003FFD322F3FED332F3FED332F5D
-1112173931305D2B011406071E011514062322262735331E01333236353426270E012322
-262735331E0133323635342726272E01272E01353436373E013332161715232E01232206
-15141716171E011716171603D77F6F0205B79225742D091A5832686203021528177CCF46
-0A59DA647C8C26266C288135937B393A38AD6B64CD440A48CE63678E2B2A5E34812B8347
-4701426BA32A13361AA2AC0E0CA00A1A4E58182D0F02023B23D3434F5056422222180918
-0E27976E457A302F373123C935494F4E452323160C180A1E494AFFFF0073FFE505460801
-0236002600000117008D006E0175000BB601002D2C0C1525012B3500FFFF0069FFE703F3
-068C0236004600000116008DCE00000BB601002423090F25012B3500FFFF0073FFE50546
-0801023600260000011700DF00A80175000BB601002E2B0E1525012B3500FFFF0069FFE7
-03F3068C023600460000011600DFF600000BB601002522090F25012B35000002006CFFE1
-04FB0614001B0028006F404A3B05380C3C2232243E284B054A0C4E2245244F2859086908
-70120D0114511A17171018011304072041100403082642070A160088011617131C041A1A
-01922A1F2A3F2A02231B010A852910F632ED5D10F632FD3232323210E42F003FED3F3FED
-1239393F12392F3CFD3C31305D01231123350E01232202113436373E0133321617352135
-213533153301112E0123220615141633323604FBB8BC4DAD6EC6ED524444B66059864CFE
-95016BBCB8FE8C4F73499CB2879750A404F4FB0C754252012E01118EDB4D4C4F2427CE86
-9A9AFB9902792218D6CCC3CD47000001FFFC0684051A06FC00030011B601500200000502
-2F11332F002FED313001212721051AFAE705051E06847800000100FD01FF01EC031A0003
-0016400C02560108002D2F013F0102012F5DED003FED31300123113301ECEFEF01FF011B
-FFFF001A0000055E0801023600240000011700D900310175000BB60200110B050025012B
-3500FFFF0068FFE1041D068C023600440000011600D9D600000BB602003A340B2625012B
-35000002001AFE5F062B05D1001B001E00C840900F051F052E053E05401D700806381C4A
-0E450F590E570F051D1E1D1C0A77098709020914100F101D1E0B770C870C020C140D0D0E
-570E580F7D0E730F040B34301E401E701E031E091E1D030D0E031B1B1753030D107A0D01
-0D080000142A060F20010E0F1D06040D0C102410391042105A106A1074100710106E200F
-20010A0D2B0D360D4D0D550D650D7C0D070D641F10E65D5D10F42F5D1217395D2FED332F
-003F5D3C3FFD322F3F1217392F5DED3130015D8710FD5DC0C0C08710FD5DC0C008C0015D
-005D010E012322263534363703210323012101230E0115141633323637330902062B344B
-2A8BA91E0679FD7C92C9021E0108021E610607535A24511108FD91FEFBFEFAFE790E0C9D
-90406A150154FE6105D1FA2F1B351B524E1B08033102DBFD250000020068FE5F052E0478
-003A00470099406A0B11052B1A12162B2A0544225F25544065166C2562407B127B1D7F25
-703F0F0C041B04390559166916053A3A3653030D0A103C3D301940190219192810242420
-3F28044541100A3009080000332A060F25012506193B091A2F25132F91490F491F493F49
-03421B13854810F6ED5D10E4113910FD3232322F5D2FED332F003F3C3FED3FED332F1112
-392F5DED12393FFD322F31305D015D010E0123222635343637350E01070E012322263534
-3637362437353426272E012322060723353E01333216171E011511230E01151416333236
-373301110E01070E01151416333236052E344B2A8BA90D041955282F7A5297D26D656601
-1EA42D2A28703D4AB6610A37D06576AF403F421D0607535A24511108FE3456E944516474
-7763A4FE790E0C9E8F263B1377113D12171FC89B7F9D2D2D20081D40541817102725BF0F
-24272F2E926CFD0A1B321E524E1B0801FB013705141317615560614DFFFF00C8000005B2
-0801023600270000011700DF00280175000BB60200211E080F25012B35000003006CFFE1
-062706140003001700240072B90000FFC0404A0E10370118090D3702180910373D073D1E
-34203B244D074F1E45204B245A0A6A0A70140B02020316011506091C4112040508224209
-0A0000021618061A02041F263F26021F1B040C852510F632ED5D2F33FD32322F332F003F
-ED3F3FED1239393F33332F31305D012B2B2B010323130123350E01232202113436373E01
-33321617113303112E012322061514163332360627FA7F98FEFDBC51B067C8EB514544B5
-6158884BBCBC4C78479EB0889650A40614FE0701F9F9EC75464E013401118EDE4E4C5025
-2701E4FAFF0281221ADCCAC7CF47FFFF000E000005BC05D1021600E70000000100C8FE5F
-04CD05D10020005C40390C041C042D043D04041235000F100F020F0F090E350B03133516
-090820201C53030D00192A0006060C10030A1473220F22010F1314140A6C2110F432FD32
-5D10E61117392F33ED2F003FFD322F3F3CED3FED12392F71ED31305D010E012322263534
-3637211121152111211521112115230E01151416333236373304CD344B2A8BA90B06FDC7
-03D5FCF1030FFCF1030FFE0607535A24511108FE790E0C9E8F24331D05D1B0FE68B0FDD7
-B01B351B524E1B080002006AFE5F0460047C002C0033007B40560D1E1A1E2604290D2B1E
-34043A0D3C1E3B3244044B0D4B32590D502A6C0D602B790D783212191915531D0D013C33
-3323303D29040F230B0B073F2309122A20201A1A0C0C2D1A008F350F351F353F35033301
-1B26853410F6FD325D10F4ED332F3C11332FED003FED332F12393FED12392FED3FFD322F
-31305D01211416171E013332363733150E01070E011514163332363733150E0123222635
-343637260011100033321215272E01232206070460FCC93E36348F5672E7310A4A9B5102
-03535A24511108344B2A8BA90604F8FEEB012BF4E2F5B701939697B30C021B6799313030
-5B2CCD1F3109143012524E1B089F0E0C9E8F18321212012A010401120142FEF8F32A94A2
-B284FFFF00C80000049D0801023600280000011700DF00220175000BB601000F0C020325
-012B3500FFFF006AFFE60460068C023600480000011600DFFD00000BB602002320120025
-012B3500FFFF00C80000047608010236002F00000117008DFEC00175000BB60100080702
-0325012B3500FFFF00AB0000025108010236004F00000117008DFE8E0175002FB5700270
-030203B8FFC0B3090C3702B8FFC04011090C3701044F049F040201000605020325012B35
-005D11352B2B5D00000200C80000047606140005000900464016070C0B0D370808090102
-030435010800000B0F0B0106B8FFEA40110E1037080C0B1037060608041408016C0A10F6
-32ED2F332F2B2B5D11332F003FED3F3F332F3130012B2901113311210B0123130476FC52
-C602E8C3FA7F9805D1FADF0564FE0701F900000200BB000003540614000300070042400D
-010C0B0D370202030601050800B8FFEA40190E1037020C0B103700000F021F0202020204
-1A7F050105880810F65DFD322F5D332F2B2B003F3F33332F3130012B0103231303231133
-0354FA7F98FCBCBC0614FE0701F9F9EC0614000200C80000047605D1000500090036401E
-07562F0801080801020304350108062D07070100000B0F0B010414016C0A10F6ED5D1133
-2F12392FED003FED3F12392F5DED3130290111331121032311330476FC52C602E89CE9E9
-05D1FADF0157010B000200BB00000362061400030007002D401A05560606010201010807
-2D6F067006020606001A7F010101880810F65DED332F5DED003F3F12392FED3130212311
-33012311330177BCBC01EBE7E70614FBF4010900FFFF00C8000005380801023600310000
-0117008D00780175000BB601000C0B050925012B3500FFFF00B90000045F068C02360051
-00000116008D0000000BB6010019180E1625012B3500FFFF00C800000538080102360031
-0000011700DF00A20175000BB601000D0A050925012B3500FFFF00B90000045F068C0236
-00510000011600DF1C00000BB601001A170E0225012B3500FFFF0073FFE105DA08010236
-00320000011700DD008C0175000DB703020029260F0325012B353500FFFF006AFFE10471
-068C023600520000011600DDD800000DB70302001D1A060025012B353500FFFF00C80000
-059808010236003500000117008DFFF60175000BB602002221060B25012B3500FFFF00B9
-00000372068C0236005500000117008DFF380000000BB6010015130A1225012B3500FFFF
-00C8000005980801023600350000011700DF000A0175000BB602002320060B25012B3500
-FFFF009200000372068C023600550000011700DFFF600000000BB6010016130A0325012B
-3500FFFF0086FFE5050208010236003600000117008D00140175000BB6010033321A1F25
-012B3500FFFF006EFFE503D7068C0236005600000116008D9400000BB601003635063225
-012B350000010000FE5904EE05D1001B0048402E0C071C072C073C07040C0C1053080D01
-18351A030216080B0B132A050F1D1F1D4F1D03005B050114185B4F1901192F5DF4FD32E4
-5D2FED332F003F333FFD323FFD322F31305D0121111E011514062322262735331E013332
-3635342627231121352104EEFDEC0309B79225742D091A58326862050332FDEC04EE0521
-FB04144822A2AC0E0CA00A1A4E581E36170521B00001003EFE5902FD059E0030006F4046
-0C080D1A19081E1A2B082F1A3C08070D0D1153090D20251C3E22201F0503171830302C3F
-18094F327F32020C0C142A06182306031C008C321D22251A1F1D4F1C7F1C021C883110F6
-5D3232FD322F10E61117392FED332F5D003FFD322F1239393F3333FD322F3FFD322F3130
-5D250E01071E011514062322262735331E01333236353426272322263511233533113311
-211521111416171E01333236373302FD0C1C100204B79225742D091A58326862030214AB
-B27F7FBC0184FE7C0818164D4F2E64160A0A030703122C18A2AC0E0CA00A1A4E58172F10
-B7CB02529E0141FEBF9EFE0358632B28251B0900FFFF0000000004EE0801023600370000
-011700DFFFEE0175000BB601000B08060725012B35000002003EFFEA037A0705001B001F
-0073404C0B041C042A042A1D2A1E3A1D3A1E4A1D4A1E551C641C691E741C791E0E1F1F1E
-0B10073E1E0D0B0A051B1B173F03094F217F21021C1C1E1E100E008C21080D101A0A0800
-4F077F070207882010F65D323232FD322F10F63211392F332F5D003FFD322F3F333333FD
-322F2F332F3130015D250E012322263511233533113311211521111416171E0133323637
-331303231302FD357D31ABB27F7FBC0184FE7C0818164D4F2E64160A7DFA7F980A0E12B8
-CB02529E0141FEBF9EFE0358632B28251B090652FE1101EFFFFF00B2FFE1052908010236
-00380000011600DB63500079405B02010900210140215021A02103EF102101902101BD00
-210150218021028B10214021702103B021C021F021039021C02102599021C021E0210310
-21602190210331002101E021010F211F214021502180210521020100241E0D1D25012B35
-3500115D71725E71725E5D71725E5D725E5D725E5D715E353500FFFF00B1FFE1045707B1
-023600580000011600DB0000000DB70201001D17091625012B353500FFFF00B2FFE10529
-0801023600380000011700DD00780175000DB7020100241F0D1D25012B353500FFFF00B1
-FFE10481068C023600580000011600DD0A00000DB70201001D18091625012B353500FFFF
-007E0000050808010236003D00000117008D00070175000BB601000B0D050625012B3500
-FFFF005D000003E3068C0236005D00000117008DFF680000000BB601000B0D050625012B
-3500FFFF007E0000050807500236003D0000011700DA00390175000BB601000B0A050625
-012B3500FFFF005D000003E305DB0236005D0000011600DA9200000BB601000B0A050625
-012B3500000100C80000048A05D10005001F401003013504030000070F07010214036C06
-10F6ED5D11332F003FED2F3130012111231121048AFD04C603C20521FADF05D100030073
-FFE105DA05F0001700230027006D404F040004060B0C0B1217001706190C191257015705
-53075F0B580D58115F13531710253560260126260976097915021B3415022134090A2726
-27260F18150373290F29010F291F293F29031E150F682810F6ED5D5D10F6ED1239392F2F
-003FED3FED5D12392F5DED3130015D011612151402070E01232224272602353412373624
-33321613100023220011100033320003213521051E5B6163595CFBA19DFEFF5A5A61605C
-5801059AA0FF47FEFCE1E3FEFD0108DEDE0107ACFD8D0273052664FEDEB8B8FEDD616566
-6863630120B9B6012167626869FD610122013BFEC5FEDEFEDBFEC901370106B300030069
-FFF0062405E1001D002A00370058403624182C321525062B32091509081603082A1E2532
-65006A0F041E150032150F00072B1518250407140F080839381F393F396F399039045D11
-12392FC4ED173910C42FED2FED5D002F3F1239392FED39392FED39393130011406070E01
-071523352E01272E01353436373E01373533151E01171E01073426272E0127113E01373E
-0101110E01070E01151416171E010624594F55F48AC586F6574F59564C51F395C594F64F
-4B57CE403B3A8E6A5E9A324142FD8E6A8E3A3A414340319B02F38CD9494F5D03A6A6035A
-524AD88C88CC4C515E049B9B03624E49D07F63A639383402FC8602392F3CAEFEAC037A01
-363737AA6170B63A2D3C0002006CFFE10443047C00130020005740162A032A203C1A301C
-38204F1A421C4820580668060A10B8FFC040230B1037120502110518410E0401081E4205
-0A1114021A0092221F223F22021B1B08852110F6ED5D10F6FD3232003FED3F3FED123939
-3F31302B5D2123350E01232202113436373E0133321617353303112E0123220615141633
-32360443BC51B067C8EB514544B56158884BBCBC4C78479EB0889650A475464E01340111
-8EDE4E4C502C2734FCB6027C221FDCCAC7CF47000002006AFFE104730614001900280086
-4029031C0520171526153B0A3A0E3A1C3E214C0A490E4A1C4F2153176B0E7B0E7A207B21
-1136264626021DB8FFE04034121C371D180A11371D171D0C050F133E1001263F030A1111
-001D0C0F1A1B00140F00902A0F2A1F2A3F2A6F2A040F0F231B06852910F6ED332F5D10E4
-113910ED11393911332F003FED3FFD323F33332F2B2B5D31305D01100023220011343637
-3E01372E012735211521151E01171E01073426270E01070E011514163332360473FEEBEE
-F1FEEB564045B45C4CB466032AFDCF44DE5D9676C26E6E4291423F55AA9C99A60227FEF0
-FECA012F01068DC5404852113F8748B39E0A2E9C5488FBA487E45608303532AE7FC9D0D3
-0001006DFFE603EE0478003D007C40432612263B363B49014418590154186A016F0B6418
-79017A0B7418792274350F0C2C3F2B2B03161A1A1E3E16043D3D393F0309192B40090C37
-2B241B10100C2B19040900B8FFC0401009143700003F7F3F803F02331B09863E10F6ED5D
-11332F2B1217392FED2F2B2F003FED332F3FED332F1112392FED3931305D250E01232226
-272E0135343637352E01353436373E013332161715232E01232206070E01151416171E01
-3B0115232206070E01151416171E01333236373303EE6BCE734FA446455771795B6C5F41
-40A24F62A45A0D42C3642D4E2A233338302D68356F9E3E642A2931342925653866E8470D
-40302A2028277F5E6090260718845C5975222120211CCF33380B140F432C3D440F0E03A6
-0911114A3B354A151314483E0002006AFFE1050F047C0011001D004D40163A15351B4A15
-451B040E3F0D05153E09041B3F030A0FB8FFC040190B0D370E0E090C0F0306121B00901F
-1F1F6F1F02181B06851E10F6ED5D10F4ED121739332F2B003FED3FED3FED5D3130011000
-232200111000333216172115211E010734262322061514163332360471FEE7E9F1FEEC01
-1AED376A1D01E0FEE03E44C2A49AA1A4A79C98A8022EFEE7FECC013C01110113013B1609
-A549C27FD7D6E0CDD1DAD7000001000A000003EE045D0007003840230301043F06054000
-4F0502000500021A05A003B00302030309080F093F094F097009045D1112392F5D33FD32
-2F2F5D003FFD322F3130012111231121352103EEFE6CBCFE6C03E403B8FC4803B8A50002
-0068FE6405EA047A001D0024007840163515740F022110090C37213E1A040F0522037717
-0117B8FFF0400F090C37173E0609050C75147A1E0211B8FFC040250D103711112217041A
-05050C1E1B3A0001008F260F261F264F266026040F2601141B0C852510F6ED5D5D10F45D
-ED12392FED3939332F2B5D003F3FED2B5D39393F3FED2B31305D011000051123112E0127
-2E01353412373315060215141617113E0133200003342623113E0105EAFEA9FEF3BB82DD
-51555E7685E58894E1BD214B270130015DC3E0C1CED30240FEFDFEC40FFE72018E065145
-4AC4869F01128A1163FEF6A7BDE60603E80201FED5FEFBB8DBFCB20AE8000002FFFCFE59
-051AFFAE000300070020400F02500101080650050D0400000905022F3311332F33003FED
-12392FED31300521352111213521051AFAE2051EFAE2051ECA78FEAB7800FFFF01230000
-03DC05D10036000400000117000401D90000001E40140302200D5F0D6F0D030D01000005
-10057F0503052F5D35352F5D35350001009A022A03C605F00016004DB90014FFE0B3090C
-3715B8FFE0B3090C3713B8FFF84017171B370110130D0D085313020E03012A000018100B
-2A0DB8FFC0B3090A370D2F2BFD3211332FED003F3FED332F1239332B31302B012B012311
-3426272E012322060711231133153E013332161503C6AC0E15164D40418D41ABAB4BA254
-9AA6022A0215466A2424234332FD4503AB683E45B9AB000200C8FFE508CA05D1004E005D
-00E240210B18044D19012E18204D55316A186631654D791375487952735A0D05200E1037
-3DB8FFE040310E103711001A46043B033F400B0D373F3F433E3B4F3501353B351E37213E
-34243134032C573450290129292B56342C0307B8FFC0403C0B0D3707070E3E0309202B3A
-4F4A4F0237341F1A20201A330606461A381D3E1A3E1A3E111A00005F0F5F014F13225F33
-7F33023333572A13702B012B2F5DFD32332F5D39ED5D11332FED33332F2F123939ED332F
-1112392FED39395D002F2F3FED332F2B3FED12392F5DED1217392FED393933332F5D2FED
-332F2B1112173931302B2B5D0114062322262735331E01171E01333236353426272E0127
-2E013534363723112311230E01070E012B01112311333216171E011733353315213E0133
-32161715232E01232206151416171E01171E01013426272E012B0111333236373E0108CA
-E2BE6ABA3D0917472D356145667943552A62377E6E0F12DDB57C0C3B2F4DCCA030BCF486
-B44847580A78B5017F24733155B53E0940B15B59723B562E642E7284FA5E36372F83572E
-1178962F2F2701429BC23C22D31331161A1E4C5A4844160B131026956E254426FC4E03B2
-45792F4D4DFDD505D12D302F9364DCDC12183024C935494E4F4648170C180C1E8E024F4D
-75241F1DFDA32D2F306DFFFF0089FFEB063E05D10036002C00000117002D035400000005
-B20F23015D00FFFF00AFFE59043D05DB0036004C00000117004D02280000001840115023
-60237F23030302500C600C7F0C030C2F5D35355D000200000000052706140016001A0065
-B90017FFE8403F0D10371818090C3719180910370315161575150318181701100D084213
-040E05010D08171740190119100B1A19300D500D700DAF0DCF0D050D0D021A00911C10F6
-ED332F5D33FD322F5D332F003F3C3F3FED12393F332F31305D012B2B2B2123113426272E
-012322060711231133153E0133321615090123130527BC1218195E4B4DA84DBCBC58BC63
-B5BEFC72FEF18AA5027C4D87262A294C3BFCBE045D7C4952DACD033FFDD1022F000100D5
-0366028705D100030027B90000FFE840140D10370118090C3702180910370101030300B1
-022FED003F332F3130012B2B2B090123130287FED688C205D1FD95026B00000200D50366
-041805D1000300070050B90004FFE8400E0D10370518090C37061809103700B8FFE84020
-0D10370118090C37021809103746000101050503070304B13F0601060600B1022FED332F
-5DED003F3C332F3C3130015D2B2B2B2B2B2B09012313210123130287FED688C20281FED6
-88C205D1FD95026BFD95026B00040095FFE3080705ED001B001F002B003700CA400C471D
-481F561D591F681E050BB8FFE040160E103701200E10371F1D1C071D171D021D291E1E1F
-29B8FFF44012090B37230C090B374F0D401B7A2F75350417B8FFE8404A0E103711180E10
-371F031B1B17512F034F0302030D030D115109022F51202940290229293551230A1E0840
-1E011C1E322A00260126262C2A1C1E062020390F39010D2000010000142A062FED332F5D
-335D11332F123939ED332F5DED2F2F5D003F3FED332F5DED3FED33332F2F5DED332F3F2B
-2B5D2B2B3130018710ED5D87C0002B2B015D010E012322263534363332161715232E0123
-220615141633323637330901230901140623222635343633321607342623220615141633
-3236032D1E934EC0D9DDBC417F3F0E3C73396D7F7B71497A250E02F5FCF4A5030C028ABE
-B2B5BABDB2B6BAB2596466585866645902BE1232E6D2C9F22121AD3233959C9698422302
-68FA2F05D1FBCCE0DADCDDE0DADADFAC8888ADAD87870002000FFFE8028605D3001B002B
-006E400D531D621D701C0316180B113705B8FFF040310B0F37001A010B1C051B1B051612
-120F5216092550050347080112121F2908401114372F0801081C1B001A0008030B2A01B8
-FFC0B3101437012F2BED17332F33322F5D2BED332F5D003FED3FED332F1112392F17392B
-2B31305D13371134363332161514020711141633323637150E012322263D0107133E0135
-3426272E01232206070E01150FB17B6F607C78A51D1B1A44693771395C6B4FF8622F0D0D
-0A190F0F19060B0C01A6EB01C7E299826D5CFEF7E6FE61592B214AA22C2B727FE162022B
-A980371E30110C0D0C0E156E5800000200920000044203B0000300070025401507CB0101
-05CB0307CB010105CB00031003300303032F5DED332FED002FED332FED31301321112113
-1121119203B0FC504C031803B0FC500364FCE80318000001008301BD0252038C00030017
-400B02020300000002300202022F5D332F002F332F3130011121110252FE31038CFE3101
-CF000002008301BD0252038C000300070023401306CB020205CB0304CB000006CB000230
-0202022F5DED332FED002FED332FED313001112111052111210252FE310183FEC9013703
-8CFE3101CF4CFEC9000100B10088042203F9000B0021401409090F032F034F0303030606
-00009000A00003002F5D332F002F5D332F3130133400333200151400232200B10102B7B6
-0102FEFEB6B7FEFE0240B70102FEFEB7B6FEFE0102000002007001AA026603A0000B0017
-0065400B06102326370610171A3700B8FFF0B323263700B8FFF04015171A3712CB06060C
-CB000910171A3709100B0E3703B8FFF0B3171A3703B8FFF040130B0E3715CB03030FCB00
-0920093009600904092F5DED332FED2B2B2B2B002FED332FED2B2B2B2B31300132161514
-06232226353436172206151416333236353426016B689393686893926949666748486766
-03A093686893936868934C674849666649486700FFFF001A0000055E073C023600240000
-011700D80031016B000AB602000C0B0607252B35FFFF0068FFE1041D05D1023600440000
-011600D8D900000AB6020036371D26252B35FFFF0073FFE5054608010236002600000117
-00D600A90175000AB601002F2B0F15252B35FFFF0069FFE703F3068C0236004600000116
-00D6F4000011400C014026502602002622060F252B5D3500FFFF0073FFE5054607500236
-00260000011700DA00A80175000AB601002C2B0F15252B35FFFF0069FFE703F305DB0236
-00460000011600DAF5000011400C012024302402002425060F252B5D3500FFFF00C80000
-049D073C023600280000011700D80033016B000AB601000E0F0203252B35FFFF006AFFE6
-046005D1023600480000011600D8F700000AB6020022231200252B35FFFF00C80000049D
-0801023600280000011700D900400175000AB60100120C0203252B35FFFF006AFFE60460
-068C023600480000011600D9FE00000F400A027026010026201515252B5D3500FFFF00C8
-0000049D0750023600280000011700DA004F0175000AB601000E0F0203252B35FFFF006A
-FFE6046005DB023600480000011600DA0000000AB6020022231218252B35FFFF0073FFE3
-05A208010236002A0000011700D600D00175000AB601002925070F252B35FFFF006CFE59
-0443068C0236004A0000011600D6FB000011400C0230354035020035311A23252B5D3500
-FFFF0073FFE305A207500236002A0000011700DA00CE0175000AB601002728070F252B35
-FFFF006CFE59044305DB0236004A0000011600DAF5000011400C0250336033020033341A
-23252B5D350000010073FE5905A205EC0038009540200906060E07261D06130E210E350E
-4901410E510E6506650B630E740E741C0F2CB8FFE04043090C37323236532E0D28032235
-40230123230C03101017340C021D34030A3131002A0F2B1F2B022B760901221022042B27
-040910216C25753A0F3A403A021A1509683910F4ED5D10F4ED331217392F2F5D2F5DED33
-2F003FED3FED332F1112392F5DED12393FFD322F3130012B5D0534262722242726023510
-002132041715232E01272E012322001110002132363711213521110E01071E0115140623
-22262735331E0133323603820302ADFEE066677001A1016C7F010999121F763945AF6FFA
-FEDD0130010660BF48FE7102535AD45E0103B79225742D091A583268626B152B0F5F6061
-0123C30165019D3D49EB184E1A1F29FEBFFEEEFEDFFEBF261E016DAEFD8129460F0E2516
-A2AC0E0CA00A1A4E0003006CFE590443068C002300300034009F406F243234320233200D
-10373D133E2A322C3A3044094B134C2A422C4B305B015D055A166A016C056A167C057020
-112F343F344F3403343433331E220512211528401E0407070B40030D2E41150731315033
-603302333300180F0601062124121A0006180092361F363F36022B1B18853510F6ED5D10
-E4113910FD32322F5D1112392F5D332F003FED3FED332F3FED1239393F11332F332F5D31
-305D012B5D2510002122262735331E01333236373E013D010E01232202113436373E0133
-321617373303112E01232206151416333236130323010443FEFEFEF459A9520A2EC86460
-7E23231E559B78C8EB514641BA5C6183490CB0BC4B81409BB2849952A534B3F301117FFE
-E4FEF61917C012352E29276E446644430121010790D14C474F272830FCD60261221DD0C6
-BCC23F058EFE8A017600FFFF00C80000053B08010236002B0000011700D600760175000A
-B60100100C060B252B35FFFF00B90000045F08010236004B0000011700D600220175001A
-4012014F1B6F1B9F1B031B112601001B170808252B35002B5D3500020020000005E305D1
-001300170060403D0E1201160408520B400C0F370B0B0C05350017101702170B10170304
-070C03070000120F150303140278190F19401950190309090B0E16030614076C1810F6ED
-1739332F5D10F6ED1739332F002F3F1217392F71ED12392F2BED17393130012311231121
-11231123353335331521353315330135211505E3A8C6FD19C6A8A8C602E7C6A8FE92FD19
-0455FBAB02D9FD2704558CF0F0F0F0FEA8CCCC00000100130000045F0614001E00504030
-031D161D751D0317140E51111112180D08421B041201010D08150F021A0091201F206020
-02141517030B1A110F0D881F10F63232FD17325D10F6ED2F2F003F3C3F3FED123912392F
-ED393931305D2123113426272E0123220607112311233533353315211521113E01333216
-15045FBC1218195E4B4DA84DBCA6A6BC0141FEBF58BC63B5BE027C4D87262A294C3BFCBE
-04F4869A9A86FEED4952DACD0002002C0000033307C8000B0025006DB9001BFFD040400B
-10370E300B10370C0C15520F1C1F1C021C191C192252700F010F0F09043206030A033201
-0825280F0C1F0C020C1828190C276D080B5A0A1405025A19036D2610F432ED32FDED32E4
-332FED2F5DED003FED323FED32332F5DED33332F2F5DED332F31302B2B29013533112335
-2115231133130E01232226272E0123220607233E01333216171E013332363702D5FDB4C3
-C3024CC3C35E077D663453262D3C20302D0288037E683351282A431D2E31019804A19898
-FB5F0730989724262B2A5B4B88A6242528295B470002FFF200000241063C0003001D0054
-40347C0673130204040DAA1440090C37141114111AAA0707020501081DAD0440090F3704
-10AD117F1F011F9204001A117F010101881E10F65D32FD32ED5D2FED2F2BED003F3F332F
-ED33332F2F2BED332F31305D21231133131406232226272E012322061523343633321617
-1E01333236350177BCBCCA6750283A1E202D17232170684E2F3220212C162421045D01DF
-81821A202322454181821B1F2322483E0002005F000002FF073C000B000F004D40150E32
-0D0D09043206030A033201082F0F3F0F020F0EB8FFC040150B0D370E0F116D0A080B5A0A
-140305025A0E036D1010F632F43210FDF43210E6332F2B2F5D003FFD323FFD32332FED31
-302901353311233521152311331321352102D5FDB4C3C3024CC3C32AFD6002A09804A198
-98FB5F060A9A0002FFFC0000023605D1000300070032401D025301010605057F00700202
-00027F0901099200041A027F050105880810F65D32FD32E65D2F2F5D002F3F332FED3130
-01213521032311330236FDC6023ABFBCBC05379AFA2F045D00020080000002DF07D3000B
-00190059401F0C701201121216AA0F0F09043206030A0332010819290C400B0E370C1329
-12B8FFC040130B0F37120C1B6D080B5A0A1405025A12036D1A10F432ED32FDED32E4332F
-2BED2F2BED003FED323FED32332FED332F5D333130290135331123352115231133131406
-232226353314163332363502D5FDB4C3C3024CC3C30A939C99979E454D49489804A19898
-FB5F073BA8CFCFA886726E8A00020001000002300668000D0011004840150006060A5003
-0310050F0D2900400B103700072906B8FFC040130B1037067F13011392000E1A067F0F01
-0F881210F65D32FD32E65D2F2BED2F2BED002F3F332FED332F3331300114062322263533
-1416333236350323113302308B8C8A8E924145414427BCBC06689AC0BE9C7A6B6283F998
-045D00010089FE5F031C05D10020004F402D1C20090C3709043206030A03320C01081717
-13531B0D1818102A1E1E0B02226D0A080B5A0A140305025A036D2110F4F43210FDF43210
-E61112392FED332F003FFD322F3F33FD323FFD3231302B21233533112335211523113315
-230E011514163332363733150E012322263534360174EBC3C3024CC3C3C2060942582141
-1309245122879A099804A19898FB5F981C29265150130B9E0A0BA08C22350002008EFE5F
-024605DB0003001B0056401C0820090C371B1753070D014402400B0D3702030E050D1104
-04142A0AB8FFC040170B17370A0A0E7F1D011D9200600F1A01607F0E010E881C10F65DE4
-FDE4E65D11332F2BED332F002F333F3F2BED3FFD3231302B01233533130E012322263534
-3637113311230E0115141633323637330183D4D4C3245122859C2508BC3C060742582141
-13090518C3F8990A0B9E8E3F6F19040BFBA31A361B5150130B00FFFF002CFFEB034D0801
-0236002D0000011700D6FF6C01750014B1011AB8FFC040090B0E37001A160415252B2B35
-0002FFC2FE5902AF068C0015001C005540340A011C0102551B651B751B0318161A1B1B1A
-1A123E150507070B40030D1A1A4F1301137F06010616121A1306160370150115921E10F4
-5D1732ED2F2F5D2F5D332F003FFD322F3FED332F332F1239395D31305D05140623222627
-35331E01333236373E01351123352137230B012313330209C8A828832C0A1C5F2D485816
-160DE901A5A69FB9B89BE4E31BC4C8100CB30B1C282828715103849EB40100FF00017B00
-FFFF00CDFE59057505D10236002E0000011600DCFB00000AB601001A0C0500252B35FFFF
-00C1FE5904AF06140236004E0000011700DCFF7C00000011400C01301A401A02001A0C05
-0A252B5D3500000100C1000004AF045D000B007D40512802D801DB090309010F0D1F011D
-021F0D2D012F0D300B400B540B69027A010C020203011A000B000809B4020B0A030A0802
-050A0507050105080B02600A700A020A0A00000D200D400D0208031A05890C10F4FD325D
-11332F332F5D3939003F3C3F3F1239393130018710C0C07AF51804C0018710FD08C0015D
-7121230107112311331101330104AFF8FE407ABCBC021FEDFDF901E974FE8B045DFDD102
-2FFDFC00000100C8FE59047605D1001A003F40240C20090C37111115530D0D0203043507
-01081010182A0A0A0105051C0F1C010414016C1B10F4ED5D11332F12392FED332F003F3C
-ED3F3FFD322F31302B29011133112115211E011514062322262735331E01333236353426
-02BFFE09C602E8FEE30204B79225742D091A583268620605D1FADFB0122F18A2AC0E0CA0
-0A1A4E581E3E00010005FE5901E906140018003D40240A20090C370F0F13530B0D020104
-01080E0E082A1616017F1A011A92041A7F010101881910F45DFDE45D12392FFD322F003F
-2F3F3FFD322F31302B2123113311331E011514062322262735331E013332363534260149
-8EBC6C0105AE8525642809184E285E52010614FA00123724A2AC0C0CA00B174F57153300
-FFFF00C8FE59053805D1023600310000011600DCFE000013400E01201630164016030016
-0A0400252B5D3500FFFF00B9FE59045F047C023600510000011600DC8B000013400E0100
-2310232023030023170D00252B5D3500000100C8FE59053805D10016009D401F00076107
-7107A107040C070B0C1B0736074607540765077507B001B0070A07B8FFC040510B113776
-06010F0102061F01150626013601340646014406560153066006790170060E0406015A01
-550602111115530D0D0207040806030A0104080110100A06010207130A78180F18401802
-0213046C1710F4ED5D10F4FD11393911332F2F003F33333F3C1239393FFD322F31300172
-715D5D002B5D71043501112311210111331114062322262735331E0133320480FD01B901
-330284B9CEB42751250B163A1E7F948A053EFACC05D1FBA00460FA18BFD10806A8050A00
-000100B9FE59045F047C00260045402B03150C191615751504100D084213040E050D081E
-1E22531A0D1D1D021A1791281F28602802100B1A0D882710F4FD325D10F6ED332F003FFD
-322F3F3F3FED123931305D0435113426272E012322060711231133153E01333216151114
-062322262735331E01333236373603A31218195E4B4DA84DBCBC58BC63B5BECCB4274E26
-0B163C1A4C6117162556024B4D87262A294C3BFCBE045D7C4952DACDFD0FBFCC0706A805
-0A262626FFFF0073FFE105DA0746023600320000011700D8009B0175000AB6020026270F
-03252B35FFFF006AFFE1047105D1023600520000011600D8E300000AB602001A1B060025
-2B35FFFF0073FFE105DA0801023600320000011700D9009C0175000AB602002A240F0325
-2B35FFFF006AFFE10471068C023600520000011600D9E400000AB602001E180600252B35
-FFFF00C8FE59059805D1023600350000011600DCF600000AB602002420050D252B350001
-001BFE590372045D002700574034000D100D200D032120090C370C090F131317430A0F05
-1C090826260253220D25251F2A05050913132940297029020C1B1A09882810F4FD325D11
-332F11392FFD322F003FFD322F3F2F3F3CFD322F11123931302B5D1E0133323635342627
-231133153E013332161715232E012322060711331E011514062322262735333C4E285E52
-0102A6BC70AB59312C2C0A2A4F3657A24B840105AE8525642809FA174F57153323045DA5
-5A4B0507C10A094D3DFCFB123724A2AC0C0CA000FFFF0086FFE505020801023600360000
-011700D6004A0175000AB6010035311A00252B35FFFF006EFFE503D7068C023600560000
-011600D6AF00000F400A017F38010038341A00252B5D350000010000000004EE05D1000F
-004140250D0A003203030F09043506030F0F111F114F11030B020B085B090D0009140204
-5B4F0501052F5DF432ED393910E4332F2F5D002F3FFD3212392FED393931300121352111
-21352115211121152111230214FEB4014CFDEC04EEFDEC014CFEB4C602E48F01AEB0B0FE
-528FFD1C0001003EFFEA02FD059E0023006E40210420090D37181507510A0A0E030F140B
-3E110F0E0523231F3F03094F257F250216B8FFC0401E090B3716160713008C250909070C
-0A0E111504181A0C07400D103707882410F62B32ED17392F12392F10F63211392F2B5D00
-3FFD322F3F3333FD322F1112392FED393931302B250E012322263D012335331123353311
-331121152111211521151416171E01333236373302FD357D31ABB27F7F7F7FBC0184FE7C
-012DFED30818164D4F2E64160A0A0E12B8CBA88601249E0141FEBF9EFEDC865358632B28
-251B0900FFFF00B2FFE1052907C8023600380000011700D700610175000AB601002B1E0D
-1D252B35FFFF00B1FFE104570653023600580000011600D70600000AB601002417091625
-2B35FFFF00B2FFE105290746023600380000011700D800630175000AB6010020210D1D25
-2B35FFFF00B1FFE1045705D1023600580000011600D80100000AB60100191A0916252B35
-FFFF00B2FFE105290801023600380000011700D900630175000AB60100241E0D1D252B35
-FFFF00B1FFE10457068C023600580000011600D90100000AB601001D170916252B350001
-00B2FE5F052905D1003400634044231223183D093D2139224C094C214B22771377170A33
-20090C372E2E2A53320D1C24060D031534060A2F2F272A00060023030C1B141E76360F36
-1F364036030F140C6B3510F4ED5D10F6ED1217392FED332F003FED3F1239393FFD322F31
-302B5D053436372206232226272E01351133111416171E01333236373E01351133111406
-070E01070E011514163332363733150E012322260314050509190F8CD0475147C621272C
-976A6B962D2721C647512D683D0405535A24511108344B2A8CA8741A271601494852E8A9
-037BFC7B798C394142414239936D038AFC85A2F1502C3B10143C17524E1B089F0E0C9F00
-000100B1FE5F0567045D002A005C40220B0619077A07032720090C370205150905114205
-0A010822221E53260D23231B2A29B8FFC04015091037292914021A17922C1F2C602C020B
-1A08872B10F4ED5D10F4FD32322F2BED332F003FFD322F3F3FED3F3C123931302B5D0437
-350E01232226351133111416171E0133323637113311230E011514163332363733150E01
-23222635340395065FAE69B0C4BC101A1B565249AD4BBC1E0607535A24511108344B2A8C
-A81D1D7C4B50D7D002D5FD8455792B2C284C3B0342FBA31B351B524E1B089F0E0CA08D24
-FFFF005C0000078D08010236003A0000011700D601690175000AB60100110D0600252B35
-FFFF005600000636068C0236005A0000011700D600BB0000000AB60100110D0600252B35
-FFFF0006000004E608010236003C0000011700D6FFEE0175000AB601000D090500252B35
-FFFF003DFE64047F068C0236005C0000011600D6DD00000AB601000C080400252B350001
-00B900000308061E0010002440140000043F0D0009080000081A6F097F090209891110F6
-5DED332F003F3FFD322F313001232E012322061511231134363332161703080A1F642679
-67BCC2BF3F652A055E09136B8CFB7D0482C2DA0C08000004001A0000055E08000012001E
-00210025013F40862B20372040205A18551A501E55206918651A651E0A180B170D4A0646
-125906561278027703082020211F02370187010201140012002021033704870402041405
-05060606091226062912370638124606491258127A0675120B24240C702501251651A00C
-F00C02060C160C3F0CF00C040C03340F2170210221212006120405201C401C020C1CB8FF
-C0406C393937501C701C021C01050824400E10370F242F240222222440090D372413290F
-0F2F0F4F0F8F0F9F0F050F19290009200940098009900905090F270106090F122405050C
-0024003A0042005A006A0074000700006E270F27010A052B0535054D05550565057B0507
-05642610E65D5D10E62F5D1217395D2F5DED2F5DED2F2B332F5D2B003F3C2F5D2B335D12
-17392F5DED2F5D72ED2F5D12392F3130015D8710FD5DC0C0C08710FD5DC0C008C0015D00
-5D212303210323012E013534363332161514060727342623220615141633323613090207
-2337055ED394FD8094C901F83139A17373A039302A47393948493838487DFEFEFEFD021D
-F39595019FFE6105571F65406D90906D40651FC4364B4A37394B4CFC6602CBFD3505B7CD
-CD0000040068FFE1041D07330032003F004B004F00D6B50C0A190A0230B8FFC040880B0E
-37590E51215C38690E63216F397B0A7A1474207B380A0208343D3011401102111149084F
-4F4E4E43AA062916299F290329400B0D37292F0123494F1F011F291F184149043D41080A
-01084E400D10374C4C4E40090C374E4E2640292F2C3F2C022C2C26297F468F4602464600
-0F1F011F1134021A001F0B0091510F511F513F51033A1B0B855010F6ED5D10E6113910FD
-32322F5D12392F5DED332F5DED12392F2B332F2B003F3FED3FED33332F5D123911392F2B
-5DED332F332F1112392F5DED123931305D012B5D2123350E01070E012322263534363736
-2437353426272E01232206070E010723353E01372E01353436333216151406071E011503
-110E01070E0115141633323603342623220615141633323613032313041DBB1955282F7A
-5297D26D6566011EA42E29296D3F3A692A3150130A2369311C259F73739E2E237D87BB56
-E9445164747763A443473939484938384895F3959577113D12171FC89B7F9D2D2D20081D
-4156171811140B0D1D07BF0914081E532E6D90906D335B1F22AA9AFE1D01370514131761
-5560614D042C364B4A37394C4D0262FEEE011200FFFF000E0000076D0801023600900000
-0117008D01DE01750011400C020F164F16020016140607252B5D3500FFFF0068FFE3073F
-068C023600A000000117008D01690000000AB6030055541B00252B35FFFF0073FF6E05DA
-08010236009100000117008D007801750013400E03303A403A603A03003A3B0F00252B5D
-3500FFFF005DFF6C0471068C023600A100000116008DE2000011400C03302E402E02002E
-2F0C00252B5D35000001015A03400249045D00030014400A01560205032D000201022F5D
-ED003FED3130012311330249EFEF0340011DFFFF005C0000078D08010236003A00000117
-004301730175000AB60100100D0600252B35FFFF005600000636068C0236005A00000117
-004300C30000000AB60100100D0600252B35FFFF005C0000078D08010236003A00000117
-008D01690175000AB601000F100600252B35FFFF005600000636068C0236005A00000117
-008D00BF0000000AB601000F100600252B35FFFF005C0000078D07500236003A00000117
-008E016C01750020B10213B8FFC040120D10370F13010100135F13020013100600252B5D
-355D2B35FFFF00560000063605DB0236005A00000117008E00BF0000001EB10213B8FFC0
-40100D10370F1301010013010013100600252B5D355D2B35FFFF0006000004E608010236
-003C000001170043000A01750014B1010AB8FFC040090D1037000A0A0500252B2B35FFFF
-003DFE64047F068C0236005C000001160043FF000015401001200B300B600B700B04000B
-090400252B5D35000001FFED03E40186061300030032B90003FFE4B70D10370101030100
-B8FFAEB30D103700B8FFE840090A0C3700007F0201022F5D332F2B2B003F332F3130012B
-010323010186A5F4010F0613FDD1022F0001FFD00685051606FD00030011B60150020000
-05022F11332F002FED3130012135210516FABA0546068578000100890000048B05EE0028
-00934063411253125B1A6312730273129024B603B6240923200551000810082008030808
-1F1C09510F0C1F0C3F0C4F0C040C141418490C01100202284A01080F2A1F2A022327021C
-1F20050C08215F1D6F1D7F1D031D0A061306081D13040220004000020000022F332F5D12
-17392F2F332F5D332F3333FD321139395D003FFD323F1239ED332F2F5DED3939332F5DED
-393931305D2901353E0137233533352335333534123332161715232E012322061D012115
-21152115210E01071521048BFBFE67620E9DA4A4A3FDCD6998400A3E98568C8B016CFE93
-016DFE8F0F705A0345CF1B817B868C86A7C801012211CE2A30A59094868C86659F2C0B00
-000200B1FFE60511053200180022005F4013380D391C491C580D6A217A21060C100B0D37
-07B8FFF0402A090A37191F290F2615690F790F05013222220F1F32150B0B07330F090C0C
-1913260001000024220114122FFD3211332F5DED332F003FED332F2FED12392FED5D2B2B
-31305D01211416171E013332363733150E0123200011100021320011272E01272E012322
-06070511FC66423C3AA3607AEA590D82C07FFEC9FEAD01420113FF010CBE02262928875A
-9FD50D027884B53E3C3B5648D53637015B0141013A0176FECDFEE92A549133333AD4B100
-FFFF00ABFFE1078305D50036023B9200003700BB023700000117024103F2FDC60016400C
-040302100A010B400B7F0B025D1135003F353535FFFF008CFFE107A405ED0036023DA600
-003700BB02910000011702410413FDC600384026040302360A0403023900392039403980
-39FF3905013100315B317B3103000900093F094F09035D11355D11355D11353535003F35
-3535FFFF008AFFE107A405DA0036023FA400003700BB02910000011702410413FDC60038
-4026040302320A040302350035203540358035FF3505012D002D5B2D7B2D03000900093F
-094F09035D11355D11355D11353535003F353535FFFF0099FFE1076F05DA00360240A600
-003700BB023100000117024103DEFDC6003640240403020E0A040302116F118011FF1103
-01092B093B0944095B097F0905000400043F04025D11355D11355D11353535003F353535
-00010061FE5901FA00880003002CB90002FFE840170D10370318090C3700180910370F01
-010101000D0202002F332F003F332F5D3130012B2B2B1B01330161A5F4FEF1FE59022FFD
-D10000010161FE59037000140014002440150B021B012B013901041207070B53030D0E2A
-0000062F332FED003FFD322F2F31305D0514062322262735331E0133323635342627331E
-010370B79225742D091A58326862060399020659A2AC0E0CA00A1A4E581D491913340001
-0212050C0305068C000300144009030302002D100301032F5DED002F332F313001032303
-0305319131068CFE8001800000030100050C0418068C00030007000B003F401506050AAF
-090902000002072B0640090A37060A2B0BB8FFC0400C090B370B06002D0B100301032F5D
-33FD322F2BED2F2BED002F332F12392FED3939313001032303012335330523353302FD31
-803101FDBFBFFDA7BFBF068CFE800180FE8CC3C3C300FFFF00070000055E05D102360024
-00000117019DFDF5FF450012400A020E03020E1F0E4F0E025D1135003F35FFFF00000000
-059005D10037002800F300000117019DFDEEFF4500204014010F030F111011401103011F
-0C010C00400101012F5D352F5D355D003F35FFFF00000000062E05D10037002B00F30000
-0117019DFDEEFF4500204014010F030F112011401103011F0C010C00400501052F5D352F
-5D355D003F35FFFF0000000003C805D10037002C00F300000117019DFDEEFF4500244018
-010F03011F0C010C00400201020F111F11401150116011055D2F5D352F5D35003F35FFFF
-0000FFE1069905F00037003200BF00000117019DFDEEFF45002240150227030F29010227
-1F270101000F000F100F700F035D1135355D11355D003F35FFFF00000000060105D10037
-003C011B00000117019DFDEEFF45002440180109030F0E1F0E2F0E03011F090109001F04
-4004700403042F5D352F5D355D003F35FFFF0000000006D705F0003701BB00B700000117
-019DFDEEFF45002A401E012B03011F2B012B00001C101C201C031C0F2D202D502D602D70
-2D8F2D065D2F5D35115D35003F350004FFCB00000267068C00030007000B000F005C401D
-0A090FAF0C0C06070706060205010B2A0A40090F370A0A0404000E2A0FB8FFC04015090F
-370F0F0707017F11011192001A7F010101881010F65DFDED5D11332F332F2BED11332F33
-2F2BED002F3F332F332F12392FED39393130212311331303230301233533052335330177
-BCBC0438543801B0ABABFE0FABAB045D022FFE800180FE8CC3C3C300FFFF001A0000055E
-05D1021600240000FFFF00C80000052B05D10216002500000002001A0000058605D10003
-00060058403C49056A050205041A000003061A01010215001A0125002A0145004A014B02
-4403590256036B0264037B0275030E020305030000080105010203065401002FED3F1239
-012F11332F17395D31308710FD8710FD04C0005D2901012109020586FA94023201080127
-FE50FE5105D1FAD7047BFB85FFFF00C80000049D05D1021600280000FFFF007E00000508
-05D10216003D0000FFFF00C80000053B05D10216002B0000FFFF0089000002D505D10216
-002C0000FFFF00CD0000057505D10216002E00000001001A0000056205D10006006C404E
-0902390258020378017703020203020114000600020314040405490546067C0573060405
-030405002400390042005A006A007400070000080F08010F08010A042B0436044D045504
-65047B0407042F5D5D5D11332F5D002F3F3130015D8710FDC08710FD08C0015D005D2123
-09012301330562D5FE2CFE2CCB022CF00505FAFB05D1FFFF00C8000005F605D102160030
-0000FFFF00C80000053805D102160031000000030072000004BF05D100030007000B0047
-40130535060609013502030A350908054009133704B8FFC0401609133704050504030204
-0908720D0F0D1F0D0209680C10E65D10E41117392F2F2B2B003FED3FED12392FED313001
-213521032135211321352104BFFBB3044D34FC1B03E534FBB3044D0521B0FD08B0FC77B0
-FFFF0073FFE105DA05F0021600320000000100C80000053B05D100070027401703350603
-010501140078090F0940095009030414056C0810F6ED5D10F6ED002F333FED3130212311
-2111231121053BC6FD19C604730521FADF05D100FFFF00C80000049605D1021600330000
-000100760000050005D1000C00EB404709040908450B540B6409640A660B9309930A960B
-A409A30AA70B0D0608060B1608160B28032708340A340B430A430B5903550B670B760B8B
-0399049908B804B808EB04EB08150BB8FFC0B32529370AB8FFC0B325293709B8FFC0B325
-293708B8FFC04030262937030203080908B3040304030B0A0BB302030264048D02020403
-0203080B3501083505030403A009B009D0090309B8FFC04023191E371009200960097209
-D009E00906090703040B0908070602000010000200000E022F11332F5D1217392F2F5D2B
-71332F003FED2FED11173931305D011087ED87C01087ED8708C0012B2B2B2B5D71290135
-090135211521011501210500FB76026CFDA80448FCC0024AFD8A039AB80258020EB3B0FE
-061AFDA3FFFF0000000004EE05D1021600370000FFFF0006000004E605D10216003C0000
-FFFF00440000053805D10216003B0000000100B30000064405D10023006240402515251E
-021B067518011834380948096F090309192209030810030822142311141023071B180714
-108008A008B0080320255025702503080825240F253F25025D1112392F5D5DC4ED393910
-C42FED2FED002F3F1217392F5DED5D393931305D011406070E01071123112E01272E0135
-1133111416171E01171133113E01373E013511330644514D50E197C59AE24B4E51C63B34
-359A62C5619C353836C6038E9DD74345460AFEBE01420B484245D69C0243FDA66D8E2C2D
-2F0703E4FC1C082D2E318571025A0001006C0000062005F00027007D40125B195B256C1A
-641D64216C24791A79240821B8FFC0B3090B371DB8FFC0403B090B373002301440024014
-041925140204160B341F02261835011608251202191214081502141C272222290F29010F
-291F299029A029040E15171C2FC4ED5D5D11332FC4123939ED2FED2FED003F3CFD3C3FED
-1217395D31302B2B5D2901113E01373E01353426232206151416171E0117112135213526
-023510002120001114020715210620FDC03C772C2D34FEDCDCFE342D2D763CFDC0019A9D
-CB0177013101310177CB9D019A01832658393B9F6ACEF9F9CE6A9F3B395826FE7DAE7C5A
-0138C20114015EFEA2FEECC2FEC85A7CFFFF007E000002E207500236002C00000117008E
-FF240175001940130200104010501060107010050100100D0409252B355D3500FFFF0006
-000004E607500236003C00000117008EFFED01750019401302000E400E500E600E700E05
-01000E090500252B355D3500FFFF006CFFE10443068C0236012E00000116019DE200000A
-B6020024210800252B35FFFF006DFFE603EE068C0236013000000116019DCC000013400E
-014041504170410300413E1219252B5D3500FFFF00B9FE64045F068C023601C600000116
-019D1D00000AB601001A170E16252B35FFFF00A000000193068C023600D500000117019D
-FE8E0000000BB601000704020325012B3500FFFF00B1FFE2045C068C023601D100000116
-019EFB00000F400903020100221F0717252B35353500000200B9FE64048D061400180037
-0077404F16200D1037070F4A1B4326433756267929062E200D0F3733200D103705200D10
-371615203E5F21012121032B3E0C0135400309080C15120F200120281B12122008191B00
-90391F390132071A08883810F6FD325D10F6ED1239392FED2F5D1239003F3FED3FED1239
-2F5DED393931302B2B2B5D012B011400232226271123113436333216171E011514060715
-1E01073426272E012B0135333236373E01353426232206070E0115111E01333236048DFE
-F3CD4FB03FBCFDDF5A953B39448B7F9FBCC2453A3B924924244282272E2D8A6D49682120
-1E42964895A101BCCAFEF82C2AFE2405D2E0FE2B2E2B8A5B7FBD25111AC797596F1F2016
-A01D1E2262557074352C2C753EFCA2261F9D0001003DFE64047F045D0008006940497507
-01070607081A00010007061A04050505030C0A001A002A004A0059006900750007000505
-15052505450556056605730507050001011A059004A0040204040A091F0A4F0A5F0A035D
-1112392F5DC4ED10C42F5D2F5D003F3F31300187FDC08710FD08C0005D09011123110133
-0901047FFE37BCFE43CC0157015A045DFBDBFE2C01D40425FCC4033C0001006CFE6403D6
-0614002F0058401D4600570065287F1178207D21061D1A3E1B012D3F0F070C1A1A19121C
-07B8FFE04018090C37000701071C070BB40303310F313F3102231B12853010F6ED5D1133
-2FED33332F5D2B2F1239392F003F2FED3FED3931305D251E011514060723353E01353426
-2B012226353412373E013735213521150E01070602151416171E01171E013B013216039A
-201C5A43B35A4C3D2F91E5DE5C4E4BC56CFE3402E875E55A5972060C0A31272479385647
-664B285B2854A93F0E4F7745394CE8E58C01007770CD5E099E874ECE7875FEE88F224828
-264B18160534000100B9FE64045F047C00160038402303151615731503100D084213040E
-05010C0D08021A0091181F18601802100B1A0D881710F6FD325D10F6ED003F3F3F3FED12
-3931305D0123113426272E012322060711231133153E0133321615045FBC1218195E4B4D
-A84DBCBC58BC63B5BEFE6404184D87262A294C3BFCBE045D7C4952DACD0000030089FFE1
-04750614001700240031006CB9002FFFD6B30A0D3729B8FFD640400A0D37212A0B0D371B
-2A0B0D37662C01263E0F241F24022424061E3E3A124A120212012C3E3506450602060A25
-181A0000331F333F330224261A800C900C020C2F5DFD325D11332FFD32003F5DED3F5DED
-12392F5DED5D31302B2B2B2B011406070E01232226272E01353412373E01333216171612
-072E01272E01232206070E010705211416171E01333236373E0104752E243AD29898D23A
-252D2D2639D39797D339252EBD043120296C4F4F6C29222F040272FD8E2E2428704F4F70
-28242E0300BEFD548789898754FDBEAE010753828A8A8254FEFA548FD6364639394637D5
-8FA18EE93E453E3E453EE900FFFF00BB00000177045D021600D50000000100C1000004A8
-045F001800D3403B0601060216182618451856186618071C023A0169027A029701A602A6
-18C70208020203C60101860101011A001800090801F90801080B0A03090109B8FFEE4040
-10183709B402181703177F0301091808020305010C1010143F0C05060505011A172A1736
-178017A417051517251777179417E917F917060917180201050F0F00B8FFF04013090E37
-00001A0F1A1F1A3F1A0308031A05891910F6FD3C5D11332F2B332F17395D71002F2F3F3F
-FD322F111217395D3130018710C0C07AF52B7118C0C004C07172018710FD5D7108C0015D
-71212301071123113311013E013332163315232E01232206070304A8F8FE3D70BCBC0180
-487F3F1C3C070B102F0D2F4D1DFB01E96DFE84045DFDDA01A14F3802A602022F21FEF100
-0001003D0000047F061400070085401305040502020306011A07000002031A04040505B8
-FFF0401C0C10372B002604200703050402030601000806680701070506030400B8FFC040
-260910370C001C004B005A006A00790006008D090F090103041304440455046504760406
-04820810E65D5D10F65D2B1117395D2F003F3F17393130015D2B8710FDC01087FDC008C0
-08C0012123090123010333047FCDFEB8FE97C401D1D7D3033DFCC3042001F400000100B9
-FE640465045D00150046402C12200B0D3703200B0D37080205140B051042050900080A0C
-0102131A0092171F1760179017030D091A0A881610F6FD3C5D10F6FD3939003F3F3FED3F
-3C12393931302B2B2123350E012322262711231133111E013332363711330465BA4A874E
-4B7854BCBC209E5B5D8836BC764E3D3650FDF305F9FCBA2752433C034000FFFF003D0000
-047F045D02160059000000010068FE64041106140046008A403C0F020F06090E1B0E241E
-24283415361E36284428473C562D563C691779170F1918333F32320C24213D22013F3F0C
-030C191C3232232121122B1B1C04B8FFD6400E090C37040408B4231C1280000100B8FFC0
-400B090C370000483A1B12854710F4ED11332F2B5D123939ED332F2B2FED12392F2F332F
-1239003F2FED3FFD3212392FED393931305D0514060723353E013534262B012226272E01
-353436373E0137352E01353436373523352115212206070E01151416171E013B01152122
-06070E01151416171E013B013216171E0104115B42B45C4B3A2E8C8CB93F424532302C89
-4C7D96575AE40338FF00446D302D3641332D7650AAFED942692F2B334B403F995A1C4467
-211F226055A83F0E4F7844374E36393C97584E84353145130B1CA56853873A069A9E1D22
-2066434F621A1716A52827256A3B66721919072F25235F00FFFF006AFFE10471047C0216
-00520000000200B9FE640494047C0011001E0042402C3A17351E4A17431E560D05060315
-3E0F041C400309080C121B3A004A00020090201F206F200219071A08881F10F4FD325D10
-F65DED003F3FED3FED123931305D011000232226271123113436373E0133320003342623
-220615111E013332360494FEEBDE41A348BC47423EBB66F30100C2A0929E8D49774BA2B0
-0241FEFEFEAB242BFE2B04227BB9423E42FEDAFEDFDACCC0B6FE6D221DDE00010069FE64
-03FA04770029005C40120C020C06201325233614362340237A1F0817B8FFE040140E1037
-3F194F190219191D3F1504030C263F0B04B8FFD64011090C370418180408B400002B201B
-12852A10F4ED11332FED33332F2F2B002FED3F3FED332F5D31302B5D0514060723353E01
-3534262B012226272E013510002132161715232E01232206151416171E013B01321603FA
-5E3EB1564D3C2D5C75C64B49530137010354A0430C5E9D44A6BD393232814B64738E6057
-AA3B0E4B7947364F3C4342D092010E0144251BD33E32EEC1708E2D2C2799000100B1FFE2
-045C045D00170030401F1607050F3E0903560366037903880305030A151A0091191F1901
-091A06871810F6ED5D10F6ED003F5DED3F333130011406232226351133111416171E0133
-3236373E01351133045CF4E2DFF6BC14201F6B5C56731E1D15BC0197DADBD7DE02C6FD7F
-5D782E2B2B2C2C2C7B5A028100010030FE640488045D000B00A240492A02250839023408
-4B02440879020710091A0A0B0A071A060506011A000B00031A04050402050B080A000606
-0A0405064A0445066A0465067A04770608040C0605080B050204040A00B8FFE040100A10
-3700000D2F0D010604200A1037042F2BC45D11332F2BC4121739003F3F5D111739313001
-8710ED8710ED8710ED8710ED4B535840140B030A070002030A0601080409070005040906
-010F0F0F0F59005D0123090123090133090133010488D5FEA6FEA2CB01BCFE4FD5014F01
-53CBFE4FFE64026BFD95030202F7FDA80258FD11000100B0FE6405E3045D0023006B4047
-1B062618751802183D39094909020919220903081005080C221A3F237F230223111A3010
-7010021023071B18071A109008C008025025602502080825240F25010F251F253F25035D
-5D1112392F5D5DC4ED393910C42F5DED2F5DED003F3F1217392F5DED5D39393130011406
-070E01071123112E01272E01351133111416171E01171133113E01373E0135113305E360
-4F52C873BB73C753505FBC4B34388643BB4386383B44BC01BE72A835373705FE68019806
-343936A772029FFD9C718723261E0403C7FC39051C27287B7802640000010071FFE20611
-045D003D0079402D361F3632441F4432551F55326804680F691A69377D1A7D370C283B28
-0903061605210D303E060A3A400C0E3718B8FFC040240C0E37361B001B1B13003A29090A
-291A18139028A028C0280328283F3E1F3F3F3F6F3F035D1112392F5DC4C4ED393910C4C4
-2FED2FED2B2B003FED39393F1217392F31305D011406070E0123222627230E0123222627
-2E013534123733150602151416171E01333236373E01371133111E01171E01333236373E
-01353402273533161206112F33379D7360A2250627946671A333332F7290E4879F101E1A
-5D47334714161D06BA091C1518393A465E1B19169D89E4907201F760C14B505963434462
-5D4C4CBF61AA0115A7116CFECCB742713F37491911122C0F0248FDB8112C111316473937
-7A41B601346D11A7FEEBFFFF00050000022D05DB021600770000FFFF00B1FFE2045C05DB
-023601D100000116008EFB000015400F02301D501D601D0301001D180717252B355D3500
-FFFF006AFFE10471068C0236005200000116019DE200000AB602001B180600252B35FFFF
-00B1FFE2045C068C023601D100000116019DFB00000AB601001B180717252B35FFFF0071
-FFE20611068C023601D400000117019D00B60000000AB60100413E1300252B35FFFF00C8
-0000049D07500236002800000117008E00500175000DB7020100110C020325012B353500
-0001FFFF0000060705D1002500614025652476240216341F1F061E1A351B03093506182F
-073F074F077F0704070717590F010F1500B8FFC04014090D370000270F27011A1F1D011D
-1D1F17141A182F33FD32322F5D2F5D11332F2BED5D12392F5D002F2FED3FFD3212392FED
-31305D011406070E012B0135333236373E01353426272E01232111231121352115211121
-3216171E010607534957AF8A6E5D5B782F38343135329583FEEBC6FE520468FE0C015398
-BF554C4901CC6CB13A4530B11022286F4E4B73232213FD220521B0B0FE6824423BAEFFFF
-00C80000048A07ED023601EB00000117008D003501610015401001300840086008700804
-0008070405252B5D350000010073FFE5053905EC002A006A400C3A1C491C58057606790C
-0511B8FFE040370A103701200A103720341D1D0F032A2A26340309131317340F021E1E13
-000010000200002C0F2C010F2C1F2C2F2C3F2C041D206C09682B10F6FD325D5D11332F5D
-33332F003FED332F3FED332F1112392FED31302B2B5D250E012322242726023534123736
-243332161715232E01232206070E01072115211416171E013332363733053963EC91A9FE
-EE61616969625F0112A98CF65F104EF98D6DAE4846580F0334FCC258474AC4708AF75010
-4127356863630120B7AF011F66626C3427DF40523A3B3BAD72AD8BD94648494A4300FFFF
-0086FFE5050205EC021600360000FFFF0089000002D505D10216002C0000FFFF007E0000
-02E207500236002C00000117008EFF240175001940130200104010501060107010050100
-100D0409252B355D3500FFFF002CFFEB02EA05D10216002D000000020012FFFD08A205D1
-000E003D0066B3460C0130B8FFACB30A10371EB8FFC0401D0B0E37073437371618353503
-28282C352408341637081416163500150FB8FFF440110E11370F713F2F3F011813003501
-3535282F332F5DED5D10F62BFD11392FFD32002FED2FFD322F3FED12392FED31302B2B5D
-013426272E01232111213236373E01371406070E01232111210E01070602070E01070E01
-2322262335331E01333236373612133612372111213216171E0107D33235379083FEEC01
-0F858F363834CF554754C098FDEEFDF0030B0308251D1D492F306544153C0C0E0A1E0F24
-401647430E050B040391015298C0554C4901C94B72232510FDCB1A252769556CB0374238
-052171D955D6FEEC595A6B2B2C2603C001021617470146012D62014487FDB823423BAE00
-000200C80000088305D1000E002700554020171E07342121161F1B030834161A560F0120
-1F081400166F160216161900150FB8FFF4400F0E11370F71294029011D19141A6C2810F6
-FD325D10F62BFD11392F5DED39395D002F2FED3F3312392FED39393130013426272E0123
-2111213236373E01371406070E0123211121112311331121113311213216171E0107B432
-35379083FEEC010F858F363834CF554754C098FDEEFD65C6C6029BC6015298C0554C4901
-C94B72232510FDCB1A252769556CB037423802DEFD2205D1FDB80248FDB823423BAE0001
-FFFF000005FD05D1001D00504032000E48175817600E620F700E700F0708011A350B0B01
-07033504031301131412121F5F067F0602060306070014037F0101012F5D33FD32322F2F
-5D11332FED002F333FFD3212392FED123931305D2123112135211521113E01333216171E
-01151123113426272E01232206070273C6FE520468FE0C5FF66765AA3D3D45C6161E2079
-646AC3660521B0B0FE2D1F33323534A373FE11018C4A8C2B2E312622FFFF00CD00000575
-07ED023601F200000117008D003C01610010400A01702301002321050025012B5D350002
-0006FFF904E6078F001A002800AF405A29033801461955140419191A1814171617161716
-191A130001001617181A010500070B0B0F35071B0F21702102212175250125AA0F1E011E
-1E0003281A1B221A702101211B2100700A010A360156016501760104160A01031700B8FF
-E0401409103700002A502A012A400910371720091037172F2B2B5D11332F2B1217395D2F
-5D1139392F5DED2FED003F332F5DED5D332F5D332FED322F11121739018710FDC008C001
-8710FD08C03130005D09010E01070E012322262735331E01333236373E013F0101330901
-030E0123222627331E013332363704E6FDCA225D3634612D2872100E0F462D14481C203F
-1624FDD6DB01B301862105C9A8A8C905B602605E5F5F0205D1FB1B4C621B19110801B902
-09060B0C34324F044FFC92036E01BEA6A8A8A67063627100000100C8FEAF053B05D1000B
-0032401C060203043409000B0913000002061407780D400D700D020314026C0C10F6ED5D
-10F6ED12392FED002F2F33ED3F33313029011133112111331121112302A4FE24C602E7C6
-FE24BB05D1FADB0525FA2FFEAF00FFFF001A0000055E05D1021600240000000200C80000
-052C05D100120021003E40256311011A340C0C070B3508031B3407080A0A131556000100
-71230F234023020C1B14076C2210F6FD325D10F45DED332F003FED3FED12392FED31305D
-011406070E0123211121152111213216171E01073426272E01232111213236373E01052C
-554754C098FDE403E5FCE1015C98C0554C49CF3235379083FEE20119858F36383401CD6C
-B037423805D1B0FE6823423BAE724B72232510FDCB1A25276900FFFF00C80000052B05D1
-021600250000000100C80000048A05D10005001F401003013504030000070F0701021403
-6C0610F6ED5D11332F003FED2F3130012111231121048AFD04C603C20521FADF05D10002
-000AFEAF059E05D1000D00130049402A09121A124A110310340A030C1307340301051013
-0A0A070E140C0C0113200001000015131307070413052FED392FED11332F5DED392FED12
-392FED002F332FFD32323FED31305D01231121112311333612112111332111210A010705
-9EBCFBE4BC78829B03728DFEADFE0E0E9476FEAF0155FEAB0201D602B1019AFADF0475FE
-9BFDAFBFFFFF00C80000049D05D102160028000000010020000007A805D1003700C7402E
-093318332933401D40244135541D54247518711D73240B27133333351A130E0C0E020116
-09103701130037000708B8FFEA405A091037081309090A271F1A032C223237070A0C0E33
-35072C02142D350409021521052C03002F0A20375F0A50376F0A6037062C2C0137022733
-350600C5220414051515080A070C0E1A0609C51F0505393810393F395F397F39045D1112
-392F33F41739322F10FD32F41739322F5D002F3F1739FD322F121739FD111739018710FD
-2BC08710FD2BC08710FD8710FD3130005D21230123112311230123012E01272E01272E01
-2B0135333216171E01171E01171133113E01373E01373E013B0115232206070E01070E01
-0707A8F2FDF469C46BFDF4E6025158682013251C1B533C3C47A7B23D0B1E0F2C8F56C45C
-912E121D093CB5A5473C424B1E1D25132A7D3E02A9FD5702A9FD5702FE3A9C693D571C1B
-18B17FAD1E5824696608029DFD610663702C5519AC80B1171C1B5B3A8587270000010051
-FFE5048505EC0040007F40145401583B6701693B7F0B7F0C7031703274380932B8FFE040
-3F0B10370B200B10373E3D1D3420200934703001303029343402100D7F0D020D0D113409
-0A3D1E0B0D37171E0B0D37236C3A1E1E3D3A030C171503734231310C2F332F10F6ED1217
-392F2FED2B2B003FED332F5D3FED332F5D1112392FED393931302B2B5D011E0115140607
-0E012322262735331E01333236373E01353426272E012B0135333236353426272E012322
-06070E010723353E01333216171E0115140607151E010416303F5B4650E68593FB4A0F63
-F97148A83436313C33339159C9B3ADD2352E2D6F4C4E843B3064170D4BF87E7BB14B4E52
-A37D347602CD2A816669AA3C4444371EDE3B4B2A292D6F454F651F1E1BA97F7836521818
-151E1411340DDB2036272C30885A7FB01B0F092F000100C80000053905D1000900644023
-0B020407190703070715075B0253076C0262077F0270077608C802E602E707F6070D07B8
-FFE840240B0F3702100C0F3707060102040308030308030807021400780B0F0B400B0207
-14046C0A10F6ED5D10F6FD113939003F3F1217392B2B31305D7121231101231133110133
-0539C5FD1CC8C502DBD104A9FB5705D1FB690497000200C800000539078F000900170093
-40320B020407190703070715075B0253076C0262077F0270077608C802E602E707F6070D
-0A0F10701002101014AA0F0D010D0D07B8FFE840330B0F3702100C0F3707060102040308
-030308171A500A600A020A111A100A10000403080702140078190F194019020714046C18
-10F6ED5D10F6ED113939111239392FED2F5DED003F3F1217392B2B332F5DED332F5D3331
-305D7121231101231133110133030E0123222627331E01333236370539C5FD1CC8C502DB
-D1B505C9A8A8C905B602605E5F5F0204A9FB5705D1FB69049701BEA6A8A8A67063627100
-000100CD0000057505D1002000AF407909011F01290127203A0137204B0147205C016500
-6720760074200D1F200A0D370C200A0D370202038801C8010201B30020001E661B861B02
-1B13120D120D121B1E04152002322F08010808000716351503070305000D121B1E200504
-4F150115150F2220003000400004500001006E22402201080414056C2110F6FD325D10F6
-5D5D322F5D121739002F2F3F3FED1112392F5DFD39121739018710FD5DC031300187107A
-FD5D1808C0012B2B5D2123012311231133113E01373E01373E01373E013B011523220607
-0E01070E01070575FEFDA387C6C6335A28284E1E0D231245B9B44F53454E1F1D2B17346B
-5A02A7FD5905D1FD6401121917553E1B522DA686B1191D1A583B847C2E0000010012FFFD
-051805D10021003DB9001BFFACB309103709B8FFC0401A0B0E370335200301131317350F
-01140078238F230103132020122F332FED5D10F6ED002FFD322F2F3FED31302B2B212311
-210E01070602070E01070E012322262335331E0133323637361213361237210518C6FDE6
-030B0308251D1D492F306544153C0C0E0A1E0F24401647430E050B04039B052171D955D6
-FEEC595A6B2B2C2603C001021617470146012D6201448700FFFF00C8000005F605D10216
-00300000FFFF00C80000053B05D10216002B0000FFFF0073FFE105DA05F0021600320000
-000100C80000053B05D100070027401703350603010501140078090F0940095009030414
-056C0810F6ED5D10F6ED002F333FED31302123112111231121053BC6FD19C604730521FA
-DF05D100FFFF00C80000049605D1021600330000FFFF0073FFE5054605EC021600260000
-FFFF0000000004EE05D102160037000000010006FFF904E605D1001A0080403C29033801
-461955140419191A1814171617161716191A130001001617181A010500070B0B0F350700
-03700A010A360156016501760104160A01031700B8FFE0401409103700001C501C011C40
-0910371720091037172F2B2B5D11332F2B1217395D2F5D003F2FFD322F11121739018710
-FDC008C0018710FD08C03130005D09010E01070E012322262735331E01333236373E013F
-010133090104E6FDCA225D3634612D2872100E0F462D14481C203F1624FDD6DB01B30186
-05D1FB1B4C621B19110801B90209060B0C34324F044FFC92036E00030069FFF0062405E1
-001D002A00370058403624182C321525062B32091509081603082A1E253265006A0F041E
-150032150F00072B1518250407140F080839381F393F396F399039045D1112392FC4ED17
-3910C42FED2FED5D002F3F1239392FED39392FED39393130011406070E01071523352E01
-272E01353436373E01373533151E01171E01073426272E0127113E01373E0101110E0107
-0E01151416171E010624594F55F48AC586F6574F59564C51F395C594F64F4B57CE403B3A
-8E6A5E9A324142FD8E6A8E3A3A414340319B02F38CD9494F5D03A6A6035A524AD88C88CC
-4C515E049B9B03624E49D07F63A639383402FC8602392F3CAEFEAC037A01363737AA6170
-B63A2D3CFFFF00440000053805D10216003B0000000100C8FEAF05BE05D1000B0032401C
-0602030B08043501080514080800130D40090B370A0A0D0414016C0C10F6ED11332F2BED
-392FED003FFD322F3F3331302901113311211133113311230502FBC6C602DDC68DBC05D1
-FADD0523FADDFE010001008E000004EA05D10019003B40243511451154116C0974160502
-0C1435050500180C030017011400781B0F1B010D140C6A1A10F6ED5D10F6FD32002F3F33
-12392FED123931305D2123110E01232226272E01351133111416171E0133323637113304
-EAC681DD6463AC3F3F47C6142323726B71D652C60276282A313535A47201FCFE67577930
-2F2F281E02B1000100C80000077605D1000B003640200A06020308043401091400C60814
-05041401C605050D0C1F0D3F0D500D700D045D1112392FF4ED10FDF4ED002FFD323F3333
-31302901113311211133112111330776F952C6022EC6022EC605D1FADB0525FADB052500
-000100C8FEAF080305D1000F004140260A0602030C080434010F0D13000009140CC60814
-05041401C6050511101F113F1150117011045D1112392FF4ED10FDF4ED332FED002F2FFD
-32323F33333130290111331121113311211133113311230747F981C6022EC6022EC68DBC
-05D1FADB0525FADB0525FADBFE0300020000000005F405D1000E00210046401D07341B1B
-1618351903083416560F011B08144F167F160216161900150FB8FFF4400A0E11370F7123
-0F2301192F5D10F62BFD11392F5DFD325D002FED3FED12392FED3130013426272E012321
-11213236373E01371406070E0123211121352111213216171E0105253235379083FEEC01
-0F858F363834CF554754C098FDEEFE660260015298C0554C4901C94B72232510FDCB1A25
-2769556CB03742380521B0FDB823423BAE00000300C80000069505D1000E001F00230055
-4016440D0107341919161703083416220321560F0100150FB8FFF4B30E11370FB8FFC040
-150C10370F0F21142078250F25702502190814166C2410F6FD325D10F6FD322F2B2BED5D
-002F3F2FED3F12392FED31305D013426272E01232111213236373E01371406070E012321
-113311213216171E010123113304533235379083FEEC010F858F363834CF554754C098FD
-EEC6015298C0554C490173C6C601C94B72232510FDCB1A252769556CB037423805D1FDB8
-23423BAEFDC505D1000200C80000052205D1000E001F003C401007341919161703083416
-560F0100150FB8FFF440110E11370F71210F21402102190814166C2010F6FD325D10F62B
-ED5D002FED3F12392FED3130013426272E01232111213236373E01371406070E01232111
-3311213216171E0104533235379083FEEC010F858F363834CF554754C098FDEEC6015298
-C0554C4901C94B72232510FDCB1A252769556CB037423805D1FDB823423BAE0000010061
-FFE5052905EC002A0070400A3A1C491C640676060426B8FFE0403E0A10370B200A103718
-34191928092424203428020D0D11340909060316035603031A24171403732C0F2C010F2C
-1F2C2F2C3F2C04241824180F0C1F0C020C2F5D33332F2F5D5D10F6ED11395D003FED332F
-3FED332F1112392FED31302B2B5D0116121514020706042322262735331E01333236373E
-01352135212E01272E012322060723353E0133320404616068696366FEEFA38DFE571051
-F78D7BCC444849FCD303230E5C4747B46689F057115DFE85AC010F052C60FEE4C2ACFEDF
-676A6B3625DB414D574B50C980AD77AF3939374D43DC27356000000200C8FFE107D305F0
-000B001E006240427814010903060915161A1C5616591C7916761C080C34131E1314031C
-03341602100309341C090F13190615180C3F0C580C6F0C040C0C0F0015197320120E140F
-6C1F10F6FD3210F6ED12392F5DED1239002F3FED3F3FED1217392FED5D31305D01100023
-2200111000333200012311231133113312002120001110002120000705FEFFDBDDFEFE01
-03DCDB0101FB79F0C6C6F924016A0113013F016CFE90FEC5FECCFE9102E801280135FECC
-FED7FEDBFEC90136010EFD3005D1FDAC012D0146FE63FE95FE93FE6601890002002C0000
-04DE05D10010001F0066400C28033506471C5A0759170504B8FFE8403209103703041305
-0506060F113440030103030012340F03000519150904060309045F050105120114007821
-0F2140216021035D10F6FD322F5D17392FED002F2F3FED12392F5DED12393130018710FD
-C02B005D212311210123012E01353436373E0133210311212206070E01151416171E0133
-04DEC6FEBFFE43EE01DE96A55F4E47BE7301EAC6FED256682B2E3425292D82560250FDB0
-026E33D5B372A5373228FD240232161D1F7043506A292C1EFFFF0068FFE1041D04780216
-0044000000020074FFE1047C061D00270039006440160C1F35043D29303940044B294039
-6512751273330A33B8FFC0402B0B0D3722062B41002510250225250619411800373F060A
-223118180C281B03903B1F3B3F3B02311B0C863A10F6ED5D10F6ED12392F1239003FED3F
-ED12392F5DED123931302B5D011E01151400232226272602353436373E01373E01373E01
-37150E01070E01070E01073E01333216133426232206070E01151416171E0133323603EE
-4648FED4DB6CB640504F0E19144D3548EBC24F883642814080CF303535084BB3655EAE0F
-B29257A04802033A352E6C3E97AA03B846C786FAFEB6494C5F0121D04B9B6C5DAC354959
-11070904AD0408060B3E3135AB4D36493EFE22B9B7372E19431CAED840362DDA000300B9
-00000453045D0015002400330061400C0A0305141A0315147623050CB8FFD6402F090C37
-12112C3C4F1E011E1E071D3D08052D3D0708161B122C0F0F07251B00100D10370090350F
-35011E2C1A07883410F6FD325D10F42BED12392F1239ED003FED3FED12392F71ED393931
-302B5D011406070E01232111213216171E0115140607151E01033426272E012B01113332
-36373E01133426272E012B0111333236373E010453413940977BFE3201B07D7F383F3B5E
-4A6381FD1F202A694DC4EB4A4724261D3B243D26584EF1B270792C2C2B0152517E2A2F2A
-045D111D216A48537A220A1889017D243A101505FECE0B161841FE4237451D1207FE930F
-19194800000100B9000003BB045D0005001F4010013F040503700001000007021A038806
-10F6ED11332F5D002F3FED313001211123112103BBFDBABC030203B8FC48045D00020009
-FEF404AF045D000D00130053401C3B124A12020105103E0A050C13073E0310C90A0A070E
-1A0C0C01C900B8FFC040120B0E370000152F153F1502131A070704C9052FED392FED5D11
-332F2BED392FED12392FED002FFD32323FED2F3331305D01231121112311333612112111
-3321112106020704AFAFFCB8AF79757302BE87FEBDFEAF0D8053FEF4010FFEF101ACC101
-F90103FC43031FFBFE628600FFFF006AFFE60460047C0216004800000001003400000632
-045D003100D840123A0E3A2D4A0E4A2D5F0C5F2F6F0C6F2F0826B8FFE0B3090B3715B8FF
-E0401A090B3724B42D2D2F17B40E0C0E020116091037011A0031000708B8FFEA405E0910
-37081A09090A241C1703291F3C31070A0C0E2F2D072902112A3F040902121D052905002E
-0A21315E0A51316F0A60317F0A7031082929013102242D2F0600C71F041A051212080A07
-0C0E170609C71C0505333210333F334F336F33045D1112392F33F41739322F10FD32F417
-39322F5D002F3F1739FD322F121739FD111739018710FD2BC08710FD2BC08710FD8710FD
-3130002B2B5D21230123112311230123012E01272E012B0135333216171E01171E011711
-33113E01373E01373E013B0115232206070E01070632E3FE9A5BBA51FE8AD901AF314B1F
-1B4A5435457C962D091B0A216740BA4069210B1B082C947D4535554B191C4D2D01FEFE02
-01FEFE0202491A60615542A2647D1A43174C3F0401E4FE1C04404B1942197B66A2465159
-631900010041FFE603C20478003D007FB7263475127D3C032FB8FFE0404C0D103708200D
-10373B1B3FAF1CBF1C021C1C06313F2D902DA02D032D2D293E3104200A300A020A0A0E3F
-06091C2E231B372E1C373B0409141B00903F7F3F803F02800990090209400B0F37092F2B
-5D5D10F6ED1217392FED2F2F003FED332F5D3FED332F5D1112392F5DED3931302B2B5D01
-1406070E012322262735331E01333236373E01353426272E012B0135333236373E013534
-26272E012322060723353E01333216171E0115140607151E0103C2574444A45274D2660D
-49E26A326A272A32312A297430A371288128343D3024255B2366C5430D53BE5F4E9B4342
-546D5C677A01395E822827242C2ECE4046131518433A3C48121208A2060D113E442F3D11
-110C3734CF1B221C2222755658851D071989000100B900000466045D00090044402D0B02
-0407020D030103380B103702380E10370706010204030805030808021A00920B1F0B600B
-0203071A04880A10F6ED395D10F4FD39003F3F12173931302B2B5D712123110123113311
-01330466BAFDB7AABA0243B00347FCB9045DFCC5033B000200B900000466061500090017
-0073404C0B020407020D030103380B103702380E10370A0F1001101014500D0D07060102
-04030805030817C91F0A2F0A020A11C900101010201003100A100408021A0092191F1960
-190203071A04881810F6ED395D10F6FD391239392F5DED2F5DED003F3F121739332FED33
-2F5D3331302B2B5D7121231101231133110133030E0123222627331E01333236370466BA
-FDB7AABA0243B06B05B1A9A9B105AB015B58595A010347FCB9045DFCC5033B01B894A6A6
-94695E5C6B00000100C1000004A9045D001A0093404D0120090E371B02271A360E321635
-1A0502011A001A000A1B0F2B0F020FB41618160A0F181604121A023C2F08010808000713
-3F12050705010508561A9600961AB600B61A05021A181604121200B8FFC04011090E3700
-001C0F1C1F1C0208031A05891B10F6FD325D11332F2B332F17395D003F3C3F3FED111239
-2F5DFD39121739018710FD71C03130018710FDC0015D2B2123012311231133113236373E
-01373E013B0115232206070E010704A9F6FE3066BCBC5D72280E1B0D349C9256534F5924
-2859320200FE00045DFE1E434A1B3D1C7170A243545E5D180001001DFFFE043E045D0021
-003FB9001BFFACB30D103709B8FFC0401C0D1037023E2105001313173F0F011A00922303
-1A20203020022020122F332F5DED10F6ED002FFD322F2F3FED31302B2B212311210E0107
-0E01070E01070E012322262335333216333236373E01373E013721043EBCFE5F03060307
-201A183B2222533111410A0A081E0A183312333E0A040703030103BF539A3EA7C7423E4D
-1F1E1E02A4020E1332EEE152E166000100B9000004D9045D000C0078401335093A0B4503
-4A0470037F04060B400D103709B8FFC0403D0D10377B027B05790A030A2A090B37050A02
-030904400E103704200D0F373F04010404070B09050107090A0B0305021A00920E0F0E20
-0E02051A07880D10F6ED5D10F6ED111739002F333F3312392F5D2B2B1217393130002B5D
-012B2B5D2123110123011123113309013304D9BAFEEA8CFEECB0E301300126E70372FDC2
-023EFC8E045DFD8F0271000100B900000460045D000B0032401C033F0808050A07050105
-0809021A00920D1F0D600D0208031A05880C10F6FD325D10F6FD32003F333F3312392FED
-31302123112111231133112111330460BCFDD1BCBC022FBC01F7FE09045DFE3C01C4FFFF
-006AFFE10471047C021600520000000100B900000460045D000700254015033F06050005
-011A0092091F09600902041A05880810F6ED5D10F6ED002F333FED313021231121112311
-210460BCFDD1BC03A703BBFC45045D00FFFF00B9FE640490047C0216005300000001006A
-FFE703FD04770021005A40430F234F235F23032B01220E2A1624183A01350E3A16351849
-014F0A440E4F1641185901550E6901650E7A01730E131010143F0C0421211A3F03090F00
-0023171B09852210F6ED11332F3C003FED332F3FED332F31305D015D250E01232226272E
-013510002132161715232E01232206151416333236373E01373303FD73A5527ACC494951
-0128010161BB4E0B5DB555A7B7B6A83B75302651100B463629474848DC93010B013F3627
-D14744E0C7C7DC1E1813350D0001000A000003EE045D0007003840230301043F06054000
-4F0502000500021A05A003B00302030309080F093F094F097009045D1112392F5D33FD32
-2F2F5D003FFD322F3130012111231121352103EEFE6CBCFE6C03E403B8FC4803B8A5FFFF
-003DFE64047F045D0216005C00000003006FFE64064B061400230030003D007A40105622
-011D011B1E0C09040627353F2118B8FFF040400E0F3718043B2E3F0F06100E0F3706090B
-0C392436384924463804241B00C809311B1E2B04091A0C381B12C8800C900C020C0C3F3E
-0F3F1F3F3F3F503F803F055D1112392F5DFDED10ED173910FDED5D003F3F2B33FD323F2B
-33FD321217393F31305D011406070E01232226271123110E01232202113436373E013332
-16171133113E0133321203342623220607111E0133323605112E01232206151416333236
-064B4C3F3EA259436327BA3D4F54C1F04E3F3DA5523C6331BA2E7C3FC6E2C18888374A3F
-2F3F3A8D9BFD7627503187A18F87355B024C95E54A4A4E2E13FE3301CD1E23012E010D8D
-DD4B494D251E01E1FE1F1B28FED5FEECBFDE1219FD171619D9AA02E91219CED2C3E01D00
-FFFF003C00000480045D0216005B0000000100B9FEF404DE045D000B0041400F0602050B
-08043F01051A080800C90AB8FFC04015090D370A0A0D0D40090E378F0DAF0D02041A0188
-0C10F6ED5D2B11332F2BED392FED002FFD322F3F33313029011133112111331133112304
-2FFC8ABC0226BC87AF045DFC4503BBFC45FE52000001008E0000041F045D0016003C4025
-0C061C062C06750E040209113F0505001509050014011A0092183F18010A1A0009100902
-092F5DED5D10F6FD32002F3F3312392FED123931305D2123110E01232226351133111416
-171E01333236371133041FBC5BA662B4BEBC101A1A5E5445A23CBC01AD1C22B1A70196FE
-CA40652524261B12021D000100B900000649045D000B003D40260A06020508043F010809
-1A00CA081A05041A01CA8005A0050205050D0C0F0D200D500D700D045D1112392F5DF4ED
-10FDF4ED003FFD323F333331302901113311211133112111330649FA70BC01AEBC01AEBC
-045DFC4503BBFC4503BB000100B9FEF406D0045D000F004A402E0A0602050C08043F0108
-0E0DC90000091A0CCA081A05041A01CA80059005A00503050511100F111F113F116F1104
-5D1112392F5DF4ED10FDF4ED392FED002F3FFD32323F3333313029011133112111331121
-1133113311230621FA98BC01AEBC01AEBC87AF045DFC4503BBFC4503BBFC45FE52000002
-000A000004C4045D000E0021004A4015750D01073D4F1B9F1B021B1B16183F1905083D16
-0FB8FFF04016090B371B081A161619001B0F8F230F231F232F2303192F5D10F6FD11392F
-FD322B002FED3FED12392F5DED31305D013426272E012B0111333236373E01371406070E
-0123211121352111333216171E01040223282A6B64B0AC646E282925C24138429676FE55
-FEB80204F47E8B453A3A0157334D18190AFE8411181A473A518429322A03B8A5FE4D1A33
-2B86000300B9000005A2045D000E001F0023005A4016200523073D4F199F190219191617
-05083D167900010FB8FFF04022090B37001B500F600F700F030F0F231A2292250F253025
-402570250419081A16882410F6FD325D10F6FD322F5DED2B5D002FED3F12392F5DED2F3F
-3130013426272E012B0111333236373E01371406070E012321113311333216171E011333
-1123036923282A6B64B0AC646E282925C24138429676FE55BCF47E8B453A3ABBBCBC0157
-334D18190AFE8411181A473A518429322A045DFE4D1A332B8602B1FBA300000200B90000
-0435045D000E001F00424013073D4F199F19021919161705083D167900010FB8FFF04013
-090B37001B0F8F210F212F210219081A16882010F6FD325D10F6ED2B5D002FED3F12392F
-5DED3130013426272E012B0111333236373E01371406070E012321113311333216171E01
-037323282A6B64BAB6646E282925C24138429676FE4BBCFE7E8B453A3A0157334D18190A
-FE8411181A473A518429322A045DFE4D1A332B8600010053FFE703F604770021007DB532
-0442040210B8FFD640090B0D37152A0B0D371DB8FFD6403F0B1037082A0B1037123D1313
-061F1B1B173E1F049F0A010A0A0E3E0609141C111A0390232340090D371C2F133F134F13
-03131C1380099009020940090C37092F2B5D33332F5D2F2B10F6ED1139003FED332F5D3F
-ED332F1112392FED31302B2B2B2B5D011E011510002122262735331E0133323637213521
-2E012322060723353E01333216035D4950FEC9FEFC66BF430D3CC66D9DC40CFDCC023314
-BE8E5BB4570D3FC2677CC803ED46D290FEEAFEB8301BCE2F49C0BA979E9F3D43CE193A44
-000200B9FFE1064C047C000B001E005640363A0335094A034509040C3E131E1314031C03
-3F16041005093F1C0A0F1319061A2F0C010C0C0F001B1990202F203F2002120E1A0F881F
-10F6FD325D10F6ED12392F5DED1239002F3FED3F3FED1217392FED5D3130013426232206
-15141633323625231123113311333624333200111000232200058AA69399A1A89292A7FC
-D3E8BCBCED190111C7E70112FEF2EBDEFEF5022ED7D5DFCDD4D7D5A2FE06045DFE3BE7FD
-FEC4FEEEFEF1FEC201200002004300000413045D0010001F0069B3721C0104B8FFE8403D
-0910370304B4050506060F113C030300123D0F0500050909190902191B70090109040603
-09040A051A054A055A0580059005060512011A0092210F21015D10F6FD322F5D17392F5D
-ED5D002F2F3FED12392FED12393130018710FDC02B015D212311230123012E0135343637
-3E0133210311232206070E01151416171E01330413BCDDFEA6DD01789186503D3C9C5C01
-AEBCED4D442827251724256A4101BBFE4501CD28A586597C27261BFDF201780A16164B2C
-37441E1D1500FFFF006AFFE6046005DB0236004800000116008EF9000014400D03302560
-250202002520120025012B355D3500010013FE6D046206140035006A4044051C1E261E28
-59056905721D0617140E51111112180D08421B0412012F3E2A2A012A0D150F5F2E6F2E7F
-2E032E2E0D001A2191371F37603702141517030B1A110F0D883610F63232FD17325D10F6
-ED12392F5D2F2F002F2F5DED3F3FED123912392FED393931305D0026272E01272E012322
-0607112311233533353315211521113E01333216171416151406070602070E01232A0127
-35333236133E013503A501010113191A594650AC4CBCA6A6BC0141FEBF58C162B1BB0303
-020103544746B96A17182A44BB9C09010102064B2B5080292B294D3AFCBE04F4869A9A86
-FEED4952DEC92F6B4B3A703AB0FEFF50504E029EF60150224B2EFFFF00B9000003BB0682
-0236020B00000116008D9AF6000AB6010009070405252B350001006AFFE7040A04770021
-006EB53B0A4B0A021BB8FFD640090B0D37162A0B0D370EB8FFD640340B1037012A0B1037
-193D1818030C1010143E0C0421211D3E03092018301840180318171810031A008E232340
-090D371A1A09852210F6ED2B10E61117392F5D003FED332F3FED332F1112392FED31302B
-2B2B2B5D250E01232226272E013510002132161715232E01232206072115211E01333236
-3733040A4E9F7B7DD14C4C52012B010D68BB450C40C2658FC719023CFDC10AC4A46CBD3E
-0C302029474849DC92010501453620CB324E9CA197B2C8443200FFFF006EFFE503D70478
-021600560000FFFF00AF0000018305DB0216004C0000FFFF00050000022D05DB02160077
-0000FFFFFFC2FE59021505DB0216004D00000002001DFFFE06F4045D000E003D0072B900
-30FFACB30D10371EB8FFC0401D0D1037073D4F379F3702373716183E350528282C3F2409
-3D167900010FB8FFF0401E090B3737081A161635001B890F010F8F3F0F3F0118C9203530
-35023535282F332F5DED5D10F45DFD11392FFD322B5D002FED2FFD322F3FED12392F5DED
-31302B2B00353426272E012B01113332363736371406070E01232111210E01070E01070E
-01070E012322262335333216333236373E01373E01372111333216171E01063223282A6B
-64B0AC646E2829E74138429676FE55FE5F03060307201A183B2222533111410A0A081E0A
-183312333E0A0407030301F47E8B453A3A012037334D18190AFE8411181A81518429322A
-03BF539A3EA7C7423E4D1F1E1E02A4020E1332EEE152E166FE4D1A332B86000200B90000
-06F4045D000E0027005D4017171E073D4F219F21022121161C20051A083D167900010FB8
-FFF0401F090B37211E081A16161A001B890F010F8F290F292F294F29031D191A1A882810
-F6FD325D10F65DED11392FED39392B5D002FED2F3F3312392F5DED39393130013426272E
-012B0111333236373E01371406070E0123211121112311331121113311333216171E0106
-3223282A6B64B0AC646E282925C24138429676FE55FDF3BCBC020DBCF47E8B453A3A0157
-334D18190AFE8411181A473A518429322A0210FDF0045DFE4D01B3FE4D1A332B86000001
-00130000045F0614001E00504030031D161D751D0317140E51111112180D08421B041201
-010D08150F021A0091201F20602002141517030B1A110F0D881F10F63232FD17325D10F6
-ED2F2F003F3C3F3FED123912392FED393931305D2123113426272E012322060711231123
-3533353315211521113E0133321615045FBC1218195E4B4DA84DBCA6A6BC0141FEBF58BC
-63B5BE027C4D87262A294C3BFCBE04F4869A9A86FEED4952DACDFFFF00C1000004A90682
-0236021200000116008DF9F60011400C01001D401D02001D1C0611252B5D35000002003D
-FE64047F06150007001500BD404C04063406440650066006700606090307051903170546
-0149035800570179030902071A000100051A0403044900460402080F0E010E0E12500B0B
-0003020405020C15C908400B0E37080FC90EB8FFC040110B0E370E080E04026801010102
-03030400B8FFC040220910370C001C004A006A007A0005008D170F170103041304450465
-0475040504821610E65D5D10F65D2B1117395D2F1139392F2BED2F2BED003F3F12393933
-2FED332F5D333130015D8710FD8710FDC0015D005D0901231301330901130E0123222627
-331E0133323637047FFD74C9D0FE43CC0157015A0805B1A9A9B105AB015B58595A01045D
-FA0701D20427FCC4033C01B894A6A694695E5C6B000100B9FEF40460045D000B003F4027
-0A060520030103083E00050802C93F034F037F0303030305091A00920D1F0D600D02081A
-05880C10F6ED5D10F6ED12392F5DED003F33ED2F5D3F3331302901112311211133112111
-330460FE84AEFE83BC022FBCFEF4010C045DFC4403BC000100C80000048A076B0007002B
-B90006FFC040140D10370606003503030205130606090114026C0810F6ED11332FED002F
-3FED332F2B31300111231121113311018EC60308BA0521FADF05D1019AFDB600000100B9
-000003BB05CE00070033B90006FFC0401A0E10370606003F03050205C97006010606090F
-0901011A02870810F6ED5D11332F5DED002F3FED332F2B313001112311211133110175BC
-0254AE03B8FC48045D0171FDEA00000100CB023C073502DC00030011B601540200000501
-2F11332F002FED3130012135210735F996066A023CA0000400C8000008B905ED00090015
-0021002500A7403E080718073A014901440646075801540656076F0160067F0170060D09
-0D0613190D16137A19751F0625533F224F220222221F401214371F51300D010D0D19B8FF
-C040321214371951130202030807040106030100220F2302232223220A1CC910100A0006
-0102071300000416C90A0A270213046C2610F6ED11332FED12392FFD1139391112392FED
-1239392F2F5D002F3F1217393FED2B332F5DED2B332F5DED5D3130015D21230111231121
-0111330114062322263534363332160734262322061514163332360121152104FFF5FD72
-B401330250B403BABDB2B6BABEB2B5BAB25865675757676558FE6201B8FE480534FACC05
-D1FB4004C0FE63E0DADADFE0DADCDDAC8888ADAD8787FDE89E00000100B900000460045D
-000700254015033F06050005011A0092091F09600902041A05880810F6ED5D10F6ED002F
-333FED313021231121112311210460BCFDD1BC03A703BBFC45045D00000101190235028F
-05D5000800214011035004040703010E0307002A03000101012F5D33ED392F003F3F332F
-ED3130012311233532363733028FA5D1667E0989023502A9752C5600000100EF023D039F
-05ED001D0043B90011FFE040250D10370F0F0B521302021C51010E00001C01082A261636
-166616761604160F160F000101012F5D33332F2F5DED1239332F003FFD323FED332F3130
-2B0121353E01373E013534262322060723353E01333216151406070E010721039FFD505B
-86276D40584C468F290F41974D9DA9526A318D3701F2023D94456825676D52464A3C20B3
-1B229E7A5D945E2B6A29000100E6021C037305ED002E0074400F6C096C227E097E220455
-0C5A1F0226B8FFE0403B0B0E3703200B0D372C2B15510F16010F161F164F165F16CF16FF
-16061621211D51160625020A0A0E51060F1A2A281622112A2216282C04090000092F332F
-121739ED2F2F2FED003FED332F3F1239ED332F2F5D71ED393931302B2B5D015D01140607
-0E012322262735331E013332363534262B01353332363534262322060723353E01333216
-15140607151E0103733C30357B4F528F4111259A4F546E645B8C7D575F52574299251140
-964F98AA614D5075033A47702225201E1CAF233B4948533B8B4C423C473E23AF1B228C62
-57711A08106D000200B3023D03BD05ED000A000D003A401E6D067E06020609010D51050C
-05030702030E00070B042A09000D060101062F332F12393333FD39392F003F3F1239392F
-ED3939323130015D012315233521350133113321110103BDA396FE2F01D295A3FECBFE9F
-0319DCDCB9021BFDB10190FE7000000100E6021C037505DA002A004840176F087F08021D
-1D1A5125250621511E030A0A0E51060F00B8FFEA400F090C371F21291E1F1E09142A0000
-092F332FED1239392FED2F2B003FED332F3FED12392FFD322F31305D011406070E012322
-262735331E01333236373E01353426272E012322060711211521153E01333216171E0103
-75322F3088574E953C1025924E2C521C1D171F1D1E59353B6C260255FE4814310E547634
-373C0363457A2A2B331C1A9F1436171C1D43272A391415110E0601F08BCF02021722246F
-000100F3023503A505DA000600414025560101030100012A020203630073000200000351
-0503020E030002100910370202040000042F332F12392F2B1239003F3FFD322F3130015D
-8710ED87C0015D0901230121352103A5FE2AB901F0FDED02B2054EFCE7031A8B000300C5
-021B039105EE001900280037005D40420F0B0F151F0B1F152A022A0439023904492B582B
-0A0F251F2526103610042F09261604031D5110023551030F1A2A13202A0D292A090D1316
-04067000010000322A062FED332F5D121739ED2FED2FED003FED3FED1217395D31305D01
-140623222635343637352E0135343633321615140607151E01033426232206151416171E
-01173E01133426272E01270E011514163332360391CB9BA7BF5E595246B99095B5505261
-5BBE574F465D302D17482E392618374217582A3A387650516D033579A19F784F78260429
-64476A8D87683F7D2304276B016433483F36263D140A1F0B254FFE79323B1E0A1C0F205D
-304A5F4E00020073FFE1068B05F0002800340075400978180176097915021BB8FFC04045
-0910371B694F0001002302031A090A0905151A0915155A095515062C3415023234090A22
-1E2926151B00030F291503360F361F3680369036BF36CF36060F36012F150F683510F6ED
-5D5D10D6ED121739D4FDC4003FED3FED5D1239393FDD5DED2B5D31305D011E0115140207
-0E01232224272602353412373624333216171E01173E013534262735331E011514060110
-0023220011100033320005A11F1A63595CFBA19DFEFF5A5A61605C5801059AA0FF591819
-144F43160CA00D0B78FEF9FEFCE1E3FEFD0108DEDE0107044958A663B8FEDD6165666863
-630120B9B6012167626869611B2121044044245B17092F46326C82FE8D0122013BFEC5FE
-DEFEDBFEC90137000002006AFFE104C30584001D0029005640391A20090C373A2135274A
-21452704151B690D050003213F0904273F030A14102918090C1B03061E1B00902B0F2B1F
-2B3F2B6F2B04241B06852A10F6ED5D10F6ED121739DCFDC4003FED3FED12393FFDCD5D31
-302B011000232200111000333216173332363534262735331E01151406071E0107342623
-22061514163332360471FEE8EBEDFEE90117ED33602B5D5A4A160CA00D0B736C4548C2AA
-9799A9AA9896AB022EFEEFFEC4013C01110111013D0F104147245B17092F46326A80144D
-D98BD9D3D3D9D2D9D700000100B2FFE1067506F8002B004C40342A20090F37252B6A1C03
-0D032615390649067615041534060A2420290F2801281B14002D0F2D402D6F2D7F2D902D
-050F140C6B2C10F6ED5D10DEEDD45DFDC4003FED5D3F3FFDC431302B011406070E012322
-26272E01351133111416171E01333236373E0135113332363534262735331E0115140623
-052947514DCE898CD0475147C621272C976A6B962D2721D85A4A160CA00D0BACA00256A2
-F1504C464A4852E8A9037BFC7B798C394142414239936D038A4147245B17092F46328384
-000100B1FFE105A505840025005C403E0B0619077A070323200910371E246A1505020509
-051142050A011D19290F21012114021A40000100270F276F27025F279027A027C027EF27
-050B1A08872610F6ED5D7110D671ED32D45DFDC4002F3FED3F12393FFDC431302B5D2123
-350E01232226351133111416171E0133323637113332363534262735331E011514062B01
-0457BC5FAE69B0C4BC101A1B565249AD4BD05A4A160CA00D0BACA0027C4B50D7D002D5FD
-8455792B2C284C3B03424147245B17092F46328384000001020905110342068C00160042
-4029BF0301030606050C50146005010504ADC005D005020540090D370505110940111437
-09290F000100112FDD5DED2B12392F2B5DED002F5DD4ED12392FC55D3130011406071523
-353E013534262322060723353E01333216034242426E2F3026211F251803134926516605
-F8404E1544790C27271827090969060C560000010221FE8202F5FF450003001340090144
-8F0201020015012FED002F5DED31300123353302F5D4D4FE82C3FFFF0154051602FA068C
-001600430000FFFF021D051603C3068C0016008D00000002013605110514068C0006000A
-004DB90006FFF040100E103705100E10370802010708040305B8FFC040110E1037050560
-0301036007700702070900B8FFC0B50E10370000042F332F2BD6CD5D002F5D332F2B1217
-392F3130012B2B01230B012313332103231303E19FB9B89BE4E30217DA817C05110100FF
-00017BFEF6010A0000020003051103E1068C0006000A004AB90006FFF040100E10370510
-0E10370802010809040305B8FFC040180E1037050560030103006F097F0902090704400E
-103700042F332BD6CD5D2F002F5D332F2B1217392F3130012B2B01230B01231333012303
-3303E19FB9B89BE4E3FE6181DADF05110100FF00017BFEF6010A00020136051104C00752
-0006001D008EB90006FFF040120E103705100E1037BF0A010A0D0D0C13501BB8FFC0400B
-0E10371B0C02010C030305B8FFC0402A0E10370505600301030BADC00CD00C020C400910
-370C0C18104011143710290F07010718400C10371800B8FFC040090E1037000060040104
-2F5D332F2BD42BDD5DED2B12392F2B5DED002F5D332F2B1217392FD42BED12392FC55D31
-30012B2B01230B01231333251406071523353E013534262322060723353E0133321603E1
-9FB9B89BE4E301C342426E2F3026211F251803134926516605110100FF00017B32404E15
-44790C27271827090969060C560000020125051103F307DE000600200064B90006FFF040
-200E103705100E10370710520F171F17A0170317141D520A400D11370A01020305B8FFC0
-40110E10370505600301032029070013291400B8FFC0B40E103700042F332BD6ED2FD6ED
-002F5D332F2B123939D62BED3CDD5DED3C3130012B2B01230B01231333130E0123222627
-2E0123220607233E01333216171E013332363703E19FB9B89BE4E3F606865F35491C183A
-192B22058C05875F36491C163B192A240405110100FF00017B015289902919162D3E4788
-912A19142E3E47000002014204E703D506FB000D0011003C40251110400F1A3710001006
-0AAA3F030103600E700E020E100D2A100F001F008F000300072A062FEDD45D39ED2FCD5D
-002F5DEDCD39392F2BCD313001140623222635331416333236353703231303D5B29897B2
-A2555253555EDA817C0646A3BCBCA37C64647CB5FEF6010A0002014204E703D506FB000D
-0011003C4025100F400F1A370F000F060AAA3F0301036F107F1002100E0D2A0E0F001F00
-8F000300072A062FEDD45D39ED2FCD5D002F5DEDCD39392F2BCD31300114062322263533
-1416333236350723033303D5B29897B2A2555253555281DADF0646A3BCBCA37C64647C55
-010A0002014204E703D5071E000D002400634040111414131A0F2201221340091A371300
-13060AAA3F0301031213400910371313001F101F201F031F1728500E600E700E030E0D2A
-0E0F001F008F000300072A062FEDD45D39ED2F5DEDCD5D392F2BCD002F5DEDCD39392F2B
-D45DCD12392FC531300114062322263533141633323635271406071523353E0135342623
-22060723353E0133321603D5B29897B2A2555253551237375C272822191C1E1402103C21
-42570646A3BCBCA37C64647C5B34431238650A2120191D080757060A45000002012504E7
-03F307DE000D0027005840100E17520F1E1F1E021E1B245220110111B8FFC04025090C37
-11006006700602060AAA3F0301031A291B0627290E0D2A0F001F008F000300072A062FED
-D45DEDD4ED10D6ED002F5DEDDD5D39D62B71ED3CDD5DED3C313001140623222635331416
-33323635130E01232226272E0123220607233E01333216171E013332363703D5B29897B2
-A255525355C006865F35491C183A192B22058C05875F36491C163B192A24040646A3BCBC
-A37C64647C019889902919162D3E4788912A19142E3E47000001020905110342068C0016
-00524035BF0301030606050C50501460147014031409900501C76005010504ADC005D005
-020540091037050511094011143709290F000100112FDD5DED2B12392F2B5DED002F5D5E
-5D5ED45DED12392FC55D3130011406071523353E013534262322060723353E0133321603
-4242426E2F3026211F251803134926516605F8404E1544790C27271827090969060C5600
-00020136065403E1080100060020007D404A0702170202141D50200A010A1050076F1701
-0F1770170217010205400D1137050920039003A003B003045910032003C00303C003D003
-0231D003E003025003010F037003020320280700B8FFC040090E10370013281400042F33
-D6ED2F2BD6ED002F5D71725E71725E715ECD2B39392F5D713CEDDD71ED3C31305D012327
-07233733130E01232226272E0123220607233E01333216171E013332363703E1A9AFAEA5
-F8BBEC0B705025491C1B3E141D2806860A6F5227432122301A1B2B0506545959AD010052
-6B190D0D1A202D4E6F17101016232A0000020142064803D50801000D0011005A403E5010
-6010020A50FF03015F030103007F0601060F109F10026F10FF1002106F11010F11701102
-11590E690E720E030E100D2A100F001F008F000300072A062FEDD45D39ED2FCD5D002F5D
-71DD5D71D45D3CDD7172ED5D313001140623222635331416333236353707233703D5AB9E
-9EACA24B5D5A4D4FC681680738589899573058592FC9D8D800020142064803D50801000D
-001100644033500E600E020A50FF03015F030103007F0601060F0E9F0E026F0EFF0E020E
-6F11010F1170110211561066107D1003100E0D2A0EB8FFC0400F090D370E0F001F008F00
-0300072A062FEDD45D392BED2FCD5D002F5D71DD5D71D45D3CDD7172ED5D313001140623
-222635331416333236350723273303D5AB9E9EACA24B5D5A4D5681C6DF07385898995730
-58592F0FD80000020142064803D50801000D0024008E4062111414131A6F22010F227022
-02223F134F13021340111537130013060A5009900301B0030159700301310F033F037003
-CF0304031213400915371313501F601F701F03001F101F201F301F401F051F17C00E010E
-0D2A0E0F001F008F000300072A062FEDD45D39ED2F5DCDCD5D71392F2BCD002F5D5E715E
-5D715EEDCD39392F2B712F5D71CD12392FC5313001140623222635331416333236352714
-06071523353E013534262322060723353E0133321603D5AB9E9EACA24B5D5A4D2E2E2E4D
-231F1C15191A0E020E321B364A0738589899573058592F612B380F2F54091E1817160805
-4905083900020142064803D50801000D0027009240111B2450DF1101110E17506F1E010F
-1E011EB8FFC040520D10371E00060A50099003B00302F0030159200330034003C003D003
-E003066003700302C003D0030231A003B003025003E003020F033F03CF0303031A281B1B
-0627280E0E0D2A0F001F008F000300072A062FEDD45DED3C10ED103C10ED002F5D71725E
-5D71725E5D715EEDCD322F2B5D71ED3CDD71ED3C31300114062322263533141633323635
-370E01232226272E0123220607233E01333216171E013332363703D5AE9B9BAFA26C3C3C
-6BA20B705025491C1B3E141D2806860A6F5227432122301A1B2B050706546A67572E2828
-2EFB526B190D0D1A202D4E6F17101016232A000201360668051008010006001D0088B900
-06FFF0401A0E103705100E1037BF0A010A0D0D0C400E10370C13500F1B011BB8FFC0403A
-0D10371B0102030F0570050205050F0301030BADC00CD00C020C400910370C0C18104011
-143710290F07010750006000700003180000600401042F5D332FD45DDD5DED2B12392F2B
-5DED002F5D332F5D1239392F2B5DEDC42B392FC55D3130012B2B01232707231333051406
-071523353E013534262322060723353E0133321603E19FB9B89BE4E3021342426E2F3026
-211F25180313492651660668CECE014944404E1544790C27271827090969060C5600FFFF
-001AFE82055E05D10236002400000116024B2F00000AB602000D0E0500252B35FFFF0068
-FE82041D04780236004400000116024BBA00000F400A027F36010036370B00252B5D3500
-FFFF001A0000055E080102360024000001170256002F0175001A401202501C0102101C40
-1C701C03001C0B0500252B5D35005D35FFFF0068FFE1041D068C0236004400000116024A
-BA000011400C025F457F45021D45340B00252B5D3500FFFF001A0000055E07ED02360024
-00000117024E002F01610011400B0302400F01000F0B0500252B5D353500FFFF0068FFE1
-04F4068C0236004400000116024EE0000013400D030240385038022938340B00252B5D35
-3500FFFF001A0000055E07ED0236002400000117024F002F01610011400B03020F0F0100
-0F0B0500252B5D353500FFFFFFE3FFE1041D068C0236004400000116024FE0000013400D
-030240385038022938340B00252B5D353500FFFF001A0000055E08010236002400000116
-025C2F00001740110302400FA00FB00FC00F04000F0B0500252B5D353500FFFF0068FFE1
-04A0075202360044000001160250E0000013400D030240385038022938340B00252B5D35
-3500FFFF001A0000055E0801023600240000011602572F00000CB70302000F0B0500252B
-3535FFFF0068FFE1041D07DE02360044000001160251E0000013400D0302403850380229
-38340B00252B5D353500FFFF001AFE82055E07ED023600240000003700D6002F01610116
-024B2F00001840110300141505002502400F01000F0B0500252B5D352B35FFFF0068FE82
-041D068C023600440000003600D6E0000116024BBA00001E4016037F3D01003D3E0B0025
-0240385038022938340B00252B5D352B5D35FFFF001A0000055E08010236002400000116
-02582F00000CB7030200110B0500252B3535FFFF0068FFE1041D06FB0236004400000116
-0252E0000011400B0302403A01293A340B00252B5D353500FFFF001A0000055E08010236
-00240000011602592F00000CB7030200110B0500252B3535FFFF0068FFE1041D06FB0236
-0044000001160253E0000011400B0302403A01293A340B00252B5D353500FFFF001A0000
-055E08010236002400000116025A2F00000CB7030200110B0500252B3535FFFF0068FFE1
-041D071E02360044000001160254E0000011400B0302403A01293A340B00252B5D353500
-FFFF001A0000055E08010236002400000116025B2F00000CB7030200110B0500252B3535
-FFFF0068FFE1041D07DE02360044000001160255E0000011400B0302403A01293A340B00
-252B5D353500FFFF001AFE82055E0801023600240000003700D9002F01750116024B2F00
-001D4013025011011103001B1C0500250200110B0500252B352B3500115D3500FFFF0068
-FE82041D068C023600440000003600D9DD000116024BBA0000184011037F44010044450B
-002502293A340B00252B352B5D35FFFF00C8FE82049D05D10236002800000116024B2600
-000AB601000E0F0100252B35FFFF006AFE820460047C0236004800000116024BF900000A
-B6021F22231218252B35FFFF00C80000049D08010236002800000117025600260175001C
-401401501D0101001D201D501D601D04001D0C0203252B5D35005D35FFFF006AFFE60460
-068C0236004800000116024AF9000018B4026F310131B8FFC040090A1137323120120025
-2B2B5D35FFFF00C80000049D07C8023600280000011700D7002601750012400B01501901
-0100190C0203252B35005D35FFFF006AFFE604600653023600480000011600D7F900000A
-B602002D201200252B35FFFF00C80000053A08010236002800000117024E002601750016
-400D0201501001020100100C0203252B3535005D3535FFFF006AFFE6050D068C02360048
-00000116024EF900000CB703021E24201200252B3535FFFF00290000049D080102360028
-00000117024F002601750016400D0201501001020100100C0203252B3535005D3535FFFF
-FFFCFFE60460068C0236004800000116024FF900000CB703021E24201200252B3535FFFF
-00C80000053608010236002800000116025C26000013400D0201101020100200100C0203
-252B5D353500FFFF006AFFE604B9075202360048000001160250F9000013400D03020024
-2024021E24201200252B5D353500FFFF00C80000049D0801023600280000011602572600
-000CB7020100100C0203252B3535FFFF006AFFE6046007DE02360048000001160251F900
-000CB703021E24201200252B3535FFFF00C8FE82049D0801023600280000003700D60026
-01750116024B2600001D40130110501001020015160203250100100C0203252B352B3500
-5D113500FFFF006AFE820460068C023600480000003600D6F9000116024BF9000014400E
-031E292A120025021E24201200252B352B35FFFF0089000002D508010236002C00000117
-0256FF2401750016400E01501101015011010011100409252B5D35005D35FFFF00960000
-01CF068C023600D500000117024AFE8D0000000AB6010009080203252B35FFFF0089FE82
-02D505D10236002C00000117024BFF240000000AB601000E0F0409252B35FFFF00AFFE82
-018305DB0236004C00000117024BFE8E0000000AB602000A0B0203252B35FFFF0073FE82
-05DA05F00236003200000117024B009B0000000AB6020026270F03252B35FFFF006AFE82
-0471047C0236005200000116024BE200000AB602001A1B0600252B35FFFF0073FFE105DA
-080102360032000001170256009601750022400B0250340102503470340234B8FFC04009
-090B370034240F03252B2B5D35005D35FFFF006AFFE10471068C0236005200000116024A
-E200000F400A02701D01001D1C0600252B5D3500FFFF0073FFE105DA0801023600320000
-0117024E00960175001E401403025028010302202850288028030028240F03252B5D3535
-005D3535FFFF006AFFE104F6068C0236005200000116024EE200001940130302001C201C
-501C801CB01C05001C180600252B5D353500FFFF0073FFE105DA08010236003200000117
-024F009601750016400D030250280103020028240F03252B3535005D3535FFFFFFE5FFE1
-0471068C0236005200000116024FE200000CB70302001C180600252B3535FFFF0073FFE1
-05DA08010236003200000117025C009600000015400F0302202850288028030028240F03
-252B5D353500FFFF006AFFE104A2075202360052000001160250E200001940130302001C
-201C501C801CB01C05001C180600252B5D353500FFFF0073FFE105DA0801023600320000
-01170257009600000015400F0302202850288028030028240F03252B5D353500FFFF006A
-FFE1047107DE02360052000001160251E200001940130302001C201C501C801CB01C0500
-1C180600252B5D353500FFFF0073FE8205DA0801023600320000003700D6009601750117
-024B00960000001D4013025028012803002D2E0F0325020028240F03252B352B3500115D
-3500FFFF006AFE820471068C023600520000003600D6E2000116024BE2000014400E0300
-212206002502001C180600252B352B35FFFF0073FFE1068B08010236024600000117008D
-007801750014400D025036603602020036360F03252B35005D35FFFF006AFFE104C3068C
-0236024700000116008DE200000AB602002B2B0600252B35FFFF0073FFE1068B08010236
-024600000117004300AA0175001A40120250366036020250367036020036360F03252B5D
-35005D35FFFF006AFFE104C3068C02360247000001160043E2000011400C02502B602B02
-002B2B0600252B5D3500FFFF0073FFE1068B080102360246000001170256008F01750012
-400B02503A0102003A390F03252B35005D35FFFF006AFFE104C3068C0236024700000116
-024AE200000AB602002F2E0600252B35FFFF0073FFE1068B07C8023602460000011700D7
-008B01750012400B02504201020042350F03252B35005D35FFFF006AFFE104C306530236
-02470000011600D7C400001540100210372037403750370400372A0600252B5D3500FFFF
-0073FE82068B05F00236024600000117024B009A0000000AB6020037380F03252B35FFFF
-006AFE8204C305840236024700000116024BE200000AB602002C2D0600252B35FFFF00B2
-FE82052905D10236003800000116024B6200000AB6010020210C00252B35FFFF00B1FE82
-0457045D0236005800000116024BFD00000AB60100191A0916252B35FFFF00B2FFE10529
-080102360038000001170256006201750012400B01502301010023220C00252B35005D35
-FFFF00B1FFE10457068C0236005800000116024AFD00000AB601001C1B0916252B35FFFF
-00B2FFE1067508010236024800000117008D007C01750014400D01502E602E0201002E2D
-0C00252B35005D35FFFF00B1FFE105A5068C0236024900000116008DEE00001840100160
-28010130284028020028290900252B5D35005D35FFFF00B2FFE106750801023602480000
-0117004300AA0175001C401401502D602D0201402D602D802D03002D2D0C00252B5D3500
-5D35FFFF00B1FFE105A5068C023602490000011600430200001840100160270101502760
-27020027270800252B5D35005D35FFFF00B2FFE106750801023602480000011702560062
-01750012400B01503101010031300C00252B35005D35FFFF00B1FFE105A5068C02360249
-00000116024AFD00000AB601002B2A0800252B35FFFF00B2FFE1067507BE023602480000
-011700D70062016B000AB60100392C0C00252B35FFFF00B1FFE105A50653023602490000
-011600D7FD00000AB6010033260800252B35FFFF00B2FE82067506F80236024800000116
-024B6200000AB601002E2F0D00252B35FFFF00B1FE8205A505840236024900000116024B
-FD00000AB6010028290800252B35FFFF0006000004E608010236003C000001170043FFE4
-0175001B400A01500A600A0201500A01B8FFD3B40A0A0401252B5D35005D3500FFFF003D
-FE64047F068C0236005C000001160043DD000013B5016009700902B8FFDDB40909040025
-2B5D3500FFFF0006FE8204E605D10236003C00000116024BEC00000AB601000A09040125
-2B35FFFF003DFE64047F045D0236005C00000117024B010400000012400D010A0F0A2F0A
-4F0A6F0A7F0A055D1135FFFF0006000004E608010236003C000001170256FFEC01750018
-401001500E0101C00ED00E02000E0D0302252B5D35005D35FFFF003DFE64047F068C0236
-005C00000116024AC900000F400A01500D01000D0C0400252B5D3500FFFF0006000004E6
-07C80236003C0000011700D7FFEC01750012400B01501601010016090500252B35005D35
-FFFF003DFE64047F06530236005C0000011600D7DD00000AB6010015080400252B350003
-006CFEBD04FB0614001B0028002C007E40523B05380C3C2232243E284B054A0C4E224524
-4F285908690870120D2AB52B0114511A17171018011304072041100403082642070A2C2B
-2C2B010A1600881617131C041A1A01922E1F2E3F2E02231B010A852D10F632ED5D10F632
-ED32323232ED2F111239392F2F003FED3F3FED1239393F12392F3CFD3C2FED31305D0123
-1123350E01232202113436373E0133321617352135213533153301112E01232206151416
-3332361321352104FBB8BC4DAD6EC6ED524444B66059864CFE95016BBCB8FE8C4F73499C
-B2879750A4EAFCB4034C04F4FB0C754252012E01118EDB4D4C4F2427CE869A9AFB990279
-2218D6CCC3CD47FDE286FFFF00ED051D042C0653001600D700000002008A009104900498
-0023002F004D40332D290B0802231D1A141108172F0501052729050F1701170F311F3102
-24290B0802231D1A1411080E202001202A29200F0E010E2F5D33ED2F5D121739ED5D002F
-5D33ED2F5D121739ED31300107270E01232226270727372E01353436372737173E013332
-16173717071E011514060727342623220615141633323604906EEC2C4A342E5724EC6DE9
-1718161AEA6FEB24572D2C5825EA71EB1818191765694B496B694B496B01016EEA1A1619
-17EC71EA25592B34492BED6EEB17191817EA6DED2653302D5824A949706E4B4A6F6D0000
-0002000000000000FF4C00780000000000000000000000000000000000000000037D0000
-01020103010401050106010701080109010A010B010C010D010E010F0110011101120113
-011401150116011701180119011A011B011C011D011E011F012001210122012301240125
-0126012701280129012A012B012C012D012E012F01300131013201330134013501360137
-01380139013A013B013C013D013E013F0140014101420143014401450146014701480149
-014A014B014C014D014E014F0150015101520153015401550156015701580159015A015B
-015C015D015E015F0160016101620163016401650166016701680169016A016B016C016D
-016E016F0170017101720173017401750176017701780179017A017B017C017D017E017F
-0180018101820183018401850186018701880189018A018B018C018D018E018F01900191
-01920193019401950196019701980199019A019B019C019D019E019F01A001A101A201A3
-01A401A501A601A701A801A901AA01AB01AC01AD01AE01AF01B001B101B201B301B401B5
-01B601B701B801B901BA01BB01BC01BD01BE01BF01C001C101C201C301C401C501C601C7
-01C801C901CA01CB01CC01CD01CE01CF01D001D101D201D301D401D501D601D701D801D9
-01DA01DB01DC01DD01DE01DF01E001E101E201E301E401E501E601E701E801E901EA01EB
-01EC01ED01EE01EF01F001F101F201F301F401F501F601F701F801F901FA01FB01FC01FD
-01FE01FF0200020102020203020402050206020702080209020A020B020C020D020E020F
-0210021102120213021402150216021702180219021A021B021C021D021E021F02200221
-02220223022402250226022702280229022A022B022C022D022E022F0230023102320233
-023402350236023702380239023A023B023C023D023E023F024002410242024302440245
-0246024702480249024A024B024C024D024E024F02500251025202530254025502560257
-02580259025A025B025C025D025E025F0260026102620263026402650266026702680269
-026A026B026C026D026E026F0270027102720273027402750276027702780279027A027B
-027C027D027E027F0280028102820283028402850286028702880289028A028B028C028D
-028E028F0290029102920293029402950296029702980299029A029B029C029D029E029F
-02A002A102A202A302A402A502A602A702A802A902AA02AB02AC02AD02AE02AF02B002B1
-02B202B302B402B502B602B702B802B902BA02BB02BC02BD02BE02BF02C002C102C202C3
-02C402C502C602C702C802C902CA02CB02CC02CD02CE02CF02D002D102D202D302D402D5
-02D602D702D802D902DA02DB02DC02DD02DE02DF02E002E102E202E302E402E502E602E7
-02E802E902EA02EB02EC02ED02EE02EF02F002F102F202F302F402F502F602F702F802F9
-02FA02FB02FC02FD02FE02FF0300030103020303030403050306030703080309030A030B
-030C030D030E030F0310031103120313031403150316031703180319031A031B031C031D
-031E031F0320032103220323032403250326032703280329032A032B032C032D032E032F
-0330033103320333033403350336033703380339033A033B033C033D033E033F03400341
-03420343034403450346034703480349034A034B034C034D034E034F0350035103520353
-035403550356035703580359035A035B035C035D035E035F036003610362036303640365
-0366036703680369036A036B036C036D036E036F03700371037203730374037503760377
-03780379037A037B037C037D037E037F0380038103820383038403850386038703880389
-038A038B038C038D038E038F0390039103920393039403950396039703980399039A039B
-039C039D039E039F03A003A103A203A303A403A503A603A703A803A903AA03AB03AC03AD
-03AE03AF03B003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF
-03C003C103C203C303C403C503C603C703C803C903CA03CB03CC03CD03CE03CF03D003D1
-03D203D303D403D503D603D703D803D903DA03DB03DC03DD03DE03DF03E003E103E203E3
-03E403E503E603E703E803E903EA03EB03EC03ED03EE03EF03F003F103F203F303F403F5
-03F603F703F803F903FA03FB03FC03FD03FE03FF04000401040204030404040504060407
-04080409040A040B040C040D040E040F0410041104120413041404150416041704180419
-041A041B041C041D041E041F0420042104220423042404250426042704280429042A042B
-042C042D042E042F0430043104320433043404350436043704380439043A043B043C043D
-043E043F0440044104420443044404450446044704480449044A044B044C044D044E044F
-0450045104520453045404550456045704580459045A045B045C045D045E045F04600461
-04620463046404650466046704680469046A046B046C046D046E046F0470047104720473
-047404750476047704780479047A047B047C047D052E6E756C6C106E6F6E6D61726B696E
-6772657475726E057370616365066578636C616D0871756F746564626C0A6E756D626572
-7369676E06646F6C6C61720770657263656E7409616D70657273616E640B71756F746573
-696E676C6509706172656E6C6566740A706172656E726967687408617374657269736B04
-706C757305636F6D6D610668797068656E06706572696F6405736C617368047A65726F03
-6F6E650374776F05746872656504666F757204666976650373697805736576656E056569
-676874046E696E6505636F6C6F6E0973656D69636F6C6F6E046C65737305657175616C07
-67726561746572087175657374696F6E0261740141014201430144014501460147014801
-49014A014B014C014D014E014F0150015101520153015401550156015701580159015A0B
-627261636B65746C656674096261636B736C6173680C627261636B657472696768740B61
-7363696963697263756D0A756E64657273636F7265056772617665016101620163016401
-650166016701680169016A016B016C016D016E016F017001710172017301740175017601
-7701780179017A0962726163656C656674036261720A627261636572696768740A617363
-696974696C646509416469657265736973054172696E670843636564696C6C6106456163
-757465064E74696C6465094F646965726573697309556469657265736973066161637574
-65066167726176650B6163697263756D666C657809616469657265736973066174696C64
-65056172696E670863636564696C6C6106656163757465066567726176650B6563697263
-756D666C65780965646965726573697306696163757465066967726176650B6963697263
-756D666C657809696469657265736973066E74696C6465066F6163757465066F67726176
-650B6F63697263756D666C6578096F6469657265736973066F74696C6465067561637574
-65067567726176650B7563697263756D666C657809756469657265736973066461676765
-72066465677265650463656E7408737465726C696E670773656374696F6E0662756C6C65
-74097061726167726170680A6765726D616E64626C730A7265676973746572656409636F
-707972696768740974726164656D61726B056163757465086469657265736973086E6F74
-657175616C024145064F736C61736808696E66696E69747909706C75736D696E7573096C
-657373657175616C0C67726561746572657175616C0379656E036D75310B706172746961
-6C646966660973756D6D6174696F6E0770726F647563740370693108696E74656772616C
-0B6F726466656D696E696E650C6F72646D617363756C696E65034F686D026165066F736C
-6173680C7175657374696F6E646F776E0A6578636C616D646F776E0A6C6F676963616C6E
-6F74077261646963616C06666C6F72696E0B617070726F78657175616C09696E6372656D
-656E740D6775696C6C656D6F746C6566740E6775696C6C656D6F74726967687408656C6C
-697073697306416772617665064174696C6465064F74696C6465024F45026F6506656E64
-61736806656D646173680C71756F746564626C6C6566740D71756F746564626C72696768
-740971756F74656C6566740A71756F7465726967687406646976696465076C6F7A656E67
-650979646965726573697309596469657265736973086672616374696F6E044575726F0D
-6775696C73696E676C6C6566740E6775696C73696E676C726967687402666902666C0964
-616767657264626C0E706572696F6463656E74657265640E71756F746573696E676C6261
-73650C71756F746564626C626173650B70657274686F7573616E640B4163697263756D66
-6C65780B4563697263756D666C6578064161637574650945646965726573697306456772
-617665064961637574650B4963697263756D666C65780949646965726573697306496772
-617665064F61637574650B4F63697263756D666C6578064F677261766506556163757465
-0B5563697263756D666C65780655677261766508646F746C657373690A63697263756D66
-6C65780574696C6465066D6163726F6E05627265766509646F74616363656E740472696E
-6707636564696C6C610C68756E676172756D6C617574066F676F6E656B056361726F6E06
-4C736C617368066C736C61736806536361726F6E06736361726F6E065A6361726F6E067A
-6361726F6E0962726F6B656E626172034574680365746806596163757465067961637574
-650554686F726E0574686F726E056D696E7573086D756C7469706C790B6F6E6573757065
-72696F720B74776F7375706572696F720D74687265657375706572696F72076F6E656861
-6C660A6F6E65717561727465720D74687265657175617274657273056672616E63064762
-72657665066762726576650449646F740853636564696C6C610873636564696C6C610643
-61637574650663616375746506436361726F6E06636361726F6E07646D6163726F6E096F
-76657273636F7265066D6964646F74064162726576650661627265766507416F676F6E65
-6B07616F676F6E656B06446361726F6E06646361726F6E0644736C61736807456F676F6E
-656B07656F676F6E656B06456361726F6E06656361726F6E064C6163757465066C616375
-7465064C6361726F6E066C6361726F6E044C646F74046C646F74064E6163757465066E61
-63757465064E6361726F6E066E6361726F6E094F64626C6163757465096F64626C616375
-7465065261637574650672616375746506526361726F6E06726361726F6E065361637574
-65067361637574650854636564696C6C610874636564696C6C6106546361726F6E067463
-61726F6E055572696E67057572696E67095564626C6163757465097564626C6163757465
-065A6163757465067A6163757465045A646F74047A646F740547616D6D61055468657461
-0350686905616C7068610564656C746107657073696C6F6E057369676D61037461750370
-68690D756E64657273636F726564626C096578636C616D64626C096E7375706572696F72
-0670657365746102494A02696A0B6E61706F7374726F706865066D696E75746506736563
-6F6E64096166696936313234380961666969363132383906483232303733064831383534
-3306483138353531064831383533330A6F70656E62756C6C657407416D6163726F6E0761
-6D6163726F6E0B4363697263756D666C65780B6363697263756D666C65780443646F7404
-63646F7407456D6163726F6E07656D6163726F6E06456272657665066562726576650445
-646F740465646F740B4763697263756D666C65780B6763697263756D666C65780447646F
-740467646F740847636564696C6C610867636564696C6C610B4863697263756D666C6578
-0B6863697263756D666C657804486261720468626172064974696C6465066974696C6465
-07496D6163726F6E07696D6163726F6E064962726576650669627265766507496F676F6E
-656B07696F676F6E656B0B4A63697263756D666C65780B6A63697263756D666C6578084B
-636564696C6C61086B636564696C6C610C6B677265656E6C616E646963084C636564696C
-6C61086C636564696C6C61084E636564696C6C61086E636564696C6C6103456E6703656E
-67074F6D6163726F6E076F6D6163726F6E064F6272657665066F62726576650852636564
-696C6C610872636564696C6C610B5363697263756D666C65780B7363697263756D666C65
-7804546261720474626172065574696C6465067574696C646507556D6163726F6E07756D
-6163726F6E065562726576650675627265766507556F676F6E656B07756F676F6E656B0B
-5763697263756D666C65780B7763697263756D666C65780B5963697263756D666C65780B
-7963697263756D666C6578056C6F6E67730A4172696E6761637574650A6172696E676163
-757465074145616375746507616561637574650B4F736C61736861637574650B6F736C61
-7368616375746509616E6F74656C65696106576772617665067767726176650657616375
-746506776163757465095764696572657369730977646965726573697306596772617665
-067967726176650D71756F74657265766572736564097261646963616C65780961666969
-303839343109657374696D61746564096F6E656569676874680C74687265656569676874
-68730B66697665656967687468730C736576656E656967687468730B636F6D6D61616363
-656E7410756E646572636F6D6D61616363656E7405746F6E6F730D646965726573697374
-6F6E6F730A416C706861746F6E6F730C457073696C6F6E746F6E6F7308457461746F6E6F
-7309496F7461746F6E6F730C4F6D6963726F6E746F6E6F730C557073696C6F6E746F6E6F
-730A4F6D656761746F6E6F7311696F74616469657265736973746F6E6F7305416C706861
-04426574610544656C746107457073696C6F6E045A6574610345746104496F7461054B61
-707061064C616D626461024D75024E75025869074F6D6963726F6E0250690352686F0553
-69676D610354617507557073696C6F6E0343686903507369054F6D6567610C496F746164
-696572657369730F557073696C6F6E64696572657369730A616C706861746F6E6F730C65
-7073696C6F6E746F6E6F7308657461746F6E6F7309696F7461746F6E6F7314757073696C
-6F6E6469657265736973746F6E6F7304626574610567616D6D61047A6574610365746105
-746865746104696F7461056B61707061066C616D626461026D75026E75027869076F6D69
-63726F6E0372686F067369676D613107757073696C6F6E0363686903707369056F6D6567
-610C696F746164696572657369730F757073696C6F6E64696572657369730C6F6D696372
-6F6E746F6E6F730C757073696C6F6E746F6E6F730A6F6D656761746F6E6F730961666969
-313030323309616669693130303531096166696931303035320961666969313030353309
-616669693130303534096166696931303035350961666969313030353609616669693130
-303537096166696931303035380961666969313030353909616669693130303630096166
-696931303036310961666969313030363209616669693130313435096166696931303031
-370961666969313030313809616669693130303139096166696931303032300961666969
-313030323109616669693130303232096166696931303032340961666969313030323509
-616669693130303236096166696931303032370961666969313030323809616669693130
-303239096166696931303033300961666969313030333109616669693130303332096166
-696931303033330961666969313030333409616669693130303335096166696931303033
-360961666969313030333709616669693130303338096166696931303033390961666969
-313030343009616669693130303431096166696931303034320961666969313030343309
-616669693130303434096166696931303034350961666969313030343609616669693130
-303437096166696931303034380961666969313030343909616669693130303635096166
-696931303036360961666969313030363709616669693130303638096166696931303036
-390961666969313030373009616669693130303732096166696931303037330961666969
-313030373409616669693130303735096166696931303037360961666969313030373709
-616669693130303738096166696931303037390961666969313030383009616669693130
-303831096166696931303038320961666969313030383309616669693130303834096166
-696931303038350961666969313030383609616669693130303837096166696931303038
-380961666969313030383909616669693130303930096166696931303039310961666969
-313030393209616669693130303933096166696931303039340961666969313030393509
-616669693130303936096166696931303039370961666969313030373109616669693130
-303939096166696931303130300961666969313031303109616669693130313032096166
-696931303130330961666969313031303409616669693130313035096166696931303130
-360961666969313031303709616669693130313038096166696931303130390961666969
-313031313009616669693130313933096166696931303035300961666969313030393809
-616669693030323038096166696936313335320270690C6F6E656E756D657261746F720C
-74776F6E756D657261746F720E74687265656E756D657261746F720D666F75726E756D65
-7261746F720D666976656E756D657261746F720E736576656E6E756D657261746F720E65
-696768746E756D657261746F7210446F6E74436F6D707265737348544D5808676C797068
-35373908676C79706835383008676C797068353831054F686F726E056F686F726E055568
-6F726E0575686F726E0D686F6F6B61626F7665636F6D620C646F7462656C6F77636F6D62
-096772617665636F6D62096163757465636F6D6208676C79706835393008676C79706835
-393108676C79706835393208676C79706835393308676C79706835393408676C79706835
-393508676C79706835393608676C79706835393708676C79706835393808676C79706835
-393908676C79706836303008676C79706836303108676C79706836303208676C79706836
-303308676C7970683630340941646F7462656C6F770961646F7462656C6F770A41686F6F
-6B61626F76650A61686F6F6B61626F7665104163697263756D666C657861637574651061
-63697263756D666C65786163757465104163697263756D666C6578677261766510616369
-7263756D666C65786772617665144163697263756D666C6578686F6F6B61626F76651461
-63697263756D666C6578686F6F6B61626F7665104163697263756D666C657874696C6465
-106163697263756D666C657874696C6465134163697263756D666C6578646F7462656C6F
-77136163697263756D666C6578646F7462656C6F770B41627265766561637574650B6162
-7265766561637574650B41627265766567726176650B61627265766567726176650F4162
-72657665686F6F6B61626F76650F616272657665686F6F6B61626F76650B416272657665
-74696C64650B61627265766574696C64650E416272657665646F7462656C6F770E616272
-657665646F7462656C6F770945646F7462656C6F770965646F7462656C6F770A45686F6F
-6B61626F76650A65686F6F6B61626F7665064574696C6465066574696C64651045636972
-63756D666C65786163757465106563697263756D666C6578616375746510456369726375
-6D666C65786772617665106563697263756D666C65786772617665144563697263756D66
-6C6578686F6F6B61626F7665146563697263756D666C6578686F6F6B61626F7665104563
-697263756D666C657874696C6465106563697263756D666C657874696C64651345636972
-63756D666C6578646F7462656C6F77136563697263756D666C6578646F7462656C6F770A
-49686F6F6B61626F76650A69686F6F6B61626F76650949646F7462656C6F770969646F74
-62656C6F7708676C79706836343908676C79706836353008676C79706836353108676C79
-70683635320573686576610A68617461667365676F6C0A686174616670617461680B6861
-74616671616D617473056869726971057473657265057365676F6C057061746168067161
-6D61747305686F6C616D0671756275747306646167657368056D65746567056D61716166
-0472616665057061736571077368696E646F740673696E646F7408736F66706173757104
-616C6566036265740567696D656C0564616C657402686503766176057A6179696E036865
-740374657403796F640866696E616C6B6166036B6166056C616D65640866696E616C6D65
-6D036D656D0866696E616C6E756E036E756E0673616D656B68046179696E0766696E616C
-70650270650A66696E616C747361646905747361646903716F660472657368047368696E
-0374617609646F75626C6576617606766176796F6409646F75626C65796F640667657265
-73680967657273686179696D0D6E657773686571656C7369676E0A7661767368696E646F
-740D66696E616C6B616673686576610E66696E616C6B616671616D6174730A6C616D6564
-686F6C616D106C616D6564686F6C616D64616765736807616C746179696E0B7368696E73
-68696E646F740A7368696E73696E646F74117368696E6461676573687368696E646F7410
-7368696E64616765736873696E646F7409616C656670617461680A616C656671616D6174
-7309616C65666D61706971096265746461676573680B67696D656C6461676573680B6461
-6C6574646167657368086865646167657368097661766461676573680B7A6179696E6461
-676573680974657464616765736809796F646461676573680E66696E616C6B6166646167
-657368096B61666461676573680B6C616D6564646167657368096D656D64616765736809
-6E756E6461676573680C73616D656B686461676573680D66696E616C7065646167657368
-0870656461676573680B747361646964616765736809716F666461676573680A72657368
-6461676573680A7368696E64616765736808746176646167657308766176686F6C616D07
-62657472616665076B6166726166650670657261666509616C65666C616D6564127A6572
-6F77696474686E6F6E6A6F696E65720F7A65726F77696474686A6F696E65720F6C656674
-746F72696768746D61726B0F7269676874746F6C6566746D61726B096166696935373338
-380961666969353734303309616669693537343037096166696935373430390961666969
-353734343009616669693537343531096166696935373435320961666969353734353309
-616669693537343534096166696935373435350961666969353734353609616669693537
-343537096166696935373435380961666969353733393209616669693537333933096166
-696935373339340961666969353733393509616669693537333936096166696935373339
-370961666969353733393809616669693537333939096166696935373430300961666969
-353734303109616669693537333831096166696935373436310961666969363331363709
-616669693537343539096166696935373534330961666969353735333409616669693537
-343934096166696936323834330961666969363238343409616669693632383435096166
-696936343234300961666969363432343109616669693633393534096166696935373338
-320961666969363432343209616669693632383831096166696935373530340961666969
-353733363909616669693537333730096166696935373337310961666969353733373209
-616669693537333733096166696935373337340961666969353733373509616669693537
-333931096166696935373437310961666969353734363009616669693532323538096166
-696935373530360961666969363239353809616669693632393536096166696935323935
-370961666969353735303509616669693632383839096166696936323838370961666969
-363238383809616669693537353037096166696936323936310961666969363239353909
-616669693632393630096166696935373530380961666969363239363209616669693537
-353637096166696936323936340961666969353233303509616669693532333036096166
-696935373530390961666969363239363709616669693632393635096166696936323936
-360961666969353735353509616669693532333634096166696936333735330961666969
-363337353409616669693633373539096166696936333736330961666969363337393509
-616669693632383931096166696936333830380961666969363239333809616669693633
-383130096166696936323934320961666969363239343709616669693633383133096166
-696936333832330961666969363338323409616669693633383333096166696936333834
-340961666969363238383209616669693632383833096166696936323838340961666969
-363238383509616669693632383836094F646F7462656C6F77096F646F7462656C6F770A
-4F686F6F6B61626F76650A6F686F6F6B61626F7665104F63697263756D666C6578616375
-7465106F63697263756D666C65786163757465104F63697263756D666C65786772617665
-106F63697263756D666C65786772617665144F63697263756D666C6578686F6F6B61626F
-7665146F63697263756D666C6578686F6F6B61626F7665104F63697263756D666C657874
-696C6465106F63697263756D666C657874696C6465134F63697263756D666C6578646F74
-62656C6F77136F63697263756D666C6578646F7462656C6F770A4F686F726E6163757465
-0A6F686F726E61637574650A4F686F726E67726176650A6F686F726E67726176650E4F68
-6F726E686F6F6B61626F76650E6F686F726E686F6F6B61626F76650A4F686F726E74696C
-64650A6F686F726E74696C64650D4F686F726E646F7462656C6F770D6F686F726E646F74
-62656C6F770955646F7462656C6F770975646F7462656C6F770A55686F6F6B61626F7665>
-<0A75686F6F6B61626F76650A55686F726E61637574650A75686F726E61637574650A5568
-6F726E67726176650A75686F726E67726176650E55686F726E686F6F6B61626F76650E75
-686F726E686F6F6B61626F76650A55686F726E74696C64650A75686F726E74696C64650D
-55686F726E646F7462656C6F770D75686F726E646F7462656C6F7708676C797068383832
-08676C7970683838330959646F7462656C6F770979646F7462656C6F770A59686F6F6B61
-626F76650A79686F6F6B61626F7665065974696C6465067974696C646504646F6E670974
-696C6465636F6D620863757272656E63790000000000000100000C92000102160C000009
-0084000400B4FF9C000400B6FF9C000A0024FF9C000A0090FF9C000F00B4FF2E000F00B6
-FF2E00100024FFCE0010002CFFE20010002DFF9C00100036FFEC00100037FF6A00100039
-FFCE0010003AFFCE0010003BFFB00010003CFF740010003DFFE200100044FFEC00100059
-FFD80010005AFFEC0010005BFFCE0010005CFFD80010005DFFD800100090FFCE001000A0
-FFEC0011000FFF7E00110010FF60001100B1FF88001100B2FF88001100B4FF2E001100B6
-FF2E001D00B2FF7400240010FFCE00240036FFF600240037FF8800240038FFF600240039
-FFC40024003AFFCE0024003CFFB000240057FFEC00240058FFF600240059FFCE0024005A
-FFE20024005CFFCE002400B1FFCE002400B2FFCE002400B3FFCE002400B4FF88002400B5
-FFCE002400B6FF880025000FFFEC00250010000A00250011FFEC00250037FFC4002500AB
-FFEC002500B1000A002500B2000A00260010FFCE002600AFFFE7002600B1FFCE002600B2
-FFCE0027000FFFCE00270011FFCE00270037FFCE0027003AFFEC0027003BFFF60027003C
-FFEC0027003DFFEC002700ABFFCE0029000FFED400290011FED40029001DFFC40029001E
-FFC400290022003C00290024FF9C00290037001E00290044FF9C00290048FFCE00290052
-FFCE00290090FF92002900A0FF9C002900A1FFCE002900ABFED4002900B0FFCE002C0010
-FFE2002C00B1FFE2002C00B2FFE2002D000FFFEC002D0011FFEC002D0024FFF6002D0090
-FFF6002D00ABFFEC002E0010FF92002E0032FFEC002E0044FFC4002E0048FFBA002E0052
-FFBA002E0058FFCE002E0059FFB0002E005AFFBA002E005CFFB0002E0091FFEC002E00A0
-FFC4002E00A1FFBA002E00AFFFEC002E00B0FFBA002E00B1FF92002E00B2FF92002F000A
-FF88002F0010FF60002F0026FFEC002F002AFFEC002F002D0064002F0032FFEC002F0037
-FF56002F0039FF92002F003AFF9C002F003CFF60002F0059FF92002F005CFF92002F0064
-FFEC002F0091FFEC002F00AFFFEC002F00B1FF60002F00B2FF60002F00B4FF60002F00B6
-FF600032000FFFE200320011FFE200320037FFCE0032003BFFF60032003CFFEC0032003D
-FFEC003200ABFFE20033000FFED400330011FED400330024FFCE0033003C001400330044
-FFCE00330048FFCE00330052FFCE00330090FFBA003300A0FFCE003300A1FFCE003300AB
-FED4003300B0FFCE0034000FFFE200340011FFE2003400ABFFE200350010FF9C00350037
-FFC40035003CFFEC00350044FFD800350048FFCE00350052FFCE00350058FFEC0035005C
-FFC9003500A0FFCE003500A1FFCE003500B0FFC4003500B1FF9C003500B2FF9C003500B4
-FFBA003500B6FFBA0036000FFFEC00360011FFEC00360024FFEC00360036FFEA00360059
-FFE20036005AFFEC0036005CFFE200360090FFEC003600ABFFEC0037000FFEDE00370010
-FF6A00370011FEDE0037001DFF380037001EFF3800370022003C00370024FF8800370026
-FFD80037002AFFD800370032FFCE00370036FFF400370037FFBA00370044FF1000370046
-FF2400370048FF240037004AFF2E00370052FF2400370055FF3800370056FF4C00370058
-FF3800370059FF380037005AFF380037005CFF380037005DFF5600370064FFD800370090
-FF7E00370091FFCE003700A0FF10003700A1FF24003700ABFEDE003700AFFFCE003700B0
-FF24003700B1FF6A003700B2FF6A0038000FFFEC00380011FFEC00380024FFF600380090
-FFEC003800ABFFEC0039000FFEDE00390010FFCE00390011FEDE0039001DFFB00039001E
-FFB000390024FFC400390044FF9C00390048FF9C00390052FF9C00390058FFC40039005C
-FFBF00390090FFBA003900A0FF9C003900A1FF9C003900ABFEDE003900B0FF9C003900B1
-FFCE003900B2FFCE003A000FFEDE003A0010FFCE003A0011FF24003A001DFFB0003A001E
-FFB0003A0024FFCE003A0044FF9C003A0048FF9C003A0052FF9C003A0055FFC4003A0058
-FFC4003A005CFFBF003A0090FFC4003A00A0FF9C003A00A1FF9C003A00ABFF24003A00B0
-FF9C003A00B1FFCE003A00B2FFCE003B0010FFB0003B0026FFF6003B002AFFF6003B0032
-FFF6003B0044FFCE003B0048FFC4003B0052FFC4003B0058FFE2003B005CFFB0003B0064
-FFF6003B0091FFF6003B00A0FFCE003B00A1FFC4003B00AFFFF6003B00B0FFC4003B00B1
-FFB0003B00B2FFB0003C000FFEDE003C0010FF74003C0011FEDE003C001DFF38003C001E
-FF38003C0024FFB0003C0032FFEC003C0044FF74003C0047FF88003C0048FF7E003C004A
-FF7E003C0050FF9C003C0051FF9C003C0052FF7E003C0053FF9C003C0054FF7E003C0055
-FF9C003C0056FF92003C0058FF92003C0059FF9C003C0090FFB0003C0091FFEC003C00A0
-FF74003C00A1FF7E003C00ABFEDE003C00AFFFEC003C00B0FF7E003C00B1FF74003C00B2
-FF74003D0010FFC4003D0026FFEC003D002AFFEC003D0032FFEC003D003DFFF6003D0044
-FFCE003D0048FFC4003D0052FFC4003D005AFFD8003D005CFFBF003D0064FFEC003D0091
-FFEC003D00A0FFCE003D00A1FFC4003D00AFFFEC003D00B0FFC4003D00B1FFCE003D00B2
-FFCE00440059FFF00044005AFFF60044005CFFF00045000FFFE200450011FFEC0045005C
-FFFB004500ABFFEC00460010FFEC00460037FFC4004600B1FFEC004600B2FFEC00480037
-FF7400490005003C0049000A003C0049000C00640049000D00320049000FFF7E00490010
-FFCE00490011FF8800490022006E0049003F00640049004000640049005CFFF600490060
-0064004900ABFF88004900B1FFCE004900B2FFCE004900B40032004900B60032004B0059
-FFEC004B005AFFF6004B005CFFEC004E0010FF9C004E0048FFEC004E0052FFEC004E00A1
-FFEC004E00B0FFEC004E00B1FF9C004E00B2FF9C00500059FFEC0050005AFFF60050005C
-FFEC00510059FFEC0051005AFFF60051005CFFEC0052000FFFE200520011FFEC00520059
-FFF10052005BFFEC0052005CFFF1005200ABFFEC0053000FFFE200530011FFEC0053005C
-FFFB005300ABFFEC0055000FFEDE00550010FFEC00550011FEDE00550044FFDC005500A0
-FFD8005500ABFEDE005500B1FFEC005500B2FFEC005500B4001E005500B6001E00570010
-FFD80057005CFFF6005700B1FFD8005700B2FFD8005700B40014005700B600140059000F
-FF4C00590010FFD800590011FF4C00590044FFD800590048FFEE00590052FFEE005900A0
-FFD8005900A1FFEE005900ABFF4C005900B0FFF1005900B1FFD8005900B2FFD8005A000F
-FFBA005A0010FFEC005A0011FFBA005A0044FFEC005A00A0FFEC005A00ABFFBA005A00B1
-FFEC005A00B2FFEC005B0010FFCE005B0046FFEC005B0047FFF6005B0048FFE8005B004A
-FFF6005B0052FFE8005B006FFFEC005B00A1FFE8005B00B0FFEC005B00B1FFCE005B00B2
-FFCE005C000FFF42005C0010FFD8005C0011FF42005C0044FFD8005C0046FFEE005C0047
-FFF6005C0048FFEE005C004AFFF6005C0052FFEE005C0054FFF6005C006FFFEE005C00A0
-FFD8005C00A1FFEE005C00ABFF4C005C00B0FFF1005C00B1FFD8005C00B2FFD8005D0010
-FFEC005D0046FFF6005D0047FFF6005D0048FFF4005D004AFFF6005D0052FFF4005D0054
-FFF6005D006FFFF6005D00A1FFF4005D00B1FFEC005D00B2FFEC00640010FFCE006400AF
-FFE7006400B1FFCE006400B2FFCE006F0010FFEC006F00B1FFEC006F00B2FFEC0091000F
-FFE200910011FFE200910037FFCE0091003BFFF60091003CFFEC0091003DFFEC009100AB
-FFE200A1000FFFE200A10011FFEC00A10059FFF100A1005BFFEC00A1005CFFF100A100AB
-FFEC00AB00B4FF2E00AB00B6FF2E00B10024FFCE00B1002CFFE200B1002DFF9C00B10036
-FFEC00B10037FF6A00B10039FFCE00B1003AFFCE00B1003BFFB000B1003CFF7400B1003D
-FFF600B10044FFEC00B10059FFD800B1005AFFEC00B1005BFFCE00B1005CFFD800B1005D
-FFD800B10090FFCE00B100A0FFEC00B20024FFCE00B2002CFFE200B2002DFF9C00B20036
-FFEC00B20037FF6A00B20039FFCE00B2003AFFCE00B2003BFFB000B2003CFF7400B2003D
-FFF600B20044FFEC00B20059FFD800B2005AFFEC00B2005BFFCE00B2005CFFD800B2005D
-FFD800B20090FFCE00B200A0FFEC00B30024FF9C00B30090FF9C00B4000FFF2E00B40011
-FF2E00B40024FF9C00B40037006E00B40039006400B4003A003C00B4003C006E00B40056
-FFBA00B40057002800B40090FF9C00B400ABFF2E00B50024FF9C00B50090FF9C00B6000F
-FF2E00B60011FF2E00B60024FF9C00B60037006E00B60039006400B6003A003C00B6003C
-006E00B60056FFBA00B60057002800B60090FF9C00B600ABFF2E00C30037FF2E00C30039
-FF2E00C3003AFF9C00C3003CFF2E00C40037FF2E00C40039FF2E00C4003AFF9C00C4003C
-FF2E0000000000010001000100000001000013FF0000001400000000000013F7308213F3
-06092A864886F70D010702A08213E4308213E0020101310E300C06082A864886F70D0205
-05003060060A2B060104018237020104A0523050302C060A2B06010401823702011CA21E
-801C003C003C003C004F00620073006F006C006500740065003E003E003E3020300C0608
-2A864886F70D020505000410503EEC935CE1D8D33511E69A791E4594A0820F3F308202C0
-3082022902141389B4D18AE8A7C4BD35C79B8D88CA1FCA535691300D06092A864886F70D
-010104050030819E311F301D060355040A1316566572695369676E205472757374204E65
-74776F726B31173015060355040B130E566572695369676E2C20496E632E312C302A0603
-55040B1323566572695369676E2054696D65205374616D70696E67205365727669636520
-526F6F7431343032060355040B132B4E4F204C494142494C495459204143434550544544
-2C20286329393720566572695369676E2C20496E632E301E170D39373035313230373030
-30305A170D3939313233313037303030305A30819E311F301D060355040A131656657269
-5369676E205472757374204E6574776F726B31173015060355040B130E56657269536967
-6E2C20496E632E312C302A060355040B1323566572695369676E2054696D65205374616D
-70696E67205365727669636520526F6F7431343032060355040B132B4E4F204C49414249
-4C4954592041434345505445442C20286329393720566572695369676E2C20496E632E30
-819F300D06092A864886F70D010101050003818D0030818902818100D32E20F0687C2C2D
-2E811CB106B2A70BB7110D57DA53D875E3C9332AB2D4F6095B34F3E990FE090CD0DB1B5A
-B9CDE7F688B19DC08725EB7D5810736A78CB7115FDC658F629AB585E9604FD2D62115881
-1CCA7194D522582FD5CC14058436BA94AAB44D4AE9EE3B22AD56997E219C6C86C04A4797
-6AB4A636D5FC092DD3B4399B0203010001300D06092A864886F70D010104050003818100
-3A119C85053ED2E980FB7BD5A9F4AC79FC05FC953D7123A92B28DF8C136589FE2C87018F
-5A9A62CA11A780F4B7BE14B7D156996B086245C6A2A5DA357F0522DE722D048605A77C09
-16931443F0F7164DD6078E9B106C58FE0A3597CA899FDF04709C2A7D618EC1E80B719AA8
-C76662423D959422329822898AFA640824F5D2FA308202CD30820236021500BD119ADA43
-ED21FB46588489CA46889025EE1460300D06092A864886F70D010104050030819E311F30
-1D060355040A1316566572695369676E205472757374204E6574776F726B311730150603
-55040B130E566572695369676E2C20496E632E312C302A060355040B1323566572695369
-676E2054696D65205374616D70696E67205365727669636520526F6F7431343032060355
-040B132B4E4F204C494142494C4954592041434345505445442C20286329393720566572
-695369676E2C20496E632E301E170D3937303531323037303030305A170D393931323331
-3037303030305A3081AC31273025060355040B131E566572695369676E2054696D652053
-74616D70696E672053657276696365311F301D060355040B1316566572695369676E2054
-72757374204E6574776F726B31343032060355040B132B4E4F204C494142494C49545920
-41434345505445442C20286329393720566572695369676E2C20496E632E311730150603
-55040A130E566572695369676E2C20496E632E3111300F06035504071308496E7465726E
-657430819D300D06092A864886F70D010101050003818B0030818702818100AB61EDB4AD
-8D904790DCB4115E69DC0A7F62900631CDCEFF889146D7493A94E9D4063F9DADA2785AEC
-F9FC63454FB80B6E30EFA236AB2D09DFF16F27AB0D516005354F7FCE544FD0B72C42D80B
-D08DB85EFFB680D0E396B47F224942106CD398B00156A3C3CF2E9F3AF47FA858A6D72265
-E58CAB789CBCD94742685B2D7DFDB5020103300D06092A864886F70D0101040500038181
-006D60FB995FA469B3D37B702B62231E442051AF2315C77402F949F2271A5CAC86713508
-2BF68FDEE0B596E88BA74BE373C848099DB0DA8BDA1592CA03E509255606E74EA447A5D1
-5746D43856F521CDC3263B2D2532CE9BE2BF4047EAD86D4776E5C030A30F80CE7FD83B7E
-A0F9952A312B15FAC814EDDDB0E9554170462D2C7E308209A63082090FA0030201020210
-7966966E83B0D0B601126E9DC0B46571300D06092A864886F70D01010205003061311130
-0F06035504071308496E7465726E657431173015060355040A130E566572695369676E2C
-20496E632E31333031060355040B132A566572695369676E20436F6D6D65726369616C20
-536F667477617265205075626C697368657273204341301E170D39383034313630303030
-30305A170D3939303431363233353935395A3082015D3111300F06035504071308496E74
-65726E657431173015060355040A130E566572695369676E2C20496E632E313330310603
-55040B132A566572695369676E20436F6D6D65726369616C20536F667477617265205075
-626C69736865727320434131463044060355040B133D7777772E766572697369676E2E63
-6F6D2F7265706F7369746F72792F43505320496E636F72702E206279205265662E2C4C49
-41422E4C54442863293936313E303C060355040B13354469676974616C20494420436C61
-73732033202D204D6963726F736F667420536F6674776172652056616C69646174696F6E
-207632310B3009060355040613025553311330110603550408130A57617368696E67746F
-6E3110300E060355040713075265646D6F6E64311E301C060355040314154D6963726F73
-6F667420436F72706F726174696F6E311E301C060355040B14154D6963726F736F667420
-436F72706F726174696F6E30820120300D06092A864886F70D01010105000382010D0030
-8201080282010100B490D226A864E6EB15C3FF6D7B414F0AF96F2A71CE2E1853A63236E0
-D468E135FD4912D896FC65CF531420BE04C97AF5C9706D94ECCCB3AF2A309A32587CB6A9
-6B256799C0E277EA05E5EFE396F7AD0B19A6AE3C8470E2F86F5C4F7D6F0F52458A15D765
-DC3B2005E33DA16C973A0E0B2513ED21CB208E397A628305C9231AFC529DAC9D4C96D73C
-4E583D827BEE093556B568C04245A23B31A3FBD895FB55C72CA8A3C3294FCEF493F0031F
-7BF1153AA9F8AA5083056D62F08B138838D9E31C0E73C10640BA28C3EBCD9271C7BE66B2
-A15422D60B677CF8877989AC660AAA51FAFD7221FC865DC6F44A0EEC5861234DD0B13A64
-E0139E5EC8856D4C16AF3D07020103A38205DD308205D930090603551D1304023000300B
-0603551D0F0404030205A03081880603551D01048180307E80107B96E4D143FD6898F338
-CC6E3BF20B82A16330613111300F06035504071308496E7465726E657431173015060355
-040A130E566572695369676E2C20496E632E31333031060355040B132A56657269536967
-6E20436F6D6D65726369616C20536F667477617265205075626C69736865727320434182
-0502B400000130210603551D040101FF04173014300E300C060A2B060104018237020116
-0302078000300D0603551D0A040630040302064030820436060A2B06010401823702010A
-0101FF048204233082041FA029802768747470733A2F2F7777772E766572697369676E2E
-636F6D2F7265706F7369746F72792F435053A18203B8818203B454686973206365727469
-66696361746520696E636F72706F7261746573206279207265666572656E63652C20616E
-642069747320757365206973207374726963746C790A7375626A65637420746F2C207468
-6520566572695369676E2043657274696669636174696F6E205072616374696365205374
-6174656D656E742028435053290A76657273696F6E20312E302C20617661696C61626C65
-20696E2074686520566572695369676E207265706F7369746F72792061743A0A68747470
-733A2F2F7777772E766572697369676E2E636F6D3B20627920452D6D61696C2061742043
-50532D726571756573747340766572697369676E2E636F6D3B206F720A6279206D61696C
-20617420566572695369676E2C20496E632E2C203235393320436F617374204176652E2C
-204D6F756E7461696E20566965772C2043412039343034330A55534120436F7079726967
-6874202863293139393620566572695369676E2C20496E632E2020416C6C205269676874
-732052657365727665642E204345525441494E0A57415252414E5449455320444953434C
-41494D454420414E44204C494142494C495459204C494D495445442E0A0A5741524E494E
-473A2054484520555345204F462054484953204345525449464943415445204953205354
-524943544C59205355424A45435420544F205448450A564552495349474E204345525449
-4649434154494F4E2050524143544943452053544154454D454E542E2020544845204953
-5355494E4720415554484F524954590A444953434C41494D53204345525441494E20494D
-504C49454420414E4420455850524553532057415252414E544945532C20494E434C5544
-494E472057415252414E544945530A4F46204D45524348414E544142494C495459204F52
-204649544E45535320464F52204120504152544943554C415220505552504F53452C2041
-4E442057494C4C204E4F540A4245204C4941424C4520464F5220434F4E53455155454E54
-49414C2C2050554E49544956452C20414E44204345525441494E204F544845522044414D
-414745532E205345450A5448452043505320464F522044455441494C532E0A0A436F6E74
-656E7473206F662074686520566572695369676E2072656769737465726564206E6F6E76
-657269666965645375626A656374417474726962757465730A657874656E73696F6E2076
-616C7565207368616C6C206E6F7420626520636F6E736964657265642061732061636375
-7261746520696E666F726D6174696F6E0A76616C69646174656420627920746865204941
-2E0AA336803468747470733A2F2F7777772E766572697369676E2E636F6D2F7265706F73
-69746F72792F766572697369676E6C6F676F2E6769663081AF0603551D200481A7308030
-80060B6086480186F845010701013080302806082B06010505070201161C68747470733A
-2F2F7777772E766572697369676E2E636F6D2F435053306206082B060105050702023056
-3015160E566572695369676E2C20496E632E30030201011A3D566572695369676E277320
-43505320696E636F72702E206279207265666572656E6365206C6961622E206C74642E20
-286329393720566572695369676E0000000000003016060A2B06010401823702011B0408
-30060101FF0101FF300D06092A864886F70D010102050003818100954CA27955DA745C8B
-25C2A620F06CB8B37B467B9E9F7ABA710648151265CC5D29F8513B8971B1F4143878DA8F
-AE0B8036905D4897C500380A53BF4037FF8A13276D004734F7484C2E72F2C6D37EFD446F
-228FD1929FE394EDE7FF00C9C2EE721CD99C036EB6C1637B3278443B9E858AFB84863728
-2EE7A638373EBAFCF382233182042430820420020101307530613111300F060355040713
-08496E7465726E657431173015060355040A130E566572695369676E2C20496E632E3133
-3031060355040B132A566572695369676E20436F6D6D65726369616C20536F6674776172
-65205075626C69736865727320434102107966966E83B0D0B601126E9DC0B46571300C06
-082A864886F70D02050500A081AE301906092A864886F70D010903310C060A2B06010401
-8237020104301C060A2B06010401823702010B310E300C060A2B06010401823702011630
-1F06092A864886F70D010904311204105BA6237427F8290EF09CCF5B63F749F83052060A
-2B06010401823702010C31443042A01A801800560065007200640061006E006100200046
-006F006E0074A1248022687474703A2F2F7777772E6D6963726F736F66742E636F6D2F74
-727565747970652F300D06092A864886F70D0101010500048201003EFBA519B6A00C823F
-B823EA3A1E5E6EBDBBF2C647D1F1093C66910B72FEA26B78E409E7750E62A559DAAC12F7
-CCA36B0725F8BB2E0409AEE1156BE3736F46D1B116DF2B18ABCF394DCF0EF8EE01A758E5
-E4872882FFDD5F04C39F3258358C3DE27BE8FC410AC11736DD19609E3BACBB2257C5E4A4
-836F811D07EC80DAB42FE9AC33537823FA2AC0D406166130C356085818B3CEC8A53763BF
-88191B4E52ED790B57C924CEA670505AA2621C1121663215F15D1A9E89A6BC2AA35F5B1F
-86E4FDEC2280203A57D736DD2C29A4D2D29F00BAF260927AB3B36EF1C4CC5100CAC54BAA
-0AFB74D0101FBEC53815E46B3814DF7E5DFC4A121257608F59AA76D5F333A3A18201D030
-8201CC06092A864886F70D010906318201BD308201B90201013081B830819E311F301D06
-0355040A1316566572695369676E205472757374204E6574776F726B3117301506035504
-0B130E566572695369676E2C20496E632E312C302A060355040B1323566572695369676E
-2054696D65205374616D70696E67205365727669636520526F6F7431343032060355040B
-132B4E4F204C494142494C4954592041434345505445442C202863293937205665726953
-69676E2C20496E632E021500BD119ADA43ED21FB46588489CA46889025EE1460300C0608
-2A864886F70D02050500A059301806092A864886F70D010903310B06092A864886F70D01
-0701301C06092A864886F70D010905310F170D3938313131323135313835305A301F0609
-2A864886F70D01090431120410641EED59DAFC3103655C9A2A4309D288300D06092A8648
-86F70D01010105000481809092A6C858A52E216E3E56A1C40477C3C63030D247298EF8EA
-BFA1C4D5DDE8C375555276DDBB2761ADFC914D772AD331C04DDD675B9736F7D136CAA72D
-41CF9F8377C51611E0D1B6EDD8C5AB73694109FD5312908B17319E96C22CCEDD65C9D342
-DC0E3B159C36E0FDA54B21C8DD968B90621C263E94F737AC1997B9D84E517C0000>
-] def
-/CharStrings 893 dict dup begin
-/.notdef 0 def /.null 1 def /nonmarkingreturn 2 def /space 3 def /exclam 4 def
-/quotedbl 5 def /numbersign 6 def /dollar 7 def /percent 8 def
-/ampersand 9 def /quotesingle 10 def /parenleft 11 def /parenright 12 def
-/asterisk 13 def /plus 14 def /comma 15 def /hyphen 16 def
-/period 17 def /slash 18 def /zero 19 def /one 20 def
-/two 21 def /three 22 def /four 23 def /five 24 def
-/six 25 def /seven 26 def /eight 27 def /nine 28 def
-/colon 29 def /semicolon 30 def /less 31 def /equal 32 def
-/greater 33 def /question 34 def /at 35 def /A 36 def
-/B 37 def /C 38 def /D 39 def /E 40 def
-/F 41 def /G 42 def /H 43 def /I 44 def
-/J 45 def /K 46 def /L 47 def /M 48 def
-/N 49 def /O 50 def /P 51 def /Q 52 def
-/R 53 def /S 54 def /T 55 def /U 56 def
-/V 57 def /W 58 def /X 59 def /Y 60 def
-/Z 61 def /bracketleft 62 def /backslash 63 def /bracketright 64 def
-/asciicircum 65 def /underscore 66 def /grave 67 def /a 68 def
-/b 69 def /c 70 def /d 71 def /e 72 def
-/f 73 def /g 74 def /h 75 def /i 76 def
-/j 77 def /k 78 def /l 79 def /m 80 def
-/n 81 def /o 82 def /p 83 def /q 84 def
-/r 85 def /s 86 def /t 87 def /u 88 def
-/v 89 def /w 90 def /x 91 def /y 92 def
-/z 93 def /braceleft 94 def /bar 95 def /braceright 96 def
-/asciitilde 97 def /Adieresis 98 def /Aring 99 def /Ccedilla 100 def
-/Eacute 101 def /Ntilde 102 def /Odieresis 103 def /Udieresis 104 def
-/aacute 105 def /agrave 106 def /acircumflex 107 def /adieresis 108 def
-/atilde 109 def /aring 110 def /ccedilla 111 def /eacute 112 def
-/egrave 113 def /ecircumflex 114 def /edieresis 115 def /iacute 116 def
-/igrave 117 def /icircumflex 118 def /idieresis 119 def /ntilde 120 def
-/oacute 121 def /ograve 122 def /ocircumflex 123 def /odieresis 124 def
-/otilde 125 def /uacute 126 def /ugrave 127 def /ucircumflex 128 def
-/udieresis 129 def /dagger 130 def /degree 131 def /cent 132 def
-/sterling 133 def /section 134 def /bullet 135 def /paragraph 136 def
-/germandbls 137 def /registered 138 def /copyright 139 def /trademark 140 def
-/acute 141 def /dieresis 142 def /notequal 143 def /AE 144 def
-/Oslash 145 def /infinity 146 def /plusminus 147 def /lessequal 148 def
-/greaterequal 149 def /yen 150 def /mu1 151 def /partialdiff 152 def
-/summation 153 def /product 154 def /pi1 155 def /integral 156 def
-/ordfeminine 157 def /ordmasculine 158 def /Ohm 159 def /ae 160 def
-/oslash 161 def /questiondown 162 def /exclamdown 163 def /logicalnot 164 def
-/radical 165 def /florin 166 def /approxequal 167 def /increment 168 def
-/guillemotleft 169 def /guillemotright 170 def /ellipsis 171 def /Agrave 172 def
-/Atilde 173 def /Otilde 174 def /OE 175 def /oe 176 def
-/endash 177 def /emdash 178 def /quotedblleft 179 def /quotedblright 180 def
-/quoteleft 181 def /quoteright 182 def /divide 183 def /lozenge 184 def
-/ydieresis 185 def /Ydieresis 186 def /fraction 187 def /Euro 188 def
-/guilsinglleft 189 def /guilsinglright 190 def /fi 191 def /fl 192 def
-/daggerdbl 193 def /periodcentered 194 def /quotesinglbase 195 def /quotedblbase 196 def
-/perthousand 197 def /Acircumflex 198 def /Ecircumflex 199 def /Aacute 200 def
-/Edieresis 201 def /Egrave 202 def /Iacute 203 def /Icircumflex 204 def
-/Idieresis 205 def /Igrave 206 def /Oacute 207 def /Ocircumflex 208 def
-/Ograve 209 def /Uacute 210 def /Ucircumflex 211 def /Ugrave 212 def
-/dotlessi 213 def /circumflex 214 def /tilde 215 def /macron 216 def
-/breve 217 def /dotaccent 218 def /ring 219 def /cedilla 220 def
-/hungarumlaut 221 def /ogonek 222 def /caron 223 def /Lslash 224 def
-/lslash 225 def /Scaron 226 def /scaron 227 def /Zcaron 228 def
-/zcaron 229 def /brokenbar 230 def /Eth 231 def /eth 232 def
-/Yacute 233 def /yacute 234 def /Thorn 235 def /thorn 236 def
-/minus 237 def /multiply 238 def /onesuperior 239 def /twosuperior 240 def
-/threesuperior 241 def /onehalf 242 def /onequarter 243 def /threequarters 244 def
-/franc 245 def /Gbreve 246 def /gbreve 247 def /Idot 248 def
-/Scedilla 249 def /scedilla 250 def /Cacute 251 def /cacute 252 def
-/Ccaron 253 def /ccaron 254 def /dmacron 255 def /overscore 256 def
-/middot 257 def /Abreve 258 def /abreve 259 def /Aogonek 260 def
-/aogonek 261 def /Dcaron 262 def /dcaron 263 def /Dslash 264 def
-/Eogonek 265 def /eogonek 266 def /Ecaron 267 def /ecaron 268 def
-/Lacute 269 def /lacute 270 def /Lcaron 271 def /lcaron 272 def
-/Ldot 273 def /ldot 274 def /Nacute 275 def /nacute 276 def
-/Ncaron 277 def /ncaron 278 def /Odblacute 279 def /odblacute 280 def
-/Racute 281 def /racute 282 def /Rcaron 283 def /rcaron 284 def
-/Sacute 285 def /sacute 286 def /Tcedilla 287 def /tcedilla 288 def
-/Tcaron 289 def /tcaron 290 def /Uring 291 def /uring 292 def
-/Udblacute 293 def /udblacute 294 def /Zacute 295 def /zacute 296 def
-/Zdot 297 def /zdot 298 def /Gamma 299 def /Theta 300 def
-/Phi 301 def /alpha 302 def /delta 303 def /epsilon 304 def
-/sigma 305 def /tau 306 def /phi 307 def /underscoredbl 308 def
-/exclamdbl 309 def /nsuperior 310 def /peseta 311 def /IJ 312 def
-/ij 313 def /napostrophe 314 def /minute 315 def /second 316 def
-/afii61248 317 def /afii61289 318 def /H22073 319 def /H18543 320 def
-/H18551 321 def /H18533 322 def /openbullet 323 def /Amacron 324 def
-/amacron 325 def /Ccircumflex 326 def /ccircumflex 327 def /Cdot 328 def
-/cdot 329 def /Emacron 330 def /emacron 331 def /Ebreve 332 def
-/ebreve 333 def /Edot 334 def /edot 335 def /Gcircumflex 336 def
-/gcircumflex 337 def /Gdot 338 def /gdot 339 def /Gcedilla 340 def
-/gcedilla 341 def /Hcircumflex 342 def /hcircumflex 343 def /Hbar 344 def
-/hbar 345 def /Itilde 346 def /itilde 347 def /Imacron 348 def
-/imacron 349 def /Ibreve 350 def /ibreve 351 def /Iogonek 352 def
-/iogonek 353 def /Jcircumflex 354 def /jcircumflex 355 def /Kcedilla 356 def
-/kcedilla 357 def /kgreenlandic 358 def /Lcedilla 359 def /lcedilla 360 def
-/Ncedilla 361 def /ncedilla 362 def /Eng 363 def /eng 364 def
-/Omacron 365 def /omacron 366 def /Obreve 367 def /obreve 368 def
-/Rcedilla 369 def /rcedilla 370 def /Scircumflex 371 def /scircumflex 372 def
-/Tbar 373 def /tbar 374 def /Utilde 375 def /utilde 376 def
-/Umacron 377 def /umacron 378 def /Ubreve 379 def /ubreve 380 def
-/Uogonek 381 def /uogonek 382 def /Wcircumflex 383 def /wcircumflex 384 def
-/Ycircumflex 385 def /ycircumflex 386 def /longs 387 def /Aringacute 388 def
-/aringacute 389 def /AEacute 390 def /aeacute 391 def /Oslashacute 392 def
-/oslashacute 393 def /anoteleia 394 def /Wgrave 395 def /wgrave 396 def
-/Wacute 397 def /wacute 398 def /Wdieresis 399 def /wdieresis 400 def
-/Ygrave 401 def /ygrave 402 def /quotereversed 403 def /radicalex 404 def
-/afii08941 405 def /estimated 406 def /oneeighth 407 def /threeeighths 408 def
-/fiveeighths 409 def /seveneighths 410 def /commaaccent 411 def /undercommaaccent 412 def
-/tonos 413 def /dieresistonos 414 def /Alphatonos 415 def /Epsilontonos 416 def
-/Etatonos 417 def /Iotatonos 418 def /Omicrontonos 419 def /Upsilontonos 420 def
-/Omegatonos 421 def /iotadieresistonos 422 def /Alpha 423 def /Beta 424 def
-/Delta 425 def /Epsilon 426 def /Zeta 427 def /Eta 428 def
-/Iota 429 def /Kappa 430 def /Lambda 431 def /Mu 432 def
-/Nu 433 def /Xi 434 def /Omicron 435 def /Pi 436 def
-/Rho 437 def /Sigma 438 def /Tau 439 def /Upsilon 440 def
-/Chi 441 def /Psi 442 def /Omega 443 def /Iotadieresis 444 def
-/Upsilondieresis 445 def /alphatonos 446 def /epsilontonos 447 def /etatonos 448 def
-/iotatonos 449 def /upsilondieresistonos 450 def /beta 451 def /gamma 452 def
-/zeta 453 def /eta 454 def /theta 455 def /iota 456 def
-/kappa 457 def /lambda 458 def /mu 459 def /nu 460 def
-/xi 461 def /omicron 462 def /rho 463 def /sigma1 464 def
-/upsilon 465 def /chi 466 def /psi 467 def /omega 468 def
-/iotadieresis 469 def /upsilondieresis 470 def /omicrontonos 471 def /upsilontonos 472 def
-/omegatonos 473 def /afii10023 474 def /afii10051 475 def /afii10052 476 def
-/afii10053 477 def /afii10054 478 def /afii10055 479 def /afii10056 480 def
-/afii10057 481 def /afii10058 482 def /afii10059 483 def /afii10060 484 def
-/afii10061 485 def /afii10062 486 def /afii10145 487 def /afii10017 488 def
-/afii10018 489 def /afii10019 490 def /afii10020 491 def /afii10021 492 def
-/afii10022 493 def /afii10024 494 def /afii10025 495 def /afii10026 496 def
-/afii10027 497 def /afii10028 498 def /afii10029 499 def /afii10030 500 def
-/afii10031 501 def /afii10032 502 def /afii10033 503 def /afii10034 504 def
-/afii10035 505 def /afii10036 506 def /afii10037 507 def /afii10038 508 def
-/afii10039 509 def /afii10040 510 def /afii10041 511 def /afii10042 512 def
-/afii10043 513 def /afii10044 514 def /afii10045 515 def /afii10046 516 def
-/afii10047 517 def /afii10048 518 def /afii10049 519 def /afii10065 520 def
-/afii10066 521 def /afii10067 522 def /afii10068 523 def /afii10069 524 def
-/afii10070 525 def /afii10072 526 def /afii10073 527 def /afii10074 528 def
-/afii10075 529 def /afii10076 530 def /afii10077 531 def /afii10078 532 def
-/afii10079 533 def /afii10080 534 def /afii10081 535 def /afii10082 536 def
-/afii10083 537 def /afii10084 538 def /afii10085 539 def /afii10086 540 def
-/afii10087 541 def /afii10088 542 def /afii10089 543 def /afii10090 544 def
-/afii10091 545 def /afii10092 546 def /afii10093 547 def /afii10094 548 def
-/afii10095 549 def /afii10096 550 def /afii10097 551 def /afii10071 552 def
-/afii10099 553 def /afii10100 554 def /afii10101 555 def /afii10102 556 def
-/afii10103 557 def /afii10104 558 def /afii10105 559 def /afii10106 560 def
-/afii10107 561 def /afii10108 562 def /afii10109 563 def /afii10110 564 def
-/afii10193 565 def /afii10050 566 def /afii10098 567 def /afii00208 568 def
-/afii61352 569 def /pi 570 def /onenumerator 571 def /twonumerator 572 def
-/threenumerator 573 def /fournumerator 574 def /fivenumerator 575 def /sevennumerator 576 def
-/eightnumerator 577 def /DontCompressHTMX 578 def /glyph579 579 def /glyph580 580 def
-/glyph581 581 def /Ohorn 582 def /ohorn 583 def /Uhorn 584 def
-/uhorn 585 def /hookabovecomb 586 def /dotbelowcomb 587 def /gravecomb 588 def
-/acutecomb 589 def /glyph590 590 def /glyph591 591 def /glyph592 592 def
-/glyph593 593 def /glyph594 594 def /glyph595 595 def /glyph596 596 def
-/glyph597 597 def /glyph598 598 def /glyph599 599 def /glyph600 600 def
-/glyph601 601 def /glyph602 602 def /glyph603 603 def /glyph604 604 def
-/Adotbelow 605 def /adotbelow 606 def /Ahookabove 607 def /ahookabove 608 def
-/Acircumflexacute 609 def /acircumflexacute 610 def /Acircumflexgrave 611 def /acircumflexgrave 612 def
-/Acircumflexhookabove 613 def /acircumflexhookabove 614 def /Acircumflextilde 615 def /acircumflextilde 616 def
-/Acircumflexdotbelow 617 def /acircumflexdotbelow 618 def /Abreveacute 619 def /abreveacute 620 def
-/Abrevegrave 621 def /abrevegrave 622 def /Abrevehookabove 623 def /abrevehookabove 624 def
-/Abrevetilde 625 def /abrevetilde 626 def /Abrevedotbelow 627 def /abrevedotbelow 628 def
-/Edotbelow 629 def /edotbelow 630 def /Ehookabove 631 def /ehookabove 632 def
-/Etilde 633 def /etilde 634 def /Ecircumflexacute 635 def /ecircumflexacute 636 def
-/Ecircumflexgrave 637 def /ecircumflexgrave 638 def /Ecircumflexhookabove 639 def /ecircumflexhookabove 640 def
-/Ecircumflextilde 641 def /ecircumflextilde 642 def /Ecircumflexdotbelow 643 def /ecircumflexdotbelow 644 def
-/Ihookabove 645 def /ihookabove 646 def /Idotbelow 647 def /idotbelow 648 def
-/glyph649 649 def /glyph650 650 def /glyph651 651 def /glyph652 652 def
-/sheva 653 def /hatafsegol 654 def /hatafpatah 655 def /hatafqamats 656 def
-/hiriq 657 def /tsere 658 def /segol 659 def /patah 660 def
-/qamats 661 def /holam 662 def /qubuts 663 def /dagesh 664 def
-/meteg 665 def /maqaf 666 def /rafe 667 def /paseq 668 def
-/shindot 669 def /sindot 670 def /sofpasuq 671 def /alef 672 def
-/bet 673 def /gimel 674 def /dalet 675 def /he 676 def
-/vav 677 def /zayin 678 def /het 679 def /tet 680 def
-/yod 681 def /finalkaf 682 def /kaf 683 def /lamed 684 def
-/finalmem 685 def /mem 686 def /finalnun 687 def /nun 688 def
-/samekh 689 def /ayin 690 def /finalpe 691 def /pe 692 def
-/finaltsadi 693 def /tsadi 694 def /qof 695 def /resh 696 def
-/shin 697 def /tav 698 def /doublevav 699 def /vavyod 700 def
-/doubleyod 701 def /geresh 702 def /gershayim 703 def /newsheqelsign 704 def
-/vavshindot 705 def /finalkafsheva 706 def /finalkafqamats 707 def /lamedholam 708 def
-/lamedholamdagesh 709 def /altayin 710 def /shinshindot 711 def /shinsindot 712 def
-/shindageshshindot 713 def /shindageshsindot 714 def /alefpatah 715 def /alefqamats 716 def
-/alefmapiq 717 def /betdagesh 718 def /gimeldagesh 719 def /daletdagesh 720 def
-/hedagesh 721 def /vavdagesh 722 def /zayindagesh 723 def /tetdagesh 724 def
-/yoddagesh 725 def /finalkafdagesh 726 def /kafdagesh 727 def /lameddagesh 728 def
-/memdagesh 729 def /nundagesh 730 def /samekhdagesh 731 def /finalpedagesh 732 def
-/pedagesh 733 def /tsadidagesh 734 def /qofdagesh 735 def /reshdagesh 736 def
-/shindagesh 737 def /tavdages 738 def /vavholam 739 def /betrafe 740 def
-/kafrafe 741 def /perafe 742 def /aleflamed 743 def /zerowidthnonjoiner 744 def
-/zerowidthjoiner 745 def /lefttorightmark 746 def /righttoleftmark 747 def /afii57388 748 def
-/afii57403 749 def /afii57407 750 def /afii57409 751 def /afii57440 752 def
-/afii57451 753 def /afii57452 754 def /afii57453 755 def /afii57454 756 def
-/afii57455 757 def /afii57456 758 def /afii57457 759 def /afii57458 760 def
-/afii57392 761 def /afii57393 762 def /afii57394 763 def /afii57395 764 def
-/afii57396 765 def /afii57397 766 def /afii57398 767 def /afii57399 768 def
-/afii57400 769 def /afii57401 770 def /afii57381 771 def /afii57461 772 def
-/afii63167 773 def /afii57459 774 def /afii57543 775 def /afii57534 776 def
-/afii57494 777 def /afii62843 778 def /afii62844 779 def /afii62845 780 def
-/afii64240 781 def /afii64241 782 def /afii63954 783 def /afii57382 784 def
-/afii64242 785 def /afii62881 786 def /afii57504 787 def /afii57369 788 def
-/afii57370 789 def /afii57371 790 def /afii57372 791 def /afii57373 792 def
-/afii57374 793 def /afii57375 794 def /afii57391 795 def /afii57471 796 def
-/afii57460 797 def /afii52258 798 def /afii57506 799 def /afii62958 800 def
-/afii62956 801 def /afii52957 802 def /afii57505 803 def /afii62889 804 def
-/afii62887 805 def /afii62888 806 def /afii57507 807 def /afii62961 808 def
-/afii62959 809 def /afii62960 810 def /afii57508 811 def /afii62962 812 def
-/afii57567 813 def /afii62964 814 def /afii52305 815 def /afii52306 816 def
-/afii57509 817 def /afii62967 818 def /afii62965 819 def /afii62966 820 def
-/afii57555 821 def /afii52364 822 def /afii63753 823 def /afii63754 824 def
-/afii63759 825 def /afii63763 826 def /afii63795 827 def /afii62891 828 def
-/afii63808 829 def /afii62938 830 def /afii63810 831 def /afii62942 832 def
-/afii62947 833 def /afii63813 834 def /afii63823 835 def /afii63824 836 def
-/afii63833 837 def /afii63844 838 def /afii62882 839 def /afii62883 840 def
-/afii62884 841 def /afii62885 842 def /afii62886 843 def /Odotbelow 844 def
-/odotbelow 845 def /Ohookabove 846 def /ohookabove 847 def /Ocircumflexacute 848 def
-/ocircumflexacute 849 def /Ocircumflexgrave 850 def /ocircumflexgrave 851 def /Ocircumflexhookabove 852 def
-/ocircumflexhookabove 853 def /Ocircumflextilde 854 def /ocircumflextilde 855 def /Ocircumflexdotbelow 856 def
-/ocircumflexdotbelow 857 def /Ohornacute 858 def /ohornacute 859 def /Ohorngrave 860 def
-/ohorngrave 861 def /Ohornhookabove 862 def /ohornhookabove 863 def /Ohorntilde 864 def
-/ohorntilde 865 def /Ohorndotbelow 866 def /ohorndotbelow 867 def /Udotbelow 868 def
-/udotbelow 869 def /Uhookabove 870 def /uhookabove 871 def /Uhornacute 872 def
-/uhornacute 873 def /Uhorngrave 874 def /uhorngrave 875 def /Uhornhookabove 876 def
-/uhornhookabove 877 def /Uhorntilde 878 def /uhorntilde 879 def /Uhorndotbelow 880 def
-/uhorndotbelow 881 def /glyph882 882 def /glyph883 883 def /Ydotbelow 884 def
-/ydotbelow 885 def /Yhookabove 886 def /yhookabove 887 def /Ytilde 888 def
-/ytilde 889 def /dong 890 def /tildecomb 891 def /currency 892 def
-
-end readonly def
-FontName currentdict end definefont pop
-%%EndFont
-%%EndProlog
-mpldict begin
-13.5 175.5 translate
-585 441 0 0 clipbox
-% polygon
-1.000 setgray
-1.000 setlinewidth
-0 setlinejoin
-2 setlinecap
-[] 0 setdash
-0 0 m
-0 441 l
-585 441 l
-585 0 l
-closepath
-gsave
-fill
-grestore
-stroke
-% polygon
-0.000 setgray
-73.125 44.1 m
-73.125 396.9 l
-526.5 396.9 l
-526.5 44.1 l
-closepath
-gsave
-1.000 setgray
-fill
-grestore
-stroke
-% draw_lines
-0.000 0.000 1.000 setrgbcolor
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 341.084 m
-76.667 340.708 l
-80.209 339.574 l
-83.751 337.667 l
-87.293 334.958 l
-90.835 331.405 l
-94.377 326.949 l
-97.919 321.506 l
-101.461 314.959 l
-105.003 307.144 l
-108.545 297.819 l
-112.087 286.607 l
-115.629 272.882 l
-119.171 255.463 l
-122.713 231.623 l
-126.255 191.605 l
-129.797 103.027 l
-133.339 189.379 l
-136.881 202.932 l
-140.423 203.284 l
-143.965 191.777 l
-147.507 147.593 l
-151.049 193.483 l
-154.591 200.946 l
-158.133 199.387 l
-161.675 188.957 l
-165.217 143.486 l
-168.759 180.998 l
-172.301 191.170 l
-175.843 191.200 l
-179.385 183.119 l
-182.927 155.818 l
-186.469 166.661 l
-190.011 181.010 l
-193.553 182.971 l
-197.095 177.076 l
-200.637 157.567 l
-204.179 150.322 l
-207.721 171.053 l
-211.263 175.126 l
-214.805 171.229 l
-218.347 156.530 l
-221.889 128.062 l
-225.431 161.185 l
-228.973 167.631 l
-232.515 165.609 l
-236.057 154.358 l
-239.599 74.463 l
-243.141 151.102 l
-246.683 160.365 l
-250.225 160.169 l
-253.767 151.622 l
-257.309 119.107 l
-260.851 140.326 l
-264.393 153.187 l
-267.935 154.839 l
-271.477 148.556 l
-275.019 126.619 l
-278.561 127.980 l
-282.103 145.946 l
-285.645 149.548 l
-289.187 145.259 l
-292.729 129.081 l
-296.271 111.844 l
-299.812 138.465 l
-303.354 144.220 l
-306.896 141.769 l
-310.438 129.466 l
-313.980 80.114 l
-317.522 130.512 l
-321.064 138.774 l
-324.606 138.087 l
-328.148 128.702 l
-331.690 86.924 l
-335.232 121.741 l
-338.774 133.118 l
-342.316 134.191 l
-345.858 127.176 l
-349.400 101.638 l
-352.942 111.541 l
-356.484 127.140 l
-360.026 130.041 l
-363.568 125.064 l
-367.110 106.776 l
-370.652 98.551 l
-374.194 120.692 l
-377.736 125.577 l
-381.278 122.435 l
-384.820 108.642 l
-388.362 78.089 l
-391.904 113.570 l
-395.446 120.713 l
-398.988 119.291 l
-402.530 108.713 l
-406.072 43.008 l
-409.614 105.462 l
-413.156 115.325 l
-416.698 115.577 l
-420.240 107.501 l
-423.782 76.568 l
-427.324 95.836 l
-430.866 109.233 l
-434.408 111.171 l
-437.950 105.155 l
-441.492 83.904 l
-445.034 83.647 l
-448.576 102.154 l
-452.118 105.845 l
-455.660 101.582 l
-459.202 85.611 l
-462.744 66.167 l
-466.286 93.605 l
-469.828 99.169 l
-473.370 96.397 l
-476.912 83.814 l
-480.454 27.509 l
-483.996 82.648 l
-487.538 90.217 l
-491.080 88.573 l
-494.622 78.102 l
-498.164 37.173 l
-501.706 66.931 l
-505.248 76.324 l
-508.790 74.675 l
-512.332 64.142 l
-515.874 34.431 l
-519.416 35.180 l
-522.958 37.945 l
-stroke
-grestore
-% draw_lines
-1.000 0.000 0.000 setrgbcolor
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 344.638 m
-76.667 344.021 l
-80.209 342.148 l
-83.751 338.946 l
-87.293 334.276 l
-90.835 327.903 l
-94.377 319.427 l
-97.919 308.120 l
-101.461 292.475 l
-105.003 268.454 l
-108.545 213.072 l
-112.087 218.519 l
-115.629 259.152 l
-119.171 273.925 l
-122.713 280.520 l
-126.255 282.309 l
-129.797 280.332 l
-133.339 274.683 l
-136.881 264.621 l
-140.423 247.681 l
-143.965 212.929 l
-147.507 184.774 l
-151.049 218.234 l
-154.591 243.484 l
-158.133 254.844 l
-161.675 259.959 l
-165.217 260.773 l
-168.759 257.793 l
-172.301 250.665 l
-175.843 237.757 l
-179.385 212.685 l
-182.927 178.994 l
-186.469 -424.877 l
-190.011 217.746 l
-193.553 235.408 l
-197.095 243.801 l
-200.637 247.028 l
-204.179 246.206 l
-207.721 241.360 l
-211.263 231.429 l
-214.805 212.332 l
-218.347 138.495 l
-221.889 185.787 l
-225.431 183.612 l
-228.973 217.038 l
-232.515 229.873 l
-236.057 235.734 l
-239.599 237.005 l
-243.141 234.198 l
-246.683 226.722 l
-250.225 211.859 l
-253.767 169.476 l
-257.309 186.593 l
-260.851 173.823 l
-264.393 194.732 l
-267.935 216.079 l
-271.477 225.369 l
-275.019 228.930 l
-278.561 228.116 l
-282.103 222.822 l
-285.645 211.246 l
-289.187 183.443 l
-292.729 181.050 l
-296.271 187.513 l
-299.812 178.164 l
-303.354 199.915 l
-306.896 214.825 l
-310.438 221.217 l
-313.980 222.524 l
-317.522 219.301 l
-321.064 210.468 l
-324.606 190.157 l
-328.148 169.944 l
-331.690 189.675 l
-335.232 181.582 l
-338.774 172.547 l
-342.316 202.663 l
-345.858 213.205 l
-349.400 216.995 l
-352.942 215.878 l
-356.484 209.487 l
-360.026 194.151 l
-363.568 141.332 l
-367.110 188.290 l
-370.652 190.018 l
-374.194 168.185 l
-377.736 185.194 l
-381.278 203.994 l
-384.820 211.108 l
-388.362 212.316 l
-391.904 208.247 l
-395.446 196.681 l
-398.988 154.875 l
-402.530 184.658 l
-406.072 192.833 l
-409.614 186.663 l
-413.156 -460.889 l
-416.698 191.640 l
-420.240 204.277 l
-423.782 208.351 l
-427.324 206.663 l
-430.866 198.243 l
-434.408 172.764 l
-437.950 178.651 l
-441.492 193.308 l
-445.034 193.407 l
-448.576 179.767 l
-452.118 167.615 l
-455.660 195.351 l
-459.202 203.595 l
-462.744 204.597 l
-466.286 199.048 l
-469.828 181.359 l
-473.370 168.699 l
-476.912 192.336 l
-480.454 196.765 l
-483.996 191.640 l
-487.538 166.317 l
-491.080 180.819 l
-494.622 197.324 l
-498.164 201.811 l
-501.706 199.150 l
-505.248 186.669 l
-508.790 146.473 l
-512.332 190.158 l
-515.874 198.473 l
-519.416 197.844 l
-522.958 187.711 l
-stroke
-grestore
-% draw_lines
-0.000 0.500 0.000 setrgbcolor
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 344.646 m
-76.667 344.163 l
-80.209 342.697 l
-83.751 340.206 l
-87.293 336.608 l
-90.835 331.765 l
-94.377 325.450 l
-97.919 317.263 l
-101.461 306.406 l
-105.003 290.855 l
-108.545 260.984 l
-112.087 257.910 l
-115.629 270.113 l
-119.171 268.975 l
-122.713 260.468 l
-126.255 240.233 l
-129.797 221.580 l
-133.339 244.142 l
-136.881 246.939 l
-140.423 241.790 l
-143.965 226.836 l
-147.507 180.268 l
-151.049 224.403 l
-154.591 230.521 l
-158.133 227.898 l
-161.675 216.607 l
-165.217 170.426 l
-168.759 207.344 l
-172.301 217.011 l
-175.843 216.608 l
-179.385 208.152 l
-182.927 180.524 l
-186.469 191.080 l
-190.011 205.174 l
-193.553 206.908 l
-197.095 200.811 l
-200.637 181.119 l
-204.179 173.710 l
-207.721 194.292 l
-211.263 198.229 l
-214.805 194.208 l
-218.347 179.396 l
-221.889 150.824 l
-225.431 183.851 l
-228.973 190.209 l
-232.515 188.106 l
-236.057 176.779 l
-239.599 96.814 l
-243.141 173.388 l
-246.683 182.589 l
-250.225 182.337 l
-253.767 173.737 l
-257.309 141.172 l
-260.851 162.345 l
-264.393 175.162 l
-267.935 176.773 l
-271.477 170.451 l
-275.019 148.477 l
-278.561 149.804 l
-282.103 167.738 l
-285.645 171.309 l
-289.187 166.991 l
-292.729 150.785 l
-296.271 133.522 l
-299.812 160.118 l
-303.354 165.850 l
-306.896 163.377 l
-310.438 151.052 l
-313.980 101.679 l
-317.522 152.059 l
-321.064 160.303 l
-324.606 159.598 l
-328.148 150.196 l
-331.690 108.402 l
-335.232 143.204 l
-338.774 154.567 l
-342.316 155.626 l
-345.858 148.598 l
-349.400 123.046 l
-352.942 132.938 l
-356.484 148.525 l
-360.026 151.416 l
-363.568 146.427 l
-367.110 128.129 l
-370.652 119.895 l
-374.194 142.026 l
-377.736 146.903 l
-381.278 143.752 l
-384.820 129.951 l
-388.362 99.390 l
-391.904 134.864 l
-395.446 141.999 l
-398.988 140.570 l
-402.530 129.986 l
-406.072 64.275 l
-409.614 126.723 l
-413.156 136.580 l
-416.698 136.826 l
-420.240 128.745 l
-423.782 97.807 l
-427.324 117.071 l
-430.866 130.463 l
-434.408 132.397 l
-437.950 126.376 l
-441.492 105.122 l
-445.034 104.861 l
-448.576 123.364 l
-452.118 127.052 l
-455.660 122.786 l
-459.202 106.813 l
-462.744 87.365 l
-466.286 114.801 l
-469.828 120.363 l
-473.370 117.588 l
-476.912 105.003 l
-480.454 48.696 l
-483.996 103.833 l
-487.538 111.400 l
-491.080 109.755 l
-494.622 99.282 l
-498.164 58.352 l
-501.706 88.110 l
-505.248 97.502 l
-508.790 95.852 l
-512.332 85.318 l
-515.874 55.606 l
-519.416 56.356 l
-522.958 59.120 l
-stroke
-grestore
-% draw_lines
-0.750 0.000 0.750 setrgbcolor
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 346.280 m
-76.667 345.676 l
-80.209 343.845 l
-83.751 340.736 l
-87.293 336.248 l
-90.835 330.224 l
-94.377 322.407 l
-97.919 312.371 l
-101.461 299.341 l
-105.003 281.601 l
-108.545 253.253 l
-112.087 220.282 l
-115.629 233.441 l
-119.171 220.121 l
-122.713 198.594 l
-126.255 213.622 l
-129.797 232.741 l
-133.339 242.085 l
-136.881 243.804 l
-140.423 237.025 l
-143.965 203.960 l
-147.507 230.388 l
-151.049 244.073 l
-154.591 246.690 l
-158.133 241.191 l
-161.675 219.125 l
-165.217 223.903 l
-168.759 241.739 l
-172.301 245.662 l
-175.843 241.477 l
-179.385 224.009 l
-182.927 215.555 l
-186.469 238.476 l
-190.011 243.766 l
-193.553 240.795 l
-197.095 226.371 l
-200.637 204.635 l
-204.179 234.918 l
-207.721 241.638 l
-211.263 239.805 l
-214.805 227.701 l
-218.347 187.148 l
-221.889 231.207 l
-225.431 239.460 l
-228.973 238.716 l
-232.515 228.509 l
-236.057 142.756 l
-239.599 227.342 l
-243.141 237.284 l
-246.683 237.602 l
-250.225 229.015 l
-253.767 188.027 l
-257.309 223.261 l
-260.851 235.117 l
-264.393 236.489 l
-267.935 229.330 l
-271.477 199.520 l
-275.019 218.852 l
-278.561 232.949 l
-282.103 235.386 l
-285.645 229.515 l
-289.187 205.946 l
-292.729 213.941 l
-296.271 230.761 l
-299.812 234.290 l
-303.354 229.607 l
-306.896 210.254 l
-310.438 208.235 l
-313.980 228.529 l
-317.522 233.195 l
-321.064 229.626 l
-324.606 213.410 l
-328.148 201.185 l
-331.690 226.226 l
-335.232 232.097 l
-338.774 229.588 l
-342.316 215.852 l
-345.858 191.524 l
-349.400 223.818 l
-352.942 230.985 l
-356.484 229.500 l
-360.026 217.812 l
-363.568 174.865 l
-367.110 221.263 l
-370.652 229.851 l
-374.194 229.371 l
-377.736 219.429 l
-381.278 138.835 l
-384.820 218.509 l
-388.362 228.686 l
-391.904 229.202 l
-395.446 220.789 l
-398.988 179.721 l
-402.530 215.482 l
-406.072 227.478 l
-409.614 228.996 l
-413.156 221.953 l
-416.698 191.902 l
-420.240 212.081 l
-423.782 226.215 l
-427.324 228.754 l
-430.866 222.960 l
-434.408 199.153 l
-437.950 208.147 l
-441.492 224.884 l
-445.034 228.476 l
-448.576 223.841 l
-452.118 204.278 l
-455.660 203.420 l
-459.202 223.466 l
-462.744 228.160 l
-466.286 224.618 l
-469.828 208.221 l
-473.370 197.415 l
-476.912 221.941 l
-480.454 227.805 l
-483.996 225.308 l
-487.538 211.417 l
-491.080 189.040 l
-494.622 220.282 l
-498.164 227.408 l
-501.706 225.922 l
-505.248 214.102 l
-508.790 174.825 l
-512.332 218.457 l
-515.874 226.966 l
-519.416 226.472 l
-522.958 216.418 l
-stroke
-grestore
-% text
-0.000 setgray
-/Verdana findfont
-18.000 scalefont
-setfont
-119.312 403.956 m
-0 4 rmoveto
-(Smoothing window in frequency-domain) show
-% text
-/Verdana findfont
-14.000 scalefont
-setfont
-62.469 30.1 m
-(0.0) show
-% line
-0.500 setlinewidth
-0 setlinecap
-163.800 44.100 m 163.800 48.100 l
-stroke
-% line
-163.800 392.900 m 163.800 396.900 l
-stroke
-% text
-153.175 30.1 m
-(0.1) show
-% line
-254.475 44.100 m 254.475 48.100 l
-stroke
-% line
-254.475 392.900 m 254.475 396.900 l
-stroke
-% text
-243.85 30.1 m
-(0.2) show
-% line
-345.150 44.100 m 345.150 48.100 l
-stroke
-% line
-345.150 392.900 m 345.150 396.900 l
-stroke
-% text
-334.994 30.1 m
-(0.3) show
-% line
-435.825 44.100 m 435.825 48.100 l
-stroke
-% line
-435.825 392.900 m 435.825 396.900 l
-stroke
-% text
-424.825 30.1 m
-(0.4) show
-% text
-515.844 30.1 m
-(0.5) show
-% text
-221.875 11.1 m
-0 3 rmoveto
-(Normalized Frequency) show
-% text
-37.062 39.1 m
-(-100) show
-% line
-73.125 91.140 m 77.125 91.140 l
-stroke
-% line
-522.500 91.140 m 526.500 91.140 l
-stroke
-% text
-47.062 86.14 m
-(-80) show
-% line
-73.125 138.180 m 77.125 138.180 l
-stroke
-% line
-522.500 138.180 m 526.500 138.180 l
-stroke
-% text
-47.062 133.18 m
-(-60) show
-% line
-73.125 185.220 m 77.125 185.220 l
-stroke
-% line
-522.500 185.220 m 526.500 185.220 l
-stroke
-% text
-47.062 180.22 m
-(-40) show
-% line
-73.125 232.260 m 77.125 232.260 l
-stroke
-% line
-522.500 232.260 m 526.500 232.260 l
-stroke
-% text
-47.062 227.26 m
-(-20) show
-% line
-73.125 279.300 m 77.125 279.300 l
-stroke
-% line
-522.500 279.300 m 526.500 279.300 l
-stroke
-% text
-61.812 274.3 m
-(0) show
-% line
-73.125 326.340 m 77.125 326.340 l
-stroke
-% line
-522.500 326.340 m 526.500 326.340 l
-stroke
-% text
-53.062 321.34 m
-(20) show
-% line
-73.125 373.380 m 77.125 373.380 l
-stroke
-% line
-522.500 373.380 m 526.500 373.380 l
-stroke
-% text
-52.938 368.38 m
-(40) show
-% text
-32.062 168.461 m
-gsave
-90 rotate
-0 3 rmoveto
-(Magnitude \(dB\)) show
-grestore
-% polygon
-1.000 setlinewidth
-2 setlinecap
-346.389 279.264 m
-346.389 389.844 l
-517.433 389.844 l
-517.433 279.264 l
-closepath
-gsave
-1.000 setgray
-fill
-grestore
-stroke
-% draw_lines
-0.000 0.000 1.000 setrgbcolor
-362.443 371.629 m
-369.999 371.629 l
-377.555 371.629 l
-385.111 371.629 l
-stroke
-% draw_lines
-1.000 0.000 0.000 setrgbcolor
-362.443 349.712 m
-369.999 349.712 l
-377.555 349.712 l
-385.111 349.712 l
-stroke
-% draw_lines
-0.000 0.500 0.000 setrgbcolor
-362.443 325.795 m
-369.999 325.795 l
-377.555 325.795 l
-385.111 325.795 l
-stroke
-% draw_lines
-0.750 0.000 0.750 setrgbcolor
-362.443 299.479 m
-369.999 299.479 l
-377.555 299.479 l
-385.111 299.479 l
-stroke
-% text
-0.000 setgray
-/Verdana findfont
-24.000 scalefont
-setfont
-394.179 362.629 m
-(Blackman) show
-% text
-394.179 340.712 m
-(Bartlett) show
-% text
-394.179 314.795 m
-0 5 rmoveto
-(Hanning) show
-% text
-394.179 288.479 m
-0 5 rmoveto
-(Hamming) show
-
-end
-showpage
diff --git a/doc/numpybook/Figures/fig2bw.eps b/doc/numpybook/Figures/fig2bw.eps
deleted file mode 100644
index f6ab19621..000000000
--- a/doc/numpybook/Figures/fig2bw.eps
+++ /dev/null
@@ -1,4919 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Title: fig2bw.eps
-%%Creator: matplotlib version 0.85.1.cvs, http://matplotlib.sourceforge.net/
-%%CreationDate: Fri Jan 6 00:30:17 2006
-%%BoundingBox: 13 175 598 616
-%%EndComments
-%%BeginProlog
-/mpldict 7 dict def
-mpldict begin
-/m { moveto } bind def
-/l { lineto } bind def
-/r { rlineto } bind def
-/box {
-m
-1 index 0 r
-0 exch r
-neg 0 r
-closepath
-} bind def
-/clipbox {
-box
-clip
-newpath
-} bind def
-/ellipse {
-newpath
-matrix currentmatrix 7 1 roll
-translate
-scale
-0 0 1 5 3 roll arc
-setmatrix
-closepath
-} bind def
-%%BeginFont: Verdana
-%!PS-TrueType-1.0-1.0
-8 dict begin
-/FontName /Verdana def
-/FontMatrix [1 0 0 1 0 0] def
-/FontType 42 def
-/Encoding StandardEncoding def
-/FontBBox [-102 -423 2963 2049] def
-/PaintType 0 def
-/FontInfo 7 dict dup begin
-/Notice (Typeface and data © 1996 Microsoft Corporation. All Rights Reserved) def
-/FamilyName (Verdana) def
-/FullName (Verdana) def
-/version (Version 2.35) def
-/isFixedPitch false def
-/UnderlinePosition -180 def
-/UnderlineThickness 120 def
-end readonly def
-/sfnts [
-<00010000001301000004003044534947CD5006A400020D64000014144C5453485694D82F
-00001530000003814F532F32477590C3000001B80000005656444D5874F17C6D000018B4
-000005E0636D6170E84D8B8B000007A80000068C637674204CA740E3000022AC00000198
-6670676DEE371553000021740000013867617370001700090000021000000010676C7966
-01F195F700009EC000013BB668646D7809490ECD0000323800006C8868656164C748722C
-0000013C0000003668686561133B09D00000017400000024686D7478C905723E00002444
-00000DF46B65726E75BF7E53000200CC00000C966C6F63616784B57700000E34000006FC
-6D617870086A023E00000198000000206E616D65A93B95720000022000000587706F7374
-C58F55450001DA7800002651707265701240C02F00001E94000002E00001000000010000
-16FBFC3A5F0F3CF5001B080000000000AA7E442900000000B26DE2ABFF9AFE590B930801
-00000009000200000000000000010000080BFE5200000C2CFF9AFBD40B93000100000000
-00000000000000000000037D00010000037D00620007006B000500020010002F00380000
-0495013F0003000100010411019000050000059A053300000125059A0533000003A00078
-02A70800020B0604030504040204000002870000000000000000000000004D5320200040
-0020FB02061EFE5900CA080B01AE2000019F000000000000000000030008000200100001
-FFFF00030000002801E60001000000000000004300000001000000000001000700430001
-0000000000020007004A0001000000000003002F00510001000000000004000700800001
-000000000005000C00870001000000000006000700930001000000000007002F009A0003
-000104030002000C00C90003000104050002001000D50003000104060002000C00E50003
-000104070002001000F10003000104080002001001010003000104090000008601110003
-000104090001000E01970003000104090002000E01A50003000104090003005E01B30003
-000104090004000E021100030001040900050018021F0003000104090006000E02370003
-000104090007005E024500030001040A0002000C02A300030001040B0002001002AF0003
-0001040C0002000C02BF00030001040E0002000C02CB0003000104100002000E02D70003
-000104130002001202E50003000104140002000C02F70003000104150002001003030003
-000104160002000C03130003000104190002000E031F00030001041B00020010032D0003
-0001041D0002000C033D00030001041F0002000C03490003000104240002000E03550003
-0001042D0002000E036300030001080A0002000C03710003000108160002000C037D0003
-00010C0A0002000C0389000300010C0C0002000C0395547970656661636520616E642064
-61746120A92031393936204D6963726F736F667420436F72706F726174696F6E2E20416C
-6C2052696768747320526573657276656456657264616E61526567756C61724D6963726F
-736F66743A56657264616E6120526567756C61723A56657273696F6E203120284D696372
-6F736F66742956657264616E6156657273696F6E20322E333556657264616E6156657264
-616E6120697320612074726164656D61726B206F66204D6963726F736F667420436F7270
-6F726174696F6E004E006F0072006D0061006C006F00620079010D0065006A006E00E900
-6E006F0072006D0061006C005300740061006E0064006100720064039A03B103BD03BF03
-BD03B903BA03AC0054007900700065006600610063006500200061006E00640020006400
-6100740061002000A9002000310039003900360020004D006900630072006F0073006F00
-66007400200043006F00720070006F0072006100740069006F006E002E00200041006C00
-6C0020005200690067006800740073002000520065007300650072007600650064005600
-65007200640061006E00610052006500670075006C00610072004D006900630072006F00
-73006F00660074003A00560065007200640061006E006100200052006500670075006C00
-610072003A00560065007200730069006F006E0020003100200028004D00690063007200
-6F0073006F00660074002900560065007200640061006E00610056006500720073006900
-6F006E00200032002E0033003500560065007200640061006E0061005600650072006400
-61006E006100200069007300200061002000740072006100640065006D00610072006B00
-20006F00660020004D006900630072006F0073006F0066007400200043006F0072007000
-6F0072006100740069006F006E004E006F0072006D0061006C004E006F0072006D006100
-61006C0069004E006F0072006D0061006C004E006F0072006D00E1006C004E006F007200
-6D0061006C0065005300740061006E00640061006100720064004E006F0072006D006100
-6C004E006F0072006D0061006C006E0079004E006F0072006D0061006C041E0431044B04
-47043D044B0439004E006F0072006D00E1006C006E0065004E006F0072006D0061006C00
-4E006F0072006D0061006C004E0061007600610064006E006F0041007200720075006E00
-740061004E006F0072006D0061006C004E006F0072006D0061006C004E006F0072006D00
-61006C004E006F0072006D0061006C00000000020001000000000014000300010000011A
-000001060000010000000000000001020000000200000000000000000000000000000001
-0000030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324
-25262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748
-494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F60610062636465666768696A6B
-6C6D6E6F707172737475767778797A7B7C7D7E7F808182838485868788898A8B8C8D8E8F
-909192939495969798999A9B9C9D9E9FA0A1A2A3A4A5A6A7A8A9AAAB03ACADAEAFB0B1B2
-B3B4B5B6B7B8B9BABBBCBDBEBFC0C1C2C3C4C5C6C7C8C9CACBCCCDCECFD000D1D2D3D4D5
-D6D7D8D9DADBDCDDDEDF0004057200000084008000060004007E017F019201A101B001FF
-02C702C902DD0301030303090323037E038A038C03A103CE040C044F045C045F04911E85
-1EF92015201E2022202620302033203A203C203E2044207F20A420A720AC210521132116
-21222126212E215E22022206220F22122215221A221E222B22482260226525A125AB25CA
-25CF25E6F002F00DFB02FFFF0000002000A0019201A001AF01FA02C602C902D803000303
-03090323037E0384038C038E03A30401040E0451045E04901E801EA02013201720202026
-203020322039203C203E2044207F20A320A720AB21052113211621222126212E215B2202
-2206220F221122152219221E222B22482260226425A125AA25CA25CF25E6F001F004FB01
-FFFFFFE30000FF1400A60099FF8A0000FE0F0000FF4C0078FF41FF28FCA00000FE170000
-0000FDD9FDD8FDD7FDD6FDA6E30B0000000000000000E085E095E109E084E0F9E156E077
-E0B70000E0900000E038E02BE123DF6ADF79E068E03CDE96DEA2DE8B0000DEA60000DE74
-DE71DE5FDE2FDE30DB9EDB96DAEEDB73DB5D10BE000005BE000100000082000000000000
-000002380000023800000000000000000000023800000242026800000000000000000000
-000002B203640368037600000000000000000000000000000000036A0000036A00000000
-000000000000000000000000000000000358000003580000000000000000000000000000
-0000000000000000034400000000000300A300840085037C009600E60086008E008B009D
-00A900A40010008A01000083009300F000F1008D00970088010100DC00EF009E00AA00F3
-00F200F400A200AC00C800C600AD006200630090006400CA006500C700C900CE00CB00CC
-00CD00E7006600D100CF00D000AE006700EE009100D400D200D3006800E900EB0089006A
-0069006B006D006C006E00A0006F0071007000720073007500740076007700E80078007A
-0079007B007D007C00B700A1007F007E0080008100EA00EC00B901440145010201030104
-010500FB00FC014601470148014900FD00FE01060107010800FF014A014B014C014D014E
-014F0109010A010B010C0150015100F600F701520153015401550156015701580159015A
-015B015C015D015E015F0160016100F800D50138013901620163016401650166010D010E
-01670168010F01100111011200E000E1011301140169016A01150116013A016B016C016D
-016E016F01700117011800AF00B00119011A01710172011B011C011D011E0173017400F9
-00FA00E200E3011F01200121012201750176017701780179017A017B017C012301240125
-0126017D017E017F01800181018200BA012701280129012A00E400E5018300D600DF00D9
-00DA00DB00DE00D700DD019D019E019F018A01A001A101A201A401A501A601A701A8012B
-01A901AA01AB01AC012C01AD01AE01AF01B001B101B201B301B401B501B601B701B8012D
-01B901BA01BB01BC01BD01BE01BF01C001C101C2012E01C301C4012F013001C501C601C7
-01C801C901CA01CB01CC01CD01CE023A01CF01D00131013201D1013301D201D301D401D5
-01D601D701D801D9025D025E025F0260026102620263026402650266026702680269026A
-026B026C026D026E026F0270027102720273027402750276027702780279027A027B027C
-027D027E027F028002810282028302840285028602870288034C034D034E034F03500351
-03520353035403550356035703580359035A035B035C035D035E035F0360036103620363
-036403650366036703680369036A036B036C036D036E036F037003710191019203740375
-037603770378037900B100B20238013400B500B600C3019300B300B400C4008200C10087
-00F50195037A00BC009900ED00C200A5019B019C023B023C023D023E023F024002410242
-0000001F001F001F001F00470070010401C0025F033C035503A203F10461049604C004DE
-04F50520057F05B9063806DB072D07A70830086B090B099309B509F10A350A640AAA0B13
-0BF80C600CDC0D4F0DA00DD60E060E7A0EAE0EDB0F180F860FA61000104C10B8111711AE
-122012B812DF132C13881407148814DF15221544156F159015C815DE15FE168916E71747
-17A01803184F18D11912193D198C19E51A001A761AB61B011B5D1BB81BF51C8B1CDB1D1B
-1D741DD91E641EC21F041F631F7E1FDC203B205520FE21AA21BD21D021E9220222142226
-2238225322652278230A231C232E234023562369237C23B423EE2400241224242436244C
-245E24702482249424AB24E62520259A260826EB270B274327C928832929297B299C29C2
-2A2D2A912B412BCD2C0D2C5A2CA82D0C2D4C2DCB2E3D2E722E9F2EE92F5E2F9F301130E7
-316D31D831FF3223326032DF336433A233F33443346D3480349334A6350E35AD35C735DD
-361C365B368036A736E33728373F37593777382D3858388438E139313986399E39C43A03
-3AD73AEA3AFD3B103B243B373B4A3B5D3B773B8A3B9D3BB03BC33BD63BE93BFC3C173C47
-3C8E3CA63CEC3D003D493D7D3DB53DEA3E1B3E5B3E923EA53EB73ECA3EDC3F043F6B3FFF
-40124024408840E441014135416941BB4239425A427E42AA42F643024314432743F044AF
-44C244D444E744F9456F4586459E45B145C3465F47144727479D47A54806489348A648B8
-48CB48F0492B4961499249BC49CF49E149F44A064A1A4A2D4A404A534A664A794A8C4A9E
-4AEE4B6C4B7F4BEC4C354C484C5C4C6F4C824C954CA84CBA4CDA4D584DDD4E3C4EC24F58
-4FB24FE1505D5081509D50E951DF51EF52085268528B52CA538353FD5425543F54665491
-54EA54FC550D551F55345546555B556D557E559055A455B655C755D955EE5600561556B8
-575B576D578757DE583458A458FC593F596C59C05A035A595AB15AC85B225B335B495BA2
-5BEB5C305C465C5C5CD25D2E5D405D515D635D745D855DEA5DFC5E105E4E5EBA5ECC5EDD
-5EEF5F005F125F235FA2600E6020603260446055608561656246625C626E6285629A62B1
-62C362D562E762F963166332634963606388639E6422648E64AA64D76504653065556589
-65A265DD65F36611662F664F666E668E66B16700670867106752675A6762676A6772677A
-67C367CB67D36812681A6840684868DA68E268EA68F2695D69DC69F66A106A216A376A48
-6A5B6A6F6AFD6B4A6BBD6BFF6C866C8E6D226D7A6DC16DC96E726E7A6ECF6F3B6F7A6FEA
-705A70F370FB7112712371347146715A71C571DD7255725D7265727F7287731C738773DE
-73F3749074C174C97521752975497594759C765676F2773A77AE783B7892789A78A278AA
-78D078D878E078E8795979DE79E67A167A5D7A907ACD7B297B907BE47C5F7CCD7D367D3E
-7DCA7E4C7E6C7EBC7EC47F7D8015804D80B18126817B81D38203820B82308238829A82C9
-82D1836C837483AC83EF8425846784C3852B858085F4865386BD86D38757876887D587DD
-87E587ED87F5888B88F9894F896489EE8A258A4E8A7B8A918B238B488B6C8BBD8C398C73
-8CD88D0C8D8E8D8E8D8E8D8E8D8E8E208E8D8EF48F598F9F8FB58FBD8FC59006904590BD
-9126916491A19209927292C09334938093D1944E94D395479558956C9586959B95B195C7
-95DD95F3960B96219633964996659683969596AA96BC96D196E396F8970A971F973E9759
-976A977B979697AE97C497D597ED97FF98179829983F985598679879989898B198C998DB
-98ED98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF
-98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF98FF9911
-9922994099549970998999A199B399CB99E499FC9A159A359A4E9A659A769A909AA59ABB
-9ACC9AE29AF99B0B9B1C9B2D9B3E9B549B659B7C9B949BAF9BC79BDD9BEE9C009C119C22
-9C339C4E9C649C759C8B9CA49CB89CCE9CDF9D639D6B9DDB0000037D01011C1C300E0E0B
-0E010A01010E0E010F01010B0B0B0B0B0B0B0B0B0B01010E0E0E0B0C320E101923150E0F
-740A0E2D240E0D0D0D0E322C1D322E1C111C0101010101010D0D0E0D0D1C0D0BB4010EB4
-110B100D0D2A11110B0A100F0A11010E0101323210230E0D1D0D0D0D0D0D0D0E0D0D0D0D
-B4B4B4B40B10101010100B0B0B0B0B010B0B01010B0101010101010E330D010E0E0E0B10
-010101010B0101010E100B300E010B010127270132320D011C0B01010101010E010A1101
-01010101010B010101013223322323747474740D0D0D1D1D1DB401010101010101010101
-0AD732111C110E1001110A0D0D0E01010101010101010E0D743211100E100E0D0101320D
-320D190D10230D230D2DB42D322D010E0B0E0B0D100E2A0E2A32112C112C111D0B1D0B1C
-111C11100D130D2612181110010D010A0A110E01240A121901011901320D100E100E230D
-230D230D0E0D0E0D0E0D0F0B0F0B74B474B474B474B40A010E0E0E2DB40E0B0E0B0D100D
-100E2A32112C111D0B1D0B1D491D182E10110A01320D330E0D10012E102E102E10110A01
-010B01010101012E010101320E1C10160C27B4320E01231C0F740E0A240E300D0F0D1E2C
-111C111474110D120BB40B0B0F0D0B0DB40D0A130A011010010B0C1010B40B100B10230A
-100D3274740A0C0E010E1111320E0E10012311010E0E0E12240F0D0F0D102C11131C2D22
-11111F2D0E0D01100D240A010D0D301210100B011D1010100D0F110A170F270D11320C11
-0C0E0D0A0D0B010E11B4B4010A0E0B0B0A10100A01011001010101010101010101012D10
-282001010101010101010101010101010101010101320D320D320D320D320D320D320D32
-0D320D320D320D320D230D230D230D230D230D230D230D230D74B474B401010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-010101010101010101010101010101010101010101010101010101010101010101010101
-01010101010101010D100D100D100D100D100D100D102D102D102D102D102D101D0B1D0B
-28202820282028202820110A110A110A110A0D010B00000000000001000101010101000C
-00F808FF00080008FFFE0009000AFFFE000A000AFFFE000B000BFFFE000C000CFFFE000D
-000DFFFD000E000EFFFD000F000FFFFD0010000FFFFD00110011FFFD00120012FFFC0013
-0013FFFC00140015FFFC00150015FFFC00160016FFFC00170017FFFB00180018FFFB0019
-001AFFFB001A001BFFFB001B001BFFFB001C001CFFFA001D001DFFFA001E001EFFFA001F
-0020FFFA00200020FFFA00210021FFF900220022FFF900230023FFF900240025FFF90025
-0026FFF900260026FFF800270027FFF800280028FFF800290029FFF8002A002BFFF8002B
-002BFFF7002C002CFFF7002D002DFFF7002E002EFFF7002F0030FFF700300031FFF60031
-0031FFF600320032FFF600330033FFF600340034FFF600350036FFF500360036FFF50037
-0037FFF500380038FFF500390039FFF5003A003BFFF4003B003CFFF4003C003DFFF4003D
-003DFFF4003E003EFFF4003F003FFFF300400041FFF300410041FFF300420042FFF30043
-0043FFF300440044FFF200450046FFF200460047FFF200470047FFF200480048FFF20049
-0049FFF1004A004AFFF1004B004CFFF1004C004DFFF1004D004DFFF1004E004EFFF0004F
-004FFFF000500051FFF000510052FFF000520052FFEF00530053FFEF00540054FFEF0055
-0055FFEF00560057FFEF00570058FFEE00580058FFEE00590059FFEE005A005AFFEE005B
-005CFFEE005C005DFFEC005D005DFFEC005E005EFFEC005F005FFFEC00600060FFEC0061
-0062FFEB00620062FFEB00630063FFEB00640064FFEB00650065FFEB00660067FFEA0067
-0068FFEA00680068FFEA00690069FFEA006A006AFFEA006B006BFFE9006C006DFFE9006D
-006DFFE9006E006EFFE9006F006FFFE900700070FFE800710072FFE800720072FFE80073
-0073FFE800740074FFE800750075FFE700760076FFE700770078FFE700780078FFE70079
-0079FFE7007A007AFFE6007B007BFFE6007C007DFFE6007D007DFFE6007E007EFFE6007F
-007FFFE500800080FFE500810082FFE500820083FFE500830083FFE500840084FFE40085
-0085FFE400860086FFE400870088FFE400880088FFE400890089FFE3008A008AFFE3008B
-008BFFE3008C008DFFE3008D008EFFE3008E008EFFE2008F008FFFE200900090FFE20091
-0091FFE200920093FFE200930093FFE100940094FFE100950095FFE100960096FFE10097
-0098FFE100980099FFE000990099FFE0009A009BFFE0009B009BFFE0009C009CFFE0009D
-009EFFDF009E009EFFDF009F00A0FFDF00A000A0FFDF00A100A1FFDF00A200A3FFDE00A3
-00A4FFDE00A400A4FFDE00A500A6FFDE00A600A6FFDE00A700A7FFDD00A800A9FFDD00A9
-00A9FFDD00AA00ABFFDD00AB00ABFFDD00AC00ACFFDC00AD00AEFFDC00AE00AFFFDC00AF
-00B0FFDC00B000B0FFDC00B100B1FFDB00B200B2FFDB00B300B4FFDB00B400B5FFDB00B5
-00B6FFDB00B600B6FFDA00B700B7FFDA00B800B9FFDA00B900BAFFDA00BA00BBFFDA00BB
-00BBFFD900BC00BCFFD900BD00BDFFD900BE00BFFFD900BF00C0FFD900C000C1FFD800C1
-00C1FFD800C200C2FFD800C300C4FFD800C400C5FFD800C500C5FFD700C600C6FFD700C7
-00C7FFD700C800C8FFD700C900CAFFD700CA00CBFFD600CB00CCFFD600CC00CCFFD600CD
-00CDFFD600CE00CFFFD600CF00D0FFD500D000D0FFD500D100D1FFD500D200D2FFD500D3
-00D3FFD500D400D5FFD400D500D5FFD400D600D7FFD400D700D7FFD400D800D8FFD400D9
-00DAFFD300DA00DBFFD300DB00DCFFD300DC00DCFFD300DD00DDFFD300DE00DEFFD200DF
-00E0FFD200E000E0FFD200E100E2FFD200E200E2FFD200E300E3FFD100E400E5FFD100E5
-00E6FFD100E600E7FFD100E700E7FFD100E800E8FFD000E900E9FFD000EA00EBFFD000EB
-00EBFFD000EC00ECFFD000ED00EDFFCF00EE00EEFFCF00EF00F0FFCF00F000F1FFCF00F1
-00F2FFCF00F200F2FFCE00F300F3FFCE00F400F4FFCE00F500F6FFCE00F600F7FFCE00F7
-00F7FFCD00F800F8FFCD00F900F9FFCD00FA00FBFFCD00FB00FCFFCC00FC00FDFFCC00FD
-00FEFFCC00FE00FEFFCC00FF00FFFFCCB8FFC0401EB229323610B220B240B250B270B280
-B2A0B2B0B2D0B2E0B20AC0B2F0B202B8FFC04070B51718361F44010F561F56024F555F55
-026F54019F54AF54025153170452531604535215044A4952044649370447493204484932
-04493539043C3F32043D3F3D043E3F2104433F1D04423F5204413F5204403F52043F3532
-0432336404333534043534540434351E04D034E034F03403B8FFEEB3B4254836B8FFE0B3
-B4102336B8FFEE400DB4090F36B41A480476B386B302B8FFF0B3B3254836B8FFFA40FFB3
-092436B314480489881304706C7078020F9CDF9E02409D161936409C161B364097171936
-4096171B368685131F0F840F850F8E0F8F0F901F841F8E1F8F2F8E808580888F91908590
-8790880F40820910360F721F72024071090C360F6D0120C80120C7013FC6EFC60220C540
-C50200620100621062024061A061020F5B012D1411042C1425042B1439042A1413042914
-15041F141E042120430420143C04C91A45041A1B47041B1A3C041A143204151439041314
-480412141A0411141A0470140140144143360F0E2A1F0006010DC34B1F0CC24B1F0AC04B
-1F09C04B1F05BC4B1F04BD4B1F03B94B1F02BA4B1F01B64B1F00B74B1FC3C22A1FC0BF2A
-1FBD4056BC211FBAB9211FB7B6211FC2C3C40DBFC0C10DBCBDBE0CB9BABB0CB6B7B80C10
-BC80BC0240B980B9020FB63FB64FB67FB6040FB62FB63FB66FB67FB6BFB6CFB6FFB6080A
-0937040C0D02050402030202010002500501B801FF858D8D1DB0964B5258B0801D59B808
-004B5458B001B0018E59B0084B5358B001B0018E59002B2B2B2B2B737473732B2B2B2B2B
-2B2B2B2B2B2B2B2B2B2B2B2B2B2B2BB00345B006456861B006234473B00345B00E456861
-B00E2344B00E45B00F456861B00F23442B01B0144568B01423442B732B2B2B2B2B2B2B2B
-2B2B2B2B2B2B2B2B7373737373737373732B732B732B2B2B2B2B73732B2B2B2B732B2B2B
-2B00752B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B73747373742B73742B400C3736
-26251F13120D0C0504022C20B003254523452361688A204568208A234460442D2C4B5258
-45441B2121592D2C202045684420B001602045B0467668188A4560442D2CB0122BB00225
-45B00225456AB0408B60B0022523442121212D2CB0132BB0022545B00225456AB8FFC08C
-60B0022523442121212D2CB100032545685458B0032545B0032545606820B004252344B0
-042523441BB00325204568208A2344B00325456860B003252344592D2CB0032520456820
-8A2344B00325456860B0032523442D2C4B525845441B2121592D2C462346608A8A462320
-468A608A61B8FF8062232010238AB14B4B8A70456020B0005058B00161B8FFBA8B1BB046
-8C59B0106068013A2D2C2045B003254652583F1B2111592D2C4B53234B515A5820458A60
-441B2121592D2C4B53234B515A58381B2121592D061E061405F005D1047C045D03DD0010
-0000FFE7FFE1FE78FE64FE590394001FFFFF009600AA00B900C600CEFFFFFFFFFFFFFFFF
-00BC00C2FFFFFFFF007600B200C000CBFFFFFFFFFFFFFFFFFFFFFFFF0081009400A600CC
-00DA00EFFFFFFFFFFFFFFFFF0098009E00AB00B0FFFFFFFFFFFFFFFFFFFFFFFF00900098
-009E00A400A900AE00B300BA00C3FFFF00880091009800A500ACFFFFFFFFFFFFFFFFFFFF
-006F0087008F009B00A000D3011DFFFFFFFFFFFF00C3021401C2FFFFFFFF00E9000C02D1
-0173018E001A002C0044005C0073007E008600B200C8014C001A003D00440050005C0072
-0078009200B200B900C8FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF003D0056005D006A
-006E00B100B900C1FFFFFFFF002A003D00540064006A00B100B9FFFFFFFFFFFF0071007A
-008900A100A700BB006F007A00870091009AFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
-008102210221007400E500B900CA019502C600AC00A700850614000A000005D1001F0000
-045D001F00000000FFE10000FE64FFF50000036202F402A2029100AF026A004C08000100
-0000000002D0000002D000000326012303AC00A8068C00C30516009B089C009505D00073
-022600A403A200B503A20093051600A7068C00D202E9009303A2009902E900FD03A2FFE2
-0516008905160116051600A1051600A70516004D051600BB051600890516009A0516007A
-0516007103A2015A03A200E6068C00FE068C00F5068C010C045D00A0080000B00578001A
-057C00C805960073062A00C8050F00C8049900C806340073060300C8035E008903A3002C
-058B00CD047400C806BE00C805FC00C8064C007304D300C8064C0073059000C805780086
-04EE000005DB00B20578001A07E9005C057B004404EC0006057B007E03A200EF03A20046
-03A200AB068C00BA0516FFFC0516015404CE006804FC00B9042B006904FC006C04C4006A
-02D0004404FC006C051000B9023200AF02C1FFC204BC00C1023200BB07C800B9051000B9
-04DB006A04FC00B904FC006C036A00B9042B006E0327003E051000B104BC003D068C0056
-04BC003C04BC003D0434005D051400AD03A2017A051400BB068C00BB0578001A0578001A
-05960073050F00C805FC00C8064C007005DB00B204CE006804CE006804CE006804CE0068
-04CE006804CE0068042B006904C4006A04C4006A04C4006A04C4006A023200A00232FFEB
-0232FFF502320005051000B904DB006A04DB006A04DB006A04DB006A04DB006A051000B1
-051000B1051000B1051000B1051600BB0456009A0516009F05160089051600AC045D00B9
-0516008904F600B90800009F0800009F07D000AA0516021D0516015A068C00F507E0000E
-064C0073080000A1068C00D7068C00FE068C010C0516006C052200BE0516009505D100BB
-068C009005A900710516008A045D0097045D0079068C006B07A4006804DB005D045D0071
-03260123068C00D2068C00860516FFDC068C00F305D10032052800A6052800AE068C00B2
-0578001A0578001A064C0073088F007807DA006A051600990800009903ACFFED03AC0096
-0226FFED022600A0068C00D2068C00AC04BC003D04EC000602E4FF9A0516000003A200BA
-03A200C20500004405020044051600BB02E900FD0226FFF603ACFFF60C2C00950578001A
-050F00C80578001A050F00C8050F00C8035E0089035E005D035E007E035E0089064C0073
-064C0073064C007305DB00B205DB00B205DB00B2023200BB05160136051600ED05160118
-05160113051602210516012D05160161051601560516019F05160132047E001802460018
-05780086042B006E057B007E0434005D03A2017A0634000E04E5006A04EC000604BC003D
-04D800C804FC00B9068C00DC068C012304560123045600CF045600CF080000AB080000AB
-0800008C0516003C0634007304FC006C035E008905780086042B006E05960073042B0069
-05960073042B006904FC006C0516FFFC02E900FD0578001A04CE00680578001A04CE0068
-062A00C8052E006C0634000E050F00C804C4006A050F00C804C4006A047400C8023200AB
-047400C8025E00BB047400C803AB00BB05FC00C8051000B905FC00C8051000B9064C0073
-04DB006A059000C8036A00B9059000C8036A009205780086042B006E04EE00000327003E
-04EE00000327003E05DB00B2051000B105DB00B2051000B1057B007E0434005D057B007E
-0434005D048800C8064C0073068D006904FC006C04DD006A041A006D050B006A03F8000A
-065200680516FFFC04FF0123045D009A094F00C806F7008904E900AF05D8000002E400D5
-047500D5089C00950296000F04D5009202D6008302D6008304D500B102D600700578001A
-04CE006805960073042B006905960073042B0069050F00C804C4006A050F00C804C4006A
-050F00C804C4006A0634007304FC006C0634007304FC006C0634007304FC006C060300C8
-051000B90603002005100013035E002C0232FFF2035E005F0232FFFC035E008002320001
-035E00890232008E03A3002C02C1FFC2058B00CD04BC00C104BC00C1047400C802320005
-05FC00C8051000B905FC00C8051000B9064C007304DB006A064C007304DB006A059000C8
-036A001B05780086042B006E04EE00000327003E05DB00B2051000B105DB00B2051000B1
-05DB00B2050B00B105DB00B2050B00B107E9005C068C005604EC000604BC003D026700B9
-0578001A04CE006807E0000E07A40068064C007304DB005D03A2015A07E9005C068C0056
-07E9005C068C005607E9005C068C005604EC000604BC003D0226FFED0516FFD005160089
-05BE00B1080000AB0800008C0800008A0800009901B00061051601610516021205160100
-057800070602000006F6000004510000070C000006070000074300000232FFCB0578001A
-057C00C805A0001A050F00C8057B007E060300C8035E0089058B00CD057C001A06BE00C8
-05FC00C805310072064C0073060300C804D300C80561007604EE000004EC0006057B0044
-06F700B3068C006C035E007E04EC000604FC006C041A006D051000B9023200A0050D00B1
-04F600B904BC003D03A9006C051000B904FE0089023200BB04BC00C104BC003D051E00B9
-04BC003D0406006804DB006A050000B904100069050D00B104B80030069300B006820071
-02320005050D00B104DB006A050D00B106820071050F00C80657FFFF048800C8059B0073
-05780086035E0089035E007E03A3002C08F2001208D300C8068BFFFF058B00CD04EC0006
-060300C80578001A057C00C8057C00C8048800C805F7000A050F00C807C9002004ED0051
-060100C8060100C8058B00CD05E0001206BE00C8060300C8064C0073060300C804D300C8
-0596007304EE000004EC0006068D0069057B0044061700C805B2008E083E00C8085C00C8
-06440000075D00C8057200C8059C0061084600C805A6002C04CE006804EA007404C200B9
-03C500B904F9000904C4006A0662003404320041051F00B9051F00B904BC00C104F7001D
-059200B9051900B904DB006A051900B904FC00B90446006A03F8000A04BC003D06BA006F
-04BC003C052800B904D8008E070200B9071A00B90520000A065B00B9049100B904600053
-06B600B904CC004304C4006A0510001303C500B90460006A042B006E023200AF02320005
-02C1FFC20750001D075000B90510001304BC00C104BC003D051900B9048800C803C500B9
-080000CB096000C8051900B904560119045600EF045600E6045600B3045600E6045600F3
-045600C5000000000000000000000000000000000674007304DB006A060D00B2054700B1
-0000020900000221000001540000021D0516013605160003051601360516012505160142
-051601420516014205160125051602090516013605160142051601420516014205160142
-051601360578001A04CE00680578001A04CE00680578001A04CE00680578001A04CEFFE3
-0578001A04CE00680578001A04CE00680578001A04CE00680578001A04CE00680578001A
-04CE00680578001A04CE00680578001A04CE00680578001A04CE0068050F00C804C4006A
-050F00C804C4006A050F00C804C4006A050F00C804C4006A050F002904C4FFFC050F00C8
-04C4006A050F00C804C4006A050F00C804C4006A035E008902320096035E0089023200AF
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000064C007304DB006A064C0073
-04DB006A064C007304DB006A064C007304DBFFE5064C007304DB006A064C007304DB006A
-064C007304DB006A0674007304DB006A0674007304DB006A0674007304DB006A06740073
-04DB006A0674007304DB006A05DB00B2051000B105DB00B2051000B1060D00B2054700B1
-060D00B2054700B1060D00B2054700B1060D00B2054700B1060D00B2054700B104EC0006
-04BC003D04EC000604BC003D04EC000604BC003D04EC000604BC003D04FC006C000000ED
-0516008A0000001F00000380090E09000303050507070B07030404070703050304070707
-070707070707070404070707060A08070808070608080505070609080907090707070808
-090707070404040706060606060606030606030306030906060606040604060607060605
-060506070808080708090806060606060606060606060303030306060606060606060606
-07050707060507060909090606070A090907070707060607070607050507090606050707
-0707070606070808090A0907090404020207070607030604040606070302040E08070807
-070505050509090908080803060606060606060606060603070607050508060706070607
-070505050909090608060507060806080606060308060806080608070607060603060306
-040806080609060704070407060704070408060806070507050609070606050605090606
-050B09060703050B03050303050308060806080607060706070608060806080608060806
-050305030503050305030706060603080608060906090607040706070408060806080608
-06090707060308060A090906040907090709070706020607060909090902060606080809
-060908090308070607070805070809080709080706070707090905070605060306060505
-060603060606060506060506050907030606060707080608070505050A0A070707070807
-070607070906080807070908090807080707070708070909080907080907060606040606
-070506060606070606060606050609060705090907080606080606060406060303030909
-060606060505090B06050505050505050000000009060806000000000606060606060606
-060606060606060806080608060806080608060806080608060806080608060706070607
-060706070607060706070605030503000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000090609060906
-090609060906090609060906090609060906080608060806080608060806080607060706
-07060706060007000A0F0A000404040508070B0703050507080405040507070707070707
-0707070505080808060A070708080606080805050706090709070908070708070B070707
-0505050806060707050707040707030307030B0707070704060407060707060606050608
-070708060709080707070707070507070707030303030707070707070707070707050707
-060507060A0A0A0606080A090A080808070706070807070505080A070604080807080706
-06080707090B0A070A0505030308080607040605050606070403050F0706070606050505
-050909090808080306060606060606060606060307060706050806070607070808050505
-0A0A0A060807050706080508050706040707070708070806070607060306030605070707
-0709070804080407060704070408070807070607060609090707050705090606050C0906
-0704060B0306040406040707080508050607060706070807080708070807080705030503
-0503050305030707070603070707070907090708040706070408070807080708070B0707
-060307070A0A0907050B070B070B070706030607070A0A0A0A0206060607070906090909
-030707070607080507070907070908070707070709090507070507030707070507070307
-0607060507070507060909030707070906080608070505050B0B08070708070707060706
-0906080807070908090807080707090709070B0B080907080A0707070605060707050707
-0706070707070705050609070706090A0708060608060707050606030303090907070607
-06050A0C0705050505050505000000000907080700000000060606060606060606060606
-060606070707070707070707070707070707070707070707070707060706070607060706
-070607060706070503050300000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000009070907090709070907
-090709070907090709070907090708070807080708070807080708070706070607060706
-070007000B110B000404040509070C080305050709040504050707070707070707070705
-05090909060A080809090706090805050806090809070908080708080B08070805050509
-07070707060707040707030407030B070707070506040707090707060705070908080907
-080908070707070707060707070703030303070707070707070707070706070707060707
-0B0B0B0707090B090B090909070707080908070606090B07060409090709080707090808
-090C0B070B05050303090907070407050507070704030511080708070705050505090909
-08080803070707070707070707070603080608060509070707070709090606060B0B0B07
-090705080609060906070704080708070907090707070706030603060508070807090708
-05080508060704070408070807080608060609090707060705090707060D0A070804060C
-040704040704080709060906070707070707090709070907080708070503050305030503
-05040807070603080708070907090708050806070408070807080708070B090707030807
-0B0B0907050B090B090B090707030707080B0B0B0B02070707080809060A090903080808
-070808050808090807090807070707080909050707060703070707050707030707070706
-07070607070909030707070907090609080505050D0C090808080808080608070B070808
-08080908090807090708090809080B0C090A07090B080707070508070906070707070707
-07070706050709070807090A080907070A0707070507060303040A0B0707070706050B0D
-070606060606060600000000090708070000000007070707070707070707070707070708
-070807080708070807080708070807080708070807080707070707070707070707070707
-070707050305030000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000907090709070907090709070907
-090709070907090709070807080708070807080708070807070707070707070707000700
-0C120C00040405060A080D09030505080904050405080808080808080808080505090909
-070C0808090908070909050508070A090A080A08080709080D0807080505050A08080808
-060808040808030407030B0808080805070508070B0707070805080A08080908090A0908
-08080808080608080808030303030808080808080808080808070808080708070C0C0C08
-08090C0A0C090909080808090A080807070A0B080705090A080A0908080A08080A0D0D08
-0C06060303090A070704080505080808040306120808080808050505050A0A0A09090903
-0808080808080808080807030807080705090707070808090A0707070C0C0C0809080508
-07090609060808040808080809090908080808070307040706090809080A080805080508
-07070507050908090808070807070A0B0808060807090808070E0A070904070D04070404
-070408080906090608080808080809080908090809080908050305030503050305040807
-070703090809080A080A0808050807070509080908090809080D0B07070408080C0B0A08
-050D0B0D0B0D0B0707030808090C0C0C0C0308080808090A060B090B0308080808080905
-08080A09080A0908080707080B0A05070806080308070706080803080708070608080608
-070B0B030808080B080A0709080505050D0D0A0808090808080709080D07090908090A09
-0A09080907080B0809090D0E090B08090C080808070608080B0608080707080808080806
-07070B0709080B0C080907080B0708080608070303040B0B0807070807060C0E08070707
-07070707000000000A080908000000000808080808080808080808080808080808080808
-080808080808080808080808080808080808080808080808080808080808080808080805
-030503000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000A080A080A080A080A080A080A080A080A08
-0A080A080A0809080908090809080908090809080707070707070707080008000D140D00
-050505050A080D09030606090905070506080808080808080808080606090909070D0908
-090908080909050608070B090A080A08090909090D0909090606060B0808080808080805
-0808030407030B0808080805070608080B0708070807080B09090908090A090808080808
-080808080808030303030808080808080808080808070808080708080D0D0D0808090C0A
-0D090909080808090B090807070B0B080705090B080B0908080B09090A0E0D080D060603
-03090B080905080606080808050306140908090808050505050A0A0A0909090308080808
-08080808080807030907090707090809080808090B0707070D0D0D080908050907090809
-080808050908090809080908080808070307040706090809080A08080508050907090609
-060908090809070907070A0B08080708070B0808070F0B080A05070E0408050508050908
-090809080808080808080908090809080908090805030503050305030604080707070309
-0809080A080A0808050907090609080908090809080D0B09080409080C0B0A08060D0B0D
-0B0D0B0908030808090D0D0D0D0308080809090A060B0A0C030908090809090508090B09
-080A0908090909090B0B05090807080308080906080803080808080708080708080B0B03
-0808080B080A0709090505060F0D0B080909090808070A080D080909080A0B090A090809
-09090B090A090D0E0A0C08090D080808080608080B070808080809080808080807080B07
-09080B0C080907080B0808080608070303040C0D0808080807060D0F0807070707070707
-000000000A08090900000000080808080808080808080808080808090809080908090809
-080908090809080908090809080908080808080808080808080808080808080503050300
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000A080A080A080A080A080A080A080A080A080A080A08
-0A0809080908090909090909090909090908090809080908080008000E150E0005050606
-0B090F0A040606090B050705060909090909090909090906060B0B0B080E0A0A0A0B0908
-0B0A05060A080B0A0B080B0A0A090A0A0F0A090A0606060B090908090709080509090305
-08030D0909090906080609080B0908080906090B0A0A0A090A0B0A080808080808070808
-0808030303030909090909090909090909080909090809090E0E0E09090B0E0B0E0B0B0B
-0909090A0B0A0908080B0D0908060B0B090B0A09090B0A0A0B0F0E090E060604040B0B08
-0905090606090909050406150A090A0909050505050B0B0B0A0A0A030909090909090909
-090908030A080A08060B09090808090B0B0808080E0E0E090B09050A080A070A07090905
-0A080A080B090B090809080803080408060A090A090B090A060A060A08090609060A090A
-090A080A08080B0B09090709070B090908100C080A05080F0508050508050A080A070A07
-0908090809080B090B090B090A090A09050305030503050306050A080808030A090A090B
-090B090A060A0809060A090A090A090A090F0B0908040A080E0D0B09060F0B0F0B0F0B09
-080409090A0E0E0E0E030909090A0B0C070C0B0C030A0A0A090A0A050A0A0B0A090B0A08
-0909090A0B0B05090907090309090906090903080809080709090709080B0B030909090B
-090B080A0A050506100F0B0A090B0A0A0A080A090F090B0B0A0A0B0A0B0A080A09090B0A
-0B0A0D0E0B0D0A0A0E0A0809080709080B07090908090A090909090807080B090A080B0C
-090B08080C0808090708080303050D0D0908080908070E10090808080808080800000000
-0B090B0A000000000909090909090909090909090909090A080A080A080A080A080A080A
-080A080A080A080A080A0809080908090809080908090809080908050305030000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000B090B090B090B090B090B090B090B090B090B090B090B090A09
-0A090B0A0B0A0B0A0B0A0B0A0908090809080908090009000F170F00050506070C0A100B
-0407070A0C050705070A0A0A0A0A0A0A0A0A0A07070C0C0C080F0A0A0B0B09090C0B0507
-0A080D0B0C090C0A0A090B0A0F0A090A0707070C0A0A0909080909050909030509030F09
-0A090906080609090D0909090A070A0C0A0A0B090B0C0B09090909090908090909090303
-0303090A0A0A0A0A090909090A080A0A0A080A090F0F0F0A0A0C0F0C0F0C0C0C0A090A0B
-0C0B0A08080C0E0A08060C0C0A0C0B0A0A0C0A0A0C100F0A0F070704040C0C0909050A07
-0709090A050407170A090A0909050505050C0C0C0B0B0B030A0A0A0A0A0A0A0A0A0A0803
-0A080A09070B09090909090C0C0808080F0F0F0A0C09050A080B080B08090A050A090A09
-0B0A0B090909090803080408070B090B090C0A0A060A060A08090609060B090B090A090A
-09090C0D090A080A070B0A0908110D080B0508100509050509050A090B080B0809090909
-09090C090C090C090B090B09050305030503050307050A090908030B090B090C0A0C0A0A
-060A0809060B090B090B090B080F0D0909050A090F0E0C0A070F0D0F0D0F0D0909040A0A
-0B0F0F0F0F030A0A0A0A0B0D070D0B0D030A0A0B090A0B050A0A0D0B0A0C0B090A09090A
-0D0C0509090809030909090709090309090909080A0A0809090B0D03090A090D090C090B
-0A05050711110C0A0A0B0A0A0A090B090F090B0B0A0B0D0B0C0B090B090A0D0A0B0B0F10
-0C0E0A0B100A0909090709090D08090909090A090A09090807090D090A090D0E0A0C0908
-0D0909090708080303050E0E0909090909070F120908080808080808000000000C0A0C0A
-000000000A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A090A090A090A090A090A090A090A090A
-090A090A090A090909090909090909090909090909090905030503000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0B090B090C0A
-0C0A0C0A0C0A0C0A090909090909090909000A0010181000060606070D0A110C0407070A
-0D060706070A0A0A0A0A0A0A0A0A0A07070D0D0D09100B0B0B0C0A090C0C07070B090D0C
-0D0A0D0B0A0A0C0B110B0B0B0707070D0A0A0A0A080A0A060A0A050609050F0A0A0A0A06
-09070A090D0909090A070A0D0B0B0B0A0C0D0C0A0A0A0A0A0A080A0A0A0A050505050A0A
-0A0A0A0A0A0A0A0A0A090A0A0A090A0A1010100A0A0D100D100D0D0D0A0A0A0C0D0B0A09
-090D0F0A09060D0D0A0D0C0A0A0D0B0B0D11100A10070704040D0D090B060A07070A0A0A
-060407180B0A0B0A0A070707070D0D0D0C0C0C050A0A0A0A0A0A0A0A0A0A09030A090B09
-070C0A0B090A0A0D0D0909091010100A0C0A070A090B080B080A0A060B0A0B0A0C0A0C0A
-0A0A0A0905090509070C0A0C0A0D0A0B060B060A090A070A070C0A0C0A0B090B09090D0D
-0A0A090A070D0A0A09130E0B0C060911050A06060A060B0A0B080B080A0A0A0A0A0A0C0A
-0C0A0C0A0C0A0C0A070507050705070507060B090909050C0A0C0A0D0A0D0A0B060A090A
-070C0A0C0A0C0A0C0A110D0B09050B0A100F0D0A07110D110D110D0B09040A0A0B101010
-10030A0A0A0B0C0E090E0C0E050B0B0B0A0B0C070B0B0D0C0A0D0C0A0B0A0B0B0D0D070B
-0A090A050A0A09070A0A0509090A09080A0A080A090D0D050A0A0A0D0A0D090B0A070707
-12120D0B0B0B0B0B0B090C0A110A0C0C0B0C0D0C0D0C0A0B0A0B0D0B0C0B0F100D0E0B0B
-110B0A0A0A080A0A0D090A0A090A0B0A0A0A0A0907090D090A0A0D0E0A0C09090D0A0A0A
-0809090505060F0F0A09090A090810130A09090909090909000000000D0A0D0B00000000
-0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A0B
-0A0B0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0A0705070500000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0C0A0C0A0D0B0D0B0D0B
-0D0B0D0B0B090B090B090B090A000A00111A1100060607080E0B120C0508080B0E060806
-080B0B0B0B0B0B0B0B0B0B08080E0E0E09110C0C0C0D0B0A0D0D08080C090E0D0D0A0D0C
-0C0A0C0C110C0A0C0808080E0B0B0A0B090B0A060B0B05060A05110B0A0B0B0709070B0A
-0E0A0A090B080B0E0C0C0C0B0D0D0C0A0A0A0A0A0A090A0A0A0A050505050B0A0A0A0A0A
-0B0B0B0B0B090B0B0B090B0B1111110B0B0E110D110E0E0E0B0B0B0C0E0C0B09090E100A
-09070E0E0B0E0C0B0B0E0C0C0D12110B11080805050E0E0A0A060B08080B0B0B0605081A
-0C0B0C0B0B080808080D0D0D0C0C0C050B0B0B0B0B0B0B0B0B0B0A050C090C09080D0A0A
-0A0A0B0E0E0909091111110B0D0B080C090C090C090B0B060C0A0C0A0D0B0D0B0A0B0A09
-05090509080D0B0D0B0D0A0C070C070C090A070A070C0B0C0B0C090C090A0D0E0B0A080B
-080D0B0B09140F0A0C060912060A06060A060C0A0C090C090B0A0B0A0B0A0D0B0D0B0D0B
-0D0B0D0B080508050805080508060C0A0A09050D0B0D0B0D0A0D0A0C070C090A070C0B0C
-0B0C0B0C0B110E0A0A050C0A11100D0A08110E110E110E0A0A050B0B0C11111111040B0B
-0B0C0D0F090F0D10050C0C0C0B0C0D080C0C0E0D0B0D0D0A0B0A0A0C0F0E080A0B080B05
-0B0B0A080B0B050A0A0B0A090A0B090B0A0E0E050B0A0B0E0B0D0A0C0C08080813130E0C
-0A0D0C0C0C0A0D0B110A0D0D0C0D0E0D0D0D0A0C0A0A0E0C0D0C12120D100C0C120C0A0A
-0A080B0A0E080B0B0A0B0C0B0A0B0B09080A0D0A0C0A0F0F0B0E0A090E0A0A0B08090905
-050610100B0A0A0B0A0811140B09090909090909000000000D0A0D0B000000000B0B0B0B
-0B0B0B0B0B0B0B0B0B0B0B0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0C0A0B
-0A0B0A0B0A0B0A0B0A0B0A0B0A0B0A080508050000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000D0A
-0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0D0A0C0B0C0B0D0B0D0B0D0B0D0B0D0B
-0A0A0A0A0A0A0A0A0B000B00121B1200060607080F0B130D0508080B0F070807080B0B0B
-0B0B0B0B0B0B0B08080F0F0F0A120C0C0D0E0B0A0E0E08080C0A0F0D0E0B0E0D0C0B0D0C
-120C0B0C0808080F0B0B0B0B090B0B060B0B05060B05120B0B0B0B0809070B0B0F0B0B09
-0B080B0F0C0C0D0B0D0E0D0B0B0B0B0B0B090B0B0B0B050505050B0B0B0B0B0B0B0B0B0B
-0B0A0B0B0B0A0B0B1212120B0B0F120E120F0F0F0B0C0B0D0F0D0B0A0A0F110B0A070F0F
-0B0F0D0C0C0F0C0C0E13120B12080805050F0F0B0B070B08080B0B0B0705081B0C0B0C0B
-0B080808080E0E0E0D0D0D050B0B0B0B0B0B0B0B0B0B0A050C090C09080E0B0B0B0B0B0F
-0F0A0A0A1212120B0E0B080C090D090D090B0B070C0B0C0B0E0C0E0B0B0B0B0A050A050A
-080D0B0D0B0E0B0D080D080C090B070B070D0B0D0B0C090C090A0E0E0B0B090B090E0B0B
-0A15100B0D070A13060B06060B060C0B0D090D090B0B0B0B0B0B0E0B0E0B0E0B0E0B0E0B
-080508050805080508060C0B0B0A050D0B0D0B0E0B0E0B0D080C090B070D0B0D0B0D0B0D
-0B120F0B0B050C0B12110E0B08120F120F120F0B0B050B0B0D12121212040B0B0B0C0E10
-0A100E10050C0C0D0B0C0E080C0C0F0D0C0E0E0B0C0B0B0C100E080B0B090B050B0B0B08
-0B0B050B0B0B0B090B0B090B0B0F0F050B0B0B0F0B0E0A0D0C08080814140F0C0B0E0C0C
-0C0A0D0B120B0E0E0C0D0F0E0E0E0B0D0B0B0E0C0E0D13130E110C0D130D0B0B0B080B0B
-0E090C0C0B0B0D0B0B0B0B0A090B0F0B0C0B10100C0E0A0A0F0B0B0B080A090505061010
-0B0B0B0B0A0812150B0A0A0A0A0A0A0A000000000E0B0D0B000000000B0B0B0B0B0B0B0B
-0B0B0B0B0B0B0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0C0B0B0B0B0B0B
-0B0B0B0B0B0B0B0B0B0B0B08050805000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000000E0B0E0B0E0B
-0E0B0E0B0E0B0E0B0E0B0E0B0E0B0E0B0E0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0B0B0B0B
-0B0B0B0B0B000B00131D130007070709100C140E0509090C10070907090C0C0C0C0C0C0C
-0C0C0C09091010100A130D0D0D0F0C0B0F0E08090D0B100E0F0B0F0D0D0C0E0D130D0C0D
-090909100C0C0B0C0A0C0B070C0C06070B06120C0C0C0C080A070C0B100B0B0A0C090C10
-0D0D0D0C0E0F0E0B0B0B0B0B0B0A0B0B0B0B060606060C0C0C0C0C0C0C0C0C0C0C0A0C0C
-0C0A0C0C1313130C0C10130F131010100C0C0C0E100D0C0A0A10120C0A0710100C100E0C
-0C100D0D0F14130C130909050510100B0C070C09090C0C0C0705091D0D0C0D0C0C080808
-080F0F0F0E0E0E060C0C0C0C0C0C0C0C0C0C0B060D0A0D0A090F0C0C0B0C0C10100A0A0A
-1313130C0F0C080D0A0D0A0D0A0C0C070D0B0D0B0F0C0F0C0B0C0B0B060B060B090E0C0E
-0C0F0C0D080D080D0A0C070C070E0C0E0C0D0A0D0A0B0F100C0C0A0C090F0C0C0A16110C
-0E070B14060B07070B070D0B0D0A0D0A0C0B0C0B0C0B0F0C0F0C0F0C0E0C0E0C08060806
-0806080609070D0B0B0B060E0C0E0C0F0C0F0C0D080D0A0C070E0C0E0C0E0C0E0C13100C
-0B060D0B13120F0C091310131013100C0B050C0C0E13131313040C0C0C0D0E110A110E11
-060D0D0D0C0D0E080D0D100E0C0F0E0B0D0C0C0D110F080C0C0A0C060C0C0B090C0C060B
-0B0C0B0A0C0C0A0C0B100F060C0C0C0F0C0F0B0D0D0808091515100D0C0E0D0D0D0B0E0C
-120C0E0E0D0E100E0F0E0B0D0C0C100D0E0E14140F110D0D140D0B0C0B090C0B0F0A0C0C
-0B0C0D0C0C0C0C0A090B100B0D0C11110C0F0B0A100B0B0C090A0A06060711110C0B0B0C
-0B0913160C0A0A0A0A0A0A0A000000000F0C0E0C000000000C0C0C0C0C0C0C0C0C0C0C0C
-0C0C0C0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0D0B0C0B0C0B0C0B0C0B0C
-0B0C0B0C0B0C0B0806080600000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000000F0C0F0C0F0C0F0C0F0C
-0F0C0F0C0F0C0F0C0F0C0F0C0F0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0C0B0C0B0C0B0C0B
-0C000C00141E140007070809100D160F0509090D10070907090D0D0D0D0D0D0D0D0D0D09
-091010100B140E0E0E0F0D0C100F08090E0B110F100C100E0E0C0F0E140E0C0E09090910
-0D0D0C0C0A0C0C070C0D06070C06130D0C0C0C090A080D0C100C0C0B0D090D100E0E0E0D
-0F100F0C0C0C0C0C0C0A0C0C0C0C060606060D0C0C0C0C0C0D0D0D0D0D0B0D0D0D0B0D0C
-1414140D0D101310141010100D0D0D0F100E0D0B0B10130C0B0810100D100F0D0D100E0E
-1015140D140909050510100C0C070D09090D0D0D0705091E0E0D0E0D0D08080808101010
-0F0F0F060D0D0D0D0D0D0D0D0D0D0B060E0A0E0B09100C0C0C0C0C10100B0B0B1414140D
-100C080E0A0E0A0E0A0C0D070E0C0E0C0F0D100D0C0D0C0B060B060B090F0D0F0D100C0E
-090E090E0A0C080C080F0D0F0D0E0B0E0B0B10100C0C0A0D0A100D0C0B17110C0F070B16
-060C07070C070E0C0E0A0E0A0D0C0D0C0D0C100C100C100C0F0D0F0D0806080608060806
-09070E0C0C0B060F0D0F0D100C100C0E090E0A0C080F0D0F0D0F0D0F0D14100C0C060E0C
-1313100C091410141014100C0C050D0D0E14141414040D0D0D0E0F110B120F12060E0E0E
-0D0E0F080E0E110F0D100F0C0D0C0C0E1110080C0C0A0D060D0C0C090D0C060C0C0D0C0A
-0C0D0A0D0C1010060D0C0D100D100B0E0E0808091616100E0C0F0E0E0E0B0F0D130C0F0F
-0E0F110F100F0C0E0C0C100E0F0E151510120E0E150E0C0C0C090C0C100A0D0D0C0C0E0D
-0C0D0C0B0A0C110C0D0C12120D100B0B110C0C0D090B0A06060712120D0C0C0D0B091417
-0D0B0B0B0B0B0B0B00000000110C0F0D000000000D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0E
-0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0E0C0D0C0D0C0D0C0D0C0D0C0D0C0D
-0C0D0C080608060000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000100C100C100C100C100C100C100C
-110C110C110C110C110C0F0D0F0D0F0D0F0D0F0D0F0D0F0D0C0C0C0C0C0C0C0C0C000D00
-152015000707080A110D170F060A0A0D11080A080A0D0D0D0D0D0D0D0D0D0D0A0A111111
-0B150E0E0F100D0C1010080A0F0C1210110D110F0E0D0F0E150E0D0E0A0A0A110D0D0D0D
-0B0D0D070D0D06070C06140D0D0D0D090B080D0C110C0C0B0D0A0D110E0E0F0D10110F0D
-0D0D0D0D0D0B0D0D0D0D060606060D0D0D0D0D0D0D0D0D0D0D0B0D0D0D0B0D0D1515150D
-0D111411151111110D0D0D0F110F0D0B0B11140D0B0811110D110F0E0E110E0E1116150D
-150A0A060611110C0D080D0A0A0D0D0D08060A200E0D0E0D0D080808081111110F0F0F06
-0D0D0D0D0D0D0D0D0D0D0C060E0B0E0B0A100D0D0C0D0D11110B0B0B1515150D100D080E
-0B0F0B0F0B0D0D080E0D0E0D100E100D0D0D0D0C060C060C0A100D100D110D0F090F090E
-0B0D080D080F0D0F0D0E0B0E0B0C11110D0D0B0D0A110D0D0B18120D0F080C17070D0707
-0D070E0D0F0B0F0B0D0D0D0D0D0D100D100D100D100D100D08060806080608060A070F0C
-0C0C06100D100D110D110D0F090E0B0D080F0D0F0D0F0D0F0D15110D0C060E0D1414110D
-0A1511151115110D0C060D0D0F15151515040D0D0D0E10120B131013060E0E0F0D0E1008
-0F0E12100E11100D0E0D0D0E1211080D0D0B0D060D0D0C0A0D0D060C0C0D0C0B0D0D0B0D
-0C1111060D0D0D110D110C0F0E08080A1717110F0D100E0E0E0C100D140D10100F0F1210
-11100D0F0D0D110E100F161610130E0F160F0D0D0C0A0D0D110B0D0D0C0D0F0D0D0D0D0B
-0A0C120C0E0D12130D110C0B120D0D0D0A0B0B06060713130D0C0C0D0C0A15190D0B0B0B
-0B0B0B0B00000000120D100D000000000D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0E0D0E0D0E
-0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D08
-060806000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000110D110D110D110D110D110D110D120D120D
-120D120D120D0F0D0F0D100D100D100D100D100D0D0C0D0C0D0C0D0C0D000D0016211600
-0808090A120E1810060A0A0E12080A080A0E0E0E0E0E0E0E0E0E0E0A0A1212120C160F0F
-0F110E0D11110A0A0F0C1310110D110F0F0E100F160F0E0F0A0A0A120E0E0D0E0B0E0D08
-0E0E06080D06150E0D0E0E090B090E0D120D0D0C0E0A0E120F0F0F0E1011100D0D0D0D0D
-0D0B0D0D0D0D060606060E0D0D0D0D0D0E0E0E0E0E0C0E0E0E0C0E0E1616150E0E121511
-161212120E0E0E1012100E0C0C12150D0C0912120E12100E0E120F0F1118160E160A0A06
-0612120D0E080E0A0A0E0E0E08060A210F0E0F0E0E0A0A0A0A111111101010060E0E0E0E
-0E0E0E0E0E0E0C060F0B0F0C0A110D0E0D0D0E12120C0C0C1616160E110E0A0F0B0F0B0F
-0B0E0E080F0D0F0D110E110E0D0E0D0C060C070C0A100E100E110D0F090F090F0B0E090E
-09100E100E0F0C0F0C0C11120E0D0B0E0B110E0E0C1A130E10080C18070D08080D080F0D
-0F0B0F0B0E0D0E0D0E0D110E110E110E110E110E0A060A060A060A060A080F0D0D0C0610
-0E100E110D110D0F090F0B0E09100E100E100E100E16120E0D070F0D1515110D0A161216
-1216120E0D060E0E1016161616050E0E0E0F11130C131114060F0F0F0E0F110A0F0F1310
-0E11110D0F0E0E0F13120A0E0E0B0E060E0E0D0A0E0E060D0D0E0D0B0D0E0B0E0D121206
-0E0D0E120E110C0F0F0A0A0A1918120F0E110F0F0F0C100E150E11110F10131111110D0F
-0E0E120F1110171711140F0F17100D0E0D0A0E0D120C0E0E0D0E0F0E0D0E0E0C0B0D130D
-0E0D13140E110D0C120D0D0E0A0C0B06060814140E0D0D0E0C0A161A0E0C0C0C0C0C0C0C
-00000000120D110F000000000E0E0E0E0E0E0E0E0E0E0E0E0E0E0E0F0D0F0D0F0D0F0D0F
-0D0F0D0F0D0F0D0F0D0F0D0F0D0F0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0E0D0A060A0600
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000110D110D110D110D110D110D110D120D120D120D120D
-120D100E100E110F110F110F110F110F0E0D0E0D0E0D0E0D0E000E00172317000808090B
-130F1911060A0A0F13080A080A0F0F0F0F0F0F0F0F0F0F0A0A1313130D17101010120F0D
-12110A0A100D1311120E1210100E111017100E100A0A0A130F0F0E0E0C0E0E080E0F0608
-0E06160F0E0E0E0A0C090F0E130E0E0C0F0A0F131010100F1112110E0E0E0E0E0E0C0E0E
-0E0E060606060F0E0E0E0E0E0F0F0F0F0F0C0F0F0F0D0F0E1717160F0F13161217131313
-0F0F0F1113100F0D0D13160E0D0913130F13110F0F1310101219170F170B0B060613130E
-0E080F0A0A0E0E0F08060B23100F100F0F0A0A0A0A121212111111060F0F0F0F0F0F0F0F
-0F0F0D06100C100C0A120E0E0E0E0E13130C0C0C1717170F120E0A100C100C100C0E0F08
-100E100E120F120F0E0F0E0D060D070D0B110F110F120E100A100A100C0E090E09110F11
-0F100C100C0D12130E0E0C0F0B120F0E0D1B140E11080D19070E08080E08100E100C100C
-0F0E0F0E0F0E120E120E120E110F110F0A060A060A060A060A08100E0E0D06110F110F12
-0E120E100A100C0E09110F110F110F110F17130E0E07100E1616120E0A1713171317130E
-0E060F0F1117171717050F0F0F1011140C141115061010100F10110A101013110F12110E
-0F0E0E1014130A0E0E0C0F060F0E0E0B0F0E060E0E0F0E0C0E0E0C0F0E1313060F0E0F13
-0F120D10100A0A0A1A1913100E111010100D110F160E11111011131112110E100E0E1310
-121018181215101018100E0E0E0B0E0E120C0F0F0E0E100F0E0F0E0C0B0E130E0F0E1414
-0F120D0D130E0E0F0B0D0C06060815150F0E0E0F0D0B171B0F0C0C0C0C0C0C0C00000000
-130E1110000000000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F100E100E100E100E100E100E10
-0E100E100E100E100E100E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0A060A060000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000120E120E120E120E120E120E120E130E130E130E130E130E110F
-110F111011101110111011100E0E0E0E0E0E0E0E0E000F00182518000808090B140F1A11
-060B0B0F14090B090B0F0F0F0F0F0F0F0F0F0F0B0B1414140D18101011130F0E13120A0B
-110D1412130E1311100F121018100F100B0B0B140F0F0E0F0D0F0E080F0F06080E06170F
-0F0F0F0A0D090F0E140E0E0D0F0B0F141010110F1213120E0E0E0E0E0E0D0E0E0E0E0606
-06060F0F0F0F0F0F0F0F0F0F0F0D0F0F0F0D0F0F1818170F0F141713181414140F0F0F11
-14110F0D0D14170F0D0914140F14110F0F141010131A180F180B0B060614140E0F090F0B
-0B0F0F0F09060B25100F100F0F0A0A0A0A131313121212060F0F0F0F0F0F0F0F0F0F0D06
-100D100D0B130F0F0E0F0F14140D0D0D1818180F130F0A100D110D110D0F0F09100E100E
-1310130F0E0F0E0D060D070D0B120F120F130F110A110A100D0F090F09120F120F100D10
-0D0E13140F0F0C0F0C130F0F0D1C150F12090D1A080F09090F09100E110D110D0F0E0F0E
-0F0E130F130F130F120F120F0A060A060A060A060B08110E0E0D06120F120F130F130F11
-0A100D0F09120F120F120F120F18140F0E07100E1717130F0B1814181418140F0E060F0F
-1118181818050F0F0F1012150D151216061010110F10120A111014121013120E100F0F10
-15140A0F0F0C0F060F0F0E0B0F0F060E0E0F0E0C0F0F0C0F0E1414060F0F0F140F130E11
-100A0A0B1B1A14110F121010100E120F170F12121112141213120E110F0F141012111919
-1316101119110E0F0E0B0F0E130D0F0F0E0F110F0F0F0F0D0C0E140E0F0F15150F130E0D
-140E0E0F0B0D0D06060816160F0E0E0F0E0B181C0F0D0D0D0D0D0D0D00000000130F1210
-000000000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F100E100E100E100E100E100E100E100E10
-0E100E100E100E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0F0E0A060A06000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000130F130F130F130F130F130F130F130F130F130F130F130F120F120F1210
-12101210121012100F0E0F0E0F0E0F0E0F000F001B291B000A0A0B0C16111D14070C0C11
-160A0C0A0C111111111111111111110C0C1616160F1B12131315111015140B0C130F1714
-15101513121114121B1311130C0C0C16111110110E11100A1111070910071A111011110C
-0E0B11101610100E110C1116121213111415141010101010100E10101010070707071110
-1010101011111111110F1111110F11111B1B1A1111161B151B161616111111141613110F
-0F161A100F0B16161116141111161212151D1B111B0C0C0707161610110A110C0C111111
-0A070C2912111211110B0B0B0B15151514141407111111111111111111110F07120E130E
-0C15111110101116160F0F0F1B1B1B1115110B120E130E130E11110A1210121015111511
-1011100F070F080F0C141114111510130C130C120E110B110B14111411130E130E0F1516
-11100E110D1511110F1F1811140A0F1D09100A0A100A1210130E130E1110111011101511
-15111511141114110B070B070B070B070C091310100F071411141115101510130C120E11
-0B14111411141114111B1611100812101B1A15100C1B161B161B161110071111131B1B1B
-1B061111111214180F181419071213131113140B13131714121514101211111318160B11
-110E11071111100C111107101011100E10110E11101616071110111611150F13120B0B0C
-1E1E161311141213130F14111A11141413141714151410131111161315131C1C15191213
-1C131011100D1110160E1111101113111011110E0D1017101110181811150F0F17101011
-0D0F0E0707091919111010110F0D1B20110F0F0F0F0F0F0F000000001610141200000000
-111111111111111111111111111111121012101210121012101210121012101210121012
-101210111011101110111011101110111011100B070B0700000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000015101510151015101510151015101610161016101610161014111411141214121412
-141214121110111011101110110011001D2C1D000A0A0B0D18121F15080D0D12180B0D0B
-0D121212121212121212120D0D181818101D14141416121116160D0D1410181617111714
-141215141D1412140D0D0D18121211120F12110A1212090A11091C121212120C0F0B1211
-1811110F120D1218141414121617151111111111110F1111111109090909121212121212
-1212121212101212121012121D1D1C1212181D171D181818121312151815121010181C12
-100B18181218151313181414171F1C121D0D0D0808181811120A120D0D1212120B080D2C
-14121412120D0D0D0D17171715151509121212121212121212121009140F140F0D161212
-11121218181010101D1D1D1216120D140F140F140F12120B141114111613161211121110
-091009100D161216121712140C140C140F120B120B15121512140F140F10171812120F12
-0E17121210221912150A101F09120A0A120A1411140F140F121112111211161216121612
-161216120D090D090D090D090D0A14111110091612161217121712140C140F120B151215
-12151215121D1812110914111D1C17120D1D181D181D181211081212151D1D1D1D061212
-12141619101A161A091414141214160D14141816131716111412121419180D12120F1209
-1212110D121209111113110F12120F12111818091212121812171014140D0D0D20201814
-12161414141016121C12161614151816171611141212181416151E1E171B14141E141112
-110E1211170F1313111214121212120F0E1118111312191A13171110181111120E100F09
-090A1B1B12111112100E1D22121010101010101000000000171216130000000012121212
-121212121212121212121214111411141114111411141114111411141114111411141112
-1112111211121112111211121112110D090D090000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000001712
-171217121712171217121712171217121712171217121512151216131613161316131613
-121112111211121112001200203120000B0B0D0F1A142217090F0F141A0C0F0C0F141414
-141414141414140F0F1A1A1A112016161619141219180D0F16121B181913191616141716
-201614160F0F0F1A141413141114130B1414090B13091F141314140E110D14131A131311
-140F141A1616161418191713131313131311131313130909090914131313131314141414
-141114141411141420201F14141A1F19201A1A1A141514171A171411111A1F13110D1A1A
-141A1715151A161619221F14200F0F09091A1A13140C140F0F1414140C090F3116141614
-140D0D0D0D19191917171709141414141414141414141209161116110F1914141313141A
-1A1111112020201419140D16111611161114140C16131613191519141314131209120912
-0F181418141913160E160E1611140D140D171417141611161112191A1413101410191414
-11251C14170C12220A130B0B130B16131611161114131413141319141914191418141814
-0D090D090D090D090F0B16131312091814181419131913160E1611140D17141714171417
-14201A14130A16131F1F19130F201A201A201A141309141417202020200714141416181C
-111C181D091616171416180D16161B1815191813161414161C1A0D14141014091414130F
-141409131314131013141014131A1A091413141A14191216160D0D0F24231A1614181616
-161218141F14181816181B181918131614141A1618172121191D161621171314130F1413
-1A111414131416141314141110131B1315131C1C151912121B1313140F121109090B1D1D
-14131314120F20261411111111111111000000001A131815000000001414141414141414
-141414141414141613161316131613161316131613161316131613161316131413141314
-13141314131413141314130D090D09000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000191319131913
-19131913191319131A131A131A131A131A13171417141815181518151815181514131413
-1413141314001400213221000C0C0D0F1B152418090F0F151B0C0F0C0F15151515151515
-1515150F0F1B1B1B12211717171915131A190D0F17121C191A141A171714181721171417
-0F0F0F1B151514151115140C1515090B140920151415150E110D15141B141411150F151B
-17171715191A181414141414141114141414090909091514141414141515151515121515
-1512151421212015151B201A211B1B1B151515181B171512121B2014120D1B1B151B1815
-151B17171A232015210F0F09091B1B14140C150F0F1515150C090F3217151715150D0D0D
-0D1A1A1A18181809151515151515151515151309171117110F1A14141414151B1B121212
-212121151A150D17111711171115150C1714171419151A151415141209120A120F191519
-151A14170E170E1711140D140D1815181517111711131A1B15141115101A151512261D14
-180C12240B140C0C140C1714171117111514151415141A151A151A15191519150D090D09
-0D090D090F0B1714141209191519151A141A14170E1711140D1815181518151815211B14
-140A171420201A140F211B211B211B141409151518212121210715151517191D121D191E
-091717171517190D17171C19151A1914161414171D1B0D14151115091514140F15150914
-1415141114151115131B1B091514151B151A1317170D0D0F25241B171419171717131915
-2014191917181C191A19141714141B17191822221A1E161722171414141015141A111515
-141417151415151210141C1415141D1D151A13121C14141510121109090B1E1E15141415
-131021271512121212121212000000001B14191600000000151515151515151515151515
-151515171417141714171417141714171417141714171417141714151415141514151415
-141514151415140D090D0900000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000000000000000000000000000000000001A141A141A141A141A14
-1A141A141B141B141B141B141B1418151815191619161916191619161414141414141414
-15001500253825000D0D0F111E18281B0A1111181E0D110D111818181818181818181811
-111E1E1E142519191A1D17151D1C10111A151F1C1D161D1A19171B19251917191111111E
-181816171317160D17170A0D160A241716171710130F17161E1616131711171E19191A17
-1C1D1B16161616161613161616160A0A0A0A171616161616171717171814181818141817
-25252418181E241D251E1E1E1818181B1E1A1814141E2316140F1E1E181E1B18181E1919
-1D2824182511110A0A1E1E16170D1811111717180D0A11381917191717101010101D1D1D
-1B1B1B0A18181818181818181818150A19131913111D17171616171E1E14141425252518
-1D171019131A131A1317180D191619161D181D17161716150A150B15111C171C171D161A
-101A101913170F170F1B171B1719131913151D1E17171317121D1817142B20171B0D1528
-0C160D0D160D19161A131A131716171617161D171D171D171C171C17100A100A100A100A
-110D1A1616150A1C171C171D161D161A101913170F1B171B171B171B17251E17160B1916
-24231D1611251E251E251E17160A18181B2525252508181818191C2014211C220A19191A
-17191C101A191F1C181D1C1619171719201E10171713170A1717161117170A1616181613
-16171317161E1E0A1716171E171D151A1910101129291E1A171C191919151C1724171C1C
-1A1B1F1C1D1C161A17171E191C1A26271D22191A261A1617161117161E13181816171A18
-1618171412161F1618162021181D15141F1616171114130A0A0D2222171616181511252B
-1814141414141414000000001E161C180000000018181818181818181818181818181819
-161916191619161916191619161916191619161916191617161716171617161716171617
-161716100A100A0000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000001D161D161D161D161D161D161D16
-1E161E161E161E161E161B171B171C181C181C181C181C18171617161716171617001800
-2A402A000F0F1113221B2D1F0B13131B220F130F131B1B1B1B1B1B1B1B1B1B1313222222
-172A1D1D1D201B18212012131D17231F2119211D1D1A1F1D2A1D1A1D131313221B1B191A
-161A190F1A1B0C0E190C291B191A1A1216111B19221919161B131B221D1D1D1B1F211F19
-191919191916191919190C0C0C0C1B19191919191B1B1B1B1B171B1B1B171B1A2A2A291B
-1B222A212A2222221B1B1B1F221E1B1717222819171122221B221F1B1B221D1D212D291B
-2A13130B0B2222191A0F1B13131A1A1B0F0B13401D1B1D1B1B121212122121211F1F1F0C
-1B1B1B1B1B1B1B1B1B1B180C1D161D1613211A1A19191A22221717172A2A2A1B211A121D
-161D161D161A1B0F1D191D19201B211B191B19170C170C17131F1B1F1B21191D121D121D
-161A111A111F1B1F1B1D161D161821221A1A161A15211B1A1731251A1F0F172D0E190F0F
-190F1D191D161D161B191B191B19211A211A211A201B201B120C120C120C120C130E1D19
-19170C1F1B1F1B211921191D121D161A111F1B1F1B1F1B1F1A2A221A190D1D192A282119
-132A222A222A221A190B1B1B1E2A2A2A2A091B1B1B1D2025172520260C1D1D1E1B1D2012
-1D1D231F1B2120191C1A1A1D2522121A1A161B0C1B1A19131B1A0C19191B1915191A151B
-1923220C1B191B221B21181D1D1212132F2E221D1A201D1D1D181F1B291A20201D1F2320
-2120191D1A1A221D201E2B2C21271D1D2B1E191A19141A1922161B1B191A1D1B191B1A16
-151923191B1925251B2118172319191B1417160C0C0E26261B19191B18142A311B171717
-17171717000000002219201C000000001B1B1B1B1B1B1B1B1B1B1B1B1B1B1B1D191D191D
-191D191D191D191D191D191D191D191D191D191B191B191B191B191B191B191B191B1912
-0C120C000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000211921192119211921192119211922192219
-2219221922191F1B1F1B201C201C201C201C201C1A191A191A191A191A001B002E462E00
-10101215261D32210C15151D26111511151D1D1D1D1D1D1D1D1D1D1515262626192E1F20
-20231D1A24231215201A2722241C24201F1C221F2D201C20151515261D1D1C1D181D1B10
-1D1D0C101B0C2D1D1C1D1D1418121D1B261B1B181D151D261F1F201D2224221C1C1C1C1C
-1C181B1B1B1B0C0C0C0C1D1C1C1C1C1C1D1D1D1D1D191D1D1D191D1D2E2E2D1D1D262E24
-2E2626261D1E1D2126211D1919262C1C191226261D26211E1E261F1F24312D1D2E15150C
-0C26261B1C111D15151D1D1D110C15461F1D1F1D1D121212122424242222220C1D1D1D1D
-1D1D1D1D1D1D1A0C1F18201815241C1C1B1C1D26261919192E2E2E1D241D121F18201820
-181D1D111F1C1F1C231E241D1B1D1B1A0C1A0E1A15221D221D241C201420141F181C121C
-12221D221D201820181A24261D1C181D17241D1D1936281C22111A320F1C10101C101F1C
-201820181D1B1D1B1D1B241D241D241D231D231D120C120C120C120C1510201B1B1A0C22
-1D221D241C241C20141F181C12221D221D221D221D2D261C1B0E1F1C2E2C241C152D262D
-262D261C1B0C1D1D212E2E2E2E0A1D1D1D1F23281929232A0C1F20201D20231220202722
-1E24231C1F1C1C202826121C1D181D0C1D1D1B151D1D0C1B1B1D1B171C1D171D1B26250C
-1D1C1D251D241A201F121215333326201C231F20201A221D2D1C23232022272324231C20
-1C1C262023212F30242A1F2030201C1C1B161D1B25181D1D1B1D201D1C1D1D19171B271B
-1E1C28291D251A19271C1B1D1619180C0C102A2A1D1B1B1D1A162E361D19191919191919
-00000000251C231E000000001D1D1D1D1D1D1D1D1D1D1D1D1D1D1D1F1C1F1C1F1C1F1C1F
-1C1F1C1F1C1F1C1F1C1F1C1F1C1F1C1D1B1D1B1D1B1D1B1D1B1D1B1D1B1D1B120C120C00
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000241C241C241C241C241C241C241C251C251C251C251C
-251C221D221D231E231E231E231E231E1C1B1C1B1C1B1C1B1D001D00324C320012121417
-292036240D17172029121712172020202020202020202017172929291B3222222327201D
-27261517231C2A25271E2723221F252231221F221717172920201E1F1A1F1E121F200F11
-1E0F31201E1F1F151A14201E291E1E1A20172029222223202527251E1E1E1E1E1E1A1E1E
-1E1E0F0F0F0F201E1E1E1E1E20202020201B2020201B201F323231202029322732292929
-202020242923201B1B29301E1B1429292029242020292222273531203217170D0D29291E
-1F122017171F1F20120D174C2220222020151515152727272525250F2020202020202020
-20201C0F221A221A17271F1F1E1E1F29291B1B1B32323220271F15221A231A231A1F2012
-221E221E272027201E201E1C0F1C0F1C1725202520271E23152315221A1F141F14252025
-20221A221A1C27291F1E1A201928201F1B3A2C1F25121C36101E12121E12221E231A231A
-201E201E201E271F271F271F26202620150F150F150F150F1711231E1E1C0F2520252027
-1E271E2315221A1F14252025202520252031291F1E0F221E3230271E173129312931291F
-1E0D202024323232320B20202022262C1B2C262D0F2222232022261523222A252027261E
-221F1F222C29151F1F1A200F201F1E17201F0F1E1E201E191E1F19201E29290F201E2029
-20281C2322151517383729231F262222221C2520311F262623252A2627261E231F1F2922
-26243434272E222334231E1F1E181F1E281A20201E1F23201E201F1B191E2A1E201E2C2C
-20281D1B2A1E1E20181B1A0F0F112E2E201E1E201C18323B201B1B1B1B1B1B1B00000000
-281E262100000000202020202020202020202020202020221E221E221E221E221E221E22
-1E221E221E221E221E221E201E201E201E201E201E201E201E201E150F150F0000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00000000000000000000271E271E271E271E271E271E271E281E281E281E281E281E2520
-2520262126212621262126211F1E1F1E1F1E1F1E1F00200036523600131315192C223A27
-0F1919222C141914192222222222222222222219192C2C2C1D362525262A221F2A291719
-251E2E282B212B2625212825352521251919192C222220221C22201322220F13200F3522
-212222171C1522202C20201C2219222C25252622282B282020202020201C202020200F0F
-0F0F22212121212122222222221D2222221D222136363522222C362B362C2C2C22232227
-2C26221D1D2C34211D152C2C222C2723232C25252B3A35223619190F0F2C2C2021142219
-19222222140F19522522252222171717172B2B2B2828280F222222222222222222221E0F
-251C251C192A21212021222C2C1D1D1D363636222A2217251C261C261C22221425202520
-2A232A222022201E0F1E101E19282228222B2126172617251C2115211528222822251C25
-1C1F2B2C22211C221B2B22221D3F2F2127141E3A1121131321132520261C261C22202220
-22202A222A222A2229222922170F170F170F170F19132520201E0F282228222B212B2126
-17251C21152822282228222822352C212010252036342B2119352C352C352C21200F2222
-27363636360B22222225292F1D3029310F2525262225291725252E28232B292124212125
-2F2C1721221C220F2221201922220F202023201B21221B22202C2C0F2221222C222B1F26
-251717193C3C2C2521292525251F28223521292925282E292B29212621212C2529263838
-2A32252638262021201922202B1C2323202226222122221D1B202D2023212F30232B1F1E
-2D202022191E1C0F0F133131222020221F19363F221D1D1D1D1D1D1D000000002C212924
-000000002222222222222222222222222222222520252025202520252025202520252025
-2025202520252022202220222022202220222022202220170F170F000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000002B212B212B212B212B212B212B212C212C212C212C212C21282228222924
-29242924292429242120212021202120220022003A583A001414171B2F253E2A101A1A25
-2F151A151A252525252525252525251A1A2F2F2F203A2828292D25212D2C181A2820312B
-2E232E2828242A28392824281A1A1A2F252523241E24231424250F14220F382523242419
-1E1725222F22221E251A252F282829252B2E2A2323232323231E232323230F0F0F0F2523
-2323232325252525251F2525252025243A3A3925252F392E3A2F2F2F2525252A2F292520
-202F372320172F2F252F2A25252F28282E3E39253A1B1B10102F2F222415251A1A242425
-15101B582825282525181818182E2E2E2A2A2A0F25252525252525252525210F281E281E
-1A2D23242223242F2F1F1F1F3A3A3A252D2418281E291E291E242515282328232D262D25
-232523200F2011201B2B252B252E2328192819281E241724172A252A25281E281E212E30
-24231E251D2E2524204333242A15203E1323151523152823291E291E2523252325232D24
-2D242D242C252C25180F180F180F180F1A14282222200F2B252B252E232E232819281E24
-172A252A252A252A25392F242211282339372E231A392F392F392F24221025252A3A3A3A
-3A0C252525282C321F332C350F28282925282C182828312B262E2C2327242428332F1824
-241E250F2524221B25240F222225221D23241D2522302F0F2523252F252E21292818181A
-41402F28242C282828212B2538242C2C282B312C2E2C2329242430282C293C3D2D352729
-3C292324231B24232E1E2525222428252325241F1D22312225233333252E212031232325
-1B201E0F0F14353525222225211B3A44251F1F1F1F1F1F1F000000002F232C2600000000
-252525252525252525252525252525282328232823282328232823282328232823282328
-23282325232523252325232523252325232523180F180F00000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-00002E232E232E232E232E232E232E232F232F232F232F232F232A252A252C262C262C26
-2C262C262422242224222422240025004366430018181A1F372B4831121E1E2B37181E18
-1E2B2B2B2B2B2B2B2B2B2B1E1E37373725432E2E2F342A2734321D1E2E2538323528352F
-2E29312E422E292E1E1E1E372B2B282A232A28182A2A12172812412A292A2A1D231A2A28
-372828232B1E2B372E2E2F2A3235312828282828282328282828121212122A2929292929
-2A2A2A2A2B242B2B2B252B2A4343412B2B374335433737372B2B2B31372F2B2525374029
-251A37372B37312B2B372E2E3548422B431F1F121237372829182B1E1E2A2A2B18121F66
-2E2A2E2A2A1D1D1D1D353535313131122B2B2B2B2B2B2B2B2B2B26122E232E231E342929
-28292A37372424244343432B342A1D2E232F232F232A2B182E282E28342B342A282A2825
-122514251F322A322A35292F1D2F1D2E23291A291A312A312A2E232E232635372A29222A
-21352B2A254E3A29311825481628181828182E282F232F232A282A282A28342A342A342A
-322A322A1D121D121D121D121E172E28282512322A322A352935292F1D2E23291A312A31
-2A312A312A42372928142E28434035291E4237423742372928122B2B30434343430E2B2B
-2B2E323A243B323D122E2E2F2A2E321D2E2E38322B3532282D29292E3A371D292A222A12
-2A2A281F2A2A1228282B2822292A222A283737122A292A372A35262F2E1D1D1E4B4A372E
-29322E2E2E26322A412932322E3138323532282F2929372E33304546343E2E2F452F2829
-28202A2835232B2B282A2F2B292B2A24212838282B293B3B2B3526253828282A20252312
-12173D3D2A28282B2620434F2B24242424242424000000003629332C000000002B2B2B2B
-2B2B2B2B2B2B2B2B2B2B2B2E282E282E282E282E282E282E282E282E282E282E282E282A
-282A282A282A282A282A282A282A281D121D120000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000003529
-35293529352935293529352936293629362936293629312A312A332C332C332C332C332C
-29282928292829282A002B004B724B001A1A1E223D305137142222303D1B221B22303030
-3030303030303022223D3D3D294B3333343A2F2B3A381F22342A3F383B2D3B34332E3733
-4A332E332222223D30302D2F272F2D1A2F2F151A2C15492F2E2F2F20271E2F2C3D2C2C27
-3022303D3333342F383B372D2D2D2D2D2D272D2D2D2D151515152F2E2E2E2E2E2F2F2F2F
-302930303029302F4B4B4930303D4A3B4B3D3D3D303030373D353029293D482E291E3D3D
-303D3730303D33333B504A304B222214143D3D2C2E1B3022222F2F301B142272332F332F
-2F1F1F1F1F3B3B3B37373715303030303030303030302A1533273327223A2E2E2C2D2F3D
-3D2929294B4B4B303A2F1F3327342734272F301B332D332D3A313A2F2D2F2D2A152A162A
-22382F382F3B2E3420342033272E1E2E1E372F372F332733272A3B3D2F2E262F253B302F
-2957412E371B2A51182D1B1B2D1B332D342734272F2D2F2D2F2D3A2F3A2F3A2F382F382F
-1F151F151F151F15221A342C2C2A15382F382F3B2E3B2E342033272E1E372F372F372F37
-2F4A3D2E2C17332D4A483B2E224A3D4A3D4A3D2E2C143030364B4B4B4B10303030333841
-28423944153333352F33381F34333F38313B382D322E2E33413D1F2E2F262F152F2F2C22
-2F2F152C2C302C262E2F262F2C3E3D152F2E2F3D2F3B2A35331F1F2254533D342E383333
-332A382F492E383834373F383B382D342E2E3D3339354D4E3B4533354E352D2E2D232F2D
-3C2730302C2F34302E302F28252C3F2C302D4243303C2B293F2D2D2F23292715151A4545
-2F2C2C302A234B583029292929292929000000003D2E3931000000003030303030303030
-30303030303030332D332D332D332D332D332D332D332D332D332D332D332D2F2D2F2D2F
-2D2F2D2F2D2F2D2F2D2F2D1F151F15000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000000000000000000000000000003B2E3B2E3B2E
-3B2E3B2E3B2E3B2E3D2E3D2E3D2E3D2E3D2E372F372F393139313931393139312E2C2E2C
-2E2C2E2C2F003000537E53001D1D21264435593C16262635441E261E2635353535353535
-35353526264444442D5339393A403430403E22263A2E463E4132413A39333D3952393339
-26262644353532342B34311D3435181D31185135323434232B2135314431312C35263544
-39393A343E413D3232323232322B313131311818181835323232323235353535352D3535
-352D35335353513535445241534444443535353C443B352D2D444F322D21444435443C36
-36443939415951355326261616444431331E3526263434351E16267E3934393434222222
-224141413D3D3D18353535353535353535352F18392B392C2640333331323444442D2D2D
-53535335403422392B3A2B3A2B34351E39323932403640343134312E182E192E263E353E
-3541323A233A23392B332133213D353D35392C392C2F414434322B34294235342D614833
-3D1E2E591B321D1D321D39323A2B3A2B3431343134314034403440343E353E3522182218
-22182218261D3A31312E183E353E35413241323A23392B33213D353D353D353D34524433
-31193932524F41322652445244524433311635353C5353535312353535393E482D493F4B
-1839393A34393E223A39463E36413E323833333948442233342B35183433312635341831
-3135312A32342A34314444183432344434422F3A392222265D5C443A333E3939392F3E34
-51333E3E3A3D463E413E323A333344393F3B5657414C393A563B323331273431422C3535
-31343A353235342C293146313632494A35422F2D46323135272D2B18181D4C4C35313135
-2F275361352D2D2D2D2D2D2D0000000043323F3700000000353535353535353535353535
-353535393239323932393239323932393239323932393239323932343134313431343134
-313431343134312218221800000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000041324132413241324132
-41324132433243324332433243323D353D353F373F373F373F373F373331333133313331
-340035005C8C5C002020242A4B3A6343192A2A3A4B212A212A3A3A3A3A3A3A3A3A3A3A2A
-2A4B4B4B325C3F3F40473A354745272A40334E45483748403F39433F5B3F393F2A2A2A4B
-3A3A373930393720393A18203618593A3839392730243A364B3636303A2A3A4B3F3F403A
-4548433737373737373037373737181818183A38383838383A3A3A3A3A323A3A3A323A39
-5C5C5A3A3A4B5B485C4B4B4B3A3B3A434B413A32324B583832244B4B3A4B433B3B4B3F3F
-48625A3A5C2A2A19194B4B3639213A2A2A3A3A3A21192A8C3F3A3F3A3A27272727484848
-434343183A3A3A3A3A3A3A3A3A3A34183F303F302A4738393638394B4B3232325C5C5C3A
-4739273F3040304030393A213F373F37473C473A373A373318331B332A453A453A483840
-2740273F3039243924433A433A3F303F3034484B39382F3A2E493A39326B503843213363
-1E38212138213F37403040303A373A373A37473947394739453A453A2718271827182718
-2A204036363318453A453A4838483840273F303924433A433A433A433A5B4B39361C3F37
-5B5848382A5B4B5B4B5B4B3936193A3A425C5C5C5C133A3A3A3F455032514554183F3F41
-3A3F4527403F4E453C4845373E39393F504B2739392F3A183A39362A3A391836363B362E
-383A2F3A364C4B183A383A4B3A4934403F27272A67654B4039453F3F3F34453A5A394545
-40444E454845374039394B3F46425F6048553F415F413739372B393749303B3B3639403B
-383B39312E364D363B3851523B4935324D37373A2B323018182054543A36363B342B5C6C
-3B32323232323232000000004A38463D000000003A3A3A3A3A3A3A3A3A3A3A3A3A3A3A3F
-373F373F373F373F373F373F373F373F373F373F373F373A373A373A373A373A373A373A
-373A37271827180000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000004838483848384838483848384838
-4A384A384A384A384A38433A433A463D463D463D463D463D393639363936393639003A00
-649864002323272E52406C491B2D2D4052242D242D404040404040404040402D2D525252
-37644445464D3F394E4B2A2D4538544B4F3C4F46443E494463453E452D2D2D5240403C3E
-343E3C233E3F1B223B1B613F3D3E3E2B34273F3B523B3B353F2D3F524444463F4B4F493C
-3C3C3C3C3C343C3C3C3C1B1B1B1B3F3D3D3D3D3D3F3F3F3F403640404037403E64646240
-4052634F6452525240404049524740373752603D3727525240524940405244444F6B6240
-642E2E1B1B52523B3E24402D2D3F3F40241B2E98443F443F3F2A2A2A2A4F4F4F4949491B
-40404040404040404040381B443445352D4E3D3E3B3D3E5252363636646464404E3E2A44
-34463446343E4024443C443C4D414E3F3C3F3C381B381E382E4B3F4B3F4F3D462B462B44
-343E273E27493F493F45354535394F523E3D333F324F403E3774573D4924386C203C2323
-3C23443C463446343F3C3F3C3F3C4E3E4E3E4E3E4B3F4B3F2A1B2A1B2A1B2A1B2D22453B
-3B381B4B3F4B3F4F3D4F3D462B44343E27493F493F493F493F63523E3B1E443C63604F3D
-2D6352635263523E3B1B4040486464646415404040444B5736584B5B1B4445463F454B2A
-4545544B414F4B3C433E3E4557522A3E3E333F1B3F3E3B2E3F3E1B3B3B403B323D3F333F
-3B52511B3F3D3F513F4F3946442A2A2D706E52453E4B444545394B3F613E4B4B4549544B
-4F4B3C463E3E52454C4767694E5C444667473C3D3B2F3E3C503440403B3E46403D403E35
-323B543B403D5859404F3937543C3C3F2F37341B1B225B5B3F3B3B40392F647540363636
-3636363600000000513D4C4200000000404040404040404040404040404040443C443C44
-3C443C443C443C443C443C443C443C443C443C3F3C3F3C3F3C3F3C3F3C3F3C3F3C3F3C2A
-1B2A1B000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-000000000000000000000000000000000000000000000000000000000000000000000000
-0000000000000000000000000000000000004F3D4F3D4F3D4F3D4F3D4F3D4F3D513D513D
-513D513D513D493F493F4C424C424C424C424C423E3B3E3B3E3B3E3B3E00400000020100
-000007000600000300070014B706020400060204002FCDDDCD002FCDDDCD313021112111
-2521112101000600FA800500FB000600FA0080050000000201230000020305D100030007
-0027401703030202075505080F0901005D042B035D0F051F0502052F5DE4FDE45D003FED
-332F3F3130010323031323353302031AAA1CD6CCCC05D1FBC90437FA2FD3000200A803D1
-0304061400030007002640150206060307010F09400902032C0040000100042C072FED33
-5D2FED5D003F3C332F3C3130010323032303230303042B842BA82B842B0614FDBD0243FD
-BD024300000200C3000005C905D1001B001F00B1407140215609740570097B137B167B17
-7B1A080A091E1D160F1501671501151E0C0F1013140B1407081F1C17001801681801181E
-0502011A06190662191462700B010B03110B111903040D001B011B1B0D171A011D0410B5
-131E020509040CB50F070F1318040B00140114030F0B4F0B020B08003F5D3F5D1217392F
-ED17392FED1739012F332F5D1217392F2F2F5DE42FE4313087C0C0C0C0FD5D71C0C0C0C0
-C08710C0C0C0C0FD5D71C0C0C0C0C0015D01210321152103231321032313213521132135
-2113330321133303210521032105C9FEB35C0134FEA9688168FEF2688168FED6014D5CFE
-CC0157698169010E698169012AFE35FEEE5E011203A4FE8887FE5B01A5FE5B01A5870178
-8701A6FE5A01A6FE5A85FE840003009BFE9704880628002C0033003A00BC408D7D087E16
-70197620702C7A36060E16012B1B16122B230D350D3C163C24352B430D4A164C24432B5A
-08532053335A356B0865206529632B6A30643A171D40090B371D382E11221D2226471B18
-312D1227373400030A067F1E011E050A11470A05060F3C1F3C0221210334207F00010031
-201818063F094F09020900112D1B1E263706031E0930064006700603062F5D33ED173932
-2F5D12392FED2F5DED12392F5D002F3333ED2F2F2F5D121739ED33332F1139392F2B3130
-5D5D011406071123112E012735331E01171E0117112E01272E01353436371133111E0117
-15232E0127111E01171E0125110E0115141601342627113E010488F2C47684E855101362
-2E348B4F28441DA38EE9D17665D4480E4BA3851E461A95A3FDD46B926C02007584788101
-7C9BCD13FE960165013127C60E351113210301B1080F0829A57994CC110110FEF2022C1D
-C42E4709FE51051105209CE8019D08655A5B5CFE585E5719FE620C6200050095FFE30807
-05ED000B000F001B00270033009C40720908060A0918061A0F351808170A1818171A2908
-260A2918261A460D480F4035560D580F680E13791F7625792B76310425512F034F030203
-031F5109020F030E082B51201940190219193151130A4F0C400E020C0E2E2A0016011616
-282A0C0E060F10401002101C2A0F00010000222A10062F33ED332F5DED2F5D123939ED33
-2F5DED2F2F5D003FED332F5DED3F3F3FED332F5DED5D3130015D01140623222635343633
-321625012309011406232226353436333216013426232206151416333236013426232206
-1514163332360374BDB2B6BABEB2B5BA02B3FCF4A5030C0285BEB2B5BABDB2B6BAFABB59
-64665858666459049359646658586664590434E0DADADFE0DADCC0FA2F05D1FBCCE0DADC
-DDE0DADA01B8AC8888ADAD8787FE17AC8888ADAD878700030073FFE1061305F0000B0018
-004500E1406F090F190F3C0C3015301D352D3E3D4F1A471D4F44791C0B6A25603F7B0576
-087B0F761D7A25703E703F090508062A06371408161D142A1437153F290C2A1D26373008
-300A4008400A490C41144F1C431D46204C21412D413C5108590D5B25690566086B0F601D
-1E3F0C161D20231903B8FFC0403B12173703AA190D2C093E05233502163F230A1E082C0D
-3E032F00143806142F3F0C4513201D2F38041A26001E011E1E45140D1A011A1A13152673
-4610F6ED332F5DED332F5D11121739111239392FED2FED121739003F3FED3F121739ED2B
-2F12393912393931305D5D015D013426232206151416173E0113010E01070E0115141633
-323601151406070123270E01232224353436373E01372E01353436373E01333216151406
-070E0107013E0137362635031871585C744F836265C2FE221F3E1F1C24AB9D5DB7016B32
-3C017AF6E573F07FD0FEED34232368356E61353532A161ADD6181D20765E01730E0E0102
-0104A75F6D7B594B744F2387FD0001D20F312A276E4592B35B02AE6060F06DFE90E08E71
-F3C55C86312F531F48926F437932303CAF862C6F2C315A20FE96286034388A30000100A4
-03D10182061400030015400A020203010F0501002C032FED5D003F332F31300103230301
-822B882B0614FDBD0243000100B5FE64030F061400150048403709010907190119072803
-28054F01480348054F075F015F076F016F077F01780278067F07120701010C7A04010830
-000100000F1F04881610F4ED332F5D3C5D003F3F3130015D012326021110123733150E01
-070602151412171E0117030FE5B1C4C4B1E551933F3C4B493E3C9A4DFE64CB01E0012D01
-2D01E0CB0A49BF7F7BFED8A4ABFEE4807BC7450000010093FE6402ED06140015004E403D
-060306131503151326012603261326154701400340134715500350136003601379007602
-700370137614151201040C750001123F040104040B1F00921710F6ED332F5D3C5D003F3F
-3130015D0110020723353E01373612353402272E01273533161202EDC4B1E54D9B3B3E49
-4A3D3F9351E5B1C4023CFED3FE20CB0A45C77B80011CABA401287B7FBF490ACBFE200001
-00A70276047106140011009040094F1301114009103708B8FFC040580910375B025B0554
-0B540E6B026B05640B640E7B027B05730B730E0C01060F0A0B0E08110502060C064F0450
-0402040A0F0C01040C010F131F130200110D4010011008070C4F090109100E020304050B
-060D2809700C010C2F5D33ED1739322F5D1239392F5D1239395D003F335D332F5D331217
-392F332F3331305D012B2B5D01072513231305272D013705033303251705047140FE9606
-8105FE9741017DFE8341016A068107016B40FE8403776ED5FE980168D66ECFCF6ED50167
-FE99D46ECD00000100D2001B05BA04FD000B0039402303AC01045408AC0A0F070107400D
-01300D400D0200AB0A800101012A05AB07400401042F5D3CE4FD5D3CE45D5D002F5D3CE4
-FD3CE4313001211123112135211133112105BAFDDFA6FDDF0221A60221023CFDDF0221A0
-0221FDDF00010093FE8E023F011D0003003540261A012A012B0235003902450048025500
-590264007400C5030C0202035604000004021A0202022F5D332F0010F4322F3130015D09
-012313023FFEE692AE011DFD71028F00000100990231030902E600030020401401420F02
-01020F054F004F055F005F05050000022F332F5D002F5DED3130012135210309FD900270
-0231B500000100FD000001EC011D00030016400C02560108002D2F013F0102012F5DED00
-3FED31302123113301ECEFEF011D0001FFE2FED0035C0614000300364025030100050116
-01250138004900440156016701770186010A011202032F02010200010000022F332F003F
-2F5D31300187ED5D87C009012301035CFD33AD02CA0614F8BC07440000020089FFE1048F
-05EF000B0023004140303601390B340C3B123B18341E4501490B440C4B124B18441E0C15
-4909022149030A0F21009E250F251F25021B2106982410F6ED5D10F6ED003FED3FED3130
-5D011002212002111012212012013E01353426272E01232206070E01151416171E013332
-36048FFBFEF8FEF4F7FA0109010CF7FEF92319192423795F5E7B24221916242179645E7C
-02E9FE6FFE89017C018A018D017BFE7FFCB551DB9A98E04E4D4E4E4F4AEE8E9CD2534E52
-4E00000101160000043C05D6000F003A4023054606060C030E034801080F111F11020502
-1F0F010F0F0C0E20023F036F03700303032F5D33ED39322F5D2F335D003FFD323F332FED
-3130290135211121353236373E0137331121043CFCDA0136FECA3F90252E35049B013098
-03E6881514194D41FAC2000100A10000049105F000200097407B501F601F020503061116
-03151124113B05380D350E3F1D3F1E391F4B05480D450E4F1D4F1E491F5F035D045D055B
-0956115F195E1B5D1C5F1D5F1E6A036406651162156F1E700274117F1A7F1C7F1E25000F
-100F2D082F1C300F400F060F0F0B4A1302021F4A01081F0208211616209E220F221F2202
-101002992110F6322F5D10F6322FED1239003FFD323FED332F5D31305D015D2901353E01
-373E013534262322060723353E01333204151406070E01070E0107210491FC1069D35BC0
-8E99895BD4650A47ED6FE501042B2A27694B6BE4630321D15AB459BADB7F74834042D223
-3ADDBD5593423E784969C554000100A7FFE1047C05F0003D009540700B0B052F1A0B152F
-290B262F293C3C0B35143122342F4A0B45144322432F56015905590B552F6A0B662F6A3C
-780B762F74357B3C1A343A443A023B3A1E491F012D112D022D2D294A1F0931020F0D1F0D
-020D0D114A090A2321371E2E1621032E1E3A37040C03A03F0F3F1F3F020C9A3E10E65D10
-E611173910ED2F2F2FED003FED332F5D3F1239ED332F5D2FFD39395D31305D011E011514
-06070E012322262735331E01333236373E01353426272E012B0135333236353426272E01
-2322060723353E01333216171E0115140607151E01040E303E4A434BCB797CF04D0F55E6
-6B3F8E2C2E2D332D2D804A5A4698B52E292B623E5FD65F0A47ED6F6DA643484AAF77307C
-02CD2B826766AA3F46433B23D1384A2A292C6A5150691E1F17A67F7A36511A1A14443ED1
-233B282C30885B7CB9180E0833000002004D000004B305D1000A000D00684041040D140D
-240D340D440D700D060C0D480606070C0607090D4901050503070303083F0A4F0A020A0F
-0F1F0F02070C04200A090D064F060101010F061F063F0603062F5D332F5D12393333ED39
-395D2F5D003F3F12392F3CFD321239393130018710FD04C0015D01231123112135013311
-3321110104B3DDC0FD3702D1B8DDFE63FDBF01A3FE5D01A3E60348FC7202A0FD60000001
-00BBFFE1048505D1002A0070404E0A081A082B083D0835113D164B0844115A0854296A08
-7A080C1D1D1A490F251F2540250325214A25061E020F0A1F0A020A0A0E4A060A2022204F
-1D011D142100201D09009F2C0F2C1F2C02099B2B10E65D10E611393910ED2F5DED2F003F
-ED332F5D3F1239ED2F5DFD322F31305D011406070E012322262735331E01333236373E01
-353426272E012322060711211521113E01333216171E0104854C4248C7837AE24E0E52DC
-6A4785342C2D352F34955C58A33B0380FD412B5A2179B64C505801D968BE41464B3324D3
-344928322B784F4D6A20261F180C02FFAFFE740404293437AE0000020089FFE104A705ED
-0022003700644044060D160D3925333133374925423143375F01560D5020502165217531
-0E1A0329491D1313174A1D030F023549030A1A2C2F122321001209009C390F391F39022F
-2109983810F6ED5D10E6113910ED2F123939003FED3F1239FD322F2FED123931305D0114
-002322262726023534123736243332161715232E01232200073E01333216171E01073426
-272E01232206070E01151416171E0133323604A7FED5D96EB445565D555D580116B93B50
-290A1C713BD7FF001554A36B5F914C5859CB373F2E703D55924D020241392E6B3F91A601
-E3E3FEE14443530112C1C6013277717F0A0DBF0F1BFEF3E5333523353DBA8D5D7A2D2014
-282A16291F9EB7352C29B1000001009A0000049505D10006004F403209010A0224014801
-4B0258027903070301000120020203000002034A050302080F081F087B02030300020204
-0F00010000042F332F5D12392F12395D003F3FFD11392F3130018710ED87C0015D090123
-012135210495FD5ED602CDFCB003FB04F2FB0E0522AF0003007AFFDE049C05F300190028
-0037009440702D2B3415332234273433441541224427453350155B195A1B5A1F54225F2B
-592C5F31543354376008620E6212621960236027760E76127B2C86121DA926A62F022616
-0A2F04031D4710023548030A1A200013011313002F0A0D292100162620009D390F391F39
-0220210D0D322106973810F6ED332FED5D10E411393910ED11393911332F71ED003FED3F
-ED1217395D31305D01140023222435343637352E0135342433320415140607151E010334
-26232206151416171E01173E01133426272E01270E01151416333236049CFED3E4F2FEE1
-908378730114D5DF010A7E7A8C94EDA5807EA15152258B42634C1F51762F705D5A6DBA8F
-92AF019FC1FF00FAC37CC93B06409872A8E0D6A565C337063CB0024F6B7F786648692912
-3A13428EFD735C6F3816262231A86A87B09600020071FFE3048F05EF0022003700644045
-0804190429043C253C2B352E4C254C2B432E58045F175D18521B70017B250F111D324914
-294914061D020A0A0E4A060A351109232100091A009E390F391F39022C211A963810F6ED
-5D10E6113910ED2F3939003FFD322F3F1239ED2FED123931305D01140207060423222627
-35331E01333212370E01232226272E01353400333216171612073426272E012322061514
-16171E01333236373E01048F595A5BFEEEB9345C240A1D6A41DDFB145DA4615C954B5859
-012CD86CB845555CCA40382F6C3F90A736402D6C424EA04601030342C3FEC270727C0B0C
-BF0F1B0109E9383024343DBC83E4011E434353FEFBA49BBC342D27B4A35F782D1F152A28
-15290002015A00000249045D00030007001E4010015602050656050807002D0600010101
-2F5D3CFD3C003FED3FED313001231133112311330249EFEFEFEF0340011DFBA3011D0002
-00E6FE8E0292045D00030007004C40370A050A061A051A062A052B063504390645044806
-5504590664047404C5070F01560205060607560806063F044F04020404002D000101012F
-5DFD322F5D332F0010F4322F3FED3130015D01231133130123130249EFEF49FEE692AE03
-40011DFCC0FD71028F00000100FE004D058004CB0006005E401073050105045403020306
-540001002C00B8FFE240260A1837031E0A1837031F002F0002030F000100400801300840
-080204050100004001500102012F5D332F1239395D5D002F5D335D2F2B2B31304B535887
-10FD8710FD05C059015D250135011509010580FB7E0482FC72038E4D02017C0201B4FE75
-FE75000200F5016A059703AE00030007003540200554060154060F020102400901300940
-09020405012F004000020000400101012F5D332F5D1239395D5D002F5D33ED2FED313001
-213521112135210597FB5E04A2FB5E04A2030EA0FDBCA0000001010C004D058E04CB0006
-006040107C030103045405050602540101002C01B8FFE240280A1837051E0A1837051F01
-2F0102050F010101400801300840080203050100002F013001400103012F5D332F123939
-5D5D002F5D335D2F2B2B31304B53588710FD8710FD05C059015D09013509013501058EFB
-7E038EFC720482024EFDFFB4018B018BB4FDFF00000200A0000003ED05EF001C00200069
-40470F221F2224140335184F024F034F0544185C0554186904691064187418741C0C0870
-090109061A1E161612341A02081F551E08202B1F1F061F7F0901090F1509172000010000
-172F332F5D1239ED2F5DED332FED003FED333FFD322F111239395D2F31305D015D011406
-070E01071523113E01373E013534262322060723353E013332160123353303ED46393892
-52B34197303A4099796CC1380A46D760D7F9FE75CCCC047362993B39642FE1013125582D
-346F56716F4423CC1B2BD1FAE2D3000200B0FF1E074E05EF0042004F00D640A206020F04
-0B050A090F1B0E1C0F3F0F4016021F041C051F1B1F1C142214271F3F1F4125022C042C05
-2F1B2F1C242220272F3F2F414740444856481D0A05052759496E09650D691A6821652766
-3F664174167B1B70277439743B0F120511081247520E1440151B371404044D53082D2D2A
-510E083D311E51313D020F2D012D051143122D144A123F0B010B0F512051021829140B37
-0F0020007F000300002429376B5010F6ED332F5D123939ED5D2F5DED2F33FD32322F5D00
-3F33ED2F123939ED332F2FED332FCD2B2FED331239392F31305D015D0114020721270E01
-23222635341233321617353311333E013534022726242322040706021514121716043332
-3637150E0123222427260235341237362433320417161201112E01232206151416333236
-074E514BFE481B4A8858A8C9F6AB4970419FF32A2B5B5858FEFCA5A0FEF75F606D685F63
-010A9D56B75461A859BAFEC2727380867474013EB5C401346A6A71FD8F3F64398192747B
-438602978BFEFC6B743C40FEE4E3010E212130FCB64BE159A4010C606067746262FEEF9A
-A5FEEF61656716188E150F7F72730142C3B9013F7575867C7070FEC5FE4002061D19B4A6
-A3A73E000002001A0000055E05D10007000A009840694009014A0645070209090A080287
-01010114000700090A0387040104140505067C067307020334300A400A700A030A090A06
-03017A050105080F0C0106070903050C002400390042005A006A0074000700006E0C0F0C
-010A052B0536054D05550565057B050705640B10E65D5D10F62F5D1217395D003F5D3C3F
-39392F5DED3130015D8710FD5DC0C0C08710FD5DC0C008C0015D005D2123032103230121
-130901055ED392FD7C92C9021E01087CFEFBFEFA019FFE6105D1FC7802DBFD25000300C8
-0000052B05D100150024003300524033050C150C270C550256157F190612112C341E1E07
-1D3408032D3407081615122C0F0F0725150071350F354035021E2C14076C3410F6FD325D
-10F6ED12392F1239ED003FED3FED12392FED39393130015D011406070E01232111213216
-171E0115140607151E01013426272E012B0111213236373E01133426272E012321112132
-36373E01052B544754C99BFDF001B9A3A24A524A6C5A97AEFEB324282F8663EC01005D6E
-2F2F277F3647308962FEC9010682A635383401CA6FAA37423805D118262B875E6A952D08
-1FCB0204364A171B0DFE52131E1E5FFD9A5A6A25190FFDD61B24276400010073FFE50546
-05EC002A0061404A05010D09061416011B0914152515361543145B08580A580E5B105B28
-600361147002760F70141316161A3412022A2A2634060A1600712C0F2C010F2C1F2C2F2C
-3F2C6F2C0520150C682B10F6ED5D5D10F63C003FED332F3FED332F3130015D250E01070E
-012322242726023534123736243332161715232E01232206070E01151416171E01333236
-373305463759483D8F56A2FEF762606C68625F010DA478EF920F7BF28A71B547454D5543
-46BB688FFA6D0E6C182A17131B5B615F0125C2B801226461663A49EB675E494D4BE5969D
-E2474A476262000200C8000005B205D1000E001D003A4027391249126902680D04163408
-03173407087600010F1500741F0F1F2F1F401F601F041714076C1E10F6ED5D10F6ED5D00
-3FED3FED3130015D011402070E01232111213204171612073426272E012B011133323637
-3E0105B2B19366FBCDFE880174DA01015998AACF7A7958C68ABABA8FD5596F6F02E7CBFE
-B65B3F3805D13F375FFEC4D6AFF0453227FB832A3947E800000100C80000049D05D1000B
-003B402309350006100602060601053502030A350108040008010800730D0F0D01060914
-016C0C10F6FD325D10F63C5D3C003FED3FED12392F71ED31302901112115211121152111
-21049DFC2B03D5FCF1030FFCF1030F05D1B0FE68B0FDD700000100C80000047F05D10009
-0034401E053502020701350803070800034F0B02030300640B0F0B01020514076C0A10F6
-FD325D10F4322F5D003F3FED12392FED313001211121152111231121047FFD0F0287FD79
-C603B70521FE5CB0FD3305D100010073FFE305A205EC00240069404907010906060E1D06
-130E210E350E4901410E510E6506650B630E740E741C0F223540230123230C0310101734
-0C021D34030A7609012210220910216C0075260F264026021A1509682510F6ED5D10F6ED
-3312392F2F5D003FED3FED332F1112392F5DED3130015D25060423222427260235100021
-32041715232E01272E01232200111000213236371121352105A27AFEDF87AEFEDE666770
-01A1016C7F010999121F763945AF6FFAFEDD0130010660BF48FE7102536E385360606101
-23C30165019D3D49EB184E1A1F29FEBFFEEEFEDFFEBF261E016DAE00000100C80000053B
-05D1000B003A4023033500081008020808050A070301050809021400780D0F0D400D500D
-03080314056C0C10F6FD325D10F6FD32003F3C3F3C12392F71ED31302123112111231133
-11211133053BC6FD19C6C602E7C602D9FD2705D1FDB8024800010089000002D505D1000B
-002E401909043206030A033201080D6D0A080B5A0A140305025A036D0C10F6F43210FDF4
-3210E6003FFD323FFD32313029013533112335211523113302D5FDB4C3C3024CC3C39804
-A19898FB5F000001002CFFEB02EA05D100150030401C6A017C01021233150307070B3403
-09131312140077170F170106651610E65D10F6ED332F003FFD322F3FED31305D01140623
-22262735331E01333236373E01351121352102EAEFC930A0360B29783F5C6D1A1B0FFEC5
-02010183C4D4110CB90E1E2A2728744C03659E00000100CD0000057505D1000B00A74075
-190956015C09030509280938094A0968098A09D809070F010A091E0119022A012B093901
-3909350B49014909450B5C01650B72007908100202038801C8010201B3000B000809B302
-0B0A030A840A010802050A07030105080B02030A0A0F0D20003000400004500001006E0D
-400D01080314056C0C10F6FD325D10F65D5D322F123939003F3C3F3C1239393130015D87
-10C0C07AFD1804C00187107AFD5D1808C0015D71722901010711231133110133010575FE
-FFFDB394C6C602D3F0FD6702979EFE0705D1FCF70309FD44000100C80000047605D10005
-002040110203043501080000070F07010414016C0610F6ED5D11332F003FED3F31302901
-113311210476FC52C602E805D1FADF00000100C8000005F605D1000C00794059560A0138
-023805360A6F0260036F05600A7F0270037F05700A0B5509560A5A0B0364037403750903
-050A020309000410043404440454046A04060404070B0903010708090A0B030502140078
-0E0F0E1F0E500E030513076C0D10F6ED5D10F6ED111739003F3C3F3C12392F5D12173931
-30015D72005D722123110123011123112109012105F6C6FE6276FE65B9010E018D018001
-130503FC970369FAFD05D1FCC3033D00000100C80000053805D10009006B404E0C071F07
-34074507510761077107077606010F0102061F0115063406440653066B0160067F017006
-0B0C010406025A01550602020701080603010408060102071300780B0F0B400B02021304
-6C0A10F6ED5D10F6FD113939003F3C3F3C12393931300172715D5D005D21230111231121
-0111330538F5FD3EB901330284B90534FACC05D1FB4004C000020073FFE105DA05F00017
-002300564042040004060B0C0B1217001706190C19125701570553075F0B580D58115F13
-53171076097915021B3415022134090A18150373250F25010F251F253F25031E150F6824
-10F6ED5D5D10F6ED003FED3FED5D3130015D011612151402070E01232224272602353412
-373624333216131000232200111000333200051E5B6163595CFBA19DFEFF5A5A61605C58
-01059AA0FF47FEFCE1E3FEFD0108DEDE0107052664FEDEB8B8FEDD6165666863630120B9
-B6012167626869FD610122013BFEC5FEDEFEDBFEC9013700000200C80000049605D10010
-001F0056403D3A143D1D4B144B1D500E540F650F071934000710070207070918340A0309
-080F211F21021115200030004000700004006F210F213F2102190714096C2010F6FD325D
-10F45DED5D003F3FED12392F5DED3130015D011406070E012B01112311213216171E0107
-3426272E012B0111333236373E010496453E4DD2A0C6C6019486BA48555DCE3637307B5E
-C4A778962F2F27040F63A93E4D4DFDD505D12D3039AA874D72241F1BFDAD2B2F306A0002
-0073FE7705F805F000250031008640610B0C0B120418041D190C19121518161D5C0B590D
-59115C1353175719571D742010551F651F751D742D0425252135030B29341E0609760979
-150215022F34090A1E130600337326151B0009061D030F1B73330F33010F331F333F3303
-2C150F683210F6ED5D5D10E61117393210EDE62F2FED003FED3F5D123939ED3FFD322F31
-305D015D010E01232226270E01232224272602353412373624333216171612151002071E
-01333236373303100023220011100033320005F83C753DAED309182D159DFEFF5A5A6160
-5C5801059AA0FF595B61DFBC0464842971181BECFEFCE1E3FEFD0108DEDE0107FE930F0D
-BFB204036863630120B9B60121676268696164FEDEB8FEEFFE8A4B727E190A039F012201
-3BFEC5FEDEFEDBFEC9013700000200C80000059805D10010001F007A405408011D012D01
-3A01391D450F4814481D5A01560F59146F016902600A650B7E01750B110201B300100010
-071A34400201020205183407030105080F211F2140210311150F0D010D0D102000010019
-031400056C2010F632FD322F5D39392F5DED5D003F3C3FED12392F5DED12393130018710
-7AFD18C0015D29010121112311213216171E0115140607133426272E012B011133323637
-3E010598FEFFFE0EFEE9C601A187B448515BA28E612D342B7650E9C85E8C312D2B0250FD
-B005D1232D339B77A1D93701A34063221D17FDCE212D2A6D00010086FFE5050205EC0030
-009A40790B09031F00231B08141F29082818241F242F390836103813351F362A4A084510
-4913451F4A27442A5802551B551F552D6B19661B651F662B602F7B16701F7020742A742D
-86122309400E103708400E103700111A28041D06212125341D020A0A0E34060A2128151A
-111500211A090074320F32703202096A3110E65D10E611393910ED2FED2F003FED332F3F
-ED332F1112173931302B2B5D011406070E012322242735331604333236353426272E0127
-2E013534243332041715232624232206151416171E01171E010502514950D596A1FEFF85
-0E71012882B8CD61634BAF62C6BF013CF39D0106650E55FEEB919FC1607940EC52A6A801
-A957AA3B40483C3BF85E668A73635E1A141A142ACBA3BBEF3C2CEA485F84685D6A1C0E28
-152CB20000010000000004EE05D1000700274018010435060303080F091F094F0903005B
-0114045B4F0501052F5DF4FDE45D003F3FFD323130012111231121352104EEFDECC6FDEC
-04EE0521FADF0521B000000100B2FFE1052905D1001D003A4029231223183D033D094C03
-4C0977137717081C0D031534060A1B1400761F0F1F1F1F401F030F140C6B1E10F6ED5D10
-F6ED003FED3F3C31305D011406070E01232226272E01351133111416171E01333236373E
-01351133052947514DCE898CD0475147C621272C976A6B962D2721C60256A2F1504C464A
-4852E8A9037BFC7B798C394142414239936D038A0001001A0000055E05D10006008C4066
-470148020205040507065706860603061400000105070457048604030414030203080144
-014B02580273017C02060005027503010303020845004A0302020103040024003A005A00
-6A00740006006E080F08010F08010B032B033503550365037B030603640710E65D5D5D10
-F65D1139395D003F3F5D1239393130015D8710FD5DC08710FD5D08C0015D090121013309
-01055EFDE2FEF8FDE2D401D301D305D1FA2F05D1FAE2051E0001005C0000078D05D1000C
-00BB409E470367037903030D010B020404020505080C0B1701190318051908190B290329
-08290B3B023903320434083C09330A3A0B4B02440444084C09430A4B0B55015A0255045A
-0557075909550A65016A0265046A056A09650A7F02700473087C09720A7C0B2E0C140001
-000714060506030301000300090205080B03090C0602060302083B0034064B0044067A00
-75060600720E1F0E3F0E5F0E7F0E0406670D10EE5D10E65D003F3F1217395D5D31300187
-10FD8710FD015D005D09012309012301330901330901078DFE7DDFFEC7FECEDAFE76CB01
-390134C90137013705D1FA2F04D4FB2C05D1FB2A04D6FB1E04E2000100440000053805D1
-000B00C2409775017A07020A04050A1A04150A2C04230A37094D04420A58035F04580557
-09500A570B68036D0468056709600A670B7B04730A170B14000100091408070803140201
-020514060607050407010A0B0602080302080F0D01060216022602360247020509081908
-290839084808050208070A04010406020D00160026003600470050000600660D08090619
-062906390648065F060606660C10F65D3210F65D321117392F2F5D5D5D003F3F12173931
-30018710ED8710ED8710ED8710ED005D015D09022309012309013309010538FDFE0201E5
-FE6AFE60D80207FE05E40191019A05D1FD20FD0F0265FD9B02E802E9FDA3025D00010006
-000004E605D10008007C405D2C012C04280735074001400440075007680470070A160619
-08270628085606590865066A08080814000100061405040502000D050200010004000703
-040107080402050302080F0A1F0A4F0A7F0A04005B01070114045B4F057F0502052F5DF4
-ED3910E45D003F3F1217395D3130015D8710ED8710ED015D005D09011123110133090104
-E6FDF4C6FDF2DB0197019B05D1FCBCFD7302780359FD66029A000001007E0000050805D1
-000900594036030708060813082608360846085608660876080808B30202030707033506
-03020208350108040803020707040209730B0F0B0102690A10E65D10E61139392F123939
-2F003FFD322F3FFD322F31300187107AED5D1887C0290135012135211501210508FB7603
-91FC910452FC6603B0B80469B0B3FB92000100EFFE7802F706140007001C400E05520201
-0652010B030000061F012FED332F3C003FED3FED3130012111211521112102F7FDF80208
-FEA6015AFE78079C8FF9820000010046FED003C006140003003A40280301020A0119012A
-0138014B01590168017801890109011200032F000100030100006002700202022F5D332F
-003F2F5D31300187ED5D87C00123013303C0ADFD33B0FED00744000100ABFE7802B30614
-0007001C400E045207010352010B031F000005012F3C332FED003FED3FED313001213521
-1121352102B3FDF8015AFEA60208FE788F067E8F000100BA02AA05D205D1000600474034
-3B0133034B0145035F0150036F0160037F0170030A69027B02020102050F031F033F035F
-036F0305030305030000004F000200042F335D2F003F332F5D12393931305D015D012309
-0123013305D2C6FE39FE3AC5024D7E02AC0273FD8B0327000001FFFCFED4051AFF4C0003
-0011B6015002000005022F11332F002FED313001213521051AFAE2051EFED47800010154
-051602FA068C000300244016480159026902790204500360037003030303010000022F33
-2F002F332F5D3130015D0123013302FA95FEEFF30516017600020068FFE1041D04780026
-0033007A40540C0A0423190A152304590E511E5C2C690E601D6F2D7B0A7A14701D7B2C0A
-0208283D3011401102111120084F1C011C1C183F20043141080A01080F1D011D1127021A
-001D0B0091350F351F353F35032E1B0B853410F6ED5D10E6113910FD32322F5D003F3FED
-3FED332F5D1112392F5DED123931305D015D2123350E01070E0123222635343637362437
-353426272E012322060723353E01333216171E011503110E01070E01151416333236041D
-BB1955282F7A5297D26D6566011EA42D2A28703D4AB6610A37D06576AF403F42BB56E944
-5164747763A477113D12171FC89B7F9D2D2D20081D40541817102725BF0F24272F2E926C
-FE1D013705141317615560614D00000200B9FFE10490061400130020005140393402350F
-3B1530204402450F4B154020571267127F087B1C0C0E0906174211040C011E40060A0B08
-141B0090221F223F22020E1B091A0C882110F6FD32325D10F4ED003F3FED3F3FED123939
-31305D011406070E012322262707231133113E0133321203342623220607111E01333236
-04904F4347AA665F8E450CB0BC4FB26FC6E5C2849352A8485073499CB102378CE04C4F4F
-2D26340614FDD44153FED0FEE6C8CF4738FD80241CCD00010069FFE703F3047700210057
-40410F234F23022B01220E2A1624183A01350E3A16351849014F0A440E4F164118590155
-0E6901650E7A01730E131010143F0C0421211A3F03090F008D23171B09852210F6ED10F6
-3C003FED332F3FED332F31305D015D250E01232226272E013510003332161715232E0123
-2206151416333236373E01373303F35EA95F79CA484950012DF760B94D0A56B757A0B9B5
-A439762F2948150A462D32474848DC93011201383627D14348D7D0CAD91E18152F110002
-006CFFE10443061400130020004B40333C1A301C38204F1A421C48205806680670100912
-0102110518410E0401081E42050A1114021A0092221F223F22021B1B08852110F6ED5D10
-F6FD3232003FED3F3FED1239393F31305D2123350E01232202113436373E013332161711
-3303112E012322061514163332360443BC51B067C8EB514544B56158884BBCBC4C78479E
-B0889650A475464E013401118EDE4E4C50252701E4FAFF0281221ADCCAC7CF470002006A
-FFE60460047C0018001F005A404026042B0D30043B0D3C1E43044B0D4B1E5A0D50166A0D
-6017780D7A1E0E013C1F1F0F1C3D15040B0B073F0F090C0C191A008F210F211F213F2103
-1F011B12852010F6FD325D10F4ED332F003FED332F3FED12392FED31305D01211416171E
-013332363733150E0123200011100033321215272E01232206070460FCC93E36348F5672
-E7310A5FC66DFEEAFEC8012BF4E2F5B701939697B30C021B67993130305B2CCD2836012D
-011501120142FEF8F32A94A2B2840001004400000312061E0018004B402D081439147505
-030000043F15000B0E3E0811050D080009400902090F090E00080B1A0F11000E400D1037
-0E891910F62B323232FD322F12392F2F5D003F3F33FD323FFD322F3130015D01232E0123
-22061D012115211123112335333534363332161703120A1F6426796D0153FEB3BC7F7FC6
-BB3F652A055E09136B8C269EFC4103BF9E25C7D50C080002006CFE590443047C00230030
-006E404E3D133E2A322C3A3044094B134C2A422C4B305B015D055A166A016C056A167C05
-702011220512211528401E0407070B40030D2E4115070F0601062124121A000618009232
-1F323F32022B1B18853110F4ED5D10E4113910FD32322F5D003FED3FED332F3FED123939
-3F31305D2510002122262735331E01333236373E013D010E01232202113436373E013332
-1617373303112E012322061514163332360443FEFEFEF459A9520A2EC864607E23231E55
-9B78C8EB514641BA5C6183490CB0BC4B81409BB2849952A57FFEE4FEF61917C012352E29
-276E446644430121010790D14C474F272830FCD60261221DD0C6BCC23F00000100B90000
-045F061400160037402203151615751503100D084213040E01010D08021A0091181F1860
-1802100B1A0D881710F6FD325D10F6ED003F3C3F3FED123931305D2123113426272E0123
-22060711231133113E0133321615045FBC1218195E4B4DA84DBCBC58BC63B5BE027C4D87
-262A294C3BFCBE0614FDCD4952DACD00000200AF0000018305DB000300070030401E0144
-02400B0D370203060505087F090109920060041A01607F050105880810F65DE4FDE4E65D
-003F3F3F2BED313001233533032311330183D4D40CBCBC0518C3FA25045D0002FFC2FE59
-021505DB000300190049402E0A051C0502014402400B0D370203163E19050B0B0F40070D
-4F1701177F0A010A0160161A00600A1770190119921B10F65D3232E4FDE42F5D2F5D003F
-FD322F3FED3F2BED31305D012335330314062322262735331E01333236373E0135112335
-210215D4D40CC8A828832C0A1C5F2D485816160DE901A50518C3FA0AC4C8100CB30B1C28
-2828715103849E00000100C1000004AF0614000B007D40512802D801DB090309010F0D1F
-011D021F0D2D012F0D300B400B540B69027A010C020203011A000B000809B4020B0A030A
-0802050A0507010105080B02600A700A020A0A00000D200D400D0208031A05890C10F6FD
-325D11332F332F5D3939003F3C3F3F1239393130018710C0C07AF51804C0018710FD08C0
-015D7121230107112311331101330104AFF8FE407ABCBC021FEDFDF901E974FE8B0614FC
-1A022FFDFC00000100BB0000017706140003001E4011020101087F05010592001A7F0101
-01880410F65DFDE65D003F3F3130212311330177BCBC0614000100B900000717047C002B
-006A4048032403291324132944204426B72A07B62501251F1D1C0817422822041D050110
-1C08402D011F2D302D402D502D702D05001A016110250B1C0F1A101F1A1A1C611F104010
-801003102F5DF4FD3210FD11393910F4ED5D5D003F3C3C3F3F3CFD32111239395D31305D
-2123113426272E01232206071E01151123113426272E012322060711231133153E013332
-16173E01333216150717BC0D151756514F9E4F0304BC0D151756514D9B4DBCBC58AF6372
-9F2772BC6BB8AF027C4886282B2C4F3D173D1EFD35027C4A85282B2B4C3BFCBE045D7C49
-5260556055DFC800000100B90000045F047C00160037402203151615751503100D084213
-040E05010D08021A0091181F18601802100B1A0D881710F6FD325D10F6ED003F3C3F3FED
-123931305D2123113426272E012322060711231133153E0133321615045FBC1218195E4B
-4DA84DBCBC58BC63B5BE027C4D87262A294C3BFCBE045D7C4952DACD0002006AFFE10471
-047C000B0017003E402C3B0E341034143B164B0E441044144B16080F3F0904153F030A0C
-1B0090190F191F193F196F1904121B06851810F6ED5D10F6ED003FED3FED3130015D0110
-002322001110003332000334262322061514163332360471FEE8EBEDFEE90117EDEB0118
-C2AA9799A9AA9896AB022EFEEFFEC4013C01110111013DFEC3FEEFD9D3D3D9D2D9D70002
-00B9FE640490047C00130020004D4035320239153220430249154220561267127E087C1C
-0A0E0906174211040C051E4006090B0C141B0090221F223F22020E1B091A0C882110F6FD
-32325D10F4ED003F3FED3F3FED12393931305D011406070E012322262711231133153E01
-33321203342623220607111E0133323604904E4742B364578D49BCBC4BBB6ACAE1C28A8F
-51A44B5073499DB0023C88E14E4A512628FE2C05F9753F55FECFFEECCAC84639FD87241A
-D4000002006CFE640443047C00130020004B40333B033D1A301C3A204C034B1A461C4A20
-701009120502110418400E04010C1E4205091114021A0092221F223F22021B1B08852110
-F6ED5D10F4FD3232003FED3F3FED1239393F31305D0123110E01232202113436373E0133
-321617373303112E012322061514163332360443BC57AC64C7ED534442B2635A8B480CB0
-BC4E7846A3AA899352A4FE64021A4B490133010E90DD4B4950282730FCBF0278231CDDC2
-C4D34700000100B900000372045D001200384021000D100D200D030C090F000004430A0F
-05090800001440147014020C071A09881310F6FD325D11332F003F3F3CFD322F11123931
-305D01232E012322060711231133153E013332161703720A2A4F3657A24BBCBC70AB5931
-2C2C03900A094D3DFCE7045DA55A4B0507000001006EFFE503D704780033009340710602
-091B1502191B26092A2432093C2442094C245E055D165321562F54326F056C166020642F
-6532147A057F1174207928742B8A01880D851A872894019A1B0B000E1829041E03802201
-2222263E1E0407070B3E030921291B180E1B00211807008E350F351F353F355F357F3505
-07863410E65D10E611393910ED2FED2F003FED332F3FED332F5D1112173931305D015D01
-14062322262735331E0133323635342726272E01272E01353436373E013332161715232E
-0123220615141716171E011716171603D7FDDB7CCF460A59DA647C8C26266C288135937B
-393A38AD6B64CD440A48CE63678E2B2A5E34812B834747014299C43B23D3434F50564222
-221809180E27976E457A302F373123C935494F4E452323160C180A1E494A0001003EFFEA
-02FD059E001B0048402C0C051A052B05030B10073E0D0B0A051B1B173F03094F1D7F1D02
-0E008C1D080D101A0A0807400D103707881C10F62B3232FD322F10F6325D003FFD322F3F
-3333FD322F31305D250E012322263511233533113311211521111416171E013332363733
-02FD357D31ABB27F7FBC0184FE7C0818164D4F2E64160A0A0E12B8CB02529E0141FEBF9E
-FE0358632B28251B0900000100B1FFE10457045D0016003740220B0619077A0703020515
-09051142050A010814021A0092181F186018020B1A08871710F6ED5D10F6FD32003F3FED
-3F3C123931305D2123350E01232226351133111416171E013332363711330457BC5FAE69
-B0C4BC101A1B565249AD4BBC7C4B50D7D002D5FD8455792B2C284C3B03420001003D0000
-047F045D000600864041260429063604390646044906062905390540055105600505061A
-000100041A03020328002703380037034A00470375017A02080005027503010305020802
-010300B8FFC0401E0910370C001C006A007A0004008D080F080103031303650375030403
-820710E65D5D10F45D2B113939003F3F5D1239393130015D8710FD8710FD005D015D0901
-2301330901047FFE3CBDFE3FCC015A0157045DFBA3045DFC870379000001005600000636
-045D000C0088406D0D031D032C012A0229032504260524082B0B34013B0544014B055701
-58045905570B6D02620464086A09640A6B0B79017D02720474087B09730A7A0B1E0C1A00
-0100071A060506000910090205080B03090C0602060502080F061F062F0603008E0E100E
-3F0E6F0E030006830D10F6325D10E65D003F3F1217395D3130018710FD8710FD015D0901
-23090123013313013301130636FEDDAEFEE1FEE3ADFEDAC4CD01179B011EC2045DFBA303
-5DFCA3045DFC9F0361FC9F0361000001003C00000480045D000B00DA408C090B1B011403
-14071B09270327073C003B0134033404340634073B093D0A4C004B014403440444064407
-4B094D0A5A0155035A0555075A09550B6F016003690560076F09660B230F0200083F0230
-084F0240087D02700808091A0A0B0A071A060506011A000B00031A0405040102050B0809
-06047A047506020605040809060106020D010502080B04040A00B8FFC0401C0910370600
-01008D0D0F0D010F0D1F0D400D5F0D040602040104820C10F65D325D5D10F65D2B321117
-395D2F5D003F3F5D1217393130018710ED8710ED8710ED8710ED005D015D212309012309
-0133090133010480EDFEC3FEC1DB01B4FE50ED013B013CDCFE4901ADFE53022D0230FE5A
-01A6FDDA0001003DFE64047F045D0007008C404104063406440650066006700606090307
-0519031705460149035800570179030902071A000100051A040304490046040200030204
-05020C02680101010203030400B8FFC040220910370C001C004A006A007A0005008D090F
-0901030413044504650475040504820810E45D5D10F65D2B1117395D2F003F3F12393931
-30015D8710FD8710FDC0015D005D0901231301330901047FFD74C9D0FE43CC0157015A04
-5DFA0701D20427FCC4033C000001005D000003E3045D00090056403A15083A0335084A03
-45085C03540860087F0370080A0707033E06050202083E01080408030207070402098E0B
-1F0B3F0B5F0B6F0B7F0B0502840A10E65D10E41139392F1239392F003FFD322F3FFD322F
-3130015D2901350121352115012103E3FC7A028BFD830367FD72029F8B03359D86FCC800
-000100ADFE78045906140025005640382F1D3A074A07562367237523063A1D4A1D021D1C
-09533F0A4F0A020A0A01145112012451010B140F00400002000919201F0E000940050105
-2F5D33333CFD3C2F2F5D3C003FED3FED12392F5DFD39395D3130015D012322263D013426
-2B01353332363D0134363B01152322061D01140607151E011D0114163B01045996B3DFA6
-AB3333ABA6DFB39672887B9A89899A7B8872FE78C7BC95A9BF9CBFA995BCC78A7E8CAF8B
-BD371837BD8BAF8C7E000001017AFE78022806140003001B400F0F054F05020201010B00
-1F4F0101012F5DED003F3F3130015D012311330228AEAEFE78079C00000100BBFE780467
-0614002500544034211235023112400240127A0C06131200533F254F25022525091B511C
-010A51090B1B0009010900170E1F050509004F200120202710D62F5D33333C10FD3C2F2F
-5D3C003FED3FED12392F5DFD39393130015D012322061D0114062B01353332363D013436
-37352E013D0134262B01353332161D0114163B01046733ABA6DFB39672887B9A89899A7B
-887296B3DFA6AB3301F8BFA995BCC78A7E8CAF8BBD371837BD8BAF8C7E8AC7BC95A9BF00
-000100BB018B05D1039F001F0056404206030609091309191908170A1518191A3B083418
-4B0844185A035A0A550D541B5B1D60056E14611875047A147518170F1C54060C54061F16
-1F2A000001000F2A00102F33ED2F5DED002F3333ED2FED333130015D010E01070E012322
-26272E0123220607233E01373E01333216171E013332363705D102292D2E82645E925466
-5C325E6409A702292C2B8A605D935550663D676103039F63C04B4D584F667D40AFC464BD
-4D4A5B4D68625BCAA900FFFF001A0000055E07500236002400000117008E002F0175001A
-40130320113011401170118011050200110E060725012B355D350003001A0000055E0801
-0012001E002100DF40442B2040205A18551A501E55206918651A651E09180B170D4A0646
-125906561278027703082020211F02870101011400120020210387040104140505067B06
-74120216510CB8FFC0405D0D10370C033470210121212006120405001C011C0301050813
-114F0F500F600F030F191140095F096F0903090F230106090F1204050C00240039004200
-5A006A0074000700006E230F23010A052B0536054D05550565057B050705642210E65D5D
-10F62F5D1217395D2F5DED2F5DED003F3C3F5D1217392F5DED2F2BED3130015D8710FD5D
-C0C0C08710FD5DC0C008C0015D005D212303210323012E01353436333216151406071334
-26232206151416333236130901055ED394FD8094C90207596BCC9293CB69592C72565672
-7355567236FEFEFEFD019FFE61057F2C9F668FC2C28F64A32A012F56737455567373FBF1
-02CBFD3500010073FE59054605EC00410097406F0A20032B1C20152B250B222B3402330B
-342B4302430B452B5D1F582158255A275E3F6102602B70027626702B160B0B1B0B022D2D
-313429021A061D41413D341D0A101014320C0D0F0F172A0009100920090309091D234371
-2C0071430F43010F431F432F433F436F4305371523684210F6ED5D5D10F43CE41239392F
-5DED332F003FFD322F3FED332F1239393FED332F31305D015D250E01070E01071E011514
-062322262735331E01333236353426270E01232224272602353412373624333216171523
-2E01232206070E01151416171E01333236373305463759480B1A120203BB9326772D091A
-5B326A620202132B12A2FEF762606C68625F010DA478EF920F7BF28A71B547454D554346
-BB688FFA6D0E6C182A17030903133317A2AC0E0CA20A1C5056132D1402025B615F0125C2
-B801226461663A49EB675E494D4BE5969DE2474A47626200FFFF00C80000049D08010236
-002800000117008D001E0175000BB601000D0D020325012B3500FFFF00C80000053807C8
-023600310000011700D7008C0175000BB60100170A050925012B3500FFFF0070FFE105D7
-075002360032FD000117008E009601750018401103002930295029702904020029240F03
-25012B355D35FFFF00B2FFE1052907500236003800000117008E00620175001840110210
-24202440246024040100241E0D1D25012B355D35FFFF0068FFE1041D068C023600440000
-0116008DE300000BB6020036371D2625012B3500FFFF0068FFE1041D068C023600440000
-01160043E800000BB6020035371D2325012B3500FFFF0068FFE1041D068C023600440000
-011600D6E000000BB6020038341D2625012B3500FFFF0068FFE1041D05DB023600440000
-0116008EE000001E4016030F39703902020039103920394039040039341D2625012B5D35
-5D35FFFF0068FFE1041D0653023600440000011600D7E200000BB6020041341D2525012B
-3500FFFF0068FFE1041D07B1023600440000011600DBD300000DB70302003A341D262501
-2B35350000010069FE5903F3047700380080405B0F3A4F3A022A012A0726252A2D252F3B
-01390735253B2D342F4B014F2140254F2D402F590153256C0166257A017525150B081B08
-0227272B3F230417031A3838313F1A090D0D113D090D0C0C142A06061A2026008D3A2E1B
-20853910F6ED10F63C1139392FED332F003FFD322F3FED332F1239393FED332F31305D5D
-015D250E01071E011514062322262735331E01333236353426270E01232226272E013510
-003332161715232E01232206151416333236373E01373303F3214D1D0305B79225742D09
-1A583268620302101D1979CA484950012DF760B94D0A56B757A0B9B5A439762F2948150A
-460F1F0913391CA2AC0E0CA00A1A4E58162E140204474848DC93011201383627D14348D7
-D0CAD91E18152F11FFFF006AFFE60460068C0236004800000116008DFD00000BB6020022
-21121825012B3500FFFF006AFFE60460068C02360048000001160043FD00000BB6020021
-20121825012B3500FFFF006AFFE60460068C023600480000011600D6F900000BB6020024
-20120025012B3500FFFF006AFFE6046005DB0236004800000116008EF9000014400D0330
-2560250202002520120025012B355D35FFFF00A000000246068C023600D500000117008D
-FE830000000BB601000505020325012B3500FFFFFFEB00000191068C023600D500000117
-0043FE970000000BB601000505020325012B35000002FFF50000023C068C0006000A003D
-40247A0174037A057406040201030505030905080800047F0C01000C92071A047F080108
-880B10FD5D32FDE4335D2F2F003F3F2F332F1239393130015D01230B0123133303231133
-023C978F8E93B2E313BCBC0511010BFEF5017BF974045D00000300050000022D05DB0003
-0007000B0041402702010744600401040A050908011A7F000100041A700501057F0D0100
-0D92081A057F090109880C10F65D32FDE4335D2F5DED2F5DED003F3F2F5DED3939313001
-2335330523353313231133022DBDBDFE95BDBDB5BCBC0518C3C3C3FA25045D00FFFF00B9
-0000045F0653023600510000011600D70700000BB6010024170E1525012B3500FFFF006A
-FFE10471068C0236005200000116008DE200000BB602001919060025012B3500FFFF006A
-FFE10471068C02360052000001160043E200000BB602001919060025012B3500FFFF006A
-FFE10471068C023600520000011600D6E200000BB602001C18060025012B3500FFFF006A
-FFE1047105DB0236005200000116008EE2000014400D03301D501D0202001D1806002501
-2B355D35FFFF006AFFE104710653023600520000011600D7E200000BB602002518060025
-012B3500FFFF00B1FFE10457068C0236005800000116008DEE00000BB601001918101225
-012B3500FFFF00B1FFE10457068C023600580000011600430200000BB601001818091625
-012B3500FFFF00B1FFE10457068C023600580000011600D6F800000BB601001B17091625
-012B3500FFFF00B1FFE1045705DB0236005800000116008EFD000016400F02301C501C60
-1C0301001C17091625012B355D35000100BB0087045B0614000B003C4026070A0B000104
-0605AA0606080308010F0D1F0D02006302040708090A010602280563700301032F5DE6ED
-173910E65D003F2F12392FED17393130012513231305350503330325045BFE6D058405FE
-6D01930584050193040A05FC780388058105018EFE7205000002009A02CC03BC05EC000B
-0017002840186A0F65157A0F751504155403030F5409020C2A0000122A062FED332FED00
-3FED332FED5D313001140623222635343633321607342623220615141633323603BCE8A9
-A9E8E8A9AAE7A58666668689636686045CA8E8E7A9A8E8E8A8668B8B6668898C0002009F
-FE97046005C3001C0023007B40553C0A3F2030224B0A4F2040225A0153116C0164117901
-7611791F76230E1D1E180D3F134F130213130D1747060C030F0505201C301C401C031C18
-471C05030F251F2502130021202F090109001D0C0F1804031E09062F33ED1739322F5DED
-2F3C5D002F3333ED2F5D2F3F123939ED33332F5D2F11393931305D250E01071123112600
-353400371133111E011715232E0127113E01373305110E01151416046047B46876E3FEFB
-010BDD7668BA410B37AE7378AD330BFE2787A2984A1E2F03FE9D0167150120FAF2012B16
-0163FEA1032C1FCB2C5209FCB90A552985034214D2BDB5D2000100890000048B05EE0021
-00774050201D3415321D03031E151E251E410E530E5B16630E7302730E091B1805460F08
-1F084F0803081010144908010C0202204A01080F231F23021F02181B20080519060F0605
-190F040220004000020000022F332F5D1217392F2F2F2F33FD3211395D003FFD323F1239
-ED332F2F5DED393931305D015D2901353E01352335331134123332161715232E01232206
-1511211521151406071521048BFBFE7667B0B0FDCD6998400A3E98568C8B019FFE617C62
-0345CF20BDB98A0136C801012211CE2A30A590FEDD8A3D7EBB390B00000200ACFE7F0468
-05EF0043006100A9407F05050A2714051D273E2030424D104F20433240425C105E165132
-63096E106A2B63321152055F205F255F275B2D5B3950426B1F6A20653D654061427C097C
-10742B7431107B50745F0218075F50293A062F0D3333373F2F021111153F0F0D1F0D020D
-181B5F045607333A1B50262911471A1129330704221000010000561A222FED332F5D1217
-39ED2F2F3939ED2F2F123939ED002F5DFD322F3FFD322F111217395D31305D015D011406
-07151E01151406070E012322262735331E01333236353426272E01272627263534363735
-2E01353436373E013332161715232E01232206151416171E0117161716033E0135342627
-2E01272E01270E01070E01151416171E01171E01173E01046876636158424148C27C57A7
-5C0A4FB46C86A2272D299052D6525372666554404340C78057A85B0A3ABD797FA92B2B2B
-845BC85A59F71C1E211D1C4E2C275D46123E1618261F1D1B512C266043144202596AA237
-072E915A4D8A3238361B1FC2253261573841191725143451518162A93907309259518334
-323A1C1DC21B3C5C573947171725152E4F4FFEAB21413A334617181F0C0B1514092D181A
-563132461817200B0A18130B2F00000100B9012103A4040B000B0013B703030900000688
-0C10F6322F002F332F313001140623222635343633321603A4DC9A9ADBDB9A9ADC02969A
-DBDB9A9ADBDB00010089FE95045205D1000D003B40245308610802010F0501054F060106
-0602AA0C030F0F1F0F020529040402290F0D010D0D092F332F5DED332FED5D003FED332F
-5D2F5D3C31305D012311231123112E013534243321045294D695CEFC0104F301D2FE9506
-BAF94603BC05F8CCCFE8000100B9FFE8048D061E0036006D4048052E152E2E132C343913
-39343736490E4636532166217B1B0C3433143D151E3C15032D0007070B3D03092608181B
-303400140C061C060206111B000614300325009038251A26883710F6ED10E611173910ED
-2F5D2F12392FED003F3FFD322F3F1239ED2FED39393130015D0114002322262735331E01
-333236373E0135342623353236353426272E01232206070E01151123113436373E013332
-1615140607151E01048DFEF1DB2C73240A2A63384A6E21231FD3C69D9A161E1B583D395C
-28252DBC48403CB35EB7E58E71A4BE01E1D6FEDD0F0DA518123A31347F4CA6A996778123
-421F1D231D2724845FFBC104387CB73E3A3BAE9770B2200925DF0004009FFF2E076105F0
-000B00170028003700AD407A7C0D7C11701370177A1A74277336070D1A04231E1A122314
-282C0E231022142C16211824233F1936234919472252186B0E641064146B166A19151A19
-2A182818292A25252818311B2A001D101D4F1D0318001D01901D011D0CAD1D06000012AD
-06281AAA31311E19401D011D30AA1E15501D1E0903030F500902003FED332F123939ED2F
-ED2F5D3C12392FED39012FED332F1239ED2F5D71335DFD3C2F39392FED8710FDC0313001
-5D005D011000212000111000212000031000212000111000212000072301231123112132
-16171E0115140607373426272E012B0111333236373E010761FE05FE9AFE9AFE0501FB01
-66016601FB74FE49FECAFECAFE4901B70136013601B7C0DFFEB5A2A501385E7A3B3F3B71
-63201C211F4635957F3E5A1D1F19028FFE9AFE0501FB0166016601FBFE05FE9A013601BC
-FE44FECAFECAFE4401BC820163FE9D0393101F226149618126FD243812110AFECB131719
-3C000003009FFF2E076105F0000B001700330096406D7C0D7C117013701779197223062C
-0E231022142C1633183324332A332E44184124442A442E54185424542A542E6B0E641064
-146B1662186A1D642417257F1801182C2A181E0CAD1E06000012AD06103320330233332F
-521B1F252F2502252529522115501B210903030F500902003FED332F123939ED2FFD322F
-5D2FFD322F5D012FED332F1239ED2F33ED2F5D3C3130015D005D01100021200011100021
-2000031000212000111000212000050E012322243534003332161715232E012322061514
-1633323637330761FE05FE9AFE9AFE0501FB0166016601FB74FE49FECAFECAFE4901B701
-36013601B7FE72569F4EE3FEF8010DDE59AC3E1036A9598E9F9994539D4810028FFE9AFE
-0501FB0166016601FBFE05FE9A013601BCFE44FECAFECAFE4401BC572727F6EAE1010230
-1CB52846ABA59FAE3A34000200AA031106F105D1000E0016005240217B0478057A060379
-0C010B0C0D01030406080815121210135015030D280B0F370BB8FFC440110B0F37022800
-000728090FAE102814AE132FE4FDE42FED332FED2B2B003FFD3C332F1217395D3130005D
-0123112303230323112311331B0133052311231123352106F17C14ED4FEF197BEEBFBFE3
-FC02E57FE5024903110269FE3D01CAFD9002C0FE82017E75FDB5024B75000001021D0516
-03C3068C000300244016470156006600760004500360037003030303010000022F332F00
-2F332F5D3130015D0901231303C3FEEF95B3068CFE8A01760002015A051803BE05DB0003
-000700264015020644016005010500140F010101041401000501052F5D33ED2F5DED002F
-5D3CFD3C3130012335330523353303BEC7C7FE63C7C70518C3C3C300000100F5001B0597
-04FD0013008840541612010C0B080704030E111201020D80029002A002B0020402290303
-0C030D030112045307110E08530D070F0B010B40150130154015020407080B0112110E08
-030D0309030D1004062F004000020000400601062F5D332F5D1217392F2F1217395D5D00
-2F5D3333ED39392FED3939322F2F3130018710FD5D87C0C0C0C010C0C0C0C0C0015D0121
-0323132135211321352113330321152103210597FDA0689968FE5701DA54FDD2025E6999
-6901ABFE2453022F016AFEB1014F9C010C9C014FFEB19CFEF4000002000E0000076D05D1
-000F00130079404F04030B061B041B052A042B053B064A044A054D064D120B1213030414
-05050675057C06020A100E140115730601080B0440000100000F05010564140334130D35
-0A0A13050835123406030E35010508003F3CED3FEDED1239392FED2FED300110F65D322F
-5D1739E62FED393931305D8710FDC0C0C0015D2901112103230121152111211521112101
-112303076DFC50FDF4D4CF0252050DFD1302EDFD1302EDFC50DBEF022CFDD405D1B0FE68
-B0FDD702230259FDA70000030073FF6E05DA064B001D002A003700A640850203000B0A0D
-0C120F1A051C1103190D1F121F1A151C550254045A08590D59115B135017551C792A140B
-090318061B1F0A1F0B1118161B2609272F75037F097F0A7F0B7F0C791270187019701A70
-1B132A2F1E2E043221340C09181B040615023234060A2A2F1E2E04272B15000C09181B04
-0F0073390F39010F391F393F390327150F683810F6ED5D5D10E411173910ED111739003F
-ED3F121739FD11173931305D015D011402070E0123222627072313260235341237362433
-3216173733031612012E01232206070E011514161701342627011E01333236373E0105DA
-63595CFBA173C94F9F84CD656D605C5801059A76C2528E84BC656FFE6F3990596EB44240
-453B3A035C3C3AFD683C91596EB73E434202E8B8FEDD6165663A37E4012664012CC4B601
-216762683737C9FEF464FED7013A2E2D4D4E4CE5938CE04C01B88BE44BFC432D2E504C52
-E100000300A1009D075F047C00170026003500724054051608311526192F2923262C3B34
-441C4B34510256075F0A5F0E5A1351165918553063026D0A631669236C24642C642D1821
-AF33AF0306120F09092AAF1BAF150F7B18743002272A0030180C0099371E2A0C993610F6
-ED10E411393910ED5D002F3CEDED332F1239393CEDED3130015D011402232226270E0123
-2202353412333216173E01333212052E01232206151416333236373E0125342623220607
-0E01071E01333236075FF5CF85DE454FD38FBFE2FACA86DE444FD58DBFE2FC683FB8608A
-9C7F776E7C392225030C807658814A1E33133CBB608A9C0297EFFEF599929794010FD6EE
-010C9A919695FEF1947575A79A85A6615E39470186A5477830672C7377A6000100D700B3
-05B505B6000F004540290E03540F010101010D045408AC0A070C401101301140110200AB
-0A800D010D2A040105AB07400401042F5D3CF43C10FD5D3CF45D5D3C002F3CE4FD3C322F
-5DFD3C31302521352111213521113311211521112105B5FB22021CFDE4021CA6021CFDE4
-021CB39E01A69E0221FDDF9EFE5A000200FE0000058005710006000A0061401605045403
-020306540001002C26012902360139020400B8FFE240240B1837031E0B18370954080303
-00400C01300C400C020504090A040100004001500102012F5D332F1217395D5D002F332F
-2FED2B2B31305D4B53588710FD8710FD05C05909013501150901112135210580FB7E0482
-FC870379FB7E0482012F01E37C01E3B7FE96FE96FE1AA0000002010C0000058E05710006
-000A0063401603045405050602540101002C26002906360039060401B8FFE240260B1837
-051E0B1837095408050501400C01300C400C020503090A040100002F013001400103012F
-5D332F1217395D5D002F332F2FED2B2B31305D4B53588710FD8710FD05C0590901350901
-350111213521058EFB7E0379FC870482FB7E04820312FE1DB7016A016AB7FE1DFC72A000
-0001006C000004A705D1001000834020300E3F10420E4F10540E5B10650E6A10730E7C10
-0A0020090B371020090B370EB8FFE0B3090B370DB8FFE04033090B374601550F700F0305
-0208320B0B0C010F0005070D0307080F121F1202030A005C0501030F05130D5C0C0A0F08
-BF0802082F5D3333E4ED39323210E42F2F5D003F3F1217392FED393931305D012B2B2B2B
-5D090115211521112311213521350133090104A7FE400174FE8EBCFE8E0174FE3DD4014C
-015005D1FCC15E8AFE5601AA8A490354FD6D0293000100BEFE640464045D001500384020
-080205140B051042050900080A0C0102131A0092171F176017020D091A0A881610F6FD3C
-5D10F4FD3939003F3F3FED3F3C12393931302123270E012322262711231133111E013332
-363711330464B20A3B815B567F42BCBC209B5B5D8536BC76414A4640FDF305F9FCBA2752
-433C034000020095FFE0047905EF00220031006640481502151B162E2904241B310A351B
-410A431B560A551A561F5020562A641A661E642A632E751B702E140F06263F0C0C061D19
-19153F1D022C3F060A1A0F232912141A0900002914092FED332F1239ED1139392F003FED
-3FFD322F1112392FED123931305D011402070E01232226353400333216173E0135342623
-22060723353E01333216171E01032E01232206151416333236373E0104794E5255CB71C0
-F3010DCA5A9F4F02029E984EB74E0B51C96089CD3E2A1DCB3C98488DA8877080A322060B
-0345A4FE987B7C62FDCBE4012134411A3B1AD9CA3F37C22C2D6D7C56CEFEC42F36B6AA91
-99C2BE215000000100BBFF43055905D1000C00A9406A01030F08450B8B03D903D30B0601
-08010B2B033208320B5D03660A600B08030203080908B3040304030B0A0BB30202030302
-03080908B3040304030B0A0BB30202030303610A010A07040304070A04020C0C0203090A
-0A6B090109040202040309040B0835050301350B002FED3FED1117392F2F2F5D332F1239
-012F332F1217392F2F2F5D332F313087107AED87C0018710ED8708C00187107AED87C001
-8710ED8708C0015D71052135090135211521011501210559FB6202A1FD69046DFC850288
-FD6603B4BDBF029C0277BCB0FDA748FD730000010090FF3F05FC05D1000B003B40250307
-050009350A0270007F09020414005A6F017F010201010D0514095A00086008700803082F
-5DE4ED11332F5DE4ED5D003FFD3C3C2F3C313001231123112111231123352105FCC8C6FD
-B0C6C8056C0523FA1C05E4FA1C05E4AE0001007100000541045D000B002B401703070500
-093E0A05041A00B001010D051A09B0100801082F5DE4ED11332FE4ED003FFD3C3C2F3C31
-300123112311211123112335210541CABCFE3CBCCA04D003BFFC4103BFFC4103BF9E0001
-008AFE590490061E0021002C4018000004401E00111115400D0D0F231F2302001000091A
-10192F33FD322F2F5D003FFD322F3FFD322F313001232E01232207061511140706232226
-2735331E013332373635113437363332161704900A2073208134356869BC346D310A216C
-228135346868BD3A6636055708153D3D95FB9DCE6D6E0B0AB208153D3D950463CC6F6E0B
-0A0000020097021303B005F000230030005740370A0A06211B0916212E0925215529600E
-6029700E70290B02082552111120081C1C1853200201012E5308061D1125022A1D0B002B
-2A000B2F33ED2F1239FD32322F003FED332F3FFD322F1112392FED12393130015D012335
-0E01070E01232226353436373E0137353426272E012322060723353E013332161503350E
-01070E0115141633323603B0AA1C312C2D514980AF5D4D4EEF88242122573054A8270E2D
-B84DD9BEAA45B736404E5B5E5283022A5E1425131415AA846A8724241F0612354013120A
-300EAC0D20A99FFE74F504100F124D444C4C430000020079021303E405F0000B00170031
-40205D015D055207520B046A0F6515020F530902155303060C2A40000100122A00062F33
-ED2F5DED003FED3FED5D31305D0114022322023534123332120734262322061514163332
-3603E4F4C1C9EDEDC9C1F4B687787A86867A78870401EBFEFD0109E5E5010AFEFCEBACAC
-AEAAAAADAB000001006B0000062105F00027006240440909090D1A091A0D2C092C0D3403
-300530113413460346136A1A641D64216A24101925140204160B341F0226183501160825
-1202191214081502141C272222290E15171C2FC4ED11332FC4123939ED2FED2FED003F3C
-FD3C3FED12173931305D2901113E01373E01353426232206151416171E01171121352135
-26023510002120001114020715210621FDA443842D2F38F8E2E2F83A2F2F7F44FDA401B4
-A8D90172013601360172D9A801B40185275A373A9970C8FDFDC86E9E38395727FE7BAE7C
-580132CC0116015AFEA6FEEACCFECE587C0000030068FFE3073F047C00390043005200B9
-40840B190B1D1C192604200D3604320D383D34414204420D4A3D4241520D5237554B630D
-6137654B13161D4B2A512E622E7B0D7E137C1E7D24732E73387C4B0B47013C2170430143
-124333033018403D36042C2C283F30040B0B073F0F0A5041180A433A011A474412213304
-00470F2D012D0C0C3A1A00472D1B008F544054014D1B001B855310F632ED5D10E4113939
-10ED332F2F5D2F1217392FFD1139003FED3FED332F3FED332F3FED111217392F5D33FD32
-31305D015D01211416171E013332363733150E01232226270E01070E0123222635343637
-362437353426272E012322060723353E01333216173E0133321215272E01272E01232206>
-<07032E01350E01070E01151416333236073FFCCD3C37348E566FD5420C4ED56DA6ED4C15
-5C323F947396D36C655F0124A22E2928703C4FB35A0D37CE659FD33945CA7DD9FBB60525
-20226D4F85B41991141569C0524F61747663C1022F72A234302D5334CD233B686713501C
-242FC2987C992A271C033D41551717112A24BF0F265D5B5268FF00FB3E446625272C968C
-FE6B35844B030915145B535F5C560003005DFF6C047104D900170021002B007840560008
-0F140A19292604001800250200180025020914001800253D1D322B4D1D422B0721261825
-04291B3E0609121504030F04293E030A21261825041E221B0009061215040C00902D0F2D
-1F2D3F2D6F2D041E1B0C852C10F6ED5D10E411173910ED111739003FED3F121739FD1117
-3931305D5D5D015D011000232226270723132E01351000333216173733071E01252E0123
-22061514161701342627011E013332360471FEE8EB548F3B856EAB4B530117ED578E3674
-6F9B4C54FEBC2563379BAA222302442322FE40275F3B96AE022EFEEFFEC42A27C601004D
-E2930111013D2C23ACE74CE0DC1D1DDCD2619436012B619836FD611F1ED900020071FFE2
-03BE05D100030020006D404C0F221F2202131E231E3A053A144B05400D400E400F43165C
-05520F6F05650E651A7A057A0910127F1301131007120155030320201C34070A022B0303
-101F70130113130A200401041915040A2F33ED2F5D12392F5DED332FED003FFD322F3FED
-331239395D2F31305D015D01233533130E01232226353436373E01373533110E01070E01
-151416333236373302C8CCCCF653BA70D7F9453B3A9D44B33C9E2E3644997967C5390A04
-FED3FA571E28D1AB62963E3E6529E1FECF2161282F7C4E716F4225000002012300000203
-05D1000300070027401707070055030305080F0901045D032B055D0F02200202022F5DE4
-FDE45D003F3FED332F3130012335331323133301F9CCCC0AE01AAA04FED3FA2F04370001
-00D2003905B002FA000500294018000002540F0401044007013007400702012A40000100
-00042F332F5DED5D5D002F5DFD322F313025231121352105B0ABFBCD04DE390221A00001
-0086FF6906C906FC0008004A402C15073307440772070407070806140302030207090829
-08590869080408000100010100040351060607080208002F2F1239392FED012F2F332F31
-308710DD5DC0C08710FD08C0005D09012301233521090106C9FC9066FE80ED0189013902
-DA06FCF86D03E18BFCCB065C0001FFDCFF37050005EF002B0077404D070B001F2E08270C
-270F2E212925350D300F400E410F59226607660C0E0C0B0807201D1E21221D220F2D1F2D
-020920201D2209041600160B081E462121281200000449280216161A4900120112002F5D
-FD322F3FFD322F1112392FED393930012F2F1217392F2F5D8710C0C0C0FDC0C0C0313001
-5D01232E012322060F01211521030E01070E012322262735331E01333236371323353337
-3E01373E013332161705000A1D7229797E232A0141FEA3671D5C4041985C2950340A215E
-2C7F812367D9F52A1A5C3E3E99573A4F3405290A1A77A0C28AFE1686B034352A0709B40E
-1480A701EA8AC67BA833332C0A08000200F300CA0598045000190033006D40490A010606
-050E08130A1B06200528082D5B0452115B1E522B680B6432790B743210272730541D1A23
-541D1A002A012A0D0D1654030009542A0300101929000033291A0C290D26291A272F33ED
-3CED2FED332FED002F333333ED2F2FED332F2F5D3333ED2F2FED332F31305D010E012322
-26272E0123220607233E01333216171E0133323637130E01232226272E0123220607233E
-01333216171E0133323637059714B69E4D8C3841682C4B541C9B17B39F488E3B3D6B2D4C
-59139E19AEA348903927802E4E56149D13B79E4D8A3A237C364B541B0450C2C64B2D3437
-607CB6C44A2E303B6D7DFDFCB8C34B2D1F4C6E7CC0C84A2E1C4F637A000200320000059E
-05D100030006004F403148024703025A056A050205041A000003061A010102390236036B
-0264037B02750306020305030000080105010203065401002FED3F1239012F11332F1739
-5D31308710FD8710FD04C0005D015D290101210902059EFA94023201080127FE50FE5105
-D1FAD7047BFB8500000200A600A2047A04760006000D005940107305730C0204400C1037
-0B400C103706B8FFC0B30C10370DB8FFC0401B0C103703000300070A0A07040500010100
-000C0B084007010707082F332F5D123939332F332F123939002F332F1239392F2F31302B
-2B2B2B015D2501350115090105013501150901047AFDF00210FE9B0165FE52FDDA0226FE
-8D0173BF01A35501A2BCFEEFFEEFD901BE5901BDC4FEDAFEDA00000200AE00A204820476
-0006000D005740107C037C0A0204400C10370B400C103702B8FFC0B30C103709B8FFC040
-1A0C10370C080C080505010403014000010000010A0B08070107082F33332F1239392F33
-2F5D123939002F332F39392F2F31302B2B2B2B015D090135090135010501350901350104
-82FDDA0173FE8D0226FE3CFDF00165FE9B02100260FE42C401260126C4FE4357FE5DBC01
-110111BCFE5E000300B2000005DA00DF00030007000B0025401405010206040A55090800
-2B0101042B0505082B092FED332FED332FED003FED173931302123353305233533052335
-3305DACCCCFDD2CCCCFDD2CCCCDFDFDFDFDFFFFF001A0000055E08010236002400000117
-004300640175000BB602000C0E050025012B3500FFFF001A0000055E07C8023600240000
-011700D700330175000BB60200180B050025012B3500FFFF0073FFE105DA07C802360032
-0000011700D7008B0175000BB6020031240F0325012B3500000200780000081C05D10016
-002500554039001C0022301C3022401C40227204720A721C741D72230B14351111011834
-10350D0317341535010811141417170E1203070073271F1507682610F6ED10E61117392F
-FD32003FEDED3FEDED12392FED3130015D29012224272602353412373E01332115211121
-152111210511232206070E01151416171E0133081CFBCEC4FEFD6791B3AE984FF9E8042E
-FD0502FBFD0502FBFC407A92B55F7481716D5BD09236415B0146CFD7013C603344B0FE68
-B0FDD7040479203642F8ABABEE4439280003006AFFE10776047C0024002B00370094406C
-2604200D3204300D32293B2E323032343B364004400D40294D2E403040344D36530D5314
-5C165C1A531C5322620D621C6222700D72221B013C2B121E2B030F283D21042F3F1B040B
-0B073F0F0A353F150A1E122B011A7F2C012C0C0C251A002C18008F393F3901321B188538
-10F6ED5D10E4113910ED332F2F5DFD323939003FED3FED332F3FED3FED1217392FED3130
-015D01211416171E013332363733150E01232226270E01232200111000333216173E0133
-321215272E012322060F0134262322061514163332360776FCDC3C34348D526DCD460C62
-BF69A8E84A45D183E9FEEF0117E38CC84447D78FE1ECB703918D8BAF10B8A49399A0A792
-92A5021B689831312F4F38CD2A347A686F78013C01110115013979726A81FEF4EF2A9B9B
-A4927DD7D5E0CCD4D7D500010099023C047D02DC00030018400C0154020000050F051F05
-02022F5D11332F002FED313001213521047DFC1C03E4023CA00000010099023C076702DC
-00030011B6015402000005022F11332F002FED3130012135210767F93206CE023CA00002
-FFED03E503160614000300070052B502180D103701B8FFE8B3090C3700B8FFE840090910
-3706180D103705B8FFE8B3090C3704B8FFE8401309103701000501050502060100B10202
-04B1062FED332FED003F3C332F5D3C3130012B2B2B2B2B2B0123013303230133031686FE
-F1F0EF86FEF1F003E5022FFDD1022F000002009603E503BF0614000300070050B90004FF
-E8400E0D10370518090C37061809103700B8FFE840200D10370118090C37021809103701
-000501050503070100B1020204B1000601062F5DED332FED003F3C332F5D3C3130012B2B
-2B2B2B2B090123132301231303BFFEF186A5A4FEF186A50614FDD1022FFDD1022F000001
-FFED03E5018606140003002EB502180D103701B8FFE8B3090C3700B8FFE8400D09103701
-00010101020100B1022FED003F335D2F3130012B2B2B0123013301868AFEF1F403E5022F
-000100A003E5023906140003002FB90000FFE8401A0D10370118090C3702180910370100
-010101030100B1000201022F5DED003F335D2F3130012B2B2B090123130239FEF18AA506
-14FDD1022F00000300D2000705BA051100030007000B00414029000B010B5608AC045407
-0F0101015602AC0F070107400D01300D400D0204AB000B2D05AB01400A010A2F5D3CE4FD
-3CE45D5D002F5DF4ED5D10FDF4ED5D313001231133012135210123113303BDEEEE01FDFB
-1804E8FE03EEEE03FE0113FD2BA0FD2B0113000200ACFFC805E00554000300070057403B
-4804470658045706680467067F047006087F057007020705000301000330036003900304
-03B200023002600290020402B220010406020002000201192F3333182F2F123939002F1A
-19FE5DEE5D11173931305D015D090705E0FD66FD66029A01BDFE43FE4301BD028EFD3A02
-C602C6FD3A01DDFE23FE2300FFFF003DFE64047F05DB0236005C00000116008EDD000016
-400F02100E600E700E0301000E0B040025012B355D35FFFF0006000004E607500236003C
-00000117008EFFED01750019401302000E400E500E600E700E0501000E090500252B355D
-35000001FF9A0000034B05D10003001D401138034803680065016903050100030000022F
-332F003F2F3130015D09012301034BFCF4A5030C05D1FA2F05D100010000FFE504CA05EC
-003300CC408758040102B52F0103B81D010237184718571867187718E718F71807013A00
-4A005A006A007A00FA0006032C06502998090109230F5020F71201081218122812581204
-00121203151827190119191D341502002833010133332F34030A272001022320292C0400
-0F12090604260C082A182A282A03002A21210C18007135103407073426150C683410F4ED
-12392F103C10F63C11392FC45F5D111217391117395F5D003FED332F5F5D333FED332F5D
-331112392F5F5D5D3CFD3CDD5D3CFD3C5F5D5F5D5F5D5F5D31305F5D250E012322000323
-37332E013534363723373312003332161715232E01232204072107210E01151416172107
-211604333236373304CA6CB97EF3FE8331862C4B02020202772C5D3A0174F38DBF541050
-C67C9DFF003001DB2CFE3C02030202017C2CFEC4310108969DB2440F3E3326012E010476
-152F161A34187601010128292DD1413DCFB17618341A172E1576B6D13F3D000100BA00AC
-02E0046C0006002C400972050104400C103706B8FFC0400C0C1037030300040501000001
-2F332F123939002F332F31302B2B015D2501350115090102E0FDDA0226FE8D0173AC01B4
-5901B3C7FEE7FEE7000100C200AC02E8046C0006002C40097D030104400C103702B8FFC0
-400C0C10370505010403010000012F332F123939002F332F31302B2B015D090135090135
-0102E8FDDA0173FE8D02260260FE4CC701190119C7FE4D000002004400000453061E0003
-001E005B40370B103A10601A741A04014402031515193F1100070A3E1D0D050509080B14
-0160051A006004140A0492201D071A0B0D0A400D10370A891F10F62B3232FD3210E61139
-10E4FDE42F2F003F3C3F33FD323FFD322F3FED3130015D01233533032311211123112335
-333534363332161715232E012322061D01210453D0D011BCFDF9BC7F7FC8B73E65290A1C
-6A22796A02C90518C3FA2503C2FC3E03BF9E31C1CF0D07AA08146B8C2800000100440000
-0447061E001A004E402D6C077A0702191A191A053E16000C0F3E091205010E08100A011A
-000A0F00921C090C1A10120F400D10370F891B10F62B3232FD3210E6113910ED2F2F003F
-3C3F33FD323FED33332F2F31305D2123112E012322061D01211521112311233533353436
-33321617370447BC2B8B35A2850149FEBDBC7F7FE9DE45902CBC056D080C6C8C2C9EFC41
-03BF9E31BFD10E040800000100BB007C045B06140013005740390B0E0F1011080609AA0A
-0712130001040605AA060A060C030C010F151F150210630063020407080B0C0D0E111201
-0A022803090563700301032F5DF63C10ED173910E6E65D003F2F1239392FED17392FED17
-3931300125132313053505110535050333032515251125045BFE6D058405FE6D0193FE6D
-01930584050193FE6D019301FB05FE7C018405810501A20581050184FE7C058105FE5E05
-000100FD01FF01EC031A00030016400C02560108002D2F013F0102012F5DED003FED3130
-0123113301ECEFEF01FF011B0001FFF6FEEC018F011B0003002EB90000FFE840190D1037
-0118090C370218091037010F0301011F03010300B1022FED002F5D335D2F3130012B2B2B
-09012313018FFEF18AA5011BFDD1022F0002FFF6FEEC031F011B000300070051B90004FF
-E8400E0D10370518090C37061809103700B8FFE840210D10370118090C37021809103701
-0005010505030F071F07020700B1020204B1062FED332FED002F5D3C332F5D3C3130012B
-2B2B2B2B2B0901231323012313031FFEF186A5A4FEF186A5011BFDD1022FFDD1022F0007
-0095FFE30B9305ED000B000F001B00270033003F004B00C640900908060A0918061A083C
-073E1808170A1818171A193C163E2908260A2918261A283C253E460D480F560D580F680E
-17791F7625792B7631794376490625512F034F030203031F5109020F030E08432B513D20
-19401902191949315137130A4F0C400E020C0E462A003A013A402A3A003401342E2A0016
-01163416282A0C0E060F10401002101C2A0F00010000222A10062F33ED332F5DED2F5D12
-3939ED33332F5DED2F5D33ED2F5DED2F2F5D003F3CFD3C332F5D3CFD3C3F3F3FED332F5D
-ED5D3130015D011406232226353436333216250123090114062322263534363332160134
-262322061514163332360134262322061514163332362514062322263534363332160734
-262322061514163332360374BDB2B6BABEB2B5BA02B3FCF4A5030C0285BEB2B5BABDB2B6
-BAFABB596466585866645904935964665858666459043EBEB2B5BABDB2B6BAB259646658
-586664590434E0DADADFE0DADCC0FA2F05D1FBCCE0DADCDDE0DADA01B8AC8888ADAD8787
-FE17AC8888ADAD8787AEE0DADCDDE0DADADFAC8888ADAD878700FFFF001A0000055E0801
-023600240000011700D600280175000BB602000F0B050025012B3500FFFF00C80000049D
-0801023600280000011700D600260175000BB60100100C020325012B3500FFFF001A0000
-055E08010236002400000117008DFFF80175000BB602000C0C050025012B3500FFFF00C8
-0000049D07500236002800000117008E00500175000DB7020100110C020325012B353500
-FFFF00C80000049D080102360028000001170043003C0175000BB601000D0D020325012B
-3500FFFF0089000002D508010236002C00000117008DFF120175000BB601000D0D040925
-012B3500FFFF005D0000030808010236002C0000011700D6FF270175000BB60100100C04
-0925012B3500FFFF007E000002E207500236002C00000117008EFF240175001940130200
-104010501060107010050100100D0409252B355D3500FFFF0089000002D508010236002C
-000001170043FF3E0175000BB601000D0D040925012B3500FFFF0073FFE105DA08010236
-003200000117008D00780175000BB6020025250F0325012B3500FFFF0073FFE105DA0801
-023600320000011700D6008F0175000BB6020028240F0325012B3500FFFF0073FFE105DA
-08010236003200000117004300AA0175000BB6020025250F0325012B3500FFFF00B2FFE1
-052908010236003800000117008D006E0175000BB60100201F0D1D25012B3500FFFF00B2
-FFE105290801023600380000011700D6005B0175000BB60100221E0D1D25012B3500FFFF
-00B2FFE1052908010236003800000117004300AA0175000BB601001F1F0D1D25012B3500
-000100BB00000177045D0003001E4011020501087F05010592001A7F010101880410F65D
-FDE65D003F3F3130212311330177BCBC045D00010136051103E1068C0006003A40275905
-5606690566067A0573060601020350056005700503050560030103500060007000030000
-042F332F5D002F5D332F5D1239393130015D01230B0123133303E19FB9B89BE4E3051101
-00FF00017B00000100ED051D042C06530019003940233902350E4902450E04190D190952
-0F101F1002101652100D600301031928000C28000D2F33ED2FED002F5D3333ED2F5DED33
-2F2F31305D010E01232226272E0123220607233E01333216171E0133323637042C0B846F
-365C292F412734340483088E67325D2A2F49213339030653989A27252B2B5A4C979A2724
-29295C4600010118053703FE05D10003001440090253100101010000022F332F002F5DED
-31300121352103FEFD1A02E605379A0000010113050E0402068C000D0056403A6508650C
-7508750C040D5006600670060306060AAA094003F00302D19003E003029003E003028B00
-03018950030150030159030D2A00072A00062F33ED2FED002F5E71725E5D5E5D715E5D5E
-ED332F5D3C31305D010E0123222627331E013332363704020AC5A9A9C509A60C6B5B596B
-0E068CA8D6D6A8847878840000010221051802F505DB0003000EB50244010015012FED00
-2FED31300123353302F5D4D40518C3000002012D050903E907B1000B00170045402E0F51
-090009300902313009015009600970090309091551030C29200030000200003000600003
-D0000100001229062FED332F5D7172ED002FED332F5D725E715EED313001140623222635
-343633321607342623220615141633323603E9CC9290CECC9293CB917558587576575875
-065E8FC6C5908FC4C48F567776575776760000010161FE59037000140014002440150B02
-1B012B013901041207070B53030D0E2A0000062F332FED003FFD322F2F31305D05140623
-22262735331E0133323635342627331E010370B79225742D091A58326862060399020659
-A2AC0E0CA00A1A4E581D491913340002015605160477068C000300070042B54500450402
-00B8FFE8B30E103704B8FFE840190E10370750036003700303030305019F000100000204
-0204062F33332F2F332F5D002F33332F5D333130012B2B5D09012313230123130477FEFE
-8BA9B0FEFE8BA9068CFE8A0176FE8A0176000001019FFE5F037C000A0014002440150E04
-1E042B043B04040A14141053030D000D2A00062F33ED2F003FFD322F2F31305D010E0123
-222635343637330E011514163332363733037C344B2A8BA90D069B0606535A24511108FE
-790E0C9E8F263E1A1B3C1E524E1B080000010132051103DD068C0006003A402754015902
-64016B0274017B020606050250036003700303030360020102500060007000030000032F
-332F5D002F5D332F5D1239393130015D01032303331B0103DDE4E3E49FB9B8068CFE8501
-7BFF00010000000100180000048005D1000D0047402A3B0B4B0A5A0A7A0A04020B050804
-090309090106030C3501080A030A00000F0F0F01080B140503026C0E10F63232FD325D11
-332F392F2F003FED3F12392F2F12173931305D29011107353711331101150111210480FC
-52BABAC6015DFEA302E8021798A395031AFD78011BA3FEE8FE0700010018000002360614
-000B003D4023490559056905030407010A040B05050B0B030801030800050D92000A011A
-050704880C10F43232FD3232E62F2F003F3F12392F332F12173931305D01071123110735
-37113311370236B5BCADADBCB5037A91FD1702608D9F8A0318FD7194FFFF0086FFE50502
-0801023600360000011700DF004D0175000BB6010034311A0025012B3500FFFF006EFFE5
-03D7068C023600560000011600DFAE00000BB601003734180025012B3500FFFF007E0000
-050808010236003D0000011700DF00320175000BB601000D0A020625012B3500FFFF005D
-000003E3068C0236005D0000011600DF9400000BB601000D0A050625012B35000002017A
-FE780228061400030007002940160F094F090201060106050201050B00041F014F050105
-2F5D3CFD3C003F3F1239392F2F3130015D01231133112311330228AEAEAEAE02F6031EF8
-64031E000002000E000005BC05D100120025005240333816481666026811041B1E083C0B
-0B071A340C031F3407087600011D1D0713150074270F274027602703091B1E140B09076C
-2610F63232FD322F5D10F6ED12392F5D003FED3FED12392FFD393931305D011402070E01
-23211123353311213204171612073426272E012B011121152111333236373E0105BCB193
-66FBCDFE88C4C40174DA01025898AACF7A7958C68ABC0169FE97BC8FD5596F6F02E7CBFE
-B65B3F3802E48F025E3F375FFEC4D6AFF0453227FE4C8FFDC62A3947E8000002006AFFE1
-0471061E001F00310084405B190D290D32013420392B362D45014C0D44204A2B442D5A2B
-542D6F05741E7421100C03293F090F121A1D041B10100903161B1B3F164F160216022F3E
-030A1C111A1D1C030011120F0C26051F162F160216231316090000092C14062FED11332F
-1239ED2F5D17391217392F2F003FED3F5D332F111239392F1217392FED123931305D0110
-00232200353400333216172E01270527372E012735211E01173717071612013E01353426
-272E012322061514163332360471FEE4F1E5FEEB0112CA6C9B56208757FEF842ED54905D
-0127236225D242BA99A6FEDE313403024BA55693A9A98F427B027DFEBCFEA8010EF5E201
-08353570D64AA2618E43512F1019431A80616D93FE9BFD8A3BA99620371E2D2BAF98B4AE
-2C00FFFF0006000004E608010236003C00000117008DFFE40175000BB601000B0A050025
-012B3500FFFF003DFE64047F068C0236005C00000116008DDD00000BB601000A09040025
-012B3500000200C80000049605D100120021005C403E391F491F551180108011051B3400
-0701071A34200C010C0C07090A0309080F231F23021315200030004000700004006F230F
-233F23020C1B071400096C2210F632FD32325D10F65DED5D003F3F1239392F5DED2F5DED
-3130015D011406070E012B011123113311333216171E01073426272E012B011133323637
-3E010496463C4EDB97C6C6C6CD85C243535ECE343830805AC4A777982F2C2903135CA939
-4B48FEBE05D1FEF22D2C35AA7D486B231E19FDCD292D2966000200B9FE64049006140013
-0020004D4035320239153220430249154220561267127E087C1C0A0E0906174211040C01
-1E4006090B0C141B0090221F223F22020E1B091A0C882110F6FD32325D10F4ED003F3FED
-3F3FED12393931305D011406070E012322262711231133113E0133321203342623220607
-111E0133323604904E4742B364578D49BCBC4BBB6ACAE1C28A8F51A44B5073499DB0023C
-88E14E4A512628FE2C07B0FDD43F55FECFFEECCAC84639FD87241AD4000100DC023C05B0
-02DC0003001E401100540F02010240050130054005020000012F332F5D5D002F5DED3130
-0121352105B0FB2C04D4023CA000000101230069056904AF000B00264017D702D80802A7
-0201D705D80B02A80B0105840294020202192F5D002F3130015D71005D71250709012709
-01370901170105696FFE4CFE4C6F01B8FE486F01B401B46FFE48D86F01B8FE486F01B401
-B46FFE4801B86FFE4C00000101230236039205D5000F002E4018055006060C030E03AA01
-0E0505020F0F0C0E2A02100301032F5D33ED39322F2F332F003FFD323F332FED31300121
-35331123353236373E01373311330392FD99EAF22D6C1E252C0387DD02367A0238700D0C
-102C28FCDB00000100CF023603C705EF001D0045402D24152518361535184C105E106D10
-651866197D1075180B0F0F0B521302021C52010E00001C02082A16101610022F33332F2F
-ED1239332F003FFD323FED332F3130015D0121353E01373E013534262322060723353E01
-333216151406070E01072103C7FD0864A733834A6B5A59AC300D47AF57B4BB6173379B42
-022002369C3E6E29676754454C3D1FB41A239D7D63975A2B6629000100CF020F03BC05F0
-002E007740162A033903450C4A1F540C5C1F6B0864237D0874230A27B8FFC040390B0E37
-2C2B15520F16010F161F164F165F16CF16FF16061621211D52160625020A0A0E52060F1A
-2A281622112A2216282C04091000010000092F332F5D121739ED2F2F2FED003FED332F3F
-1239ED332F2F5D71ED393931302B5D011406070E012322262735331E013332363534262B
-01353332363534262322060723353E0133321615140607151E0103BC42383994595EA54A
-0E29C35D648576708F80706B63684DC32C0E4AAD5AAFC16E595F8303314B712223211E1C
-B3243B474B553C8D4D443D473E24B21B23886A59721A08116F00FFFF00AB000007A305D5
-0036023B9200003700BB023700000117023C0404FDC300204015020E08020E400E600E02
-010B2B0B5B0B6B0B7F0B045D11355D1135003F35FFFF00AB0000074105D50036023B9200
-003700BB023700000117023E0384FDC3002640190302100803020E1F0E5F0E7F0E03010B
-2B0B5B0B6B0B7F0B045D11355D113535003F3535FFFF008C0000077905ED0026023DA600
-002700BB029100000107023E03BCFDC30036402603023608030236103630367F36030131
-003134314B315F316B317B3106000900093F094F09035D11355D11355D113535003F3535
-0001003C0000047405D10011005840330C0F09512F063F060206060B02344F0501050510
-0B01341003200301080803032F00010000130E01050A140F0E2F0B3F0B020B2F5D3333FD
-32322F11332F5D332F392F5D003FED2F12392F5DED12392F5DED39393130012111211521
-1121152111231123353311210474FD3E028AFD76014AFEB6C0B6B603820526FE55ABFEEF
-8BFECC01348B0412FFFF0073FFE305A208010236002A0000001700D900CF0175FFFF006C
-FE590443068C0236004A0000011600D9FE00000BB6020037311A2325012B3500FFFF0089
-000002D507500236002C0000011700DAFF240175000BB601000D0C040925012B35000001
-0086FE59050205EC004700C240990B0B0A1F0036003A1B0B1B1F13362F0B2A1F292F2436
-24463F0B391F3427392A34363441481F4427482A43364B3E44415F035A05523257365544
-6B026F046A30643264366642604679057A2D703670377541754486292B20400E10371F40
-0E10371A060028313F06341D38383C343402212125341D0A101014530C0D0F0F172A0937
-3F153128150031371D0904200074490F49704902206A4810E65D10E611173910ED2FED2F
-2FED332F003FFD322F3FED332F3FED332F1112173931302B2B5D011406070E01071E0115
-14062322262735331E01333236353426270E012322242735331604333236353426272E01
-272E013534243332041715232624232206151416171E01171E01050251492C683E0303B3
-9A25742D091A523868620302142515A1FEFF850E71012882B8CD61634BAF62C6BF013CF3
-9D0106650E55FEEB919FC1607940EC52A6A801A957AA3B233711162C199DB10E0CA20A1C
-4E5818291201023C3BF85E668A73635E1A141A142ACBA3BBEF3C2CEA485F84685D6A1C0E
-28152CB20001006EFE5903D70478004A00AA40810820090C37090204321902173224202B
-3B34203A3B43204B3B5A1C5C2D5237534652496B1C6B2D6237624662497C1C7C28743779
-3F74428B0188248531873F1D170300252F4006351A80390139393D3E35041E1E223E1A09
-0D0D1153090D0C0C142A0638401B2F251B002F381A06041D008E4C0F4C1F4C3F4C5F4C7F
-4C051D864B10E65D10E611173910ED2FED2F2FED332F003FFD322F3FED332F3FED332F5D
-1112173931305D2B011406071E011514062322262735331E01333236353426270E012322
-262735331E0133323635342726272E01272E01353436373E013332161715232E01232206
-15141716171E011716171603D77F6F0205B79225742D091A5832686203021528177CCF46
-0A59DA647C8C26266C288135937B393A38AD6B64CD440A48CE63678E2B2A5E34812B8347
-4701426BA32A13361AA2AC0E0CA00A1A4E58182D0F02023B23D3434F5056422222180918
-0E27976E457A302F373123C935494F4E452323160C180A1E494AFFFF0073FFE505460801
-0236002600000117008D006E0175000BB601002D2C0C1525012B3500FFFF0069FFE703F3
-068C0236004600000116008DCE00000BB601002423090F25012B3500FFFF0073FFE50546
-0801023600260000011700DF00A80175000BB601002E2B0E1525012B3500FFFF0069FFE7
-03F3068C023600460000011600DFF600000BB601002522090F25012B35000002006CFFE1
-04FB0614001B0028006F404A3B05380C3C2232243E284B054A0C4E2245244F2859086908
-70120D0114511A17171018011304072041100403082642070A160088011617131C041A1A
-01922A1F2A3F2A02231B010A852910F632ED5D10F632FD3232323210E42F003FED3F3FED
-1239393F12392F3CFD3C31305D01231123350E01232202113436373E0133321617352135
-213533153301112E0123220615141633323604FBB8BC4DAD6EC6ED524444B66059864CFE
-95016BBCB8FE8C4F73499CB2879750A404F4FB0C754252012E01118EDB4D4C4F2427CE86
-9A9AFB9902792218D6CCC3CD47000001FFFC0684051A06FC00030011B601500200000502
-2F11332F002FED313001212721051AFAE705051E06847800000100FD01FF01EC031A0003
-0016400C02560108002D2F013F0102012F5DED003FED31300123113301ECEFEF01FF011B
-FFFF001A0000055E0801023600240000011700D900310175000BB60200110B050025012B
-3500FFFF0068FFE1041D068C023600440000011600D9D600000BB602003A340B2625012B
-35000002001AFE5F062B05D1001B001E00C840900F051F052E053E05401D700806381C4A
-0E450F590E570F051D1E1D1C0A77098709020914100F101D1E0B770C870C020C140D0D0E
-570E580F7D0E730F040B34301E401E701E031E091E1D030D0E031B1B1753030D107A0D01
-0D080000142A060F20010E0F1D06040D0C102410391042105A106A1074100710106E200F
-20010A0D2B0D360D4D0D550D650D7C0D070D641F10E65D5D10F42F5D1217395D2FED332F
-003F5D3C3FFD322F3F1217392F5DED3130015D8710FD5DC0C0C08710FD5DC0C008C0015D
-005D010E012322263534363703210323012101230E0115141633323637330902062B344B
-2A8BA91E0679FD7C92C9021E0108021E610607535A24511108FD91FEFBFEFAFE790E0C9D
-90406A150154FE6105D1FA2F1B351B524E1B08033102DBFD250000020068FE5F052E0478
-003A00470099406A0B11052B1A12162B2A0544225F25544065166C2562407B127B1D7F25
-703F0F0C041B04390559166916053A3A3653030D0A103C3D301940190219192810242420
-3F28044541100A3009080000332A060F25012506193B091A2F25132F91490F491F493F49
-03421B13854810F6ED5D10E4113910FD3232322F5D2FED332F003F3C3FED3FED332F1112
-392F5DED12393FFD322F31305D015D010E0123222635343637350E01070E012322263534
-3637362437353426272E012322060723353E01333216171E011511230E01151416333236
-373301110E01070E01151416333236052E344B2A8BA90D041955282F7A5297D26D656601
-1EA42D2A28703D4AB6610A37D06576AF403F421D0607535A24511108FE3456E944516474
-7763A4FE790E0C9E8F263B1377113D12171FC89B7F9D2D2D20081D40541817102725BF0F
-24272F2E926CFD0A1B321E524E1B0801FB013705141317615560614DFFFF00C8000005B2
-0801023600270000011700DF00280175000BB60200211E080F25012B35000003006CFFE1
-062706140003001700240072B90000FFC0404A0E10370118090D3702180910373D073D1E
-34203B244D074F1E45204B245A0A6A0A70140B02020316011506091C4112040508224209
-0A0000021618061A02041F263F26021F1B040C852510F632ED5D2F33FD32322F332F003F
-ED3F3FED1239393F33332F31305D012B2B2B010323130123350E01232202113436373E01
-33321617113303112E012322061514163332360627FA7F98FEFDBC51B067C8EB514544B5
-6158884BBCBC4C78479EB0889650A40614FE0701F9F9EC75464E013401118EDE4E4C5025
-2701E4FAFF0281221ADCCAC7CF47FFFF000E000005BC05D1021600E70000000100C8FE5F
-04CD05D10020005C40390C041C042D043D04041235000F100F020F0F090E350B03133516
-090820201C53030D00192A0006060C10030A1473220F22010F1314140A6C2110F432FD32
-5D10E61117392F33ED2F003FFD322F3F3CED3FED12392F71ED31305D010E012322263534
-3637211121152111211521112115230E01151416333236373304CD344B2A8BA90B06FDC7
-03D5FCF1030FFCF1030FFE0607535A24511108FE790E0C9E8F24331D05D1B0FE68B0FDD7
-B01B351B524E1B080002006AFE5F0460047C002C0033007B40560D1E1A1E2604290D2B1E
-34043A0D3C1E3B3244044B0D4B32590D502A6C0D602B790D783212191915531D0D013C33
-3323303D29040F230B0B073F2309122A20201A1A0C0C2D1A008F350F351F353F35033301
-1B26853410F6FD325D10F4ED332F3C11332FED003FED332F12393FED12392FED3FFD322F
-31305D01211416171E013332363733150E01070E011514163332363733150E0123222635
-343637260011100033321215272E01232206070460FCC93E36348F5672E7310A4A9B5102
-03535A24511108344B2A8BA90604F8FEEB012BF4E2F5B701939697B30C021B6799313030
-5B2CCD1F3109143012524E1B089F0E0C9E8F18321212012A010401120142FEF8F32A94A2
-B284FFFF00C80000049D0801023600280000011700DF00220175000BB601000F0C020325
-012B3500FFFF006AFFE60460068C023600480000011600DFFD00000BB602002320120025
-012B3500FFFF00C80000047608010236002F00000117008DFEC00175000BB60100080702
-0325012B3500FFFF00AB0000025108010236004F00000117008DFE8E0175002FB5700270
-030203B8FFC0B3090C3702B8FFC04011090C3701044F049F040201000605020325012B35
-005D11352B2B5D00000200C80000047606140005000900464016070C0B0D370808090102
-030435010800000B0F0B0106B8FFEA40110E1037080C0B1037060608041408016C0A10F6
-32ED2F332F2B2B5D11332F003FED3F3F332F3130012B2901113311210B0123130476FC52
-C602E8C3FA7F9805D1FADF0564FE0701F900000200BB000003540614000300070042400D
-010C0B0D370202030601050800B8FFEA40190E1037020C0B103700000F021F0202020204
-1A7F050105880810F65DFD322F5D332F2B2B003F3F33332F3130012B0103231303231133
-0354FA7F98FCBCBC0614FE0701F9F9EC0614000200C80000047605D1000500090036401E
-07562F0801080801020304350108062D07070100000B0F0B010414016C0A10F6ED5D1133
-2F12392FED003FED3F12392F5DED3130290111331121032311330476FC52C602E89CE9E9
-05D1FADF0157010B000200BB00000362061400030007002D401A05560606010201010807
-2D6F067006020606001A7F010101880810F65DED332F5DED003F3F12392FED3130212311
-33012311330177BCBC01EBE7E70614FBF4010900FFFF00C8000005380801023600310000
-0117008D00780175000BB601000C0B050925012B3500FFFF00B90000045F068C02360051
-00000116008D0000000BB6010019180E1625012B3500FFFF00C800000538080102360031
-0000011700DF00A20175000BB601000D0A050925012B3500FFFF00B90000045F068C0236
-00510000011600DF1C00000BB601001A170E0225012B3500FFFF0073FFE105DA08010236
-00320000011700DD008C0175000DB703020029260F0325012B353500FFFF006AFFE10471
-068C023600520000011600DDD800000DB70302001D1A060025012B353500FFFF00C80000
-059808010236003500000117008DFFF60175000BB602002221060B25012B3500FFFF00B9
-00000372068C0236005500000117008DFF380000000BB6010015130A1225012B3500FFFF
-00C8000005980801023600350000011700DF000A0175000BB602002320060B25012B3500
-FFFF009200000372068C023600550000011700DFFF600000000BB6010016130A0325012B
-3500FFFF0086FFE5050208010236003600000117008D00140175000BB6010033321A1F25
-012B3500FFFF006EFFE503D7068C0236005600000116008D9400000BB601003635063225
-012B350000010000FE5904EE05D1001B0048402E0C071C072C073C07040C0C1053080D01
-18351A030216080B0B132A050F1D1F1D4F1D03005B050114185B4F1901192F5DF4FD32E4
-5D2FED332F003F333FFD323FFD322F31305D0121111E011514062322262735331E013332
-3635342627231121352104EEFDEC0309B79225742D091A58326862050332FDEC04EE0521
-FB04144822A2AC0E0CA00A1A4E581E36170521B00001003EFE5902FD059E0030006F4046
-0C080D1A19081E1A2B082F1A3C08070D0D1153090D20251C3E22201F0503171830302C3F
-18094F327F32020C0C142A06182306031C008C321D22251A1F1D4F1C7F1C021C883110F6
-5D3232FD322F10E61117392FED332F5D003FFD322F1239393F3333FD322F3FFD322F3130
-5D250E01071E011514062322262735331E01333236353426272322263511233533113311
-211521111416171E01333236373302FD0C1C100204B79225742D091A58326862030214AB
-B27F7FBC0184FE7C0818164D4F2E64160A0A030703122C18A2AC0E0CA00A1A4E58172F10
-B7CB02529E0141FEBF9EFE0358632B28251B0900FFFF0000000004EE0801023600370000
-011700DFFFEE0175000BB601000B08060725012B35000002003EFFEA037A0705001B001F
-0073404C0B041C042A042A1D2A1E3A1D3A1E4A1D4A1E551C641C691E741C791E0E1F1F1E
-0B10073E1E0D0B0A051B1B173F03094F217F21021C1C1E1E100E008C21080D101A0A0800
-4F077F070207882010F65D323232FD322F10F63211392F332F5D003FFD322F3F333333FD
-322F2F332F3130015D250E012322263511233533113311211521111416171E0133323637
-331303231302FD357D31ABB27F7FBC0184FE7C0818164D4F2E64160A7DFA7F980A0E12B8
-CB02529E0141FEBF9EFE0358632B28251B090652FE1101EFFFFF00B2FFE1052908010236
-00380000011600DB63500079405B02010900210140215021A02103EF102101902101BD00
-210150218021028B10214021702103B021C021F021039021C02102599021C021E0210310
-21602190210331002101E021010F211F214021502180210521020100241E0D1D25012B35
-3500115D71725E71725E5D71725E5D725E5D725E5D715E353500FFFF00B1FFE1045707B1
-023600580000011600DB0000000DB70201001D17091625012B353500FFFF00B2FFE10529
-0801023600380000011700DD00780175000DB7020100241F0D1D25012B353500FFFF00B1
-FFE10481068C023600580000011600DD0A00000DB70201001D18091625012B353500FFFF
-007E0000050808010236003D00000117008D00070175000BB601000B0D050625012B3500
-FFFF005D000003E3068C0236005D00000117008DFF680000000BB601000B0D050625012B
-3500FFFF007E0000050807500236003D0000011700DA00390175000BB601000B0A050625
-012B3500FFFF005D000003E305DB0236005D0000011600DA9200000BB601000B0A050625
-012B3500000100C80000048A05D10005001F401003013504030000070F07010214036C06
-10F6ED5D11332F003FED2F3130012111231121048AFD04C603C20521FADF05D100030073
-FFE105DA05F0001700230027006D404F040004060B0C0B1217001706190C191257015705
-53075F0B580D58115F13531710253560260126260976097915021B3415022134090A2726
-27260F18150373290F29010F291F293F29031E150F682810F6ED5D5D10F6ED1239392F2F
-003FED3FED5D12392F5DED3130015D011612151402070E01232224272602353412373624
-33321613100023220011100033320003213521051E5B6163595CFBA19DFEFF5A5A61605C
-5801059AA0FF47FEFCE1E3FEFD0108DEDE0107ACFD8D0273052664FEDEB8B8FEDD616566
-6863630120B9B6012167626869FD610122013BFEC5FEDEFEDBFEC901370106B300030069
-FFF0062405E1001D002A00370058403624182C321525062B32091509081603082A1E2532
-65006A0F041E150032150F00072B1518250407140F080839381F393F396F399039045D11
-12392FC4ED173910C42FED2FED5D002F3F1239392FED39392FED39393130011406070E01
-071523352E01272E01353436373E01373533151E01171E01073426272E0127113E01373E
-0101110E01070E01151416171E010624594F55F48AC586F6574F59564C51F395C594F64F
-4B57CE403B3A8E6A5E9A324142FD8E6A8E3A3A414340319B02F38CD9494F5D03A6A6035A
-524AD88C88CC4C515E049B9B03624E49D07F63A639383402FC8602392F3CAEFEAC037A01
-363737AA6170B63A2D3C0002006CFFE10443047C00130020005740162A032A203C1A301C
-38204F1A421C4820580668060A10B8FFC040230B1037120502110518410E0401081E4205
-0A1114021A0092221F223F22021B1B08852110F6ED5D10F6FD3232003FED3F3FED123939
-3F31302B5D2123350E01232202113436373E0133321617353303112E0123220615141633
-32360443BC51B067C8EB514544B56158884BBCBC4C78479EB0889650A475464E01340111
-8EDE4E4C502C2734FCB6027C221FDCCAC7CF47000002006AFFE104730614001900280086
-4029031C0520171526153B0A3A0E3A1C3E214C0A490E4A1C4F2153176B0E7B0E7A207B21
-1136264626021DB8FFE04034121C371D180A11371D171D0C050F133E1001263F030A1111
-001D0C0F1A1B00140F00902A0F2A1F2A3F2A6F2A040F0F231B06852910F6ED332F5D10E4
-113910ED11393911332F003FED3FFD323F33332F2B2B5D31305D01100023220011343637
-3E01372E012735211521151E01171E01073426270E01070E011514163332360473FEEBEE
-F1FEEB564045B45C4CB466032AFDCF44DE5D9676C26E6E4291423F55AA9C99A60227FEF0
-FECA012F01068DC5404852113F8748B39E0A2E9C5488FBA487E45608303532AE7FC9D0D3
-0001006DFFE603EE0478003D007C40432612263B363B49014418590154186A016F0B6418
-79017A0B7418792274350F0C2C3F2B2B03161A1A1E3E16043D3D393F0309192B40090C37
-2B241B10100C2B19040900B8FFC0401009143700003F7F3F803F02331B09863E10F6ED5D
-11332F2B1217392FED2F2B2F003FED332F3FED332F1112392FED3931305D250E01232226
-272E0135343637352E01353436373E013332161715232E01232206070E01151416171E01
-3B0115232206070E01151416171E01333236373303EE6BCE734FA446455771795B6C5F41
-40A24F62A45A0D42C3642D4E2A233338302D68356F9E3E642A2931342925653866E8470D
-40302A2028277F5E6090260718845C5975222120211CCF33380B140F432C3D440F0E03A6
-0911114A3B354A151314483E0002006AFFE1050F047C0011001D004D40163A15351B4A15
-451B040E3F0D05153E09041B3F030A0FB8FFC040190B0D370E0E090C0F0306121B00901F
-1F1F6F1F02181B06851E10F6ED5D10F4ED121739332F2B003FED3FED3FED5D3130011000
-232200111000333216172115211E010734262322061514163332360471FEE7E9F1FEEC01
-1AED376A1D01E0FEE03E44C2A49AA1A4A79C98A8022EFEE7FECC013C01110113013B1609
-A549C27FD7D6E0CDD1DAD7000001000A000003EE045D0007003840230301043F06054000
-4F0502000500021A05A003B00302030309080F093F094F097009045D1112392F5D33FD32
-2F2F5D003FFD322F3130012111231121352103EEFE6CBCFE6C03E403B8FC4803B8A50002
-0068FE6405EA047A001D0024007840163515740F022110090C37213E1A040F0522037717
-0117B8FFF0400F090C37173E0609050C75147A1E0211B8FFC040250D103711112217041A
-05050C1E1B3A0001008F260F261F264F266026040F2601141B0C852510F6ED5D5D10F45D
-ED12392FED3939332F2B5D003F3FED2B5D39393F3FED2B31305D011000051123112E0127
-2E01353412373315060215141617113E0133200003342623113E0105EAFEA9FEF3BB82DD
-51555E7685E58894E1BD214B270130015DC3E0C1CED30240FEFDFEC40FFE72018E065145
-4AC4869F01128A1163FEF6A7BDE60603E80201FED5FEFBB8DBFCB20AE8000002FFFCFE59
-051AFFAE000300070020400F02500101080650050D0400000905022F3311332F33003FED
-12392FED31300521352111213521051AFAE2051EFAE2051ECA78FEAB7800FFFF01230000
-03DC05D10036000400000117000401D90000001E40140302200D5F0D6F0D030D01000005
-10057F0503052F5D35352F5D35350001009A022A03C605F00016004DB90014FFE0B3090C
-3715B8FFE0B3090C3713B8FFF84017171B370110130D0D085313020E03012A000018100B
-2A0DB8FFC0B3090A370D2F2BFD3211332FED003F3FED332F1239332B31302B012B012311
-3426272E012322060711231133153E013332161503C6AC0E15164D40418D41ABAB4BA254
-9AA6022A0215466A2424234332FD4503AB683E45B9AB000200C8FFE508CA05D1004E005D
-00E240210B18044D19012E18204D55316A186631654D791375487952735A0D05200E1037
-3DB8FFE040310E103711001A46043B033F400B0D373F3F433E3B4F3501353B351E37213E
-34243134032C573450290129292B56342C0307B8FFC0403C0B0D3707070E3E0309202B3A
-4F4A4F0237341F1A20201A330606461A381D3E1A3E1A3E111A00005F0F5F014F13225F33
-7F33023333572A13702B012B2F5DFD32332F5D39ED5D11332FED33332F2F123939ED332F
-1112392FED39395D002F2F3FED332F2B3FED12392F5DED1217392FED393933332F5D2FED
-332F2B1112173931302B2B5D0114062322262735331E01171E01333236353426272E0127
-2E013534363723112311230E01070E012B01112311333216171E011733353315213E0133
-32161715232E01232206151416171E01171E01013426272E012B0111333236373E0108CA
-E2BE6ABA3D0917472D356145667943552A62377E6E0F12DDB57C0C3B2F4DCCA030BCF486
-B44847580A78B5017F24733155B53E0940B15B59723B562E642E7284FA5E36372F83572E
-1178962F2F2701429BC23C22D31331161A1E4C5A4844160B131026956E254426FC4E03B2
-45792F4D4DFDD505D12D302F9364DCDC12183024C935494E4F4648170C180C1E8E024F4D
-75241F1DFDA32D2F306DFFFF0089FFEB063E05D10036002C00000117002D035400000005
-B20F23015D00FFFF00AFFE59043D05DB0036004C00000117004D02280000001840115023
-60237F23030302500C600C7F0C030C2F5D35355D000200000000052706140016001A0065
-B90017FFE8403F0D10371818090C3719180910370315161575150318181701100D084213
-040E05010D08171740190119100B1A19300D500D700DAF0DCF0D050D0D021A00911C10F6
-ED332F5D33FD322F5D332F003F3C3F3FED12393F332F31305D012B2B2B2123113426272E
-012322060711231133153E0133321615090123130527BC1218195E4B4DA84DBCBC58BC63
-B5BEFC72FEF18AA5027C4D87262A294C3BFCBE045D7C4952DACD033FFDD1022F000100D5
-0366028705D100030027B90000FFE840140D10370118090C3702180910370101030300B1
-022FED003F332F3130012B2B2B090123130287FED688C205D1FD95026B00000200D50366
-041805D1000300070050B90004FFE8400E0D10370518090C37061809103700B8FFE84020
-0D10370118090C37021809103746000101050503070304B13F0601060600B1022FED332F
-5DED003F3C332F3C3130015D2B2B2B2B2B2B09012313210123130287FED688C20281FED6
-88C205D1FD95026BFD95026B00040095FFE3080705ED001B001F002B003700CA400C471D
-481F561D591F681E050BB8FFE040160E103701200E10371F1D1C071D171D021D291E1E1F
-29B8FFF44012090B37230C090B374F0D401B7A2F75350417B8FFE8404A0E103711180E10
-371F031B1B17512F034F0302030D030D115109022F51202940290229293551230A1E0840
-1E011C1E322A00260126262C2A1C1E062020390F39010D2000010000142A062FED332F5D
-335D11332F123939ED332F5DED2F2F5D003F3FED332F5DED3FED33332F2F5DED332F3F2B
-2B5D2B2B3130018710ED5D87C0002B2B015D010E012322263534363332161715232E0123
-220615141633323637330901230901140623222635343633321607342623220615141633
-3236032D1E934EC0D9DDBC417F3F0E3C73396D7F7B71497A250E02F5FCF4A5030C028ABE
-B2B5BABDB2B6BAB2596466585866645902BE1232E6D2C9F22121AD3233959C9698422302
-68FA2F05D1FBCCE0DADCDDE0DADADFAC8888ADAD87870002000FFFE8028605D3001B002B
-006E400D531D621D701C0316180B113705B8FFF040310B0F37001A010B1C051B1B051612
-120F5216092550050347080112121F2908401114372F0801081C1B001A0008030B2A01B8
-FFC0B3101437012F2BED17332F33322F5D2BED332F5D003FED3FED332F1112392F17392B
-2B31305D13371134363332161514020711141633323637150E012322263D0107133E0135
-3426272E01232206070E01150FB17B6F607C78A51D1B1A44693771395C6B4FF8622F0D0D
-0A190F0F19060B0C01A6EB01C7E299826D5CFEF7E6FE61592B214AA22C2B727FE162022B
-A980371E30110C0D0C0E156E5800000200920000044203B0000300070025401507CB0101
-05CB0307CB010105CB00031003300303032F5DED332FED002FED332FED31301321112113
-1121119203B0FC504C031803B0FC500364FCE80318000001008301BD0252038C00030017
-400B02020300000002300202022F5D332F002F332F3130011121110252FE31038CFE3101
-CF000002008301BD0252038C000300070023401306CB020205CB0304CB000006CB000230
-0202022F5DED332FED002FED332FED313001112111052111210252FE310183FEC9013703
-8CFE3101CF4CFEC9000100B10088042203F9000B0021401409090F032F034F0303030606
-00009000A00003002F5D332F002F5D332F3130133400333200151400232200B10102B7B6
-0102FEFEB6B7FEFE0240B70102FEFEB7B6FEFE0102000002007001AA026603A0000B0017
-0065400B06102326370610171A3700B8FFF0B323263700B8FFF04015171A3712CB06060C
-CB000910171A3709100B0E3703B8FFF0B3171A3703B8FFF040130B0E3715CB03030FCB00
-0920093009600904092F5DED332FED2B2B2B2B002FED332FED2B2B2B2B31300132161514
-06232226353436172206151416333236353426016B689393686893926949666748486766
-03A093686893936868934C674849666649486700FFFF001A0000055E073C023600240000
-011700D80031016B000AB602000C0B0607252B35FFFF0068FFE1041D05D1023600440000
-011600D8D900000AB6020036371D26252B35FFFF0073FFE5054608010236002600000117
-00D600A90175000AB601002F2B0F15252B35FFFF0069FFE703F3068C0236004600000116
-00D6F4000011400C014026502602002622060F252B5D3500FFFF0073FFE5054607500236
-00260000011700DA00A80175000AB601002C2B0F15252B35FFFF0069FFE703F305DB0236
-00460000011600DAF5000011400C012024302402002425060F252B5D3500FFFF00C80000
-049D073C023600280000011700D80033016B000AB601000E0F0203252B35FFFF006AFFE6
-046005D1023600480000011600D8F700000AB6020022231200252B35FFFF00C80000049D
-0801023600280000011700D900400175000AB60100120C0203252B35FFFF006AFFE60460
-068C023600480000011600D9FE00000F400A027026010026201515252B5D3500FFFF00C8
-0000049D0750023600280000011700DA004F0175000AB601000E0F0203252B35FFFF006A
-FFE6046005DB023600480000011600DA0000000AB6020022231218252B35FFFF0073FFE3
-05A208010236002A0000011700D600D00175000AB601002925070F252B35FFFF006CFE59
-0443068C0236004A0000011600D6FB000011400C0230354035020035311A23252B5D3500
-FFFF0073FFE305A207500236002A0000011700DA00CE0175000AB601002728070F252B35
-FFFF006CFE59044305DB0236004A0000011600DAF5000011400C0250336033020033341A
-23252B5D350000010073FE5905A205EC0038009540200906060E07261D06130E210E350E
-4901410E510E6506650B630E740E741C0F2CB8FFE04043090C37323236532E0D28032235
-40230123230C03101017340C021D34030A3131002A0F2B1F2B022B760901221022042B27
-040910216C25753A0F3A403A021A1509683910F4ED5D10F4ED331217392F2F5D2F5DED33
-2F003FED3FED332F1112392F5DED12393FFD322F3130012B5D0534262722242726023510
-002132041715232E01272E012322001110002132363711213521110E01071E0115140623
-22262735331E0133323603820302ADFEE066677001A1016C7F010999121F763945AF6FFA
-FEDD0130010660BF48FE7102535AD45E0103B79225742D091A583268626B152B0F5F6061
-0123C30165019D3D49EB184E1A1F29FEBFFEEEFEDFFEBF261E016DAEFD8129460F0E2516
-A2AC0E0CA00A1A4E0003006CFE590443068C002300300034009F406F243234320233200D
-10373D133E2A322C3A3044094B134C2A422C4B305B015D055A166A016C056A167C057020
-112F343F344F3403343433331E220512211528401E0407070B40030D2E41150731315033
-603302333300180F0601062124121A0006180092361F363F36022B1B18853510F6ED5D10
-E4113910FD32322F5D1112392F5D332F003FED3FED332F3FED1239393F11332F332F5D31
-305D012B5D2510002122262735331E01333236373E013D010E01232202113436373E0133
-321617373303112E01232206151416333236130323010443FEFEFEF459A9520A2EC86460
-7E23231E559B78C8EB514641BA5C6183490CB0BC4B81409BB2849952A534B3F301117FFE
-E4FEF61917C012352E29276E446644430121010790D14C474F272830FCD60261221DD0C6
-BCC23F058EFE8A017600FFFF00C80000053B08010236002B0000011700D600760175000A
-B60100100C060B252B35FFFF00B90000045F08010236004B0000011700D600220175001A
-4012014F1B6F1B9F1B031B112601001B170808252B35002B5D3500020020000005E305D1
-001300170060403D0E1201160408520B400C0F370B0B0C05350017101702170B10170304
-070C03070000120F150303140278190F19401950190309090B0E16030614076C1810F6ED
-1739332F5D10F6ED1739332F002F3F1217392F71ED12392F2BED17393130012311231121
-11231123353335331521353315330135211505E3A8C6FD19C6A8A8C602E7C6A8FE92FD19
-0455FBAB02D9FD2704558CF0F0F0F0FEA8CCCC00000100130000045F0614001E00504030
-031D161D751D0317140E51111112180D08421B041201010D08150F021A0091201F206020
-02141517030B1A110F0D881F10F63232FD17325D10F6ED2F2F003F3C3F3FED123912392F
-ED393931305D2123113426272E0123220607112311233533353315211521113E01333216
-15045FBC1218195E4B4DA84DBCA6A6BC0141FEBF58BC63B5BE027C4D87262A294C3BFCBE
-04F4869A9A86FEED4952DACD0002002C0000033307C8000B0025006DB9001BFFD040400B
-10370E300B10370C0C15520F1C1F1C021C191C192252700F010F0F09043206030A033201
-0825280F0C1F0C020C1828190C276D080B5A0A1405025A19036D2610F432ED32FDED32E4
-332FED2F5DED003FED323FED32332F5DED33332F2F5DED332F31302B2B29013533112335
-2115231133130E01232226272E0123220607233E01333216171E013332363702D5FDB4C3
-C3024CC3C35E077D663453262D3C20302D0288037E683351282A431D2E31019804A19898
-FB5F0730989724262B2A5B4B88A6242528295B470002FFF200000241063C0003001D0054
-40347C0673130204040DAA1440090C37141114111AAA0707020501081DAD0440090F3704
-10AD117F1F011F9204001A117F010101881E10F65D32FD32ED5D2FED2F2BED003F3F332F
-ED33332F2F2BED332F31305D21231133131406232226272E012322061523343633321617
-1E01333236350177BCBCCA6750283A1E202D17232170684E2F3220212C162421045D01DF
-81821A202322454181821B1F2322483E0002005F000002FF073C000B000F004D40150E32
-0D0D09043206030A033201082F0F3F0F020F0EB8FFC040150B0D370E0F116D0A080B5A0A
-140305025A0E036D1010F632F43210FDF43210E6332F2B2F5D003FFD323FFD32332FED31
-302901353311233521152311331321352102D5FDB4C3C3024CC3C32AFD6002A09804A198
-98FB5F060A9A0002FFFC0000023605D1000300070032401D025301010605057F00700202
-00027F0901099200041A027F050105880810F65D32FD32E65D2F2F5D002F3F332FED3130
-01213521032311330236FDC6023ABFBCBC05379AFA2F045D00020080000002DF07D3000B
-00190059401F0C701201121216AA0F0F09043206030A0332010819290C400B0E370C1329
-12B8FFC040130B0F37120C1B6D080B5A0A1405025A12036D1A10F432ED32FDED32E4332F
-2BED2F2BED003FED323FED32332FED332F5D333130290135331123352115231133131406
-232226353314163332363502D5FDB4C3C3024CC3C30A939C99979E454D49489804A19898
-FB5F073BA8CFCFA886726E8A00020001000002300668000D0011004840150006060A5003
-0310050F0D2900400B103700072906B8FFC040130B1037067F13011392000E1A067F0F01
-0F881210F65D32FD32E65D2F2BED2F2BED002F3F332FED332F3331300114062322263533
-1416333236350323113302308B8C8A8E924145414427BCBC06689AC0BE9C7A6B6283F998
-045D00010089FE5F031C05D10020004F402D1C20090C3709043206030A03320C01081717
-13531B0D1818102A1E1E0B02226D0A080B5A0A140305025A036D2110F4F43210FDF43210
-E61112392FED332F003FFD322F3F33FD323FFD3231302B21233533112335211523113315
-230E011514163332363733150E012322263534360174EBC3C3024CC3C3C2060942582141
-1309245122879A099804A19898FB5F981C29265150130B9E0A0BA08C22350002008EFE5F
-024605DB0003001B0056401C0820090C371B1753070D014402400B0D3702030E050D1104
-04142A0AB8FFC040170B17370A0A0E7F1D011D9200600F1A01607F0E010E881C10F65DE4
-FDE4E65D11332F2BED332F002F333F3F2BED3FFD3231302B01233533130E012322263534
-3637113311230E0115141633323637330183D4D4C3245122859C2508BC3C060742582141
-13090518C3F8990A0B9E8E3F6F19040BFBA31A361B5150130B00FFFF002CFFEB034D0801
-0236002D0000011700D6FF6C01750014B1011AB8FFC040090B0E37001A160415252B2B35
-0002FFC2FE5902AF068C0015001C005540340A011C0102551B651B751B0318161A1B1B1A
-1A123E150507070B40030D1A1A4F1301137F06010616121A1306160370150115921E10F4
-5D1732ED2F2F5D2F5D332F003FFD322F3FED332F332F1239395D31305D05140623222627
-35331E01333236373E01351123352137230B012313330209C8A828832C0A1C5F2D485816
-160DE901A5A69FB9B89BE4E31BC4C8100CB30B1C282828715103849EB40100FF00017B00
-FFFF00CDFE59057505D10236002E0000011600DCFB00000AB601001A0C0500252B35FFFF
-00C1FE5904AF06140236004E0000011700DCFF7C00000011400C01301A401A02001A0C05
-0A252B5D3500000100C1000004AF045D000B007D40512802D801DB090309010F0D1F011D
-021F0D2D012F0D300B400B540B69027A010C020203011A000B000809B4020B0A030A0802
-050A0507050105080B02600A700A020A0A00000D200D400D0208031A05890C10F4FD325D
-11332F332F5D3939003F3C3F3F1239393130018710C0C07AF51804C0018710FD08C0015D
-7121230107112311331101330104AFF8FE407ABCBC021FEDFDF901E974FE8B045DFDD102
-2FFDFC00000100C8FE59047605D1001A003F40240C20090C37111115530D0D0203043507
-01081010182A0A0A0105051C0F1C010414016C1B10F4ED5D11332F12392FED332F003F3C
-ED3F3FFD322F31302B29011133112115211E011514062322262735331E01333236353426
-02BFFE09C602E8FEE30204B79225742D091A583268620605D1FADFB0122F18A2AC0E0CA0
-0A1A4E581E3E00010005FE5901E906140018003D40240A20090C370F0F13530B0D020104
-01080E0E082A1616017F1A011A92041A7F010101881910F45DFDE45D12392FFD322F003F
-2F3F3FFD322F31302B2123113311331E011514062322262735331E013332363534260149
-8EBC6C0105AE8525642809184E285E52010614FA00123724A2AC0C0CA00B174F57153300
-FFFF00C8FE59053805D1023600310000011600DCFE000013400E01201630164016030016
-0A0400252B5D3500FFFF00B9FE59045F047C023600510000011600DC8B000013400E0100
-2310232023030023170D00252B5D3500000100C8FE59053805D10016009D401F00076107
-7107A107040C070B0C1B0736074607540765077507B001B0070A07B8FFC040510B113776
-06010F0102061F01150626013601340646014406560153066006790170060E0406015A01
-550602111115530D0D0207040806030A0104080110100A06010207130A78180F18401802
-0213046C1710F4ED5D10F4FD11393911332F2F003F33333F3C1239393FFD322F31300172
-715D5D002B5D71043501112311210111331114062322262735331E0133320480FD01B901
-330284B9CEB42751250B163A1E7F948A053EFACC05D1FBA00460FA18BFD10806A8050A00
-000100B9FE59045F047C00260045402B03150C191615751504100D084213040E050D081E
-1E22531A0D1D1D021A1791281F28602802100B1A0D882710F4FD325D10F6ED332F003FFD
-322F3F3F3FED123931305D0435113426272E012322060711231133153E01333216151114
-062322262735331E01333236373603A31218195E4B4DA84DBCBC58BC63B5BECCB4274E26
-0B163C1A4C6117162556024B4D87262A294C3BFCBE045D7C4952DACDFD0FBFCC0706A805
-0A262626FFFF0073FFE105DA0746023600320000011700D8009B0175000AB6020026270F
-03252B35FFFF006AFFE1047105D1023600520000011600D8E300000AB602001A1B060025
-2B35FFFF0073FFE105DA0801023600320000011700D9009C0175000AB602002A240F0325
-2B35FFFF006AFFE10471068C023600520000011600D9E400000AB602001E180600252B35
-FFFF00C8FE59059805D1023600350000011600DCF600000AB602002420050D252B350001
-001BFE590372045D002700574034000D100D200D032120090C370C090F131317430A0F05
-1C090826260253220D25251F2A05050913132940297029020C1B1A09882810F4FD325D11
-332F11392FFD322F003FFD322F3F2F3F3CFD322F11123931302B5D1E0133323635342627
-231133153E013332161715232E012322060711331E011514062322262735333C4E285E52
-0102A6BC70AB59312C2C0A2A4F3657A24B840105AE8525642809FA174F57153323045DA5
-5A4B0507C10A094D3DFCFB123724A2AC0C0CA000FFFF0086FFE505020801023600360000
-011700D6004A0175000AB6010035311A00252B35FFFF006EFFE503D7068C023600560000
-011600D6AF00000F400A017F38010038341A00252B5D350000010000000004EE05D1000F
-004140250D0A003203030F09043506030F0F111F114F11030B020B085B090D0009140204
-5B4F0501052F5DF432ED393910E4332F2F5D002F3FFD3212392FED393931300121352111
-21352115211121152111230214FEB4014CFDEC04EEFDEC014CFEB4C602E48F01AEB0B0FE
-528FFD1C0001003EFFEA02FD059E0023006E40210420090D37181507510A0A0E030F140B
-3E110F0E0523231F3F03094F257F250216B8FFC0401E090B3716160713008C250909070C
-0A0E111504181A0C07400D103707882410F62B32ED17392F12392F10F63211392F2B5D00
-3FFD322F3F3333FD322F1112392FED393931302B250E012322263D012335331123353311
-331121152111211521151416171E01333236373302FD357D31ABB27F7F7F7FBC0184FE7C
-012DFED30818164D4F2E64160A0A0E12B8CBA88601249E0141FEBF9EFEDC865358632B28
-251B0900FFFF00B2FFE1052907C8023600380000011700D700610175000AB601002B1E0D
-1D252B35FFFF00B1FFE104570653023600580000011600D70600000AB601002417091625
-2B35FFFF00B2FFE105290746023600380000011700D800630175000AB6010020210D1D25
-2B35FFFF00B1FFE1045705D1023600580000011600D80100000AB60100191A0916252B35
-FFFF00B2FFE105290801023600380000011700D900630175000AB60100241E0D1D252B35
-FFFF00B1FFE10457068C023600580000011600D90100000AB601001D170916252B350001
-00B2FE5F052905D1003400634044231223183D093D2139224C094C214B22771377170A33
-20090C372E2E2A53320D1C24060D031534060A2F2F272A00060023030C1B141E76360F36
-1F364036030F140C6B3510F4ED5D10F6ED1217392FED332F003FED3F1239393FFD322F31
-302B5D053436372206232226272E01351133111416171E01333236373E01351133111406
-070E01070E011514163332363733150E012322260314050509190F8CD0475147C621272C
-976A6B962D2721C647512D683D0405535A24511108344B2A8CA8741A271601494852E8A9
-037BFC7B798C394142414239936D038AFC85A2F1502C3B10143C17524E1B089F0E0C9F00
-000100B1FE5F0567045D002A005C40220B0619077A07032720090C370205150905114205
-0A010822221E53260D23231B2A29B8FFC04015091037292914021A17922C1F2C602C020B
-1A08872B10F4ED5D10F4FD32322F2BED332F003FFD322F3F3FED3F3C123931302B5D0437
-350E01232226351133111416171E0133323637113311230E011514163332363733150E01
-23222635340395065FAE69B0C4BC101A1B565249AD4BBC1E0607535A24511108344B2A8C
-A81D1D7C4B50D7D002D5FD8455792B2C284C3B0342FBA31B351B524E1B089F0E0CA08D24
-FFFF005C0000078D08010236003A0000011700D601690175000AB60100110D0600252B35
-FFFF005600000636068C0236005A0000011700D600BB0000000AB60100110D0600252B35
-FFFF0006000004E608010236003C0000011700D6FFEE0175000AB601000D090500252B35
-FFFF003DFE64047F068C0236005C0000011600D6DD00000AB601000C080400252B350001
-00B900000308061E0010002440140000043F0D0009080000081A6F097F090209891110F6
-5DED332F003F3FFD322F313001232E012322061511231134363332161703080A1F642679
-67BCC2BF3F652A055E09136B8CFB7D0482C2DA0C08000004001A0000055E08000012001E
-00210025013F40862B20372040205A18551A501E55206918651A651E0A180B170D4A0646
-125906561278027703082020211F02370187010201140012002021033704870402041405
-05060606091226062912370638124606491258127A0675120B24240C702501251651A00C
-F00C02060C160C3F0CF00C040C03340F2170210221212006120405201C401C020C1CB8FF
-C0406C393937501C701C021C01050824400E10370F242F240222222440090D372413290F
-0F2F0F4F0F8F0F9F0F050F19290009200940098009900905090F270106090F122405050C
-0024003A0042005A006A0074000700006E270F27010A052B0535054D05550565057B0507
-05642610E65D5D10E62F5D1217395D2F5DED2F5DED2F2B332F5D2B003F3C2F5D2B335D12
-17392F5DED2F5D72ED2F5D12392F3130015D8710FD5DC0C0C08710FD5DC0C008C0015D00
-5D212303210323012E013534363332161514060727342623220615141633323613090207
-2337055ED394FD8094C901F83139A17373A039302A47393948493838487DFEFEFEFD021D
-F39595019FFE6105571F65406D90906D40651FC4364B4A37394B4CFC6602CBFD3505B7CD
-CD0000040068FFE1041D07330032003F004B004F00D6B50C0A190A0230B8FFC040880B0E
-37590E51215C38690E63216F397B0A7A1474207B380A0208343D3011401102111149084F
-4F4E4E43AA062916299F290329400B0D37292F0123494F1F011F291F184149043D41080A
-01084E400D10374C4C4E40090C374E4E2640292F2C3F2C022C2C26297F468F4602464600
-0F1F011F1134021A001F0B0091510F511F513F51033A1B0B855010F6ED5D10E6113910FD
-32322F5D12392F5DED332F5DED12392F2B332F2B003F3FED3FED33332F5D123911392F2B
-5DED332F332F1112392F5DED123931305D012B5D2123350E01070E012322263534363736
-2437353426272E01232206070E010723353E01372E01353436333216151406071E011503
-110E01070E0115141633323603342623220615141633323613032313041DBB1955282F7A
-5297D26D6566011EA42E29296D3F3A692A3150130A2369311C259F73739E2E237D87BB56
-E9445164747763A443473939484938384895F3959577113D12171FC89B7F9D2D2D20081D
-4156171811140B0D1D07BF0914081E532E6D90906D335B1F22AA9AFE1D01370514131761
-5560614D042C364B4A37394C4D0262FEEE011200FFFF000E0000076D0801023600900000
-0117008D01DE01750011400C020F164F16020016140607252B5D3500FFFF0068FFE3073F
-068C023600A000000117008D01690000000AB6030055541B00252B35FFFF0073FF6E05DA
-08010236009100000117008D007801750013400E03303A403A603A03003A3B0F00252B5D
-3500FFFF005DFF6C0471068C023600A100000116008DE2000011400C03302E402E02002E
-2F0C00252B5D35000001015A03400249045D00030014400A01560205032D000201022F5D
-ED003FED3130012311330249EFEF0340011DFFFF005C0000078D08010236003A00000117
-004301730175000AB60100100D0600252B35FFFF005600000636068C0236005A00000117
-004300C30000000AB60100100D0600252B35FFFF005C0000078D08010236003A00000117
-008D01690175000AB601000F100600252B35FFFF005600000636068C0236005A00000117
-008D00BF0000000AB601000F100600252B35FFFF005C0000078D07500236003A00000117
-008E016C01750020B10213B8FFC040120D10370F13010100135F13020013100600252B5D
-355D2B35FFFF00560000063605DB0236005A00000117008E00BF0000001EB10213B8FFC0
-40100D10370F1301010013010013100600252B5D355D2B35FFFF0006000004E608010236
-003C000001170043000A01750014B1010AB8FFC040090D1037000A0A0500252B2B35FFFF
-003DFE64047F068C0236005C000001160043FF000015401001200B300B600B700B04000B
-090400252B5D35000001FFED03E40186061300030032B90003FFE4B70D10370101030100
-B8FFAEB30D103700B8FFE840090A0C3700007F0201022F5D332F2B2B003F332F3130012B
-010323010186A5F4010F0613FDD1022F0001FFD00685051606FD00030011B60150020000
-05022F11332F002FED3130012135210516FABA0546068578000100890000048B05EE0028
-00934063411253125B1A6312730273129024B603B6240923200551000810082008030808
-1F1C09510F0C1F0C3F0C4F0C040C141418490C01100202284A01080F2A1F2A022327021C
-1F20050C08215F1D6F1D7F1D031D0A061306081D13040220004000020000022F332F5D12
-17392F2F332F5D332F3333FD321139395D003FFD323F1239ED332F2F5DED3939332F5DED
-393931305D2901353E0137233533352335333534123332161715232E012322061D012115
-21152115210E01071521048BFBFE67620E9DA4A4A3FDCD6998400A3E98568C8B016CFE93
-016DFE8F0F705A0345CF1B817B868C86A7C801012211CE2A30A59094868C86659F2C0B00
-000200B1FFE60511053200180022005F4013380D391C491C580D6A217A21060C100B0D37
-07B8FFF0402A090A37191F290F2615690F790F05013222220F1F32150B0B07330F090C0C
-1913260001000024220114122FFD3211332F5DED332F003FED332F2FED12392FED5D2B2B
-31305D01211416171E013332363733150E0123200011100021320011272E01272E012322
-06070511FC66423C3AA3607AEA590D82C07FFEC9FEAD01420113FF010CBE02262928875A
-9FD50D027884B53E3C3B5648D53637015B0141013A0176FECDFEE92A549133333AD4B100
-FFFF00ABFFE1078305D50036023B9200003700BB023700000117024103F2FDC60016400C
-040302100A010B400B7F0B025D1135003F353535FFFF008CFFE107A405ED0036023DA600
-003700BB02910000011702410413FDC600384026040302360A0403023900392039403980
-39FF3905013100315B317B3103000900093F094F09035D11355D11355D11353535003F35
-3535FFFF008AFFE107A405DA0036023FA400003700BB02910000011702410413FDC60038
-4026040302320A040302350035203540358035FF3505012D002D5B2D7B2D03000900093F
-094F09035D11355D11355D11353535003F353535FFFF0099FFE1076F05DA00360240A600
-003700BB023100000117024103DEFDC6003640240403020E0A040302116F118011FF1103
-01092B093B0944095B097F0905000400043F04025D11355D11355D11353535003F353535
-00010061FE5901FA00880003002CB90002FFE840170D10370318090C3700180910370F01
-010101000D0202002F332F003F332F5D3130012B2B2B1B01330161A5F4FEF1FE59022FFD
-D10000010161FE59037000140014002440150B021B012B013901041207070B53030D0E2A
-0000062F332FED003FFD322F2F31305D0514062322262735331E0133323635342627331E
-010370B79225742D091A58326862060399020659A2AC0E0CA00A1A4E581D491913340001
-0212050C0305068C000300144009030302002D100301032F5DED002F332F313001032303
-0305319131068CFE8001800000030100050C0418068C00030007000B003F401506050AAF
-090902000002072B0640090A37060A2B0BB8FFC0400C090B370B06002D0B100301032F5D
-33FD322F2BED2F2BED002F332F12392FED3939313001032303012335330523353302FD31
-803101FDBFBFFDA7BFBF068CFE800180FE8CC3C3C300FFFF00070000055E05D102360024
-00000117019DFDF5FF450012400A020E03020E1F0E4F0E025D1135003F35FFFF00000000
-059005D10037002800F300000117019DFDEEFF4500204014010F030F111011401103011F
-0C010C00400101012F5D352F5D355D003F35FFFF00000000062E05D10037002B00F30000
-0117019DFDEEFF4500204014010F030F112011401103011F0C010C00400501052F5D352F
-5D355D003F35FFFF0000000003C805D10037002C00F300000117019DFDEEFF4500244018
-010F03011F0C010C00400201020F111F11401150116011055D2F5D352F5D35003F35FFFF
-0000FFE1069905F00037003200BF00000117019DFDEEFF45002240150227030F29010227
-1F270101000F000F100F700F035D1135355D11355D003F35FFFF00000000060105D10037
-003C011B00000117019DFDEEFF45002440180109030F0E1F0E2F0E03011F090109001F04
-4004700403042F5D352F5D355D003F35FFFF0000000006D705F0003701BB00B700000117
-019DFDEEFF45002A401E012B03011F2B012B00001C101C201C031C0F2D202D502D602D70
-2D8F2D065D2F5D35115D35003F350004FFCB00000267068C00030007000B000F005C401D
-0A090FAF0C0C06070706060205010B2A0A40090F370A0A0404000E2A0FB8FFC04015090F
-370F0F0707017F11011192001A7F010101881010F65DFDED5D11332F332F2BED11332F33
-2F2BED002F3F332F332F12392FED39393130212311331303230301233533052335330177
-BCBC0438543801B0ABABFE0FABAB045D022FFE800180FE8CC3C3C300FFFF001A0000055E
-05D1021600240000FFFF00C80000052B05D10216002500000002001A0000058605D10003
-00060058403C49056A050205041A000003061A01010215001A0125002A0145004A014B02
-4403590256036B0264037B0275030E020305030000080105010203065401002FED3F1239
-012F11332F17395D31308710FD8710FD04C0005D2901012109020586FA94023201080127
-FE50FE5105D1FAD7047BFB85FFFF00C80000049D05D1021600280000FFFF007E00000508
-05D10216003D0000FFFF00C80000053B05D10216002B0000FFFF0089000002D505D10216
-002C0000FFFF00CD0000057505D10216002E00000001001A0000056205D10006006C404E
-0902390258020378017703020203020114000600020314040405490546067C0573060405
-030405002400390042005A006A007400070000080F08010F08010A042B0436044D045504
-65047B0407042F5D5D5D11332F5D002F3F3130015D8710FDC08710FD08C0015D005D2123
-09012301330562D5FE2CFE2CCB022CF00505FAFB05D1FFFF00C8000005F605D102160030
-0000FFFF00C80000053805D102160031000000030072000004BF05D100030007000B0047
-40130535060609013502030A350908054009133704B8FFC0401609133704050504030204
-0908720D0F0D1F0D0209680C10E65D10E41117392F2F2B2B003FED3FED12392FED313001
-213521032135211321352104BFFBB3044D34FC1B03E534FBB3044D0521B0FD08B0FC77B0
-FFFF0073FFE105DA05F0021600320000000100C80000053B05D100070027401703350603
-010501140078090F0940095009030414056C0810F6ED5D10F6ED002F333FED3130212311
-2111231121053BC6FD19C604730521FADF05D100FFFF00C80000049605D1021600330000
-000100760000050005D1000C00EB404709040908450B540B6409640A660B9309930A960B
-A409A30AA70B0D0608060B1608160B28032708340A340B430A430B5903550B670B760B8B
-0399049908B804B808EB04EB08150BB8FFC0B32529370AB8FFC0B325293709B8FFC0B325
-293708B8FFC04030262937030203080908B3040304030B0A0BB302030264048D02020403
-0203080B3501083505030403A009B009D0090309B8FFC04023191E371009200960097209
-D009E00906090703040B0908070602000010000200000E022F11332F5D1217392F2F5D2B
-71332F003FED2FED11173931305D011087ED87C01087ED8708C0012B2B2B2B5D71290135
-090135211521011501210500FB76026CFDA80448FCC0024AFD8A039AB80258020EB3B0FE
-061AFDA3FFFF0000000004EE05D1021600370000FFFF0006000004E605D10216003C0000
-FFFF00440000053805D10216003B0000000100B30000064405D10023006240402515251E
-021B067518011834380948096F090309192209030810030822142311141023071B180714
-108008A008B0080320255025702503080825240F253F25025D1112392F5D5DC4ED393910
-C42FED2FED002F3F1217392F5DED5D393931305D011406070E01071123112E01272E0135
-1133111416171E01171133113E01373E013511330644514D50E197C59AE24B4E51C63B34
-359A62C5619C353836C6038E9DD74345460AFEBE01420B484245D69C0243FDA66D8E2C2D
-2F0703E4FC1C082D2E318571025A0001006C0000062005F00027007D40125B195B256C1A
-641D64216C24791A79240821B8FFC0B3090B371DB8FFC0403B090B373002301440024014
-041925140204160B341F02261835011608251202191214081502141C272222290F29010F
-291F299029A029040E15171C2FC4ED5D5D11332FC4123939ED2FED2FED003F3CFD3C3FED
-1217395D31302B2B5D2901113E01373E01353426232206151416171E0117112135213526
-023510002120001114020715210620FDC03C772C2D34FEDCDCFE342D2D763CFDC0019A9D
-CB0177013101310177CB9D019A01832658393B9F6ACEF9F9CE6A9F3B395826FE7DAE7C5A
-0138C20114015EFEA2FEECC2FEC85A7CFFFF007E000002E207500236002C00000117008E
-FF240175001940130200104010501060107010050100100D0409252B355D3500FFFF0006
-000004E607500236003C00000117008EFFED01750019401302000E400E500E600E700E05
-01000E090500252B355D3500FFFF006CFFE10443068C0236012E00000116019DE200000A
-B6020024210800252B35FFFF006DFFE603EE068C0236013000000116019DCC000013400E
-014041504170410300413E1219252B5D3500FFFF00B9FE64045F068C023601C600000116
-019D1D00000AB601001A170E16252B35FFFF00A000000193068C023600D500000117019D
-FE8E0000000BB601000704020325012B3500FFFF00B1FFE2045C068C023601D100000116
-019EFB00000F400903020100221F0717252B35353500000200B9FE64048D061400180037
-0077404F16200D1037070F4A1B4326433756267929062E200D0F3733200D103705200D10
-371615203E5F21012121032B3E0C0135400309080C15120F200120281B12122008191B00
-90391F390132071A08883810F6FD325D10F6ED1239392FED2F5D1239003F3FED3FED1239
-2F5DED393931302B2B2B5D012B011400232226271123113436333216171E011514060715
-1E01073426272E012B0135333236373E01353426232206070E0115111E01333236048DFE
-F3CD4FB03FBCFDDF5A953B39448B7F9FBCC2453A3B924924244282272E2D8A6D49682120
-1E42964895A101BCCAFEF82C2AFE2405D2E0FE2B2E2B8A5B7FBD25111AC797596F1F2016
-A01D1E2262557074352C2C753EFCA2261F9D0001003DFE64047F045D0008006940497507
-01070607081A00010007061A04050505030C0A001A002A004A0059006900750007000505
-15052505450556056605730507050001011A059004A0040204040A091F0A4F0A5F0A035D
-1112392F5DC4ED10C42F5D2F5D003F3F31300187FDC08710FD08C0005D09011123110133
-0901047FFE37BCFE43CC0157015A045DFBDBFE2C01D40425FCC4033C0001006CFE6403D6
-0614002F0058401D4600570065287F1178207D21061D1A3E1B012D3F0F070C1A1A19121C
-07B8FFE04018090C37000701071C070BB40303310F313F3102231B12853010F6ED5D1133
-2FED33332F5D2B2F1239392F003F2FED3FED3931305D251E011514060723353E01353426
-2B012226353412373E013735213521150E01070602151416171E01171E013B013216039A
-201C5A43B35A4C3D2F91E5DE5C4E4BC56CFE3402E875E55A5972060C0A31272479385647
-664B285B2854A93F0E4F7745394CE8E58C01007770CD5E099E874ECE7875FEE88F224828
-264B18160534000100B9FE64045F047C00160038402303151615731503100D084213040E
-05010C0D08021A0091181F18601802100B1A0D881710F6FD325D10F6ED003F3F3F3FED12
-3931305D0123113426272E012322060711231133153E0133321615045FBC1218195E4B4D
-A84DBCBC58BC63B5BEFE6404184D87262A294C3BFCBE045D7C4952DACD0000030089FFE1
-04750614001700240031006CB9002FFFD6B30A0D3729B8FFD640400A0D37212A0B0D371B
-2A0B0D37662C01263E0F241F24022424061E3E3A124A120212012C3E3506450602060A25
-181A0000331F333F330224261A800C900C020C2F5DFD325D11332FFD32003F5DED3F5DED
-12392F5DED5D31302B2B2B2B011406070E01232226272E01353412373E01333216171612
-072E01272E01232206070E010705211416171E01333236373E0104752E243AD29898D23A
-252D2D2639D39797D339252EBD043120296C4F4F6C29222F040272FD8E2E2428704F4F70
-28242E0300BEFD548789898754FDBEAE010753828A8A8254FEFA548FD6364639394637D5
-8FA18EE93E453E3E453EE900FFFF00BB00000177045D021600D50000000100C1000004A8
-045F001800D3403B0601060216182618451856186618071C023A0169027A029701A602A6
-18C70208020203C60101860101011A001800090801F90801080B0A03090109B8FFEE4040
-10183709B402181703177F0301091808020305010C1010143F0C05060505011A172A1736
-178017A417051517251777179417E917F917060917180201050F0F00B8FFF04013090E37
-00001A0F1A1F1A3F1A0308031A05891910F6FD3C5D11332F2B332F17395D71002F2F3F3F
-FD322F111217395D3130018710C0C07AF52B7118C0C004C07172018710FD5D7108C0015D
-71212301071123113311013E013332163315232E01232206070304A8F8FE3D70BCBC0180
-487F3F1C3C070B102F0D2F4D1DFB01E96DFE84045DFDDA01A14F3802A602022F21FEF100
-0001003D0000047F061400070085401305040502020306011A07000002031A04040505B8
-FFF0401C0C10372B002604200703050402030601000806680701070506030400B8FFC040
-260910370C001C004B005A006A00790006008D090F090103041304440455046504760406
-04820810E65D5D10F65D2B1117395D2F003F3F17393130015D2B8710FDC01087FDC008C0
-08C0012123090123010333047FCDFEB8FE97C401D1D7D3033DFCC3042001F400000100B9
-FE640465045D00150046402C12200B0D3703200B0D37080205140B051042050900080A0C
-0102131A0092171F1760179017030D091A0A881610F6FD3C5D10F6FD3939003F3F3FED3F
-3C12393931302B2B2123350E012322262711231133111E013332363711330465BA4A874E
-4B7854BCBC209E5B5D8836BC764E3D3650FDF305F9FCBA2752433C034000FFFF003D0000
-047F045D02160059000000010068FE64041106140046008A403C0F020F06090E1B0E241E
-24283415361E36284428473C562D563C691779170F1918333F32320C24213D22013F3F0C
-030C191C3232232121122B1B1C04B8FFD6400E090C37040408B4231C1280000100B8FFC0
-400B090C370000483A1B12854710F4ED11332F2B5D123939ED332F2B2FED12392F2F332F
-1239003F2FED3FFD3212392FED393931305D0514060723353E013534262B012226272E01
-353436373E0137352E01353436373523352115212206070E01151416171E013B01152122
-06070E01151416171E013B013216171E0104115B42B45C4B3A2E8C8CB93F424532302C89
-4C7D96575AE40338FF00446D302D3641332D7650AAFED942692F2B334B403F995A1C4467
-211F226055A83F0E4F7844374E36393C97584E84353145130B1CA56853873A069A9E1D22
-2066434F621A1716A52827256A3B66721919072F25235F00FFFF006AFFE10471047C0216
-00520000000200B9FE640494047C0011001E0042402C3A17351E4A17431E560D05060315
-3E0F041C400309080C121B3A004A00020090201F206F200219071A08881F10F4FD325D10
-F65DED003F3FED3FED123931305D011000232226271123113436373E0133320003342623
-220615111E013332360494FEEBDE41A348BC47423EBB66F30100C2A0929E8D49774BA2B0
-0241FEFEFEAB242BFE2B04227BB9423E42FEDAFEDFDACCC0B6FE6D221DDE00010069FE64
-03FA04770029005C40120C020C06201325233614362340237A1F0817B8FFE040140E1037
-3F194F190219191D3F1504030C263F0B04B8FFD64011090C370418180408B400002B201B
-12852A10F4ED11332FED33332F2F2B002FED3F3FED332F5D31302B5D0514060723353E01
-3534262B012226272E013510002132161715232E01232206151416171E013B01321603FA
-5E3EB1564D3C2D5C75C64B49530137010354A0430C5E9D44A6BD393232814B64738E6057
-AA3B0E4B7947364F3C4342D092010E0144251BD33E32EEC1708E2D2C2799000100B1FFE2
-045C045D00170030401F1607050F3E0903560366037903880305030A151A0091191F1901
-091A06871810F6ED5D10F6ED003F5DED3F333130011406232226351133111416171E0133
-3236373E01351133045CF4E2DFF6BC14201F6B5C56731E1D15BC0197DADBD7DE02C6FD7F
-5D782E2B2B2C2C2C7B5A028100010030FE640488045D000B00A240492A02250839023408
-4B02440879020710091A0A0B0A071A060506011A000B00031A04050402050B080A000606
-0A0405064A0445066A0465067A04770608040C0605080B050204040A00B8FFE040100A10
-3700000D2F0D010604200A1037042F2BC45D11332F2BC4121739003F3F5D111739313001
-8710ED8710ED8710ED8710ED4B535840140B030A070002030A0601080409070005040906
-010F0F0F0F59005D0123090123090133090133010488D5FEA6FEA2CB01BCFE4FD5014F01
-53CBFE4FFE64026BFD95030202F7FDA80258FD11000100B0FE6405E3045D0023006B4047
-1B062618751802183D39094909020919220903081005080C221A3F237F230223111A3010
-7010021023071B18071A109008C008025025602502080825240F25010F251F253F25035D
-5D1112392F5D5DC4ED393910C42F5DED2F5DED003F3F1217392F5DED5D39393130011406
-070E01071123112E01272E01351133111416171E01171133113E01373E0135113305E360
-4F52C873BB73C753505FBC4B34388643BB4386383B44BC01BE72A835373705FE68019806
-343936A772029FFD9C718723261E0403C7FC39051C27287B7802640000010071FFE20611
-045D003D0079402D361F3632441F4432551F55326804680F691A69377D1A7D370C283B28
-0903061605210D303E060A3A400C0E3718B8FFC040240C0E37361B001B1B13003A29090A
-291A18139028A028C0280328283F3E1F3F3F3F6F3F035D1112392F5DC4C4ED393910C4C4
-2FED2FED2B2B003FED39393F1217392F31305D011406070E0123222627230E0123222627
-2E013534123733150602151416171E01333236373E01371133111E01171E01333236373E
-01353402273533161206112F33379D7360A2250627946671A333332F7290E4879F101E1A
-5D47334714161D06BA091C1518393A465E1B19169D89E4907201F760C14B505963434462
-5D4C4CBF61AA0115A7116CFECCB742713F37491911122C0F0248FDB8112C111316473937
-7A41B601346D11A7FEEBFFFF00050000022D05DB021600770000FFFF00B1FFE2045C05DB
-023601D100000116008EFB000015400F02301D501D601D0301001D180717252B355D3500
-FFFF006AFFE10471068C0236005200000116019DE200000AB602001B180600252B35FFFF
-00B1FFE2045C068C023601D100000116019DFB00000AB601001B180717252B35FFFF0071
-FFE20611068C023601D400000117019D00B60000000AB60100413E1300252B35FFFF00C8
-0000049D07500236002800000117008E00500175000DB7020100110C020325012B353500
-0001FFFF0000060705D1002500614025652476240216341F1F061E1A351B03093506182F
-073F074F077F0704070717590F010F1500B8FFC04014090D370000270F27011A1F1D011D
-1D1F17141A182F33FD32322F5D2F5D11332F2BED5D12392F5D002F2FED3FFD3212392FED
-31305D011406070E012B0135333236373E01353426272E01232111231121352115211121
-3216171E010607534957AF8A6E5D5B782F38343135329583FEEBC6FE520468FE0C015398
-BF554C4901CC6CB13A4530B11022286F4E4B73232213FD220521B0B0FE6824423BAEFFFF
-00C80000048A07ED023601EB00000117008D003501610015401001300840086008700804
-0008070405252B5D350000010073FFE5053905EC002A006A400C3A1C491C58057606790C
-0511B8FFE040370A103701200A103720341D1D0F032A2A26340309131317340F021E1E13
-000010000200002C0F2C010F2C1F2C2F2C3F2C041D206C09682B10F6FD325D5D11332F5D
-33332F003FED332F3FED332F1112392FED31302B2B5D250E012322242726023534123736
-243332161715232E01232206070E01072115211416171E013332363733053963EC91A9FE
-EE61616969625F0112A98CF65F104EF98D6DAE4846580F0334FCC258474AC4708AF75010
-4127356863630120B7AF011F66626C3427DF40523A3B3BAD72AD8BD94648494A4300FFFF
-0086FFE5050205EC021600360000FFFF0089000002D505D10216002C0000FFFF007E0000
-02E207500236002C00000117008EFF240175001940130200104010501060107010050100
-100D0409252B355D3500FFFF002CFFEB02EA05D10216002D000000020012FFFD08A205D1
-000E003D0066B3460C0130B8FFACB30A10371EB8FFC0401D0B0E37073437371618353503
-28282C352408341637081416163500150FB8FFF440110E11370F713F2F3F011813003501
-3535282F332F5DED5D10F62BFD11392FFD32002FED2FFD322F3FED12392FED31302B2B5D
-013426272E01232111213236373E01371406070E01232111210E01070602070E01070E01
-2322262335331E01333236373612133612372111213216171E0107D33235379083FEEC01
-0F858F363834CF554754C098FDEEFDF0030B0308251D1D492F306544153C0C0E0A1E0F24
-401647430E050B040391015298C0554C4901C94B72232510FDCB1A252769556CB0374238
-052171D955D6FEEC595A6B2B2C2603C001021617470146012D62014487FDB823423BAE00
-000200C80000088305D1000E002700554020171E07342121161F1B030834161A560F0120
-1F081400166F160216161900150FB8FFF4400F0E11370F71294029011D19141A6C2810F6
-FD325D10F62BFD11392F5DED39395D002F2FED3F3312392FED39393130013426272E0123
-2111213236373E01371406070E0123211121112311331121113311213216171E0107B432
-35379083FEEC010F858F363834CF554754C098FDEEFD65C6C6029BC6015298C0554C4901
-C94B72232510FDCB1A252769556CB037423802DEFD2205D1FDB80248FDB823423BAE0001
-FFFF000005FD05D1001D00504032000E48175817600E620F700E700F0708011A350B0B01
-07033504031301131412121F5F067F0602060306070014037F0101012F5D33FD32322F2F
-5D11332FED002F333FFD3212392FED123931305D2123112135211521113E01333216171E
-01151123113426272E01232206070273C6FE520468FE0C5FF66765AA3D3D45C6161E2079
-646AC3660521B0B0FE2D1F33323534A373FE11018C4A8C2B2E312622FFFF00CD00000575
-07ED023601F200000117008D003C01610010400A01702301002321050025012B5D350002
-0006FFF904E6078F001A002800AF405A29033801461955140419191A1814171617161716
-191A130001001617181A010500070B0B0F35071B0F21702102212175250125AA0F1E011E
-1E0003281A1B221A702101211B2100700A010A360156016501760104160A01031700B8FF
-E0401409103700002A502A012A400910371720091037172F2B2B5D11332F2B1217395D2F
-5D1139392F5DED2FED003F332F5DED5D332F5D332FED322F11121739018710FDC008C001
-8710FD08C03130005D09010E01070E012322262735331E01333236373E013F0101330901
-030E0123222627331E013332363704E6FDCA225D3634612D2872100E0F462D14481C203F
-1624FDD6DB01B301862105C9A8A8C905B602605E5F5F0205D1FB1B4C621B19110801B902
-09060B0C34324F044FFC92036E01BEA6A8A8A67063627100000100C8FEAF053B05D1000B
-0032401C060203043409000B0913000002061407780D400D700D020314026C0C10F6ED5D
-10F6ED12392FED002F2F33ED3F33313029011133112111331121112302A4FE24C602E7C6
-FE24BB05D1FADB0525FA2FFEAF00FFFF001A0000055E05D1021600240000000200C80000
-052C05D100120021003E40256311011A340C0C070B3508031B3407080A0A131556000100
-71230F234023020C1B14076C2210F6FD325D10F45DED332F003FED3FED12392FED31305D
-011406070E0123211121152111213216171E01073426272E01232111213236373E01052C
-554754C098FDE403E5FCE1015C98C0554C49CF3235379083FEE20119858F36383401CD6C
-B037423805D1B0FE6823423BAE724B72232510FDCB1A25276900FFFF00C80000052B05D1
-021600250000000100C80000048A05D10005001F401003013504030000070F0701021403
-6C0610F6ED5D11332F003FED2F3130012111231121048AFD04C603C20521FADF05D10002
-000AFEAF059E05D1000D00130049402A09121A124A110310340A030C1307340301051013
-0A0A070E140C0C0113200001000015131307070413052FED392FED11332F5DED392FED12
-392FED002F332FFD32323FED31305D01231121112311333612112111332111210A010705
-9EBCFBE4BC78829B03728DFEADFE0E0E9476FEAF0155FEAB0201D602B1019AFADF0475FE
-9BFDAFBFFFFF00C80000049D05D102160028000000010020000007A805D1003700C7402E
-093318332933401D40244135541D54247518711D73240B27133333351A130E0C0E020116
-09103701130037000708B8FFEA405A091037081309090A271F1A032C223237070A0C0E33
-35072C02142D350409021521052C03002F0A20375F0A50376F0A6037062C2C0137022733
-350600C5220414051515080A070C0E1A0609C51F0505393810393F395F397F39045D1112
-392F33F41739322F10FD32F41739322F5D002F3F1739FD322F121739FD111739018710FD
-2BC08710FD2BC08710FD8710FD3130005D21230123112311230123012E01272E01272E01
-2B0135333216171E01171E01171133113E01373E01373E013B0115232206070E01070E01
-0707A8F2FDF469C46BFDF4E6025158682013251C1B533C3C47A7B23D0B1E0F2C8F56C45C
-912E121D093CB5A5473C424B1E1D25132A7D3E02A9FD5702A9FD5702FE3A9C693D571C1B
-18B17FAD1E5824696608029DFD610663702C5519AC80B1171C1B5B3A8587270000010051
-FFE5048505EC0040007F40145401583B6701693B7F0B7F0C7031703274380932B8FFE040
-3F0B10370B200B10373E3D1D3420200934703001303029343402100D7F0D020D0D113409
-0A3D1E0B0D37171E0B0D37236C3A1E1E3D3A030C171503734231310C2F332F10F6ED1217
-392F2FED2B2B003FED332F5D3FED332F5D1112392FED393931302B2B5D011E0115140607
-0E012322262735331E01333236373E01353426272E012B0135333236353426272E012322
-06070E010723353E01333216171E0115140607151E010416303F5B4650E68593FB4A0F63
-F97148A83436313C33339159C9B3ADD2352E2D6F4C4E843B3064170D4BF87E7BB14B4E52
-A37D347602CD2A816669AA3C4444371EDE3B4B2A292D6F454F651F1E1BA97F7836521818
-151E1411340DDB2036272C30885A7FB01B0F092F000100C80000053905D1000900644023
-0B020407190703070715075B0253076C0262077F0270077608C802E602E707F6070D07B8
-FFE840240B0F3702100C0F3707060102040308030308030807021400780B0F0B400B0207
-14046C0A10F6ED5D10F6FD113939003F3F1217392B2B31305D7121231101231133110133
-0539C5FD1CC8C502DBD104A9FB5705D1FB690497000200C800000539078F000900170093
-40320B020407190703070715075B0253076C0262077F0270077608C802E602E707F6070D
-0A0F10701002101014AA0F0D010D0D07B8FFE840330B0F3702100C0F3707060102040308
-030308171A500A600A020A111A100A10000403080702140078190F194019020714046C18
-10F6ED5D10F6ED113939111239392FED2F5DED003F3F1217392B2B332F5DED332F5D3331
-305D7121231101231133110133030E0123222627331E01333236370539C5FD1CC8C502DB
-D1B505C9A8A8C905B602605E5F5F0204A9FB5705D1FB69049701BEA6A8A8A67063627100
-000100CD0000057505D1002000AF407909011F01290127203A0137204B0147205C016500
-6720760074200D1F200A0D370C200A0D370202038801C8010201B30020001E661B861B02
-1B13120D120D121B1E04152002322F08010808000716351503070305000D121B1E200504
-4F150115150F2220003000400004500001006E22402201080414056C2110F6FD325D10F6
-5D5D322F5D121739002F2F3F3FED1112392F5DFD39121739018710FD5DC031300187107A
-FD5D1808C0012B2B5D2123012311231133113E01373E01373E01373E013B011523220607
-0E01070E01070575FEFDA387C6C6335A28284E1E0D231245B9B44F53454E1F1D2B17346B
-5A02A7FD5905D1FD6401121917553E1B522DA686B1191D1A583B847C2E0000010012FFFD
-051805D10021003DB9001BFFACB309103709B8FFC0401A0B0E370335200301131317350F
-01140078238F230103132020122F332FED5D10F6ED002FFD322F2F3FED31302B2B212311
-210E01070602070E01070E012322262335331E0133323637361213361237210518C6FDE6
-030B0308251D1D492F306544153C0C0E0A1E0F24401647430E050B04039B052171D955D6
-FEEC595A6B2B2C2603C001021617470146012D6201448700FFFF00C8000005F605D10216
-00300000FFFF00C80000053B05D10216002B0000FFFF0073FFE105DA05F0021600320000
-000100C80000053B05D100070027401703350603010501140078090F0940095009030414
-056C0810F6ED5D10F6ED002F333FED31302123112111231121053BC6FD19C604730521FA
-DF05D100FFFF00C80000049605D1021600330000FFFF0073FFE5054605EC021600260000
-FFFF0000000004EE05D102160037000000010006FFF904E605D1001A0080403C29033801
-461955140419191A1814171617161716191A130001001617181A010500070B0B0F350700
-03700A010A360156016501760104160A01031700B8FFE0401409103700001C501C011C40
-0910371720091037172F2B2B5D11332F2B1217395D2F5D003F2FFD322F11121739018710
-FDC008C0018710FD08C03130005D09010E01070E012322262735331E01333236373E013F
-010133090104E6FDCA225D3634612D2872100E0F462D14481C203F1624FDD6DB01B30186
-05D1FB1B4C621B19110801B90209060B0C34324F044FFC92036E00030069FFF0062405E1
-001D002A00370058403624182C321525062B32091509081603082A1E253265006A0F041E
-150032150F00072B1518250407140F080839381F393F396F399039045D1112392FC4ED17
-3910C42FED2FED5D002F3F1239392FED39392FED39393130011406070E01071523352E01
-272E01353436373E01373533151E01171E01073426272E0127113E01373E0101110E0107
-0E01151416171E010624594F55F48AC586F6574F59564C51F395C594F64F4B57CE403B3A
-8E6A5E9A324142FD8E6A8E3A3A414340319B02F38CD9494F5D03A6A6035A524AD88C88CC
-4C515E049B9B03624E49D07F63A639383402FC8602392F3CAEFEAC037A01363737AA6170
-B63A2D3CFFFF00440000053805D10216003B0000000100C8FEAF05BE05D1000B0032401C
-0602030B08043501080514080800130D40090B370A0A0D0414016C0C10F6ED11332F2BED
-392FED003FFD322F3F3331302901113311211133113311230502FBC6C602DDC68DBC05D1
-FADD0523FADDFE010001008E000004EA05D10019003B40243511451154116C0974160502
-0C1435050500180C030017011400781B0F1B010D140C6A1A10F6ED5D10F6FD32002F3F33
-12392FED123931305D2123110E01232226272E01351133111416171E0133323637113304
-EAC681DD6463AC3F3F47C6142323726B71D652C60276282A313535A47201FCFE67577930
-2F2F281E02B1000100C80000077605D1000B003640200A06020308043401091400C60814
-05041401C605050D0C1F0D3F0D500D700D045D1112392FF4ED10FDF4ED002FFD323F3333
-31302901113311211133112111330776F952C6022EC6022EC605D1FADB0525FADB052500
-000100C8FEAF080305D1000F004140260A0602030C080434010F0D13000009140CC60814
-05041401C6050511101F113F1150117011045D1112392FF4ED10FDF4ED332FED002F2FFD
-32323F33333130290111331121113311211133113311230747F981C6022EC6022EC68DBC
-05D1FADB0525FADB0525FADBFE0300020000000005F405D1000E00210046401D07341B1B
-1618351903083416560F011B08144F167F160216161900150FB8FFF4400A0E11370F7123
-0F2301192F5D10F62BFD11392F5DFD325D002FED3FED12392FED3130013426272E012321
-11213236373E01371406070E0123211121352111213216171E0105253235379083FEEC01
-0F858F363834CF554754C098FDEEFE660260015298C0554C4901C94B72232510FDCB1A25
-2769556CB03742380521B0FDB823423BAE00000300C80000069505D1000E001F00230055
-4016440D0107341919161703083416220321560F0100150FB8FFF4B30E11370FB8FFC040
-150C10370F0F21142078250F25702502190814166C2410F6FD325D10F6FD322F2B2BED5D
-002F3F2FED3F12392FED31305D013426272E01232111213236373E01371406070E012321
-113311213216171E010123113304533235379083FEEC010F858F363834CF554754C098FD
-EEC6015298C0554C490173C6C601C94B72232510FDCB1A252769556CB037423805D1FDB8
-23423BAEFDC505D1000200C80000052205D1000E001F003C401007341919161703083416
-560F0100150FB8FFF440110E11370F71210F21402102190814166C2010F6FD325D10F62B
-ED5D002FED3F12392FED3130013426272E01232111213236373E01371406070E01232111
-3311213216171E0104533235379083FEEC010F858F363834CF554754C098FDEEC6015298
-C0554C4901C94B72232510FDCB1A252769556CB037423805D1FDB823423BAE0000010061
-FFE5052905EC002A0070400A3A1C491C640676060426B8FFE0403E0A10370B200A103718
-34191928092424203428020D0D11340909060316035603031A24171403732C0F2C010F2C
-1F2C2F2C3F2C04241824180F0C1F0C020C2F5D33332F2F5D5D10F6ED11395D003FED332F
-3FED332F1112392FED31302B2B5D0116121514020706042322262735331E01333236373E
-01352135212E01272E012322060723353E0133320404616068696366FEEFA38DFE571051
-F78D7BCC444849FCD303230E5C4747B46689F057115DFE85AC010F052C60FEE4C2ACFEDF
-676A6B3625DB414D574B50C980AD77AF3939374D43DC27356000000200C8FFE107D305F0
-000B001E006240427814010903060915161A1C5616591C7916761C080C34131E1314031C
-03341602100309341C090F13190615180C3F0C580C6F0C040C0C0F0015197320120E140F
-6C1F10F6FD3210F6ED12392F5DED1239002F3FED3F3FED1217392FED5D31305D01100023
-2200111000333200012311231133113312002120001110002120000705FEFFDBDDFEFE01
-03DCDB0101FB79F0C6C6F924016A0113013F016CFE90FEC5FECCFE9102E801280135FECC
-FED7FEDBFEC90136010EFD3005D1FDAC012D0146FE63FE95FE93FE6601890002002C0000
-04DE05D10010001F0066400C28033506471C5A0759170504B8FFE8403209103703041305
-0506060F113440030103030012340F03000519150904060309045F050105120114007821
-0F2140216021035D10F6FD322F5D17392FED002F2F3FED12392F5DED12393130018710FD
-C02B005D212311210123012E01353436373E0133210311212206070E01151416171E0133
-04DEC6FEBFFE43EE01DE96A55F4E47BE7301EAC6FED256682B2E3425292D82560250FDB0
-026E33D5B372A5373228FD240232161D1F7043506A292C1EFFFF0068FFE1041D04780216
-0044000000020074FFE1047C061D00270039006440160C1F35043D29303940044B294039
-6512751273330A33B8FFC0402B0B0D3722062B41002510250225250619411800373F060A
-223118180C281B03903B1F3B3F3B02311B0C863A10F6ED5D10F6ED12392F1239003FED3F
-ED12392F5DED123931302B5D011E01151400232226272602353436373E01373E01373E01
-37150E01070E01070E01073E01333216133426232206070E01151416171E0133323603EE
-4648FED4DB6CB640504F0E19144D3548EBC24F883642814080CF303535084BB3655EAE0F
-B29257A04802033A352E6C3E97AA03B846C786FAFEB6494C5F0121D04B9B6C5DAC354959
-11070904AD0408060B3E3135AB4D36493EFE22B9B7372E19431CAED840362DDA000300B9
-00000453045D0015002400330061400C0A0305141A0315147623050CB8FFD6402F090C37
-12112C3C4F1E011E1E071D3D08052D3D0708161B122C0F0F07251B00100D10370090350F
-35011E2C1A07883410F6FD325D10F42BED12392F1239ED003FED3FED12392F71ED393931
-302B5D011406070E01232111213216171E0115140607151E01033426272E012B01113332
-36373E01133426272E012B0111333236373E010453413940977BFE3201B07D7F383F3B5E
-4A6381FD1F202A694DC4EB4A4724261D3B243D26584EF1B270792C2C2B0152517E2A2F2A
-045D111D216A48537A220A1889017D243A101505FECE0B161841FE4237451D1207FE930F
-19194800000100B9000003BB045D0005001F4010013F040503700001000007021A038806
-10F6ED11332F5D002F3FED313001211123112103BBFDBABC030203B8FC48045D00020009
-FEF404AF045D000D00130053401C3B124A12020105103E0A050C13073E0310C90A0A070E
-1A0C0C01C900B8FFC040120B0E370000152F153F1502131A070704C9052FED392FED5D11
-332F2BED392FED12392FED002FFD32323FED2F3331305D01231121112311333612112111
-3321112106020704AFAFFCB8AF79757302BE87FEBDFEAF0D8053FEF4010FFEF101ACC101
-F90103FC43031FFBFE628600FFFF006AFFE60460047C0216004800000001003400000632
-045D003100D840123A0E3A2D4A0E4A2D5F0C5F2F6F0C6F2F0826B8FFE0B3090B3715B8FF
-E0401A090B3724B42D2D2F17B40E0C0E020116091037011A0031000708B8FFEA405E0910
-37081A09090A241C1703291F3C31070A0C0E2F2D072902112A3F040902121D052905002E
-0A21315E0A51316F0A60317F0A7031082929013102242D2F0600C71F041A051212080A07
-0C0E170609C71C0505333210333F334F336F33045D1112392F33F41739322F10FD32F417
-39322F5D002F3F1739FD322F121739FD111739018710FD2BC08710FD2BC08710FD8710FD
-3130002B2B5D21230123112311230123012E01272E012B0135333216171E01171E011711
-33113E01373E01373E013B0115232206070E01070632E3FE9A5BBA51FE8AD901AF314B1F
-1B4A5435457C962D091B0A216740BA4069210B1B082C947D4535554B191C4D2D01FEFE02
-01FEFE0202491A60615542A2647D1A43174C3F0401E4FE1C04404B1942197B66A2465159
-631900010041FFE603C20478003D007FB7263475127D3C032FB8FFE0404C0D103708200D
-10373B1B3FAF1CBF1C021C1C06313F2D902DA02D032D2D293E3104200A300A020A0A0E3F
-06091C2E231B372E1C373B0409141B00903F7F3F803F02800990090209400B0F37092F2B
-5D5D10F6ED1217392FED2F2F003FED332F5D3FED332F5D1112392F5DED3931302B2B5D01
-1406070E012322262735331E01333236373E01353426272E012B0135333236373E013534
-26272E012322060723353E01333216171E0115140607151E0103C2574444A45274D2660D
-49E26A326A272A32312A297430A371288128343D3024255B2366C5430D53BE5F4E9B4342
-546D5C677A01395E822827242C2ECE4046131518433A3C48121208A2060D113E442F3D11
-110C3734CF1B221C2222755658851D071989000100B900000466045D00090044402D0B02
-0407020D030103380B103702380E10370706010204030805030808021A00920B1F0B600B
-0203071A04880A10F6ED395D10F4FD39003F3F12173931302B2B5D712123110123113311
-01330466BAFDB7AABA0243B00347FCB9045DFCC5033B000200B900000466061500090017
-0073404C0B020407020D030103380B103702380E10370A0F1001101014500D0D07060102
-04030805030817C91F0A2F0A020A11C900101010201003100A100408021A0092191F1960
-190203071A04881810F6ED395D10F6FD391239392F5DED2F5DED003F3F121739332FED33
-2F5D3331302B2B5D7121231101231133110133030E0123222627331E01333236370466BA
-FDB7AABA0243B06B05B1A9A9B105AB015B58595A010347FCB9045DFCC5033B01B894A6A6
-94695E5C6B00000100C1000004A9045D001A0093404D0120090E371B02271A360E321635
-1A0502011A001A000A1B0F2B0F020FB41618160A0F181604121A023C2F08010808000713
-3F12050705010508561A9600961AB600B61A05021A181604121200B8FFC04011090E3700
-001C0F1C1F1C0208031A05891B10F6FD325D11332F2B332F17395D003F3C3F3FED111239
-2F5DFD39121739018710FD71C03130018710FDC0015D2B2123012311231133113236373E
-01373E013B0115232206070E010704A9F6FE3066BCBC5D72280E1B0D349C9256534F5924
-2859320200FE00045DFE1E434A1B3D1C7170A243545E5D180001001DFFFE043E045D0021
-003FB9001BFFACB30D103709B8FFC0401C0D1037023E2105001313173F0F011A00922303
-1A20203020022020122F332F5DED10F6ED002FFD322F2F3FED31302B2B212311210E0107
-0E01070E01070E012322262335333216333236373E01373E013721043EBCFE5F03060307
-201A183B2222533111410A0A081E0A183312333E0A040703030103BF539A3EA7C7423E4D
-1F1E1E02A4020E1332EEE152E166000100B9000004D9045D000C0078401335093A0B4503
-4A0470037F04060B400D103709B8FFC0403D0D10377B027B05790A030A2A090B37050A02
-030904400E103704200D0F373F04010404070B09050107090A0B0305021A00920E0F0E20
-0E02051A07880D10F6ED5D10F6ED111739002F333F3312392F5D2B2B1217393130002B5D
-012B2B5D2123110123011123113309013304D9BAFEEA8CFEECB0E301300126E70372FDC2
-023EFC8E045DFD8F0271000100B900000460045D000B0032401C033F0808050A07050105
-0809021A00920D1F0D600D0208031A05880C10F6FD325D10F6FD32003F333F3312392FED
-31302123112111231133112111330460BCFDD1BCBC022FBC01F7FE09045DFE3C01C4FFFF
-006AFFE10471047C021600520000000100B900000460045D000700254015033F06050005
-011A0092091F09600902041A05880810F6ED5D10F6ED002F333FED313021231121112311
-210460BCFDD1BC03A703BBFC45045D00FFFF00B9FE640490047C0216005300000001006A
-FFE703FD04770021005A40430F234F235F23032B01220E2A1624183A01350E3A16351849
-014F0A440E4F1641185901550E6901650E7A01730E131010143F0C0421211A3F03090F00
-0023171B09852210F6ED11332F3C003FED332F3FED332F31305D015D250E01232226272E
-013510002132161715232E01232206151416333236373E01373303FD73A5527ACC494951
-0128010161BB4E0B5DB555A7B7B6A83B75302651100B463629474848DC93010B013F3627
-D14744E0C7C7DC1E1813350D0001000A000003EE045D0007003840230301043F06054000
-4F0502000500021A05A003B00302030309080F093F094F097009045D1112392F5D33FD32
-2F2F5D003FFD322F3130012111231121352103EEFE6CBCFE6C03E403B8FC4803B8A5FFFF
-003DFE64047F045D0216005C00000003006FFE64064B061400230030003D007A40105622
-011D011B1E0C09040627353F2118B8FFF040400E0F3718043B2E3F0F06100E0F3706090B
-0C392436384924463804241B00C809311B1E2B04091A0C381B12C8800C900C020C0C3F3E
-0F3F1F3F3F3F503F803F055D1112392F5DFDED10ED173910FDED5D003F3F2B33FD323F2B
-33FD321217393F31305D011406070E01232226271123110E01232202113436373E013332
-16171133113E0133321203342623220607111E0133323605112E01232206151416333236
-064B4C3F3EA259436327BA3D4F54C1F04E3F3DA5523C6331BA2E7C3FC6E2C18888374A3F
-2F3F3A8D9BFD7627503187A18F87355B024C95E54A4A4E2E13FE3301CD1E23012E010D8D
-DD4B494D251E01E1FE1F1B28FED5FEECBFDE1219FD171619D9AA02E91219CED2C3E01D00
-FFFF003C00000480045D0216005B0000000100B9FEF404DE045D000B0041400F0602050B
-08043F01051A080800C90AB8FFC04015090D370A0A0D0D40090E378F0DAF0D02041A0188
-0C10F6ED5D2B11332F2BED392FED002FFD322F3F33313029011133112111331133112304
-2FFC8ABC0226BC87AF045DFC4503BBFC45FE52000001008E0000041F045D0016003C4025
-0C061C062C06750E040209113F0505001509050014011A0092183F18010A1A0009100902
-092F5DED5D10F6FD32002F3F3312392FED123931305D2123110E01232226351133111416
-171E01333236371133041FBC5BA662B4BEBC101A1A5E5445A23CBC01AD1C22B1A70196FE
-CA40652524261B12021D000100B900000649045D000B003D40260A06020508043F010809
-1A00CA081A05041A01CA8005A0050205050D0C0F0D200D500D700D045D1112392F5DF4ED
-10FDF4ED003FFD323F333331302901113311211133112111330649FA70BC01AEBC01AEBC
-045DFC4503BBFC4503BB000100B9FEF406D0045D000F004A402E0A0602050C08043F0108
-0E0DC90000091A0CCA081A05041A01CA80059005A00503050511100F111F113F116F1104
-5D1112392F5DF4ED10FDF4ED392FED002F3FFD32323F3333313029011133112111331121
-1133113311230621FA98BC01AEBC01AEBC87AF045DFC4503BBFC4503BBFC45FE52000002
-000A000004C4045D000E0021004A4015750D01073D4F1B9F1B021B1B16183F1905083D16
-0FB8FFF04016090B371B081A161619001B0F8F230F231F232F2303192F5D10F6FD11392F
-FD322B002FED3FED12392F5DED31305D013426272E012B0111333236373E01371406070E
-0123211121352111333216171E01040223282A6B64B0AC646E282925C24138429676FE55
-FEB80204F47E8B453A3A0157334D18190AFE8411181A473A518429322A03B8A5FE4D1A33
-2B86000300B9000005A2045D000E001F0023005A4016200523073D4F199F190219191617
-05083D167900010FB8FFF04022090B37001B500F600F700F030F0F231A2292250F253025
-402570250419081A16882410F6FD325D10F6FD322F5DED2B5D002FED3F12392F5DED2F3F
-3130013426272E012B0111333236373E01371406070E012321113311333216171E011333
-1123036923282A6B64B0AC646E282925C24138429676FE55BCF47E8B453A3ABBBCBC0157
-334D18190AFE8411181A473A518429322A045DFE4D1A332B8602B1FBA300000200B90000
-0435045D000E001F00424013073D4F199F19021919161705083D167900010FB8FFF04013
-090B37001B0F8F210F212F210219081A16882010F6FD325D10F6ED2B5D002FED3F12392F
-5DED3130013426272E012B0111333236373E01371406070E012321113311333216171E01
-037323282A6B64BAB6646E282925C24138429676FE4BBCFE7E8B453A3A0157334D18190A
-FE8411181A473A518429322A045DFE4D1A332B8600010053FFE703F604770021007DB532
-0442040210B8FFD640090B0D37152A0B0D371DB8FFD6403F0B1037082A0B1037123D1313
-061F1B1B173E1F049F0A010A0A0E3E0609141C111A0390232340090D371C2F133F134F13
-03131C1380099009020940090C37092F2B5D33332F5D2F2B10F6ED1139003FED332F5D3F
-ED332F1112392FED31302B2B2B2B5D011E011510002122262735331E0133323637213521
-2E012322060723353E01333216035D4950FEC9FEFC66BF430D3CC66D9DC40CFDCC023314
-BE8E5BB4570D3FC2677CC803ED46D290FEEAFEB8301BCE2F49C0BA979E9F3D43CE193A44
-000200B9FFE1064C047C000B001E005640363A0335094A034509040C3E131E1314031C03
-3F16041005093F1C0A0F1319061A2F0C010C0C0F001B1990202F203F2002120E1A0F881F
-10F6FD325D10F6ED12392F5DED1239002F3FED3F3FED1217392FED5D3130013426232206
-15141633323625231123113311333624333200111000232200058AA69399A1A89292A7FC
-D3E8BCBCED190111C7E70112FEF2EBDEFEF5022ED7D5DFCDD4D7D5A2FE06045DFE3BE7FD
-FEC4FEEEFEF1FEC201200002004300000413045D0010001F0069B3721C0104B8FFE8403D
-0910370304B4050506060F113C030300123D0F0500050909190902191B70090109040603
-09040A051A054A055A0580059005060512011A0092210F21015D10F6FD322F5D17392F5D
-ED5D002F2F3FED12392FED12393130018710FDC02B015D212311230123012E0135343637
-3E0133210311232206070E01151416171E01330413BCDDFEA6DD01789186503D3C9C5C01
-AEBCED4D442827251724256A4101BBFE4501CD28A586597C27261BFDF201780A16164B2C
-37441E1D1500FFFF006AFFE6046005DB0236004800000116008EF9000014400D03302560
-250202002520120025012B355D3500010013FE6D046206140035006A4044051C1E261E28
-59056905721D0617140E51111112180D08421B0412012F3E2A2A012A0D150F5F2E6F2E7F
-2E032E2E0D001A2191371F37603702141517030B1A110F0D883610F63232FD17325D10F6
-ED12392F5D2F2F002F2F5DED3F3FED123912392FED393931305D0026272E01272E012322
-0607112311233533353315211521113E01333216171416151406070602070E01232A0127
-35333236133E013503A501010113191A594650AC4CBCA6A6BC0141FEBF58C162B1BB0303
-020103544746B96A17182A44BB9C09010102064B2B5080292B294D3AFCBE04F4869A9A86
-FEED4952DEC92F6B4B3A703AB0FEFF50504E029EF60150224B2EFFFF00B9000003BB0682
-0236020B00000116008D9AF6000AB6010009070405252B350001006AFFE7040A04770021
-006EB53B0A4B0A021BB8FFD640090B0D37162A0B0D370EB8FFD640340B1037012A0B1037
-193D1818030C1010143E0C0421211D3E03092018301840180318171810031A008E232340
-090D371A1A09852210F6ED2B10E61117392F5D003FED332F3FED332F1112392FED31302B
-2B2B2B5D250E01232226272E013510002132161715232E01232206072115211E01333236
-3733040A4E9F7B7DD14C4C52012B010D68BB450C40C2658FC719023CFDC10AC4A46CBD3E
-0C302029474849DC92010501453620CB324E9CA197B2C8443200FFFF006EFFE503D70478
-021600560000FFFF00AF0000018305DB0216004C0000FFFF00050000022D05DB02160077
-0000FFFFFFC2FE59021505DB0216004D00000002001DFFFE06F4045D000E003D0072B900
-30FFACB30D10371EB8FFC0401D0D1037073D4F379F3702373716183E350528282C3F2409
-3D167900010FB8FFF0401E090B3737081A161635001B890F010F8F3F0F3F0118C9203530
-35023535282F332F5DED5D10F45DFD11392FFD322B5D002FED2FFD322F3FED12392F5DED
-31302B2B00353426272E012B01113332363736371406070E01232111210E01070E01070E
-01070E012322262335333216333236373E01373E01372111333216171E01063223282A6B
-64B0AC646E2829E74138429676FE55FE5F03060307201A183B2222533111410A0A081E0A
-183312333E0A0407030301F47E8B453A3A012037334D18190AFE8411181A81518429322A
-03BF539A3EA7C7423E4D1F1E1E02A4020E1332EEE152E166FE4D1A332B86000200B90000
-06F4045D000E0027005D4017171E073D4F219F21022121161C20051A083D167900010FB8
-FFF0401F090B37211E081A16161A001B890F010F8F290F292F294F29031D191A1A882810
-F6FD325D10F65DED11392FED39392B5D002FED2F3F3312392F5DED39393130013426272E
-012B0111333236373E01371406070E0123211121112311331121113311333216171E0106
-3223282A6B64B0AC646E282925C24138429676FE55FDF3BCBC020DBCF47E8B453A3A0157
-334D18190AFE8411181A473A518429322A0210FDF0045DFE4D01B3FE4D1A332B86000001
-00130000045F0614001E00504030031D161D751D0317140E51111112180D08421B041201
-010D08150F021A0091201F20602002141517030B1A110F0D881F10F63232FD17325D10F6
-ED2F2F003F3C3F3FED123912392FED393931305D2123113426272E012322060711231123
-3533353315211521113E0133321615045FBC1218195E4B4DA84DBCA6A6BC0141FEBF58BC
-63B5BE027C4D87262A294C3BFCBE04F4869A9A86FEED4952DACDFFFF00C1000004A90682
-0236021200000116008DF9F60011400C01001D401D02001D1C0611252B5D35000002003D
-FE64047F06150007001500BD404C04063406440650066006700606090307051903170546
-0149035800570179030902071A000100051A0403044900460402080F0E010E0E12500B0B
-0003020405020C15C908400B0E37080FC90EB8FFC040110B0E370E080E04026801010102
-03030400B8FFC040220910370C001C004A006A007A0005008D170F170103041304450465
-0475040504821610E65D5D10F65D2B1117395D2F1139392F2BED2F2BED003F3F12393933
-2FED332F5D333130015D8710FD8710FDC0015D005D0901231301330901130E0123222627
-331E0133323637047FFD74C9D0FE43CC0157015A0805B1A9A9B105AB015B58595A01045D
-FA0701D20427FCC4033C01B894A6A694695E5C6B000100B9FEF40460045D000B003F4027
-0A060520030103083E00050802C93F034F037F0303030305091A00920D1F0D600D02081A
-05880C10F6ED5D10F6ED12392F5DED003F33ED2F5D3F3331302901112311211133112111
-330460FE84AEFE83BC022FBCFEF4010C045DFC4403BC000100C80000048A076B0007002B
-B90006FFC040140D10370606003503030205130606090114026C0810F6ED11332FED002F
-3FED332F2B31300111231121113311018EC60308BA0521FADF05D1019AFDB600000100B9
-000003BB05CE00070033B90006FFC0401A0E10370606003F03050205C97006010606090F
-0901011A02870810F6ED5D11332F5DED002F3FED332F2B313001112311211133110175BC
-0254AE03B8FC48045D0171FDEA00000100CB023C073502DC00030011B601540200000501
-2F11332F002FED3130012135210735F996066A023CA0000400C8000008B905ED00090015
-0021002500A7403E080718073A014901440646075801540656076F0160067F0170060D09
-0D0613190D16137A19751F0625533F224F220222221F401214371F51300D010D0D19B8FF
-C040321214371951130202030807040106030100220F2302232223220A1CC910100A0006
-0102071300000416C90A0A270213046C2610F6ED11332FED12392FFD1139391112392FED
-1239392F2F5D002F3F1217393FED2B332F5DED2B332F5DED5D3130015D21230111231121
-0111330114062322263534363332160734262322061514163332360121152104FFF5FD72
-B401330250B403BABDB2B6BABEB2B5BAB25865675757676558FE6201B8FE480534FACC05
-D1FB4004C0FE63E0DADADFE0DADCDDAC8888ADAD8787FDE89E00000100B900000460045D
-000700254015033F06050005011A0092091F09600902041A05880810F6ED5D10F6ED002F
-333FED313021231121112311210460BCFDD1BC03A703BBFC45045D00000101190235028F
-05D5000800214011035004040703010E0307002A03000101012F5D33ED392F003F3F332F
-ED3130012311233532363733028FA5D1667E0989023502A9752C5600000100EF023D039F
-05ED001D0043B90011FFE040250D10370F0F0B521302021C51010E00001C01082A261636
-166616761604160F160F000101012F5D33332F2F5DED1239332F003FFD323FED332F3130
-2B0121353E01373E013534262322060723353E01333216151406070E010721039FFD505B
-86276D40584C468F290F41974D9DA9526A318D3701F2023D94456825676D52464A3C20B3
-1B229E7A5D945E2B6A29000100E6021C037305ED002E0074400F6C096C227E097E220455
-0C5A1F0226B8FFE0403B0B0E3703200B0D372C2B15510F16010F161F164F165F16CF16FF
-16061621211D51160625020A0A0E51060F1A2A281622112A2216282C04090000092F332F
-121739ED2F2F2FED003FED332F3F1239ED332F2F5D71ED393931302B2B5D015D01140607
-0E012322262735331E013332363534262B01353332363534262322060723353E01333216
-15140607151E0103733C30357B4F528F4111259A4F546E645B8C7D575F52574299251140
-964F98AA614D5075033A47702225201E1CAF233B4948533B8B4C423C473E23AF1B228C62
-57711A08106D000200B3023D03BD05ED000A000D003A401E6D067E06020609010D51050C
-05030702030E00070B042A09000D060101062F332F12393333FD39392F003F3F1239392F
-ED3939323130015D012315233521350133113321110103BDA396FE2F01D295A3FECBFE9F
-0319DCDCB9021BFDB10190FE7000000100E6021C037505DA002A004840176F087F08021D
-1D1A5125250621511E030A0A0E51060F00B8FFEA400F090C371F21291E1F1E09142A0000
-092F332FED1239392FED2F2B003FED332F3FED12392FFD322F31305D011406070E012322
-262735331E01333236373E01353426272E012322060711211521153E01333216171E0103
-75322F3088574E953C1025924E2C521C1D171F1D1E59353B6C260255FE4814310E547634
-373C0363457A2A2B331C1A9F1436171C1D43272A391415110E0601F08BCF02021722246F
-000100F3023503A505DA000600414025560101030100012A020203630073000200000351
-0503020E030002100910370202040000042F332F12392F2B1239003F3FFD322F3130015D
-8710ED87C0015D0901230121352103A5FE2AB901F0FDED02B2054EFCE7031A8B000300C5
-021B039105EE001900280037005D40420F0B0F151F0B1F152A022A0439023904492B582B
-0A0F251F2526103610042F09261604031D5110023551030F1A2A13202A0D292A090D1316
-04067000010000322A062FED332F5D121739ED2FED2FED003FED3FED1217395D31305D01
-140623222635343637352E0135343633321615140607151E01033426232206151416171E
-01173E01133426272E01270E011514163332360391CB9BA7BF5E595246B99095B5505261
-5BBE574F465D302D17482E392618374217582A3A387650516D033579A19F784F78260429
-64476A8D87683F7D2304276B016433483F36263D140A1F0B254FFE79323B1E0A1C0F205D
-304A5F4E00020073FFE1068B05F0002800340075400978180176097915021BB8FFC04045
-0910371B694F0001002302031A090A0905151A0915155A095515062C3415023234090A22
-1E2926151B00030F291503360F361F3680369036BF36CF36060F36012F150F683510F6ED
-5D5D10D6ED121739D4FDC4003FED3FED5D1239393FDD5DED2B5D31305D011E0115140207
-0E01232224272602353412373624333216171E01173E013534262735331E011514060110
-0023220011100033320005A11F1A63595CFBA19DFEFF5A5A61605C5801059AA0FF591819
-144F43160CA00D0B78FEF9FEFCE1E3FEFD0108DEDE0107044958A663B8FEDD6165666863
-630120B9B6012167626869611B2121044044245B17092F46326C82FE8D0122013BFEC5FE
-DEFEDBFEC90137000002006AFFE104C30584001D0029005640391A20090C373A2135274A
-21452704151B690D050003213F0904273F030A14102918090C1B03061E1B00902B0F2B1F
-2B3F2B6F2B04241B06852A10F6ED5D10F6ED121739DCFDC4003FED3FED12393FFDCD5D31
-302B011000232200111000333216173332363534262735331E01151406071E0107342623
-22061514163332360471FEE8EBEDFEE90117ED33602B5D5A4A160CA00D0B736C4548C2AA
-9799A9AA9896AB022EFEEFFEC4013C01110111013D0F104147245B17092F46326A80144D
-D98BD9D3D3D9D2D9D700000100B2FFE1067506F8002B004C40342A20090F37252B6A1C03
-0D032615390649067615041534060A2420290F2801281B14002D0F2D402D6F2D7F2D902D
-050F140C6B2C10F6ED5D10DEEDD45DFDC4003FED5D3F3FFDC431302B011406070E012322
-26272E01351133111416171E01333236373E0135113332363534262735331E0115140623
-052947514DCE898CD0475147C621272C976A6B962D2721D85A4A160CA00D0BACA00256A2
-F1504C464A4852E8A9037BFC7B798C394142414239936D038A4147245B17092F46328384
-000100B1FFE105A505840025005C403E0B0619077A070323200910371E246A1505020509
-051142050A011D19290F21012114021A40000100270F276F27025F279027A027C027EF27
-050B1A08872610F6ED5D7110D671ED32D45DFDC4002F3FED3F12393FFDC431302B5D2123
-350E01232226351133111416171E0133323637113332363534262735331E011514062B01
-0457BC5FAE69B0C4BC101A1B565249AD4BD05A4A160CA00D0BACA0027C4B50D7D002D5FD
-8455792B2C284C3B03424147245B17092F46328384000001020905110342068C00160042
-4029BF0301030606050C50146005010504ADC005D005020540090D370505110940111437
-09290F000100112FDD5DED2B12392F2B5DED002F5DD4ED12392FC55D3130011406071523
-353E013534262322060723353E01333216034242426E2F3026211F251803134926516605
-F8404E1544790C27271827090969060C560000010221FE8202F5FF450003001340090144
-8F0201020015012FED002F5DED31300123353302F5D4D4FE82C3FFFF0154051602FA068C
-001600430000FFFF021D051603C3068C0016008D00000002013605110514068C0006000A
-004DB90006FFF040100E103705100E10370802010708040305B8FFC040110E1037050560
-0301036007700702070900B8FFC0B50E10370000042F332F2BD6CD5D002F5D332F2B1217
-392F3130012B2B01230B012313332103231303E19FB9B89BE4E30217DA817C05110100FF
-00017BFEF6010A0000020003051103E1068C0006000A004AB90006FFF040100E10370510
-0E10370802010809040305B8FFC040180E1037050560030103006F097F0902090704400E
-103700042F332BD6CD5D2F002F5D332F2B1217392F3130012B2B01230B01231333012303
-3303E19FB9B89BE4E3FE6181DADF05110100FF00017BFEF6010A00020136051104C00752
-0006001D008EB90006FFF040120E103705100E1037BF0A010A0D0D0C13501BB8FFC0400B
-0E10371B0C02010C030305B8FFC0402A0E10370505600301030BADC00CD00C020C400910
-370C0C18104011143710290F07010718400C10371800B8FFC040090E1037000060040104
-2F5D332F2BD42BDD5DED2B12392F2B5DED002F5D332F2B1217392FD42BED12392FC55D31
-30012B2B01230B01231333251406071523353E013534262322060723353E0133321603E1
-9FB9B89BE4E301C342426E2F3026211F251803134926516605110100FF00017B32404E15
-44790C27271827090969060C560000020125051103F307DE000600200064B90006FFF040
-200E103705100E10370710520F171F17A0170317141D520A400D11370A01020305B8FFC0
-40110E10370505600301032029070013291400B8FFC0B40E103700042F332BD6ED2FD6ED
-002F5D332F2B123939D62BED3CDD5DED3C3130012B2B01230B01231333130E0123222627
-2E0123220607233E01333216171E013332363703E19FB9B89BE4E3F606865F35491C183A
-192B22058C05875F36491C163B192A240405110100FF00017B015289902919162D3E4788
-912A19142E3E47000002014204E703D506FB000D0011003C40251110400F1A3710001006
-0AAA3F030103600E700E020E100D2A100F001F008F000300072A062FEDD45D39ED2FCD5D
-002F5DEDCD39392F2BCD313001140623222635331416333236353703231303D5B29897B2
-A2555253555EDA817C0646A3BCBCA37C64647CB5FEF6010A0002014204E703D506FB000D
-0011003C4025100F400F1A370F000F060AAA3F0301036F107F1002100E0D2A0E0F001F00
-8F000300072A062FEDD45D39ED2FCD5D002F5DEDCD39392F2BCD31300114062322263533
-1416333236350723033303D5B29897B2A2555253555281DADF0646A3BCBCA37C64647C55
-010A0002014204E703D5071E000D002400634040111414131A0F2201221340091A371300
-13060AAA3F0301031213400910371313001F101F201F031F1728500E600E700E030E0D2A
-0E0F001F008F000300072A062FEDD45D39ED2F5DEDCD5D392F2BCD002F5DEDCD39392F2B
-D45DCD12392FC531300114062322263533141633323635271406071523353E0135342623
-22060723353E0133321603D5B29897B2A2555253551237375C272822191C1E1402103C21
-42570646A3BCBCA37C64647C5B34431238650A2120191D080757060A45000002012504E7
-03F307DE000D0027005840100E17520F1E1F1E021E1B245220110111B8FFC04025090C37
-11006006700602060AAA3F0301031A291B0627290E0D2A0F001F008F000300072A062FED
-D45DEDD4ED10D6ED002F5DEDDD5D39D62B71ED3CDD5DED3C313001140623222635331416
-33323635130E01232226272E0123220607233E01333216171E013332363703D5B29897B2
-A255525355C006865F35491C183A192B22058C05875F36491C163B192A24040646A3BCBC
-A37C64647C019889902919162D3E4788912A19142E3E47000001020905110342068C0016
-00524035BF0301030606050C50501460147014031409900501C76005010504ADC005D005
-020540091037050511094011143709290F000100112FDD5DED2B12392F2B5DED002F5D5E
-5D5ED45DED12392FC55D3130011406071523353E013534262322060723353E0133321603
-4242426E2F3026211F251803134926516605F8404E1544790C27271827090969060C5600
-00020136065403E1080100060020007D404A0702170202141D50200A010A1050076F1701
-0F1770170217010205400D1137050920039003A003B003045910032003C00303C003D003
-0231D003E003025003010F037003020320280700B8FFC040090E10370013281400042F33
-D6ED2F2BD6ED002F5D71725E71725E715ECD2B39392F5D713CEDDD71ED3C31305D012327
-07233733130E01232226272E0123220607233E01333216171E013332363703E1A9AFAEA5
-F8BBEC0B705025491C1B3E141D2806860A6F5227432122301A1B2B0506545959AD010052
-6B190D0D1A202D4E6F17101016232A0000020142064803D50801000D0011005A403E5010
-6010020A50FF03015F030103007F0601060F109F10026F10FF1002106F11010F11701102
-11590E690E720E030E100D2A100F001F008F000300072A062FEDD45D39ED2FCD5D002F5D
-71DD5D71D45D3CDD7172ED5D313001140623222635331416333236353707233703D5AB9E
-9EACA24B5D5A4D4FC681680738589899573058592FC9D8D800020142064803D50801000D
-001100644033500E600E020A50FF03015F030103007F0601060F0E9F0E026F0EFF0E020E
-6F11010F1170110211561066107D1003100E0D2A0EB8FFC0400F090D370E0F001F008F00
-0300072A062FEDD45D392BED2FCD5D002F5D71DD5D71D45D3CDD7172ED5D313001140623
-222635331416333236350723273303D5AB9E9EACA24B5D5A4D5681C6DF07385898995730
-58592F0FD80000020142064803D50801000D0024008E4062111414131A6F22010F227022
-02223F134F13021340111537130013060A5009900301B0030159700301310F033F037003
-CF0304031213400915371313501F601F701F03001F101F201F301F401F051F17C00E010E
-0D2A0E0F001F008F000300072A062FEDD45D39ED2F5DCDCD5D71392F2BCD002F5D5E715E
-5D715EEDCD39392F2B712F5D71CD12392FC5313001140623222635331416333236352714
-06071523353E013534262322060723353E0133321603D5AB9E9EACA24B5D5A4D2E2E2E4D
-231F1C15191A0E020E321B364A0738589899573058592F612B380F2F54091E1817160805
-4905083900020142064803D50801000D0027009240111B2450DF1101110E17506F1E010F
-1E011EB8FFC040520D10371E00060A50099003B00302F0030159200330034003C003D003
-E003066003700302C003D0030231A003B003025003E003020F033F03CF0303031A281B1B
-0627280E0E0D2A0F001F008F000300072A062FEDD45DED3C10ED103C10ED002F5D71725E
-5D71725E5D715EEDCD322F2B5D71ED3CDD71ED3C31300114062322263533141633323635
-370E01232226272E0123220607233E01333216171E013332363703D5AE9B9BAFA26C3C3C
-6BA20B705025491C1B3E141D2806860A6F5227432122301A1B2B050706546A67572E2828
-2EFB526B190D0D1A202D4E6F17101016232A000201360668051008010006001D0088B900
-06FFF0401A0E103705100E1037BF0A010A0D0D0C400E10370C13500F1B011BB8FFC0403A
-0D10371B0102030F0570050205050F0301030BADC00CD00C020C400910370C0C18104011
-143710290F07010750006000700003180000600401042F5D332FD45DDD5DED2B12392F2B
-5DED002F5D332F5D1239392F2B5DEDC42B392FC55D3130012B2B01232707231333051406
-071523353E013534262322060723353E0133321603E19FB9B89BE4E3021342426E2F3026
-211F25180313492651660668CECE014944404E1544790C27271827090969060C5600FFFF
-001AFE82055E05D10236002400000116024B2F00000AB602000D0E0500252B35FFFF0068
-FE82041D04780236004400000116024BBA00000F400A027F36010036370B00252B5D3500
-FFFF001A0000055E080102360024000001170256002F0175001A401202501C0102101C40
-1C701C03001C0B0500252B5D35005D35FFFF0068FFE1041D068C0236004400000116024A
-BA000011400C025F457F45021D45340B00252B5D3500FFFF001A0000055E07ED02360024
-00000117024E002F01610011400B0302400F01000F0B0500252B5D353500FFFF0068FFE1
-04F4068C0236004400000116024EE0000013400D030240385038022938340B00252B5D35
-3500FFFF001A0000055E07ED0236002400000117024F002F01610011400B03020F0F0100
-0F0B0500252B5D353500FFFFFFE3FFE1041D068C0236004400000116024FE0000013400D
-030240385038022938340B00252B5D353500FFFF001A0000055E08010236002400000116
-025C2F00001740110302400FA00FB00FC00F04000F0B0500252B5D353500FFFF0068FFE1
-04A0075202360044000001160250E0000013400D030240385038022938340B00252B5D35
-3500FFFF001A0000055E0801023600240000011602572F00000CB70302000F0B0500252B
-3535FFFF0068FFE1041D07DE02360044000001160251E0000013400D0302403850380229
-38340B00252B5D353500FFFF001AFE82055E07ED023600240000003700D6002F01610116
-024B2F00001840110300141505002502400F01000F0B0500252B5D352B35FFFF0068FE82
-041D068C023600440000003600D6E0000116024BBA00001E4016037F3D01003D3E0B0025
-0240385038022938340B00252B5D352B5D35FFFF001A0000055E08010236002400000116
-02582F00000CB7030200110B0500252B3535FFFF0068FFE1041D06FB0236004400000116
-0252E0000011400B0302403A01293A340B00252B5D353500FFFF001A0000055E08010236
-00240000011602592F00000CB7030200110B0500252B3535FFFF0068FFE1041D06FB0236
-0044000001160253E0000011400B0302403A01293A340B00252B5D353500FFFF001A0000
-055E08010236002400000116025A2F00000CB7030200110B0500252B3535FFFF0068FFE1
-041D071E02360044000001160254E0000011400B0302403A01293A340B00252B5D353500
-FFFF001A0000055E08010236002400000116025B2F00000CB7030200110B0500252B3535
-FFFF0068FFE1041D07DE02360044000001160255E0000011400B0302403A01293A340B00
-252B5D353500FFFF001AFE82055E0801023600240000003700D9002F01750116024B2F00
-001D4013025011011103001B1C0500250200110B0500252B352B3500115D3500FFFF0068
-FE82041D068C023600440000003600D9DD000116024BBA0000184011037F44010044450B
-002502293A340B00252B352B5D35FFFF00C8FE82049D05D10236002800000116024B2600
-000AB601000E0F0100252B35FFFF006AFE820460047C0236004800000116024BF900000A
-B6021F22231218252B35FFFF00C80000049D08010236002800000117025600260175001C
-401401501D0101001D201D501D601D04001D0C0203252B5D35005D35FFFF006AFFE60460
-068C0236004800000116024AF9000018B4026F310131B8FFC040090A1137323120120025
-2B2B5D35FFFF00C80000049D07C8023600280000011700D7002601750012400B01501901
-0100190C0203252B35005D35FFFF006AFFE604600653023600480000011600D7F900000A
-B602002D201200252B35FFFF00C80000053A08010236002800000117024E002601750016
-400D0201501001020100100C0203252B3535005D3535FFFF006AFFE6050D068C02360048
-00000116024EF900000CB703021E24201200252B3535FFFF00290000049D080102360028
-00000117024F002601750016400D0201501001020100100C0203252B3535005D3535FFFF
-FFFCFFE60460068C0236004800000116024FF900000CB703021E24201200252B3535FFFF
-00C80000053608010236002800000116025C26000013400D0201101020100200100C0203
-252B5D353500FFFF006AFFE604B9075202360048000001160250F9000013400D03020024
-2024021E24201200252B5D353500FFFF00C80000049D0801023600280000011602572600
-000CB7020100100C0203252B3535FFFF006AFFE6046007DE02360048000001160251F900
-000CB703021E24201200252B3535FFFF00C8FE82049D0801023600280000003700D60026
-01750116024B2600001D40130110501001020015160203250100100C0203252B352B3500
-5D113500FFFF006AFE820460068C023600480000003600D6F9000116024BF9000014400E
-031E292A120025021E24201200252B352B35FFFF0089000002D508010236002C00000117
-0256FF2401750016400E01501101015011010011100409252B5D35005D35FFFF00960000
-01CF068C023600D500000117024AFE8D0000000AB6010009080203252B35FFFF0089FE82
-02D505D10236002C00000117024BFF240000000AB601000E0F0409252B35FFFF00AFFE82
-018305DB0236004C00000117024BFE8E0000000AB602000A0B0203252B35FFFF0073FE82
-05DA05F00236003200000117024B009B0000000AB6020026270F03252B35FFFF006AFE82
-0471047C0236005200000116024BE200000AB602001A1B0600252B35FFFF0073FFE105DA
-080102360032000001170256009601750022400B0250340102503470340234B8FFC04009
-090B370034240F03252B2B5D35005D35FFFF006AFFE10471068C0236005200000116024A
-E200000F400A02701D01001D1C0600252B5D3500FFFF0073FFE105DA0801023600320000
-0117024E00960175001E401403025028010302202850288028030028240F03252B5D3535
-005D3535FFFF006AFFE104F6068C0236005200000116024EE200001940130302001C201C
-501C801CB01C05001C180600252B5D353500FFFF0073FFE105DA08010236003200000117
-024F009601750016400D030250280103020028240F03252B3535005D3535FFFFFFE5FFE1
-0471068C0236005200000116024FE200000CB70302001C180600252B3535FFFF0073FFE1
-05DA08010236003200000117025C009600000015400F0302202850288028030028240F03
-252B5D353500FFFF006AFFE104A2075202360052000001160250E200001940130302001C
-201C501C801CB01C05001C180600252B5D353500FFFF0073FFE105DA0801023600320000
-01170257009600000015400F0302202850288028030028240F03252B5D353500FFFF006A
-FFE1047107DE02360052000001160251E200001940130302001C201C501C801CB01C0500
-1C180600252B5D353500FFFF0073FE8205DA0801023600320000003700D6009601750117
-024B00960000001D4013025028012803002D2E0F0325020028240F03252B352B3500115D
-3500FFFF006AFE820471068C023600520000003600D6E2000116024BE2000014400E0300
-212206002502001C180600252B352B35FFFF0073FFE1068B08010236024600000117008D
-007801750014400D025036603602020036360F03252B35005D35FFFF006AFFE104C3068C
-0236024700000116008DE200000AB602002B2B0600252B35FFFF0073FFE1068B08010236
-024600000117004300AA0175001A40120250366036020250367036020036360F03252B5D
-35005D35FFFF006AFFE104C3068C02360247000001160043E2000011400C02502B602B02
-002B2B0600252B5D3500FFFF0073FFE1068B080102360246000001170256008F01750012
-400B02503A0102003A390F03252B35005D35FFFF006AFFE104C3068C0236024700000116
-024AE200000AB602002F2E0600252B35FFFF0073FFE1068B07C8023602460000011700D7
-008B01750012400B02504201020042350F03252B35005D35FFFF006AFFE104C306530236
-02470000011600D7C400001540100210372037403750370400372A0600252B5D3500FFFF
-0073FE82068B05F00236024600000117024B009A0000000AB6020037380F03252B35FFFF
-006AFE8204C305840236024700000116024BE200000AB602002C2D0600252B35FFFF00B2
-FE82052905D10236003800000116024B6200000AB6010020210C00252B35FFFF00B1FE82
-0457045D0236005800000116024BFD00000AB60100191A0916252B35FFFF00B2FFE10529
-080102360038000001170256006201750012400B01502301010023220C00252B35005D35
-FFFF00B1FFE10457068C0236005800000116024AFD00000AB601001C1B0916252B35FFFF
-00B2FFE1067508010236024800000117008D007C01750014400D01502E602E0201002E2D
-0C00252B35005D35FFFF00B1FFE105A5068C0236024900000116008DEE00001840100160
-28010130284028020028290900252B5D35005D35FFFF00B2FFE106750801023602480000
-0117004300AA0175001C401401502D602D0201402D602D802D03002D2D0C00252B5D3500
-5D35FFFF00B1FFE105A5068C023602490000011600430200001840100160270101502760
-27020027270800252B5D35005D35FFFF00B2FFE106750801023602480000011702560062
-01750012400B01503101010031300C00252B35005D35FFFF00B1FFE105A5068C02360249
-00000116024AFD00000AB601002B2A0800252B35FFFF00B2FFE1067507BE023602480000
-011700D70062016B000AB60100392C0C00252B35FFFF00B1FFE105A50653023602490000
-011600D7FD00000AB6010033260800252B35FFFF00B2FE82067506F80236024800000116
-024B6200000AB601002E2F0D00252B35FFFF00B1FE8205A505840236024900000116024B
-FD00000AB6010028290800252B35FFFF0006000004E608010236003C000001170043FFE4
-0175001B400A01500A600A0201500A01B8FFD3B40A0A0401252B5D35005D3500FFFF003D
-FE64047F068C0236005C000001160043DD000013B5016009700902B8FFDDB40909040025
-2B5D3500FFFF0006FE8204E605D10236003C00000116024BEC00000AB601000A09040125
-2B35FFFF003DFE64047F045D0236005C00000117024B010400000012400D010A0F0A2F0A
-4F0A6F0A7F0A055D1135FFFF0006000004E608010236003C000001170256FFEC01750018
-401001500E0101C00ED00E02000E0D0302252B5D35005D35FFFF003DFE64047F068C0236
-005C00000116024AC900000F400A01500D01000D0C0400252B5D3500FFFF0006000004E6
-07C80236003C0000011700D7FFEC01750012400B01501601010016090500252B35005D35
-FFFF003DFE64047F06530236005C0000011600D7DD00000AB6010015080400252B350003
-006CFEBD04FB0614001B0028002C007E40523B05380C3C2232243E284B054A0C4E224524
-4F285908690870120D2AB52B0114511A17171018011304072041100403082642070A2C2B
-2C2B010A1600881617131C041A1A01922E1F2E3F2E02231B010A852D10F632ED5D10F632
-ED32323232ED2F111239392F2F003FED3F3FED1239393F12392F3CFD3C2FED31305D0123
-1123350E01232202113436373E0133321617352135213533153301112E01232206151416
-3332361321352104FBB8BC4DAD6EC6ED524444B66059864CFE95016BBCB8FE8C4F73499C
-B2879750A4EAFCB4034C04F4FB0C754252012E01118EDB4D4C4F2427CE869A9AFB990279
-2218D6CCC3CD47FDE286FFFF00ED051D042C0653001600D700000002008A009104900498
-0023002F004D40332D290B0802231D1A141108172F0501052729050F1701170F311F3102
-24290B0802231D1A1411080E202001202A29200F0E010E2F5D33ED2F5D121739ED5D002F
-5D33ED2F5D121739ED31300107270E01232226270727372E01353436372737173E013332
-16173717071E011514060727342623220615141633323604906EEC2C4A342E5724EC6DE9
-1718161AEA6FEB24572D2C5825EA71EB1818191765694B496B694B496B01016EEA1A1619
-17EC71EA25592B34492BED6EEB17191817EA6DED2653302D5824A949706E4B4A6F6D0000
-0002000000000000FF4C00780000000000000000000000000000000000000000037D0000
-01020103010401050106010701080109010A010B010C010D010E010F0110011101120113
-011401150116011701180119011A011B011C011D011E011F012001210122012301240125
-0126012701280129012A012B012C012D012E012F01300131013201330134013501360137
-01380139013A013B013C013D013E013F0140014101420143014401450146014701480149
-014A014B014C014D014E014F0150015101520153015401550156015701580159015A015B
-015C015D015E015F0160016101620163016401650166016701680169016A016B016C016D
-016E016F0170017101720173017401750176017701780179017A017B017C017D017E017F
-0180018101820183018401850186018701880189018A018B018C018D018E018F01900191
-01920193019401950196019701980199019A019B019C019D019E019F01A001A101A201A3
-01A401A501A601A701A801A901AA01AB01AC01AD01AE01AF01B001B101B201B301B401B5
-01B601B701B801B901BA01BB01BC01BD01BE01BF01C001C101C201C301C401C501C601C7
-01C801C901CA01CB01CC01CD01CE01CF01D001D101D201D301D401D501D601D701D801D9
-01DA01DB01DC01DD01DE01DF01E001E101E201E301E401E501E601E701E801E901EA01EB
-01EC01ED01EE01EF01F001F101F201F301F401F501F601F701F801F901FA01FB01FC01FD
-01FE01FF0200020102020203020402050206020702080209020A020B020C020D020E020F
-0210021102120213021402150216021702180219021A021B021C021D021E021F02200221
-02220223022402250226022702280229022A022B022C022D022E022F0230023102320233
-023402350236023702380239023A023B023C023D023E023F024002410242024302440245
-0246024702480249024A024B024C024D024E024F02500251025202530254025502560257
-02580259025A025B025C025D025E025F0260026102620263026402650266026702680269
-026A026B026C026D026E026F0270027102720273027402750276027702780279027A027B
-027C027D027E027F0280028102820283028402850286028702880289028A028B028C028D
-028E028F0290029102920293029402950296029702980299029A029B029C029D029E029F
-02A002A102A202A302A402A502A602A702A802A902AA02AB02AC02AD02AE02AF02B002B1
-02B202B302B402B502B602B702B802B902BA02BB02BC02BD02BE02BF02C002C102C202C3
-02C402C502C602C702C802C902CA02CB02CC02CD02CE02CF02D002D102D202D302D402D5
-02D602D702D802D902DA02DB02DC02DD02DE02DF02E002E102E202E302E402E502E602E7
-02E802E902EA02EB02EC02ED02EE02EF02F002F102F202F302F402F502F602F702F802F9
-02FA02FB02FC02FD02FE02FF0300030103020303030403050306030703080309030A030B
-030C030D030E030F0310031103120313031403150316031703180319031A031B031C031D
-031E031F0320032103220323032403250326032703280329032A032B032C032D032E032F
-0330033103320333033403350336033703380339033A033B033C033D033E033F03400341
-03420343034403450346034703480349034A034B034C034D034E034F0350035103520353
-035403550356035703580359035A035B035C035D035E035F036003610362036303640365
-0366036703680369036A036B036C036D036E036F03700371037203730374037503760377
-03780379037A037B037C037D037E037F0380038103820383038403850386038703880389
-038A038B038C038D038E038F0390039103920393039403950396039703980399039A039B
-039C039D039E039F03A003A103A203A303A403A503A603A703A803A903AA03AB03AC03AD
-03AE03AF03B003B103B203B303B403B503B603B703B803B903BA03BB03BC03BD03BE03BF
-03C003C103C203C303C403C503C603C703C803C903CA03CB03CC03CD03CE03CF03D003D1
-03D203D303D403D503D603D703D803D903DA03DB03DC03DD03DE03DF03E003E103E203E3
-03E403E503E603E703E803E903EA03EB03EC03ED03EE03EF03F003F103F203F303F403F5
-03F603F703F803F903FA03FB03FC03FD03FE03FF04000401040204030404040504060407
-04080409040A040B040C040D040E040F0410041104120413041404150416041704180419
-041A041B041C041D041E041F0420042104220423042404250426042704280429042A042B
-042C042D042E042F0430043104320433043404350436043704380439043A043B043C043D
-043E043F0440044104420443044404450446044704480449044A044B044C044D044E044F
-0450045104520453045404550456045704580459045A045B045C045D045E045F04600461
-04620463046404650466046704680469046A046B046C046D046E046F0470047104720473
-047404750476047704780479047A047B047C047D052E6E756C6C106E6F6E6D61726B696E
-6772657475726E057370616365066578636C616D0871756F746564626C0A6E756D626572
-7369676E06646F6C6C61720770657263656E7409616D70657273616E640B71756F746573
-696E676C6509706172656E6C6566740A706172656E726967687408617374657269736B04
-706C757305636F6D6D610668797068656E06706572696F6405736C617368047A65726F03
-6F6E650374776F05746872656504666F757204666976650373697805736576656E056569
-676874046E696E6505636F6C6F6E0973656D69636F6C6F6E046C65737305657175616C07
-67726561746572087175657374696F6E0261740141014201430144014501460147014801
-49014A014B014C014D014E014F0150015101520153015401550156015701580159015A0B
-627261636B65746C656674096261636B736C6173680C627261636B657472696768740B61
-7363696963697263756D0A756E64657273636F7265056772617665016101620163016401
-650166016701680169016A016B016C016D016E016F017001710172017301740175017601
-7701780179017A0962726163656C656674036261720A627261636572696768740A617363
-696974696C646509416469657265736973054172696E670843636564696C6C6106456163
-757465064E74696C6465094F646965726573697309556469657265736973066161637574
-65066167726176650B6163697263756D666C657809616469657265736973066174696C64
-65056172696E670863636564696C6C6106656163757465066567726176650B6563697263
-756D666C65780965646965726573697306696163757465066967726176650B6963697263
-756D666C657809696469657265736973066E74696C6465066F6163757465066F67726176
-650B6F63697263756D666C6578096F6469657265736973066F74696C6465067561637574
-65067567726176650B7563697263756D666C657809756469657265736973066461676765
-72066465677265650463656E7408737465726C696E670773656374696F6E0662756C6C65
-74097061726167726170680A6765726D616E64626C730A7265676973746572656409636F
-707972696768740974726164656D61726B056163757465086469657265736973086E6F74
-657175616C024145064F736C61736808696E66696E69747909706C75736D696E7573096C
-657373657175616C0C67726561746572657175616C0379656E036D75310B706172746961
-6C646966660973756D6D6174696F6E0770726F647563740370693108696E74656772616C
-0B6F726466656D696E696E650C6F72646D617363756C696E65034F686D026165066F736C
-6173680C7175657374696F6E646F776E0A6578636C616D646F776E0A6C6F676963616C6E
-6F74077261646963616C06666C6F72696E0B617070726F78657175616C09696E6372656D
-656E740D6775696C6C656D6F746C6566740E6775696C6C656D6F74726967687408656C6C
-697073697306416772617665064174696C6465064F74696C6465024F45026F6506656E64
-61736806656D646173680C71756F746564626C6C6566740D71756F746564626C72696768
-740971756F74656C6566740A71756F7465726967687406646976696465076C6F7A656E67
-650979646965726573697309596469657265736973086672616374696F6E044575726F0D
-6775696C73696E676C6C6566740E6775696C73696E676C726967687402666902666C0964
-616767657264626C0E706572696F6463656E74657265640E71756F746573696E676C6261
-73650C71756F746564626C626173650B70657274686F7573616E640B4163697263756D66
-6C65780B4563697263756D666C6578064161637574650945646965726573697306456772
-617665064961637574650B4963697263756D666C65780949646965726573697306496772
-617665064F61637574650B4F63697263756D666C6578064F677261766506556163757465
-0B5563697263756D666C65780655677261766508646F746C657373690A63697263756D66
-6C65780574696C6465066D6163726F6E05627265766509646F74616363656E740472696E
-6707636564696C6C610C68756E676172756D6C617574066F676F6E656B056361726F6E06
-4C736C617368066C736C61736806536361726F6E06736361726F6E065A6361726F6E067A
-6361726F6E0962726F6B656E626172034574680365746806596163757465067961637574
-650554686F726E0574686F726E056D696E7573086D756C7469706C790B6F6E6573757065
-72696F720B74776F7375706572696F720D74687265657375706572696F72076F6E656861
-6C660A6F6E65717561727465720D74687265657175617274657273056672616E63064762
-72657665066762726576650449646F740853636564696C6C610873636564696C6C610643
-61637574650663616375746506436361726F6E06636361726F6E07646D6163726F6E096F
-76657273636F7265066D6964646F74064162726576650661627265766507416F676F6E65
-6B07616F676F6E656B06446361726F6E06646361726F6E0644736C61736807456F676F6E
-656B07656F676F6E656B06456361726F6E06656361726F6E064C6163757465066C616375
-7465064C6361726F6E066C6361726F6E044C646F74046C646F74064E6163757465066E61
-63757465064E6361726F6E066E6361726F6E094F64626C6163757465096F64626C616375
-7465065261637574650672616375746506526361726F6E06726361726F6E065361637574
-65067361637574650854636564696C6C610874636564696C6C6106546361726F6E067463
-61726F6E055572696E67057572696E67095564626C6163757465097564626C6163757465
-065A6163757465067A6163757465045A646F74047A646F740547616D6D61055468657461
-0350686905616C7068610564656C746107657073696C6F6E057369676D61037461750370
-68690D756E64657273636F726564626C096578636C616D64626C096E7375706572696F72
-0670657365746102494A02696A0B6E61706F7374726F706865066D696E75746506736563
-6F6E64096166696936313234380961666969363132383906483232303733064831383534
-3306483138353531064831383533330A6F70656E62756C6C657407416D6163726F6E0761
-6D6163726F6E0B4363697263756D666C65780B6363697263756D666C65780443646F7404
-63646F7407456D6163726F6E07656D6163726F6E06456272657665066562726576650445
-646F740465646F740B4763697263756D666C65780B6763697263756D666C65780447646F
-740467646F740847636564696C6C610867636564696C6C610B4863697263756D666C6578
-0B6863697263756D666C657804486261720468626172064974696C6465066974696C6465
-07496D6163726F6E07696D6163726F6E064962726576650669627265766507496F676F6E
-656B07696F676F6E656B0B4A63697263756D666C65780B6A63697263756D666C6578084B
-636564696C6C61086B636564696C6C610C6B677265656E6C616E646963084C636564696C
-6C61086C636564696C6C61084E636564696C6C61086E636564696C6C6103456E6703656E
-67074F6D6163726F6E076F6D6163726F6E064F6272657665066F62726576650852636564
-696C6C610872636564696C6C610B5363697263756D666C65780B7363697263756D666C65
-7804546261720474626172065574696C6465067574696C646507556D6163726F6E07756D
-6163726F6E065562726576650675627265766507556F676F6E656B07756F676F6E656B0B
-5763697263756D666C65780B7763697263756D666C65780B5963697263756D666C65780B
-7963697263756D666C6578056C6F6E67730A4172696E6761637574650A6172696E676163
-757465074145616375746507616561637574650B4F736C61736861637574650B6F736C61
-7368616375746509616E6F74656C65696106576772617665067767726176650657616375
-746506776163757465095764696572657369730977646965726573697306596772617665
-067967726176650D71756F74657265766572736564097261646963616C65780961666969
-303839343109657374696D61746564096F6E656569676874680C74687265656569676874
-68730B66697665656967687468730C736576656E656967687468730B636F6D6D61616363
-656E7410756E646572636F6D6D61616363656E7405746F6E6F730D646965726573697374
-6F6E6F730A416C706861746F6E6F730C457073696C6F6E746F6E6F7308457461746F6E6F
-7309496F7461746F6E6F730C4F6D6963726F6E746F6E6F730C557073696C6F6E746F6E6F
-730A4F6D656761746F6E6F7311696F74616469657265736973746F6E6F7305416C706861
-04426574610544656C746107457073696C6F6E045A6574610345746104496F7461054B61
-707061064C616D626461024D75024E75025869074F6D6963726F6E0250690352686F0553
-69676D610354617507557073696C6F6E0343686903507369054F6D6567610C496F746164
-696572657369730F557073696C6F6E64696572657369730A616C706861746F6E6F730C65
-7073696C6F6E746F6E6F7308657461746F6E6F7309696F7461746F6E6F7314757073696C
-6F6E6469657265736973746F6E6F7304626574610567616D6D61047A6574610365746105
-746865746104696F7461056B61707061066C616D626461026D75026E75027869076F6D69
-63726F6E0372686F067369676D613107757073696C6F6E0363686903707369056F6D6567
-610C696F746164696572657369730F757073696C6F6E64696572657369730C6F6D696372
-6F6E746F6E6F730C757073696C6F6E746F6E6F730A6F6D656761746F6E6F730961666969
-313030323309616669693130303531096166696931303035320961666969313030353309
-616669693130303534096166696931303035350961666969313030353609616669693130
-303537096166696931303035380961666969313030353909616669693130303630096166
-696931303036310961666969313030363209616669693130313435096166696931303031
-370961666969313030313809616669693130303139096166696931303032300961666969
-313030323109616669693130303232096166696931303032340961666969313030323509
-616669693130303236096166696931303032370961666969313030323809616669693130
-303239096166696931303033300961666969313030333109616669693130303332096166
-696931303033330961666969313030333409616669693130303335096166696931303033
-360961666969313030333709616669693130303338096166696931303033390961666969
-313030343009616669693130303431096166696931303034320961666969313030343309
-616669693130303434096166696931303034350961666969313030343609616669693130
-303437096166696931303034380961666969313030343909616669693130303635096166
-696931303036360961666969313030363709616669693130303638096166696931303036
-390961666969313030373009616669693130303732096166696931303037330961666969
-313030373409616669693130303735096166696931303037360961666969313030373709
-616669693130303738096166696931303037390961666969313030383009616669693130
-303831096166696931303038320961666969313030383309616669693130303834096166
-696931303038350961666969313030383609616669693130303837096166696931303038
-380961666969313030383909616669693130303930096166696931303039310961666969
-313030393209616669693130303933096166696931303039340961666969313030393509
-616669693130303936096166696931303039370961666969313030373109616669693130
-303939096166696931303130300961666969313031303109616669693130313032096166
-696931303130330961666969313031303409616669693130313035096166696931303130
-360961666969313031303709616669693130313038096166696931303130390961666969
-313031313009616669693130313933096166696931303035300961666969313030393809
-616669693030323038096166696936313335320270690C6F6E656E756D657261746F720C
-74776F6E756D657261746F720E74687265656E756D657261746F720D666F75726E756D65
-7261746F720D666976656E756D657261746F720E736576656E6E756D657261746F720E65
-696768746E756D657261746F7210446F6E74436F6D707265737348544D5808676C797068
-35373908676C79706835383008676C797068353831054F686F726E056F686F726E055568
-6F726E0575686F726E0D686F6F6B61626F7665636F6D620C646F7462656C6F77636F6D62
-096772617665636F6D62096163757465636F6D6208676C79706835393008676C79706835
-393108676C79706835393208676C79706835393308676C79706835393408676C79706835
-393508676C79706835393608676C79706835393708676C79706835393808676C79706835
-393908676C79706836303008676C79706836303108676C79706836303208676C79706836
-303308676C7970683630340941646F7462656C6F770961646F7462656C6F770A41686F6F
-6B61626F76650A61686F6F6B61626F7665104163697263756D666C657861637574651061
-63697263756D666C65786163757465104163697263756D666C6578677261766510616369
-7263756D666C65786772617665144163697263756D666C6578686F6F6B61626F76651461
-63697263756D666C6578686F6F6B61626F7665104163697263756D666C657874696C6465
-106163697263756D666C657874696C6465134163697263756D666C6578646F7462656C6F
-77136163697263756D666C6578646F7462656C6F770B41627265766561637574650B6162
-7265766561637574650B41627265766567726176650B61627265766567726176650F4162
-72657665686F6F6B61626F76650F616272657665686F6F6B61626F76650B416272657665
-74696C64650B61627265766574696C64650E416272657665646F7462656C6F770E616272
-657665646F7462656C6F770945646F7462656C6F770965646F7462656C6F770A45686F6F
-6B61626F76650A65686F6F6B61626F7665064574696C6465066574696C64651045636972
-63756D666C65786163757465106563697263756D666C6578616375746510456369726375
-6D666C65786772617665106563697263756D666C65786772617665144563697263756D66
-6C6578686F6F6B61626F7665146563697263756D666C6578686F6F6B61626F7665104563
-697263756D666C657874696C6465106563697263756D666C657874696C64651345636972
-63756D666C6578646F7462656C6F77136563697263756D666C6578646F7462656C6F770A
-49686F6F6B61626F76650A69686F6F6B61626F76650949646F7462656C6F770969646F74
-62656C6F7708676C79706836343908676C79706836353008676C79706836353108676C79
-70683635320573686576610A68617461667365676F6C0A686174616670617461680B6861
-74616671616D617473056869726971057473657265057365676F6C057061746168067161
-6D61747305686F6C616D0671756275747306646167657368056D65746567056D61716166
-0472616665057061736571077368696E646F740673696E646F7408736F66706173757104
-616C6566036265740567696D656C0564616C657402686503766176057A6179696E036865
-740374657403796F640866696E616C6B6166036B6166056C616D65640866696E616C6D65
-6D036D656D0866696E616C6E756E036E756E0673616D656B68046179696E0766696E616C
-70650270650A66696E616C747361646905747361646903716F660472657368047368696E
-0374617609646F75626C6576617606766176796F6409646F75626C65796F640667657265
-73680967657273686179696D0D6E657773686571656C7369676E0A7661767368696E646F
-740D66696E616C6B616673686576610E66696E616C6B616671616D6174730A6C616D6564
-686F6C616D106C616D6564686F6C616D64616765736807616C746179696E0B7368696E73
-68696E646F740A7368696E73696E646F74117368696E6461676573687368696E646F7410
-7368696E64616765736873696E646F7409616C656670617461680A616C656671616D6174
-7309616C65666D61706971096265746461676573680B67696D656C6461676573680B6461
-6C6574646167657368086865646167657368097661766461676573680B7A6179696E6461
-676573680974657464616765736809796F646461676573680E66696E616C6B6166646167
-657368096B61666461676573680B6C616D6564646167657368096D656D64616765736809
-6E756E6461676573680C73616D656B686461676573680D66696E616C7065646167657368
-0870656461676573680B747361646964616765736809716F666461676573680A72657368
-6461676573680A7368696E64616765736808746176646167657308766176686F6C616D07
-62657472616665076B6166726166650670657261666509616C65666C616D6564127A6572
-6F77696474686E6F6E6A6F696E65720F7A65726F77696474686A6F696E65720F6C656674
-746F72696768746D61726B0F7269676874746F6C6566746D61726B096166696935373338
-380961666969353734303309616669693537343037096166696935373430390961666969
-353734343009616669693537343531096166696935373435320961666969353734353309
-616669693537343534096166696935373435350961666969353734353609616669693537
-343537096166696935373435380961666969353733393209616669693537333933096166
-696935373339340961666969353733393509616669693537333936096166696935373339
-370961666969353733393809616669693537333939096166696935373430300961666969
-353734303109616669693537333831096166696935373436310961666969363331363709
-616669693537343539096166696935373534330961666969353735333409616669693537
-343934096166696936323834330961666969363238343409616669693632383435096166
-696936343234300961666969363432343109616669693633393534096166696935373338
-320961666969363432343209616669693632383831096166696935373530340961666969
-353733363909616669693537333730096166696935373337310961666969353733373209
-616669693537333733096166696935373337340961666969353733373509616669693537
-333931096166696935373437310961666969353734363009616669693532323538096166
-696935373530360961666969363239353809616669693632393536096166696935323935
-370961666969353735303509616669693632383839096166696936323838370961666969
-363238383809616669693537353037096166696936323936310961666969363239353909
-616669693632393630096166696935373530380961666969363239363209616669693537
-353637096166696936323936340961666969353233303509616669693532333036096166
-696935373530390961666969363239363709616669693632393635096166696936323936
-360961666969353735353509616669693532333634096166696936333735330961666969
-363337353409616669693633373539096166696936333736330961666969363337393509
-616669693632383931096166696936333830380961666969363239333809616669693633
-383130096166696936323934320961666969363239343709616669693633383133096166
-696936333832330961666969363338323409616669693633383333096166696936333834
-340961666969363238383209616669693632383833096166696936323838340961666969
-363238383509616669693632383836094F646F7462656C6F77096F646F7462656C6F770A
-4F686F6F6B61626F76650A6F686F6F6B61626F7665104F63697263756D666C6578616375
-7465106F63697263756D666C65786163757465104F63697263756D666C65786772617665
-106F63697263756D666C65786772617665144F63697263756D666C6578686F6F6B61626F
-7665146F63697263756D666C6578686F6F6B61626F7665104F63697263756D666C657874
-696C6465106F63697263756D666C657874696C6465134F63697263756D666C6578646F74
-62656C6F77136F63697263756D666C6578646F7462656C6F770A4F686F726E6163757465
-0A6F686F726E61637574650A4F686F726E67726176650A6F686F726E67726176650E4F68
-6F726E686F6F6B61626F76650E6F686F726E686F6F6B61626F76650A4F686F726E74696C
-64650A6F686F726E74696C64650D4F686F726E646F7462656C6F770D6F686F726E646F74
-62656C6F770955646F7462656C6F770975646F7462656C6F770A55686F6F6B61626F7665>
-<0A75686F6F6B61626F76650A55686F726E61637574650A75686F726E61637574650A5568
-6F726E67726176650A75686F726E67726176650E55686F726E686F6F6B61626F76650E75
-686F726E686F6F6B61626F76650A55686F726E74696C64650A75686F726E74696C64650D
-55686F726E646F7462656C6F770D75686F726E646F7462656C6F7708676C797068383832
-08676C7970683838330959646F7462656C6F770979646F7462656C6F770A59686F6F6B61
-626F76650A79686F6F6B61626F7665065974696C6465067974696C646504646F6E670974
-696C6465636F6D620863757272656E63790000000000000100000C92000102160C000009
-0084000400B4FF9C000400B6FF9C000A0024FF9C000A0090FF9C000F00B4FF2E000F00B6
-FF2E00100024FFCE0010002CFFE20010002DFF9C00100036FFEC00100037FF6A00100039
-FFCE0010003AFFCE0010003BFFB00010003CFF740010003DFFE200100044FFEC00100059
-FFD80010005AFFEC0010005BFFCE0010005CFFD80010005DFFD800100090FFCE001000A0
-FFEC0011000FFF7E00110010FF60001100B1FF88001100B2FF88001100B4FF2E001100B6
-FF2E001D00B2FF7400240010FFCE00240036FFF600240037FF8800240038FFF600240039
-FFC40024003AFFCE0024003CFFB000240057FFEC00240058FFF600240059FFCE0024005A
-FFE20024005CFFCE002400B1FFCE002400B2FFCE002400B3FFCE002400B4FF88002400B5
-FFCE002400B6FF880025000FFFEC00250010000A00250011FFEC00250037FFC4002500AB
-FFEC002500B1000A002500B2000A00260010FFCE002600AFFFE7002600B1FFCE002600B2
-FFCE0027000FFFCE00270011FFCE00270037FFCE0027003AFFEC0027003BFFF60027003C
-FFEC0027003DFFEC002700ABFFCE0029000FFED400290011FED40029001DFFC40029001E
-FFC400290022003C00290024FF9C00290037001E00290044FF9C00290048FFCE00290052
-FFCE00290090FF92002900A0FF9C002900A1FFCE002900ABFED4002900B0FFCE002C0010
-FFE2002C00B1FFE2002C00B2FFE2002D000FFFEC002D0011FFEC002D0024FFF6002D0090
-FFF6002D00ABFFEC002E0010FF92002E0032FFEC002E0044FFC4002E0048FFBA002E0052
-FFBA002E0058FFCE002E0059FFB0002E005AFFBA002E005CFFB0002E0091FFEC002E00A0
-FFC4002E00A1FFBA002E00AFFFEC002E00B0FFBA002E00B1FF92002E00B2FF92002F000A
-FF88002F0010FF60002F0026FFEC002F002AFFEC002F002D0064002F0032FFEC002F0037
-FF56002F0039FF92002F003AFF9C002F003CFF60002F0059FF92002F005CFF92002F0064
-FFEC002F0091FFEC002F00AFFFEC002F00B1FF60002F00B2FF60002F00B4FF60002F00B6
-FF600032000FFFE200320011FFE200320037FFCE0032003BFFF60032003CFFEC0032003D
-FFEC003200ABFFE20033000FFED400330011FED400330024FFCE0033003C001400330044
-FFCE00330048FFCE00330052FFCE00330090FFBA003300A0FFCE003300A1FFCE003300AB
-FED4003300B0FFCE0034000FFFE200340011FFE2003400ABFFE200350010FF9C00350037
-FFC40035003CFFEC00350044FFD800350048FFCE00350052FFCE00350058FFEC0035005C
-FFC9003500A0FFCE003500A1FFCE003500B0FFC4003500B1FF9C003500B2FF9C003500B4
-FFBA003500B6FFBA0036000FFFEC00360011FFEC00360024FFEC00360036FFEA00360059
-FFE20036005AFFEC0036005CFFE200360090FFEC003600ABFFEC0037000FFEDE00370010
-FF6A00370011FEDE0037001DFF380037001EFF3800370022003C00370024FF8800370026
-FFD80037002AFFD800370032FFCE00370036FFF400370037FFBA00370044FF1000370046
-FF2400370048FF240037004AFF2E00370052FF2400370055FF3800370056FF4C00370058
-FF3800370059FF380037005AFF380037005CFF380037005DFF5600370064FFD800370090
-FF7E00370091FFCE003700A0FF10003700A1FF24003700ABFEDE003700AFFFCE003700B0
-FF24003700B1FF6A003700B2FF6A0038000FFFEC00380011FFEC00380024FFF600380090
-FFEC003800ABFFEC0039000FFEDE00390010FFCE00390011FEDE0039001DFFB00039001E
-FFB000390024FFC400390044FF9C00390048FF9C00390052FF9C00390058FFC40039005C
-FFBF00390090FFBA003900A0FF9C003900A1FF9C003900ABFEDE003900B0FF9C003900B1
-FFCE003900B2FFCE003A000FFEDE003A0010FFCE003A0011FF24003A001DFFB0003A001E
-FFB0003A0024FFCE003A0044FF9C003A0048FF9C003A0052FF9C003A0055FFC4003A0058
-FFC4003A005CFFBF003A0090FFC4003A00A0FF9C003A00A1FF9C003A00ABFF24003A00B0
-FF9C003A00B1FFCE003A00B2FFCE003B0010FFB0003B0026FFF6003B002AFFF6003B0032
-FFF6003B0044FFCE003B0048FFC4003B0052FFC4003B0058FFE2003B005CFFB0003B0064
-FFF6003B0091FFF6003B00A0FFCE003B00A1FFC4003B00AFFFF6003B00B0FFC4003B00B1
-FFB0003B00B2FFB0003C000FFEDE003C0010FF74003C0011FEDE003C001DFF38003C001E
-FF38003C0024FFB0003C0032FFEC003C0044FF74003C0047FF88003C0048FF7E003C004A
-FF7E003C0050FF9C003C0051FF9C003C0052FF7E003C0053FF9C003C0054FF7E003C0055
-FF9C003C0056FF92003C0058FF92003C0059FF9C003C0090FFB0003C0091FFEC003C00A0
-FF74003C00A1FF7E003C00ABFEDE003C00AFFFEC003C00B0FF7E003C00B1FF74003C00B2
-FF74003D0010FFC4003D0026FFEC003D002AFFEC003D0032FFEC003D003DFFF6003D0044
-FFCE003D0048FFC4003D0052FFC4003D005AFFD8003D005CFFBF003D0064FFEC003D0091
-FFEC003D00A0FFCE003D00A1FFC4003D00AFFFEC003D00B0FFC4003D00B1FFCE003D00B2
-FFCE00440059FFF00044005AFFF60044005CFFF00045000FFFE200450011FFEC0045005C
-FFFB004500ABFFEC00460010FFEC00460037FFC4004600B1FFEC004600B2FFEC00480037
-FF7400490005003C0049000A003C0049000C00640049000D00320049000FFF7E00490010
-FFCE00490011FF8800490022006E0049003F00640049004000640049005CFFF600490060
-0064004900ABFF88004900B1FFCE004900B2FFCE004900B40032004900B60032004B0059
-FFEC004B005AFFF6004B005CFFEC004E0010FF9C004E0048FFEC004E0052FFEC004E00A1
-FFEC004E00B0FFEC004E00B1FF9C004E00B2FF9C00500059FFEC0050005AFFF60050005C
-FFEC00510059FFEC0051005AFFF60051005CFFEC0052000FFFE200520011FFEC00520059
-FFF10052005BFFEC0052005CFFF1005200ABFFEC0053000FFFE200530011FFEC0053005C
-FFFB005300ABFFEC0055000FFEDE00550010FFEC00550011FEDE00550044FFDC005500A0
-FFD8005500ABFEDE005500B1FFEC005500B2FFEC005500B4001E005500B6001E00570010
-FFD80057005CFFF6005700B1FFD8005700B2FFD8005700B40014005700B600140059000F
-FF4C00590010FFD800590011FF4C00590044FFD800590048FFEE00590052FFEE005900A0
-FFD8005900A1FFEE005900ABFF4C005900B0FFF1005900B1FFD8005900B2FFD8005A000F
-FFBA005A0010FFEC005A0011FFBA005A0044FFEC005A00A0FFEC005A00ABFFBA005A00B1
-FFEC005A00B2FFEC005B0010FFCE005B0046FFEC005B0047FFF6005B0048FFE8005B004A
-FFF6005B0052FFE8005B006FFFEC005B00A1FFE8005B00B0FFEC005B00B1FFCE005B00B2
-FFCE005C000FFF42005C0010FFD8005C0011FF42005C0044FFD8005C0046FFEE005C0047
-FFF6005C0048FFEE005C004AFFF6005C0052FFEE005C0054FFF6005C006FFFEE005C00A0
-FFD8005C00A1FFEE005C00ABFF4C005C00B0FFF1005C00B1FFD8005C00B2FFD8005D0010
-FFEC005D0046FFF6005D0047FFF6005D0048FFF4005D004AFFF6005D0052FFF4005D0054
-FFF6005D006FFFF6005D00A1FFF4005D00B1FFEC005D00B2FFEC00640010FFCE006400AF
-FFE7006400B1FFCE006400B2FFCE006F0010FFEC006F00B1FFEC006F00B2FFEC0091000F
-FFE200910011FFE200910037FFCE0091003BFFF60091003CFFEC0091003DFFEC009100AB
-FFE200A1000FFFE200A10011FFEC00A10059FFF100A1005BFFEC00A1005CFFF100A100AB
-FFEC00AB00B4FF2E00AB00B6FF2E00B10024FFCE00B1002CFFE200B1002DFF9C00B10036
-FFEC00B10037FF6A00B10039FFCE00B1003AFFCE00B1003BFFB000B1003CFF7400B1003D
-FFF600B10044FFEC00B10059FFD800B1005AFFEC00B1005BFFCE00B1005CFFD800B1005D
-FFD800B10090FFCE00B100A0FFEC00B20024FFCE00B2002CFFE200B2002DFF9C00B20036
-FFEC00B20037FF6A00B20039FFCE00B2003AFFCE00B2003BFFB000B2003CFF7400B2003D
-FFF600B20044FFEC00B20059FFD800B2005AFFEC00B2005BFFCE00B2005CFFD800B2005D
-FFD800B20090FFCE00B200A0FFEC00B30024FF9C00B30090FF9C00B4000FFF2E00B40011
-FF2E00B40024FF9C00B40037006E00B40039006400B4003A003C00B4003C006E00B40056
-FFBA00B40057002800B40090FF9C00B400ABFF2E00B50024FF9C00B50090FF9C00B6000F
-FF2E00B60011FF2E00B60024FF9C00B60037006E00B60039006400B6003A003C00B6003C
-006E00B60056FFBA00B60057002800B60090FF9C00B600ABFF2E00C30037FF2E00C30039
-FF2E00C3003AFF9C00C3003CFF2E00C40037FF2E00C40039FF2E00C4003AFF9C00C4003C
-FF2E0000000000010001000100000001000013FF0000001400000000000013F7308213F3
-06092A864886F70D010702A08213E4308213E0020101310E300C06082A864886F70D0205
-05003060060A2B060104018237020104A0523050302C060A2B06010401823702011CA21E
-801C003C003C003C004F00620073006F006C006500740065003E003E003E3020300C0608
-2A864886F70D020505000410503EEC935CE1D8D33511E69A791E4594A0820F3F308202C0
-3082022902141389B4D18AE8A7C4BD35C79B8D88CA1FCA535691300D06092A864886F70D
-010104050030819E311F301D060355040A1316566572695369676E205472757374204E65
-74776F726B31173015060355040B130E566572695369676E2C20496E632E312C302A0603
-55040B1323566572695369676E2054696D65205374616D70696E67205365727669636520
-526F6F7431343032060355040B132B4E4F204C494142494C495459204143434550544544
-2C20286329393720566572695369676E2C20496E632E301E170D39373035313230373030
-30305A170D3939313233313037303030305A30819E311F301D060355040A131656657269
-5369676E205472757374204E6574776F726B31173015060355040B130E56657269536967
-6E2C20496E632E312C302A060355040B1323566572695369676E2054696D65205374616D
-70696E67205365727669636520526F6F7431343032060355040B132B4E4F204C49414249
-4C4954592041434345505445442C20286329393720566572695369676E2C20496E632E30
-819F300D06092A864886F70D010101050003818D0030818902818100D32E20F0687C2C2D
-2E811CB106B2A70BB7110D57DA53D875E3C9332AB2D4F6095B34F3E990FE090CD0DB1B5A
-B9CDE7F688B19DC08725EB7D5810736A78CB7115FDC658F629AB585E9604FD2D62115881
-1CCA7194D522582FD5CC14058436BA94AAB44D4AE9EE3B22AD56997E219C6C86C04A4797
-6AB4A636D5FC092DD3B4399B0203010001300D06092A864886F70D010104050003818100
-3A119C85053ED2E980FB7BD5A9F4AC79FC05FC953D7123A92B28DF8C136589FE2C87018F
-5A9A62CA11A780F4B7BE14B7D156996B086245C6A2A5DA357F0522DE722D048605A77C09
-16931443F0F7164DD6078E9B106C58FE0A3597CA899FDF04709C2A7D618EC1E80B719AA8
-C76662423D959422329822898AFA640824F5D2FA308202CD30820236021500BD119ADA43
-ED21FB46588489CA46889025EE1460300D06092A864886F70D010104050030819E311F30
-1D060355040A1316566572695369676E205472757374204E6574776F726B311730150603
-55040B130E566572695369676E2C20496E632E312C302A060355040B1323566572695369
-676E2054696D65205374616D70696E67205365727669636520526F6F7431343032060355
-040B132B4E4F204C494142494C4954592041434345505445442C20286329393720566572
-695369676E2C20496E632E301E170D3937303531323037303030305A170D393931323331
-3037303030305A3081AC31273025060355040B131E566572695369676E2054696D652053
-74616D70696E672053657276696365311F301D060355040B1316566572695369676E2054
-72757374204E6574776F726B31343032060355040B132B4E4F204C494142494C49545920
-41434345505445442C20286329393720566572695369676E2C20496E632E311730150603
-55040A130E566572695369676E2C20496E632E3111300F06035504071308496E7465726E
-657430819D300D06092A864886F70D010101050003818B0030818702818100AB61EDB4AD
-8D904790DCB4115E69DC0A7F62900631CDCEFF889146D7493A94E9D4063F9DADA2785AEC
-F9FC63454FB80B6E30EFA236AB2D09DFF16F27AB0D516005354F7FCE544FD0B72C42D80B
-D08DB85EFFB680D0E396B47F224942106CD398B00156A3C3CF2E9F3AF47FA858A6D72265
-E58CAB789CBCD94742685B2D7DFDB5020103300D06092A864886F70D0101040500038181
-006D60FB995FA469B3D37B702B62231E442051AF2315C77402F949F2271A5CAC86713508
-2BF68FDEE0B596E88BA74BE373C848099DB0DA8BDA1592CA03E509255606E74EA447A5D1
-5746D43856F521CDC3263B2D2532CE9BE2BF4047EAD86D4776E5C030A30F80CE7FD83B7E
-A0F9952A312B15FAC814EDDDB0E9554170462D2C7E308209A63082090FA0030201020210
-7966966E83B0D0B601126E9DC0B46571300D06092A864886F70D01010205003061311130
-0F06035504071308496E7465726E657431173015060355040A130E566572695369676E2C
-20496E632E31333031060355040B132A566572695369676E20436F6D6D65726369616C20
-536F667477617265205075626C697368657273204341301E170D39383034313630303030
-30305A170D3939303431363233353935395A3082015D3111300F06035504071308496E74
-65726E657431173015060355040A130E566572695369676E2C20496E632E313330310603
-55040B132A566572695369676E20436F6D6D65726369616C20536F667477617265205075
-626C69736865727320434131463044060355040B133D7777772E766572697369676E2E63
-6F6D2F7265706F7369746F72792F43505320496E636F72702E206279205265662E2C4C49
-41422E4C54442863293936313E303C060355040B13354469676974616C20494420436C61
-73732033202D204D6963726F736F667420536F6674776172652056616C69646174696F6E
-207632310B3009060355040613025553311330110603550408130A57617368696E67746F
-6E3110300E060355040713075265646D6F6E64311E301C060355040314154D6963726F73
-6F667420436F72706F726174696F6E311E301C060355040B14154D6963726F736F667420
-436F72706F726174696F6E30820120300D06092A864886F70D01010105000382010D0030
-8201080282010100B490D226A864E6EB15C3FF6D7B414F0AF96F2A71CE2E1853A63236E0
-D468E135FD4912D896FC65CF531420BE04C97AF5C9706D94ECCCB3AF2A309A32587CB6A9
-6B256799C0E277EA05E5EFE396F7AD0B19A6AE3C8470E2F86F5C4F7D6F0F52458A15D765
-DC3B2005E33DA16C973A0E0B2513ED21CB208E397A628305C9231AFC529DAC9D4C96D73C
-4E583D827BEE093556B568C04245A23B31A3FBD895FB55C72CA8A3C3294FCEF493F0031F
-7BF1153AA9F8AA5083056D62F08B138838D9E31C0E73C10640BA28C3EBCD9271C7BE66B2
-A15422D60B677CF8877989AC660AAA51FAFD7221FC865DC6F44A0EEC5861234DD0B13A64
-E0139E5EC8856D4C16AF3D07020103A38205DD308205D930090603551D1304023000300B
-0603551D0F0404030205A03081880603551D01048180307E80107B96E4D143FD6898F338
-CC6E3BF20B82A16330613111300F06035504071308496E7465726E657431173015060355
-040A130E566572695369676E2C20496E632E31333031060355040B132A56657269536967
-6E20436F6D6D65726369616C20536F667477617265205075626C69736865727320434182
-0502B400000130210603551D040101FF04173014300E300C060A2B060104018237020116
-0302078000300D0603551D0A040630040302064030820436060A2B06010401823702010A
-0101FF048204233082041FA029802768747470733A2F2F7777772E766572697369676E2E
-636F6D2F7265706F7369746F72792F435053A18203B8818203B454686973206365727469
-66696361746520696E636F72706F7261746573206279207265666572656E63652C20616E
-642069747320757365206973207374726963746C790A7375626A65637420746F2C207468
-6520566572695369676E2043657274696669636174696F6E205072616374696365205374
-6174656D656E742028435053290A76657273696F6E20312E302C20617661696C61626C65
-20696E2074686520566572695369676E207265706F7369746F72792061743A0A68747470
-733A2F2F7777772E766572697369676E2E636F6D3B20627920452D6D61696C2061742043
-50532D726571756573747340766572697369676E2E636F6D3B206F720A6279206D61696C
-20617420566572695369676E2C20496E632E2C203235393320436F617374204176652E2C
-204D6F756E7461696E20566965772C2043412039343034330A55534120436F7079726967
-6874202863293139393620566572695369676E2C20496E632E2020416C6C205269676874
-732052657365727665642E204345525441494E0A57415252414E5449455320444953434C
-41494D454420414E44204C494142494C495459204C494D495445442E0A0A5741524E494E
-473A2054484520555345204F462054484953204345525449464943415445204953205354
-524943544C59205355424A45435420544F205448450A564552495349474E204345525449
-4649434154494F4E2050524143544943452053544154454D454E542E2020544845204953
-5355494E4720415554484F524954590A444953434C41494D53204345525441494E20494D
-504C49454420414E4420455850524553532057415252414E544945532C20494E434C5544
-494E472057415252414E544945530A4F46204D45524348414E544142494C495459204F52
-204649544E45535320464F52204120504152544943554C415220505552504F53452C2041
-4E442057494C4C204E4F540A4245204C4941424C4520464F5220434F4E53455155454E54
-49414C2C2050554E49544956452C20414E44204345525441494E204F544845522044414D
-414745532E205345450A5448452043505320464F522044455441494C532E0A0A436F6E74
-656E7473206F662074686520566572695369676E2072656769737465726564206E6F6E76
-657269666965645375626A656374417474726962757465730A657874656E73696F6E2076
-616C7565207368616C6C206E6F7420626520636F6E736964657265642061732061636375
-7261746520696E666F726D6174696F6E0A76616C69646174656420627920746865204941
-2E0AA336803468747470733A2F2F7777772E766572697369676E2E636F6D2F7265706F73
-69746F72792F766572697369676E6C6F676F2E6769663081AF0603551D200481A7308030
-80060B6086480186F845010701013080302806082B06010505070201161C68747470733A
-2F2F7777772E766572697369676E2E636F6D2F435053306206082B060105050702023056
-3015160E566572695369676E2C20496E632E30030201011A3D566572695369676E277320
-43505320696E636F72702E206279207265666572656E6365206C6961622E206C74642E20
-286329393720566572695369676E0000000000003016060A2B06010401823702011B0408
-30060101FF0101FF300D06092A864886F70D010102050003818100954CA27955DA745C8B
-25C2A620F06CB8B37B467B9E9F7ABA710648151265CC5D29F8513B8971B1F4143878DA8F
-AE0B8036905D4897C500380A53BF4037FF8A13276D004734F7484C2E72F2C6D37EFD446F
-228FD1929FE394EDE7FF00C9C2EE721CD99C036EB6C1637B3278443B9E858AFB84863728
-2EE7A638373EBAFCF382233182042430820420020101307530613111300F060355040713
-08496E7465726E657431173015060355040A130E566572695369676E2C20496E632E3133
-3031060355040B132A566572695369676E20436F6D6D65726369616C20536F6674776172
-65205075626C69736865727320434102107966966E83B0D0B601126E9DC0B46571300C06
-082A864886F70D02050500A081AE301906092A864886F70D010903310C060A2B06010401
-8237020104301C060A2B06010401823702010B310E300C060A2B06010401823702011630
-1F06092A864886F70D010904311204105BA6237427F8290EF09CCF5B63F749F83052060A
-2B06010401823702010C31443042A01A801800560065007200640061006E006100200046
-006F006E0074A1248022687474703A2F2F7777772E6D6963726F736F66742E636F6D2F74
-727565747970652F300D06092A864886F70D0101010500048201003EFBA519B6A00C823F
-B823EA3A1E5E6EBDBBF2C647D1F1093C66910B72FEA26B78E409E7750E62A559DAAC12F7
-CCA36B0725F8BB2E0409AEE1156BE3736F46D1B116DF2B18ABCF394DCF0EF8EE01A758E5
-E4872882FFDD5F04C39F3258358C3DE27BE8FC410AC11736DD19609E3BACBB2257C5E4A4
-836F811D07EC80DAB42FE9AC33537823FA2AC0D406166130C356085818B3CEC8A53763BF
-88191B4E52ED790B57C924CEA670505AA2621C1121663215F15D1A9E89A6BC2AA35F5B1F
-86E4FDEC2280203A57D736DD2C29A4D2D29F00BAF260927AB3B36EF1C4CC5100CAC54BAA
-0AFB74D0101FBEC53815E46B3814DF7E5DFC4A121257608F59AA76D5F333A3A18201D030
-8201CC06092A864886F70D010906318201BD308201B90201013081B830819E311F301D06
-0355040A1316566572695369676E205472757374204E6574776F726B3117301506035504
-0B130E566572695369676E2C20496E632E312C302A060355040B1323566572695369676E
-2054696D65205374616D70696E67205365727669636520526F6F7431343032060355040B
-132B4E4F204C494142494C4954592041434345505445442C202863293937205665726953
-69676E2C20496E632E021500BD119ADA43ED21FB46588489CA46889025EE1460300C0608
-2A864886F70D02050500A059301806092A864886F70D010903310B06092A864886F70D01
-0701301C06092A864886F70D010905310F170D3938313131323135313835305A301F0609
-2A864886F70D01090431120410641EED59DAFC3103655C9A2A4309D288300D06092A8648
-86F70D01010105000481809092A6C858A52E216E3E56A1C40477C3C63030D247298EF8EA
-BFA1C4D5DDE8C375555276DDBB2761ADFC914D772AD331C04DDD675B9736F7D136CAA72D
-41CF9F8377C51611E0D1B6EDD8C5AB73694109FD5312908B17319E96C22CCEDD65C9D342
-DC0E3B159C36E0FDA54B21C8DD968B90621C263E94F737AC1997B9D84E517C0000>
-] def
-/CharStrings 893 dict dup begin
-/.notdef 0 def /.null 1 def /nonmarkingreturn 2 def /space 3 def /exclam 4 def
-/quotedbl 5 def /numbersign 6 def /dollar 7 def /percent 8 def
-/ampersand 9 def /quotesingle 10 def /parenleft 11 def /parenright 12 def
-/asterisk 13 def /plus 14 def /comma 15 def /hyphen 16 def
-/period 17 def /slash 18 def /zero 19 def /one 20 def
-/two 21 def /three 22 def /four 23 def /five 24 def
-/six 25 def /seven 26 def /eight 27 def /nine 28 def
-/colon 29 def /semicolon 30 def /less 31 def /equal 32 def
-/greater 33 def /question 34 def /at 35 def /A 36 def
-/B 37 def /C 38 def /D 39 def /E 40 def
-/F 41 def /G 42 def /H 43 def /I 44 def
-/J 45 def /K 46 def /L 47 def /M 48 def
-/N 49 def /O 50 def /P 51 def /Q 52 def
-/R 53 def /S 54 def /T 55 def /U 56 def
-/V 57 def /W 58 def /X 59 def /Y 60 def
-/Z 61 def /bracketleft 62 def /backslash 63 def /bracketright 64 def
-/asciicircum 65 def /underscore 66 def /grave 67 def /a 68 def
-/b 69 def /c 70 def /d 71 def /e 72 def
-/f 73 def /g 74 def /h 75 def /i 76 def
-/j 77 def /k 78 def /l 79 def /m 80 def
-/n 81 def /o 82 def /p 83 def /q 84 def
-/r 85 def /s 86 def /t 87 def /u 88 def
-/v 89 def /w 90 def /x 91 def /y 92 def
-/z 93 def /braceleft 94 def /bar 95 def /braceright 96 def
-/asciitilde 97 def /Adieresis 98 def /Aring 99 def /Ccedilla 100 def
-/Eacute 101 def /Ntilde 102 def /Odieresis 103 def /Udieresis 104 def
-/aacute 105 def /agrave 106 def /acircumflex 107 def /adieresis 108 def
-/atilde 109 def /aring 110 def /ccedilla 111 def /eacute 112 def
-/egrave 113 def /ecircumflex 114 def /edieresis 115 def /iacute 116 def
-/igrave 117 def /icircumflex 118 def /idieresis 119 def /ntilde 120 def
-/oacute 121 def /ograve 122 def /ocircumflex 123 def /odieresis 124 def
-/otilde 125 def /uacute 126 def /ugrave 127 def /ucircumflex 128 def
-/udieresis 129 def /dagger 130 def /degree 131 def /cent 132 def
-/sterling 133 def /section 134 def /bullet 135 def /paragraph 136 def
-/germandbls 137 def /registered 138 def /copyright 139 def /trademark 140 def
-/acute 141 def /dieresis 142 def /notequal 143 def /AE 144 def
-/Oslash 145 def /infinity 146 def /plusminus 147 def /lessequal 148 def
-/greaterequal 149 def /yen 150 def /mu1 151 def /partialdiff 152 def
-/summation 153 def /product 154 def /pi1 155 def /integral 156 def
-/ordfeminine 157 def /ordmasculine 158 def /Ohm 159 def /ae 160 def
-/oslash 161 def /questiondown 162 def /exclamdown 163 def /logicalnot 164 def
-/radical 165 def /florin 166 def /approxequal 167 def /increment 168 def
-/guillemotleft 169 def /guillemotright 170 def /ellipsis 171 def /Agrave 172 def
-/Atilde 173 def /Otilde 174 def /OE 175 def /oe 176 def
-/endash 177 def /emdash 178 def /quotedblleft 179 def /quotedblright 180 def
-/quoteleft 181 def /quoteright 182 def /divide 183 def /lozenge 184 def
-/ydieresis 185 def /Ydieresis 186 def /fraction 187 def /Euro 188 def
-/guilsinglleft 189 def /guilsinglright 190 def /fi 191 def /fl 192 def
-/daggerdbl 193 def /periodcentered 194 def /quotesinglbase 195 def /quotedblbase 196 def
-/perthousand 197 def /Acircumflex 198 def /Ecircumflex 199 def /Aacute 200 def
-/Edieresis 201 def /Egrave 202 def /Iacute 203 def /Icircumflex 204 def
-/Idieresis 205 def /Igrave 206 def /Oacute 207 def /Ocircumflex 208 def
-/Ograve 209 def /Uacute 210 def /Ucircumflex 211 def /Ugrave 212 def
-/dotlessi 213 def /circumflex 214 def /tilde 215 def /macron 216 def
-/breve 217 def /dotaccent 218 def /ring 219 def /cedilla 220 def
-/hungarumlaut 221 def /ogonek 222 def /caron 223 def /Lslash 224 def
-/lslash 225 def /Scaron 226 def /scaron 227 def /Zcaron 228 def
-/zcaron 229 def /brokenbar 230 def /Eth 231 def /eth 232 def
-/Yacute 233 def /yacute 234 def /Thorn 235 def /thorn 236 def
-/minus 237 def /multiply 238 def /onesuperior 239 def /twosuperior 240 def
-/threesuperior 241 def /onehalf 242 def /onequarter 243 def /threequarters 244 def
-/franc 245 def /Gbreve 246 def /gbreve 247 def /Idot 248 def
-/Scedilla 249 def /scedilla 250 def /Cacute 251 def /cacute 252 def
-/Ccaron 253 def /ccaron 254 def /dmacron 255 def /overscore 256 def
-/middot 257 def /Abreve 258 def /abreve 259 def /Aogonek 260 def
-/aogonek 261 def /Dcaron 262 def /dcaron 263 def /Dslash 264 def
-/Eogonek 265 def /eogonek 266 def /Ecaron 267 def /ecaron 268 def
-/Lacute 269 def /lacute 270 def /Lcaron 271 def /lcaron 272 def
-/Ldot 273 def /ldot 274 def /Nacute 275 def /nacute 276 def
-/Ncaron 277 def /ncaron 278 def /Odblacute 279 def /odblacute 280 def
-/Racute 281 def /racute 282 def /Rcaron 283 def /rcaron 284 def
-/Sacute 285 def /sacute 286 def /Tcedilla 287 def /tcedilla 288 def
-/Tcaron 289 def /tcaron 290 def /Uring 291 def /uring 292 def
-/Udblacute 293 def /udblacute 294 def /Zacute 295 def /zacute 296 def
-/Zdot 297 def /zdot 298 def /Gamma 299 def /Theta 300 def
-/Phi 301 def /alpha 302 def /delta 303 def /epsilon 304 def
-/sigma 305 def /tau 306 def /phi 307 def /underscoredbl 308 def
-/exclamdbl 309 def /nsuperior 310 def /peseta 311 def /IJ 312 def
-/ij 313 def /napostrophe 314 def /minute 315 def /second 316 def
-/afii61248 317 def /afii61289 318 def /H22073 319 def /H18543 320 def
-/H18551 321 def /H18533 322 def /openbullet 323 def /Amacron 324 def
-/amacron 325 def /Ccircumflex 326 def /ccircumflex 327 def /Cdot 328 def
-/cdot 329 def /Emacron 330 def /emacron 331 def /Ebreve 332 def
-/ebreve 333 def /Edot 334 def /edot 335 def /Gcircumflex 336 def
-/gcircumflex 337 def /Gdot 338 def /gdot 339 def /Gcedilla 340 def
-/gcedilla 341 def /Hcircumflex 342 def /hcircumflex 343 def /Hbar 344 def
-/hbar 345 def /Itilde 346 def /itilde 347 def /Imacron 348 def
-/imacron 349 def /Ibreve 350 def /ibreve 351 def /Iogonek 352 def
-/iogonek 353 def /Jcircumflex 354 def /jcircumflex 355 def /Kcedilla 356 def
-/kcedilla 357 def /kgreenlandic 358 def /Lcedilla 359 def /lcedilla 360 def
-/Ncedilla 361 def /ncedilla 362 def /Eng 363 def /eng 364 def
-/Omacron 365 def /omacron 366 def /Obreve 367 def /obreve 368 def
-/Rcedilla 369 def /rcedilla 370 def /Scircumflex 371 def /scircumflex 372 def
-/Tbar 373 def /tbar 374 def /Utilde 375 def /utilde 376 def
-/Umacron 377 def /umacron 378 def /Ubreve 379 def /ubreve 380 def
-/Uogonek 381 def /uogonek 382 def /Wcircumflex 383 def /wcircumflex 384 def
-/Ycircumflex 385 def /ycircumflex 386 def /longs 387 def /Aringacute 388 def
-/aringacute 389 def /AEacute 390 def /aeacute 391 def /Oslashacute 392 def
-/oslashacute 393 def /anoteleia 394 def /Wgrave 395 def /wgrave 396 def
-/Wacute 397 def /wacute 398 def /Wdieresis 399 def /wdieresis 400 def
-/Ygrave 401 def /ygrave 402 def /quotereversed 403 def /radicalex 404 def
-/afii08941 405 def /estimated 406 def /oneeighth 407 def /threeeighths 408 def
-/fiveeighths 409 def /seveneighths 410 def /commaaccent 411 def /undercommaaccent 412 def
-/tonos 413 def /dieresistonos 414 def /Alphatonos 415 def /Epsilontonos 416 def
-/Etatonos 417 def /Iotatonos 418 def /Omicrontonos 419 def /Upsilontonos 420 def
-/Omegatonos 421 def /iotadieresistonos 422 def /Alpha 423 def /Beta 424 def
-/Delta 425 def /Epsilon 426 def /Zeta 427 def /Eta 428 def
-/Iota 429 def /Kappa 430 def /Lambda 431 def /Mu 432 def
-/Nu 433 def /Xi 434 def /Omicron 435 def /Pi 436 def
-/Rho 437 def /Sigma 438 def /Tau 439 def /Upsilon 440 def
-/Chi 441 def /Psi 442 def /Omega 443 def /Iotadieresis 444 def
-/Upsilondieresis 445 def /alphatonos 446 def /epsilontonos 447 def /etatonos 448 def
-/iotatonos 449 def /upsilondieresistonos 450 def /beta 451 def /gamma 452 def
-/zeta 453 def /eta 454 def /theta 455 def /iota 456 def
-/kappa 457 def /lambda 458 def /mu 459 def /nu 460 def
-/xi 461 def /omicron 462 def /rho 463 def /sigma1 464 def
-/upsilon 465 def /chi 466 def /psi 467 def /omega 468 def
-/iotadieresis 469 def /upsilondieresis 470 def /omicrontonos 471 def /upsilontonos 472 def
-/omegatonos 473 def /afii10023 474 def /afii10051 475 def /afii10052 476 def
-/afii10053 477 def /afii10054 478 def /afii10055 479 def /afii10056 480 def
-/afii10057 481 def /afii10058 482 def /afii10059 483 def /afii10060 484 def
-/afii10061 485 def /afii10062 486 def /afii10145 487 def /afii10017 488 def
-/afii10018 489 def /afii10019 490 def /afii10020 491 def /afii10021 492 def
-/afii10022 493 def /afii10024 494 def /afii10025 495 def /afii10026 496 def
-/afii10027 497 def /afii10028 498 def /afii10029 499 def /afii10030 500 def
-/afii10031 501 def /afii10032 502 def /afii10033 503 def /afii10034 504 def
-/afii10035 505 def /afii10036 506 def /afii10037 507 def /afii10038 508 def
-/afii10039 509 def /afii10040 510 def /afii10041 511 def /afii10042 512 def
-/afii10043 513 def /afii10044 514 def /afii10045 515 def /afii10046 516 def
-/afii10047 517 def /afii10048 518 def /afii10049 519 def /afii10065 520 def
-/afii10066 521 def /afii10067 522 def /afii10068 523 def /afii10069 524 def
-/afii10070 525 def /afii10072 526 def /afii10073 527 def /afii10074 528 def
-/afii10075 529 def /afii10076 530 def /afii10077 531 def /afii10078 532 def
-/afii10079 533 def /afii10080 534 def /afii10081 535 def /afii10082 536 def
-/afii10083 537 def /afii10084 538 def /afii10085 539 def /afii10086 540 def
-/afii10087 541 def /afii10088 542 def /afii10089 543 def /afii10090 544 def
-/afii10091 545 def /afii10092 546 def /afii10093 547 def /afii10094 548 def
-/afii10095 549 def /afii10096 550 def /afii10097 551 def /afii10071 552 def
-/afii10099 553 def /afii10100 554 def /afii10101 555 def /afii10102 556 def
-/afii10103 557 def /afii10104 558 def /afii10105 559 def /afii10106 560 def
-/afii10107 561 def /afii10108 562 def /afii10109 563 def /afii10110 564 def
-/afii10193 565 def /afii10050 566 def /afii10098 567 def /afii00208 568 def
-/afii61352 569 def /pi 570 def /onenumerator 571 def /twonumerator 572 def
-/threenumerator 573 def /fournumerator 574 def /fivenumerator 575 def /sevennumerator 576 def
-/eightnumerator 577 def /DontCompressHTMX 578 def /glyph579 579 def /glyph580 580 def
-/glyph581 581 def /Ohorn 582 def /ohorn 583 def /Uhorn 584 def
-/uhorn 585 def /hookabovecomb 586 def /dotbelowcomb 587 def /gravecomb 588 def
-/acutecomb 589 def /glyph590 590 def /glyph591 591 def /glyph592 592 def
-/glyph593 593 def /glyph594 594 def /glyph595 595 def /glyph596 596 def
-/glyph597 597 def /glyph598 598 def /glyph599 599 def /glyph600 600 def
-/glyph601 601 def /glyph602 602 def /glyph603 603 def /glyph604 604 def
-/Adotbelow 605 def /adotbelow 606 def /Ahookabove 607 def /ahookabove 608 def
-/Acircumflexacute 609 def /acircumflexacute 610 def /Acircumflexgrave 611 def /acircumflexgrave 612 def
-/Acircumflexhookabove 613 def /acircumflexhookabove 614 def /Acircumflextilde 615 def /acircumflextilde 616 def
-/Acircumflexdotbelow 617 def /acircumflexdotbelow 618 def /Abreveacute 619 def /abreveacute 620 def
-/Abrevegrave 621 def /abrevegrave 622 def /Abrevehookabove 623 def /abrevehookabove 624 def
-/Abrevetilde 625 def /abrevetilde 626 def /Abrevedotbelow 627 def /abrevedotbelow 628 def
-/Edotbelow 629 def /edotbelow 630 def /Ehookabove 631 def /ehookabove 632 def
-/Etilde 633 def /etilde 634 def /Ecircumflexacute 635 def /ecircumflexacute 636 def
-/Ecircumflexgrave 637 def /ecircumflexgrave 638 def /Ecircumflexhookabove 639 def /ecircumflexhookabove 640 def
-/Ecircumflextilde 641 def /ecircumflextilde 642 def /Ecircumflexdotbelow 643 def /ecircumflexdotbelow 644 def
-/Ihookabove 645 def /ihookabove 646 def /Idotbelow 647 def /idotbelow 648 def
-/glyph649 649 def /glyph650 650 def /glyph651 651 def /glyph652 652 def
-/sheva 653 def /hatafsegol 654 def /hatafpatah 655 def /hatafqamats 656 def
-/hiriq 657 def /tsere 658 def /segol 659 def /patah 660 def
-/qamats 661 def /holam 662 def /qubuts 663 def /dagesh 664 def
-/meteg 665 def /maqaf 666 def /rafe 667 def /paseq 668 def
-/shindot 669 def /sindot 670 def /sofpasuq 671 def /alef 672 def
-/bet 673 def /gimel 674 def /dalet 675 def /he 676 def
-/vav 677 def /zayin 678 def /het 679 def /tet 680 def
-/yod 681 def /finalkaf 682 def /kaf 683 def /lamed 684 def
-/finalmem 685 def /mem 686 def /finalnun 687 def /nun 688 def
-/samekh 689 def /ayin 690 def /finalpe 691 def /pe 692 def
-/finaltsadi 693 def /tsadi 694 def /qof 695 def /resh 696 def
-/shin 697 def /tav 698 def /doublevav 699 def /vavyod 700 def
-/doubleyod 701 def /geresh 702 def /gershayim 703 def /newsheqelsign 704 def
-/vavshindot 705 def /finalkafsheva 706 def /finalkafqamats 707 def /lamedholam 708 def
-/lamedholamdagesh 709 def /altayin 710 def /shinshindot 711 def /shinsindot 712 def
-/shindageshshindot 713 def /shindageshsindot 714 def /alefpatah 715 def /alefqamats 716 def
-/alefmapiq 717 def /betdagesh 718 def /gimeldagesh 719 def /daletdagesh 720 def
-/hedagesh 721 def /vavdagesh 722 def /zayindagesh 723 def /tetdagesh 724 def
-/yoddagesh 725 def /finalkafdagesh 726 def /kafdagesh 727 def /lameddagesh 728 def
-/memdagesh 729 def /nundagesh 730 def /samekhdagesh 731 def /finalpedagesh 732 def
-/pedagesh 733 def /tsadidagesh 734 def /qofdagesh 735 def /reshdagesh 736 def
-/shindagesh 737 def /tavdages 738 def /vavholam 739 def /betrafe 740 def
-/kafrafe 741 def /perafe 742 def /aleflamed 743 def /zerowidthnonjoiner 744 def
-/zerowidthjoiner 745 def /lefttorightmark 746 def /righttoleftmark 747 def /afii57388 748 def
-/afii57403 749 def /afii57407 750 def /afii57409 751 def /afii57440 752 def
-/afii57451 753 def /afii57452 754 def /afii57453 755 def /afii57454 756 def
-/afii57455 757 def /afii57456 758 def /afii57457 759 def /afii57458 760 def
-/afii57392 761 def /afii57393 762 def /afii57394 763 def /afii57395 764 def
-/afii57396 765 def /afii57397 766 def /afii57398 767 def /afii57399 768 def
-/afii57400 769 def /afii57401 770 def /afii57381 771 def /afii57461 772 def
-/afii63167 773 def /afii57459 774 def /afii57543 775 def /afii57534 776 def
-/afii57494 777 def /afii62843 778 def /afii62844 779 def /afii62845 780 def
-/afii64240 781 def /afii64241 782 def /afii63954 783 def /afii57382 784 def
-/afii64242 785 def /afii62881 786 def /afii57504 787 def /afii57369 788 def
-/afii57370 789 def /afii57371 790 def /afii57372 791 def /afii57373 792 def
-/afii57374 793 def /afii57375 794 def /afii57391 795 def /afii57471 796 def
-/afii57460 797 def /afii52258 798 def /afii57506 799 def /afii62958 800 def
-/afii62956 801 def /afii52957 802 def /afii57505 803 def /afii62889 804 def
-/afii62887 805 def /afii62888 806 def /afii57507 807 def /afii62961 808 def
-/afii62959 809 def /afii62960 810 def /afii57508 811 def /afii62962 812 def
-/afii57567 813 def /afii62964 814 def /afii52305 815 def /afii52306 816 def
-/afii57509 817 def /afii62967 818 def /afii62965 819 def /afii62966 820 def
-/afii57555 821 def /afii52364 822 def /afii63753 823 def /afii63754 824 def
-/afii63759 825 def /afii63763 826 def /afii63795 827 def /afii62891 828 def
-/afii63808 829 def /afii62938 830 def /afii63810 831 def /afii62942 832 def
-/afii62947 833 def /afii63813 834 def /afii63823 835 def /afii63824 836 def
-/afii63833 837 def /afii63844 838 def /afii62882 839 def /afii62883 840 def
-/afii62884 841 def /afii62885 842 def /afii62886 843 def /Odotbelow 844 def
-/odotbelow 845 def /Ohookabove 846 def /ohookabove 847 def /Ocircumflexacute 848 def
-/ocircumflexacute 849 def /Ocircumflexgrave 850 def /ocircumflexgrave 851 def /Ocircumflexhookabove 852 def
-/ocircumflexhookabove 853 def /Ocircumflextilde 854 def /ocircumflextilde 855 def /Ocircumflexdotbelow 856 def
-/ocircumflexdotbelow 857 def /Ohornacute 858 def /ohornacute 859 def /Ohorngrave 860 def
-/ohorngrave 861 def /Ohornhookabove 862 def /ohornhookabove 863 def /Ohorntilde 864 def
-/ohorntilde 865 def /Ohorndotbelow 866 def /ohorndotbelow 867 def /Udotbelow 868 def
-/udotbelow 869 def /Uhookabove 870 def /uhookabove 871 def /Uhornacute 872 def
-/uhornacute 873 def /Uhorngrave 874 def /uhorngrave 875 def /Uhornhookabove 876 def
-/uhornhookabove 877 def /Uhorntilde 878 def /uhorntilde 879 def /Uhorndotbelow 880 def
-/uhorndotbelow 881 def /glyph882 882 def /glyph883 883 def /Ydotbelow 884 def
-/ydotbelow 885 def /Yhookabove 886 def /yhookabove 887 def /Ytilde 888 def
-/ytilde 889 def /dong 890 def /tildecomb 891 def /currency 892 def
-
-end readonly def
-FontName currentdict end definefont pop
-%%EndFont
-%%EndProlog
-mpldict begin
-13.5 175.5 translate
-585 441 0 0 clipbox
-% polygon
-1.000 setgray
-1.000 setlinewidth
-0 setlinejoin
-2 setlinecap
-[] 0 setdash
-0 0 m
-0 441 l
-585 441 l
-585 0 l
-closepath
-gsave
-fill
-grestore
-stroke
-% polygon
-0.000 setgray
-73.125 44.1 m
-73.125 396.9 l
-526.5 396.9 l
-526.5 44.1 l
-closepath
-gsave
-1.000 setgray
-fill
-grestore
-stroke
-% draw_lines
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 341.084 m
-76.667 340.708 l
-80.209 339.574 l
-83.751 337.667 l
-87.293 334.958 l
-90.835 331.405 l
-94.377 326.949 l
-97.919 321.506 l
-101.461 314.959 l
-105.003 307.144 l
-108.545 297.819 l
-112.087 286.607 l
-115.629 272.882 l
-119.171 255.463 l
-122.713 231.623 l
-126.255 191.605 l
-129.797 103.027 l
-133.339 189.379 l
-136.881 202.932 l
-140.423 203.284 l
-143.965 191.777 l
-147.507 147.593 l
-151.049 193.483 l
-154.591 200.946 l
-158.133 199.387 l
-161.675 188.957 l
-165.217 143.486 l
-168.759 180.998 l
-172.301 191.170 l
-175.843 191.200 l
-179.385 183.119 l
-182.927 155.818 l
-186.469 166.661 l
-190.011 181.010 l
-193.553 182.971 l
-197.095 177.076 l
-200.637 157.567 l
-204.179 150.322 l
-207.721 171.053 l
-211.263 175.126 l
-214.805 171.229 l
-218.347 156.530 l
-221.889 128.062 l
-225.431 161.185 l
-228.973 167.631 l
-232.515 165.609 l
-236.057 154.358 l
-239.599 74.463 l
-243.141 151.102 l
-246.683 160.365 l
-250.225 160.169 l
-253.767 151.622 l
-257.309 119.107 l
-260.851 140.326 l
-264.393 153.187 l
-267.935 154.839 l
-271.477 148.556 l
-275.019 126.619 l
-278.561 127.980 l
-282.103 145.946 l
-285.645 149.548 l
-289.187 145.259 l
-292.729 129.081 l
-296.271 111.844 l
-299.812 138.465 l
-303.354 144.220 l
-306.896 141.769 l
-310.438 129.466 l
-313.980 80.114 l
-317.522 130.512 l
-321.064 138.774 l
-324.606 138.087 l
-328.148 128.702 l
-331.690 86.924 l
-335.232 121.741 l
-338.774 133.118 l
-342.316 134.191 l
-345.858 127.176 l
-349.400 101.638 l
-352.942 111.541 l
-356.484 127.140 l
-360.026 130.041 l
-363.568 125.064 l
-367.110 106.776 l
-370.652 98.551 l
-374.194 120.692 l
-377.736 125.577 l
-381.278 122.435 l
-384.820 108.642 l
-388.362 78.089 l
-391.904 113.570 l
-395.446 120.713 l
-398.988 119.291 l
-402.530 108.713 l
-406.072 43.008 l
-409.614 105.462 l
-413.156 115.325 l
-416.698 115.577 l
-420.240 107.501 l
-423.782 76.568 l
-427.324 95.836 l
-430.866 109.233 l
-434.408 111.171 l
-437.950 105.155 l
-441.492 83.904 l
-445.034 83.647 l
-448.576 102.154 l
-452.118 105.845 l
-455.660 101.582 l
-459.202 85.611 l
-462.744 66.167 l
-466.286 93.605 l
-469.828 99.169 l
-473.370 96.397 l
-476.912 83.814 l
-480.454 27.509 l
-483.996 82.648 l
-487.538 90.217 l
-491.080 88.573 l
-494.622 78.102 l
-498.164 37.173 l
-501.706 66.931 l
-505.248 76.324 l
-508.790 74.675 l
-512.332 64.142 l
-515.874 34.431 l
-519.416 35.180 l
-522.958 37.945 l
-stroke
-grestore
-% draw_lines
-0 setlinecap
-[6 6] 0 setdash
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 344.638 m
-76.667 344.021 l
-80.209 342.148 l
-83.751 338.946 l
-87.293 334.276 l
-90.835 327.903 l
-94.377 319.427 l
-97.919 308.120 l
-101.461 292.475 l
-105.003 268.454 l
-108.545 213.072 l
-112.087 218.519 l
-115.629 259.152 l
-119.171 273.925 l
-122.713 280.520 l
-126.255 282.309 l
-129.797 280.332 l
-133.339 274.683 l
-136.881 264.621 l
-140.423 247.681 l
-143.965 212.929 l
-147.507 184.774 l
-151.049 218.234 l
-154.591 243.484 l
-158.133 254.844 l
-161.675 259.959 l
-165.217 260.773 l
-168.759 257.793 l
-172.301 250.665 l
-175.843 237.757 l
-179.385 212.685 l
-182.927 178.994 l
-186.469 -424.877 l
-190.011 217.746 l
-193.553 235.408 l
-197.095 243.801 l
-200.637 247.028 l
-204.179 246.206 l
-207.721 241.360 l
-211.263 231.429 l
-214.805 212.332 l
-218.347 138.495 l
-221.889 185.787 l
-225.431 183.612 l
-228.973 217.038 l
-232.515 229.873 l
-236.057 235.734 l
-239.599 237.005 l
-243.141 234.198 l
-246.683 226.722 l
-250.225 211.859 l
-253.767 169.476 l
-257.309 186.593 l
-260.851 173.823 l
-264.393 194.732 l
-267.935 216.079 l
-271.477 225.369 l
-275.019 228.930 l
-278.561 228.116 l
-282.103 222.822 l
-285.645 211.246 l
-289.187 183.443 l
-292.729 181.050 l
-296.271 187.513 l
-299.812 178.164 l
-303.354 199.915 l
-306.896 214.825 l
-310.438 221.217 l
-313.980 222.524 l
-317.522 219.301 l
-321.064 210.468 l
-324.606 190.157 l
-328.148 169.944 l
-331.690 189.675 l
-335.232 181.582 l
-338.774 172.547 l
-342.316 202.663 l
-345.858 213.205 l
-349.400 216.995 l
-352.942 215.878 l
-356.484 209.487 l
-360.026 194.151 l
-363.568 141.332 l
-367.110 188.290 l
-370.652 190.018 l
-374.194 168.185 l
-377.736 185.194 l
-381.278 203.994 l
-384.820 211.108 l
-388.362 212.316 l
-391.904 208.247 l
-395.446 196.681 l
-398.988 154.875 l
-402.530 184.658 l
-406.072 192.833 l
-409.614 186.663 l
-413.156 -460.889 l
-416.698 191.640 l
-420.240 204.277 l
-423.782 208.351 l
-427.324 206.663 l
-430.866 198.243 l
-434.408 172.764 l
-437.950 178.651 l
-441.492 193.308 l
-445.034 193.407 l
-448.576 179.767 l
-452.118 167.615 l
-455.660 195.351 l
-459.202 203.595 l
-462.744 204.597 l
-466.286 199.048 l
-469.828 181.359 l
-473.370 168.699 l
-476.912 192.336 l
-480.454 196.765 l
-483.996 191.640 l
-487.538 166.317 l
-491.080 180.819 l
-494.622 197.324 l
-498.164 201.811 l
-501.706 199.150 l
-505.248 186.669 l
-508.790 146.473 l
-512.332 190.158 l
-515.874 198.473 l
-519.416 197.844 l
-522.958 187.711 l
-stroke
-grestore
-% draw_lines
-[3 5 1 5] 0 setdash
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 344.646 m
-76.667 344.163 l
-80.209 342.697 l
-83.751 340.206 l
-87.293 336.608 l
-90.835 331.765 l
-94.377 325.450 l
-97.919 317.263 l
-101.461 306.406 l
-105.003 290.855 l
-108.545 260.984 l
-112.087 257.910 l
-115.629 270.113 l
-119.171 268.975 l
-122.713 260.468 l
-126.255 240.233 l
-129.797 221.580 l
-133.339 244.142 l
-136.881 246.939 l
-140.423 241.790 l
-143.965 226.836 l
-147.507 180.268 l
-151.049 224.403 l
-154.591 230.521 l
-158.133 227.898 l
-161.675 216.607 l
-165.217 170.426 l
-168.759 207.344 l
-172.301 217.011 l
-175.843 216.608 l
-179.385 208.152 l
-182.927 180.524 l
-186.469 191.080 l
-190.011 205.174 l
-193.553 206.908 l
-197.095 200.811 l
-200.637 181.119 l
-204.179 173.710 l
-207.721 194.292 l
-211.263 198.229 l
-214.805 194.208 l
-218.347 179.396 l
-221.889 150.824 l
-225.431 183.851 l
-228.973 190.209 l
-232.515 188.106 l
-236.057 176.779 l
-239.599 96.814 l
-243.141 173.388 l
-246.683 182.589 l
-250.225 182.337 l
-253.767 173.737 l
-257.309 141.172 l
-260.851 162.345 l
-264.393 175.162 l
-267.935 176.773 l
-271.477 170.451 l
-275.019 148.477 l
-278.561 149.804 l
-282.103 167.738 l
-285.645 171.309 l
-289.187 166.991 l
-292.729 150.785 l
-296.271 133.522 l
-299.812 160.118 l
-303.354 165.850 l
-306.896 163.377 l
-310.438 151.052 l
-313.980 101.679 l
-317.522 152.059 l
-321.064 160.303 l
-324.606 159.598 l
-328.148 150.196 l
-331.690 108.402 l
-335.232 143.204 l
-338.774 154.567 l
-342.316 155.626 l
-345.858 148.598 l
-349.400 123.046 l
-352.942 132.938 l
-356.484 148.525 l
-360.026 151.416 l
-363.568 146.427 l
-367.110 128.129 l
-370.652 119.895 l
-374.194 142.026 l
-377.736 146.903 l
-381.278 143.752 l
-384.820 129.951 l
-388.362 99.390 l
-391.904 134.864 l
-395.446 141.999 l
-398.988 140.570 l
-402.530 129.986 l
-406.072 64.275 l
-409.614 126.723 l
-413.156 136.580 l
-416.698 136.826 l
-420.240 128.745 l
-423.782 97.807 l
-427.324 117.071 l
-430.866 130.463 l
-434.408 132.397 l
-437.950 126.376 l
-441.492 105.122 l
-445.034 104.861 l
-448.576 123.364 l
-452.118 127.052 l
-455.660 122.786 l
-459.202 106.813 l
-462.744 87.365 l
-466.286 114.801 l
-469.828 120.363 l
-473.370 117.588 l
-476.912 105.003 l
-480.454 48.696 l
-483.996 103.833 l
-487.538 111.400 l
-491.080 109.755 l
-494.622 99.282 l
-498.164 58.352 l
-501.706 88.110 l
-505.248 97.502 l
-508.790 95.852 l
-512.332 85.318 l
-515.874 55.606 l
-519.416 56.356 l
-522.958 59.120 l
-stroke
-grestore
-% draw_lines
-[1 3] 0 setdash
-gsave
-453.375 352.800 73.125 44.100 clipbox
-73.125 346.280 m
-76.667 345.676 l
-80.209 343.845 l
-83.751 340.736 l
-87.293 336.248 l
-90.835 330.224 l
-94.377 322.407 l
-97.919 312.371 l
-101.461 299.341 l
-105.003 281.601 l
-108.545 253.253 l
-112.087 220.282 l
-115.629 233.441 l
-119.171 220.121 l
-122.713 198.594 l
-126.255 213.622 l
-129.797 232.741 l
-133.339 242.085 l
-136.881 243.804 l
-140.423 237.025 l
-143.965 203.960 l
-147.507 230.388 l
-151.049 244.073 l
-154.591 246.690 l
-158.133 241.191 l
-161.675 219.125 l
-165.217 223.903 l
-168.759 241.739 l
-172.301 245.662 l
-175.843 241.477 l
-179.385 224.009 l
-182.927 215.555 l
-186.469 238.476 l
-190.011 243.766 l
-193.553 240.795 l
-197.095 226.371 l
-200.637 204.635 l
-204.179 234.918 l
-207.721 241.638 l
-211.263 239.805 l
-214.805 227.701 l
-218.347 187.148 l
-221.889 231.207 l
-225.431 239.460 l
-228.973 238.716 l
-232.515 228.509 l
-236.057 142.756 l
-239.599 227.342 l
-243.141 237.284 l
-246.683 237.602 l
-250.225 229.015 l
-253.767 188.027 l
-257.309 223.261 l
-260.851 235.117 l
-264.393 236.489 l
-267.935 229.330 l
-271.477 199.520 l
-275.019 218.852 l
-278.561 232.949 l
-282.103 235.386 l
-285.645 229.515 l
-289.187 205.946 l
-292.729 213.941 l
-296.271 230.761 l
-299.812 234.290 l
-303.354 229.607 l
-306.896 210.254 l
-310.438 208.235 l
-313.980 228.529 l
-317.522 233.195 l
-321.064 229.626 l
-324.606 213.410 l
-328.148 201.185 l
-331.690 226.226 l
-335.232 232.097 l
-338.774 229.588 l
-342.316 215.852 l
-345.858 191.524 l
-349.400 223.818 l
-352.942 230.985 l
-356.484 229.500 l
-360.026 217.812 l
-363.568 174.865 l
-367.110 221.263 l
-370.652 229.851 l
-374.194 229.371 l
-377.736 219.429 l
-381.278 138.835 l
-384.820 218.509 l
-388.362 228.686 l
-391.904 229.202 l
-395.446 220.789 l
-398.988 179.721 l
-402.530 215.482 l
-406.072 227.478 l
-409.614 228.996 l
-413.156 221.953 l
-416.698 191.902 l
-420.240 212.081 l
-423.782 226.215 l
-427.324 228.754 l
-430.866 222.960 l
-434.408 199.153 l
-437.950 208.147 l
-441.492 224.884 l
-445.034 228.476 l
-448.576 223.841 l
-452.118 204.278 l
-455.660 203.420 l
-459.202 223.466 l
-462.744 228.160 l
-466.286 224.618 l
-469.828 208.221 l
-473.370 197.415 l
-476.912 221.941 l
-480.454 227.805 l
-483.996 225.308 l
-487.538 211.417 l
-491.080 189.040 l
-494.622 220.282 l
-498.164 227.408 l
-501.706 225.922 l
-505.248 214.102 l
-508.790 174.825 l
-512.332 218.457 l
-515.874 226.966 l
-519.416 226.472 l
-522.958 216.418 l
-stroke
-grestore
-% text
-/Verdana findfont
-18.000 scalefont
-setfont
-119.312 403.956 m
-0 4 rmoveto
-(Smoothing window in frequency-domain) show
-% text
-/Verdana findfont
-14.000 scalefont
-setfont
-62.469 30.1 m
-(0.0) show
-% line
-0.500 setlinewidth
-[] 0 setdash
-163.800 44.100 m 163.800 48.100 l
-stroke
-% line
-163.800 392.900 m 163.800 396.900 l
-stroke
-% text
-153.175 30.1 m
-(0.1) show
-% line
-254.475 44.100 m 254.475 48.100 l
-stroke
-% line
-254.475 392.900 m 254.475 396.900 l
-stroke
-% text
-243.85 30.1 m
-(0.2) show
-% line
-345.150 44.100 m 345.150 48.100 l
-stroke
-% line
-345.150 392.900 m 345.150 396.900 l
-stroke
-% text
-334.994 30.1 m
-(0.3) show
-% line
-435.825 44.100 m 435.825 48.100 l
-stroke
-% line
-435.825 392.900 m 435.825 396.900 l
-stroke
-% text
-424.825 30.1 m
-(0.4) show
-% text
-515.844 30.1 m
-(0.5) show
-% text
-221.875 11.1 m
-0 3 rmoveto
-(Normalized Frequency) show
-% text
-37.062 39.1 m
-(-100) show
-% line
-73.125 91.140 m 77.125 91.140 l
-stroke
-% line
-522.500 91.140 m 526.500 91.140 l
-stroke
-% text
-47.062 86.14 m
-(-80) show
-% line
-73.125 138.180 m 77.125 138.180 l
-stroke
-% line
-522.500 138.180 m 526.500 138.180 l
-stroke
-% text
-47.062 133.18 m
-(-60) show
-% line
-73.125 185.220 m 77.125 185.220 l
-stroke
-% line
-522.500 185.220 m 526.500 185.220 l
-stroke
-% text
-47.062 180.22 m
-(-40) show
-% line
-73.125 232.260 m 77.125 232.260 l
-stroke
-% line
-522.500 232.260 m 526.500 232.260 l
-stroke
-% text
-47.062 227.26 m
-(-20) show
-% line
-73.125 279.300 m 77.125 279.300 l
-stroke
-% line
-522.500 279.300 m 526.500 279.300 l
-stroke
-% text
-61.812 274.3 m
-(0) show
-% line
-73.125 326.340 m 77.125 326.340 l
-stroke
-% line
-522.500 326.340 m 526.500 326.340 l
-stroke
-% text
-53.062 321.34 m
-(20) show
-% line
-73.125 373.380 m 77.125 373.380 l
-stroke
-% line
-522.500 373.380 m 526.500 373.380 l
-stroke
-% text
-52.938 368.38 m
-(40) show
-% text
-32.062 168.461 m
-gsave
-90 rotate
-0 3 rmoveto
-(Magnitude \(dB\)) show
-grestore
-% polygon
-1.000 setlinewidth
-2 setlinecap
-346.389 279.264 m
-346.389 389.844 l
-517.433 389.844 l
-517.433 279.264 l
-closepath
-gsave
-1.000 setgray
-fill
-grestore
-stroke
-% draw_lines
-362.443 371.629 m
-369.999 371.629 l
-377.555 371.629 l
-385.111 371.629 l
-stroke
-% draw_lines
-0 setlinecap
-[6 6] 0 setdash
-362.443 349.712 m
-369.999 349.712 l
-377.555 349.712 l
-385.111 349.712 l
-stroke
-% draw_lines
-[3 5 1 5] 0 setdash
-362.443 325.795 m
-369.999 325.795 l
-377.555 325.795 l
-385.111 325.795 l
-stroke
-% draw_lines
-[1 3] 0 setdash
-362.443 299.479 m
-369.999 299.479 l
-377.555 299.479 l
-385.111 299.479 l
-stroke
-% text
-/Verdana findfont
-24.000 scalefont
-setfont
-394.179 362.629 m
-(Blackman) show
-% text
-394.179 340.712 m
-(Bartlett) show
-% text
-394.179 314.795 m
-0 5 rmoveto
-(Hanning) show
-% text
-394.179 288.479 m
-0 5 rmoveto
-(Hamming) show
-
-end
-showpage
diff --git a/doc/numpybook/Figures/hierarchy.dia b/doc/numpybook/Figures/hierarchy.dia
deleted file mode 100644
index 65379b880..000000000
--- a/doc/numpybook/Figures/hierarchy.dia
+++ /dev/null
Binary files differ
diff --git a/doc/numpybook/Figures/hierarchy.eps b/doc/numpybook/Figures/hierarchy.eps
deleted file mode 100644
index f7538c764..000000000
--- a/doc/numpybook/Figures/hierarchy.eps
+++ /dev/null
@@ -1,5596 +0,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Title: hierarchy.dia
-%%Creator: Dia v0.94
-%%CreationDate: Wed Jan 4 16:44:07 2006
-%%For: oliphant
-%%Orientation: Portrait
-%%Magnification: 1.0000
-%%BoundingBox: 0 0 743 584
-%%BeginSetup
-%%EndSetup
-%%EndComments
-%%BeginProlog
-[ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright
-/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one
-/two /three /four /five /six /seven /eight /nine /colon /semicolon
-/less /equal /greater /question /at /A /B /C /D /E
-/F /G /H /I /J /K /L /M /N /O
-/P /Q /R /S /T /U /V /W /X /Y
-/Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c
-/d /e /f /g /h /i /j /k /l /m
-/n /o /p /q /r /s /t /u /v /w
-/x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
-/space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright
-/ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior
-/acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf
-/threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla
-/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde
-/Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex
-/Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring
-/ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis
-/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave
-/uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def
-/cp {closepath} bind def
-/c {curveto} bind def
-/f {fill} bind def
-/a {arc} bind def
-/ef {eofill} bind def
-/ex {exch} bind def
-/gr {grestore} bind def
-/gs {gsave} bind def
-/sa {save} bind def
-/rs {restore} bind def
-/l {lineto} bind def
-/m {moveto} bind def
-/rm {rmoveto} bind def
-/n {newpath} bind def
-/s {stroke} bind def
-/sh {show} bind def
-/slc {setlinecap} bind def
-/slj {setlinejoin} bind def
-/slw {setlinewidth} bind def
-/srgb {setrgbcolor} bind def
-/rot {rotate} bind def
-/sc {scale} bind def
-/sd {setdash} bind def
-/ff {findfont} bind def
-/sf {setfont} bind def
-/scf {scalefont} bind def
-/sw {stringwidth pop} bind def
-/tr {translate} bind def
-
-/ellipsedict 8 dict def
-ellipsedict /mtrx matrix put
-/ellipse
-{ ellipsedict begin
- /endangle exch def
- /startangle exch def
- /yrad exch def
- /xrad exch def
- /y exch def
- /x exch def /savematrix mtrx currentmatrix def
- x y tr xrad yrad sc
- 0 0 1 startangle endangle arc
- savematrix setmatrix
- end
-} def
-
-/mergeprocs {
-dup length
-3 -1 roll
-dup
-length
-dup
-5 1 roll
-3 -1 roll
-add
-array cvx
-dup
-3 -1 roll
-0 exch
-putinterval
-dup
-4 2 roll
-putinterval
-} bind def
-/dpi_x 300 def
-/dpi_y 300 def
-/conicto {
- /to_y exch def
- /to_x exch def
- /conic_cntrl_y exch def
- /conic_cntrl_x exch def
- currentpoint
- /p0_y exch def
- /p0_x exch def
- /p1_x p0_x conic_cntrl_x p0_x sub 2 3 div mul add def
- /p1_y p0_y conic_cntrl_y p0_y sub 2 3 div mul add def
- /p2_x p1_x to_x p0_x sub 1 3 div mul add def
- /p2_y p1_y to_y p0_y sub 1 3 div mul add def
- p1_x p1_y p2_x p2_y to_x to_y curveto
-} bind def
-/start_ol { gsave 1.1 dpi_x div dup scale} bind def
-/end_ol { closepath fill grestore } bind def
-28.346000 -28.346000 scale
--1.702375 -22.793875 translate
-%%EndProlog
-
-
-0.095250 slw
-[1.000000] 0 sd
-[0.127000] 0 sd
-0 slj
-0.000000 0.000000 0.000000 srgb
-n 11.500000 2.250000 m 11.500000 3.750000 l 14.357500 3.750000 l 14.357500 2.250000 l cp s
-gsave 12.000000 3.250000 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 12.330200 3.250000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 12.660400 3.250000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 12.990600 3.250000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 13.320800 3.250000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 2304 lineto
-576 2304 lineto
-576 1986 lineto
-709 2209 822 2288 conicto
-936 2368 1072 2368 conicto
-1268 2368 1471 2237 conicto
-1337 1898 lineto
-1195 1984 1053 1984 conicto
-925 1984 823 1905 conicto
-722 1827 679 1689 conicto
-614 1477 614 1226 conicto
-614 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 13.507067 3.250000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 13.642533 3.250000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-0.095250 slw
-[0.127000] 0 sd
-[0.127000] 0 sd
-0 slj
-n 12.500000 6.000000 m 12.500000 7.500000 l 15.357500 7.500000 l 15.357500 6.000000 l cp s
-gsave 13.000000 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 13.330200 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-1792 0 moveto
-1792 314 lineto
-1521 -64 1053 -64 conicto
-847 -64 668 11 conicto
-489 87 402 201 conicto
-316 316 280 490 conicto
-256 606 256 859 conicto
-256 2304 lineto
-655 2304 lineto
-655 1010 lineto
-655 701 679 593 conicto
-717 437 837 348 conicto
-957 259 1135 259 conicto
-1312 259 1467 350 conicto
-1622 441 1686 598 conicto
-1751 755 1751 1054 conicto
-1751 2304 lineto
-2112 2304 lineto
-2112 0 lineto
-1792 0 lineto
-end_ol grestore
-gsave 13.651933 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2008 lineto
-749 2165 930 2266 conicto
-1112 2368 1344 2368 conicto
-1602 2368 1767 2263 conicto
-1932 2159 2001 1979 conicto
-2280 2368 2728 2368 conicto
-3079 2368 3267 2177 conicto
-3456 1986 3456 1589 conicto
-3456 0 lineto
-3057 0 lineto
-3057 1471 lineto
-3057 1709 3018 1813 conicto
-2979 1918 2877 1981 conicto
-2775 2045 2638 2045 conicto
-2390 2045 2226 1881 conicto
-2063 1717 2063 1357 conicto
-2063 0 lineto
-1664 0 lineto
-1664 1517 lineto
-1664 1781 1568 1913 conicto
-1472 2045 1254 2045 conicto
-1088 2045 947 1957 conicto
-807 1869 744 1699 conicto
-681 1530 681 1212 conicto
-681 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 14.143000 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-719 0 moveto
-320 0 lineto
-320 3200 lineto
-747 3200 lineto
-747 2056 lineto
-984 2368 1357 2368 conicto
-1563 2368 1747 2281 conicto
-1931 2194 2050 2038 conicto
-2169 1882 2236 1660 conicto
-2304 1438 2304 1186 conicto
-2304 588 2019 262 conicto
-1735 -64 1337 -64 conicto
-942 -64 719 279 conicto
-719 0 lineto
-719 1170 moveto
-719 751 827 564 conicto
-1003 259 1304 259 conicto
-1549 259 1727 484 conicto
-1905 709 1905 1155 conicto
-1905 1610 1734 1827 conicto
-1563 2045 1320 2045 conicto
-1075 2045 897 1820 conicto
-719 1595 719 1170 conicto
-end_ol grestore
-gsave 14.473200 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 14.803400 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 2304 lineto
-576 2304 lineto
-576 1986 lineto
-709 2209 822 2288 conicto
-936 2368 1072 2368 conicto
-1268 2368 1471 2237 conicto
-1337 1898 lineto
-1195 1984 1053 1984 conicto
-925 1984 823 1905 conicto
-722 1827 679 1689 conicto
-614 1477 614 1226 conicto
-614 0 lineto
-256 0 lineto
-end_ol grestore
-0.095250 slw
-[0.127000] 0 sd
-[0.127000] 0 sd
-0 slj
-n 22.000000 6.000000 m 22.000000 7.500000 l 24.765000 7.500000 l 24.765000 6.000000 l cp s
-0.095250 slw
-[0.127000] 0 sd
-[0.127000] 0 sd
-0 slj
-n 21.500000 9.500000 m 21.500000 11.000000 l 24.357500 11.000000 l 24.357500 9.500000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 25.000000 9.500000 m 25.000000 10.943875 l 27.857500 10.943875 l 27.857500 9.500000 l cp s
-0.095250 slw
-[1.000000] 0 sd
-[0.127000] 0 sd
-0 slj
-n 6.000000 9.500000 m 6.000000 11.000000 l 8.750000 11.000000 l 8.750000 9.500000 l cp s
-0.095250 slw
-[0.127000] 0 sd
-[0.127000] 0 sd
-0 slj
-n 12.750000 11.500000 m 12.750000 13.000000 l 15.607500 13.000000 l 15.607500 11.500000 l cp s
-0.095250 slw
-[0.127000] 0 sd
-[0.127000] 0 sd
-0 slj
-n 16.700000 11.500000 m 16.700000 13.052375 l 21.227375 13.052375 l 21.227375 11.500000 l cp s
-gsave 22.500000 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-384 0 moveto
-384 1984 lineto
-64 1984 lineto
-64 2307 lineto
-384 2307 lineto
-384 2552 lineto
-384 2785 425 2889 conicto
-481 3029 622 3116 conicto
-764 3203 1018 3203 conicto
-1182 3203 1380 3168 conicto
-1322 2858 lineto
-1201 2880 1096 2880 conicto
-925 2880 854 2804 conicto
-783 2728 783 2520 conicto
-783 2307 lineto
-1216 2307 lineto
-1216 1984 lineto
-783 1984 lineto
-783 0 lineto
-384 0 lineto
-end_ol grestore
-gsave 22.660867 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 22.787867 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 23.118067 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-32 0 moveto
-870 1198 lineto
-95 2304 lineto
-581 2304 lineto
-932 1763 lineto
-1032 1610 1092 1506 conicto
-1187 1649 1267 1759 conicto
-1653 2304 lineto
-2117 2304 lineto
-1325 1219 lineto
-2178 0 lineto
-1701 0 lineto
-1230 716 lineto
-1105 909 lineto
-503 0 lineto
-32 0 lineto
-end_ol grestore
-gsave 23.414400 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 23.549867 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-719 0 moveto
-320 0 lineto
-320 3200 lineto
-747 3200 lineto
-747 2056 lineto
-984 2368 1357 2368 conicto
-1563 2368 1747 2281 conicto
-1931 2194 2050 2038 conicto
-2169 1882 2236 1660 conicto
-2304 1438 2304 1186 conicto
-2304 588 2019 262 conicto
-1735 -64 1337 -64 conicto
-942 -64 719 279 conicto
-719 0 lineto
-719 1170 moveto
-719 751 827 564 conicto
-1003 259 1304 259 conicto
-1549 259 1727 484 conicto
-1905 709 1905 1155 conicto
-1905 1610 1734 1827 conicto
-1563 2045 1320 2045 conicto
-1075 2045 897 1820 conicto
-719 1595 719 1170 conicto
-end_ol grestore
-gsave 23.880067 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 24.007067 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 6.500000 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 6.635467 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 6.965667 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 7.126533 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 7.456733 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 7.786933 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 8.117133 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 2304 lineto
-576 2304 lineto
-576 1986 lineto
-709 2209 822 2288 conicto
-936 2368 1072 2368 conicto
-1268 2368 1471 2237 conicto
-1337 1898 lineto
-1195 1984 1053 1984 conicto
-925 1984 823 1905 conicto
-722 1827 679 1689 conicto
-614 1477 614 1226 conicto
-614 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 13.250000 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-423 0 moveto
-423 2048 lineto
-64 2048 lineto
-64 2379 lineto
-423 2379 lineto
-423 2644 lineto
-423 2894 465 3003 conicto
-522 3148 668 3238 conicto
-814 3328 1076 3328 conicto
-1244 3328 1448 3292 conicto
-1389 2974 lineto
-1265 2997 1157 2997 conicto
-980 2997 906 2915 conicto
-832 2833 832 2608 conicto
-832 2379 lineto
-1280 2379 lineto
-1280 2048 lineto
-832 2048 lineto
-832 0 lineto
-423 0 lineto
-end_ol grestore
-gsave 13.419333 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 3264 lineto
-729 3264 lineto
-729 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 13.554800 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-128 1184 moveto
-128 1847 491 2166 conicto
-794 2432 1230 2432 conicto
-1714 2432 2021 2109 conicto
-2329 1786 2329 1218 conicto
-2329 757 2193 492 conicto
-2057 228 1797 82 conicto
-1537 -64 1230 -64 conicto
-737 -64 432 258 conicto
-128 580 128 1184 conicto
-537 1185 moveto
-537 724 734 495 conicto
-931 267 1230 267 conicto
-1526 267 1723 497 conicto
-1920 727 1920 1198 conicto
-1920 1643 1722 1872 conicto
-1524 2101 1230 2101 conicto
-931 2101 734 1873 conicto
-537 1646 537 1185 conicto
-end_ol grestore
-gsave 13.885000 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-1865 298 moveto
-1640 105 1435 20 conicto
-1230 -64 995 -64 conicto
-608 -64 400 129 conicto
-192 323 192 624 conicto
-192 801 269 946 conicto
-347 1091 472 1179 conicto
-597 1268 754 1314 conicto
-869 1345 1109 1374 conicto
-1599 1432 1831 1513 conicto
-1831 1596 1831 1618 conicto
-1831 1864 1716 1964 conicto
-1562 2101 1256 2101 conicto
-971 2101 835 2001 conicto
-700 1902 635 1649 conicto
-258 1703 lineto
-311 1955 434 2110 conicto
-557 2265 788 2348 conicto
-1020 2432 1325 2432 conicto
-1628 2432 1817 2360 conicto
-2006 2289 2095 2181 conicto
-2185 2073 2220 1908 conicto
-2240 1806 2240 1537 conicto
-2240 1001 lineto
-2240 439 2265 289 conicto
-2291 139 2366 0 conicto
-1946 0 lineto
-1883 127 1865 298 conicto
-1831 1197 moveto
-1611 1108 1170 1045 conicto
-920 1010 817 965 conicto
-714 921 657 834 conicto
-601 748 601 643 conicto
-601 482 723 374 conicto
-846 267 1082 267 conicto
-1316 267 1498 369 conicto
-1681 471 1766 648 conicto
-1831 783 1831 1050 conicto
-1831 1197 lineto
-end_ol grestore
-gsave 14.223667 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-1152 400 moveto
-1209 37 lineto
-1042 0 909 0 conicto
-694 0 575 70 conicto
-456 141 407 257 conicto
-359 373 359 735 conicto
-359 2101 lineto
-64 2101 lineto
-64 2432 lineto
-359 2432 lineto
-359 3021 lineto
-768 3263 lineto
-768 2432 lineto
-1152 2432 lineto
-1152 2101 lineto
-768 2101 lineto
-768 713 lineto
-768 541 788 491 conicto
-808 442 853 413 conicto
-899 384 984 384 conicto
-1048 384 1152 400 conicto
-end_ol grestore
-gsave 14.384533 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 2816 moveto
-320 3264 lineto
-729 3264 lineto
-729 2816 lineto
-320 2816 lineto
-320 0 moveto
-320 2368 lineto
-729 2368 lineto
-729 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 14.520000 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2368 lineto
-704 2368 lineto
-704 2058 lineto
-958 2432 1443 2432 conicto
-1654 2432 1831 2354 conicto
-2008 2277 2095 2151 conicto
-2183 2026 2218 1854 conicto
-2240 1742 2240 1462 conicto
-2240 0 lineto
-1831 0 lineto
-1831 1459 lineto
-1831 1708 1785 1831 conicto
-1740 1955 1624 2028 conicto
-1508 2101 1353 2101 conicto
-1105 2101 924 1936 conicto
-744 1771 744 1310 conicto
-744 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 14.858667 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-183 -196 moveto
-594 -254 lineto
-618 -435 726 -517 conicto
-872 -629 1124 -629 conicto
-1396 -629 1543 -518 conicto
-1691 -407 1743 -206 conicto
-1773 -83 1773 309 conicto
-1516 0 1131 0 conicto
-653 0 390 354 conicto
-128 708 128 1202 conicto
-128 1543 248 1830 conicto
-368 2118 596 2275 conicto
-825 2432 1134 2432 conicto
-1545 2432 1811 2094 conicto
-1811 2368 lineto
-2176 2368 lineto
-2176 321 lineto
-2176 -231 2064 -461 conicto
-1953 -692 1711 -826 conicto
-1470 -960 1117 -960 conicto
-698 -960 440 -769 conicto
-183 -579 183 -196 conicto
-537 1231 moveto
-537 762 718 546 conicto
-900 331 1174 331 conicto
-1444 331 1627 545 conicto
-1811 759 1811 1218 conicto
-1811 1656 1622 1878 conicto
-1433 2101 1167 2101 conicto
-905 2101 721 1882 conicto
-537 1663 537 1231 conicto
-end_ol grestore
-gsave 16.950000 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-gsave 17.246333 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 17.568067 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2008 lineto
-749 2165 930 2266 conicto
-1112 2368 1344 2368 conicto
-1602 2368 1767 2263 conicto
-1932 2159 2001 1979 conicto
-2280 2368 2728 2368 conicto
-3079 2368 3267 2177 conicto
-3456 1986 3456 1589 conicto
-3456 0 lineto
-3057 0 lineto
-3057 1471 lineto
-3057 1709 3018 1813 conicto
-2979 1918 2877 1981 conicto
-2775 2045 2638 2045 conicto
-2390 2045 2226 1881 conicto
-2063 1717 2063 1357 conicto
-2063 0 lineto
-1664 0 lineto
-1664 1517 lineto
-1664 1781 1568 1913 conicto
-1472 2045 1254 2045 conicto
-1088 2045 947 1957 conicto
-807 1869 744 1699 conicto
-681 1530 681 1212 conicto
-681 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 18.059133 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 -896 moveto
-320 2304 lineto
-704 2304 lineto
-704 1999 lineto
-827 2178 981 2273 conicto
-1136 2368 1355 2368 conicto
-1641 2368 1860 2214 conicto
-2080 2060 2192 1781 conicto
-2304 1502 2304 1169 conicto
-2304 812 2181 526 conicto
-2058 241 1822 88 conicto
-1586 -64 1327 -64 conicto
-1137 -64 986 19 conicto
-835 102 739 228 conicto
-739 -896 lineto
-320 -896 lineto
-704 1132 moveto
-704 686 877 472 conicto
-1050 259 1297 259 conicto
-1548 259 1726 480 conicto
-1905 701 1905 1164 conicto
-1905 1606 1731 1825 conicto
-1557 2045 1314 2045 conicto
-1074 2045 889 1811 conicto
-704 1577 704 1132 conicto
-end_ol grestore
-gsave 18.389333 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 18.516333 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 18.846533 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-32 0 moveto
-870 1198 lineto
-95 2304 lineto
-581 2304 lineto
-932 1763 lineto
-1032 1610 1092 1506 conicto
-1187 1649 1267 1759 conicto
-1653 2304 lineto
-2117 2304 lineto
-1325 1219 lineto
-2178 0 lineto
-1701 0 lineto
-1230 716 lineto
-1105 909 lineto
-503 0 lineto
-32 0 lineto
-end_ol grestore
-gsave 19.142867 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-384 0 moveto
-384 1984 lineto
-64 1984 lineto
-64 2307 lineto
-384 2307 lineto
-384 2552 lineto
-384 2785 425 2889 conicto
-481 3029 622 3116 conicto
-764 3203 1018 3203 conicto
-1182 3203 1380 3168 conicto
-1322 2858 lineto
-1201 2880 1096 2880 conicto
-925 2880 854 2804 conicto
-783 2728 783 2520 conicto
-783 2307 lineto
-1216 2307 lineto
-1216 1984 lineto
-783 1984 lineto
-783 0 lineto
-384 0 lineto
-end_ol grestore
-gsave 19.303733 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 19.430733 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 19.752467 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-1746 289 moveto
-1529 102 1331 19 conicto
-1133 -64 905 -64 conicto
-530 -64 329 124 conicto
-128 312 128 605 conicto
-128 777 203 919 conicto
-278 1062 399 1148 conicto
-521 1234 672 1278 conicto
-785 1309 1017 1337 conicto
-1490 1394 1713 1472 conicto
-1713 1553 1713 1575 conicto
-1713 1814 1603 1912 conicto
-1453 2045 1158 2045 conicto
-884 2045 753 1948 conicto
-622 1851 560 1605 conicto
-192 1657 lineto
-243 1902 362 2053 conicto
-481 2204 705 2286 conicto
-930 2368 1225 2368 conicto
-1519 2368 1702 2298 conicto
-1886 2229 1972 2124 conicto
-2058 2019 2093 1858 conicto
-2112 1758 2112 1496 conicto
-2112 973 lineto
-2112 427 2137 281 conicto
-2162 135 2235 0 conicto
-1825 0 lineto
-1763 123 1746 289 conicto
-1713 1165 moveto
-1501 1078 1076 1017 conicto
-835 982 735 938 conicto
-635 895 581 811 conicto
-527 727 527 624 conicto
-527 468 645 363 conicto
-763 259 991 259 conicto
-1216 259 1391 358 conicto
-1567 457 1650 630 conicto
-1713 762 1713 1021 conicto
-1713 1165 lineto
-end_ol grestore
-gsave 20.074200 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 20.235067 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 20.370533 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 20.700733 12.500000 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 25.750000 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-132 2432 moveto
-552 2432 lineto
-1308 391 lineto
-2063 2432 lineto
-2484 2432 lineto
-1578 0 lineto
-1038 0 lineto
-132 2432 lineto
-end_ol grestore
-gsave 26.097133 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-1362 2157 moveto
-1044 2157 859 1905 conicto
-675 1654 675 1216 conicto
-675 779 858 527 conicto
-1042 275 1362 275 conicto
-1678 275 1863 528 conicto
-2048 781 2048 1216 conicto
-2048 1649 1863 1903 conicto
-1678 2157 1362 2157 conicto
-1362 2496 moveto
-1878 2496 2172 2156 conicto
-2467 1817 2467 1215 conicto
-2467 617 2172 276 conicto
-1878 -64 1361 -64 conicto
-843 -64 549 276 conicto
-256 617 256 1215 conicto
-256 1817 549 2156 conicto
-843 2496 1362 2496 conicto
-end_ol grestore
-gsave 26.452733 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-448 2432 moveto
-867 2432 lineto
-867 0 lineto
-448 0 lineto
-448 2432 lineto
-448 3392 moveto
-867 3392 lineto
-867 2880 lineto
-448 2880 lineto
-448 3392 lineto
-end_ol grestore
-gsave 26.622067 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-2013 2064 moveto
-2013 3392 lineto
-2432 3392 lineto
-2432 0 lineto
-2013 0 lineto
-2013 368 lineto
-1889 150 1698 43 conicto
-1508 -64 1241 -64 conicto
-804 -64 530 288 conicto
-256 641 256 1215 conicto
-256 1791 530 2143 conicto
-804 2496 1241 2496 conicto
-1508 2496 1698 2390 conicto
-1888 2284 2013 2064 conicto
-675 1216 moveto
-675 776 853 525 conicto
-1031 275 1343 275 conicto
-1654 275 1833 525 conicto
-2013 776 2013 1216 conicto
-2013 1656 1833 1906 conicto
-1654 2157 1343 2157 conicto
-1031 2157 853 1906 conicto
-675 1656 675 1216 conicto
-end_ol grestore
-gsave 21.750000 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-gsave 22.046333 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 3200 lineto
-719 3200 lineto
-719 2064 lineto
-987 2368 1400 2368 conicto
-1655 2368 1842 2266 conicto
-2029 2165 2110 1986 conicto
-2191 1807 2191 1467 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1478 lineto
-1792 1775 1667 1910 conicto
-1543 2045 1316 2045 conicto
-1146 2045 996 1954 conicto
-846 1863 782 1707 conicto
-719 1551 719 1276 conicto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 22.376533 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-1746 289 moveto
-1529 102 1331 19 conicto
-1133 -64 905 -64 conicto
-530 -64 329 124 conicto
-128 312 128 605 conicto
-128 777 203 919 conicto
-278 1062 399 1148 conicto
-521 1234 672 1278 conicto
-785 1309 1017 1337 conicto
-1490 1394 1713 1472 conicto
-1713 1553 1713 1575 conicto
-1713 1814 1603 1912 conicto
-1453 2045 1158 2045 conicto
-884 2045 753 1948 conicto
-622 1851 560 1605 conicto
-192 1657 lineto
-243 1902 362 2053 conicto
-481 2204 705 2286 conicto
-930 2368 1225 2368 conicto
-1519 2368 1702 2298 conicto
-1886 2229 1972 2124 conicto
-2058 2019 2093 1858 conicto
-2112 1758 2112 1496 conicto
-2112 973 lineto
-2112 427 2137 281 conicto
-2162 135 2235 0 conicto
-1825 0 lineto
-1763 123 1746 289 conicto
-1713 1165 moveto
-1501 1078 1076 1017 conicto
-835 982 735 938 conicto
-635 895 581 811 conicto
-527 727 527 624 conicto
-527 468 645 363 conicto
-763 259 991 259 conicto
-1216 259 1391 358 conicto
-1567 457 1650 630 conicto
-1713 762 1713 1021 conicto
-1713 1165 lineto
-end_ol grestore
-gsave 22.698267 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 2304 lineto
-576 2304 lineto
-576 1986 lineto
-709 2209 822 2288 conicto
-936 2368 1072 2368 conicto
-1268 2368 1471 2237 conicto
-1337 1898 lineto
-1195 1984 1053 1984 conicto
-925 1984 823 1905 conicto
-722 1827 679 1689 conicto
-614 1477 614 1226 conicto
-614 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 22.884533 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-1746 289 moveto
-1529 102 1331 19 conicto
-1133 -64 905 -64 conicto
-530 -64 329 124 conicto
-128 312 128 605 conicto
-128 777 203 919 conicto
-278 1062 399 1148 conicto
-521 1234 672 1278 conicto
-785 1309 1017 1337 conicto
-1490 1394 1713 1472 conicto
-1713 1553 1713 1575 conicto
-1713 1814 1603 1912 conicto
-1453 2045 1158 2045 conicto
-884 2045 753 1948 conicto
-622 1851 560 1605 conicto
-192 1657 lineto
-243 1902 362 2053 conicto
-481 2204 705 2286 conicto
-930 2368 1225 2368 conicto
-1519 2368 1702 2298 conicto
-1886 2229 1972 2124 conicto
-2058 2019 2093 1858 conicto
-2112 1758 2112 1496 conicto
-2112 973 lineto
-2112 427 2137 281 conicto
-2162 135 2235 0 conicto
-1825 0 lineto
-1763 123 1746 289 conicto
-1713 1165 moveto
-1501 1078 1076 1017 conicto
-835 982 735 938 conicto
-635 895 581 811 conicto
-527 727 527 624 conicto
-527 468 645 363 conicto
-763 259 991 259 conicto
-1216 259 1391 358 conicto
-1567 457 1650 630 conicto
-1713 762 1713 1021 conicto
-1713 1165 lineto
-end_ol grestore
-gsave 23.206267 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-gsave 23.502600 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 23.663467 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 23.993667 10.500000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 2304 lineto
-576 2304 lineto
-576 1986 lineto
-709 2209 822 2288 conicto
-936 2368 1072 2368 conicto
-1268 2368 1471 2237 conicto
-1337 1898 lineto
-1195 1984 1053 1984 conicto
-925 1984 823 1905 conicto
-722 1827 679 1689 conicto
-614 1477 614 1226 conicto
-614 0 lineto
-256 0 lineto
-end_ol grestore
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 5.500000 6.000000 m 5.500000 7.417500 l 8.437500 7.417500 l 8.437500 6.000000 l cp s
-gsave 6.000000 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 6.321733 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-719 0 moveto
-320 0 lineto
-320 3200 lineto
-747 3200 lineto
-747 2056 lineto
-984 2368 1357 2368 conicto
-1563 2368 1747 2281 conicto
-1931 2194 2050 2038 conicto
-2169 1882 2236 1660 conicto
-2304 1438 2304 1186 conicto
-2304 588 2019 262 conicto
-1735 -64 1337 -64 conicto
-942 -64 719 279 conicto
-719 0 lineto
-719 1170 moveto
-719 751 827 564 conicto
-1003 259 1304 259 conicto
-1549 259 1727 484 conicto
-1905 709 1905 1155 conicto
-1905 1610 1734 1827 conicto
-1563 2045 1320 2045 conicto
-1075 2045 897 1820 conicto
-719 1595 719 1170 conicto
-end_ol grestore
-gsave 6.651933 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
--172 -921 moveto
--98 -606 lineto
-18 -637 85 -637 conicto
-204 -637 262 -557 conicto
-320 -478 320 -160 conicto
-320 2273 lineto
-719 2273 lineto
-719 -168 lineto
-719 -596 606 -756 conicto
-462 -960 134 -960 conicto
--24 -960 -172 -921 conicto
-end_ol grestore
-gsave 6.787400 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 7.117600 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-gsave 7.413933 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 7.574800 7.000000 translate 0.035278 -0.035278 scale
-start_ol
--64 -896 moveto
--64 -640 lineto
-2496 -640 lineto
-2496 -896 lineto
--64 -896 lineto
-end_ol grestore
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 1.750000 6.000000 m 1.750000 7.500000 l 4.627500 7.500000 l 4.627500 6.000000 l cp s
-gsave 2.502510 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-729 0 moveto
-320 0 lineto
-320 3264 lineto
-757 3264 lineto
-757 2112 lineto
-1003 2432 1389 2432 conicto
-1602 2432 1792 2343 conicto
-1983 2254 2106 2093 conicto
-2229 1933 2298 1705 conicto
-2368 1478 2368 1220 conicto
-2368 606 2074 271 conicto
-1781 -64 1369 -64 conicto
-960 -64 729 287 conicto
-729 0 lineto
-729 1202 moveto
-729 771 841 580 conicto
-1024 267 1336 267 conicto
-1590 267 1774 498 conicto
-1959 729 1959 1186 conicto
-1959 1655 1781 1878 conicto
-1604 2101 1353 2101 conicto
-1099 2101 914 1870 conicto
-729 1639 729 1202 conicto
-end_ol grestore
-gsave 2.841177 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-128 1184 moveto
-128 1847 491 2166 conicto
-794 2432 1230 2432 conicto
-1714 2432 2021 2109 conicto
-2329 1786 2329 1218 conicto
-2329 757 2193 492 conicto
-2057 228 1797 82 conicto
-1537 -64 1230 -64 conicto
-737 -64 432 258 conicto
-128 580 128 1184 conicto
-537 1185 moveto
-537 724 734 495 conicto
-931 267 1230 267 conicto
-1526 267 1723 497 conicto
-1920 727 1920 1198 conicto
-1920 1643 1722 1872 conicto
-1524 2101 1230 2101 conicto
-931 2101 734 1873 conicto
-537 1646 537 1185 conicto
-end_ol grestore
-gsave 3.171377 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-128 1184 moveto
-128 1847 491 2166 conicto
-794 2432 1230 2432 conicto
-1714 2432 2021 2109 conicto
-2329 1786 2329 1218 conicto
-2329 757 2193 492 conicto
-2057 228 1797 82 conicto
-1537 -64 1230 -64 conicto
-737 -64 432 258 conicto
-128 580 128 1184 conicto
-537 1185 moveto
-537 724 734 495 conicto
-931 267 1230 267 conicto
-1526 267 1723 497 conicto
-1920 727 1920 1198 conicto
-1920 1643 1722 1872 conicto
-1524 2101 1230 2101 conicto
-931 2101 734 1873 conicto
-537 1646 537 1185 conicto
-end_ol grestore
-gsave 3.501577 7.000000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 3264 lineto
-729 3264 lineto
-729 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 3.637043 7.000000 translate 0.035278 -0.035278 scale
-start_ol
--64 -896 moveto
--64 -576 lineto
-2560 -576 lineto
-2560 -896 lineto
--64 -896 lineto
-end_ol grestore
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 12.928800 3.750000 m 12.928800 4.875000 l 6.968750 4.875000 l 6.968750 5.513197 l s
-[] 0 sd
-0 slj
-0 slc
-n 6.968750 5.888197 m 6.718750 5.388197 l 6.968750 5.513197 l 7.218750 5.388197 l ef
-n 6.968750 5.888197 m 6.718750 5.388197 l 6.968750 5.513197 l 7.218750 5.388197 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 12.928800 3.750000 m 12.928800 4.875000 l 3.188750 4.875000 l 3.188750 5.513197 l s
-[] 0 sd
-0 slj
-0 slc
-n 3.188750 5.888197 m 2.938750 5.388197 l 3.188750 5.513197 l 3.438750 5.388197 l ef
-n 3.188750 5.888197 m 2.938750 5.388197 l 3.188750 5.513197 l 3.438750 5.388197 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 12.928800 3.750000 m 12.928800 4.875000 l 13.928800 4.875000 l 13.928800 5.513197 l s
-[] 0 sd
-0 slj
-0 slc
-n 13.928800 5.888197 m 13.678800 5.388197 l 13.928800 5.513197 l 14.178800 5.388197 l ef
-n 13.928800 5.888197 m 13.678800 5.388197 l 13.928800 5.513197 l 14.178800 5.388197 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 12.928800 3.750000 m 12.928800 4.875000 l 23.382500 4.875000 l 23.382500 5.513197 l s
-[] 0 sd
-0 slj
-0 slc
-n 23.382500 5.888197 m 23.132500 5.388197 l 23.382500 5.513197 l 23.632500 5.388197 l ef
-n 23.382500 5.888197 m 23.132500 5.388197 l 23.382500 5.513197 l 23.632500 5.388197 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 23.382500 7.500000 m 23.382500 8.500000 l 26.428800 8.500000 l 26.428800 9.013197 l s
-[] 0 sd
-0 slj
-0 slc
-n 26.428800 9.388197 m 26.178800 8.888197 l 26.428800 9.013197 l 26.678800 8.888197 l ef
-n 26.428800 9.388197 m 26.178800 8.888197 l 26.428800 9.013197 l 26.678800 8.888197 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 13.928800 7.500000 m 13.928800 8.500000 l 7.375000 8.500000 l 7.375000 9.013197 l s
-[] 0 sd
-0 slj
-0 slc
-n 7.375000 9.388197 m 7.125000 8.888197 l 7.375000 9.013197 l 7.625000 8.888197 l ef
-n 7.375000 9.388197 m 7.125000 8.888197 l 7.375000 9.013197 l 7.625000 8.888197 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 23.382500 7.500000 m 23.382500 8.500000 l 22.928800 8.500000 l 22.928800 9.013197 l s
-[] 0 sd
-0 slj
-0 slc
-n 22.928800 9.388197 m 22.678800 8.888197 l 22.928800 9.013197 l 23.178800 8.888197 l ef
-n 22.928800 9.388197 m 22.678800 8.888197 l 22.928800 9.013197 l 23.178800 8.888197 l cp s
-0.095250 slw
-[1.000000] 0 sd
-[0.127000] 0 sd
-0 slj
-n 3.000000 11.500000 m 3.000000 13.002375 l 6.752375 13.002375 l 6.752375 11.500000 l cp s
-0.095250 slw
-[0.127000] 0 sd
-[0.127000] 0 sd
-0 slj
-n 7.750000 11.500000 m 7.750000 13.002375 l 12.102375 13.002375 l 12.102375 11.500000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 14.200000 15.500000 m 14.200000 16.996250 l 17.057500 16.996250 l 17.057500 15.500000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 14.200000 17.250000 m 14.200000 18.746250 l 17.057500 18.746250 l 17.057500 17.250000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 14.200000 19.000000 m 14.200000 20.496250 l 17.450000 20.496250 l 17.450000 19.000000 l cp s
-gsave 3.100000 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-127 682 moveto
-531 744 lineto
-566 509 713 384 conicto
-861 259 1125 259 conicto
-1391 259 1520 370 conicto
-1649 481 1649 630 conicto
-1649 764 1536 841 conicto
-1456 893 1140 974 conicto
-715 1084 542 1164 conicto
-370 1244 281 1385 conicto
-192 1527 192 1698 conicto
-192 1853 266 1986 conicto
-341 2119 469 2207 conicto
-566 2274 722 2321 conicto
-878 2368 1057 2368 conicto
-1325 2368 1528 2289 conicto
-1732 2211 1828 2076 conicto
-1925 1941 1962 1716 conicto
-1582 1663 lineto
-1557 1843 1433 1944 conicto
-1310 2045 1085 2045 conicto
-819 2045 705 1955 conicto
-591 1865 591 1744 conicto
-591 1668 638 1606 conicto
-685 1543 786 1501 conicto
-844 1479 1128 1400 conicto
-1537 1288 1700 1216 conicto
-1863 1145 1955 1009 conicto
-2048 874 2048 672 conicto
-2048 475 1934 300 conicto
-1820 126 1604 31 conicto
-1389 -64 1116 -64 conicto
-665 -64 429 124 conicto
-193 313 127 682 conicto
-end_ol grestore
-gsave 3.396333 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 3.531800 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 3.862000 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 4.192200 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 4.522400 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-1752 0 moveto
-1752 281 lineto
-1534 -64 1112 -64 conicto
-838 -64 609 89 conicto
-380 243 254 517 conicto
-128 792 128 1149 conicto
-128 1498 242 1782 conicto
-357 2066 585 2217 conicto
-813 2368 1095 2368 conicto
-1302 2368 1463 2280 conicto
-1625 2192 1726 2052 conicto
-1726 3200 lineto
-2127 3200 lineto
-2127 0 lineto
-1752 0 lineto
-527 1150 moveto
-527 703 711 481 conicto
-896 259 1146 259 conicto
-1399 259 1575 471 conicto
-1752 683 1752 1118 conicto
-1752 1597 1572 1821 conicto
-1392 2045 1129 2045 conicto
-872 2045 699 1829 conicto
-527 1614 527 1150 conicto
-end_ol grestore
-gsave 4.844133 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 4.979600 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 5.309800 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 5.470667 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 5.800867 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 6.131067 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 6.461267 12.450000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 2304 lineto
-576 2304 lineto
-576 1986 lineto
-709 2209 822 2288 conicto
-936 2368 1072 2368 conicto
-1268 2368 1471 2237 conicto
-1337 1898 lineto
-1195 1984 1053 1984 conicto
-925 1984 823 1905 conicto
-722 1827 679 1689 conicto
-614 1477 614 1226 conicto
-614 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 7.852380 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-1792 0 moveto
-1792 314 lineto
-1521 -64 1053 -64 conicto
-847 -64 668 11 conicto
-489 87 402 201 conicto
-316 316 280 490 conicto
-256 606 256 859 conicto
-256 2304 lineto
-655 2304 lineto
-655 1010 lineto
-655 701 679 593 conicto
-717 437 837 348 conicto
-957 259 1135 259 conicto
-1312 259 1467 350 conicto
-1622 441 1686 598 conicto
-1751 755 1751 1054 conicto
-1751 2304 lineto
-2112 2304 lineto
-2112 0 lineto
-1792 0 lineto
-end_ol grestore
-gsave 8.174113 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 8.504313 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-127 682 moveto
-531 744 lineto
-566 509 713 384 conicto
-861 259 1125 259 conicto
-1391 259 1520 370 conicto
-1649 481 1649 630 conicto
-1649 764 1536 841 conicto
-1456 893 1140 974 conicto
-715 1084 542 1164 conicto
-370 1244 281 1385 conicto
-192 1527 192 1698 conicto
-192 1853 266 1986 conicto
-341 2119 469 2207 conicto
-566 2274 722 2321 conicto
-878 2368 1057 2368 conicto
-1325 2368 1528 2289 conicto
-1732 2211 1828 2076 conicto
-1925 1941 1962 1716 conicto
-1582 1663 lineto
-1557 1843 1433 1944 conicto
-1310 2045 1085 2045 conicto
-819 2045 705 1955 conicto
-591 1865 591 1744 conicto
-591 1668 638 1606 conicto
-685 1543 786 1501 conicto
-844 1479 1128 1400 conicto
-1537 1288 1700 1216 conicto
-1863 1145 1955 1009 conicto
-2048 874 2048 672 conicto
-2048 475 1934 300 conicto
-1820 126 1604 31 conicto
-1389 -64 1116 -64 conicto
-665 -64 429 124 conicto
-193 313 127 682 conicto
-end_ol grestore
-gsave 8.800647 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 8.936113 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 9.266313 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 9.596513 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 9.926713 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-1752 0 moveto
-1752 281 lineto
-1534 -64 1112 -64 conicto
-838 -64 609 89 conicto
-380 243 254 517 conicto
-128 792 128 1149 conicto
-128 1498 242 1782 conicto
-357 2066 585 2217 conicto
-813 2368 1095 2368 conicto
-1302 2368 1463 2280 conicto
-1625 2192 1726 2052 conicto
-1726 3200 lineto
-2127 3200 lineto
-2127 0 lineto
-1752 0 lineto
-527 1150 moveto
-527 703 711 481 conicto
-896 259 1146 259 conicto
-1399 259 1575 471 conicto
-1752 683 1752 1118 conicto
-1752 1597 1572 1821 conicto
-1392 2045 1129 2045 conicto
-872 2045 699 1829 conicto
-527 1614 527 1150 conicto
-end_ol grestore
-gsave 10.248447 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 10.383913 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 10.714113 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 10.874980 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 11.205180 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 11.535380 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 11.865580 12.502400 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 2304 lineto
-576 2304 lineto
-576 1986 lineto
-709 2209 822 2288 conicto
-936 2368 1072 2368 conicto
-1268 2368 1471 2237 conicto
-1337 1898 lineto
-1195 1984 1053 1984 conicto
-925 1984 823 1905 conicto
-722 1827 679 1689 conicto
-614 1477 614 1226 conicto
-614 0 lineto
-256 0 lineto
-end_ol grestore
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 4.000000 14.250000 m 4.000000 15.746250 l 6.857500 15.746250 l 6.857500 14.250000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 4.000000 16.000000 m 4.000000 17.496250 l 6.857500 17.496250 l 6.857500 16.000000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 4.000000 17.750000 m 4.000000 19.246250 l 6.857500 19.246250 l 6.857500 17.750000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 4.000000 19.500000 m 4.000000 20.996250 l 6.857500 20.996250 l 6.857500 19.500000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 4.000000 21.250000 m 4.000000 22.746250 l 6.857500 22.746250 l 6.857500 21.250000 l cp s
-gsave 4.750000 15.250000 translate 0.035278 -0.035278 scale
-start_ol
-719 0 moveto
-320 0 lineto
-320 3200 lineto
-747 3200 lineto
-747 2056 lineto
-984 2368 1357 2368 conicto
-1563 2368 1747 2281 conicto
-1931 2194 2050 2038 conicto
-2169 1882 2236 1660 conicto
-2304 1438 2304 1186 conicto
-2304 588 2019 262 conicto
-1735 -64 1337 -64 conicto
-942 -64 719 279 conicto
-719 0 lineto
-719 1170 moveto
-719 751 827 564 conicto
-1003 259 1304 259 conicto
-1549 259 1727 484 conicto
-1905 709 1905 1155 conicto
-1905 1610 1734 1827 conicto
-1563 2045 1320 2045 conicto
-1075 2045 897 1820 conicto
-719 1595 719 1170 conicto
-end_ol grestore
-gsave 5.080200 15.250000 translate 0.035278 -0.035278 scale
-start_ol
-274 -912 moveto
-231 -541 lineto
-358 -576 453 -576 conicto
-583 -576 660 -532 conicto
-738 -489 788 -410 conicto
-824 -352 906 -118 conicto
-917 -86 941 -22 conicto
-71 2297 lineto
-490 2297 lineto
-967 956 lineto
-1060 701 1133 420 conicto
-1200 690 1293 947 conicto
-1783 2297 lineto
-2171 2297 lineto
-1299 -57 lineto
-1159 -439 1081 -583 conicto
-978 -778 844 -869 conicto
-710 -960 524 -960 conicto
-412 -960 274 -912 conicto
-end_ol grestore
-gsave 5.376533 15.250000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 5.537400 15.250000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 4.750000 17.000000 translate 0.035278 -0.035278 scale
-start_ol
-127 682 moveto
-531 744 lineto
-566 509 713 384 conicto
-861 259 1125 259 conicto
-1391 259 1520 370 conicto
-1649 481 1649 630 conicto
-1649 764 1536 841 conicto
-1456 893 1140 974 conicto
-715 1084 542 1164 conicto
-370 1244 281 1385 conicto
-192 1527 192 1698 conicto
-192 1853 266 1986 conicto
-341 2119 469 2207 conicto
-566 2274 722 2321 conicto
-878 2368 1057 2368 conicto
-1325 2368 1528 2289 conicto
-1732 2211 1828 2076 conicto
-1925 1941 1962 1716 conicto
-1582 1663 lineto
-1557 1843 1433 1944 conicto
-1310 2045 1085 2045 conicto
-819 2045 705 1955 conicto
-591 1865 591 1744 conicto
-591 1668 638 1606 conicto
-685 1543 786 1501 conicto
-844 1479 1128 1400 conicto
-1537 1288 1700 1216 conicto
-1863 1145 1955 1009 conicto
-2048 874 2048 672 conicto
-2048 475 1934 300 conicto
-1820 126 1604 31 conicto
-1389 -64 1116 -64 conicto
-665 -64 429 124 conicto
-193 313 127 682 conicto
-end_ol grestore
-gsave 5.046333 17.000000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 3200 lineto
-719 3200 lineto
-719 2064 lineto
-987 2368 1400 2368 conicto
-1655 2368 1842 2266 conicto
-2029 2165 2110 1986 conicto
-2191 1807 2191 1467 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1478 lineto
-1792 1775 1667 1910 conicto
-1543 2045 1316 2045 conicto
-1146 2045 996 1954 conicto
-846 1863 782 1707 conicto
-719 1551 719 1276 conicto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 5.376533 17.000000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 5.698267 17.000000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 2304 lineto
-576 2304 lineto
-576 1986 lineto
-709 2209 822 2288 conicto
-936 2368 1072 2368 conicto
-1268 2368 1471 2237 conicto
-1337 1898 lineto
-1195 1984 1053 1984 conicto
-925 1984 823 1905 conicto
-722 1827 679 1689 conicto
-614 1477 614 1226 conicto
-614 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 5.884533 17.000000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 4.900000 18.650000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 5.035467 18.650000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 5.365667 18.650000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 5.526533 18.650000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-gsave 4.700000 20.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 4.835467 20.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 5.165667 20.500000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 5.326533 20.500000 translate 0.035278 -0.035278 scale
-start_ol
--64 -896 moveto
--64 -640 lineto
-2496 -640 lineto
-2496 -896 lineto
--64 -896 lineto
-end_ol grestore
-gsave 4.400000 22.250000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 4.527000 22.250000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 4.848733 22.250000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 5.178933 22.250000 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 5.509133 22.250000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 5.636133 22.250000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 5.957867 22.250000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 6.288067 22.250000 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 9.250000 14.250000 m 9.250000 15.746250 l 12.107500 15.746250 l 12.107500 14.250000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 9.250000 16.000000 m 9.250000 17.496250 l 12.107500 17.496250 l 12.107500 16.000000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 9.250000 17.750000 m 9.250000 19.246250 l 12.107500 19.246250 l 12.107500 17.750000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 9.250000 19.500000 m 9.250000 20.996250 l 12.107500 20.996250 l 12.107500 19.500000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 9.250000 21.250000 m 9.250000 22.746250 l 12.107500 22.746250 l 12.107500 21.250000 l cp s
-gsave 10.000000 15.250000 translate 0.035278 -0.035278 scale
-start_ol
-1792 0 moveto
-1792 314 lineto
-1521 -64 1053 -64 conicto
-847 -64 668 11 conicto
-489 87 402 201 conicto
-316 316 280 490 conicto
-256 606 256 859 conicto
-256 2304 lineto
-655 2304 lineto
-655 1010 lineto
-655 701 679 593 conicto
-717 437 837 348 conicto
-957 259 1135 259 conicto
-1312 259 1467 350 conicto
-1622 441 1686 598 conicto
-1751 755 1751 1054 conicto
-1751 2304 lineto
-2112 2304 lineto
-2112 0 lineto
-1792 0 lineto
-end_ol grestore
-gsave 10.321733 15.250000 translate 0.035278 -0.035278 scale
-start_ol
-719 0 moveto
-320 0 lineto
-320 3200 lineto
-747 3200 lineto
-747 2056 lineto
-984 2368 1357 2368 conicto
-1563 2368 1747 2281 conicto
-1931 2194 2050 2038 conicto
-2169 1882 2236 1660 conicto
-2304 1438 2304 1186 conicto
-2304 588 2019 262 conicto
-1735 -64 1337 -64 conicto
-942 -64 719 279 conicto
-719 0 lineto
-719 1170 moveto
-719 751 827 564 conicto
-1003 259 1304 259 conicto
-1549 259 1727 484 conicto
-1905 709 1905 1155 conicto
-1905 1610 1734 1827 conicto
-1563 2045 1320 2045 conicto
-1075 2045 897 1820 conicto
-719 1595 719 1170 conicto
-end_ol grestore
-gsave 10.651933 15.250000 translate 0.035278 -0.035278 scale
-start_ol
-274 -912 moveto
-231 -541 lineto
-358 -576 453 -576 conicto
-583 -576 660 -532 conicto
-738 -489 788 -410 conicto
-824 -352 906 -118 conicto
-917 -86 941 -22 conicto
-71 2297 lineto
-490 2297 lineto
-967 956 lineto
-1060 701 1133 420 conicto
-1200 690 1293 947 conicto
-1783 2297 lineto
-2171 2297 lineto
-1299 -57 lineto
-1159 -439 1081 -583 conicto
-978 -778 844 -869 conicto
-710 -960 524 -960 conicto
-412 -960 274 -912 conicto
-end_ol grestore
-gsave 10.948267 15.250000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 11.109133 15.250000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 10.000000 18.750000 translate 0.035278 -0.035278 scale
-start_ol
-1792 0 moveto
-1792 314 lineto
-1521 -64 1053 -64 conicto
-847 -64 668 11 conicto
-489 87 402 201 conicto
-316 316 280 490 conicto
-256 606 256 859 conicto
-256 2304 lineto
-655 2304 lineto
-655 1010 lineto
-655 701 679 593 conicto
-717 437 837 348 conicto
-957 259 1135 259 conicto
-1312 259 1467 350 conicto
-1622 441 1686 598 conicto
-1751 755 1751 1054 conicto
-1751 2304 lineto
-2112 2304 lineto
-2112 0 lineto
-1792 0 lineto
-end_ol grestore
-gsave 10.321733 18.750000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 10.457200 18.750000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 10.787400 18.750000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 10.948267 18.750000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-gsave 10.202400 20.502400 translate 0.035278 -0.035278 scale
-start_ol
-1792 0 moveto
-1792 314 lineto
-1521 -64 1053 -64 conicto
-847 -64 668 11 conicto
-489 87 402 201 conicto
-316 316 280 490 conicto
-256 606 256 859 conicto
-256 2304 lineto
-655 2304 lineto
-655 1010 lineto
-655 701 679 593 conicto
-717 437 837 348 conicto
-957 259 1135 259 conicto
-1312 259 1467 350 conicto
-1622 441 1686 598 conicto
-1751 755 1751 1054 conicto
-1751 2304 lineto
-2112 2304 lineto
-2112 0 lineto
-1792 0 lineto
-end_ol grestore
-gsave 10.524133 20.502400 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 10.659600 20.502400 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 10.989800 20.502400 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 9.452370 22.252400 translate 0.035278 -0.035278 scale
-start_ol
-1792 0 moveto
-1792 314 lineto
-1521 -64 1053 -64 conicto
-847 -64 668 11 conicto
-489 87 402 201 conicto
-316 316 280 490 conicto
-256 606 256 859 conicto
-256 2304 lineto
-655 2304 lineto
-655 1010 lineto
-655 701 679 593 conicto
-717 437 837 348 conicto
-957 259 1135 259 conicto
-1312 259 1467 350 conicto
-1622 441 1686 598 conicto
-1751 755 1751 1054 conicto
-1751 2304 lineto
-2112 2304 lineto
-2112 0 lineto
-1792 0 lineto
-end_ol grestore
-gsave 9.774103 22.252400 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 9.901103 22.252400 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 10.222837 22.252400 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 10.553037 22.252400 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 10.883237 22.252400 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 11.010237 22.252400 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 11.331970 22.252400 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 11.662170 22.252400 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 10.000000 17.000000 translate 0.035278 -0.035278 scale
-start_ol
-1792 0 moveto
-1792 314 lineto
-1521 -64 1053 -64 conicto
-847 -64 668 11 conicto
-489 87 402 201 conicto
-316 316 280 490 conicto
-256 606 256 859 conicto
-256 2304 lineto
-655 2304 lineto
-655 1010 lineto
-655 701 679 593 conicto
-717 437 837 348 conicto
-957 259 1135 259 conicto
-1312 259 1467 350 conicto
-1622 441 1686 598 conicto
-1751 755 1751 1054 conicto
-1751 2304 lineto
-2112 2304 lineto
-2112 0 lineto
-1792 0 lineto
-end_ol grestore
-gsave 10.321733 17.000000 translate 0.035278 -0.035278 scale
-start_ol
-127 682 moveto
-531 744 lineto
-566 509 713 384 conicto
-861 259 1125 259 conicto
-1391 259 1520 370 conicto
-1649 481 1649 630 conicto
-1649 764 1536 841 conicto
-1456 893 1140 974 conicto
-715 1084 542 1164 conicto
-370 1244 281 1385 conicto
-192 1527 192 1698 conicto
-192 1853 266 1986 conicto
-341 2119 469 2207 conicto
-566 2274 722 2321 conicto
-878 2368 1057 2368 conicto
-1325 2368 1528 2289 conicto
-1732 2211 1828 2076 conicto
-1925 1941 1962 1716 conicto
-1582 1663 lineto
-1557 1843 1433 1944 conicto
-1310 2045 1085 2045 conicto
-819 2045 705 1955 conicto
-591 1865 591 1744 conicto
-591 1668 638 1606 conicto
-685 1543 786 1501 conicto
-844 1479 1128 1400 conicto
-1537 1288 1700 1216 conicto
-1863 1145 1955 1009 conicto
-2048 874 2048 672 conicto
-2048 475 1934 300 conicto
-1820 126 1604 31 conicto
-1389 -64 1116 -64 conicto
-665 -64 429 124 conicto
-193 313 127 682 conicto
-end_ol grestore
-gsave 10.618067 17.000000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 3200 lineto
-719 3200 lineto
-719 2064 lineto
-987 2368 1400 2368 conicto
-1655 2368 1842 2266 conicto
-2029 2165 2110 1986 conicto
-2191 1807 2191 1467 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1478 lineto
-1792 1775 1667 1910 conicto
-1543 2045 1316 2045 conicto
-1146 2045 996 1954 conicto
-846 1863 782 1707 conicto
-719 1551 719 1276 conicto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 10.948267 17.000000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 11.270000 17.000000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 2304 lineto
-576 2304 lineto
-576 1986 lineto
-709 2209 822 2288 conicto
-936 2368 1072 2368 conicto
-1268 2368 1471 2237 conicto
-1337 1898 lineto
-1195 1984 1053 1984 conicto
-925 1984 823 1905 conicto
-722 1827 679 1689 conicto
-614 1477 614 1226 conicto
-614 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 11.456267 17.000000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 14.600000 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-127 682 moveto
-531 744 lineto
-566 509 713 384 conicto
-861 259 1125 259 conicto
-1391 259 1520 370 conicto
-1649 481 1649 630 conicto
-1649 764 1536 841 conicto
-1456 893 1140 974 conicto
-715 1084 542 1164 conicto
-370 1244 281 1385 conicto
-192 1527 192 1698 conicto
-192 1853 266 1986 conicto
-341 2119 469 2207 conicto
-566 2274 722 2321 conicto
-878 2368 1057 2368 conicto
-1325 2368 1528 2289 conicto
-1732 2211 1828 2076 conicto
-1925 1941 1962 1716 conicto
-1582 1663 lineto
-1557 1843 1433 1944 conicto
-1310 2045 1085 2045 conicto
-819 2045 705 1955 conicto
-591 1865 591 1744 conicto
-591 1668 638 1606 conicto
-685 1543 786 1501 conicto
-844 1479 1128 1400 conicto
-1537 1288 1700 1216 conicto
-1863 1145 1955 1009 conicto
-2048 874 2048 672 conicto
-2048 475 1934 300 conicto
-1820 126 1604 31 conicto
-1389 -64 1116 -64 conicto
-665 -64 429 124 conicto
-193 313 127 682 conicto
-end_ol grestore
-gsave 14.896333 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 15.031800 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 15.362000 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 15.692200 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 15.819200 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 14.700000 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-384 0 moveto
-384 1984 lineto
-64 1984 lineto
-64 2307 lineto
-384 2307 lineto
-384 2552 lineto
-384 2785 425 2889 conicto
-481 3029 622 3116 conicto
-764 3203 1018 3203 conicto
-1182 3203 1380 3168 conicto
-1322 2858 lineto
-1201 2880 1096 2880 conicto
-925 2880 854 2804 conicto
-783 2728 783 2520 conicto
-783 2307 lineto
-1216 2307 lineto
-1216 1984 lineto
-783 1984 lineto
-783 0 lineto
-384 0 lineto
-end_ol grestore
-gsave 14.860867 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 14.987867 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 15.309600 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-1746 289 moveto
-1529 102 1331 19 conicto
-1133 -64 905 -64 conicto
-530 -64 329 124 conicto
-128 312 128 605 conicto
-128 777 203 919 conicto
-278 1062 399 1148 conicto
-521 1234 672 1278 conicto
-785 1309 1017 1337 conicto
-1490 1394 1713 1472 conicto
-1713 1553 1713 1575 conicto
-1713 1814 1603 1912 conicto
-1453 2045 1158 2045 conicto
-884 2045 753 1948 conicto
-622 1851 560 1605 conicto
-192 1657 lineto
-243 1902 362 2053 conicto
-481 2204 705 2286 conicto
-930 2368 1225 2368 conicto
-1519 2368 1702 2298 conicto
-1886 2229 1972 2124 conicto
-2058 2019 2093 1858 conicto
-2112 1758 2112 1496 conicto
-2112 973 lineto
-2112 427 2137 281 conicto
-2162 135 2235 0 conicto
-1825 0 lineto
-1763 123 1746 289 conicto
-1713 1165 moveto
-1501 1078 1076 1017 conicto
-835 982 735 938 conicto
-635 895 581 811 conicto
-527 727 527 624 conicto
-527 468 645 363 conicto
-763 259 991 259 conicto
-1216 259 1391 358 conicto
-1567 457 1650 630 conicto
-1713 762 1713 1021 conicto
-1713 1165 lineto
-end_ol grestore
-gsave 15.631333 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-gsave 15.792200 18.250000 translate 0.035278 -0.035278 scale
-start_ol
--64 -896 moveto
--64 -640 lineto
-2496 -640 lineto
-2496 -896 lineto
--64 -896 lineto
-end_ol grestore
-gsave 14.650000 19.950000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 14.777000 19.950000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 15.098733 19.950000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 15.428933 19.950000 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 15.759133 19.950000 translate 0.035278 -0.035278 scale
-start_ol
-384 0 moveto
-384 1984 lineto
-64 1984 lineto
-64 2307 lineto
-384 2307 lineto
-384 2552 lineto
-384 2785 425 2889 conicto
-481 3029 622 3116 conicto
-764 3203 1018 3203 conicto
-1182 3203 1380 3168 conicto
-1322 2858 lineto
-1201 2880 1096 2880 conicto
-925 2880 854 2804 conicto
-783 2728 783 2520 conicto
-783 2307 lineto
-1216 2307 lineto
-1216 1984 lineto
-783 1984 lineto
-783 0 lineto
-384 0 lineto
-end_ol grestore
-gsave 15.920000 19.950000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 16.047000 19.950000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 16.368733 19.950000 translate 0.035278 -0.035278 scale
-start_ol
-1746 289 moveto
-1529 102 1331 19 conicto
-1133 -64 905 -64 conicto
-530 -64 329 124 conicto
-128 312 128 605 conicto
-128 777 203 919 conicto
-278 1062 399 1148 conicto
-521 1234 672 1278 conicto
-785 1309 1017 1337 conicto
-1490 1394 1713 1472 conicto
-1713 1553 1713 1575 conicto
-1713 1814 1603 1912 conicto
-1453 2045 1158 2045 conicto
-884 2045 753 1948 conicto
-622 1851 560 1605 conicto
-192 1657 lineto
-243 1902 362 2053 conicto
-481 2204 705 2286 conicto
-930 2368 1225 2368 conicto
-1519 2368 1702 2298 conicto
-1886 2229 1972 2124 conicto
-2058 2019 2093 1858 conicto
-2112 1758 2112 1496 conicto
-2112 973 lineto
-2112 427 2137 281 conicto
-2162 135 2235 0 conicto
-1825 0 lineto
-1763 123 1746 289 conicto
-1713 1165 moveto
-1501 1078 1076 1017 conicto
-835 982 735 938 conicto
-635 895 581 811 conicto
-527 727 527 624 conicto
-527 468 645 363 conicto
-763 259 991 259 conicto
-1216 259 1391 358 conicto
-1567 457 1650 630 conicto
-1713 762 1713 1021 conicto
-1713 1165 lineto
-end_ol grestore
-gsave 16.690467 19.950000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 4.876190 13.002400 m 4.876190 14.002400 l 3.000000 14.002400 l 3.000000 14.998100 l 3.513197 14.998100 l s
-[] 0 sd
-0 slj
-0 slc
-n 3.888197 14.998100 m 3.388197 15.248100 l 3.513197 14.998100 l 3.388197 14.748100 l ef
-n 3.888197 14.998100 m 3.388197 15.248100 l 3.513197 14.998100 l 3.388197 14.748100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 4.876190 13.002400 m 4.876190 14.002400 l 3.000000 14.002400 l 3.000000 16.748100 l 3.513197 16.748100 l s
-[] 0 sd
-0 slj
-0 slc
-n 3.888197 16.748100 m 3.388197 16.998100 l 3.513197 16.748100 l 3.388197 16.498100 l ef
-n 3.888197 16.748100 m 3.388197 16.998100 l 3.513197 16.748100 l 3.388197 16.498100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 4.876190 13.002400 m 4.876190 14.002400 l 3.000000 14.002400 l 3.000000 18.498100 l 3.513197 18.498100 l s
-[] 0 sd
-0 slj
-0 slc
-n 3.888197 18.498100 m 3.388197 18.748100 l 3.513197 18.498100 l 3.388197 18.248100 l ef
-n 3.888197 18.498100 m 3.388197 18.748100 l 3.513197 18.498100 l 3.388197 18.248100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 4.876190 13.002400 m 4.876190 14.002400 l 3.000000 14.002400 l 3.000000 20.248100 l 3.513197 20.248100 l s
-[] 0 sd
-0 slj
-0 slc
-n 3.888197 20.248100 m 3.388197 20.498100 l 3.513197 20.248100 l 3.388197 19.998100 l ef
-n 3.888197 20.248100 m 3.388197 20.498100 l 3.513197 20.248100 l 3.388197 19.998100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 4.876190 13.002400 m 4.876190 14.002400 l 3.000000 14.002400 l 3.000000 21.998100 l 3.513197 21.998100 l s
-[] 0 sd
-0 slj
-0 slc
-n 3.888197 21.998100 m 3.388197 22.248100 l 3.513197 21.998100 l 3.388197 21.748100 l ef
-n 3.888197 21.998100 m 3.388197 22.248100 l 3.513197 21.998100 l 3.388197 21.748100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 9.926190 13.002400 m 9.926190 14.002400 l 8.250000 14.002400 l 8.250000 14.998100 l 8.763197 14.998100 l s
-[] 0 sd
-0 slj
-0 slc
-n 9.138197 14.998100 m 8.638197 15.248100 l 8.763197 14.998100 l 8.638197 14.748100 l ef
-n 9.138197 14.998100 m 8.638197 15.248100 l 8.763197 14.998100 l 8.638197 14.748100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 9.926190 13.002400 m 9.926190 14.002400 l 8.250000 14.002400 l 8.250000 16.748100 l 8.763197 16.748100 l s
-[] 0 sd
-0 slj
-0 slc
-n 9.138197 16.748100 m 8.638197 16.998100 l 8.763197 16.748100 l 8.638197 16.498100 l ef
-n 9.138197 16.748100 m 8.638197 16.998100 l 8.763197 16.748100 l 8.638197 16.498100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 9.926190 13.002400 m 9.926190 14.002400 l 8.250000 14.002400 l 8.250000 18.498100 l 8.763197 18.498100 l s
-[] 0 sd
-0 slj
-0 slc
-n 9.138197 18.498100 m 8.638197 18.748100 l 8.763197 18.498100 l 8.638197 18.248100 l ef
-n 9.138197 18.498100 m 8.638197 18.748100 l 8.763197 18.498100 l 8.638197 18.248100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 9.926190 13.002400 m 9.926190 14.002400 l 8.250000 14.002400 l 8.250000 20.248100 l 8.763197 20.248100 l s
-[] 0 sd
-0 slj
-0 slc
-n 9.138197 20.248100 m 8.638197 20.498100 l 8.763197 20.248100 l 8.638197 19.998100 l ef
-n 9.138197 20.248100 m 8.638197 20.498100 l 8.763197 20.248100 l 8.638197 19.998100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 9.926190 13.002400 m 9.926190 14.002400 l 8.250000 14.002400 l 8.250000 21.998100 l 8.763197 21.998100 l s
-[] 0 sd
-0 slj
-0 slc
-n 9.138197 21.998100 m 8.638197 22.248100 l 8.763197 21.998100 l 8.638197 21.748100 l ef
-n 9.138197 21.998100 m 8.638197 22.248100 l 8.763197 21.998100 l 8.638197 21.748100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 14.178700 13.000000 m 14.178700 14.000000 l 13.178700 14.000000 l 13.178700 16.248100 l 13.713197 16.248100 l s
-[] 0 sd
-0 slj
-0 slc
-n 14.088197 16.248100 m 13.588197 16.498100 l 13.713197 16.248100 l 13.588197 15.998100 l ef
-n 14.088197 16.248100 m 13.588197 16.498100 l 13.713197 16.248100 l 13.588197 15.998100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 14.178700 13.000000 m 14.178700 14.000000 l 13.178700 14.000000 l 13.178700 17.998100 l 13.713197 17.998100 l s
-[] 0 sd
-0 slj
-0 slc
-n 14.088197 17.998100 m 13.588197 18.248100 l 13.713197 17.998100 l 13.588197 17.748100 l ef
-n 14.088197 17.998100 m 13.588197 18.248100 l 13.713197 17.998100 l 13.588197 17.748100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 14.178700 13.000000 m 14.178700 14.000000 l 13.178700 14.000000 l 13.178700 19.748100 l 13.713197 19.748100 l s
-[] 0 sd
-0 slj
-0 slc
-n 14.088197 19.748100 m 13.588197 19.998100 l 13.713197 19.748100 l 13.588197 19.498100 l ef
-n 14.088197 19.748100 m 13.588197 19.998100 l 13.713197 19.748100 l 13.588197 19.498100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 18.963700 13.052400 m 18.963700 14.052400 l 17.963700 14.052400 l 17.963700 16.248100 l 18.713197 16.248100 l s
-[] 0 sd
-0 slj
-0 slc
-n 19.088197 16.248100 m 18.588197 16.498100 l 18.713197 16.248100 l 18.588197 15.998100 l ef
-n 19.088197 16.248100 m 18.588197 16.498100 l 18.713197 16.248100 l 18.588197 15.998100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 18.963700 13.052400 m 18.963700 14.052400 l 17.963700 14.052400 l 17.963700 17.998100 l 18.713197 17.998100 l s
-[] 0 sd
-0 slj
-0 slc
-n 19.088197 17.998100 m 18.588197 18.248100 l 18.713197 17.998100 l 18.588197 17.748100 l ef
-n 19.088197 17.998100 m 18.588197 18.248100 l 18.713197 17.998100 l 18.588197 17.748100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 18.963700 13.052400 m 18.963700 14.052400 l 17.963700 14.052400 l 17.963700 19.748100 l 18.713197 19.748100 l s
-[] 0 sd
-0 slj
-0 slc
-n 19.088197 19.748100 m 18.588197 19.998100 l 18.713197 19.748100 l 18.588197 19.498100 l ef
-n 19.088197 19.748100 m 18.588197 19.998100 l 18.713197 19.748100 l 18.588197 19.498100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 22.928800 11.000000 m 22.928800 12.498100 l 24.013197 12.498100 l s
-[] 0 sd
-0 slj
-0 slc
-n 24.388197 12.498100 m 23.888197 12.748100 l 24.013197 12.498100 l 23.888197 12.248100 l ef
-n 24.388197 12.498100 m 23.888197 12.748100 l 24.013197 12.498100 l 23.888197 12.248100 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 22.928800 11.000000 m 22.928800 14.248100 l 24.013197 14.248100 l s
-[] 0 sd
-0 slj
-0 slc
-n 24.388197 14.248100 m 23.888197 14.498100 l 24.013197 14.248100 l 23.888197 13.998100 l ef
-n 24.388197 14.248100 m 23.888197 14.498100 l 24.013197 14.248100 l 23.888197 13.998100 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 24.500000 11.750000 m 24.500000 13.246250 l 27.357500 13.246250 l 27.357500 11.750000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 24.500000 13.500000 m 24.500000 14.996250 l 27.357500 14.996250 l 27.357500 13.500000 l cp s
-gsave 24.800000 14.500000 translate 0.035278 -0.035278 scale
-start_ol
-1792 0 moveto
-1792 314 lineto
-1521 -64 1053 -64 conicto
-847 -64 668 11 conicto
-489 87 402 201 conicto
-316 316 280 490 conicto
-256 606 256 859 conicto
-256 2304 lineto
-655 2304 lineto
-655 1010 lineto
-655 701 679 593 conicto
-717 437 837 348 conicto
-957 259 1135 259 conicto
-1312 259 1467 350 conicto
-1622 441 1686 598 conicto
-1751 755 1751 1054 conicto
-1751 2304 lineto
-2112 2304 lineto
-2112 0 lineto
-1792 0 lineto
-end_ol grestore
-gsave 25.121733 14.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 25.451933 14.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 25.587400 14.500000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-gsave 25.883733 14.500000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 26.205467 14.500000 translate 0.035278 -0.035278 scale
-start_ol
-1752 0 moveto
-1752 281 lineto
-1534 -64 1112 -64 conicto
-838 -64 609 89 conicto
-380 243 254 517 conicto
-128 792 128 1149 conicto
-128 1498 242 1782 conicto
-357 2066 585 2217 conicto
-813 2368 1095 2368 conicto
-1302 2368 1463 2280 conicto
-1625 2192 1726 2052 conicto
-1726 3200 lineto
-2127 3200 lineto
-2127 0 lineto
-1752 0 lineto
-527 1150 moveto
-527 703 711 481 conicto
-896 259 1146 259 conicto
-1399 259 1575 471 conicto
-1752 683 1752 1118 conicto
-1752 1597 1572 1821 conicto
-1392 2045 1129 2045 conicto
-872 2045 699 1829 conicto
-527 1614 527 1150 conicto
-end_ol grestore
-gsave 26.527200 14.500000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 26.857400 14.500000 translate 0.035278 -0.035278 scale
-start_ol
--64 -896 moveto
--64 -640 lineto
-2496 -640 lineto
-2496 -896 lineto
--64 -896 lineto
-end_ol grestore
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 19.200000 15.500000 m 19.200000 16.996250 l 22.057500 16.996250 l 22.057500 15.500000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 19.200000 17.250000 m 19.200000 18.746250 l 22.057500 18.746250 l 22.057500 17.250000 l cp s
-0.095250 slw
-[] 0 sd
-[] 0 sd
-0 slj
-n 19.200000 19.000000 m 19.200000 20.496250 l 22.700000 20.496250 l 22.700000 19.000000 l cp s
-gsave 19.650000 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-gsave 19.946333 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-127 682 moveto
-531 744 lineto
-566 509 713 384 conicto
-861 259 1125 259 conicto
-1391 259 1520 370 conicto
-1649 481 1649 630 conicto
-1649 764 1536 841 conicto
-1456 893 1140 974 conicto
-715 1084 542 1164 conicto
-370 1244 281 1385 conicto
-192 1527 192 1698 conicto
-192 1853 266 1986 conicto
-341 2119 469 2207 conicto
-566 2274 722 2321 conicto
-878 2368 1057 2368 conicto
-1325 2368 1528 2289 conicto
-1732 2211 1828 2076 conicto
-1925 1941 1962 1716 conicto
-1582 1663 lineto
-1557 1843 1433 1944 conicto
-1310 2045 1085 2045 conicto
-819 2045 705 1955 conicto
-591 1865 591 1744 conicto
-591 1668 638 1606 conicto
-685 1543 786 1501 conicto
-844 1479 1128 1400 conicto
-1537 1288 1700 1216 conicto
-1863 1145 1955 1009 conicto
-2048 874 2048 672 conicto
-2048 475 1934 300 conicto
-1820 126 1604 31 conicto
-1389 -64 1116 -64 conicto
-665 -64 429 124 conicto
-193 313 127 682 conicto
-end_ol grestore
-gsave 20.242667 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 20.378133 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 20.708333 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 21.038533 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 21.165533 16.500000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 19.529300 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-gsave 19.825633 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 20.147367 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2008 lineto
-749 2165 930 2266 conicto
-1112 2368 1344 2368 conicto
-1602 2368 1767 2263 conicto
-1932 2159 2001 1979 conicto
-2280 2368 2728 2368 conicto
-3079 2368 3267 2177 conicto
-3456 1986 3456 1589 conicto
-3456 0 lineto
-3057 0 lineto
-3057 1471 lineto
-3057 1709 3018 1813 conicto
-2979 1918 2877 1981 conicto
-2775 2045 2638 2045 conicto
-2390 2045 2226 1881 conicto
-2063 1717 2063 1357 conicto
-2063 0 lineto
-1664 0 lineto
-1664 1517 lineto
-1664 1781 1568 1913 conicto
-1472 2045 1254 2045 conicto
-1088 2045 947 1957 conicto
-807 1869 744 1699 conicto
-681 1530 681 1212 conicto
-681 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 20.638433 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-320 -896 moveto
-320 2304 lineto
-704 2304 lineto
-704 1999 lineto
-827 2178 981 2273 conicto
-1136 2368 1355 2368 conicto
-1641 2368 1860 2214 conicto
-2080 2060 2192 1781 conicto
-2304 1502 2304 1169 conicto
-2304 812 2181 526 conicto
-2058 241 1822 88 conicto
-1586 -64 1327 -64 conicto
-1137 -64 986 19 conicto
-835 102 739 228 conicto
-739 -896 lineto
-320 -896 lineto
-704 1132 moveto
-704 686 877 472 conicto
-1050 259 1297 259 conicto
-1548 259 1726 480 conicto
-1905 701 1905 1164 conicto
-1905 1606 1731 1825 conicto
-1557 2045 1314 2045 conicto
-1074 2045 889 1811 conicto
-704 1577 704 1132 conicto
-end_ol grestore
-gsave 20.968633 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 21.095633 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 21.425833 18.250000 translate 0.035278 -0.035278 scale
-start_ol
-32 0 moveto
-870 1198 lineto
-95 2304 lineto
-581 2304 lineto
-932 1763 lineto
-1032 1610 1092 1506 conicto
-1187 1649 1267 1759 conicto
-1653 2304 lineto
-2117 2304 lineto
-1325 1219 lineto
-2178 0 lineto
-1701 0 lineto
-1230 716 lineto
-1105 909 lineto
-503 0 lineto
-32 0 lineto
-end_ol grestore
-gsave 21.722167 18.250000 translate 0.035278 -0.035278 scale
-start_ol
--64 -896 moveto
--64 -640 lineto
-2496 -640 lineto
-2496 -896 lineto
--64 -896 lineto
-end_ol grestore
-gsave 19.550000 20.000000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-gsave 19.846333 20.000000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 19.973333 20.000000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 20.295067 20.000000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 20.625267 20.000000 translate 0.035278 -0.035278 scale
-start_ol
-204 -201 moveto
-583 -259 lineto
-607 -441 714 -525 conicto
-859 -637 1109 -637 conicto
-1379 -637 1526 -526 conicto
-1673 -415 1724 -215 conicto
-1755 -93 1755 298 conicto
-1500 -3 1120 -3 conicto
-646 -3 387 342 conicto
-128 687 128 1169 conicto
-128 1501 247 1781 conicto
-366 2062 591 2215 conicto
-817 2368 1122 2368 conicto
-1528 2368 1792 2038 conicto
-1792 2304 lineto
-2176 2304 lineto
-2176 297 lineto
-2176 -245 2066 -471 conicto
-1956 -697 1717 -828 conicto
-1479 -960 1130 -960 conicto
-714 -960 459 -771 conicto
-204 -582 204 -201 conicto
-527 1198 moveto
-527 740 707 530 conicto
-887 320 1158 320 conicto
-1427 320 1609 529 conicto
-1792 738 1792 1185 conicto
-1792 1611 1604 1828 conicto
-1417 2045 1151 2045 conicto
-891 2045 709 1831 conicto
-527 1618 527 1198 conicto
-end_ol grestore
-gsave 20.955467 20.000000 translate 0.035278 -0.035278 scale
-start_ol
-384 0 moveto
-384 1984 lineto
-64 1984 lineto
-64 2307 lineto
-384 2307 lineto
-384 2552 lineto
-384 2785 425 2889 conicto
-481 3029 622 3116 conicto
-764 3203 1018 3203 conicto
-1182 3203 1380 3168 conicto
-1322 2858 lineto
-1201 2880 1096 2880 conicto
-925 2880 854 2804 conicto
-783 2728 783 2520 conicto
-783 2307 lineto
-1216 2307 lineto
-1216 1984 lineto
-783 1984 lineto
-783 0 lineto
-384 0 lineto
-end_ol grestore
-gsave 21.116333 20.000000 translate 0.035278 -0.035278 scale
-start_ol
-256 0 moveto
-256 3200 lineto
-655 3200 lineto
-655 0 lineto
-256 0 lineto
-end_ol grestore
-gsave 21.243333 20.000000 translate 0.035278 -0.035278 scale
-start_ol
-128 1152 moveto
-128 1798 479 2109 conicto
-771 2368 1192 2368 conicto
-1661 2368 1958 2053 conicto
-2255 1739 2255 1184 conicto
-2255 735 2123 477 conicto
-1992 220 1740 78 conicto
-1489 -64 1192 -64 conicto
-715 -64 421 249 conicto
-128 562 128 1152 conicto
-527 1154 moveto
-527 705 716 482 conicto
-905 259 1192 259 conicto
-1478 259 1667 483 conicto
-1856 707 1856 1167 conicto
-1856 1599 1666 1822 conicto
-1476 2045 1192 2045 conicto
-905 2045 716 1823 conicto
-527 1601 527 1154 conicto
-end_ol grestore
-gsave 21.565067 20.000000 translate 0.035278 -0.035278 scale
-start_ol
-1746 289 moveto
-1529 102 1331 19 conicto
-1133 -64 905 -64 conicto
-530 -64 329 124 conicto
-128 312 128 605 conicto
-128 777 203 919 conicto
-278 1062 399 1148 conicto
-521 1234 672 1278 conicto
-785 1309 1017 1337 conicto
-1490 1394 1713 1472 conicto
-1713 1553 1713 1575 conicto
-1713 1814 1603 1912 conicto
-1453 2045 1158 2045 conicto
-884 2045 753 1948 conicto
-622 1851 560 1605 conicto
-192 1657 lineto
-243 1902 362 2053 conicto
-481 2204 705 2286 conicto
-930 2368 1225 2368 conicto
-1519 2368 1702 2298 conicto
-1886 2229 1972 2124 conicto
-2058 2019 2093 1858 conicto
-2112 1758 2112 1496 conicto
-2112 973 lineto
-2112 427 2137 281 conicto
-2162 135 2235 0 conicto
-1825 0 lineto
-1763 123 1746 289 conicto
-1713 1165 moveto
-1501 1078 1076 1017 conicto
-835 982 735 938 conicto
-635 895 581 811 conicto
-527 727 527 624 conicto
-527 468 645 363 conicto
-763 259 991 259 conicto
-1216 259 1391 358 conicto
-1567 457 1650 630 conicto
-1713 762 1713 1021 conicto
-1713 1165 lineto
-end_ol grestore
-gsave 21.886800 20.000000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 6.000000 10.250000 m 4.876190 10.250000 l 4.876190 11.013197 l s
-[] 0 sd
-0 slj
-0 slc
-n 4.876190 11.388197 m 4.626190 10.888197 l 4.876190 11.013197 l 5.126190 10.888197 l ef
-n 4.876190 11.388197 m 4.626190 10.888197 l 4.876190 11.013197 l 5.126190 10.888197 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 8.750000 10.250000 m 9.926190 10.250000 l 9.926190 11.013197 l s
-[] 0 sd
-0 slj
-0 slc
-n 9.926190 11.388197 m 9.676190 10.888197 l 9.926190 11.013197 l 10.176190 10.888197 l ef
-n 9.926190 11.388197 m 9.676190 10.888197 l 9.926190 11.013197 l 10.176190 10.888197 l cp s
-0.095250 slw
-[1.000000] 0 sd
-[0.127000] 0 sd
-0 slj
-n 15.202400 9.535000 m 15.202400 11.102375 l 17.752400 11.102375 l 17.752400 9.535000 l cp s
-gsave 15.555000 10.535000 translate 0.035278 -0.035278 scale
-start_ol
-320 2752 moveto
-320 3200 lineto
-719 3200 lineto
-719 2752 lineto
-320 2752 lineto
-320 0 moveto
-320 2304 lineto
-719 2304 lineto
-719 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 15.690467 10.535000 translate 0.035278 -0.035278 scale
-start_ol
-320 0 moveto
-320 2304 lineto
-640 2304 lineto
-640 2003 lineto
-898 2368 1387 2368 conicto
-1600 2368 1778 2292 conicto
-1956 2217 2045 2095 conicto
-2134 1973 2168 1805 conicto
-2191 1696 2191 1424 conicto
-2191 0 lineto
-1792 0 lineto
-1792 1421 lineto
-1792 1662 1746 1782 conicto
-1700 1903 1581 1974 conicto
-1463 2045 1303 2045 conicto
-1048 2045 863 1884 conicto
-679 1724 679 1275 conicto
-679 0 lineto
-320 0 lineto
-end_ol grestore
-gsave 16.020667 10.535000 translate 0.035278 -0.035278 scale
-start_ol
-1877 721 moveto
-2278 672 lineto
-2184 322 1928 129 conicto
-1673 -64 1277 -64 conicto
-777 -64 484 250 conicto
-192 564 192 1132 conicto
-192 1719 487 2043 conicto
-782 2368 1254 2368 conicto
-1710 2368 1999 2043 conicto
-2289 1719 2289 1132 conicto
-2289 1096 2289 1024 conicto
-591 1024 lineto
-591 654 784 456 conicto
-978 259 1268 259 conicto
-1484 259 1636 369 conicto
-1788 479 1877 721 conicto
-610 1347 moveto
-1881 1347 lineto
-1855 1654 1734 1807 conicto
-1549 2045 1251 2045 conicto
-979 2045 794 1855 conicto
-610 1665 610 1347 conicto
-end_ol grestore
-gsave 16.350867 10.535000 translate 0.035278 -0.035278 scale
-start_ol
-32 0 moveto
-870 1198 lineto
-95 2304 lineto
-581 2304 lineto
-932 1763 lineto
-1032 1610 1092 1506 conicto
-1187 1649 1267 1759 conicto
-1653 2304 lineto
-2117 2304 lineto
-1325 1219 lineto
-2178 0 lineto
-1701 0 lineto
-1230 716 lineto
-1105 909 lineto
-503 0 lineto
-32 0 lineto
-end_ol grestore
-gsave 16.647200 10.535000 translate 0.035278 -0.035278 scale
-start_ol
-1746 289 moveto
-1529 102 1331 19 conicto
-1133 -64 905 -64 conicto
-530 -64 329 124 conicto
-128 312 128 605 conicto
-128 777 203 919 conicto
-278 1062 399 1148 conicto
-521 1234 672 1278 conicto
-785 1309 1017 1337 conicto
-1490 1394 1713 1472 conicto
-1713 1553 1713 1575 conicto
-1713 1814 1603 1912 conicto
-1453 2045 1158 2045 conicto
-884 2045 753 1948 conicto
-622 1851 560 1605 conicto
-192 1657 lineto
-243 1902 362 2053 conicto
-481 2204 705 2286 conicto
-930 2368 1225 2368 conicto
-1519 2368 1702 2298 conicto
-1886 2229 1972 2124 conicto
-2058 2019 2093 1858 conicto
-2112 1758 2112 1496 conicto
-2112 973 lineto
-2112 427 2137 281 conicto
-2162 135 2235 0 conicto
-1825 0 lineto
-1763 123 1746 289 conicto
-1713 1165 moveto
-1501 1078 1076 1017 conicto
-835 982 735 938 conicto
-635 895 581 811 conicto
-527 727 527 624 conicto
-527 468 645 363 conicto
-763 259 991 259 conicto
-1216 259 1391 358 conicto
-1567 457 1650 630 conicto
-1713 762 1713 1021 conicto
-1713 1165 lineto
-end_ol grestore
-gsave 16.968933 10.535000 translate 0.035278 -0.035278 scale
-start_ol
-1806 840 moveto
-2188 790 lineto
-2125 389 1867 162 conicto
-1610 -64 1234 -64 conicto
-764 -64 478 248 conicto
-192 560 192 1143 conicto
-192 1520 315 1802 conicto
-438 2085 689 2226 conicto
-941 2368 1236 2368 conicto
-1610 2368 1847 2176 conicto
-2084 1985 2151 1633 conicto
-1774 1573 lineto
-1720 1808 1583 1926 conicto
-1446 2045 1251 2045 conicto
-958 2045 774 1831 conicto
-591 1617 591 1155 conicto
-591 685 768 472 conicto
-945 259 1230 259 conicto
-1458 259 1611 401 conicto
-1765 544 1806 840 conicto
-end_ol grestore
-gsave 17.265267 10.535000 translate 0.035278 -0.035278 scale
-start_ol
-1152 399 moveto
-1209 37 lineto
-1034 0 895 0 conicto
-670 0 545 71 conicto
-421 142 370 257 conicto
-320 373 320 724 conicto
-320 2045 lineto
-64 2045 lineto
-64 2368 lineto
-320 2368 lineto
-320 2942 lineto
-719 3177 lineto
-719 2368 lineto
-1152 2368 lineto
-1152 2045 lineto
-719 2045 lineto
-719 702 lineto
-719 535 742 487 conicto
-765 440 816 412 conicto
-868 384 963 384 conicto
-1035 384 1152 399 conicto
-end_ol grestore
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 13.928800 7.500000 m 13.928800 8.517500 l 16.477400 8.517500 l 16.477400 9.048197 l s
-[] 0 sd
-0 slj
-0 slc
-n 16.477400 9.423197 m 16.227400 8.923197 l 16.477400 9.048197 l 16.727400 8.923197 l ef
-n 16.477400 9.423197 m 16.227400 8.923197 l 16.477400 9.048197 l 16.727400 8.923197 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 15.202400 10.318700 m 14.178700 10.318700 l 14.178700 11.013197 l s
-[] 0 sd
-0 slj
-0 slc
-n 14.178700 11.388197 m 13.928700 10.888197 l 14.178700 11.013197 l 14.428700 10.888197 l ef
-n 14.178700 11.388197 m 13.928700 10.888197 l 14.178700 11.013197 l 14.428700 10.888197 l cp s
-0.100000 slw
-[] 0 sd
-[] 0 sd
-0 slj
-0 slc
-n 17.752400 10.318700 m 18.963700 10.318700 l 18.963700 11.013197 l s
-[] 0 sd
-0 slj
-0 slc
-n 18.963700 11.388197 m 18.713700 10.888197 l 18.963700 11.013197 l 19.213700 10.888197 l ef
-n 18.963700 11.388197 m 18.713700 10.888197 l 18.963700 11.013197 l 19.213700 10.888197 l cp s
-gsave 25.352400 12.802400 translate 0.035278 -0.035278 scale
-start_ol
-2034 2424 moveto
-2034 2034 lineto
-1849 2123 1665 2167 conicto
-1482 2212 1285 2212 conicto
-985 2212 835 2118 conicto
-685 2025 685 1839 conicto
-685 1697 791 1615 conicto
-898 1534 1219 1462 conicto
-1355 1430 lineto
-1785 1337 1971 1166 conicto
-2157 995 2157 690 conicto
-2157 342 1882 139 conicto
-1608 -64 1128 -64 conicto
-928 -64 710 -24 conicto
-493 15 253 94 conicto
-253 519 lineto
-483 402 701 343 conicto
-920 284 1133 284 conicto
-1420 284 1574 383 conicto
-1728 482 1728 661 conicto
-1728 829 1618 917 conicto
-1509 1006 1138 1088 conicto
-999 1121 lineto
-622 1201 439 1367 conicto
-256 1533 256 1823 conicto
-256 2176 509 2368 conicto
-762 2560 1226 2560 conicto
-1457 2560 1660 2526 conicto
-1863 2492 2034 2424 conicto
-end_ol grestore
-gsave 25.665667 12.802400 translate 0.035278 -0.035278 scale
-start_ol
-832 3213 moveto
-832 2524 lineto
-1664 2524 lineto
-1664 2176 lineto
-832 2176 lineto
-832 825 lineto
-832 521 914 434 conicto
-997 348 1249 348 conicto
-1664 348 lineto
-1664 0 lineto
-1241 0 lineto
-765 0 584 179 conicto
-403 359 403 826 conicto
-403 2176 lineto
-128 2176 lineto
-128 2524 lineto
-403 2524 lineto
-403 3213 lineto
-832 3213 lineto
-end_ol grestore
-gsave 25.902733 12.802400 translate 0.035278 -0.035278 scale
-start_ol
-1853 2133 moveto
-1787 2174 1706 2193 conicto
-1626 2212 1529 2212 conicto
-1183 2212 998 1983 conicto
-813 1755 813 1328 conicto
-813 0 lineto
-384 0 lineto
-384 2496 lineto
-813 2496 lineto
-813 2129 lineto
-941 2347 1146 2453 conicto
-1352 2560 1647 2560 conicto
-1689 2560 1740 2553 conicto
-1791 2547 1853 2536 conicto
-1853 2133 lineto
-end_ol grestore
-gsave 26.148267 12.802400 translate 0.035278 -0.035278 scale
-start_ol
-2304 -740 moveto
-2304 -1088 lineto
--64 -1088 lineto
--64 -740 lineto
-2304 -740 lineto
-end_ol grestore
-showpage
diff --git a/doc/numpybook/Figures/hierarchy.fig b/doc/numpybook/Figures/hierarchy.fig
deleted file mode 100644
index 178555da0..000000000
--- a/doc/numpybook/Figures/hierarchy.fig
+++ /dev/null
Binary files differ
diff --git a/doc/numpybook/Figures/hierarchy.pdf b/doc/numpybook/Figures/hierarchy.pdf
deleted file mode 100644
index 7ab56ee97..000000000
--- a/doc/numpybook/Figures/hierarchy.pdf
+++ /dev/null
Binary files differ
diff --git a/doc/numpybook/Figures/hierarchy.png b/doc/numpybook/Figures/hierarchy.png
deleted file mode 100644
index 50dd7474d..000000000
--- a/doc/numpybook/Figures/hierarchy.png
+++ /dev/null
Binary files differ
diff --git a/doc/numpybook/Figures/threefundamental.eps b/doc/numpybook/Figures/threefundamental.eps
deleted file mode 100644
index 22eedc4f1..000000000
--- a/doc/numpybook/Figures/threefundamental.eps
+++ /dev/null
@@ -1,246 +0,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Title: threefundamental.fig
-%%Creator: fig2dev Version 3.2 Patchlevel 4
-%%CreationDate: Mon Jan 16 15:40:51 2006
-%%For: oliphant@den.local.net (Travis Oliphant)
-%%BoundingBox: 0 0 438 162
-%%Magnification: 1.0000
-%%EndComments
-/$F2psDict 200 dict def
-$F2psDict begin
-$F2psDict /mtrx matrix put
-/col-1 {0 setgray} bind def
-/col0 {0.000 0.000 0.000 srgb} bind def
-/col1 {0.000 0.000 1.000 srgb} bind def
-/col2 {0.000 1.000 0.000 srgb} bind def
-/col3 {0.000 1.000 1.000 srgb} bind def
-/col4 {1.000 0.000 0.000 srgb} bind def
-/col5 {1.000 0.000 1.000 srgb} bind def
-/col6 {1.000 1.000 0.000 srgb} bind def
-/col7 {1.000 1.000 1.000 srgb} bind def
-/col8 {0.000 0.000 0.560 srgb} bind def
-/col9 {0.000 0.000 0.690 srgb} bind def
-/col10 {0.000 0.000 0.820 srgb} bind def
-/col11 {0.530 0.810 1.000 srgb} bind def
-/col12 {0.000 0.560 0.000 srgb} bind def
-/col13 {0.000 0.690 0.000 srgb} bind def
-/col14 {0.000 0.820 0.000 srgb} bind def
-/col15 {0.000 0.560 0.560 srgb} bind def
-/col16 {0.000 0.690 0.690 srgb} bind def
-/col17 {0.000 0.820 0.820 srgb} bind def
-/col18 {0.560 0.000 0.000 srgb} bind def
-/col19 {0.690 0.000 0.000 srgb} bind def
-/col20 {0.820 0.000 0.000 srgb} bind def
-/col21 {0.560 0.000 0.560 srgb} bind def
-/col22 {0.690 0.000 0.690 srgb} bind def
-/col23 {0.820 0.000 0.820 srgb} bind def
-/col24 {0.500 0.190 0.000 srgb} bind def
-/col25 {0.630 0.250 0.000 srgb} bind def
-/col26 {0.750 0.380 0.000 srgb} bind def
-/col27 {1.000 0.500 0.500 srgb} bind def
-/col28 {1.000 0.630 0.630 srgb} bind def
-/col29 {1.000 0.750 0.750 srgb} bind def
-/col30 {1.000 0.880 0.880 srgb} bind def
-/col31 {1.000 0.840 0.000 srgb} bind def
-
-end
-save
-newpath 0 162 moveto 0 0 lineto 438 0 lineto 438 162 lineto closepath clip newpath
--30.8 237.8 translate
-1 -1 scale
-
-/cp {closepath} bind def
-/ef {eofill} bind def
-/gr {grestore} bind def
-/gs {gsave} bind def
-/sa {save} bind def
-/rs {restore} bind def
-/l {lineto} bind def
-/m {moveto} bind def
-/rm {rmoveto} bind def
-/n {newpath} bind def
-/s {stroke} bind def
-/sh {show} bind def
-/slc {setlinecap} bind def
-/slj {setlinejoin} bind def
-/slw {setlinewidth} bind def
-/srgb {setrgbcolor} bind def
-/rot {rotate} bind def
-/sc {scale} bind def
-/sd {setdash} bind def
-/ff {findfont} bind def
-/sf {setfont} bind def
-/scf {scalefont} bind def
-/sw {stringwidth} bind def
-/tr {translate} bind def
-/tnt {dup dup currentrgbcolor
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
- bind def
-/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
- 4 -2 roll mul srgb} bind def
-/reencdict 12 dict def /ReEncode { reencdict begin
-/newcodesandnames exch def /newfontname exch def /basefontname exch def
-/basefontdict basefontname findfont def /newfont basefontdict maxlength dict def
-basefontdict { exch dup /FID ne { dup /Encoding eq
-{ exch dup length array copy newfont 3 1 roll put }
-{ exch newfont 3 1 roll put } ifelse } { pop pop } ifelse } forall
-newfont /FontName newfontname put newcodesandnames aload pop
-128 1 255 { newfont /Encoding get exch /.notdef put } for
-newcodesandnames length 2 idiv { newfont /Encoding get 3 1 roll put } repeat
-newfontname newfont definefont pop end } def
-/isovec [
-8#055 /minus 8#200 /grave 8#201 /acute 8#202 /circumflex 8#203 /tilde
-8#204 /macron 8#205 /breve 8#206 /dotaccent 8#207 /dieresis
-8#210 /ring 8#211 /cedilla 8#212 /hungarumlaut 8#213 /ogonek 8#214 /caron
-8#220 /dotlessi 8#230 /oe 8#231 /OE
-8#240 /space 8#241 /exclamdown 8#242 /cent 8#243 /sterling
-8#244 /currency 8#245 /yen 8#246 /brokenbar 8#247 /section 8#250 /dieresis
-8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft 8#254 /logicalnot
-8#255 /hyphen 8#256 /registered 8#257 /macron 8#260 /degree 8#261 /plusminus
-8#262 /twosuperior 8#263 /threesuperior 8#264 /acute 8#265 /mu 8#266 /paragraph
-8#267 /periodcentered 8#270 /cedilla 8#271 /onesuperior 8#272 /ordmasculine
-8#273 /guillemotright 8#274 /onequarter 8#275 /onehalf
-8#276 /threequarters 8#277 /questiondown 8#300 /Agrave 8#301 /Aacute
-8#302 /Acircumflex 8#303 /Atilde 8#304 /Adieresis 8#305 /Aring
-8#306 /AE 8#307 /Ccedilla 8#310 /Egrave 8#311 /Eacute
-8#312 /Ecircumflex 8#313 /Edieresis 8#314 /Igrave 8#315 /Iacute
-8#316 /Icircumflex 8#317 /Idieresis 8#320 /Eth 8#321 /Ntilde 8#322 /Ograve
-8#323 /Oacute 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply
-8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex
-8#334 /Udieresis 8#335 /Yacute 8#336 /Thorn 8#337 /germandbls 8#340 /agrave
-8#341 /aacute 8#342 /acircumflex 8#343 /atilde 8#344 /adieresis 8#345 /aring
-8#346 /ae 8#347 /ccedilla 8#350 /egrave 8#351 /eacute
-8#352 /ecircumflex 8#353 /edieresis 8#354 /igrave 8#355 /iacute
-8#356 /icircumflex 8#357 /idieresis 8#360 /eth 8#361 /ntilde 8#362 /ograve
-8#363 /oacute 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide
-8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex
-8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /ydieresis] def
-/Helvetica-Bold /Helvetica-Bold-iso isovec ReEncode
-/Times-Bold /Times-Bold-iso isovec ReEncode
-/Helvetica /Helvetica-iso isovec ReEncode
-/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
-/$F2psEnd {$F2psEnteredState restore end} def
-
-$F2psBegin
-10 setmiterlimit
-0 slj 0 slc
- 0.06000 0.06000 sc
-%
-% Fig objects follow
-%
-%
-% here starts figure with depth 50
-% Polyline
-7.500 slw
-n 1950 2850 m 4350 2850 l 4350 3450 l 1950 3450 l
- cp gs col0 s gr
-% Polyline
-n 2550 2850 m
- 2550 3450 l gs col0 s gr
-% Polyline
-n 3150 2850 m
- 3150 3450 l gs col0 s gr
-% Polyline
-n 3750 2850 m
- 3750 3450 l gs col0 s gr
-% Polyline
-n 5100 2850 m 7500 2850 l 7500 3450 l 5100 3450 l
- cp gs col0 s gr
-% Polyline
-n 5700 2850 m
- 5700 3450 l gs col0 s gr
-% Polyline
-n 6300 2850 m
- 6300 3450 l gs col0 s gr
-% Polyline
-n 6900 2850 m
- 6900 3450 l gs col0 s gr
-% Polyline
-n 630 2700 m 525 2700 525 3495 105 arcto 4 {pop} repeat
- 525 3600 7695 3600 105 arcto 4 {pop} repeat
- 7800 3600 7800 2805 105 arcto 4 {pop} repeat
- 7800 2700 630 2700 105 arcto 4 {pop} repeat
- cp gs col0 s gr
-% Polyline
-n 675 2850 m 1725 2850 l 1725 3450 l 675 3450 l
- cp gs col0 s gr
-% Polyline
-45.000 slw
-n 5700 2850 m 6300 2850 l 6300 3450 l 5700 3450 l
- cp gs col0 s gr
-% Polyline
-n 5700 1725 m 6300 1725 l 6300 2325 l 5700 2325 l
- cp gs col0 s gr
-% Polyline
-7.500 slw
-n 5655 1275 m 5550 1275 5550 2370 105 arcto 4 {pop} repeat
- 5550 2475 6345 2475 105 arcto 4 {pop} repeat
- 6450 2475 6450 1380 105 arcto 4 {pop} repeat
- 6450 1275 5655 1275 105 arcto 4 {pop} repeat
- cp gs col0 s gr
-% Polyline
-n 5700 1350 m 6300 1350 l 6300 1575 l 5700 1575 l
- cp gs col0 s gr
-% Polyline
-gs clippath
-1590 1905 m 1590 1845 l 1405 1845 l 1555 1875 l 1405 1905 l cp
-eoclip
-n 900 2850 m 900 1875 l
- 1575 1875 l gs col0 s gr gr
-
-% arrowhead
-n 1405 1905 m 1555 1875 l 1405 1845 l 1435 1875 l 1405 1905 l
- cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-5565 1830 m 5565 1770 l 5380 1770 l 5530 1800 l 5380 1830 l cp
-eoclip
-n 3375 1800 m
- 5550 1800 l gs col0 s gr gr
-
-% arrowhead
-n 5380 1830 m 5530 1800 l 5380 1770 l 5410 1800 l 5380 1830 l
- cp gs 0.00 setgray ef gr col0 s
-% Polyline
-gs clippath
-6030 2310 m 5970 2310 l 5970 2495 l 6000 2345 l 6030 2495 l cp
-eoclip
-n 6000 2850 m
- 6000 2325 l gs col0 s gr gr
-
-% arrowhead
-n 6030 2495 m 6000 2345 l 5970 2495 l 6000 2465 l 6030 2495 l
- cp gs 0.00 setgray ef gr col0 s
-% Polyline
-n 1680 1575 m 1575 1575 1575 1995 105 arcto 4 {pop} repeat
- 1575 2100 3270 2100 105 arcto 4 {pop} repeat
- 3375 2100 3375 1680 105 arcto 4 {pop} repeat
- 3375 1575 1680 1575 105 arcto 4 {pop} repeat
- cp gs col0 s gr
-/Helvetica-Bold-iso ff 210.00 scf sf
-825 3225 m
-gs 1 -1 sc (header) col0 sh gr
-/Times-Bold-iso ff 600.00 scf sf
-4500 3225 m
-gs 1 -1 sc (...) col0 sh gr
-/Helvetica-Bold-iso ff 210.00 scf sf
-3600 3900 m
-gs 1 -1 sc (ndarray) col0 sh gr
-/Helvetica-Bold-iso ff 210.00 scf sf
-6600 2175 m
-gs 1 -1 sc (scalar) col0 sh gr
-/Helvetica-Bold-iso ff 210.00 scf sf
-6600 1950 m
-gs 1 -1 sc (array) col0 sh gr
-/Helvetica-iso ff 180.00 scf sf
-5775 1500 m
-gs 1 -1 sc (head) col0 sh gr
-/Helvetica-Bold-iso ff 210.00 scf sf
-1950 1875 m
-gs 1 -1 sc (data-type) col0 sh gr
-% here ends figure;
-$F2psEnd
-rs
-showpage
diff --git a/doc/numpybook/Figures/threefundamental.fig b/doc/numpybook/Figures/threefundamental.fig
deleted file mode 100644
index 79760c410..000000000
--- a/doc/numpybook/Figures/threefundamental.fig
+++ /dev/null
@@ -1,57 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter
-100.00
-Single
--2
-1200 2
-6 1950 2850 4350 3450
-2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 1950 2850 4350 2850 4350 3450 1950 3450 1950 2850
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 2550 2850 2550 3450
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 3150 2850 3150 3450
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 3750 2850 3750 3450
--6
-2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 5100 2850 7500 2850 7500 3450 5100 3450 5100 2850
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 5700 2850 5700 3450
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 6300 2850 6300 3450
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2
- 6900 2850 6900 3450
-2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5
- 7800 3600 7800 2700 525 2700 525 3600 7800 3600
-2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 675 2850 1725 2850 1725 3450 675 3450 675 2850
-2 2 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 5700 2850 6300 2850 6300 3450 5700 3450 5700 2850
-2 2 0 4 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 5700 1725 6300 1725 6300 2325 5700 2325 5700 1725
-2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5
- 6450 2475 6450 1275 5550 1275 5550 2475 6450 2475
-2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 5700 1350 6300 1350 6300 1575 5700 1575 5700 1350
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3
- 2 1 1.00 60.00 120.00
- 900 2850 900 1875 1575 1875
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
- 2 1 1.00 60.00 120.00
- 3375 1800 5550 1800
-2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2
- 2 1 1.00 60.00 120.00
- 6000 2850 6000 2325
-2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5
- 3375 2100 3375 1575 1575 1575 1575 2100 3375 2100
-4 0 0 50 -1 18 14 0.0000 4 165 720 825 3225 header\001
-4 0 0 50 -1 2 40 0.0000 4 105 450 4500 3225 ...\001
-4 0 0 50 -1 18 14 0.0000 4 210 810 3600 3900 ndarray\001
-4 0 0 50 -1 18 14 0.0000 4 165 630 6600 2175 scalar\001
-4 0 0 50 -1 18 14 0.0000 4 165 540 6600 1950 array\001
-4 0 0 50 -1 16 12 0.0000 4 135 420 5775 1500 head\001
-4 0 0 50 -1 18 14 0.0000 4 210 975 1950 1875 data-type\001
diff --git a/doc/numpybook/Figures/threefundamental.png b/doc/numpybook/Figures/threefundamental.png
deleted file mode 100644
index f4d4d950d..000000000
--- a/doc/numpybook/Figures/threefundamental.png
+++ /dev/null
Binary files differ
diff --git a/doc/numpybook/capi.lyx b/doc/numpybook/capi.lyx
deleted file mode 100644
index 94f18362a..000000000
--- a/doc/numpybook/capi.lyx
+++ /dev/null
@@ -1,24240 +0,0 @@
-#LyX 1.5.1 created this file. For more info see http://www.lyx.org/
-\lyxformat 276
-\begin_document
-\begin_header
-\textclass mybook
-\language english
-\inputencoding auto
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_default_family default
-\font_sc false
-\font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
-\graphics default
-\paperfontsize default
-\spacing onehalf
-\papersize default
-\use_geometry true
-\use_amsmath 2
-\use_esint 0
-\cite_engine basic
-\use_bibtopic false
-\paperorientation portrait
-\leftmargin 1in
-\topmargin 1in
-\rightmargin 1in
-\bottommargin 1in
-\secnumdepth 3
-\tocdepth 3
-\paragraph_separation indent
-\defskip medskip
-\quotes_language english
-\papercolumns 1
-\papersides 1
-\paperpagestyle default
-\tracking_changes false
-\output_changes false
-\author ""
-\author ""
-\end_header
-
-\begin_body
-
-\begin_layout Part
-C-API
-\end_layout
-
-\begin_layout Chapter
-New Python Types and C-Structures
-\end_layout
-
-\begin_layout Quotation
-Beware of the man who won't be bothered with details.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-William Feather, Sr.
-\end_layout
-
-\begin_layout Quotation
-The truth is out there.
-\end_layout
-
-\begin_layout Right Address
----Chris Carter, The X Files
-\end_layout
-
-\begin_layout Standard
-NumPy provides a C-API to enable users to extend the system and get access
- to the array object for use in other routines.
- The best way to truly understand the C-API is to read the source code.
- If you are unfamiliar with (C) source code, however, this can be a daunting
- experience at first.
- Be assured that the task becomes easier with practice, and you may be surprised
- at how simple the C-code can be to understand.
- Even if you don't think you can write C-code from scratch, it is much easier
- to understand and modify already-written source code then create it
-\emph on
-de novo
-\emph default
-.
-
-\end_layout
-
-\begin_layout Standard
-Python extensions are especially straightforward to understand because they
- all have a very similar structure.
- Admittedly, NumPy is not a trivial extension to Python, and may take a
- little more snooping to grasp.
- This is especially true because of the code-generation techniques, which
- simplify maintenance of very similar code, but can make the code a little
- less readable to beginners.
- Still, with a little persistence, the code can be opened to your understanding.
- It is my hope, that this guide to the C-API can assist in the process of
- becoming familiar with the compiled-level work that can be done with NumPy
- in order to squeeze that last bit of necessary speed out of your code.
-\end_layout
-
-\begin_layout Standard
-Several new types are defined in the C-code.
- Most of these are accessible from Python, but a few are not exposed due
- to their limited use.
- Every new Python type has an associated PyObject * with an internal structure
- that includes a pointer to a
-\begin_inset Quotes eld
-\end_inset
-
-method table
-\begin_inset Quotes erd
-\end_inset
-
- that defines how the new object behaves in Python.
- When you receive a Python object into C code, you always get a pointer
- to a
-\family typewriter
-PyObject
-\family default
- structure.
- Because a
-\family typewriter
-PyObject
-\family default
- structure is very generic and defines only
-\family typewriter
-PyObject_HEAD
-\family default
-, by itself it is not very interesting.
- However, different objects contain more details after the
-\family typewriter
-PyObject_HEAD
-\family default
- (but you have to cast to the correct type to access them --- or use accessor
- functions or macros).
-
-\end_layout
-
-\begin_layout Section
-New Python Types Defined
-\end_layout
-
-\begin_layout Standard
-Python types are the functional equivalent in C of classes in Python.
- By constructing a new Python type you make available a new object for Python.
- The ndarray object is an example of a new type defined in C.
- New types are defined in C by two basic steps:
-\end_layout
-
-\begin_layout Enumerate
-creating a C-structure (usually named Py<Name>Object) that is binary-compatible
- with the
-\family typewriter
-PyObject
-\family default
- structure itself but holds the additional information needed for that particula
-r object;
-\end_layout
-
-\begin_layout Enumerate
-populating the
-\family typewriter
-PyTypeObject
-\family default
- table (pointed to by the ob_type member of the
-\family typewriter
-PyObject
-\family default
- structure) with pointers to functions that implement the desired behavior
- for the type.
-
-\end_layout
-
-\begin_layout Standard
-Instead of special method names which define behavior for Python classes,
- there are
-\begin_inset Quotes eld
-\end_inset
-
-function tables
-\begin_inset Quotes erd
-\end_inset
-
- which point to functions that implement the desired results.
- Since Python 2.2, the PyTypeObject itself has become dynamic which allows
- C types that can be
-\begin_inset Quotes eld
-\end_inset
-
-sub-typed
-\begin_inset Quotes erd
-\end_inset
-
- from other C-types in C, and sub-classed in Python.
- The children types inherit the attributes and methods from their parent(s).
-
-\end_layout
-
-\begin_layout Standard
-There are two major new types: the ndarray (
-\family typewriter
-PyArray_Type
-\family default
-) and the ufunc (
-\family typewriter
-PyUFunc_Type
-\family default
-).
- Additional types play a supportive role: the
-\family typewriter
-PyArrayIter_Type
-\family default
-, the
-\family typewriter
-PyArrayMultiIter_Type
-\family default
-, and the
-\family typewriter
-PyArrayDescr_Type
-\family default
-.
- The
-\family typewriter
-PyArrayIter_Type
-\family default
- is the type for a flat iterator for an ndarray (the object that is returned
- when getting the flat attribute).
- The
-\family typewriter
-PyArrayMultiIter_Type
-\family default
- is the type of the object returned when calling
-\family typewriter
-broadcast
-\family default
-().
- It handles iteration and broadcasting over a collection of nested sequences.
- Also, the
-\family typewriter
-PyArrayDescr_Type
-\family default
- is the data-type-descriptor type whose instances describe the data.
- Finally, there are 21 new scalar-array types which are new Python scalars
- corresponding to each of the fundamental data types available for arrays.
- An additional 10 other types are place holders that allow the array scalars
- to fit into a hierarchy of actual Python types.
-
-\end_layout
-
-\begin_layout Subsection
-PyArray_Type
-\end_layout
-
-\begin_layout Standard
-The Python type of the ndarray is
-\family typewriter
-PyArray_Type
-\family default
-
-\begin_inset LatexCommand index
-name "PyArray\\_Type"
-
-\end_inset
-
-.
- In C, every ndarray is a pointer to a
-\family typewriter
-PyArrayObject
-\family default
- structure.
- The ob_type member of this structure contains a pointer to the
-\family typewriter
-PyArray_Type
-\family default
- typeobject.
-
-\end_layout
-
-\begin_layout Standard
-The
-\family typewriter
-PyArrayObject
-\family default
- C-structure contains all of the required information for an array.
- All instances of an ndarray (and its subclasses) will have this structure.
- For future compatibility, these structure members should normally be accessed
- using the provided macros.
- If you need a shorter name, then you can make use of
-\family typewriter
-NPY_AO
-\family default
- which is defined to be equivalent to
-\family typewriter
-PyArrayObject
-\family default
-.
-\end_layout
-
-\begin_layout LyX-Code
-typedef struct PyArrayObject {
-\end_layout
-
-\begin_layout LyX-Code
- PyObject_HEAD
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-char *
-\emph default
-data;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- nd;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp *
-\emph default
-dimensions;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp *
-\emph default
-strides;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyObject *
-\emph default
-base;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_Descr *
-\emph default
-descr;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- flags;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyObject *
-\emph default
-weakreflist;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\emph on
-PyArrayObject
-\emph default
-;
-\end_layout
-
-\begin_layout Description
-PyObject_HEAD This is needed by all Python objects.
- It consists of (at least) a reference count member (
-\family typewriter
-ob_refcnt
-\family default
-) and a pointer to the typeobject (
-\family typewriter
-ob_type
-\family default
-).
- (Other elements may also be present if Python was compiled with special
- options see Include/object.h in the Python source tree for more information).
- The ob_type member points to a Python type object.
-
-\end_layout
-
-\begin_layout Description
-data A pointer to the first element of the array.
- This pointer can (and normally should) be recast to the data type of the
- array.
-
-\end_layout
-
-\begin_layout Description
-nd An integer providing the number of dimensions for this array.
- When nd is 0, the array is sometimes called a rank-0 array.
- Such arrays have undefined dimensions and strides and cannot be accessed.
-
-\family typewriter
-NPY_MAXDIMS
-\family default
- is the largest number of dimensions for any array.
-\end_layout
-
-\begin_layout Description
-dimensions An array of integers providing the shape in each dimension as
- long as nd
-\begin_inset Formula $\geq$
-\end_inset
-
-1.
- The integer is always large enough to hold a pointer on the platform, so
- the dimension size is only limited by memory.
-
-\end_layout
-
-\begin_layout Description
-strides An array of integers providing for each dimension the number of
- bytes that must be skipped to get to the next element in that dimension.
-
-\end_layout
-
-\begin_layout Description
-base This member is used to hold a pointer to another Python object that
- is related to this array.
- There are two use cases: 1) If this array does not own its own memory,
- then base points to the Python object that owns it (perhaps another array
- object), 2) If this array has the
-\family typewriter
-NPY_UPDATEIFCOPY
-\family default
- flag set, then this array is a working copy of a
-\begin_inset Quotes eld
-\end_inset
-
-misbehaved
-\begin_inset Quotes erd
-\end_inset
-
- array.
- As soon as this array is deleted, the array pointed to by base will be
- updated with the contents of this array.
-
-\end_layout
-
-\begin_layout Description
-descr A pointer to a data-type descriptor object (see below).
- The data-type descriptor object is an instance of a new built-in type which
- allows a generic description of memory.
- There is a descriptor structure for each data type supported.
- This descriptor structure contains useful information about the type as
- well as a pointer to a table of function pointers to implement specific
- functionality.
-\end_layout
-
-\begin_layout Description
-flags Flags indicating how the memory pointed to by data is to be interpreted.
- Possible flags are
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
-,
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
-,
-\family typewriter
-NPY_OWNDATA
-\family default
-,
-\family typewriter
-NPY_ALIGNED
-\family default
-,
-\family typewriter
-NPY_WRITEABLE
-\family default
-, and
-\family typewriter
-NPY_UPDATEIFCOPY
-\family default
-.
-\end_layout
-
-\begin_layout Description
-weakreflist This member allows array objects to have weak references (using
- the weakref module).
-
-\end_layout
-
-\begin_layout Subsection
-PyArrayDescr_Type
-\end_layout
-
-\begin_layout Standard
-The
-\family typewriter
-PyArrayDescr_Type
-\family default
-
-\begin_inset LatexCommand index
-name "PyArrayDescr\\_Type"
-
-\end_inset
-
- is the built-in type of the data-type-descriptor objects used to describe
- how the bytes comprising the array are to be interpreted.
- There are 21 statically-defined
-\family typewriter
-PyArray_Descr
-\family default
- objects for the built-in data-types.
- While these participate in reference counting, their reference count should
- never reach zero.
- There is also a dynamic table of user-defined
-\family typewriter
-PyArray_Descr
-\family default
- objects that is also maintained.
- Once a data-type-descriptor object is
-\begin_inset Quotes eld
-\end_inset
-
-registered
-\begin_inset Quotes erd
-\end_inset
-
- it should never be deallocated either.
- The function
-\family typewriter
-PyArray_DescrFromType
-\family default
-(...) can be used to retrieve a
-\family typewriter
-PyArray_Descr
-\family default
- object from an enumerated type-number (either built-in or user-defined).
- The format of the structure that lies at the heart of the
-\family typewriter
-PyArrayDescr_Type
-\family default
- is.
-
-\end_layout
-
-\begin_layout LyX-Code
-typedef struct {
-\end_layout
-
-\begin_layout LyX-Code
- PyObject_HEAD
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyTypeObject *
-\emph default
-typeobj;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-char
-\emph default
- kind;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-char
-\emph default
- type;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-char
-\emph default
- byteorder;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-char
-\emph default
- unused;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- flags;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- type_num;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- elsize;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- alignment;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_ArrayDescr
-\emph default
- *subarray;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyObject
-\emph default
- *fields;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_ArrFuncs
-\emph default
- *f;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\emph on
-PyArray_Descr
-\emph default
-;
-\end_layout
-
-\begin_layout Description
-typeobj Pointer to a typeobject that is the corresponding Python type for
- the elements of this array.
- For the builtin types, this points to the corresponding array scalar.
- For user-defined types, this should point to a user-defined typeobject.
- This typeobject can either inherit from array scalars or not.
- If it does not inherit from array scalars, then the
-\family typewriter
-NPY_USE_GETITEM
-\family default
- and
-\family typewriter
-NPY_USE_SETITEM
-\family default
- flags should be set in the
-\family typewriter
-flags
-\family default
- member.
-\end_layout
-
-\begin_layout Description
-kind A character code indicating the kind of array (using the array interface
- typestring notation).
- A 'b' represents Boolean, a 'i' represents signed integer, a 'u' represents
- unsigned integer, 'f' represents floating point, 'c' represents complex
- floating point, 'S' represents 8-bit character string, 'U' represents 32-bit/ch
-aracter unicode string, and 'V' repesents arbitrary.
-
-\end_layout
-
-\begin_layout Description
-type A traditional character code indicating the data type.
-
-\end_layout
-
-\begin_layout Description
-byteorder A character indicating the byte-order: '>' (big-endian), '<' (little-e
-ndian), '=' (native), '|' (irrelevant, ignore).
- All builtin data-types have byteorder '='.
-
-\end_layout
-
-\begin_layout Description
-flags A data-type bit-flag that determines if the data-type exhibits
- object-array like behavior.
- Each bit in this member is a flag which are named as:
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-NPY_ITEM_REFCOUNT\InsetSpace ~
-(NPY_ITEM_HASOBJECT) Indicates that items of this data-type
- must be reference counted (using
-\family typewriter
-Py_INCREF
-\family default
- and
-\family typewriter
-Py_DECREF
-\family default
-).
-
-\end_layout
-
-\begin_layout Description
-NPY_ITEM_LISTPICKLE Indicates arrays of this data-type must be converted
- to a list before pickling.
-
-\end_layout
-
-\begin_layout Description
-NPY_ITEM_IS_POINTER Indicates the item is a pointer to some other data-type
-\end_layout
-
-\begin_layout Description
-NPY_NEEDS_INIT Indicates memory for this data-type must be initialized (set
- to 0) on creation.
-
-\end_layout
-
-\begin_layout Description
-NPY_NEEDS_PYAPI Indicates this data-type requires the Python C-API during
- access (so don't give up the GIL if array access is going to be needed).
-
-\end_layout
-
-\begin_layout Description
-NPY_USE_GETITEM On array access use the
-\family typewriter
-f->getitem
-\family default
- function pointer instead of the standard conversion to an array scalar.
- Must use if you don't define an array scalar to go along with the data-type.
-
-\end_layout
-
-\begin_layout Description
-NPY_USE_SETITEM When creating a 0-d array from an array scalar use
-\family typewriter
-f->setitem
-\family default
- instead of the standard copy from an array scalar.
- Must use if you don't define an array scalar to go along with the data-type.
-
-\end_layout
-
-\begin_layout Description
-NPY_FROM_FIELDS The bits that are inherited for the parent data-type if
- these bits are set in any field of the data-type.
- Currently (
-\family typewriter
-NPY_NEEDS_INIT
-\family default
- |
-\family typewriter
-NPY_LIST_PICKLE
-\family default
- |
-\family typewriter
-NPY_ITEM_REFCOUNT
-\family default
- |
-\family typewriter
-NPY_NEEDS_PYAPI
-\family default
-).
-
-\end_layout
-
-\begin_layout Description
-NPY_OBJECT_DTYPE_FLAGS Bits set for the object data-type: (
-\family typewriter
-NPY_LIST_PICKLE
-\family default
- |
-\family typewriter
-NPY_USE_GETITEM
-\family default
- |
-\family typewriter
-NPY_ITEM_IS_POINTER
-\family default
- |
-\family typewriter
-NPY_REFCOUNT
-\family default
- |
-\family typewriter
-NPY_NEEDS_INIT
-\family default
- |
-\family typewriter
-NPY_NEEDS_PYAPI
-\family default
-).
-
-\end_layout
-
-\begin_layout Description
-PyDataType_FLAGCHK (
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-int
-\family default
- flags) Return true if all the given flags are set for the data-type object.
-
-\end_layout
-
-\begin_layout Description
-PyDataType_REFCHK (
-\family typewriter
-PyArray_Descr*
-\family default
- dtype) Equivalent to
-\family typewriter
-PyDataType_FLAGCHK
-\family default
-(
-\emph on
-dtype
-\emph default
-,
-\family typewriter
-NPY_ITEM_REFCOUNT
-\family default
-).
-\end_layout
-
-\end_deeper
-\begin_layout Description
-type_num A number that uniquely identifies the data type.
- For new data-types, this number is assigned when the data-type is registered.
-\end_layout
-
-\begin_layout Description
-elsize For data types that are always the same size (such as long), this
- holds the size of the data type.
- For flexible data types where different arrays can have a different elementsize
-, this should be 0.
-\end_layout
-
-\begin_layout Description
-alignment A number providing alignment information for this data type.
- Specifically, it shows how far from the start of a 2-element structure
- (whose first element is a
-\family typewriter
-char
-\family default
-), the compiler places an item of this type:
-\family typewriter
-offsetof(struct {char c; type v;}, v)
-\end_layout
-
-\begin_layout Description
-subarray If this is non-
-\family typewriter
-NULL
-\family default
-, then this data-type descriptor is a C-style contiguous array of another
- data-type descriptor.
- In other-words, each element that this descriptor describes is actually
- an array of some other base descriptor.
- This is most useful as the data-type descriptor for a field in another
- data-type descriptor.
- The fields member should be
-\family typewriter
-NULL
-\family default
- if this is non-
-\family typewriter
-NULL
-\family default
- (the fields member of the base descriptor can be non-
-\family typewriter
-NULL
-\family default
- however).
- The
-\family typewriter
-PyArray_ArrayDescr
-\family default
- structure is defined using
-\end_layout
-
-\begin_layout LyX-Code
-typedef struct {
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_Descr
-\emph default
- *base;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyObject
-\emph default
- *shape;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\emph on
-PyArray_ArrayDescr;
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The elements of this structure are:
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-base The data-type-descriptor object of the base-type.
-
-\end_layout
-
-\begin_layout Description
-shape The shape (always C-style contiguous) of the sub-array as a Python
- tuple.
-
-\end_layout
-
-\end_deeper
-\begin_layout Description
-fields If this is non-NULL, then this data-type-descriptor has fields described
- by a Python dictionary whose keys are names (and also titles if given)
- and whose values are tuples that describe the fields.
- Recall that a data-type-descriptor always describes a fixed-length set
- of bytes.
- A field is a named sub-region of that total, fixed-length collection.
- A field is described by a tuple composed of another data-type-descriptor
- and a byte offset.
- Optionally, the tuple may contain a title which is normally a Python string.
- These tuples are placed in this dictionary keyed by name (and also title
- if given).
-
-\end_layout
-
-\begin_layout Description
-f A pointer to a structure containing functions that the type needs to implement
- internal features.
- These functions are not the same thing as the universal functions (ufuncs)
- described later.
- Their signatures can vary arbitrarily.
- Not all of these function pointers must be defined for a given type.
- The required members are
-\family typewriter
-nonzero
-\family default
-,
-\family typewriter
-copyswap
-\family default
-,
-\family typewriter
-copyswapn
-\family default
-,
-\family typewriter
-setitem
-\family default
-,
-\family typewriter
-getitem
-\family default
-, and
-\family typewriter
-cast
-\family default
-.
- These are assumed to be non-
-\family typewriter
-NULL
-\family default
- and
-\family typewriter
-NULL
-\family default
- entries will cause a program crash.
- The other functions may be
-\family typewriter
-NULL
-\family default
- which will just mean reduced functionality for that data-type.
- (Also, the nonzero function will be filled in with a default function if
- it is
-\family typewriter
-NULL
-\family default
- when you register a user-defined data-type).
-\end_layout
-
-\begin_layout LyX-Code
-typedef struct {
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
- PyArray_VectorUnaryFunc
-\emph default
-
-\emph on
-*
-\emph default
-cast[NPY_NTYPES];
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_GetItemFunc *
-\emph default
-getitem;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_SetItemFunc *
-\emph default
-setitem;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_CopySwapNFunc *
-\emph default
-copyswapn;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_CopySwapFunc *
-\emph default
-copyswap;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_CompareFunc *
-\emph default
-compare;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_ArgFunc *
-\emph default
-argmax;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_DotFunc *
-\emph default
-dotfunc;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_ScanFunc *
-\emph default
-scanfunc;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_FromStrFunc
-\emph default
- *fromstr;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_NonzeroFunc *
-\emph default
-nonzero;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_FillFunc
-\emph default
- *fill;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_FillWithScalarFunc
-\emph default
- *fillwithscalar;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_SortFunc
-\emph default
- *sort[NPY_NSORTS];
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_ArgSortFunc
-\emph default
- *argsort[NPY_NSORTS];
-\newline
-
-\emph on
-PyObject
-\emph default
- *castdict;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArray_ScalarKindFunc
-\emph default
- *scalarkind;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- **cancastscalarkindto;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- *cancastto;
-\end_layout
-
-\begin_layout LyX-Code
-
-\shape italic
-int
-\shape default
- listpickle
-\end_layout
-
-\begin_layout LyX-Code
-}
-\emph on
-PyArray_ArrFuncs
-\emph default
-;
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The concept of a behaved segment is used in the description of the function
- pointers.
- A behaved segment is one that is aligned and in native machine byte-order
- for the data-type.
- The
-\family typewriter
-nonzero
-\family default
-,
-\family typewriter
-copyswap
-\family default
-,
-\family typewriter
-copyswapn
-\family default
-,
-\family typewriter
-getitem
-\family default
-, and
-\family typewriter
-setitem
-\family default
- functions can (and must) deal with mis-behaved arrays.
- The other functions require behaved memory segments.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-cast (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-void*
-\family default
- from,
-\family typewriter
-void*
-\family default
- to,
-\family typewriter
-npy_intp
-\family default
- n,
-\family typewriter
-void*
-\family default
- fromarr,
-\family typewriter
-void*
-\family default
- toarr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- An array of function pointers to cast from the current type to all of the
- other builtin types.
- Each function casts a contiguous, aligned, and notswapped buffer pointed
- at by
-\emph on
-from
-\emph default
- to a contiguous, aligned, and notswapped buffer pointed at by
-\emph on
-to
-\emph default
- The number of items to cast is given by
-\emph on
-n
-\emph default
-, and the arguments
-\emph on
-fromarr
-\emph default
- and
-\emph on
-toarr
-\emph default
- are interpreted as PyArrayObjects for flexible arrays to get itemsize informati
-on.
-\end_layout
-
-\begin_layout Description
-getitem (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-void*
-\family default
- data,
-\family typewriter
-void*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to a function that returns a standard Python object from a single
- element of the array object
-\emph on
-arr
-\emph default
- pointed to by
-\emph on
-data
-\emph default
-.
- This function must be able to deal with
-\begin_inset Quotes eld
-\end_inset
-
-misbehaved
-\begin_inset Quotes erd
-\end_inset
-
- (misaligned and/or swapped) arrays correctly.
-
-\end_layout
-
-\begin_layout Description
-setitem (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- item,
-\family typewriter
-void*
-\family default
- data,
-\family typewriter
-void*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to a function that sets the Python object
-\emph on
-item
-\emph default
- into the array,
-\emph on
-arr
-\emph default
-, at the position pointed to by
-\emph on
-data
-\emph default
-.
- This function deals with
-\begin_inset Quotes eld
-\end_inset
-
-misbehaved
-\begin_inset Quotes erd
-\end_inset
-
- arrays.
- If successful, a zero is returned, otherwise, a negative one is returned
- (and a Python error set).
-
-\end_layout
-
-\begin_layout Description
-copyswapn (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-void*
-\family default
- dest,
-\family typewriter
-npy_intp
-\family default
- dstride,
-\family typewriter
-void*
-\family default
- src,
-\family typewriter
-npy_intp
-\family default
- sstride,
-\family typewriter
-npy_intp
-\family default
- n,
-\family typewriter
-int
-\family default
- swap, void *arr)
-\end_layout
-
-\begin_layout Description
-copyswap (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-void*
-\family default
- dest,
-\family typewriter
-void*
-\family default
- src,
-\family typewriter
-int
-\family default
- swap, void *arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These members are both pointers to functions to copy data from
-\emph on
-src
-\emph default
- to
-\emph on
-dest
-\emph default
- and
-\emph on
-swap
-\emph default
- if indicated.
- The value of arr is only used for flexible (
-\family typewriter
-NPY_STRING
-\family default
-,
-\family typewriter
-NPY_UNICODE
-\family default
-, and
-\family typewriter
-NPY_VOID
-\family default
-) arrays (and is obtained from
-\family typewriter
-arr->descr->elsize
-\family default
-).
- The second function copies a single value, while the first loops over n
- values with the provided strides.
- These functions can deal with misbehaved
-\emph on
-src
-\emph default
- data.
- If
-\emph on
-src
-\emph default
- is NULL then no copy is performed.
- If
-\emph on
-swap
-\emph default
- is 0, then no byteswapping occurs.
- It is assumed that
-\emph on
-dest
-\emph default
- and
-\emph on
-src
-\emph default
- do not overlap.
- If they overlap, then use
-\family typewriter
-memmove
-\family default
-(...) first followed by
-\family typewriter
-copyswap(n)
-\family default
- with NULL valued
-\family typewriter
-src
-\family default
-.
-\end_layout
-
-\begin_layout Description
-compare (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-const void*
-\family default
- d1,
-\family typewriter
-const void*
-\family default
- d2,
-\family typewriter
-void*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to a function that compares two elements of the array,
-\family typewriter
-arr
-\family default
-, pointed to by
-\family typewriter
-d1
-\family default
- and
-\family typewriter
-d2
-\family default
-.
- This function requires behaved arrays.
- The return value is 1 if *
-\family typewriter
-d1
-\family default
- > *
-\family typewriter
-d2
-\family default
-, 0 if *
-\family typewriter
-d1
-\family default
- == *
-\family typewriter
-d2
-\family default
-, and -1 if *
-\family typewriter
-d1
-\family default
- < *
-\family typewriter
-d2
-\family default
-.
- The array object arr is used to retrieve itemsize and field information
- for flexible arrays.
-\end_layout
-
-\begin_layout Description
-argmax (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-void*
-\family default
- data,
-\family typewriter
-npy_intp
-\family default
- n,
-\family typewriter
-npy_intp*
-\family default
- max_ind,
-\family typewriter
-void*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to a function that retrieves the index of the largest of
-\family typewriter
-n
-\family default
- elements in
-\family typewriter
-arr
-\family default
- beginning at the element pointed to by
-\family typewriter
-data
-\family default
-.
- This function requires that the memory segment be contiguous and behaved.
- The return value is always 0.
- The index of the largest element is returned in
-\family typewriter
-max_ind
-\family default
-.
-\end_layout
-
-\begin_layout Description
-dotfunc (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-void*
-\family default
- ip1,
-\family typewriter
-npy_intp
-\family default
- is1,
-\family typewriter
-void*
-\family default
- ip2,
-\family typewriter
-npy_intp
-\family default
- is2,
-\family typewriter
-void*
-\family default
- op,
-\family typewriter
-npy_intp
-\family default
- n,
-\family typewriter
-void*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to a function that multiplies two
-\family typewriter
-n
-\family default
--length sequences together, adds them, and places the result in element
- pointed to by
-\family typewriter
-op
-\family default
- of
-\family typewriter
-arr
-\family default
-.
- The start of the two sequences are pointed to by
-\family typewriter
-ip1
-\family default
- and
-\family typewriter
-ip2
-\family default
-.
- To get to the next element in each sequence requires a jump of
-\family typewriter
-is1
-\family default
- and
-\family typewriter
-is2
-\family default
-
-\emph on
-bytes
-\emph default
-, respectively.
- This function requires behaved (though not necessarily contiguous) memory.
-
-\end_layout
-
-\begin_layout Description
-scanfunc (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-FILE*
-\family default
- fd,
-\family typewriter
-void*
-\family default
- ip ,
-\family typewriter
-void*
-\family default
- sep ,
-\family typewriter
-void*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to a function that scans (scanf style) one element of the correspondi
-ng type from the file descriptor
-\family typewriter
-fd
-\family default
- into the array memory pointed to by
-\family typewriter
-ip
-\family default
-.
- The array is assumed to be behaved.
- If
-\family typewriter
-sep
-\family default
- is not NULL, then a separator string is also scanned from the file before
- returning.
- The last argument
-\family typewriter
-arr
-\family default
- is the array to be scanned into.
- A 0 is returned if the scan is successful.
- A negative number indicates something went wrong: -1 means the end of file
- was reached before the separator string could be scanned, -4 means that
- the end of file was reached before the element could be scanned, and -3
- means that the element could not be interpreted from the format string.
- Requires a behaved array.
-\end_layout
-
-\begin_layout Description
-fromstr (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-char*
-\family default
- str,
-\family typewriter
-void*
-\family default
- ip,
-\family typewriter
-char**
-\family default
- endptr,
-\family typewriter
-void*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to a function that converts the string pointed to by
-\family typewriter
-str
-\family default
- to one element of the corresponding type and places it in the memory location
- pointed to by
-\family typewriter
-ip
-\family default
-.
- After the conversion is completed,
-\family typewriter
-*endptr
-\family default
- points to the rest of the string.
- The last argument
-\family typewriter
-arr
-\family default
- is the array into which ip points (needed for variable-size data-types).
- Returns 0 on success or -1 on failure.
- Requires a behaved array.
-\end_layout
-
-\begin_layout Description
-nonzero (
-\family typewriter
-Bool
-\family default
-) (
-\family typewriter
-void*
-\family default
- data,
-\family typewriter
-void*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to a function that returns TRUE if the item of
-\family typewriter
-arr
-\family default
- pointed to by
-\family typewriter
-data
-\family default
- is nonzero.
- This function can deal with misbehaved arrays.
-
-\end_layout
-
-\begin_layout Description
-fill (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-void*
-\family default
- data,
-\family typewriter
-npy_intp
-\family default
- length,
-\family typewriter
-void*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to a function that fills a contiguous array of given length with
- data.
- The first two elements of the array must already be filled-in.
- From these two values, a delta will be computed and the values from item
- 3 to the end will be computed by repeatedly adding this computed delta.
- The data buffer must be well-behaved.
-\end_layout
-
-\begin_layout Description
-fillwithscalar (
-\family typewriter
-void
-\family default
-)(
-\family typewriter
-void*
-\family default
- buffer,
-\family typewriter
-npy_intp
-\family default
- length,
-\family typewriter
-void*
-\family default
- value,
-\family typewriter
-void*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to a function that fills a contiguous
-\family typewriter
-buffer
-\family default
- of the given
-\family typewriter
-length
-\family default
- with a single scalar
-\family typewriter
-value
-\family default
- whose address is given.
- The final argument is the array which is needed to get the itemsize for
- variable-length arrays.
-
-\end_layout
-
-\begin_layout Description
-sort (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-void*
-\family default
- start,
-\family typewriter
-npy_intp
-\family default
- length,
-\family typewriter
-void*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- An array of function pointers to a particular sorting algorithms.
- A particular sorting algorithm is obtained using a key (so far
-\family typewriter
-NPY_QUICKSORT
-\family default
-,
-\family typewriter
-NPY_HEAPSORT
-\family default
-, and
-\family typewriter
-NPY_MERGESORT
-\family default
- are defined).
- These sorts are done in-place assuming contiguous and aligned data.
-
-\end_layout
-
-\begin_layout Description
-argsort (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-void*
-\family default
- start,
-\family typewriter
-npy_intp*
-\family default
- result,
-\family typewriter
-npy_intp
-\family default
- length, void *arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- An array of function pointers to sorting algorithms for this data type.
- The same sorting algorithms as for sort are available.
- The indices producing the sort are returned in result (which must be initialize
-d with indices 0 to length-1 inclusive).
-
-\end_layout
-
-\begin_layout Description
-castdict
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Either
-\family typewriter
-NULL
-\family default
- or a dictionary containing low-level casting functions for user-defined
- data-types.
- Each function is wrapped in a
-\family typewriter
-PyCObject*
-\family default
- and keyed by the data-type number.
-
-\end_layout
-
-\begin_layout Description
-scalarkind (
-\family typewriter
-NPY_SCALARKIND
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A function to determine how scalars of this type should be interpreted.
- The argument is
-\family typewriter
-NULL
-\family default
- or a 0-dimensional array containing the data (if that is needed to determine
- the kind of scalar).
- The return value must be of type
-\family typewriter
-NPY_SCALARKIND
-\family default
-.
-
-\end_layout
-
-\begin_layout Description
-cancastscalarkindto
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Either
-\family typewriter
-NULL
-\family default
- or an array of
-\family typewriter
-NPY_NSCALARKINDS
-\family default
- pointers.
- These pointers should each be either
-\family typewriter
-NULL
-\family default
- or a pointer to an array of integers (terminated by
-\family typewriter
-NPY_NOTYPE
-\family default
-) indicating data-types that a scalar of this data-type of the specified
- kind can be cast to safely (this usually means without losing precision).
-\end_layout
-
-\begin_layout Description
-cancastto
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Either
-\family typewriter
-NULL
-\family default
- or an array of integers (terminated by
-\family typewriter
-NPY_NOTYPE
-\family default
-) indicated data-types that this data-type can be cast to safely (this usually
- means without losing precision).
-\end_layout
-
-\begin_layout Description
-listpickle
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Unused.
-\end_layout
-
-\end_deeper
-\begin_layout Standard
-The
-\family typewriter
-PyArray_Type
-\family default
- typeobject implements many of the features of Python objects including
- the tp_as_number, tp_as_sequence, tp_as_mapping, and tp_as_buffer interfaces.
- The rich comparison (tp_richcompare) is also used along with new-style
- attribute lookup for methods (tp_methods) and properties (tp_getset).
- The
-\family typewriter
-PyArray_Type
-\family default
- can also be sub-typed.
-
-\end_layout
-
-\begin_layout Tip
-The tp_as_number methods use a generic approach to call whatever function
- has been registered for handling the operation.
- The function PyNumeric_SetOps(..) can be used to register functions to handle
- particular mathematical operations (for all arrays).
- When the umath module is imported, it sets the numeric operations for all
- arrays to the corresponding ufuncs.
-
-\newline
-The tp_str and tp_repr methods can also be altered using PyString_SetStringFunc
-tion(...).
-\end_layout
-
-\begin_layout Subsection
-PyUFunc_Type
-\end_layout
-
-\begin_layout Standard
-The ufunc object is implemented by creation of the
-\family typewriter
-PyUFunc_Type
-\family default
-
-\begin_inset LatexCommand index
-name "PyUFunc\\_Type"
-
-\end_inset
-
-.
- It is a very simple type that implements only basic getattribute behavior,
- printing behavior, and has call behavior which allows these objects to
- act like functions.
- The basic idea behind the ufunc is to hold a reference to fast 1-dimensional
- (vector) loops for each data type that supports the operation.
- These one-dimensional loops all have the same signature and are the key
- to creating a new ufunc.
- They are called by the generic looping code as appropriate to implement
- the N-dimensional function.
- There are also some generic 1-d loops defined for floating and complexfloating
- arrays that allow you to define a ufunc using a single scalar function
- (
-\emph on
-e.g.
-
-\emph default
- atanh).
-
-\end_layout
-
-\begin_layout Standard
-The core of the ufunc is the
-\family typewriter
-PyUFuncObject
-\family default
- which contains all the information needed to call the underlying C-code
- loops that perform the actual work.
- It has the following structure.
-
-\end_layout
-
-\begin_layout LyX-Code
-typedef struct {
-\end_layout
-
-\begin_layout LyX-Code
- PyObject_HEAD
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- nin;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- nout;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- nargs;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- identity;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyUFuncGenericFunction *
-\emph default
-functions;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-void **
-\emph default
-data;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- ntypes;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- check_return;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-char *
-\emph default
-name;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-char *
-\emph default
-types;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-char *
-\emph default
-doc;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-void *
-\emph default
-ptr;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyObject *
-\emph default
-obj;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyObject *
-\emph default
-userloops;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\emph on
-PyUFuncObject
-\emph default
-;
-\end_layout
-
-\begin_layout Description
-PyObject_HEAD required for all Python objects.
-\end_layout
-
-\begin_layout Description
-nin The number of input arguments.
-\end_layout
-
-\begin_layout Description
-nout The number of output arguments.
-\end_layout
-
-\begin_layout Description
-nargs The total number of arguments (
-\emph on
-nin
-\emph default
-+
-\emph on
-nout
-\emph default
-).
- This must be less than
-\family typewriter
-NPY_MAXARGS
-\family default
-.
-\end_layout
-
-\begin_layout Description
-identity Either
-\family typewriter
-PyUFunc_One
-\family default
-,
-\family typewriter
-PyUFunc_Zero
-\family default
-, or
-\family typewriter
-PyUFunc_None
-\family default
- to indicate the identity for this operation.
- It is only used for a reduce-like call on an empty array.
-\end_layout
-
-\begin_layout Description
-functions (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- extradata )
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- An array of function pointers --- one for each data type supported by the
- ufunc.
- This is the vector loop that is called to implement the underlying function
-
-\emph on
-dims
-\emph default
-[0] times.
- The first argument,
-\emph on
-args
-\emph default
-, is an array of
-\emph on
-nargs
-\emph default
- pointers to behaved memory.
- Pointers to the data for the input arguments are first, followed by the
- pointers to the data for the output arguments.
- How many bytes must be skipped to get to the next element in the sequence
- is specified by the corresponding entry in the
-\emph on
-steps
-\emph default
- array.
- The last argument allows the loop to receive extra information.
- This is commonly used so that a single, generic vector loop can be used
- for multiple functions.
- In this case, the actual scalar function to call is passed in as
-\emph on
-extradata
-\emph default
-.
- The size of this function pointer array is ntypes.
-
-\end_layout
-
-\begin_layout Description
-data Extra data to be passed to the 1-d vector loops or
-\family typewriter
-NULL
-\family default
- if no extra-data is needed.
- This C-array must be the same size (
-\emph on
-i.e.
-
-\emph default
- ntypes) as the functions array.
-
-\family typewriter
-NULL
-\family default
- is used if extra_data is not needed.
- Several C-API calls for UFuncs are just 1-d vector loops that make use
- of this extra data to receive a pointer to the actual function to call.
-
-\end_layout
-
-\begin_layout Description
-ntypes The number of supported data types for the ufunc.
- This number specifies how many different 1-d loops (of the builtin data
- types) are available.
-
-\end_layout
-
-\begin_layout Description
-check_return Obsolete and unused.
- However, it is set by the corresponding entry in the main ufunc creation
- routine:
-\family typewriter
-PyUFunc_FromFuncAndData
-\family default
-(...).
-\end_layout
-
-\begin_layout Description
-name A string name for the ufunc.
- This is used dynamically to build the __doc__ attribute of ufuncs.
-\end_layout
-
-\begin_layout Description
-types An array of
-\emph on
-nargs
-\series bold
-\emph default
-
-\begin_inset Formula $\times$
-\end_inset
-
-
-\series default
-\emph on
-ntypes
-\emph default
- 8-bit type_numbers which contains the type signature for the function for
- each of the supported (builtin) data types.
- For each of the
-\emph on
-ntypes
-\emph default
- functions, the corresponding set of type numbers in this array shows how
- the
-\emph on
-args
-\emph default
- argument should be interpreted in the 1-d vector loop.
- These type numbers do not have to be the same type and mixed-type ufuncs
- are supported.
-
-\end_layout
-
-\begin_layout Description
-doc Documentation for the ufunc.
- Should not contain the function signature as this is generated dynamically
- when __doc__ is retrieved.
-\end_layout
-
-\begin_layout Description
-ptr Any dynamically allocated memory.
- Currently, this is used for dynamic ufuncs created from a python function
- to store room for the types, data, and name members.
-\end_layout
-
-\begin_layout Description
-obj For ufuncs dynamically created from python functions, this member holds
- a reference to the underlying Python function.
-\end_layout
-
-\begin_layout Description
-userloops A dictionary of user-defined 1-d vector loops (stored as CObject
- ptrs) for user-defined types.
- A loop may be registered by the user for any user-defined type.
- It is retrieved by type number.
- User defined type numbers are always larger than
-\family typewriter
-NPY_USERDEF
-\family default
-.
-
-\end_layout
-
-\begin_layout Subsection
-PyArrayIter_Type
-\end_layout
-
-\begin_layout Standard
-This
-\begin_inset LatexCommand index
-name "PyArrayIter\\_Type"
-
-\end_inset
-
- is an iterator object that makes it easy to loop over an N-dimensional
- array.
- It is the object returned from the flat attribute of an ndarray.
- It is also used extensively throughout the implementation internals to
- loop over an N-dimensional array.
- The tp_as_mapping interface is implemented so that the iterator object
- can be indexed (using 1-d indexing), and a few methods are implemented
- through the tp_methods table.
- This object implements the next method and can be used anywhere an iterator
- can be used in Python.
-\end_layout
-
-\begin_layout Standard
-The C-structure corresponding to an object of
-\family typewriter
-PyArrayIter_Type
-\family default
- is the
-\family typewriter
-PyArrayIterObject
-\family default
-.
- The
-\family typewriter
-PyArrayIterObject
-\family default
- is used to keep track of a pointer into an N-dimensional array.
- It contains associated information used to quickly march through the array.
- The pointer can be adjusted in three basic ways: 1) advance to the
-\begin_inset Quotes eld
-\end_inset
-
-next
-\begin_inset Quotes erd
-\end_inset
-
- position in the array in a C-style contiguous fashion, 2) advance to an
- arbitrary N-dimensional coordinate in the array, and 3) advance to an arbitrary
- one-dimensional index into the array.
- The members of the
-\family typewriter
-PyArrayIterObject
-\family default
- structure are used in these calculations.
- Iterator objects keep their own dimension and strides information about
- an array.
- This can be adjusted as needed for
-\begin_inset Quotes eld
-\end_inset
-
-broadcasting,
-\begin_inset Quotes erd
-\end_inset
-
- or to loop over only specific dimensions.
-
-\end_layout
-
-\begin_layout LyX-Code
-typedef struct {
-\end_layout
-
-\begin_layout LyX-Code
- PyObject_HEAD
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- nd_m1;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp
-\emph default
- index;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp
-\emph default
- size;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp
-\emph default
- coordinates
-\emph on
-[NPY_MAXDIMS]
-\emph default
-;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp
-\emph default
- dims_m1
-\emph on
-[NPY_MAXDIMS]
-\emph default
-;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp
-\emph default
- strides
-\emph on
-[NPY_MAXDIMS]
-\emph default
-;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp
-\emph default
- backstrides
-\emph on
-[NPY_MAXDIMS]
-\emph default
-;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp
-\emph default
- factors
-\emph on
-[NPY_MAXDIMS]
-\emph default
-;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArrayObject *
-\emph default
-ao;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-char *
-\emph default
-dataptr;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-Bool
-\emph default
- contiguous;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\emph on
-PyArrayIterObject
-\emph default
-;
-\end_layout
-
-\begin_layout Description
-nd_m1
-\begin_inset Formula $N-1$
-\end_inset
-
- where
-\begin_inset Formula $N$
-\end_inset
-
- is the number of dimensions in the underlying array.
-\end_layout
-
-\begin_layout Description
-index The current 1-d index into the array.
-\end_layout
-
-\begin_layout Description
-size The total size of the underlying array.
-\end_layout
-
-\begin_layout Description
-coordinates An
-\begin_inset Formula $N$
-\end_inset
-
--dimensional index into the array.
-\end_layout
-
-\begin_layout Description
-dims_m1 The size of the array minus 1 in each dimension.
-\end_layout
-
-\begin_layout Description
-strides The strides of the array.
- How many bytes needed to jump to the next element in each dimension.
-
-\end_layout
-
-\begin_layout Description
-backstrides How many bytes needed to jump from the end of a dimension back
- to its beginning.
- Note that
-\emph on
-backstrides
-\emph default
-[k]=
-\emph on
-strides
-\emph default
-[k]*d
-\emph on
-ims_m1
-\emph default
-[k], but it is stored here as an optimization.
-\end_layout
-
-\begin_layout Description
-factors This array is used in computing an N-d index from a 1-d index.
- It contains needed products of the dimensions.
-
-\end_layout
-
-\begin_layout Description
-ao A pointer to the underlying ndarray this iterator was created to represent.
-\end_layout
-
-\begin_layout Description
-dataptr This member points to an element in the ndarray indicated by the
- index.
-\end_layout
-
-\begin_layout Description
-contiguous This flag is true if the underlying array is
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
-.
- It is used to simplify calculations when possible.
-
-\end_layout
-
-\begin_layout Standard
-How to use an array iterator on a C-level is explained more fully in later
- sections.
- Typically, you do not need to concern yourself with the internal structure
- of the iterator object, and merely interact with it through the use of
- the macros
-\family typewriter
-PyArray_ITER_NEXT
-\family default
-(it),
-\family typewriter
-PyArray_ITER_GOTO
-\family default
-(it, dest), or
-\family typewriter
-PyArray_ITER_GOTO1D
-\family default
-(it, index).
- All of these macros require the argument
-\emph on
-it
-\emph default
- to be a
-\family typewriter
-PyArrayIterObject*
-\family default
-.
-
-\end_layout
-
-\begin_layout Subsection
-PyArrayMultiIter_Type
-\end_layout
-
-\begin_layout Standard
-This type provides an iterator that encapsulates the concept of broadcasting.
- It allows
-\begin_inset Formula $N$
-\end_inset
-
- arrays to be broadcast together so that the loop progresses in C-style
- contiguous fashion over the broadcasted array.
- The corresponding C-structure is the
-\family typewriter
-PyArrayMultiIterObject
-\family default
- whose memory layout must begin any object,
-\emph on
-obj
-\emph default
-, passed in to the
-\family typewriter
-PyArray_Broadcast
-\family default
-(obj) function.
- Broadcasting is performed by adjusting array iterators so that each iterator
- represents the broadcasted shape and size, but has its strides adjusted
- so that the correct element from the array is used at each iteration.
-
-\end_layout
-
-\begin_layout LyX-Code
-typedef struct {
-\end_layout
-
-\begin_layout LyX-Code
- PyObject_HEAD
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- numiter;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp
-\emph default
- size;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp
-\emph default
- index;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- nd;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp
-\emph default
- dimensions
-\emph on
-[NPY_MAXDIMS]
-\emph default
-;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyArrayIterObject *
-\emph default
-iters
-\emph on
-[NPY_MAXDIMS]
-\emph default
-;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\emph on
-PyArrayMultiIterObject
-\emph default
-;
-\end_layout
-
-\begin_layout Description
-PyObject_HEAD Needed at the start of every Python object (holds reference
- count and type identification).
-\end_layout
-
-\begin_layout Description
-numiter The number of arrays that need to be broadcast to the same shape.
-\end_layout
-
-\begin_layout Description
-size The total broadcasted size.
-\end_layout
-
-\begin_layout Description
-index The current (1-d) index into the broadcasted result.
-\end_layout
-
-\begin_layout Description
-nd The number of dimensions in the broadcasted result.
-\end_layout
-
-\begin_layout Description
-dimensions The shape of the broadcasted result (only
-\family typewriter
-nd
-\family default
- slots are used).
-\end_layout
-
-\begin_layout Description
-iters An array of iterator objects that holds the iterators for the arrays
- to be broadcast together.
- On return, the iterators are adjusted for broadcasting.
-
-\end_layout
-
-\begin_layout Subsection
-PyArrayFlags_Type
-\end_layout
-
-\begin_layout Standard
-When the flags attribute is retrieved from Python, a special builtin object
- of this type is constructed.
- This special type makes it easier to work with the different flags by accessing
- them as attributes or by accessing them as if the object were a dictionary
- with the flag names as entries.
-
-\end_layout
-
-\begin_layout Subsection
-ScalarArrayTypes
-\end_layout
-
-\begin_layout Standard
-There is a Python type for each of the different built-in data types that
- can be present in the array Most of these are simple wrappers around the
- corresponding data type in C.
- The C-names for these types are
-\series bold
-Py
-\series default
-<TYPE>
-\series bold
-ArrType_Type
-\series default
- where <TYPE> can be
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-Bool
-\series default
-,
-\series bold
-Byte
-\series default
-,
-\series bold
-Short
-\series default
-,
-\series bold
-Int
-\series default
-,
-\series bold
-Long
-\series default
-,
-\series bold
-LongLong
-\series default
-,
-\series bold
-UByte
-\series default
-,
-\series bold
-UShort
-\series default
-,
-\series bold
-UInt
-\series default
-,
-\series bold
-ULong
-\series default
-,
-\series bold
-ULongLong
-\series default
-,
-\series bold
-Float
-\series default
-,
-\series bold
-Double
-\series default
-,
-\series bold
-LongDouble
-\series default
-,
-\series bold
-CFloat
-\series default
-,
-\series bold
-CDouble
-\series default
-,
-\series bold
-CLongDouble
-\series default
-,
-\series bold
-String
-\series default
-,
-\series bold
-Unicode
-\series default
-,
-\series bold
-Void
-\series default
-, and
-\series bold
-Object
-\series default
-.
-
-\end_layout
-
-\begin_layout Standard
-These type names are part of the C-API and can therefore be created in extension
- C-code.
- There is also a
-\family typewriter
-PyIntpArrType_Type
-\family default
- and a
-\family typewriter
-PyUIntpArrType_Type
-\family default
- that are simple substitutes for one of the integer types that can hold
- a pointer on the platform.
- The structure of these scalar objects is not exposed to C-code.
- The function
-\family typewriter
-PyArray_ScalarAsCtype
-\family default
-(..) can be used to extract the C-type value from the array scalar and the
- function
-\family typewriter
-PyArray_Scalar
-\family default
-(...) can be used to construct an array scalar from a C-value.
-
-\end_layout
-
-\begin_layout Section
-Other C-Structures
-\end_layout
-
-\begin_layout Standard
-A few new C-structures were found to be useful in the development of NumPy.
- These C-structures are used in at least one C-API call and are therefore
- documented here.
- The main reason these structures were defined is to make it easy to use
- the Python ParseTuple C-API to convert from Python objects to a useful
- C-Object.
-
-\end_layout
-
-\begin_layout Subsection
-PyArray_Dims
-\end_layout
-
-\begin_layout Standard
-This structure is very useful when shape and/or strides information is supposed
- to be interpreted.
- The structure is
-\end_layout
-
-\begin_layout LyX-Code
-typedef struct {
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp *
-\emph default
-ptr;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- len;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\emph on
-PyArray_Dims
-\emph default
-;
-\end_layout
-
-\begin_layout Standard
-The members of this structure are
-\end_layout
-
-\begin_layout Description
-ptr A pointer to a list of (
-\family typewriter
-npy_intp
-\family default
-) integers which usually represent array shape or array strides.
-
-\end_layout
-
-\begin_layout Description
-len The length of the list of integers.
- It is assumed safe to access
-\emph on
-ptr
-\emph default
-[0] to
-\emph on
-ptr
-\emph default
-[len-1].
-
-\end_layout
-
-\begin_layout Subsection
-PyArray_Chunk
-\end_layout
-
-\begin_layout Standard
-This is equivalent to the buffer object structure in Python up to the ptr
- member.
- On 32-bit platforms (
-\emph on
-i.e.
-
-\emph default
- if
-\family typewriter
-NPY_SIZEOF_INT
-\family default
-==
-\family typewriter
-NPY_SIZEOF_INTP
-\family default
-) or in Python 2.5, the len member also matches an equivalent member of the
- buffer object.
- It is useful to represent a generic single-segment chunk of memory.
-
-\end_layout
-
-\begin_layout LyX-Code
-typedef struct {
-\end_layout
-
-\begin_layout LyX-Code
- PyObject_HEAD
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-PyObject *
-\emph default
-base;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-void *
-\emph default
-ptr;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp
-\emph default
- len;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- flags;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\emph on
-PyArray_Chunk
-\emph default
-;
-\end_layout
-
-\begin_layout Standard
-The members are
-\end_layout
-
-\begin_layout Description
-PyObject_HEAD Necessary for all Python objects.
- Included here so that the
-\family typewriter
-PyArray_Chunk
-\family default
- structure matches that of the buffer object (at least to the len member).
-
-\end_layout
-
-\begin_layout Description
-base The Python object this chunk of memory comes from.
- Needed so that memory can be accounted for properly.
-\end_layout
-
-\begin_layout Description
-ptr A pointer to the start of the single-segment chunk of memory.
-
-\end_layout
-
-\begin_layout Description
-len The length of the segment in bytes.
-\end_layout
-
-\begin_layout Description
-flags Any data flags (
-\emph on
-e.g.
-
-\emph default
-
-\family typewriter
-NPY_WRITEABLE
-\family default
-) that should be used to interpret the memory.
-
-\end_layout
-
-\begin_layout Subsection
-PyArrayInterface
-\end_layout
-
-\begin_layout Standard
-The
-\family typewriter
-PyArrayInterface
-\family default
-
-\begin_inset LatexCommand index
-name "PyArrayInterface"
-
-\end_inset
-
- structure is defined so that NumPy and other extension modules can use
- the rapid array interface protocol.
- The
-\series bold
-__array_struct__
-\series default
- method of an object that supports the rapid array interface protocol should
- return a
-\family typewriter
-PyCObject
-\family default
- that contains a pointer to a
-\family typewriter
-PyArrayInterface
-\family default
- structure with the relevant details of the array.
- After the new array is created, the attribute should be
-\family typewriter
-DECREF
-\family default
-'d which will free the
-\family typewriter
-PyArrayInterface
-\family default
- structure.
- Remember to
-\family typewriter
-INCREF
-\family default
- the object (whose
-\series bold
-__array_struct__
-\series default
- attribute was retrieved) and point the base member of the new
-\family typewriter
-PyArrayObject
-\family default
- to this same object.
- In this way the memory for the array will be managed correctly.
-
-\end_layout
-
-\begin_layout LyX-Code
-typedef struct {
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- two;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- nd;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-char
-\emph default
- typekind;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- itemsize;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-int
-\emph default
- flags;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp *
-\emph default
-shape;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-npy_intp *
-\emph default
-strides;
-\end_layout
-
-\begin_layout LyX-Code
-
-\emph on
-void *
-\emph default
-data;
-\end_layout
-
-\begin_layout LyX-Code
- PyObject *descr;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\emph on
-PyArrayInterface
-\emph default
-;
-\end_layout
-
-\begin_layout Description
-two the integer 2 as a sanity check.
-\end_layout
-
-\begin_layout Description
-nd the number of dimensions in the array.
-\end_layout
-
-\begin_layout Description
-typekind A character indicating what kind of array is present according
- to the typestring convention with 't' -> bitfield, 'b' -> Boolean, 'i'
- -> signed integer, 'u' -> unsigned integer, 'f' -> floating point, 'c'
- -> complex floating point, 'O' -> object, 'S' -> string, 'U' -> unicode,
- 'V' -> void.
-\end_layout
-
-\begin_layout Description
-itemsize the number of bytes each item in the array requires.
-\end_layout
-
-\begin_layout Description
-flags any of the bits
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
- (1),
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- (2),
-\family typewriter
-NPY_ALIGNED
-\family default
- (0x100),
-\family typewriter
-NPY_NOTSWAPPED
-\family default
- (0x200), or
-\family typewriter
-NPY_WRITEABLE
-\family default
- (0x400) to indicate something about the data.
- The
-\family typewriter
-NPY_ALIGNED
-\family default
-,
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
-, and
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- flags can actually be determined from the other parameters.
- The flag
-\family typewriter
-NPY_ARR_HAS_DESCR
-\family default
- (0x800) can also be set to indicate to objects consuming the version 3
- array interface that the descr member of the structure is present (it will
- be ignored by objects consuming version 2 of the array interface).
-
-\end_layout
-
-\begin_layout Description
-shape An array containing the size of the array in each dimension.
-\end_layout
-
-\begin_layout Description
-strides An array containing the number of bytes to jump to get to the next
- element in each dimension.
-\end_layout
-
-\begin_layout Description
-data A pointer
-\emph on
-to
-\emph default
- the first element of the array.
-\end_layout
-
-\begin_layout Description
-descr A Python object describing the data-type in more detail (currently
- an array_description list of tuples).
- This can be
-\family typewriter
-NULL
-\family default
- if
-\emph on
-typekind
-\emph default
- and
-\emph on
-itemsize
-\emph default
- provide enough information.
-
-\end_layout
-
-\begin_layout Subsection
-Internally used structures
-\end_layout
-
-\begin_layout Standard
-Internally, the code uses some additional Python objects primarily for memory
- management.
- These types are not accessible directly from Python, and are not exposed
- to the C-API.
- They are included here only for completeness and assistance in understanding
- the code.
-
-\end_layout
-
-\begin_layout Subsubsection
-PyUFuncLoopObject
-\end_layout
-
-\begin_layout Standard
-A loose wrapper for a C-structure that contains the information needed for
- looping.
- This is useful if you are trying to understand the ufunc looping code.
- The
-\family typewriter
-PyUFuncLoopObject
-\family default
- is the associated C-structure.
- It is defined in the
-\family typewriter
-ufuncobject.h
-\family default
- header.
-\end_layout
-
-\begin_layout Subsubsection
-PyUFuncReduceObject
-\end_layout
-
-\begin_layout Standard
-A loose wrapper for the C-structure that contains the information needed
- for reduce-like methods of ufuncs.
- This is useful if you are trying to understand the reduce, accumulate,
- and reduce-at code.
- The
-\family typewriter
-PyUFuncReduceObject
-\family default
- is the associated C-structure.
- It is defined in the
-\family typewriter
-ufuncobject.h
-\family default
- header.
-\end_layout
-
-\begin_layout Subsubsection
-PyUFunc_Loop1d
-\end_layout
-
-\begin_layout Standard
-A simple linked-list of C-structures containing the information needed to
- define a 1-d loop for a ufunc for every defined signature of a user-defined
- data-type.
-
-\end_layout
-
-\begin_layout Subsubsection
-PyArrayMapIter_Type
-\end_layout
-
-\begin_layout Standard
-Advanced indexing is handled with this Python type.
- It is simply a loose wrapper around the C-structure containing the variables
- needed for advanced array indexing.
- The associated C-structure,
-\family typewriter
-PyArrayMapIterObject
-\family default
-, is useful if you are trying to understand the advanced-index mapping code.
- It is defined in the
-\family typewriter
-arrayobject.h
-\family default
- header.
- This type is not exposed to Python and could be replaced with a C-structure.
- As a Python type it takes advantage of reference-counted memory management.
-\end_layout
-
-\begin_layout Chapter
-Complete API
-\end_layout
-
-\begin_layout Quotation
-The test of a first-rate intelligence is the ability to hold two opposed
- ideas in the mind at the same time, and still retain the ability to function.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-F.
- Scott Fitzgerald
-\end_layout
-
-\begin_layout Quotation
-For a successful technology, reality must take precedence over public relations,
- for Nature cannot be fooled.
-
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Richard P.
- Feynman
-\end_layout
-
-\begin_layout Section
-Configuration defines
-\end_layout
-
-\begin_layout Standard
-When NumPy is built, a configuration file is constructed and placed as config.h
- in the NumPy include directory.
- This configuration file ensures that specific macros are defined and defines
- other macros based on whether or not your system has certain features.
- It is included by the arrayobject.h file.
-
-\end_layout
-
-\begin_layout Subsection
-Guaranteed to be defined
-\end_layout
-
-\begin_layout Standard
-The
-\series bold
-SIZEOF_
-\series default
-<CTYPE> constants are defined so that sizeof information is available to
- the pre-processor.
-
-\end_layout
-
-\begin_layout Description
-CHAR_BIT The number of bits of a char.
- The char is the unit of all sizeof definitions
-\end_layout
-
-\begin_layout Description
-SIZEOF_SHORT sizeof(short)
-\end_layout
-
-\begin_layout Description
-SIZEOF_INT sizeof(int)
-\end_layout
-
-\begin_layout Description
-SIZEOF_LONG sizeof(long)
-\end_layout
-
-\begin_layout Description
-SIZEOF_LONG_LONG sizeof(longlong) where longlong is defined appropriately
- on the platform (A macro defines
-\series bold
-SIZEOF_LONGLONG
-\series default
- as well.)
-\end_layout
-
-\begin_layout Description
-SIZEOF_PY_LONG_LONG
-\end_layout
-
-\begin_layout Description
-SIZEOF_FLOAT sizeof(float)
-\end_layout
-
-\begin_layout Description
-SIZEOF_DOUBLE sizeof(double)
-\end_layout
-
-\begin_layout Description
-SIZEOF_LONG_DOUBLE sizeof(longdouble) (A macro defines
-\series bold
-SIZEOF_LONGDOUBLE
-\series default
- as well.)
-\end_layout
-
-\begin_layout Description
-SIZEOF_PY_INTPTR_T Size of a pointer on this platform (sizeof(void *)) (A
- macro defines SIZEOF_INTP as well.)
-\end_layout
-
-\begin_layout Subsection
-Possible defines
-\end_layout
-
-\begin_layout Standard
-These defines will cause the compilation to ignore compatibility code that
- is placed in NumPy and use the system code instead.
- If they are not defined, then the system does not have that capability.
-\end_layout
-
-\begin_layout Description
-HAVE_LONGDOUBLE_FUNCS System has C99 long double math functions.
-\end_layout
-
-\begin_layout Description
-HAVE_FLOAT_FUNCS System has C99 float math functions.
-\end_layout
-
-\begin_layout Description
-HAVE_INVERSE_HYPERBOLIC System has inverse hyperbolic functions: asinh,
- acosh, and atanh.
-\end_layout
-
-\begin_layout Description
-HAVE_INVERSE_HYPERBOLIC_FLOAT System has C99 float extensions to inverse
- hyperbolic functions: asinhf, acoshf, atanhf
-\end_layout
-
-\begin_layout Description
-HAVE_INVERSE_HYPERBOLIC_LONGDOUBLE System has C99 long double extensions
- to inverse hyperbolic functions: asinhl, acoshl, atanhl.
-\end_layout
-
-\begin_layout Description
-HAVE_ISNAN System has an isnan function.
-\end_layout
-
-\begin_layout Description
-HAVE_ISINF System has an isinf function.
-
-\end_layout
-
-\begin_layout Description
-HAVE_LOG1P System has the log1p function:
-\begin_inset Formula $\log\left(x+1\right)$
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Description
-HAVE_EXPM1 System has the expm1 function:
-\begin_inset Formula $\exp\left(x\right)-1$
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Description
-HAVE_RINT System has the rint function.
-
-\end_layout
-
-\begin_layout Section
-Array Data Types
-\end_layout
-
-\begin_layout Standard
-The standard array can have 21 different data types (and has some support
- for adding your own types).
- These data types all have an enumerated type, an enumerated type-character,
- and a corresponding array scalar Python type object (placed in a hierarchy).
- There are also standard C typedefs to make it easier to manipulate elements
- of the given data type.
- For the numeric types, there are also bit-width equivalent C typedefs and
- named typenumbers that make it easier to select the precision desired.
-
-\end_layout
-
-\begin_layout Warning
-The names for the types in c code follows c naming conventions more closely.
- The Python names for these types follow Python conventions.
- Thus, NPY_FLOAT picks up a 32-bit float in C, but
-\begin_inset Quotes eld
-\end_inset
-
-float_
-\begin_inset Quotes erd
-\end_inset
-
- in python corresponds to a 64-bit double.
- The bit-width names can be used in both Python and C for clarity.
-\end_layout
-
-\begin_layout Subsection
-Enumerated Types
-\end_layout
-
-\begin_layout Standard
-There is a list of enumerated types defined providing the basic 21 data
- types plus some useful generic names.
- Whenever the code requires a type number, one of these enumerated types
- is requested.
- The types are all called
-\series bold
-NPY_
-\series default
-<NAME> where <NAME> can be
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-BOOL
-\series default
-,
-\series bold
-BYTE
-\series default
-,
-\series bold
-UBYTE
-\series default
-,
-\series bold
-SHORT
-\series default
-,
-\series bold
-USHORT
-\series default
-,
-\series bold
-INT
-\series default
-,
-\series bold
-UINT
-\series default
-,
-\series bold
-LONG
-\series default
-,
-\series bold
-ULONG
-\series default
-,
-\series bold
-LONGLONG
-\series default
-,
-\series bold
-ULONGLONG
-\series default
-,
-\series bold
-FLOAT
-\series default
-,
-\series bold
-DOUBLE
-\series default
-,
-\series bold
-LONGDOUBLE
-\series default
-,
-\series bold
-CFLOAT
-\series default
-,
-\series bold
-CDOUBLE
-\series default
-,
-\series bold
-CLONGDOUBLE
-\series default
-,
-\series bold
-OBJECT
-\series default
-,
-\series bold
-STRING
-\series default
-,
-\series bold
-UNICODE
-\series default
-,
-\series bold
-VOID
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-NTYPES
-\series default
-,
-\series bold
-NOTYPE
-\series default
-,
-\series bold
-USERDEF
-\series default
-,
-\series bold
-DEFAULT_TYPE
-\end_layout
-
-\begin_layout Standard
-The various character codes indicating certain types are also part of an
- enumerated list.
- References to type characters (should they be needed at all) should always
- use these enumerations.
- The form of them is
-\series bold
-NPY_
-\series default
-<NAME>
-\series bold
-LTR
-\series default
- where <NAME> can be
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-BOOL
-\series default
-,
-\series bold
-BYTE
-\series default
-,
-\series bold
-UBYTE
-\series default
-,
-\series bold
-SHORT
-\series default
-,
-\series bold
-USHORT
-\series default
-,
-\series bold
-INT
-\series default
-,
-\series bold
-UINT
-\series default
-,
-\series bold
-LONG
-\series default
-,
-\series bold
-ULONG
-\series default
-,
-\series bold
-LONGLONG
-\series default
-,
-\series bold
-ULONGLONG
-\series default
-,
-\series bold
-FLOAT
-\series default
-,
-\series bold
-DOUBLE
-\series default
-,
-\series bold
-LONGDOUBLE
-\series default
-,
-\series bold
-CFLOAT
-\series default
-,
-\series bold
-CDOUBLE
-\series default
-,
-\series bold
-CLONGDOUBLE
-\series default
-,
-\series bold
-OBJECT
-\series default
-,
-\series bold
-STRING
-\series default
-,
-\series bold
-VOID
-\series default
-
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-INTP
-\series default
-,
-\series bold
-UINTP
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-GENBOOL
-\series default
-,
-\series bold
-SIGNED
-\series default
-,
-\series bold
-UNSIGNED
-\series default
-,
-\series bold
-FLOATING
-\series default
-,
-\series bold
-COMPLEX
-\end_layout
-
-\begin_layout Standard
-The latter group of <NAME>s corresponds to letters used in the array interface
- typestring specification.
-
-\end_layout
-
-\begin_layout Subsection
-Defines
-\end_layout
-
-\begin_layout Subsubsection
-Max and min values for integers
-\end_layout
-
-\begin_layout Description
-NPY_MAX_INT
-\series medium
-<bits>
-\end_layout
-
-\begin_layout Description
-NPY_MAX_UINT
-\series medium
-<bits>
-\end_layout
-
-\begin_layout Description
-NPY_MIN_INT
-\series medium
-<bits>
-\series default
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These are defined for <bits> = 8, 16, 32, 64, 128, and 256 and provide
- the maximum (minimum) value of the corresponding (unsigned) integer type.
- Note: the actual integer type may not be available on all platforms (i.e.
- 128-bit and 256-bit integers are rare).
-
-\end_layout
-
-\begin_layout Description
-NPY_MIN_
-\series medium
-<type>
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is defined for <type> =
-\series bold
-BYTE
-\series default
-,
-\series bold
-SHORT
-\series default
-,
-\series bold
-INT
-\series default
-,
-\series bold
-LONG
-\series default
-,
-\series bold
-LONGLONG
-\series default
-,
-\series bold
-INTP
-\end_layout
-
-\begin_layout Description
-NPY_MAX_
-\series medium
-<type>
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is defined for all defined for <type> =
-\series bold
-BYTE
-\series default
-,
-\series bold
-UBYTE
-\series default
-,
-\series bold
-SHORT
-\series default
-,
-\series bold
-USHORT
-\series default
-,
-\series bold
-INT
-\series default
-,
-\series bold
-UINT
-\series default
-,
-\series bold
-LONG
-\series default
-,
-\series bold
-ULONG
-\series default
-,
-\series bold
-LONGLONG
-\series default
-,
-\series bold
-ULONGLONG
-\series default
-,
-\series bold
-INTP
-\series default
-,
-\series bold
-UINTP
-\end_layout
-
-\begin_layout Subsubsection
-Number of bits in data types
-\end_layout
-
-\begin_layout Standard
-All
-\series bold
-NPY_SIZEOF_
-\series default
-<CTYPE> constants have corresponding
-\series bold
-NPY_BITSOF_
-\series default
-<CTYPE> constants defined.
- The
-\series bold
-NPY_BITSOF_
-\series default
-<CTYPE> constants provide the number of bits in the data type.
- Specifically, the available <CTYPE>s are
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-BOOL
-\series default
-,
-\series bold
-CHAR
-\series default
-,
-\series bold
-SHORT
-\series default
-,
-\series bold
-INT
-\series default
-,
-\series bold
-LONG
-\series default
-,
-\series bold
-LONGLONG
-\series default
-,
-\series bold
-FLOAT
-\series default
-,
-\series bold
-DOUBLE
-\series default
-,
-\series bold
-LONGDOUBLE
-\end_layout
-
-\begin_layout Subsubsection
-Bit-width references to enumerated typenums
-\end_layout
-
-\begin_layout Standard
-All of the numeric data types (integer, floating point, and complex) have
- constants that are defined to be a specific enumerated type number.
- Exactly which enumerated type a bit-width type refers to is platform dependent.
- In particular, the constants available are
-\series bold
-PyArray_
-\series default
-<NAME><BITS> where <NAME> is
-\series bold
-INT
-\series default
-,
-\series bold
-UINT
-\series default
-,
-\series bold
-FLOAT
-\series default
-,
-\series bold
-COMPLEX
-\series default
- and <BITS> can be 8, 16, 32, 64, 80, 96, 128, 160, 192, 256, and 512.
- Obviously not all bit-widths are available on all platforms for all the
- kinds of numeric types.
- Commonly 8-, 16-, 32-, 64-bit integers; 32-, 64-bit floats; and 64-, 128-bit
- complex types are available.
-
-\end_layout
-
-\begin_layout Subsubsection
-Integer that can hold a pointer
-\end_layout
-
-\begin_layout Standard
-The constants
-\series bold
-NPY_INTP
-\series default
- and
-\series bold
-NPY_UINTP
-\series default
- refer to an enumerated integer type that is large enough to hold a pointer
- on the platform.
- Index arrays should always be converted to
-\series bold
-NPY_INTP
-\series default
-, because the dimension of the array is of type npy_intp.
-
-\end_layout
-
-\begin_layout Subsection
-C-type names
-\end_layout
-
-\begin_layout Standard
-There are standard variable types for each of the numeric data types and
- the bool data type.
- Some of these are already available in the C-specification.
- You can create variables in extension code with these types.
-
-\end_layout
-
-\begin_layout Subsubsection
-Boolean
-\end_layout
-
-\begin_layout Description
-npy_bool unsigned char; The constants NPY_FALSE and NPY_TRUE are also defined.
-
-\end_layout
-
-\begin_layout Subsubsection
-(Un)Signed Integer
-\end_layout
-
-\begin_layout Standard
-Unsigned versions of the integers can be defined by pre-pending a 'u' to
- the front of the integer name.
-
-\end_layout
-
-\begin_layout Description
-npy_(u)byte (unsigned) char
-\end_layout
-
-\begin_layout Description
-npy_(u)short (unsigned) short
-\end_layout
-
-\begin_layout Description
-npy_(u)int (unsigned) int
-\end_layout
-
-\begin_layout Description
-npy_(u)long (unsigned) long int
-\end_layout
-
-\begin_layout Description
-npy_(u)longlong (unsigned long long int)
-\end_layout
-
-\begin_layout Description
-npy_(u)intp (unsigned) Py_intptr_t (an integer that is the size of a pointer
- on the platform).
-
-\end_layout
-
-\begin_layout Subsubsection
-(Complex) Floating point
-\end_layout
-
-\begin_layout Description
-npy_(c)float float
-\end_layout
-
-\begin_layout Description
-npy_(c)double double
-\end_layout
-
-\begin_layout Description
-npy_(c)longdouble long double
-\end_layout
-
-\begin_layout Standard
-complex types are structures with
-\series bold
-.real
-\series default
- and
-\series bold
-.imag
-\series default
- members (in that order).
-\end_layout
-
-\begin_layout Subsubsection
-Bit-width names
-\end_layout
-
-\begin_layout Standard
-There are also typedefs for signed integers, unsigned integers, floating
- point, and complex floating point types of specific bit-widths.
- The available type names are
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-npy_int
-\series default
-<bits>,
-\series bold
-npy_uint
-\series default
-<bits>,
-\series bold
-npy_float
-\series default
-<bits>, and
-\series bold
-npy_complex
-\series default
-<bits>
-\end_layout
-
-\begin_layout Standard
-where <bits> is the number of bits in the type and can be
-\series bold
-8
-\series default
-,
-\series bold
-16
-\series default
-,
-\series bold
-32
-\series default
-,
-\series bold
-64
-\series default
-, 128, and 256 for integer types; 16,
-\series bold
-32
-\series default
-,
-\series bold
-64
-\series default
-, 80, 96, 128, and 256 for floating-point types; and 32,
-\series bold
-64
-\series default
-,
-\series bold
-128
-\series default
-, 160, 192, and 512 for complex-valued types.
- Which bit-widths are available is platform dependent.
- The bolded bit-widths are usually available on all platforms.
-
-\end_layout
-
-\begin_layout Subsection
-Printf Formatting
-\end_layout
-
-\begin_layout Standard
-For help in printing, the following strings are defined as the correct format
- specifier in printf and related commands.
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-NPY_LONGLONG_FMT
-\series default
-,
-\series bold
-NPY_ULONGLONG_FMT
-\series default
-,
-\series bold
-NPY_INTP_FMT
-\series default
-,
-\series bold
-NPY_UINTP_FMT
-\series default
-,
-\series bold
-NPY_LONGDOUBLE_FMT
-\end_layout
-
-\begin_layout Section
-Array API
-\begin_inset LatexCommand index
-name "ndarray!C-API|("
-
-\end_inset
-
-
-\begin_inset LatexCommand index
-name "C-API!array|("
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Subsection
-Array structure and data access
-\end_layout
-
-\begin_layout Standard
-These macros all access the PyArrayObject structure members.
- The input argument, obj, can be any
-\family typewriter
-PyObject*
-\family default
- that is directly interpretable as a
-\family typewriter
-PyArrayObject*
-\family default
- (any instance of the
-\series bold
-PyArray_Type
-\series default
- and its sub-types).
-
-\end_layout
-
-\begin_layout Description
-PyArray_DATA (
-\family typewriter
-void*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-PyArray_BYTES (
-\family typewriter
-char*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These two macros are similar and obtain the pointer to the data-buffer
- for the array.
- The first macro can (and should be) assigned to a particular pointer where
- the second is for generic processing.
- If you have not guaranteed a contiguous and/or aligned array then be sure
- you understand how to access the data in the array to avoid memory and/or
- alignment problems.
-
-\end_layout
-
-\begin_layout Description
-PyArray_DIMS (
-\family typewriter
-npy_intp*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-PyArray_STRIDES (
-\family typewriter
-npy_intp*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-PyArray_DIM (
-\family typewriter
-npy_intp
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr,
-\family typewriter
-int
-\family default
- n)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the shape in the
-\emph on
-n
-\emph default
-
-\begin_inset Formula $^{\textrm{th}}$
-\end_inset
-
- dimension.
-\end_layout
-
-\begin_layout Description
-PyArray_STRIDE (
-\family typewriter
-npy_intp
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr,
-\family typewriter
-int
-\family default
- n)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the stride in the
-\emph on
-n
-\emph default
-
-\begin_inset Formula $^{\textrm{th}}$
-\end_inset
-
- dimension.
-\end_layout
-
-\begin_layout Description
-PyArray_BASE (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-PyArray_DESCR (
-\family typewriter
-PyArray_Descr*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-PyArray_FLAGS (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-PyArray_ITEMSIZE (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the itemsize for the elements of this array.
-\end_layout
-
-\begin_layout Description
-PyArray_TYPE (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the (builtin) typenumber for the elements of this array.
-
-\end_layout
-
-\begin_layout Description
-PyArray_GETITEM (
-\family typewriter
-PyObject
-\family default
- *) (
-\family typewriter
-PyObject*
-\family default
- arr,
-\family typewriter
-void*
-\family default
- itemptr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Get a Python object from the ndarray,
-\emph on
-arr
-\emph default
-, at the location pointed to by itemptr.
- Return
-\family typewriter
-NULL
-\family default
- on failure.
-
-\end_layout
-
-\begin_layout Description
-PyArray_SETITEM (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr,
-\family typewriter
-void*
-\family default
- itemptr,
-\family typewriter
-PyObject*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert obj and place it in the ndarray,
-\emph on
-arr
-\emph default
-, at the place pointed to by itemptr.
- Return -1 if an error occurs or 0 on success.
-
-\end_layout
-
-\begin_layout Description
-PyArray_SIZE (
-\family typewriter
-npy_intp
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the total size (in number of elements) of the array.
-\end_layout
-
-\begin_layout Description
-PyArray_Size (
-\family typewriter
-npy_intp
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns 0 if
-\emph on
-obj
-\emph default
- is not a sub-class of bigndarray.
- Otherwise, returns the total number of elements in the array.
- Safer version of
-\family typewriter
-PyArray_SIZE
-\family default
-(
-\emph on
-obj
-\emph default
-).
-\end_layout
-
-\begin_layout Description
-PyArray_NBYTES (
-\family typewriter
-npy_intp
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the total number of bytes consumed by the array.
-
-\end_layout
-
-\begin_layout Subsubsection
-Data access
-\end_layout
-
-\begin_layout Standard
-These functions and macros provide easy access to elements of the ndarray
- from C.
- These work for all arrays.
- You may need to take care when accessing the data in the array, however,
- if it is not in machine byte-order, misaligned, or not writeable.
- In other words, be sure to respect the state of the flags unless you know
- what you are doing, or have previously guaranteed an array that is writeable,
- aligned, and in machine byte-order using PyArray_FromAny.
- If you wish to handle all types of arrays, the copyswap function for each
- type is useful for handling misbehaved arrays.
- Some platforms (e.g.
- Solaris) do not like misaligned data and will crash if you de-reference
- a misaligned pointer.
- Other platforms (e.g.
- x86 Linux) will just work more slowly with misaligned data.
-
-\end_layout
-
-\begin_layout Description
-PyArray_GetPtr (
-\family typewriter
-void*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- aobj,
-\family typewriter
-npy_intp*
-\family default
- ind)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a pointer to the data of the ndarray,
-\emph on
-aobj
-\emph default
-, at the N-dimensional index given by the c-array,
-\emph on
-ind
-\emph default
-, (which must be at least
-\emph on
-aobj
-\emph default
-->nd in size).
- You may want to typecast the returned pointer to the data type of the ndarray.
-\end_layout
-
-\begin_layout Description
-PyArray_GETPTR1 (
-\family typewriter
-void*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-<npy_intp>
-\family default
- i)
-\end_layout
-
-\begin_layout Description
-PyArray_GETPTR2 (
-\family typewriter
-void*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-<npy_intp>
-\family default
- i,
-\family typewriter
-<npy_intp>
-\family default
- j)
-\end_layout
-
-\begin_layout Description
-PyArray_GETPTR3 (
-\family typewriter
-void*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-<npy_intp>
-\family default
- i,
-\family typewriter
-<npy_intp>
-\family default
- j,
-\family typewriter
-<npy_intp>
-\family default
- k)
-\end_layout
-
-\begin_layout Description
-PyArray_GETPTR4 (
-\family typewriter
-void*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-<npy_intp>
-\family default
- i,
-\family typewriter
-<npy_intp>
-\family default
- j,
-\family typewriter
-<npy_intp>
-\family default
- k,
-\family typewriter
-<npy_intp>
-\family default
- l)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Quick, inline access to the element at the given coordinates in the ndarray,
-
-\emph on
-obj
-\emph default
-, which must have respectively 1, 2, 3, or 4 dimensions (this is not checked).
- The corresponding
-\emph on
-i
-\emph default
-,
-\emph on
-j
-\emph default
-,
-\emph on
-k
-\emph default
-, and
-\emph on
-l
-\emph default
- coordinates can be any integer but will be interpreted as
-\family typewriter
-npy_intp
-\family default
-.
- You may want to typecast the returned pointer to the data type of the ndarray.
-
-\end_layout
-
-\begin_layout Subsection
-Creating arrays
-\end_layout
-
-\begin_layout Subsubsection
-From scratch
-\end_layout
-
-\begin_layout Description
-PyArray_NewFromDescr (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyTypeObject*
-\family default
- subtype,
-\family typewriter
-PyArray_Descr*
-\family default
- descr,
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-npy_intp*
-\family default
- strides,
-\family typewriter
-void*
-\family default
- data,
-\family typewriter
-int
-\family default
- flags,
-\family typewriter
-PyObject*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is the main array creation function.
- Most new arrays are created with this flexible function.
- The returned object is an object of Python-type
-\emph on
-subtype
-\emph default
-, which must be a subtype of
-\family typewriter
-PyArray_Type
-\family default
-.
- The array has
-\emph on
-nd
-\emph default
- dimensions, described by
-\emph on
-dims
-\emph default
-.
- The data-type descriptor of the new array is
-\emph on
-descr
-\emph default
-.
- If
-\emph on
-subtype
-\emph default
- is not
-\family typewriter
-&PyArray_Type
-\family default
- (
-\emph on
-e.g.
-
-\emph default
- a Python subclass of the ndarray), then
-\emph on
-obj
-\emph default
- is the object to pass to the
-\series bold
-__array_finalize__
-\series default
- method of the subclass.
- If
-\emph on
-data
-\emph default
- is
-\family typewriter
-NULL
-\family default
-, then new memory will be allocated and
-\emph on
-flags
-\emph default
- can be non-zero to indicate a Fortran-style contiguous array.
- If
-\emph on
-data
-\emph default
- is not
-\family typewriter
-NULL
-\family default
-, then it is assumed to point to the memory to be used for the array and
- the
-\emph on
-flags
-\emph default
- argument is used as the new flags for the array (except the state of
-\family typewriter
-NPY_OWNDATA
-\family default
- and
-\family typewriter
-UPDATEIFCOPY
-\family default
- flags of the new array will be reset).
- In addition, if
-\emph on
-data
-\emph default
- is non-NULL, then
-\emph on
-strides
-\emph default
- can also be provided.
- If
-\emph on
-strides
-\emph default
- is
-\family typewriter
-NULL
-\family default
-, then the array strides are computed as C-style contiguous (default) or
- Fortran-style contiguous (
-\emph on
-flags
-\emph default
- is nonzero for
-\emph on
-data
-\emph default
-=
-\family typewriter
-NULL
-\family default
- or
-\emph on
-flags
-\emph default
- &
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- is nonzero non-NULL
-\emph on
-data
-\emph default
-).
- Any provided
-\emph on
-dims
-\emph default
- and
-\emph on
-strides
-\emph default
- are copied into newly allocated dimension and strides arrays for the new
- array object.
-\end_layout
-
-\begin_layout Description
-PyArray_New (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyTypeObject*
-\family default
- subtype,
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-int
-\family default
- type_num,
-\family typewriter
-npy_intp*
-\family default
- strides,
-\family typewriter
-void*
-\family default
- data,
-\family typewriter
-int
-\family default
- itemsize,
-\family typewriter
-int
-\family default
- flags,
-\family typewriter
-PyObject*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is similar to
-\family typewriter
-PyArray
-\family default
-\series bold
-_
-\family typewriter
-\series default
-DescrNew
-\family default
-(...) except you specify the data-type descriptor with
-\emph on
-type_num
-\emph default
- and
-\emph on
-itemsize
-\emph default
-, where
-\emph on
-type_num
-\emph default
- corresponds to a builtin (or user-defined) type.
- If the type always has the same number of bytes, then itemsize is ignored.
- Otherwise, itemsize specifies the particular size of this array.
-
-\end_layout
-
-\begin_layout Warning
-If data is passed to
-\family typewriter
-PyArray_NewFromDescr
-\family default
- or
-\family typewriter
-PyArray_New
-\family default
-, this memory must not be deallocated until the new array is deleted.
- If this data came from another Python object, this can be accomplished
- using
-\family typewriter
-Py_INCREF
-\family default
- on that object and setting the base member of the new array to point to
- that object.
- If strides are passed in they must be consistent with the dimensions, the
- itemsize, and the data of the array.
-\end_layout
-
-\begin_layout Description
-PyArray_SimpleNew (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-int
-\family default
- typenum)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create a new unitialized array of type,
-\emph on
-typenum
-\emph default
-, whose size in each of
-\emph on
-nd
-\emph default
- dimensions is given by the integer array,
-\emph on
-dims
-\emph default
-.
- This function cannot be used to create a flexible-type array (no itemsize
- given).
-\end_layout
-
-\begin_layout Description
-PyArray_SimpleNewFromData (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-int
-\family default
- typenum,
-\family typewriter
-void*
-\family default
- data)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create an array wrapper around
-\emph on
-data
-\emph default
- pointed to by the given pointer.
- The array flags will have a default that the data area is well-behaved
- and C-style contiguous.
- The shape of the array is given by the
-\emph on
-dims
-\emph default
- c-array of length
-\emph on
-nd
-\emph default
-.
- The data-type of the array is indicated by
-\emph on
-typenum
-\emph default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_SimpleNewFromDescr (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-PyArray_Descr*
-\family default
- descr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create a new array with the provided data-type descriptor,
-\emph on
-descr
-\emph default
-, of the shape deteremined by
-\emph on
-nd
-\emph default
- and
-\emph on
-dims
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_FILLWBYTE (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-int
-\family default
- val)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Fill the array pointed to by
-\emph on
-obj
-\emph default
----which must be a (subclass of) bigndarray---with the contents of
-\emph on
-val
-\emph default
- (evaluated as a byte).
-\end_layout
-
-\begin_layout Description
-PyArray_Zeros (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-int
-\family default
- fortran)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a new
-\emph on
-nd
-\emph default
--dimensional array with shape given by
-\emph on
-dims
-\emph default
- and data type given by
-\emph on
-dtype
-\emph default
-.
- If
-\emph on
-fortran
-\emph default
- is non-zero, then a Fortran-order array is created, otherwise a C-order
- array is created.
- Fill the memory with zeros (or the 0 object if
-\emph on
-dtype
-\emph default
- corresponds to
-\family typewriter
-NPY_OBJECT
-\family default
-).
-
-\end_layout
-
-\begin_layout Description
-PyArray_ZEROS (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-int
-\family default
- type_num,
-\family typewriter
-int
-\family default
- fortran)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Macro form of
-\family typewriter
-PyArray_Zeros
-\family default
- which takes a type-number instead of a data-type object.
-\end_layout
-
-\begin_layout Description
-PyArray_Empty (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-int
-\family default
- fortran)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a new
-\emph on
-nd
-\emph default
--dimensional array with shape given by
-\emph on
-dims
-\emph default
- and data type given by
-\emph on
-dtype
-\emph default
-.
- If
-\emph on
-fortran
-\emph default
- is non-zero, then a Fortran-order array is created, otherwise a C-order
- array is created.
- The array is uninitialized unless the data type corresponds to
-\family typewriter
-NPY_OBJECT
-\family default
- in which case the array is filled with
-\family typewriter
-Py_None
-\family default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_EMPTY (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-int
-\family default
- typenum,
-\family typewriter
-int
-\family default
- fortran)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Macro form of
-\family typewriter
-PyArray_Empty
-\family default
- which takes a type-number,
-\emph on
-typenum
-\emph default
-, instead of a data-type object.
-\end_layout
-
-\begin_layout Description
-PyArray_Arange (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-double
-\family default
- start,
-\family typewriter
-double
-\family default
- stop,
-\family typewriter
-double
-\family default
- step,
-\family typewriter
-int
-\family default
- typenum)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a new 1-dimensional array of data-type,
-\emph on
-typenum
-\emph default
-, that ranges from
-\emph on
-start
-\emph default
- to
-\emph on
-stop
-\emph default
- (exclusive) in increments of
-\emph on
-step
-\emph default
-.
- Equivalent to
-\series bold
-arange
-\series default
-(
-\emph on
-start
-\emph default
-,
-\emph on
-stop
-\emph default
-,
-\emph on
-step
-\emph default
-, dtype).
-\end_layout
-
-\begin_layout Description
-PyArray_ArangeObj (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- start,
-\family typewriter
-PyObject*
-\family default
- stop,
-\family typewriter
-PyObject*
-\family default
- step,
-\family typewriter
-PyArray_Descr*
-\family default
- descr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a new 1-dimensional array of data-type determined by
-\family typewriter
-descr
-\family default
-, that ranges from
-\family typewriter
-start
-\family default
- to
-\family typewriter
-stop
-\family default
- (exclusive) in increments of
-\family typewriter
-step
-\family default
-.
- Equivalent to arange(
-\family typewriter
-start
-\family default
-,
-\family typewriter
-stop
-\family default
-,
-\family typewriter
-step
-\family default
-,
-\family typewriter
-typenum
-\family default
-).
-
-\end_layout
-
-\begin_layout Subsubsection
-From other objects
-\end_layout
-
-\begin_layout Description
-PyArray_FromAny (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-int
-\family default
- min_depth,
-\family typewriter
-int
-\family default
- max_depth,
-\family typewriter
-int
-\family default
- requirements,
-\family typewriter
-PyObject*
-\family default
- context)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is the main function used to obtain an array from any nested sequence,
- or object that exposes the array interface,
-\family typewriter
-op
-\family default
-.
- The parameters allow specification of the required
-\emph on
-type
-\emph default
-, the minimum (
-\emph on
-min_depth
-\emph default
-) and maximum (
-\emph on
-max_depth
-\emph default
-) number of dimensions acceptable, and other
-\emph on
-requirements
-\emph default
- for the array.
- The
-\emph on
-dtype
-\emph default
- argument needs to be a
-\family typewriter
-PyArray_Descr
-\family default
- structure indicating the desired data-type (including required byteorder).
- The
-\emph on
-dtype
-\emph default
- argument may be NULL, indicating that any data-type (and byteorder) is
- acceptable.
- If you want to use
-\family typewriter
-NULL
-\family default
- for the
-\emph on
-dtype
-\emph default
- and ensure the array is notswapped then use
-\family typewriter
-PyArray_CheckFromAny
-\family default
-.
- A value of 0 for either of the depth parameters causes the parameter to
- be ignored.
- Any of the following array flags can be added (
-\emph on
-e.g.
-
-\emph default
- using |) to get the
-\emph on
-requirements
-\emph default
- argument.
- If your code can handle general (
-\emph on
-e.g.
-
-\emph default
- strided, byte-swapped, or unaligned arrays) then
-\emph on
-requirements
-\emph default
- may be 0.
- Also, if
-\emph on
-op
-\emph default
- is not already an array (or does not expose the array interface), then
- a new array will be created (and filled from
-\emph on
-op
-\emph default
- using the sequence protocol).
- The new array will have
-\family typewriter
-NPY_DEFAULT
-\family default
- as its flags member.
- The
-\emph on
-context
-\emph default
- argument is passed to the
-\series bold
-__array__
-\series default
- method of
-\emph on
-op
-\emph default
- and is only used if the array is constructed that way.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-NPY_C_CONTIGUOUS Make sure the returned array is C-style contiguous
-\end_layout
-
-\begin_layout Description
-NPY_F_CONTIGUOUS Make sure the returned array is Fortran-style contiguous.
-
-\end_layout
-
-\begin_layout Description
-NPY_ALIGNED Make sure the returned array is aligned on proper boundaries
- for its data type.
- An aligned array has the data pointer and every strides factor as a multiple
- of the alignment factor for the data-type-descriptor.
-\end_layout
-
-\begin_layout Description
-NPY_WRITEABLE Make sure the returned array can be written to.
-
-\end_layout
-
-\begin_layout Description
-NPY_ENSURECOPY Make sure a copy is made of
-\emph on
-op
-\emph default
-.
- If this flag is not present, data is not copied if it can be avoided.
-
-\end_layout
-
-\begin_layout Description
-NPY_ENSUREARRAY Make sure the result is a base-class ndarray or bigndarray.
- By default, if
-\emph on
-op
-\emph default
- is an instance of a subclass of the bigndarray, an instance of that same
- subclass is returned.
- If this flag is set, an ndarray object will be returned instead.
-\end_layout
-
-\begin_layout Description
-NPY_FORCECAST Force a cast to the output type even if it cannot be done
- safely.
- Without this flag, a data cast will occur only if it can be done safely,
- otherwise an error is reaised.
-
-\end_layout
-
-\begin_layout Description
-NPY_UPDATEIFCOPY If
-\emph on
-op
-\emph default
- is already an array, but does not satisfy the requirements, then a copy
- is made (which will satisfy the requirements).
- If this flag is present and a copy (of an object that is already an array)
- must be made, then the corresponding
-\family typewriter
-NPY_UPDATEIFCOPY
-\family default
- flag is set in the returned copy and
-\emph on
-op
-\emph default
- is made to be read-only.
- When the returned copy is deleted (presumably after your calculations are
- complete), its contents will be copied back into
-\emph on
-op
-\emph default
- and the
-\emph on
-op
-\emph default
- array will be made writeable again.
- If
-\emph on
-op
-\emph default
- is not writeable to begin with, then an error is raised.
- If
-\emph on
-op
-\emph default
- is not already an array, then this flag has no effect.
-\end_layout
-
-\begin_layout Description
-NPY_BEHAVED
-\family typewriter
-NPY_ALIGNED
-\family default
- |
-\family typewriter
-NPY_WRITEABLE
-\end_layout
-
-\begin_layout Description
-NPY_CARRAY
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_BEHAVED
-\end_layout
-
-\begin_layout Description
-NPY_CARRAY_RO
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_ALIGNED
-\end_layout
-
-\begin_layout Description
-NPY_FARRAY
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_BEHAVED
-\end_layout
-
-\begin_layout Description
-NPY_FARRAY_RO
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_ALIGNED
-\end_layout
-
-\begin_layout Description
-NPY_DEFAULT
-\family typewriter
-NPY_CARRAY
-\end_layout
-
-\begin_layout Description
-NPY_IN_ARRAY
-\family typewriter
-NPY_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_ALIGNED
-\end_layout
-
-\begin_layout Description
-NPY_IN_FARRAY
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_ALIGNED
-\end_layout
-
-\begin_layout Description
-NPY_INOUT_ARRAY
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_WRITEABLE
-\family default
- |
-\family typewriter
-NPY_ALIGNED
-\end_layout
-
-\begin_layout Description
-NPY_INOUT_FARRAY
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_WRITEABLE
-\family default
- |
-\family typewriter
-NPY_ALIGNED
-\end_layout
-
-\begin_layout Description
-NPY_OUT_ARRAY
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_WRITEABLE
-\family default
- |
-\family typewriter
-NPY_ALIGNED
-\family default
- |
-\family typewriter
-NPY_UPDATEIFCOPY
-\end_layout
-
-\begin_layout Description
-NPY_OUT_FARRAY
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_WRITEABLE
-\family default
- |
-\family typewriter
-NPY_ALIGNED
-\family default
- |
-\family typewriter
-UPDATEIFCOPY
-\end_layout
-
-\end_deeper
-\begin_layout Description
-PyArray_CheckFromAny (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-int
-\family default
- min_depth,
-\family typewriter
-int
-\family default
- max_depth,
-\family typewriter
-int
-\family default
- requirements,
-\family typewriter
-PyObject*
-\family default
- context)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Nearly identical to
-\family typewriter
-PyArray_FromAny
-\family default
-(...) except
-\emph on
-requirements
-\emph default
- can contain
-\family typewriter
-NPY_NOTSWAPPED
-\family default
- (over-riding the specification in
-\emph on
-dtype
-\emph default
-) and
-\family typewriter
-NPY_ELEMENTSTRIDES
-\family default
- which indicates that the array should be aligned in the sense that the
- strides are multiples of the element size.
-
-\end_layout
-
-\begin_layout Description
-NPY_NOTSWAPPED Make sure the returned array has a data-type descriptor that
- is in machine byte-order, over-riding any specification in the
-\emph on
-dtype
-\emph default
- argument.
- Normally, the byte-order requirement is determined by the
-\emph on
-dtype
-\emph default
- argument.
- If this flag is set and the dtype argument does not indicate a machine
- byte-order descriptor (or is NULL and the object is already an array with
- a data-type descriptor that is not in machine byte-order), then a new data-type
- descriptor is created and used with its byte-order field set to native.
-\end_layout
-
-\begin_layout Description
-NPY_BEHAVED_NS
-\family typewriter
-NPY_ALIGNED
-\family default
- |
-\family typewriter
-NPY_WRITEABLE
-\family default
- |
-\family typewriter
-NPY_NOTSWAPPED
-\end_layout
-
-\begin_layout Description
-NPY_ELEMENTSTRIDES Make sure the returned array has strides that are multiples
- of the element size.
-
-\end_layout
-
-\begin_layout Description
-PyArray_FromArray (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- op,
-\family typewriter
-PyArray_Descr*
-\family default
- newtype,
-\family typewriter
-int
-\family default
- requirements)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Special case of
-\family typewriter
-PyArray_FromAny
-\family default
- for when
-\emph on
-op
-\emph default
- is already an array but it needs to be of a specific
-\emph on
-newtype
-\emph default
- (including byte-order) or has certain
-\emph on
-requirements
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_FromStructInterface (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns an ndarray object from a Python object that exposes the
-\series bold
-__array_struct__
-\series default
- method and follows the array interface protocol.
- If the object does not contain this method then a borrowed reference to
-
-\family typewriter
-Py_NotImplemented
-\family default
- is returned.
-\end_layout
-
-\begin_layout Description
-PyArray_FromInterface (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns an ndarray object from a Python object that exposes the
-\series bold
-__array_shape__
-\series default
- and
-\series bold
-__array_typestr__
-\series default
- methods following the array interface protocol.
- If the object does not contain one of these method then a borrowed reference
- to
-\family typewriter
-Py_NotImplemented
-\family default
- is returned.
-\end_layout
-
-\begin_layout Description
-PyArray_FromArrayAttr (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-PyObject*
-\family default
- context)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an ndarray object from a Python object that exposes the
-\series bold
-__array__
-\series default
- method.
- The
-\series bold
-__array__
-\series default
- method can take 0, 1, or 2 arguments ([dtype, context]) where
-\emph on
-context
-\emph default
- is used to pass information about where the
-\series bold
-__array__
-\series default
- method is being called from (currently only used in ufuncs).
-
-\end_layout
-
-\begin_layout Description
-PyArray_ContiguousFromAny (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-int
-\family default
- typenum,
-\family typewriter
-int
-\family default
- min_depth,
-\family typewriter
-int
-\family default
- max_depth)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function returns a (C-style) contiguous and behaved function array
- from any nested sequence or array interface exporting object,
-\emph on
-op
-\emph default
-, of (non-flexible) type given by the enumerated
-\emph on
-typenum
-\emph default
-, of minimum depth
-\emph on
-min_depth
-\emph default
-, and of maximum depth
-\emph on
-max_depth
-\emph default
-.
- Equivalent to a call to
-\family typewriter
-PyArray_FromAny
-\family default
- with requirements set to
-\family typewriter
-NPY_DEFAULT
-\family default
- and the type_num member of the type argument set to
-\emph on
-typenum
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_FromObject (PyObject *) (PyObject * op, int typenum, int min_depth,
- int max_depth)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an aligned and in native-byteorder array from any nested sequence
- or array-interface exporting object, op, of a type given by the enumerated
- typenum.
- The minimum number of dimensions the array can have is given by min_depth
- while the maximum is max_depth.
- This is equivalent to a call to PyArray_FromAny with requirements set to
- BEHAVED.
-
-\end_layout
-
-\begin_layout Description
-PyArray_EnsureArray (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function
-\series bold
-steals a reference
-\series default
- to
-\family typewriter
-op
-\family default
- and makes sure that
-\family typewriter
-op
-\family default
- is a base-class ndarray.
- It special cases array scalars, but otherwise calls
-\series bold
-PyArray_FromAny
-\series default
-(
-\family typewriter
-op
-\family default
-, NULL, 0, 0, NPY_ENSUREARRAY).
-\end_layout
-
-\begin_layout Description
-PyArray_FromString (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-char*
-\family default
- string,
-\family typewriter
-npy_intp
-\family default
- slen,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-npy_intp
-\family default
- num,
-\family typewriter
-char*
-\family default
- sep)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a one-dimensional ndarray of a single type from a binary or (ASCII)
- text
-\family typewriter
-string
-\family default
- of length
-\family typewriter
-slen
-\family default
-.
- The data-type of the array to-be-created is given by
-\family typewriter
-dtype
-\family default
-.
- If num is -1, then
-\series bold
-copy
-\series default
- the entire string and return an appropriately sized array, otherwise,
-\family typewriter
-num
-\family default
- is the number of items to
-\series bold
-copy
-\series default
- from the string.
- If
-\family typewriter
-sep
-\family default
- is NULL (or
-\begin_inset Quotes eld
-\end_inset
-
-
-\begin_inset Quotes erd
-\end_inset
-
-), then interpret the string as bytes of binary data, otherwise convert
- the sub-strings separated by
-\family typewriter
-sep
-\family default
- to items of data-type
-\family typewriter
-dtype
-\family default
-.
- Some data-types may not be readable in text mode and an error will be raised
- if that occurs.
- All errors return NULL.
-
-\end_layout
-
-\begin_layout Description
-PyArray_FromFile (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-FILE*
-\family default
- fp,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-npy_intp
-\family default
- num,
-\family typewriter
-char*
-\family default
- sep)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a one-dimensional ndarray of a single type from a binary or text
- file.
- The open file pointer is
-\family typewriter
-fp
-\family default
-, the data-type of the array to be created is given by
-\family typewriter
-dtype
-\family default
-.
- This must match the data in the file.
- If
-\family typewriter
-num
-\family default
- is -1, then read until the end of the file and return an appropriately
- sized array, otherwise,
-\family typewriter
-num
-\family default
- is the number of items to read.
- If
-\family typewriter
-sep
-\family default
- is NULL (or
-\begin_inset Quotes eld
-\end_inset
-
-
-\begin_inset Quotes erd
-\end_inset
-
-), then read from the file in binary mode, otherwise read from the file
- in text mode with
-\family typewriter
-sep
-\family default
- providing the item separator.
- Some array types cannot be read in text mode in which case an error is
- raised.
-\end_layout
-
-\begin_layout Description
-PyArray_FromBuffer (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- buf,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-npy_intp
-\family default
- count,
-\family typewriter
-npy_intp
-\family default
- offset)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a one-dimensional ndarray of a single type from an object,
-\family typewriter
-buf
-\family default
-, that exports the (single-segment) buffer protocol (or has an attribute
- __buffer__ that returns an object that exports the buffer protocol).
- A writeable buffer will be tried first followed by a read-only buffer.
- The NPY_WRITEABLE flag of the returned array will reflect which one was
- successful.
- The data is assumed to start at
-\family typewriter
-offset
-\family default
- bytes from the start of the memory location for the object.
- The type of the data in the buffer will be interpreted depending on the
- data-type descriptor,
-\family typewriter
-dtype.
-
-\family default
- If
-\family typewriter
-count
-\family default
- is negative then it will be determined from the size of the buffer and
- the requested itemsize, otherwise,
-\family typewriter
-count
-\family default
- represents how many elements should be converted from the buffer.
-
-\end_layout
-
-\begin_layout Description
-PyArray_CopyInto (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- dest,
-\family typewriter
-PyArrayObject*
-\family default
- src)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Copy from the source array,
-\family typewriter
-src
-\family default
-, into the destination array,
-\family typewriter
-dest
-\family default
-, performing a data-type conversion if necessary.
- If an error occurs return -1 (otherwise 0).
- The shape of
-\family typewriter
-src
-\family default
- must be broadcastable to the shape of
-\family typewriter
-dest
-\family default
-.
- The data areas of dest and src must not overlap.
-
-\end_layout
-
-\begin_layout Description
-PyArray_MoveInto (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- dest,
-\family typewriter
-PyArrayObject*
-\family default
- src)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Move data from the source array,
-\family typewriter
-src
-\family default
-, into the destination array,
-\family typewriter
-dest
-\family default
-, performing a data-type conversion if necessary.
- If an error occurs return -1 (otherwise 0).
- The shape of
-\family typewriter
-src
-\family default
- must be broadcastable to the shape of
-\family typewriter
-dest
-\family default
-.
- The data areas of dest and src may overlap.
-
-\end_layout
-
-\begin_layout Description
-PyArray_GETCONTIGUOUS (
-\family typewriter
-PyArrayObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If
-\family typewriter
-op
-\family default
- is already (C-style) contiguous and well-behaved then just return a reference,
- otherwise return a (contiguous and well-behaved) copy of the array.
- The parameter op must be a (sub-class of an) ndarray and no checking for
- that is done.
-\end_layout
-
-\begin_layout Description
-PyArray_FROM_O (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert
-\family typewriter
-obj
-\family default
- to an ndarray.
- The argument can be any nested sequence or object that exports the array
- interface.
- This is a macro form of
-\family typewriter
-PyArray_FromAny
-\family default
- using
-\family typewriter
-NULL
-\family default
-, 0, 0, 0 for the other arguments.
- Your code must be able to handle any data-type descriptor and any combination
- of data-flags to use this macro.
-
-\end_layout
-
-\begin_layout Description
-PyArray_FROM_OF (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-int
-\family default
- requirements)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Similar to
-\family typewriter
-PyArray_FROM_O
-\family default
- except it can take an argument of
-\emph on
-requirements
-\emph default
- indicating properties the resulting array must have.
- Available requirements that can be enforced are
-\family typewriter
-NPY_CONTIGUOUS
-\family default
-,
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
-,
-\family typewriter
-NPY_ALIGNED
-\family default
-,
-\family typewriter
-NPY_WRITEABLE
-\family default
-,
-\family typewriter
-NPY_NOTSWAPPED
-\family default
-,
-\family typewriter
-NPY_ENSURECOPY
-\family default
-,
-\family typewriter
-NPY_UPDATEIFCOPY
-\family default
-,
-\family typewriter
-NPY_FORCECAST
-\family default
-, and
-\family typewriter
-NPY_ENSUREARRAY
-\family default
-.
- Standard combinations of flags can also be used:
-\end_layout
-
-\begin_layout Description
-PyArray_FROM_OT (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-int
-\family default
- typenum)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Similar to
-\family typewriter
-PyArray_FROM_O
-\family default
- except it can take an argument of
-\emph on
-typenum
-\emph default
- specifying the type-number the returned array.
-\end_layout
-
-\begin_layout Description
-PyArray_FROM_OTF (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-int
-\family default
- typenum,
-\family typewriter
-int
-\family default
- requirements)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Combination of
-\family typewriter
-PyArray_FROM_OF
-\family default
- and
-\family typewriter
-PyArray_FROM_OT
-\family default
- allowing both a
-\emph on
-typenum
-\emph default
- and a
-\emph on
-flags
-\emph default
- argument to be provided..
-\end_layout
-
-\begin_layout Description
-PyArray_FROMANY (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-int
-\family default
- typenum,
-\family typewriter
-int
-\family default
- min,
-\family typewriter
-int
-\family default
- max,
-\family typewriter
-int
-\family default
- requirements)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Similar to
-\family typewriter
-PyArray_FromAny
-\family default
- except the data-type is specified using a typenumber.
-
-\family typewriter
-PyArray_DescrFromType
-\family default
-(
-\emph on
-typenum
-\emph default
-) is passed directly to
-\family typewriter
-PyArray_FromAny
-\family default
-.
- This macro also adds
-\family typewriter
-NPY_DEFAULT
-\family default
- to requirements if
-\family typewriter
-NPY_ENSURECOPY
-\family default
- is passed in as requirements.
-
-\end_layout
-
-\begin_layout Description
-PyArray_CheckAxis (
-\family typewriter
-PyObject*
-\family default
-)(
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-int*
-\family default
- axis,
-\family typewriter
-int
-\family default
- requirements)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Encapsulate the functionality of functions and methods that take the axis=
- keyword and work properly with None as the axis argument.
- The input array is
-\family typewriter
-obj
-\family default
-, while
-\family typewriter
-*axis
-\family default
- is a converted integer (so that >=MAXDIMS is the None value), and
-\family typewriter
-requirements
-\family default
- gives the needed properties of
-\family typewriter
-obj
-\family default
-.
- The output is a converted version of the input so that requirements are
- met and if needed a flattening has occurred.
- On output negative values of
-\family typewriter
-*axis
-\family default
- are converted and the new value is checked to ensure consistency with the
- shape of
-\family typewriter
-obj
-\family default
-.
-\end_layout
-
-\begin_layout Subsection
-Dealing with types
-\end_layout
-
-\begin_layout Subsubsection
-General check of Python Type
-\end_layout
-
-\begin_layout Description
-PyArray_Check (op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if
-\emph on
-op
-\emph default
- is a Python object whose type is a sub-type of
-\family typewriter
-PyArray_Type
-\family default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_CheckExact (op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if
-\emph on
-op
-\emph default
- is a Python object with type
-\family typewriter
-PyArray_Type
-\family default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_HasArrayInterface (op, out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If
-\family typewriter
-op
-\family default
- implements any part of the array interface, then
-\family typewriter
-out
-\family default
- will contain a new reference to the newly created ndarray using the interface
- or
-\family typewriter
-out
-\family default
- will contain
-\family typewriter
-NULL
-\family default
- if an error during conversion occurs.
- Otherwise, out will contain a borrowed reference to
-\family typewriter
-Py_NotImplemented
-\family default
- and no error condition is set.
-
-\end_layout
-
-\begin_layout Description
-PyArray_HasArrayInterfaceType (op, type, context, out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If
-\family typewriter
-op
-\family default
- implements any part of the array interface, then
-\family typewriter
-out
-\family default
- will contain a new reference to the newly created ndarray using the interface
- or
-\family typewriter
-out
-\family default
- will contain
-\family typewriter
-NULL
-\family default
- if an error during conversion occurs.
- Otherwise, out will contain a borrowed reference to Py_NotImplemented and
- no error condition is set.
- This version allows setting of the type and context in the part of the
- array interface that looks for the
-\series bold
-__array__
-\series default
- attribute.
-
-\end_layout
-
-\begin_layout Description
-PyArray_IsZeroDim (op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if
-\emph on
-op
-\emph default
- is an instance of (a subclass of)
-\family typewriter
-PyArray_Type
-\family default
- and has 0 dimensions.
-\end_layout
-
-\begin_layout Description
-PyArray_IsScalar (op, cls)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if
-\emph on
-op
-\emph default
- is an instance of
-\family typewriter
-Py<cls>ArrType_Type
-\family default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_CheckScalar (op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if
-\emph on
-op
-\emph default
- is either an array scalar (an instance of a sub-type of
-\family typewriter
-PyGenericArr_Type
-\family default
-), or an instance of (a sub-class of)
-\family typewriter
-PyArray_Type
-\family default
- whose dimensionality is 0.
-\end_layout
-
-\begin_layout Description
-PyArray_IsPythonScalar (op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if
-\emph on
-op
-\emph default
- is a builtin Python
-\begin_inset Quotes eld
-\end_inset
-
-scalar
-\begin_inset Quotes erd
-\end_inset
-
- object (int, float, complex, str, unicode, long, bool).
-\end_layout
-
-\begin_layout Description
-PyArray_IsAnyScalar (op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if
-\emph on
-op
-\emph default
- is either a Python scalar or an array scalar (an instance of a sub-type
- of
-\family typewriter
-PyGenericArr_Type
-\family default
-).
-
-\end_layout
-
-\begin_layout Subsubsection
-Data-type checking
-\end_layout
-
-\begin_layout Standard
-For the typenum macros, the argument is an integer representing an enumerated
- array data type.
- For the array type checking macros the argument must be a
-\family typewriter
-PyObject*
-\family default
- that can be directly interpreted as a
-\family typewriter
-PyArrayObject*
-\family default
-.
-
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISUNSIGNED (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISUNSIGNED (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISUNSIGNED (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents an unsigned integer.
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISSIGNED (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISSIGNED (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISSIGNED (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents a signed integer.
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISINTEGER (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISINTEGER (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISINTEGER (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents any integer.
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISFLOAT (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISFLOAT (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISFLOAT (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents any floating point number.
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISCOMPLEX (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISCOMPLEX (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISCOMPLEX (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents any complex floating point number.
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISNUMBER (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISNUMBER (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISNUMBER (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents any integer, floating point, or complex floating point
- number.
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISSTRING (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISSTRING (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISSTRING (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents a string data type.
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISPYTHON (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISPYTHON (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISPYTHON (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents an enumerated type corresponding to one of the standard
- Python scalar (bool, int, float, or complex).
-
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISFLEXIBLE (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISFLEXIBLE (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISFLEXIBLE (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents one of the flexible array types (
-\family typewriter
-NPY_STRING
-\family default
-,
-\family typewriter
-NPY_UNICODE
-\family default
-, or
-\family typewriter
-NPY_VOID
-\family default
-).
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISUSERDEF (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISUSERDEF (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISUSERDEF (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents a user-defined type.
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISEXTENDED (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISEXTENDED (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISEXTENDED (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type is either flexible or user-defined.
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISOBJECT (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISOBJECT (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISOBJECT (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents object data type.
-\end_layout
-
-\begin_layout Description
-PyTypeNum_ISBOOL (num)
-\end_layout
-
-\begin_layout Description
-PyDataType_ISBOOL (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_ISBOOL (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type represents Boolean data type.
-\end_layout
-
-\begin_layout Description
-PyDataType_HASFIELDS (descr)
-\end_layout
-
-\begin_layout Description
-PyArray_HASFIELDS (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type has fields associated with it.
-\end_layout
-
-\begin_layout Description
-PyArray_ISNOTSWAPPED (m)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if the data area of the ndarray
-\emph on
-m
-\emph default
- is in machine byte-order according to the array's data-type descriptor.
-\end_layout
-
-\begin_layout Description
-PyArray_ISBYTESWAPPED (m)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if the data area of the ndarray
-\emph on
-m
-\emph default
- is
-\series bold
-not
-\series default
- in machine byte-order according to the array's data-type descriptor.
-
-\end_layout
-
-\begin_layout Description
-PyArray_EquivTypes (
-\family typewriter
-Bool
-\family default
-) (
-\family typewriter
-PyArray_Descr*
-\family default
- type1,
-\family typewriter
-PyArray_Descr*
-\family default
- type2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return
-\family typewriter
-NPY_TRUE
-\family default
- if
-\emph on
-type1
-\emph default
- and
-\emph on
-type2
-\emph default
- actually represent equivalent types for this platform (the fortran member
- of each type is ignored).
- For example, on 32-bit platforms,
-\family typewriter
-NPY_LONG
-\family default
- and
-\family typewriter
-NPY_INT
-\family default
- are equivalent.
- Otherwise return
-\family typewriter
-NPY_FALSE
-\family default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_EquivArrTypes (
-\family typewriter
-Bool
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- a1,
-\family typewriter
-PyArrayObject
-\family default
-* a2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return
-\family typewriter
-NPY_TRUE
-\family default
- if
-\emph on
-a1
-\emph default
- and
-\emph on
-a2
-\emph default
- are arrays with equivalent types for this platform.
-
-\end_layout
-
-\begin_layout Description
-PyArray_EquivTypenums (
-\family typewriter
-Bool
-\family default
-) (
-\family typewriter
-int
-\family default
- typenum1,
-\family typewriter
-int
-\family default
- typenum2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Special case of
-\family typewriter
-PyArray_EquivTypes
-\family default
-(...) that does not accept flexible data types but may be easier to call.
-
-\end_layout
-
-\begin_layout Description
-PyArray_EquivByteorders (int) (<byteorder> b1, <byteorder> b2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True if byteorder characters (
-\family typewriter
-NPY_LITTLE
-\family default
-,
-\family typewriter
-NPY_BIG
-\family default
-,
-\family typewriter
-NPY_NATIVE
-\family default
-,
-\family typewriter
-NPY_IGNORE
-\family default
-) are either equal or equivalent as to their specification of a native byte
- order.
- Thus, on a little-endian machine
-\family typewriter
-NPY_LITTLE
-\family default
- and
-\family typewriter
-NPY_NATIVE
-\family default
- are equivalent where they are not equivalent on a big-endian machine.
-
-\end_layout
-
-\begin_layout Subsubsection
-Converting data types
-\end_layout
-
-\begin_layout Description
-PyArray_Cast (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- arr,
-\family typewriter
-int
-\family default
- typenum)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Mainly for backwards compatibility to the Numeric C-API and for simple
- casts to non-flexible types.
- Return a new array object with the elements of
-\emph on
-arr
-\emph default
- cast to the data-type
-\emph on
-typenum
-\emph default
- which must be one of the enumerated types and not a flexible type.
-\end_layout
-
-\begin_layout Description
-PyArray_CastToType (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- arr,
-\family typewriter
-PyArray_Descr*
-\family default
- type,
-\family typewriter
-int
-\family default
- fortran)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a new array of the
-\emph on
-type
-\emph default
- specified, casting the elements of
-\emph on
-arr
-\emph default
- as appropriate.
- The fortran argument specifies the ordering of the output array.
-
-\end_layout
-
-\begin_layout Description
-PyArray_CastTo (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- out,
-\family typewriter
-PyArrayObject*
-\family default
- in)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Cast the elements of the array
-\emph on
-in
-\emph default
- into the array
-\emph on
-out
-\emph default
-.
- The output array should be writeable, have an integer-multiple of the number
- of elements in the input array (more than one copy can be placed in out),
- and have a data type that is one of the builtin types.
- Returns 0 on success and -1 if an error occurs.
-\end_layout
-
-\begin_layout Description
-PyArray_GetCastFunc (
-\family typewriter
-PyArray_VectorUnaryFunc*
-\family default
-) (
-\family typewriter
-PyArray_Descr*
-\family default
- from,
-\family typewriter
-int
-\family default
- totype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the low-level casting function to cast from the given descriptor
- to the builtin type number.
- If no casting function exists return
-\family typewriter
-NULL
-\family default
- and set an error.
- Using this function instead of direct access to
-\emph on
-from
-\emph default
-->f->cast will allow support of any user-defined casting functions added
- to a descriptors casting dictionary.
-
-\end_layout
-
-\begin_layout Description
-PyArray_CanCastSafely (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-int
-\family default
- fromtype,
-\family typewriter
-int
-\family default
- totype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns non-zero if an array of data type
-\emph on
-fromtype
-\emph default
- can be cast to an array of data type
-\emph on
-totype
-\emph default
- without losing information.
- An exception is that 64-bit integers are allowed to be cast to 64-bit floating
- point values even though this can lose precision on large integers so as
- not to proliferate the use of long doubles without explict requests.
- Flexible array types are not checked according to their lengths with this
- function.
-
-\end_layout
-
-\begin_layout Description
-PyArray_CanCastTo (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArray_Descr*
-\family default
- fromtype,
-\family typewriter
-PyArray_Descr*
-\family default
- totype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns non-zero if an array of data type
-\emph on
-fromtype
-\emph default
- (which can include flexible types) can be cast safely to an array of data
- type
-\emph on
-totype
-\emph default
- (which can include flexible types).
- This is basically a wrapper around
-\family typewriter
-PyArray_CanCastSafely
-\family default
- with additional support for size checking if
-\emph on
-fromtype
-\emph default
- and
-\emph on
-totype
-\emph default
- are
-\family typewriter
-NPY_STRING
-\family default
- or
-\family typewriter
-NPY_UNICODE
-\family default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_ObjectType (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-int
-\family default
- mintype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function is useful for determining a common type that two or more
- arrays can be converted to.
- It only works for non-flexible array types as no itemsize information is
- passed.
- The
-\emph on
-mintype
-\emph default
- argument represents the minimum type acceptable, and
-\emph on
-op
-\emph default
- represents the object that will be converted to an array.
- The return value is the enumerated typenumber that represents the data-type
- that
-\emph on
-op
-\emph default
- should have.
-\end_layout
-
-\begin_layout Description
-PyArray_ArrayType (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-PyArray_Descr*
-\family default
- mintype,
-\family typewriter
-PyArray_Descr*
-\family default
- outtype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function works similarly to
-\family typewriter
-PyArray_ObjectType
-\family default
-(...) except it handles flexible arrays.
- The
-\emph on
-mintype
-\emph default
- argument can have an itemsize member and the
-\emph on
-outtype
-\emph default
- argument will have an itemsize member at least as big but perhaps bigger
- depending on the object
-\emph on
-op
-\emph default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_ConvertToCommonType (
-\family typewriter
-PyArrayObject**
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-int*
-\family default
- n)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert a sequence of Python objects contained in
-\emph on
-op
-\emph default
- to an array of ndarrays each having the same data type.
- The type is selected based on the typenumber (larger type number is chosen
- over a smaller one) ignoring objects that are only scalars.
- The length of the sequence is returned in
-\emph on
-n
-\emph default
-, and an
-\emph on
-n
-\emph default
--length array of
-\family typewriter
-PyArrayObject
-\family default
- pointers is the return value (or
-\family typewriter
-NULL
-\family default
- if an error occurs).
- The returned array must be freed by the caller of this routine (using
-\family typewriter
-PyDataMem_FREE
-\family default
-) and all the array objects in it
-\family typewriter
-DECREF
-\family default
-'d or a memory-leak will occur.
- The example template-code below shows a typically usage.
-\end_layout
-
-\begin_layout LyX-Code
-mps = PyArray_ConvertToCommonType(obj, &n);
-\end_layout
-
-\begin_layout LyX-Code
-if (mps==NULL) return NULL;
-\end_layout
-
-\begin_layout LyX-Code
-<code>
-\end_layout
-
-\begin_layout LyX-Code
-<before return>
-\end_layout
-
-\begin_layout LyX-Code
-for (i=0; i<n; i++) Py_DECREF(mps[i]);
-\end_layout
-
-\begin_layout LyX-Code
-PyDataMem_FREE(mps);
-\end_layout
-
-\begin_layout LyX-Code
-<return>
-\end_layout
-
-\begin_layout Description
-PyArray_Zero (
-\family typewriter
-char*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to newly created memory of size
-\emph on
-arr
-\emph default
-->itemsize that holds the representation of 0 for that type.
- The returned pointer,
-\emph on
-ret
-\emph default
-,
-\series bold
-must be freed
-\series default
- using
-\family typewriter
-\emph on
-PyDataMem_FREE
-\family default
-\emph default
-(ret) when it is not needed anymore.
-\end_layout
-
-\begin_layout Description
-PyArray_One (
-\family typewriter
-char*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to newly created memory of size
-\emph on
-arr
-\emph default
-->itemsize that holds the representation of 1 for that type.
- The returned pointer,
-\emph on
-ret
-\emph default
-,
-\series bold
-must be freed
-\series default
- using
-\family typewriter
-PyDataMem_FREE
-\family default
-(ret) when it is not needed anymore.
-\end_layout
-
-\begin_layout Description
-PyArray_ValidType (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-int
-\family default
- typenum)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns
-\family typewriter
-NPY_TRUE
-\family default
- if
-\family typewriter
-\emph on
-typenum
-\family default
-\emph default
- represents a valid type-number (builtin or user-defined or character code).
- Otherwise, this function returns
-\family typewriter
-NPY_FALSE
-\family default
-.
-\end_layout
-
-\begin_layout Subsubsection
-New data types
-\end_layout
-
-\begin_layout Description
-PyArray_InitArrFuncs (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyArray_ArrFuncs*
-\family default
- f)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Initialize all function pointers and members to
-\family typewriter
-NULL
-\family default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_RegisterDataType (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArray_Descr*
-\family default
- dtype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Register a data-type as a new user-defined data type for arrays.
- The type must have most of its entries filled in.
- This is not always checked and errors can produce segfaults.
- In particular, the typeobj member of the
-\family typewriter
-dtype
-\family default
- structure must be filled with a Python type that has a fixed-size element-size
- that corresponds to the elsize member of
-\emph on
-dtype
-\emph default
-.
- Also the
-\family typewriter
-f
-\family default
- member must have the required functions: nonzero, copyswap, copyswapn,
- getitem, setitem, and cast (some of the cast functions may be
-\family typewriter
-NULL
-\family default
- if no support is desired).
- To avoid confusion, you should choose a unique character typecode but this
- is not enforced and not relied on internally.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A user-defined type number is returned that uniquely identifies the type.
- A pointer to the new structure can then be obtained from
-\family typewriter
-PyArray_DescrFromType
-\family default
- using the returned type number.
- A -1 is returned if an error occurs.
- If this
-\family typewriter
-\emph on
-dtype
-\family default
-\emph default
- has already been registered (checked only by the address of the pointer),
- then return the previously-assigned type-number.
-
-\end_layout
-
-\begin_layout Description
-PyArray_RegisterCastFunc (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArray_Descr*
-\family default
- descr,
-\family typewriter
-int
-\family default
- totype,
-\family typewriter
-PyArray_VectorUnaryFunc*
-\family default
- castfunc)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Register a low-level casting function,
-\emph on
-castfunc
-\emph default
-, to convert from the data-type,
-\emph on
-descr
-\emph default
-, to the given data-type number,
-\emph on
-totype
-\emph default
-.
- Any old casting function is over-written.
- A
-\family typewriter
-0
-\family default
- is returned on success or a
-\family typewriter
--1
-\family default
- on failure.
-
-\end_layout
-
-\begin_layout Description
-PyArray_RegisterCanCast (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArray_Descr*
-\family default
- descr,
-\family typewriter
-int
-\family default
- totype,
-\family typewriter
-NPY_SCALARKIND
-\family default
- scalar)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Register the data-type number,
-\emph on
-totype
-\emph default
-, as castable from data-type object,
-\emph on
-descr
-\emph default
-, of the given
-\emph on
-scalar
-\emph default
- kind.
- Use
-\emph on
-scalar
-\emph default
- =
-\family typewriter
-NPY_NOSCALAR
-\family default
- to register that an array of data-type
-\emph on
-descr
-\emph default
- can be cast safely to a data-type whose type_number is
-\emph on
-totype
-\emph default
-.
-
-\end_layout
-
-\begin_layout Subsubsection
-Special functions for NPY_OBJECT
-\end_layout
-
-\begin_layout Description
-PyArray_INCREF (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Used for an array,
-\emph on
-op
-\emph default
-, that contains any Python objects.
- It increments the reference count of every object in the array according
- to the data-type of
-\emph on
-op
-\emph default
-.
- A -1 is returned if an error occurs, otherwise 0 is returned.
-\end_layout
-
-\begin_layout Description
-PyArray_Item_INCREF (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char*
-\family default
- ptr,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A function to INCREF all the objects at the location
-\emph on
-ptr
-\emph default
- according to the data-type
-\emph on
-dtype
-\emph default
-.
- If
-\emph on
-ptr
-\emph default
- is the start of a record with an object at any offset, then this will (recursiv
-ely) increment the reference count of all object-like items in the record.
-\end_layout
-
-\begin_layout Description
-PyArray_XDECREF (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Used for an array,
-\emph on
-op
-\emph default
-, that contains any Python objects.
- It decrements the reference count of every object in the array according
- to the data-type of
-\emph on
-op
-\emph default
-.
- Normal return value is 0.
- A -1 is returned if an error occurs.
-\end_layout
-
-\begin_layout Description
-PyArray_Item_XDECREF (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char*
-\family default
- ptr,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A function to XDECREF all the object-like items at the loacation
-\emph on
-ptr
-\emph default
- as recorded in the data-type,
-\emph on
-dtype
-\emph default
-.
- This works recursively so that if
-\family typewriter
-dtype
-\family default
- itself has fields with data-types that contain object-like items, all the
- object-like fields will be XDECREF
-\family typewriter
-'d
-\family default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_FillObjectArray (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- arr,
-\family typewriter
-PyObject*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Fill a newly created array with a single value obj at all locations in
- the structure with object data-types.
- No checking is performed but
-\emph on
-arr
-\emph default
- must be of data-type
-\family typewriter
-NPY_OBJECT
-\family default
- and be single-segment and uninitialized (no previous objects in position).
- Use
-\family typewriter
-PyArray_DECREF
-\family default
-(
-\emph on
-arr
-\emph default
-) if you need to decrement all the items in the object array prior to calling
- this function.
-
-\end_layout
-
-\begin_layout Subsection
-Array flags
-\end_layout
-
-\begin_layout Subsubsection
-Basic Array Flags
-\end_layout
-
-\begin_layout Standard
-An ndarray can have a data segment that is not a simple contiguous chunk
- of well-behaved memory you can manipulate.
- It may not be aligned with word boundaries (very important on some platforms).
- It might have its data in a different byte-order than the machine recognizes.
- It might not be writeable.
- It might be in Fortan-contiguous order.
- The array flags are used to indicate what can be said about data associated
- with an array.
-\end_layout
-
-\begin_layout Description
-NPY_C_CONTIGUOUS The data area is in C-style contiguous order (last index
- varies the fastest).
-\end_layout
-
-\begin_layout Description
-NPY_F_CONTIGUOUS The data area is in Fortran-style contiguous order (first
- index varies the fastest).
-\end_layout
-
-\begin_layout Description
-NPY_OWNDATA The data area is owned by this array.
-\end_layout
-
-\begin_layout Description
-NPY_ALIGNED The data area is aligned appropriately (for all strides).
-\end_layout
-
-\begin_layout Description
-NPY_WRITEABLE The data area can be written to.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Notice that the above 3 flags are are defined so that a new, well-behaved
- array has these flags defined as true.
-
-\end_layout
-
-\begin_layout Description
-NPY_UPDATEIFCOPY The data area represents a (well-behaved) copy whose informatio
-n should be transferred back to the original when this array is deleted.
-\end_layout
-
-\begin_layout Subsubsection
-Combinations of array flags
-\end_layout
-
-\begin_layout Description
-NPY_BEHAVED
-\family typewriter
-NPY_ALIGNED
-\family default
- |
-\family typewriter
-NPY_WRITEABLE
-\end_layout
-
-\begin_layout Description
-NPY_CARRAY
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_BEHAVED
-\end_layout
-
-\begin_layout Description
-NPY_CARRAY_RO
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_ALIGNED
-\end_layout
-
-\begin_layout Description
-NPY_FARRAY
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_BEHAVED
-\end_layout
-
-\begin_layout Description
-NPY_FARRAY_RO
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_ALIGNED
-\end_layout
-
-\begin_layout Description
-NPY_DEFAULT
-\family typewriter
-NPY_CARRAY
-\end_layout
-
-\begin_layout Description
-NPY_UPDATE_ALL
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- |
-\family typewriter
-NPY_ALIGNED
-\end_layout
-
-\begin_layout Subsubsection
-Flag-like constants
-\end_layout
-
-\begin_layout Standard
-These constants are used in PyArray_FromAny (and its macro forms) to specify
- desired properties of the new array.
-\end_layout
-
-\begin_layout Description
-NPY_FORCECAST Cast to the desired type, even if it can't be done without
- losing information.
-\end_layout
-
-\begin_layout Description
-NPY_ENSURECOPY Make sure the resulting array is a copy of the original.
-\end_layout
-
-\begin_layout Description
-NPY_ENSUREARRAY Make sure the resulting object is an actual ndarray (or
- bigndarray), and not a sub-class.
-\end_layout
-
-\begin_layout Description
-NPY_NOTSWAPPED Only used in
-\family typewriter
-PyArray_CheckFromAny
-\family default
- to over-ride the byteorder of the data-type object passed in.
-
-\end_layout
-
-\begin_layout Description
-NPY_BEHAVED_NS
-\family typewriter
-NPY_ALIGNED
-\family default
- |
-\family typewriter
-NPY_WRITEABLE
-\family default
- |
-\family typewriter
-NPY_NOTSWAPPED
-\end_layout
-
-\begin_layout Subsubsection
-Flag checking
-\end_layout
-
-\begin_layout Standard
-For all of these macros
-\emph on
-arr
-\emph default
- must be an instance of a (subclass of)
-\family typewriter
-PyArray_Type
-\family default
-, but no checking is done.
-\end_layout
-
-\begin_layout Description
-PyArray_CHKFLAGS (arr, flags)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The first parameter, arr, must be an ndarray or subclass.
- The parameter,
-\emph on
-flags
-\emph default
-, should be an integer consisting of bitwise combinations of the possible
- flags an array can have:
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
-,
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
-,
-\family typewriter
-NPY_OWNDATA
-\family default
-,
-\family typewriter
-NPY_ALIGNED
-\family default
-,
-\family typewriter
-NPY_WRITEABLE
-\family default
-,
-\family typewriter
-NPY_UPDATEIFCOPY
-\family default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_ISCONTIGUOUS (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if
-\emph on
-arr
-\emph default
- is C-style contiguous.
-\end_layout
-
-\begin_layout Description
-PyArray_ISFORTRAN (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if
-\emph on
-arr
-\emph default
- is Fortran-style contiguous.
-\end_layout
-
-\begin_layout Description
-PyArray_ISWRITEABLE (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if the data area of
-\emph on
-arr
-\emph default
- can be written to
-\end_layout
-
-\begin_layout Description
-PyArray_ISALIGNED (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if the data area of
-\emph on
-arr
-\emph default
- is properly aligned on the machine.
-\end_layout
-
-\begin_layout Description
-PyArray_ISBEHAVED (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evalutes true if the data area of
-\emph on
-arr
-\emph default
- is aligned and writeable and in machine byte-order according to its descriptor.
-\end_layout
-
-\begin_layout Description
-PyArray_ISBEHAVED_RO (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if the data area of
-\emph on
-arr
-\emph default
- is aligned and in machine byte-order.
-\end_layout
-
-\begin_layout Description
-PyArray_ISCARRAY (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if the data area of
-\emph on
-arr
-\emph default
- is C-style contiguous, and
-\family typewriter
-PyArray_ISBEHAVED
-\family default
-(
-\emph on
-arr
-\emph default
-) is true.
-\end_layout
-
-\begin_layout Description
-PyArray_ISFARRAY (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if the data area of
-\emph on
-arr
-\emph default
- is Fortran-style contiguous and
-\family typewriter
-PyArray_ISBEHAVED
-\family default
-(
-\emph on
-arr
-\emph default
-) is true.
-\end_layout
-
-\begin_layout Description
-PyArray_ISCARRAY_RO (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if the data area of
-\emph on
-arr
-\emph default
- is C-style contiguous, aligned, and in machine byte-order.
-
-\end_layout
-
-\begin_layout Description
-PyArray_ISFARRAY_RO (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if the data area of
-\emph on
-arr
-\emph default
- is Fortran-style contiguous, aligned, and in machine byte-order
-\series bold
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_ISONESEGMENT (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if the data area of
-\emph on
-arr
-\emph default
- consists of a single (C-style or Fortran-style) contiguous segment.
-\end_layout
-
-\begin_layout Description
-PyArray_UpdateFlags (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- arr,
-\family typewriter
-int
-\family default
- flagmask)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The
-\family typewriter
-NPY_C_CONTIGUOUS
-\family default
-,
-\family typewriter
-NPY_ALIGNED
-\family default
-, and
-\family typewriter
-NPY_F_CONTIGUOUS
-\family default
- array flags can be
-\begin_inset Quotes eld
-\end_inset
-
-calculated
-\begin_inset Quotes erd
-\end_inset
-
- from the array object itself.
- This routine updates one or more of these flags of
-\emph on
-arr
-\emph default
- as specified in
-\emph on
-flagmask
-\emph default
- by performing the required calculation.
-
-\end_layout
-
-\begin_layout Warning
-It is important to keep the flags updated (using PyArray_UpdateFlags can
- help) whenever a manipulation with an array is performed that might cause
- them to change.
- Later calculations in NumPy that rely on the state of these flags do not
- repeat the calculation to update them.
-
-\end_layout
-
-\begin_layout Subsection
-Array method alternative API
-\end_layout
-
-\begin_layout Subsubsection
-Conversion
-\end_layout
-
-\begin_layout Description
-PyArray_GetField (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-int
-\family default
- offset)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-getfield
-\series default
-(
-\emph on
-dtype
-\emph default
-,
-\emph on
-offset
-\emph default
-).
- Return a new array of the given
-\emph on
-dtype
-\emph default
- using the data in the current array at a specified
-\emph on
-offset
-\emph default
- in bytes.
- The
-\emph on
-offset
-\emph default
- plus the itemsize of the new array type must be less than
-\emph on
-self
-\emph default
-->descr->elsize or an error is raised.
- The same shape and strides as the original array are used.
- Therefore, this function has the effect of returning a field from a record
- array.
- But, it can also be used to select specific bytes or groups of bytes from
- any array type.
-
-\end_layout
-
-\begin_layout Description
-PyArray_SetField (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-int
-\family default
- offset,
-\family typewriter
-PyObject*
-\family default
- val)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-setfield
-\series default
-(
-\emph on
-val
-\emph default
-,
-\emph on
-dtype
-\emph default
-,
-\emph on
-offset
-\emph default
-).
- Set the field starting at
-\emph on
-offset
-\emph default
- in bytes and of the given
-\emph on
-dtype
-\emph default
- to
-\emph on
-val
-\emph default
-.
- The
-\emph on
-offset
-\emph default
- plus
-\emph on
-dtype
-\emph default
-->elsize must be less than
-\emph on
-self
-\emph default
-->descr->elsize or an error is raised.
- Otherwise, the
-\emph on
-val
-\emph default
- argument is converted to an array and copied into the field pointed to.
- If necessary, the elements of
-\emph on
-val
-\emph default
- are repeated to fill the destination array, But, the number of elements
- in the destination must be an integer multiple of the number of elements
- in
-\emph on
-val
-\emph default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Byteswap (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-Bool
-\family default
- inplace)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-byteswap
-\series default
-(
-\emph on
-inplace
-\emph default
-).
- Return an array whose data area is byteswapped.
- If
-\emph on
-inplace
-\emph default
- is non-zero, then do the byteswap inplace and return a reference to self.
- Otherwise, create a byteswapped copy and leave self unchanged.
-\end_layout
-
-\begin_layout Description
-PyArray_NewCopy (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- old,
-\family typewriter
-NPY_ORDER
-\family default
- order)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-copy
-\series default
-(
-\emph on
-fortran
-\emph default
-).
- Make a copy of the
-\emph on
-old
-\emph default
- array.
- The returned array is always aligned and writeable with data interpreted
- the same as the old array.
- If
-\emph on
-order
-\emph default
- is
-\family typewriter
-NPY_CORDER
-\family default
-, then a C-style contiguous array is returned.
- If
-\emph on
-order
-\emph default
- is
-\family typewriter
-NPY_FORTRANORDER
-\family default
-, then a Fortran-style contiguous array is returned.
- If
-\emph on
-order is
-\emph default
-
-\family typewriter
-NPY_ANYORDER
-\family default
-, then the array returned is Fortran-style contiguous only if the old one
- is; otherwise, it is C-style contiguous.
-
-\end_layout
-
-\begin_layout Description
-PyArray_ToList (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-tolist
-\series default
-().
- Return a nested Python list from
-\emph on
-self
-\emph default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_ToString (PyObject*) (PyArrayObject* self, NPY_ORDER order)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-tostring
-\series default
-(
-\emph on
-order
-\emph default
-).
- Return the bytes of this array in a Python string.
-
-\end_layout
-
-\begin_layout Description
-PyArray_ToFile (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-FILE*
-\family default
- fp,
-\family typewriter
-char*
-\family default
- sep,
-\family typewriter
-char*
-\family default
- format)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Write the contents of
-\emph on
-self
-\emph default
- to the file pointer
-\emph on
-fp
-\emph default
- in C-style contiguous fashion.
- Write the data as binary bytes if
-\family typewriter
-\emph on
-sep
-\family default
-\emph default
- is the string
-\begin_inset Quotes eld
-\end_inset
-
-
-\begin_inset Quotes erd
-\end_inset
-
- or
-\family typewriter
-NULL
-\family default
-.
- Otherwise, write the contents of
-\emph on
-self
-\emph default
- as text using the
-\family typewriter
-\emph on
-sep
-\family default
-\emph default
- string as the item separator.
- Each item will be printed to the file.
- If the
-\emph on
-format
-\emph default
- string is not
-\family typewriter
-NULL
-\family default
- or
-\begin_inset Quotes eld
-\end_inset
-
-
-\begin_inset Quotes erd
-\end_inset
-
-, then it is a Python print statement format string showing how the items
- are to be written.
-\end_layout
-
-\begin_layout Description
-PyArray_Dump (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- self,
-\family typewriter
-PyObject*
-\family default
- file,
-\family typewriter
-int
-\family default
- protocol)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Pickle the object in
-\emph on
-self
-\emph default
- to the given
-\emph on
-file
-\emph default
- (either a string or a Python file object).
- If
-\emph on
-file
-\emph default
- is a Python string it is considered to be the name of a file which is then
- opened in binary mode.
- The given
-\emph on
-protocol
-\emph default
- is used (if
-\emph on
-protocol
-\emph default
- is negative, or the highest available is used).
- This is a simple wrapper around cPickle.dump(
-\emph on
-self
-\emph default
-,
-\emph on
-file
-\emph default
-,
-\emph on
-protocol
-\emph default
-).
-\end_layout
-
-\begin_layout Description
-PyArray_Dumps (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- protocol)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Pickle the object in
-\emph on
-self
-\emph default
- to a Python string and return it.
- Use the Pickle
-\emph on
-protocol
-\emph default
- provided (or the highest available if
-\emph on
-protocol
-\emph default
- is negative).
-
-\end_layout
-
-\begin_layout Description
-PyArray_FillWithScalar (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- arr,
-\family typewriter
-PyObject*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Fill the array,
-\emph on
-arr
-\emph default
-, with the given scalar object,
-\emph on
-obj
-\emph default
-.
- The object is first converted to the data type of
-\emph on
-arr
-\emph default
-, and then copied into every location.
- A -1 is returned if an error occurs, otherwise 0 is returned.
-\end_layout
-
-\begin_layout Description
-PyArray_View (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-view
-\series default
-(
-\emph on
-dtype
-\emph default
-).
- Return a new view of the array
-\emph on
-self
-\emph default
- as possibly a different data-type,
-\emph on
-dtype
-\emph default
-.
- If
-\emph on
-dtype
-\emph default
- is
-\family typewriter
-NULL
-\family default
-, then the returned array will have the same data type as
-\emph on
-self
-\emph default
-.
- The new data-type must be consistent with the size of
-\emph on
-self
-\emph default
-.
- Either the itemsizes must be identical, or
-\emph on
-self
-\emph default
- must be single-segment and the total number of bytes must be the same.
- In the latter case the dimensions of the returned array will be altered
- in the last (or first for Fortran-style contiguous arrays) dimension.
- The data area of the returned array and self is exactly the same.
-\end_layout
-
-\begin_layout Subsubsection
-Shape Manipulation
-\end_layout
-
-\begin_layout Description
-PyArray_Newshape (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyArray_Dims*
-\family default
- newshape)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Result will be a new array (pointing to the same memory location as
-\emph on
-self
-\emph default
- if possible), but having a shape given by
-\emph on
-newshape
-\emph default
-.
- If the new shape is not compatible with the strides of
-\emph on
-self
-\emph default
-, then a copy of the array with the new specified shape will be returned.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Reshape (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyObject*
-\family default
- shape)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\family typewriter
-\emph on
-self
-\family default
-\emph default
-.
-\series bold
-reshape
-\series default
-(
-\family typewriter
-\emph on
-shape
-\family default
-\emph default
-) where
-\emph on
-shape
-\emph default
- is a sequence.
- Converts
-\emph on
-shape
-\emph default
- to a
-\family typewriter
-PyArray_Dims
-\family default
- structure and calls
-\family typewriter
-PyArray_Newshape
-\family default
- internally.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Squeeze (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-squeeze
-\series default
-().
- Return a new view of
-\emph on
-self
-\emph default
- with all of the dimensions of length 1 removed from the shape.
-
-\end_layout
-
-\begin_layout Warning
-matrix objects are always 2-dimensional.
- Therefore,
-\family typewriter
-PyArray_Squeeze
-\family default
- has no effect on arrays of matrix sub-class.
-
-\end_layout
-
-\begin_layout Description
-PyArray_SwapAxes (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- a1,
-\family typewriter
-int
-\family default
- a2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-swapaxes
-\series default
-(
-\emph on
-a1
-\emph default
-,
-\emph on
-a2
-\emph default
-).
- The returned array is a new view of the data in
-\emph on
-self
-\emph default
- with the given axes,
-\emph on
-a1
-\emph default
- and
-\emph on
-a2
-\emph default
-, swapped.
-\end_layout
-
-\begin_layout Description
-PyArray_Resize (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyArray_Dims*
-\family default
- newshape,
-\family typewriter
-int
-\family default
- refcheck, NPY_ORDER fortran)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-resize
-\series default
-(
-\emph on
-newshape
-\emph default
-, refcheck
-\family typewriter
-=
-\family default
-\emph on
-refcheck
-\emph default
-, order=
-\shape italic
-fortran
-\shape default
-).
- This function only works on single-segment arrays.
- It changes the shape of
-\emph on
-self
-\emph default
- inplace and will reallocate the memory for
-\emph on
-self
-\emph default
- if
-\emph on
-newshape
-\emph default
- has a different total number of elements then the old shape.
- If reallocation is necessary, then
-\emph on
-self
-\emph default
- must own its data, have
-\emph on
-self
-\emph default
--
-\family typewriter
->base==NULL
-\family default
-, have
-\emph on
-self
-\emph default
--
-\family typewriter
->weakrefs==NULL
-\family default
-, and (unless refcheck is 0) not be referenced by any other array.
- A reference to the new array is returned.
- The
-\shape italic
-fortran
-\shape default
- argument can be NPY_ANYORDER, NPY_CORDER, or NPY_FORTRANORDER.
- This argument is used if the number of dimension is (or is being resized
- to be) greater than 2.
- It currently has no effect.
- Eventually it could be used to determine how the resize operation should
- view the data when constructing a differently-dimensioned array.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Transpose (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyArray_Dims*
-\family default
- permute)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-transpose
-\series default
-(
-\emph on
-permute
-\emph default
-).
- Permute the axes of the ndarray object
-\emph on
-self
-\emph default
- according to the data structure
-\emph on
-permute
-\emph default
- and return the result.
- If
-\emph on
-permute
-\emph default
- is
-\family typewriter
-NULL
-\family default
-, then the resulting array has its axes reversed.
- For example if
-\emph on
-self
-\emph default
- has shape
-\begin_inset Formula $10\times20\times30$
-\end_inset
-
-, and
-\emph on
-permute
-\family typewriter
-\emph default
-.ptr
-\family default
- is (0,2,1) the shape of the result is
-\begin_inset Formula $10\times30\times20.$
-\end_inset
-
- If
-\emph on
-permute
-\emph default
- is
-\family typewriter
-NULL
-\family default
-, the shape of the result is
-\begin_inset Formula $30\times20\times10.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-PyArray_Flatten (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-NPY_ORDER
-\family default
- order)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-flatten
-\series default
-(
-\emph on
-order
-\emph default
-).
- Return a 1-d copy of the array.
- If
-\emph on
-order
-\emph default
- is
-\family typewriter
-NPY_FORTRANORDER
-\family default
- the elements are scanned out in Fortran order (first-dimension varies the
- fastest).
- If
-\emph on
-order
-\emph default
- is
-\family typewriter
-NPY_CORDER
-\family default
-, the elements of
-\family typewriter
-self
-\family default
- are scanned in C-order (last dimension varies the fastest).
- If
-\emph on
-order
-\emph default
-
-\family typewriter
-NPY_ANYORDER
-\family default
-, then the result of
-\family typewriter
-PyArray_ISFORTRAN
-\family default
-(
-\emph on
-self
-\emph default
-) is used to determine which order to flatten.
-\end_layout
-
-\begin_layout Description
-PyArray_Ravel (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-NPY_ORDER
-\family default
- order)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.ravel(
-\emph on
-order
-\emph default
-).
- Same basic functionality as
-\family typewriter
-PyArray_Flatten
-\family default
-(
-\emph on
-self
-\emph default
-,
-\emph on
-order
-\emph default
-) except if
-\emph on
-order
-\emph default
- is 0 and
-\emph on
-self
-\emph default
- is C-style contiguous, the shape is altered but no copy is performed.
-\end_layout
-
-\begin_layout Subsubsection
-Item selection and manipulation
-\end_layout
-
-\begin_layout Description
-PyArray_TakeFrom (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyObject*
-\family default
- indices,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-PyArrayObject*
-\family default
- ret,
-\family typewriter
-NPY_CLIPMODE
-\family default
- clipmode)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-take
-\series default
-(
-\emph on
-indices
-\emph default
-,
-\emph on
-axis
-\emph default
-,
-\emph on
-ret
-\emph default
-,
-\emph on
-clipmode
-\emph default
-) except
-\emph on
-axis
-\emph default
-=None in Python is obtained by setting
-\emph on
-axis
-\emph default
-=
-\family typewriter
-NPY_MAXDIMS
-\family default
- in C.
- Extract the items from self indicated by the integer-valued
-\emph on
-indices
-\emph default
- along the given
-\emph on
-axis.
-
-\emph default
- The clipmode argument can be
-\family typewriter
-NPY_RAISE
-\family default
-,
-\family typewriter
-NPY_WRAP
-\family default
-, or
-\family typewriter
-NPY_CLIP
-\family default
- to indicate what to do with out-of-bound indices.
- The
-\emph on
-ret
-\emph default
- argument can specify an output array rather than having one created internally.
-
-\end_layout
-
-\begin_layout Description
-PyArray_PutTo (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyObject*
-\family default
- values,
-\family typewriter
-PyObject*
-\family default
- indices,
-\family typewriter
-NPY_CLIPMODE
-\family default
- clipmode)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.put(
-\emph on
-values
-\emph default
-,
-\emph on
-indices
-\emph default
-,
-\emph on
-clipmode
-\emph default
-).
- Put
-\emph on
-values
-\emph default
- into
-\emph on
-self
-\emph default
- at the corresponding (flattened)
-\emph on
-indices
-\emph default
-.
- If
-\emph on
-values
-\emph default
- is too small it will be repeated as necessary.
-
-\end_layout
-
-\begin_layout Description
-PyArray_PutMask (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyObject*
-\family default
- values,
-\family typewriter
-PyObject*
-\family default
- mask)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Place the
-\emph on
-values
-\emph default
- in
-\emph on
-self
-\emph default
- wherever corresponding positions (using a flattened context) in
-\emph on
-mask
-\emph default
- are true.
- The
-\emph on
-mask
-\emph default
- and
-\emph on
-self
-\emph default
- arrays must have the same total number of elements.
- If
-\emph on
-values
-\emph default
- is too small, it will be repeated as necessary.
-\end_layout
-
-\begin_layout Description
-PyArray_Repeat (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-int
-\family default
- axis)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-repeat
-\series default
-(
-\emph on
-op
-\emph default
-,
-\emph on
-axis
-\emph default
-).
- Copy the elements of
-\emph on
-self
-\emph default
-,
-\emph on
-op
-\emph default
- times along the given
-\emph on
-axis
-\emph default
-.
- Either
-\emph on
-op
-\emph default
- is a scalar integer or a sequence of length
-\emph on
-self
-\emph default
-->dimensions[
-\emph on
-axis
-\emph default
-] indicating how many times to repeat each item along the axis.
-\end_layout
-
-\begin_layout Description
-PyArray_Choose (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-PyArrayObject*
-\family default
- ret,
-\family typewriter
-NPY_CLIPMODE
-\family default
- clipmode)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-choose
-\series default
-(
-\emph on
-op
-\emph default
-,
-\emph on
-ret
-\emph default
-,
-\emph on
-clipmode
-\emph default
-).
- Create a new array by selecting elements from the sequence of arrays in
-
-\emph on
-op
-\emph default
- based on the integer values in
-\emph on
-self
-\emph default
-.
- The arrays must all be broadcastable to the same shape and the entries
- in
-\emph on
-self
-\emph default
- should be between 0 and len(
-\emph on
-op
-\emph default
-).
- The output is placed in
-\emph on
-ret
-\emph default
- unless it is
-\family typewriter
-NULL
-\family default
- in which case a new output is created.
- The
-\emph on
-clipmode
-\emph default
- argument determines behavior for when entries in
-\emph on
-self
-\emph default
- are not between 0 and len(
-\emph on
-op
-\emph default
-).
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-NPY_RAISE raise a ValueError;
-\end_layout
-
-\begin_layout Description
-NPY_WRAP wrap values <0 by adding len(
-\emph on
-op
-\emph default
-) and values >=len(
-\emph on
-op
-\emph default
-) by subtracting len(
-\emph on
-op
-\emph default
-) until they are in range;
-\end_layout
-
-\begin_layout Description
-NPY_CLIP all values are clipped to the region [0, len(
-\emph on
-op
-\emph default
-) ).
-\end_layout
-
-\end_deeper
-\begin_layout Description
-PyArray_Sort (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-sort
-\series default
-(
-\emph on
-axis
-\emph default
-).
- Return an array with the items of
-\emph on
-self
-\emph default
- sorted along
-\emph on
-axis
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_ArgSort (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-argsort
-\series default
-(
-\emph on
-axis
-\emph default
-).
- Return an array of indices such that selection of these indices along the
- given
-\family typewriter
-axis
-\family default
- would return a sorted version of
-\emph on
-self
-\emph default
-.
- If
-\emph on
-self
-\emph default
-->descr is a data-type with fields defined, then self->descr->names is used
- to determine the sort order.
- A comparison where the first field is equal will use the second field and
- so on.
- To alter the sort order of a record array, create a new data-type with
- a different order of names and construct a view of the array with that
- new data-type.
-
-\end_layout
-
-\begin_layout Description
-PyArray_LexSort (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- sort_keys,
-\family typewriter
-int
-\family default
- axis)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Given a sequence of arrays (
-\emph on
-sort_keys
-\emph default
-) of the same shape, return an array of indices (similar to
-\family typewriter
-PyArray_ArgSort
-\family default
-(...)) that would sort the arrays lexicographically.
- A lexicographic sort specifies that when two keys are found to be equal,
- the order is based on comparison of subsequent keys.
- A merge sort (which leaves equal entries unmoved) is required to be defined
- for the types.
- The sort is accomplished by sorting the indices first using the first
-\emph on
-sort_key
-\emph default
- and then using the second
-\emph on
-sort_key
-\emph default
- and so forth.
- This is equivalent to the lexsort(
-\emph on
-sort_keys
-\emph default
-,
-\emph on
-axis
-\emph default
-) Python command.
- Because of the way the merge-sort works, be sure to understand the order
- the
-\emph on
-sort_keys
-\emph default
- must be in (reversed from the order you would use when comparing two elements).
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If these arrays are all collected in a record array, then
-\family typewriter
-PyArray_Sort
-\family default
-(...) can also be used to sort the array directly.
-
-\end_layout
-
-\begin_layout Description
-PyArray_SearchSorted (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyObject*
-\family default
- values)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-searchsorted
-\series default
-(
-\emph on
-values
-\emph default
-).
- Assuming
-\emph on
-self
-\emph default
- is a 1-d array in ascending order representing bin boundaries then the
- output is an array the same shape as
-\emph on
-values
-\emph default
- of bin numbers, giving the bin into which each item in
-\emph on
-values
-\emph default
- would be placed.
- No checking is done on whether or not self is in ascending order.
-\end_layout
-
-\begin_layout Description
-PyArray_Diagonal (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- offset,
-\family typewriter
-int
-\family default
- axis1,
-\family typewriter
-int
-\family default
- axis2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-diagonal
-\series default
-(
-\emph on
-offset
-\emph default
-,
-\emph on
-axis1
-\emph default
-,
-\emph on
-axis2
-\emph default
-).
- Return the
-\emph on
-offset
-\emph default
- diagonals of the 2-d arrays defined by
-\emph on
-axis1
-\emph default
- and
-\emph on
-axis2
-\emph default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Nonzero (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-nonzero
-\series default
-().
- Returns a tuple of index arrays that select elements of
-\emph on
-self
-\emph default
- that are nonzero.
- If (nd=
-\family typewriter
-PyArray_NDIM
-\family default
-(
-\family typewriter
-self
-\family default
-))==1, then a single index array is returned.
- The index arrays have data type
-\family typewriter
-NPY_INTP
-\family default
-.
- If a tuple is returned (nd
-\begin_inset Formula $\neq$
-\end_inset
-
-1), then its length is nd.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Compress (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyObject*
-\family default
- condition,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-compress
-\series default
-(
-\emph on
-condition
-\emph default
-,
-\emph on
-axis
-\emph default
-).
- Return the elements along
-\emph on
-axis
-\emph default
- corresponding to elements of
-\emph on
-condition
-\emph default
- that are true.
-
-\end_layout
-
-\begin_layout Subsubsection
-Calculation
-\end_layout
-
-\begin_layout Tip
-Pass in NPY_MAXDIMS for axis in order to achieve the same effect that is
- obtained by passing in axis = None in Python (treating the array as a 1-d
- array).
-
-\end_layout
-
-\begin_layout Description
-PyArray_ArgMax (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-argmax
-\series default
-(
-\emph on
-axis
-\emph default
-).
- Return the index of the largest element of
-\emph on
-self
-\emph default
- along
-\emph on
-axis
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_ArgMin (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-argmin
-\series default
-(
-\emph on
-axis
-\emph default
-).
- Return the index of the smallest element of
-\emph on
-self
-\emph default
- along
-\emph on
-axis
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_Max (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-max
-\series default
-(
-\emph on
-axis
-\emph default
-).
- Return the largest element of
-\emph on
-self
-\emph default
- along the given
-\emph on
-axis
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_Min (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-min
-\series default
-(
-\emph on
-axis
-\emph default
-).
- Return the smallest element of
-\emph on
-self
-\emph default
- along the given
-\emph on
-axis
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_Ptp (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-ptp
-\series default
-(
-\emph on
-axis
-\emph default
-).
- Return the difference between the largest element of
-\emph on
-self
-\emph default
- along
-\emph on
-axis
-\emph default
- and the smallest element of
-\emph on
-self
-\emph default
- along
-\emph on
-axis
-\emph default
-.
-\end_layout
-
-\begin_layout Note
-The rtype argument specifies the data-type the reduction should take place
- over.
- This is important if the data-type of the array is not
-\begin_inset Quotes eld
-\end_inset
-
-large
-\begin_inset Quotes erd
-\end_inset
-
- enough to handle the output.
- By default, all integer data-types are made at least as large as NPY_LONG
- for the
-\begin_inset Quotes eld
-\end_inset
-
-add
-\begin_inset Quotes erd
-\end_inset
-
- and
-\begin_inset Quotes eld
-\end_inset
-
-multiply
-\begin_inset Quotes erd
-\end_inset
-
- ufuncs (which form the basis for mean, sum, cumsum, prod, and cumprod functions
-).
-\end_layout
-
-\begin_layout Description
-PyArray_Mean (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-int
-\family default
- rtype,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-mean
-\series default
-(
-\emph on
-axis
-\emph default
-,
-\emph on
-rtype
-\emph default
-).
- Returns the mean of the elements along the given
-\emph on
-axis
-\emph default
-, using the enumerated type
-\emph on
-rtype
-\emph default
- as the data type to sum in.
- Default sum behavior is obtained using
-\family typewriter
-NPY_NOTYPE
-\family default
- for
-\emph on
-rtype
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_Trace (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- offset,
-\family typewriter
-int
-\family default
- axis1,
-\family typewriter
-int
-\family default
- axis2,
-\family typewriter
-int
-\family default
- rtype,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-trace
-\series default
-(
-\emph on
-offset
-\emph default
-,
-\emph on
-axis1
-\emph default
-,
-\emph on
-axis2
-\emph default
-,
-\emph on
-rtype
-\emph default
-).
- Return the sum (using
-\emph on
-rtype
-\emph default
- as the data type of summation) over the
-\emph on
-offset
-\emph default
- diagonal elements of the 2-d arrays defined by
-\emph on
-axis1
-\emph default
- and
-\emph on
-axis2
-\emph default
- variables.
- A positive offset chooses diagonals above the main diagonal.
- A negative offset selects diagonals below the main diagonal.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Clip (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-PyObject*
-\family default
- min,
-\family typewriter
-PyObject*
-\family default
- max)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-clip
-\series default
-(
-\emph on
-min
-\emph default
-,
-\emph on
-max
-\emph default
-).
- Clip an array,
-\emph on
-self
-\emph default
-, so that values larger than
-\emph on
-max
-\emph default
- are fixed to
-\emph on
-max
-\emph default
- and values less than
-\emph on
-min
-\emph default
- are fixed to
-\emph on
-min
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_Conjugate (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-conjugate
-\series default
-() and
-\emph on
-self
-\emph default
-.
-\series bold
-conj
-\series default
-() Return the complex conjugate of
-\emph on
-self
-\emph default
-.
- If
-\emph on
-self
-\emph default
- is not of complex data type, then return
-\emph on
-self
-\emph default
- with an reference.
-\end_layout
-
-\begin_layout Description
-PyArray_Round (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- decimals,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-round
-\series default
-(
-\emph on
-decimals
-\emph default
-,
-\emph on
-out
-\emph default
-).
- Returns the array with elements rounded to the nearest decimal place.
- The decimal place is defined as the
-\begin_inset Formula $10^{-\textrm{decimals}}$
-\end_inset
-
- digit so that negative
-\emph on
-decimals
-\emph default
- cause rounding to the nearest 10's, 100's, etc.
- If out is
-\family typewriter
-NULL
-\family default
-, then the output array is created, otherwise the output is placed in
-\family typewriter
-\emph on
-out
-\family default
-\emph default
- which must be the correct size and type.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Std (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-int
-\family default
- rtype,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-std
-\series default
-(
-\emph on
-axis
-\emph default
-,
-\emph on
-rtype
-\emph default
-).
- Return the standard deviation using data along
-\emph on
-axis
-\emph default
- converted to data type
-\emph on
-rtype
-\emph default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Sum (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-int
-\family default
- rtype,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-sum
-\series default
-(
-\family typewriter
-\emph on
-axis
-\family default
-\emph default
-,
-\family typewriter
-\emph on
-rtype
-\family default
-\emph default
-).
- Return 1-d vector sums of elements in
-\emph on
-self
-\emph default
- along
-\emph on
-axis
-\emph default
-.
- Perform the sum after converting data to data type
-\emph on
-rtype
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_CumSum (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-int
-\family default
- rtype,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-cumsum
-\series default
-(
-\family typewriter
-\emph on
-axis
-\family default
-\emph default
-,
-\family typewriter
-\emph on
-rtype
-\family default
-\emph default
-).
- Return cumulative 1-d sums of elements in
-\emph on
-self
-\emph default
- along
-\emph on
-axis
-\emph default
-.
- Perform the sum after converting data to data type
-\emph on
-rtype
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_Prod (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-int
-\family default
- rtype,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-prod
-\series default
-(
-\emph on
-axis
-\emph default
-,
-\emph on
-rtype
-\emph default
-).
- Return 1-d products of elements in
-\emph on
-self
-\emph default
- along
-\emph on
-axis
-\emph default
-.
- Perform the product after converting data to data type
-\emph on
-rtype
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_CumProd (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-int
-\family default
- rtype,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-cumprod
-\series default
-(
-\emph on
-axis
-\emph default
-,
-\emph on
-rtype
-\emph default
-).
- Return 1-d cumulative products of elements in
-\family typewriter
-self
-\family default
- along
-\family typewriter
-axis
-\family default
-.
- Perform the product after converting data to data type
-\family typewriter
-rtype
-\family default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_All (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-all
-\series default
-(
-\emph on
-axis
-\emph default
-).
- Return an array with True elements for every 1-d sub-array of
-\family typewriter
-self
-\family default
- defined by
-\family typewriter
-axis
-\family default
- in which all the elements are True.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Any (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- self,
-\family typewriter
-int
-\family default
- axis,
-\family typewriter
-PyArrayObject*
-\family default
- out)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\emph on
-self
-\emph default
-.
-\series bold
-any
-\series default
-(
-\emph on
-axis
-\emph default
-).
- Return an array with True elements for every 1-d sub-array of
-\emph on
-self
-\emph default
- defined by
-\emph on
-axis
-\emph default
- in which any of the elements are True.
-
-\end_layout
-
-\begin_layout Subsection
-Functions
-\end_layout
-
-\begin_layout Subsubsection
-Array Functions
-\end_layout
-
-\begin_layout Description
-PyArray_AsCArray (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject**
-\family default
- op,
-\family typewriter
-void*
-\family default
- ptr,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-int
-\family default
- typenum,
-\family typewriter
-int
-\family default
- itemsize)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Sometimes it is useful to access a multidimensional array as a C-style
- multi-dimensional array so that algorithms can be implemented using C's
- a[i][j][k] syntax.
- This routine returns a pointer,
-\emph on
-ptr
-\emph default
-, that simulates this kind of C-style array, for 1-, 2-, and 3-d ndarrays.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-op The address to any Python object.
- This Python object will be replaced with an equivalent well-behaved, C-style
- contiguous, ndarray of the given data type specifice by the last two arguments.
- Be sure that stealing a reference in this way to the input object is justified.
-
-\end_layout
-
-\begin_layout Description
-ptr The address to a (ctype* for 1-d, ctype** for 2-d or ctype*** for 3-d)
- variable where ctype is the equivalent C-type for the data type.
- On return,
-\emph on
-ptr
-\emph default
- will be addressable as a 1-d, 2-d, or 3-d array.
-
-\end_layout
-
-\begin_layout Description
-dims An output array that contains the shape of the array object.
- This array gives boundaries on any looping that will take place.
-
-\end_layout
-
-\begin_layout Description
-nd The dimensionality of the array (1, 2, or 3).
-
-\end_layout
-
-\begin_layout Description
-typenum The expected data type of the array.
-
-\end_layout
-
-\begin_layout Description
-itemsize This argument is only needed when
-\emph on
-typenum
-\emph default
- represents a flexible array.
- Otherwise it should be 0.
-
-\end_layout
-
-\end_deeper
-\begin_layout Note
-The simulation of a C-style array is not complete for 2-d and 3-d arrays.
- For example, the simulated arrays of pointers cannot be passed to subroutines
- expecting specific, statically-defined 2-d and 3-d arrays.
- To pass to functions requiring those kind of inputs, you must statically
- define the required array and copy data.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Free (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-void*
-\family default
- ptr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Must be called with the same objects and memory locations returned from
-
-\family typewriter
-PyArray_AsCArray
-\family default
-(...).
- This function cleans up memory that otherwise would get leaked.
-\end_layout
-
-\begin_layout Description
-PyArray_Concatenate (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-int
-\family default
- axis)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Join the sequence of objects in
-\emph on
-obj
-\emph default
- together along
-\emph on
-axis
-\emph default
- into a single array.
- If the dimensions or types are not compatible an error is raised.
-\end_layout
-
-\begin_layout Description
-PyArray_InnerProduct (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj1,
-\family typewriter
-PyObject*
-\family default
- obj2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute a product-sum over the last dimensions of
-\emph on
-obj1
-\emph default
- and
-\emph on
-obj2
-\emph default
-.
- Neither array is conjugated.
-
-\end_layout
-
-\begin_layout Description
-PyArray_MatrixProduct (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj1,
-\family typewriter
-PyObject*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute a product-sum over the last dimension of
-\emph on
-obj1
-\emph default
- and the second-to-last dimension of
-\emph on
-obj2
-\emph default
-.
- For 2-d arrays this is a matrix-product.
- Neither array is conjugated.
-
-\end_layout
-
-\begin_layout Description
-PyArray_CopyAndTranspose (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject
-\family default
-* op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A specialized copy and transpose function that works only for 2-d arrays.
- The returned array is a transposed copy of
-\emph on
-op
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_Correlate (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op1,
-\family typewriter
-PyObject*
-\family default
- op2,
-\family typewriter
-int
-\family default
- mode)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the 1-d correlation of the 1-d arrays
-\emph on
-op1
-\emph default
- and
-\emph on
-op2
-\emph default
-.
- The correlation is computed at each output point by multiplying
-\emph on
-op1
-\emph default
- by a shifted version of
-\emph on
-op2
-\emph default
- and summing the result.
- As a result of the shift, needed values outside of the defined range of
-
-\emph on
-op1
-\emph default
- and
-\emph on
-op2
-\emph default
- are interpreted as zero.
- The mode determines how many shifts to return: 0 - return only shifts that
- did not need to assume zero-values; 1 - return an object that is the same
- size as
-\emph on
-op1
-\emph default
-, 2 - return all possible shifts (any overlap at all is accepted).
-
-\end_layout
-
-\begin_layout Description
-PyArray_Where (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- condition,
-\family typewriter
-PyObject*
-\family default
- x,
-\family typewriter
-PyObject*
-\family default
- y)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If both
-\family typewriter
-x
-\family default
- and
-\family typewriter
-y
-\family default
- are
-\family typewriter
-NULL
-\family default
-, then return
-\family typewriter
-PyArray_Nonzero
-\family default
-(
-\family typewriter
-\emph on
-condition
-\family default
-\emph default
-).
- Otherwise, both
-\emph on
-x
-\emph default
- and
-\emph on
-y
-\emph default
- must be given and the object returned is shaped like
-\emph on
-condition
-\emph default
- and has elements of
-\emph on
-x
-\emph default
- and
-\emph on
-y
-\emph default
- where
-\emph on
-condition
-\emph default
- is respectively True or False.
-
-\end_layout
-
-\begin_layout Subsubsection
-Other functions
-\end_layout
-
-\begin_layout Description
-PyArray_CheckStrides (
-\family typewriter
-Bool
-\family default
-) (
-\family typewriter
-int
-\family default
- elsize,
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp
-\family default
- numbytes,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-npy_intp*
-\family default
- newstrides)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Determine if
-\emph on
-newstrides
-\emph default
- is a strides array consistent with the memory of an
-\emph on
-nd
-\emph default
--dimensional array with shape
-\family typewriter
-dims
-\family default
- and element-size,
-\emph on
-elsize
-\emph default
-.
- The
-\emph on
-newstrides
-\emph default
- array is checked to see if jumping by the provided number of bytes in each
- direction will ever mean jumping more than
-\emph on
-numbytes
-\emph default
- which is the assumed size of the available memory segment.
- If
-\emph on
-numbytes
-\emph default
- is 0, then an equivalent
-\emph on
-numbytes
-\emph default
- is computed assuming
-\emph on
-nd
-\emph default
-,
-\emph on
-dims
-\emph default
-, and
-\emph on
-elsize
-\emph default
- refer to a single-segment array.
- Return
-\family typewriter
-NPY_TRUE
-\family default
- if
-\emph on
-newstrides
-\emph default
- is acceptable, otherwise return
-\family typewriter
-NPY_FALSE
-\family default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_MultiplyList (
-\family typewriter
-npy_intp
-\family default
-) (
-\family typewriter
-npy_intp*
-\family default
- seq,
-\family typewriter
-int
-\family default
- n)
-\end_layout
-
-\begin_layout Description
-PyArray_MultiplyIntList (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-int*
-\family default
- seq,
-\family typewriter
-int
-\family default
- n)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Both of these routines multiply an
-\emph on
-n
-\emph default
--length array,
-\emph on
-seq
-\emph default
-, of integers and return the result.
- No overflow checking is performed.
-\end_layout
-
-\begin_layout Description
-PyArray_CompareLists (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-npy_intp*
-\family default
- l1,
-\family typewriter
-npy_intp*
-\family default
- l2,
-\family typewriter
-int
-\family default
- n)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Given two
-\emph on
-n
-\emph default
--length arrays of integers,
-\emph on
-l1
-\emph default
-, and
-\emph on
-l2
-\emph default
-, return 1 if the lists are identical; otherwise, return 0.
-
-\end_layout
-
-\begin_layout Subsection
-Array Iterators
-\end_layout
-
-\begin_layout Standard
-An array iterator is a simple way to access the elements of an N-dimensional
- array quickly and efficiently.
- Section
-\begin_inset LatexCommand ref
-reference "sec:array_iterator"
-
-\end_inset
-
- provides more description and examples of this useful approach to looping
- over an array.
-
-\end_layout
-
-\begin_layout Description
-PyArray_IterNew (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array iterator object from the array,
-\emph on
-arr
-\emph default
-.
- This is equivalent to
-\emph on
-arr
-\emph default
-.
-\series bold
-flat
-\series default
-.
- The array iterator object makes it easy to loop over an N-dimensional non-conti
-guous array in C-style contiguous fashion.
-
-\end_layout
-
-\begin_layout Description
-PyArray_IterAllButAxis (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- arr,
-\family typewriter
-int
-\family default
- *axis)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array iterator that will iterate over all axes but the one provided
- in
-\emph on
-*axis
-\emph default
-.
- The returned iterator cannot be used with
-\family typewriter
-PyArray_ITER_GOTO1D
-\family default
-.
- This iterator could be used to write something similar to what ufuncs do
- wherein the loop over the largest axis is done by a separate sub-routine.
- If
-\emph on
-*axis
-\emph default
- is negative then
-\emph on
-*axis
-\emph default
- will be set to the axis having the smallest stride and that axis will be
- used.
-
-\end_layout
-
-\begin_layout Description
-PyArray_BroadcastToShape (
-\family typewriter
-PyObject*
-\family default
-)(
-\family typewriter
-PyObject*
-\family default
- arr,
-\family typewriter
-npy_intp
-\family default
- *dimensions,
-\family typewriter
-int
-\family default
- nd)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array iterator that is broadcast to iterate as an array of the
- shape provided by
-\emph on
-dimensions
-\emph default
- and
-\emph on
-nd
-\emph default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArrayIter_Check (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates true if
-\emph on
-op
-\emph default
- is an array iterator (or instance of a subclass of the array iterator type).
-
-\end_layout
-
-\begin_layout Description
-PyArray_ITER_RESET (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- iterator)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Reset an
-\emph on
-iterator
-\emph default
- to the beginning of the array.
-\end_layout
-
-\begin_layout Description
-PyArray_ITER_NEXT (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- iterator)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Incremement the index and the dataptr members of the
-\emph on
-iterator
-\emph default
- to point to the next element of the array.
- If the array is not (C-style) contiguous, also increment the N-dimensional
- coordinates array.
-\end_layout
-
-\begin_layout Description
-PyArray_ITER_DATA (
-\family typewriter
-void*
-\family default
-)(
-\family typewriter
-PyObject*
-\family default
- iterator)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A pointer to the current element of the array.
-
-\end_layout
-
-\begin_layout Description
-PyArray_ITER_GOTO (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- iterator,
-\family typewriter
-npy_intp*
-\family default
- destination)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Set the
-\emph on
-iterator
-\emph default
- index, dataptr, and coordinates members to the location in the array indicated
- by the N-dimensional c-array,
-\emph on
-destination
-\emph default
-, which must have size at least
-\emph on
-iterator
-\emph default
-->nd_m1+1.
-\end_layout
-
-\begin_layout Description
-PyArray_ITER_GOTO1D (
-\family typewriter
-PyObject*
-\family default
- iterator,
-\family typewriter
-npy_intp
-\family default
- index)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Set the
-\emph on
-iterator
-\emph default
- index and dataptr to the location in the array indicated by the integer
-
-\emph on
-index
-\emph default
- which points to an element in the C-styled flattened array.
-
-\end_layout
-
-\begin_layout Description
-PyArray_ITER_NOTDONE (
-\family typewriter
-int
-\family default
-)(
-\family typewriter
-PyObject*
-\family default
- iterator)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates TRUE as long as the iterator has not looped through all of the
- elements, otherwise it evaluates FALSE.
-
-\end_layout
-
-\begin_layout Subsection
-Broadcasting (multi-iterators)
-\end_layout
-
-\begin_layout Description
-PyArray_MultiIterNew (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-int
-\family default
- num, ...)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A simplified interface to broadcasting.
- This function takes the number of arrays to broadcast and then
-\emph on
-num
-\emph default
- extra (
-\family typewriter
-PyObject*
-\family default
-) arguments.
- These arguments are converted to arrays and iterators are created.
-
-\family typewriter
-PyArray_Broadcast
-\family default
- is then called on the resulting multi-iterator object.
- The resulting, broadcasted mult-iterator object is then returned.
- A broadcasted operation can then be performed using a single loop and using
-
-\family typewriter
-PyArray_MultiIter_NEXT
-\family default
-(..)
-\end_layout
-
-\begin_layout Description
-PyArray_MultiIter_RESET (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- multi)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Reset all the iterators to the beginning in a multi-iterator object,
-\emph on
-multi
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_MultiIter_NEXT (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- multi)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Advance each iterator in a multi-iterator object,
-\emph on
-multi
-\emph default
-, to its next (broadcasted) element.
-\end_layout
-
-\begin_layout Description
-PyArray_MultiIter_DATA (
-\family typewriter
-void*
-\family default
-)(
-\family typewriter
-PyObject*
-\family default
- multi,
-\family typewriter
-int
-\family default
- i)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the data-pointer of the
-\emph on
-i
-\emph default
-
-\begin_inset Formula $^{\textrm{th}}$
-\end_inset
-
- iterator in a multi-iterator object.
-
-\end_layout
-
-\begin_layout Description
-PyArray_MultiIter_NEXTi (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- multi,
-\family typewriter
-int
-\family default
- i)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Advance the pointer of only the
-\emph on
-i
-\emph default
-
-\begin_inset Formula $^{\textrm{th}}$
-\end_inset
-
- iterator.
-\end_layout
-
-\begin_layout Description
-PyArray_MultiIter_GOTO (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- multi,
-\family typewriter
-npy_intp*
-\family default
- destination)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Advance each iterator in a multi-iterator object,
-\emph on
-multi
-\emph default
-, to the given
-\begin_inset Formula $N$
-\end_inset
-
--dimensional
-\emph on
-destination
-\emph default
- where
-\begin_inset Formula $N$
-\end_inset
-
- is the number of dimensions in the broadcasted array.
-
-\end_layout
-
-\begin_layout Description
-PyArray_MultiIter_GOTO1D (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- multi,
-\family typewriter
-npy_intp
-\family default
- index)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Advance each iterator in a multi-iterator object,
-\emph on
-multi
-\emph default
-, to the corresponding location of the
-\emph on
-index
-\emph default
- into the flattened broadcasted array.
-
-\end_layout
-
-\begin_layout Description
-PyArray_MultiIter_NOTDONE (
-\family typewriter
-int
-\family default
-)(
-\family typewriter
-PyObject*
-\family default
- multi)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates TRUE as long as the multi-iterator has not looped through all
- of the elements (of the broadcasted result), otherwise it evaluates FALSE.
-
-\end_layout
-
-\begin_layout Description
-PyArray_Broadcast (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArrayMultiIterObject*
-\family default
- mit)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function encapsulates the broadcasting rules.
- The
-\emph on
-mit
-\emph default
- container should already contain iterators for all the arrays that need
- to be broadcast.
- On return, these iterators will be adjusted so that iteration over each
- simultaneously will accomplish the broadcasting.
- A negative number is returned if an error occurs.
-
-\end_layout
-
-\begin_layout Description
-PyArray_RemoveSmallest (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyArrayMultiIterObject*
-\family default
- mit)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function takes a multi-iterator object that has been previously
-\begin_inset Quotes eld
-\end_inset
-
-broadcasted,
-\begin_inset Quotes erd
-\end_inset
-
- finds the dimension with the smallest
-\begin_inset Quotes eld
-\end_inset
-
-sum of strides
-\begin_inset Quotes erd
-\end_inset
-
- in the broadcasted result and adapts all the iterators so as not to iterate
- over that dimension (by effectively making them of length-1 in that dimension).
- The corresponding dimension is returned unless
-\emph on
-mit
-\emph default
-->nd is 0, then -1 is returned.
- This function is useful for constructing ufunc-like routines that broadcast
- their inputs correctly and then call a strided 1-d version of the routine
- as the inner-loop.
- This 1-d version is usually optimized for speed and for this reason the
- loop should be performed over the axis that won't require large stride
- jumps.
-
-\end_layout
-
-\begin_layout Subsection
-Array Scalars
-\end_layout
-
-\begin_layout Description
-PyArray_Return (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyArrayObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function checks to see if
-\emph on
-arr
-\emph default
- is a 0-dimensional array and, if so, returns the appropriate array scalar.
- It should be used whenever 0-dimensional arrays could be returned to Python.
-\end_layout
-
-\begin_layout Description
-PyArray_Scalar (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-void*
-\family default
- data,
-\family typewriter
-PyArray_Descr*
-\family default
- dtype,
-\family typewriter
-PyObject*
-\family default
- itemsize)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array scalar object of the given enumerated
-\emph on
-typenum
-\emph default
- and
-\emph on
-itemsize
-\emph default
- by
-\series bold
-copying
-\series default
- from memory pointed to by
-\emph on
-data
-\emph default
-.
- If
-\emph on
-swap
-\emph default
- is nonzero then this function will byteswap the data if appropriate to
- the data-type because array scalars are always in correct machine-byte
- order.
-\end_layout
-
-\begin_layout Description
-PyArray_ToScalar (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-void*
-\family default
- data,
-\family typewriter
-PyArrayObject*
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array scalar object of the type and itemsize indicated by the
- array object
-\emph on
-arr
-\emph default
- copied from the memory pointed to by
-\emph on
-data
-\emph default
- and swapping if the data in
-\emph on
-arr
-\emph default
- is not in machine byte-order.
-\end_layout
-
-\begin_layout Description
-PyArray_FromScalar (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- scalar,
-\family typewriter
-PyArray_Descr*
-\family default
- outcode)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a 0-dimensional array of type determined by
-\emph on
-outcode
-\emph default
- from
-\emph on
-scalar
-\emph default
- which should be an array-scalar object.
- If
-\emph on
-outcode
-\emph default
- is NULL, then the type is determined from
-\family typewriter
-\emph on
-scalar
-\family default
-\emph default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_ScalarAsCtype (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- scalar,
-\family typewriter
-void*
-\family default
- ctypeptr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return in
-\emph on
-ctypeptr
-\emph default
- a pointer to the actual value in an array scalar.
- There is no error checking so
-\emph on
-scalar
-\emph default
- must be an array-scalar object, and ctypeptr must have enough space to
- hold the correct type.
- For flexible-sized types, a pointer to the data is copied into the memory
- of
-\emph on
-ctypeptr
-\emph default
-, for all other types, the actual data is copied into the address pointed
- to by
-\emph on
-ctypeptr
-\emph default
-.
-
-\end_layout
-
-\begin_layout Description
-PyArray_CastScalarToCtype (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- scalar,
-\family typewriter
-void*
-\family default
- ctypeptr,
-\family typewriter
-PyArray_Descr*
-\family default
- outcode)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the data (cast to the data type indicated by
-\emph on
-outcode
-\emph default
-) from the array-scalar,
-\emph on
-scalar
-\emph default
-, into the memory pointed to by
-\emph on
-ctypeptr
-\emph default
- (which must be large enough to handle the incoming memory).
-
-\end_layout
-
-\begin_layout Description
-PyArray_TypeObjectFromType (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-int
-\family default
- type)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns a scalar type-object from a type-number,
-\emph on
-type
-\emph default
-.
- Equivalent to
-\family typewriter
-PyArray_DescrFromType
-\family default
-(
-\emph on
-type
-\emph default
-)->typeobj except for reference counting and error-checking.
- Returns a new reference to the typeobject on success or
-\family typewriter
-NULL
-\family default
- on failure.
-\end_layout
-
-\begin_layout Description
-PyArray_ScalarKind (
-\family typewriter
-NPY_SCALARKIND
-\family default
-) (
-\family typewriter
-int
-\family default
- typenum,
-\family typewriter
-PyArrayObject**
-\family default
- arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the kind of scalar represented by
-\emph on
-typenum
-\emph default
- and the array in
-\emph on
-*arr
-\emph default
- (if
-\emph on
-arr
-\emph default
- is not
-\family typewriter
-NULL
-\family default
-).
- The array is assumed to be rank-0 and only used if
-\emph on
-typenum
-\emph default
- represents a signed integer.
- If
-\emph on
-arr
-\emph default
- is not
-\family typewriter
-NULL
-\family default
- and the first element is negative then
-\family typewriter
-NPY_INTNEG_SCALAR
-\family default
- is returned, otherwise
-\family typewriter
-NPY_INTPOS_SCALAR
-\family default
- is returned.
- The possible return values are
-\family typewriter
-NPY_
-\family default
-<kind>
-\family typewriter
-_SCALAR
-\family default
- where <kind> can be
-\series bold
-INTPOS
-\series default
-,
-\series bold
-INTNEG
-\series default
-,
-\series bold
-FLOAT
-\series default
-,
-\series bold
-COMPLEX
-\series default
-,
-\series bold
-BOOL
-\series default
-, or
-\series bold
-OBJECT
-\series default
-.
-
-\family typewriter
-NPY_NOSCALAR
-\family default
- is also an enumerated value
-\family typewriter
-NPY_SCALARKIND
-\family default
- variables can take on.
-
-\end_layout
-
-\begin_layout Description
-PyArray_CanCoerceScalar (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-char
-\family default
- thistype,
-\family typewriter
-char
-\family default
- neededtype,
-\family typewriter
-NPY_SCALARKIND
-\family default
- scalar)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Implements the rules for scalar coercion.
- Scalars are only silently coerced from thistype to neededtype if this function
- returns nonzero.
- If scalar is
-\family typewriter
-NPY_NOSCALAR
-\family default
-, then this function is equivalent to
-\family typewriter
-PyArray_CanCastSafely
-\family default
-.
- The rule is that scalars of the same KIND can be coerced into arrays of
- the same KIND.
- This rule means that high-precision scalars will never cause low-precision
- arrays of the same KIND to be upcast.
-
-\end_layout
-
-\begin_layout Subsection
-Data-type descriptors
-\end_layout
-
-\begin_layout Warning
-Data-type objects must be reference counted so be aware of the action on
- the data-type reference of different C-API calls.
- The standard rule is that when a data-type object is returned it is a new
- reference.
- Functions that take
-\family typewriter
-PyArray_Descr*
-\family default
- objects and return arrays steal references to the data-type their inputs
- unless otherwise noted.
- Therefore, you must own a reference to any data-type object used as input
- to such a function.
-
-\end_layout
-
-\begin_layout Description
-PyArrayDescr_Check (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates as true if
-\emph on
-obj
-\emph default
- is a data-type object (
-\family typewriter
-PyArray_Descr*
-\family default
-).
-\end_layout
-
-\begin_layout Description
-PyArray_DescrNew (
-\family typewriter
-PyArray_Descr*
-\family default
-) (
-\family typewriter
-PyArray_Descr*
-\family default
- obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a new data-type object copied from
-\emph on
-obj
-\emph default
- (the fields reference is just updated so that the new object points to
- the same fields dictionary if any).
-
-\end_layout
-
-\begin_layout Description
-PyArray_DescrNewFromType (
-\family typewriter
-PyArray_Descr*
-\family default
-) (
-\family typewriter
-int
-\family default
- typenum)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create a new data-type object from the built-in (or user-registered) data-type
- indicated by
-\emph on
-typenum
-\emph default
-.
- All builtin types should not have any of their fields changed.
- This creates a new copy of the
-\family typewriter
-PyArray_Descr
-\family default
- structure so that you can fill it in as appropriate.
- This function is especially needed for flexible data-types which need to
- have a new elsize member in order to be meaningful in array construction.
-
-\end_layout
-
-\begin_layout Description
-PyArray_DescrNewByteorder (
-\family typewriter
-PyArray_Descr*
-\family default
-) (
-\family typewriter
-PyArray_Descr*
-\family default
- obj,
-\family typewriter
-char
-\family default
- newendian)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create a new data-type object with the byteorder set according to
-\emph on
-newendian
-\emph default
-.
- All referenced data-type objects (in subdescr and fields members of the
- data-type object) are also changed (recursively).
- If a byteorder of
-\family typewriter
-NPY_IGNORE
-\family default
- is encountered it is left alone.
- If newendian is
-\family typewriter
-NPY_SWAP
-\family default
-, then all byte-orders are swapped.
- Other valid newendian values are
-\family typewriter
-NPY_NATIVE
-\family default
-,
-\family typewriter
-NPY_LITTLE
-\family default
-, and
-\family typewriter
-NPY_BIG
-\family default
- which all cause the returned data-typed descriptor (and all it's referenced
- data-type descriptors) to have the corresponding byte-order.
-\end_layout
-
-\begin_layout Description
-PyArray_DescrFromObject (
-\family typewriter
-PyArray_Descr*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-PyArray_Descr*
-\family default
- mintype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Determine an appropriate data-type object from the object
-\emph on
-op
-\emph default
- (which should be a
-\begin_inset Quotes eld
-\end_inset
-
-nested
-\begin_inset Quotes erd
-\end_inset
-
- sequence object) and the minimum data-type descriptor mintype (which can
- be
-\family typewriter
-NULL
-\family default
-).
- Similar in behavior to array(
-\emph on
-op
-\emph default
-).dtype.
- Don't confuse this function with
-\family typewriter
-PyArray_DescrConverter
-\family default
-.
- This function essentially looks at all the objects in the (nested) sequence
- and determines the data-type from the elements it finds.
-
-\end_layout
-
-\begin_layout Description
-PyArray_DescrFromScalar (
-\family typewriter
-PyArray_Descr*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- scalar)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a data-type object from an array-scalar object.
- No checking is done to be sure that
-\emph on
-scalar
-\emph default
- is an array scalar.
- If no suitable data-type can be determined, then a data-type of NPY_OBJECT
- is returned by default.
-
-\end_layout
-
-\begin_layout Description
-PyArray_DescrFromType (
-\family typewriter
-PyArray_Descr*
-\family default
-) (
-\family typewriter
-int
-\family default
- typenum)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns a data-type object corresponding to
-\emph on
-typenum
-\emph default
-.
- The
-\emph on
-typenum
-\emph default
- can be one of the enumerated types, a character code for one of the enumerated
- types, or a user-defined type.
-
-\end_layout
-
-\begin_layout Description
-PyArray_DescrConverter (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-PyArray_Descr**
-\family default
- dtype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert any compatible Python object,
-\emph on
-obj
-\emph default
-, to a data-type object in
-\emph on
-dtype
-\emph default
-.
- A large number of Python objects can be converted to data-type objects.
- See Chapter
-\begin_inset LatexCommand ref
-reference "cha:Data-descriptor-objects"
-
-\end_inset
-
- for a complete description.
- This version of the converter converts None objects to a
-\family typewriter
-NPY_DEFAULT_TYPE
-\family default
- data-type object.
- This function can be used with the
-\begin_inset Quotes eld
-\end_inset
-
-O&
-\begin_inset Quotes erd
-\end_inset
-
- character code in PyArg_ParseTuple processing.
-
-\end_layout
-
-\begin_layout Description
-PyArray_DescrConverter2 (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-PyArray_Descr**
-\family default
- dtype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert any compatible Python object,
-\emph on
-obj
-\emph default
-, to a data-type object in
-\emph on
-dtype
-\emph default
-.
- This version of the converter converts None objects so that the returned
- data-type is
-\family typewriter
-NULL
-\family default
-.
- This function can also be used with the
-\begin_inset Quotes eld
-\end_inset
-
-O&
-\begin_inset Quotes erd
-\end_inset
-
- character in PyArg_ParseTuple processing.
-\end_layout
-
-\begin_layout Description
-Pyarray_DescrAlignConverter (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-PyArray_Descr**
-\family default
- dtype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Like
-\family typewriter
-PyArray_DescrConverter
-\family default
- except it aligns C-struct-like objects on word-boundaries as the compiler
- would.
-\end_layout
-
-\begin_layout Description
-Pyarray_DescrAlignConverter2 (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-PyArray_Descr**
-\family default
- dtype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Like
-\family typewriter
-PyArray_DescrConverter2
-\family default
- except it aligns C-struct-like objects on word-boundaries as the compiler
- would.
-\end_layout
-
-\begin_layout Description
-PyArray_FieldNames (
-\family typewriter
-PyObject*
-\family default
-)(
-\family typewriter
-PyObject*
-\family default
- dict)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Take the fields dictionary,
-\family typewriter
-\emph on
-dict
-\family default
-\emph default
-, such as the one attached to a data-type object and construct an ordered-list
- of field names such as is stored in the names field of the
-\family typewriter
-PyArray_Descr
-\family default
- object.
-
-\end_layout
-
-\begin_layout Subsection
-Conversion Utilities
-\end_layout
-
-\begin_layout Subsubsection
-For use with
-\family typewriter
-PyArg_ParseTuple
-\end_layout
-
-\begin_layout Standard
-All of these functions can be used in
-\family typewriter
-PyArg_ParseTuple
-\family default
-(...) with the
-\begin_inset Quotes eld
-\end_inset
-
-O&
-\begin_inset Quotes erd
-\end_inset
-
- format specifier to automatically convert any Python object to the required
- C-object.
- All of these functions return
-\family typewriter
-NPY_SUCCEED
-\family default
- if successful and
-\family typewriter
-NPY_FAIL
-\family default
- if not.
- The first argument to all of these function is a Python object.
- The second argument is the
-\series bold
-address
-\series default
- of the C-type to convert the Python object to.
-
-\end_layout
-
-\begin_layout Warning
-Be sure to understand what steps you should take to manage the memory when
- using these conversion functions.
- These functions can require freeing memory, and/or altering the reference
- counts of specific objects based on your use.
-\end_layout
-
-\begin_layout Description
-PyArray_Converter (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-PyObject**
-\family default
- address)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert any Python object to a
-\family typewriter
-PyArrayObject
-\family default
-.
- If
-\family typewriter
-PyArray_Check
-\family default
-(
-\family typewriter
-\emph on
-obj
-\family default
-\emph default
-) is TRUE then its reference count is incremented and a reference placed
- in
-\emph on
-address
-\emph default
-.
- If
-\emph on
-obj
-\emph default
- is not an array, then convert it to an array using
-\family typewriter
-PyArray_FromAny
-\family default
-.
- No matter what is returned, you must DECREF the object returned by this
- routine in
-\emph on
-address
-\emph default
- when you are done with it.
-
-\end_layout
-
-\begin_layout Description
-PyArray_OutputConverter (
-\family typewriter
-int
-\family default
-)(
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-PyArrayObject**
-\family default
- address)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is a default converter for output arrays given to functions.
- If
-\emph on
-obj
-\emph default
- is
-\family typewriter
-Py_None
-\family default
- or
-\family typewriter
-NULL
-\family default
-, then
-\emph on
-*address
-\emph default
- will be
-\family typewriter
-NULL
-\family default
- but the call will succeed.
- If
-\family typewriter
-PyArray_Check
-\family default
-(
-\emph on
-obj
-\emph default
-) is TRUE then it is returned in
-\emph on
-*address
-\emph default
- without incrementing its reference count.
-
-\end_layout
-
-\begin_layout Description
-PyArray_IntpConverter (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-PyArray_Dims*
-\family default
- seq)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert any Python sequence,
-\emph on
-obj
-\emph default
-, smaller than
-\family typewriter
-NPY_MAXDIMS
-\family default
- to a C-array of
-\family typewriter
-npy_intp
-\family default
-.
- The Python object could also be a single number.
- The
-\emph on
-seq
-\emph default
- variable is a pointer to a structure with members ptr and len.
- On successful return,
-\emph on
-seq
-\emph default
-->ptr contains a pointer to memory that must be freed to avoid a memory
- leak.
- The restriction on memory size allows this converter to be conveniently
- used for sequences intended to be interpreted as array shapes.
-
-\end_layout
-
-\begin_layout Description
-PyArray_BufferConverter (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-PyArray_Chunk*
-\family default
- buf)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert any Python object,
-\emph on
-obj
-\emph default
-, with a (single-segment) buffer interface to a variable with members that
- detail the object's use of its chunk of memory.
- The
-\emph on
-buf
-\emph default
- variable is a pointer to a structure with base, ptr, len, and flags members.
- The
-\family typewriter
-PyArray_Chunk
-\family default
- structure is binary compatibile with the Python's buffer object (through
- its len member on 32-bit platforms and its ptr member on 64-bit platforms
- or in Python 2.5).
- On return, the base member is set to
-\emph on
-obj
-\emph default
- (or its base if
-\emph on
-obj
-\emph default
- is already a buffer object pointing to another object).
- If you need to hold on to the memory be sure to INCREF the base member.
- The chunk of memory is pointed to by
-\emph on
-buf
-\emph default
-->ptr member and has length
-\emph on
-buf
-\emph default
-->len.
- The flags member of
-\emph on
-buf
-\emph default
- is
-\family typewriter
-NPY_BEHAVED_RO
-\family default
- with the
-\family typewriter
-NPY_WRITEABLE
-\family default
- flag set if
-\emph on
-obj
-\emph default
- has a writeable buffer interface.
-
-\end_layout
-
-\begin_layout Description
-PyArray_AxisConverter (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject
-\family default
-* obj,
-\family typewriter
-int*
-\family default
- axis)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert a Python object,
-\emph on
-obj
-\emph default
-, representing an axis argument to the proper value for passing to the functions
- that take an integer axis.
- Specifically, if
-\emph on
-obj
-\emph default
- is None,
-\emph on
-axis
-\emph default
- is set to
-\family typewriter
-NPY_MAXDIMS
-\family default
- which is interpreted correctly by the C-API functions that take axis arguments.
-\end_layout
-
-\begin_layout Description
-PyArray_BoolConverter (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-Bool*
-\family default
- value)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert any Python object,
-\emph on
-obj
-\emph default
-, to
-\family typewriter
-NPY_TRUE
-\family default
- or
-\family typewriter
-NPY_FALSE
-\family default
-, and place the result in
-\emph on
-value
-\emph default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_ByteorderConverter (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-char*
-\family default
- endian)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert Python strings into the corresponding byte-order character: '>',
- '<', 's', '=', or '|'.
-
-\end_layout
-
-\begin_layout Description
-PyArray_SortkindConverter (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-NPY_SORTKIND*
-\family default
- sort)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert Python strings into one of
-\family typewriter
-NPY_QUICKSORT
-\family default
- (starts with 'q' or 'Q') ,
-\family typewriter
-NPY_HEAPSORT
-\family default
- (starts with 'h' or 'H'), or
-\family typewriter
-NPY_MERGESORT
-\family default
- (starts with 'm' or 'M').
-
-\end_layout
-
-\begin_layout Description
-PyArray_SearchsideConverter (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-NPY_SEARCHSIDE*
-\family default
- side)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert Python strings into one of
-\family typewriter
-NPY_SEARCHLEFT
-\family default
- (starts with 'l' or 'L'), or
-\family typewriter
-NPY_SEARCHRIGHT
-\family default
- (starts with 'r' or 'R').
-
-\end_layout
-
-\begin_layout Subsubsection
-Other conversions
-\end_layout
-
-\begin_layout Description
-PyArray_PyIntAsInt (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert all kinds of Python objects (including arrays and array scalars)
- to a standard integer.
- On error, -1 is returned and an exception set.
- You may find useful the macro:
-\end_layout
-
-\begin_layout LyX-Code
-#define error_converting(x) (((x) == -1) && PyErr_Occurred()
-\end_layout
-
-\begin_layout Description
-PyArray_PyIntAsIntp (
-\family typewriter
-npy_intp
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert all kinds of Python objects (including arrays and array scalars)
- to a (platform-pointer-sized) integer.
- On error, -1 is returned and an exception set.
-
-\end_layout
-
-\begin_layout Description
-PyArray_IntpFromSequence (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- seq,
-\family typewriter
-npy_intp*
-\family default
- vals,
-\family typewriter
-int
-\family default
- maxvals)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert any Python sequence (or single Python number) passed in as
-\emph on
-seq
-\emph default
- to (up to)
-\emph on
-maxvals
-\emph default
- pointer-sized integers and place them in the
-\emph on
-vals
-\emph default
- array.
- The sequence can be smaller then
-\emph on
-maxvals
-\emph default
- as the number of converted objects is returned.
-
-\end_layout
-
-\begin_layout Description
-PyArray_TypestrConvert (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-int
-\family default
- itemsize,
-\family typewriter
-int
-\family default
- gentype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert typestring characters (with
-\emph on
-itemsize
-\emph default
-) to basic enumerated data types.
- The typestring character corresponding to signed and unsigned integers,
- floating point numbers, and complex-floating point numbers are recognized
- and converted.
- Other values of gentype are returned.
- This function can be used to convert, for example, the string 'f4' to
-\family typewriter
-NPY_FLOAT32
-\family default
-.
-
-\end_layout
-
-\begin_layout Subsection
-Miscellaneous
-\end_layout
-
-\begin_layout Subsubsection
-Importing the API
-\end_layout
-
-\begin_layout Standard
-In order to make use of the C-API from another extension module, the
-\family typewriter
-import_array
-\family default
-() command must be used.
- If the extension module is self-contained in a single .c file, then that
- is all that needs to be done.
- If, however, the extension module involves multiple files where the C-API
- is needed then some additional steps must be taken.
-\end_layout
-
-\begin_layout Description
-import_array (void) (void)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function must be called in the initialization section of a module
- that will make use of the C-API.
- It imports the module where the function-pointer table is stored and points
- the correct variable to it.
-
-\end_layout
-
-\begin_layout Description
-PY_ARRAY_UNIQUE_SYMBOL
-\end_layout
-
-\begin_layout Description
-NO_IMPORT_ARRAY
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Using these #defines you can use the C-API in multiple files for a single
- extension module.
- In each file you must define
-\family typewriter
-PY_ARRAY_UNIQUE_SYMBOL
-\family default
- to some name that will hold the C-API (
-\emph on
-e.g.
-
-\emph default
- myextension_ARRAY_API).
- This must be done
-\series bold
-before
-\series default
- including the numpy/arrayobject.h file.
- In the module intialization routine you call
-\family typewriter
-import_array
-\family default
-().
- In addition, in the files that do not have the module initialization sub_routin
-e define
-\family typewriter
-NO_IMPORT_ARRAY
-\family default
- prior to including numpy/arrayobject.h.
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Suppose I have two files coolmodule.c and coolhelper.c which need to be compiled
- and linked into a single extension module.
- Suppose coolmodule.c contains the required initcool module initialization
- function (with the import_array() function called).
- Then, coolmodule.c would have at the top:
-\end_layout
-
-\begin_layout LyX-Code
-#define PY_ARRAY_UNIQUE_SYMBOL cool_ARRAY_API
-\end_layout
-
-\begin_layout LyX-Code
-#include numpy/arrayobject.h
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- On the other hand, coolhelper.c would contain at the top:
-\end_layout
-
-\begin_layout LyX-Code
-#define PY_ARRAY_UNIQUE_SYMBOL cool_ARRAY_API
-\end_layout
-
-\begin_layout LyX-Code
-#define NO_IMPORT_ARRAY
-\end_layout
-
-\begin_layout LyX-Code
-#include numpy/arrayobject.h
-\end_layout
-
-\begin_layout Description
-PyArray_GetNDArrayCVersion (
-\family typewriter
-unsigned
-\family default
-
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-void
-\family default
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This just returns the value
-\family typewriter
-NPY_VERSION
-\family default
-.
- Because it is in the C-API, however, comparing the output of this function
- from the value defined in the current header gives a way to test if the
- C-API has changed thus requiring a re-compilation of extension modules
- that use the C-API.
-
-\end_layout
-
-\begin_layout Subsubsection
-Internal Flexibility
-\end_layout
-
-\begin_layout Description
-PyArray_SetNumericOps (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- dict)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- NumPy stores an internal table of Python callable objects that are used
- to implement arithmetic operations for arrays as well as certain array
- calculation methods.
- This function allows the user to replace any or all of these Python objects
- with their own versions.
- The keys of the dictionary,
-\emph on
-dict
-\emph default
-, are the named functions to replace and the paired value is the Python
- callable object to use.
- Care should be taken that the function used to replace an internal array
- operation does not itself call back to that internal array operation (unless
- you have designed the function to handle that), or an unchecked infinite
- recursion can result (possibly causing program crash).
- The key names that represent operations that can be replaced are:
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-add
-\series default
-,
-\series bold
-subtract
-\series default
-,
-\series bold
-multiply
-\series default
-,
-\series bold
-divide
-\series default
-,
-\series bold
-remainder
-\series default
-,
-\series bold
-power
-\series default
-,
-\series bold
-square, reciprocal, ones_like, sqrt
-\series default
-,
-\series bold
-negative
-\series default
-,
-\series bold
-absolute
-\series default
-,
-\series bold
-invert
-\series default
-,
-\series bold
-left_shift
-\series default
-,
-\series bold
-right_shift
-\series default
-,
-\series bold
-bitwise_and
-\series default
-,
-\series bold
-bitwise_xor
-\series default
-,
-\series bold
-bitwise_or
-\series default
-,
-\series bold
-less
-\series default
-,
-\series bold
-less_equal
-\series default
-,
-\series bold
-equal
-\series default
-,
-\series bold
-not_equal
-\series default
-,
-\series bold
-greater
-\series default
-,
-\series bold
-greater_equal
-\series default
-,
-\series bold
-floor_divide
-\series default
-,
-\series bold
-true_divide
-\series default
-,
-\series bold
-logical_or
-\series default
-,
-\series bold
-logical_and
-\series default
-,
-\series bold
-floor
-\series default
-,
-\series bold
-ceil
-\series default
-,
-\series bold
-maximum
-\series default
-,
-\series bold
-minimum
-\series default
-,
-\series bold
-rint
-\series default
-.
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These functions are included here because they are used at least once in
- the array object's methods.
- The function returns -1 (without setting a Python Error) if one of the
- objects being assigned is not callable.
-\end_layout
-
-\begin_layout Description
-PyArray_GetNumericOps (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-void
-\family default
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a Python dictionary containing the callable Python objects stored
- in the the internal arithmetic operation table.
- The keys of this dictionary are given in the explanation for
-\family typewriter
-PyArray_SetNumericOps
-\family default
-.
-\end_layout
-
-\begin_layout Description
-PyArray_SetStringFunction (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- op,
-\family typewriter
-int
-\family default
- repr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function allows you to alter the tp_str and tp_repr methods of the
- array object to any Python function.
- Thus you can alter what happens for all arrays when str(arr) or repr(arr)
- is called from Python.
- The function to be called is passed in as
-\emph on
-op
-\emph default
-.
- If
-\emph on
-repr
-\emph default
- is non-zero, then this function will be called in response to repr(arr),
- otherwise the function will be called in response to str(arr).
- No check on whether or not
-\emph on
-op
-\emph default
- is callable is performed.
- The callable passed in to
-\emph on
-op
-\emph default
- should expect an array argument and should return a string to be printed.
-\end_layout
-
-\begin_layout Subsubsection
-Memory management
-\end_layout
-
-\begin_layout Description
-PyDataMem_NEW (
-\family typewriter
-char*
-\family default
-) (
-\family typewriter
-size_t
-\family default
- nbytes)
-\end_layout
-
-\begin_layout Description
-PyDataMem_FREE (
-\family typewriter
-char*
-\family default
- ptr)
-\end_layout
-
-\begin_layout Description
-PyDataMem_RENEW (
-\family typewriter
-char*
-\family default
-) (
-\family typewriter
-void *
-\family default
- ptr,
-\family typewriter
-size_t
-\family default
- newbytes)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Macros to allocate, free, and reallocate memory.
- These macros are used internally to create arrays.
-\end_layout
-
-\begin_layout Description
-PyDimMem_NEW (
-\family typewriter
-npy_intp*
-\family default
-) (nd)
-\end_layout
-
-\begin_layout Description
-PyDimMem_FREE (
-\family typewriter
-npy_intp*
-\family default
- ptr)
-\end_layout
-
-\begin_layout Description
-PyDimMem_RENEW (
-\family typewriter
-npy_intp*
-\family default
-) (
-\family typewriter
-npy_intp*
-\family default
- ptr,
-\family typewriter
-npy_intp
-\family default
- newnd)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Macros to allocate, free, and reallocate dimension and strides memory.
-\end_layout
-
-\begin_layout Description
-PyArray_malloc (nbytes)
-\end_layout
-
-\begin_layout Description
-PyArray_free (ptr)
-\end_layout
-
-\begin_layout Description
-PyArray_realloc (ptr, nbytes)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These macros use different memory allocators, depending on the constant
-
-\family typewriter
-NPY_USE_PYMEM
-\family default
-.
- The system malloc is used when NPY_USE_PYMEM is 0, if NPY_USE_PYMEM is
- 1, then the Python memory allocator is used.
-
-\end_layout
-
-\begin_layout Subsubsection
-Threading support
-\end_layout
-
-\begin_layout Standard
-These macros are only meaningful if
-\family typewriter
-NPY_ALLOW_THREADS
-\family default
- evaluates True during compilation of the extension module.
- Otherwise, these macros are equivalent to whitespace.
- Python uses a single Global Interpreter Lock (GIL) for each Python process
- so that only a single thread may excecute at a time (even on multi-cpu
- machines).
- When calling out to a compiled function that may take time to compute (and
- does not have side-effects for other threads like updated global variables),
- the GIL should be released so that other Python threads can run while the
- time-consuming calculations are performed.
- This can be accomplished using two groups of macros.
- Typically, if one macro in a group is used in a code block, all of them
- must be used in the same code block.
- Currently,
-\family typewriter
-NPY_ALLOW_THREADS
-\family default
- is defined to the python-defined
-\family typewriter
-WITH_THREADS
-\family default
- constant unless the environment variable
-\family typewriter
-NPY_NOSMP
-\family default
- is set in which case
-\family typewriter
-NPY_ALLOW_THREADS
-\family default
- is defined to be 0.
-
-\end_layout
-
-\begin_layout Description
-Group\InsetSpace ~
-1 This group is used to call code that may take some time but does
- not use any Python C-API calls.
- Thus, the GIL should be released during its calculation.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-NPY_BEGIN_ALLOW_THREADS Equivalent to
-\family typewriter
-Py_BEGIN_ALLOW_THREADS
-\family default
- except it uses
-\family typewriter
-NPY_ALLOW_THREADS
-\family default
- to determine if the macro if replaced with white-space or not.
-
-\end_layout
-
-\begin_layout Description
-NPY_END_ALLOW_THREADS Equivalent to
-\family typewriter
-Py_END_ALLOW_THREADS
-\family default
- except it uses
-\family typewriter
-NPY_ALLOW_THREADS
-\family default
- to determine if the macro if replaced with white-space or not.
-
-\end_layout
-
-\begin_layout Description
-NPY_BEGIN_THREADS_DEF Place in the variable declaration area.
- This macro sets up the variable needed for storing the Python state.
-\end_layout
-
-\begin_layout Description
-NPY_BEGIN_THREADS Place right before code that does not need the Python
- interpreter (no Python C-API calls).
- This macro saves the Python state and releases the GIL.
-\end_layout
-
-\begin_layout Description
-NPY_END_THREADS Place right after code that does not need the Python interpreter.
- This macro acquires the GIL and restores the Python state from the saved
- variable.
-\end_layout
-
-\begin_layout Description
-NPY_BEGIN_THREADS_DESCR (
-\family typewriter
-PyArray_Descr*
-\family default
- dtype) Useful to release the GIL only if
-\emph on
-dtype
-\emph default
- does not contain arbitrary Python objects which may need the Python interpreter
- during execution of the loop.
- Equivalent to
-\end_layout
-
-\begin_layout Description
-NPY_END_THREADS_DESCR (
-\family typewriter
-PyArray_Descr*
-\family default
- dtype) Useful to regain the GIL in situations where it was released using
- the BEGIN form of this macro.
-
-\end_layout
-
-\end_deeper
-\begin_layout Description
-Group\InsetSpace ~
-2 This group is used to re-acquire the Python GIL after it has been
- released.
- For example, suppose the GIL has been released (using the previous calls),
- and then some path in the code (perhaps in a different subroutine) requires
- use of the Python C-API, then these macros are useful to acquire the GIL.
- These macros accomplish essentially a reverse of the previous three (acquire
- the LOCK saving what state it had) and then re-release it with the saved
- state.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-NPY_ALLOW_C_API_DEF Place in the variable declaration area to set up the
- necessary variable.
-
-\end_layout
-
-\begin_layout Description
-NPY_ALLOW_C_API Place before code that needs to call the Python C-API (when
- it is known that the GIL has already been released).
-
-\end_layout
-
-\begin_layout Description
-NPY_DISABLE_C_API Place after code that needs to call the Python C-API (to
- re-release the GIL).
-
-\end_layout
-
-\end_deeper
-\begin_layout Tip
-Never use semicolons after the threading support macros.
-\end_layout
-
-\begin_layout Subsubsection
-Priority
-\end_layout
-
-\begin_layout Description
-NPY_PRIOIRTY Default priority for arrays.
-\end_layout
-
-\begin_layout Description
-NPY_SUBTYPE_PRIORITY Default subtype priority.
-\end_layout
-
-\begin_layout Description
-NPY_SCALAR_PRIORITY Default scalar priority (very small)
-\end_layout
-
-\begin_layout Description
-PyArray_GetPriority (
-\family typewriter
-double
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-double
-\family default
- def)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the
-\series bold
-__array_priority__
-\series default
- attribute (converted to a double) of
-\emph on
-obj
-\emph default
- or
-\emph on
-def
-\emph default
- if no attribute of that name exists.
- Fast returns that avoid the attribute lookup are provided for objects of
- type
-\family typewriter
-PyArray_Type
-\family default
-.
-
-\end_layout
-
-\begin_layout Subsubsection
-Default buffers
-\end_layout
-
-\begin_layout Description
-NPY_BUFSIZE Default size of the user-settable internal buffers.
-\end_layout
-
-\begin_layout Description
-NPY_MIN_BUFSIZE Smallest size of user-settable internal buffers.
-\end_layout
-
-\begin_layout Description
-NPY_MAX_BUFSIZE Largest size allowed for the user-settable buffers.
-\end_layout
-
-\begin_layout Subsubsection
-Other constants
-\end_layout
-
-\begin_layout Description
-NPY_NUM_FLOATTYPE The number of floating-point types
-\end_layout
-
-\begin_layout Description
-NPY_MAXDIMS The maximum number of dimensions allowed in arrays.
-\end_layout
-
-\begin_layout Description
-NPY_VERSION The current version of the ndarray object (check to see if this
- variable is defined to guarantee the numpy/arrayobject.h header is being
- used).
-
-\end_layout
-
-\begin_layout Description
-NPY_FALSE Defined as 0 for use with Bool.
-\end_layout
-
-\begin_layout Description
-NPY_TRUE Defined as 1 for use with Bool.
-\end_layout
-
-\begin_layout Description
-NPY_FAIL The return value of failed converter functions which are called
- using the
-\begin_inset Quotes eld
-\end_inset
-
-O&
-\begin_inset Quotes erd
-\end_inset
-
- syntax in PyArg_ParseTuple-like functions.
-\end_layout
-
-\begin_layout Description
-NPY_SUCCEED The return value of successful converter functions which are
- called using the
-\begin_inset Quotes eld
-\end_inset
-
-O&
-\begin_inset Quotes erd
-\end_inset
-
- syntax in PyArg_ParseTuple-like functions.
-\end_layout
-
-\begin_layout Subsubsection
-Miscellaneous Macros
-\end_layout
-
-\begin_layout Description
-PyArray_SAMESHAPE (a1, a2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluates as True if arrays
-\emph on
-a1
-\emph default
- and
-\emph on
-a2
-\emph default
- have the same shape.
-
-\end_layout
-
-\begin_layout Description
-PyArray_MAX (a,b)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the maximum of
-\emph on
-a
-\emph default
- and
-\emph on
-b
-\emph default
-.
- If (
-\emph on
-a
-\emph default
-) or (
-\emph on
-b
-\emph default
-) are expressions they are evaluated twice.
-\end_layout
-
-\begin_layout Description
-PyArray_MIN (a,b)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the minimum of
-\emph on
-a
-\emph default
- and
-\emph on
-b
-\emph default
-.
- If (
-\emph on
-a
-\emph default
-) or (
-\emph on
-b
-\emph default
-) are expressions they are evaluated twice.
-\end_layout
-
-\begin_layout Description
-PyArray_CLT (a,b)
-\end_layout
-
-\begin_layout Description
-PyArray_CGT (a,b)
-\end_layout
-
-\begin_layout Description
-PyArray_CLE (a,b)
-\end_layout
-
-\begin_layout Description
-PyArray_CGE (a,b)
-\end_layout
-
-\begin_layout Description
-PyArray_CEQ (a,b)
-\end_layout
-
-\begin_layout Description
-PyArray_CNE (a,b)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Implements the complex comparisons between two complex numbers (structures
- with a real and imag member) using NumPy's definition of the ordering which
- is lexicographic: comparing the real parts first and then the complex parts
- if the real parts are equal.
-
-\end_layout
-
-\begin_layout Description
-PyArray_REFCOUNT (
-\family typewriter
-PyObject*
-\family default
- op)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the reference count of any Python object.
-
-\end_layout
-
-\begin_layout Description
-PyArray_XDECREF_ERR (PyObject *obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- DECREF's an array object which may have the
-\family typewriter
-NPY_UPDATEIFCOPY
-\family default
- flag set without causing the contents to be copied back into the original
- array.
- Resets the
-\family typewriter
-NPY_WRITEABLE
-\family default
- flag on the base object.
- This is useful for recovering from an error condition when
-\family typewriter
-NPY_UPDATEIFCOPY
-\family default
- is used.
-
-\end_layout
-
-\begin_layout Subsubsection
-Enumerated Types
-\end_layout
-
-\begin_layout Description
-NPY_SORTKIND A special variable-type which can take on the values
-\series bold
-NPY_
-\series default
-<KIND> where <KIND> is
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-QUICKSORT
-\series default
-,
-\series bold
-HEAPSORT
-\series default
-,
-\series bold
-MERGESORT
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\series bold
-NPY_NSORTS
-\series default
- is defined to be the number of sorts.
-\end_layout
-
-\begin_layout Description
-NPY_SCALARKIND A special variable type indicating the number of
-\begin_inset Quotes eld
-\end_inset
-
-kinds
-\begin_inset Quotes erd
-\end_inset
-
- of scalars distinguished in determining scalar-coercion rules.
- This variable can take on the values NPY_<KIND> where <KIND> can be
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-NOSCALAR
-\series default
-,
-\series bold
-BOOL_SCALAR
-\series default
-,
-\series bold
-INTPOS_SCALAR
-\series default
-,
-\series bold
-INTNEG_SCALAR
-\series default
-,
-\series bold
-FLOAT_SCALAR
-\series default
-,
-\series bold
-COMPLEX_SCALAR
-\series default
-,
-\series bold
-OBJECT_SCALAR
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\series bold
-NPY_NSCALARKINDS
-\series default
- is defined to be the number of scalar kinds (not including
-\family typewriter
-NPY_NOSCALAR
-\family default
-).
-
-\end_layout
-
-\begin_layout Description
-NPY_ORDER A variable type indicating the order that an array should be interpret
-ed in.
- The value of a variable of this type can be
-\series bold
-NPY_
-\series default
-<ORDER> where <ORDER> is
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-ANYORDER
-\series default
-,
-\series bold
-CORDER
-\series default
-,
-\series bold
-FORTRANORDER
-\end_layout
-
-\begin_layout Description
-NPY_CLIPMODE A variable type indicating the kind of clipping that should
- be applied in certain functions.
- The value of a variable of this type can be
-\series bold
-NPY_
-\series default
-<MODE> where <MODE> is
-\end_layout
-
-\begin_layout Quote
-
-\series bold
-CLIP
-\series default
-,
-\series bold
-WRAP
-\series default
-,
-\series bold
-RAISE
-\begin_inset LatexCommand index
-name "ndarray!C-API|)"
-
-\end_inset
-
-
-\begin_inset LatexCommand index
-name "C-API!array|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-UFunc API
-\begin_inset LatexCommand index
-name "ufunc!C-API|("
-
-\end_inset
-
-
-\begin_inset LatexCommand index
-name "C-API!ufunc|("
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Subsection
-Constants
-\end_layout
-
-\begin_layout Description
-UFUNC_ERR_<HANDLER>
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- <HANDLER> can be
-\series bold
-IGNORE
-\series default
-,
-\series bold
-WARN
-\series default
-,
-\series bold
-RAISE
-\series default
-, or
-\series bold
-CALL
-\end_layout
-
-\begin_layout Description
-UFUNC_<THING>_<ERR>
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- <THING> can be
-\series bold
-MASK
-\series default
-,
-\series bold
-SHIFT
-\series default
-, or
-\series bold
-FPE
-\series default
-, and <ERR> can be
-\series bold
-DIVIDEBYZERO
-\series default
-,
-\series bold
-OVERFLOW
-\series default
-,
-\series bold
-UNDERFLOW
-\series default
-, and
-\series bold
-INVALID
-\series default
-.
-\end_layout
-
-\begin_layout Description
-PyUFunc_<VALUE> <VALUE> can be
-\series bold
-One
-\series default
- (1),
-\series bold
-Zero
-\series default
- (0), or
-\series bold
-None
-\series default
- (-1)
-\end_layout
-
-\begin_layout Subsection
-Macros
-\end_layout
-
-\begin_layout Description
-NPY_LOOP_BEGIN_THREADS
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Used in universal function code to only release the Python GIL if loop->obj
- is not true (
-\emph on
-i.e.
-
-\emph default
- this is not an OBJECT array loop).
- Requires use of
-\family typewriter
-NPY_BEGIN_THREADS_DEF
-\family default
- in variable declaration area.
-\end_layout
-
-\begin_layout Description
-NPY_LOOP_END_THREADS
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Used in universal function code to re-acquire the Python GIL if it was
- released (because loop->obj was not true).
-
-\end_layout
-
-\begin_layout Description
-UFUNC_CHECK_ERROR (loop)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A macro used internally to check for errors and goto fail if found.
- This macro requires a fail label in the current code block.
- The
-\emph on
-loop
-\emph default
- variable must have at least members (obj, errormask, and errorobj).
- If
-\emph on
-loop
-\emph default
-->obj is nonzero, then
-\family typewriter
-PyErr_Occurred
-\family default
-() is called (meaning the GIL must be held).
- If
-\emph on
-loop
-\emph default
-->obj is zero, then if
-\emph on
-loop
-\emph default
-->errormask is nonzero,
-\family typewriter
-PyUFunc_checkfperr
-\family default
- is called with arguments
-\emph on
-loop
-\emph default
-->errormask and
-\emph on
-loop
-\emph default
-->errobj.
- If the result of this check of the IEEE floating point registers is true
- then the code redirects to the fail label which must be defined.
-\end_layout
-
-\begin_layout Description
-UFUNC_CHECK_STATUS (
-\emph on
-ret
-\emph default
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A macro that expands to platform-dependent code.
- The
-\emph on
-ret
-\emph default
- variable can can be any integer.
- The
-\family typewriter
-UFUNC_FPE_
-\family default
-<ERR> bits are set in
-\emph on
-ret
-\emph default
- according to the status of the corresponding error flags of the floating
- point processor.
-
-\end_layout
-
-\begin_layout Subsection
-Functions
-\end_layout
-
-\begin_layout Description
-PyUFunc_FromFuncAndData (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyUFuncGenericFunction*
-\family default
- func,
-\family typewriter
-void**
-\family default
- data,
-\family typewriter
-char*
-\family default
- types,
-\family typewriter
-int
-\family default
- ntypes,
-\family typewriter
-int
-\family default
- nin,
-\family typewriter
-int
-\family default
- nout,
-\family typewriter
-int
-\family default
- identity,
-\family typewriter
-char*
-\family default
- name,
-\family typewriter
-char*
-\family default
- doc,
-\family typewriter
-int
-\family default
- check_return)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create a new broadcasting universal function from required variables.
- Each ufunc builds around the notion of an element-by-element operation.
- Each ufunc object contains pointers to 1-d loops implementing the basic
- functionality for each supported type.
-
-\end_layout
-
-\begin_layout Description
-nin The number of inputs to this operation.
-\end_layout
-
-\begin_layout Description
-nout The number of outputs
-\end_layout
-
-\begin_layout Description
-ntypes How many different data-type
-\begin_inset Quotes eld
-\end_inset
-
-signatures
-\begin_inset Quotes erd
-\end_inset
-
- the ufunc has implemented.
-
-\end_layout
-
-\begin_layout Description
-func Must to an array of length
-\emph on
-ntypes
-\emph default
- containing
-\family typewriter
-PyUFuncGenericFunction
-\family default
- items.
- These items are pointers to functions that acutally implement the underlying
- (element-by-element) function
-\begin_inset Formula $N$
-\end_inset
-
- times.
- T
-\end_layout
-
-\begin_layout Description
-types Must be of length (
-\emph on
-nin
-\emph default
-+
-\emph on
-nout
-\emph default
-)
-\emph on
-*ntypes
-\emph default
-, and it contains the data-types (built-in only) that the corresponding
- function in the
-\emph on
-func
-\emph default
- array can deal with.
-
-\end_layout
-
-\begin_layout Description
-data Should be
-\family typewriter
-NULL
-\family default
- or a pointer to an array of size
-\emph on
-ntypes
-\emph default
-.
- This array may contain arbitrary extra-data to be passed to the corresponding
- 1-d loop function in the func array.
-
-\end_layout
-
-\begin_layout Description
-name The name for the ufunc.
-
-\end_layout
-
-\begin_layout Description
-doc Allows passing in a documentation string to be stored with the ufunc.
- The documentation string should not contain the name of the function or
- the calling signature as that will be dynamically determined from the object
- and available when accessing the
-\series bold
-__doc__
-\series default
- attribute of the ufunc.
-
-\end_layout
-
-\begin_layout Description
-check_return Unused and present for backwards compatibility of the C-API.
- A corresponding
-\emph on
-check_return
-\emph default
- integer does exist in the ufunc structure and it does get set with this
- value when the ufunc object is created.
-
-\end_layout
-
-\begin_layout Description
-PyUFunc_RegisterLoopForType (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyUFuncObject*
-\family default
- ufunc,
-\family typewriter
-int
-\family default
- usertype,
-\family typewriter
-PyUFuncGenericFunction
-\family default
- function,
-\family typewriter
-int*
-\family default
- arg_types,
-\family typewriter
-void*
-\family default
- data)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function allows the user to register a 1-d loop with an already-created
- ufunc to be used whenever the ufunc is called with any of its input arguments
- as the user-defined data-type.
- This is needed in order to make ufuncs work with built-in data-types.
- The data-type must have been previously registered with the numpy system.
- The loop is passed in as
-\emph on
-function
-\emph default
-.
- This loop can take arbitrary data which should be passed in as
-\emph on
-data
-\emph default
-.
- The data-types the loop requires are passed in as
-\emph on
-arg_types
-\emph default
- which must be a pointer to memory at least as large as ufunc->nargs.
-\end_layout
-
-\begin_layout Description
-PyUFunc_ReplaceLoopBySignature (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyUFuncObject*
-\family default
- ufunc,
-\family typewriter
-PyUFuncGenericFunction
-\family default
- newfunc,
-\family typewriter
-int*
-\family default
- signature,
-\family typewriter
-PyUFuncGenericFunction*
-\family default
- oldfunc)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Replace a 1-d loop matching the given
-\emph on
-signature
-\emph default
- in the already-created
-\emph on
-ufunc
-\emph default
- with the new 1-d loop newfunc.
- Return the old 1-d loop function in
-\emph on
-oldfunc
-\emph default
-.
- Return 0 on success and -1 on failure.
- This function works only with built-in types (use
-\family typewriter
-PyUFunc_RegisterLoopForType
-\family default
- for user-defined types).
- A signature is an array of data-type numbers indicating the inputs followed
- by the outputs assumed by the 1-d loop.
-
-\end_layout
-
-\begin_layout Description
-PyUFunc_GenericFunction (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyUFuncObject*
-\family default
- self,
-\family typewriter
-PyObject*
-\family default
- args,
-\family typewriter
-PyArrayObject**
-\family default
- mps)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A generic ufunc call.
- The ufunc is passed in as
-\emph on
-self
-\emph default
-, the arguments to the ufunc as
-\emph on
-args
-\emph default
-.
- The
-\emph on
-mps
-\emph default
- argument is an array of
-\family typewriter
-PyArrayObject
-\family default
- pointers containing the converted input arguments as well as the ufunc
- outputs on return.
- The user is responsible for managing this array and receives a new reference
- for each array in
-\emph on
-mps
-\emph default
-.
- The total number of arrays in
-\emph on
-mps
-\emph default
- is given by
-\emph on
-self
-\emph default
-->nin +
-\emph on
-self
-\emph default
-->nout.
-\end_layout
-
-\begin_layout Description
-PyUFunc_checkfperr (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-int
-\family default
- errmask,
-\family typewriter
-PyObject*
-\family default
- errobj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A simple interface to the IEEE error-flag checking support.
- The
-\emph on
-errmask
-\emph default
- argument is a mask of
-\family typewriter
-UFUNC_MASK_<ERR>
-\family default
- bitmasks indicating which errors to check for (and how to check for them).
- The
-\emph on
-errobj
-\emph default
- must be a Python tuple with two elements: a string containing the name
- which will be used in any communication of error and either a callable
- Python object (call-back function) or
-\family typewriter
-Py_None
-\family default
-.
- The callable object will only be used if
-\family typewriter
-UFUNC_ERR_CALL
-\family default
- is set as the desired error checking method.
- This routine manages the GIL and is safe to call even after releasing the
- GIL.
- If an error in the IEEE-compatibile hardware is determined a -1 is returned,
- otherwise a 0 is returned.
-
-\end_layout
-
-\begin_layout Description
-PyUFunc_clearfperr (
-\family typewriter
-void
-\family default
-) ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Clear the IEEE error flags.
-
-\end_layout
-
-\begin_layout Description
-PyUFunc_GetPyValues (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char*
-\family default
- name,
-\family typewriter
-int*
-\family default
- bufsize,
-\family typewriter
-int*
-\family default
- errmask,
-\family typewriter
-PyObject**
-\family default
- errobj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Get the Python values used for ufunc processing from the thread-local storage
- area unless the defaults have been set in which case the name lookup is
- bypassed.
- The name is placed as a string in the first element of
-\emph on
-*errobj
-\emph default
-.
- The second element is the looked-up function to call on error callback.
- The value of the looked-up buffer-size to use is passed into
-\emph on
-bufsize
-\emph default
-, and the value of the error mask is placed into
-\emph on
-errmask
-\emph default
-.
-
-\end_layout
-
-\begin_layout Subsection
-Generic functions
-\end_layout
-
-\begin_layout Standard
-At the core of every ufunc is a collection of type-specific functions that
- defines the basic functionality for each of the supported types.
- These functions must evaluate the underlying function
-\begin_inset Formula $N\geq1$
-\end_inset
-
- times.
- Extra-data may be passed in that may be used during the calculation.
- This feature allows some general functions to be used as these basic looping
- functions.
- The general function has all the code needed to point variables to the
- right place and set up a function call.
- The general function assumes that the actual function to call is passed
- in as the extra data and calls it with the correct values.
- All of these functions are suitable for placing directly in the array of
- functions stored in the functions member of the PyUFuncObject structure.
-
-\end_layout
-
-\begin_layout Description
-PyUFunc_f_f_As_d_d (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_d_d (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_f_f (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_g_g (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_F_F_As_D_D (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_F_F (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_D_D (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_G_G (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type specific, core 1-d functions for ufuncs where each calculation is
- obtained by calling a function taking one input argument and returning
- one output.
- This function is passed in
-\family typewriter
-func
-\family default
-.
- The letters correspond to dtypechar's of the supported data types (
-\family typewriter
-f
-\family default
- - float,
-\family typewriter
-d
-\family default
- - double,
-\family typewriter
-g
-\family default
- - long double,
-\family typewriter
-F
-\family default
- - cfloat,
-\family typewriter
-D
-\family default
- - cdouble,
-\family typewriter
-G
-\family default
- - clongdouble).
- The argument
-\emph on
-func
-\emph default
- must support the same signature.
- The _As_X_X variants assume ndarray's of one data type but cast the values
- to use an underlying function that takes a different data type.
- Thus,
-\family typewriter
-PyUFunc_f_f_As_d_d
-\family default
- uses ndarrays of data type
-\family typewriter
-NPY_FLOAT
-\family default
- but calls out to a C-function that takes double and returns double.
-
-\end_layout
-
-\begin_layout Description
-PyUFunc_ff_f_As_dd_d (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_ff_f (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_dd_d (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_gg_g (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_FF_F_As_DD_D (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_DD_D (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_FF_F (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_GG_G (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Type specific, core 1-d functions for ufuncs where each calculation is
- obtained by calling a function taking two input arguments and returning
- one output.
- The underlying function to call is passed in as
-\emph on
-func
-\emph default
-.
- The letters correspond to dtypechar's of the specific data type supported
- by the general-purpose function.
- The argument
-\family typewriter
-func
-\family default
- must support the corresponding signature.
- The
-\family typewriter
-_As_XX_X
-\family default
- variants assume ndarrays of one data type but cast the values at each iteration
- of the loop to use the underlying function that takes a different data
- type.
-
-\end_layout
-
-\begin_layout Description
-PyUFunc_O_O (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-PyUFunc_OO_O (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- One-input, one-output, and two-input, one-output core 1-d functions for
- the
-\family typewriter
-NPY_OBJECT
-\family default
- data type.
- These functions handle reference count issues and return early on error.
- The actual function to call is
-\emph on
-func
-\emph default
- and it must accept calls with the signature (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
-) for
-\family typewriter
-PyUFunc_O_O
-\family default
- or (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject
-\family default
- *,
-\family typewriter
-PyObject
-\family default
- *) for
-\family typewriter
-PyUFunc_OO_O
-\family default
-.
-\end_layout
-
-\begin_layout Description
-PyUFunc_O_O_method (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This general purpose 1-d core function assumes that
-\emph on
-func
-\emph default
- is a string representing a method of the input object.
- For each iteration of the loop, the Python obejct is extracted from the
- array and its
-\emph on
-func
-\emph default
- method is called returning the result to the output array.
-
-\end_layout
-
-\begin_layout Description
-PyUFunc_OO_O_method (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This general purpose 1-d core function assumes that
-\emph on
-func
-\emph default
- is a string representing a method of the input object that takes one argument.
- The first argument in
-\emph on
-args
-\emph default
- is the method whose function is called, the second argument in
-\emph on
-args
-\emph default
- is the argument passed to the function.
- The output of the function is stored in the third entry of
-\emph on
-args
-\emph default
-.
-
-\end_layout
-
-\begin_layout Description
-PyUFunc_On_Om (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- func)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is the 1-d core function used by the dynamic ufuncs created by umath.frompy
-func(function, nin, nout).
- In this case
-\emph on
-func
-\emph default
- is a pointer to a
-\family typewriter
-PyUFunc_PyFuncData
-\family default
- structure which has definition {
-\family typewriter
-int
-\family default
- nin;
-\family typewriter
-int
-\family default
- nout;
-\family typewriter
-PyObject*
-\family default
- callable}.
- At each iteration of the loop, the
-\emph on
-nin
-\emph default
- input objects are exctracted from their object arrays and placed into an
- argument tuple, the Python
-\emph on
-callable
-\emph default
- is called with the input arguments, and the nout outputs are placed into
- their object arrays.
-
-\end_layout
-
-\begin_layout Section
-Importing the API
-\end_layout
-
-\begin_layout Description
-PY_UFUNC_UNIQUE_SYMBOL
-\end_layout
-
-\begin_layout Description
-NO_IMPORT_UFUNC
-\end_layout
-
-\begin_layout Description
-import_ufunc (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-void
-\family default
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These are the constants and functions for accessing the ufunc C-API from
- extension modules in precisely the same way as the array C-API can be accessed.
- The
-\family typewriter
-import_ufunc
-\family default
-() function must always be called (in the initialization subroutine of the
- extension module).
- If your extension module is in one file then that is all that is required.
- The other two constants are useful if your extension module makes use of
- multiple files.
- In that case, define
-\family typewriter
-PY_UFUNC_UNIQUE_SYMBOL
-\family default
- to something unique to your code and then in source files that do not contain
- the module initialization function but still need access to the UFUNC API,
- define
-\family typewriter
-PY_UFUNC_UNIQUE_SYMBOL
-\family default
- to the same name used previously and also define
-\family typewriter
-NO_IMPORT_UFUNC
-\family default
-.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The C-API is actually an array of function pointers.
- This array is created (and pointed to by a global variable) by import_ufunc.
- The global variable is either statically defined or allowed to be seen
- by other files depending on the state of
-\family typewriter
-Py_UFUNC_UNIQUE_SYMBOL
-\family default
- and
-\family typewriter
-NO_IMPORT_UFUNC
-\family default
-.
-
-\begin_inset LatexCommand index
-name "ufunc!C-API|)"
-
-\end_inset
-
-
-\begin_inset LatexCommand index
-name "C-API!ufunc|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Chapter
-How to extend NumPy
-\end_layout
-
-\begin_layout Quotation
-That which is static and repetitive is boring.
- That which is dynamic and random is confusing.
- In between lies art.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-John A.
- Locke
-\end_layout
-
-\begin_layout Quotation
-Science is a differential equation.
- Religion is a boundary condition.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Alan Turing
-\end_layout
-
-\begin_layout Section
-Writing an extension module
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "sec:Writing-an-extension"
-
-\end_inset
-
-
-\begin_inset LatexCommand index
-name "extension module|("
-
-\end_inset
-
-While the ndarray object is designed to allow rapid computation in Python,
- it is also designed to be general-purpose and satisfy a wide-variety of
- computational needs.
- As a result, if absolute speed is essential, there is no replacement for
- a well-crafted, compiled loop specific to your application and hardware.
- This is one of the reasons that numpy includes f2py so that an easy-to-use
- mechanisms for linking (simple) C/C++ and (arbitrary) Fortran code directly
- into Python are available.
- You are encouraged to use and improve this mechanism.
- The purpose of this section is not to document this tool but to document
- the more basic steps to writing an extension module that this tool depends
- on.
-
-\end_layout
-
-\begin_layout Standard
-When an extension module is written, compiled, and installed to somewhere
- in the Python path (sys.path), the code can then be imported into Python
- as if it were a standard python file.
- It will contain objects and methods that have been defined and compiled
- in C code.
- The basic steps for doing this in Python are well-documented and you can
- find more information in the documentation for Python itself available
- online at
-\begin_inset LatexCommand url
-name "www.python.org"
-target "http://www.python.org"
-
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Standard
-In addition to the Python C-API, there is a full and rich C-API for NumPy
- allowing sophisticated manipulations on a C-level.
- However, for most applications, only a few API calls will typically be
- used.
- If all you need to do is extract a pointer to memory along with some shape
- information to pass to another calculation routine, then you will use very
- different calls, then if you are trying to create a new array-like type
- or add a new data type for ndarrays.
- This chapter documents the API calls and macros that are most commonly
- used.
-\end_layout
-
-\begin_layout Section
-Required subroutine
-\end_layout
-
-\begin_layout Standard
-There is exactly one function that must be defined in your C-code in order
- for Python to use it as an extension module.
- The function must be called init<name> where <name> is the name of the
- module from Python.
- This function must be declared so that it is visible to code outside of
- the routine.
- Besides adding the methods and constants you desire, this subroutine must
- also contain calls to import_array() and/or import_ufunc() depending on
- which C-API is needed.
- Forgetting to place these commands will show itself as an ugly segmentation
- fault (crash) as soon as any C-API subroutine is actually called.
- It is actually possible to have multiple init<name> functions in a single
- file in which case multiple modules will be defined by that file.
- However, there are some tricks to get that to work correctly and it is
- not covered here.
-\end_layout
-
-\begin_layout Standard
-A minimal init<name> method looks like
-\end_layout
-
-\begin_layout LyX-Code
-PyMODINIT_FUNC
-\newline
-init<name>(void)
-\newline
-{
-\newline
- (void)Py_InitModule(
-\begin_inset Quotes erd
-\end_inset
-
-<name>
-\begin_inset Quotes erd
-\end_inset
-
-, mymethods);
-\newline
- import_array();
-\newline
-}
-\end_layout
-
-\begin_layout Standard
-The mymethods must be an array (usually statically declared) of PyMethodDef
- structures which contain method names, actual C-functions, a variable indicatin
-g whether the method uses keyword arguments or not, and docstrings.
- These are explained in the next section.
- If you want to add constants to the module, then you store the returned
- value from Py_InitModule which is a module object.
- The most general way to add itmes to the module is to get the module dictionary
- using PyModule_GetDict(module).
- With the module dictionary, you can add whatever you like to the module
- manually.
- An easier way to add objects to the module is to use one of three additional
- Python C-API calls that do not require a separate extraction of the module
- dictionary.
- These are documented in the Python documentation, but repeated here for
- convenience:
-\end_layout
-
-\begin_layout Description
-PyModule_AddObject (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- module,
-\family typewriter
-char*
-\family default
- name,
-\family typewriter
-PyObject*
-\family default
- value)
-\end_layout
-
-\begin_layout Description
-PyModule_AddIntConstant (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- module,
-\family typewriter
-char*
-\family default
- name,
-\family typewriter
-long
-\family default
- value)
-\end_layout
-
-\begin_layout Description
-PyModule_AddStringConstant (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- module,
-\family typewriter
-char*
-\family default
- name,
-\family typewriter
-char*
-\family default
- value)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- All three of these functions require the
-\family typewriter
-module
-\family default
- object (the return value of Py_InitModule).
- The
-\family typewriter
-name
-\family default
- is a string that labels the value in the module.
- Depending on which function is called, the
-\family typewriter
-value
-\family default
- argument is either a general object (PyModule_AddObject steals a reference
- to it), an integer constant, or a string constant.
-\end_layout
-
-\begin_layout Section
-Defining functions
-\end_layout
-
-\begin_layout Standard
-The second argument passed in to the Py_InitModule function is a structure
- that makes it easy to to define functions in the module.
- In the example given above, the mymethods structure would have been defined
- earlier in the file (usually right before the init<name> subroutine) to
-
-\end_layout
-
-\begin_layout LyX-Code
-static PyMethodDef mymethods[] = {
-\newline
-{
-\begin_inset Quotes erd
-\end_inset
-
-nokeywordfunc
-\begin_inset Quotes erd
-\end_inset
-
-,nokeyword_cfunc,
-\newline
-METH_VARARGS,
-\newline
-
-\begin_inset Quotes erd
-\end_inset
-
-Doc string
-\begin_inset Quotes erd
-\end_inset
-
-},
-\newline
-{
-\begin_inset Quotes erd
-\end_inset
-
-keywordfunc
-\begin_inset Quotes erd
-\end_inset
-
-, keyword_cfunc,
-\end_layout
-
-\begin_layout LyX-Code
-METH_VARARGS|METH_KEYWORDS,
-\newline
-
-\begin_inset Quotes erd
-\end_inset
-
-Doc string
-\begin_inset Quotes erd
-\end_inset
-
-},
-\newline
-{NULL, NULL, 0, NULL} /* Sentinel */
-\newline
-}
-\end_layout
-
-\begin_layout Standard
-Each entry in the mymethods array is a PyMethodDef structure containing
- 1) the Python name, 2) the C-function that implements the function, 3)
- flags indicating whether or not keywords are accepted for this function,
- and 4) The docstring for the function.
- Any number of functions may be defined for a single module by adding more
- entries to this table.
- The last entry must be all NULL as shown to act as a sentinel.
- Python looks for this entry to know that all of the functions for the module
- have been defined.
-
-\end_layout
-
-\begin_layout Standard
-The last thing that must be done to finish the extension module is to actually
- write the code that performs the desired functions.
- There are two kinds of functions: those that don't accept keyword arguments,
- and those that do.
-\end_layout
-
-\begin_layout Subsection
-Functions without keyword arguments
-\end_layout
-
-\begin_layout Standard
-Functions that don't accept keyword arguments should be written as
-\end_layout
-
-\begin_layout LyX-Code
-static PyObject*
-\newline
-nokeyword_cfunc (PyObject *dummy, PyObject *args)
-\newline
-{
-\newline
- /*
- convert Python arguments */
-\newline
- /* do function */
-\end_layout
-
-\begin_layout LyX-Code
- /* return something */
-\end_layout
-
-\begin_layout LyX-Code
-}
-\end_layout
-
-\begin_layout Standard
-The dummy argument is not used in this context and can be safely ignored.
- The
-\emph on
-args
-\emph default
- argument contains all of the arguments passed in to the function as a tuple.
- You can do anything you want at this point, but usually the easiest way
- to manage the input arguments is to call
-\family typewriter
-PyArg_ParseTuple
-\family default
- (args, format_string, addresses_to_C_variables...) or
-\family typewriter
-PyArg_UnpackTuple
-\family default
- (tuple,
-\begin_inset Quotes eld
-\end_inset
-
-name
-\begin_inset Quotes erd
-\end_inset
-
-, min, max, ...).
- A good description of how to use the first function is contained in the
- Python C-API reference manual under section 5.5 (Parsing arguments and building
- values).
- You should pay particular attention to the
-\begin_inset Quotes eld
-\end_inset
-
-O&
-\begin_inset Quotes erd
-\end_inset
-
- format which uses converter functions to go between the Python object and
- the C object.
- All of the other format functions can be (mostly) thought of as special
- cases of this general rule.
- There are several converter functions defined in the NumPy C-API that may
- be of use.
- In particular, the
-\family typewriter
-PyArray_DescrConverter
-\family default
- function is very useful to support arbitrary data-type specification.
- This function transforms any valid data-type Python object into a
-\family typewriter
-PyArray_Descr*
-\family default
- object.
- Remember to pass in the address of the C-variables that should be filled
- in.
-\end_layout
-
-\begin_layout Standard
-There are lots of examples of how to use
-\family typewriter
-PyArg_ParseTuple
-\family default
- throughout the NumPy source code.
- The standard usage is like this:
-\end_layout
-
-\begin_layout LyX-Code
-PyObject *input;
-\end_layout
-
-\begin_layout LyX-Code
-PyArray_Descr *dtype;
-\end_layout
-
-\begin_layout LyX-Code
-if (!PyArg_ParseTuple(args, "OO&", &input,
-\newline
- PyArray_DescrCon
-verter,
-\newline
- &dtype)) return NULL;
-\end_layout
-
-\begin_layout Standard
-It is important to keep in mind that you get a
-\emph on
-borrowed
-\emph default
- reference to the object when using the
-\begin_inset Quotes eld
-\end_inset
-
-O
-\begin_inset Quotes erd
-\end_inset
-
- format string.
- However, the converter functions usually require some form of memory handling.
- In this example, if the conversion is successful,
-\emph on
-dtype
-\emph default
- will hold a new reference to a
-\family typewriter
-PyArray_Descr*
-\family default
- object, while
-\emph on
-input
-\emph default
- will hold a borrowed reference.
- Therefore, if this conversion were mixed with another conversion (say to
- an integer) and the data-type conversion was successful but the integer
- conversion failed, then you would need to release the reference count to
- the data-type object before returning.
- A typical way to do this is to set
-\emph on
-dtype
-\emph default
- to
-\family typewriter
-NULL
-\family default
- before calling PyArg_ParseTuple and then use
-\family typewriter
-Py_XDECREF
-\family default
- on
-\emph on
-dtype
-\emph default
- before returning.
-
-\end_layout
-
-\begin_layout Standard
-After the input arguments are processed, the code that actually does the
- work is written (likely calling other functions as needed).
- The final step of the C-function is to return something.
- If an error is encountered then
-\family typewriter
-NULL
-\family default
- should be returned (making sure an error has actually been set).
- If nothing should be returned then increment
-\family typewriter
-Py_None
-\family default
- and return it.
- If a single object should be returned then it is returned (ensuring that
- you own a reference to it first).
- If multiple objects should be returned then you need to return a tuple.
- The
-\family typewriter
-Py_BuildValue
-\family default
- (format_string, c_variables...) function makes it easy to build tuples of
- Python objects from C variables.
- Pay special attention to the difference between 'N' and 'O' in the format
- string or you can easily create memory leaks.
- The 'O' format string increments the reference count of the
-\family typewriter
-PyObject*
-\family default
- C-variable it corresponds to, while the 'N' format string steals a reference
- to the corresponding
-\family typewriter
-PyObject*
-\family default
- C-variable.
- You should use 'N' if you ave already created a reference for the object
- and just want to give that reference to the tuple.
- You should use 'O' if you only have a borrowed reference to an object and
- need to create one to provide for the tuple.
-
-\end_layout
-
-\begin_layout Subsection
-Functions with keyword arguments
-\end_layout
-
-\begin_layout Standard
-These functions are very similar to functions without keyword arguments.
- The only difference is that the function signature is
-\end_layout
-
-\begin_layout LyX-Code
-static PyObject*
-\newline
-keyword_cfunc (PyObject *dummy, PyObject *args, PyObject
- *kwds)
-\newline
-{
-\newline
-...
-\newline
-}
-\end_layout
-
-\begin_layout Standard
-The kwds argument holds a Python dictionary whose keys are the names of
- the keyword arguments and whose values are the corresponding keyword-argument
- values.
- This dictionary can be processed however you see fit.
- The easiest way to handle it, however, is to replace the
-\family typewriter
-PyArg_ParseTuple
-\family default
- (args, format_string, addresses...) function with a call to
-\family typewriter
-PyArg_ParseTupleAndKeywords
-\family default
- (args, kwds, format_string, char *kwlist[], addresses...).
- The kwlist parameter to this function is a
-\family typewriter
-NULL
-\family default
--terminated array of strings providing the expected keyword arguments.
- There should be one string for each entry in the format_string.
- Using this function will raise a TypeError if invalid keyword arguments
- are passed in.
-
-\end_layout
-
-\begin_layout Standard
-For more help on this function please see section 1.8 (Keyword Paramters
- for Extension Functions) of the Extending and Embedding tutorial in the
- Python documentation.
-\end_layout
-
-\begin_layout Subsection
-Reference counting
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "reference counting|("
-
-\end_inset
-
-The biggest difficulty when writing extension modules is reference counting.
- It is an important reason for the popularity of f2py, weave, pyrex, ctypes,
- etc....
- If you mis-handle reference counts you can get problems from memory-leaks
- to segmentation faults.
- The only strategy I know of to handle reference counts correctly is blood,
- sweat, and tears.
- First, you force it into your head that every Python variable has a reference
- count.
- Then, you understand exactly what each function does to the reference count
- of your objects, so that you can properly use DECREF and INCREF when you
- need them.
- Reference counting can really test the amount of patience and diligence
- you have towards your programming craft.
- Despite the grim depiction, most cases of reference counting are quite
- straightforward with the most common difficulty being not using DECREF
- on objects before exiting early from a routine due to some error.
- In second place, is the common error of not owning the reference on an
- object that is passed to a function or macro that is going to steal the
- reference (
-\emph on
-e.g.
-
-\emph default
-
-\family typewriter
-PyTuple_SET_ITEM
-\family default
-, and most functions that take
-\family typewriter
-PyArray_Descr
-\family default
- objects).
-
-\end_layout
-
-\begin_layout Standard
-Typically you get a new reference to a variable when it is created or is
- the return value of some function (there are some prominent exceptions,
- however --- such as getting an item out of a tuple or a dictionary).
- When you own the reference, you are responsible to make sure that
-\family typewriter
-Py_DECREF
-\family default
-(var) is called when the variable is no longer necessary (and no other function
- has
-\begin_inset Quotes eld
-\end_inset
-
-stolen
-\begin_inset Quotes erd
-\end_inset
-
- its reference).
- Also, if you are passing a Python object to a function that will
-\begin_inset Quotes eld
-\end_inset
-
-steal
-\begin_inset Quotes erd
-\end_inset
-
- the reference, then you need to make sure you own it (or use
-\family typewriter
-Py_INCREF
-\family default
- to get your own reference).
- You will also encounter the notion of borrowing a reference.
- A function that borrows a reference does not alter the reference count
- of the object and does not expect to
-\begin_inset Quotes eld
-\end_inset
-
-hold on
-\begin_inset Quotes erd
-\end_inset
-
- to the reference.
- It's just going to use the object temporarily.
- When you use
-\family typewriter
-PyArg_ParseTuple
-\family default
- or
-\family typewriter
-PyArg_UnpackTuple
-\family default
- you receive a borrowed reference to the objects in the tuple and should
- not alter their reference count inside your function.
- With practice, you can learn to get reference counting right, but it can
- be frustrating at first.
-
-\end_layout
-
-\begin_layout Standard
-One common source of reference-count errors is the
-\family typewriter
-Py_BuildValue
-\family default
- function.
- Pay careful attention to the difference between the 'N' format character
- and the 'O' format character.
- If you create a new object in your subroutine (such as an output array),
- and you are passing it back in a tuple of return values, then you should
- most-likely use the 'N' format character in
-\family typewriter
-Py_BuildValue
-\family default
-.
- The 'O' character will increase the reference count by one.
- This will leave the caller with two reference counts for a brand-new array.
- When the variable is deleted and the reference count decremented by one,
- there will still be that extra reference count, and the array will never
- be deallocated.
- You will have a reference-counting induced memory leak.
- Using the 'N' character will avoid this situation as it will return to
- the caller an object (inside the tuple) with a single reference count.
-
-\begin_inset LatexCommand index
-name "reference counting|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Dealing with array objects
-\end_layout
-
-\begin_layout Standard
-Most extension modules for NumPy will need to access the memory for an ndarray
- object (or one of it's sub-classes).
- The easiest way to do this doesn't require you to know much about the internals
- of NumPy.
- The method is to
-\end_layout
-
-\begin_layout Enumerate
-Ensure you are dealing with a well-behaved array (aligned, in machine byte-order
- and single-segment) of the correct type and number of dimensions.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-By converting it from some Python object using
-\family typewriter
-PyArray_FromAny
-\family default
- or a macro built on it.
-
-\end_layout
-
-\begin_layout Enumerate
-By constructing a new ndarray of your desired shape and type using
-\family typewriter
-PyArray_NewFromDescr
-\family default
- or a simpler macro or function based on it.
-
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Get the shape of the array and a pointer to its actual data.
-
-\end_layout
-
-\begin_layout Enumerate
-Pass the data and shape information on to a subroutine or other section
- of code that actually performs the computation.
-
-\end_layout
-
-\begin_layout Enumerate
-If you are writing the algorithm, then I recommend that you use the stride
- information contained in the array to access the elements of the array
- (the
-\family typewriter
-PyArray_GETPTR
-\family default
- macros make this painless).
- Then, you can relax your requirements so as not to force a single-segment
- array and the data-copying that might result.
-
-\end_layout
-
-\begin_layout Standard
-Each of these sub-topics is covered in the following sub-sections.
-\end_layout
-
-\begin_layout Subsection
-Converting an arbitrary sequence object
-\end_layout
-
-\begin_layout Standard
-The main routine for obtaining an array from any Python object that can
- be converted to an array is
-\family typewriter
-PyArray_FromAny
-\family default
-.
- This function is very flexible with many input arguments.
- Several macros make it easier to use the basic function.
-
-\family typewriter
-PyArray_FROM_OTF
-\family default
- is arguably the most useful of these macros for the most common uses.
- It allows you to convert an arbitrary Python object to an array of a specific
- builtin data-type (
-\emph on
-e.g.
-
-\emph default
- float), while specifying a particular set of requirements (
-\emph on
-e.g.
-
-\emph default
- contiguous, aligned, and writeable).
- The syntax is
-\end_layout
-
-\begin_layout Description
-PyArray_FROM_OTF (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyObject*
-\family default
- obj,
-\family typewriter
-int
-\family default
- typenum,
-\family typewriter
-int
-\family default
- requirements)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an ndarray from any Python object,
-\emph on
-obj
-\emph default
-, that can be converted to an array.
- The number of dimensions in the returned array is determined by the object.
- The desired data-type of the returned array is provided in
-\emph on
-typenum
-\emph default
- which should be one of the enumerated types.
- The
-\emph on
-requirements
-\emph default
- for the returned array can be any combination of standard array flags.
- Each of these arguments is explained in more detail below.
- You receive a new reference to the array on success.
- On failure,
-\family typewriter
-NULL
-\family default
- is returned and an exception is set.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-obj The object can be any Python object convertable to an ndarray.
- If the object is already (a subclass of) the ndarray that satisfies the
- requirements then a new reference is returned.
- Otherwise, a new array is constructed.
- The contents of
-\emph on
-obj
-\emph default
- are copied to the new array unless the array interface is used so that
- data does not have to be copied.
- Objects that can be converted to an array include: 1) any nested sequence
- object, 2) any object exposing the array interface, 3) any object with
- an
-\series bold
-__array__
-\series default
- method (which should return an ndarray), and 4) any scalar object (becomes
- a zero-dimensional array).
- Sub-classes of the ndarray that otherwise fit the requirements will be
- passed through.
- If you want to ensure a base-class ndarray, then use
-\family typewriter
-NPY_ENSUREARRAY
-\family default
- in the requirements flag.
- A copy is made only if necessary.
- If you want to guarantee a copy, then pass in
-\family typewriter
-NPY_ENSURECOPY
-\family default
- to the requirements flag.
-
-\end_layout
-
-\begin_layout Description
-typenum One of the enumerated types or
-\family typewriter
-NPY_NOTYPE
-\family default
- if the data-type should be determined from the object itself.
- The C-based names can be used:
-\end_layout
-
-\begin_deeper
-\begin_layout Quote
-
-\family typewriter
-NPY_BOOL
-\family default
-,
-\family typewriter
-NPY_BYTE
-\family default
-,
-\family typewriter
-NPY_UBYTE
-\family default
-,
-\family typewriter
-NPY_SHORT
-\family default
-,
-\family typewriter
-NPY_USHORT
-\family default
-,
-\family typewriter
-NPY_INT
-\family default
-,
-\family typewriter
-NPY_UINT
-\family default
-,
-\family typewriter
-NPY_LONG
-\family default
-,
-\family typewriter
-NPY_ULONG
-\family default
-,
-\family typewriter
-NPY_LONGLONG
-\family default
-,
-\family typewriter
-NPY_ULONGLONG
-\family default
-,
-\family typewriter
-NPY_DOUBLE
-\family default
-,
-\family typewriter
-NPY_LONGDOUBLE
-\family default
-,
-\family typewriter
-NPY_CFLOAT
-\family default
-,
-\family typewriter
-NPY_CDOUBLE
-\family default
-,
-\family typewriter
-NPY_CLONGDOUBLE
-\family default
-,
-\family typewriter
-NPY_OBJECT
-\family default
-.
-
-\end_layout
-
-\end_deeper
-\begin_layout Description
-\InsetSpace ~
- Alternatively, the bit-width names can be used as supported on the platform.
- For example:
-\end_layout
-
-\begin_deeper
-\begin_layout Quote
-
-\family typewriter
-NPY_INT8
-\family default
-,
-\family typewriter
-NPY_INT16
-\family default
-,
-\family typewriter
-NPY_INT32
-\family default
-,
-\family typewriter
-NPY_INT64
-\family default
-,
-\family typewriter
-NPY_UINT8
-\family default
-,
-\family typewriter
-NPY_UINT16
-\family default
-,
-\family typewriter
-NPY_UINT32
-\family default
-,
-\family typewriter
-NPY_UINT64
-\family default
-,
-\family typewriter
-NPY_FLOAT32
-\family default
-,
-\family typewriter
-NPY_FLOAT64
-\family default
-,
-\family typewriter
-NPY_COMPLEX64
-\family default
-,
-\family typewriter
-NPY_COMPLEX128
-\family default
-.
-
-\end_layout
-
-\end_deeper
-\begin_layout Description
-\InsetSpace ~
- The object will be converted to the desired type only if it can be done
- without losing precision.
- Otherwise
-\family typewriter
-NULL
-\family default
- will be returned and an error raised.
- Use
-\family typewriter
-NPY_FORCECAST
-\family default
- in the requirements flag to override this behavior.
-
-\end_layout
-
-\begin_layout Description
-requirements The memory model for an ndarray admits arbitrary strides in
- each dimension to advance to the next element of the array.
- Often, however, you need to interface with code that expects a C-contiguous
- or a Fortran-contiguous memory layout.
- In addition, an ndarray can be misaligned (the address of an element is
- not at an integral multiple of the size of the element) which can cause
- your program to crash (or at least work more slowly) if you try and dereference
- a pointer into the array data.
- Both of these problems can be solved by converting the Python object into
- an array that is more
-\begin_inset Quotes eld
-\end_inset
-
-well-behaved
-\begin_inset Quotes erd
-\end_inset
-
- for your specific usage.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The requirements flag allows specification of what kind of array is acceptable.
- If the object passed in does not satisfy this requirements then a copy
- is made so that thre returned object will satisfy the requirements.
- these ndarray can use a very generic pointer to memory.
- This flag allows specification of the desired properties of the returned
- array object.
- All of the flags are explained in the detailed API chapter.
- The flags most commonly needed are NPY_IN_ARRAY, NPY_OUT_ARRAY, and NPY_INOUT_A
-RRAY:
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-NPY_IN_ARRAY Equivalent to NPY_CONTIGUOUS | NPY_ALIGNED.
- This combination of flags is useful for arrays that must be in C-contiguous
- order and aligned.
- These kinds of arrays are usually input arrays for some algorithm.
-\end_layout
-
-\begin_layout Description
-NPY_OUT_ARRAY Equivalent to NPY_CONTIGUOUS | NPY_ALIGNED | NPY_WRITEABLE.
- This combination of flags is useful to specify an array that is in C-contiguous
- order, is aligned, and can be written to as well.
- Such an array is usually returned as output (although normally such output
- arrays are created from scratch).
-
-\end_layout
-
-\begin_layout Description
-NPY_INOUT_ARRAY Equivalent to NPY_CONTIGUOUS | NPY_ALIGNED | NPY_WRITEABLE
- | NPY_UPDATEIFCOPY.
- This combination of flags is useful to specify an array that will be used
- for both input and output.
- If a copy is needed, then when the temporary is deleted (by your use of
- Py_DECREF at the end of the interface routine), the temporary array will
- be copied back into the original array passed in.
- Use of the UPDATEIFCOPY flag requires that the input object is already
- an array (because other objects cannot be automatically updated in this
- fashion).
- If an error occurs use
-\series bold
-PyArray_DECREF_ERR
-\series default
-(obj) on an array with the NPY_UPDATEIFCOPY flag set.
- This will delete the array without causing the contents to be copied back
- into the original array.
-
-\end_layout
-
-\end_deeper
-\begin_layout Description
-\InsetSpace ~
- Other useful flags that can be OR'd as additional requirements are:
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-NPY_FORCECAST Cast to the desired type, even if it can't be done without
- losing information.
-\end_layout
-
-\begin_layout Description
-NPY_ENSURECOPY Make sure the resulting array is a copy of the original.
-\end_layout
-
-\begin_layout Description
-NPY_ENSUREARRAY Make sure the resulting object is an actual ndarray and
- not a sub-class.
-\end_layout
-
-\end_deeper
-\end_deeper
-\begin_layout Note
-Whether or not an array is byte-swapped is determined by the data-type of
- the array.
- Native byte-order arrays are always requested by PyArray_FROM_OTF and so
- there is no need for a NPY_NOTSWAPPED flag in the requirements argument.
- There is also no way to get a byte-swapped array from this routine.
-\end_layout
-
-\begin_layout Subsection
-Creating a brand-new ndarray
-\end_layout
-
-\begin_layout Standard
-Quite often new arrays must be created from within extension-module code.
- Perhaps an output array is needed and you don't want the caller to have
- to supply it.
- Perhaps only a temporary array is needed to hold an intermediate calculation.
- Whatever the need there are simple ways to get an ndarray object of whatever
- data-type is needed.
- The most general function for doing this is PyArray_NewFromDescr.
- All array creation functions go through this heavily re-used code.
- Because of its flexibility, it can be somewhat confusing to use.
- As a result, simpler forms exist that are easier to use.
-
-\end_layout
-
-\begin_layout Description
-PyArray_SimpleNew (
-\family typewriter
-PyObject*
-\family default
-)(
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-int
-\family default
- typenum)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function allocates new memory and places it in an ndarray with
-\family typewriter
-nd
-\family default
- dimensions whose shape is determined by the array of at least
-\family typewriter
-nd
-\family default
- items pointed to by
-\family typewriter
-dims
-\family default
-.
- The memory for the array is uninitialized (unless typenum is
-\series bold
-NPY_OBJECT
-\series default
- in which case each element in the array is set to NULL).
- The
-\family typewriter
-typenum
-\family default
- argument allows specification of any of the builtin data-types such as
-
-\series bold
-NPY_FLOAT
-\series default
- or
-\series bold
-NPY_LONG
-\series default
-.
- The memory for the array can be set to zero if desired using
-\series bold
-PyArray_FILLWBYTE
-\series default
-(return_object, 0).
-
-\end_layout
-
-\begin_layout Description
-PyArray_SimpleNewFromData (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-int
-\family default
- nd,
-\family typewriter
-npy_intp*
-\family default
- dims,
-\family typewriter
-int
-\family default
- typenum,
-\family typewriter
-void*
-\family default
- data)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Sometimes, you want to wrap memory allocated elsewhere into an ndarray
- object for downstream use.
- This routine makes it straightforward to do that.
- The first three arguments are the same as in
-\series bold
-PyArray_SimpleNew
-\series default
-, the final argument is a pointer to a block of contiguous memory that the
- ndarray should use as it's data-buffer which will be interpreted in C-style
- contiguous fashion.
- A new reference to an ndarray is returned, but the ndarray will not own
- its data.
- When this ndarray is deallocated, the pointer will not be freed.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- You should ensure that the provided memory is not freed while the returned
- array is in existence.
- The easiest way to handle this is if data comes from another reference-counted
- Python object.
- The reference count on this object should be increased after the pointer
- is passed in, and the base member of the returned ndarray should point
- to the Python object that owns the data.
- Then, when the ndarray is deallocated, the base-member will be DECREF'd
- appropriately.
- If you want the memory to be freed as soon as the ndarray is deallocated
- then simply set the OWNDATA flag on the returned ndarray.
-
-\end_layout
-
-\begin_layout Subsection
-Getting at ndarray memory and accessing elements of the ndarray
-\end_layout
-
-\begin_layout Standard
-If obj is an ndarray (PyArrayObject *), then the data-area of the ndarray
- is pointed to by the void* pointer
-\series bold
-PyArray_DATA
-\series default
-(obj) or the char* pointer
-\series bold
-PyArray_BYTES
-\series default
-(obj).
- Remember that (in general) this data-area may not be aligned according
- to the data-type, it may represent byte-swapped data, and/or it may not
- be writeable.
- If the data area is aligned and in native byte-order, then how to get at
- a specific element of the array is determined only by the array of npy_intp
- variables,
-\series bold
-PyArray_STRIDES
-\series default
-(obj).
- In particular, this c-array of integers shows how many
-\series bold
-bytes
-\series default
- must be added to the current element pointer to get to the next element
- in each dimension.
- For arrays less than 4-dimensions there are
-\series bold
-PyArray_GETPTR<k>
-\series default
-(obj, ...) macros where <k> is the integer 1, 2, 3, or 4 that make using the
- array strides easier.
- The arguments ....
- represent <k> non-negative integer indices into the array.
- For example, suppose
-\family typewriter
-E
-\family default
- is a 3-dimensional ndarray.
- A (void*) pointer to the element
-\family typewriter
-E[i,j,k]
-\family default
- is obtained as PyArray_GETPTR3(E, i, j, k).
-
-\end_layout
-
-\begin_layout Standard
-As explained previously, C-style contiguous arrays and Fortran-style contiguous
- arrays have particular striding patterns.
- Two array flags (NPY_C_CONTIGUOUS and NPY_F_CONTIGUOUS) indicate whether
- or not the striding pattern of a particular array matches the C-style contiguou
-s or Fortran-style contiguous or neither.
- Whether or not the striding pattern matches a standard C or Fortran one
- can be tested Using
-\family typewriter
-PyArray_ISCONTIGUOUS
-\family default
-(obj) and
-\family typewriter
-PyArray_ISFORTRAN
-\family default
-(obj) respectively.
- Most third-party libraries expect contiguous arrays.
- But, often it is not difficult to support general-purpose striding.
- I encourage you to use the striding information in your own code whenever
- possible, and reserve single-segment requirements for wrapping third-party
- code.
- Using the striding information provided with the ndarray rather than requiring
- a contiguous striding reduces copying that otherwise must be made.
-
-\end_layout
-
-\begin_layout Section
-Example
-\end_layout
-
-\begin_layout Standard
-The following example shows how you might write a wrapper that accepts two
- input arguments (that will be converted to an array) and an output argument
- (that must be an array).
- The function returns None and updates the output array.
-
-\begin_inset LatexCommand index
-name "extension module|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout LyX-Code
-static PyObject *
-\end_layout
-
-\begin_layout LyX-Code
-example_wrapper(PyObject *dummy, PyObject *args)
-\end_layout
-
-\begin_layout LyX-Code
-{
-\end_layout
-
-\begin_layout LyX-Code
- PyObject *arg1=NULL, *arg2=NULL, *out=NULL;
-\end_layout
-
-\begin_layout LyX-Code
- PyObject *arr1=NULL, *arr2=NULL, *oarr=NULL;
-\end_layout
-
-\begin_layout LyX-Code
-
-\end_layout
-
-\begin_layout LyX-Code
- if (!PyArg_ParseTuple(args,
-\begin_inset Quotes eld
-\end_inset
-
-OOO&
-\begin_inset Quotes erd
-\end_inset
-
-, &arg1, *arg2,
-\end_layout
-
-\begin_layout LyX-Code
- &PyArrayType, *out)) return NULL;
-\end_layout
-
-\begin_layout LyX-Code
-
-\end_layout
-
-\begin_layout LyX-Code
- arr1 = PyArray_FROM_OTF(arg1, NPY_DOUBLE, NPY_IN_ARRAY);
-\end_layout
-
-\begin_layout LyX-Code
- if (arr1 == NULL) return NULL;
-\end_layout
-
-\begin_layout LyX-Code
- arr2 = PyArray_FROM_OTF(arg2, NPY_DOUBLE, NPY_IN_ARRAY);
-\end_layout
-
-\begin_layout LyX-Code
- if (arr2 == NULL) goto fail;
-\end_layout
-
-\begin_layout LyX-Code
- oarr = PyArray_FROM_OTF(out, NPY_DOUBLE, NPY_INOUT_ARRAY);
-\end_layout
-
-\begin_layout LyX-Code
- if (oarr == NULL) goto fail;
-\end_layout
-
-\begin_layout LyX-Code
-
-\end_layout
-
-\begin_layout LyX-Code
- /* code that makes use of arguments */
-\end_layout
-
-\begin_layout LyX-Code
- /* You will probably need at least
-\end_layout
-
-\begin_layout LyX-Code
- nd = PyArray_NDIM(<..>) -- number of dimensions
-\end_layout
-
-\begin_layout LyX-Code
- dims = PyArray_DIMS(<..>) -- npy_intp array of length nd
-\end_layout
-
-\begin_layout LyX-Code
- showing length in each dim.
-\end_layout
-
-\begin_layout LyX-Code
- dptr = (double *)PyArray_DATA(<..>) -- pointer to data.
-\end_layout
-
-\begin_layout LyX-Code
-
-\end_layout
-
-\begin_layout LyX-Code
- If an error occurs goto fail.
-\end_layout
-
-\begin_layout LyX-Code
- */
-\end_layout
-
-\begin_layout LyX-Code
-
-\end_layout
-
-\begin_layout LyX-Code
- Py_DECREF(arr1);
-\end_layout
-
-\begin_layout LyX-Code
- Py_DECREF(arr2);
-\end_layout
-
-\begin_layout LyX-Code
- Py_DECREF(oarr);
-\end_layout
-
-\begin_layout LyX-Code
- Py_INCREF(Py_None);
-\end_layout
-
-\begin_layout LyX-Code
- return Py_None;
-\end_layout
-
-\begin_layout LyX-Code
-
-\end_layout
-
-\begin_layout LyX-Code
- fail:
-\end_layout
-
-\begin_layout LyX-Code
- Py_XDECREF(arr1);
-\end_layout
-
-\begin_layout LyX-Code
- Py_XDECREF(arr2);
-\end_layout
-
-\begin_layout LyX-Code
- PyArray_XDECREF_ERR(oarr);
-\end_layout
-
-\begin_layout LyX-Code
- return NULL;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\end_layout
-
-\begin_layout Chapter
-Beyond the Basics
-\end_layout
-
-\begin_layout Quotation
-The voyage of discovery is not in seeking new landscapes but in having new
- eyes.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Marcel Proust
-\end_layout
-
-\begin_layout Quotation
-Discovery is seeing what everyone else has seen and thinking what no one
- else has thought.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Albert Szent-Gyorgi
-\end_layout
-
-\begin_layout Section
-Iterating over elements in the array
-\end_layout
-
-\begin_layout Subsection
-Basic Iteration
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "sec:array_iterator"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "array iterator|("
-
-\end_inset
-
-One common algorithmic requirement is to be able to walk over all elements
- in a multidimensional array.
- The array iterator object makes this easy to do in a generic way that works
- for arrays of any dimension.
- Naturally, if you know the number of dimensions you will be using, then
- you can always write nested for loops to accomplish the iteration.
- If, however, you want to write code that works with any number of dimensions,
- then you can make use of the array iterator.
- An array iterator object is returned when accessing the .flat attribute
- of an array.
-
-\end_layout
-
-\begin_layout Standard
-Basic usage is to call
-\series bold
-PyArray_IterNew
-\series default
- (
-\family typewriter
-array
-\family default
-) where array is an ndarray object (or one of its sub-classes).
- The returned object is an array-iterator object (the same object returned
- by the .flat attribute of the ndarray).
- This object is usually cast to PyArrayIterObject* so that its members can
- be accessed.
- The only members that are needed are
-\family typewriter
-iter->size
-\family default
- which contains the total size of the array,
-\family typewriter
-iter->index
-\family default
-, which contains the current 1-d index into the array, and
-\family typewriter
-iter->dataptr
-\family default
- which is a pointer to the data for the current element of the array.
- Sometimes it is also useful to access
-\family typewriter
-iter->ao
-\family default
- which is a pointer to the underlying ndarray object.
-
-\end_layout
-
-\begin_layout Standard
-After processing data at the current element of the array, the next element
- of the array can be obtained using the macro
-\series bold
-PyArray_ITER_NEXT
-\series default
-(
-\family typewriter
-iter
-\family default
-).
- The iteration always proceeds in a C-style contiguous fashion (last index
- varying the fastest).
- The
-\series bold
-PyArray_ITER_GOTO
-\series default
-(
-\family typewriter
-iter
-\family default
-,
-\family typewriter
-destination
-\family default
-) can be used to jump to a particular point in the array, where
-\family typewriter
-destination
-\family default
- is an array of npy_intp data-type with space to handle at least the number
- of dimensions in the underlying array.
- Occasionally it is useful to use
-\series bold
-PyArray_ITER_GOTO1D
-\series default
-(
-\family typewriter
-iter
-\family default
-,
-\family typewriter
-index
-\family default
-) which will jump to the 1-d index given by the value of
-\family typewriter
-index
-\family default
-.
- The most common usage, however, is given in the following example.
-
-\end_layout
-
-\begin_layout LyX-Code
-PyObject *obj; /* assumed to be some ndarray object */
-\end_layout
-
-\begin_layout LyX-Code
-PyArrayIterObject *iter;
-\end_layout
-
-\begin_layout LyX-Code
-...
-\end_layout
-
-\begin_layout LyX-Code
-iter = (PyArrayIterObject *)PyArray_IterNew(obj);
-\end_layout
-
-\begin_layout LyX-Code
-if (iter == NULL) goto fail; /* Assume fail has clean-up code */
-\end_layout
-
-\begin_layout LyX-Code
-while (iter->index < iter->size) {
-\end_layout
-
-\begin_layout LyX-Code
- /* do something with the data at it->dataptr */
-\end_layout
-
-\begin_layout LyX-Code
- PyArray_ITER_NEXT(it);
-\end_layout
-
-\begin_layout LyX-Code
-}
-\end_layout
-
-\begin_layout LyX-Code
-...
-\end_layout
-
-\begin_layout Standard
-You can also use
-\series bold
-PyArrayIter_Check
-\series default
-(
-\family typewriter
-obj
-\family default
-) to ensure you have an iterator object and
-\series bold
-PyArray_ITER_RESET
-\series default
-(
-\family typewriter
-iter
-\family default
-) to reset an iterator object back to the beginning of the array.
-
-\end_layout
-
-\begin_layout Standard
-It should be emphasized at this point that you may not need the array iterator
- if your array is already contiguous (using an array iterator will work
- but will be slower than the fastest code you could write).
- The major purpose of array iterators is to encapsulate iteration over N-dimensi
-onal arrays with arbitrary strides.
- They are used in many, many places in the NumPy source code itself.
- If you already know your array is contiguous (Fortran or C), then simply
- adding the element-size to a running pointer variable will step you through
- the array very efficiently.
- In other words, code like this will probably be faster for you in the contiguou
-s case (assuming doubles).
-
-\end_layout
-
-\begin_layout LyX-Code
-npy_intp size;
-\end_layout
-
-\begin_layout LyX-Code
-double *dptr; /* could make this any variable type */
-\end_layout
-
-\begin_layout LyX-Code
-size = PyArray_SIZE(obj);
-\end_layout
-
-\begin_layout LyX-Code
-dptr = PyArray_DATA(obj);
-\end_layout
-
-\begin_layout LyX-Code
-while(size--) {
-\end_layout
-
-\begin_layout LyX-Code
- /* do something with the data at dptr */
-\end_layout
-
-\begin_layout LyX-Code
- dptr++;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\end_layout
-
-\begin_layout Subsection
-Iterating over all but one axis
-\end_layout
-
-\begin_layout Standard
-A common algorithm is to loop over all elements of an array and perform
- some function with each element by issuing a function call.
- As function calls can be time consuming, one way to speed up this kind
- of algorithm is to write the function so it takes a vector of data and
- then write the iteration so the function call is performed for an entire
- dimension of data at a time.
- This increases the amount of work done per function call, thereby reducing
- the function-call over-head to a small(er) fraction of the total time.
- Even if the interior of the loop is performed without a function call it
- can be advantageous to perform the inner loop over the dimension with the
- highest number of elements to take advantage of speed enhancements available
- on micro-processors that use pipelining to enhance fundmental operations.
-
-\end_layout
-
-\begin_layout Standard
-The
-\series bold
-PyArray_IterAllButAxis
-\series default
-(
-\family typewriter
-array
-\family default
-,
-\family typewriter
-&dim
-\family default
-) constructs an iterator object that is modified so that it will not iterate
- over the dimension indicated by dim.
- The only restriction on this iterator object, is that the
-\series bold
-PyArray_Iter_GOTO1D
-\series default
-(
-\family typewriter
-it
-\family default
-,
-\family typewriter
-ind
-\family default
-) macro cannot be used (thus flat indexing won't work either if you pass
- this object back to Python --- so you shouldn't do this).
- Note that the returned object from this routine is still usually cast to
- PyArrayIterObject *.
- All that's been done is to modify the strides and dimensions of the returned
- iterator to simulate iterating over array[...,0,...] where 0 is placed on the
-
-\begin_inset Formula $\textrm{dim}^{\textrm{th}}$
-\end_inset
-
- dimension.
- If dim is negative, then the dimension with the largest axis is found and
- used.
-
-\end_layout
-
-\begin_layout Subsection
-Iterating over multiple arrays
-\end_layout
-
-\begin_layout Standard
-Very often, it is desireable to iterate over several arrays at the same
- time.
- The universal functions are an example of this kind of behavior.
- If all you want to do is iterate over arrays with the same shape, then
- simply creating several iterator objects is the standard procedure.
- For example, the following code iterates over two arrays assumed to be
- the same shape and size (actually obj1 just has to have at least as many
- total elements as does obj2):
-\end_layout
-
-\begin_layout LyX-Code
-/* It is already assumed that obj1 and obj2
-\end_layout
-
-\begin_layout LyX-Code
- are ndarrays of the same shape and size.
-\end_layout
-
-\begin_layout LyX-Code
-*/
-\end_layout
-
-\begin_layout LyX-Code
-iter1 = (PyArrayIterObject *)PyArray_IterNew(obj1);
-\end_layout
-
-\begin_layout LyX-Code
-if (iter1 == NULL) goto fail;
-\end_layout
-
-\begin_layout LyX-Code
-iter2 = (PyArrayIterObject *)PyArray_IterNew(obj2);
-\end_layout
-
-\begin_layout LyX-Code
-if (iter2 == NULL) goto fail; /* assume iter1 is DECREF'd at fail */
-\end_layout
-
-\begin_layout LyX-Code
-while (iter2->index < iter2->size) {
-\end_layout
-
-\begin_layout LyX-Code
- /* process with iter1->dataptr and iter2->dataptr */
-\end_layout
-
-\begin_layout LyX-Code
- PyArray_ITER_NEXT(iter1);
-\end_layout
-
-\begin_layout LyX-Code
- PyArray_ITER_NEXT(iter2);
-\end_layout
-
-\begin_layout LyX-Code
-}
-\end_layout
-
-\begin_layout Subsection
-Broadcasting over multiple arrays
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "broadcasting"
-
-\end_inset
-
-When multiple arrays are involved in an operation, you may want to use the
- same broadcasting rules that the math operations (
-\emph on
-i.e.
-
-\emph default
- the ufuncs) use.
- This can be done easily using the PyArrayMultiIterObject.
- This is the object returned from the Python command numpy.broadcast and
- it is almost as easy to use from C.
- The function
-\series bold
-PyArray_MultiIterNew
-\series default
- (
-\family typewriter
-n
-\family default
-,
-\family typewriter
-...
-\family default
-) is used (with
-\family typewriter
-n
-\family default
- input objects in place of
-\family typewriter
-...
-\family default
-).
- The input objects can be arrays or anything that can be converted into
- an array.
- A pointer to a PyArrayMultiIterObject is returned.
- Broadcasting has already been accomplished which adjusts the iterators
- so that all that needs to be done to advance to the next element in each
- array is for PyArray_ITER_NEXT to be called for each of the inputs.
- This incrementing is automatically performed by
-\series bold
-PyArray_MultiIter_NEXT
-\series default
-(
-\family typewriter
-obj
-\family default
-) macro (which can handle a multiterator
-\family typewriter
-obj
-\family default
- as either a PyArrayMultiObject* or a PyObject*).
- The data from input number
-\family typewriter
-i
-\family default
- is available using
-\series bold
-PyArray_MultiIter_DATA
-\series default
-(
-\family typewriter
-obj
-\family default
-,
-\family typewriter
-i
-\family default
-) and the total (broadcasted) size as
-\series bold
-PyArray_MultiIter_SIZE
-\series default
-(
-\family typewriter
-obj
-\family default
-).
- An example of using this feature follows.
-\end_layout
-
-\begin_layout LyX-Code
-mobj = PyArray_MultiIterNew(2, obj1, obj2);
-\end_layout
-
-\begin_layout LyX-Code
-size = PyArray_MultiIter_SIZE(obj);
-\end_layout
-
-\begin_layout LyX-Code
-while(size--) {
-\end_layout
-
-\begin_layout LyX-Code
- ptr1 = PyArray_MultiIter_DATA(mobj, 0);
-\end_layout
-
-\begin_layout LyX-Code
- ptr2 = PyArray_MultiIter_DATA(mobj, 1);
-\end_layout
-
-\begin_layout LyX-Code
- /* code using contents of ptr1 and ptr2 */
-\end_layout
-
-\begin_layout LyX-Code
- PyArray_MultiIter_NEXT(mobj);
-\end_layout
-
-\begin_layout LyX-Code
-}
-\end_layout
-
-\begin_layout Standard
-The function
-\series bold
-PyArray_RemoveSmallest
-\series default
-(
-\family typewriter
-multi
-\family default
-) can be used to take a multi-iterator object and adjust all the iterators
- so that iteration does not take place over the largest dimension (it makes
- that dimension of size 1).
- The code being looped over that makes use of the pointers will very-likely
- also need the strides data for each of the iterators.
- This information is stored in multi->iters[i]->strides.
-\end_layout
-
-\begin_layout Standard
-There are several examples of using the multi-iterator in the NumPy source
- code as it makes N-dimensional broadcasting-code very simple to write.
- Browse the source for more examples.
-
-\begin_inset LatexCommand index
-name "array iterator|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Creating a new universal function
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "sec:Creating-a-new"
-
-\end_inset
-
-
-\begin_inset LatexCommand index
-name "ufunc!adding new|("
-
-\end_inset
-
-The umath module is a computer-generated C-module that creates many ufuncs.
- It provides a great many examples of how to create a universal function.
- Creating your own ufunc that will make use of the ufunc machinery is not
- difficult either.
- Suppose you have a function that you want to operate element-by-element
- over its inputs.
- By creating a new ufunc you will obtain a function that handles
-\end_layout
-
-\begin_layout Itemize
-broadcasting
-\end_layout
-
-\begin_layout Itemize
-N-dimensional looping
-\end_layout
-
-\begin_layout Itemize
-automatic type-conversions with minimal memory usage
-\end_layout
-
-\begin_layout Itemize
-optional output arrays
-\end_layout
-
-\begin_layout Standard
-It is not difficult to create your own ufunc.
- All that is required is a 1-d loop for each data-type you want to support.
- Each 1-d loop must have a specific signature, and only ufuncs for fixed-size
- data-types can be used.
- The function call used to create a new ufunc to work on built-in data-types
- is given below.
- A different mechanism is used to register ufuncs for user-defined data-types.
-\end_layout
-
-\begin_layout Description
-PyUFunc_FromFuncAndData (
-\family typewriter
-PyObject*
-\family default
-) (
-\family typewriter
-PyUFuncGenericFunction*
-\family default
- func,
-\family typewriter
-void**
-\family default
- data,
-\family typewriter
-char*
-\family default
- types,
-\family typewriter
-int
-\family default
- ntypes,
-\family typewriter
-int
-\family default
- nin,
-\family typewriter
-int
-\family default
- nout,
-\family typewriter
-int
-\family default
- identity,
-\family typewriter
-char*
-\family default
- name,
-\family typewriter
-char*
-\family default
- doc,
-\family typewriter
-int
-\family default
- check_return)
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-func A pointer to an array of 1-d functions to use.
- This array must be at least ntypes long.
- Each entry in the array must be a
-\family typewriter
-PyUFuncGenericFunction
-\family default
- function.
- This function has the following signature.
- An example of a valid 1d loop function is also given.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\family typewriter
-void
-\family default
- loop1d (
-\family typewriter
-char**
-\family default
- args,
-\family typewriter
-npy_intp*
-\family default
- dimensions,
-\family typewriter
-npy_intp*
-\family default
- steps,
-\family typewriter
-void*
-\family default
- data)
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-args An array of pointers to the actual data for the input and output arrays.
- The input arguments are given first followed by the output arguments.
-\end_layout
-
-\begin_layout Description
-dimensions A pointer to the size of the dimension over which this function
- is looping.
-
-\end_layout
-
-\begin_layout Description
-steps A pointer to the number of bytes to jump to get to the next element
- in this dimension for each of the input and output arguments.
-
-\end_layout
-
-\begin_layout Description
-data Arbitrary data (extra arguments, function names,
-\emph on
-etc.
-\emph default
-) that can be stored with the ufunc and will be passed in when it is called.
-
-\end_layout
-
-\end_deeper
-\begin_layout LyX-Code
-static void
-\newline
-double_add(char *args, npy_intp *dimensions, npy_intp *steps,
- void *extra)
-\newline
-{
-\newline
- npy_intp i;
-\newline
- npy_intp is1=steps[0], is2=steps[1];
-\newline
-
- npy_intp os=steps[2], n=dimensions[0];
-\newline
- char *i1=args[0], *i2=args[1],
- *op=args[2];
-\newline
- for (i=0; i<n; i++) {
-\newline
- *((double *)op) = *((double
- *)i1) +
-\backslash
-
-\newline
- *((double *)i2);
-\newline
- i1 += is1; i2 += is2;
- op += os;
-\newline
- }
-\newline
-}
-\end_layout
-
-\begin_layout Description
-data An array of data.
- There should be ntypes entries (or NULL) --- one for every loop function
- defined for this ufunc.
- This data will be passed in to the 1-d loop.
- One common use of this data variable is to pass in an actual function to
- call to compute the result when a generic 1-d loop (e.g.
- PyUFunc_d_d) is being used.
-
-\end_layout
-
-\begin_layout Description
-types An array of type-number signatures (type
-\family typewriter
-char
-\family default
-).
- This array should be of size (nin+nout)*ntypes and contain the data-types
- for the corresponding 1-d loop.
- The inputs should be first followed by the outputs.
- For example, suppose I have a ufunc that supports 1 integer and 1 double
- 1-d loop (length-2 func and data arrays) that takes 2 inputs and returns
- 1 output that is always a complex double, then the types array would be
-\end_layout
-
-\begin_layout LyX-Code
-char my_sigs[] =
-\backslash
-
-\newline
-{NPY_INT, NPY_INT, NPY_CDOUBLE,
-\newline
-NPY_DOUBLE, NPY_DOUBLE, NPY_CDOUBLE};
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The bit-width names can also be used (e.g.
-
-\family typewriter
-NPY_INT32
-\family default
-,
-\family typewriter
-NPY_COMPLEX128
-\family default
-) if desired.
-
-\end_layout
-
-\begin_layout Description
-ntypes The number of data-types supported.
- This is equal to the number of 1-d loops provided.
-
-\end_layout
-
-\begin_layout Description
-nin The number of input arguments.
-\end_layout
-
-\begin_layout Description
-nout The number of output arguments.
-\end_layout
-
-\begin_layout Description
-identity Either
-\series bold
-PyUFunc_One
-\series default
-,
-\series bold
-PyUFunc_Zero
-\series default
-,
-\series bold
-PyUFunc_None
-\series default
-.
- This specifies what should be returned when an empty array is passed to
- the reduce method of the ufunc.
-
-\end_layout
-
-\begin_layout Description
-name A
-\family typewriter
-NULL
-\family default
--terminated string providing the name of this ufunc (should be the Python
- name it will be called).
-
-\end_layout
-
-\begin_layout Description
-doc A documentation string for this ufunc (will be used in generating the
- response to <ufunc_name>.__doc__).
- Do not include the function signature or the name as this is generated
- automatically.
-
-\end_layout
-
-\begin_layout Description
-check_return Not presently used, but this integer value does get set in
- the structure-member of similar name.
-
-\end_layout
-
-\end_deeper
-\begin_layout Standard
-The returned ufunc object is a callable Python object.
- It should be placed in a (module) dictionary under the same name as was
- used in the name argument to the ufunc-creation routine.
- The following example is adapted from the umath module:
-\begin_inset LatexCommand index
-name "ufunc!adding new|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout LyX-Code
-static PyUFuncGenericFunction atan2_functions[]=
-\backslash
-
-\newline
- {PyUFunc_ff_f, PyUFunc_dd_d,
-\newline
- PyUFunc_gg_g, PyUFunc_OO_O_method};
-\newline
-static
- void* atan2_data[]=
-\backslash
-
-\newline
- {(void *)atan2f,(void *) atan2,
-\newline
- (void *)atan2l,(void *)"arctan2"};
-\newline
-stati
-c char atan2_signatures[]=
-\backslash
-
-\newline
- {NPY_FLOAT, NPY_FLOAT, NPY_FLOAT,
-\newline
- NPY_DOUBLE, NPY_DOUBLE,
-\newline
- NPY_DOUBLE
-, NPY_LONGDOUBLE,
-\newline
- NPY_LONGDOUBLE, NPY_LONGDOUBLE
-\newline
- NPY_OBJECT, NPY_OBJECT,
-
-\newline
- NPY_OBJECT};
-\newline
-...
-\newline
-/* in the module initialization code */
-\newline
-PyObject *f, *dict,
- *module;
-\newline
-...
-\newline
-dict = PyModule_GetDict(module);
-\newline
-...
-\newline
-f = PyUFunc_FromFuncAndData(atan2_funct
-ions,
-\newline
- atan2_data, atan2_signatures, 4, 2, 1,
-\newline
- PyUFunc_None, "arctan2",
-
-\newline
- "a safe and correct arctan(x1/x2)", 0);
-\newline
-PyDict_SetItemString(dict, "arctan2"
-, f);
-\newline
-Py_DECREF(f);
-\newline
-...
-\end_layout
-
-\begin_layout Section
-User-defined data-types
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "dtype!adding new|("
-
-\end_inset
-
-NumPy comes with 21 builtin data-types.
- While this covers a large majority of possible use cases, it is conceivable
- that a user may have a need for an additional data-type.
- There is some support for adding an additional data-type into the NumPy
- system.
- This additional data-type will behave much like a regular data-type except
- ufuncs must have 1-d loops registered to handle it separately.
- Also checking for whether or not other data-types can be cast
-\begin_inset Quotes eld
-\end_inset
-
-safely
-\begin_inset Quotes erd
-\end_inset
-
- to and from this new type or not will always return
-\begin_inset Quotes eld
-\end_inset
-
-can cast
-\begin_inset Quotes erd
-\end_inset
-
- unless you also register which types your new data-type can be cast to
- and from.
- Adding data-types is one of the less well-tested areas for NumPy 1.0, so
- there may be bugs remaining in the approach.
- Only add a new data-type if you can't do what you want to do using the
- OBJECT or VOID data-types that are already available.
- As an example of what I consider a useful application of the ability to
- add data-types is the possibility of adding a data-type of arbitrary precision
- floats to NumPy.
-
-\end_layout
-
-\begin_layout Subsection
-Adding the new data-type
-\end_layout
-
-\begin_layout Standard
-To begin to make use of the new data-type, you need to first define a new
- Python type to hold the scalars of your new data-type.
- It should be acceptable to inherit from one of the array scalars if your
- new type has a binary compatible layout.
- This will allow your new data type to have the methods and attributes of
- array scalars.
- New data-types must have a fixed memory size (if you want to define a data-type
- that needs a flexible representation, like a variable-precision number,
- then use a pointer to the object as the data-type).
- The memory layout of the object structure for the new Python type must
- be PyObject_HEAD followed by the fixed-size memory needed for the data-type.
- For example, a suitable structure for the new Python type is:
-\end_layout
-
-\begin_layout LyX-Code
-typedef struct {
-\end_layout
-
-\begin_layout LyX-Code
- PyObject_HEAD;
-\end_layout
-
-\begin_layout LyX-Code
- some_data_type obval;
-\end_layout
-
-\begin_layout LyX-Code
- /* the name can be whatever you want */
-\end_layout
-
-\begin_layout LyX-Code
-} PySomeDataTypeObject;
-\end_layout
-
-\begin_layout Standard
-After you have defined a new Python type object, you must then define a
- new PyArray_Descr structure whose typeobject member will contain a pointer
- to the data-type you've just defined.
- In addition, the required functions in the
-\begin_inset Quotes eld
-\end_inset
-
-.f
-\begin_inset Quotes erd
-\end_inset
-
- member must be defined: nonzero, copyswap, copyswapn, setitem, getitem,
- and cast.
- The more functions in the
-\begin_inset Quotes eld
-\end_inset
-
-.f
-\begin_inset Quotes erd
-\end_inset
-
- member you define, however, the more useful the new data-type will be.
- It is very important to intialize unused functions to NULL.
- This can be achieved using
-\series bold
-PyArray_InitArrFuncs
-\series default
-(f).
-\end_layout
-
-\begin_layout Standard
-Once a new PyArray_Descr structure is created and filled with the needed
- information and useful functions you call
-\series bold
-PyArray_RegisterDataType
-\series default
-(new_descr).
- The return value from this call is an integer providing you with a unique
- type_number that specifies your data-type.
- This type number should be stored and made available by your module so
- that other modules can use it to recognize your data-type (the other mechanism
- for finding a user-defined data-type number is to search based on the name
- of the type-object associated with the data-type using
-\series bold
-PyArray_TypeNumFromName
-\series default
-).
-
-\end_layout
-
-\begin_layout Subsection
-Registering a casting function
-\end_layout
-
-\begin_layout Standard
-You may want to allow builtin (and other user-defined) data-types to be
- cast automatically to your data-type.
- In order to make this possible, you must register a casting function with
- the data-type you want to be able to cast from.
- This requires writing low-level casting functions for each conversion you
- want to support and then registering these functions with the data-type
- descriptor.
- A low-level casting function has the signature.
-
-\end_layout
-
-\begin_layout Description
-castfunc (
-\family typewriter
-void
-\family default
-) (
-\family typewriter
-void*
-\family default
- from,
-\family typewriter
-void*
-\family default
- to,
-\family typewriter
-npy_intp
-\family default
- n,
-\family typewriter
-void*
-\family default
- fromarr,
-\family typewriter
-void*
-\family default
- toarr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Cast
-\family typewriter
-n
-\family default
- elements
-\family typewriter
-from
-\family default
- one type
-\family typewriter
-to
-\family default
- another.
- The data to cast from is in a contiguous, correctly-swapped and aligned
- chunk of memory pointed to by from.
- The buffer to cast to is also contiguous, correctly-swapped and aligned.
- The fromarr and toarr arguments should only be used for flexible-element-sized
- arrays (string, unicode, void).
-
-\end_layout
-
-\begin_layout Standard
-An example castfunc is
-\end_layout
-
-\begin_layout LyX-Code
-static void
-\end_layout
-
-\begin_layout LyX-Code
-double_to_float(double *from, float* to, npy_intp n,
-\newline
- void* ig1, void*
- ig2);
-\newline
-while (n--) {
-\newline
- (*to++) = (double) *(from++);
-\newline
-}
-\end_layout
-
-\begin_layout Standard
-This could then be registered to convert doubles to floats using the code
-\end_layout
-
-\begin_layout LyX-Code
-doub = PyArray_DescrFromType(NPY_DOUBLE);
-\newline
-PyArray_RegisterCastFunc(doub,
- NPY_FLOAT,
-\newline
- (PyArray_VectorUnaryFunc *)double_to_float);
-\newline
-Py_DECREF(doub);
-\end_layout
-
-\begin_layout Subsection
-Registering coercion rules
-\end_layout
-
-\begin_layout Standard
-By default, all user-defined data-types are not presumed to be safely castable
- to any builtin data-types.
- In addition builtin data-types are not presumed to be safely castable to
- user-defined data-types.
- This situation limits the ability of user-defined data-types to participate
- in the coercion system used by ufuncs and other times when automatic coercion
- takes place in NumPy.
- This can be changed by registering data-types as safely castable from a
- particlar data-type object.
- The function
-\series bold
-PyArray_RegisterCanCast
-\series default
- (from_descr, totype_number, scalarkind) should be used to specify that
- the data-type object from_descr can be cast to the data-type with type
- number totype_number.
- If you are not trying to alter scalar coercion rules, then use
-\series bold
-NPY_NOSCALAR
-\series default
- for the scalarkind argument.
-\end_layout
-
-\begin_layout Standard
-If you want to allow your new data-type to also be able to share in the
- scalar coercion rules, then you need to specify the scalarkind function
- in the data-type object's
-\begin_inset Quotes eld
-\end_inset
-
-.f
-\begin_inset Quotes erd
-\end_inset
-
- member to return the kind of scalar the new data-type should be seen as
- (the value of the scalar is available to that function).
- Then, you can register data-types that can be cast to separately for each
- scalar kind that may be returned from your user-defined data-type.
- If you don't register scalar coercion handling, then all of your user-defined
- data-types will be seen as
-\series bold
-NPY_NOSCALAR
-\series default
-.
-
-\end_layout
-
-\begin_layout Subsection
-Registering a ufunc loop
-\end_layout
-
-\begin_layout Standard
-You may also want to register low-level ufunc loops for your data-type so
- that an ndarray of your data-type can have math applied to it seamlessly.
- Registering a new loop with exactly the same arg_types signature, silently
- replaces any previously registered loops for that data-type.
-
-\end_layout
-
-\begin_layout Standard
-Before you can register a 1-d loop for a ufunc, the ufunc must be previously
- created.
- Then you call
-\series bold
-PyUFunc_RegisterLoopForType
-\series default
-(...) with the information needed for the loop.
- The return value of this function is
-\family typewriter
-0
-\family default
- if the process was successful and
-\family typewriter
--1
-\family default
- with an error condition set if it was not successful.
-
-\end_layout
-
-\begin_layout Description
-PyUFunc_RegisterLoopForType (
-\family typewriter
-int
-\family default
-) (
-\family typewriter
-PyUFuncObject*
-\family default
- ufunc,
-\family typewriter
-int
-\family default
- usertype,
-\family typewriter
-PyUFuncGenericFunction
-\family default
- function,
-\family typewriter
-int*
-\family default
- arg_types,
-\family typewriter
-void*
-\family default
- data)
-\end_layout
-
-\begin_layout Description
-ufunc The ufunc to attach this loop to.
-\end_layout
-
-\begin_layout Description
-usertype The user-defined type this loop should be indexed under.
- This number must be a user-defined type or an error occurs.
-
-\end_layout
-
-\begin_layout Description
-function The ufunc inner 1-d loop.
- This function must have the signature as explained in Section
-\begin_inset LatexCommand ref
-reference "sec:Creating-a-new"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Description
-arg_types (optional) If given, this should contain an array of integers
- of at least size ufunc.nargs containing the data-types expected by the loop
- function.
- The data will be copied into a NumPy-managed structure so the memory for
- this argument should be deleted after calling this function.
- If this is NULL, then it will be assumed that all data-types are of type
- usertype.
-\end_layout
-
-\begin_layout Description
-data (optional) Specify any optional data needed by the function which will
- be passed when the function is called.
-
-\begin_inset LatexCommand index
-name "dtype!adding new|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Subtyping the ndarray in C
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ndarray!subtyping|("
-
-\end_inset
-
-One of the lesser-used features that has been lurking in Python since 2.2
- is the ability to sub-class types in C.
- This facility is one of the important reasons for basing NumPy off of the
- Numeric code-base which was already in C.
- A sub-type in C allows much more flexibility with regards to memory management.
- Sub-typing in C is not difficult even if you have only a rudimentary understand
-ing of how to create new types for Python.
- While it is easiest to sub-type from a single parent type, sub-typing from
- multiple parent types is also possible.
- Multiple inheritence in C is generally less useful than it is in Python
- because a restriction on Python sub-types is that they have a binary compatible
- memory layout.
- Perhaps for this reason, it is somewhat easier to sub-type from a single
- parent type.
-
-\end_layout
-
-\begin_layout Standard
-All C-structures corresponding to Python objects must begin with PyObject_HEAD
- (or PyObject_VAR_HEAD).
- In the same way, any sub-type must have a C-structure that begins with
- exactly the same memory layout as the parent type (or all of the parent
- types in the case of multiple-inheritance).
- The reason for this is that Python may attempt to access a member of the
- sub-type structure as if it had the parent structure (
-\emph on
-i.e.
-
-\emph default
- it will cast a given pointer to a pointer to the parent structure and then
- dereference one of it's members).
- If the memory layouts are not compatible, then this attempt will cause
- unpredictable behavior (eventually leading to a memory violation and program
- crash).
-
-\end_layout
-
-\begin_layout Standard
-One of the elements in PyObject_HEAD is a pointer to a type-object structure.
- A new Python type is created by creating a new type-object structure and
- populating it with functions and pointers to describe the desired behavior
- of the type.
- Typically, a new C-structure is also created to contain the instance-specific
- information needed for each object of the type as well.
- For example, &PyArray_Type is a pointer to the type-object table for the
- ndarray while a PyArrayObject* variable is a pointer to a particular instance
- of an ndarray (one of the members of the ndarray structure is, in turn,
- a pointer to the type-object table &PyArray_Type).
- Finally
-\series bold
-PyType_Ready
-\series default
-(<pointer_to_type_object>) must be called for every new Python type.
-
-\end_layout
-
-\begin_layout Subsection
-Creating sub-types
-\end_layout
-
-\begin_layout Standard
-To create a sub-type, a similar proceedure must be followed except only
- behaviors that are different require new entries in the type-object structure.
- All other entires can be NULL and will be filled in by
-\series bold
-PyType_Ready
-\series default
- with appropriate functions from the parent type(s).
- In particular, to create a sub-type in C follow these steps:
-\end_layout
-
-\begin_layout Enumerate
-If needed create a new C-structure to handle each instance of your type.
- A typical C-structure would be
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-typedef _new_struct {
-\newline
- PyArrayObject base;
-\newline
- /* new things here */
-\newline
-} NewArrayO
-bject;
-\end_layout
-
-\begin_layout Standard
-Notice that the full PyArrayObject is used as the first entry in order to
- ensure that the binary layout of instances of the new type is identical
- to the PyArrayObject.
-
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Fill in a new Python type-object structure with pointers to new functions
- that will over-ride the default behavior while leaving any function that
- should remain the same unfilled (or NULL).
- The tp_name element should be different.
-\end_layout
-
-\begin_layout Enumerate
-Fill in the tp_base member of the new type-object structure with a pointer
- to the (main) parent type object.
- For multiple-inheritance, also fill in the tp_bases member with a tuple
- containing all of the parent objects in the order they should be used to
- define inheritance.
- Remember, all parent-types must have the same C-structure for multiple
- inheritance to work properly.
-
-\end_layout
-
-\begin_layout Enumerate
-Call
-\series bold
-PyType_Ready
-\series default
-(<pointer_to_new_type>).
- If this function returns a negative number, a failure occurred and the
- type is not initialized.
- Otherwise, the type is ready to be used.
- It is generally important to place a reference to the new type into the
- module dictionary so it can be accessed from Python.
-
-\end_layout
-
-\begin_layout Standard
-More information on creating sub-types in C can be learned by reading PEP
- 253 (available at http://www.python.org/dev/peps/pep-0253).
-\end_layout
-
-\begin_layout Subsection
-Specific features of ndarray sub-typing
-\end_layout
-
-\begin_layout Standard
-Some special methods and attributes are used by arrays in order to facilitate
- the interoperation of sub-types with the base ndarray type.
-
-\end_layout
-
-\begin_layout Subsubsection
-The __array_finalize__ method
-\end_layout
-
-\begin_layout Standard
-Several array-creation functions of the ndarray allow specification of a
- particular sub-type to be created.
- This allows sub-types to be handled seamlessly in many routines.
- When a sub-type is created in such a fashion, however, neither the __new__
- method nor the __init__ method gets called.
- Instead, the sub-type is allocated and the appropriate instance-structure
- members are filled in.
- Finally, the
-\series bold
-__array_finalize__
-\series default
- attribute is looked-up in the object dictionary.
- If it is present and not None, then it can be either a CObject containing
- a pointer to a
-\series bold
-PyArray_FinalizeFunc
-\series default
- or it can be a method taking a single argument (which could be None).
-
-\end_layout
-
-\begin_layout Standard
-If the
-\series bold
-__array_finalize__
-\series default
- attribute is a CObject, then the pointer must be a pointer to a function
- with the signature:
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- (int) (PyArrayObject *, PyObject *)
-\end_layout
-
-\begin_layout Standard
-The first argument is the newly created sub-type.
- The second argument (if not NULL) is the
-\begin_inset Quotes eld
-\end_inset
-
-parent
-\begin_inset Quotes erd
-\end_inset
-
- array (if the array was created using slicing or some other operation where
- a clearly-distinguishable parent is present).
- This routine can do anything it wants to.
- It should return a -1 on error and 0 otherwise.
-
-\end_layout
-
-\begin_layout Standard
-If the
-\series bold
-__array_finalize__
-\series default
- attribute is not None nor a CObject, then it must be a Python method that
- takes the parent array as an argument (which could be None if there is
- no parent), and returns nothing.
- Errors in this method will be caught and handled.
-
-\end_layout
-
-\begin_layout Subsubsection
-The __array_priority__ attribute
-\end_layout
-
-\begin_layout Standard
-This attribute allows simple but flexible determination of which sub-type
- should be considered
-\begin_inset Quotes eld
-\end_inset
-
-primary
-\begin_inset Quotes erd
-\end_inset
-
- when an operation involving two or more sub-types arises.
- In operations where different sub-types are being used, the sub-type with
- the largest
-\series bold
-__array_priority__
-\series default
- attribute will determine the sub-type of the output(s).
- If two sub-types have the same
-\series bold
-__array_prioirty__
-\series default
- then the sub-type of the first argument determines the output.
- The default
-\series bold
-__array_priority__
-\series default
- attribute returns a value of 0.0 for the base ndarray type and 1.0 for a
- sub-type.
- This attribute can also be defined by objects that are not sub-types of
- the ndarray and can be used to determine which
-\series bold
-__array_wrap__
-\series default
- method should be called for the return output.
-
-\end_layout
-
-\begin_layout Subsubsection
-The __array_wrap__ method
-\end_layout
-
-\begin_layout Standard
-Any class or type can define this method which should take an ndarray argument
- and return an instance of the type.
- It can be seen as the opposite of the
-\series bold
-__array__
-\series default
- method.
- This method is used by the ufuncs (and other NumPy functions) to allow
- other objects to pass through.
- For Python >2.4, it can also be used to write a decorator that converts
- a function that works only with ndarrays to one that works with any type
- with
-\series bold
-__array__
-\series default
- and
-\series bold
-__array_wrap__
-\series default
- methods.
-
-\begin_inset LatexCommand index
-name "ndarray!subtyping|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Chapter
-Using Python as glue
-\end_layout
-
-\begin_layout Quotation
-There is no conversation more boring than the one where everybody agrees.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Michel de Montaigne
-\end_layout
-
-\begin_layout Quotation
-Duct tape is like the force.
- It has a light side, and a dark side, and it holds the universe together.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Carl Zwanzig
-\end_layout
-
-\begin_layout Standard
-Many people like to say that Python is a fantastic glue language.
- Hopefully, this Chapter will convince you that this is true.
- The first adopters of Python for science were typically people who used
- it to glue together large applicaton codes running on super-computers.
- Not only was it much nicer to code in Python than in a shell script or
- Perl, in addition, the ability to easily extend Python made it relatively
- easy to create new classes and types specifically adapted to the problems
- being solved.
- From the interactions of these early contributors, Numeric emerged as an
- array-like object that could be used to pass data between these applications.
-\end_layout
-
-\begin_layout Standard
-As Numeric has matured and developed into NumPy, people have been able to
- write more code directly in NumPy.
- Often this code is fast-enough for production use, but there are still
- times that there is a need to access compiled code.
- Either to get that last bit of efficiency out of the algorithm or to make
- it easier to access widely-available codes written in C/C++ or Fortran.
-
-\end_layout
-
-\begin_layout Standard
-This chapter will review many of the tools that are available for the purpose
- of accessing code written in other compiled languages.
- There are many resources available for learning to call other compiled
- libraries from Python and the purpose of this Chapter is not to make you
- an expert.
- The main goal is to make you aware of some of the possibilities so that
- you will know what to
-\begin_inset Quotes eld
-\end_inset
-
-Google
-\begin_inset Quotes erd
-\end_inset
-
- in order to learn more.
-
-\end_layout
-
-\begin_layout Standard
-The http://www.scipy.org website also contains a great deal of useful information
- about many of these tools.
- For example, there is a nice description of using several of the tools
- explained in this chapter at http://www.scipy.org/PerformancePython.
- This link provides several ways to solve the same problem showing how to
- use and connect with compiled code to get the best performance.
- In the process you can get a taste for several of the approaches that will
- be discussed in this chapter.
-
-\end_layout
-
-\begin_layout Section
-Calling other compiled libraries from Python
-\end_layout
-
-\begin_layout Standard
-While Python is a great language and a pleasure to code in, its dynamic
- nature results in overhead that can cause some code (
-\emph on
-i.e.
-
-\emph default
- raw computations inside of for loops) to be up 10-100 times slower than
- equivalent code written in a static compiled language.
- In addition, it can cause memory usage to be larger than necessary as temporary
- arrays are created and destroyed during computation.
- For many types of computing needs the extra slow-down and memory consumption
- can often not be spared (at least for time- or memory-critical portions
- of your code).
- Therefore one of the most common needs is to call out from Python code
- to a fast, machine-code routine (e.g.
- compiled using C/C++ or Fortran).
- The fact that this is relatively easy to do is a big reason why Python
- is such an excellent high-level language for scientific and engineering
- programming.
-
-\end_layout
-
-\begin_layout Standard
-Their are two basic approaches to calling compiled code: writing an extension
- module that is then imported to Python using the import command, or calling
- a shared-library subroutine directly from Python using the ctypes module
- (included in the standard distribution with Python 2.5).
- The first method is the most common (but with the inclusion of ctypes into
- Python 2.5 this status may change).
-\end_layout
-
-\begin_layout Warning
-Calling C-code from Python can result in Python crashes if you are not careful.
- None of the approaches in this chapter are immune.
- You have to know something about the way data is handled by both NumPy
- and by the third-party library being used.
-
-\end_layout
-
-\begin_layout Section
-Hand-generated wrappers
-\end_layout
-
-\begin_layout Standard
-Extension modules were discussed in Chapter
-\begin_inset LatexCommand ref
-reference "sec:Writing-an-extension"
-
-\end_inset
-
-.
- The most basic way to interface with compiled code is to write an extension
- module and construct a module method that calls the compiled code.
- For improved readability, your method should take advantage of the PyArg_ParseT
-uple call to convert between Python objects and C data-types.
- For standard C data-types there is probably already a built-in converter.
- For others you may need to write your own converter and use the
-\begin_inset Quotes eld
-\end_inset
-
-O&
-\begin_inset Quotes erd
-\end_inset
-
- format string which allows you to specify a function that will be used
- to perform the conversion from the Python object to whatever C-structures
- are needed.
-
-\end_layout
-
-\begin_layout Standard
-Once the conversions to the appropriate C-structures and C data-types have
- been performed, the next step in the wrapper is to call the underlying
- function.
- This is straightforward if the underlying function is in C or C++.
- However, in order to call Fortran code you must be familiar with how Fortran
- subroutines are called from C/C++ using your compiler and platform.
- This can vary somewhat platforms and compilers (which is another reason
- f2py makes life much simpler for interfacing Fortran code) but generally
- involves underscore mangling of the name and the fact that all variables
- are passed by reference (i.e.
- all arguments are pointers).
-
-\end_layout
-
-\begin_layout Standard
-The advantage of the hand-generated wrapper is that you have complete control
- over how the C-library gets used and called which can lead to a lean and
- tight interface with minimal over-head.
- The disadvantage is that you have to write, debug, and maintain C-code,
- although most of it can be adapted using the time-honored technique of
-
-\begin_inset Quotes eld
-\end_inset
-
-cutting-pasting-and-modifying
-\begin_inset Quotes erd
-\end_inset
-
- from other extension modules.
- Because, the procedure of calling out to additional C-code is fairly regimented
-, code-generation procedures have been developed to make this process easier.
- One of these code-generation techniques is distributed with NumPy and allows
- easy integration with Fortran and (simple) C code.
- This package, f2py, will be covered briefly in the next session.
-
-\end_layout
-
-\begin_layout Section
-f2py
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "f2py|("
-
-\end_inset
-
-F2py allows you to automatically construct an extension module that interfaces
- to routines in Fortran 77/90/95 code.
- It has the ability to parse Fortran 77/90/95 code and automatically generate
- Python signatures for the subroutines it encounters, or you can guide how
- the subroutine interfaces with Python by constructing an interface-defintion-fi
-le (or modifying the f2py-produced one).
-
-\end_layout
-
-\begin_layout Subsection
-Creating source for a basic extension module
-\end_layout
-
-\begin_layout Standard
-Probably the easiest way to introduce f2py is to offer a simple example.
- Here is one of the subroutines contained in a file named add.f
-\end_layout
-
-\begin_layout LyX-Code
-C
-\newline
- SUBROUTINE ZADD(A,B,C,N)
-\newline
-C
-\newline
- DOUBLE COMPLEX A(*)
-\newline
- DOUBLE COMPLEX
- B(*)
-\newline
- DOUBLE COMPLEX C(*)
-\newline
- INTEGER N
-\newline
- DO 20 J = 1, N
-\newline
-
- C(J) = A(J)+B(J)
-\newline
- 20 CONTINUE
-\newline
- END
-\end_layout
-
-\begin_layout Standard
-This routine simply adds the elements in two contiguous arrays and places
- the result in a third.
- The memory for all three arrays must be provided by the calling routine.
- A very basic interface to this routine can be automatically generated by
- f2py:
-\end_layout
-
-\begin_layout LyX-Code
-f2py -m add add.f
-\end_layout
-
-\begin_layout Standard
-You should be able to run this command assuming your search-path is set-up
- properly.
- This command will produce an extension module named addmodule.c in the current
- directory.
- This extension module can now be compiled and used from Python just like
- any other extension module.
-
-\end_layout
-
-\begin_layout Subsection
-Creating a compiled extension module
-\end_layout
-
-\begin_layout Standard
-You can also get f2py to compile add.f and also compile its produced extension
- module leaving only a shared-library extension file that can be imported
- from Python:
-\end_layout
-
-\begin_layout LyX-Code
-f2py -c -m add add.f
-\end_layout
-
-\begin_layout Standard
-This command leaves a file named add.<ext> in the current directory (where
- <ext> is the appropriate extension for a python extension module on your
- platform --- so, pyd,
-\emph on
-etc.
-\emph default
-).
- This module may then be imported from Python.
- It will contain a method for each subroutin in add (zadd, cadd, dadd, sadd).
- The docstring of each method contains information about how the module
- method may be called:
-\end_layout
-
-\begin_layout LyX-Code
->>> import add
-\newline
->>> print add.zadd.__doc__
-\newline
-zadd - Function signature:
-\newline
- zadd(a,b,c,n)
-\newline
-
-Required arguments:
-\newline
- a : input rank-1 array('D') with bounds (*)
-\newline
- b : input
- rank-1 array('D') with bounds (*)
-\newline
- c : input rank-1 array('D') with bounds
- (*)
-\newline
- n : input int
-\end_layout
-
-\begin_layout Subsection
-Improving the basic interface
-\end_layout
-
-\begin_layout Standard
-The default interface is a very literal translation of the fortran code
- into Python.
- The Fortran array arguments must now be NumPy arrays and the integer argument
- should be an integer.
- The interface will attempt to convert all arguments to their required types
- (and shapes) and issue an error if unsuccessful.
- However, because it knows nothing about the semantics of the arguments
- (such that C is an output and n should really match the array sizes), it
- is possible to abuse this function in ways that can cause Python to crash.
- For example
-\end_layout
-
-\begin_layout LyX-Code
->>> add.zadd([1,2,3],[1,2],[3,4],1000)
-\end_layout
-
-\begin_layout Standard
-will cause a program crash on most systems.
- Under the covers, the lists are being converted to proper arrays but then
- the underlying add loop is told to cycle way beyond the borders of the
- allocated memory.
-
-\end_layout
-
-\begin_layout Standard
-In order to improve the interface, directives should be provided.
- This is accomplished by constructing an interface definition file.
- It is usually best to start from the interface file that f2py can produce
- (where it gets its default behavior from).
- To get f2py to generate the interface file use the -h option:
-\end_layout
-
-\begin_layout LyX-Code
-f2py -h add.pyf -m add add.f
-\end_layout
-
-\begin_layout Standard
-This command leaves the file add.pyf in the current directory.
- The section of this file corresponding to zadd is:
-\end_layout
-
-\begin_layout LyX-Code
-subroutine zadd(a,b,c,n) ! in :add:add.f
-\newline
- double complex dimension(*) ::
- a
-\newline
- double complex dimension(*) :: b
-\newline
- double complex dimension(*) ::
- c
-\newline
- integer :: n
-\newline
-end subroutine zadd
-\end_layout
-
-\begin_layout Standard
-By placing intent directives and checking code, the interface can be cleaned
- up quite a bit until the Python module method is both easier to use and
- more robust.
-
-\end_layout
-
-\begin_layout LyX-Code
-subroutine zadd(a,b,c,n) ! in :add:add.f
-\newline
- double complex dimension(n) ::
- a
-\newline
- double complex dimension(n) :: b
-\newline
- double complex intent(out),dimension(n
-) :: c
-\newline
- integer intent(hide),depend(a) :: n=len(a)
-\newline
-end subroutine zadd
-\end_layout
-
-\begin_layout Standard
-The intent directive, intent(out) is used to tell f2py that
-\family typewriter
-c
-\family default
- is an output variable and should be created by the interface before being
- passed to the underlying code.
- The intent(hide) directive tells f2py to not allow the user to specify
- the variable,
-\family typewriter
-n
-\family default
-, but instead to get it from the size of
-\family typewriter
-a
-\family default
-.
- The depend(
-\family typewriter
-a
-\family default
-) directive is necessary to tell f2py that the value of n depends on the
- input a (so that it won't try to create the variable n until the variable
- a is created).
-
-\end_layout
-
-\begin_layout Standard
-The new interface has docstring:
-\end_layout
-
-\begin_layout LyX-Code
->>> print add.zadd.__doc__
-\newline
-zadd - Function signature:
-\newline
- c = zadd(a,b)
-\newline
-Required
- arguments:
-\newline
- a : input rank-1 array('D') with bounds (n)
-\newline
- b : input rank-1
- array('D') with bounds (n)
-\newline
-Return objects:
-\newline
- c : rank-1 array('D') with
- bounds (n)
-\end_layout
-
-\begin_layout Standard
-Now, the function can be called in a much more robust way:
-\end_layout
-
-\begin_layout LyX-Code
->>> add.zadd([1,2,3],[4,5,6])
-\newline
-array([ 5.+0.j, 7.+0.j, 9.+0.j])
-\end_layout
-
-\begin_layout Standard
-Notice the automatic conversion to the correct format that occurred.
-
-\end_layout
-
-\begin_layout Subsection
-Inserting directives in Fortran source
-\end_layout
-
-\begin_layout Standard
-The nice interface can also be generated automatically by placing the variable
- directives as special comments in the original fortran code.
- Thus, if I modify the source code to contain:
-\end_layout
-
-\begin_layout LyX-Code
-C
-\newline
- SUBROUTINE ZADD(A,B,C,N)
-\newline
-C
-\newline
-CF2PY INTENT(OUT) :: C
-\newline
-CF2PY INTENT(HIDE)
- :: N
-\newline
-CF2PY DOUBLE COMPLEX :: A(N)
-\newline
-CF2PY DOUBLE COMPLEX :: B(N)
-\newline
-CF2PY DOUBLE
- COMPLEX :: C(N)
-\newline
- DOUBLE COMPLEX A(*)
-\newline
- DOUBLE COMPLEX B(*)
-\newline
-
- DOUBLE COMPLEX C(*)
-\newline
- INTEGER N
-\newline
- DO 20 J = 1, N
-\newline
- C(J) = A(J)
- + B(J)
-\newline
- 20 CONTINUE
-\newline
- END
-\end_layout
-
-\begin_layout Standard
-Then, I can compile the extension module using
-\end_layout
-
-\begin_layout LyX-Code
-f2py -c -m add add.f
-\end_layout
-
-\begin_layout Standard
-The resulting signature for the function add.zadd is exactly the same one
- that was created previously.
- If the original source code had contained A(N) instead of A(*) and so forth
- with B and C, then I could obtain (nearly) the same interface simply by
- placing the INTENT(OUT) :: C comment line in the source code.
- The only difference is that N would be an optional input that would default
- to the length of A.
-
-\end_layout
-
-\begin_layout Subsection
-A filtering example
-\end_layout
-
-\begin_layout Standard
-For comparison with the other methods to be discussed.
- Here is another example of a function that filters a two-dimensional array
- of double precision floating-point numbers using a fixed averaging filter.
- The advantage of using Fortran to index into multi-dimensional arrays should
- be clear from this example.
-
-\end_layout
-
-\begin_layout LyX-Code
- SUBROUTINE DFILTER2D(A,B,M,N)
-\newline
-C
-\newline
- DOUBLE PRECISION A(M,N)
-\newline
- DOUBLE
- PRECISION B(M,N)
-\newline
- INTEGER N, M
-\newline
-CF2PY INTENT(OUT) :: B
-\newline
-CF2PY INTENT(HIDE)
- :: N
-\newline
-CF2PY INTENT(HIDE) :: M
-\newline
- DO 20 I = 2,M-1
-\newline
- DO 40 J=2,N-1
-\newline
-
- B(I,J) = A(I,J) +
-\newline
- $ (A(I-1,J)+A(I+1,J) +
-\newline
-
- $ A(I,J-1)+A(I,J+1) )*0.5D0 +
-\newline
- $ (A(I-1,J-1) + A(I-1,J+1
-) +
-\newline
- $ A(I+1,J-1) + A(I+1,J+1))*0.25D0
-\newline
- 40 CONTINUE
-\newline
- 20
- CONTINUE
-\newline
- END
-\end_layout
-
-\begin_layout Standard
-This code can be compiled and linked into an extension module named filter
- using
-\end_layout
-
-\begin_layout LyX-Code
-f2py -c -m filter filter.f
-\end_layout
-
-\begin_layout Standard
-This will produce an extension module named filter.so in the current directory
- with a method named dfilter2d that returns a filtered version of the input.
-
-\end_layout
-
-\begin_layout Subsection
-Calling f2py from Python
-\end_layout
-
-\begin_layout Standard
-The f2py program is written in Python and can be run from inside your module.
- This provides a facility that is somewhat similar to the use of weave.ext_tools
- described below.
- An example of the final interface executed using Python code is
-\end_layout
-
-\begin_layout LyX-Code
-import numpy.f2py as f2py
-\end_layout
-
-\begin_layout LyX-Code
-fid = open('add.f')
-\end_layout
-
-\begin_layout LyX-Code
-source = fid.read()
-\end_layout
-
-\begin_layout LyX-Code
-fid.close()
-\end_layout
-
-\begin_layout LyX-Code
-f2py.compile(source, modulename='add')
-\end_layout
-
-\begin_layout LyX-Code
-import add
-\end_layout
-
-\begin_layout Standard
-The source string can be any valid Fortran code.
- If you want to save the extension-module source code then a suitable file-name
- can be provided by the source_fn keyword to the compile function.
-
-\end_layout
-
-\begin_layout Subsection
-Automatic extension module generation
-\end_layout
-
-\begin_layout Standard
-If you want to distribute your f2py extension module, then you only need
- to include the .pyf file and the Fortran code.
- The distutils extensions in NumPy allow you to define an extension module
- entirely in terms of this interface file.
- A valid setup.py file allowing distribution of the add.f module (as part
- of the package f2py_examples so that it would be loaded as f2py_examples.add)
- is
-\end_layout
-
-\begin_layout LyX-Code
-def configuration(parent_package='', top_path=None)
-\newline
- from numpy.distutils.misc_u
-til import Configuration
-\newline
- config = Configuration('f2py_examples',parent_packag
-e, top_path)
-\newline
- config.add_extension('add', sources=['add.pyf','add.f'])
-\newline
-
- return config
-\newline
-
-\newline
-if __name__ == '__main__':
-\newline
- from numpy.distutils.core import
- setup
-\newline
- setup(**configuration(top_path='').todict())
-\end_layout
-
-\begin_layout Standard
-Installation of the new package is easy using
-\end_layout
-
-\begin_layout LyX-Code
-python setup.py install
-\end_layout
-
-\begin_layout Standard
-assuming you have the proper permissions to write to the main site-packages
- directory for the version of Python you are using.
- For the resulting package to work, you need to create a file named __init__.py
- (in the same directory as add.pyf).
- Notice the extension module is defined entirely in terms of the
-\begin_inset Quotes eld
-\end_inset
-
-add.pyf
-\begin_inset Quotes erd
-\end_inset
-
- and
-\begin_inset Quotes eld
-\end_inset
-
-add.f
-\begin_inset Quotes erd
-\end_inset
-
- files.
- The conversion of the .pyf file to a .c file is handled by numpy.disutils.
-
-\end_layout
-
-\begin_layout Subsection
-Conclusion
-\end_layout
-
-\begin_layout Standard
-The interface definition file (.pyf) is how you can fine-tune the interface
- between Python and Fortran.
- There is decent documentation for f2py found in the numpy/f2py/docs directory
- where-ever NumPy is installed on your system (usually under site-packages).
- There is also more information on using f2py (including how to use it to
- wrap C codes) at http://www.scipy.org/Cookbook under the
-\begin_inset Quotes eld
-\end_inset
-
-Using NumPy with Other Languages
-\begin_inset Quotes erd
-\end_inset
-
- heading.
-
-\end_layout
-
-\begin_layout Standard
-The f2py method of linking compiled code is currently the most sophisticated
- and integrated approach.
- It allows clean separation of Python with compiled code while still allowing
- for separate distribution of the extension module.
- The only draw-back is that it requires the existence of a Fortran compiler
- in order for a user to install the code.
- However, with the existence of the free-compilers g77, gfortran, and g95,
- as well as high-quality commerical compilers, this restriction is not particula
-rly onerous.
- In my opinion, Fortran is still the easiest way to write fast and clear
- code for scientific computing.
- It handles complex numbers, and multi-dimensional indexing in the most
- straightforward way.
- Be aware, however, that some Fortran compilers will not be able to optimize
- code as well as good hand-written C-code.
-
-\begin_inset LatexCommand index
-name "f2py|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-weave
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "weave|("
-
-\end_inset
-
-Weave is a scipy package that can be used to automate the process of extending
- Python with C/C++ code.
- It can be used to speed up evaluation of an array expression that would
- otherwise create temporary variables, to directly
-\begin_inset Quotes eld
-\end_inset
-
-inline
-\begin_inset Quotes erd
-\end_inset
-
- C/C++ code into Python, or to create a fully-named extension module.
- You must either install scipy or get the weave package separately and install
- it using the standard python setup.py install.
- You must also have a C/C++-compiler installed and useable by Python distutils
- in order to use weave.
-\end_layout
-
-\begin_layout Standard
-Somewhat dated, but still useful documentation for weave can be found at
- the link http://www.scipy/Weave.
- There are also many examples found in the examples directory which is installed
- under the weave directory in the place where weave is installed on your
- system.
-\end_layout
-
-\begin_layout Subsection
-Speed up code involving arrays (also see scipy.numexpr)
-\end_layout
-
-\begin_layout Standard
-This is the easiest way to use weave and requires minimal changes to your
- Python code.
- It involves placing quotes around the expression of interest and calling
- weave.blitz.
- Weave will parse the code and generate C++ code using Blitz C++ arrays.
- It will then compile the code and catalog the shared library so that the
- next time this exact string is asked for (and the array types are the same),
- the already-compiled shared library will be loaded and used.
- Because Blitz makes extensive use of C++ templating, it can take a long
- time to compile the first time.
- After that, however, the code should evaluate more quickly than the equivalent
- NumPy expression.
- This is especially true if your array sizes are large and the expression
- would require NumPy to create several temporaries.
- Only expressions involving basic arithmetic operations and basic array
- slicing can be converted to Blitz C++ code.
-
-\end_layout
-
-\begin_layout Standard
-For example, consider the expression
-\end_layout
-
-\begin_layout LyX-Code
-d = 4*a + 5*a*b + 6*b*c
-\end_layout
-
-\begin_layout Standard
-where a, b, and c are all arrays of the same type and shape.
- When the data-type is double-precision and the size is 1000x1000, this
- expression takes about 0.5 seconds to compute on an 1.1Ghz AMD Athlon machine.
- When this expression is executed instead using blitz:
-\end_layout
-
-\begin_layout LyX-Code
-d = empty(a.shape, 'd'); weave.blitz(expr)
-\end_layout
-
-\begin_layout Standard
-execution time is only about 0.20 seconds (about 0.14 seconds spent in weave
- and the rest in allocating space for d).
- Thus, we've sped up the code by a factor of 2 using only a simnple command
- (weave.blitz).
- Your mileage may vary, but factors of 2-8 speed-ups are possible with this
- very simple technique.
-
-\end_layout
-
-\begin_layout Standard
-If you are interested in using weave in this way, then you should also look
- at scipy.numexpr which is another similar way to speed up expressions by
- eliminating the need for temporary variables.
- Using numexpr does not require a C/C++ compiler.
-
-\end_layout
-
-\begin_layout Subsection
-Inline C-code
-\end_layout
-
-\begin_layout Standard
-Probably the most widely-used method of employing weave is to
-\begin_inset Quotes eld
-\end_inset
-
-in-line
-\begin_inset Quotes erd
-\end_inset
-
- C/C++ code into Python in order to speed up a time-critical section of
- Python code.
- In this method of using weave, you define a string containing useful C-code
- and then pass it to the function
-\series bold
-weave.inline
-\series default
-(
-\family typewriter
-code_string
-\family default
-,
-\family typewriter
-variables
-\family default
-), where code_string is a string of valid C/C++ code and variables is a
- list of variables that should be passed in from Python.
- The C/C++ code should refer to the variables with the same names as they
- are defined with in Python.
- If weave.line should return anything the the special value return_val should
- be set to whatever object should be returned.
- The following example shows how to use weave on basic Python objects
-\end_layout
-
-\begin_layout LyX-Code
-code = r"""
-\newline
-int i;
-\newline
-py::tuple results(2);
-\newline
-for (i=0; i<a.length(); i++) {
-\newline
-
- a[i] = i;
-\newline
-}
-\newline
-results[0] = 3.0;
-\newline
-results[1] = 4.0;
-\newline
-return_val = results;
-\newline
-"""
-
-\newline
-a = [None]*10
-\newline
-res = weave.inline(code,['a'])
-\end_layout
-
-\begin_layout Standard
-The C++ code shown in the code string uses the name 'a' to refer to the
- Python list that is passed in.
- Because the Python List is a mutable type, the elements of the list itself
- are modified by the C++ code.
- A set of C++ classes are used to access Python objects using simple syntax.
-
-\end_layout
-
-\begin_layout Standard
-The main advantage of using C-code, however, is to speed up processing on
- an array of data.
- Accessing a NumPy array in C++ code using weave, depends on what kind of
- type converter is chosen in going from NumPy arrays to C++ code.
- The default converter creates 5 variables for the C-code for every NumPy
- array passed in to weave.inline.
- The following table shows these variables which can all be used in the
- C++ code.
- The table assumes that
-\family typewriter
-myvar
-\family default
- is the name of the array in Python with data-type <dtype> (i.e.
- float64, float32, int8, etc.)
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="6" columns="3">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Variable
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Type
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Contents
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-myvar
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-<dtype>*
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Pointer to the first element of the array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Nmyvar
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-npy_intp*
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-A pointer to the dimensions array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Smyvar
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-npy_intp*
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-A pointer to the strides array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Dmyvar
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-int
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-The number of dimensions
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-myvar_array
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-PyArrayObject*
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-The entire structure for the array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-The in-lined code can contain references to any of these variables as well
- as to the standard macros MYVAR1(i), MYVAR2(i,j), MYVAR3(i,j,k), and MYVAR4(i,j
-,k,l).
- These name-based macros (they are the Python name capitalized followed
- by the number of dimensions needed) will de-reference the memory for the
- array at the given location with no error checking (be-sure to use the
- correct macro and ensure the array is aligned and in correct byte-swap
- order in order to get useful results).
- The following code shows how you might use these variables and macros to
- code a loop in C that computes a simple 2-d weighted averaging filter.
-\end_layout
-
-\begin_layout LyX-Code
-int i,j;
-\newline
-for(i=1;i<Na[0]-1;i++) {
-\newline
- for(j=1;j<Na[1]-1;j++) {
-\newline
- B2(i,j)
- = A2(i,j) + (A2(i-1,j) +
-\newline
- A2(i+1,j)+A2(i,j-1)
-\newline
-
- + A2(i,j+1))*0.5
-\newline
- + (A2(i-1,j-1)
-\newline
- +
- A2(i-1,j+1)
-\newline
- + A2(i+1,j-1)
-\newline
- + A2(i+1,j+1))*0.25
-\newline
-
- }
-\end_layout
-
-\begin_layout LyX-Code
-}
-\end_layout
-
-\begin_layout Standard
-The above code doesn't have any error checking and so could fail with a
- Python crash if,
-\family typewriter
-a
-\family default
- had the wrong number of dimensions, or
-\family typewriter
-b
-\family default
- did not have the same shape as
-\family typewriter
-a
-\family default
-.
- However, it could be placed inside a standard Python function with the
- necessary error checking to produce a robust but fast subroutine.
-\end_layout
-
-\begin_layout Standard
-One final note about weave.inline: if you have additional code you want to
- include in the final extension module such as supporting function calls,
- include statments, etc.
- you can pass this code in as a string using the keyword support_code:
-\family typewriter
-weave.inline(code, variables, support_code=support)
-\family default
-.
- If you need the extension module to link against an additional library
- then you can also pass in distutils-style keyword arguments such as library_dir
-s, libraries, and/or runtime_library_dirs which point to the appropriate
- libraries and directories.
-
-\end_layout
-
-\begin_layout Subsection
-Simplify creation of an extension module
-\end_layout
-
-\begin_layout Standard
-The inline function creates one extension module for each function to-be
- inlined.
- It also generates a lot of intermediate code that is duplicated for each
- extension module.
- If you have several related codes to execute in C, it would be better to
- make them all separate functions in a single extension module with multiple
- functions.
- You can also use the tools weave provides to produce this larger extension
- module.
- In fact, the weave.inline function just uses these more general tools to
- do its work.
-
-\end_layout
-
-\begin_layout Standard
-The approach is to:
-\end_layout
-
-\begin_layout Enumerate
-construct a extension module object using ext_tools.ext_module(
-\family typewriter
-module_name
-\family default
-);
-\end_layout
-
-\begin_layout Enumerate
-create function objects using ext_tools.ext_function(
-\family typewriter
-func_name
-\family default
-,
-\family typewriter
-code
-\family default
-,
-\family typewriter
-variables
-\family default
-);
-\end_layout
-
-\begin_layout Enumerate
-(optional) add support code to the function using the .customize.add_support_code(
-\family typewriter
-support_code
-\family default
-) method of the function object;
-\end_layout
-
-\begin_layout Enumerate
-add the functions to the extension module object using the .add_function(
-\family typewriter
-func
-\family default
-) method;
-\end_layout
-
-\begin_layout Enumerate
-when all the functions are added, compile the extension with its .compile()
- method.
-\end_layout
-
-\begin_layout Standard
-Several examples are available in the examples directory where weave is
- installed on your system.
- Look particularly at ramp2.py, increment_example.py and fibonacii.py
-\end_layout
-
-\begin_layout Subsection
-Conclusion
-\end_layout
-
-\begin_layout Standard
-Weave is a useful tool for quickly routines in C/C++ and linking them into
- Python.
- It's caching-mechanism allows for on-the-fly compilation which makes it
- particularly attractive for in-house code.
- Because of the requirement that the user have a C++-compiler, it can be
- difficult (but not impossible) to distribute a package that uses weave
- to other users who don't have a compiler installed.
- Of course, weave could be used to construct an extension module which is
- then distributed in the normal way
-\emph on
-(
-\emph default
-using a setup.py file).
- While you can use weave to build larger extension modules with many methods,
- creating methods with a variable-number of arguments is not possible.
- Thus, for a more sophisticated module, you will still probably want a Python-la
-yer that calls the weave-produced extension.
-
-\begin_inset LatexCommand index
-name "weave|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Pyrex
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "pyrex|("
-
-\end_inset
-
-Pyrex is a way to write C-extension modules using Python-like syntax.
- It is an interesting way to generate extension modules that is growing
- in popularity, particularly among people who have rusty or non-existent
- C-skills.
- It does require the user to write the
-\begin_inset Quotes eld
-\end_inset
-
-interface
-\begin_inset Quotes erd
-\end_inset
-
- code and so is more time-consuming than SWIG or f2py if you are trying
- to interface to a large library of code.
- However, if you are writing an extension module that will include quite
- a bit of your own algorithmic code, as well, then Pyrex is a good match.
- A big weakness perhaps is the inability to easily and quickly access the
- elements of a multidimensional array.
-
-\end_layout
-
-\begin_layout Standard
-Notice that Pyrex is an extension-module generator only.
- Unlike weave or f2py, it includes no automatic facility for compiling and
- linking the extension module (which must be done in the usual fashion).
- It does provide a modified distutils class called build_ext which lets
- you build an extension module from a .pyx source.
- Thus, you could write in a setup.py file
-\end_layout
-
-\begin_layout LyX-Code
-from Pyrex.Distutils import build_ext
-\newline
-from distutils.extension import Extension
-\newline
-from
- distutils.core import setup
-\newline
-
-\newline
-import numpy
-\newline
-py_ext = Extension('mine', ['mine.pyx'],
-\newline
-
- include_dirs=[numpy.get_include()])
-\newline
-
-\newline
-setup(name='mine', description='Nothi
-ng',
-\newline
- ext_modules=[pyx_ext],
-\newline
- cmdclass = {'build_ext':build_ext})
-\end_layout
-
-\begin_layout Standard
-Adding the NumPy include directory is, of course, only necessary if you
- are using NumPy arrays in the extension module (which is what I assume
- you are using Pyrex for).
- The distutils extensions in NumPy also include support for automatically
- producing the extension-module and linking it from a
-\family typewriter
-.pyx
-\family default
- file.
- It works so that if the user does not have Pyrex installed, then it looks
- for a file with the same file-name but a
-\family typewriter
-.c
-\family default
- extension which it then uses instead of trying to produce the
-\family typewriter
-.c
-\family default
- file again.
-
-\end_layout
-
-\begin_layout Standard
-Pyrex does not natively understand NumPy arrays.
- However, it is not difficult to include information that lets Pyrex deal
- with them usefully.
- In fact, the numpy.random.mtrand module was written using Pyrex so an example
- of Pyrex usage is already included in the NumPy source distribution.
- That experience led to the creation of a standard c_numpy.pxd file that
- you can use to simplify interacting with NumPy array objects in a Pyrex-written
- extension.
- The file may not be complete (it wasn't at the time of this writing).
- If you have additions you'd like to contribute, please send them.
- The file is located in the .../site-packages/numpy/doc/pyrex directory where
- you have Python installed.
- There is also an example in that directory of using Pyrex to construct
- a simple extension module.
- It shows that Pyrex looks a lot like Python but also contains some new
- syntax that is necessary in order to get C-like speed.
-
-\end_layout
-
-\begin_layout Standard
-If you just use Pyrex to compile a standard Python module, then you will
- get a C-extension module that runs either as fast or, possibly, more slowly
- than the equivalent Python module.
- Speed increases are possible only when you use cdef to statically define
- C variables and use a special construct to create for loops:
-\end_layout
-
-\begin_layout LyX-Code
-cdef int i
-\newline
-for i from start <= i < stop
-\end_layout
-
-\begin_layout Standard
-Let's look at two examples we've seen before to see how they might be implemente
-d using Pyrex.
- These examples were compiled into extension modules using Pyrex-0.9.3.1.
-\end_layout
-
-\begin_layout Subsection
-Pyrex-add
-\end_layout
-
-\begin_layout Standard
-Here is part of a Pyrex-file I named add.pyx which implements the add functions
- we previously implemented using f2py:
-\end_layout
-
-\begin_layout LyX-Code
-cimport c_numpy
-\newline
-from c_numpy cimport import_array, ndarray, npy_intp, npy_cdouble
-,
-\backslash
-
-\newline
- npy_cfloat, NPY_DOUBLE, NPY_CDOUBLE, NPY_FLOAT,
-\backslash
-
-\newline
- NPY_CFLOAT
-\newline
-
-\newline
-#We need to initialize NumPy
-\newline
-import_array()
-\newline
-
-\newline
-def zadd(object
- ao, object bo):
-\newline
- cdef ndarray c, a, b
-\newline
- cdef npy_intp i
-\newline
- a = c_numpy.PyArra
-y_ContiguousFromAny(ao,
-\newline
- NPY_CDOUBLE, 1, 1)
-\newline
- b = c_numpy.PyArr
-ay_ContiguousFromAny(bo,
-\newline
- NPY_CDOUBLE, 1, 1)
-\newline
- c = c_numpy.PyAr
-ray_SimpleNew(a.nd, a.dimensions,
-\newline
- a.descr.type_num)
-\newline
- for i
- from 0 <= i < a.dimensions[0]:
-\newline
- (<npy_cdouble *>c.data)[i].real =
-\backslash
-
-\newline
- (<npy_cdouble *>a.data)[i].real +
-\backslash
-
-\newline
- (<npy_cdouble *>b.data)[i].real
-\newline
- (<npy_cdouble *>c.data)[i].imag
- =
-\backslash
-
-\newline
- (<npy_cdouble *>a.data)[i].imag +
-\backslash
-
-\newline
- (<npy_cdouble *>b.data)[i].imag
-\newline
- return c
-\end_layout
-
-\begin_layout Standard
-This module shows use of the
-\family typewriter
-cimport
-\family default
- statement to load the definitions from the c_numpy.pxd file.
- As shown, both versions of the import statement are supported.
- It also shows use of the NumPy C-API to construct NumPy arrays from arbitrary
- input objects.
- The array c is created using PyArray_SimpleNew.
- Then the c-array is filled by addition.
- Casting to a particiular data-type is accomplished using <cast *>.
- Pointers are de-referenced with bracket notation and members of structures
- are accessed using '.' notation even if the object is techinically a pointer
- to a structure.
- The use of the special for loop construct ensures that the underlying code
- will have a similar C-loop so the addition calculation will proceed quickly.
- Notice that we have not checked for NULL after calling to the C-API ---
- a cardinal sin when writing C-code.
- For routines that return Python objects, Pyrex inserts the checks for NULL
- into the C-code for you and returns with failure if need be.
- There is also a way to get Pyrex to automatically check for exceptions
- when you call functions that don't return Python objects.
- See the documentation of Pyrex for details.
-
-\end_layout
-
-\begin_layout Subsection
-Pyrex-filter
-\end_layout
-
-\begin_layout Standard
-The two-dimensional example we created using weave is a bit uglierto implement
- in Pyrex because two-dimensional indexing using Pyrex is not as simple.
- But, it is straightforward (and possibly faster because of pre-computed
- indices).
- Here is the Pyrex-file I named image.pyx.
-\end_layout
-
-\begin_layout LyX-Code
-cimport c_numpy
-\newline
-from c_numpy cimport import_array, ndarray, npy_intp,
-\backslash
-
-\newline
- NPY_DOUBLE, NPY_CDOUBLE,
-\backslash
-
-\newline
- NPY_FLOAT, NPY_CFLOAT, NPY_ALIGNED
-\backslash
-
-\newline
-
-\newline
-#We need to initialize NumPy
-\newline
-import_array()
-\newline
-def filter(object ao):
-\newline
- cdef
- ndarray a, b
-\newline
- cdef npy_intp i, j, M, N, oS
-\newline
- cdef npy_intp r,rm1,rp1,c,cm1,c
-p1
-\newline
- cdef double value
-\newline
- # Require an ALIGNED array
-\newline
- # (but not necessarily
- contiguous)
-\newline
- # We will use strides to access the elements.
-\newline
- a = c_numpy.PyAr
-ray_FROMANY(ao, NPY_DOUBLE,
-\backslash
-
-\newline
- 2, 2, NPY_ALIGNED)
-\newline
- b = c_numpy.PyArray_SimpleNew(a.nd,a.dimensio
-ns,
-\backslash
-
-\newline
- a.descr.type_num)
-\newline
- M = a.dimensions[0]
-\newline
-
- N = a.dimensions[1]
-\newline
- S0 = a.strides[0]
-\newline
- S1 = a.strides[1]
-\newline
- for i
- from 1 <= i < M-1:
-\newline
- r = i*S0
-\newline
- rm1 = r-S0
-\newline
- rp1 = r+S0
-\newline
-
- oS = i*N
-\newline
- for j from 1 <= j < N-1:
-\newline
- c = j*S1
-\newline
-
- cm1 = c-S1
-\newline
- cp1 = c+S1
-\newline
- (<double *>b.data)[oS+j]
- =
-\backslash
-
-\newline
- (<double *>(a.data+r+c))[0] +
-\backslash
-
-\newline
- ((<double *>(a.data+rm1+c))[0] +
-\backslash
-
-\newline
- (<double *>(a.data+rp1+c))[0] +
-\backslash
-
-\newline
- (<double *>(a.data+r+cm1))[0] +
-\backslash
-
-\newline
- (<double *>(a.data+r+cp1))[0])*0.5 +
-\backslash
-
-\newline
- ((<double *>(a.data+rm1+cm1))[0] +
-\backslash
-
-\newline
- (<double *>(a.data+rp1+cm1))[0] +
-\backslash
-
-\newline
- (<double *>(a.data+rp1+cp1))[0] +
-\backslash
-
-\newline
- (<double *>(a.data+rm1+cp1))[0])*0.25
-\newline
- return b
-\end_layout
-
-\begin_layout Standard
-This 2-d averaging filter runs quickly because the loop is in C and the
- pointer computations are done only as needed.
- However, it is not particularly easy to understand what is happening.
- A 2-d image,
-\family typewriter
-in
-\family default
-, can be filtered using this code very quickly using
-\end_layout
-
-\begin_layout LyX-Code
-import image
-\end_layout
-
-\begin_layout LyX-Code
-out = image.filter(in)
-\end_layout
-
-\begin_layout Subsection
-Conclusion
-\end_layout
-
-\begin_layout Standard
-There are several disadvantages of using Pyrex:
-\end_layout
-
-\begin_layout Enumerate
-The syntax for Pyrex can get a bit bulky, and it can be confusing at first
- to understand what kind of objects you are getting and how to interface
- them with C-like constructs.
-
-\end_layout
-
-\begin_layout Enumerate
-Inappropriate Pyrex syntax or incorrect calls to C-code or type-mismatches
- can result in failures such as
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-Pyrex failing to generate the extension module source code,
-\end_layout
-
-\begin_layout Enumerate
-Compiler failure while generating the extension module binary due to incorrect
- C syntax,
-\end_layout
-
-\begin_layout Enumerate
-Python failure when trying to use the module.
-
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-It is easy to lose a clean separation between Python and C which makes re-using
- your C-code for other non-Python-related projects more difficult.
-\end_layout
-
-\begin_layout Enumerate
-Multi-dimensional arrays are
-\begin_inset Quotes eld
-\end_inset
-
-bulky
-\begin_inset Quotes erd
-\end_inset
-
- to index (appropriate macros may be able to fix this).
-
-\end_layout
-
-\begin_layout Enumerate
-The C-code generated by Prex is hard to read and modify (and typically compiles
- with annoying but harmless warnings).
-
-\end_layout
-
-\begin_layout Standard
-Writing a good Pyrex extension module still takes a bit of effort because
- not only does it require (a little) familiarity with C, but also with Pyrex's
- brand of Python-mixed-with C.
- One big advantage of Pyrex-generated extension modules is that they are
- easy to distribute using distutils.
- In summary, Pyrex is a very capable tool for either gluing C-code or generating
- an extension module quickly and should not be over-looked.
- It is especially useful for people that can't or won't write C-code or
- Fortran code.
- But, if you are already able to write simple subroutines in C or Fortran,
- then I would use one of the other approaches such as f2py (for Fortran),
- ctypes (for C shared-libraries), or weave (for inline C-code).
-\begin_inset LatexCommand index
-name "pyrex|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-ctypes
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ctypes|("
-
-\end_inset
-
-Ctypes is a python extension module (downloaded separately for Python <2.5
- and included with Python 2.5) that allows you to call an arbitrary function
- in a shared library directly from Python.
- This approach allows you to interface with C-code directly from Python.
- This opens up an enormous number of libraries for use from Python.
- The drawback, however, is that coding mistakes can lead to ugly program
- crashes very easily (just as can happen in C) because there is little type
- or bounds checking done on the parameters.
- This is especially true when array data is passed in as a pointer to a
- raw memory location.
- The responsibility is then on you that the subroutine will not access memory
- outside the actual array area.
- But, if you don't mind living a little dangerously ctypes can be an effective
- tool for quickly taking advantage of a large shared library (or writing
- extended functionality in your own shared library).
-\end_layout
-
-\begin_layout Standard
-Because the ctypes approach exposes a raw interface to the compiled code
- it is not always tolerant of user mistakes.
- Robust use of the ctypes module typically involves an additional layer
- of Python code in order to check the data types and array bounds of objects
- passed to the underlying subroutine.
- This additional layer of checking (not to mention the conversion from ctypes
- objects to C-data-types that ctypes itself performs), will make the interface
- slower than a hand-written extension-module interface.
- However, this overhead should be neglible if the C-routine being called
- is doing any significant amount of work.
- If you are a great Python programmer with weak C-skills, ctypes is an easy
- way to write a useful interface to a (shared) library of compiled code.
-
-\end_layout
-
-\begin_layout Standard
-To use c-types you must
-\end_layout
-
-\begin_layout Enumerate
-Have a shared library.
-\end_layout
-
-\begin_layout Enumerate
-Load the shared library.
-\end_layout
-
-\begin_layout Enumerate
-Convert the python objects to ctypes-understood arguments.
-\end_layout
-
-\begin_layout Enumerate
-Call the function from the library with the ctypes arguments.
-\end_layout
-
-\begin_layout Subsection
-Having a shared library
-\end_layout
-
-\begin_layout Standard
-There are several requirements for a shared library that can be used with
- c-types that are platform specific.
- This guide assumes you have some familiarity with making a shared library
- on your system (or simply have a shared library available to you).
- Items to remember are:
-\end_layout
-
-\begin_layout Itemize
-A shared library must be compiled in a special way (
-\emph on
-e.g.
-
-\emph default
- using the -shared flag with gcc).
-\end_layout
-
-\begin_layout Itemize
-On some platforms (
-\emph on
-e.g.
-
-\emph default
- Windows) , a shared library requires a .def file that specifies the functions
- to be exported.
- For example a mylib.def file might contain.
-
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-LIBRARY mylib.dll
-\newline
-EXPORTS
-\newline
-cool_function1
-\newline
-cool_function2
-\end_layout
-
-\begin_layout Standard
-Alternatively, you may be able to use the storage-class specifier __declspec(dll
-export) in the C-definition of the function to avoid the need for this .def
- file.
-
-\end_layout
-
-\end_deeper
-\begin_layout Standard
-There is no standard way in Python distutils to create a standard shared
- library (an extension module is a
-\begin_inset Quotes eld
-\end_inset
-
-special
-\begin_inset Quotes erd
-\end_inset
-
- shared library Python understands) in a cross-platform manner.
- Thus, a big disadvantage of ctypes at the time of writing this book is
- that it is difficult to distribute in a cross-platform manner a Python
- extension that uses c-types and includes your own code which should be
- compiled as a shared library on the users system.
-
-\end_layout
-
-\begin_layout Subsection
-Loading the shared library
-\end_layout
-
-\begin_layout Standard
-A simple, but robust way to load the shared library is to get the absolute
- path name and load it using the cdll object of ctypes.
-
-\end_layout
-
-\begin_layout LyX-Code
-lib = ctypes.cdll[<full_path_name>]
-\end_layout
-
-\begin_layout Standard
-However, on Windows accessing an attribute of the cdll method will load
- the first DLL by that name found in the current directory or on the PATH.
- Loading the absolute path name requires a little finesse for cross-platform
- work since the extension of shared libraries varies.
- There is a
-\family typewriter
-ctypes.util.find_library
-\family default
- utility available that can simplify the process of finding the library
- to load but it is not foolproof.
- Complicating matters, different platforms have different default extensions
- used by shared libraries (e.g.
- .dll -- Windows, .so -- Linux, .dylib -- Mac OS X).
- This must also be taken into account if you are using c-types to wrap code
- that needs to work on several platforms.
-
-\end_layout
-
-\begin_layout Standard
-NumPy provides a convenience function called
-\series bold
-ctypeslib.load_library
-\series default
-(name, path).
- This function takes the name of the shared library (including any prefix
- like 'lib' but excluding the extension) and a path where the shared library
- can be located.
- It returns a ctypes library object or raises an OSError if the library
- cannot be found or raises an ImportError if the ctypes module is not available.
- (Windows users: the ctypes library object loaded using
-\series bold
-load_library
-\series default
- is always loaded assuming cdecl calling convention.
- See the ctypes documentation under ctypes.windll and/or ctypes.oledll for
- ways to load libraries under other calling conventions).
-
-\end_layout
-
-\begin_layout Standard
-The functions in the shared library are available as attributes of the ctypes
- library object (returned from
-\series bold
-ctypeslib.load_library
-\series default
-) or as items using lib['func_name'] syntax.
- The latter method for retrieving a function name is particularly useful
- if the function name contains characters that are not allowable in Python
- variable names.
-
-\end_layout
-
-\begin_layout Subsection
-Converting arguments
-\end_layout
-
-\begin_layout Standard
-Python ints/longs, strings, and unicode objects are automatically converted
- as needed to equivalent c-types arguments The None object is also converted
- automatically to a NULL pointer.
- All other Python objects must be converted to ctypes-specific types.
- There are two ways around this restriction that allow c-types to integrate
- with other objects.
-
-\end_layout
-
-\begin_layout Enumerate
-Don't set the argtypes attribute of the function object and define an _as_parame
-ter_ method for the object you want to pass in.
- The _as_parameter_ method must return a Python int which will be passed
- directly to the function.
-
-\end_layout
-
-\begin_layout Enumerate
-Set the argtypes attribute to a list whose entries contain objects with
- a classmethod named from_param that knows how to convert your object to
- an object that ctypes can understand (an int/long, string, unicode, or
- object with the _as_parameter_ attribute).
-
-\end_layout
-
-\begin_layout Standard
-NumPy uses both methods with a preference for the second method because
- it can be safer.
- The ctypes attribute of the ndarray returns an object that has an _as_parameter
-_ attribute which returns an integer representing the address of the ndarray
- to which it is associated.
- As a result, one can pass this ctypes attribute object directly to a function
- expecting a pointer to the data in your ndarray.
- The caller must be sure that the ndarray object is of the correct type,
- shape, and has the correct flags set or risk nasty crashes if the data-pointer
- to inappropriate arrays are passsed in.
-
-\end_layout
-
-\begin_layout Standard
-To implement the second method, NumPy provides the class-factory function
-
-\series bold
-ndpointer
-\series default
- in the
-\series bold
-ctypeslib
-\series default
- module.
- This class-factory function produces an appropriate class that can be placed
- in an argtypes attribute entry of a ctypes function.
- The class will contain a from_param method which ctypes will use to convert
- any ndarray passed in to the function to a ctypes-recognized object.
- In the process, the conversion will perform checking on any properties
- of the ndarray that were specified by the user in the call to ndpointer.
- Aspects of the ndarray that can be checked include the data-type, the number-of
--dimensions, the shape, and/or the state of the flags on any array passed.
- The return value of the from_param method is the ctypes attribute of the
- array which (because it contains the _as_parameter_ attribute pointing
- to the array data area) can be used by ctypes directly.
-
-\end_layout
-
-\begin_layout Standard
-The ctypes attribute of an ndarray is also endowed with additional attributes
- that may be convenient when passing additional information about the array
- into a ctypes function.
- The attributes
-\series bold
-data
-\series default
-,
-\series bold
-shape
-\series default
-, and
-\series bold
-strides
-\series default
- can provide c-types compatible types corresponding to the data-area, the
- shape, and the strides of the array.
- The data attribute reutrns a
-\family typewriter
-c_void_p
-\family default
- representing a pointer to the data area.
- The shape and strides attributes each return an array of ctypes integers
- (or None representing a NULL pointer, if a 0-d array).
- The base ctype of the array is a ctype integer of the same size as a pointer
- on the platform.
- There are also methods data_as(<ctype>), shape_as(<base ctype>), and strides_as
-(<base ctype>).
- These return the data as a ctype object of your choice and the shape/strides
- arrays using an underlying base type of your choice.
- For convenience, the
-\series bold
-ctypeslib
-\series default
- module also contains
-\series bold
-c_intp
-\series default
- as a ctypes integer data-type whose size is the same as the size of
-\family typewriter
-c_void_p
-\family default
- on the platform (it's value is None if ctypes is not installed).
-
-\end_layout
-
-\begin_layout Subsection
-Calling the function
-\end_layout
-
-\begin_layout Standard
-The function is accessed as an attribute of or an item from the loaded shared-li
-brary.
- Thus, if
-\begin_inset Quotes eld
-\end_inset
-
-./mylib.so
-\begin_inset Quotes erd
-\end_inset
-
- has a function named
-\begin_inset Quotes eld
-\end_inset
-
-cool_function1
-\begin_inset Quotes erd
-\end_inset
-
-, I could access this function either as
-\end_layout
-
-\begin_layout LyX-Code
-lib = numpy.ctypeslib.load_library('mylib','.')
-\newline
-func1 = lib.cool_function1 #
- or equivalently
-\newline
-func1 = lib['cool_function1']
-\end_layout
-
-\begin_layout Standard
-In ctypes, the return-value of a function is set to be 'int' by default.
- This behavior can be changed by setting the restype attribute of the function.
- Use None for the restype if the function has no return value ('void'):
-\end_layout
-
-\begin_layout LyX-Code
-func1.restype = None
-\end_layout
-
-\begin_layout Standard
-As previously discussed, you can also set the argtypes attribute of the
- function in order to have ctypes check the types of the input arguments
- when the function is called.
- Use the ndpointer factory function to generate a ready-made class for data-type
-, shape, and flags checking on your new function.
- The ndpointer function has the signature
-\end_layout
-
-\begin_layout Description
-ndpointer (dtype=None, ndim=None, shape=None, flags=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Keyword arguments with the value
-\family typewriter
-None
-\family default
- are not checked.
- Specifying a keyword enforces checking of that aspect of the ndarray on
- conversion to a ctypes-compatible object.
- The dtype keyword can be any object understood as a data-type object.
- The ndim keyword should be an integer, and the shape keyword should be
- an integer or a sequence of integers.
- The flags keyword specifies the minimal flags that are required on any
- array passed in.
- This can be specified as a string of comma separated requirements, an integer
- indicating the requirement bits OR'd together, or a flags object returned
- from the flags attribute of an array with the necessary requirements.
-
-\end_layout
-
-\begin_layout Standard
-Using an ndpointer class in the argtypes method can make it significantly
- safer to call a C-function using ctypes and the data-area of an ndarray.
- You may still want to wrap the function in an additional Python wrapper
- to make it user-friendly (hiding some obvious arguments and making some
- arguments output arguments).
- In this process, the
-\series bold
-requires
-\series default
- function in NumPy may be useful to return the right kind of array from
- a given input.
-
-\end_layout
-
-\begin_layout Subsection
-Complete example
-\end_layout
-
-\begin_layout Standard
-In this example, I will show how the addition function and the filter function
- implemented previously using the other approaches can be implemented using
- ctypes.
- First, the C-code which implements the algorithms contains the functions
- zadd, dadd, sadd, cadd, and dfilter2d.
- The zadd function is
-\end_layout
-
-\begin_layout LyX-Code
-/* Add arrays of contiguous data */
-\newline
-typedef struct {double real; double imag;}
- cdouble;
-\newline
-typedef struct {float real; float imag;} cfloat;
-\newline
-void zadd(cdouble
- *a, cdouble *b, cdouble *c, long n)
-\newline
-{
-\newline
- while (n--) {
-\newline
- c->real =
- a->real + b->real;
-\newline
- c->imag = a->imag + b->imag;
-\newline
- a++; b++;
- c++;
-\newline
- }
-\newline
-}
-\end_layout
-
-\begin_layout Standard
-with similar code for cadd, dadd, and sadd that handles complex float, double,
- and float data-types, respectively:
-\end_layout
-
-\begin_layout LyX-Code
-void cadd(cfloat *a, cfloat *b, cfloat *c, long n)
-\newline
-{
-\newline
- while (n--) {
-\newline
-
- c->real = a->real + b->real;
-\newline
- c->imag = a->imag
- + b->imag;
-\newline
- a++; b++; c++;
-\newline
- }
-\newline
-}
-\newline
-void dadd(double
- *a, double *b, double *c, long n)
-\newline
-{
-\newline
- while (n--) {
-\newline
-
- *c++ = *a++ + *b++;
-\newline
- }
-\newline
-}
-\newline
-void sadd(float *a, float *b, float
- *c, long n)
-\newline
-{
-\newline
- while (n--) {
-\newline
- *c++ = *a++ + *b++;
-\newline
-
- }
-\newline
-}
-\end_layout
-
-\begin_layout Standard
-The code.c file also contains the function dfilter2d:
-\end_layout
-
-\begin_layout LyX-Code
-/* Assumes b is contiguous and
-\newline
- a has strides that are multiples of sizeof(dou
-ble)
-\newline
-*/
-\newline
-void
-\newline
-dfilter2d(double *a, double *b, int *astrides, int *dims)
-\newline
-{
-\newline
-
- int i, j, M, N, S0, S1;
-\newline
- int r, c, rm1, rp1, cp1, cm1;
-\newline
-
-\newline
- M = dims[0];
- N = dims[1];
-\newline
- S0 = astrides[0]/sizeof(double);
-\newline
- S1=astrides[1]/sizeof(doub
-le);
-\newline
- for (i=1; i<M-1; i++) {
-\newline
- r = i*S0; rp1 = r+S0; rm1 = r-S0;
-\newline
-
- for (j=1; j<N-1; j++) {
-\newline
- c = j*S1; cp1 = j+S1; cm1 = j-S1;
-\newline
-
- b[i*N+j] = a[r+c] +
-\backslash
-
-\newline
- (a[rp1+c] + a[rm1+c] +
-\backslash
-
-\newline
- a[r+cp1] + a[r+cm1])*0.5 +
-\backslash
-
-\newline
- (a[rp1+cp1] + a[rp1+cm1] +
-\backslash
-
-\newline
- a[rm1+cp1] + a[rm1+cp1])*0.25;
-\newline
- }
-\newline
- }
-\newline
-}
-\end_layout
-
-\begin_layout Standard
-A possible advantage this code has over the Fortran-equivalent code is that
- it takes arbitrarily strided (i.e.
- non-contiguous arrays) and may also run faster depending on the optimization
- capability of your compiler.
- But, it is a obviously more complicated than the simple code in filter.f.
- This code must be compiled into a shared library.
- On my Linux system this is accomplished using
-\end_layout
-
-\begin_layout LyX-Code
-gcc -o code.so -shared code.c
-\end_layout
-
-\begin_layout Standard
-Which creates a shared_library named code.so in the current directory.
- On Windows don't forget to either add __declspec(dllexport) in front of
- void on the line preceeding each function definition, or write a code.def
- file that lists the names of the functions to be exported.
-
-\end_layout
-
-\begin_layout Standard
-A suitable Python interface to this shared library should be constructed.
- To do this create a file named interface.py with the following lines at
- the top:
-\end_layout
-
-\begin_layout LyX-Code
-__all__ = ['add', 'filter2d']
-\newline
-
-\newline
-import numpy as N
-\newline
-import os
-\newline
-
-\newline
-_path = os.path.dirname('__
-file__')
-\newline
-lib = N.ctypeslib.load_library('code', _path)
-\newline
-_typedict = {'zadd' :
- complex, 'sadd' : N.single,
-\newline
- 'cadd' : N.csingle, 'dadd' : float}
-\newline
-for
- name in _typedict.keys():
-\newline
- val = getattr(lib, name)
-\newline
- val.restype = None
-\newline
-
- _type = _typedict[name]
-\newline
- val.argtypes = [N.ctypeslib.ndpointer(_type,
-
-\newline
- flags='aligned, contiguous'),
-\newline
-
- N.ctypeslib.ndpointer(_type,
-\newline
- flags='aligned, contiguous'),
-\newline
-
- N.ctypeslib.ndpointer(_type,
-\newline
- flags='alig
-ned, contiguous,'
-\backslash
-
-\newline
- 'writeable'),
-\newline
- N.ctypeslib.c_intp]
-\end_layout
-
-\begin_layout Standard
-This code loads the shared library named code.<ext> located in the same path
- as this file.
- It then adds a return type of void to the functions contained in the library.
- It also adds argument checking to the functions in the library so that
- ndarrays can be passed as the first three arguments along with an integer
- (large enough to hold a pointer on the platform) as the fourth argument.
-
-\end_layout
-
-\begin_layout Standard
-Setting up the filtering function is similar and allows the filtering function
- to be called with ndarray arguments as the first two arguments and with
- pointers to integers (large enough to handle the strides and shape of an
- ndarray) as the last two arguments.
-
-\end_layout
-
-\begin_layout LyX-Code
-lib.dfilter2d.restype=None
-\newline
-lib.dfilter2d.argtypes = [N.ctypeslib.ndpointer(float,
- ndim=2,
-\newline
- flags='aligned'),
-\newline
-
- N.ctypeslib.ndpointer(float, ndim=2,
-\newline
-
- flags='aligned, contiguous,'
-\backslash
-
-\newline
- 'writeable'),
-\newline
-
- ctypes.POINTER(N.ctypeslib.c_intp),
-\newline
- ctypes.POINTER
-(N.ctypeslib.c_intp)]
-\end_layout
-
-\begin_layout Standard
-Next, define a simple selection function that chooses which addition function
- to call in the shared library based on the data-type:
-\end_layout
-
-\begin_layout LyX-Code
-def select(dtype):
-\newline
- if dtype.char in ['?bBhHf']:
-\newline
- return lib.sadd,
- single
-\newline
- elif dtype.char in ['F']:
-\newline
- return lib.cadd, csingle
-\newline
- elif
- dtype.char in ['DG']:
-\newline
- return lib.zadd, complex
-\newline
- else:
-\newline
- return
- lib.dadd, float
-\newline
- return func, ntype
-\end_layout
-
-\begin_layout Standard
-Finally, the two functions to be exported by the interface can be written
- simply as
-\end_layout
-
-\begin_layout LyX-Code
-def add(a, b):
-\newline
- requires = ['CONTIGUOUS', 'ALIGNED']
-\newline
- a = N.asanyarray(a)
-\newline
-
- func, dtype = select(a.dtype)
-\newline
- a = N.require(a, dtype, requires)
-\newline
-
- b = N.require(b, dtype, requires)
-\newline
- c = N.empty_like(a)
-\newline
- func(a,b,c,a.size)
-\newline
-
- return c
-\end_layout
-
-\begin_layout Standard
-and
-\end_layout
-
-\begin_layout LyX-Code
-def filter2d(a):
-\newline
- a = N.require(a, float, ['ALIGNED'])
-\newline
- b = N.zeros_like(a)
-\newline
-
- lib.dfilter2d(a, b, a.ctypes.strides, a.ctypes.shape)
-\newline
- return b
-\end_layout
-
-\begin_layout Subsection
-Conclusion
-\end_layout
-
-\begin_layout Standard
-Using ctypes is a powerful way to connect Python with arbitrary C-code.
- It's advantages for extending Python include
-\end_layout
-
-\begin_layout Itemize
-clean separation of C-code from Python code
-\end_layout
-
-\begin_deeper
-\begin_layout Itemize
-no need to learn a new syntax except Python and C
-\end_layout
-
-\begin_layout Itemize
-allows re-use of C-code
-\end_layout
-
-\begin_layout Itemize
-functionality in shared libraries written for other purposes can be obtained
- with a simple Python wrapper and search for the library.
-
-\end_layout
-
-\end_deeper
-\begin_layout Itemize
-easy integration with NumPy through the ctypes attribute
-\end_layout
-
-\begin_layout Itemize
-full argument checking with the ndpointer class factory
-\end_layout
-
-\begin_layout Standard
-It's disadvantages include
-\end_layout
-
-\begin_layout Itemize
-It is difficult to distribute an extension module made using ctypes because
- of a lack of support for building shared libraries in distutils (but I
- suspect this will change in time).
-
-\end_layout
-
-\begin_layout Itemize
-You must have shared-libraries of your code (no static libraries).
-
-\end_layout
-
-\begin_layout Itemize
-Very little support for C++ code and it's different library-calling conventions.
- You will probably need a C-wrapper around C++ code to use with ctypes (or
- just use Boost.Python instead).
-\end_layout
-
-\begin_layout Standard
-Because of the difficulty in distributing an extension module made using
- ctypes, f2py is still the easiest way to extend Python for package creation.
- However, ctypes is a close second and will probably be growing in popularity
- now that it is part of the Python distribution.
- This should bring more features to ctypes that should eliminate the difficulty
- in extending Python and distributing the extension using ctypes.
-
-\begin_inset LatexCommand index
-name "ctypes|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Additional tools you may find useful
-\end_layout
-
-\begin_layout Standard
-These tools have been found useful by others using Python and so are included
- here.
- They are discussed separately because I see them as either older ways to
- do things more modernly handled by f2py, weave, Pyrex, or ctypes (SWIG,
- PyFort, PyInline) or because I don't know much about them (SIP, Boost,
- Instant).
- I have not added links to these methods because my experience is that you
- can find the most relevant link faster using Google or some other search
- engine, and any links provided here would be quickly dated.
- Do not assume that just because it is included in this list, I don't think
- the package deserves your attention.
- I'm including information about these packages because many people have
- found them useful and I'd like to give you as many options as possible
- for tackling the problem of easily integrating your code.
-
-\end_layout
-
-\begin_layout Subsection
-SWIG
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "swig"
-
-\end_inset
-
-Simplified Wrapper and Interface Generator (SWIG) is an old and fairly stable
- method for wrapping C/C++-libraries to a large variety of other languages.
- It does not specifically understand NumPy arrays but can be made useable
- with NumPy through the use of typemaps.
- There are some sample typemaps in the numpy/doc/swig directory under numpy.i
- along with an example module that makes use of them.
- SWIG excels at wrapping large C/C++ libraries because it can (almost) parse
- their headers and auto-produce an interface.
- Technically, you need to generate a
-\family typewriter
-.i
-\family default
- file that defines the interface.
- Often, however, this
-\family typewriter
-.i
-\family default
- file can be parts of the header itself.
- The interface usually needs a bit of tweaking to be very useful.
- This ability to parse C/C++ headers and auto-generate the interface still
- makes SWIG a useful approach to adding functionalilty from C/C++ into Python,
- despite the other methods that have emerged that are more targeted to Python.
- SWIG can actually target extensions for several languages, but the typemaps
- usually have to be language-specific.
- Nonetheless, with modifications to the Python-specific typemaps, SWIG can
- be used to interface a library with other languages such as Perl, Tcl,
- and Ruby.
-
-\end_layout
-
-\begin_layout Standard
-My experience with SWIG has been generally positive in that it is relatively
- easy to use and quite powerful.
- I used to use it quite often before becoming more proficient at writing
- C-extensions.
- However, I struggled writing custom interfaces with SWIG because it must
- be done using the concept of typemaps which are not Python specific and
- are written in a C-like syntax.
- Therefore, I tend to prefer other gluing strategies and would only attempt
- to use SWIG to wrap a very-large C/C++ library.
- Nonetheless, there are others who use SWIG quite happily.
-
-\end_layout
-
-\begin_layout Subsection
-SIP
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "SIP"
-
-\end_inset
-
-SIP is another tool for wrapping C/C++ libraries that is Python specific
- and appears to have very good support for C++.
- Riverbank Computing developed SIP in order to create Python bindings to
- the QT library.
- An interface file must be written to generate the binding, but the interface
- file looks a lot like a C/C++ header file.
- While SIP is not a full C++ parser, it understands quite a bit of C++ syntax
- as well as its own special directives that allow modification of how the
- Python binding is accomplished.
- It also allows the user to define mappings between Python types and C/C++
- structrues and classes.
-
-\end_layout
-
-\begin_layout Subsection
-Boost Python
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "Boost.Python"
-
-\end_inset
-
-Boost is a repository of C++ libraries and Boost.Python is one of those libraries
- which provides a concise interface for binding C++ classes and functions
- to Python.
- The amazing part of the Boost.Python approach is that it works entirely
- in pure C++ without introducing a new syntax.
- Many users of C++ report that Boost.Python makes it possible to combine
- the best of both worlds in a seamless fashion.
- I have not used Boost.Python because I am not a big user of C++ and using
- Boost to wrap simple C-subroutines is usually over-kill.
- It's primary purpose is to make C++ classes available in Python.
- So, if you have a set of C++ classes that need to be integrated cleanly
- into Python, consider learning about and using Boost.Python.
-\end_layout
-
-\begin_layout Subsection
-Instant
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "Instant"
-
-\end_inset
-
-This is a relatively new package (called pyinstant at sourceforge) that
- builds on top of SWIG to make it easy to inline C and C++ code in Python
- very much like weave.
- However, Instant builds extension modules on the fly with specific module
- names and specific method names.
- In this repsect it is more more like f2py in its behavior.
- The extension modules are built on-the fly (as long as the SWIG is installed).
- They can then be imported.
- Here is an example of using Instant with NumPy arrays (adapted from the
- test2 included in the Instant distribution):
-\end_layout
-
-\begin_layout LyX-Code
-code="""
-\end_layout
-
-\begin_layout LyX-Code
-PyObject* add(PyObject* a_, PyObject* b_){
-\end_layout
-
-\begin_layout LyX-Code
- /*
-\end_layout
-
-\begin_layout LyX-Code
- various checks
-\end_layout
-
-\begin_layout LyX-Code
- */
-\end_layout
-
-\begin_layout LyX-Code
- PyArrayObject* a=(PyArrayObject*) a_;
-\end_layout
-
-\begin_layout LyX-Code
- PyArrayObject* b=(PyArrayObject*) b_;
-\end_layout
-
-\begin_layout LyX-Code
- int n = a->dimensions[0];
-\end_layout
-
-\begin_layout LyX-Code
- int dims[1];
-\end_layout
-
-\begin_layout LyX-Code
- dims[0] = n;
-\end_layout
-
-\begin_layout LyX-Code
- PyArrayObject* ret;
-\end_layout
-
-\begin_layout LyX-Code
- ret = (PyArrayObject*) PyArray_FromDims(1, dims, NPY_DOUBLE);
-\end_layout
-
-\begin_layout LyX-Code
- int i;
-\end_layout
-
-\begin_layout LyX-Code
- char *aj=a->data;
-\end_layout
-
-\begin_layout LyX-Code
- char *bj=b->data;
-\end_layout
-
-\begin_layout LyX-Code
- double *retj = (double *)ret->data;
-\end_layout
-
-\begin_layout LyX-Code
- for (i=0; i < n; i++) {
-\end_layout
-
-\begin_layout LyX-Code
- *retj++ = *((double *)aj) + *((double *)bj);
-\end_layout
-
-\begin_layout LyX-Code
- aj += a->strides[0];
-\end_layout
-
-\begin_layout LyX-Code
- bj += b->strides[0];
-\end_layout
-
-\begin_layout LyX-Code
- }
-\end_layout
-
-\begin_layout LyX-Code
-return (PyObject *)ret;
-\end_layout
-
-\begin_layout LyX-Code
-}
-\end_layout
-
-\begin_layout LyX-Code
-"""
-\end_layout
-
-\begin_layout LyX-Code
-import Instant, numpy
-\end_layout
-
-\begin_layout LyX-Code
-ext = Instant.Instant()
-\end_layout
-
-\begin_layout LyX-Code
-ext.create_extension(code=s, headers=["numpy/arrayobject.h"],
- include_dirs=[numpy.get_include()],
- init_code='import_array();', module="test2b_ext
-")
-\end_layout
-
-\begin_layout LyX-Code
-import test2b_ext
-\end_layout
-
-\begin_layout LyX-Code
-a = numpy.arange(1000)
-\end_layout
-
-\begin_layout LyX-Code
-b = numpy.arange(1000)
-\end_layout
-
-\begin_layout LyX-Code
-d = test2b_ext.add(a,b)
-\end_layout
-
-\begin_layout Standard
-Except perhaps for the dependence on SWIG, Instant is a straightforward
- utility for writing extension modules.
-
-\end_layout
-
-\begin_layout Subsection
-PyInline
-\end_layout
-
-\begin_layout Standard
-This is a much older module that allows automatic building of extension
- modules so that C-code can be included with Python code.
- It's latest release (version 0.03) was in 2001, and it appears that it is
- not being updated.
-
-\end_layout
-
-\begin_layout Subsection
-PyFort
-\end_layout
-
-\begin_layout Standard
-PyFort is a nice tool for wrapping Fortran and Fortran-like C-code into
- Python with support for Numeric arrays.
- It was written by Paul Dubois, a distinguished computer scientist and the
- very first maintainer of Numeric (now retired).
- It is worth mentioning in the hopes that somebody will update PyFort to
- work with NumPy arrays as well which now support either Fortran or C-style
- contiguous arrays.
-
-\end_layout
-
-\begin_layout Chapter
-Code Explanations
-\end_layout
-
-\begin_layout Quotation
-Fanaticism consists of redoubling your efforts when you have forgotten your
- aim.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-George Santayana
-\end_layout
-
-\begin_layout Quotation
-An authority is a person who can tell you more about something than you
- really care to know.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Unknown
-\end_layout
-
-\begin_layout Standard
-This Chapter attempts to explain the logic behind some of the new pieces
- of code.
- The purpose behind these explanations is to enable somebody to be able
- to understand the ideas behind the implementation somewhat more easily
- than just staring at the code.
- Perhaps in this way, the algorithms can be improved on, borrowed from,
- and/or optimized.
-
-\end_layout
-
-\begin_layout Section
-Memory model
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ndarray!memory model"
-
-\end_inset
-
-One fundamental aspect of the ndarray is that an array is seen as a
-\begin_inset Quotes eld
-\end_inset
-
-chunk
-\begin_inset Quotes erd
-\end_inset
-
- of memory starting at some location.
- The interpretation of this memory depends on the stride information.
- For each dimension in an
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array, an integer (stride) dictates how many bytes must be
- skipped to get to the next element in that dimension.
- Unless you have a single-segment array, this stride information must be
- consulted when traversing through an array.
- It is not difficult to write code that accepts strides, you just have to
- use (char *) pointers because strides are in units of bytes.
- Keep in mind also that strides do not have to be unit-multiples of the
- element size.
- Also, remember that if the number of dimensions of the array is 0 (sometimes
- called a rank-0 array), then the strides and dimensions variables are NULL.
-
-\end_layout
-
-\begin_layout Standard
-Besides the structural information contained in the strides and dimensions
- members of the PyArrayObject, the flags contain important information about
- how the data may be accessed.
- In particular, the NPY_ALIGNED flag is set when the memory is on a suitable
- boundary according to the data-type array.
- Even if you have a contiguous chunk of memory, you cannot just assume it
- is safe to dereference a data-type-specific pointer to an element.
- Only if the NPY_ALIGNED flag is set is this a safe operation (on some platforms
- it will work but on others, like Solaris, it will cause a bus error).
- The NPY_WRITEABLE should also be ensured if you plan on writing to the
- memory area of the array.
- It is also possible to obtain a pointer to an unwriteable memory area.
- Sometimes, writing to the memory area when the NPY_WRITEABLE flag is not
- set will just be rude.
- Other times it can cause program crashes (
-\emph on
-e.g.
-
-\emph default
- a data-area that is a read-only memory-mapped file).
-\end_layout
-
-\begin_layout Section
-Data-type encapsulation
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "dtype"
-
-\end_inset
-
-The data-type is an important abstraction of the ndarray.
- Operations will look to the data-type to provide the key functionality
- that is needed to operate on the array.
- This functionality is provided in the list of function pointers pointed
- to by the 'f' member of the PyArray_Descr structure.
- In this way, the number of data-types can be extended simply by providing
- a PyArray_Descr structure with suitable function pointers in the 'f' member.
- For built-in types there are some optimizations that by-pass this mechanism,
- but the point of the data-type abstraction is to allow new data-types to
- be added.
-\end_layout
-
-\begin_layout Standard
-One of the built-in data-types, the void data-type allows for arbitrary
- records containing 1 or more fields as elements of the array.
- A field is simply another data-type object along with an offset into the
- current record.
- In order to support arbitrarily nested fields, several recursive implementation
-s of data-type access are implemented for the void type.
- A common idiom is to cycle through the elements of the dictionary and perform
- a specific operation based on the data-type object stored at the given
- offset.
- These offsets can be arbitrary numbers.
- Therefore, the possibility of encountering mis-aligned data must be recognized
- and taken into account if necessary.
-
-\end_layout
-
-\begin_layout Section
-N-D Iterators
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "array iterator"
-
-\end_inset
-
-A very common operation in much of NumPy code is the need to iterate over
- all the elements of a general, strided, N-dimensional array.
- This operation of a general-purpose N-dimensional loop is abstracted in
- the notion of an iterator object.
- To write an N-dimensional loop, you only have to create an iterator object
- from an ndarray, work with the dataptr member of the iterator object structure
- and call the macro PyArray_ITER_NEXT(it) on the iterator object to move
- to the next element.
- The
-\begin_inset Quotes eld
-\end_inset
-
-next
-\begin_inset Quotes erd
-\end_inset
-
- element is always in C-contiguous order.
- The macro works by first special casing the C-contiguous, 1-d, and 2-d
- cases which work very simply.
-
-\end_layout
-
-\begin_layout Standard
-For the general case, the iteration works by keeping track of a list of
- coordinate counters in the iterator object.
- At each iteration, the last coordinate counter is increased (starting from
- 0).
- If this counter is smaller then one less than the size of the array in
- that dimension (a pre-computed and stored value), then the counter is increased
- and the dataptr member is increased by the strides in that dimension and
- the macro ends.
- If the end of a dimension is reached, the counter for the last dimension
- is reset to zero and the dataptr is moved back to the beginning of that
- dimension by subtracting the strides value times one less than the number
- of elements in that dimension (this is also pre-computed and stored in
- the backstrides member of the iterator object).
- In this case, the macro does not end, but a local dimension counter is
- decremented so that the next-to-last dimension replaces the role that the
- last dimension played and the previously-described tests are executed again
- on the next-to-last dimension.
- In this way, the dataptr is adjusted appropriately for arbitrary striding.
-
-\end_layout
-
-\begin_layout Standard
-The coordinates member of the PyArrayIterObject structure maintains the
- current N-d counter unless the underlying array is C-contiguous in which
- case the coordinate counting is by-passed.
- The index member of the PyArrayIterObject keeps track of the current flat
- index of the iterator.
- It is updated by the PyArray_ITER_NEXT macro.
-
-\end_layout
-
-\begin_layout Section
-Broadcasting
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "broadcasting"
-
-\end_inset
-
-In Numeric, broadcasting was implemented in several lines of code buried
- deep in ufuncobject.c.
- In NumPy, the notion of broadcasting has been abstracted so that it can
- be performed in multiple places.
- Broadcasting is handled by the function PyArray_Broadcast.
- This function requires a PyArrayMultiIterObject (or something that is a
- binary equivalent) to be passed in.
- The PyArrayMultiIterObject keeps track of the broadcasted number of dimensions
- and size in each dimension along with the total size of the broadcasted
- result.
- It also keeps track of the number of arrays being broadcast and a pointer
- to an iterator for each of the arrays being broadcasted.
-
-\end_layout
-
-\begin_layout Standard
-The PyArray_Broadcast function takes the iterators that have already been
- defined and uses them to determine the broadcast shape in each dimension
- (to create the iterators at the same time that broadcasting occurs then
- use the PyMuliIter_New function).
- Then, the iterators are adjusted so that each iterator thinks it is iterating
- over an array with the broadcasted size.
- This is done by adjusting the iterators number of dimensions, and the shape
- in each dimension.
- This works because the iterator strides are also adjusted.
- Broadcasting only adjusts (or adds) length-1 dimensions.
- For these dimensions, the strides variable is simply set to 0 so that the
- data-pointer for the iterator over that array doesn't move as the broadcasting
- operation operates over the extended dimension.
-
-\end_layout
-
-\begin_layout Standard
-Broadcasting was always implemented in Numeric using 0-valued strides for
- the extended dimensions.
- It is done in exactly the same way in NumPy.
- The big difference is that now the array of strides is kept track of in
- a PyArrayIterObject, the iterators involved in a broadcasted result are
- kept track of in a PyArrayMultiIterObject, and the PyArray_BroadCast call
- implements the broad-casting rules.
-
-\end_layout
-
-\begin_layout Section
-Array Scalars
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "array scalars"
-
-\end_inset
-
-The array scalars offer a hierarchy of Python types that allow a one-to-one
- correspondence between the data-type stored in an array and the Python-type
- that is returned when an element is extracted from the array.
- An exception to this rule was made with object arrays.
- Object arrays are heterogeneous collections of arbitrary Python objects.
- When you select an item from an object array, you get back the original
- Python object (and not an object array scalar which does exist but is rarely
- used for practical purposes).
-\end_layout
-
-\begin_layout Standard
-The array scalars also offer the same methods and attributes as arrays with
- the intent that the same code can be used to support arbitrary dimensions
- (including 0-dimensions).
- The array scalars are read-only (immutable) with the exception of the void
- scalar which can also be written to so that record-array field setting
- works more naturally (a[0]['f1'] =
-\family typewriter
-value
-\family default
-).
-\end_layout
-
-\begin_layout Section
-Advanced (
-\begin_inset Quotes eld
-\end_inset
-
-Fancy
-\begin_inset Quotes erd
-\end_inset
-
-) Indexing
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "indexing"
-
-\end_inset
-
-The implementation of advanced indexing represents some of the most difficult
- code to write and explain.
- In fact, there are two implementations of advanced indexing.
- The first works only with 1-d arrays and is implemented to handle expressions
- involving a.flat[obj].
- The second is general-purpose that works for arrays of
-\begin_inset Quotes eld
-\end_inset
-
-arbitrary dimension
-\begin_inset Quotes erd
-\end_inset
-
- (up to a fixed maximum).
- The one-dimensional indexing approaches were implemented in a rather straightfo
-rward fashion, and so it is the general-purpose indexing code that will
- be the focus of this section.
-
-\end_layout
-
-\begin_layout Standard
-There is a multi-layer approach to indexing because the indexing code can
- at times return an array scalar and at other times return an array.
- The functions with
-\begin_inset Quotes eld
-\end_inset
-
-_nice
-\begin_inset Quotes erd
-\end_inset
-
- appended to their name do this special handling while the function without
- the _nice appendage always return an array (perhaps a 0-dimensional array).
- Some special-case optimizations (the index being an integer scalar, and
- the index being a tuple with as many dimensions as the array) are handled
- in array_subscript_nice function which is what Python calls when presented
- with the code
-\begin_inset Quotes eld
-\end_inset
-
-a[obj].
-\begin_inset Quotes erd
-\end_inset
-
- These optimizations allow fast single-integer indexing, and also ensure
- that a 0-dimensional array is not created only to be discarded as the array
- scalar is returned instead.
- This provides significant speed-up for code that is selecting many scalars
- out of an array (such as in a loop).
- However, it is still not faster than simply using a list to store standard
- Python scalars, because that is optimized by the Python interpreter itself.
-
-\end_layout
-
-\begin_layout Standard
-After these optimizations, the array_subscript function itself is called.
- This function first checks for field selection which occurs when a string
- is passed as the indexing object.
- Then, 0-d arrays are given special-case consideration.
- Finally, the code determines whether or not advanced, or fancy, indexing
- needs to be performed.
- If fancy indexing is not needed, then standard view-based indexing is performed
- using code borrowed from Numeric which parses the indexing object and returns
- the offset into the data-buffer and the dimensions necessary to create
- a new view of the array.
- The strides are also changed by multiplying each stride by the step-size
- requested along the corresponding dimension.
-
-\end_layout
-
-\begin_layout Subsection
-Fancy-indexing check
-\end_layout
-
-\begin_layout Standard
-The fancy_indexing_check routine determines whether or not to use standard
- view-based indexing or new copy-based indexing.
- If the indexing object is a tuple, then view-based indexing is assumed
- by default.
- Only if the tuple contains an array object or a sequence object is fancy-indexi
-ng assumed.
- If the indexing object is an array, then fancy indexing is automatically
- assumed.
- If the indexing object is any other kind of sequence, then fancy-indexing
- is assumed by default.
- This is over-ridden to simple indexing if the sequence contains any slice,
- newaxis, or Ellipsis objects, and no arrays or additional sequences are
- also contained in the sequence.
- The purpose of this is to allow the construction of
-\begin_inset Quotes eld
-\end_inset
-
-slicing
-\begin_inset Quotes erd
-\end_inset
-
- sequences which is a common technique for building up code that works in
- arbitrary numbers of dimensions.
-
-\end_layout
-
-\begin_layout Subsection
-Fancy-indexing implementation
-\end_layout
-
-\begin_layout Standard
-The concept of indexing was also abstracted using the idea of an iterator.
- If fancy indexing is performed, then a PyArrayMapIterObject is created.
- This internal object is not exposed to Python.
- It is created in order to handle the fancy-indexing at a high-level.
- Both get and set fancy-indexing operations are implemented using this object.
- Fancy indexing is abstracted into three separate operations: (1) creating
- the PyArrayMapIterObject from the indexing object, (2) binding the PyArrayMapIt
-erObject to the array being indexed, and (3) getting (or setting) the items
- determined by the indexing object.
- There is an optimization implemented so that the PyArrayIterObject (which
- has it's own less complicated fancy-indexing) is used for indexing when
- possible.
-
-\end_layout
-
-\begin_layout Subsubsection
-Creating the mapping object
-\end_layout
-
-\begin_layout Standard
-The first step is to convert the indexing objects into a standard form where
- iterators are created for all of the index array inputs and all Boolean
- arrays are converted to equivalent integer index arrays (as if nonzero(arr)
- had been called).
- Finally, all integer arrays are replaced with the integer 0 in the indexing
- object and all of the index-array iterators are
-\begin_inset Quotes eld
-\end_inset
-
-broadcast
-\begin_inset Quotes erd
-\end_inset
-
- to the same shape.
-
-\end_layout
-
-\begin_layout Subsubsection
-Binding the mapping object
-\end_layout
-
-\begin_layout Standard
-When the mapping object is created it does not know which array it will
- be used with so once the index iterators are constructed during mapping-object
- creation, the next step is to associate these iterators with a particular
- ndarray.
- This process interprets any ellipsis and slice objects so that the index
- arrays are associated with the appropriate axis (the axis indicated by
- the iteraxis entry corresponding to the iterator for the integer index
- array).
- This information is then used to check the indices to be sure they are
- within range of the shape of the array being indexed.
- The presence of ellipsis and/or slice objects implies a sub-space iteration
- that is accomplished by extracting a sub-space view of the array (using
- the index object resulting from replacing all the integer index arrays
- with 0) and storing the information about where this sub-space starts in
- the mapping object.
- This is used later during mapping-object iteration to select the correct
- elements from the underlying array.
-
-\end_layout
-
-\begin_layout Subsubsection
-Getting (or Setting)
-\end_layout
-
-\begin_layout Standard
-After the mapping object is successfully bound to a particular array, the
- mapping object contains the shape of the resulting item as well as iterator
- objects that will walk through the currently-bound array and either get
- or set its elements as needed.
- The walk is implemented using the PyArray_MapIterNext function.
- This function sets the coordinates of an iterator object into the current
- array to be the next coordinate location indicated by all of the indexing-objec
-t iterators while adjusting, if necessary, for the presence of a sub-space.
- The result of this function is that the dataptr member of the mapping object
- structure is pointed to the next position in the array that needs to be
- copied out or set to some value.
-
-\end_layout
-
-\begin_layout Standard
-When advanced indexing is used to extract an array, an iterator for the
- new array is constructed and advanced in phase with the mapping object
- iterator.
- When advanced indexing is used to place values in an array, a special
-\begin_inset Quotes eld
-\end_inset
-
-broadcasted
-\begin_inset Quotes erd
-\end_inset
-
- iterator is constructed from the object being placed into the array so
- that it will only work if the values used for setting have a shape that
- is
-\begin_inset Quotes eld
-\end_inset
-
-broadcastable
-\begin_inset Quotes erd
-\end_inset
-
- to the shape implied by the indexing object.
-
-\end_layout
-
-\begin_layout Section
-Universal Functions
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ufunc|("
-
-\end_inset
-
-Universal functions are callable objects that take
-\begin_inset Formula $N$
-\end_inset
-
- inputs and produce
-\begin_inset Formula $M$
-\end_inset
-
- outputs by wrapping basic 1-d loops that work element-by-element into full
- easy-to use functions that seamlessly implement broadcasting, type-checking
- and buffered coercion, and output-argument handling.
- New universal functions are normally created in C, although there is a
- mechanism for creating ufuncs from Python functions (
-\series bold
-frompyfunc
-\series default
-).
- The user must supply a 1-d loop that implements the basic function taking
- the input scalar values and placing the resulting scalars into the appropriate
- output slots as explaine n implementation.
-
-\end_layout
-
-\begin_layout Subsection
-Setup
-\end_layout
-
-\begin_layout Standard
-Every ufunc calculation involves some overhead related to setting up the
- calculation.
- The practical significance of this overhead is that even though the actual
- calculation of the ufunc is very fast, you will be able to write array
- and type-specific code that will work faster for small arrays than the
- ufunc.
- In particular, using ufuncs to perform many calculations on 0-d arrays
- will be slower than other Python-based solutions (the silently-imported
- scalarmath module exists precisely to give array scalars the look-and-feel
- of ufunc-based calculations with significantly reduced overhead).
-
-\end_layout
-
-\begin_layout Standard
-When a ufunc is called, many things must be done.
- The information collected from these setup operations is stored in a loop-objec
-t.
- This loop object is a C-structure (that could become a Python object but
- is not initialized as such because it is only used internally).
- This loop object has the layout needed to be used with PyArray_Broadcast
- so that the broadcasting can be handled in the same way as it is handled
- in other sections of code.
-
-\end_layout
-
-\begin_layout Standard
-The first thing done is to look-up in the thread-specific global dictionary
- the current values for the buffer-size, the error mask, and the associated
- error object.
- The state of the error mask controls what happens when an error-condiction
- is found.
- It should be noted that checking of the hardware error flags is only performed
- after each 1-d loop is executed.
- This means that if the input and output arrays are contiguous and of the
- correct type so that a single 1-d loop is performed, then the flags may
- not be checked until all elements of the array have been calcluated.
- Looking up these values in a thread-specific dictionary takes time which
- is easily ignored for all but very small arrays.
-
-\end_layout
-
-\begin_layout Standard
-After checking, the thread-specific global variables, the inputs are evaluated
- to determine how the ufunc should proceed and the input and output arrays
- are constructed if necessary.
- Any inputs which are not arrays are converted to arrays (using context
- if necessary).
- Which of the inputs are scalars (and therefore converted to 0-d arrays)
- is noted.
-
-\end_layout
-
-\begin_layout Standard
-Next, an appropriate 1-d loop is selected from the 1-d loops available to
- the ufunc based on the input array types.
- This 1-d loop is selected by trying to match the signature of the data-types
- of the inputs against the available signatures.
- The signatures corresponding to built-in types are stored in the types
- member of the ufunc structure.
- The signatures corresponding to user-defined types are stored in a linked-list
- of function-information with the head element stored as a
-\family typewriter
-CObject
-\family default
- in the userloops dictionary keyed by the data-type number (the first user-defin
-ed type in the argument list is used as the key).
- The signatures are searched until a signature is found to which the input
- arrays can all be cast safely (ignoring any scalar arguments which are
- not allowed to determine the type of the result).
- The implication of this search procedure is that
-\begin_inset Quotes eld
-\end_inset
-
-lesser types
-\begin_inset Quotes erd
-\end_inset
-
- should be placed below
-\begin_inset Quotes eld
-\end_inset
-
-larger types
-\begin_inset Quotes erd
-\end_inset
-
- when the signatures are stored.
- If no 1-d loop is found, then an error is reported.
- Otherwise, the argument_list is updated with the stored signature --- in
- case casting is necessary and to fix the output types assumed by the 1-d
- loop.
-\end_layout
-
-\begin_layout Standard
-If the ufunc has 2 inputs and 1 output and the second input is an Object
- array then a special-case check is performed so that NotImplemented is
- returned if the second input is not an ndarray, has the __array_priority__
- attribute, and has an __r<op>__ special method.
- In this way, Python is signaled to give the other object a chance to complete
- the operation instead of using generic object-array calculations.
- This allows (for example) sparse matrices to override the multiplication
- operator 1-d loop.
-
-\end_layout
-
-\begin_layout Standard
-For input arrays that are smaller than the specified buffer size, copies
- are made of all non-contiguous, mis-aligned, or out-of-byteorder arrays
- to ensure that for small arrays, a single-loop is used.
- Then, array iterators are created for all the input arrays and the resulting
- collection of iterators is broadcast to a single shape.
-
-\end_layout
-
-\begin_layout Standard
-The output arguments (if any) are then processed and any missing return
- arrays are constructed.
- If any provided output array doesn't have the correct type (or is mis-aligned)
- and is smaller than the buffer size, then a new output array is constructed
- with the special UPDATEIFCOPY flag set so that when it is DECREF'd on completio
-n of the function, it's contents will be copied back into the output array.
- Iterators for the output arguments are then processed.
-
-\end_layout
-
-\begin_layout Standard
-Finally, the decision is made about how to execute the looping mechanism
- to ensure that all elements of the input arrays are combined to produce
- the output arrays of the correct type.
- The options for loop execution are one-loop (for contiguous, aligned, and
- correct data-type), strided-loop (for non-contiguous but still aligned
- and correct data-type), and a buffered loop (for mis-aligned or incorrect
- data-type situations).
- Depending on which execution method is called for, the loop is then setup
- and computed.
-
-\end_layout
-
-\begin_layout Subsection
-Function call
-\end_layout
-
-\begin_layout Standard
-This section describes how the basic universal function computation loop
- is setup and executed for each of the three different kinds of execution
- possibilities.
- If NPY_ALLOW_THREADS is defined during compilation, then the Python Global
- Interpreter Lock (GIL) is released prior to calling all of these loops
- (as long as they don't involve object arrays).
- It is re-acquired if necessary to handle error conditions.
- The hardware error flags are checked only after the 1-d loop is calcluated.
-
-\end_layout
-
-\begin_layout Subsubsection
-One Loop
-\end_layout
-
-\begin_layout Standard
-This is the simplest case of all.
- The ufunc is executed by calling the underlying 1-d loop exactly once.
- This is possible only when we have aligned data of the correct type (including
- byte-order) for both input and output and all arrays have uniform strides
- (either contiguous, 0-d, or 1-d).
- In this case, the 1-d computational loop is called once to compute the
- calculation for the entire array.
- Note that the hardware error flags are only checked after the entire calculatio
-n is complete.
-
-\end_layout
-
-\begin_layout Subsubsection
-Strided Loop
-\end_layout
-
-\begin_layout Standard
-When the input and output arrays are aligned and of the correct type, but
- the striding is not uniform (non-contiguous and 2-d or larger), then a
- second looping structure is employed for the calculation.
- This approach converts all of the iterators for the input and output arguments
- to iterate over all but the largest dimension.
- The inner loop is then handled by the underlying 1-d computational loop.
- The outer loop is a standard iterator loop on the converted iterators.
- The hardware error flags are checked after each 1-d loop is completed.
-
-\end_layout
-
-\begin_layout Subsubsection
-Buffered Loop
-\end_layout
-
-\begin_layout Standard
-This is the code that handles the situation whenever the input and/or output
- arrays are either misaligned or of the wrong data-type (including being
- byte-swapped) from what the underlying 1-d loop expects.
- The arrays are also assumed to be non-contiguous.
- The code works very much like the strided loop except for the inner 1-d
- loop is modified so that pre-processing is performed on the inputs and
- post-processing is performed on the outputs in bufsize chunks (where bufsize
- is a user-settable parameter).
- The underlying 1-d computational loop is called on data that is copied
- over (if it needs to be).
- The setup code and the loop code is considerably more complicated in this
- case because it has to handle:
-\end_layout
-
-\begin_layout Itemize
-memory allocation of the temporary buffers
-\end_layout
-
-\begin_layout Itemize
-deciding whether or not to use buffers on the input and output data (mis-aligned
- and/or wrong data-type)
-\end_layout
-
-\begin_layout Itemize
-copying and possibly casting data for any inputs or outputs for which buffers
- are necessary.
-\end_layout
-
-\begin_layout Itemize
-special-casing Object arrays so that reference counts are properly handled
- when copies and/or casts are necessary.
-
-\end_layout
-
-\begin_layout Itemize
-breaking up the inner 1-d loop into bufsize chunks (with a possible remainder).
-
-\end_layout
-
-\begin_layout Standard
-Again, the hardware error flags are checked at the end of each 1-d loop.
-\end_layout
-
-\begin_layout Subsection
-Final output manipulation
-\end_layout
-
-\begin_layout Standard
-Ufuncs allow other array-like classes to be passed seamlessly through the
- interface in that inputs of a particular class will induce the outputs
- to be of that same class.
- The mechanism by which this works is the following.
- If any of the inputs are not ndarrays and define the
-\series bold
-__array_wrap__
-\series default
- method, then the class with the largest
-\series bold
-__array_priority__
-\series default
- attribute determines the type of all the outputs (with the exception of
- any output arrays passed in).
- The
-\series bold
-__array_wrap__
-\series default
- method of the input array will be called with the ndarray being returned
- from the ufunc as it's input.
- There are two calling styles of the
-\series bold
-__array_wrap__
-\series default
- function supported.
- The first takes the ndarray as the first argument and a tuple of
-\begin_inset Quotes eld
-\end_inset
-
-context
-\begin_inset Quotes erd
-\end_inset
-
- as the second argument.
- The context is (ufunc, arguments, output argument number).
- This is the first call tried.
- If a TypeError occurs, then the function is called with just the ndarray
- as the first argument.
-
-\end_layout
-
-\begin_layout Subsection
-Methods
-\end_layout
-
-\begin_layout Standard
-Their are three methods of ufuncs that require calculation similar to the
- general-purpose ufuncs.
- These are reduce, accumulate, and reduceat.
- Each of these methods requires a setup command followed by a loop.
- There are four loop styles possible for the methods corresponding to no-element
-s, one-element, strided-loop, and buffered-loop.
- These are the same basic loop styles as implemented for the general purpose
- function call except for the no-element and one-element cases which are
- special-cases occurring when the input array objects have 0 and 1 elements
- respectively.
-
-\end_layout
-
-\begin_layout Subsubsection
-Setup
-\end_layout
-
-\begin_layout Standard
-The setup function for all three methods is
-\family typewriter
-construct_reduce
-\family default
-.
- This function creates a reducing loop object and fills it with parameters
- needed to complete the loop.
- All of the methods only work on ufuncs that take 2-inputs and return 1
- output.
- Therefore, the underlying 1-d loop is selected assuming a signature of
- [
-\family typewriter
-otype
-\family default
-,
-\family typewriter
-otype
-\family default
-,
-\family typewriter
-otype
-\family default
-] where
-\family typewriter
-otype
-\family default
- is the requested reduction data-type.
- The buffer size and error handling is then retrieved from (per-thread)
- global storage.
- For small arrays that are mis-aligned or have incorrect data-type, a copy
- is made so that the un-buffered section of code is used.
- Then, the looping strategy is selected.
- If there is 1 element or 0 elements in the array, then a simple looping
- method is selected.
- If the array is not mis-aligned and has the correct data-type, then strided
- looping is selected.
- Otherwise, buffered looping must be performed.
- Looping parameters are then established, and the return array is constructed.
- The output array is of a different shape depending on whether the method
- is reduce, accumulate, or reduceat.
- If an output array is already provided, then it's shape is checked.
- If the output array is not C-contiguous, aligned, and of the correct data
- type, then a temporary copy is made with the UPDATEIFCOPY flag set.
- In this way, the methods will be able to work with a well-behaved output
- array but the result will be copied back into the true output array when
- the method computation is complete.
- Finally, iterators are set up to loop over the correct axis (depending
- on the value of axis provided to the method) and the setup routine returns
- to the actual computation routine.
-
-\end_layout
-
-\begin_layout Subsubsection
-Reduce
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ufunc!methods!reduce"
-
-\end_inset
-
-All of the ufunc methods use the same underlying 1-d computational loops
- with input and output arguments adjusted so that the appropriate reduction
- takes place.
- For example, the key to the functioning of reduce is that the 1-d loop
- is called with the output and the second input pointing to the same position
- in memory and both having a step-size of 0.
- The first input is pointing to the input array with a step-size given by
- the appropriate stride for the selected axis.
- In this way, the operation performed is
-\begin_inset Formula \begin{eqnarray*}
-o & = & i[0]\\
-o & = & i[k]\textrm{ <op> }o\quad k=1\ldots N\end{eqnarray*}
-
-\end_inset
-
- where
-\begin_inset Formula $N+1$
-\end_inset
-
- is the number of elements in the input,
-\begin_inset Formula $i$
-\end_inset
-
-,
-\begin_inset Formula $o$
-\end_inset
-
- is the output, and
-\begin_inset Formula $i[k]$
-\end_inset
-
- is the
-\begin_inset Formula $k^{\textrm{th}}$
-\end_inset
-
- element of
-\begin_inset Formula $i$
-\end_inset
-
- along the selected axis.
- This basic operations is repeated for arrays with greater than 1 dimension
- so that the reduction takes place for every 1-d sub-array along the selected
- axis.
- An iterator with the selected dimension removed handles this looping.
-
-\end_layout
-
-\begin_layout Standard
-For buffered loops, care must be taken to copy and cast data before the
- loop function is called because the underlying loop expects aligned data
- of the correct data-type (including byte-order).
- The buffered loop must handle this copying and casting prior to calling
- the loop function on chunks no greater than the user-specified bufsize.
-
-\end_layout
-
-\begin_layout Subsubsection
-Accumulate
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ufunc!methods!accumulate"
-
-\end_inset
-
-The accumulate function is very similar to the reduce function in that the
- output and the second input both point to the output.
- The difference is that the second input points to memory one stride behind
- the current output pointer.
- Thus, the operation performed is
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \begin{eqnarray*}
-o[0] & = & i[0]\\
-o[k] & = & i[k]\textrm{ <op> }o[k-1]\quad k=1\ldots N.\end{eqnarray*}
-
-\end_inset
-
- The output has the same shape as the input and each 1-d loop operates over
-
-\begin_inset Formula $N$
-\end_inset
-
- elements when the shape in the selected axis is
-\begin_inset Formula $N+1$
-\end_inset
-
-.
- Again, buffered loops take care to copy and cast the data before calling
- the underlying 1-d computational loop.
-
-\end_layout
-
-\begin_layout Subsubsection
-Reduceat
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ufunc!methods!reduceat"
-
-\end_inset
-
-The reduceat function is a generalization of both the reduce and accumulate
- functions.
- It implements a reduce over ranges of the input array specified by indices.
- The extra indices argument is checked to be sure that every input is not
- too large for the input array along the selected dimension before the loop
- calculations take place.
- The loop implementation is handled using code that is very similar to the
- reduce code repeated as many times as there are elements in the indices
- input.
- In particular: the first input pointer passed to the underlying 1-d computation
-al loop points to the input array at the correct location indicated by the
- index array.
- In addition, the output pointer and the second input pointer passed to
- the underlying 1-d loop point to the same position in memory.
- The size of the 1-d computational loop is fixed to be the difference between
- the current index and the next index (when the current index is the last
- index, then the next index is assumed to be the length of the array along
- the selected dimension).
- In this way, the 1-d loop will implement a reduce over the specified indices.
-
-\end_layout
-
-\begin_layout Standard
-Mis-aligned or a loop data-type that does not match the input and/or output
- data-type is handled using buffered code where-in data is copied to a temporary
- buffer and cast to the correct data-type if necessary prior to calling
- the underlying 1-d function.
- The temporary buffers are created in (element) sizes no bigger than the
- user settable buffer-size value.
- Thus, the loop must be flexible enough to call the underlying 1-d computational
- loop enough times to complete the total calculation in chunks no bigger
- than the buffer-size.
-
-\begin_inset LatexCommand index
-name "ufunc|)"
-
-\end_inset
-
-
-\end_layout
-
-\end_body
-\end_document
diff --git a/doc/numpybook/comparison/ctypes/code.c b/doc/numpybook/comparison/ctypes/code.c
deleted file mode 100644
index 0927a7ed3..000000000
--- a/doc/numpybook/comparison/ctypes/code.c
+++ /dev/null
@@ -1,60 +0,0 @@
-
-typedef struct {double real; double imag;} cdouble;
-typedef struct {double real; double imag;} cfloat;
-
-/* Add arrays of contiguous data */
-void zadd(cdouble *a, cdouble *b, cdouble *c, long n)
-{
- while (n--) {
- c->real = a->real + b->real;
- c->imag = a->imag + b->imag;
- a++; b++; c++;
- }
-}
-
-void cadd(cfloat *a, cfloat *b, cfloat *c, long n)
-{
- while (n--) {
- c->real = a->real + b->real;
- c->imag = a->imag + b->imag;
- a++; b++; c++;
- }
-}
-
-void dadd(double *a, double *b, double *c, long n)
-{
- while (n--) {
- *c++ = *a++ + *b++;
- }
-}
-
-void sadd(float *a, float *b, float *c, long n)
-{
- while (n--) {
- *c++ = *a++ + *b++;
- }
-}
-
-/* Assumes b is contiguous and
- a has strides that are multiples of sizeof(double)
-*/
-void dfilter2d(double *a, double *b, int *astrides, int *dims)
-{
- int i, j, M, N, S0, S1;
- int r, c, rm1, rp1, cp1, cm1;
-
- M = dims[0]; N = dims[1];
- S0 = astrides[0]/sizeof(double);
- S1=astrides[1]/sizeof(double);
- for (i=1; i<M-1; i++) {
- r = i*S0; rp1 = r+S0; rm1 = r-S0;
- for (j=1; j<N-1; j++) {
- c = j*S1; cp1 = j+S1; cm1 = j-S1;
- b[i*N+j] = a[r+c] + \
- (a[rp1+c] + a[rm1+c] + \
- a[r+cp1] + a[r+cm1])*0.5 + \
- (a[rp1+cp1] + a[rp1+cm1] + \
- a[rm1+cp1] + a[rm1+cp1])*0.25;
- }
- }
-}
diff --git a/doc/numpybook/comparison/ctypes/filter.py b/doc/numpybook/comparison/ctypes/filter.py
deleted file mode 100644
index 13d768027..000000000
--- a/doc/numpybook/comparison/ctypes/filter.py
+++ /dev/null
@@ -1,25 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-__all__ = ['filter2d']
-
-import numpy as N
-import os
-import ctypes
-
-_path = os.path.dirname('__file__')
-lib = N.ctypeslib.load_library('code', _path)
-
-lib.dfilter2d.restype = None
-lib.dfilter2d.argtypes = [N.ctypeslib.ndpointer(float, ndim=2,
- flags='aligned'),
- N.ctypeslib.ndpointer(float, ndim=2,
- flags='aligned, contiguous,'\
- 'writeable'),
- ctypes.POINTER(N.ctypeslib.c_intp),
- ctypes.POINTER(N.ctypeslib.c_intp)]
-
-def filter2d(a):
- a = N.require(a, float, ['ALIGNED'])
- b = N.zeros_like(a)
- lib.dfilter2d(a, b, a.ctypes.strides, a.ctypes.shape)
- return b
diff --git a/doc/numpybook/comparison/ctypes/interface.py b/doc/numpybook/comparison/ctypes/interface.py
deleted file mode 100644
index 1fabe3170..000000000
--- a/doc/numpybook/comparison/ctypes/interface.py
+++ /dev/null
@@ -1,59 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-__all__ = ['add', 'filter2d']
-
-import numpy as N
-import os
-import ctypes
-
-_path = os.path.dirname('__file__')
-lib = N.ctypeslib.load_library('code', _path)
-_typedict = {'zadd' : complex,
- 'sadd' : N.single,
- 'cadd' : N.csingle,
- 'dadd' : float}
-for name in _typedict.keys():
- val = getattr(lib, name)
- val.restype = None
- _type = _typedict[name]
- val.argtypes = [N.ctypeslib.ndpointer(_type, flags='aligned, contiguous'),
- N.ctypeslib.ndpointer(_type, flags='aligned, contiguous'),
- N.ctypeslib.ndpointer(_type, flags='aligned, contiguous,'\
- 'writeable'),
- N.ctypeslib.c_intp]
-
-lib.dfilter2d.restype=None
-lib.dfilter2d.argtypes = [N.ctypeslib.ndpointer(float, ndim=2,
- flags='aligned'),
- N.ctypeslib.ndpointer(float, ndim=2,
- flags='aligned, contiguous,'\
- 'writeable'),
- ctypes.POINTER(N.ctypeslib.c_intp),
- ctypes.POINTER(N.ctypeslib.c_intp)]
-
-def select(dtype):
- if dtype.char in ['?bBhHf']:
- return lib.sadd, N.single
- elif dtype.char in ['F']:
- return lib.cadd, N.csingle
- elif dtype.char in ['DG']:
- return lib.zadd, complex
- else:
- return lib.dadd, float
- return func, ntype
-
-def add(a, b):
- requires = ['CONTIGUOUS', 'ALIGNED']
- a = N.asanyarray(a)
- func, dtype = select(a.dtype)
- a = N.require(a, dtype, requires)
- b = N.require(b, dtype, requires)
- c = N.empty_like(a)
- func(a, b, c, a.size)
- return c
-
-def filter2d(a):
- a = N.require(a, float, ['ALIGNED'])
- b = N.zeros_like(a)
- lib.dfilter2d(a, b, a.ctypes.strides, a.ctypes.shape)
- return b
diff --git a/doc/numpybook/comparison/ctypes/newfile.dat b/doc/numpybook/comparison/ctypes/newfile.dat
deleted file mode 100644
index d3899c294..000000000
--- a/doc/numpybook/comparison/ctypes/newfile.dat
+++ /dev/null
Binary files differ
diff --git a/doc/numpybook/comparison/ctypes/timeme b/doc/numpybook/comparison/ctypes/timeme
deleted file mode 100755
index 2f7cd297f..000000000
--- a/doc/numpybook/comparison/ctypes/timeme
+++ /dev/null
@@ -1,2 +0,0 @@
-python2.4 -m timeit -s "import numpy as N; a=N.random.rand(100,200); import filter" "b = filter.filter(a)"
-
diff --git a/doc/numpybook/comparison/f2py/add.f b/doc/numpybook/comparison/f2py/add.f
deleted file mode 100644
index 26e45da34..000000000
--- a/doc/numpybook/comparison/f2py/add.f
+++ /dev/null
@@ -1,45 +0,0 @@
-C
- SUBROUTINE ZADD(A,B,C,N)
-C
- DOUBLE COMPLEX A(*)
- DOUBLE COMPLEX B(*)
- DOUBLE COMPLEX C(*)
- INTEGER N
- DO 20 J = 1, N
- C(J) = A(J) + B(J)
- 20 CONTINUE
- END
-
- SUBROUTINE CADD(A,B,C,N)
-C
- COMPLEX A(*)
- COMPLEX B(*)
- COMPLEX C(*)
- INTEGER N
- DO 20 J = 1, N
- C(J) = A(J) + B(J)
- 20 CONTINUE
- END
-
- SUBROUTINE DADD(A,B,C,N)
-C
- DOUBLE PRECISION A(*)
- DOUBLE PRECISION B(*)
- DOUBLE PRECISION C(*)
- INTEGER N
- DO 20 J = 1, N
- C(J) = A(J) + B(J)
- 20 CONTINUE
- END
-
- SUBROUTINE SADD(A,B,C,N)
-C
- REAL A(*)
- REAL B(*)
- REAL C(*)
- INTEGER N
- DO 20 J = 1, N
- C(J) = A(J) + B(J)
- 20 CONTINUE
- END
-
diff --git a/doc/numpybook/comparison/f2py/add.pyf b/doc/numpybook/comparison/f2py/add.pyf
deleted file mode 100644
index 1a9ac2c9e..000000000
--- a/doc/numpybook/comparison/f2py/add.pyf
+++ /dev/null
@@ -1,34 +0,0 @@
-! -*- f90 -*-
-! Note: the context of this file is case sensitive.
-
-python module add ! in
- interface ! in :add
- subroutine zadd(a,b,c,n) ! in :add:add.f
- double complex dimension(n) :: a
- double complex dimension(n) :: b
- double complex intent(out), dimension(n) :: c
- integer intent(hide), depend(a) :: n = len(a)
- end subroutine zadd
- subroutine cadd(a,b,c,n) ! in :add:add.f
- complex dimension(*) :: a
- complex dimension(*) :: b
- complex dimension(*) :: c
- integer :: n
- end subroutine cadd
- subroutine dadd(a,b,c,n) ! in :add:add.f
- double precision dimension(*) :: a
- double precision dimension(*) :: b
- double precision dimension(*) :: c
- integer :: n
- end subroutine dadd
- subroutine sadd(a,b,c,n) ! in :add:add.f
- real dimension(*) :: a
- real dimension(*) :: b
- real dimension(*) :: c
- integer :: n
- end subroutine sadd
- end interface
-end python module add
-
-! This file was auto-generated with f2py (version:2_2694).
-! See http://cens.ioc.ee/projects/f2py2e/
diff --git a/doc/numpybook/comparison/f2py/filter.f b/doc/numpybook/comparison/f2py/filter.f
deleted file mode 100644
index a817a866f..000000000
--- a/doc/numpybook/comparison/f2py/filter.f
+++ /dev/null
@@ -1,20 +0,0 @@
-
- SUBROUTINE DFILTER2D(A,B,M,N)
-C
- DOUBLE PRECISION A(M,N)
- DOUBLE PRECISION B(M,N)
- INTEGER N, M
-CF2PY INTENT(OUT) :: B
-CF2PY INTENT(HIDE) :: N
-CF2PY INTENT(HIDE) :: M
- DO 20 I = 2,M-1
- DO 40 J=2,N-1
- B(I,J) = A(I,J) +
- $ (A(I-1,J)+A(I+1,J) +
- $ A(I,J-1)+A(I,J+1) )*0.5D0 +
- $ (A(I-1,J-1) + A(I-1,J+1) +
- $ A(I+1,J-1) + A(I+1,J+1))*0.25D0
- 40 CONTINUE
- 20 CONTINUE
- END
-
diff --git a/doc/numpybook/comparison/f2py/filter.pyf b/doc/numpybook/comparison/f2py/filter.pyf
deleted file mode 100644
index 1e4bc37f4..000000000
--- a/doc/numpybook/comparison/f2py/filter.pyf
+++ /dev/null
@@ -1,16 +0,0 @@
-! -*- f90 -*-
-! Note: the context of this file is case sensitive.
-
-python module filter ! in
- interface ! in :filter
- subroutine dfilter2d(a,b,m,n) ! in :filter:filter.f
- double precision dimension(m,n) :: a
- double precision dimension(m,n),intent(out),depend(m,n) :: b
- integer optional,intent(hide),check(shape(a,0)==m),depend(a) :: m=shape(a,0)
- integer optional,intent(hide),check(shape(a,1)==n),depend(a) :: n=shape(a,1)
- end subroutine dfilter2d
- end interface
-end python module filter
-
-! This file was auto-generated with f2py (version:2_3032).
-! See http://cens.ioc.ee/projects/f2py2e/
diff --git a/doc/numpybook/comparison/f2py/filtermodule.c b/doc/numpybook/comparison/f2py/filtermodule.c
deleted file mode 100644
index 3851dfe86..000000000
--- a/doc/numpybook/comparison/f2py/filtermodule.c
+++ /dev/null
@@ -1,293 +0,0 @@
-/* File: filtermodule.c
- * This file is auto-generated with f2py (version:2_3032).
- * f2py is a Fortran to Python Interface Generator (FPIG), Second Edition,
- * written by Pearu Peterson <pearu@cens.ioc.ee>.
- * See http://cens.ioc.ee/projects/f2py2e/
- * Generation date: Thu Aug 17 12:03:28 2006
- * $Revision:$
- * $Date:$
- * Do not edit this file directly unless you know what you are doing!!!
- */
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*********************** See f2py2e/cfuncs.py: includes ***********************/
-#include "Python.h"
-#include "fortranobject.h"
-#include <math.h>
-
-/**************** See f2py2e/rules.py: mod_rules['modulebody'] ****************/
-static PyObject *filter_error;
-static PyObject *filter_module;
-
-/*********************** See f2py2e/cfuncs.py: typedefs ***********************/
-/*need_typedefs*/
-
-/****************** See f2py2e/cfuncs.py: typedefs_generated ******************/
-/*need_typedefs_generated*/
-
-/********************** See f2py2e/cfuncs.py: cppmacros **********************/
-#if defined(PREPEND_FORTRAN)
-#if defined(NO_APPEND_FORTRAN)
-#if defined(UPPERCASE_FORTRAN)
-#define F_FUNC(f,F) _##F
-#else
-#define F_FUNC(f,F) _##f
-#endif
-#else
-#if defined(UPPERCASE_FORTRAN)
-#define F_FUNC(f,F) _##F##_
-#else
-#define F_FUNC(f,F) _##f##_
-#endif
-#endif
-#else
-#if defined(NO_APPEND_FORTRAN)
-#if defined(UPPERCASE_FORTRAN)
-#define F_FUNC(f,F) F
-#else
-#define F_FUNC(f,F) f
-#endif
-#else
-#if defined(UPPERCASE_FORTRAN)
-#define F_FUNC(f,F) F##_
-#else
-#define F_FUNC(f,F) f##_
-#endif
-#endif
-#endif
-#if defined(UNDERSCORE_G77)
-#define F_FUNC_US(f,F) F_FUNC(f##_,F##_)
-#else
-#define F_FUNC_US(f,F) F_FUNC(f,F)
-#endif
-
-#define rank(var) var ## _Rank
-#define shape(var,dim) var ## _Dims[dim]
-#define old_rank(var) (((PyArrayObject *)(capi_ ## var ## _tmp))->nd)
-#define old_shape(var,dim) (((PyArrayObject *)(capi_ ## var ## _tmp))->dimensions[dim])
-#define fshape(var,dim) shape(var,rank(var)-dim-1)
-#define len(var) shape(var,0)
-#define flen(var) fshape(var,0)
-#define size(var) PyArray_SIZE((PyArrayObject *)(capi_ ## var ## _tmp))
-/* #define index(i) capi_i ## i */
-#define slen(var) capi_ ## var ## _len
-
-#define CHECKSCALAR(check,tcheck,name,show,var)\
- if (!(check)) {\
- PyErr_SetString(filter_error,"("tcheck") failed for "name);\
- fprintf(stderr,show"\n",var);\
- /*goto capi_fail;*/\
- } else
-#ifdef DEBUGCFUNCS
-#define CFUNCSMESS(mess) fprintf(stderr,"debug-capi:"mess);
-#define CFUNCSMESSPY(mess,obj) CFUNCSMESS(mess) \
- PyObject_Print((PyObject *)obj,stderr,Py_PRINT_RAW);\
- fprintf(stderr,"\n");
-#else
-#define CFUNCSMESS(mess)
-#define CFUNCSMESSPY(mess,obj)
-#endif
-
-#ifndef MAX
-#define MAX(a,b) ((a > b) ? (a) : (b))
-#endif
-#ifndef MIN
-#define MIN(a,b) ((a < b) ? (a) : (b))
-#endif
-
-
-/************************ See f2py2e/cfuncs.py: cfuncs ************************/
-/*need_cfuncs*/
-
-/********************* See f2py2e/cfuncs.py: userincludes *********************/
-/*need_userincludes*/
-
-/********************* See f2py2e/capi_rules.py: usercode *********************/
-
-
-/* See f2py2e/rules.py */
-extern void F_FUNC(dfilter2d,DFILTER2D)(double*,double*,int*,int*);
-/*eof externroutines*/
-
-/******************** See f2py2e/capi_rules.py: usercode1 ********************/
-
-
-/******************* See f2py2e/cb_rules.py: buildcallback *******************/
-/*need_callbacks*/
-
-/*********************** See f2py2e/rules.py: buildapi ***********************/
-
-/********************************* dfilter2d *********************************/
-static char doc_f2py_rout_filter_dfilter2d[] = "\
-Function signature:\n\
- b = dfilter2d(a)\n\
-Required arguments:\n"
-" a : input rank-2 array('d') with bounds (m,n)\n"
-"Return objects:\n"
-" b : rank-2 array('d') with bounds (m,n)";
-/* extern void F_FUNC(dfilter2d,DFILTER2D)(double*,double*,int*,int*); */
-static PyObject *f2py_rout_filter_dfilter2d(const PyObject *capi_self,
- PyObject *capi_args,
- PyObject *capi_keywds,
- void (*f2py_func)(double*,double*,int*,int*)) {
- PyObject * volatile capi_buildvalue = NULL;
- volatile int f2py_success = 1;
-/*decl*/
-
- double *a = NULL;
- npy_intp a_Dims[2] = {-1, -1};
- const int a_Rank = 2;
- PyArrayObject *capi_a_tmp = NULL;
- int capi_a_intent = 0;
- PyObject *a_capi = Py_None;
- double *b = NULL;
- npy_intp b_Dims[2] = {-1, -1};
- const int b_Rank = 2;
- PyArrayObject *capi_b_tmp = NULL;
- int capi_b_intent = 0;
- int m = 0;
- int n = 0;
- static char *capi_kwlist[] = {"a",NULL};
-
-/*routdebugenter*/
-#ifdef F2PY_REPORT_ATEXIT
-f2py_start_clock();
-#endif
- if (!PyArg_ParseTupleAndKeywords(capi_args,capi_keywds,\
- "O|:filter.dfilter2d",\
- capi_kwlist,&a_capi))
- return NULL;
-/*frompyobj*/
- /* Processing variable a */
- ;
- capi_a_intent |= F2PY_INTENT_IN;
- capi_a_tmp = array_from_pyobj(NPY_DOUBLE,a_Dims,a_Rank,capi_a_intent,a_capi);
- if (capi_a_tmp == NULL) {
- if (!PyErr_Occurred())
- PyErr_SetString(filter_error,"failed in converting 1st argument `a' of filter.dfilter2d to C/Fortran array" );
- } else {
- a = (double *)(capi_a_tmp->data);
-
- /* Processing variable m */
- m = shape(a,0);
- CHECKSCALAR(shape(a,0)==m,"shape(a,0)==m","hidden m","dfilter2d:m=%d",m) {
- /* Processing variable n */
- n = shape(a,1);
- CHECKSCALAR(shape(a,1)==n,"shape(a,1)==n","hidden n","dfilter2d:n=%d",n) {
- /* Processing variable b */
- b_Dims[0]=m,b_Dims[1]=n;
- capi_b_intent |= F2PY_INTENT_OUT|F2PY_INTENT_HIDE;
- capi_b_tmp = array_from_pyobj(NPY_DOUBLE,b_Dims,b_Rank,capi_b_intent,Py_None);
- if (capi_b_tmp == NULL) {
- if (!PyErr_Occurred())
- PyErr_SetString(filter_error,"failed in converting hidden `b' of filter.dfilter2d to C/Fortran array" );
- } else {
- b = (double *)(capi_b_tmp->data);
-
-/*end of frompyobj*/
-#ifdef F2PY_REPORT_ATEXIT
-f2py_start_call_clock();
-#endif
-/*callfortranroutine*/
- (*f2py_func)(a,b,&m,&n);
-if (PyErr_Occurred())
- f2py_success = 0;
-#ifdef F2PY_REPORT_ATEXIT
-f2py_stop_call_clock();
-#endif
-/*end of callfortranroutine*/
- if (f2py_success) {
-/*pyobjfrom*/
-/*end of pyobjfrom*/
- CFUNCSMESS("Building return value.\n");
- capi_buildvalue = Py_BuildValue("N",capi_b_tmp);
-/*closepyobjfrom*/
-/*end of closepyobjfrom*/
- } /*if (f2py_success) after callfortranroutine*/
-/*cleanupfrompyobj*/
- } /*if (capi_b_tmp == NULL) ... else of b*/
- /* End of cleaning variable b */
- } /*CHECKSCALAR(shape(a,1)==n)*/
- /* End of cleaning variable n */
- } /*CHECKSCALAR(shape(a,0)==m)*/
- /* End of cleaning variable m */
- if((PyObject *)capi_a_tmp!=a_capi) {
- Py_XDECREF(capi_a_tmp); }
- } /*if (capi_a_tmp == NULL) ... else of a*/
- /* End of cleaning variable a */
-/*end of cleanupfrompyobj*/
- if (capi_buildvalue == NULL) {
-/*routdebugfailure*/
- } else {
-/*routdebugleave*/
- }
- CFUNCSMESS("Freeing memory.\n");
-/*freemem*/
-#ifdef F2PY_REPORT_ATEXIT
-f2py_stop_clock();
-#endif
- return capi_buildvalue;
-}
-/****************************** end of dfilter2d ******************************/
-/*eof body*/
-
-/******************* See f2py2e/f90mod_rules.py: buildhooks *******************/
-/*need_f90modhooks*/
-
-/************** See f2py2e/rules.py: module_rules['modulebody'] **************/
-
-/******************* See f2py2e/common_rules.py: buildhooks *******************/
-
-/*need_commonhooks*/
-
-/**************************** See f2py2e/rules.py ****************************/
-
-static FortranDataDef f2py_routine_defs[] = {
- {"dfilter2d",-1,{{-1}},0,(char *)F_FUNC(dfilter2d,DFILTER2D),(f2py_init_func)f2py_rout_filter_dfilter2d,doc_f2py_rout_filter_dfilter2d},
-
-/*eof routine_defs*/
- {NULL}
-};
-
-static PyMethodDef f2py_module_methods[] = {
-
- {NULL,NULL}
-};
-
-PyMODINIT_FUNC initfilter(void) {
- int i;
- PyObject *m,*d, *s;
- m = filter_module = Py_InitModule("filter", f2py_module_methods);
- PyFortran_Type.ob_type = &PyType_Type;
- import_array();
- if (PyErr_Occurred())
- Py_FatalError("can't initialize module filter (failed to import numpy)");
- d = PyModule_GetDict(m);
- s = PyString_FromString("$Revision: $");
- PyDict_SetItemString(d, "__version__", s);
- s = PyString_FromString("This module 'filter' is auto-generated with f2py (version:2_3032).\nFunctions:\n"
-" b = dfilter2d(a)\n"
-".");
- PyDict_SetItemString(d, "__doc__", s);
- filter_error = PyErr_NewException ("filter.error", NULL, NULL);
- Py_DECREF(s);
- for(i=0;f2py_routine_defs[i].name!=NULL;i++)
- PyDict_SetItemString(d, f2py_routine_defs[i].name,PyFortranObject_NewAsAttr(&f2py_routine_defs[i]));
-
-/*eof initf2pywraphooks*/
-/*eof initf90modhooks*/
-
-/*eof initcommonhooks*/
-
-
-#ifdef F2PY_REPORT_ATEXIT
- if (! PyErr_Occurred())
- on_exit(f2py_report_on_exit,(void*)"filter");
-#endif
-
-}
-#ifdef __cplusplus
-}
-#endif
diff --git a/doc/numpybook/comparison/f2py/timeme b/doc/numpybook/comparison/f2py/timeme
deleted file mode 100755
index d6ac5741e..000000000
--- a/doc/numpybook/comparison/f2py/timeme
+++ /dev/null
@@ -1 +0,0 @@
-python2.4 -m timeit -s "import numpy as N; a=N.random.rand(100,200); import filter" "b=N.zeros_like(a); none = filter.DFILTER2D(a,b)"
diff --git a/doc/numpybook/comparison/pyrex/add.c b/doc/numpybook/comparison/pyrex/add.c
deleted file mode 100644
index d5e3bd725..000000000
--- a/doc/numpybook/comparison/pyrex/add.c
+++ /dev/null
@@ -1,560 +0,0 @@
-/* Generated by Pyrex 0.9.4.1 on Thu Aug 17 02:11:41 2006 */
-
-#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 "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_UnpackItem(PyObject *, int); /*proto*/
-static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
-static int __Pyx_PrintItem(PyObject *); /*proto*/
-static int __Pyx_PrintNewline(void); /*proto*/
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static void __Pyx_ReRaise(void); /*proto*/
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
-static PyObject *__Pyx_GetExcValue(void); /*proto*/
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
-static void __Pyx_WriteUnraisable(char *name); /*proto*/
-static void __Pyx_AddTraceback(char *funcname); /*proto*/
-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
-static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
-
-static PyObject *__pyx_m;
-static PyObject *__pyx_b;
-static int __pyx_lineno;
-static char *__pyx_filename;
-static char **__pyx_f;
-
-/* Declarations from c_numpy */
-
-static PyTypeObject *__pyx_ptype_7c_numpy_dtype = 0;
-static PyTypeObject *__pyx_ptype_7c_numpy_ndarray = 0;
-
-/* Declarations from add */
-
-
-/* Implementation of add */
-
-static PyObject *__pyx_n_c_numpy;
-static PyObject *__pyx_n_zadd;
-static PyObject *__pyx_n_cadd;
-static PyObject *__pyx_n_dadd;
-static PyObject *__pyx_n_sadd;
-
-static PyObject *__pyx_f_3add_zadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_3add_zadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_ao = 0;
- PyObject *__pyx_v_bo = 0;
- PyArrayObject *__pyx_v_c;
- PyArrayObject *__pyx_v_a;
- PyArrayObject *__pyx_v_b;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- npy_intp __pyx_2;
- static char *__pyx_argnames[] = {"ao","bo",0};
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_ao, &__pyx_v_bo)) return 0;
- Py_INCREF(__pyx_v_ao);
- Py_INCREF(__pyx_v_bo);
- __pyx_v_c = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- __pyx_v_a = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":15 */
- __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_ao,NPY_CDOUBLE,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_a));
- __pyx_v_a = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":16 */
- __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_bo,NPY_CDOUBLE,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 16; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_b));
- __pyx_v_b = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":18 */
- __pyx_1 = PyArray_SimpleNew(__pyx_v_a->nd,__pyx_v_a->dimensions,__pyx_v_a->descr->type_num); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_c));
- __pyx_v_c = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":21 */
- __pyx_2 = (__pyx_v_a->dimensions[0]);
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_2; ++__pyx_v_i) {
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":22 */
- (((npy_cdouble (*))__pyx_v_c->data)[__pyx_v_i]).real = ((((npy_cdouble (*))__pyx_v_a->data)[__pyx_v_i]).real + (((npy_cdouble (*))__pyx_v_b->data)[__pyx_v_i]).real);
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":24 */
- (((npy_cdouble (*))__pyx_v_c->data)[__pyx_v_i]).imag = ((((npy_cdouble (*))__pyx_v_a->data)[__pyx_v_i]).imag + (((npy_cdouble (*))__pyx_v_b->data)[__pyx_v_i]).imag);
- __pyx_L2:;
- }
- __pyx_L3:;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":26 */
- Py_INCREF(((PyObject *)__pyx_v_c));
- __pyx_r = ((PyObject *)__pyx_v_c);
- goto __pyx_L0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- __Pyx_AddTraceback("add.zadd");
- __pyx_r = 0;
- __pyx_L0:;
- Py_DECREF(__pyx_v_c);
- Py_DECREF(__pyx_v_a);
- Py_DECREF(__pyx_v_b);
- Py_DECREF(__pyx_v_ao);
- Py_DECREF(__pyx_v_bo);
- return __pyx_r;
-}
-
-static PyObject *__pyx_f_3add_cadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_3add_cadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_ao = 0;
- PyObject *__pyx_v_bo = 0;
- PyArrayObject *__pyx_v_c;
- PyArrayObject *__pyx_v_a;
- PyArrayObject *__pyx_v_b;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- npy_intp __pyx_2;
- static char *__pyx_argnames[] = {"ao","bo",0};
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_ao, &__pyx_v_bo)) return 0;
- Py_INCREF(__pyx_v_ao);
- Py_INCREF(__pyx_v_bo);
- __pyx_v_c = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- __pyx_v_a = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":32 */
- __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_ao,NPY_CFLOAT,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_a));
- __pyx_v_a = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":33 */
- __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_bo,NPY_CFLOAT,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_b));
- __pyx_v_b = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":35 */
- __pyx_1 = PyArray_SimpleNew(__pyx_v_a->nd,__pyx_v_a->dimensions,__pyx_v_a->descr->type_num); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_c));
- __pyx_v_c = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":38 */
- __pyx_2 = (__pyx_v_a->dimensions[0]);
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_2; ++__pyx_v_i) {
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":39 */
- (((npy_cfloat (*))__pyx_v_c->data)[__pyx_v_i]).real = ((((npy_cfloat (*))__pyx_v_a->data)[__pyx_v_i]).real + (((npy_cfloat (*))__pyx_v_b->data)[__pyx_v_i]).real);
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":41 */
- (((npy_cfloat (*))__pyx_v_c->data)[__pyx_v_i]).imag = ((((npy_cfloat (*))__pyx_v_a->data)[__pyx_v_i]).imag + (((npy_cfloat (*))__pyx_v_b->data)[__pyx_v_i]).imag);
- __pyx_L2:;
- }
- __pyx_L3:;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":43 */
- Py_INCREF(((PyObject *)__pyx_v_c));
- __pyx_r = ((PyObject *)__pyx_v_c);
- goto __pyx_L0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- __Pyx_AddTraceback("add.cadd");
- __pyx_r = 0;
- __pyx_L0:;
- Py_DECREF(__pyx_v_c);
- Py_DECREF(__pyx_v_a);
- Py_DECREF(__pyx_v_b);
- Py_DECREF(__pyx_v_ao);
- Py_DECREF(__pyx_v_bo);
- return __pyx_r;
-}
-
-static PyObject *__pyx_f_3add_dadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_3add_dadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_ao = 0;
- PyObject *__pyx_v_bo = 0;
- PyArrayObject *__pyx_v_c;
- PyArrayObject *__pyx_v_a;
- PyArrayObject *__pyx_v_b;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- npy_intp __pyx_2;
- static char *__pyx_argnames[] = {"ao","bo",0};
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_ao, &__pyx_v_bo)) return 0;
- Py_INCREF(__pyx_v_ao);
- Py_INCREF(__pyx_v_bo);
- __pyx_v_c = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- __pyx_v_a = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":50 */
- __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_ao,NPY_DOUBLE,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_a));
- __pyx_v_a = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":51 */
- __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_bo,NPY_DOUBLE,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_b));
- __pyx_v_b = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":53 */
- __pyx_1 = PyArray_SimpleNew(__pyx_v_a->nd,__pyx_v_a->dimensions,__pyx_v_a->descr->type_num); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_c));
- __pyx_v_c = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":56 */
- __pyx_2 = (__pyx_v_a->dimensions[0]);
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_2; ++__pyx_v_i) {
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":57 */
- (((double (*))__pyx_v_c->data)[__pyx_v_i]) = ((((double (*))__pyx_v_a->data)[__pyx_v_i]) + (((double (*))__pyx_v_b->data)[__pyx_v_i]));
- __pyx_L2:;
- }
- __pyx_L3:;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":59 */
- Py_INCREF(((PyObject *)__pyx_v_c));
- __pyx_r = ((PyObject *)__pyx_v_c);
- goto __pyx_L0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- __Pyx_AddTraceback("add.dadd");
- __pyx_r = 0;
- __pyx_L0:;
- Py_DECREF(__pyx_v_c);
- Py_DECREF(__pyx_v_a);
- Py_DECREF(__pyx_v_b);
- Py_DECREF(__pyx_v_ao);
- Py_DECREF(__pyx_v_bo);
- return __pyx_r;
-}
-
-static PyObject *__pyx_f_3add_sadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_3add_sadd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_ao = 0;
- PyObject *__pyx_v_bo = 0;
- PyArrayObject *__pyx_v_c;
- PyArrayObject *__pyx_v_a;
- PyArrayObject *__pyx_v_b;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- npy_intp __pyx_2;
- static char *__pyx_argnames[] = {"ao","bo",0};
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_ao, &__pyx_v_bo)) return 0;
- Py_INCREF(__pyx_v_ao);
- Py_INCREF(__pyx_v_bo);
- __pyx_v_c = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- __pyx_v_a = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":66 */
- __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_ao,NPY_FLOAT,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_a));
- __pyx_v_a = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":67 */
- __pyx_1 = PyArray_ContiguousFromAny(__pyx_v_bo,NPY_FLOAT,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_b));
- __pyx_v_b = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":69 */
- __pyx_1 = PyArray_SimpleNew(__pyx_v_a->nd,__pyx_v_a->dimensions,__pyx_v_a->descr->type_num); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_c));
- __pyx_v_c = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":72 */
- __pyx_2 = (__pyx_v_a->dimensions[0]);
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_2; ++__pyx_v_i) {
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":73 */
- (((float (*))__pyx_v_c->data)[__pyx_v_i]) = ((((float (*))__pyx_v_a->data)[__pyx_v_i]) + (((float (*))__pyx_v_b->data)[__pyx_v_i]));
- __pyx_L2:;
- }
- __pyx_L3:;
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":75 */
- Py_INCREF(((PyObject *)__pyx_v_c));
- __pyx_r = ((PyObject *)__pyx_v_c);
- goto __pyx_L0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- __Pyx_AddTraceback("add.sadd");
- __pyx_r = 0;
- __pyx_L0:;
- Py_DECREF(__pyx_v_c);
- Py_DECREF(__pyx_v_a);
- Py_DECREF(__pyx_v_b);
- Py_DECREF(__pyx_v_ao);
- Py_DECREF(__pyx_v_bo);
- return __pyx_r;
-}
-
-static __Pyx_InternTabEntry __pyx_intern_tab[] = {
- {&__pyx_n_c_numpy, "c_numpy"},
- {&__pyx_n_cadd, "cadd"},
- {&__pyx_n_dadd, "dadd"},
- {&__pyx_n_sadd, "sadd"},
- {&__pyx_n_zadd, "zadd"},
- {0, 0}
-};
-
-static struct PyMethodDef __pyx_methods[] = {
- {"zadd", (PyCFunction)__pyx_f_3add_zadd, METH_VARARGS|METH_KEYWORDS, 0},
- {"cadd", (PyCFunction)__pyx_f_3add_cadd, METH_VARARGS|METH_KEYWORDS, 0},
- {"dadd", (PyCFunction)__pyx_f_3add_dadd, METH_VARARGS|METH_KEYWORDS, 0},
- {"sadd", (PyCFunction)__pyx_f_3add_sadd, METH_VARARGS|METH_KEYWORDS, 0},
- {0, 0, 0, 0}
-};
-
-static void __pyx_init_filenames(void); /*proto*/
-
-PyMODINIT_FUNC initadd(void); /*proto*/
-PyMODINIT_FUNC initadd(void) {
- __pyx_init_filenames();
- __pyx_m = Py_InitModule4("add", __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;};
- __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 = 74; 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 = 79; goto __pyx_L1;}
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":9 */
- import_array();
-
- /* "/Users/oliphant/numpybook/pyrex/add.pyx":62 */
- return;
- __pyx_L1:;
- __Pyx_AddTraceback("add");
-}
-
-static char *__pyx_filenames[] = {
- "add.pyx",
- "c_numpy.pxd",
-};
-
-/* Runtime support code */
-
-static void __pyx_init_filenames(void) {
- __pyx_f = __pyx_filenames;
-}
-
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
- if (!type) {
- PyErr_Format(PyExc_SystemError, "Missing type object");
- return 0;
- }
- if (obj == Py_None || PyObject_TypeCheck(obj, type))
- return 1;
- PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
- obj->ob_type->tp_name, type->tp_name);
- return 0;
-}
-
-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 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;
-}
-
-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;
-}
-
-#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/doc/numpybook/comparison/pyrex/add.pyx b/doc/numpybook/comparison/pyrex/add.pyx
deleted file mode 100644
index 63c231641..000000000
--- a/doc/numpybook/comparison/pyrex/add.pyx
+++ /dev/null
@@ -1,75 +0,0 @@
-# -*- Mode: Python -*- Not really, but close enough
-
-cimport c_numpy
-from c_numpy cimport import_array, ndarray, npy_intp, npy_cdouble, \
- npy_cfloat, NPY_DOUBLE, NPY_CDOUBLE, NPY_FLOAT, \
- NPY_CFLOAT
-
-#We need to initialize NumPy
-import_array()
-
-def zadd(object ao, object bo):
- cdef ndarray c, a, b
- cdef npy_intp i
-
- a = c_numpy.PyArray_ContiguousFromAny(ao, NPY_CDOUBLE, 1, 1)
- b = c_numpy.PyArray_ContiguousFromAny(bo, NPY_CDOUBLE, 1, 1)
-
- c = c_numpy.PyArray_SimpleNew(a.nd, a.dimensions,
- a.descr.type_num)
-
- for i from 0 <= i < a.dimensions[0]:
- (<npy_cdouble *>c.data)[i].real = (<npy_cdouble *>a.data)[i].real + \
- (<npy_cdouble *>b.data)[i].real
- (<npy_cdouble *>c.data)[i].imag = (<npy_cdouble *>a.data)[i].imag + \
- (<npy_cdouble *>b.data)[i].imag
- return c
-
-def cadd(object ao, object bo):
- cdef ndarray c, a, b
- cdef npy_intp i
-
- a = c_numpy.PyArray_ContiguousFromAny(ao, NPY_CFLOAT, 1, 1)
- b = c_numpy.PyArray_ContiguousFromAny(bo, NPY_CFLOAT, 1, 1)
-
- c = c_numpy.PyArray_SimpleNew(a.nd, a.dimensions,
- a.descr.type_num)
-
- for i from 0 <= i < a.dimensions[0]:
- (<npy_cfloat *>c.data)[i].real = (<npy_cfloat *>a.data)[i].real + \
- (<npy_cfloat *>b.data)[i].real
- (<npy_cfloat *>c.data)[i].imag = (<npy_cfloat *>a.data)[i].imag + \
- (<npy_cfloat *>b.data)[i].imag
- return c
-
-
-def dadd(object ao, object bo):
- cdef ndarray c, a, b
- cdef npy_intp i
-
- a = c_numpy.PyArray_ContiguousFromAny(ao, NPY_DOUBLE, 1, 1)
- b = c_numpy.PyArray_ContiguousFromAny(bo, NPY_DOUBLE, 1, 1)
-
- c = c_numpy.PyArray_SimpleNew(a.nd, a.dimensions,
- a.descr.type_num)
-
- for i from 0 <= i < a.dimensions[0]:
- (<double *>c.data)[i] = (<double *>a.data)[i] + \
- (<double *>b.data)[i]
- return c
-
-
-def sadd(object ao, object bo):
- cdef ndarray c, a, b
- cdef npy_intp i
-
- a = c_numpy.PyArray_ContiguousFromAny(ao, NPY_FLOAT, 1, 1)
- b = c_numpy.PyArray_ContiguousFromAny(bo, NPY_FLOAT, 1, 1)
-
- c = c_numpy.PyArray_SimpleNew(a.nd, a.dimensions,
- a.descr.type_num)
-
- for i from 0 <= i < a.dimensions[0]:
- (<float *>c.data)[i] = (<float *>a.data)[i] + \
- (<float *>b.data)[i]
- return c
diff --git a/doc/numpybook/comparison/pyrex/c_numpy.pxd b/doc/numpybook/comparison/pyrex/c_numpy.pxd
deleted file mode 100644
index 66e77e294..000000000
--- a/doc/numpybook/comparison/pyrex/c_numpy.pxd
+++ /dev/null
@@ -1,107 +0,0 @@
-# :Author: Robert Kern
-# :Copyright: 2004, Enthought, Inc.
-# :License: BSD Style
-
-
-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
-
- 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
- cdef int flags
- 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
-
- 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 import_array()
diff --git a/doc/numpybook/comparison/pyrex/filter.c b/doc/numpybook/comparison/pyrex/filter.c
deleted file mode 100644
index 1c25eb677..000000000
--- a/doc/numpybook/comparison/pyrex/filter.c
+++ /dev/null
@@ -1,388 +0,0 @@
-/* Generated by Pyrex 0.9.4.1 on Thu Aug 17 02:11:42 2006 */
-
-#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 "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_UnpackItem(PyObject *, int); /*proto*/
-static int __Pyx_EndUnpack(PyObject *, int); /*proto*/
-static int __Pyx_PrintItem(PyObject *); /*proto*/
-static int __Pyx_PrintNewline(void); /*proto*/
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static void __Pyx_ReRaise(void); /*proto*/
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
-static PyObject *__Pyx_GetExcValue(void); /*proto*/
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[], int nargs, PyObject **args2, PyObject **kwds2); /*proto*/
-static void __Pyx_WriteUnraisable(char *name); /*proto*/
-static void __Pyx_AddTraceback(char *funcname); /*proto*/
-static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size); /*proto*/
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-static int __Pyx_GetVtable(PyObject *dict, void *vtabptr); /*proto*/
-static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
-static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
-
-static PyObject *__pyx_m;
-static PyObject *__pyx_b;
-static int __pyx_lineno;
-static char *__pyx_filename;
-static char **__pyx_f;
-
-/* Declarations from c_numpy */
-
-static PyTypeObject *__pyx_ptype_7c_numpy_dtype = 0;
-static PyTypeObject *__pyx_ptype_7c_numpy_ndarray = 0;
-
-/* Declarations from filter */
-
-
-/* Implementation of filter */
-
-static PyObject *__pyx_n_c_numpy;
-static PyObject *__pyx_n_filter;
-
-static PyObject *__pyx_f_6filter_filter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyObject *__pyx_f_6filter_filter(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_ao = 0;
- PyArrayObject *__pyx_v_a;
- PyArrayObject *__pyx_v_b;
- npy_intp __pyx_v_i;
- npy_intp __pyx_v_j;
- npy_intp __pyx_v_M;
- npy_intp __pyx_v_N;
- npy_intp __pyx_v_S0;
- npy_intp __pyx_v_S1;
- npy_intp __pyx_v_r;
- npy_intp __pyx_v_rm1;
- npy_intp __pyx_v_rp1;
- npy_intp __pyx_v_c;
- npy_intp __pyx_v_cm1;
- npy_intp __pyx_v_cp1;
- PyObject *__pyx_v_oS;
- PyObject *__pyx_r;
- PyObject *__pyx_1 = 0;
- long __pyx_2;
- long __pyx_3;
- PyObject *__pyx_4 = 0;
- int __pyx_5;
- static char *__pyx_argnames[] = {"ao",0};
- if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_ao)) return 0;
- Py_INCREF(__pyx_v_ao);
- __pyx_v_a = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- __pyx_v_b = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
- __pyx_v_oS = Py_None; Py_INCREF(Py_None);
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":18 */
- __pyx_1 = PyArray_FROMANY(__pyx_v_ao,NPY_DOUBLE,2,2,NPY_ALIGNED); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_a));
- __pyx_v_a = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":19 */
- __pyx_1 = PyArray_ZEROS(__pyx_v_a->nd,__pyx_v_a->dimensions,__pyx_v_a->descr->type_num,0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
- if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_7c_numpy_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
- Py_DECREF(((PyObject *)__pyx_v_b));
- __pyx_v_b = ((PyArrayObject *)__pyx_1);
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":20 */
- __pyx_v_M = (__pyx_v_a->dimensions[0]);
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":21 */
- __pyx_v_N = (__pyx_v_a->dimensions[1]);
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":22 */
- __pyx_v_S0 = (__pyx_v_a->strides[0]);
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":23 */
- __pyx_v_S1 = (__pyx_v_a->strides[1]);
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":24 */
- __pyx_2 = (__pyx_v_M - 1);
- for (__pyx_v_i = 1; __pyx_v_i < __pyx_2; ++__pyx_v_i) {
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":25 */
- __pyx_v_r = (__pyx_v_i * __pyx_v_S0);
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":26 */
- __pyx_v_rm1 = (__pyx_v_r - __pyx_v_S0);
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":27 */
- __pyx_v_rp1 = (__pyx_v_r + __pyx_v_S0);
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":28 */
- __pyx_1 = PyInt_FromLong((__pyx_v_i * __pyx_v_N)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
- Py_DECREF(__pyx_v_oS);
- __pyx_v_oS = __pyx_1;
- __pyx_1 = 0;
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":29 */
- __pyx_3 = (__pyx_v_N - 1);
- for (__pyx_v_j = 1; __pyx_v_j < __pyx_3; ++__pyx_v_j) {
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":30 */
- __pyx_v_c = (__pyx_v_j * __pyx_v_S1);
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":31 */
- __pyx_v_cm1 = (__pyx_v_c - __pyx_v_S1);
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":32 */
- __pyx_v_cp1 = (__pyx_v_c + __pyx_v_S1);
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":38 */
- __pyx_1 = PyInt_FromLong(__pyx_v_j); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
- __pyx_4 = PyNumber_Add(__pyx_v_oS, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
- Py_DECREF(__pyx_1); __pyx_1 = 0;
- __pyx_5 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
- Py_DECREF(__pyx_4); __pyx_4 = 0;
- (((double (*))__pyx_v_b->data)[__pyx_5]) = (((((double (*))((__pyx_v_a->data + __pyx_v_r) + __pyx_v_c))[0]) + (((((((double (*))((__pyx_v_a->data + __pyx_v_rm1) + __pyx_v_c))[0]) + (((double (*))((__pyx_v_a->data + __pyx_v_rp1) + __pyx_v_c))[0])) + (((double (*))((__pyx_v_a->data + __pyx_v_r) + __pyx_v_cm1))[0])) + (((double (*))((__pyx_v_a->data + __pyx_v_r) + __pyx_v_cp1))[0])) * 0.5)) + (((((((double (*))((__pyx_v_a->data + __pyx_v_rm1) + __pyx_v_cm1))[0]) + (((double (*))((__pyx_v_a->data + __pyx_v_rp1) + __pyx_v_cm1))[0])) + (((double (*))((__pyx_v_a->data + __pyx_v_rp1) + __pyx_v_cp1))[0])) + (((double (*))((__pyx_v_a->data + __pyx_v_rm1) + __pyx_v_cp1))[0])) * 0.25));
- __pyx_L4:;
- }
- __pyx_L5:;
- __pyx_L2:;
- }
- __pyx_L3:;
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":43 */
- Py_INCREF(((PyObject *)__pyx_v_b));
- __pyx_r = ((PyObject *)__pyx_v_b);
- goto __pyx_L0;
-
- __pyx_r = Py_None; Py_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1:;
- Py_XDECREF(__pyx_1);
- Py_XDECREF(__pyx_4);
- __Pyx_AddTraceback("filter.filter");
- __pyx_r = 0;
- __pyx_L0:;
- Py_DECREF(__pyx_v_a);
- Py_DECREF(__pyx_v_b);
- Py_DECREF(__pyx_v_oS);
- Py_DECREF(__pyx_v_ao);
- return __pyx_r;
-}
-
-static __Pyx_InternTabEntry __pyx_intern_tab[] = {
- {&__pyx_n_c_numpy, "c_numpy"},
- {&__pyx_n_filter, "filter"},
- {0, 0}
-};
-
-static struct PyMethodDef __pyx_methods[] = {
- {"filter", (PyCFunction)__pyx_f_6filter_filter, METH_VARARGS|METH_KEYWORDS, 0},
- {0, 0, 0, 0}
-};
-
-static void __pyx_init_filenames(void); /*proto*/
-
-PyMODINIT_FUNC initfilter(void); /*proto*/
-PyMODINIT_FUNC initfilter(void) {
- __pyx_init_filenames();
- __pyx_m = Py_InitModule4("filter", __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;};
- __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 = 74; 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 = 79; goto __pyx_L1;}
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":9 */
- import_array();
-
- /* "/Users/oliphant/numpybook/pyrex/filter.pyx":11 */
- return;
- __pyx_L1:;
- __Pyx_AddTraceback("filter");
-}
-
-static char *__pyx_filenames[] = {
- "filter.pyx",
- "c_numpy.pxd",
-};
-
-/* Runtime support code */
-
-static void __pyx_init_filenames(void) {
- __pyx_f = __pyx_filenames;
-}
-
-static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
- if (!type) {
- PyErr_Format(PyExc_SystemError, "Missing type object");
- return 0;
- }
- if (obj == Py_None || PyObject_TypeCheck(obj, type))
- return 1;
- PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
- obj->ob_type->tp_name, type->tp_name);
- return 0;
-}
-
-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 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;
-}
-
-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;
-}
-
-#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/doc/numpybook/comparison/pyrex/filter.pyx b/doc/numpybook/comparison/pyrex/filter.pyx
deleted file mode 100644
index 492bc43de..000000000
--- a/doc/numpybook/comparison/pyrex/filter.pyx
+++ /dev/null
@@ -1,44 +0,0 @@
-# -*- Mode: Python -*- Not really, but close enough
-
-cimport c_numpy
-from c_numpy cimport import_array, ndarray, npy_intp,\
- NPY_DOUBLE, NPY_CDOUBLE, NPY_FLOAT, \
- NPY_CFLOAT, NPY_ALIGNED
-
-#We need to initialize NumPy
-import_array()
-
-def filter(object ao):
- cdef ndarray a, b
- cdef npy_intp i, j, M, N, S0, S1
- cdef npy_intp r,rm1,rp1,c,cm1,cp1
-
- # Require an ALIGNED array (but not necessarily contiguous)
- # We will use strides to access the elements.
- a = c_numpy.PyArray_FROMANY(ao, NPY_DOUBLE, 2, 2, NPY_ALIGNED)
- b = c_numpy.PyArray_ZEROS(a.nd, a.dimensions, a.descr.type_num, 0)
- M = a.dimensions[0]
- N = a.dimensions[1]
- S0 = a.strides[0]
- S1 = a.strides[1]
- for i from 1 <= i < M-1:
- r = i*S0
- rm1 = r-S0
- rp1 = r+S0
- oS = i*N
- for j from 1 <= j < N-1:
- c = j*S1
- cm1 = c-S1
- cp1 = c+S1
- (<double *>b.data)[oS+j] = \
- (<double *>(a.data+r+c))[0] + \
- ((<double *>(a.data+rm1+c))[0] + \
- (<double *>(a.data+rp1+c))[0] + \
- (<double *>(a.data+r+cm1))[0] + \
- (<double *>(a.data+r+cp1))[0])*0.5 + \
- ((<double *>(a.data+rm1+cm1))[0] + \
- (<double *>(a.data+rp1+cm1))[0] + \
- (<double *>(a.data+rp1+cp1))[0] + \
- (<double *>(a.data+rm1+cp1))[0])*0.25
- return b
-
diff --git a/doc/numpybook/comparison/pyrex/setup.py b/doc/numpybook/comparison/pyrex/setup.py
deleted file mode 100644
index 3fb69a705..000000000
--- a/doc/numpybook/comparison/pyrex/setup.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python
-from __future__ import division, print_function
-
-from distutils.core import setup
-from distutils.extension import Extension
-
-import numpy
-
-# Define a pyrex-based extension module, using the generated sources if pyrex
-from Pyrex.Distutils import build_ext
-pyx_sources = ['add.pyx']
-cmdclass = {'build_ext': build_ext}
-
-
-pyx_ext = Extension('add',
- pyx_sources,
- include_dirs = [numpy.get_include()])
-
-pyx_ext2 = Extension('blur',
- ['blur.pyx'],
- include_dirs = [numpy.get_include()])
-
-
-# Call the routine which does the real work
-setup(name = 'add',
- description = 'Small example on using Pyrex to write a Numpy extension',
- url = 'http://www.scipy.org/Cookbook/Pyrex_and_NumPy',
- ext_modules = [pyx_ext, pyx_ext2],
- cmdclass = cmdclass,
- )
diff --git a/doc/numpybook/comparison/pyrex/timeme b/doc/numpybook/comparison/pyrex/timeme
deleted file mode 100755
index 2f7cd297f..000000000
--- a/doc/numpybook/comparison/pyrex/timeme
+++ /dev/null
@@ -1,2 +0,0 @@
-python2.4 -m timeit -s "import numpy as N; a=N.random.rand(100,200); import filter" "b = filter.filter(a)"
-
diff --git a/doc/numpybook/comparison/timing.py b/doc/numpybook/comparison/timing.py
deleted file mode 100644
index 1c70b48ac..000000000
--- a/doc/numpybook/comparison/timing.py
+++ /dev/null
@@ -1,62 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-import timeit
-
-pyrex_pre = """
-import numpy as N
-a = N.random.rand(%d,%d)
-import filter
-"""
-
-pyrex_run = """
-b = filter.filter(a)
-"""
-
-weave_pre = """
-import numpy as N
-a = N.random.rand(%d,%d)
-import filter
-"""
-
-weave_run = """
-b = filter.filter(a)
-"""
-
-ctypes_pre = """
-import numpy as N
-a = N.random.rand(%d,%d)
-import filter
-"""
-
-ctypes_run = """
-b = filter.filter(a)
-"""
-
-f2py_pre = """
-import numpy as N
-a = N.random.rand(%d, %d).T
-import filter
-"""
-
-f2py_run = """
-b = N.zeros_like(a)
-filter.DFILTER2D(a,b)
-"""
-
-N = [10, 20, 30, 40, 50, 100, 200, 300, 400, 500]
-
-res = {}
-
-import os
-import sys
-path = sys.path
-
-for kind in ['f2py']:#['ctypes', 'pyrex', 'weave', 'f2py']:
- res[kind] = []
- sys.path = ['/Users/oliphant/numpybook/%s' % (kind,)] + path
- print(sys.path)
- for n in N:
- print("%s - %d" % (kind, n))
- t = timeit.Timer(eval('%s_run'%kind), eval('%s_pre %% (%d,%d)'%(kind, n, n)))
- mytime = min(t.repeat(3, 100))
- res[kind].append(mytime)
diff --git a/doc/numpybook/comparison/weave/filter.py b/doc/numpybook/comparison/weave/filter.py
deleted file mode 100644
index 309764c29..000000000
--- a/doc/numpybook/comparison/weave/filter.py
+++ /dev/null
@@ -1,24 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-from scipy import weave, zeros_like
-
-def filter(a):
- if a.ndim != 2:
- raise ValueError("a must be 2-d")
- code = r"""
- int i,j;
- for(i=1;i<Na[0]-1;i++) {
- for(j=1;j<Na[1]-1;j++) {
- B2(i,j) = A2(i,j) + (A2(i-1,j) +
- A2(i+1,j) + A2(i,j-1)
- + A2(i,j+1))*0.5
- + (A2(i-1,j-1)
- + A2(i-1,j+1)
- + A2(i+1,j-1)
- + A2(i+1,j+1))*0.25;
- }
- }
- """
- b = zeros_like(a)
- weave.inline(code, ['a', 'b'])
- return b
diff --git a/doc/numpybook/comparison/weave/inline.py b/doc/numpybook/comparison/weave/inline.py
deleted file mode 100644
index 6e98e6997..000000000
--- a/doc/numpybook/comparison/weave/inline.py
+++ /dev/null
@@ -1,51 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-from scipy import weave
-from numpy import rand, zeros_like
-
-def example1(a):
- if not isinstance(a, list):
- raise ValueError("argument must be a list")
- code = r"""
- int i;
- py::tuple results(2);
- for (i=0; i<a.length(); i++) {
- a[i] = i;
- }
- results[0] = 3.0;
- results[1] = 4.0;
- return_val = results;
- """
- return weave.inline(code, ['a'])
-
-def arr(a):
- if a.ndim != 2:
- raise ValueError("a must be 2-d")
- code = r"""
- int i,j;
- for(i=1;i<Na[0]-1;i++) {
- for(j=1;j<Na[1]-1;j++) {
- B2(i,j) = A2(i,j) + A2(i-1,j)*0.5 +
- A2(i+1,j)*0.5 + A2(i,j-1)*0.5
- + A2(i,j+1)*0.5
- + A2(i-1,j-1)*0.25
- + A2(i-1,j+1)*0.25
- + A2(i+1,j-1)*0.25
- + A2(i+1,j+1)*0.25;
- }
- }
- """
- b = zeros_like(a)
- weave.inline(code, ['a', 'b'])
- return b
-
-a = [None]*10
-print(example1(a))
-print(a)
-
-a = rand(512, 512)
-b = arr(a)
-
-h = [[0.25, 0.5, 0.25], [0.5, 1, 0.5], [0.25, 0.5, 0.25]]
-import scipy.signal as ss
-b2 = ss.convolve(h, a, 'same')
diff --git a/doc/numpybook/comparison/weave/timeme b/doc/numpybook/comparison/weave/timeme
deleted file mode 100755
index 2f7cd297f..000000000
--- a/doc/numpybook/comparison/weave/timeme
+++ /dev/null
@@ -1,2 +0,0 @@
-python2.4 -m timeit -s "import numpy as N; a=N.random.rand(100,200); import filter" "b = filter.filter(a)"
-
diff --git a/doc/numpybook/graphics/note.eps b/doc/numpybook/graphics/note.eps
deleted file mode 100644
index 6dc22e31c..000000000
--- a/doc/numpybook/graphics/note.eps
+++ /dev/null
@@ -1,116 +0,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Title: note.fig
-%%Creator: fig2dev Version 3.2 Patchlevel 4
-%%CreationDate: Wed Aug 24 03:03:42 2005
-%%For: oliphant@den.local.net (Travis Oliphant)
-%%BoundingBox: 0 0 88 88
-%%Magnification: 1.0000
-%%EndComments
-/$F2psDict 200 dict def
-$F2psDict begin
-$F2psDict /mtrx matrix put
-/col-1 {0 setgray} bind def
-/col0 {0.000 0.000 0.000 srgb} bind def
-/col1 {0.000 0.000 1.000 srgb} bind def
-/col2 {0.000 1.000 0.000 srgb} bind def
-/col3 {0.000 1.000 1.000 srgb} bind def
-/col4 {1.000 0.000 0.000 srgb} bind def
-/col5 {1.000 0.000 1.000 srgb} bind def
-/col6 {1.000 1.000 0.000 srgb} bind def
-/col7 {1.000 1.000 1.000 srgb} bind def
-/col8 {0.000 0.000 0.560 srgb} bind def
-/col9 {0.000 0.000 0.690 srgb} bind def
-/col10 {0.000 0.000 0.820 srgb} bind def
-/col11 {0.530 0.810 1.000 srgb} bind def
-/col12 {0.000 0.560 0.000 srgb} bind def
-/col13 {0.000 0.690 0.000 srgb} bind def
-/col14 {0.000 0.820 0.000 srgb} bind def
-/col15 {0.000 0.560 0.560 srgb} bind def
-/col16 {0.000 0.690 0.690 srgb} bind def
-/col17 {0.000 0.820 0.820 srgb} bind def
-/col18 {0.560 0.000 0.000 srgb} bind def
-/col19 {0.690 0.000 0.000 srgb} bind def
-/col20 {0.820 0.000 0.000 srgb} bind def
-/col21 {0.560 0.000 0.560 srgb} bind def
-/col22 {0.690 0.000 0.690 srgb} bind def
-/col23 {0.820 0.000 0.820 srgb} bind def
-/col24 {0.500 0.190 0.000 srgb} bind def
-/col25 {0.630 0.250 0.000 srgb} bind def
-/col26 {0.750 0.380 0.000 srgb} bind def
-/col27 {1.000 0.500 0.500 srgb} bind def
-/col28 {1.000 0.630 0.630 srgb} bind def
-/col29 {1.000 0.750 0.750 srgb} bind def
-/col30 {1.000 0.880 0.880 srgb} bind def
-/col31 {1.000 0.840 0.000 srgb} bind def
-/col32 {0.875 0.953 0.996 srgb} bind def
-/col33 {0.996 0.820 0.820 srgb} bind def
-/col34 {0.984 0.961 0.859 srgb} bind def
-
-end
-save
-newpath 0 88 moveto 0 0 lineto 88 0 lineto 88 88 lineto closepath clip newpath
-% Fill background color
-0 0 moveto 88 0 lineto 88 88 lineto 0 88 lineto
-closepath 0.98 0.96 0.86 setrgbcolor fill
-
--172.1 187.9 translate
-1 -1 scale
-
-/cp {closepath} bind def
-/ef {eofill} bind def
-/gr {grestore} bind def
-/gs {gsave} bind def
-/sa {save} bind def
-/rs {restore} bind def
-/l {lineto} bind def
-/m {moveto} bind def
-/rm {rmoveto} bind def
-/n {newpath} bind def
-/s {stroke} bind def
-/sh {show} bind def
-/slc {setlinecap} bind def
-/slj {setlinejoin} bind def
-/slw {setlinewidth} bind def
-/srgb {setrgbcolor} bind def
-/rot {rotate} bind def
-/sc {scale} bind def
-/sd {setdash} bind def
-/ff {findfont} bind def
-/sf {setfont} bind def
-/scf {scalefont} bind def
-/sw {stringwidth} bind def
-/tr {translate} bind def
-/tnt {dup dup currentrgbcolor
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
- bind def
-/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
- 4 -2 roll mul srgb} bind def
-/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
-/$F2psEnd {$F2psEnteredState restore end} def
-
-$F2psBegin
-10 setmiterlimit
-0 slj 0 slc
- 0.06000 0.06000 sc
-%
-% Fig objects follow
-%
-%
-% here starts figure with depth 52
-% Polyline
-7.500 slw
-n 3600 1680 m 2880 2400 l 3600 3120 l 4320 2400 l
- cp gs col31 1.00 shd ef gr gs col31 s gr
-% here ends figure;
-%
-% here starts figure with depth 50
-% Polyline
-60.000 slw
-n 3600 1860 m 3060 2400 l 3600 2940 l 4140 2400 l
- cp gs col0 s gr
-% here ends figure;
-$F2psEnd
-rs
-showpage
diff --git a/doc/numpybook/graphics/note.fig b/doc/numpybook/graphics/note.fig
deleted file mode 100644
index 3a193a52c..000000000
--- a/doc/numpybook/graphics/note.fig
+++ /dev/null
@@ -1,16 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter
-100.00
-Single
--2
-1200 2
-0 32 #e0f4ff
-0 33 #ffd2d2
-0 34 #fcf6dc
-2 3 0 1 31 31 52 -1 20 0.000 0 0 -1 0 0 5
- 3600 1680 2880 2400 3600 3120 4320 2400 3600 1680
-2 3 0 5 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
- 3600 1860 3060 2400 3600 2940 4140 2400 3600 1860
diff --git a/doc/numpybook/graphics/note.png b/doc/numpybook/graphics/note.png
deleted file mode 100644
index bea5b70be..000000000
--- a/doc/numpybook/graphics/note.png
+++ /dev/null
Binary files differ
diff --git a/doc/numpybook/graphics/tip.eps b/doc/numpybook/graphics/tip.eps
deleted file mode 100644
index b87fd662c..000000000
--- a/doc/numpybook/graphics/tip.eps
+++ /dev/null
@@ -1,127 +0,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Title: tip.fig
-%%Creator: fig2dev Version 3.2 Patchlevel 4
-%%CreationDate: Tue Aug 23 23:51:46 2005
-%%For: oliphant@den.local.net (Travis Oliphant)
-%%BoundingBox: 0 0 88 88
-%%Magnification: 1.0000
-%%EndComments
-/$F2psDict 200 dict def
-$F2psDict begin
-$F2psDict /mtrx matrix put
-/col-1 {0 setgray} bind def
-/col0 {0.000 0.000 0.000 srgb} bind def
-/col1 {0.000 0.000 1.000 srgb} bind def
-/col2 {0.000 1.000 0.000 srgb} bind def
-/col3 {0.000 1.000 1.000 srgb} bind def
-/col4 {1.000 0.000 0.000 srgb} bind def
-/col5 {1.000 0.000 1.000 srgb} bind def
-/col6 {1.000 1.000 0.000 srgb} bind def
-/col7 {1.000 1.000 1.000 srgb} bind def
-/col8 {0.000 0.000 0.560 srgb} bind def
-/col9 {0.000 0.000 0.690 srgb} bind def
-/col10 {0.000 0.000 0.820 srgb} bind def
-/col11 {0.530 0.810 1.000 srgb} bind def
-/col12 {0.000 0.560 0.000 srgb} bind def
-/col13 {0.000 0.690 0.000 srgb} bind def
-/col14 {0.000 0.820 0.000 srgb} bind def
-/col15 {0.000 0.560 0.560 srgb} bind def
-/col16 {0.000 0.690 0.690 srgb} bind def
-/col17 {0.000 0.820 0.820 srgb} bind def
-/col18 {0.560 0.000 0.000 srgb} bind def
-/col19 {0.690 0.000 0.000 srgb} bind def
-/col20 {0.820 0.000 0.000 srgb} bind def
-/col21 {0.560 0.000 0.560 srgb} bind def
-/col22 {0.690 0.000 0.690 srgb} bind def
-/col23 {0.820 0.000 0.820 srgb} bind def
-/col24 {0.500 0.190 0.000 srgb} bind def
-/col25 {0.630 0.250 0.000 srgb} bind def
-/col26 {0.750 0.380 0.000 srgb} bind def
-/col27 {1.000 0.500 0.500 srgb} bind def
-/col28 {1.000 0.630 0.630 srgb} bind def
-/col29 {1.000 0.750 0.750 srgb} bind def
-/col30 {1.000 0.880 0.880 srgb} bind def
-/col31 {1.000 0.840 0.000 srgb} bind def
-/col32 {0.875 0.953 0.996 srgb} bind def
-/col33 {0.000 0.000 0.000 srgb} bind def
-
-end
-save
-newpath 0 88 moveto 0 0 lineto 88 0 lineto 88 88 lineto closepath clip newpath
-% Fill background color
-0 0 moveto 88 0 lineto 88 88 lineto 0 88 lineto
-closepath 0.88 0.95 1.00 setrgbcolor fill
-
--172.3 187.6 translate
-1 -1 scale
-
-/cp {closepath} bind def
-/ef {eofill} bind def
-/gr {grestore} bind def
-/gs {gsave} bind def
-/sa {save} bind def
-/rs {restore} bind def
-/l {lineto} bind def
-/m {moveto} bind def
-/rm {rmoveto} bind def
-/n {newpath} bind def
-/s {stroke} bind def
-/sh {show} bind def
-/slc {setlinecap} bind def
-/slj {setlinejoin} bind def
-/slw {setlinewidth} bind def
-/srgb {setrgbcolor} bind def
-/rot {rotate} bind def
-/sc {scale} bind def
-/sd {setdash} bind def
-/ff {findfont} bind def
-/sf {setfont} bind def
-/scf {scalefont} bind def
-/sw {stringwidth} bind def
-/tr {translate} bind def
-/tnt {dup dup currentrgbcolor
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
- bind def
-/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
- 4 -2 roll mul srgb} bind def
- /DrawEllipse {
- /endangle exch def
- /startangle exch def
- /yrad exch def
- /xrad exch def
- /y exch def
- /x exch def
- /savematrix mtrx currentmatrix def
- x y tr xrad yrad sc 0 0 1 startangle endangle arc
- closepath
- savematrix setmatrix
- } def
-
-/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
-/$F2psEnd {$F2psEnteredState restore end} def
-
-$F2psBegin
-10 setmiterlimit
-0 slj 0 slc
- 0.06000 0.06000 sc
-%
-% Fig objects follow
-%
-%
-% here starts figure with depth 51
-% Ellipse
-7.500 slw
-n 3600 2400 720 720 0 360 DrawEllipse gs col7 1.00 shd ef gr gs col7 s gr
-
-% Ellipse
-n 3600 2400 660 660 0 360 DrawEllipse gs col1 1.00 shd ef gr gs col1 s gr
-
-/Times-Bold ff 1650.00 scf sf
-3384 2940 m
-gs 1 -1 sc (i) col7 sh gr
-% here ends figure;
-$F2psEnd
-rs
-showpage
diff --git a/doc/numpybook/graphics/tip.fig b/doc/numpybook/graphics/tip.fig
deleted file mode 100644
index 77db02fe1..000000000
--- a/doc/numpybook/graphics/tip.fig
+++ /dev/null
@@ -1,14 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter
-100.00
-Single
--2
-1200 2
-0 32 #e0f4ff
-0 33 #000000
-1 3 0 1 1 1 50 -1 20 0.000 1 0.0000 3600 2400 660 660 3600 2400 4260 2400
-1 3 0 1 7 7 51 -1 20 0.000 1 0.0000 3600 2400 720 720 3600 2400 4320 2400
-4 0 7 50 -1 2 110 0.0000 4 1140 465 3384 2940 i\001
diff --git a/doc/numpybook/graphics/tip.png b/doc/numpybook/graphics/tip.png
deleted file mode 100644
index 6a63550e2..000000000
--- a/doc/numpybook/graphics/tip.png
+++ /dev/null
Binary files differ
diff --git a/doc/numpybook/graphics/tip.xfig.fig b/doc/numpybook/graphics/tip.xfig.fig
deleted file mode 100644
index ede65f7c4..000000000
--- a/doc/numpybook/graphics/tip.xfig.fig
+++ /dev/null
@@ -1,12 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter
-100.00
-Single
--2
-1200 2
-1 3 0 1 1 1 50 -1 20 0.000 1 0.0000 3600 2400 660 660 3600 2400 4260 2400
-1 3 0 1 7 7 51 -1 20 0.000 1 0.0000 3600 2400 720 720 3600 2400 4320 2400
-4 0 7 50 -1 2 92 0.0000 4 960 390 3450 2850 i\001
diff --git a/doc/numpybook/graphics/warning.eps b/doc/numpybook/graphics/warning.eps
deleted file mode 100644
index d854a99ff..000000000
--- a/doc/numpybook/graphics/warning.eps
+++ /dev/null
@@ -1,125 +0,0 @@
-%!PS-Adobe-2.0 EPSF-2.0
-%%Title: warning.fig
-%%Creator: fig2dev Version 3.2 Patchlevel 4
-%%CreationDate: Wed Aug 24 00:00:52 2005
-%%For: oliphant@den.local.net (Travis Oliphant)
-%%BoundingBox: 0 0 88 88
-%%Magnification: 1.0000
-%%EndComments
-/$F2psDict 200 dict def
-$F2psDict begin
-$F2psDict /mtrx matrix put
-/col-1 {0 setgray} bind def
-/col0 {0.000 0.000 0.000 srgb} bind def
-/col1 {0.000 0.000 1.000 srgb} bind def
-/col2 {0.000 1.000 0.000 srgb} bind def
-/col3 {0.000 1.000 1.000 srgb} bind def
-/col4 {1.000 0.000 0.000 srgb} bind def
-/col5 {1.000 0.000 1.000 srgb} bind def
-/col6 {1.000 1.000 0.000 srgb} bind def
-/col7 {1.000 1.000 1.000 srgb} bind def
-/col8 {0.000 0.000 0.560 srgb} bind def
-/col9 {0.000 0.000 0.690 srgb} bind def
-/col10 {0.000 0.000 0.820 srgb} bind def
-/col11 {0.530 0.810 1.000 srgb} bind def
-/col12 {0.000 0.560 0.000 srgb} bind def
-/col13 {0.000 0.690 0.000 srgb} bind def
-/col14 {0.000 0.820 0.000 srgb} bind def
-/col15 {0.000 0.560 0.560 srgb} bind def
-/col16 {0.000 0.690 0.690 srgb} bind def
-/col17 {0.000 0.820 0.820 srgb} bind def
-/col18 {0.560 0.000 0.000 srgb} bind def
-/col19 {0.690 0.000 0.000 srgb} bind def
-/col20 {0.820 0.000 0.000 srgb} bind def
-/col21 {0.560 0.000 0.560 srgb} bind def
-/col22 {0.690 0.000 0.690 srgb} bind def
-/col23 {0.820 0.000 0.820 srgb} bind def
-/col24 {0.500 0.190 0.000 srgb} bind def
-/col25 {0.630 0.250 0.000 srgb} bind def
-/col26 {0.750 0.380 0.000 srgb} bind def
-/col27 {1.000 0.500 0.500 srgb} bind def
-/col28 {1.000 0.630 0.630 srgb} bind def
-/col29 {1.000 0.750 0.750 srgb} bind def
-/col30 {1.000 0.880 0.880 srgb} bind def
-/col31 {1.000 0.840 0.000 srgb} bind def
-/col32 {0.875 0.953 0.996 srgb} bind def
-/col33 {0.996 0.820 0.820 srgb} bind def
-/col34 {0.984 0.961 0.859 srgb} bind def
-
-end
-save
-newpath 0 88 moveto 0 0 lineto 88 0 lineto 88 88 lineto closepath clip newpath
-% Fill background color
-0 0 moveto 88 0 lineto 88 88 lineto 0 88 lineto
-closepath 1.00 0.82 0.82 setrgbcolor fill
-
--172.3 187.6 translate
-1 -1 scale
-
-/cp {closepath} bind def
-/ef {eofill} bind def
-/gr {grestore} bind def
-/gs {gsave} bind def
-/sa {save} bind def
-/rs {restore} bind def
-/l {lineto} bind def
-/m {moveto} bind def
-/rm {rmoveto} bind def
-/n {newpath} bind def
-/s {stroke} bind def
-/sh {show} bind def
-/slc {setlinecap} bind def
-/slj {setlinejoin} bind def
-/slw {setlinewidth} bind def
-/srgb {setrgbcolor} bind def
-/rot {rotate} bind def
-/sc {scale} bind def
-/sd {setdash} bind def
-/ff {findfont} bind def
-/sf {setfont} bind def
-/scf {scalefont} bind def
-/sw {stringwidth} bind def
-/tr {translate} bind def
-/tnt {dup dup currentrgbcolor
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add
- 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
- bind def
-/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
- 4 -2 roll mul srgb} bind def
- /DrawEllipse {
- /endangle exch def
- /startangle exch def
- /yrad exch def
- /xrad exch def
- /y exch def
- /x exch def
- /savematrix mtrx currentmatrix def
- x y tr xrad yrad sc 0 0 1 startangle endangle arc
- closepath
- savematrix setmatrix
- } def
-
-/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
-/$F2psEnd {$F2psEnteredState restore end} def
-
-$F2psBegin
-10 setmiterlimit
-0 slj 0 slc
- 0.06000 0.06000 sc
-%
-% Fig objects follow
-%
-%
-% here starts figure with depth 50
-% Ellipse
-7.500 slw
-n 3600 2400 720 720 0 360 DrawEllipse gs col20 1.00 shd ef gr gs col20 s gr
-
-% Polyline
-n 3096 2268 m 4104 2268 l 4104 2532 l 3096 2532 l
- cp gs col7 1.00 shd ef gr gs col7 s gr
-% here ends figure;
-$F2psEnd
-rs
-showpage
diff --git a/doc/numpybook/graphics/warning.fig b/doc/numpybook/graphics/warning.fig
deleted file mode 100644
index 89424d5ba..000000000
--- a/doc/numpybook/graphics/warning.fig
+++ /dev/null
@@ -1,15 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Inches
-Letter
-100.00
-Single
--2
-1200 2
-0 32 #e0f4ff
-0 33 #ffd2d2
-0 34 #fcf6dc
-1 3 0 1 20 20 50 -1 20 0.000 1 0.0000 3600 2400 720 720 3600 2400 4320 2400
-2 2 0 1 7 7 50 -1 20 0.000 0 0 -1 0 0 5
- 3096 2268 4104 2268 4104 2532 3096 2532 3096 2268
diff --git a/doc/numpybook/graphics/warning.png b/doc/numpybook/graphics/warning.png
deleted file mode 100644
index 12f105160..000000000
--- a/doc/numpybook/graphics/warning.png
+++ /dev/null
Binary files differ
diff --git a/doc/numpybook/mybook.layout b/doc/numpybook/mybook.layout
deleted file mode 100644
index 588384dd3..000000000
--- a/doc/numpybook/mybook.layout
+++ /dev/null
@@ -1,177 +0,0 @@
-#% Do not delete the line below; configure depends on this
-# \DeclareLaTeXClass[book]{Stylish Book}
-# Book textclass definition file. Taken from initial LyX source code
-# Author : Matthias Ettrich <ettrich@informatik.uni-tuebingen.de>
-# Transposed by Pascal André <andre@via.ecp.fr>
-# Heavily modifed and enhanced by serveral developers.
-
-# Input general definitions
-Input stdclass.inc
-
-# Global parameters.
-Sides 2
-PageStyle Headings
-
-# There is no abstract environment in book.cls
-NoStyle Abstract
-
-# a few changes to the bibliography
-Style Bibliography
- TopSep 4
- LabelString Bibliography
- # label font definition
- LabelFont
- Series Bold
- Size Huge
- EndFont
-End
-
-
-Style Note
- LatexType Command
- LatexName notel
-
- LabelType Centered_Top_Environment
- LabelString "NOTE"
- AlignPossible Left
- LeftMargin "MMMMM"
- RightMargin "MMMMM"
- ParSkip 0.7
- ParSep 0.7
- TopSep 0.7
- BottomSep 0.7
-
- Font
- Shape SmallCaps
- Color Magenta
- EndFont
- Preamble
- \usepackage{color}
- \setlength{\fboxrule}{2pt}
- \definecolor{noteback}{rgb}{0.988235, 0.964706, 0.862745}
- \newcommand{\notel}[1]{%
- \begin{center}%
- \fcolorbox{black}{noteback}{%
- \begin{minipage}{0.8\textwidth}%
- \includegraphics[height=0.3in]{graphics/note.eps}%
- \vskip-0.3in\hskip1.65in{\large\bf NOTE} \\[0.2cm]%
- #1%
- \end{minipage}%
- }%
- \end{center}%
- }
- EndPreamble
-End
-
-
-Style Warning
- LatexType Command
- LatexName warnl
-
- LabelType Centered_Top_Environment
- LabelString "WARNING"
- AlignPossible Left
- LeftMargin "MMMMM"
- RightMargin "MMMMM"
- ParSkip 0.7
- ParSep 0.7
- TopSep 0.7
- BottomSep 0.7
-
- Font
- Shape SmallCaps
- Color Red
- EndFont
- Preamble
- \usepackage{color}
- \setlength{\fboxrule}{2pt}
- \definecolor{warnback}{rgb}{1.0, 0.8235294, 0.8235294}
- \newcommand{\warnl}[1]{%
- \begin{center}%
- \fcolorbox{black}{warnback}{%
- \begin{minipage}{0.8\textwidth}%
- \includegraphics[height=0.3in]{graphics/warning.eps}%
- \vskip-0.3in\hskip1.5in{\large\bf WARNING} \\[0.2cm]%
- #1%
- \end{minipage}%
- }%
- \end{center}%
- }
- EndPreamble
-End
-
-
-Style Tip
- LatexType Command
- LatexName tipl
-
- LabelType Centered_Top_Environment
- LabelString "TIP"
- AlignPossible Left
- LeftMargin "MMMMM"
- RightMargin "MMMMM"
- ParSkip 0.7
- ParSep 0.7
- TopSep 0.7
- BottomSep 0.7
-
- Font
- Shape SmallCaps
- Color Blue
- EndFont
- Preamble
- \usepackage{color}
- \setlength{\fboxrule}{2pt}
- \definecolor{tipback}{rgb}{0.87843, 0.95686, 1.0}
- \newcommand{\tipl}[1]{%
- \begin{center}%
- \fcolorbox{black}{tipback}{%
- \begin{minipage}{0.8\textwidth}%
- \includegraphics[height=0.3in]{graphics/tip.eps}%
- \vskip-0.3in\hskip1.8in{\large\bf TIP} \\[0.2cm]%
- #1%
- \end{minipage}%
- }%
- \end{center}%
- }
- EndPreamble
-End
-
-Style MyCode
- Margin Static
- LatexType Environment
- LatexName mycode
- NextNoIndent 1
- LeftMargin MMM
- RightMargin MMM
- TopSep 0.5
- BottomSep 0.5
- Align Left
- AlignPossible Block, Left, Right, Center
- LabelType No_Label
- FreeSpacing 1
-
- # define the environment lyxcode
- Preamble
- \usepackage{color}
- \setlength{\fboxrule}{2pt}
- \definecolor{codeback}{rgb}{0.94118,0.94118,0.94118}
- \newsavebox{\mycodesavebox}
- \newenvironment{mycode}
- {\begin{lrbox}{\mycodesavebox}%
- \begin{minipage}{0.95\linewidth}%
- \begin{trivlist}
- \setlength{\itemsep}{0pt}
- \setlength{\parsep}{0pt}
- \normalfont\ttfamily
- \item[] }
- {\end{trivlist}\end{minipage}\end{lrbox}%
- \vskip 0.5em \begin{center}\fcolorbox{black}{codeback}{\usebox{\mycodesavebox}}\end{center}\par \vskip 0.5em}
- EndPreamble
-
- # standard font definition
- Font
- Family Typewriter
- EndFont
-
-End
diff --git a/doc/numpybook/numpybook.lyx b/doc/numpybook/numpybook.lyx
deleted file mode 100644
index 59f51b4eb..000000000
--- a/doc/numpybook/numpybook.lyx
+++ /dev/null
@@ -1,27837 +0,0 @@
-#LyX 1.5.1 created this file. For more info see http://www.lyx.org/
-\lyxformat 276
-\begin_document
-\begin_header
-\textclass mybook
-\begin_preamble
-
-
-
-\usepackage{array}
-
-% This gives us a better font in URL links (otherwise the default
-% MonoSpace font is bitmapped, and it looks horrible in PDF)
-\usepackage{courier}
-
-\usepackage{fullpage}
-
-\usepackage{color} % so we can use red for the fixme warnings
-
-% The hyperref package gives us a pdf with properly built
-% internal navigation ('pdf bookmarks' for the table of contents,
-% internal cross-reference links, web links for URLs, etc.)
-
-% A few colors to replace the defaults for certain link types
-\definecolor{darkorange}{rgb}{.71,0.21,0.01}
-\definecolor{darkgreen}{rgb}{.12,.54,.11}
-
-\usepackage[
- %pdftex, % needed for pdflatex
- breaklinks=true, % so long urls are correctly broken across lines
- colorlinks=true,
- urlcolor=blue,
- linkcolor=darkorange,
- citecolor=darkgreen,
- ]{hyperref}
-
-% This helps prevent overly long lines that stretch beyond the margins
-\sloppy
-
-% Define a \fixme command to mark visually things needing fixing in the draft.
-% For final printing or to simply disable these bright warnings, simply
-% uncomment the \renewcommand redefinition below
-
-\newcommand{\fixme}[1] {
-\textcolor{red}{
-{\fbox{ {\bf FIX}
-\ensuremath{\blacktriangleright \blacktriangleright \blacktriangleright}}
-{\bf #1}
-\fbox{\ensuremath{ \blacktriangleleft \blacktriangleleft \blacktriangleleft }
-} } }
-}
-% Uncomment the next line to make the \fixme command be a no-op
-%\renewcommand{\fixme}[1]{}
-
-%%% If you also want to use the listings package for nicely formatted
-%%% Python source code, this configuration produces good on-paper and
-%%% on-screen results:
-
-\definecolor{orange}{cmyk}{0,0.4,0.8,0.2}
-% Use and configure listings package for nicely formatted code
-\usepackage{listings}
-\lstset{
- language=Python,
- basicstyle=\small\ttfamily,
- commentstyle=\ttfamily\color{blue},
- stringstyle=\ttfamily\color{orange},
- showstringspaces=false,
- breaklines=true,
- postbreak = \space\dots
-}
-\end_preamble
-\language english
-\inputencoding auto
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_default_family default
-\font_sc false
-\font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
-\graphics default
-\paperfontsize 10
-\spacing onehalf
-\papersize custom
-\use_geometry true
-\use_amsmath 2
-\use_esint 0
-\cite_engine basic
-\use_bibtopic false
-\paperorientation portrait
-\paperwidth 7in
-\paperheight 9in
-\leftmargin 1in
-\topmargin 1in
-\rightmargin 1in
-\bottommargin 1in
-\secnumdepth 3
-\tocdepth 3
-\paragraph_separation indent
-\defskip medskip
-\quotes_language english
-\papercolumns 1
-\papersides 1
-\paperpagestyle headings
-\tracking_changes false
-\output_changes false
-\author ""
-\author ""
-\end_header
-
-\begin_body
-
-\begin_layout Standard
-\begin_inset VSpace 2in*
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\align center
-
-\family sans
-\series bold
-\size giant
-Guide to NumPy
-\end_layout
-
-\begin_layout Standard
-\align center
-
-\family sans
-\size larger
-Travis E.
- Oliphant, PhD
-\newline
-August 21, 2008
-\end_layout
-
-\begin_layout Standard
-\begin_inset VSpace vfill
-\end_inset
-
-This book was released from a restricted distribution using a Market-Determined,
- Temporary, Distribution-Restriction (MDTDR) system (see http://www.trelgol.com)
- on August 21, 2008.
- It is now released to the public domain and can be used as source material
- for other works.
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand tableofcontents
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset FloatList table
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Part
-NumPy from Python
-\end_layout
-
-\begin_layout Chapter
-Origins of NumPy
-\end_layout
-
-\begin_layout Quotation
-A complex system that works is invariably found to have evolved from a simple
- system that worked
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-John Gall
-\end_layout
-
-\begin_layout Quotation
-Copy from one, it's plagiarism; copy from two, it's research.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Wilson Mizner
-\end_layout
-
-\begin_layout Standard
-NumPy builds on (and is a successor to) the successful Numeric array object.
- Its goal is to create the corner-stone for a useful environment for scientific
- computing.
- In order to better understand the people surrounding NumPy and (its library-pac
-kage) SciPy, I will explain a little about how SciPy and (current) NumPy
- originated.
- In 1998, as a graduate student studying biomedical imaging at the Mayo
- Clinic in Rochester, MN, I came across Python and its numerical extension
- (Numeric) while I was looking for ways to analyze large data sets for Magnetic
- Resonance Imaging and Ultrasound using a high-level language.
- I quickly fell in love with Python programming which is a remarkable statement
- to make about a programming language.
- If I had not seen others with the same view, I might have seriously doubted
- my sanity.
- I became rather involved in the Numeric Python community, adding the C-API
- chapter to the Numeric documentation (for which Paul Dubois graciously
- made me a co-author).
-
-\end_layout
-
-\begin_layout Standard
-As I progressed with my thesis work, programming in Python was so enjoyable
- that I felt inhibited when I worked with other programming frameworks.
- As a result, when a task I needed to perform was not available in the core
- language, or in the Numeric extension, I looked around and found C or Fortran
- code that performed the needed task, wrapped it into Python (either by
- hand or using SWIG), and used the new functionality in my programs.
-
-\end_layout
-
-\begin_layout Standard
-Along the way, I learned a great deal about the underlying structure of
- Numeric and grew to admire it's simple but elegant structures that grew
- out of the mechanism by which Python allows itself to be extended.
-
-\end_layout
-
-\begin_layout Note
-Numeric was originally written in 1995 based off of an earlier Matrix Object
- design by Jim Fulton which was released in 1994.
- Most of the code was written by Jim Hugunin while he was a graduate student
- at MIT.
- He received help from many people including Jim Fulton, David Ascher, Paul
- Dubois, and Konrad Hinsen.
- These individuals and many others added comments, criticisms, and code
- which helped the Numeric extension reach stability.
- Jim Hugunin did not stay long as an active member of the community ---
- moving on to write Jython and, later, Iron Python.
-\end_layout
-
-\begin_layout Standard
-By operating in this need-it-make-it fashion I ended up with a substantial
- library of extension modules that helped Python + Numeric become easier
- to use in a scientific setting.
- These early modules included raw input-output functions, a special function
- library, an integration library, an ordinary differential equation solver,
- some least-squares optimizers, and sparse matrix solvers.
- While I was doing this laborious work, Pearu Peterson noticed that a lot
- of the routines I was wrapping were written in Fortran, and there was no
- simplified wrapping mechanism for Fortran subroutines (like SWIG for C).
- He began the task of writing f2py which made it possible to easily wrap
- Fortran programs into Python.
- I helped him a little bit, mostly with testing and contributing early function-
-call-back code, but he put forth the brunt of the work.
- His result was simply amazing to me.
- I've always been impressed with f2py, especially because I knew how much
- effort writing and maintaining extension modules could be.
- Anybody serious about scientific computing with Python will appreciate
- that f2py is distributed along with NumPy.
-\end_layout
-
-\begin_layout Standard
-When I finished my Ph.D.
- in 2001, Eric Jones (who had recently completed his Ph.D.
- at Duke) contacted me because he had a collection of Python modules he
- had developed as part of his thesis work as well.
- He wanted to combine his modules with mine into one super package.
- Together with Pearu Peterson we joined our efforts, and SciPy was born
- in 2001.
- Since then, many people have contributed module code to SciPy including
- Ed Schofield, Robert Cimrman, David M.
- Cooke, Charles (Chuck) Harris, Prabhu Ramachandran, Gary Strangman, Jean-Sebast
-ien Roy, and Fernando Perez.
- Others such as Travis Vaught, David Morrill, Jeff Whitaker, and Louis Luangkeso
-rn have contributed testing and build support.
-
-\end_layout
-
-\begin_layout Standard
-At the start of 2005, SciPy was at release 0.3 and relatively stable for
- an early version number.
- Part of the reason it was difficult to stabilize SciPy was that the array
- object upon which SciPy builds was undergoing a bit of an upheaval.
- At about the same time as SciPy was being built, some Numeric users were
- hitting up against the limited capabilities of Numeric.
- In particular, the ability to deal with memory mapped files (and associated
- alignment and swapping issues), record arrays, and altered error checking
- modes were important but limited or non-existent in Numeric.
- As a result, numarray was created by Perry Greenfield, Todd Miller, and
- Rick White at the Space Science Telescope Institute as a replacement for
- Numeric.
- Numarray used a very different implementation scheme as a mix of Python
- classes and C code (which led to slow downs in certain common uses).
- While improving some capabilities, it was slow to pick up on the more advanced
- features of Numeric's universal functions (ufuncs) --- never re-creating
- the C-API that SciPy depended on.
- This made it difficult for SciPy to
-\begin_inset Quotes eld
-\end_inset
-
-convert
-\begin_inset Quotes erd
-\end_inset
-
- to numarray.
-
-\end_layout
-
-\begin_layout Standard
-Many newcomers to scientific computing with Python were told that numarray
- was the future and started developing for it.
- Very useful tools were developed that could not be used with Numeric (because
- of numarray's change in C-API), and therefore could not be used easily
- in SciPy.
- This state of affairs was very discouraging for me personally as it left
- the community fragmented.
- Some developed for numarray, others developed as part of SciPy.
- A few people even rejected adopting Python for scientific computing entirely
- because of the split.
- In addition, I estimate that quite a few Python users simply stayed away
- from both SciPy and numarray, leaving the community smaller than it could
- have been given the number of people that use Python for science and engineerin
-g purposes.
-
-\end_layout
-
-\begin_layout Standard
-It should be recognized that the split was not intentional, but simply an
- outgrowth of the different and exacting demands of scientific computing
- users.
- My describing these events should not be construed as assigning blame to
- anyone.
- I very much admire and appreciate everyone I've met who is involved with
- scientific computing and Python.
- Using a stretched biological metaphor, it is only through the process of
- dividing and merging that better results are born.
- I think this concept applies to NumPy.
-\end_layout
-
-\begin_layout Standard
-In early 2005, I decided to begin an effort to help bring the diverging
- community together under a common framework if it were possible.
- I first looked at numarray to see what could be done to add the missing
- features to make SciPy work with it as a core array object.
- After a couple of days of studying numarray, I was not enthusiastic about
- this approach.
- My familiarity with the Numeric code base no doubt biased my opinion, but
- it seemed to me that the features of Numarray could be added back to Numeric
- with a few fundamental changes to the core object.
- This would make the transition of SciPy to a more enhanced array object
- much easier in my mind.
-
-\end_layout
-
-\begin_layout Standard
-Therefore, I began to construct this hybrid array object complete with an
- enhanced set of universal (broadcasting) functions that could deal with
- it.
- Along the way, quite a few new features and significant enhancements were
- added to the array object and its surrounding infrastructure.
- This book describes the result of that year-and-a-half-long effort which
- culminated with the release of NumPy 0.9.2 in early 2006 and NumPy 1.0 in
- late 2006.
- I first named the new package, SciPy Core, and used the scipy namespace.
- However, after a few months of testing under that name, it became clear
- that a separate namespace was needed for the new package.
- As a result, a rapid search for a new name resulted in actually coming
- back to the NumPy name which was the unofficial name of Numerical Python
- but never the actual namespace.
- Because the new package builds on the code-base of and is a successor to
- Numeric, I think the NumPy name is fitting and hopefully not too confusing
- to new users.
-\end_layout
-
-\begin_layout Standard
-This book only briefly outlines some of the infrastructure that surrounds
- the basic objects in NumPy to provide the additional functionality contained
- in the older Numeric package (
-\emph on
-i.e.
-
-\emph default
- LinearAlgebra, RandomArray, FFT).
- This infrastructure in NumPy includes basic linear algebra routines, Fourier
- transform capabilities, and random number generators.
- In addition, the f2py module is described in its own documentation, and
- so is only briefly mentioned in the second part of the book.
- There are also extensions to the standard Python distutils and testing
- frameworks included with NumPy that are useful in constructing your own
- packages built on top of NumPy.
- The central purpose of this book, however, is to describe and document
- the basic NumPy system that is available under the numpy namespace.
-\end_layout
-
-\begin_layout Note
-The numpy namespace includes all names under the numpy.core and numpy.lib
- namespaces as well.
- Thus,
-\family typewriter
-import numpy
-\family default
- will also import the names from numpy.core and numpy.lib.
- This is the recommended way to use numpy.
-\end_layout
-
-\begin_layout Standard
-The following table gives a brief outline of the sub-packages contained
- in numpy package.
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="9" columns="3">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="1in">
-<column alignment="center" valignment="top" leftline="true" width="2in">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="2in">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Package
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Purpose
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Comments
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-core
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-basic objects
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-all names exported to numpy
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-lib
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-additional utilities
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-all names exported to numpy
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-linalg
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-basic linear algebra
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-old LinearAlgebra from Numeric
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-fft
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-discrete Fourier transforms
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-old FFT from Numeric
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-random
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-random number generators
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-old RandomArray from Numeric
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-distutils
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-enhanced build and distribution
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-improvements built on standard distutils
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-testing
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-unit-testing
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-utility functions useful for testing
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-f2py
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-automatic wrapping of Fortran code
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-a useful utility needed by SciPy
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Chapter
-Object Essentials
-\end_layout
-
-\begin_layout Quotation
-Our programs last longer if we manage to build simple abstractions for ourselves...
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Ron Jeffries
-\end_layout
-
-\begin_layout Quotation
-I will tell you the truth as soon as I figure it out.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Wayne Birmingham
-\end_layout
-
-\begin_layout Standard
-NumPy provides two fundamental objects: an N-dimensional array object (
-\family typewriter
-ndarray
-\family default
-) and a universal function object (
-\family typewriter
-ufunc
-\family default
-).
- In addition, there are other objects that build on top of these which you
- may find useful in your work, and these will be discussed later.
- The current chapter will provide background information on just the
-\family typewriter
-ndarray
-\family default
- and the
-\family typewriter
-ufunc
-\family default
- that will be important for understanding the attributes and methods to
- be discussed later.
-
-\end_layout
-
-\begin_layout Standard
-An N-dimensional array is a homogeneous collection of
-\begin_inset Quotes eld
-\end_inset
-
-items
-\begin_inset Quotes erd
-\end_inset
-
- indexed using
-\begin_inset Formula $N$
-\end_inset
-
- integers.
- There are two essential pieces of information that define an
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array: 1) the shape of the array, and 2) the kind of item the
- array is composed of.
- The shape of the array is a tuple of
-\begin_inset Formula $N$
-\end_inset
-
- integers (one for each dimension) that provides information on how far
- the index can vary along that dimension.
- The other important information describing an array is the kind of item
- the array is composed of.
- Because every
-\family typewriter
-ndarray
-\family default
- is a homogeneous collection of exactly the same data-type, every item takes
- up the same size block of memory, and each block of memory in the array
- is interpreted in exactly the same way
-\begin_inset Foot
-status open
-
-\begin_layout Standard
-By using OBJECT arrays, one can effectively have heterogeneous arrays, but
- the system still sees each element of the array as exactly the same thing
- (a reference to a Python object).
-\end_layout
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Tip
-All arrays in NumPy are indexed starting at 0 and ending at M-1 following
- the Python convention.
-\end_layout
-
-\begin_layout Standard
-For example, consider the following piece of code:
-\end_layout
-
-\begin_layout MyCode
->>> a = array([[1,2,3],[4,5,6]])
-\newline
->>> a.shape
-\newline
-(2, 3)
-\newline
->>> a.dtype
-\newline
-dtype('int32')
-\end_layout
-
-\begin_layout Note
-for all code in this book it is assumed that you have first entered
-\family typewriter
-from numpy import *
-\family default
-.
- In addition, any previously defined arrays are still defined for subsequent
- examples.
-\end_layout
-
-\begin_layout Standard
-This code defines an array of size
-\begin_inset Formula $2\times3$
-\end_inset
-
- composed of 4-byte (little-endian) integer elements (on my 32-bit platform).
- We can index into this two-dimensional array using two integers: the first
- integer running from 0 to 1 inclusive and the second from 0 to 2 inclusive.
- For example, index
-\begin_inset Formula $\left(1,1\right)$
-\end_inset
-
- selects the element with value 5:
-\end_layout
-
-\begin_layout MyCode
->>> a[1,1]
-\newline
-5
-\end_layout
-
-\begin_layout Standard
-All code shown in the shaded-boxes in this book has been (automatically)
- executed on a particular version of NumPy.
- The output of the code shown below shows which version of NumPy was used
- to create all of the output in your copy of this book.
-\end_layout
-
-\begin_layout MyCode
->>> import numpy; print numpy.__version__
-\newline
-1.0.2.dev3478
-\end_layout
-
-\begin_layout Section
-Data-Type Descriptors
-\end_layout
-
-\begin_layout Standard
-In NumPy, an ndarray is an
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array of items where each item takes up a fixed number of bytes.
- Typically, this fixed number of bytes represents a number (
-\emph on
-e.g.
-
-\emph default
- integer or floating-point).
- However, this fixed number of bytes could also represent an arbitrary record
- made up of any collection of other data types.
- NumPy achieves this flexibility through the use of a data-type (dtype)
- object.
- Every array has an associated dtype object which describes the layout of
- the array data.
- Every dtype
-\begin_inset LatexCommand index
-name "dtype"
-
-\end_inset
-
- object, in turn, has an associated Python type-object that determines exactly
- what type of Python object is returned when an element of the array is
- accessed.
- The dtype objects are flexible enough to contain references to arrays of
- other dtype objects and, therefore, can be used to define nested records.
- This advanced functionality will be described in better detail later as
- it is mainly useful for the recarray (record array) subclass that will
- also be defined later.
- However, all ndarrays can enjoy the flexibility provided by the dtype objects.
- Figure
-\begin_inset LatexCommand ref
-reference "cap:Conceptual-diagram-showing"
-
-\end_inset
-
- provides a conceptual diagram showing the relationship between the ndarray,
- its associated data-type object, and an array-scalar that is returned when
- a single-element of the array is accessed.
- Note that the data-type points to the type-object of the array scalar
-\begin_inset LatexCommand index
-name "array scalars"
-
-\end_inset
-
-.
- An array scalar is returned using the type-object and a particular element
- of the ndarray.
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float figure
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\align center
-\begin_inset Graphics
- filename Figures/threefundamental.eps
- width 90text%
- keepAspectRatio
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "cap:Conceptual-diagram-showing"
-
-\end_inset
-
-Conceptual diagram showing the relationship between the three fundamental
- objects used to describe the data in an array: 1) the ndarray itself, 2)
- the data-type object that describes the layout of a single fixed-size element
- of the array, 3) the array-scalar Python object that is returned when a
- single element of the array is accessed.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Every dtype object is based on one of 21 built-in dtype objects.
- These built-in objects allow numeric operations on a wide-variety of integer,
- floating-point, and complex data types.
- Associated with each data-type is a Python type object whose instances
- are array scalars.
- This type-object can be obtained using the
-\family typewriter
-type
-\family default
- attribute of the dtype object.
- Python typically defines only one data-type of a particular data class
- (one integer type, one floating-point type, etc.).
- This can be convenient for some applications that don't need to be concerned
- with all the ways data can be represented in a computer.
- For scientific applications, however, this is not always true.
- As a result, in NumPy, their are 21 different fundamental Python data-type-desc
-riptor objects built-in.
- These descriptors are mostly based on the types available in the C language
- that CPython is written in.
- However, there are a few types that are extremely flexible, such as
-\family typewriter
-str_
-\family default
-,
-\family typewriter
-unicode_
-\family default
-, and
-\family typewriter
-void
-\family default
-.
-\end_layout
-
-\begin_layout Standard
-The fundamental data-types are shown in Table
-\begin_inset LatexCommand ref
-reference "cap:Fundamental-Data-Types"
-
-\end_inset
-
-.
- Along with their (mostly) C-derived names, the integer, float, and complex
- data-types are also available using a bit-width convention so that an array
- of the right size can always be ensured (
-\emph on
-e.g.
-
-\emph default
- int8, float64, complex128).
- The C-like names are also accessible using a character code which is also
- shown in the table (use of the character codes, however, is discouraged).
- Names for the data types that would clash with standard Python object names
- are followed by a trailing underscore, '_'.
- These data types are so named because they use the same underlying precision
- as the corresponding Python data types.
- Most scientific users should be able to use the array-enhanced scalar objects
- in place of the Python objects.
- The array-enhanced scalars inherit from the Python objects they can replace
- and should act like them under all circumstances (except for how errors
- are handled in math computations).
-
-\end_layout
-
-\begin_layout Tip
-The array types
-\series bold
-bool
-\series default
-_,
-\series bold
-int
-\series default
-_,
-\series bold
-complex
-\series default
-_,
-\series bold
-float
-\series default
-_,
-\series bold
-object
-\series default
-_,
-\series bold
-unicode
-\series default
-_, and
-\series bold
-str_
-\series default
- are enhanced-scalars.
- They are very similar to the standard Python types (without the trailing
- underscore) and inherit from them (except for bool_ and object_).
- They can be used in place of the standard Python types whenever desired.
- Whenever a data type is required, as an argument, the standard Python types
- are recognized as well.
-\end_layout
-
-\begin_layout Standard
-Three of the data types are flexible in that they can have items that are
- of an arbitrary size: the
-\family typewriter
-str_
-\family default
- type, the
-\family typewriter
-unicode_
-\family default
- type, and the
-\family typewriter
-void
-\family default
- type.
- While, you can specify an arbitrary size for these types, every item in
- an array is still of that specified size.
- The void type, for example, allows for arbitrary records to be defined
- as elements of the array, and can be used to define exotic types built
- on top of the basic
-\family typewriter
-ndarray
-\family default
-.
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float table
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "cap:Fundamental-Data-Types"
-
-\end_inset
-
-Built-in array-scalar types corresponding to data-types for an ndarray.
- The bold-face types correspond to standard Python types.
- The object_ type is special because arrays with dtype='O' do not return
- an array scalar on item access but instead return the actual object referenced
- in the array.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="24" columns="3">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Type
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Bit-Width
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Character
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-bool_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-boolXX
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'?'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-byte
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-intXX
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'b'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-short
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'h'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-intc
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'i'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-int_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'l'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-longlong
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'q'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-intp
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'p'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-ubyte
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-uintXX
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'B'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-ushort
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'H'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-uintc
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'I'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-uint
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'L'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-ulonglong
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'Q'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-uintp
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'P'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-single
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-floatXX
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'f'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-float_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'d'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-longfloat
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'g'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-csingle
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-complexXX
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'F'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-complex_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'D'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-clongfloat
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'G'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-object_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'O'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-str_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'S#'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-unicode_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'U#'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-void
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family typewriter
-'V#'
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Note
-The two types
-\family typewriter
-intp
-\family default
- and
-\family typewriter
-uintp
-\family default
- are not separate types.
- They are names bound to a specific integer type just large enough to hold
- a memory address (a pointer) on the platform.
-\end_layout
-
-\begin_layout Warning
-Numeric Compatibility: If you used old typecode characters in your Numeric
- code (which was never recommended), you will need to change some of them
- to the new characters.
- In particular, the needed changes are 'c->'S1', 'b'->'B', '1'->'b', 's'->'h',
- 'w'->'H', and 'u'->'I'.
- These changes make the typecharacter convention more consistent with other
- Python modules such as the struct module.
-\end_layout
-
-\begin_layout Standard
-The fundamental data-types are arranged into a hierarchy of Python type-objects
- shown in Figure
-\begin_inset LatexCommand ref
-reference "cap:Hierarchy-of-type"
-
-\end_inset
-
-.
- Each of the leaves on this hierarchy correspond to actual data-types that
- arrays can have (in other words, there is a built in dtype object associated
- with each of these new types).
- They also correspond to new Python objects that can be created.
- These new objects are
-\begin_inset Quotes eld
-\end_inset
-
-scalar
-\begin_inset Quotes erd
-\end_inset
-
- types corresponding to each fundamental data-type.
- Their purpose is to smooth out the rough edges that result when mixing
- scalar and array operations.
- These scalar objects will be discussed in more detail in Chapter
-\begin_inset LatexCommand ref
-reference "cha:Scalar-objects"
-
-\end_inset
-
-.
- The other types in the hierarchy define particular categories of types.
- These categories can be useful for testing whether or not the object returned
- by
-\family typewriter
-self.dtype.type
-\family default
- is of a particular class (using
-\family typewriter
-issubclass
-\family default
-).
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float figure
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\align center
-\begin_inset Graphics
- filename Figures/hierarchy.eps
- lyxscale 75
- width 95text%
- keepAspectRatio
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "cap:Hierarchy-of-type"
-
-\end_inset
-
-Hierarchy of type objects representing the array data types.
- Not shown are the two integer types
-\family typewriter
-intp
-\family default
- and
-\family typewriter
-uintp
-\family default
- which just point to the integer type that holds a pointer for the platform.
- All the number types can be obtained using bit-width names as well.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Basic indexing (slicing)
-\end_layout
-
-\begin_layout Standard
-Indexing
-\begin_inset LatexCommand index
-name "indexing"
-
-\end_inset
-
- is a powerful tool in Python and NumPy takes full advantage of this power.
- In fact, some of capabilities of Python's indexing were first established
- by the needs of Numeric users.
-\begin_inset Foot
-status open
-
-\begin_layout Standard
-For example, the ability to index with a comma separated list of objects
- and have it correspond to indexing with a tuple is a feature added to Python
- at the request of the NumPy community.
- The Ellipsis object was also added to Python explicitly for the NumPy community.
- Extended slicing (wherein a step can be provided) was also a feature added
- to Python because of Numeric.
-\end_layout
-
-\end_inset
-
- Indexing is also sometimes called slicing in Python, and slicing for an
-
-\family typewriter
-ndarray
-\family default
- works very similarly as it does for other Python sequences.
- There are three big differences: 1) slicing can be done over multiple dimension
-s, 2) exactly one ellipsis object can be used to indicate several dimensions
- at once, 3) slicing cannot be used to expand the size of an array (unlike
- lists).
-\end_layout
-
-\begin_layout Standard
-A few examples should make slicing more clear.
- Suppose
-\begin_inset Formula $A$
-\end_inset
-
- is a
-\begin_inset Formula $10\times20$
-\end_inset
-
- array, then
-\begin_inset Formula $A[3]$
-\end_inset
-
- is the same as
-\begin_inset Formula $A[3,:]$
-\end_inset
-
- and represents the 4th length-20
-\begin_inset Quotes eld
-\end_inset
-
-row
-\begin_inset Quotes erd
-\end_inset
-
- of the array.
- On the other hand,
-\begin_inset Formula $A[:,3]$
-\end_inset
-
- represents the 4th length-10
-\begin_inset Quotes eld
-\end_inset
-
-column
-\begin_inset Quotes erd
-\end_inset
-
- of the array.
- Every third element of the 4th column can be selected as
-\begin_inset Formula $A[::3,3]$
-\end_inset
-
-.
- Ellipses can be used to replace zero or more
-\begin_inset Quotes eld
-\end_inset
-
-:
-\begin_inset Quotes erd
-\end_inset
-
- terms.
- In other words, an Ellipsis
-\begin_inset LatexCommand index
-name "Ellipsis"
-
-\end_inset
-
- object expands to zero or more full slice objects (
-\begin_inset Quotes eld
-\end_inset
-
-:
-\begin_inset Quotes erd
-\end_inset
-
-) so that the total number of dimensions in the slicing tuple matches the
- number of dimensions in the array.
- Thus, if
-\begin_inset Formula $A$
-\end_inset
-
- is
-\begin_inset Formula $10\times20\times30\times40$
-\end_inset
-
-, then
-\begin_inset Formula $A[3:,...,4]$
-\end_inset
-
- is equivalent to
-\begin_inset Formula $A[3:,:,:,4]$
-\end_inset
-
- while
-\begin_inset Formula $A[...,3]$
-\end_inset
-
- is equivalent to
-\begin_inset Formula $A[:,:,:,3].$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-The following code illustrates some of these concepts:
-\end_layout
-
-\begin_layout MyCode
->>> a = arange(60).reshape(3,4,5); print a
-\newline
-[[[ 0 1 2 3 4]
-\newline
- [ 5 6 7
- 8 9]
-\newline
- [10 11 12 13 14]
-\newline
- [15 16 17 18 19]]
-\newline
-
-\newline
- [[20 21 22 23 24]
-\newline
- [25 26 27
- 28 29]
-\newline
- [30 31 32 33 34]
-\newline
- [35 36 37 38 39]]
-\newline
-
-\newline
- [[40 41 42 43 44]
-\newline
- [45 46 47
- 48 49]
-\newline
- [50 51 52 53 54]
-\newline
- [55 56 57 58 59]]]
-\end_layout
-
-\begin_layout Standard
-\InsetSpace ~
-
-\end_layout
-
-\begin_layout MyCode
->>> print a[...,3]
-\newline
-[[ 3 8 13 18]
-\newline
- [23 28 33 38]
-\newline
- [43 48 53 58]]
-\newline
->>> print a[1,...,3]
-\newline
-[23
- 28 33 38]
-\newline
->>> print a[:,:,2]
-\newline
-[[ 2 7 12 17]
-\newline
- [22 27 32 37]
-\newline
- [42 47 52 57]]
-\newline
->>>
- print a[0,::2,::2]
-\newline
-[[ 0 2 4]
-\newline
- [10 12 14]]
-\end_layout
-
-\begin_layout Section
-Memory Layout of
-\family typewriter
-ndarray
-\end_layout
-
-\begin_layout Standard
-On a fundamental level, an
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array object is just a one-dimensional sequence of memory with
- fancy indexing code that maps an
-\begin_inset Formula $N$
-\end_inset
-
--dimensional index into a one-dimensional index.
- The one-dimensional index is necessary on some level because that is how
- memory is addressed in a computer.
- The fancy indexing, however, can be very helpful for translating our ideas
- into computer code.
- This is because many concepts we wish to model on a computer have a natural
- representation as an
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array.
- While this is especially true in science and engineering, it is also applicable
- to many other arenas which can be appreciated by considering the popularity
- of the spreadsheet as well as
-\begin_inset Quotes eld
-\end_inset
-
-image processing
-\begin_inset Quotes erd
-\end_inset
-
- applications.
-\end_layout
-
-\begin_layout Warning
-Some high-level languages give pre-eminence to a particular use of 2-dimensional
- arrays as Matrices.
- In NumPy, however, the core object is the more general
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array.
- NumPy defines a matrix object as a sub-class of the N-dimensional array.
-
-\end_layout
-
-\begin_layout Standard
-In order to more fully understand the array object along with its attributes
- and methods it is important to learn more about how an
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array is represented in the computer's memory.
- A complete understanding of this layout is only essential for optimizing
- algorithms operating on general purpose arrays.
- But, even for the casual user, a general understanding of memory layout
- will help to explain the use of certain array attributes that may otherwise
- be mysterious.
-
-\end_layout
-
-\begin_layout Subsection
-Contiguous Memory Layout
-\end_layout
-
-\begin_layout Standard
-There is a fundamental ambiguity in how the mapping to a one-dimensional
- index can take place which is illustrated for a 2-dimensional array in
- Figure
-\begin_inset LatexCommand ref
-reference "cap:Options-for-memory"
-
-\end_inset
-
-.
- In that figure, each block represents a chunk of memory that is needed
- for representing the underlying array element.
- For example, each block could represent the 8 bytes needed to represent
- a double-precision floating point number.
-
-\end_layout
-
-\begin_layout Standard
-In the figure, two arrays are shown, a
-\begin_inset Formula $4x3$
-\end_inset
-
- array and a
-\begin_inset Formula $3x4$
-\end_inset
-
- array.
- Each of these arrays takes 12 blocks of memory shown as a single, contiguous
- segment.
- How this memory is used to form the abstract 2-dimensional array can vary,
- however, and the
-\family typewriter
-ndarray
-\family default
- object supports both styles.
- Which style is in use can be interrogated by the use of the flags attribute
- which returns a dictionary of the state of array flags.
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float figure
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\align center
-\begin_inset Graphics
- filename Figures/contiguous.eps
- width 85text%
- keepAspectRatio
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "cap:Options-for-memory"
-
-\end_inset
-
-Options for memory layout of a 2-dimensional array.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-In the C-style of
-\begin_inset Formula $N$
-\end_inset
-
--dimensional indexing shown on the left of Figure
-\begin_inset LatexCommand ref
-reference "cap:Options-for-memory"
-
-\end_inset
-
- the last
-\begin_inset Formula $N$
-\end_inset
-
--dimensional index
-\begin_inset Quotes eld
-\end_inset
-
-varies the fastest.
-\begin_inset Quotes erd
-\end_inset
-
- In other words, to move through computer memory sequentially, the last
- index is incremented first, followed by the second-to-last index and so
- forth.
- Some of the algorithms in NumPy that deal with
-\begin_inset Formula $N$
-\end_inset
-
--dimensional arrays work best with this kind of data.
-
-\end_layout
-
-\begin_layout Standard
-In the Fortran-style of
-\begin_inset Formula $N$
-\end_inset
-
--dimensional indexing shown on the right of Figure
-\begin_inset LatexCommand ref
-reference "cap:Options-for-memory"
-
-\end_inset
-
-, the first
-\begin_inset Formula $N$
-\end_inset
-
--dimensional index
-\begin_inset Quotes eld
-\end_inset
-
-varies the fastest.
-\begin_inset Quotes erd
-\end_inset
-
- Thus, to move through computer memory sequentially, the first index is
- incremented first until it reaches the limit in that dimension, then the
- second index is incremented and the first index is reset to zero.
- While NumPy can be compiled without the use of a Fortran compiler, several
- modules of SciPy (available separately) rely on underlying algorithms written
- in Fortran.
- Algorithms that work on
-\begin_inset Formula $N$
-\end_inset
-
--dimensional arrays that are written in Fortran typically expect Fortran-style
- arrays.
-
-\end_layout
-
-\begin_layout Standard
-The two-styles of memory layout for arrays are connected through the transpose
- operation.
- Thus, if
-\begin_inset Formula $A$
-\end_inset
-
- is a (contiguous) C-style array, then the same block of memory can be used
- to represent
-\begin_inset Formula $A^{T}$
-\end_inset
-
- as a (contiguous) Fortran-style array.
- This kind of understanding can be useful when trying to optimize the wrapping
- of Fortran subroutines, or if a more detailed understanding of how to write
- algorithms for generally-indexed arrays is desired.
- But, fortunately, the casual user who does not care if an array is copied
- occasionally to get it into the right orientation needed for a particular
- algorithm can forget about how the array is stored in memory and just visualize
- it as an
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array (that is, after all, the whole point of creating the
-
-\family typewriter
-ndarray
-\family default
- object in the first place).
-
-\end_layout
-
-\begin_layout Subsection
-Non-contiguous memory layout
-\end_layout
-
-\begin_layout Standard
-Both of the examples presented above are
-\emph on
-single-segment
-\begin_inset LatexCommand index
-name "single-segment"
-
-\end_inset
-
-
-\emph default
- arrays where the entire array is visited by sequentially marching through
- memory one element at a time.
- When an algorithm in C or Fortran expects an N-dimensional array, this
- single segment (of a certain fundamental type) is usually what is expected
- along with the shape
-\begin_inset Formula $N$
-\end_inset
-
--tuple.
- With a single-segment of memory representing the array, the one-dimensional
- index into computer memory can always be computed from the
-\begin_inset Formula $N$
-\end_inset
-
--dimensional index.
- This concept is explored further in the following paragraphs.
-\end_layout
-
-\begin_layout Standard
-Let
-\begin_inset Formula $n_{i}$
-\end_inset
-
- be the value of the
-\begin_inset Formula $i^{\textrm{th}}$
-\end_inset
-
- index into an array whose shape is represented by the
-\begin_inset Formula $N$
-\end_inset
-
- integers
-\begin_inset Formula $d_{i}$
-\end_inset
-
- (
-\begin_inset Formula $i=0\ldots N-1).$
-\end_inset
-
- Then, the one-dimensional index into a C-style contiguous array is
-\begin_inset Formula \[
-n^{C}=\sum_{i=0}^{N-1}n_{i}\prod_{j=i+1}^{N-1}d_{j}\]
-
-\end_inset
-
- while the one-dimensional index into a Fortran-style contiguous array is
-
-\begin_inset Formula \[
-n^{F}=\sum_{i=0}^{N-1}n_{i}\prod_{j=0}^{i-1}d_{j}.\]
-
-\end_inset
-
- In these formulas we are assuming that
-\begin_inset Formula \[
-\prod_{j=k}^{m}d_{j}=d_{k}d_{k+1}\cdots d_{m-1}d_{m}\]
-
-\end_inset
-
-so that if
-\begin_inset Formula $m<k,$
-\end_inset
-
- the product is
-\begin_inset Formula $1.$
-\end_inset
-
- While perfectly general, these formulas may be a bit confusing at first
- glimpse.
- Let's see how they expand out for determining the one-dimensional index
- corresponding to the element
-\begin_inset Formula $\left(1,3,2\right)$
-\end_inset
-
- of a
-\begin_inset Formula $4\times5\times6$
-\end_inset
-
- array.
- If the array is stored as Fortran contiguous, then
-\begin_inset Formula \begin{eqnarray*}
-n^{F} & = & n_{0}\cdot\left(1\right)+n_{1}\cdot(4)+n_{2}\cdot\left(4\cdot5\right)\\
- & = & 1+3\cdot4+2\cdot20=53.\end{eqnarray*}
-
-\end_inset
-
- On the other hand, if the array is stored as C contiguous, then
-\begin_inset Formula \begin{eqnarray*}
-n^{C} & = & n_{0}\cdot\left(5\cdot6\right)+n_{1}\cdot\left(6\right)+n_{2}\cdot\left(1\right)\\
- & = & 1\cdot30+3\cdot6+2\cdot1=50.\end{eqnarray*}
-
-\end_inset
-
- The general pattern should be more clear from these examples.
-
-\end_layout
-
-\begin_layout Standard
-The formulas for the one-dimensional index of the N-dimensional arrays reveal
- what results in an important generalization for memory layout.
- Notice that each formula can be written as
-\begin_inset Formula \[
-n^{X}=\sum_{i=0}^{N-1}n_{i}s_{i}^{X}\]
-
-\end_inset
-
- where
-\begin_inset Formula $s_{i}^{X}$
-\end_inset
-
- gives the
-\emph on
-stride
-\begin_inset LatexCommand index
-name "stride"
-
-\end_inset
-
-
-\emph default
- for dimension
-\begin_inset Formula $i$
-\end_inset
-
-.
-\begin_inset Foot
-status open
-
-\begin_layout Standard
-Our definition of stride here is an element-based stride, while the strides
- attribute returns a byte-based stride.
- The byte-based stride is the element itemsize multiplied by the element-based
- stride.
-\end_layout
-
-\end_inset
-
- Thus, for C and Fortran contiguous arrays respectively we have
-\begin_inset Formula \begin{eqnarray*}
-s_{i}^{C} & = & \prod_{j=i+1}^{N-1}d_{j}=d_{i+1}d_{i+2}\cdots d_{N-1},\\
-s_{i}^{F} & = & \prod_{j=0}^{i-1}d_{j}=d_{0}d_{1}\cdots d_{i-1}.\end{eqnarray*}
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-The stride is how many elements in the underlying one-dimensional layout
- of the array one must jump in order to get to the next array element of
- a specific dimension in the N-dimensional layout.
- Thus, in a C-style
-\begin_inset Formula $4\times5\times6$
-\end_inset
-
- array one must jump over 30 elements to increment the first index by one,
- so 30 is the stride for the first dimension (
-\begin_inset Formula $s_{0}^{C}=30$
-\end_inset
-
-).
- If, for each array, we define a strides tuple with
-\begin_inset Formula $N$
-\end_inset
-
- integers, then we have pre-computed and stored an important piece of how
- to map the
-\begin_inset Formula $N$
-\end_inset
-
--dimensional index to the one-dimensional one used by the computer.
-
-\end_layout
-
-\begin_layout Standard
-In addition to providing a pre-computed table for index mapping, by allowing
- the strides tuple to consist of arbitrary integers we have provided a more
- general layout for the
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array.
- As long as we always use the stride information to move around in the
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array, we can use any convenient layout we wish for the underlying
- representation as long as it is regular enough to be defined by constant
- jumps in each dimension.
- The
-\family typewriter
-ndarray
-\family default
- object of NumPy uses this stride information and therefore the underlying
- memory of an
-\family typewriter
-ndarray
-\family default
- can be laid out dis-contiguously.
-
-\end_layout
-
-\begin_layout Note
-Several algorithms in NumPy work on arbitrarily strided arrays.
- However, some algorithms require single-segment arrays.
- When an irregularly strided array is passed in to such algorithms, a copy
- is automatically made.
-
-\end_layout
-
-\begin_layout Standard
-An important situation where irregularly strided arrays occur is array indexing.
- Consider again Figure
-\begin_inset LatexCommand ref
-reference "cap:Options-for-memory"
-
-\end_inset
-
-.
- In that figure a high-lighted sub-array is shown.
- Define
-\begin_inset Formula $C$
-\end_inset
-
- to be the
-\begin_inset Formula $4\times3$
-\end_inset
-
- C contiguous array and
-\begin_inset Formula $F$
-\end_inset
-
- to be the
-\begin_inset Formula $3\times4$
-\end_inset
-
- Fortran contiguous array.
- The highlighted areas can be written respectively as
-\begin_inset Formula $C$
-\end_inset
-
-[1:3,1:3] and
-\begin_inset Formula $F$
-\end_inset
-
-[1:3,1:3].
- As evidenced by the corresponding highlighted region in the one-dimensional
- view of the memory, these sub-arrays are neither C contiguous nor Fortran
- contiguous.
- However, they can still be represented by an
-\family typewriter
-ndarray
-\family default
- object using the same striding tuple as the original array used.
- Therefore, a regular indexing expression on an
-\family typewriter
-ndarray
-\family default
- can always produce an
-\family typewriter
-ndarray
-\family default
- object
-\emph on
-without
-\emph default
- copying any data.
- This is sometimes referred to as the
-\begin_inset Quotes eld
-\end_inset
-
-view
-\begin_inset Quotes erd
-\end_inset
-
- feature of array indexing, and one can see that it is enabled by the use
- of striding information in the underlying
-\family typewriter
-ndarray
-\family default
- object.
- The greatest benefit of this feature is that it allows indexing to be done
- very rapidly and without exploding memory usage (because no copies of the
- data are made).
-\end_layout
-
-\begin_layout Section
-Universal Functions for arrays
-\end_layout
-
-\begin_layout Standard
-NumPy provides a wealth of mathematical functions that operate on then ndarray
- object.
- From algebraic functions such as addition and multiplication to trigonometric
- functions such as
-\begin_inset Formula $\sin,$
-\end_inset
-
- and
-\begin_inset Formula $\cos$
-\end_inset
-
-.
- Each universal function
-\begin_inset LatexCommand index
-name "universal function"
-
-\end_inset
-
- (
-\family typewriter
-ufunc
-\family default
-
-\begin_inset LatexCommand index
-name "ufunc"
-
-\end_inset
-
-) is an instance of a general class so that function behavior is the same.
- All ufuncs perform element-by-element operations over an array or a set
- of arrays (for multi-input functions).
- The ufuncs themselves and their methods are documented in Part
-\begin_inset LatexCommand ref
-reference "par:The-Ufunc-Object"
-
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Standard
-One important aspect of ufunc behavior that should be introduced early,
- however, is the idea of
-\emph on
-
-\begin_inset LatexCommand index
-name "broadcasting"
-
-\end_inset
-
-broadcasting
-\emph default
-.
- Broadcasting is used in several places throughout NumPy and is therefore
- worth early exposure.
- To understand the idea of broadcasting, you first have to be conscious
- of the fact that all ufuncs are always element-by-element operations.
- In other words, suppose we have a ufunc with two inputs and one output
- (
-\emph on
-e.g.
-
-\emph default
- addition) and the inputs are both arrays of shape
-\begin_inset Formula $4\times6\times5$
-\end_inset
-
-.
- Then, the output is going to be
-\begin_inset Formula $4\times6\times5$
-\end_inset
-
-, and will be the result of applying the underlying function (
-\emph on
-e.g.
-
-\emph default
-
-\begin_inset Formula $+$
-\end_inset
-
-) to each pair of inputs to produce the output at the corresponding
-\begin_inset Formula $N$
-\end_inset
-
--dimensional location.
-
-\end_layout
-
-\begin_layout Standard
-Broadcasting allows ufuncs to deal in a meaningful way with inputs that
- do not have exactly the same shape.
- In particular, the first rule of broadcasting is that if all input arrays
- do not have the same number of dimensions, then a
-\begin_inset Quotes eld
-\end_inset
-
-
-\begin_inset Formula $1$
-\end_inset
-
-
-\begin_inset Quotes erd
-\end_inset
-
- will be repeatedly pre-pended to the shapes of the smaller arrays until
- all the arrays have the same number of dimensions.
- The second rule of broadcasting ensures that arrays with a size of 1 along
- a particular dimension act as if they had the size of the array with the
- largest shape along that dimension.
- The value of the array element is assumed to be the same along that dimension
- for the
-\begin_inset Quotes eld
-\end_inset
-
-broadcasted
-\begin_inset Quotes erd
-\end_inset
-
- array.
- After application of the broadcasting rules, the sizes of all arrays must
- match.
-\end_layout
-
-\begin_layout Standard
-While a little tedious to explain, the broadcasting rules are easy to pick
- up by looking at a couple of examples.
- Suppose there is a
-\family typewriter
-ufunc
-\family default
- with two inputs,
-\begin_inset Formula $A$
-\end_inset
-
- and
-\begin_inset Formula $B$
-\end_inset
-
-.
- Now supposed that
-\begin_inset Formula $A$
-\end_inset
-
- has shape
-\begin_inset Formula $4\times6\times5$
-\end_inset
-
- while
-\begin_inset Formula $B$
-\end_inset
-
- has shape
-\begin_inset Formula $4\times6\times1$
-\end_inset
-
-.
- The ufunc will proceed to compute the
-\begin_inset Formula $4\times6\times5$
-\end_inset
-
- output as if
-\begin_inset Formula $B$
-\end_inset
-
- had been
-\begin_inset Formula $4\times6\times5$
-\end_inset
-
- by assuming that
-\begin_inset Formula $B[...,k]=B[...,0]$
-\end_inset
-
- for
-\begin_inset Formula $k=1,2,3,4$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Standard
-Another example illustrates the idea of adding
-\begin_inset Formula $1$
-\end_inset
-
-'s to the beginning of the array shape-tuple.
- Suppose
-\begin_inset Formula $A$
-\end_inset
-
- is the same as above, but
-\begin_inset Formula $B$
-\end_inset
-
- is a length
-\begin_inset Formula $5$
-\end_inset
-
- array.
- Because of the first rule,
-\begin_inset Formula $B$
-\end_inset
-
- will be interpreted as a
-\begin_inset Formula $1\times1\times5$
-\end_inset
-
- array, and then because of the second rule
-\begin_inset Formula $B$
-\end_inset
-
- will be interpreted as a
-\begin_inset Formula $4\times6\times5$
-\end_inset
-
- array by repeating the elements of
-\begin_inset Formula $B$
-\end_inset
-
- in the obvious way.
-
-\end_layout
-
-\begin_layout Standard
-The most common alteration needed is to route-around the automatic pre-pending
- of 1's to the shape of the array.
- If it is desired, to add
-\begin_inset Formula $1$
-\end_inset
-
-'s to the end of the array shape, then dimensions can always be added using
- the
-\family typewriter
-newaxis
-\family default
- name in NumPy:
-\begin_inset Formula $B[...,\textrm{newaxis, newaxis}]$
-\end_inset
-
- returns an array with 2 additional 1's appended to the shape of
-\begin_inset Formula $B.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-One important aspect of broadcasting is the calculation of functions on
- regularly spaced grids.
- For example, suppose it is desired to show a portion of the multiplication
- table by computing the function
-\begin_inset Formula $a*b$
-\end_inset
-
- on a grid with
-\begin_inset Formula $a$
-\end_inset
-
- running from 6 to 9 and
-\begin_inset Formula $b$
-\end_inset
-
- running from 12 to 16.
- The following code illustrates how this could be done using ufuncs and
- broadcasting.
-
-\end_layout
-
-\begin_layout MyCode
->>> a = arange(6, 10); print a
-\newline
-[6 7 8 9]
-\newline
->>> b = arange(12, 17); print b
-\newline
-[12
- 13 14 15 16]
-\newline
->>> table = a[:,newaxis] * b
-\newline
->>> print table
-\newline
-[[ 72 78 84 90
- 96]
-\newline
- [ 84 91 98 105 112]
-\newline
- [ 96 104 112 120 128]
-\newline
- [108 117 126 135 144]]
-\end_layout
-
-\begin_layout Section
-Summary of new features
-\end_layout
-
-\begin_layout Standard
-More information about using arrays in Python can be found in the old Numeric
- documentation at
-\begin_inset LatexCommand htmlurl
-name "http://numeric.scipy.org"
-target "http://numeric.scipy.org"
-
-\end_inset
-
-.
- Quite a bit of that documentation is still accurate, especially in the
- discussion of array basics.
- There are significant differences, however, and this book seeks to explain
- them in detail.
- The following list tries to summarize the significant new features (over
- Numeric) available in the
-\family typewriter
-ndarray
-\family default
- and
-\family typewriter
-ufunc
-\family default
- objects of NumPy:
-\end_layout
-
-\begin_layout Enumerate
-more data types (all standard C-data types plus complex floats, Boolean,
- string, unicode, and void *);
-\end_layout
-
-\begin_layout Enumerate
-flexible data types where each array can have a different itemsize (but
- all elements of the same array still have the same itemsize);
-\end_layout
-
-\begin_layout Enumerate
-there is a true Python scalar type (contained in a hierarchy of types) for
- every data-type an array can have;
-\end_layout
-
-\begin_layout Enumerate
-data-type objects define the data-type with support for data-type objects
- with fields and subarrays which allow record arrays with nested records;
-\end_layout
-
-\begin_layout Enumerate
-many more array methods in addition to functional counterparts;
-\end_layout
-
-\begin_layout Enumerate
-attributes more clearly distinguished from methods (attributes are intrinsic
- parts of an array so that setting them changes the array itself);
-\end_layout
-
-\begin_layout Enumerate
-array scalars covering all data types which inherit from Python scalars
- when appropriate;
-\end_layout
-
-\begin_layout Enumerate
-arrays can be misaligned, swapped, and in Fortran order in memory (facilitates
- memory-mapped arrays);
-\end_layout
-
-\begin_layout Enumerate
-arrays can be more easily read from text files and created from buffers
- and iterators;
-\end_layout
-
-\begin_layout Enumerate
-arrays can be quickly written to files in text and/or binary mode;
-\end_layout
-
-\begin_layout Enumerate
-arrays support the removal of the 64-bit memory limitation as long as you
- have Python 2.5 or later;
-\end_layout
-
-\begin_layout Enumerate
-fancy indexing can be done on arrays using integer sequences and Boolean
- masks;
-\end_layout
-
-\begin_layout Enumerate
-coercion rules are altered for mixed scalar / array operations so that scalars
- (anything that produces a 0-dimensional array internally) will not determine
- the output type in such cases.
-\end_layout
-
-\begin_layout Enumerate
-when coercion is needed, temporary buffer-memory allocation is limited to
- a user-adjustable size;
-\end_layout
-
-\begin_layout Enumerate
-errors are handled through the IEEE floating point status flags and there
- is flexibility on a per-thread level for handling these errors;
-\end_layout
-
-\begin_layout Enumerate
-one can register an error callback function in Python to handle errors are
- set to 'call' for their error handling;
-\end_layout
-
-\begin_layout Enumerate
-ufunc reduce, accumulate, and reduceat can take place using a different
- type then the array type if desired (without copying the entire array);
-\end_layout
-
-\begin_layout Enumerate
-ufunc output arrays passed in can be a different type than expected from
- the calculation;
-\end_layout
-
-\begin_layout Enumerate
-ufuncs take keyword arguments which can specify 1) the error handling explicitly
- and 2) the specific 1-d loop to use by-passing the type-coercion detection.
-
-\end_layout
-
-\begin_layout Enumerate
-arbitrary classes can be passed through ufuncs (__array_wrap__ and __array_prior
-ity__ expand previous __array__ method);
-\end_layout
-
-\begin_layout Enumerate
-ufuncs can be easily created from Python functions;
-\end_layout
-
-\begin_layout Enumerate
-ufuncs have attributes to detail their behavior, including a dynamic doc
- string that automatically generates the calling signature;
-\end_layout
-
-\begin_layout Enumerate
-several new ufuncs (frexp, modf, ldexp, isnan, isfinite, isinf, signbit);
-\end_layout
-
-\begin_layout Enumerate
-new types can be registered with the system so that specialized ufunc loops
- can be written over new type objects;
-\end_layout
-
-\begin_layout Enumerate
-new types can also register casting functions and rules for fitting into
- the
-\begin_inset Quotes eld
-\end_inset
-
-can-cast
-\begin_inset Quotes erd
-\end_inset
-
- hierarchy;
-\end_layout
-
-\begin_layout Enumerate
-C-API enhanced so that more of the functionality is available from compiled
- code;
-\end_layout
-
-\begin_layout Enumerate
-C-API enhanced so array structure access can take place through macros;
-\end_layout
-
-\begin_layout Enumerate
-new iterator objects created for easy handling in C of non-contiguous arrays;
-\end_layout
-
-\begin_layout Enumerate
-new multi-iterator object created for easy handling in C of broadcasting;
-\end_layout
-
-\begin_layout Enumerate
-types have more functions associated with them (no magic function lists
- in the C-code).
- Any function needed is part of the type structure.
-\end_layout
-
-\begin_layout Standard
-All of these enhancements will be documented more thoroughly in the remaining
- portions of this book.
-\end_layout
-
-\begin_layout Section
-Summary of differences with Numeric
-\end_layout
-
-\begin_layout Standard
-An effort was made to retain backwards compatibility with Numeric all the
- way to the C-level.
- This was mostly accomplished, with a few changes that needed to be made
- for consistency of the new system.
- If you are just starting out with NumPy, then this section may be skipped.
-\end_layout
-
-\begin_layout Standard
-There are two steps (one required and one optional) to converting code that
- works with Numeric to work fully with NumPy The first step uses a compatibility
- layer and requires only small changes which can be handled by the numpy.oldnumer
-ic.alter_code1 module.
- Code written to the compatibility layer will work and be supported.
- The purpose of the compatibility layer is to make it easy to convert to
- NumPy and many codes may only take this first step and work fine with NumPy.
- The second step is optional as it removes dependency on the compatibility
- layer and therefore requires a few more extensive changes.
- Many of these changes can be performed by the numpy.oldnumeric.alter_code2
- module, but you may still need to do some final tweaking by hand.
- Because many users will probably be content to only use the first step,
- the alter_code2 module for second-stage migration may not be as complete
- as it otherwise could be.
-
-\end_layout
-
-\begin_layout Subsection
-First-step changes
-\end_layout
-
-\begin_layout Standard
-In order to use the compatibility layer there are still a few changes that
- need to be made to your code.
- Many of these changes can be made by running the alter_code1 module with
- your code as input.
-
-\end_layout
-
-\begin_layout Enumerate
-Importing (the alter_code1 module handles all these changes)
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-import Numeric --> import numpy.oldnumeric as Numeric
-\end_layout
-
-\begin_layout Enumerate
-import Numeric as XX --> import numpy.oldnumeric as XX
-\end_layout
-
-\begin_layout Enumerate
-from Numeric import <name1>,...<nameN> --> from numpy.oldnumeric import <name1>,...,<na
-meN>
-\end_layout
-
-\begin_layout Enumerate
-from Numeric import * --> from numpy.oldnumeric import *
-\end_layout
-
-\begin_layout Enumerate
-Similar name changes need to be made for Matrix, MLab, UserArray, LinearAlgebra,
- RandomArray RNG, RNG.Statistics, and FFT.
- The new names are numpy.oldnumeric.<pkg> where <pkg> is matrix, mlab, user_array,
- linear_algebra, random_array, rng, rng_stats, and fft.
-
-\end_layout
-
-\begin_layout Enumerate
-multiarray and umath (if you used them directly) are now numpy.core.multiarray
- and numpy.core.umath, but it is more future proof to replace usages of these
- internal modules with numpy.oldnumeric.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Method name changes and methods converted to attributes.
- The alter_code1 module handles all these changes.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-
-\emph on
-arr
-\emph default
-.typecode() -->
-\emph on
-arr
-\emph default
-.dtype.char
-\end_layout
-
-\begin_layout Enumerate
-
-\emph on
-arr
-\emph default
-.iscontiguous() -->
-\emph on
-arr
-\emph default
-.flags.contiguous
-\end_layout
-
-\begin_layout Enumerate
-
-\emph on
-arr
-\emph default
-.byteswapped() -->
-\emph on
-arr
-\emph default
-.byteswap()
-\end_layout
-
-\begin_layout Enumerate
-
-\emph on
-arr
-\emph default
-.toscalar() -->
-\emph on
-arr
-\emph default
-.item()
-\end_layout
-
-\begin_layout Enumerate
-
-\emph on
-arr
-\emph default
-.itemsize() -->
-\emph on
-arr
-\emph default
-.itemsize
-\end_layout
-
-\begin_layout Enumerate
-
-\emph on
-arr
-\emph default
-.spacesaver() eliminated
-\end_layout
-
-\begin_layout Enumerate
-
-\emph on
-arr
-\emph default
-.savespace() eliminated
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Some of the typecode characters have changed to be more consistent with
- other Python modules (array and struct).
- You should only notice this change if you used the actual typecode characters
- (instead of the named constants).
-
-\newline
-The alter_code1 module will change uses of 'b' to 'B' for internal Numeric
- functions that it knows about because NumPy will interpret 'b' to mean
- a signed byte type (instead of the old unsigned).
- It will also change the character codes when they are used explicitly in
- the .astype method.
- In the compatibility layer (and only in the compatibility layer), typecode-requ
-iring function calls (
-\emph on
-e.g.
-
-\emph default
- zeros, array) understand the old typecode characters.
-
-\newline
-The changes are (Numeric --> NumPy):
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-'b' --> 'B'
-\end_layout
-
-\begin_layout Enumerate
-'1' --> 'b'
-\end_layout
-
-\begin_layout Enumerate
-'s' --> 'h'
-\end_layout
-
-\begin_layout Enumerate
-'w' --> 'H'
-\end_layout
-
-\begin_layout Enumerate
-'u' --> 'I'
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-
-\emph on
-arr.
-\emph default
-flat now returns an indexable 1-D iterator.
- This behaves correctly when passed to a function, but if you expected methods
- or attributes on
-\emph on
-arr.
-\emph default
-flat --- besides .copy() --- then you will need to replace
-\emph on
-arr
-\emph default
-.flat with
-\emph on
-arr.
-\emph default
-ravel() (copies only when necessary) or
-\emph on
-arr.
-\emph default
-flatten() (always copies).
- The alter_code1 module will change
-\emph on
-arr
-\emph default
-.flat to
-\emph on
-arr
-\emph default
-.ravel() unless you used the construct
-\emph on
-arr
-\emph default
-.flat = obj or
-\emph on
-arr
-\emph default
-.flat[ind].
-\end_layout
-
-\begin_layout Enumerate
-If you used type-equality testing on the objects returned from arrays, then
- you need to change this to isinstance testing.
- Thus type(a[0]) is float or type(a[0]) == float should be changed to isinstance
-(a[0], float).
- This is because array scalar objects are now returned from arrays.
- These inherit from the Python scalars where they can, but define their
- own methods and attributes.
- This conversion is done by alter_code1 for the types (float, int, complex,
- and ArrayType)
-\end_layout
-
-\begin_layout Enumerate
-If your code should produce 0-d arrays.
- These no-longer have a length as they should be interpreted similarly to
- real scalars which don't have a length.
-
-\end_layout
-
-\begin_layout Enumerate
-Arrays cannot be tested for truth value unless they are empty (returns False)
- or have only one element.
- This means that if Z: where Z is an array will fail (unless Z is empty
- or has only one element).
- Also the 'and' and 'or' operations (which test for object truth value)
- will also fail on arrays of more than one element.
- Use the .any() and .all() methods to test for truth value of an array.
-
-\end_layout
-
-\begin_layout Enumerate
-Masked arrays return a special nomask object instead of None when there
- is no mask on the array for the functions getmask and attribute access
-
-\emph on
-arr
-\emph default
-.mask
-\end_layout
-
-\begin_layout Enumerate
-Masked array functions have a default axis of None (meaning ravel), make
- sure to specify an axis if your masked arrays are larger than 1-d.
-
-\end_layout
-
-\begin_layout Enumerate
-If you used the construct
-\family typewriter
-arr.shape=<tuple>
-\family default
-, this will not work for array scalars (which can be returned from array
- operations).
- You cannot set the shape of an array-scalar (you can read it though).
- As a result, for more general code you should use
-\family typewriter
-arr=arr.reshape(<tuple>)
-\family default
- which works for both array-scalars and arrays.
-
-\end_layout
-
-\begin_layout Standard
-The alter_code1 script should handle the changes outlined in steps 1-5 above.
- The final incompatibilities in 6-9 are less common and must be modified
- by hand if necessary.
-
-\end_layout
-
-\begin_layout Subsection
-Second-step changes
-\end_layout
-
-\begin_layout Standard
-During the second phase of migration (should it be necessary) the compatibility
- layer is dropped.
- This phase requires additional changes to your code.
- There is another conversion module (alter_code2) which can help but it
- is not complete.
- The changes required to drop dependency on the compatibility layer are
-\end_layout
-
-\begin_layout Enumerate
-Importing
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-numpy.oldnumeric --> numpy
-\end_layout
-
-\begin_layout Enumerate
-from numpy.oldnumeric import * --> from numpy import * (this may clobber
- more names and therefore require further fixes to your code but then you
- didn't do this regularly anyway did you).
- The recommended procedure if this replacement causes problems is to fix
- the use of from numpy.oldnumeric import * to extract only the required names
- and then continue.
-\end_layout
-
-\begin_layout Enumerate
-numpy.oldnumeric.mlab --> None, the functions come from other places.
-\end_layout
-
-\begin_layout Enumerate
-numpy.oldnumeric.linear_algebra --> numpy.lilnalg with name changes to the
- functions (made lower case and shorter).
-\end_layout
-
-\begin_layout Enumerate
-numpy.oldnumeric.random_array --> numpy.random with some name changes to the
- functions.
-\end_layout
-
-\begin_layout Enumerate
-numpy.oldnumeic.fft --> numpy.fft with some name changes to the functions.
-\end_layout
-
-\begin_layout Enumerate
-numpy.oldnumeric.rng --> None
-\end_layout
-
-\begin_layout Enumerate
-numpy.oldnumeric.rng_stats --> None
-\end_layout
-
-\begin_layout Enumerate
-numpy.oldnumeric.user_array --> numpy.lib.user_array
-\end_layout
-
-\begin_layout Enumerate
-numpy.oldnumeric.matrix --> numpy
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-The typecode names are all lower-case and refer to type-objects corresponding
- to array scalars.
- The character codes are understood by array-creation functions but are
- not given names.
- All named type constants should be replaced with their lower-case equivalents.
- Also, the old character codes '1', 's', 'w', and 'u' are not understood
- as data-types.
- It is probably easiest to manually replace these with Int8, Int16, UInt16,
- and UInt32 and let the alter_code2 script convert the names to lower-case
- typeobjects.
-
-\end_layout
-
-\begin_layout Enumerate
-Keyword and argument changes
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-All
-\family typewriter
-typecode=
-\family default
- keywords must be changed to
-\family typewriter
-dtype=
-\family default
-.
-
-\end_layout
-
-\begin_layout Enumerate
-The
-\family typewriter
-savespace
-\family default
- keyword argument has been removed from all functions where it was present
- (array, sarray, asarray, ones, and zeros).
- The sarray function is equivalent to asarray.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-The default data-type in NumPy is float unlike in Numeric (and numpy.oldnumeric)
- where it was int.
- There are several functions affected by this so that if your code was relying
- on the default data-type, then it must be changed to explicitly add dtype=int.
-\end_layout
-
-\begin_layout Enumerate
-The nonzero function in NumPy returns a tuple of index arrays just like
- the corresponding method.
- There is a flatnonzero function that first ravels the array and then returns
- a single index array.
- This function should be interchangeable with the old use of nonzero.
-
-\end_layout
-
-\begin_layout Enumerate
-The default axis is None (instead of 0) to match the methods for the functions
- take, repeat, sum, average, product, sometrue, alltrue, cumsum, and cumproduct
- (from Numeric) and also for the functions average, max, min, ptp, prod,
- std, and mean (from MLab).
-\end_layout
-
-\begin_layout Enumerate
-The default axis is None (instead of -1) to match the methods for the functions
- argmin, argmax, compress
-\end_layout
-
-\begin_layout Subsection
-Updating code that uses Numeric using alter_codeN
-\end_layout
-
-\begin_layout Standard
-Despite the long list of changes that might be needed given above, it is
- likely that your code does not use any of the incompatible corners and
- it should not be too difficult to convert from Numeric to NumPy.
- For example all of SciPy was converted in about 2-3 days.
- The needed changes are largely search-and replace type changes, and the
- alter_codeN modules can help.
- The modules have two functions which help the process:
-\end_layout
-
-\begin_layout Description
-convertfile (filename, orig=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert the file with the given filename to use NumPy.
- If orig is True, then a backup is first made and given the name filename.orig.
- Then, the file is converted and the updated code written over the top of
- the old file.
-
-\end_layout
-
-\begin_layout Description
-convertall (direc=os.path.curdir, orig=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Converts all the
-\begin_inset Quotes eld
-\end_inset
-
-.py
-\begin_inset Quotes erd
-\end_inset
-
- files in the given directory to use NumPy.
- Backups of all the files are first made if orig is True as explained for
- the convertfile function.
-
-\end_layout
-
-\begin_layout Description
-convertsrc (direc=os.path.curdir, ext=None, orig=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Replace
-\family typewriter
-''Numeric/arrayobject.h
-\begin_inset Quotes erd
-\end_inset
-
-
-\family default
- with
-\family typewriter
-''numpy/oldnumeric.h
-\begin_inset Quotes erd
-\end_inset
-
-
-\family default
- in all files ending in the list of extensions given by ext (if ext is None,
- then all files are updated).
- If orig is True, then first make a backup file with
-\begin_inset Quotes eld
-\end_inset
-
-.orig
-\begin_inset Quotes erd
-\end_inset
-
- as the extension.
-\end_layout
-
-\begin_layout Description
-converttree (direc=os.path.curdir)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Walks the tree pointed to by direc and converts all
-\begin_inset Quotes eld
-\end_inset
-
-.py
-\begin_inset Quotes erd
-\end_inset
-
- modules in each sub-directory to use NumPy.
- No backups of the files are made.
- Also, converts all .h and .c files to replace
-\family typewriter
-''Numeric/arrayobject.h
-\begin_inset Quotes erd
-\end_inset
-
-
-\family default
- with
-\family typewriter
-''numpy/oldnumeric.h
-\begin_inset Quotes erd
-\end_inset
-
-
-\family default
- so that NumPy is used.
-
-\end_layout
-
-\begin_layout Subsection
-Changes to think about
-\end_layout
-
-\begin_layout Standard
-Even if you don't make changes to your old code.
- If you are used to coding in Numeric, then you may need to adjust your
- coding style a bit.
- This list provides some helpful things to remember.
-
-\end_layout
-
-\begin_layout Enumerate
-Switch from using typecode characters to bitwidth type names or c-type names
-
-\end_layout
-
-\begin_layout Enumerate
-Convert use of uppercase type-names Int32, Float, etc., to lower case int32,
- float, etc.
-\end_layout
-
-\begin_layout Enumerate
-Convert use of functions to method calls where appropriate but explicitly
- specify any axis arguments for arrays greater than 1-d.
-
-\end_layout
-
-\begin_layout Enumerate
-The names for standard computations like Fourier transforms, linear algebra,
- and random-number generation have changed to conform to the standard of
- lower-case names possibly separated by an underscore.
-\end_layout
-
-\begin_layout Enumerate
-Look for ways to take advantage of advanced slicing, but remember it always
- returns a copy and may be slower at times.
-\end_layout
-
-\begin_layout Enumerate
-Remove any kludges you inserted to eliminate problems with Numeric that
- are now gone.
-
-\end_layout
-
-\begin_layout Enumerate
-Look for ways to take advantage of new features like expanded data-types
- (record-arrays).
-
-\end_layout
-
-\begin_layout Enumerate
-See if you can inherit from the ndarray directly, rather than using user_array.co
-ntainer (UserArray).
- However, if you were using UserArray in a multiple-inheritance hierarchy
- this is going to be more difficult and you can continue to use the standard
- container class in user_array (but notice the name change).
-
-\end_layout
-
-\begin_layout Enumerate
-Watch your usage of scalars extracted from arrays.
- Treating Numeric arrays like lists and then doing math on the elements
- 1 by 1 was always about 2x slower than using real lists in Python.
- This can now be 3x-6x slower than using lists in NumPy because of the increased
- complexity of both the indexing of ndarrays and the math of array scalars.
- If you must select individual scalars from NumPy, you can get some speed
- increases by using the item method to get a standard Python scalar from
- an N-d array and by using the itemset method to place a scalar into a particula
-r location in the N-d array.
- This complicates the appearance of the code, however.
- Also, when using these methods inside a loop, be sure to assign the methods
- to a local variable to avoid the attribute look-up at each loop iteration.
-
-\end_layout
-
-\begin_layout Standard
-Throughout this book, warnings are inserted when compatibility issues with
- old Numeric are raised.
- While you may not need to make any changes to get code to run with the
- ndarray object, you will likely want to make changes to take advantage
- of the new features of NumPy.
- If you get into a jam during the conversion process, you should be aware
- that Numeric and NumPy can both be used together and they will not interfere
- with each other.
- In addition, if you have Numeric 24.0 or newer, they can even share the
- same memory.
- This makes it easy to use NumPy as well as third-party tools that have
- not made the switch from Numeric yet.
-\end_layout
-
-\begin_layout Section
-Summary of differences with Numarray
-\end_layout
-
-\begin_layout Standard
-Conversion from Numarray can also be relatively painless, depending on how
- dependent your code is on the specific structure of the Numarray ufuncs,
- cfuncs, and various array-like objects.
- The internals of Numarray can be quite different and so depending on how
- intimately you used those internals adapting to NumPy can be more or less
- difficult.
- C-code that used the Numarray C-API can be easily adapted because NumPy
- includes a Numarray-compatible C-API module.
- All you need to do is replace usage of
-\begin_inset Quotes eld
-\end_inset
-
-numarray/libnumarray.h
-\begin_inset Quotes erd
-\end_inset
-
- with
-\begin_inset Quotes eld
-\end_inset
-
-numpy/libnumarray.h
-\begin_inset Quotes erd
-\end_inset
-
- and be sure the directory returned from the Python command numpy.get_numarray_in
-clude() is included in the list of directories used for compilation.
-\end_layout
-
-\begin_layout Standard
-On the Python-side the largest number of differences are in the methods
- and attributes of the array and the way array data-types are represented.
- In addition, arrays containing Python Objects, strings, and records are
- an integral part of the array object and not handled using a separate class
- (although enhanced separate classes do exist for the case of character
- arrays and record arrays).
-
-\end_layout
-
-\begin_layout Standard
-As is the case with Numeric, there is a two-step process available for migrating
- code written for Numarray to work with NumPy.
- This process involves running functions in the modules alter_code1 and
- alter_code2 located in the numarray sub-package of NumPy.
- These modules have interfaces identical to the ones that convert Numeric
- code, but they work to convert code written for numarray.
- The first module will convert your code to use the numarray compatibility
- module (numpy.numarray), while the second will try and help convert code
- to move away from dependency on the compatibility module.
- Because many users will probably be content to only use the first step,
- the alter_code2 module for second-stage migration may not be as complete
- as it otherwise could be.
-
-\end_layout
-
-\begin_layout Standard
-Also, the alter_code1 module is not guaranteed to convert every piece of
- working numarray code to use NumPy.
- If your code relied on the internal module structure of numarray or on
- how the class hierarchy was laid out, then it will need to be changed manually
- to run with NumPy.
- Of course you can still use your code with Numarray installed side-by-side
- and the two array objects should be able to exchange data without copying.
-
-\end_layout
-
-\begin_layout Subsection
-First-step changes
-\end_layout
-
-\begin_layout Standard
-The alter_code1 script makes the following import and attribute/method changes
-\end_layout
-
-\begin_layout Subsubsection
-Import changes
-\end_layout
-
-\begin_layout Itemize
-import numarray --> import numpy.numarray as numarray
-\end_layout
-
-\begin_layout Itemize
-import numarray.package --> import numpy.numarray.package as numarray_package
- with all usages of numarray.package in the code replaced by numarray_package
-\end_layout
-
-\begin_layout Itemize
-import numarray as <name> --> import numpy.numarray s <name>
-\end_layout
-
-\begin_layout Itemize
-import numarray.package as <name> --> import numpy.numarray.package as <name>
-\end_layout
-
-\begin_layout Itemize
-from numarray import <names> --> from numpy.numarray import <names>
-\end_layout
-
-\begin_layout Itemize
-from numarray.package import <names> --> from numpy.numarray.package import
- <names>
-\end_layout
-
-\begin_layout Subsubsection
-Attribute and method changes
-\end_layout
-
-\begin_layout Itemize
-.imaginary --> .imag
-\end_layout
-
-\begin_layout Itemize
-.flat --> probably .ravel() (Many usages will still work correctly because
- you can index and assign to self.flat)
-\end_layout
-
-\begin_layout Itemize
-.byteswapped() --> .byteswap(False)
-\end_layout
-
-\begin_layout Itemize
-.byteswap() --> .byteswap(True) (Returns a reference to self instead of None).
-
-\end_layout
-
-\begin_layout Itemize
-self.info() --> numarray.info(self)
-\end_layout
-
-\begin_layout Itemize
-.isaligned() --> .flags.aligned
-\end_layout
-
-\begin_layout Itemize
-.isbyteswapped() --> not .dtype.isnative (the byte-order is a property of the
- data-type object not the array itself in NumPy).
-
-\end_layout
-
-\begin_layout Itemize
-.iscontiguous() --> .flags.c_contiguous
-\end_layout
-
-\begin_layout Itemize
-.is_c_array() --> .dtype.isnative and .flags.carray
-\end_layout
-
-\begin_layout Itemize
-.is_fortran_contiguous() --> .flags.f_contiguous
-\end_layout
-
-\begin_layout Itemize
-.is_f_array() --> .dtype.isnative and .flags.farray
-\end_layout
-
-\begin_layout Itemize
-.itemsize() --> .itemsize
-\end_layout
-
-\begin_layout Itemize
-.nelements() --> .size
-\end_layout
-
-\begin_layout Itemize
-self.new(type) --> numarray.newobj(self, type)
-\end_layout
-
-\begin_layout Itemize
-.repeat(r) --> .repeat(r, axis=0)
-\end_layout
-
-\begin_layout Itemize
-.size() --> .size
-\end_layout
-
-\begin_layout Itemize
-.type() --> numarray.typefrom(self)
-\end_layout
-
-\begin_layout Itemize
-.typecode() --> .dtype.char
-\end_layout
-
-\begin_layout Itemize
-.stddev() --> .std()
-\end_layout
-
-\begin_layout Itemize
-.togglebyteorder() --> numarray.togglebyteorder(self)
-\end_layout
-
-\begin_layout Itemize
-.getshape() --> .shape
-\end_layout
-
-\begin_layout Itemize
-.setshape(obj) --> .shape = obj
-\end_layout
-
-\begin_layout Itemize
-.getflat() --> .ravel()
-\end_layout
-
-\begin_layout Itemize
-.getreal() --> .real
-\end_layout
-
-\begin_layout Itemize
-.setreal(obj) --> .real = obj
-\end_layout
-
-\begin_layout Itemize
-.getimag() --> .imag
-\end_layout
-
-\begin_layout Itemize
-.setimag(obj) --> .imag = obj
-\end_layout
-
-\begin_layout Itemize
-.getimaginary() --> .imag
-\end_layout
-
-\begin_layout Itemize
-.setimaginary(obj) --> .imag = obj
-\end_layout
-
-\begin_layout Subsection
-Second-step changes
-\end_layout
-
-\begin_layout Standard
-One of the notable differences is that several functions (array, arange,
- fromfile, and fromstring) do not take the shape= keyword argument.
- Instead you simply reshape the result using the reshape method.
- Another notable difference is that instead of allowing typecode=, type=,
- and dtype= variants for specifying the data-types, you must use the dtype=
- keyword.
- Other differences include
-\end_layout
-
-\begin_layout Itemize
-matrixmultiply(a,b) --> dot(a,b)
-\end_layout
-
-\begin_layout Itemize
-innerproduct(a,b) --> inner(a,b)
-\end_layout
-
-\begin_layout Itemize
-outerproduct(a,b) --> outer(a,b)
-\end_layout
-
-\begin_layout Itemize
-kroneckerproduct(a,b) --> kron(a,b)
-\end_layout
-
-\begin_layout Itemize
-tensormultiply(a,b) --> None
-\end_layout
-
-\begin_layout Subsection
-Additional Extension modules
-\end_layout
-
-\begin_layout Standard
-There are three extension packages that come included with numarray which
- are now downloaded separately.
- Stubs for these packages exist in numpy.numarray but they try and find the
- actual code by looking at what is currently installed.
- These packages are available in SciPy but can be installed separately as
- well:
-\end_layout
-
-\begin_layout Itemize
-nd_image --> scipy.ndimage
-\end_layout
-
-\begin_layout Itemize
-convolve --> scipy.stsci.convolve
-\end_layout
-
-\begin_layout Itemize
-image --> scipy.stsci.image
-\end_layout
-
-\begin_layout Standard
-If you don't want to install all of scipy, you can grab just these packages
- from SVN using
-\end_layout
-
-\begin_layout LyX-Code
-svn co http://svn.scipy.org/svn/scipy/trunk/Lib/ndimage ndimage
-\end_layout
-
-\begin_layout LyX-Code
-svn co http://svn.scipy.org/svn/scipy/trunk/Lib/stsci stsci
-\end_layout
-
-\begin_layout Standard
-and then run
-\end_layout
-
-\begin_layout LyX-Code
-cd ndimage; sudo python setup.py install
-\end_layout
-
-\begin_layout LyX-Code
-cd stsci; sudo python setup.py install
-\end_layout
-
-\begin_layout Standard
-On a Windows system, you can use the Tortoise SVN client which is integrated
- into the Windows Explorer.
- It can be downloaded from http://tortoisesvn.tigris.org.
- Instructions on how to use it are also provided on that site.
- After downloading the packages from SVN, installation will still require
- a C-compiler (the mingw32 compiler works fine even with MSVC-compiled Python
- as long as you specify --compiler=mingw32).
- Alternatively you can download binary releases of scipy from http://www.scipy.org
- to get the needed functionality or use the Enthon edition of Python.
-\end_layout
-
-\begin_layout Chapter
-The Array Object
-\end_layout
-
-\begin_layout Quotation
-Don't worry about people stealing your ideas.
- If your ideas are any good, you'll have to ram them down people's throats.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Howard Aiken, IBM engineer
-\end_layout
-
-\begin_layout Quotation
-No idea is so antiquated that it was not once modern; no idea is so modern
- that it will not someday be antiquated.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Ellen Glasgow
-\end_layout
-
-\begin_layout Section
-
-\family typewriter
-ndarray
-\family default
- Attributes
-\end_layout
-
-\begin_layout Standard
-Array
-\begin_inset LatexCommand index
-name "ndarray|("
-
-\end_inset
-
- attributes reflect information that is intrinsic to the array itself.
- Generally, accessing an array through its attributes allows you to get
- and sometimes set intrinsic properties of the array without creating a
- new array.
- The exposed attributes are the core parts of an array and only some of
- them can be reset meaningfully without creating a new array.
- Table
-\begin_inset LatexCommand ref
-reference "cap:ndarray-attributes"
-
-\end_inset
-
- shows all the attributes
-\begin_inset LatexCommand index
-name "ndarray!attributes|("
-
-\end_inset
-
- with a brief description.
- Detailed information on each attribute is given below.
-\end_layout
-
-\begin_layout Warning
-Numeric Compatibility: you should check your old use of the .flat attribute.
- This attribute now returns an iterator object which acts like a 1-d array
- in terms of indexing.
- while it does not share all the attributes or methods of an array, it will
- be interpreted as an array in functions that take objects and convert them
- to arrays.
- Furthermore, Any changes in an array converted from a 1-d iterator will
- be reflected back in the original array when the converted array is deleted.
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float table
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "cap:ndarray-attributes"
-
-\end_inset
-
-Attributes of the
-\family typewriter
-ndarray
-\family default
-.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-vspace*{-0.2in}
-\backslash
-setlength{
-\backslash
-extrarowheight}{0.25eM}
-\end_layout
-
-\begin_layout Standard
-
-\end_layout
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="18" columns="3">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="1in">
-<column alignment="center" valignment="top" leftline="true" width="1in">
-<column alignment="block" valignment="top" leftline="true" rightline="true" width="3in">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Attribute
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Settable
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Description
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-flags
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-No
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-special array-connected dictionary-like object with attributes showing the
- state of flags in this array; only the flags WRITEABLE, ALIGNED, and UPDATEIFCO
-PY can be modified by setting attributes of this object
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-shape
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Yes
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-tuple showing the array shape; setting this attribute re-shapes the array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-strides
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Yes
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-tuple showing how many
-\emph on
-bytes
-\emph default
- must be jumped in the data segment to get from one entry to the next
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-ndim
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-No
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-number of dimensions in array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-data
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Yes
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-buffer object loosely wrapping the array data (only works for single-segment
- arrays)
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-size
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-No
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-total number of elements
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-itemsize
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-No
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-size (in bytes) of each element
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-nbytes
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-No
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-total number of bytes used
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-base
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-No
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-object this array is using for its data buffer, or None if it owns its own
- memory
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-dtype
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Yes
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-data-type object for this array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-real
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Yes
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-real part of the array; setting copies data to real part of current array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-imag
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Yes
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-imaginary part, or read-only zero array if type is not complex; setting
- works only if type is complex
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-flat
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Yes
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-one-dimensional, indexable iterator object that acts somewhat like a 1-d
- array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-ctypes
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-No
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-object to simplify the interaction of this array with the ctypes module
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-__array_interface__
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-No
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-dictionary with keys (data, typestr, descr, shape, strides) for compliance
- with Python side of array protocol
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-__array_struct__
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-No
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-array interface on C-level
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-__array_priority__
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-No
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-always 0.0 for base type
-\family typewriter
-ndarray
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Subsection
-Memory Layout attributes
-\end_layout
-
-\begin_layout Description
-flags
-\begin_inset LatexCommand index
-name "ndarray!attributes!flags"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Array flags
-\begin_inset LatexCommand index
-name "ndarray!flags|("
-
-\end_inset
-
- provide information about how the memory area used for the array is to
- be interpreted.
- There are 6 Boolean flags in use which govern whether or not:
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-C_CONTIGUOUS\InsetSpace ~
-(C) the data is in a single, C-style contiguous segment;
-\end_layout
-
-\begin_layout Description
-F_CONTIGUOUS\InsetSpace ~
-(F) the data is in a single, Fortran-style contiguous segment;
-\end_layout
-
-\begin_layout Description
-OWNDATA\InsetSpace ~
-(O) the array owns the memory it uses or if it borrows it from another
- object (if this is False, the base attribute retrieves a reference to the
- object this array obtained its data from);
-\end_layout
-
-\begin_layout Description
-WRITEABLE\InsetSpace ~
-(W) the data area can be written to;
-\end_layout
-
-\begin_layout Description
-ALIGNED\InsetSpace ~
-(A) the data and strides are aligned appropriately for the hardware
- (as determined by the compiler);
-\end_layout
-
-\begin_layout Description
-UPDATEIFCOPY\InsetSpace ~
-(U) this array is a copy of some other array (referenced by
-
-\family typewriter
-.base
-\family default
-).
- When this array is deallocated, the base array will be updated with the
- contents of this array.
-\end_layout
-
-\end_deeper
-\begin_layout Description
-\InsetSpace ~
- Only the
-\series bold
-UPDATEIFCOPY
-\series default
-,
-\series bold
-WRITEABLE
-\series default
-, and
-\series bold
-ALIGNED
-\series default
- flags can be changed by the user.
- This can be done using the special array-connected, dictionary-like object
- that the flags attribute returns.
- By setting elements in this dictionary, the underlying array obect's flags
- are altered.
- Flags can also be changed using the method
-\family typewriter
-setflags
-\family default
-(...).
- All flags in the dictionary can be accessed using their first (upper case)
- letter as well as the full name.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Certain logical combinations of flags can also be read using named keys
- to the special flags dictionary.
- These combinations are
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-FNC Returns F_CONTIGUOUS and not C_CONTIGUOUS
-\end_layout
-
-\begin_layout Description
-FORC Returns F_CONTIGUOUS or C_CONTIGUOUS (one-segment test).
-\end_layout
-
-\begin_layout Description
-BEHAVED\InsetSpace ~
-(B) Returns ALIGNED and WRITEABLE
-\end_layout
-
-\begin_layout Description
-CARRAY\InsetSpace ~
-(CA) Returns BEHAVED and C_CONTIGUOUS
-\end_layout
-
-\begin_layout Description
-FARRAY_(FA) Returns BEHAVED and F_CONTIGUOUS and not C_CONTIGUOUS
-\end_layout
-
-\end_deeper
-\begin_layout Note
-The array flags cannot be set arbitrarily.
- UPDATEIFCOPY can only be set False.
- the ALIGNED flag can only be set True if the data is truly aligned.
- The flag WRITEABLE can only be set True if the array owns its own memory
- or the ultimate owner of the memory exposes a writeable buffer interface
- (or is a string).
- The exception for string is made so that unpickling can be done without
- copying memory.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Flags can also be set and read using attribute access with the lower-case
- key equivalent (without first letter support).
- Thus, for example, self.flags.c_contiguous returns whether or not the array
- is C-style contiguous, and self.flags.writeable=True changes the array to
- be writeable (if possible)
-\begin_inset LatexCommand index
-name "ndarray!flags|)"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Description
-shape
-\begin_inset LatexCommand index
-name "ndarray!attributes!shape"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The shape of the array is a tuple giving the number of elements in each
- dimension.
- The shape can be reset for single-segment arrays by setting this attribute
- to another tuple.
- The total number of elements cannot change.
- However, a -1 may be used in a dimension entry to indicate that the array
- length in that dimension should be computed so that the total number of
- elements does not change.
-
-\family typewriter
-a.shape=x
-\family default
- is equivalent to
-\family typewriter
-a=a.reshape(x)
-\family default
- except the latter can be used even if the array is not single-segment and
- even if
-\begin_inset Formula $a$
-\end_inset
-
- is an array scalar.
-
-\end_layout
-
-\begin_layout Note
-Setting the shape attribute to () for a 1-element array will turn self into
- a 0-dimensional array.
- This is one of the few ways to get a 0-dimensional array in Python.
- Most other operations will return an array scalar.
- Other ways to get a 0-dimensional array in Python include calling array
- with a scalar argument and calling the squeeze method of an array whose
- shape is all 1's.
-
-\end_layout
-
-\begin_layout Description
-strides
-\begin_inset LatexCommand index
-name "ndarray!attributes!strides"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The strides of an array is a tuple showing for each dimension how many
-
-\emph on
-bytes
-\emph default
- must be skipped to get to the next element in that dimension.
- Setting this attribute to another tuple will change the way the memory
- is viewed.
- This attribute can only be set to a tuple that will not cause the array
- to access unavailable memory.
- If an attempt is made to do so, ValueError is raised.
-\end_layout
-
-\begin_layout Description
-ndim
-\begin_inset LatexCommand index
-name "ndarray!attributes!ndim"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The number of dimensions of an array is sometimes called the rank of the
- array.
- Getting this attribute reveals the length of the shape tuple and the strides
- tuple.
-
-\end_layout
-
-\begin_layout Description
-data
-\begin_inset LatexCommand index
-name "ndarray!attributes!data"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A buffer object referencing the actual data for this array if this array
- is single-segment.
- If the array is not single-segment, then an AttributeError is raised.
- The buffer object is writeable depending on the status of self.flags.writeable.
-\end_layout
-
-\begin_layout Description
-size
-\begin_inset LatexCommand index
-name "ndarray!attributes!size"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The total number of elements in the array.
-\end_layout
-
-\begin_layout Description
-itemsize
-\begin_inset LatexCommand index
-name "ndarray!attributes!itemsize"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The number of bytes each element of the array requires.
-
-\end_layout
-
-\begin_layout Description
-nbytes
-\begin_inset LatexCommand index
-name "ndarray!attributes!nbytes"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The total number of bytes used by the array.
- This is equal to
-\family typewriter
-self.itemsize*self.size
-\family default
-.
-\end_layout
-
-\begin_layout Description
-base
-\begin_inset LatexCommand index
-name "ndarray!attributes!base"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If the array does not own its own memory, then this attribute returns the
- object whose memory this array is referencing.
- The returned object may not be the original allocator of the memory, but
- may be borrowing it from still another object.
- If this array does own its own memory, then None is returned unless the
- UPDATEIFCOPY flag is True in which case self.base is the array that will
- be updated when self is deleted.
- UPDATEIFCOPY gets set for an array that is created as a behaved copy of
- a general array.
- The intent is for the misaligned array to get any changes that occur to
- the copy.
-
-\end_layout
-
-\begin_layout Subsection
-Data Type attributes
-\end_layout
-
-\begin_layout Standard
-There are several ways to specify the kind of data that the array is composed
- of.
- The fullest description that preserves field information is always obtained
- using an actual dtype object.
- See Chapter
-\begin_inset LatexCommand ref
-reference "cha:Data-descriptor-objects"
-
-\end_inset
-
- for more discussion on data-type objects and acceptable arguments to construct
- data-type objects.
- Three commonly-used attributes of the data-type object returned are also
- documented here.
-\end_layout
-
-\begin_layout Description
-dtype
-\begin_inset LatexCommand index
-name "ndarray!attributes!dtype"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A data-type object that fully describes (including any defined fields)
- each fixed-length item in the array.
- Whether or not the data is in machine byte-order is also determined by
- the data-type.
- The data-type attribute can be set to anything that can be interpreted
- as a data-type (see Chapter
-\begin_inset LatexCommand ref
-reference "cha:Data-descriptor-objects"
-
-\end_inset
-
- for more information).
- Setting this attribute allows you to change the interpretation of the data
- in the array.
- The new data-type must be compatible with the array's current data-type.
- The new data-type is compatible if it has the same itemsize as the current
- data-type descriptor, or (if the array is a single-segment array) if the
- the array with the new data-type fits in the memory already consumed by
- the array.
-
-\end_layout
-
-\begin_layout Description
-dtype.type
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A Python type object gives the typeobject whose instances represent elements
- of the array.
- This type object can be used to instantiate a scalar of that type.
-
-\end_layout
-
-\begin_layout Description
-dtype.char
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A typecode character unique to each of the 21 built-in types.
-
-\end_layout
-
-\begin_layout Description
-dtype.str
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This string consists of a required first character giving the
-\begin_inset Quotes eld
-\end_inset
-
-endianness
-\begin_inset Quotes erd
-\end_inset
-
- of the data (
-\begin_inset Quotes eld
-\end_inset
-
-<
-\begin_inset Quotes erd
-\end_inset
-
- for little endian,
-\begin_inset Quotes eld
-\end_inset
-
->
-\begin_inset Quotes erd
-\end_inset
-
- for big endian, and
-\begin_inset Quotes eld
-\end_inset
-
-|
-\begin_inset Quotes erd
-\end_inset
-
- for irrelevant), the second character is a code for the kind of data ('b'
- for Boolean, 'i' for signed integer, 'u' for unsigned integer, 'f' for
- floating-point, 'c' for complex floating point, 'O' for object, 'S' for
- ASCII string, 'U' for unicode, and 'V' for void), the final characters
- give the number of bytes each element uses.
-\end_layout
-
-\begin_layout Subsection
-Other attributes
-\end_layout
-
-\begin_layout Description
-T
-\begin_inset LatexCommand index
-name "ndarray!attributes!T"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to self.transpose().
- For self.ndim < 2, it returns a view of self.
-
-\end_layout
-
-\begin_layout Warning
-If arr is 0- or 1-dimensional, then arr.T will return a new ndarray which
- refers to the same data as arr.
- This is because transpose has the effect of reversing the shape attribute
- of an array (whose 0-d and 1-d equivalent is to return the same array).
- This may be surprising if you are thinking of your 1-d array as a
-\begin_inset Quotes eld
-\end_inset
-
-row
-\begin_inset Quotes erd
-\end_inset
-
- or a
-\begin_inset Quotes eld
-\end_inset
-
-column
-\begin_inset Quotes erd
-\end_inset
-
- vector and expected the .T attribute to return the other convention.
-
-\end_layout
-
-\begin_layout Description
-real
-\begin_inset LatexCommand index
-name "ndarray!attributes!real"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The real part of an array.
- For arrays that are not complex this attribute returns the array itself.
- Setting this attribute allows setting just the real part of an array.
- If the array is already real then setting this attribute is equivalent
- to self[...] = values.
-\end_layout
-
-\begin_layout Description
-imag
-\begin_inset LatexCommand index
-name "ndarray!attributes!imag"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A view of the imaginary part of an array.
- For arrays that are not complex, this returns a read-only array of zeros.
- Setting this array allows in-place alteration of the complex part of an
- imaginary array.
- If the array is not complex, then trying to set this attribute raises an
- Error.
-
-\end_layout
-
-\begin_layout Description
-flat
-\begin_inset LatexCommand index
-name "ndarray!attributes!flat"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an iterator object (numpy.flatiter) that acts like a 1-d version
- of the array.
- 1-d indexing works on this array and it can be passed in to most routines
- as an array wherein a 1-d array will be constructed from it.
- The new 1-d array will reference this array's data if this array is C-style
- contiguous, otherwise, new memory will be allocated for the 1-d array,
- the UPDATEIFCOPY flag will be set for the new array, and this array will
- have its WRITEABLE flag set FALSE until the the last reference to the new
- array disappears.
- When the last reference to the new 1-d array disappears, the data will
- be copied over to this non-contiguous array.
- This is done so that a.flat effectively references the current array regardless
- of whether or not it is contiguous or non-contiguous.
- As an example, consider the following code:
-\end_layout
-
-\begin_layout MyCode
->>> a = zeros((4,5))
-\newline
->>> b = ones(6)
-\newline
->>> add(b,b,a[1:3,0:3].flat)
-\newline
-array([[ 2.,
- 2., 2.],
-\newline
- [ 2., 2., 2.]])
-\newline
->>> print a
-\newline
-[[ 0.
- 0.
- 0.
- 0.
- 0.]
-\newline
- [ 2.
- 2.
- 2.
- 0.
- 0.]
-\newline
- [ 2.
- 2.
- 2.
- 0.
- 0.]
-\newline
- [ 0.
- 0.
- 0.
- 0.
- 0.]]
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The numpy.flatiter object has two methods:
-\series bold
-__array__()
-\series default
- and
-\series bold
-copy()
-\series default
- and one attribute:
-\series bold
-base
-\series default
-.
- The base attribute returns a reference to the underlying array.
-
-\end_layout
-
-\begin_layout Description
-__array_priority__
-\begin_inset LatexCommand index
-name "ndarray!attributes!\\_\\_array\\_priority\\_\\_"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The array priority attribute is a floating point number useful in mixed
- operations involving two subtypes to decide which subtype is returned.
- The base ndarray object has priority 0.0 and 1.0 is the default subtype priority.
-\end_layout
-
-\begin_layout Subsection
-Array Interface attributes
-\end_layout
-
-\begin_layout Standard
-The array interface
-\begin_inset LatexCommand index
-name "array interface"
-
-\end_inset
-
- (sometimes called array protocol) was created in 2005 as a means for array-like
- Python objects to re-use each other's data buffers intelligently whenever
- possible.
- The ndarray object supports both the Python-side and the C-side of the
- array interface.
- The system is able to consume objects that expose the array interface,
- and array objects can expose their inner workings to other objects that
- support the array interface.
-
-\end_layout
-
-\begin_layout Description
-__array_interface__
-\begin_inset LatexCommand index
-name "ndarray!attributes!\\_\\_array\\_interface\\_\\_"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The python-side of the array interface.
- It is a dictionary with the following attributes:
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-data A 2-tuple (dataptr, read-only flag).
- The dataptr is a string giving the address (in hexadecimal format) of the
- array data.
- The read-only flag is True if the array memory is read-only.
-
-\end_layout
-
-\begin_layout Description
-strides The strides tuple.
- Same as
-\series bold
-strides
-\series default
- attribute except None is returned if the array is C-style contiguous.
-\end_layout
-
-\begin_layout Description
-shape The shape tuple.
- Same as
-\series bold
-shape
-\series default
- attribute.
-\end_layout
-
-\begin_layout Description
-typestr A string giving the format of the data.
- Same as
-\series bold
-dtype.str
-\series default
- attribute.
-
-\end_layout
-
-\begin_layout Description
-descr A list of tuples providing the detailed description of this data type.
- This information is obtained from the arrdescr attribute of the dtypedescr
- object associated with each array.
- For arrays with fields, this will return a valid array-protocol descriptor
- list.
- For arrays without defined fields, this returns [('',typestr)].
-\end_layout
-
-\end_deeper
-\begin_layout Description
-__array_struct__
-\begin_inset LatexCommand index
-name "ndarray!attributes!\\_\\_array\\_struct\\_\\_"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A PyCObject that wraps a pointer to a PyArrayInterface structure.
- This is only useful on the C-level for rapid implementation of the array
- interface, using a single attribute lookup.
-\end_layout
-
-\begin_layout Description
-ctypes
-\begin_inset LatexCommand index
-name "ndarray!attributes!ctypes|("
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This attribute creates an object that makes it easier to use arrays when
- calling out to shared libraries with the ctypes module.
- The returned object has data, shape, and strides attributes which return
- ctypes
-\begin_inset LatexCommand index
-name "ctypes"
-
-\end_inset
-
- objects that can be used as arguments to a shared library.
- These attributes are:
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-data A pointer to the memory area of the array as a Python integer.
- This memory area may contain data that is not aligned, or not in correct
- byte-order.
- The memory area may not even be writeable.
- The array flags and data-type of this array should be respected when passing
- this attribute to arbitrary C-code to avoid trouble that can include Python
- crashing.
- User Beware! The value of this attribute is exactly the same as
-\family typewriter
-self.__array_interface__['data'][0]
-\family default
-.
-\end_layout
-
-\begin_layout Description
-shape (c_intp*self.ndim) A ctypes array of length self.ndim where the base-type
- is the C-integer corresponding to dtype('p') on this platform.
- This base-type could be c_int, c_long, or c_longlong depending on the platform.
- The c_intp type is defined accordingly in numpy.ctypeslib.
- The ctypes array contains the shape of the underlying array.
-\end_layout
-
-\begin_layout Description
-strides (c_intp*self.ndim) A ctypes array of length self.ndim where the base-type
- is the same as for the shape attribute.
- This ctypes array contains the strides information from the underlying
- array.
- This strides information is important for showing how many bytes must be
- jumped to get to the next element in the array.
-
-\end_layout
-
-\begin_layout Description
-_as_parameter_ (c_void_p) Returns the data-pointer to the array as a ctypes
- object.
- Among other possible uses, this enables this ctypes object to be used directly
- in a ctypes-loaded call to an arbitrary function.
- Be sure to respect the flags on the array and the size and strides of the
- array so as not to use this memory in-appropriately (see the
-\series bold
-ndpointer
-\series default
- function for how to return a class that can be used with the argtypes attribute
- of ctypes functions).
-
-\end_layout
-
-\end_deeper
-\begin_layout Warning
-Be careful using the ctypes attribute --- especially on temporary arrays
- or arrays constructed on the fly.
- For example, calling (a+b).ctypes.data_as(ctypes.c_void_p) returns a pointer
- to memory that is invalid because the array created as (a+b) is deallocated
- before the next Python statement.
- You can avoid this problem using either c=a+b or ct=(a+b).ctypes.
- In the latter case, ct will hold a reference to the array until ct is deleted
- or re-assigned.
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The ctypes object also has several methods which can alter how the shape,
- strides, and data of the underlying object is returned.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-data_as (obj) Return the data pointer cast-to a particular c-types object.
- For example, calling
-\family typewriter
-self._as_parameter_
-\family default
- is equivalent to
-\family typewriter
-self.data_as(ctypes.c_void_p)
-\family default
-.
- Perhaps you want to use the data as a pointer to a ctypes array of floating-poi
-nt data:
-\family typewriter
-self.data_as(ctypes.POINTER(ctypes.c_double))
-\family default
-.
-
-\end_layout
-
-\begin_layout Description
-shape_as (obj) Return the shape tuple as an array of some other c-types
- type.
- For example:
-\family typewriter
-self.shape_as(ctypes.c_short)
-\family default
-.
-
-\end_layout
-
-\begin_layout Description
-strides_as (obj) Return the strides tuple as an array of some other c-types
- type.
- For example:
-\family typewriter
-self.strides_as(ctypes.c_longlong)
-\family default
-.
-\end_layout
-
-\end_deeper
-\begin_layout Description
-\InsetSpace ~
- If the ctypes module is not available, then the ctypes attribute of array
- objects still returns something useful, but ctypes objects are not returned
- and errors may be raised instead.
- In particular, the object will still have the _as_parameter_ attribute
- which will return an integer equal to the data
-\begin_inset LatexCommand index
-name "ndarray!attributes!ctypes|)"
-
-\end_inset
-
- attribute
-\begin_inset LatexCommand index
-name "ndarray!attributes|)"
-
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Section
-
-\family typewriter
-ndarray
-\family default
- Methods
-\end_layout
-
-\begin_layout Standard
-In NumPy, the
-\family typewriter
-ndarray
-\family default
- object has many methods
-\begin_inset LatexCommand index
-name "ndarray!methods|("
-
-\end_inset
-
- which operate on or with the array in some fashion, typically returning
- an array result.
- In Numeric, many of these methods were only library calls.
- These methods are explained in this chapter.
- Whenever the array whose method is being called needs to be referenced
- it will be referred to as
-\emph on
-this array
-\emph default
-, or
-\emph on
-self
-\emph default
-.
- Keyword arguments will be shown.
- Methods that only take one argument do not have keyword arguments.
- Default values for one argument methods will be shown in braces {default}.
-
-\end_layout
-
-\begin_layout Warning
-If you are converting code from Numeric, then you will need to make the
- following (search and replace) conversions:
-\family typewriter
-.typecode() --> .dtype.char
-\family default
-;
-\family typewriter
-.iscontiguous() --> .flags.contiguous
-\family default
-;
-\family typewriter
-.byteswapped() --> .byteswap()
-\family default
-;
-\family typewriter
-.toscalar() --> .item()
-\family default
-; and
-\family typewriter
-.itemsize() --> .itemsize
-\family default
-.
- The numpy.oldnumeric.alter_code1 module can automate this for you.
-\end_layout
-
-\begin_layout Subsection
-Array conversion
-\end_layout
-
-\begin_layout Description
-tolist
-\begin_inset LatexCommand index
-name "ndarray!methods!tolist"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The contents of self as a nested list.
-\end_layout
-
-\begin_layout MyCode
->>> a = array([[1,2,3],[4,5,6]]); print a.tolist()
-\newline
-[[1, 2, 3], [4, 5, 6]]
-\end_layout
-
-\begin_layout Description
-item
-\begin_inset LatexCommand index
-name "ndarray!methods!item"
-
-\end_inset
-
- (*args)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If no arguments are passed in, then this method only works for arrays with
- one element (a.size == 1).
- In this case, it returns a standard Python scalar object (if possible)
- copied from the first element of self.
- When the data type of self is longdouble or clongdouble, this returns a
- scalar array object because there is no available Python scalar that would
- not lose information.
- Void arrays return a buffer object for item() unless fields are defined
- in which case a tuple is returned.
-\end_layout
-
-\begin_layout MyCode
->>> asc = a[0,0].item()
-\newline
->>> type(asc)
-\newline
-<type 'int'>
-\newline
->>> asc
-\newline
-1
-\newline
->>> type(a[0,0])
-\newline
-<type
- 'numpy.int32'>
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If arguments are provided, then they indicate indices into the array (either
- a flat index or an nd-index).
- A standard Python scalar corresponding to the item at the given location
- is then returned.
- This is very similar to self[args] except instead of an array scalar, a
- standard Python scalar is returned.
- This can be useful for speeding up access to elements of the array and
- doing arithmetic on elements of the array using Python's optimized math.
-
-\end_layout
-
-\begin_layout Description
-itemset
-\begin_inset LatexCommand index
-name "ndarray!methods!itemset"
-
-\end_inset
-
- (*args)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- There must be at least 1 argument and define the last argument as item.
- Then, this is equivalent to but faster than self[args] = item.
- The item should be a scalar value and args must select a single item in
- the array.
-\end_layout
-
-\begin_layout Description
-tostring
-\begin_inset LatexCommand index
-name "ndarray!methods!tostring"
-
-\end_inset
-
- (order='C')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A Python string showing a copy of the raw contents of data memory.
- The string can be produced in either 'C' or 'Fortran', or 'Any' order (the
- default is 'C'-order).
- 'Any' order means C-order unless the F_CONTIGUOUS flag in the array is
- set, then 'Fortran' order.
-
-\end_layout
-
-\begin_layout Description
-tofile
-\begin_inset LatexCommand index
-name "ndarray!methods!tofile"
-
-\end_inset
-
- (file=, sep='', format='')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Write the contents of self to the open file object.
- If file is a string, then open a file of that name first.
- If sep is the empty string, then write the file in binary mode.
- If sep is any other string, write the array in simple text mode separating
- each element with the value of the sep string.
- When the file is written in text mode, the format string can be used to
- alter the appearance of each entry.
- If format is the empty string, then it is equivalent to
-\family typewriter
-
-\begin_inset Quotes eld
-\end_inset
-
-%s
-\begin_inset Quotes erd
-\end_inset
-
-
-\family default
-.
- Each element of the array will be converted to a Python scalar,
-\family typewriter
-o
-\family default
-, and written to the file as
-\family typewriter
-
-\begin_inset Quotes eld
-\end_inset
-
-format
-\begin_inset Quotes erd
-\end_inset
-
- % o
-\family default
-.
- Note that writing an array to a file does not store any information about
- the shape, type, or endianness of an array.
- When written in binary mode, tofile is functionally equivalent to
-\family typewriter
-fid.write(self.tostring())
-\family default
-.
-\end_layout
-
-\begin_layout MyCode
->>> a.tofile('myfile.txt',sep=':',format='%03d')
-\end_layout
-
-\begin_layout MyCode
-Contents of myfile.txt
-\end_layout
-
-\begin_layout MyCode
-001:002:003:004:005:006
-\end_layout
-
-\begin_layout Description
-dump
-\begin_inset LatexCommand index
-name "ndarray!methods!dump"
-
-\end_inset
-
- (file)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Pickle the contents of self to the file object represented by file.
- Equivalent to cPickle.dump(self, file, 2)
-\end_layout
-
-\begin_layout Description
-dumps
-\begin_inset LatexCommand index
-name "ndarray!methods!dumps"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return pickled representation of self as a string.
- Equivalent to cPickle.dumps(self, 2)
-\end_layout
-
-\begin_layout Description
-astype
-\begin_inset LatexCommand index
-name "ndarray!methods!astype"
-
-\end_inset
-
- ({None})
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Force conversion of this array to an array with the data type provided
- as the argument.
- If the argument is None, or equal to the data type of self, then return
- a copy of the array.
-
-\end_layout
-
-\begin_layout Description
-byteswap
-\begin_inset LatexCommand index
-name "ndarray!methods!byteswap"
-
-\end_inset
-
- ({False})
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Byteswap the elements of the array and return the byteswapped array.
- If the argument is True, then byteswap in-place and return a reference
- to self.
- Otherwise, return a copy of the array with the elements byteswapped.
- The data-type descriptor is not changed so the array will have changed
- numbers.
-\end_layout
-
-\begin_layout Description
-copy
-\begin_inset LatexCommand index
-name "ndarray!methods!copy"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a copy of the array (which is always single-segment, and ALIGNED).
- However, the data-type is preserved (including whether or not the data
- is byteswapped).
-
-\end_layout
-
-\begin_layout Description
-view
-\begin_inset LatexCommand index
-name "ndarray!methods!view"
-
-\end_inset
-
- ({None})
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a new array using the same memory area as self.
- If the optional argument is given, it can be either a typeobject that is
- a sub-type of the ndarray or an object that can be converted to a data-type
- descriptor.
- If the argument is a typeobject then a new array of that Python type is
- returned that uses the information from self.
- If the argument is a data-type descriptor, then a new array of the same
- Python type as self is returned using the given data-type.
-
-\end_layout
-
-\begin_layout MyCode
->>> print a.view(single)
-\newline
-[[ 1.40129846e-45 2.80259693e-45 4.20389539e-45]
-\newline
-
- [ 5.60519386e-45 7.00649232e-45 8.40779079e-45]]
-\newline
->>> a.view(ubyte)
-\newline
-array([[1,
- 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0],
-\newline
- [4, 0, 0, 0, 5, 0, 0, 0, 6, 0,
- 0, 0]], dtype=uint8)
-\end_layout
-
-\begin_layout Description
-getfield
-\begin_inset LatexCommand index
-name "ndarray!methods!getfield"
-
-\end_inset
-
- (dtype=, offset=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a
-\emph on
-field
-\emph default
- of the given array as an array of the given data type.
- A field is a view of the array's data at a certain byte offset interpreted
- as a given data type.
- The returned array is a reference into self, therefore changes made to
- the returned array will be reflected in self.
- This method is particularly useful for record arrays that use a void data
- type, but it can also be used to extract the low (high)-order bytes of
- other array types as well.
- For example, using getfield, you could extract fixed-length substrings
- from an array of strings.
-
-\end_layout
-
-\begin_layout MyCode
->>> a = array(['Hello','World','NumPy'])
-\newline
->>> a.getfield('S2',1)
-\newline
-array(['el',
- 'or', 'um'],
-\newline
- dtype='|S2')
-\end_layout
-
-\begin_layout Description
-setflags
-\begin_inset LatexCommand index
-name "ndarray!methods!setflags"
-
-\end_inset
-
- (write=None, align=None, uic=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Set array flags WRITEABLE, ALIGNED, and UPDATEIFCOPY, respectively.
- The ALIGNED flag can only be set to True if the data is actually aligned
- according to the type.
- The UPDATEIFCOPY flag can never be set to True.
- The flag WRITEABLE can only be set True if the array owns its own memory
- or the ultimate owner of the memory exposes a writeable buffer interface
- (or is a string).
- The exception for string is made so that unpickling can be done without
- copying memory.
-
-\end_layout
-
-\begin_layout Description
-fill
-\begin_inset LatexCommand index
-name "ndarray!methods!fill"
-
-\end_inset
-
- (scalar)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Fill an array with the scalar value (appropriately converted to the type
- of self).
- If the scalar value is an array or a sequence, then only the first element
- is used.
- This method is usually faster than a[...]=scalar or self.flat=scalar, and always
- interprets its argument as a scalar.
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float table
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-Array conversion methods
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-setlength{
-\backslash
-extrarowheight}{0.1eM}
-\end_layout
-
-\begin_layout Standard
-
-\end_layout
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="15" columns="3">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" width="30text%">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Method
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Arguments
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Description
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-astype
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(dtype {None})
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Cast to another data type
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-byteswap
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(inplace {False})
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Byteswap array elements
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-copy
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-()
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Copy array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-dump
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(file)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Pickle to stream or file
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-dumps
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-()
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Get pickled string
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-fill
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(scalar)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Fill an array with scalar value
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-getfield
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(dtype=, offset=0)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Return a field of the array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-setflags
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(write=None, align=None, uic=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Set array flags
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-tofile
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(file=, sep='', format='')
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Raw write to file
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-tolist
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-()
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Array as a nested list
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-item
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(*args)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Python scalar extraction
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-itemset
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(*args)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Insert scalar (last argument) into array
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-tostring
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(order='C')
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-String of raw memory
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-view
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(obj)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-View as another data type or class
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Subsection
-Array shape manipulation
-\end_layout
-
-\begin_layout Standard
-For reshape, resize, and transpose, the single tuple argument may be replaced
- with
-\begin_inset Formula $n$
-\end_inset
-
- integers which will be interpreted as an
-\begin_inset Formula $n$
-\end_inset
-
--tuple.
-\end_layout
-
-\begin_layout Description
-reshape
-\begin_inset LatexCommand index
-name "ndarray!methods!reshape"
-
-\end_inset
-
- (newshape, order='C')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array that uses the same data as this array but has a new shape
- given by the newshape tuple (or a scalar to reshape as 1-d).
- The new shape must define an array with the same total number of elements.
- If one of the elements of the new shape tuple is -1, then that dimension
- will be determined such that the overall number of items in the array stays
- constant.
- If possible, the new array will reference the data of the old one.
- If the data must be moved in order to accomplish the reshape, then then
- the new array will contain a copy of the data in self.
- The order argument specifies how the array data should be viewed during
- the reshape (either in 'C' or 'FORTRAN' order).
- This order argument specifies both how the intrinsic raveling to a 1-d
- array should occur as well as how that 1-d array should be used to fill-up
- the new output array.
-
-\end_layout
-
-\begin_layout Description
-resize
-\begin_inset LatexCommand index
-name "ndarray!methods!resize"
-
-\end_inset
-
- (newshape, refcheck=1, order='C')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Resize an array in-place.
- This changes self (in-place) to be an array with the new shape, reallocating
- space for the data area if necessary.
- If the data memory must be changed because the number of new elements is
- different than self.size, then an error will occur if this array does not
- own its data or if another object is referencing this one.
- Only a single-segment array can be resized.
- The method returns None.
- To bypass the reference count check, then set refcheck=0.
- The purpose of the reference count check is to make sure you don't use
- this array as a buffer for another Python object and then reallocate the
- memory.
- However, reference counts can increase in other ways so if you are sure
- that you have not shared the memory for this array to another Python object,
- then you may safely set refcheck=0.
-
-\end_layout
-
-\begin_layout Description
-transpose
-\begin_inset LatexCommand index
-name "ndarray!methods!transpose"
-
-\end_inset
-
- (<None>)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array view with the shape transposed according to the argument.
- An argument of None is equivalent to range(self.ndim)[::-1].
- The argument can either be a tuple or multiple integer arguments.
- This method returns a new array with permuted shape and strides attributes
- using the same data as self.
-
-\end_layout
-
-\begin_layout MyCode
->>> a = arange(40).reshape((2,4,5))
-\newline
->>> b = a.transpose(2,0,1)
-\newline
->>> print a.shape,
- b.shape
-\newline
-(2, 4, 5) (5, 2, 4)
-\newline
->>> print a.strides, b.strides
-\newline
-(80, 20, 4) (4, 80,
- 20)
-\newline
->>> print a
-\newline
-[[[ 0 1 2 3 4]
-\newline
- [ 5 6 7 8 9]
-\newline
- [10 11 12 13 14]
-\newline
- [15
- 16 17 18 19]]
-\newline
-
-\newline
- [[20 21 22 23 24]
-\newline
- [25 26 27 28 29]
-\newline
- [30 31 32 33 34]
-\newline
- [35
- 36 37 38 39]]]
-\newline
->>> print b
-\newline
-[[[ 0 5 10 15]
-\newline
- [20 25 30 35]]
-\newline
-
-\newline
- [[ 1 6 11 16]
-\newline
-
- [21 26 31 36]]
-\newline
-
-\newline
- [[ 2 7 12 17]
-\newline
- [22 27 32 37]]
-\newline
-
-\newline
- [[ 3 8 13 18]
-\newline
- [23 28 33
- 38]]
-\newline
-
-\newline
- [[ 4 9 14 19]
-\newline
- [24 29 34 39]]]
-\end_layout
-
-\begin_layout Description
-swapaxes
-\begin_inset LatexCommand index
-name "ndarray!methods!swapaxes"
-
-\end_inset
-
- (axis1, axis2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array view with axis1 and axis2 swapped.
- This is a special case of the transpose method with argument equal to arg=range
-(self.ndim); arg[axis1], arg[axis2] = arg[axis2], arg[axis1].
- See the
-\series bold
-rollaxis
-\series default
- function for a routine that transposes the array with the axes rolled instead
- of swapped.
-
-\end_layout
-
-\begin_layout Description
-flatten
-\begin_inset LatexCommand index
-name "ndarray!methods!flatten"
-
-\end_inset
-
- (order='C')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a new 1-d array with data copied from self.
- Equivalent to but slightly faster then a.flat.copy().
-
-\end_layout
-
-\begin_layout Description
-ravel
-\begin_inset LatexCommand index
-name "ndarray!methods!ravel"
-
-\end_inset
-
- (order='C')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a 1-d version of self.
- If self is single-segment, then the new array references self, otherwise,
- a copy is made.
-\end_layout
-
-\begin_layout Description
-squeeze
-\begin_inset LatexCommand index
-name "ndarray!methods!squeeze"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array with all unit-length dimensions squeezed out.
-\end_layout
-
-\begin_layout Subsection
-Array item selection and manipulation
-\end_layout
-
-\begin_layout Standard
-For array methods that take an axis keyword, it defaults to None.
- If axis is None, then the array is treated as a 1-D array.
- Any other value for axis represents the dimension along which the operation
- should proceed.
-
-\end_layout
-
-\begin_layout Description
-take
-\begin_inset LatexCommand index
-name "ndarray!methods!take"
-
-\end_inset
-
- (indices=, axis=None, out=None, mode='raise')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The functionality of this method is available using the advanced indexing
- ability of the
-\family typewriter
-ndarray
-\family default
- object.
- However, for doing selection along a single axis it is usually faster to
- use take.
- If axis is not None, this method is equivalent to
-\family typewriter
-self[indxobj]
-\family default
- preceeded by
-\family typewriter
-indxobj=[slice(None)]*self.ndim; indxobj[
-\series bold
-axis
-\series default
-] =
-\family default
-
-\family typewriter
-\series bold
-indices
-\family default
-\series default
-.
- It returns the elements or sub-arrays from self indicated by the index
- numbers in indices.
- If axis is None, then this method is equivalent to
-\family typewriter
-self.flat[indices]
-\family default
-.
- The out and mode arguments allow for specification of the output array
- and how out-of-bounds indices will be handled ('raise': raise an error,
- 'wrap': wrap around, 'clip': clip to range)
-\end_layout
-
-\begin_layout Description
-put
-\begin_inset LatexCommand index
-name "ndarray!methods!put"
-
-\end_inset
-
- (indices=, values=, mode='raise')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Performs the equivalent of
-\end_layout
-
-\begin_layout LyX-Code
-for n in
-\series bold
-indices
-\series default
-:
-\end_layout
-
-\begin_layout LyX-Code
- self.flat[n] =
-\series bold
-values
-\series default
-[n]
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Values is repeated if it is too short.
- The mode argument specifies what to do if n is too large.
-
-\end_layout
-
-\begin_layout Description
-repeat
-\begin_inset LatexCommand index
-name "ndarray!methods!repeat"
-
-\end_inset
-
- (repeats=, axis=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Copy elements (or sub-arrays selected along axis) of self
-\series bold
-repeats
-\series default
- times.
- The repeats argument must be a sequence of length self.shape[axis] or a
- scalar.
- The repeats argument dictates how many times the element (or sub-array)
- will be repeated in the result array.
-
-\end_layout
-
-\begin_layout Description
-choose
-\begin_inset LatexCommand index
-name "ndarray!methods!choose"
-
-\end_inset
-
- (choices, out=None, mode='raise')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The array must be an integer (or bool) array with entries from
-\begin_inset Formula $0$
-\end_inset
-
- to
-\begin_inset Formula $n$
-\end_inset
-
-.
- Choices is a tuple of
-\begin_inset Formula $n$
-\end_inset
-
- choice arrays:
-\begin_inset Formula $b0,\, b1,\,\ldots\,,\, bn$
-\end_inset
-
-.
- (Alternatively, choices can be replaced with
-\begin_inset Formula $n$
-\end_inset
-
- arguments where each argument is a choice array).
- The return array will be formed from the elements of the choice arrays
- according to the value of the elements of self.
- In other words, the output array will merge the choice arrays together
- by using the value of self at a particular position to select which choice
- array should be used for the output at a particular position.
- The out keyword allows specification of an output array and the clip keyword
- allows different behavior when self contains entries outside the number
- of choices.
- The acceptable arguments to mode are 'raise' (RAISE), 'wrap' (WRAP), and
- 'clip' (CLIP) ('raise' produces an error, 'wrap' converts the number into
- range by periodic wrapping so that numbers <0 have
-\begin_inset Formula $n$
-\end_inset
-
- repeatedly added and numbers >=
-\begin_inset Formula $n$
-\end_inset
-
- have
-\begin_inset Formula $n$
-\end_inset
-
- repeatedly subtracted, and 'clip' will clip all entries to be within the
- range [0,
-\begin_inset Formula $n$
-\end_inset
-
-).
-\end_layout
-
-\begin_layout MyCode
->>> a = array([0,3,2,1])
-\newline
->>> a.choose([0,1,2,3],[10,11,12,13],
-\newline
-...
- [20,21,22,23],[30,31,32,33])
-\newline
-array([ 0, 31, 22, 13])
-\end_layout
-
-\begin_layout Description
-sort
-\begin_inset LatexCommand index
-name "ndarray!methods!sort"
-
-\end_inset
-
- (axis=-1, kind='quick', order=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Sort the array in-place and return None.
- The sort takes place over the given axis using an underlying sort algorithm
- specified by kind.
- The sorting algorithms available are 'quick', 'heap', and 'merge'.
- For flexible types only the quicksort algorithm is available.
- For arrays with fields defined, the order keyword allows specification
- of the order in which to use the field names in the sort.
- If order is a string then it is the field name to use to define the sort.
- If order is a list (or tuple) of strings, then it specifies a lexicographic
- ordering so that the first listed field name is compared first if that
- results in equality, the second listed field name is used for the comparison
- and so on.
- If order is None, then arrays with fields use the first field for comparison.
-
-\end_layout
-
-\begin_layout MyCode
->>> a=array([[0.2,1.3,2.5],[1.5,0.1,1.4]]);
-\newline
->>> b=a.copy(); b.sort(0); print b
-\newline
-[[
- 0.2 0.1 1.4]
-\newline
- [ 1.5 1.3 2.5]]
-\newline
->>> b=a.copy(); b.sort(1); print b
-\newline
-[[ 0.2 1.3 2.5]
-\newline
-
- [ 0.1 1.4 1.5]]
-\end_layout
-
-\begin_layout Description
-argsort
-\begin_inset LatexCommand index
-name "ndarray!methods!argsort"
-
-\end_inset
-
- (axis=-1, kind='quick', order=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an index array of the same size as self showing which indices along
- the given axis should be selected to sort self along that axis.
- Uses an underlying sort algorithm specified by kind.
- The sorting algorithms available are 'quick', 'heap', and 'merge'.
- For arrays with fields defined, the order keyword allows specification
- of the order in which to use the field names in the sort.
- If order is a string then it is the field name to use to define the sort.
- If order is a list (or tuple) of strings, then it specifies a lexicographic
- ordering so that the first listed field name is compared first if that
- results in equality, the second listed field name is used for the comparison
- and so on.
- If order is None, then arrays with fields use the first field for comparison.
-
-\end_layout
-
-\begin_layout MyCode
->>> b=a.copy(); print b.argsort(0)
-\newline
-[[0 1 1]
-\newline
- [1 0 0]]
-\newline
->>> b=a.copy(); print b.argsort(1
-)
-\newline
-[[0 1 2]
-\newline
- [1 2 0]]
-\end_layout
-
-\begin_layout Tip
-Complex valued arrays sort lexicographically by comparing first the real
- parts and then the imaginary parts if the real parts are the same.
-\end_layout
-
-\begin_layout Description
-searchsorted
-\begin_inset LatexCommand index
-name "ndarray!methods!searchsorted"
-
-\end_inset
-
- (values, side='left')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an index array (dtype=intp) of the same shape as values showing
- the index where the value would fit in self.
- The index is such that self[index-1]
-\begin_inset Formula $<$
-\end_inset
-
- value
-\begin_inset Formula $\le$
-\end_inset
-
- self[index] when side is 'left'.
- In this formula self[self.size]=
-\begin_inset Formula $\infty$
-\end_inset
-
- and self[-1]=
-\begin_inset Formula $-\infty$
-\end_inset
-
-.
- Therefore, if value is larger than all elements of self, then index is
- self.size.
- If value is smaller than all elements of self, then index is 0.
- Self must be a sorted 1-d array.
- If elements of self are repeated, the index of the first occurrence is
- used.
- If side is 'right', then the search rule is switched so that the
-\begin_inset Formula $<$
-\end_inset
-
- sign is on the
-\begin_inset Quotes eld
-\end_inset
-
-right
-\begin_inset Quotes erd
-\end_inset
-
- instead of the left in the search rule.
- In other words, the index returned is such that self[index-1]
-\begin_inset Formula $\le$
-\end_inset
-
-value
-\begin_inset Formula $<$
-\end_inset
-
- self[index].
-\end_layout
-
-\begin_layout MyCode
->>> b=a.ravel(); b.sort()
-\newline
->>> b.searchsorted([0.0, 1.35, 2.0, 3.0])
-\newline
-array([0, 3,
- 5, 6])
-\end_layout
-
-\begin_layout Description
-nonzero
-\begin_inset LatexCommand index
-name "ndarray!methods!nonzero"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the
-\begin_inset Formula $n$
-\end_inset
-
--dimensional indices for elements of the
-\begin_inset Formula $n$
-\end_inset
-
--dimensional array self that are nonzero into an
-\begin_inset Formula $n$
-\end_inset
-
--tuple of equal-length index arrays.
- In particular, notice that a 0-dimensional array always returns an empty
- tuple.
-
-\end_layout
-
-\begin_layout MyCode
->>> x = arange(15); y=x.reshape(3,5)
-\newline
->>> (x>8).nonzero()
-\newline
-(array([ 9, 10, 11,
- 12, 13, 14]),)
-\newline
->>> (y>8).nonzero()
-\newline
-(array([1, 2, 2, 2, 2, 2]), array([4, 0,
- 1, 2, 3, 4]))
-\end_layout
-
-\begin_layout Description
-compress
-\begin_inset LatexCommand index
-name "ndarray!methods!compress"
-
-\end_inset
-
- (condition=, axis=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This method expects condition to be a one-dimensional mask array of the
- same length as self.shape[axis].
- If the array is less than self.shape[axis], then False is assumed for the
- missing elements.
- The method returns the elements (or sub-arrays along the given axis) of
- self where condition is true.
- The shape of the return array is self.shape with the axis dimension replaced
- by the number of True elements of condition.
- The same effect can often be accomplished using array indexing.
-\end_layout
-
-\begin_layout MyCode
->>> x=array([0,1,2,3])
-\newline
->>> x.compress(x > 2)
-\newline
-array([3])
-\newline
->>> x[x>2]
-\newline
-array([3])
-\end_layout
-
-\begin_layout Description
-diagonal
-\begin_inset LatexCommand index
-name "ndarray!methods!diagonal"
-
-\end_inset
-
- (offset=0, axis1=0, axis2=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If self is 2-d, return the
-\series bold
-offset
-\series default
- (from the main diagonal) diagonal of self.
- If self is larger than 2-d, then return an array constructed from all the
- diagonals created from all the 2-d sub-arrays formed using all of axis1
- and axis2.
- The offset parameter is with respect to axis2.
- The shape of the returned array is found by removing the axis1 and axis2
- entries from self.shape and then appending the length of the offset diagonal
- of each 2-d sub-array.
-\end_layout
-
-\begin_layout MyCode
->>> a=arange(25).reshape(5,5); print a
-\newline
-[[ 0 1 2 3 4]
-\newline
- [ 5 6 7 8 9]
-\newline
-
- [10 11 12 13 14]
-\newline
- [15 16 17 18 19]
-\newline
- [20 21 22 23 24]]
-\newline
->>> print a.diagonal()
-\newline
-[
- 0 6 12 18 24]
-\newline
->>> print a.diagonal(1)
-\newline
-[ 1 7 13 19]
-\newline
->>> print a.diagonal(-1)
-\newline
-[
- 5 11 17 23]
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float table
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-Array item selection and shape manipulation methods.
- If axis is an argument, then the calculation is performed along that axis.
- An axis value of None means the array is flattened before calculation proceeds.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-setlength{
-\backslash
-extrarowheight}{0.25eM}
-\end_layout
-
-\begin_layout Standard
-
-\end_layout
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="18" columns="3">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" width="50text%">
-<column alignment="block" valignment="top" leftline="true" rightline="true" width="30text%">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Method
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Arguments
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Description
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-argsort
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-argsort (axis=None, kind='quick')
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Indices showing how to sort array.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-choose
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-choose (c0, c1 , ..., cn, out=None, clip='raise')
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Choose from different arrays based on value of self.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-compress
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(condition=, axis=None, out=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Elements of self where condition is true.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-diagonal
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(offset=0, axis1=0, axis2=1)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Return a diagonal from self.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-flatten
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(order='C')
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-A 1-d copy of self.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-nonzero
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-()
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-True where self is not zero.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-put
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(indices=, values=, mode='raise')
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Place values at 1-d index locations of self.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-ravel
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(order='C')
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-1-d version of self (no data copy if self is C-style contiguous).
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-repeat
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(repeats=, axis=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Repeat elements of self.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-reshape
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(d1,d2,...,dn, order='C')
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Return reshaped version of self.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-resize
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(d1,d2,...,dn, refcheck=1, order='Any')
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Resize self in-place.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-searchsorted
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(values)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Show where values would be placed in self (assumed sorted).
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-sort
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None, kind='quick')
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Copy of self sorted along axis.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-squeeze
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-()
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Squeeze out all length-1 dimensions.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-swapaxes
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis1, axis2)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Swap two dimensions of self.
-
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-take
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(indices=, axis=None, out=None, mode='raise')
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Select elements of self along axis according to indices.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-transpose
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(permute <None>)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Rearrange shape of self according to permute.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Subsection
-Array calculation
-\end_layout
-
-\begin_layout Standard
-Many of these methods take an argument named axis.
- In such cases, if axis is None (the default), the array is treated as a
- 1-d array and the operation is performed over the entire array.
- This behavior is also the default if self is a 0-dimensional array or array
- scalar.
- If axis is an integer, then the operation is done over the given axis (for
- each 1-d subarray that can be created along the given axis).
- The parameter dtype specifies the data type over which a reduction operation
- (like summing) should take place.
- The default reduce data type is the same as the data type of self.
- To avoid overflow, it can be useful to perform the reduction using a larger
- data type.
- For several methods, an optional out argument can be provided and the result
- will be placed into the output array given.
- The out argument must be an ndarray and have the same number of elements.
- It can be of a different type in which case casting will be performed.
-
-\end_layout
-
-\begin_layout Description
-max
-\begin_inset LatexCommand index
-name "ndarray!methods!max"
-
-\end_inset
-
- (axis=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the largest value in self.
- This is a better way to compute the maximum over an array, than using max(self).
- The latter uses the generic sequence interface to self.
- This will be slower, and will try to get an answer by comparing whole sub-array
-s of self.
- This will be incorrect for arrays larger than 1-d.
-\end_layout
-
-\begin_layout Description
-argmax
-\begin_inset LatexCommand index
-name "ndarray!methods!argmax"
-
-\end_inset
-
- (axis=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the (first, 1-d) index of the largest value in self.
-\end_layout
-
-\begin_layout Description
-min
-\begin_inset LatexCommand index
-name "ndarray!methods!min"
-
-\end_inset
-
- (axis=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the smallest value in self.
- This is a better way to compute the minimum over an array, than using min(self).
- The latter uses the generic sequence interface to self.
- This will be slower, and will try to get an answer by comparing whole sub-array
-s of self.
- This will be incorrect for arrays larger than 1-d.
-\end_layout
-
-\begin_layout Description
-argmin
-\begin_inset LatexCommand index
-name "ndarray!methods!argmin"
-
-\end_inset
-
- (axis=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the (first, 1-d) index of the smallest value in self.
-\end_layout
-
-\begin_layout Description
-ptp
-\begin_inset LatexCommand index
-name "ndarray!methods!ptp"
-
-\end_inset
-
- (axis=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the difference of the largest to the smallest value in self.
- Equivalent to self.max(axis) - self.min(axis)
-\end_layout
-
-\begin_layout Description
-clip
-\begin_inset LatexCommand index
-name "ndarray!methods!clip"
-
-\end_inset
-
- (min=,max=, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a new array where any element in self less than min is set to min
- and any element less than max is set to max.
- Equivalent to self[self<min]=min; self[self>max]=max.
-\end_layout
-
-\begin_layout Description
-conj
-\begin_inset LatexCommand index
-name "ndarray!methods!conj"
-
-\end_inset
-
- (out=None)
-\end_layout
-
-\begin_layout Description
-conjugate
-\begin_inset LatexCommand index
-name "ndarray!methods!conjugate"
-
-\end_inset
-
- (out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the conjugate of elements of the array.
-\end_layout
-
-\begin_layout Description
-round
-\begin_inset LatexCommand index
-name "ndarray!methods!round"
-
-\end_inset
-
- (decimals=0, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Round the elements of the array to the nearest decimal.
- For decimals < 0, the rounding is done to the nearest tens, hundreds, etc.
- Rounding of exactly the half-interval is to the nearest even integer.
- This is the only difference with standard Python rounding.
-\end_layout
-
-\begin_layout Description
-trace
-\begin_inset LatexCommand index
-name "ndarray!methods!trace"
-
-\end_inset
-
- (offset=0, axis1=0, axis2=1, dtype=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Perform a summation along each diagonal specified by offset, axis1, and
- axis2.
- Equivalent to diagonal(offset,axis1,axis2).sum(axis=-1, dtype=dtype)
-\end_layout
-
-\begin_layout Description
-sum
-\begin_inset LatexCommand index
-name "ndarray!methods!sum"
-
-\end_inset
-
- (axis=None, dtype=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the sum
-\begin_inset Formula \[
-\sum_{i=0}^{N-1}\textrm{self}[\underbrace{:,\ldots,:}_{\textrm{axis}},i]\]
-
-\end_inset
-
- where axis ':' objects are placed before the
-\begin_inset Formula $i.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-cumsum
-\begin_inset LatexCommand index
-name "ndarray!methods!cumsum"
-
-\end_inset
-
- (axis=None, dtype=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the cumulative sum.
- If ret is the return array of the same shape as
-\begin_inset Formula $\textrm{self},$
-\end_inset
-
- then
-\begin_inset Formula \[
-\textrm{ret}[\underbrace{:,\ldots,:}_{\textrm{axis}},j]=\sum_{i=0}^{j}\textrm{self}[\underbrace{:,\ldots,:}_{\textrm{axis}},i].\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-mean
-\begin_inset LatexCommand index
-name "ndarray!methods!mean"
-
-\end_inset
-
- (axis=None, dtype=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the average value caculated as
-\begin_inset Formula \[
-\frac{1}{N}\sum_{i=0}^{N-1}\textrm{self}[\underbrace{:,\ldots,:}_{\textrm{axis}},i]\]
-
-\end_inset
-
- where
-\begin_inset Formula $N$
-\end_inset
-
- is self.shape[axis] and axis ':' objects are placed before the
-\begin_inset Formula $i.$
-\end_inset
-
- The sum is done in the data-type of self unless self is an integer or Boolean
- data-type and then it is done over the float data-type.
-
-\end_layout
-
-\begin_layout Description
-var
-\begin_inset LatexCommand index
-name "ndarray!methods!var"
-
-\end_inset
-
- (axis=None, dtype=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the variance of the data calculated as
-\begin_inset Formula \[
-\frac{1}{N}\sum_{i=0}^{N-1}\left(\textrm{self}[\underbrace{:,\ldots,:}_{\textrm{axis}},i]-\mu\right)^{2}\]
-
-\end_inset
-
- where
-\begin_inset Formula $N$
-\end_inset
-
- is self.shape[axis] and
-\begin_inset Formula $\mu$
-\end_inset
-
- is the mean (restored to the same number of dimensions as self with
-\begin_inset Formula $\mu$
-\end_inset
-
- copied along the axis dimension).
- This is equivalent to (self**2).mean - self.mean()**2 and ((self-self.mean())**2).m
-ean().
- The value of
-\begin_inset Formula $N-1$
-\end_inset
-
- was not chosen for normalization because while it gives an
-\begin_inset Quotes eld
-\end_inset
-
-unbiased
-\begin_inset Quotes erd
-\end_inset
-
- estimate, it is not always prudent to return unbiased estimates as they
- may have larger mean-square error.
- The sum is done using a float data-type if self has integer or Boolean
- data-type, otherwise it is done using the same data-type as self.
-
-\end_layout
-
-\begin_layout Description
-std
-\begin_inset LatexCommand index
-name "ndarray!methods!std"
-
-\end_inset
-
- (axis=None, dtype=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the standard deviation calculated as
-\begin_inset Formula \[
-\sqrt{\frac{1}{N}\sum_{i=0}^{N-1}\left(\textrm{self}[\underbrace{:,\ldots,:}_{\textrm{axis}},i]-\mu\right)^{2}}\]
-
-\end_inset
-
- where
-\begin_inset Formula $N$
-\end_inset
-
- is self.shape[axis] and
-\begin_inset Formula $\mu$
-\end_inset
-
- is the mean (restored to the same number of dimensions as self with
-\begin_inset Formula $\mu$
-\end_inset
-
- copied along the axis dimension).
- The sum is done using the same data-type as self unless self is an integer
- or Boolean data-type and then it is done using a float data-type.
-
-\end_layout
-
-\begin_layout Description
-prod
-\begin_inset LatexCommand index
-name "ndarray!methods!prod"
-
-\end_inset
-
- (axis=None, dtype=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the product calculated as
-\begin_inset Formula \[
-\prod_{i=0}^{N-1}\textrm{self}[\underbrace{:,\ldots,:}_{\textrm{axis}},i].\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-cumprod
-\begin_inset LatexCommand index
-name "ndarray!methods!cumprod"
-
-\end_inset
-
- (axis=None, dtype=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the cumulative product so that the return array, ret, is the same
- shape as self and
-\begin_inset Formula \[
-\textrm{ret}[\underbrace{:,\ldots,:}_{\textrm{axis}},j]=\prod_{i=0}^{j}\textrm{self}[\underbrace{:,\ldots,:}_{\textrm{axis}},i].\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-all
-\begin_inset LatexCommand index
-name "ndarray!methods!all"
-
-\end_inset
-
- (axis=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return True if all entries along axis evaluate True, otherwise return False.
-\end_layout
-
-\begin_layout Description
-any
-\begin_inset LatexCommand index
-name "ndarray!methods!any"
-
-\end_inset
-
- (axis=None, out=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return True if any entries along axis evaluate True, otherwise return False
-\begin_inset LatexCommand index
-name "ndarray!methods|)"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float table
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-Array object calculation methods.
- If axis is an argument, then the calculation is performed along that axis.
- An axis value of None means the array is flattened before calculation proceeds.
- All of these methods can take an optional out= argument which can specify
- the output array to write the results into.
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-setlength{
-\backslash
-extrarowheight}{0.5eM}
-\end_layout
-
-\begin_layout Standard
-
-\end_layout
-
-\begin_layout Standard
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="18" columns="3">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" width="30text%">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Method
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Arguments
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\family sans
-\series bold
-\size large
-Description
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-all
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-true if all entries are true.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-any
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-true if any entries are true.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-argmax
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-index of largest value.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-argmin
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-index of smallest value.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-clip
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(min=, max=)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-self[self>max]=max; self[self<min]=min
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-conj
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-()
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-complex conjugate
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-cumprod
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None, dtype=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-cumulative product
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-cumsum
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None, dtype=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-cumulative sum
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-max
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-maximum of self
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-mean
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None, dtype=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-mean of self
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-min
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-minimum of self
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-prod
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None, dtype=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-multiply elements of self together
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-ptp
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-self.max(axis)-self.min(axis)
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-var
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None, dtype=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-variance of self
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-std
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None, dtype=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-standard deviation of self
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-sum
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(axis=None, dtype=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-add elements of self together
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-
-\series bold
-trace
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-(offset, axis1=0, axis2=0, dtype=None)
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-sum along a diagonal
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Array Special Methods
-\end_layout
-
-\begin_layout Standard
-Methods
-\begin_inset LatexCommand index
-name "ndarray!special methods|("
-
-\end_inset
-
- in this chapter are not generally meant to be called directly by the user.
- They are called by Python and are used to customize behavior of the ndarray
- object as it interacts with the Python language and standard library.
-
-\end_layout
-
-\begin_layout Subsection
-Methods for standard library functions
-\end_layout
-
-\begin_layout Description
-__copy__
-\begin_inset LatexCommand index
-name "ndarray!special methods!copy"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- To allow copy.copy(a) to perform a shallow copy of an array.
- Exactly the same as self.copy() (contents of object arrays are not copied).
-
-\end_layout
-
-\begin_layout Description
-__deepcopy__
-\begin_inset LatexCommand index
-name "ndarray!special methods!deepcopy"
-
-\end_inset
-
- (memodict)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- To allow copy.deepcopy(a) to perform a deep copy.
- This is the same as a shallow copy unless self is an object array.
- Then, after the shallow copy is made, a copy.deepcopy(item) is called for
- every item in the object array.
-
-\end_layout
-
-\begin_layout Description
-__reduce__
-\begin_inset LatexCommand index
-name "ndarray!special methods!reduce"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-__setstate__
-\begin_inset LatexCommand index
-name "ndarray!special methods!setstate"
-
-\end_inset
-
- (shape, typestr, isfortran, data)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Pickling support for arrays is provided by these two methods.
- When an array needs to be pickled, the __reduce__() method is called to
- provide a 3-tuple of already-pickleable objects.
- To construct a new object from the pickle, the first two elements of the
- 3-tuple are used to construct a new (0-length) array of the correct type
- and the last element of the 3-tuple, which is itself a 4-tuple of (shape,
- typestr, isfortran, data) is passed to the __setstate__ method of the newly
- created array to restore its contents.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The reduce method returns a 3-tuple consisting of (callable, args, state)
- where callable is a simple constructor function that handles subclasses
- of the ndarray.
- Also, args is a 3-tuple of arguments to pass to this constructor function
- (type(self), (0,), self.dtypechar), and state is a 4-tuple of information
- giving the object's state (self.shape, self.dtypedescr, isfortran, string_or_list
-).
- In this tuple, isfortran is a Bool stating whether the following flattened
- data is in Fortran order or not, and string_or_list is a string formed
- by self.tostring() if the data type is not object.
- If the data type of self is an object array, then string_or_list is a flat
- list equivalent to self.ravel().tolist().
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- On load from a pickle, the pickling code uses the first two elements from
- the tuple returned by reduce to construct an empty 0-dimensional subclass
- of the correct type.
- The last element is then passed to the __setstate__ method of the newly
- created array to restore its contents.
-
-\end_layout
-
-\begin_layout Note
-When data is a string, the __setstate__ method will directly use the string
- memory as the array memory (new.base will point to the string).
- The typestr contains enough information to decode how the memory should
- be interpreted.
-\end_layout
-
-\begin_layout Subsection
-Basic customization
-\end_layout
-
-\begin_layout Description
-__new__
-\begin_inset LatexCommand index
-name "ndarray!special methods!new"
-
-\end_inset
-
- (subtype, shape=, dtype=long_, buffer=None, offset=0, strides=None, order=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This method creates a new ndarray.
- It is typically only used in the __new__ method of a subclass.
- This method is called to construct a new array whenever the object name
- is called,
-\family typewriter
-a=ndarray(...)
-\family default
-.
- It supports two basic modes of array creation:
-\end_layout
-
-\begin_layout Enumerate
-a single-segment array of the specified shape and data-type from newly allocated
- memory;
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-uses shape, dtype, strides, and order arguments; others are ignored;
-\end_layout
-
-\begin_layout Enumerate
-The order argument allows specification of a Fortran-style contiguous memory
- segment (order='Fortran');
-\end_layout
-
-\begin_layout Enumerate
-If strides is given, then it specifies the new strides of the array (and
- the order keyword is ignored).
- The strides will be checked for consistency with the dimension size so
- that steps outside of the memory won't occur.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-an array of the given shape and data type using the provided object, buffer,
- which must export the buffer interface.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-all arguments can be used;
-\end_layout
-
-\begin_layout Enumerate
-strides can be given and will be checked for consistency with the shape,
- data type, and available memory in buffer;
-\end_layout
-
-\begin_layout Enumerate
-order indicates whether the data buffer should be interpreted as Fortran-style
- contiguous (order='Fortran') or not;
-\end_layout
-
-\begin_layout Enumerate
-offset can be used to start the array data at some offset in the buffer.
-
-\end_layout
-
-\end_deeper
-\begin_layout Note
-The ndarray uses the default no-op __init__
-\begin_inset LatexCommand index
-name "ndarray!special methods!init"
-
-\end_inset
-
- function because the array is completely initialized after __new__ is called.
-\end_layout
-
-\begin_layout Description
-__array__
-\begin_inset LatexCommand index
-name "ndarray!special methods!array"
-
-\end_inset
-
- (dtype {None})
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is a special method that should always return an object of type ndarray.
- Useful for subclasses that need to get to the ndarray object.
-
-\end_layout
-
-\begin_layout Description
-__array_wrap__
-\begin_inset LatexCommand index
-name "ndarray!special methods!array\\_wrap"
-
-\end_inset
-
- (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is a special method that always returns an object of the same Python
- type as self using the array passed as an argument.
- This is mainly useful for subclasses as it is an easy way to get the subclass
- back from an ndarray.
-\end_layout
-
-\begin_layout Description
-__lt__
-\begin_inset LatexCommand index
-name "ndarray!special methods!lt"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__le__
-\begin_inset LatexCommand index
-name "ndarray!special methods!le"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__gt__
-\begin_inset LatexCommand index
-name "ndarray!special methods!gt"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__ge__
-\begin_inset LatexCommand index
-name "ndarray!special methods!ge"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__eq__
-\begin_inset LatexCommand index
-name "ndarray!special methods!eq"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__ne__
-\begin_inset LatexCommand index
-name "ndarray!special methods!ne"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Defined to support rich comparisons (<, <=, >, >=, ==, !=) on ndarrays
- using universal functions.
-
-\end_layout
-
-\begin_layout Description
-__str__
-\begin_inset LatexCommand index
-name "ndarray!special methods!str"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-__repr__
-\begin_inset LatexCommand index
-name "ndarray!special methods!repr"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These functions print the array when called by str(self) and repr(self)
- respectively.
- Array printing can be changed using set_string_function(..).
- Default array printing has been borrowed from numarray whose printing code
- was written by Perry Greenfield and J.
- Todd Miller.
- By default, arrays print such that
-\end_layout
-
-\begin_layout Enumerate
-The last axis is always printed left to right.
-\end_layout
-
-\begin_layout Enumerate
-The next-to-last axis is printed top to bottom.
-\end_layout
-
-\begin_layout Enumerate
-Remaining axes are printed top to bottom with increasing numbers of separators.
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Five parameters of the printing can be set using keyword arguments with
-
-\family typewriter
-set_printoptions(...)
-\family default
-.
- The parameters
-\begin_inset LatexCommand index
-name "set\\_printoptions"
-
-\end_inset
-
- can all be retrieved using
-\family typewriter
-get_printoptions()
-\family default
-.
- These printing options
-\begin_inset LatexCommand index
-name "get\\_printoptions"
-
-\end_inset
-
- are
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-precision the number of digits of precision for floating point output (default
- 8);
-\end_layout
-
-\begin_layout Description
-threshold total number of array elements which triggers summarization rather
- than full representation (default 1000);
-\end_layout
-
-\begin_layout Description
-edgeitems number of array items in summary at beginning an end of each dimension
- (default 3);
-\end_layout
-
-\begin_layout Description
-linewidth the number of characters per line for the purpose of inserting
- line breaks (default 71);
-\end_layout
-
-\begin_layout Description
-suppress Boolean indicating whether or not to suppress printing of small
- floating point values using scientific notation (default False).
-
-\end_layout
-
-\end_deeper
-\begin_layout Description
-__nonzero__
-\begin_inset LatexCommand index
-name "ndarray!special methods!nonzero"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Truth-value testing for the array as a whole.
- It is called whenever the truth value of the ndarray as a whole object
- is required.
- This raises an error if the number of elements in the the array is larger
- than 1 because the truth value of such arrays is ambiguous.
- Use .any() and .all() instead to be clear about what is meant in such cases.
- If the number of elements is 0 then False is returned.
- If there is one element in the array, then the truth-value of this element
- is returned.
-\end_layout
-
-\begin_layout Subsection
-Container customization
-\end_layout
-
-\begin_layout Description
-__len__
-\begin_inset LatexCommand index
-name "ndarray!special methods!len"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns self.shape[0].
- It is called in response to len(self).
- Use self.size to get the total number of elements in the array.
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Notice that the default Python iterator for sequences is used when arrays
- are used in places that expect an iterator.
- This iterator returns successively self[0], self[1], ..., self[self.__len__()].
- Use self.flat to get an iterator that walks through the entire array one
- element at a time.
-\end_layout
-
-\begin_layout Description
-__getitem__
-\begin_inset LatexCommand index
-name "ndarray!special methods!getitem"
-
-\end_inset
-
- (key)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Called when evaluating self[key] construct.
- Items from the array can be selected using this customization.
- This construct has both standard and extended indexing abilities which
- are explained in Section
-\begin_inset LatexCommand ref
-reference "sec:Array-indexing"
-
-\end_inset
-
-.
- A named field can be retrieved if key is a string and fields are defined
- in the dtypedescr object associated with this array.
-
-\end_layout
-
-\begin_layout Description
-__setitem__
-\begin_inset LatexCommand index
-name "ndarray!special methods!setitem"
-
-\end_inset
-
- (key, value)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Called when evaluating self[key]=value.
- Items in the array can be set using this construct.
- This construct is explained in Section
-\begin_inset LatexCommand ref
-reference "sec:Array-indexing"
-
-\end_inset
-
-.
- A named field can be set if key is a string and fields are defined in the
- dtypedescr object associated with this array.
-
-\end_layout
-
-\begin_layout Description
-__getslice__
-\begin_inset LatexCommand index
-name "ndarray!special methods!getslice"
-
-\end_inset
-
- (i, j)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to self.__getitem__(slice(i,j)) but defined mainly so that C
- code can use the sequence interface.
- Called to evaluate self[i:j]
-\end_layout
-
-\begin_layout Description
-__setslice__
-\begin_inset LatexCommand index
-name "ndarray!special methods!setslice"
-
-\end_inset
-
- (i, j, value)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to self.__setitem__(slice(i,j), value) but defined mainly so
- C code can use the sequence interface.
- Called to evaluate self[i:j] = value.
-\end_layout
-
-\begin_layout Description
-__contains__
-\begin_inset LatexCommand index
-name "ndarray!special methods!contains"
-
-\end_inset
-
- (item)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Called to determine truth value of the
-\family typewriter
-item in self
-\family default
- construct.
- Returns the equivalent of (self==item).any()
-\end_layout
-
-\begin_layout Subsection
-Arithmetic customization
-\end_layout
-
-\begin_layout Subsubsection
-Binary
-\end_layout
-
-\begin_layout Description
-__add__
-\begin_inset LatexCommand index
-name "ndarray!special methods!add"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__sub__
-\begin_inset LatexCommand index
-name "ndarray!special methods!sub"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__mul__
-\begin_inset LatexCommand index
-name "ndarray!special methods!mul"
-
-\end_inset
-
- (self, other)
-\end_layout
-
-\begin_layout Description
-__div__
-\begin_inset LatexCommand index
-name "ndarray!special methods!div"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__truediv__
-\begin_inset LatexCommand index
-name "ndarray!special methods!truediv"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__floordiv__
-\begin_inset LatexCommand index
-name "ndarray!special methods!floordiv"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__mod__
-\begin_inset LatexCommand index
-name "ndarray!special methods!mod"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__divmod__
-\begin_inset LatexCommand index
-name "ndarray!special methods!divmod"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__pow__
-\begin_inset LatexCommand index
-name "ndarray!special methods!pow"
-
-\end_inset
-
- (other[,modulo])
-\end_layout
-
-\begin_layout Description
-__lshift__
-\begin_inset LatexCommand index
-name "ndarray!special methods!lshift"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__rshift__
-\begin_inset LatexCommand index
-name "ndarray!special methods!rshift"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__and__
-\begin_inset LatexCommand index
-name "ndarray!special methods!and"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__or__
-\begin_inset LatexCommand index
-name "ndarray!special methods!or"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__xor__
-\begin_inset LatexCommand index
-name "ndarray!special methods!xor"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These methods are defined for ndarrays to implement the operations (
-\family typewriter
-+
-\family default
-,
-\family typewriter
--
-\family default
-,
-\family typewriter
-*
-\family default
-,
-\family typewriter
-/,
-\family default
-
-\family typewriter
-/,
-\family default
-
-\family typewriter
-//
-\family default
-,
-\family typewriter
-%
-\family default
-,
-\family typewriter
-divmod()
-\family default
-,
-\family typewriter
-**
-\family default
- or
-\family typewriter
-pow()
-\family default
-,
-\family typewriter
-<<,
-\family default
-
-\family typewriter
->>
-\family default
-,
-\family typewriter
-&
-\family default
-,
-\family typewriter
-^
-\family default
-,
-\family typewriter
-|
-\family default
-).
- This is done using calls to the corresponding universal function object
- (add, subtract, multiply, divide, true_divide, floor_divide, remainder,
- divide and remainder, power, left_shift, right_shift, bitwise_and, bitwise_xor,
- bitwise_or).
- These implement element-by-element operations for arrays that are broadcastable
- to the same shape.
-
-\end_layout
-
-\begin_layout Itemize
-any third argument to
-\family typewriter
-pow()
-\family default
- is silently ignored as the underlying ufunc (power) only takes two arguments.
-\end_layout
-
-\begin_layout Itemize
-the three division operators are all defined, div is active by default,
- truediv is active when __future__.division is in effect.
-\end_layout
-
-\begin_layout Note
-Because it is a built-in type (written in C), the __r<op>__ special methods
- are not directly defined for the ndarray.
-\end_layout
-
-\begin_layout Subsubsection
-In-place
-\end_layout
-
-\begin_layout Description
-__iadd__
-\begin_inset LatexCommand index
-name "ndarray!special methods!iadd"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__isub__
-\begin_inset LatexCommand index
-name "ndarray!special methods!isub"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__imul__
-\begin_inset LatexCommand index
-name "ndarray!special methods!imul"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__idiv__
-\begin_inset LatexCommand index
-name "ndarray!special methods!idiv"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__itruediv__
-\begin_inset LatexCommand index
-name "ndarray!special methods!itruediv"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__ifloordiv__
-\begin_inset LatexCommand index
-name "ndarray!special methods!ifloordiv"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__imod__
-\begin_inset LatexCommand index
-name "ndarray!special methods!imod"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__ipow__
-\begin_inset LatexCommand index
-name "ndarray!special methods!ipow"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__ilshift__
-\begin_inset LatexCommand index
-name "ndarray!special methods!ilshift"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__irshift__
-\begin_inset LatexCommand index
-name "ndarray!special methods!irshift"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__iand__
-\begin_inset LatexCommand index
-name "ndarray!special methods!iand"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__ixor__
-\begin_inset LatexCommand index
-name "ndarray!special methods!ixor"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-__ior__
-\begin_inset LatexCommand index
-name "ndarray!special methods!ior"
-
-\end_inset
-
- (other)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These methods are implemented to handle the inplace operatiors (
-\family typewriter
-+=
-\family default
-,
-\family typewriter
--=
-\family default
-,
-\family typewriter
-*=
-\family default
-,
-\family typewriter
-/=
-\family default
-,
-\family typewriter
-/=
-\family default
-,
-\family typewriter
-//=
-\family default
-,
-\family typewriter
-%=
-\family default
-,
-\family typewriter
-**
-\family default
-=,
-\family typewriter
-<<
-\family default
-=,
-\family typewriter
->>=
-\family default
-,
-\family typewriter
-&=
-\family default
-,
-\family typewriter
-^=
-\family default
-,
-\family typewriter
-|=
-\family default
-).
- The inplace operators are implemented using the corresponding ufunc and
- its ability to take an output argument (which is set as self).
- Using inplace operations can save space and time and is therefore encouraged
- whenever appropriate.
-
-\end_layout
-
-\begin_layout Warning
-In place operations will perform the calculation using the precision decided
- by the data type of the two operands, but will silently downcast the result
- (if necessary) so it can fit back into the array.
- Therefore, for mixed precision calculations, a <op>= B can be different
- than a = a <op> B.
- For example, suppose a=ones((3,3)).
- Then a+=3j is different than a=a+3j While they both perform the same computatio
-n, a+=3j casts the result to fit back in a, while a=a+3j re-binds the name
- a to the result.
-\end_layout
-
-\begin_layout Subsubsection
-Unary operations
-\end_layout
-
-\begin_layout Description
-__neg__
-\begin_inset LatexCommand index
-name "ndarray!special methods!neg"
-
-\end_inset
-
- (self)
-\end_layout
-
-\begin_layout Description
-__pos__
-\begin_inset LatexCommand index
-name "ndarray!special methods!pos"
-
-\end_inset
-
- (self)
-\end_layout
-
-\begin_layout Description
-__abs__
-\begin_inset LatexCommand index
-name "ndarray!special methods!abs"
-
-\end_inset
-
- (self)
-\end_layout
-
-\begin_layout Description
-__invert__
-\begin_inset LatexCommand index
-name "ndarray!special methods!invert"
-
-\end_inset
-
- (self)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These functions are called in response to the unary operations (
-\family typewriter
--
-\family default
-,
-\family typewriter
-+
-\family default
-,
-\family typewriter
-abs()
-\family default
-,
-\family typewriter
-~
-\family default
-).
- With the exception of __pos__, these are implemented using ufuncs (negative,
- absolute, invert).
- The unary
-\family typewriter
-+
-\family default
- operator, however simply calls self.copy(), and can therefore be used to
- get a copy of an array.
-
-\end_layout
-
-\begin_layout Description
-__complex__
-\begin_inset LatexCommand index
-name "ndarray!special methods!complex"
-
-\end_inset
-
- (self)
-\end_layout
-
-\begin_layout Description
-__int__
-\begin_inset LatexCommand index
-name "ndarray!special methods!int"
-
-\end_inset
-
- (self)
-\end_layout
-
-\begin_layout Description
-__long__
-\begin_inset LatexCommand index
-name "ndarray!special methods!long"
-
-\end_inset
-
- (self)
-\end_layout
-
-\begin_layout Description
-__float__
-\begin_inset LatexCommand index
-name "ndarray!special methods!float"
-
-\end_inset
-
- (self)
-\end_layout
-
-\begin_layout Description
-__oct__
-\begin_inset LatexCommand index
-name "ndarray!special methods!oct"
-
-\end_inset
-
- (self)
-\end_layout
-
-\begin_layout Description
-__hex__
-\begin_inset LatexCommand index
-name "ndarray!special methods!hex"
-
-\end_inset
-
- (self)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These functions are also defined for the
-\family typewriter
-ndarray
-\family default
- object to handle the operations
-\family typewriter
-complex()
-\family default
-,
-\family typewriter
-int()
-\family default
-,
-\family typewriter
-long()
-\family default
-,
-\family typewriter
-float()
-\family default
-,
-\family typewriter
-oct()
-\family default
-, and
-\family typewriter
-hex()
-\family default
-.
- They work only on arrays that have one element in them and return the appropria
-te scalar
-\begin_inset LatexCommand index
-name "ndarray!special methods|)"
-
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Tip
-The function called to implement many arithmetic special methods for arrays
- can be modified using the function set_numeric_ops.
- This function is called with keyword arguments indicating which operation(s)
- to replace.
- A dictionary is returned containing showing the old functions.
- By default, these functions are set to the corresponding ufunc.
-
-\end_layout
-
-\begin_layout Section
-Array indexing
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "sec:Array-indexing"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-More powerful array
-\begin_inset LatexCommand index
-name "indexing|("
-
-\end_inset
-
- indexing
-\begin_inset LatexCommand index
-name "ndarray!special methods!getitem"
-
-\end_inset
-
- was an important extension introduced by numarray, and was therefore an
- important part of the development of NumPy.
- In particular, the desire to select arbitrary elements based on their position
- in the array, and according to a mask was desirable.
-
-\end_layout
-
-\begin_layout Standard
-There are two kinds of indexing available using the
-\family typewriter
-X[obj]
-\family default
- syntax: basic slicing, and advanced indexing
-\begin_inset LatexCommand index
-name "ndarray!special methods!setitem"
-
-\end_inset
-
-.
- For the description of this syntax given below, X is the array to-be-sliced
- and obj is the
-\emph on
-selection
-\emph default
- object.
- Furthermore, define
-\begin_inset Formula $N\equiv$
-\end_inset
-
-X.ndim.
- These two methods of slicing have different behavior and are triggered
- depending on obj.
- Adding additional functionality yet remaining compatible with old uses
- of slicing complicated the rules a little.
- Hopefully, after studying this section, you will have a firm grasp of what
- kind of selection will be initiated depending on the selection object.
-\end_layout
-
-\begin_layout Tip
-in Python X[(exp1, exp2, ..., expN)] is equivalent to X[exp1, exp2, ..., expN]
- as the latter is just syntactic sugar for the former.
-\end_layout
-
-\begin_layout Subsection
-Basic Slicing
-\end_layout
-
-\begin_layout Standard
-Basic slicing
-\begin_inset LatexCommand index
-name "ndarray!special methods!getslice"
-
-\end_inset
-
- extends Python's basic concept of slicing
-\begin_inset LatexCommand index
-name "ndarray!special methods!setslice"
-
-\end_inset
-
- to N dimensions.
- Basic slicing occurs when obj is a slice object (constructed by start:stop:step
- notation inside of brackets), an integer, or a tuple of slice objects and
- integers.
- Ellipsis and newaxis objects can be interspersed with these as well.
- In order to remain backward compatible with a common usage in Numeric,
- basic slicing is also initiated if the selection object is any sequence
- (such as a list) containing slice objects, the ellipsis
-\begin_inset LatexCommand index
-name "ellipsis"
-
-\end_inset
-
- object, or the newaxis
-\begin_inset LatexCommand index
-name "newaxis"
-
-\end_inset
-
- object, but no integer arrays or other embedded sequences.
-
-\end_layout
-
-\begin_layout Standard
-The standard rules of sequence slicing apply to basic slicing on a per-dimension
- basis (including using a step index).
- Some useful concepts to remember include:
-\end_layout
-
-\begin_layout Itemize
-The basic slice syntax is '
-\begin_inset Formula $i:j:k$
-\end_inset
-
-' where
-\begin_inset Formula $i$
-\end_inset
-
- is the starting index,
-\begin_inset Formula $j$
-\end_inset
-
- is the stopping index, and
-\begin_inset Formula $k$
-\end_inset
-
- is the step (
-\begin_inset Formula $k\neq0$
-\end_inset
-
-).
- This selects the
-\begin_inset Formula $m$
-\end_inset
-
- elements (in the corresponding dimension) with index values
-\begin_inset Formula $i,\, i+k,\,\ldots,\, i+(m-1)k$
-\end_inset
-
- where
-\begin_inset Formula $m=q+(r\neq0)$
-\end_inset
-
- where
-\begin_inset Formula $q$
-\end_inset
-
- and
-\begin_inset Formula $r$
-\end_inset
-
- are the quotient and remainder obtained by dividing
-\begin_inset Formula $j-i$
-\end_inset
-
- by
-\begin_inset Formula $k$
-\end_inset
-
-:
-\begin_inset Formula $j-i=qk+r$
-\end_inset
-
-, so that
-\begin_inset Formula $i+\left(m-1\right)k<j.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Itemize
-Assume
-\begin_inset Formula $n$
-\end_inset
-
- is the number of elements in the dimension being sliced.
- Then, if
-\begin_inset Formula $i$
-\end_inset
-
- is not given it defaults to 0 for
-\begin_inset Formula $k>0$
-\end_inset
-
- and
-\begin_inset Formula $n$
-\end_inset
-
- for
-\begin_inset Formula $k<0$
-\end_inset
-
-.
- If
-\begin_inset Formula $j$
-\end_inset
-
- is not given it defaults to
-\begin_inset Formula $n$
-\end_inset
-
- for
-\begin_inset Formula $k>0$
-\end_inset
-
- and
-\begin_inset Formula $-1$
-\end_inset
-
- for
-\begin_inset Formula $k<0$
-\end_inset
-
-.
- If
-\begin_inset Formula $k$
-\end_inset
-
- is not given it defaults to 1.
- Note that '::' is the same as ':' and means select all indices along this
- axis.
-
-\end_layout
-
-\begin_layout Itemize
-If the number of objects in the selection tuple is less than
-\begin_inset Formula $N$
-\end_inset
-
-, then ':' is assumed for any remaining dimensions.
-\end_layout
-
-\begin_layout Itemize
-Ellipsis expand to the number of ':' objects needed to make a selection
- tuple of the same length as X.ndim.
- Only one ellipsis is expanded, any others are interpreted as more ':'
-\end_layout
-
-\begin_layout Itemize
-Each newaxis object in the selection tuple serves to expand the dimensions
- of the resulting selection by one unit-length dimension.
- The added dimension is the position of the newaxis object in the selection
- tuple.
-
-\end_layout
-
-\begin_layout Itemize
-An integer,
-\begin_inset Formula $i$
-\end_inset
-
-, returns the same values as
-\begin_inset Formula $i:i+1$
-\end_inset
-
-
-\series bold
-except
-\series default
- the dimensionality of the returned object is reduced by 1.
- In particular, a selection tuple with the
-\begin_inset Formula $p^{\textrm{th}}$
-\end_inset
-
- element an integer (and all other entries ':') returns the corresponding
- sub-array with dimension
-\begin_inset Formula $N-1$
-\end_inset
-
-.
- If
-\begin_inset Formula $N=1,$
-\end_inset
-
- then the returned object is an Array Scalar.
- These objects are explained in Chapter
-\begin_inset LatexCommand ref
-reference "cha:Scalar-objects"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Itemize
-If the selection tuple has all entries ':' except the
-\begin_inset Formula $p^{\textrm{th}}$
-\end_inset
-
- entry which is a slice object
-\begin_inset Formula $i:j:k$
-\end_inset
-
-, then the returned array has dimension
-\begin_inset Formula $N$
-\end_inset
-
- formed by concatenating the sub-arrays returned by integer indexing of
- elements
-\begin_inset Formula $i$
-\end_inset
-
-,
-\begin_inset Formula $i+k$
-\end_inset
-
-,
-\begin_inset Formula $i+(m-1)k<j$
-\end_inset
-
-,
-\end_layout
-
-\begin_layout Itemize
-Basic slicing with more than one non-':' entry in the slicing tuple, acts
- like repeated application of slicing using a single non-':' entry, where
- the non-':' entries are successively taken (with all other non-':' entries
- replaced by ':').
- Thus, X[ind1,...,ind2,:] acts like X[ind1][...,ind2,:] under basic slicing.
- Note this is NOT true for advanced slicing.
-
-\end_layout
-
-\begin_layout Itemize
-You may use slicing to set values in the array, but (unlike lists) you can
- never grow the array.
- The size of the value to be set in X[obj] = value must be (broadcastable)
- to the same shape as X[obj].
-
-\end_layout
-
-\begin_layout Standard
-Basic slicing always returns another
-\emph on
-view
-\begin_inset LatexCommand index
-name "ndarray!view"
-
-\end_inset
-
-
-\emph default
- of the array.
- In other words, the returned array from a basic slicing operation uses
- the same data as the original array.
- This can be confusing at first, but it is faster and can save memory.
- A copy can always be obtained if needed using the unary + operator (which
- has lower precedence than slicing) or the .copy() method.
-
-\end_layout
-
-\begin_layout Tip
-Remember that a slicing tuple can always be constructed as obj and used
- in the x[obj] notation.
- Slice objects can be used in the construction in place of the [start:stop:step]
- notation.
- For example,
-\family typewriter
-x[1:10:5,::-1]
-\family default
- can also be implemented as
-\family typewriter
-obj=(slice(1,10,5), slice(None,None,-1)); X[obj]
-\family default
-.
- This can be useful for constructing generic code that works on arrays of
- arbitrary dimension.
-\end_layout
-
-\begin_layout Subsection
-Advanced selection
-\end_layout
-
-\begin_layout Standard
-Advanced selection is triggered when the selection object, obj, is a non-tuple
- sequence object, an ndarray (of data type integer or bool), or a tuple
- with at least one sequence object or ndarray (of data type integer or bool).
- There are two types of advanced indexing: integer and Boolean.
- Advanced selection always returns a copy of the data (contrast with basic
- slicing that returns a view).
-
-\end_layout
-
-\begin_layout Subsubsection
-Integer
-\end_layout
-
-\begin_layout Standard
-Integer indexing allows selection of arbitrary items in the array based
- on their
-\begin_inset Formula $N$
-\end_inset
-
--dimensional index.
- This kind of selection occurs when advanced selection is triggered and
- the selection object is not an array of data type bool.
- For the discussion below, when the selection object is not a tuple, it
- will be referred to as if it had been promoted to a 1-tuple, which will
- be called the selection tuple.
- The rules of advanced integer-style indexing are:
-\end_layout
-
-\begin_layout Itemize
-if the length of the selection tuple is larger than
-\begin_inset Formula $N$
-\end_inset
-
-(=X.ndim) an error is raised.
-\end_layout
-
-\begin_layout Itemize
-all sequences and scalars in the selection tuple are converted to intp indexing
- arrays.
-
-\end_layout
-
-\begin_layout Itemize
-all selection tuple objects must be convertible to intp arrays, or slice
- objects, or the Ellipsis (...) object.
-\end_layout
-
-\begin_layout Itemize
-Exactly one Ellipsis object will be expanded, any other Ellipsis objects
- will be treated as full slice (':') objects.
- The Ellipsis object is replaced with as many full slice (':') objects as
- needed to make the length of the selection tuple
-\begin_inset Formula $N$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Itemize
-If the selection tuple is smaller than
-\begin_inset Formula $N$
-\end_inset
-
-, then as many ':' objects as needed are added to the end of the selection
- tuple so that the modified selection tuple has length
-\begin_inset Formula $N$
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Itemize
-The shape of all the integer indexing arrays must be broadcastable to the
- same shape.
- Arrays are broadcastable if any of the following are satisfied
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-The arrays all have exactly the same shape.
-\end_layout
-
-\begin_layout Enumerate
-The arrays all have the same number of dimensions and the length of each
- dimensions is either a common length or 1.
-\end_layout
-
-\begin_layout Enumerate
-The arrays that have too few dimensions can have their shapes pre-pended
- with a dimension of length 1 to satisfy property 2.
-
-\end_layout
-
-\end_deeper
-\begin_layout Itemize
-The shape of the output (or the needed shape of the object to be used for
- setting) is the broadcasted shape.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Example: If a.shape is (5,1), b.shape is (1,6), c.shape is (6,) and d.shape
- is () so that d is a scalar, then a, b, c, and d are all broadcastable
- to dimension (5,6).
- The array
-\begin_inset Quotes eld
-\end_inset
-
-a
-\begin_inset Quotes erd
-\end_inset
-
- acts like a (5,6) array where a[:,0] is broadcast to the other columns,
-
-\begin_inset Quotes eld
-\end_inset
-
-b
-\begin_inset Quotes erd
-\end_inset
-
- acts like a (5,6) array where b[0,:] is broadcast to the other rows,
-\begin_inset Quotes eld
-\end_inset
-
-c
-\begin_inset Quotes erd
-\end_inset
-
- acts like a (1,6) array and therefore a (5,6) where c[:] is broadcast to
- every row, and finally
-\begin_inset Quotes eld
-\end_inset
-
-d
-\begin_inset Quotes erd
-\end_inset
-
- acts like a (5,6) array where the single values is repeated.
-
-\end_layout
-
-\end_deeper
-\begin_layout Itemize
-After expanding any ellipses and filling out any missing (':') objects in
- the selection tuple, then let
-\begin_inset Formula $N_{t}$
-\end_inset
-
- be the number of indexing arrays, and let
-\begin_inset Formula $N_{s}=N-N_{t}$
-\end_inset
-
- be the number of slice objects.
- Note that
-\begin_inset Formula $N_{t}>0$
-\end_inset
-
- (or we wouldn't be doing advanced integer indexing).
-
-\end_layout
-
-\begin_layout Itemize
-If
-\begin_inset Formula $N_{s}=0$
-\end_inset
-
- then the
-\begin_inset Formula $M$
-\end_inset
-
--dimensional result is constructed by varying the index tuple
-\begin_inset Formula $\left(i_{1},\ldots,i_{M}\right)$
-\end_inset
-
- over the range of the result shape and for each value of the index tuple
- setting:
-\begin_inset Formula \[
-\textrm{result[$i_{1},\ldots,i_{M}$]=X[ind$_{1}$[$i_{1},\ldots i_{M}$], ind$_{2}$[$i_{1},\ldots,i_{M}$], \, etc.,\, ind$_{N}$[$i_{1},\ldots,i_{M}$]}.\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Example: Suppose the shape of the broadcasted indexing arrays is 3-dimensional
- and
-\begin_inset Formula $N$
-\end_inset
-
- is 2.
- Then the result is found by letting
-\begin_inset Formula $i,j,k$
-\end_inset
-
- run over the shape found by broadcasting
-\begin_inset Formula $\textrm{ind}_{1},$
-\end_inset
-
- and
-\begin_inset Formula $\textrm{ind}_{2},$
-\end_inset
-
-and for each
-\begin_inset Formula $i,j,k$
-\end_inset
-
- setting result[
-\begin_inset Formula $i,j,k$
-\end_inset
-
-] = X[
-\begin_inset Formula $\textrm{ind}_{1}[i,j,k]$
-\end_inset
-
-,
-\begin_inset Formula $\textrm{ind}_{2}[i,j,k]$
-\end_inset
-
-].
-
-\end_layout
-
-\end_deeper
-\begin_layout Itemize
-If
-\begin_inset Formula $N_{s}>0$
-\end_inset
-
-, then partial indexing is done.
- This can be somewhat mind-boggling to understand, but if you think in terms
- of the shapes of the arrays involved, it can be easier to grasp what happens.
- In simple cases (
-\emph on
-i.e.
-
-\emph default
- one indexing array and
-\begin_inset Formula $N-1$
-\end_inset
-
- slice objects) it does exactly what you would expect (concatenation of
- repeated application of basic slicing).
- The rule for partial indexing is that the shape of the result (or the interpret
-ed shape of the object to be used in setting) is the shape of X with the
- indexed subspace replaced with the broadcasted indexing subspace.
- If the index subspaces are right next to each other, then the broadcasted
- indexing space directly replaces all of the indexed subspaces in X.
- If the indexing subspaces are separated (by slice objects), then the broadcaste
-d indexing space is first, followed by the sliced subspace of X.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Example\InsetSpace ~
-1: Suppose X.shape is (10,20,30) and ind is a (2,3,4) indexing intp
- array, then result=X[...,ind,:] has shape (10,2,3,4,30) because the (20,)-shaped
- subspace has been replaced with a (2,3,4)-shaped broadcasted indexing subspace.
- If we let
-\begin_inset Formula $i,j,k$
-\end_inset
-
- loop over the (2,3,4)-shaped subspace then result[...,i,j,k,:] = X[...,ind[i,j,k],:].
- This example produces the same result as X.take(ind,axis=-2).
-
-\end_layout
-
-\begin_layout Description
-Example\InsetSpace ~
-2: Now let X.shape be (10,20,30,40,50) and suppose
-\begin_inset Formula $\textrm{ind}_{1}$
-\end_inset
-
- and
-\begin_inset Formula $\textrm{ind}_{2}$
-\end_inset
-
- are broadcastable to the shape (2,3,4).
- Then X[:,ind
-\begin_inset Formula $_{1}$
-\end_inset
-
-,ind
-\begin_inset Formula $_{2}$
-\end_inset
-
-] has shape (10,2,3,4,40,50) because the (20,30)-shaped subspace from X
- has been replaced with the (2,3,4) subspace from the indices.
- However, X[:,ind
-\begin_inset Formula $_{1}$
-\end_inset
-
-,:,ind
-\begin_inset Formula $_{2}$
-\end_inset
-
-,:] has shape (2,3,4,10,30,50) because there is no unambiguous place to
- drop in the indexing subspace, thus it is tacked-on to the beginning.
- It is always possible to use .transpose() to move the sups pace anywhere
- desired.
- This example cannot be replicated using take.
-
-\end_layout
-
-\end_deeper
-\begin_layout Subsubsection
-Boolean
-\end_layout
-
-\begin_layout Standard
-This advanced selection occurs when obj is an array object of Boolean type
- (such as may be returned from comparison operators).
- It is always equivalent to (but faster than) X[obj.nonzero()] where as described
- above obj.nonzero() returns a tuple (of length obj.ndim) of integer index
- arrays showing the True elements of obj.
-
-\end_layout
-
-\begin_layout Standard
-The special case when obj.ndim == X.ndim is worth mentioning.
- In this case X[obj] returns a 1-dimensional array filled with the elements
- of X corresponding to the True values of obj.
- It The search order will be C-style (last index varies the fastest).
- If obj has True values at entries that are outside of the bounds of X,
- then an index error will be raised.
-\end_layout
-
-\begin_layout Standard
-You can also use Boolean arrays as element of the selection tuple.
- In such instances, they will always be interpreted as nonzero(obj) and
- the equivalent integer indexing will be done.
- In general you can think of indexing with Boolean arrays as indexing with
- nonzero(<Boolean>).
-\end_layout
-
-\begin_layout Warning
-the definition of advanced selection means that X[(1,2,3),] is fundamentally
- different than X[(1,2,3)].
- The latter is equivalent to X[1,2,3] which will trigger basic selection
- while the former will trigger advanced selection.
- Be sure to understand why this is True.
- You should also recognize that x[[1,2,3]] will trigger advanced selection,
- but X[[1,2,slice(None)]] will trigger basic selection.
-\end_layout
-
-\begin_layout Subsection
-Flat Iterator indexing
-\end_layout
-
-\begin_layout Standard
-As mentioned previously, X.flat returns an iterator that will iterate over
- the entire array (in C-contiguous style with the last index varying the
- fastest).
- This iterator object can also be indexed using basic slicing or advanced
- indexing as long as the selection object is not a tuple.
- This should be clear from the fact that X.flat is a 1-dimensional view.
- X.flat can be used for integer indexing using 1-dimensional C-style-flat
- indices.
- The shape of any returned array is therefore the shape of the integer indexing
-\begin_inset LatexCommand index
-name "indexing|)"
-
-\end_inset
-
- object
-\begin_inset LatexCommand index
-name "ndarray|)"
-
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Chapter
-Basic Routines
-\end_layout
-
-\begin_layout Quotation
-Do not pray for tasks equal to your powers; pray for powers equal to your
- tasks.
- Then the doing of your work shall be no miracle, but you shall be the miracle.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Phillips Brooks
-\end_layout
-
-\begin_layout Quote
-Education isn't how much you have committed to memory, or even how much
- you know.
- It's being able to differentiate between what you do know and what you
- don't.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Anatole France
-\end_layout
-
-\begin_layout Section
-Creating arrays
-\end_layout
-
-\begin_layout Description
-array
-\begin_inset LatexCommand index
-name "array"
-
-\end_inset
-
- (object=, dtype=None, copy=True, order=None, subok=False, ndmin=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create a new ndarray of data type, dtype (or determined from object if
- dtype is None).
- The shape of the new array will be determined from object.
- If copy is True, then ensure a copy of the object is made.
- If copy is False, then the returned object is a copy of the array only
- if dtype is not equivalent to the data type of object.
- If order is 'Fortran' then the resulting array will be in Fortran order,
- otherwise it is in C order.
- If subok (subclasses are O.K.) is True then pass through subclasses of the
- array object if possible.
- If subok is False then only ndarray objects may be returned.
- The ndmin parameter specifies that the returned array must have at least
- the given number of dimensions.
-
-\end_layout
-
-\begin_layout Description
-asarray
-\begin_inset LatexCommand index
-name "asarray"
-
-\end_inset
-
- (object=, dtype=None, order=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Exactly the same as array(...) except the default copy argument is False,
- and subok is always False.
- Using this function always returns the base class ndarray.
-
-\end_layout
-
-\begin_layout Description
-asanyarray
-\begin_inset LatexCommand index
-name "asanyarray"
-
-\end_inset
-
- (object, dtype=None, order=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Thin wrapper around array(...) with subok=1.
- You should use this routine if you are only making use of the array attributes,
- and believe the calculations that will follow would work with any subclass
- of the array.
- Use of this routine increases the chance that array subclasses will interact
- seamlessly with your function --- returning the same subclasses.
-
-\end_layout
-
-\begin_layout Description
-require
-\begin_inset LatexCommand index
-name "require"
-
-\end_inset
-
- (object, dtype=None, requirements=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Require a Python object to be an ndarray (or a sub-class) of the given
- data-type if it can be cast safely, otherwise raise an error.
- The requirements, if given, are a sequence containing the requested combination
- of the flags 'C_CONTIGUOUS' ('C'), 'F_CONTIGUOUS' ('F'), 'ALIGNED' ('A'),
- 'WRITEABLE' ('W'), 'OWNDATA' ('O'), and the special directive 'ENSUREARRAY'
- ('E').
- These strings dictate which flags should be set on the return array (note
- only one of 'F_CONTIGUOUS' or 'C_CONTIGUOUS' should be used and 'F_CONTIGUOUS'
- over-rides 'C_CONTIGUOUS').
- The special directive 'ENSUREARRAY' makes sure that a base-class ndarray
- is returned instead of allowing sub-classes to pass through.
- This function is particularly useful in a Python interface to C-code (say
- called using ctypes
-\begin_inset LatexCommand index
-name "ctypes"
-
-\end_inset
-
-).
-
-\end_layout
-
-\begin_layout Description
-arange
-\begin_inset LatexCommand index
-name "arange"
-
-\end_inset
-
- (start=, stop=None, step=1, dtype=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Function similar to Python's built-in range() function except it returns
- an ndarray object.
- Return a 1-d array of data type, dtype (or determined from the start, stop,
- and step objects if None), that starts at start, ends
-\emph on
-before
-\emph default
- stop and is incremented by step.
- The returned array has length
-\begin_inset Formula $n$
-\end_inset
-
- where
-\begin_inset Formula \[
-n=\left\lceil \frac{\textrm{stop}-\textrm{start}}{\textrm{step}}\right\rceil \]
-
-\end_inset
-
- with element
-\begin_inset Formula $i$
-\end_inset
-
- equal to
-\begin_inset Formula $\textrm{start}+i\cdot\textrm{step}.$
-\end_inset
-
- If stop is None, then the first argument is interpreted as stop and start
- is 0.
-
-\end_layout
-
-\begin_layout Note
-By definition of the ceiling function (denoted by
-\begin_inset Formula $\left\lceil x\right\rceil $
-\end_inset
-
-), we know that
-\begin_inset Formula $x\leq\left\lceil x\right\rceil <x+1$
-\end_inset
-
-, therefore this definition of the length of arange guarantees that
-\begin_inset Formula $\textrm{start}+n\cdot\textrm{step}\geq\textrm{stop}$
-\end_inset
-
- as well as
-\begin_inset Formula $\textrm{start}+(n-1)\cdot\textrm{step}<\textrm{stop}$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Description
-isfortran
-\begin_inset LatexCommand index
-name "isfortran"
-
-\end_inset
-
- (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to
-\family typewriter
-arr.flags.fnc
-\family default
- and therefore returns True only if arr is Fortran-contiguous but not also
- C-contiguous.
-\end_layout
-
-\begin_layout Description
-empty
-\begin_inset LatexCommand index
-name "empty"
-
-\end_inset
-
- (shape=, dtype=int, order='C')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an uninitialized array of data type, dtype, and given shape.
- The memory layout defaults to C-style contiguous, but can be made Fortran-style
- contiguous with a 'Fortran' order keyword.
-\end_layout
-
-\begin_layout Description
-empty_like
-\begin_inset LatexCommand index
-name "empty\\_like"
-
-\end_inset
-
- (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Syntactic sugar for empty(a.shape, a.dtype, isfortran(arr))
-\end_layout
-
-\begin_layout Description
-zeros
-\begin_inset LatexCommand index
-name "zeros"
-
-\end_inset
-
- (shape=, dtype=int, order='C')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array of data type dtype and given shape filled with zeros.
- The memory layout may be altered from the default C-style contiguous with
- the order keyword.
-\end_layout
-
-\begin_layout Description
-zeros_like
-\begin_inset LatexCommand index
-name "zeros\\_like"
-
-\end_inset
-
- (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Syntactic sugar for zeros(a.shape, a.dtype, isfortran(arr))
-\end_layout
-
-\begin_layout Description
-ones
-\begin_inset LatexCommand index
-name "ones"
-
-\end_inset
-
- (shape=, dtype=int, order='C')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Syntactic sugar for a = zeros(shape, dtype, order); a+= 1.
-
-\end_layout
-
-\begin_layout Description
-fromstring
-\begin_inset LatexCommand index
-name "fromstring"
-
-\end_inset
-
- (string=,dtype=int, count=-1, sep='')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If sep is '', then return a new 1-d array with data-type descriptor given
- by dtype and with memory initialized (copied) from the raw binary data
- in string.
- If count is non-negative, the new array will have count elements (with
- a
-\family typewriter
-ValueError
-\family default
- raised if count requires more data than the string offers), otherwise the
- size of the string must be a multiple of the itemsize implied by dtype,
- and count will be the length of the string divided by the itemsize.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If sep is not '', then interpret the string in ASCII mode with the provided
- separator and convert the string to an array of numbers.
- Any additional white-space will be ignored.
-\end_layout
-
-\begin_layout Description
-fromfile
-\begin_inset LatexCommand index
-name "fromfile"
-
-\end_inset
-
- (file=, dtype=int, count=-1, sep='')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a 1-d array of data type, dtype, from a file (open file object or
- string with the name of a file to read).
- The file will be read in binary mode if sep is the empty string.
- Otherwise, the file will be read in text mode with sep providing the separator
- string between the entries.
- If count is -1, then the size will be determined from the file, otherwise,
- up to count items will be read from the file.
- If fewer than count items are read, then a RunTimeWarning is issued indicating
- the number of items read.
-\end_layout
-
-\begin_layout Description
-frombuffer
-\begin_inset LatexCommand index
-name "frombuffer"
-
-\end_inset
-
- (buffer, dtype=intp, count=-1, offset=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Very similar to (binary-mode) fromstring in interpretation of the arguments,
- except buffer can be any object exposing the buffer interface (or any object
- with a __buffer__ attribute that returns a buffer exposing the buffer protocol).
- The new array shares memory with the buffer object.
- The new array will be read-only if the buffer does not expose a writeable
- buffer.
-
-\end_layout
-
-\begin_layout Description
-fromiter
-\begin_inset LatexCommand index
-name "fromiter"
-
-\end_inset
-
- (iterator_or_generator, dtype=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct an array from an iterator or a generator.
- Only handles 1-dimensional cases.
- By default the data-type is determined from the objects returned from the
- iterator.
-
-\end_layout
-
-\begin_layout Description
-load
-\begin_inset LatexCommand index
-name "load"
-
-\end_inset
-
- (file)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Load a NumPy binary file (.npy), a NumPy binary zipfile (.npz), or a pickled
- Python object from an open file.
- If file is a string, then open a file with that name first.
- Which kind of file should be loaded is determined by the magic bytes at
- the front of the file (not by filename extension).
- See
-\shape italic
-save
-\shape default
- and
-\shape italic
-savez
-\shape default
- for functions which write .npy and .npz files from NumPy arrays.
- If file is a binary zipfile, then an instance of NpzObj is returned.
- This object is a simple wrapper around the zip-file which allows extraction
- of the arrays stored within it.
- The .files attribute of the NpzObj returns a list of all arrays in the archive.
- These arrays are accessible through a dictionary-like interface (obj['name'])
- or through attribute lookup through the .f attribute of the returned object
- (obj.f.name).
- If the file is a NumPy binary file (.npy), then the array itself is returned
- from this function.
- If the file contains a pickled object, then that object is returned.
-
-\end_layout
-
-\begin_layout Description
-loads
-\begin_inset LatexCommand index
-name "loads"
-
-\end_inset
-
- (str)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Load a pickled array from a string.
- Equivalent to cPickle.loads(str).
- This function will likely be deprecated in the future.
- Use cPickle instead.
-\end_layout
-
-\begin_layout Description
-save
-\begin_inset LatexCommand index
-name "save"
-
-\end_inset
-
- (file, arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Save the array into a file which can be a string or an open file-like object.
- If the file is given as a string, then it will have .npy appended if it
- does not already end with that extension.
- The .npy file format is NumPy-specific and is documented in the numpy.lib.format
- module.
- It only stores a single array.
-
-\end_layout
-
-\begin_layout Description
-savez
-\begin_inset LatexCommand index
-name "savez"
-
-\end_inset
-
- (file, *args, **kwds)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Save a sequence of arrays into a NumPy binary zipfile (.npz).
- An .npz file is a regular zip-file containing multiple .npy files.
- If keywords are given, then the keyword names are used as filenames (with
- the .npy extension added) in the zip-file with the corresponding values
- being converted to arrays and stored in the specified filename.
- Any non-keyword arguments that are passed in results in the names arr_0,
- arr_1, etc.
- being used in the zip-file (if a keyword by one of those names also exists,
- then a ValueError is raised).
-
-\end_layout
-
-\begin_layout Description
-loadtxt
-\end_layout
-
-\begin_layout Description
-savetxt
-\end_layout
-
-\begin_layout Description
-DataSource
-\end_layout
-
-\begin_layout Description
-indices
-\begin_inset LatexCommand index
-name "indices"
-
-\end_inset
-
- (dimensions, dtype=intp)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array of dtype representing
-\begin_inset Formula $n$
-\end_inset
-
-(=len(dimensions)) grids of indices each with variation in a single direction.
- The returned array has shape (
-\begin_inset Formula $n$
-\end_inset
-
-,)+dimensions.
- Compare with mgrid.
-
-\end_layout
-
-\begin_layout MyCode
->>> indices((2,3))
-\newline
-array([[[0, 0, 0],
-\newline
- [1, 1, 1]],
-\newline
-
-\newline
- [[0, 1, 2],
-\newline
-
- [0, 1, 2]]])
-\end_layout
-
-\begin_layout Description
-fromfunction
-\begin_inset LatexCommand index
-name "fromfunction"
-
-\end_inset
-
- (function, dimensions, **kwargs)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct an array from a function called on a tuple of index grids.
- The function should be able to take array arguments and process them like
- ufuncs (use vectorize if it doesn't).
- The function should accept as many arguments as there are dimensions which
- is a sequence of numbers indicating the length of the desired output for
- each axis.
- Keyword arguments to function may also be passed in as keywords to fromfunction.
-\end_layout
-
-\begin_layout MyCode
->>> print fromfunction(lambda i,j: i+j, (2,3))
-\newline
-[[ 0.
- 1.
- 2.]
-\newline
- [ 1.
- 2.
- 3.]]
-\end_layout
-
-\begin_layout Description
-identity
-\begin_inset LatexCommand index
-name "identity"
-
-\end_inset
-
- (n, dtype=intp)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a 2-d array of shape (n,n) and data type, dtype with ones along
- the main diagonal.
-
-\end_layout
-
-\begin_layout Description
-where
-\begin_inset LatexCommand index
-name "where"
-
-\end_inset
-
- (condition[, x, y])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns an array shaped like condition, that has the elements of x and
- y respectively where condition is respectively true or false.
- If x and y are not given, then it is equivalent to nonzero(condition).
-\end_layout
-
-\begin_layout Description
-flatnonzero
-\begin_inset LatexCommand index
-name "flatnonzero"
-
-\end_inset
-
- (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return indices that are non-zero in a flattened version of arr.
- Equivalent to a.ravel().nonzero()[0].
-\end_layout
-
-\begin_layout Description
-putmask
-\begin_inset LatexCommand index
-name "putmask"
-
-\end_inset
-
- (arr=, mask=, values=)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Performs the equivalent of
-\end_layout
-
-\begin_layout LyX-Code
-for n, obj in enumerate(
-\series bold
-mask
-\series default
-.flat):
-\end_layout
-
-\begin_layout LyX-Code
- if obj:
-\end_layout
-
-\begin_layout LyX-Code
- self.flat[n] =
-\series bold
-values
-\series default
-[n]
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The values array is repeated if it is too short.
- In particular, this means that indexing on the values array is modular
- it's length, which might be surprising you are expecting putmask to work
- the same as arr[mask]=values.
-\end_layout
-
-\begin_layout Description
-lexsort
-\begin_inset LatexCommand index
-name "lexsort"
-
-\end_inset
-
- (keys=, axis=-1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array of indices similar to argsort except sorting is done using
- all of the provided keys.
- First a sort is computed using key[0], then the indices are further altered
- by sorting on key[1].
- This is repeated until sorting has been performed on all of the keys.
- This is a useful function for multiple-field sorting.
-\end_layout
-
-\begin_layout MyCode
->>> a = [1,2,1,3,1,5]; b = [0,4,5,6,2,3]
-\newline
->>> ind = lexsort((b,a))
-\newline
->>> print
- take(a,ind)
-\newline
-[1 1 1 2 3 5]
-\newline
->>> print take(b,ind)
-\newline
-[0 2 5 4 6 3]
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Notice the order the keys had to be used in order to get a lexicographical
- sorting order.
- To clarify, suppose three equal-length sequences are fields of an underlying
- data-type: (f1,f2,f3).
- If we want to sort first on f1 and then on f2 and then on f3, the indices
- that would accomplish that sort are obtained as lexsort((f3,f2,f1)).
-\end_layout
-
-\begin_layout Section
-Operations on two or more arrays
-\end_layout
-
-\begin_layout Description
-concatenate
-\begin_inset LatexCommand index
-name "concatenate"
-
-\end_inset
-
- (seq=, axis=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a new array from elements of the sequence object seq concatenated
- along the given axis.
- The elements of the sequence object must have compatible types and be the
- same shape.
- If axis is None, then flatten each element of seq before concatenating
- together to construct a 1-d array.
-\end_layout
-
-\begin_layout Description
-correlate
-\begin_inset LatexCommand index
-name "correlate"
-
-\end_inset
-
- (x, y, mode='valid')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the 1-d cross correlation of x and y keeping portions determined
- by mode which may be 'valid' (0), 'same' (1), or 'full' (2).
- The 'full' cross-correlation between two 1-d arrays is computed as
-\begin_inset Formula \[
-z\left[n\right]=\sum_{i=\max\left(n-M,0\right)}^{\min\left(n,K\right)}x\left[i\right]y\left[n+i\right],\]
-
-\end_inset
-
-for
-\begin_inset Formula $n=0\ldots K+M$
-\end_inset
-
- where
-\begin_inset Formula $K$
-\end_inset
-
-=len(
-\begin_inset Formula $x$
-\end_inset
-
-)-1 and
-\begin_inset Formula $M$
-\end_inset
-
-=len(
-\begin_inset Formula $y$
-\end_inset
-
-)-1, and we assume
-\begin_inset Formula $K\geq M$
-\end_inset
-
- (without loss of generality because we can interchange the roles of
-\begin_inset Formula $x$
-\end_inset
-
- and
-\begin_inset Formula $y$
-\end_inset
-
- without effect).
- For this formula to work, we assume that
-\begin_inset Formula $x[i]=0$
-\end_inset
-
- when
-\begin_inset Formula $i\notin\left[0,K-1\right]$
-\end_inset
-
- and
-\begin_inset Formula $y[j]=0$
-\end_inset
-
- when
-\begin_inset Formula $j\neq[0,M-1]$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If mode is 'same' then only the
-\begin_inset Formula $K$
-\end_inset
-
- middle values are returned starting at
-\begin_inset Formula $n=\left\lfloor \frac{M-1}{2}\right\rfloor $
-\end_inset
-
-.
- If the flag has a value of 'valid' then only the middle
-\begin_inset Formula $K-M+1=\left(K+1\right)-\left(M+1\right)+1$
-\end_inset
-
- output values are returned starting at
-\begin_inset Formula $n=M.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-convolve
-\begin_inset LatexCommand index
-name "convolve"
-
-\end_inset
-
- (x, y, mode='valid')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convolution is very similar to correlation except it is defined with one
- sequence reversed:
-\begin_inset Formula \[
-z\left[n\right]=\sum_{i}x[i]y[n-i].\]
-
-\end_inset
-
- The mode keyword has the same effect as it does for correlation.
- Convolution ('full') between two 1-d arrays implements polynomial multiplicatio
-n where the array entries are viewed as coefficients for polynomials.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Example: Consider that
-\begin_inset Formula $(x^{3}+4x^{2}+2)$
-\end_inset
-
-
-\begin_inset Formula $\left(x^{4}+3x+1\right)$
-\end_inset
-
-=
-\begin_inset Formula $x^{7}+4x^{6}+5x^{4}+13x^{3}+4x^{2}+6x+2.$
-\end_inset
-
- This can be determined by using the code
-\family typewriter
-convolve([1,4,0,2], [1,0,0,3,1])
-\family default
- which returns
-\family typewriter
-[1,4,0,5,13,4,6,2].
-
-\family default
- Notice the one-to-one alignment between the elements of the arrays and
- the coefficients on powers of
-\begin_inset Formula $x$
-\end_inset
-
- in the polynomial.
-
-\end_layout
-
-\end_deeper
-\begin_layout Description
-outer
-\begin_inset LatexCommand index
-name "outer"
-
-\end_inset
-
- (a, b)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- compute an outerproduct which is syntactic sugar for a.ravel() [:,newaxis]
- * b.ravel() [newaxis,:] (after first converting a and b to ndarrays).
-\end_layout
-
-\begin_layout MyCode
->>> print outer([1,2,3],[10,100,1000])
-\newline
-[[ 10 100 1000]
-\newline
- [ 20 200 2000]
-\newline
-
- [ 30 300 3000]]
-\end_layout
-
-\begin_layout Description
-inner
-\begin_inset LatexCommand index
-name "inner"
-
-\end_inset
-
- (a, b)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Computes the inner product between two arrays.
- This is an array that has shape a.shape[:-1] + b.shape[:-1] with elements
- computed as the sum of the product of the elements from the last dimensions
- of a and b.
- In particular, let
-\begin_inset Formula $I$
-\end_inset
-
- and
-\begin_inset Formula $J$
-\end_inset
-
- be the super
-\begin_inset Foot
-status open
-
-\begin_layout Standard
-A super index is 0 or more integer indices used to index into an N-dimensional
- array.
- How many indices a super index represents should be implied by context.
-\end_layout
-
-\end_inset
-
- indices selecting the 1-dimensional arrays
-\begin_inset Formula $a[I,:]$
-\end_inset
-
- and
-\begin_inset Formula $b[J,:]$
-\end_inset
-
-, then the resulting array,
-\begin_inset Formula $r$
-\end_inset
-
-, is
-\begin_inset Formula \[
-r[I,J]=\sum_{k}a[I,k]b[J,k].\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-dot
-\begin_inset LatexCommand index
-name "dot"
-
-\end_inset
-
- (a, b)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Computes the dot (matrix) product between two arrays.
- The product-sum is over the last dimension of
-\begin_inset Formula $a$
-\end_inset
-
- and the second-to-last dimension of
-\begin_inset Formula $b$
-\end_inset
-
-.
- Specifically, if
-\begin_inset Formula $I$
-\end_inset
-
- and
-\begin_inset Formula $J$
-\end_inset
-
- are super indices for
-\begin_inset Formula $a[I,:]$
-\end_inset
-
- and
-\begin_inset Formula $b[J,:,j]$
-\end_inset
-
- so that
-\begin_inset Formula $j$
-\end_inset
-
- is the index of the last dimension of
-\begin_inset Formula $b$
-\end_inset
-
-.
- Then, the shape of the resulting array is a.shape[:-1] + b.shape[:-2] + (b.shape[-
-1],) with elements.
-
-\begin_inset Formula \[
-r[I,J,j]=\sum_{k}a[I,k]b[J,k,j],\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\begin_inset LatexCommand index
-name "vdot"
-
-\end_inset
-
-vdot (a, b)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Computes the dot product between two arrays (flattened into one-dimensional
- vectors) after conjugating the first vector.
- This is an inner-product following the physicists convention of conjugating
- the first argument.
-\begin_inset Formula \[
-r=\sum_{k}\overline{\textrm{a.flat}[k]}\textrm{b.flat}[k].\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-tensordot
-\begin_inset LatexCommand index
-name "tensordot"
-
-\end_inset
-
- (a, b, axes=(-1,0))
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Computes a dot-product between two arrays where the sum is taken over the
- axes specified by the 2-sequence which can have either scalar or sequence
- entries.
- The axes specified are summed over and the remaining axes are used to construct
- the result.
- So, for example, if
-\begin_inset Formula $a$
-\end_inset
-
- is
-\begin_inset Formula $3\times4\times5$
-\end_inset
-
- and
-\begin_inset Formula $b$
-\end_inset
-
- is
-\begin_inset Formula $4\times3\times2$
-\end_inset
-
- then if axes=([1,0],[0,1]) (or axes=([0,1],[1,0])) the result will be
-\begin_inset Formula $5\times2$
-\end_inset
-
-.
- Let
-\begin_inset Formula $I$
-\end_inset
-
- represent the indices of the un-summed axes in
-\begin_inset Formula $a$
-\end_inset
-
-, let
-\begin_inset Formula $J$
-\end_inset
-
- represent the indices of the un-summed axes in
-\begin_inset Formula $b$
-\end_inset
-
- and let
-\begin_inset Formula $K$
-\end_inset
-
- represent the the indices of the axes summed over in both
-\begin_inset Formula $a$
-\end_inset
-
- and
-\begin_inset Formula $b$
-\end_inset
-
-.
- Also, let
-\begin_inset Formula $a_{t}$
-\end_inset
-
- represent a transposed version of
-\begin_inset Formula $a$
-\end_inset
-
- where the axes to be summed over are pushed to the end, and let
-\begin_inset Formula $b_{t}$
-\end_inset
-
- represent a transposed version of
-\begin_inset Formula $b$
-\end_inset
-
- where the axes to be summed over are pushed to the front.
- Then, using
-\begin_inset Formula $\sum_{K}$
-\end_inset
-
- to represent a multi-index sum, the result can be written as
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-r[I,J]=\sum_{K}a_{t}[I,K]b_{t}[K,J]\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-cross
-\begin_inset LatexCommand index
-name "cross"
-
-\end_inset
-
- (a, b, axisa=-1, axisb=-1, axisc=-1, axis=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the cross product of two (arrays of) vectors.
- The cross product is performed over the axes of the input arrays indicated
- by the axisa, and axisb arguments.
- For both arrays, the axis used must have dimension either 2 or 3.
- If both axes used have dimension 2, then only the z-component of the equivalent
- 3-d cross product is returned.
- Otherwise, the entire vector is returned.
- The axisc argument gives the axis of the vectors in the returned cross-product
- result.
- If axis is not None, then it is assumed that axisa=axisb=axisc=axis (regardless
- of what else is specified).
-
-\end_layout
-
-\begin_layout Description
-allclose
-\begin_inset LatexCommand index
-name "allclose"
-
-\end_inset
-
- (a, b, rtol=
-\begin_inset Formula $10^{-5}$
-\end_inset
-
-, atol=
-\begin_inset Formula $10^{-8}$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns true if all components of a and b are equal subject to the given
- relative and absolute tolerances.
- This returns true if every element of a and b satisfy
-\begin_inset Formula \[
-\left|a-b\right|<\textrm{atol}+\textrm{rtol}\left|b\right|.\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Printing arrays
-\end_layout
-
-\begin_layout Description
-array2string
-\begin_inset LatexCommand index
-name "array2string"
-
-\end_inset
-
- (a)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The default printing mechanism uses this function to produce a string from
- an array.
-
-\end_layout
-
-\begin_layout Description
-set_printoptions
-\begin_inset LatexCommand index
-name "set\\_printoptions"
-
-\end_inset
-
- (precision=None, theshold=None, edgeitems=None, linewidth=None, suppress=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Set options associated with representing an array.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-precision the default number of digits of precision for floating point output
- (default 8);
-\end_layout
-
-\begin_layout Description
-threshold total number of array elements which triggers printing only the
-
-\begin_inset Quotes eld
-\end_inset
-
-ends
-\begin_inset Quotes erd
-\end_inset
-
- of the array rather than a full representation (default 1000);
-\end_layout
-
-\begin_layout Description
-edgeitems number of array elements in summary at beginning and end of each
- dimension (default 3);
-\end_layout
-
-\begin_layout Description
-linewidth the number of characters per line (default 75);
-\end_layout
-
-\begin_layout Description
-suppress Boolean value indicating whether or not to suppress printing of
- small floating point values using scientific notation (default False).
-\end_layout
-
-\end_deeper
-\begin_layout Description
-get_printoptions
-\begin_inset LatexCommand index
-name "get\\_printoptions"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the values of precision, threshold, edgeitems, linewidth, and suppress
- that control printing of arrays.
-\end_layout
-
-\begin_layout Description
-set_string_function
-\begin_inset LatexCommand index
-name "set\\_string\\_function"
-
-\end_inset
-
- (func, repr=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Set the function to use in response to str(array) or repr(array).
- By default this function is array2string.
- The function passed in must take an array argument and return a string.
- If func is None, then the print function is reset to a simple internal
- function.
-
-\end_layout
-
-\begin_layout Section
-Functions redundant with methods
-\end_layout
-
-\begin_layout Standard
-Several functions are available primarily for purposes of backward compatibility
- with old Numeric, and are therefore redundant.
- The functions are all simple wrappers for asarray(a).<function>(*args, **kwds),
- or are replaceable by attribute access.
- The following list documents them.
- It is not recommended that these functions be used in new programs, but
- there are no plans for removing them as in functional form they work with
- arbitrary sequences which is sometimes desirable.
- The functions that mirror methods and attributes are:
-\series bold
-take
-\series default
-
-\begin_inset LatexCommand index
-name "take"
-
-\end_inset
-
-,
-\series bold
-reshape
-\series default
-
-\begin_inset LatexCommand index
-name "reshape"
-
-\end_inset
-
-,
-\series bold
-squeeze
-\series default
-
-\begin_inset LatexCommand index
-name "squeeze"
-
-\end_inset
-
-,
-\series bold
-choose
-\series default
-
-\begin_inset LatexCommand index
-name "choose"
-
-\end_inset
-
-,
-\series bold
-repeat
-\series default
-
-\begin_inset LatexCommand index
-name "repeat"
-
-\end_inset
-
-,
-\series bold
-put
-\series default
-
-\begin_inset LatexCommand index
-name "put"
-
-\end_inset
-
-,
-\series bold
-swapaxes
-\series default
-
-\begin_inset LatexCommand index
-name "swapaxes"
-
-\end_inset
-
-,
-\series bold
-transpose
-\series default
-
-\begin_inset LatexCommand index
-name "transpose"
-
-\end_inset
-
-,
-\series bold
-real
-\series default
-
-\begin_inset LatexCommand index
-name "real"
-
-\end_inset
-
-,
-\series bold
-imag
-\series default
-
-\begin_inset LatexCommand index
-name "imag"
-
-\end_inset
-
-,
-\series bold
-sort
-\series default
-
-\begin_inset LatexCommand index
-name "sort"
-
-\end_inset
-
-,
-\series bold
-argsort
-\series default
-
-\begin_inset LatexCommand index
-name "argsort"
-
-\end_inset
-
-,
-\series bold
-amax
-\begin_inset LatexCommand index
-name "amax"
-
-\end_inset
-
-, argmax
-\series default
-
-\begin_inset LatexCommand index
-name "argmax"
-
-\end_inset
-
-,
-\series bold
-amin
-\begin_inset LatexCommand index
-name "amin"
-
-\end_inset
-
-
-\series default
-,
-\series bold
-argmin
-\series default
-
-\begin_inset LatexCommand index
-name "argmin"
-
-\end_inset
-
-,
-\series bold
-ptp
-\series default
-
-\begin_inset LatexCommand index
-name "ptp"
-
-\end_inset
-
-,
-\series bold
-alen
-\series default
-
-\begin_inset LatexCommand index
-name "alen"
-
-\end_inset
-
-,
-\series bold
-searchsorted
-\series default
-
-\begin_inset LatexCommand index
-name "searchsorted"
-
-\end_inset
-
-,
-\series bold
-diagonal
-\series default
-
-\begin_inset LatexCommand index
-name "diagonal"
-
-\end_inset
-
-,
-\series bold
-trace
-\series default
-
-\begin_inset LatexCommand index
-name "trace"
-
-\end_inset
-
-,
-\series bold
-ravel
-\series default
-
-\begin_inset LatexCommand index
-name "ravel"
-
-\end_inset
-
-,
-\series bold
-nonzero
-\series default
-
-\begin_inset LatexCommand index
-name "nonzero"
-
-\end_inset
-
-,
-\series bold
-shape
-\series default
-
-\begin_inset LatexCommand index
-name "shape"
-
-\end_inset
-
-,
-\series bold
-compress
-\series default
-
-\begin_inset LatexCommand index
-name "compress"
-
-\end_inset
-
-,
-\series bold
-clip
-\series default
-
-\begin_inset LatexCommand index
-name "clip"
-
-\end_inset
-
-,
-\series bold
-std
-\series default
-
-\begin_inset LatexCommand index
-name "std"
-
-\end_inset
-
-,
-\series bold
-var
-\series default
-
-\begin_inset LatexCommand index
-name "var"
-
-\end_inset
-
-,
-\series bold
-mean
-\series default
-
-\begin_inset LatexCommand index
-name "mean"
-
-\end_inset
-
-,
-\series bold
-sum
-\series default
-
-\begin_inset LatexCommand index
-name "sum"
-
-\end_inset
-
-,
-\series bold
-cumsum
-\series default
-
-\begin_inset LatexCommand index
-name "cumsum"
-
-\end_inset
-
-,
-\series bold
-product
-\series default
-
-\begin_inset LatexCommand index
-name "product"
-
-\end_inset
-
-,
-\series bold
-cumproduct
-\series default
-
-\begin_inset LatexCommand index
-name "cumproduct"
-
-\end_inset
-
-,
-\series bold
-sometrue
-\begin_inset LatexCommand index
-name "sometrue"
-
-\end_inset
-
-
-\series default
- (method is .any),
-\series bold
-alltrue
-\begin_inset LatexCommand index
-name "alltrue"
-
-\end_inset
-
-
-\series default
- (method is .all),
-\series bold
-around
-\begin_inset LatexCommand index
-name "around"
-
-\end_inset
-
-
-\series default
- (method is .round),
-\series bold
-rank
-\begin_inset LatexCommand index
-name "rank"
-
-\end_inset
-
-
-\series default
- (attribute is .ndim),
-\series bold
-shape
-\series default
-
-\begin_inset LatexCommand index
-name "shape"
-
-\end_inset
-
-,
-\series bold
-size
-\begin_inset LatexCommand index
-name "size"
-
-\end_inset
-
-
-\series default
- (.size or .shape[axis]), and
-\series bold
-copy
-\series default
-
-\begin_inset LatexCommand index
-name "copy"
-
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Section
-Dealing with data types
-\end_layout
-
-\begin_layout Description
-dtype (obj, align=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a data-type object from any object.
- See Chapter
-\begin_inset LatexCommand ref
-reference "cha:Data-descriptor-objects"
-
-\end_inset
-
- for a more detailed explanation of what can be interpreted as a data-type
- object and the meaning of the align keyword.
-
-\end_layout
-
-\begin_layout Description
-maximum_sctype (arg)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the array-scalar type of highest precision of the same general
- kind as arg which can be any recognized form for describing a data-type.
-\end_layout
-
-\begin_layout Description
-issctype (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns True if obj is an array data type (or a recognized alias for one)
-\end_layout
-
-\begin_layout Description
-obj2sctype (obj, default=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the array type object corresponding to obj which can be an array
- type already, a python type object, an actual array, or any recognized
- alias for an array type object.
- If no suitable data type object can be determined, return default.
-\end_layout
-
-\begin_layout Description
-sctype2char (sctype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the typecode character associated with an array-scalar type dtype.
- The first argument is first converted to a dtype if it needs to be.
-
-\end_layout
-
-\begin_layout Tip
-the type attribute of data-type objects are actual Python type objects subclasse
-d in a hierarchy of types.
- This can often be useful to check data types generically.
- For example, issubclass(dtype.type, integer) can check to see if the data
- type is one of the 10 different integer types.
- The issubclass function, however, raises an error if either argument is
- not an actual type object.
- NumPy defines _(arg1, arg2) that will return false instead of raise an
- error.
- Alternatively, dtype.kind is a character describing the class of the data-type
- so dtype.kind in 'iu' would also check to see if the data-type is an integer
- type.
-\end_layout
-
-\begin_layout Description
-can_cast (from=d1, to=d2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return Boolean value indicating whether or not data type d1 can be cast
- to data type d2 safely (without losing precision or information).
-
-\end_layout
-
-\begin_layout Chapter
-Additional Convenience Routines
-\end_layout
-
-\begin_layout Quotation
-A committee is twelve men doing the work of one.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-John F.
- Kennedy
-\end_layout
-
-\begin_layout Quotation
-Your mind can only hold one thought at a time.
- Make it a positive and constructive one.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-H.
- Jackson Brown Jr.
-
-\end_layout
-
-\begin_layout Section
-Shape functions
-\end_layout
-
-\begin_layout Description
-atleast_1d
-\begin_inset LatexCommand index
-name "atleast\\_1d"
-
-\end_inset
-
- (a1,a2,...,an)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Force a sequence of arrays (including array scalars) to each be at least
- 1-d.
-
-\end_layout
-
-\begin_layout Description
-atleast_2d
-\begin_inset LatexCommand index
-name "atleast\\_2d"
-
-\end_inset
-
- (a1,a2,...,an)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Force a sequence of arrays (including array scalars) to each be at least
- 2-d.
- Dimensions of length 1 are pre-pended to reach a two-dimensional array.
-\end_layout
-
-\begin_layout Description
-atleast_3d
-\begin_inset LatexCommand index
-name "atleast\\_3d"
-
-\end_inset
-
- (a1,a2,...,an)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Force a sequence of arrays (including array_scalars) to each be at least
- 3-d.
- Dimensions of length 1 are pre-pended to reach a two-dimensional array.
-\end_layout
-
-\begin_layout Description
-roll
-\begin_inset LatexCommand index
-name "roll"
-
-\end_inset
-
- (arr, shift, axis=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a new array with the contents of arr shifted (rolled) by the amount
- given in the integer argument shift along the axis specified.
- If axis is None, then the shift takes place in the ravelled array (but
- the returned array has the same shape as arr).
- Elements that shift outside the array are rolled back into the array from
- the opposite side.
-
-\end_layout
-
-\begin_layout Description
-rollaxis
-\begin_inset LatexCommand index
-name "rollaxis"
-
-\end_inset
-
- (arr, axis, start)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return arr transposed so that the provided axis is inserted into the shape
- before start with the other dimensions rolled.
- Thus, if arr.shape is (i,j,k,l) then rollaxis(arr, 2, 0) has shape (k,i,j,l)
- and rollaxis(arr, 1, 3) has shape (i,k,j,l).
-\end_layout
-
-\begin_layout Description
-vstack
-\begin_inset LatexCommand index
-name "vstack"
-
-\end_inset
-
- (seq)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Stack a sequence of arrays along the first axis (row wise).
- Arrays in seq must have the same shape along all dimensions but the first.
- Rebuilds array divided by vsplit.
- All 1-d arrays will be stacked row-wise.
-\end_layout
-
-\begin_layout Description
-hstack
-\begin_inset LatexCommand index
-name "hstack"
-
-\end_inset
-
- (seq)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Stack a sequence of arrays along the second axis (column wise).
- Arrays in seq must have the same shape along all dimensions but the second.
- Rebuilds array divided by hsplit.
- Notice that 1-d arrays will be appended into a new 1-d array.
- Use column_stack to get a 2-d array from 1-d arrays.
- If some arrays are already 2-d, then the 1-d arrays need to have a dimension
- added to the end (
-\emph on
-e.g.
-
-\emph default
-
-\family typewriter
-y[:,newaxis]
-\family default
-) in order to stack correctly.
-
-\end_layout
-
-\begin_layout Description
-column_stack
-\begin_inset LatexCommand index
-name "column\\_stack"
-
-\end_inset
-
- (seq)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Stack a sequence of arrays as columns into a 2-d array.
- 1-d arrays are converted to 2-d arrays and transposed.
- All arrays must have shapes so that the resulting array is well defined.
- Compare with
-\series bold
-hstack
-\series default
-.
-\end_layout
-
-\begin_layout Description
-row_stack
-\begin_inset LatexCommand index
-name "row\\_stack"
-
-\end_inset
-
- (seq)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Stack a sequence of 1-d arrays as rows into a 2-d array (alias for
-\series bold
-vstack
-\series default
-).
-
-\end_layout
-
-\begin_layout Description
-dstack
-\begin_inset LatexCommand index
-name "dstack"
-
-\end_inset
-
- (seq)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Stack a sequence of arrays along the third axis (depth wise).
- Arrays in seq must have the same shape along all dimensions but the third.
- Rebuilds array divided by vsplit.
-\end_layout
-
-\begin_layout Description
-array_split
-\begin_inset LatexCommand index
-name "array\\_split"
-
-\end_inset
-
- (ary, i_or_s, axis=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Divide ary into a list of sub-arrays along the specified axis.
- The i_or_s argument stands for indices_or_sections.
- If i_or_s is an integer, ary is divided into that many equally-sized arrays.
- If it is impossible to make an even split, each of the leading arrays in
- the returned list have one additional member.
- If i_or_s is a list of sorted integer, its entries define the indexes where
- ary is split.
- An empty list for i_or_s results in a single sub-array equal to the original
- array.
-\end_layout
-
-\begin_layout Description
-split
-\begin_inset LatexCommand index
-name "split"
-
-\end_inset
-
- (ary, i_or_s, axis=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The same as array_split() except if i_or_s is an integer and it is impossible
- to make an even split, an error is raised.
-\end_layout
-
-\begin_layout Description
-hsplit
-\begin_inset LatexCommand index
-name "hsplit"
-
-\end_inset
-
- (ary, i_or_s)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Split a single array into multiple columns of sub-arrays (along the first
- axis if 1-d or along the second second if >1-d).
- Only works on arrays of 1 or more dimension.
-
-\end_layout
-
-\begin_layout Description
-vsplit
-\begin_inset LatexCommand index
-name "vsplit"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Split a single array into multiple rows of sub-arrays (along the first
- axis).
- Only works on arrays of 2 or more dimensions.
-\end_layout
-
-\begin_layout Description
-dsplit
-\begin_inset LatexCommand index
-name "dsplit"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Split a single array into multiple sub-arrays along the third axis (depth).
- Only works on arrays of 3 or more dimensions.
-\end_layout
-
-\begin_layout Description
-apply_along_axis
-\begin_inset LatexCommand index
-name "apply\\_along\\_axis"
-
-\end_inset
-
- (func1d, axis, arr, *args)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Execute func1d(arr[sel_i], *args) where func1d takes 1-d arrays and arr
- is an N-d array, where sel_i is a selection object sufficient to select
- a 1-d sub-array along the given axis.
- The function is executed for all 1-d arrays along axis in arr.
-
-\end_layout
-
-\begin_layout Description
-apply_over_axes
-\begin_inset LatexCommand index
-name "apply\\_over\\_axes"
-
-\end_inset
-
- (func, a, axes)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- For each axis in the axes sequence, call func as
-\family typewriter
-res=func(a, axis)
-\family default
-.
- If res is the same shape as a then set
-\family typewriter
-a=res
-\family default
- and continue.
- if
-\family typewriter
-res.ndim = a.ndim -1
-\family default
-, then insert a dimension before axis and continue.
-
-\end_layout
-
-\begin_layout Description
-expand_dims
-\begin_inset LatexCommand index
-name "expand\\_dims"
-
-\end_inset
-
- (a, axis)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Expand the shape of array a by including newaxis
-\series bold
-before
-\series default
- the given axis.
-\end_layout
-
-\begin_layout Description
-resize
-\begin_inset LatexCommand index
-name "resize"
-
-\end_inset
-
- (a, new_shape)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns a new array with the specified shape which can be any size.
- The new array is filled with repeated copies of a.
- This function is similar in spirit to a.resize(new_shape) except that it
- fills in the new array with repeated copies and returns a new array.
-
-\end_layout
-
-\begin_layout Description
-kron
-\begin_inset LatexCommand index
-name "kron"
-
-\end_inset
-
- (a, b)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a composite array with blocks from
-\emph on
-b
-\emph default
- scaled by elements of
-\emph on
-a
-\emph default
-.
- The number of dimensions of
-\emph on
-a
-\emph default
- and
-\emph on
-b
-\emph default
- should be the same.
- If not, then the input with fewer dimensions is pre-pended with ones (broadcast
-) to the same shape as the input with more dimensions.
- The return array has this same number of dimensions with shape given by
- the product of the shape of
-\emph on
-a
-\emph default
- and the shape of
-\emph on
-b
-\emph default
-.
- If either a or b is a scalar then this function is equivalent to multiply(a,b).
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- For example, if
-\emph on
-a
-\emph default
- and
-\emph on
-b
-\emph default
- are is 1-d the result is
-\begin_inset Formula \[
-\left[\begin{array}{cccc}
-a[0]*b & a[1]*b & \cdots & a[-1]*b\end{array}\right]\]
-
-\end_inset
-
- while if
-\emph on
-a
-\emph default
- and
-\emph on
-b
-\emph default
- are 2-d, the result is
-\begin_inset Formula \[
-\left[\begin{array}{cccc}
-a[0,0]*b & a[0,1]*b & \cdots & a[0,-1]*b\\
-a[1,0]*b & a[1,1]*b & \cdots & a[1,-1]*b\\
-\vdots & \vdots & \ddots & \vdots\\
-a[-1,0]*b & a[-1,1]*b & \cdots & a[-1,-1]*b\end{array}\right]\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Example:
-\end_layout
-
-\end_deeper
-\begin_layout MyCode
->>> kron([1,10,100],[5,6,7])
-\newline
-array([ 5, 6, 7, 50, 60, 70, 500, 600,
- 700])
-\newline
->>> kron([[1,10],[100,1000]],[[2,3],[4,5]])
-\newline
-array([[ 2, 3, 20,
- 30],
-\newline
- [ 4, 5, 40, 50],
-\newline
- [ 200, 300, 2000, 3000],
-\newline
-
- [ 400, 500, 4000, 5000]])
-\end_layout
-
-\begin_layout Description
-tile
-\begin_inset LatexCommand index
-name "tile"
-
-\end_inset
-
- (a, reps)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Tile an
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array using the shape information in reps to create a larger
-
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array.
- This is equivalent to kron(ones(reps, a.dtype), a).
- The number of dimensions of a and the length of shape should be the same
- or else 1's will be pre-pended to make them the same.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Example:
-\end_layout
-
-\end_deeper
-\begin_layout MyCode
->>> tile([5,6,7],(1,2,3))
-\newline
-array([[[5, 6, 7, 5, 6, 7, 5, 6, 7],
-\newline
- [5,
- 6, 7, 5, 6, 7, 5, 6, 7]]])
-\end_layout
-
-\begin_layout Section
-Basic functions
-\end_layout
-
-\begin_layout Description
-average
-\begin_inset LatexCommand index
-name "average"
-
-\end_inset
-
- (a, axis=None, weights=None, returned=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Computes the average along the indicated axis.
- If axis is None, average over the entire array.
- Inputs can be integer or floating types; result is type float.
- If weights are given, the result is sum(a*weights)/sum(weights).
- Therefore, weights must have shape equal to a.shape or be 1-d with length
- a.shape[axis].
- Integer weights are converted to float.
- If returned is True, then return a tuple showing both the result and the
- sum of the weights (or count of the values).
- The shape of these two results will be the same.
-
-\end_layout
-
-\begin_layout Description
-cov
-\begin_inset LatexCommand index
-name "cov"
-
-\end_inset
-
- (x, y=None, rowvar=1, bias=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the covariance matrix of data in x.
- If x is a vector and y is None, then this function is equivalent to asarray(x).v
-ar().
- Otherwise, x is interpreted as observations of several random variables.
- If rowvar is True (default), then the variables are in the rows and the
- observations of the variables are in the columns.
- Otherwise, the variables are in the columns and the observations are in
- the rows.
- If y is given then it is treated as another variable or set of variables
- to be added to x.
- By default, a so-called unbiased estimate of the covariance matrix is made.
- If bias is non-zero, then a biased normalization factor (with better mean-squar
-e error performance) is used instead.
- If
-\begin_inset Formula $\mathbf{X}$
-\end_inset
-
- is a random vector, then the covariance matrix is defined as
-\begin_inset Formula \[
-\mathbf{C}=E\left[\left(\mathbf{X}-E\mathbf{X}\right)\left(\mathbf{X}-E\mathbf{X}\right)^{H}\right].\]
-
-\end_inset
-
- It can be approximated as
-\begin_inset Formula \[
-\mathbf{C}\approx\frac{1}{P}\sum_{i=0}^{N-1}\left(\mathbf{x}_{i}-\bar{\mathbf{x}}\right)\left(\mathbf{x}_{i}-\bar{\mathbf{x}}\right)^{H}\]
-
-\end_inset
-
- where
-\begin_inset Formula $\mathbf{x}_{i}$
-\end_inset
-
- is an observation of
-\begin_inset Formula $\mathbf{X}$
-\end_inset
-
- (as a column-vector),
-\begin_inset Formula $N$
-\end_inset
-
- is the number of observations made and
-\begin_inset Formula $P=N-1$
-\end_inset
-
- for an unbiased estimate or
-\begin_inset Formula $P=N$
-\end_inset
-
- for a biased (but lower mean-squared error) estimate.
-
-\end_layout
-
-\begin_layout Description
-corrcoef
-\begin_inset LatexCommand index
-name "corrcoef"
-
-\end_inset
-
- (x, y=None, rowvar=1, bias=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Estimate the correlation coefficient of x.
- By default, each row of x contains a random variable with observations
- of the random variable in the columns of x.
- (If rowvar is False, the each column is a random variable with observations
- in the rows).
- The y argument can be used to append additional variables to x.
- The
-\begin_inset Formula $i^{\textrm{th}}$
-\end_inset
-
- row and
-\begin_inset Formula $j^{\textrm{th}}$
-\end_inset
-
- column of the correlation coefficient matrix is defined as
-\begin_inset Formula \[
-\rho_{ij}=\frac{C_{ij}}{\sqrt{C_{ii}C_{jj}}}\]
-
-\end_inset
-
- where
-\begin_inset Formula $\mathbf{C}$
-\end_inset
-
- is the covariance matrix.
- The rowvar and bias arguments are passed on to the cov function to estimate
-
-\begin_inset Formula $\mathbf{C}.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-msort
-\begin_inset LatexCommand index
-name "msort"
-
-\end_inset
-
- (a)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a new array, sorted along the first axis.
- Equivalent to b=a.copy(); b.sort(0)
-\end_layout
-
-\begin_layout Description
-median
-\begin_inset LatexCommand index
-name "median"
-
-\end_inset
-
- (m)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the median of m along its first dimension.
-\end_layout
-
-\begin_layout Description
-bincount
-\begin_inset LatexCommand index
-name "bincount"
-
-\end_inset
-
- (list=, weights=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The list argument is a 1-d integer array.
- Let
-\begin_inset Formula $r$
-\end_inset
-
- be the returned 1-d array whose length is (list.max()+1).
- If weights is None, then
-\begin_inset Formula $r[i]$
-\end_inset
-
- is the number of occurrences of
-\begin_inset Formula $i$
-\end_inset
-
- in list.
- If weight is present, then the
-\begin_inset Formula $i^{\textrm{th}}$
-\end_inset
-
- element is
-\begin_inset Formula \[
-r[i]=\sum_{j:\textrm{list}\left[j\right]=i}\textrm{weights}[j].\]
-
-\end_inset
-
- Notice that if weights is None, it is equivalent to a weights array of
- all 1.
- The length of weights must be the same as the length of list.
-
-\end_layout
-
-\begin_layout Description
-digitize
-\begin_inset LatexCommand index
-name "digitize"
-
-\end_inset
-
- (x=,bins=)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array of integers the same length as x with values
-\begin_inset Formula $i$
-\end_inset
-
- such that
-\begin_inset Formula $\textrm{bins}\left[i-1\right]\leq x<\textrm{bins}\left[i\right]$
-\end_inset
-
- if bins is monotonically increasing, or
-\begin_inset Formula $\textrm{bins}[i]\leq x<\textrm{bins}[i-1]$
-\end_inset
-
- if bins is monotonically decreasing.
- When
-\begin_inset Formula $x$
-\end_inset
-
- is beyond the bounds of bins, return either
-\begin_inset Formula $i=0$
-\end_inset
-
- or
-\begin_inset Formula $i=$
-\end_inset
-
-len(bins) as appropriate.
-\end_layout
-
-\begin_layout Description
-histogram
-\begin_inset LatexCommand index
-name "histogram"
-
-\end_inset
-
- (x=, bins=None, range=None, normed=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a histogram for the data in x (treated as one-dimensional array
- of type float).
- If bins is not a sequence, then bins should be the number of bins which
- will be constructed ranging from range[0] to range[1] or x.min() to x.max()
- if range is None.
- If normed is True, then the histogram will be normalized and comparable
- with a probability density function, otherwise it will be a count of the
- number of items in each bin.
- The return value is the tuple (n, bins) where n is the histogram.
-\end_layout
-
-\begin_layout Description
-histogram2d
-\begin_inset LatexCommand index
-name "histogram2d"
-
-\end_inset
-
- (x, y, bins=10, range=None, normed=False)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the two-dimensional histogram for a dataset (x,y) given the bins.
- Returns (histogram, xedges, yedges).
- The bins argument can be either the number of bins or a sequence of the
- bin edges if the x and y directions should have the same bins.
- If the bins argument is a sequence of length 2, then separate bin edges
- will be computed.
- The first element can be either the number of bins or the bin edges for
- the x-direction.
- The second element is interpreted as the number of bins or the bin edges
- for the y-direction.
- The returned histogram array, H, is a count of the number of samples in
- each bin.
- The array is oriented such that H[i,j] is the number of samples falling
- into binx[j] and biny[i] (notice the association x<->j and y<->i).
- Setting normed to True returns a density rather than a bin-count.
- The range argument allows specifying lower and upper bin edges (in a sequence
- of length 2 with 2-length sequences in each entry).
- The default is [[x.min(), x.max()],[y.min(), y.max()]].
-
-\end_layout
-
-\begin_layout Description
-histogramdd
-\begin_inset LatexCommand index
-name "histogramdd"
-
-\end_inset
-
- (sample, bins=10, range=None, normed=False)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the
-\begin_inset Formula $D$
-\end_inset
-
--dimensional histogram for a (vector) dataset contained in sample give the
- bins.
- The dataset is a sequence of
-\begin_inset Formula $D$
-\end_inset
-
- arrays or an
-\begin_inset Formula $N\times D$
-\end_inset
-
- array where
-\begin_inset Formula $N$
-\end_inset
-
- is the number of samples and
-\begin_inset Formula $D$
-\end_inset
-
- is the number of dimensions.
- Returns (histogram, edges) where histogram is a
-\begin_inset Formula $D$
-\end_inset
-
--dimensional array of shape given by the number of bins selected in each
- axis containing the number of counts that a point in the sample data fell
- into the volume bin specified.
- The edges sequence has
-\begin_inset Formula $D$
-\end_inset
-
--entries to specify the edge boundaries for each dimension.
- The bins argument is a sequence of edge arrays or a sequence of the number
- of bins.
- If a scalar is given, it is assumed to be the number of bins for all dimensions.
- The range is a length-
-\begin_inset Formula $D$
-\end_inset
-
- sequence containing lower and upper bin edges which default to the min
- and maximum of the respective datasets.
- If normed is True, then a density rather than a bin-count is returned.
-
-\end_layout
-
-\begin_layout Description
-logspace
-\begin_inset LatexCommand index
-name "logspace"
-
-\end_inset
-
- (start, stop, num=50, endpoint=True,base=10.0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evenly spaced samples on a logarithmic scale.
- Returns num evenly spaced (in logspace) samples from base**start to base**stop.
- If endpoint is True, then the last sample is base**stop.
-\end_layout
-
-\begin_layout Description
-linspace
-\begin_inset LatexCommand index
-name "linspace"
-
-\end_inset
-
- (start, stop, num=50, endpoint=True, retstep=False):
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evenly spaced samples.
- Returns num evenly spaced samples from start to stop.
- If endpoint is True, then the last sample is stop.
- If retstep is True, then return the computed step size.
-\end_layout
-
-\begin_layout Description
-meshgrid
-\begin_inset LatexCommand index
-name "meshgrid"
-
-\end_inset
-
- (x, y)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- For 1-d arrays x, y with lengths Nx=len(x) and Ny = len(y), return X, Y
- where X and Y are (Ny, Nx) shaped arrays with the elements of x and y repeated
- to fill the array.
-
-\end_layout
-
-\begin_layout MyCode
->>> X,Y = meshgrid([1,2,3], [4,5,6,7]); print X; print Y
-\newline
-[[1 2 3]
-\newline
- [1 2 3]
-\newline
-
- [1 2 3]
-\newline
- [1 2 3]]
-\newline
-[[4 4 4]
-\newline
- [5 5 5]
-\newline
- [6 6 6]
-\newline
- [7 7 7]]
-\end_layout
-
-\begin_layout Description
-select
-\begin_inset LatexCommand index
-name "select"
-
-\end_inset
-
- (condlist, choicelist, default=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns an array comprised from different elements of choicelist depending
- on the list of conditions.
- The condlist argument is a list of Boolean condition arrays.
- The choicelist argument is a list of choice arrays (of the same size as
- the arrays in condlist).
- The result has the same size as the arrays in choicelist.
- If condlist is [
-\begin_inset Formula $c_{0},\ldots,c_{N-1}$
-\end_inset
-
-], then choicelist must be of length
-\begin_inset Formula $N$
-\end_inset
-
-.
- The elements of choicelist can then be represented as [
-\begin_inset Formula $v_{0},\ldots,v_{N-1}$
-\end_inset
-
-].
- The default choice if none of the conditions are met is given as the default
- argument.
- The conditions are tested in order and the first one satisfied is used
- to select the choice.
- In other words, the elements of the output array are found from the following
- tree (evaluated on an element-by-element basis)
-\end_layout
-
-\begin_layout LyX-Code
-
-\series bold
-if
-\series default
-
-\begin_inset Formula $c_{0}$
-\end_inset
-
-:
-\begin_inset Formula $v_{0}$
-\end_inset
-
-
-\newline
-
-\series bold
-elif
-\series default
-
-\begin_inset Formula $c_{1}$
-\end_inset
-
-:
-\begin_inset Formula $v_{1}$
-\end_inset
-
-
-\newline
-...
-\newline
-
-\series bold
-elif
-\series default
-
-\begin_inset Formula $c_{N-1}$
-\end_inset
-
-:
-\begin_inset Formula $v_{N-1}$
-\end_inset
-
-
-\newline
-
-\series bold
-else
-\series default
-: default
-\end_layout
-
-\begin_layout Description
-piecewise
-\begin_inset LatexCommand index
-name "piecewise"
-
-\end_inset
-
- (x, condlist, funclist, *args, **kw)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute a piecewise-defined function.
- A piecewise defined function is
-\begin_inset Formula \[
-f\left(x\right)=\left\{ \begin{array}{cc}
-f_{1}\left(x\right) & x\in S_{1},\\
-f_{2}\left(x\right) & x\in S_{2},\\
-\vdots & \vdots\\
-f_{n}\left(x\right) & x\in S_{n}.\end{array}\right.\]
-
-\end_inset
-
-where
-\begin_inset Formula $S_{1}$
-\end_inset
-
- are sets.
- Thus, the function is defined differently over different sub-domains of
- the input.
- Such a function can be computed using
-\family typewriter
-select
-\family default
- but such an implementation means calling each
-\begin_inset Formula $f_{i}$
-\end_inset
-
- over the entire region of
-\begin_inset Formula $x.$
-\end_inset
-
- The piecewise call guarantees that each function
-\begin_inset Formula $f_{i}$
-\end_inset
-
- will only be called over those values of
-\begin_inset Formula $x$
-\end_inset
-
- in
-\begin_inset Formula $S_{i}.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Arguments: x is the array of values over which to call the function; condlist
- is a sequence of Boolean (indicator) arrays (or a single Boolean array)
- of the same shape as
-\begin_inset Formula $x$
-\end_inset
-
- that defines the sets (True indicates that element of
-\begin_inset Formula $x$
-\end_inset
-
- is in the set).
- If needed, to match the length of funclist, an
-\begin_inset Quotes eld
-\end_inset
-
-otherwise
-\begin_inset Quotes erd
-\end_inset
-
- set will be added to condlist.
- This otherwise set is defined as
-\begin_inset Formula $S_{n}=\overline{\bigcup S_{i}}.$
-\end_inset
-
- The argument funclist is a list of functions to be called (or items to
- be inserted) corresponding to the conditions.
- Each of these functions can take extra arguments and key-word arguments
- which are passed in as *args, and **kw using standard Python syntax.
- Each of these functions should return vector output for vector input.
- If the function is a scalar, then it will simply be inserted where appropriate
- into the output.
- It is the equivalent of a constant function.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Example: Suppose we want to compute
-\begin_inset Formula $f\left(x\right)=x^{2}\Pi\left(\frac{x}{3}\right)+u\left(x-5\right)$
-\end_inset
-
- where
-\begin_inset Formula $\Pi\left(x\right)=1$
-\end_inset
-
- only when
-\begin_inset Formula $\left|x\right|\leq1$
-\end_inset
-
- and
-\begin_inset Formula $u\left(x\right)=1$
-\end_inset
-
- only when
-\begin_inset Formula $x\geq0.$
-\end_inset
-
- This could be done using the code:
-\end_layout
-
-\end_deeper
-\begin_layout MyCode
->>> f1 = lambda x: x*x
-\newline
->>> x = r_[-4:6:20j]
-\newline
->>> y = piecewise(x,abs(x)<=3,[f1,0])+
-piecewise(x,x>=0,[1,0])
-\newline
->>> set_printoptions(precision=4); print y
-\newline
-[ 0.
- 0.
- 8.687 5.8615 3.59 1.8726 0.7091 0.0997
-\newline
- 1.0443 1.5429 2.5956 4.2022
- 6.3629 9.0776 1.
- 1.
- 1.
-\newline
- 1.
- 1.
- 1.
- ]
-\end_layout
-
-\begin_layout Description
-trim_zeros
-\begin_inset LatexCommand index
-name "trim\\_zeros"
-
-\end_inset
-
- (filt, trim='fb'):
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Trim the leading ('f' in trim) and trailing ('b' in trim) zeros from a
- sequence according to the trim keyword.
-
-\end_layout
-
-\begin_layout Description
-trapz
-\begin_inset LatexCommand index
-name "trapz"
-
-\end_inset
-
- (y, x=None, dx=1.0, axis=-1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If
-\begin_inset Formula $\mathbf{y}$
-\end_inset
-
- contains samples of a function:
-\begin_inset Formula $y_{i}=f\left(x_{i}\right)$
-\end_inset
-
- then trapz can be used to approximate the integral of the function using
- the trapezoidal rule.
- If the sampling is not evenly spaced use
-\begin_inset Formula $\mathbf{x}$
-\end_inset
-
- to pass in the sample positions.
- Otherwise, only the sample-spacing is needed in dx.
- The trapz function can work with many functions at a time stored in an
-
-\begin_inset Formula $N$
-\end_inset
-
--dimensional array.
- The axis argument controls which axis defines the sampling axis (the other
- dimensions are different functions).
- The number of dimensions of the returned result is
-\begin_inset Formula $y$
-\end_inset
-
-.ndim - 1.
-\end_layout
-
-\begin_layout Description
-diff
-\begin_inset LatexCommand index
-name "diff"
-
-\end_inset
-
- (x, n=1, axis=-1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Calculates the
-\begin_inset Formula $n^{\textrm{th}}$
-\end_inset
-
- order, discrete difference along the given axis.
-\end_layout
-
-\begin_layout Description
-gradient
-\begin_inset LatexCommand index
-name "gradient"
-
-\end_inset
-
- (f, *varargs)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Calculate the gradient of an N-d scalar function, f.
- Uses central differences on the interior and first differences on boundaries
- to give the same shape for each component of the gradient.
- The varargs variable can contain 0, 1, or N scalars corresponding to the
- sample distances in each direction (default 1.0).
- If f is N-d, then N arrays are returned each of the same shape as f, giving
- the derivative of f with respect to each dimension.
-
-\end_layout
-
-\begin_layout Description
-angle
-\begin_inset LatexCommand index
-name "angle"
-
-\end_inset
-
- (z, deg=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the angle of a complex number z (in degrees if deg is True).
-\end_layout
-
-\begin_layout Description
-unwrap
-\begin_inset LatexCommand index
-name "unwrap"
-
-\end_inset
-
- (p, discont=pi, axis=-1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Unwraps radian phase p by changing absolute jumps greater than discont
- to their
-\begin_inset Formula $2\pi$
-\end_inset
-
- complement along the given axis.
-
-\end_layout
-
-\begin_layout Description
-sort_complex
-\begin_inset LatexCommand index
-name "sort\\_complex"
-
-\end_inset
-
- (x)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is syntactic sugar for asarray(x).sort().astype(<cmplx_type>) where
- cmplx_type is csingle if x.dtype is integral with fewer bits than intp,
- clongfloat if x.dtype.type is longfloat, and cdouble for all other types.
- The sorting is done by comparing the real part of the array, and then the
- imaginary part if the real parts are the same.
-
-\end_layout
-
-\begin_layout Description
-disp
-\begin_inset LatexCommand index
-name "disp"
-
-\end_inset
-
- (mesg, device=None, linefeed=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Display a message to device (defaults to sys.stdout) with or without a closing
- linefeed.
-\end_layout
-
-\begin_layout Description
-unique
-\begin_inset LatexCommand index
-name "unique"
-
-\end_inset
-
- (seq)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns unique items in the 1-dimensional seq.
-\end_layout
-
-\begin_layout Description
-extract
-\begin_inset LatexCommand index
-name "extract"
-
-\end_inset
-
- (condition, arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equivalent to arr.compress(condition.flat) and arr.flat[bool_(condition.flat)]
- which extracts the elements of (flattened) arr according to the elements
- of (flattened) condition that are True.
-
-\end_layout
-
-\begin_layout Description
-place
-\begin_inset LatexCommand index
-name "place"
-
-\end_inset
-
- (arr, mask, vals)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Inverse of extract.
- Equivalent to arr[abool(mask)] = vals but it uses a different algorithm.
-
-\end_layout
-
-\begin_layout Description
-delete
-\begin_inset LatexCommand index
-name "delete"
-
-\end_inset
-
- (arr, indices, axis=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a new array with the sub-arrays indicated by indices along axis
- removed.
- If axis is None, then first ravel the array and set axis to -1.
- The indices argument describes which sub-arrays along the given axis should
- be removed.
- It can be an integer, a slice object, or a sequence of integers.
- A new array is created with the corresponding sub-arrays are removed.
-
-\end_layout
-
-\begin_layout Description
-insert
-\begin_inset LatexCommand index
-name "insert"
-
-\end_inset
-
- (arr, indices, values, axis=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create a new array with values inserted into arr before indices.
- If axis is None, then first ravel the array and set axis to -1.
- The indices argument describes which indices along the provided axis the
- values should be inserted before.
- It can be an integer, a slice object, or a sequence of integers.
- The values argument must be broadcastable to the shape implied by where
- they will be inserted.
-
-\end_layout
-
-\begin_layout Description
-append
-\begin_inset LatexCommand index
-name "append"
-
-\end_inset
-
- (arr, values, axis=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a new array with values appended to the end of the array along axis.
-
-\end_layout
-
-\begin_layout Description
-nansum
-\begin_inset LatexCommand index
-name "nansum"
-
-\end_inset
-
- (x, axis=None)
-\end_layout
-
-\begin_layout Description
-nanmax
-\begin_inset LatexCommand index
-name "nanmax"
-
-\end_inset
-
- (x, axis=None)
-\end_layout
-
-\begin_layout Description
-nanargmax
-\begin_inset LatexCommand index
-name "nanargmax"
-
-\end_inset
-
- (x, axis=None)
-\end_layout
-
-\begin_layout Description
-nanargmin
-\begin_inset LatexCommand index
-name "nanargmin"
-
-\end_inset
-
- (x, axis=None)
-\end_layout
-
-\begin_layout Description
-nanmin
-\begin_inset LatexCommand index
-name "nanmin"
-
-\end_inset
-
- (x, axis=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These functions perform their respective operations over the given axis
- (or the entire array if axis is None), after replacing any nans with appropriat
-e values so as not to affect the calculation.
-
-\end_layout
-
-\begin_layout Description
-vectorize
-\begin_inset LatexCommand index
-name "vectorize"
-
-\end_inset
-
- (pyfunc, otypes=None, doc=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This creates a class whose instances have a call method that invokes a
- ufunc that has been dynamically built to call the python function pyfunc
- internally.
- The output types can be controlled by the otypes argument.
- If it is None, then the output types will be determined upon first call
- to the function using the provided inputs.
- This can be reset, by re-setting the otypes attribute to
-\begin_inset Quotes eld
-\end_inset
-
-
-\begin_inset Quotes erd
-\end_inset
-
-.
- The normal rules of array broadcasting are followed by the returned object.
-\end_layout
-
-\begin_layout MyCode
->>> def myfunc(a,b):
-\newline
-...
- if (a>b): return a
-\newline
-...
- else: return b-1
-\newline
->>> vecfunc = vectorize(myfunc)
-\newline
->>> vecfunc([[1,2,3],[5,6,9]
-],[7,4,5])
-\newline
-array([[6, 3, 4],
-\newline
- [6, 6, 9]])
-\end_layout
-
-\begin_layout Description
-asarray_chkfinite
-\begin_inset LatexCommand index
-name "asarray\\_chkfinite"
-
-\end_inset
-
- (x)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Like asarray(x) except an error is raised if any of the values in x are
- not finite.
-
-\end_layout
-
-\begin_layout Description
-round_
-\begin_inset LatexCommand index
-name "round\\_"
-
-\end_inset
-
- (x, decimals=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array with all the elements of x rounded to decimals places.
- Returns x if array is not floating point and rounds both the real and imaginary
- parts separately if array is complex.
- Rounds in the same way as standard python except for half-way values are
- rounded to the nearest
-\emph on
-even
-\emph default
- number.
-\end_layout
-
-\begin_layout Description
-packbits (array, axis=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Pack an integer array of logical data (zero/non-zero) into bits of a uint8
- data-type along the dimension given by axis.
- This dimension is shrunk by a factor of 8 (rounded up).
- Each element in the input is converted to a bit in the output which is
- set to 1 or 0 depending on whether the input is non-zero or not.
- Thus, every 8-element chunk of the input is converted to a single byte
- in the output.
- If axis is None, then the bit-packing is done on the entire array as if
- it were raveled.
-\end_layout
-
-\begin_layout Description
-unpackbits (array, axis=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Unpack bits of an array of uint8 data-type into a single uint8 byte for
- each bit along the dimension given by axis.
- This dimension is thus expanded 8-fold, but otherwise the output has the
- same shape as the input.
- If axis is None, then the input is treated as a 1-d array and expanded
- 8-fold so that each bit of the input is given an output byte.
-
-\end_layout
-
-\begin_layout Description
-add_docstring
-\begin_inset LatexCommand index
-name "add\\_docstring"
-
-\end_inset
-
- (obj, doc)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Adds a docstring to a built-in object, obj, that does not have a docstring
- defined already.
- The obj can be a built-in function-or-method, a typeobject, a method descriptor
-, a getset descriptor, or a member descriptor.
- This is useful for improving the documentation of objects defined in C-compiled
- code without re-compiling.
- If the object already has a docstring, a RuntimeError is raised.
- If the object is not a supported type the code can add a docstring to,
- a TypeError is raised.
-
-\end_layout
-
-\begin_layout Description
-add_newdoc
-\begin_inset LatexCommand index
-name "add\\_newdoc"
-
-\end_inset
-
- (place, obj, doc)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Adds a docstring to the
-\emph on
-obj
-\emph default
- imported from
-\emph on
-place
-\emph default
- using exec 'from %s import %s' % (place, obj).
- Thus, both place and obj should be strings.
- If doc is a string, then a single docstring is added to obj from place.
- If doc is a 2-tuple, then obj must be an object with attributes that need
- to be commented.
- The first element of the doc tuple is the attribute to be commented on
- and the second element is the actual docstring.
- If doc is a list, then it must be composed of elements that are 2-tuples
- indicating that obj has several attributes that need to be documented.
-
-\end_layout
-
-\begin_layout Section
-Polynomial functions
-\end_layout
-
-\begin_layout Standard
-There are two interfaces for dealing with polynomials
-\begin_inset LatexCommand index
-name "polynomials"
-
-\end_inset
-
-: a class-based interface, and a collection of functions to deal with a
- polynomials represented as a simple list of coefficients.
- This latter representation results from the is a one-to-one correspondence
- between a length-
-\begin_inset Formula $\left(n+1\right)$
-\end_inset
-
- sequence of coefficients
-\begin_inset Formula $a_{n}\equiv a[n]$
-\end_inset
-
- and an
-\begin_inset Formula $n^{\textrm{th}}$
-\end_inset
-
- order polynomial:
-\begin_inset Formula \[
-p\left(x\right)=a_{0}x^{n}+a_{1}x^{n-1}+\cdots+a_{n-1}x+a_{n}.\]
-
-\end_inset
-
- Most of the functions below operate on and return a simple sequence of
- coefficients representing a polynomial.
- There is, however, a simple polynomial class that provides some utility
- for doing simple algebra on polynomials.
-
-\end_layout
-
-\begin_layout Description
-poly1d
-\begin_inset LatexCommand index
-name "poly1d"
-
-\end_inset
-
- (c_or_r, r=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This construction returns an instance of a simple polynomial class.
- It can take either a list of coefficients on polynomial powers, or a sequence
- of roots (if r=1).
- The returned polynomial can be added, subtracted, multiplied, divided,
- and taken to integer powers, resulting in new polynomials.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-.r roots of the polynomial
-\end_layout
-
-\begin_layout Description
-.o order of the polynomial
-\end_layout
-
-\begin_layout Description
-.c polynomial coefficients as an array (also
-\series bold
-__array__()
-\series default
- )
-\end_layout
-
-\begin_layout Description
-__call__(x) evaluate the polynomial at x (can be an array)
-\end_layout
-
-\begin_layout Description
-__getitem__(x) p[k] returns the coefficient on the kth power of x (backwards
- from indexing the coefficient array)
-\end_layout
-
-\end_deeper
-\begin_layout MyCode
->>> p=poly1d([2,5,7])
-\newline
->>> print p
-\newline
-2
-\newline
-2 x + 5 x + 7
-\newline
->>> print p*[1,3,1]
-\newline
-4
- 3 2
-\newline
-2 x + 11 x + 24 x + 26 x + 7
-\newline
->>> print p([0.5,0.6,3])
-\newline
-[ 10.
- 10.72 40.
- ]
-\newline
->>> print p.r
-\newline
-[-1.25+1.3919j -1.25-1.3919j]
-\end_layout
-
-\begin_layout Description
-poly
-\begin_inset LatexCommand index
-name "poly"
-
-\end_inset
-
- (roots_or_matrix)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a sequence of coefficients representing a polynomial given the sequence
- of roots as an argument.
- Alternatively, if the argument is a 2-d array, then return the characteristic
- polynomial of the matrix.
-
-\end_layout
-
-\begin_layout Description
-roots
-\begin_inset LatexCommand index
-name "roots"
-
-\end_inset
-
- (poly)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the roots of the polynomial represented by coefficients in poly
-\end_layout
-
-\begin_layout Description
-polyint
-\begin_inset LatexCommand index
-name "polyint"
-
-\end_inset
-
- (poly, m=1, k=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an exact
-\begin_inset Formula $m^{\textrm{th}}$
-\end_inset
-
--order integral of the polynomial represented in poly.
- If k is None, then use 0 for the integrating constants.
- Otherwise, use the scalars in the sequence k as integrating constants.
- Also available as .integ (m=1,k=0) method of poly1d objects.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Example:
-\begin_inset Formula \begin{eqnarray*}
-p\left(x\right) & = & x^{2}+3x+4\\
-\int\int p\left(x\right) & = & \frac{1}{12}x^{4}+\frac{1}{2}x^{3}+2x^{2}+k_{0}x+k_{1}\end{eqnarray*}
-
-\end_inset
-
-
-\end_layout
-
-\end_deeper
-\begin_layout MyCode
->>> print polyint([1,3,4],m=2,k=[5,3])
-\newline
-[ 0.0833 0.5 2.
- 5.
- 3.
- ]
-\end_layout
-
-\begin_layout Description
-polyder
-\begin_inset LatexCommand index
-name "polyder"
-
-\end_inset
-
- (poly, m)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an exact
-\begin_inset Formula $m^{\textrm{th}}$
-\end_inset
-
--order derivative of the polynomial represented in poly.
- Also available as .deriv(m=1) method of poly1d objects.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Example:
-\begin_inset Formula \begin{eqnarray*}
-p\left(x\right) & = & x^{3}+2x^{2}+4x+3\\
-\frac{dp}{dx}\left(x\right) & = & 3x^{2}+4x+4\end{eqnarray*}
-
-\end_inset
-
-
-\end_layout
-
-\end_deeper
-\begin_layout MyCode
->>> polyder([1,2,4,3])
-\newline
-array([3, 4, 4])
-\end_layout
-
-\begin_layout Description
-polyadd
-\begin_inset LatexCommand index
-name "polyadd"
-
-\end_inset
-
- (p1, p2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Add the two polynomials represented by coefficients:
-\begin_inset Formula $p_{1}\left(x\right)+p_{2}\left(x\right)$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-polysub
-\begin_inset LatexCommand index
-name "polysub"
-
-\end_inset
-
- (p1, p2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return coefficients for the polynomial found by subtracting the two polynomials
- represented by
-\begin_inset Formula $p_{1}$
-\end_inset
-
- and
-\begin_inset Formula $p_{2}$
-\end_inset
-
-:
-\begin_inset Formula $p_{1}\left(x\right)-p_{2}\left(x\right)$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-polymul
-\begin_inset LatexCommand index
-name "polymul"
-
-\end_inset
-
- (p1, p2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the coefficients for
-\begin_inset Formula $p_{1}\left(x\right)p_{2}\left(x\right)$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-polydiv
-\begin_inset LatexCommand index
-name "polydiv"
-
-\end_inset
-
- (p1, p2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the quotient,
-\begin_inset Formula $q\left(x\right)$
-\end_inset
-
-, and remainder,
-\begin_inset Formula $r\left(x\right)$
-\end_inset
-
-, so that
-\begin_inset Formula $p_{1}\left(x\right)=q\left(x\right)p_{2}\left(x\right)+r\left(x\right),$
-\end_inset
-
- with the order of
-\begin_inset Formula $r\left(x\right)$
-\end_inset
-
- less than the order of
-\begin_inset Formula $p_{2}\left(x\right).$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-polyval
-\begin_inset LatexCommand index
-name "polyval"
-
-\end_inset
-
- (p, y)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Evaluate the polynomial
-\begin_inset Formula $p$
-\end_inset
-
- at
-\begin_inset Formula $y$
-\end_inset
-
-.
- The argument,
-\begin_inset Formula $y$
-\end_inset
-
-, can be a number or an array or a polynomial object.
- If x is a polynomial object, then polyval performs polynomial composition:
-
-\begin_inset Formula $p\left(y\left(x\right)\right),$
-\end_inset
-
- otherwise polyval computes the value of the polynomial at each
-\begin_inset Formula $y$
-\end_inset
-
-.
- Uses Horner's rule for evaluation, but this can still lead to numerical
- instabilities for wildly fluctuating coefficients.
-\end_layout
-
-\begin_layout Description
-polyfit
-\begin_inset LatexCommand index
-name "polyfit"
-
-\end_inset
-
- (x,y,N)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute a best-fit polynomial in
-\begin_inset Formula $x$
-\end_inset
-
- of order
-\begin_inset Formula $N$
-\end_inset
-
-, to the data,
-\begin_inset Formula $y$
-\end_inset
-
-, in the sense of minimizing averaged-squared error between the measurement
- and the model.
- Useful for quick line-fitting
-\begin_inset LatexCommand index
-name "fitting"
-
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Section
-Set Operations
-\end_layout
-
-\begin_layout Standard
-The set operations
-\begin_inset LatexCommand index
-name "set operations|("
-
-\end_inset
-
- were kindly contributed by Robert Cimrman.
- These set operations are based on sorting functions and all expect 1-d
- sequences with unique elements with the exception of unique1d and intersect1d_n
-u which will flatten N-d nested-sequences to 1-d arrays and can handle non-uniqu
-e elements.
-
-\end_layout
-
-\begin_layout Description
-unique1d
-\begin_inset LatexCommand index
-name "unique1d"
-
-\end_inset
-
- (arr, retindx=False)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the unique elements of arr as a 1-d array.
- If retindx is True, then also return the indices, ind, such that arr.flat[ind]
- is the set of unique values.
-\end_layout
-
-\begin_layout Description
-intersect1d
-\begin_inset LatexCommand index
-name "intersect1d"
-
-\end_inset
-
- (a1, a2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the (sorted) intersection of a1 and a2 which is an array containing
- the elements of a1 that are also in a2.
-
-\end_layout
-
-\begin_layout Description
-intersect1d_nu
-\begin_inset LatexCommand index
-name "intersect1d\\_nu"
-
-\end_inset
-
- (a1, a2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the (sorted) intersection of a1 and a2 but allow a1 and a2 to be
- N-d arrays with non-unique elements.
- Equivalent to intersect1d(unique1d(a1), unique1d(a2)).
-
-\end_layout
-
-\begin_layout Description
-union1d
-\begin_inset LatexCommand index
-name "union1d"
-
-\end_inset
-
- (a1, a2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the (sorted) union of a1 and a2 which is an array containing elements
- that are in either a1 or a2.
-
-\end_layout
-
-\begin_layout Description
-setdiff1d
-\begin_inset LatexCommand index
-name "setdiff1d"
-
-\end_inset
-
- (a1, a2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the set-difference of a1 and a2 which is an array containing the
- elements of a1 that are
-\series bold
-not
-\series default
- in a2.
-\end_layout
-
-\begin_layout Description
-setxor1d
-\begin_inset LatexCommand index
-name "setxor1d"
-
-\end_inset
-
- (a1, a2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the (sorted) set containing the exclusive-or of the arrays a1 and
- a2.
- The exclusive-or contains elements that are in a1 or in a2 as long as the
- element is not in both a1 and a2.
-
-\end_layout
-
-\begin_layout Description
-setmember1d
-\begin_inset LatexCommand index
-name "setmember1d"
-
-\end_inset
-
- (tocheck, set)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a Boolean 1-d array of the length of tocheck which is True whenever
- that element is contained in set and false when it is not.
- Equivalent
-\begin_inset LatexCommand index
-name "set operations|)"
-
-\end_inset
-
- to array([x in set for x in tocheck]).
-\end_layout
-
-\begin_layout Section
-Array construction using index tricks
-\end_layout
-
-\begin_layout Standard
-The functions and classes in this category make it simpler to construct
- arrays.
-
-\end_layout
-
-\begin_layout Description
-ix_
-\begin_inset LatexCommand index
-name "ix\\_"
-
-\end_inset
-
- (*args)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This indexing cross function is useful for forming indexing arrays necessary
- to select out the cross-product of
-\begin_inset Formula $N$
-\end_inset
-
- 1-dimensional arrays.
- Note that the default indexing does not do a cross-product (which might
- be unexpected for someone coming from other programming environments).
- The default indexing is more general purpose.
- Using the ix_ constructor can produce the indexing arrays necessary to
- select a cross-product.
-\end_layout
-
-\begin_layout Description
-mgrid [index expression]
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is an instance of a class.
- It can be used to construct a filled
-\begin_inset Quotes eld
-\end_inset
-
-mesh-grid
-\begin_inset Quotes erd
-\end_inset
-
- using slicing syntax.
-
-\end_layout
-
-\begin_layout Description
-ogrid [index expression]
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is similar to mgrid except it returns an open grid, so as to save
- space and time.
- The broadcasting rules will ensure that any universal function operating
- on the grid will act as if the ogrid had been the result of mgrid.
-\end_layout
-
-\begin_layout Description
-r_
-\begin_inset LatexCommand index
-name "r\\_"
-
-\end_inset
-
- [index expression]
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is a simple way to build up arrays quickly.
- There are two use cases.
- 1) If the index expression contains comma separated arrays, then stack
- them along their first axis.
- 2) If the index expression contains slice notation or scalars then create
- a 1-d array with a range indicated by the slice notation.
- In other-words the slice syntax start:stop:step is equivalent to arange(start,
- stop, step) inside of the brackets.
- However, if step is an imaginary number (i.e.
- 100j) then its integer portion is interpreted as a number-of-points desired
- and the start and stop are inclusive.
- In other words start:stop:step
-\family typewriter
-j
-\family default
- is interpreted as linspace(start, stop, step, endpoint=1) inside of the
- brackets.
- After expansion of slice notation, all comma separated sequences are concatenat
-ed together.
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Optional character strings placed as the first element of the index expression
- can be used to change the output.
- The strings 'r' or 'c' result in matrix output.
- If the result is 1-d and 'r' is specified a
-\begin_inset Formula $1\times N$
-\end_inset
-
- (row) matrix is produced.
- If the result is 1-d and 'c' is specified, then a
-\begin_inset Formula $N\times1$
-\end_inset
-
- (column) matrix is produced.
- If the result is 2-d then both provide the same matrix result.
-
-\end_layout
-
-\begin_layout MyCode
->>> print r_[-1:1:9j,[0]*10,5,6]
-\newline
-[-1.
- -0.75 -0.5 -0.25 0.
- 0.25 0.5 0.75 1.
- 0.
- 0.
-\newline
- 0.
- 0.
- 0.
- 0.
- 0.
- 0.
- 0.
- 0.
- 5.
- 6.
- ]
-\newline
->>> print r_['r',1,2,5,6]
-\newline
-[[1 2 5 6]]
-\newline
->>> print r_['c',1,2,5,6]
-\newline
-[[1]
-\newline
- [2]
-\newline
-
- [5]
-\newline
- [6]]
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A string integer specifies which axis to stack multiple comma separated
- arrays along.
-
-\end_layout
-
-\begin_layout MyCode
->>> a=arange(6).reshape(2,3)
-\newline
->>> r_[a,a]
-\newline
-array([[0, 1, 2],
-\newline
- [3, 4, 5],
-\newline
-
- [0, 1, 2],
-\newline
- [3, 4, 5]])
-\newline
->>> r_['-1',a,a]
-\newline
-array([[0, 1, 2, 0, 1,
- 2],
-\newline
- [3, 4, 5, 3, 4, 5]])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A string of two comma-separated integers allows indication of the minimum
- number of dimensions to force each entry into as the second integer (the
- axis to concatenate along is still the first integer).
-
-\end_layout
-
-\begin_layout MyCode
->>> r_['0,2',[1,2,3],[4,5,6]]
-\newline
-array([[1, 2, 3],
-\newline
- [4, 5, 6]])
-\newline
->>> r_['1,2',[1,
-2,3],[4,5,6]]
-\newline
-array([[1, 2, 3, 4, 5, 6]])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A string with three comma-separated integers allows specification of the
- axis to concatenate along, the minimum number of dimensions to force the
- entries to, and which axis should contain the start of the arrays which
- are less than the specified number of dimensions.
- In other words the third integer allows you to specify where the the 1's
- should be placed in the shape of the arrays that have their shapes upgraded.
- By default, they are placed in the front of the shape tuple.
- The third argument allows you to specify where the start of the array should
- be instead.
- Thus, a third argument of '0' would place the 1's at the end of the array
- shape.
- Negative integers specify where in the new shape tuple the last dimension
- of upgraded arrays should be placed, so the default is '-1'.
-\end_layout
-
-\begin_layout MyCode
->>> r_['0,2,0', [1,2,3], [4,5,6]]
-\newline
-array([[1],
-\newline
- [2],
-\newline
- [3],
-\newline
-
- [4],
-\newline
- [5],
-\newline
- [6]])
-\newline
->>> r_['1,2,0', [1,2,3], [4,5,6]]
-\newline
-array([[1,
- 4],
-\newline
- [2, 5],
-\newline
- [3, 6]])
-\end_layout
-
-\begin_layout Description
-c_
-\begin_inset LatexCommand index
-name "c\\_"
-
-\end_inset
-
- [index_expression]
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is short-hand for r_['-1,2,0', index_expression] useful because of
- its common occurence.
- In particular, arrays will be stacked along their last axis after being
- upgraded to at least 2-d with 1's post-pended to the shape (column vectors
- made out of 1-d arrays).
-
-\end_layout
-
-\begin_layout Section
-Other indexing devices
-\end_layout
-
-\begin_layout Description
-index_exp
-\begin_inset LatexCommand index
-name "index\\_exp"
-
-\end_inset
-
- [index expression]
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a tuple of Python objects that implements the index expression and
- can be modified and placed in any other index expression.
-
-\end_layout
-
-\begin_layout MyCode
->>> index_exp[2:5,...,4,::-1]
-\newline
-(slice(2, 5, None), Ellipsis, 4, slice(None, None,
- -1))
-\end_layout
-
-\begin_layout Description
-s_
-\begin_inset LatexCommand index
-name "s\\_"
-
-\end_inset
-
- [index expression]
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Translate index expressions into the equivalent Python objects.
- This is similar to index_expression except a tuple is not always returned.
- For example:
-\end_layout
-
-\begin_layout MyCode
->>> s_[1:10]
-\newline
-slice(1, 10, None)
-\newline
->>> s_[1:10,-3:4:0.5]
-\newline
-(slice(1, 10, None), slice(-3,
- 4, 0.5))
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This provides a standard way to construct index expressions to pass to
- functions and methods because Python does not allow slice expressions anywhere
- except for inside brackets.
-
-\end_layout
-
-\begin_layout Description
-ndindex
-\begin_inset LatexCommand index
-name "ndindex"
-
-\end_inset
-
- (*seq)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A sequence of
-\begin_inset Formula $N$
-\end_inset
-
- integers are passed in as separate arguments.
- These integers are used as the upper boundaries of an
-\begin_inset Formula $N$
-\end_inset
-
--dimensional counter that starts at 0.
- The object returned is an iterator that implements the counter.
-\end_layout
-
-\begin_layout MyCode
->>> for index in ndindex(3,3,2):
-\newline
-...
- print index,
-\newline
-(0, 0, 0) (0, 0, 1) (0, 1, 0) (0, 1, 1) (0, 2, 0) (0, 2,
- 1) (1, 0, 0) (1, 0, 1) (1, 1, 0) (1, 1, 1) (1, 2, 0) (1, 2, 1) (2, 0, 0)
- (2, 0, 1) (2, 1, 0) (2, 1, 1) (2, 2, 0) (2, 2, 1)
-\end_layout
-
-\begin_layout Description
-unravel_index
-\begin_inset LatexCommand index
-name "unravel\\_index"
-
-\end_inset
-
- (indx, dims)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert a flat index, indx, into an index tuple for an array of the given
- shape.
- Keep in mind that it may be more convenient to use indx with a.flat, then
- to unravel the index.
-\end_layout
-
-\begin_layout Section
-Two-dimensional functions
-\end_layout
-
-\begin_layout Standard
-These functions all deal with or return two dimensional arrays.
-\end_layout
-
-\begin_layout Description
-eye
-\begin_inset LatexCommand index
-name "eye"
-
-\end_inset
-
- (
-\begin_inset Formula $N$
-\end_inset
-
-,
-\begin_inset Formula $M$
-\end_inset
-
-=None,
-\begin_inset Formula $k$
-\end_inset
-
-=0, dtype=float)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an
-\begin_inset Formula $N\times M$
-\end_inset
-
- array of the given type with ones down the
-\begin_inset Formula $k^{\textrm{th}}$
-\end_inset
-
- diagonal.
- If
-\begin_inset Formula $M$
-\end_inset
-
- is None, it defaults to
-\begin_inset Formula $N$
-\end_inset
-
-.
- Alternatively, if
-\begin_inset Formula $M$
-\end_inset
-
- is a valid data type, then it becomes the data-type used.
-
-\end_layout
-
-\begin_layout Description
-vander
-\begin_inset LatexCommand index
-name "vander"
-
-\end_inset
-
- (
-\begin_inset Formula $x$
-\end_inset
-
-,
-\begin_inset Formula $N$
-\end_inset
-
-=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The Vandermonde matrix of vector,
-\begin_inset Formula $x$
-\end_inset
-
-.
- The
-\begin_inset Formula $i^{\textrm{th}}$
-\end_inset
-
- column of the return matrix is the
-\begin_inset Formula $m_{i}^{\textrm{th}}$
-\end_inset
-
- power of
-\begin_inset Formula $x$
-\end_inset
-
- where
-\begin_inset Formula $m_{i}=N-i-1$
-\end_inset
-
-.
- If
-\begin_inset Formula $N$
-\end_inset
-
- is None, it defaults to the length of
-\begin_inset Formula $x$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout MyCode
->>> vander([1,2,3,4,5],3)
-\newline
-array([[ 1, 1, 1],
-\newline
- [ 4, 2, 1],
-\newline
-
- [ 9, 3, 1],
-\newline
- [16, 4, 1],
-\newline
- [25, 5, 1]])
-\end_layout
-
-\begin_layout Description
-diag
-\begin_inset LatexCommand index
-name "diag"
-
-\end_inset
-
- (
-\begin_inset Formula $v$
-\end_inset
-
-,
-\begin_inset Formula $k$
-\end_inset
-
-=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the
-\begin_inset Formula $k^{\textrm{th}}$
-\end_inset
-
- diagonal if
-\begin_inset Formula $v$
-\end_inset
-
- is a 2-d array, or returns an array with
-\begin_inset Formula $v$
-\end_inset
-
- as the
-\begin_inset Formula $k^{\textrm{th}}$
-\end_inset
-
- diagonal if
-\begin_inset Formula $v$
-\end_inset
-
- is a 1-d array.
-
-\end_layout
-
-\begin_layout MyCode
->>> diag(arange(12).reshape(4,3),k=1)
-\newline
-array([1, 5])
-\newline
->>> diag([1,4,5,7],k=-1)
-\newline
-array([
-[0, 0, 0, 0, 0],
-\newline
- [1, 0, 0, 0, 0],
-\newline
- [0, 4, 0, 0, 0],
-\newline
- [0,
- 0, 5, 0, 0],
-\newline
- [0, 0, 0, 7, 0]])
-\end_layout
-
-\begin_layout Description
-diagflat
-\begin_inset LatexCommand index
-name "diagflat"
-
-\end_inset
-
- (
-\begin_inset Formula $v$
-\end_inset
-
-,
-\begin_inset Formula $k$
-\end_inset
-
-=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a 2-d array (of the same class as
-\begin_inset Formula $v$
-\end_inset
-
-) by placing a flattened version of
-\begin_inset Formula $v$
-\end_inset
-
- along the
-\begin_inset Formula $k^{\textrm{th}}$
-\end_inset
-
- diagonal.
- This differs from diag in that it only creates 2-d arrays and will work
- with any object that can be converted to an array (returning that object
- if it also defines an __array_wrap__ method).
-
-\end_layout
-
-\begin_layout Description
-fliplr
-\begin_inset LatexCommand index
-name "fliplr"
-
-\end_inset
-
- (m)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the array, m, with rows preserved and columns reversed in the left-right
- direction.
- For m.ndim > 2, this works on the first two dimensions (equivalent to m[:,::-1])
-\end_layout
-
-\begin_layout Description
-flipud
-\begin_inset LatexCommand index
-name "flipud"
-
-\end_inset
-
- (m)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the array, m, with columns preserved and rows reversed in the up-down
- direction.
- For m.ndim > 1, this works on the first dimension (equivalent to m[::-1])
-\end_layout
-
-\begin_layout Description
-rot90
-\begin_inset LatexCommand index
-name "rot90"
-
-\end_inset
-
- (m, k=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Rotate the first two dimensions of an array, m, by k*90 degrees in the
- counterclockwise direction.
- Must have m.ndim >=2.
-\end_layout
-
-\begin_layout Description
-tri
-\begin_inset LatexCommand index
-name "tri"
-
-\end_inset
-
- (
-\begin_inset Formula $N$
-\end_inset
-
-,
-\begin_inset Formula $M$
-\end_inset
-
-=
-\begin_inset Formula $N$
-\end_inset
-
-, k=0, dtype=aint)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct an
-\begin_inset Formula $N\times M$
-\end_inset
-
- array where all the diagonals starting from the lower left corner up to
- the
-\begin_inset Formula $\textrm{k}^{\textrm{th}}$
-\end_inset
-
- diagonal are all ones.
-
-\end_layout
-
-\begin_layout Description
-triu
-\begin_inset LatexCommand index
-name "triu"
-
-\end_inset
-
- (m, k=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a upper-triangular 2-d array from m with all the elements below
- the
-\begin_inset Formula $\textrm{k}^{\textrm{th}}$
-\end_inset
-
- diagonal set to 0.
-
-\end_layout
-
-\begin_layout Description
-tril
-\begin_inset LatexCommand index
-name "tril"
-
-\end_inset
-
- (m, k=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a lower-triangular 2-d array from m with all the elements above
- the
-\begin_inset Formula $\textrm{k}^{\textrm{th}}$
-\end_inset
-
- diagonal set to 0.
-
-\end_layout
-
-\begin_layout Description
-mat
-\begin_inset LatexCommand index
-name "mat"
-
-\end_inset
-
- (data, dtype=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a matrix from data.
- Alias for numpy.asmatrix.
- The calling syntax is the same as that function.
- Note that data can be a string in which case the routine uses spaces and
- semi-colons to construct the matrix:
-\end_layout
-
-\begin_layout MyCode
->>> mat('1 3 4; 5 6 9')
-\newline
-matrix([[1, 3, 4],
-\newline
- [5, 6, 9]])
-\end_layout
-
-\begin_layout Description
-bmat
-\begin_inset LatexCommand index
-name "bmat"
-
-\end_inset
-
- (obj, ldict=None, gdict=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Build a matrix from sub-blocks.
- This is similar to mat, except the items in the nested-sequence, or string,
- should be appropriately shaped 2-d arrays.
- If obj is a string, then ldict and gdict can be used to alter where the
- names represented in the string are found (default is current local and
- global namespace).
-
-\end_layout
-
-\begin_layout MyCode
->>> A=mat('1 2; 3 4'); B=mat('5 6; 7 8')
-\newline
->>> bmat('A, B; B, A')
-\newline
-matrix([[1,
- 2, 5, 6],
-\newline
- [3, 4, 7, 8],
-\newline
- [5, 6, 1, 2],
-\newline
- [7, 8, 3, 4]])
-\end_layout
-
-\begin_layout Section
-More data type functions
-\end_layout
-
-\begin_layout Description
-issubclass_
-\begin_inset LatexCommand index
-name "issubclass\\_"
-
-\end_inset
-
- (arg1, arg2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns True if arg1 is a sub-class of arg2, otherwise returns False.
- Similar to the built-in issubclass except it does not raise an error if
- arg1 or arg2 are not types.
-
-\end_layout
-
-\begin_layout Description
-issubdtype
-\begin_inset LatexCommand index
-name "issubdtype"
-
-\end_inset
-
- (arg1, arg2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns True if the type-object of the data-type represented by arg1 is
- a sub class of the type-object of the data-type represented by arg2.
-\end_layout
-
-\begin_layout Description
-iscomplexobj
-\begin_inset LatexCommand index
-name "iscomplexobj"
-
-\end_inset
-
- (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a single True or False value depending on whether or not obj would
- be interpreted as an array with complex-valued data type.
-\end_layout
-
-\begin_layout Description
-isrealobj
-\begin_inset LatexCommand index
-name "isrealobj"
-
-\end_inset
-
- (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a single True or False value depending on whether or not obj would
- be interpreted as an array with real-valued data type.
-\end_layout
-
-\begin_layout Description
-isscalar
-\begin_inset LatexCommand index
-name "isscalar"
-
-\end_inset
-
- (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True if obj is a scalar (an instance of an array data type, or a standard
- Python scalar type).
- There is also a sequence of called ScalarType defined in NumPy, so that
- this can also be tested as type(obj) in numpy.ScalarType.
-
-\end_layout
-
-\begin_layout Description
-nan_to_num
-\begin_inset LatexCommand index
-name "nan\\_to\\_num"
-
-\end_inset
-
- (arr)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns an array with non-finite numbers changed to finite numbers.
- The mapping converts
-\family typewriter
-nan
-\family default
- to 0,
-\family typewriter
-inf
-\family default
- to the maximum value for the data type and
-\family typewriter
--inf
-\family default
- to the minimum value for the data type.
-\end_layout
-
-\begin_layout Description
-real_if_close
-\begin_inset LatexCommand index
-name "real\\_if\\_close"
-
-\end_inset
-
- (arr, tol=100)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a real arr if arr is complex with imaginary parts less than some
- tolerance.
- If tol > 1, then it represents a multiplicative factor on the value of
- epsilon for the data type of arr.
-\end_layout
-
-\begin_layout Description
-cast
-\begin_inset LatexCommand index
-name "cast"
-
-\end_inset
-
- [dtype_or_alias] (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Cast obj to an array of the given type.
- This is equivalent to array(obj, copy=0).astype(dtype_or_alias).
- When one type is cast to another in this fashion, a very low-level operation
- takes place.
- Typically, you get what your C-compiler produces for the cast, but notice
- that in the case of casting to a bool type, the value becomes either a
- 0 or a 1.
-
-\end_layout
-
-\begin_layout MyCode
->>> cast[bool]([1,2,0,4,0]).astype(int)
-\newline
-array([1, 1, 0, 1, 0])
-\end_layout
-
-\begin_layout Description
-asfarray
-\begin_inset LatexCommand index
-name "asfarray"
-
-\end_inset
-
- (a, dtype=float)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array of inexact data type (floating or complexfloating).
-
-\end_layout
-
-\begin_layout Description
-mintypecode
-\begin_inset LatexCommand index
-name "mintypecode"
-
-\end_inset
-
- (typechars, typeset='GDFgdf', default='d')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a minimum data type character from typeset that handles all given
- typechars.
- The returned type character must correspond to the data type of the smallest
- size such that an array of the returned type can handle the data from an
- array of type t for each t in typechars.
- If the typechars does not intersect with the typeset, then default is returned.
- If an element of typechars is not a string, then t=asarray(t).dtypechar
- is applied.
-\end_layout
-
-\begin_layout Description
-finfo
-\begin_inset LatexCommand index
-name "finfo"
-
-\end_inset
-
- (dtype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This class allows exploration of the details of how a floating point number
- is represented in the computer.
- It can be instantiated by an inexact data type object (or an alias for
- one).
- Complex-valued data types are acceptable and are equivalent to their real-value
-d counterparts.
- The attributes of the class are
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-nmant The number of bits in the floating point mantissa, or fraction.
-\end_layout
-
-\begin_layout Description
-nexp The number of bits in the floating point exponent
-\end_layout
-
-\begin_layout Description
-machep Exponent of the smallest (most negative) power of 2 that when added
- to 1.0 gives something different than 1.0.
-
-\end_layout
-
-\begin_layout Description
-eps Floating point precision: 2**machep.
-\end_layout
-
-\begin_layout Description
-precision Number of decimal digits of precision: int(-log10(eps))
-\end_layout
-
-\begin_layout Description
-resolution 10**(-precision)
-\end_layout
-
-\begin_layout Description
-negep Exponent of the smallest power of 2 that, subtracted from 1.0, gives
- something different than 1.0.
-\end_layout
-
-\begin_layout Description
-epsneg Floating point precision: 2**negep.
-\end_layout
-
-\begin_layout Description
-minexp Smallest (most negative) power of 2 producing
-\begin_inset Quotes eld
-\end_inset
-
-normal
-\begin_inset Quotes erd
-\end_inset
-
- numbers (no leading zeros in the mantissa).
-
-\end_layout
-
-\begin_layout Description
-tiny The smallest (in magnitude) usable floating point number equal to 2**minexp.
-\end_layout
-
-\begin_layout Description
-maxexp Smallest (positive) power of 2 that causes overflow.
-\end_layout
-
-\begin_layout Description
-max The largest usable floating value: (1-epsneg)* (2**maxep)
-\end_layout
-
-\begin_layout Description
-min The most negative usable floating value: -max
-\end_layout
-
-\end_deeper
-\begin_layout Description
-\InsetSpace ~
- The most useful attributes are probably eps, max, min, and tiny.
-\end_layout
-
-\begin_layout Section
-Functions that behave like ufuncs
-\end_layout
-
-\begin_layout Standard
-These functions are Python functions built on top of universal functions
- (ufuncs) and also take optional output arguments.
- They broadcast like ufuncs but do not have ufunc attributes.
-\end_layout
-
-\begin_layout Description
-fix
-\begin_inset LatexCommand index
-name "fix"
-
-\end_inset
-
- (x, y=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Round x to the nearest integer towards zero.
-\end_layout
-
-\begin_layout Description
-isneginf
-\begin_inset LatexCommand index
-name "isneginf"
-
-\end_inset
-
- (x, y=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True if
-\begin_inset Formula $x=-\infty$
-\end_inset
-
-.
- Should be the same as
-\family typewriter
-x==NumPy.NINF
-\family default
-.
-\end_layout
-
-\begin_layout Description
-isposinf
-\begin_inset LatexCommand index
-name "isposinf"
-
-\end_inset
-
- (x, y=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True if
-\begin_inset Formula $x=+\infty.$
-\end_inset
-
- Should be the same as
-\family typewriter
-x==NumPy.PINF
-\family default
-.
-\end_layout
-
-\begin_layout Description
-log2
-\begin_inset LatexCommand index
-name "log2"
-
-\end_inset
-
- (x, y=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the logarithm to the base 2 of
-\begin_inset Formula $x.$
-\end_inset
-
- An optional output array may be provided.
-\end_layout
-
-\begin_layout Section
-Miscellaneous Functions
-\end_layout
-
-\begin_layout Standard
-Some miscellaneous functions are available in NumPy which are included largely
- for compatibility with MLab of the old Numeric package.
- One notable difference, however, is that due to a separate implementation
- of the modified Bessel function, the kaiser window is available without
- needing a separate library.
-
-\end_layout
-
-\begin_layout Description
-sinc
-\begin_inset LatexCommand index
-name "sinc"
-
-\end_inset
-
- (
-\begin_inset Formula $x$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the sinc function for
-\begin_inset Formula $x$
-\end_inset
-
- which can be a scalar or array.
- The sinc is defined as
-\begin_inset Formula $y=\textrm{sinc}\left(x\right)=\frac{\sin\left(\pi x\right)}{\pi x}$
-\end_inset
-
- with the caveat that the limiting value (1.0) of the ratio is taken for
-
-\begin_inset Formula $x=0.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-i0
-\begin_inset LatexCommand index
-name "i0"
-
-\end_inset
-
- (
-\begin_inset Formula $x$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Modified Bessel function of the first kind of order 0.
- Needed to compute the kaiser window.
- The modified Bessel function is defined as
-\begin_inset Formula \[
-I_{0}\left(x\right)=\frac{1}{\pi}\int_{0}^{\pi}e^{x\cos\theta}d\theta=\sum_{k=0}^{\infty}\frac{x^{2k}}{4^{k}\left(k!\right)^{2}}.\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-blackman
-\begin_inset LatexCommand index
-name "blackman"
-
-\end_inset
-
- (
-\begin_inset Formula $M$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct an
-\begin_inset Formula $M$
-\end_inset
-
--point Blackman smoothing window which is sequence of length
-\begin_inset Formula $M$
-\end_inset
-
- with values given for
-\begin_inset Formula $n=0\ldots M-1$
-\end_inset
-
- by
-\begin_inset Formula \[
-w\left[n\right]=0.42-0.5\cos\left(2\pi\frac{n}{M-1}\right)+0.08\cos\left(4\pi\frac{n}{M-1}\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-bartlett
-\begin_inset LatexCommand index
-name "bartlett"
-
-\end_inset
-
- (
-\begin_inset Formula $M$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct an
-\begin_inset Formula $M$
-\end_inset
-
--point Bartlett (triangular) smoothing window as
-\begin_inset Formula \[
-w\left[n\right]=\left\{ \begin{array}{cc}
-2\frac{n}{M-1} & 0\leq n\leq\frac{M-1}{2},\\
-2-2\frac{n}{M-1} & \frac{M-1}{2}<n\leq M-1.\end{array}\right.\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-hanning
-\begin_inset LatexCommand index
-name "hanning"
-
-\end_inset
-
- (
-\begin_inset Formula $M$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct an
-\begin_inset Formula $M$
-\end_inset
-
--point Hanning smoothing window defined as
-\begin_inset Formula \[
-w\left[n\right]=\frac{1}{2}-\frac{1}{2}\cos\left(2\pi\frac{n}{M-1}\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-hamming
-\begin_inset LatexCommand index
-name "hamming"
-
-\end_inset
-
- (
-\begin_inset Formula $M$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct an
-\begin_inset Formula $M$
-\end_inset
-
--point Hamming smoothing window defined for
-\begin_inset Formula $n=0\ldots M-1$
-\end_inset
-
- as
-\begin_inset Formula \[
-w\left[n\right]=0.54-0.46\cos\left(2\pi\frac{n}{M-1}\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- All of the windowing functions are smoothing windows that attempt to balance
- the inherent trade off between side-lobe height (ringing) and main-lobe
- width (resolution) in the frequency domain.
- A rectangular window has the smallest main-lobe width but the largest side-lobe
- height.
- A windowing (tapering) function tries to can help trade off main-lobe width
- By sacrificing a little in resolution using a windowing function These
- windows can be used to smooth data using the convolve function.
- Figure
-\begin_inset LatexCommand ref
-reference "cap:window functions"
-
-\end_inset
-
- shows the windowing functions described so far and their time- and frequency-do
-main behavior.
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float figure
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\begin_inset Graphics
- filename Figures/fig1.eps
- lyxscale 48
- width 49line%
- keepAspectRatio
-
-\end_inset
-
-
-\hfill
-
-\begin_inset Graphics
- filename Figures/fig2.eps
- lyxscale 48
- width 49line%
- keepAspectRatio
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "cap:window functions"
-
-\end_inset
-
-Blackman, Bartlett, Hanning, and Hamming windows in the time and frequency
- domain showing the trade-off between main-lobe width and side-lobe height
- (Figures made with matplotlib).
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The trade-off between main-lobe and side-lobe has been studied extensively.
- Solutions that maximize energy in the main-lobe compared to energy in the
- side-lobes can be found by finding an eigenvector which can be expensive
- to compute for large window sizes.
- A good approximation to these prolate-spheroidal windows is the Kaiser
- window.
-
-\end_layout
-
-\begin_layout Description
-kaiser
-\begin_inset LatexCommand index
-name "kaiser"
-
-\end_inset
-
- (
-\begin_inset Formula $M$
-\end_inset
-
-,
-\begin_inset Formula $\beta$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct an
-\begin_inset Formula $M$
-\end_inset
-
--point Kaiser smoothing window.
- The
-\begin_inset Formula $\beta$
-\end_inset
-
- parameter controls the width of the window (and the frequency-domain side-lobe
- height and main-lobe width).
- The window is defined as
-\begin_inset Formula \[
-w\left[n\right]=\frac{1}{I_{0}\left(\beta\right)}I_{0}\left(\beta\sqrt{1-\frac{\left(2n-M-1\right)^{2}}{\left(M-1\right)^{2}}}\right).\]
-
-\end_inset
-
- There is an empirical relationship between
-\begin_inset Formula $\beta$
-\end_inset
-
- and the side-lobe height which can be used in FIR filter design.
- To achieve a side-lobe height of
-\begin_inset Formula $-\alpha$
-\end_inset
-
-dB, the
-\begin_inset Formula $\beta$
-\end_inset
-
- parameter is
-\begin_inset Formula \[
-\beta=\left\{ \begin{array}{cc}
-0.1002\left(\alpha-8.7\right) & \alpha>50,\\
-0.5842\left(\alpha-21\right)^{0.4}+0.07886\left(\alpha-21\right) & 21\leq\alpha\leq50,\\
-0 & \alpha<21.\end{array}\right.\]
-
-\end_inset
-
- The length
-\begin_inset Formula $M$
-\end_inset
-
- of the window determines the transition width.
- To obtain a transition width of
-\begin_inset Formula $\Delta\omega$
-\end_inset
-
-rad/s the window-length must be at least:
-\begin_inset Formula \[
-M=\frac{\alpha-8}{2.285\Delta\omega}+1.\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Utility functions
-\end_layout
-
-\begin_layout Description
-set_numeric_ops
-\begin_inset LatexCommand index
-name "set\\_numeric\\_ops"
-
-\end_inset
-
- (<op1>=func1, <op2>=func2, ...)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function can be used to alter the operations used for internal array
- calculations and array special methods.
- Replaceable operations (and possible entries for <opN>) are add, subtract,
- multiply, divide, remainder, power, sqrt, negative, absolute, invert, left_shif
-t, right_shift, bitwise_and, bitwise_or, less, less_equal, equal, not_equal,
- greater, greater_equal, floor_divide, true_divide, logical_or, logical_and,
- floor, ceil, maximum, and minimum.
- The example code below changes, then restores, the old Numeric behavior
- of remainder (which was changed because it was not consistent with Python).
-
-\end_layout
-
-\begin_layout MyCode
->>> a = array([-3.,-2,-1,0,1,2,3])
-\newline
->>> print a % -2.1
-\newline
-[-0.9 -2.
- -1.
- 0.
- -1.1 -0.1 -1.2]
-\newline
->>> oldops = set_numeric_ops(remainder=fmod)
-\newline
->>> print a %
- -2.1
-\newline
-[-0.9 -2.
- -1.
- 0.
- 1.
- 2.
- 0.9]
-\newline
->>> newops = set_numeric_ops(**oldops)
-\newline
->>> print a % -2.1
-\newline
-[-0.9 -2.
- -1.
- 0.
- -1.1 -0.1 -1.2]
-\newline
->>> print 3 % -2.1 # comparison
-\newline
--1.2
-\end_layout
-
-\begin_layout Description
-get_include
-\begin_inset LatexCommand index
-name "get\\_include"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the directory that contains the numpy include files.
- The numpy.distutils automatically includes this directory in building extensions.
-
-\end_layout
-
-\begin_layout Description
-get_numarray_include
-\begin_inset LatexCommand index
-name "get\\_numarray\\_include"
-
-\end_inset
-
- (type=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the directory that contains the numarray compatible C-API include
- files.
- If type is not None, then return a list containing both the numarray compatible
- C-API include files and the numpy include files.
- The latter form is only needed when building an extension without the use
- of numpy.distutils.
-
-\end_layout
-
-\begin_layout Description
-deprecate
-\begin_inset LatexCommand index
-name "deprecate"
-
-\end_inset
-
- (func, oldname, newname)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a deprecated function named 'oldname' that has been replaced by
- 'newname'.
- This new deprecated function issues a warning before calling the old function.
- The name and docs of the function are also updated to be oldname instead
- of the name that func has.
- Example usage.
- If you want to deprecate the function named 'old' in favor of a new function
- named 'new' which has the same calling conention then this could be done
- with the assignment
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-old = deprecate(new, 'old', 'new')
-\end_layout
-
-\end_deeper
-\begin_layout Chapter
-Scalar objects
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "cha:Scalar-objects"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Quotation
-Never worry about numbers.
- Help one person at a time, and always start with the person nearest you.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Mother Teresa
-\end_layout
-
-\begin_layout Quotation
-A great many people think they are thinking when they are merely rearranging
- their prejudices.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-William James
-\end_layout
-
-\begin_layout Standard
-One
-\begin_inset LatexCommand index
-name "array scalars|("
-
-\end_inset
-
- important new feature of NumPy is the addition of a new scalar object for
- each of the 21 different data types that an array can have.
- Do not confuse these scalar objects with the data-type objects.
- There is one data-type object.
- It contains a
-\family typewriter
-.type
-\family default
- attribute which points to the Python type that each element of the array
- will be returned as
-\begin_inset Foot
-status open
-
-\begin_layout Standard
-with the exception of object data-types which return the underlying object
- and not a
-\begin_inset Quotes eld
-\end_inset
-
-scalar
-\begin_inset Quotes erd
-\end_inset
-
- type.
-
-\end_layout
-
-\end_inset
-
-.
- The built-in data-types point have .
-\family typewriter
-type
-\family default
- attributes that point to these scalar objects.
- Five (or six) of these new scalar objects are essentially equivalent to
- fundamental Python types and therefore inherit from them as well as from
- the generic array scalar type.
- The bool_ data type is very similar to the Python BooleanType but does
- not inherit from it because Python's BooleanType does not allow itself
- to be inherited from, and on the C-level the size of the actual bool_ data
- is not the same as a Python Boolean scalar.
- Table
-\begin_inset LatexCommand ref
-reference "cap:Array-scalar-types"
-
-\end_inset
-
- shows which array scalars inherit from basic Python types.
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float table
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "cap:Array-scalar-types"
-
-\end_inset
-
-Array scalar types that inherit from basic Python types.
- The intc array data type might also inherit from the IntType if it has
- the same number of bits as the int_ array data type on your platform.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="6" columns="2">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-array data type
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Python type
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-int_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-IntType
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-float_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-FloatType
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-complex_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-ComplexType
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-str_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-StringType
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-unicode_
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-UnicodeType
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-The array scalars have the same attributes and methods as arrays and live
- in a hierarchy of scalar types so they can be easily classified based on
- their type objects.
- However, because array scalars are immutable, and attributes change intrinsic
- properties of the object, the
-\series bold
-array scalar attributes are not settable
-\series default
-.
-\end_layout
-
-\begin_layout Standard
-Array scalars can be detected using the hierarchy of data types.
- For example,
-\family typewriter
-isinstance(val, generic)
-\family default
- will return True if val is an array scalar object.
- Alternatively, what kind of array scalar is present can be determined using
- other members of the data type hierarchy.
- Thus, for example
-\family typewriter
-isinstance(val, complexfloating)
-\family default
- will return True if val is a complex valued type, while
-\family typewriter
-isinstance(val, flexible)
-\family default
- will return true if val is one of the flexible itemsize array types (string,
- unicode, void).
-
-\end_layout
-
-\begin_layout Warning
-The bool_ type is not a subclass of the int_ type (the bool_ type is not
- even a number type).
- This is different than Python's default implementation of bool as a sub-class
- of int.
-\end_layout
-
-\begin_layout Section
-Attributes of array scalars
-\end_layout
-
-\begin_layout Standard
-The array scalar objects have an
-\family typewriter
-__array_priority__
-\family default
- of NPY_SCALAR_PRIORITY (-1,000,000.0).
- They also do not (yet) have a ctypes attribute.
- Otherwise, they share the same attributes as arrays:
-\end_layout
-
-\begin_layout Description
-flags
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns True for CONTIGUOUS, OWNDATA, FORTRAN, and ALIGNED.
- Always returns False for WRITEABLE, and UPDATEIFCOPY.
-
-\end_layout
-
-\begin_layout Description
-shape
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns ().
-\end_layout
-
-\begin_layout Description
-strides
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns ().
-\end_layout
-
-\begin_layout Description
-ndim
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns 0.
-\end_layout
-
-\begin_layout Description
-data
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A read-only buffer object of size self.itemsize,
-\end_layout
-
-\begin_layout Description
-size
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return 1.
-\end_layout
-
-\begin_layout Description
-itemsize
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The number of bytes this scalar requires.
-\end_layout
-
-\begin_layout Description
-base
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns None.
-\end_layout
-
-\begin_layout Description
-dtype
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns data type descriptor corresponding to this array scalar.
-
-\end_layout
-
-\begin_layout Description
-real
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The real part of the scalar.
-\end_layout
-
-\begin_layout Description
-imag
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The imaginary part of the scalar (or 0 if this is real).
-\end_layout
-
-\begin_layout Description
-flat
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a 1-d iterator object (of size 1).
-\end_layout
-
-\begin_layout Description
-T
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a reference to self.
-\end_layout
-
-\begin_layout Description
-__array_interface__
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The Python-side to the array interface.
-
-\end_layout
-
-\begin_layout Description
-__array_struct__
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The C-side to the array interface
-\end_layout
-
-\begin_layout Description
-__array_priority__
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- -100.0 (very low-priority).
-
-\end_layout
-
-\begin_layout Description
-__array_wrap__ (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns an array scalar from an array
-\end_layout
-
-\begin_layout Section
-Methods of array scalars
-\end_layout
-
-\begin_layout Standard
-Array scalars have exactly the same methods as arrays.
- The default behavior of these methods is to internally convert the scalar
- to an equivalent 0-dimensional array and to call the corresponding array
- method.
- The exceptions to these rules are given below.
- In addition, math operations on array scalars are defined so that the same
- hardware flags are set and used to interpret the results as for ufunc.
- Therefore the error state used for ufuncs also carries over to the math
- on array scalars.
-\end_layout
-
-\begin_layout Description
-__new__ (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The default behavior is to return a new array or array scalar by calling
- array(obj) with the corresponding data type.
- There are two situations when this default behavior is delayed until another
- approach is tried.
- First, when the array scalar type inherits from a Python type, then the
- Python types new method is called first and the default method is called
- only if that approach fails.
- The second situation is for the
-\family typewriter
-void
-\family default
- data type where a single integer-like argument will cause a void scalar
- of that size to be created and initialized to 0.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Notice that because array(obj) is called for new, if obj is a nested sequence,
- then the return object could actually be an
-\family typewriter
-ndarray
-\family default
-.
- Thus, arrays of the correct type can also be created by calling the array
- data type name directly:
-\end_layout
-
-\begin_layout MyCode
->>> uint32([[5,6,7,8],[1,2,3,4]])
-\newline
-array([[5, 6, 7, 8],
-\newline
- [1, 2, 3, 4]],
- dtype=uint32)
-\end_layout
-
-\begin_layout Description
-__array__ (<None>)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns a 0-dimensional array of the given data type, or of type(self)
- if argument is None.
-\end_layout
-
-\begin_layout Description
-__array_wrap__ (array)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns a scalar array object from the first-element of the array.
-\end_layout
-
-\begin_layout Description
-__squeeze__ ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns self.
-\end_layout
-
-\begin_layout Description
-byteswap (<False>)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Trying to set the first (inplace) argument to True raises a ValueError.
- Otherwise, this returns a new array scalar with the data byteswapped.
-
-\end_layout
-
-\begin_layout Description
-__reduce__ ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is called to pickle an array scalar.
- It returns a tuple of (numpy.core.multiarray.scalar, self.dtypestr, obj or
- self.tostring()) which can be used to reconstruct the scalar on unpickling.
- Notice that no state is written, because the entire scalar can be constructed
- from just the string.
- Also, if this is an object array scalar, then the Python object being reference
-d is written.
-\end_layout
-
-\begin_layout Description
-__setstate__ ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Does nothing but return None.
-\end_layout
-
-\begin_layout Description
-setflags ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Does nothing, as flags cannot be set for scalars
-\begin_inset LatexCommand index
-name "array scalars|)"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Section
-Defining New Types
-\end_layout
-
-\begin_layout Standard
-There are two ways to effectively define a new type of array.
- One way is to simply subclass the ndarray and overwrite the methods of
- interest.
- This will work to a degree, but internally certain behaviors are fixed
- by the data type of the array.
- To fully customize the data type of an array you need to define a new data-type
- for the array, and register it with NumPy.
- This new type can only be defined in C.
- How to define a new data type in C will be discussed in the next part of
- the book.
-\end_layout
-
-\begin_layout Chapter
-Data-type (
-\family typewriter
-dtype
-\family default
-) Objects
-\end_layout
-
-\begin_layout Quotation
-We cannot expect that all nations will adopt like systems, for conformity
- is the jailer of freedom and the enemy of growth.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-John F.
- Kennedy
-\end_layout
-
-\begin_layout Quotation
-What information consumes is rather obvious: it consumes the attention of
- its recipients.
- Hence, a wealth of information creates a poverty of attention and a need
- to allocate that attention efficiently among the overabundance of information
- sources that might consume it.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Herbert Simon
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "cha:Data-descriptor-objects"
-
-\end_inset
-
-It
-\begin_inset LatexCommand index
-name "dtype|("
-
-\end_inset
-
- is important not to confuse the
-\begin_inset Quotes eld
-\end_inset
-
-array-scalars
-\begin_inset Quotes erd
-\end_inset
-
- with the
-\begin_inset Quotes eld
-\end_inset
-
-data-type objects.
-\begin_inset Quotes erd
-\end_inset
-
- It is true that an array-scalar can be interpreted as a data-type object
- and so can be used to refer to the data-type of an array.
- However, the data-type object is a separate Python object.
- Every ndarray has an associated data-type object that completely defines
- the data in the array (including any named fields).
- For every built-in data-type object there is an associated type object
- whose instances are the array-scalars.
- Because of the association between each data-type object and a type-object
- of the corresponding array scalar, the array-scalar type-objects can also
- be thought of as data-types.
- However, for the type objects of flexible array-scalars (string, unicode_,
- and void), the type-objects alone are not enough to specify the full data-type
- because the length is not given.
- The data-type constructor,
-\series bold
-numpy.dtype
-\series default
-, converts any object that can be considered as a data-type into a data-type
- object which is the actual object an ndarray looks to in order to interpret
- each element of its data region.
- Whenever a data-type is required in a NumPy function or method, supplying
- a dtype object is always fastest.
- If the object supplied is not a dtype object, then it will be converted
- to one using dtype(obj).
- Therefore, understanding data-type objects is the key to understanding
- how data types are really represented and understood in NumPy.
-\end_layout
-
-\begin_layout Section
-Attributes
-\begin_inset LatexCommand index
-name "dtype!attributes|("
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-type
-\begin_inset LatexCommand index
-name "dtype!attributes!type"
-
-\end_inset
-
- The
-\begin_inset LatexCommand index
-name "The"
-
-\end_inset
-
- type object used to instantiate a scalar of this data-type.
-\end_layout
-
-\begin_layout Description
-kind
-\begin_inset LatexCommand index
-name "dtype!attributes!kind"
-
-\end_inset
-
- A character code (one of 'biufcSUV') identifying the general kind of data.
-
-\end_layout
-
-\begin_layout Description
-char
-\begin_inset LatexCommand index
-name "dtype!attributes!char"
-
-\end_inset
-
- A unique character code for each of the 21 different built-in types.
-
-\end_layout
-
-\begin_layout Description
-num
-\begin_inset LatexCommand index
-name "dtype!attributes!num"
-
-\end_inset
-
- A unique number for each of the 21 different built-in types roughly ordered
- from least-to-most precision.
-
-\end_layout
-
-\begin_layout Description
-str
-\begin_inset LatexCommand index
-name "dtype!attributes!str"
-
-\end_inset
-
- The array-protocol typestring of this data-type object.
-\end_layout
-
-\begin_layout Description
-name
-\begin_inset LatexCommand index
-name "dtype!attributes!name"
-
-\end_inset
-
- A bit-width name for this data-type (un-sized flexible data-type objects
- are missing the width).
-
-\end_layout
-
-\begin_layout Description
-byteorder
-\begin_inset LatexCommand index
-name "dtype!attributes!byteorder"
-
-\end_inset
-
- A character indicating the byte-order of this data-type object ('=' : native,
- '<' : little-endian, '>' : big-endian, '|' : not applicable).
- All built-in data-type objects have byteorder either '=' or '|'.
-
-\end_layout
-
-\begin_layout Description
-itemsize
-\begin_inset LatexCommand index
-name "dtype!attributes!itemsize"
-
-\end_inset
-
- The element size of this data-type object.
- For 18 of the 21 types this number is fixed by the data-type.
- For the flexible data-types, this number can be anything.
-
-\end_layout
-
-\begin_layout Description
-alignment
-\begin_inset LatexCommand index
-name "dtype!attributes!alignment"
-
-\end_inset
-
- The required alignment (in bytes) of this data-type according to the compiler.
- More information is available in the C-API section.
-
-\end_layout
-
-\begin_layout Description
-fields
-\begin_inset LatexCommand index
-name "dtype!attributes!fields"
-
-\end_inset
-
- A dictionary showing any named fields that have been defined for this data-type
- (or None if there are no named fields).
- Fields can be assigned to any built-in data-type (
-\emph on
-e.g.
-
-\emph default
- using the tuple input to the dtype constructor).
- However, fields are most useful for (subtypes of) void data-types which
- can be any size.
- Fields are a convenient way to keep track of fixed-size sub-parts of the
- total fixed-size array-element, or record.
- A field is defined in terms of another dtype object and an offset (in bytes)
- into the current record.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The fields dictionary is indexed by keys that are the names of the fields.
- Each entry in the dictionary is a tuple fully describing the field: (dtype,
- offset[, title]).
- If present, the optional title can actually be any object (if it is string
- or unicode then it will also be a key in the fields dictionary, otherwise
- it's meta-data).
- Notice also, that the first two elements of the tuple can be passed directly
- as arguments to the getfield and setfield attributes of an ndarray.
- If field names are not specified in a constructor, they default to 'f0',
- 'f2', ..., 'f<n-1>'.
-
-\end_layout
-
-\begin_layout Description
-names
-\begin_inset LatexCommand index
-name "dtype!attributes!char"
-
-\end_inset
-
- An ordered list of field names.
- This can be used to walk through all of the named fields in offset order.
- Notice that the defined fields do not have to
-\begin_inset Quotes eld
-\end_inset
-
-cover
-\begin_inset Quotes erd
-\end_inset
-
- the record, but the itemsize of the container data-type object must always
- be at least as large as the itemsizes of the data-type objects in the defined
- fields.
- This attribute is None if there are no fields.
-\end_layout
-
-\begin_layout Description
-subdtype
-\begin_inset LatexCommand index
-name "dtype!attributes!subdtype"
-
-\end_inset
-
- Numarray introduced the concept of a fixed-length record having fields
- that were themselves arrays of another data-type.
- This is supported at a fundamental level in NumPy using this attribute
- which maintains the simplicity of defining a field by another data-type
- object.
- It either returns None or a tuple (base dtype, shape) where shape is a
- tuple showing the size of the C-contiguous array and the base dtype object
- indicates the data-type in each element of the subarray.
- If a field whose dtype object has this attribute is retrieved, then the
- extra dimensions implied by the shape are tacked on to the end of the retrieved
- array.
-
-\end_layout
-
-\begin_layout Description
-descr
-\begin_inset LatexCommand index
-name "dtype!attributes!descr"
-
-\end_inset
-
- An array-interface-compliant full description of the data-type.
- The format is that required by the 'descr' key in the __array_interface__.
-\end_layout
-
-\begin_layout Description
-isbuiltin
-\begin_inset LatexCommand index
-name "dtype!attributes!isbuiltin"
-
-\end_inset
-
- A 1 if self is one of the built-in dtype objects; a 2 if self is a user-defined
- dtype object; a 0, otherwise.
-\end_layout
-
-\begin_layout Description
-isnative
-\begin_inset LatexCommand index
-name "dtype!attributes!isnative"
-
-\end_inset
-
- True if this data-type object has a byteorder that is native to the platform;
- otherwise False.
-\end_layout
-
-\begin_layout Description
-hasobject
-\begin_inset LatexCommand index
-name "dtype!attributes!hasobject"
-
-\end_inset
-
- True if self contains reference-counted objects in any of it's fields or
- sub data-types.
- Recall that what is actually in the ndarray memory representing the Python
- object is the memory address of that object (a pointer).
- Special handling may be required and this attribute is useful for distinguishin
-g data-types that may contain arbitrary Python objects and data-types that
- won't.
-
-\end_layout
-
-\begin_layout Description
-flags
-\begin_inset LatexCommand index
-name "dtype!attributes!flags"
-
-\end_inset
-
- Bit-flags for the data-type describing how the data-type will be interpreted.
- Bit-masks are in numpy.core.multiarray as the constants ITEM_HASOBJECT, LIST_PICK
-LE, ITEM_IS_POINTER, NEEDS_INIT, NEEDS_PYAPI, USE_GETITEM, USE_SETITEM.
- A full explanation of these flags is in the second part of this book.
- These flags are largely useful for user-defined data-types.
-
-\begin_inset LatexCommand index
-name "dtype!attributes|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Construction
-\end_layout
-
-\begin_layout Description
-dtype (obj, align=0, copy=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset LatexCommand index
-name "dtype!construction|("
-
-\end_inset
-
-Return a new data-type object from obj.
- The keyword argument, align, can only be nonzero if obj is a dictionary,
- or a comma-separated string.
- If it is non-zero in those cases it is used to add padding as needed to
- the fields to match what the compiler that compiled NumPy would do to a
- similar C-struct.
- The copy argument guarantees a new copy of the data-type object, otherwise,
- the result may just be a reference to a built-in data-type object.
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Objects that can be converted to a data-type object are described in the
- following list.
- Because every object in this list can be converted to a data-type object
- it can also be used whenever a
-\family typewriter
-dtype
-\family default
- is requested by a function or method in NumPy.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-dtype
-\begin_inset LatexCommand index
-name "dtype!construction!from float"
-
-\end_inset
-
-Returns itself.
-\end_layout
-
-\begin_layout Description
-None
-\begin_inset LatexCommand index
-name "dtype!construction!from None"
-
-\end_inset
-
-Returns the default data-type descriptor object: float.
-\end_layout
-
-\begin_layout Description
-type-object
-\begin_inset LatexCommand index
-name "dtype!construction!from type"
-
-\end_inset
-
-Many Python type objects can be converted to data-type objects.
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-Array-scalar types: The type-objects of the 21 built-in array scalars all
- convert to an associated data-type object.
- This is true for sub-classes as well.
- Not all data-type information can be supplied with a type-object.
- Flexible data-types with default itemsizes of 0, for example, require an
- itemsize to be useful.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Examples: int32, float64, uint16, complex128
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Generic types: The generic hierarchical type objects convert to corresponding
- dtype objects according to the associations: (numeric, inexact, floating)
- --> float; complexfloating --> cfloat; (integer, signedinteger) --> int_;
- unsignedinteger --> uint; character --> string; (generic, flexible) -->
- void.
-
-\end_layout
-
-\begin_layout Enumerate
-Builtin types: Several python types are equivalent to a corresponding array
- scalar when used to generate a dtype object: int --> int_; bool --> bool_;
- float --> float_; complex --> cfloat; str --> string; unicode --> unicode_;
- buffer --> void; (all others) --> object_.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Examples: object, str, float, int
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Any type object with the dtype attribute: The attribute will be accessed
- and used directly.
- The attribute must return something that is convertible into a dtype object.
-
-\end_layout
-
-\end_deeper
-\begin_layout Description
-string
-\begin_inset LatexCommand index
-name "dtype!construction!from string"
-
-\end_inset
-
-Several kinds of strings can be converted.
- Recognized strings can be pre-pended with '>', or '<', to specify the byteorder.
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-One-character strings: Each built-in data-type has a character code (the
- updated Numeric typecodes), that uniquely identifies it.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Examples: 'b', 'H', 'f', 'd', 'F', 'D', Float64, Int32, UInt16
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Array-protocol type strings: The first character specifies the kind of data
- and the remaining characters specify how many bytes of data.
- The supported kinds are 'b' --> Boolean, 'i' --> (signed) integer, 'u'
- --> unsigned integer, 'f' --> floating-point, 'c' --> complex-floating
- point, 'S', 'a' --> string, 'U' --> unicode, 'V' --> anything (void).
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Examples: 'i4', 'f8', 'c16', 'b1', 'S10', 'a25'
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Comma-separated field formats: numarray introduced a short-hand notation
- for specifying the format of a record as a comma-separated string of basic
- formats.
- A basic format in this context is an optional shape specifier followed
- by an array-protocol type string.
- Parenthesis are required on the shape if it is greater than 1-d.
- NumPy allows a modification on the format in that any string that can uniquely
- identify the type can be used to specify the data-type in a field.
- This data-type defines fields named 'f0', 'f2', ..., 'f<N-1>' where N (>1)
- is the number of comma-separated basic formats in the string.
- If the optional shape specifier is provided, then the data-type for the
- corresponding field contains a subdtype attribute providing the shape.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Examples:
-\begin_inset Quotes eld
-\end_inset
-
-i4, (2,3)f8, f4
-\begin_inset Quotes erd
-\end_inset
-
-;
-\begin_inset Quotes eld
-\end_inset
-
-a3, 3u8, (3,4)a10
-\begin_inset Quotes erd
-\end_inset
-
-
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Any string in NumPy.sctypeDict.keys():
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Examples: 'uint32', 'Int16', 'Uint64', 'Float64', 'Complex64'
-\end_layout
-
-\end_deeper
-\end_deeper
-\begin_layout Description
-tuple
-\begin_inset LatexCommand index
-name "dtype!construction!from tuple"
-
-\end_inset
-
-Three kinds of tuples each of length 2 can be converted into a data-type
- object:
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-(flexible dtype, itemsize): The first argument must be an object that is
- converted to a flexible data-type object (one whose element size is 0),
- the second argument is an integer providing the desired itemsize.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Examples: (void, 10); (str, 35), ('U', 10)
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-(fixed dtype, shape): The first argument is any object that can be converted
- into a fixed-size data-type object.
- The second argument is the desired shape of this type.
- If the shape parameter is 1, then the data-type object is equivalent to
- fixed dtype.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Examples: (int32, (2,5)); ('S10', 1)=='S10'; ('i4, (2,3)f8, f4', (2,3))
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-(base dtype, new dtype): Both arguments must be convertible to data-type
- objects in this case.
- The base dtype is the data-type object that the new data-type builds on.
- This is how you could assign named fields to any built-in data-type object.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Examples: (int32, {'real':(int16,0), 'imag':(int16,2)}); (int32, (int8,
- 4));
-\newline
-('i4', [('r','u1'),('g','u1'),('b','u1'),('a','u1')])
-\end_layout
-
-\end_deeper
-\end_deeper
-\begin_layout Description
-list
-\begin_inset LatexCommand index
-name "dtype!construction!from list"
-
-\end_inset
-
-(array description interface): This style is more fully described at
-\begin_inset LatexCommand url
-name "this site"
-target "http://docs.scipy.org/doc/numpy/reference/arrays.interface.html"
-
-\end_inset
-
-.
- It consists of a list of fields where each field is described by a tuple
- of length 2 or 3.
- The first element of the tuple is the field name (if this is '' then a
- standard field name, 'f#', is assigned).
- The field name may also be a 2-tuple of strings where the first string
- is either a
-\begin_inset Quotes eld
-\end_inset
-
-title
-\begin_inset Quotes erd
-\end_inset
-
- (which may be any string or unicode string) or meta-data for the field
- which can be any object, and the second string is the
-\begin_inset Quotes eld
-\end_inset
-
-name
-\begin_inset Quotes erd
-\end_inset
-
- which must be a valid Python identifier.
- The second element of the tuple can be anything that can be interpreted
- as a data-type.
- The optional third element of the tuple contains the shape if this field
- represents an array of the data-type in the second element.
- This style does not accept align=1 as it is assumed that all of the memory
- is accounted for by the array interface description.
- See the web-page for more examples.
- Note that a 3-tuple with a third argument equal to 1 is equivalent to a
- 2-tuple.
-\end_layout
-
-\begin_layout Description
-Examples: [('big','>i4'), ('little','<i4')]; [('R','u1'), ('G','u1'), ('B','u1')
-, ('A','u1')]
-\end_layout
-
-\begin_layout Description
-dictionary
-\begin_inset LatexCommand index
-name "dtype!construction!from dict"
-
-\end_inset
-
-There are two dictionary styles.
- The first is a standard dictionary format while the second accepted format
- allows the fields attribute of dtype objects to be interpreted as a data-type.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-names and formats: This style has two required and two optional keys.
- The 'names' and 'formats' keys are required.
- Their respective values are equal-length lists with the field names and
- the field formats.
- The field names must be strings and the field formats can be any object
- accepted by dtypedescr constructor.
- The optional keys in the dictionary are 'offsets' and 'titles' and their
- values must each be lists of the same length as the 'names' and 'formats'
- lists.
- The 'offsets' value is a list of integer offsets for each field, while
- the 'titles' value is a list of titles for each field (None can be used
- if no title is desired for that field).
- The titles can be any string or unicode object and will add another entry
- to the fields dictionary keyed by the title and referencing the same field
- tuple which will contain the title as an additional tuple member.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Examples: {'names': ['r','g','b','a'], 'formats': [uint8, uint8, uint8,
- uint8]}; {'names':['r','b'], 'formats': ['u1', 'u1'], 'offsets': [0, 2],
- 'titles': ['Red pixel', 'Blue pixel']}
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-data-type object fields: This style is patterned after the format of the
- fields dictionary in a data-type object.
- It contains string or unicode keys that refer to (data-type, offset) or
- (data-type, offset, title) tuples.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Examples: {'col1': ('S10', 0), 'col2': (float32, 10), 'col3': (int, 14)}
-\begin_inset LatexCommand index
-name "dtype!construction|)"
-
-\end_inset
-
-
-\end_layout
-
-\end_deeper
-\end_deeper
-\end_deeper
-\begin_layout Section
-Methods
-\begin_inset LatexCommand index
-name "dtype!methods|("
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-newbyteorder
-\begin_inset LatexCommand index
-name "dtype!methods!newbyteorder"
-
-\end_inset
-
-(<'swap'>)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a new copy of self with its byteorder changed according to the
- optional argument.
- All changes are also propagated to the data-type objects of all fields
- and sub-arrays.
- If a byteorder of '|' (meaning ignore) is encountered it is left unchanged.
- The default behavior is to swap the byteorder.
- Other possible arguments are 'big' ('>'), 'little' ('<'), and 'native'
- ('=') which recursively forces the byteorder of self (and it's field data-type
- objects and any sub-arrays) to the corresponding byteorder.
-
-\end_layout
-
-\begin_layout Description
-__reduce__
-\begin_inset LatexCommand index
-name "dtype!methods!\\_\\_reduce\\_\\_"
-
-\end_inset
-
- ()
-\end_layout
-
-\begin_layout Description
-__setstate__
-\begin_inset LatexCommand index
-name "dtype!methods!\\_\\_setstate\\_\\_"
-
-\end_inset
-
- (state)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Data-type objects can be pickled because of these two methods.
- The __reduce__() method returns a 3-tuple consisting of (callable object,
- args, state), where the callable object is numpy.core.multiarray.dtype and
- args is (typestring, 0, 1) unless the data-type inherits from void (or
- is user-defined) in which case args is (typeobj, 0, 1).
- The state is an 8-tuple with (version, endian, self.subdtype, self.names,
- self.fields, self.itemsize, self.alignment, self.flags).
- The self.itemsize and self.alignment entries are both -1 if the data-type
- object is built-in and not flexible (because they are fixed on creation).
- The setstate method takes the saved state and updates the date-type
-\begin_inset LatexCommand index
-name "dtype!methods|)"
-
-\end_inset
-
-object.
-\begin_inset LatexCommand index
-name "dtype|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Chapter
-Standard Classes
-\end_layout
-
-\begin_layout Quotation
-To generalize is to be an idiot.
-
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-William Blake
-\end_layout
-
-\begin_layout Quotation
-Not everything that can be counted counts, and not everything that counts
- can be counted.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Albert Einstein
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ndarray!subtyping|("
-
-\end_inset
-
-The ndarray in NumPy is a
-\begin_inset Quotes eld
-\end_inset
-
-new-style
-\begin_inset Quotes erd
-\end_inset
-
- Python built-in-type.
- Therefore, it can be inherited from (in Python or in C) if desired.
- Therefore, it can form a foundation for many useful classes.
- Often whether to sub-class the array object or to simply use the core array
- component as an internal part of a new class is a difficult decision, and
- can be simply a matter of choice.
- NumPy has several tools for simplifying how your new object interacts with
- other array objects, and so the choice may not be significant in the end.
- One way to simplify the question is by asking yourself if the object you
- are interested can be replaced as a single array or does it really require
- two or more arrays at it's core.
- For example, in the standard NumPy distribution, the matrix and records
- classes inherit from the ndarray, while masked arrays use two ndarrays
- as objects of its internal structure.
-\end_layout
-
-\begin_layout Standard
-Note that asarray(a) always returns the base-class ndarray.
- If you are confident that your use of the array object can handle any subclass
- of an ndarray, then asanyarray(a) can be used to allow subclasses to propagate
- more cleanly through your subroutine.
- In principal a subclass could redefine any aspect of the array and therefore,
- under strict guidelines, asanyarray(a) would rarely be useful.
- However, most subclasses of the arrayobject will not redefine certain aspects
- of the array object such as the buffer interface, or the attributes of
- the array.
- One of important example, however, of why your subroutine may not be able
- to handle an arbitrary subclass of an array is that matrices redefine the
- '*' operator to be matrix-multiplication, rather than element-by-element
- multiplication.
-\end_layout
-
-\begin_layout Section
-Special attributes and methods recognized by NumPy
-\begin_inset LatexCommand index
-name "ndarray!attributes!recognized by|("
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-__array_finalize__ (obj)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This method is called whenever the system internally allocates a new array
- from obj, where obj is a subclass (subtype) of the (big)ndarray.
- It can be used to change attributes of self after construction (so as to
- ensure a 2-d matrix for example), or to update meta-information from the
-
-\begin_inset Quotes eld
-\end_inset
-
-parent.
-\begin_inset Quotes erd
-\end_inset
-
- Subclasses inherit a default implementation of this method that does nothing.
-\end_layout
-
-\begin_layout Description
-__array_wrap__ (array)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This method should return an instance of the class from the ndarray object
- passed in.
- For example, this is called after every ufunc for the object with the highest
- __array_priority__.
- The ufunc-computed array object is passed in and whatever is returned is
- passed to the user.
- Subclasses inherit a default implementation of this method.
-\end_layout
-
-\begin_layout Description
-__array__ (dtype <None>)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This method is called to obtain an ndarray object when needed.
- You should always guarantee this returns an actual ndarray object.
- Subclasses inherit a default implementation of this method.
-
-\end_layout
-
-\begin_layout Description
-__array_priority__
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The value of this attribute is used to determine what type of object to
- return in situations where there is more than one possibility for the Python
- type of the returned object.
- Subclasses inherit a default value of 1.0 for this attribute.
-\begin_inset LatexCommand index
-name "ndarray!attributes!recognized by|)"
-
-\end_inset
-
-
-\begin_inset LatexCommand index
-name "ndarray!subtyping|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Matrix Objects
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "matrix|("
-
-\end_inset
-
-Matrix objects inherit from the ndarray and therefore, they have the same
- attributes and methods of ndarrays.
- There are six important differences of matrix objects, however that may
- lead to unexpected results when you use matrices but expect them to act
- like arrays:
-\end_layout
-
-\begin_layout Enumerate
-Matrix objects can be created using a string notation to allow Matlab-style
- syntax where spaces separate columns and semicolons (';') separate rows.
-
-\end_layout
-
-\begin_layout Enumerate
-Matrix objects are always two-dimensional.
- This has far-reaching implications, in that m.ravel() is still two-dimensional
- (with a 1 in the first dimension) and item selection returns two-dimensional
- objects so that sequence behavior is fundamentally different than arrays.
-\end_layout
-
-\begin_layout Enumerate
-Matrix objects over-ride multiplication to be matrix-multiplication.
-
-\series bold
-Make sure you understand this for functions that you may want to receive
- matrices.
- Especially in light of the fact that asanyarray(m) returns a matrix when
- m is a matrix.
-\end_layout
-
-\begin_layout Enumerate
-Matrix objects over-ride power to be matrix raised to a power.
- The same warning about using power inside a function that uses asanyarray(...)
- to get an array object holds for this fact.
-
-\end_layout
-
-\begin_layout Enumerate
-The default __array_priority__ of matrix objects is 10.0, and therefore mixed
- operations with ndarrays always produce matrices.
-
-\end_layout
-
-\begin_layout Enumerate
-Matrices have special attributes which make calculations easier.
- These are
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-.T --- return the transpose of self
-\end_layout
-
-\begin_layout Enumerate
-.H --- return the conjugate transpose of self
-\end_layout
-
-\begin_layout Enumerate
-.I --- return the inverse of self
-\end_layout
-
-\begin_layout Enumerate
-.A --- return a view of the data of self as a 2d array (no copy is done).
-\end_layout
-
-\end_deeper
-\begin_layout Warning
-Matrix objects over-ride multiplication, '*', and power, '**', to be matrix-mult
-iplication and matrix power, respectively.
- If your subroutine can accept sub-classes and you do not convert to base-class
- arrays, then you must use the ufuncs multiply and power to be sure that
- you are performing the correct operation for all inputs.
-
-\end_layout
-
-\begin_layout Standard
-The matrix class is a Python subclass of the ndarray and can be used as
- a reference for how to construct your own subclass of the ndarray.
- Matrices can be created from other matrices, strings, and anything else
- that can be converted to an
-\family typewriter
-ndarray
-\family default
-.
- The name
-\begin_inset Quotes eld
-\end_inset
-
-mat
-\begin_inset Quotes erd
-\end_inset
-
- is an alias for
-\begin_inset Quotes eld
-\end_inset
-
-matrix
-\begin_inset Quotes erd
-\end_inset
-
- in NumPy.
-\end_layout
-
-\begin_layout Description
-Example\InsetSpace ~
-1: Matrix creation from a string
-\end_layout
-
-\begin_layout MyCode
->>> a=mat('1 2 3; 4 5 3')
-\newline
->>> print (a*a.T).I
-\newline
-[[ 0.2924 -0.1345]
-\newline
- [-0.1345 0.0819]]
-\end_layout
-
-\begin_layout Description
-Example\InsetSpace ~
-2: Matrix creation from nested sequence
-\end_layout
-
-\begin_layout MyCode
->>> mat([[1,5,10],[1.0,3,4j]])
-\newline
-matrix([[ 1.+0.j, 5.+0.j, 10.+0.j],
-\newline
- [
- 1.+0.j, 3.+0.j, 0.+4.j]])
-\end_layout
-
-\begin_layout Description
-Example\InsetSpace ~
-3: Matrix creation from an array
-\end_layout
-
-\begin_layout MyCode
->>> mat(random.rand(3,3)).T
-\newline
-matrix([[ 0.7699, 0.7922, 0.3294],
-\newline
- [ 0.2792,
- 0.0101, 0.9219],
-\newline
- [ 0.3398, 0.7571, 0.8197]])
-\end_layout
-
-\begin_layout Description
-matrix (data, dtype=None, copy=True)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The sequence to convert to a matrix is passed in as data.
- If dtype is None, then the data-type is determined from the data.
- If copy is True, then a copy of the data is made, otherwise, the same data
- buffer is used.
- If no buffer can be found for data, then a copy is also made.
- Note: The matrix object is actually a class and so using this syntax calls
- matrix.__new__(matrix, data, dtype, copy) which is what happens whenever
- you
-\begin_inset Quotes eld
-\end_inset
-
-call
-\begin_inset Quotes erd
-\end_inset
-
- any class object as a function.
-\end_layout
-
-\begin_layout Description
-mat
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Just another name for matrix.
-\end_layout
-
-\begin_layout Description
-asmatrix (data, dtype=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the data without copying.
- Equivalent to matrix(data, dtype, copy=False).
-\end_layout
-
-\begin_layout Description
-bmat (obj, ldict=None, gdict=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Build a matrix object from a string, nested sequence or an array.
- This command lets you build up matrices from other other objects.
- The ldict and gdict parameters are local and module (global) dictionaries
- that are only used when obj is a string.
- If they are not provided, then the local and module dictionaries present
- when bmat is called are used.
-\begin_inset LatexCommand index
-name "matrix|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout MyCode
->>> A = mat('2 2; 2 2'); B=mat('1 1; 1 1');
-\newline
->>> print bmat('A B; B A')
-\newline
-[[2
- 2 1 1]
-\newline
- [2 2 1 1]
-\newline
- [1 1 2 2]
-\newline
- [1 1 2 2]]
-\end_layout
-
-\begin_layout Section
-Memory-mapped-file arrays
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "memory maps|("
-
-\end_inset
-
-Memory-mapped files are useful for reading and/or modifying small segments
- of a large file with regular layout, without reading the entire file into
- memory.
- A simple subclass of the ndarray uses a memory-mapped file for the data
- buffer of the array.
- For small files, the over-head of reading the entire file into memory is
- typically not significant, however for large files using memory mapping
- can save considerable resources.
-
-\end_layout
-
-\begin_layout Note
-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.
-
-\end_layout
-
-\begin_layout Standard
-The class is called memmap and is available in the NumPy namespace.
- The __new__ method of the class has been re-written to have the following
- syntax:
-\end_layout
-
-\begin_layout Description
-__new__ (cls, filename, dtype=uint8, mode='r+', offset=0, shape=None, order=0)
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-filename The file name to be used as the array data buffer
-\end_layout
-
-\begin_layout Description
-dtype A data-type object used to interpret the file contents (including
- byteorder).
-\end_layout
-
-\begin_layout Description
-mode The mode to open the file in.
- Valid modes are 'readonly' or 'r', 'copyonwrite' or 'c', 'readwrite' or
- 'r+', and 'write' or 'w+'.
- This mode determines the WRITEABLE flag of the returned array.
-\end_layout
-
-\begin_layout Description
-offset An offset into the file to start the array data.
-\end_layout
-
-\begin_layout Description
-shape The desired shape of the array.
- If this is None, then the returned array will be 1-d with the number of
- elements determined by the file size and data type.
-\end_layout
-
-\begin_layout Description
-order Either 'C' or 'Fortran' to indicate the order that an N-D array should
- be interpreted.
- This only has an effect if the shape is greater than 2-D.
-\end_layout
-
-\end_deeper
-\begin_layout Standard
-Memory-mapped-file arrays have one additional method (besides those they
- inherit from the ndarray): self.
-\series bold
-flush
-\series default
-() which can be called manually by the user to ensure that any changes to
- the array actually get written to disk. This also occurs on deleting
- the memmap object
-
-\end_layout
-
-\begin_layout Description
-Example:
-\end_layout
-
-\begin_layout MyCode
->>> a = memmap('newfile.dat', dtype=float, mode='w+', shape=1000)
-\newline
->>> a[10]
- = 10.0
-\newline
->>> a[30] = 30.0
-\newline
->>> del a
-\newline
->>> b = fromfile('newfile.dat', dtype=float)
-\newline
->>>
- print b[10], b[30]
-\newline
-10.0 30.0
-\newline
->>> a = memmap('newfile.dat', dtype=float)
-\newline
->>> print
- a[10], a[30]
-\newline
-10.0 30.0
-\end_layout
-
-\begin_layout Section
-Character arrays (numpy.char)
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "character arrays|("
-
-\end_inset
-
-These are enhanced arrays of either string type or unicode_ type.
- These arrays inherit from the ndarray, but specially-define the operations
- +, *, and % on a (broadcasting) element-by-element basis.
- These operations are not available on the standard ndarray of character
- type.
- In addition, the chararray has all of the standard string (and unicode)
- methods, executing them on an element-by-element basis.
- Perhaps the easiest way to create a chararray is to use self.view(chararray)
- where self is an ndarray of string or unicode data-type.
- However, a chararray can also be created using the numpy.chararray.__new__
- method.
-\end_layout
-
-\begin_layout Description
-__new__ (shape, itemsize, unicode=False, buffer=None, offset=0, strides=None,
- order=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create a new character array of string or unicode type and itemsize characters.
- Create the array using buffer (with offset and strides) if it is not None.
- If buffer is None, then construct a new array with strides in Fortran order
- if len(shape) >=2 and order is 'Fortran' (otherwise the strides will be
- in 'C' order).
-
-\end_layout
-
-\begin_layout Description
-char.array (obj, itemsize=None, copy=True, unicode=False, order=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create a chararray from the nested sequence obj.
- If obj is an ndarray of data-type unicode_ or string, then its data is
- wrapped by the chararray object and converted to the desired type (string
- or unicode).
-
-\end_layout
-
-\begin_layout Standard
-Another difference with the standard ndarray of string data-type is that
- the chararray inherits the feature introduced by Numarray that white-space
- at the end of any element in the array will be ignored on item retrieval
- and comparison operations.
-
-\begin_inset LatexCommand index
-name "character arrays|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Record Arrays (numpy.rec)
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "record arrays|("
-
-\end_inset
-
-NumPy provides a powerful data-type object that allows any ndarray to hold
- (arbitrarily nested) record-like items with named-field access to the sub-types.
- This is possible without any special record-array sub-class.
- Consider the example where each item in the array is a simple record of
- name, age, and weight.
- You could specify a data-type for an array of such records using the following
- data-type object:
-\end_layout
-
-\begin_layout MyCode
->>> desc = dtype({'names': ['name', 'age', 'weight'], 'formats': ['S30',
- 'i2', 'f4']})
-\newline
->>> a = array([('Bill',31,260.0),('Fred', 15, 145.0)],dtype=desc)
-\newline
->>>
- print a[0]
-\newline
-('Bill', 31, 260.0)
-\newline
->>> print a['name']
-\newline
-['Bill' 'Fred']
-\newline
->>> print
- a['age']
-\newline
-[31 15]
-\newline
->>> print a['weight']
-\newline
-[ 260.
- 145.]
-\newline
->>> print a[0]['name'], a[0]['age'], a[0]['weight']
-\newline
-Bill 31 260.0
-\newline
->>>
- print len(a[0])
-\newline
-3
-\end_layout
-
-\begin_layout Standard
-This example shows how a general array can be assigned named fields and
- how these fields can be accessed.
- In this case the a[0] object is an array-scalar of type void.
- The void array-scalars are unique in that they contain references to (rather
- than copies of) the underlying data whenever fields are defined.
- Therefore, the record data can be modified in place:
-\end_layout
-
-\begin_layout MyCode
->>> a[0]['name'] = 'George'; print a
-\newline
-[('George', 31, 260.0) ('Fred', 15, 145.0)]
-\end_layout
-
-\begin_layout Standard
-The recarray subclass and its accompanying record item add the ability to
- access named fields through attribute lookup.
- A quick way to get a record array is to use the view method of the ndarray.
-
-\end_layout
-
-\begin_layout MyCode
->>> r = a.view(recarray)
-\newline
->>> print r.name
-\newline
-['George' 'Fred']
-\end_layout
-
-\begin_layout Standard
-The numpy.core.records module (aliased to nump.rec when numpy is imported)
- contains additional convenience functions for constructing record arrays.
- All of the following constructors have two different mechanisms for specifying
- the data-type.
- Either the dtype= argument can be specified or the argument formats= can
- be specified along with an optional set of four additional keyword arguments
- (names=, titles=, aligned= and byteorder=).
- In some cases neither dtype= nor formats= is required as the data-type
- can be inferred from the object passed in as the first argument.
-\end_layout
-
-\begin_layout Standard
-The five argument method for specifying a data-type constructs a data-type
- object internally.
- The comma-separated formats string is used to specify the fields.
- The names (and optional titles) of the fields can be specified by a comma-separ
-ated string of names (or titles).
- The aligned flag determines whether the fields are packed (False) or padded
- (True) according to the platform compiler rules.
- The byteorder argument allows specification of the byte-order for all of
- the fields at once (they can also be specified individually in the formats
- string).
- The default byte-order is native to the platform.
-
-\end_layout
-
-\begin_layout Description
-array (obj, dtype=None, shape=None, offset=0, strides=None, formats=None,
- names=None, titles=None, aligned=False, byteorder=None, copy=True)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A general-purpose record array constructor that is a front-end to the other
- constructors If obj is None, then call the
-\series bold
-recarray
-\series default
- constructor.
- If obj is a string, then call the
-\series bold
-fromstring
-\series default
- constructor.
- If obj is a list or a tuple then if the first object is an ndarray, then
- call
-\series bold
-fromarrays
-\series default
-, otherwise call
-\series bold
-fromrecords
-\series default
-.
- If obj is a recarray, then make a copy of the data in recarray (if copy
- is True) and use the new formats, names, and titles.
- If obj is a file then call
-\series bold
-fromfile
-\series default
-.
- Finally, if obj is an ndarray, then return obj.view(recarray) and make a
- copy of the data if copy is True.
- Otherwise, call the __array_interface__ attribute and try to convert using
- the information returned from that object.
- Either dtype or the formats argument must be given if obj is None, a string,
- or a file, and if obj is None so the recarray constructor will be called,
- then shape must be given as well.
-
-\end_layout
-
-\begin_layout Description
-fromarrays (array_list, dtype=None, shape=None, formats=None, names=None,
- titles=None, aligned=False, byteorder=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create a record array from a (flat) list of ndarrays.
- The data from the arrays will be copied into the fields.
- If formats is None and dtype is None, then the formats will be determined
- from the arrays.
- The names and titles arguments can be a list, tuple or a (comma-separated)
- string specifying the names and/or titles to use for the fields.
- If aligned is True, then the structure will be padded according to the
- rules of the compiler that NumPy was compiled with.
-\end_layout
-
-\begin_layout MyCode
->>> x1 = array([21,32,14])
-\newline
->>> x2 = array(['my','first','name'])
-\newline
->>> x3 =
- array([3.1, 4.5, 6.2])
-\newline
->>> r = rec.fromarrays([x1,x2,x3], names='id, word, number')
-\newline
->
->> print r[1]
-\newline
-(32, 'first', 4.5)
-\newline
->>> r.number
-\newline
-array([ 3.1, 4.5, 6.2])
-\newline
->>> r.word
-\newline
-chararra
-y(['my', 'first', 'name'],
-\newline
- dtype='|S5')
-\end_layout
-
-\begin_layout Description
-fromrecords (rec_list, dtype=None, shape=None, formats=None, names=None,
- titles=None, aligned=False, byteorder=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a record array from a (nested) sequence of tuples that define
- the records.
- If formats are not given, they are deduced from the records, but this is
- slower.
- The field names and field titles can be specified.
- If aligned is non-zero, then the record array is padded so that fields
- are aligned as the platform compiler would do if the fields represented
- a C-struct.
-\end_layout
-
-\begin_layout MyCode
->>> recs = [('Bill', 31, 260.0), ('Fred', 15, 145.0)]
-\newline
->>> r = rec.fromrecords(recs,
- formats='S30,i2,f4', names='name, age, weight')
-\newline
->>> print r.name
-\newline
-['Bill' 'Fred']
-\newline
->>
-> print r.age
-\newline
-[31 15]
-\newline
->>> print r.weight
-\newline
-[ 260.
- 145.]
-\end_layout
-
-\begin_layout Description
-fromstring (datastring, dtype=None, shape=None, offset=0, formats=None,
- names=None, titles=None, aligned=0, byteorder=None):
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a record array using the provided datastring (at the given offset)
- as the memory.
- The record array will be read-only.
- The byteorder argument may be used to specify the byteorder of all of the
- fields at the same time.
- A True aligned argument causes padding fields to be added as needed so
- that the fields are aligned on boundaries determined by the compiler.
- The shape of the returned array can also be specified.
-
-\end_layout
-
-\begin_layout Description
-fromfile (fd, dtype=None, shape=None, offset=0, formats=None, names=None,
- titles=None, aligned=False, byteorder=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a record array from the (binary) data in the given file object,
- fd.
- This object may be an open file or a string to indicate a file to read
- from.
- If offset is non-zero, then data is read from the file at offset bytes
- from the current position.
-
-\end_layout
-
-\begin_layout Standard
-The following classes are also available in the numpy.core (and therefore
- the numpy) namespace
-\end_layout
-
-\begin_layout Description
-record A subclass of the void array scalar type that allows field access
- using attributes.
-
-\end_layout
-
-\begin_layout Description
-recarray A subclass of the ndarray that allows field access using attributes
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-__new__ (subtype, shape, formats, names=None, titles=None, buf=None, offset=0,
- strides=None, byteorder=None, aligned=0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct an array of the given subtype and shape with data-type (record,
- dtype) where dtype is constructed from formats, names, and titles.
- If buf is None, then create new memory.
- Otherwise, use the memory of buf exposed through the buffer protocol.
-\end_layout
-
-\end_deeper
-\begin_layout Description
-format_parser A class useful for creating a data-type descriptor from formats,
- names, titles, and aligned arguments.
- This is used by several of the record array constructors for consistency
- in behavior.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-__init__ (self, formats, names, titles, aligned=False, byteorder=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Construct a data-type object from formats, names, titles, aligned, and
- byteorder arguments.
- Upon completion the constructed data-type object is in self._descr.
-
-\begin_inset LatexCommand index
-name "record arrays|)"
-
-\end_inset
-
-
-\end_layout
-
-\end_deeper
-\begin_layout Section
-Masked Arrays (numpy.ma)
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "masked arrays|("
-
-\end_inset
-
-These are adapted from the masked arrays provided with Numeric.
- Masked Arrays do not inherit from the ndarray, they simply use two ndarray
- objects in their internal representation.
- Fortunately, as I have not used masked arrays in my work, Paul Dubois (the
- original author of MA for Numeric) adapted and modified the code for use
- by NumPy.
- Alexander Belopolsky (Sasha) added additional functions and improvements
-
-\end_layout
-
-\begin_layout Standard
-Masked arrays are created using the masked array creation function.
-
-\end_layout
-
-\begin_layout Description
-ma.array (data, dtype=None, copy=True, order='C', mask=ma.nomask, fill_value=None)
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-data Something that can be converted to an array.
- If data is already a masked array, then if mask is ma.nomask, the mask used
- be data.mask and the data used data.data.
-
-\end_layout
-
-\begin_layout Description
-dtype The data-type of the underlying array
-\end_layout
-
-\begin_layout Description
-copy If copy is False, then every effort will be made to not copy the data.
-
-\end_layout
-
-\begin_layout Description
-order Specify whether the array is in 'C', 'Fortran', or 'Any' order
-\end_layout
-
-\begin_layout Description
-mask Masked values are excluded from calculations.
- If this is ma.nomask, then there are no masked values.
- Otherwise, this should be an object that is convertible to an array of
- Booleans with the same shape as data.
-\end_layout
-
-\begin_layout Description
-fill_value This value is used to fill in masked values when necessary.
- The fill_value is not used for computation for functions within the ma
- module.
-\end_layout
-
-\end_deeper
-\begin_layout Standard
-Masked arrays have the same methods and attributes as arrays with the addition
- of the mask attribute as well as the
-\begin_inset Quotes eld
-\end_inset
-
-hidden
-\begin_inset Quotes erd
-\end_inset
-
- attributes ._data and ._mask.
-
-\begin_inset LatexCommand index
-name "masked arrays|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Standard container class
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "user\\_array"
-
-\end_inset
-
-
-\begin_inset LatexCommand index
-name "container class"
-
-\end_inset
-
-For backward compatibility and as a standard
-\begin_inset Quotes eld
-\end_inset
-
-container
-\begin_inset Quotes erd
-\end_inset
-
- class, the UserArray from Numeric has been brought over to NumPy and named
-
-\series bold
-numpy.lib.user_array.container
-\series default
- The container class is a Python class whose self.array attribute is an ndarray.
- Multiple inheritance is probably easier with numpy.lib.user_array.container
- than with the ndarray itself and so it is included by default.
- It is not documented here beyond mentioning its existence because you are
- encouraged to use the ndarray class directly if you can.
-
-\end_layout
-
-\begin_layout Section
-Array Iterators
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "array iterator"
-
-\end_inset
-
-Iterators are a powerful concept for array processing.
- Essentially, iterators implement a generalized for-loop.
- If myiter is an iterator object, then the Python code
-\end_layout
-
-\begin_layout LyX-Code
-for val in myiter:
-\end_layout
-
-\begin_layout LyX-Code
- ...
-\end_layout
-
-\begin_layout LyX-Code
- some code involving val
-\end_layout
-
-\begin_layout LyX-Code
- ...
-\end_layout
-
-\begin_layout Standard
-calls val=myiter.next() repeatedly until StopIteration is raised by the iterator.
- There are several ways to iterate over an array that may be useful: default
- iteration, flat iteration, and
-\begin_inset Formula $N$
-\end_inset
-
--dimensional enumeration.
-\end_layout
-
-\begin_layout Subsection
-Default iteration
-\end_layout
-
-\begin_layout Standard
-The default iterator of an ndarray object is the default Python iterator
- of a sequence type.
- Thus, when the array object itself is used as an iterator.
- The default behavior is equivalent to:
-\end_layout
-
-\begin_layout LyX-Code
-for i in arr.shape[0]:
-\end_layout
-
-\begin_layout LyX-Code
- val = arr[i]
-\end_layout
-
-\begin_layout Standard
-This default iterator selects a sub-array of dimension
-\begin_inset Formula $N-1$
-\end_inset
-
- from the array.
- This can be a useful construct for defining recursive algorithms.
- To loop over the entire array requires
-\begin_inset Formula $N$
-\end_inset
-
- for-loops.
-
-\end_layout
-
-\begin_layout MyCode
->>> a = arange(24).reshape(3,2,4)+10
-\newline
->>> for val in a:
-\newline
-...
- print 'item:', val
-\newline
-item: [[10 11 12 13]
-\newline
- [14 15 16 17]]
-\newline
-item: [[18 19
- 20 21]
-\newline
- [22 23 24 25]]
-\newline
-item: [[26 27 28 29]
-\newline
- [30 31 32 33]]
-\end_layout
-
-\begin_layout Subsection
-Flat iteration
-\end_layout
-
-\begin_layout Standard
-As mentioned previously, the flat attribute of ndarray objects returns an
- iterator that will cycle over the entire array in C-style contiguous order.
-
-\end_layout
-
-\begin_layout MyCode
->>> for i, val in enumerate(a.flat):
-\newline
-...
- if i%5 == 0: print i, val
-\newline
-0 10
-\newline
-5 15
-\newline
-10 20
-\newline
-15 25
-\newline
-20 30
-\end_layout
-
-\begin_layout Standard
-Here, I've used the built-in enumerate iterator to return the iterator index
- as well as the value.
-\end_layout
-
-\begin_layout Subsection
-N-dimensional enumeration
-\end_layout
-
-\begin_layout Standard
-Sometimes it may be useful to get the N-dimensional index while iterating.
- The ndenumerate iterator can achieve this.
-\end_layout
-
-\begin_layout MyCode
->>> for i, val in ndenumerate(a):
-\newline
-...
- if sum(i)%5 == 0: print i, val
-\newline
-(0, 0, 0) 10
-\newline
-(1, 1, 3) 25
-\newline
-(2, 0, 3) 29
-\newline
-(2,
- 1, 2) 32
-\end_layout
-
-\begin_layout Subsection
-Iterator for broadcasting
-\end_layout
-
-\begin_layout Standard
-The general concept of broadcasting is also available from Python using
- the
-\series bold
-broadcast
-\series default
- iterator.
- This object takes
-\begin_inset Formula $N$
-\end_inset
-
- objects as inputs and returns an iterator that returns tuples providing
- each of the input sequence elements in the broadcasted result.
-\end_layout
-
-\begin_layout MyCode
->>> for val in broadcast([[1,0],[2,3]],[0,1]):
-\newline
-...
- print val
-\newline
-(1, 0)
-\newline
-(0, 1)
-\newline
-(2, 0)
-\newline
-(3, 1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The methods and attributes of the broadcast object are:
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-nd the number of dimensions in the broadcasted result.
-\end_layout
-
-\begin_layout Description
-shape the shape of the broadcasted result.
-\end_layout
-
-\begin_layout Description
-size the total size of the broadcasted result.
-\end_layout
-
-\begin_layout Description
-index the current (flat) index into the broadcasted array
-\end_layout
-
-\begin_layout Description
-iters a tuple of (broadcasted) NumPy.flatiter objects, one for each array.
-\end_layout
-
-\begin_layout Description
-reset ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Reset the multiter object to the beginning.
-\end_layout
-
-\begin_layout Description
-next ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Get the next tuple of objects from the (broadcasted) arrays
-\end_layout
-
-\end_deeper
-\begin_layout Chapter
-Universal Functions
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "par:The-Ufunc-Object"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Quotation
-Computers make it easier to do a lot of things, but most of the things they
- make it easier to do don't need to be done.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Andy Rooney
-\end_layout
-
-\begin_layout Quotation
-People think computers will keep them from making mistakes.
- They're wrong.
- With computers you make mistakes faster.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Adam Osborne
-\end_layout
-
-\begin_layout Section
-Description
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ufunc|("
-
-\end_inset
-
-Universal functions are wrappers that provide a common interface to mathematical
- functions that operate on scalars, and can be made to operate on arrays
- in an element-by-element fashion.
- All
-\family typewriter
-u
-\family default
-niversal
-\family typewriter
-func
-\family default
-tion
-\family typewriter
-s
-\family default
- (
-\family typewriter
-ufuncs
-\family default
-) wrap some core function that takes
-\begin_inset Formula $n_{i}$
-\end_inset
-
- (scalar) inputs and produces
-\begin_inset Formula $n_{o}$
-\end_inset
-
- (scalar) outputs.
- Typically, this core function is implemented in compiled code but a Python
- function can also be wrapped into a universal function using the basic
- method
-\family typewriter
-frompyfunc
-\family default
- in the umath module.
-
-\end_layout
-
-\begin_layout Description
-frompyfunc (func, nin, nout)
-\begin_inset LatexCommand index
-name "frompyfunc"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This function returns a new universal function wrapping a Python function
- func with nin inputs and nout outputs.
- The resulting universal function works using Object arrays for both input
- and output.
- The vectorize class makes use of frompyfunc internally.
- You can view the source code using numpy.source(numpy.vectorize).
-\end_layout
-
-\begin_layout Subsection
-Broadcasting
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "broadcasting"
-
-\end_inset
-
-Each universal function takes array inputs and produces array outputs by
- performing the core function element-wise on the inputs.
- The standard broadcasting rules are applied so that inputs without exactly
- the same shapes can still be usefully operated on.
- Broadcasting can be understood by four rules:
-\end_layout
-
-\begin_layout Enumerate
-All input arrays with ndim smaller than the input array of largest ndim
- have 1's pre-pended to their shapes.
-\end_layout
-
-\begin_layout Enumerate
-The size in each dimension of the output shape is the maximum of all the
- input shapes in that dimension.
-\end_layout
-
-\begin_layout Enumerate
-An input can be used in the calculation if it's shape in a particular dimension
- either matches the output shape or has value exactly 1.
-\end_layout
-
-\begin_layout Enumerate
-If an input has a dimension size of 1 in its shape, the first data entry
- in that dimension will be used for all calculations along that dimension.
- In other words, the stepping machinery of the ufunc will simply not step
- along that dimension when otherwise needed (the stride will be 0 for that
- dimension).
-
-\end_layout
-
-\begin_layout Standard
-While perhaps a bit difficult to explain, broadcasting can be quite useful
- and becomes second nature rather quickly.
- Broadcasting is used throughout NumPy to decide how to handle non equally-shape
-d arrays.
-
-\end_layout
-
-\begin_layout Subsection
-Output type determination
-\end_layout
-
-\begin_layout Standard
-The output of the ufunc (and its methods) does not have to be an ndarray.
- All output arrays will be passed to the __array_wrap__ method of any input
- (besides ndarrays, and scalars) that defines it
-\series bold
-and
-\series default
- has the highest __array_priority__ of any other input to the universal
- function.
- The default __array_priority__ of the ndarray is 0.0, and the default __array_pr
-iority__ of a subtype is 1.0.
- Matrices have __array_priority__ equal to 10.0.
-
-\end_layout
-
-\begin_layout Standard
-The ufuncs can also all take output arguments.
- The output will be cast if necessary to the provided output array.
- If a class with an __array__ method is used for the output, results will
- be written to the object returned by __array__.
- Then, if the class also has an __array_wrap__ method, the returned
-\family typewriter
-ndarray
-\family default
- result will be passed to that method just before passing control back to
- the caller.
-
-\end_layout
-
-\begin_layout Subsection
-Use of internal buffers
-\end_layout
-
-\begin_layout Standard
-Internally, buffers are used for misaligned data, swapped data, and data
- that has to be converted from one data type to another.
- The size of the internal buffers is settable on a per-thread basis.
- There can be up to
-\begin_inset Formula $2\left(n_{i}+n_{o}\right)$
-\end_inset
-
- buffers of the specified size created to handle the data from all the inputs
- and outputs of a ufunc.
- The default size of the buffer is 10,000 elements.
- Whenever buffer-based calculation would be needed, but all input arrays
- are smaller than the buffer size, those misbehaved or incorrect typed arrays
- will be copied before the calculation proceeds.
- Adjusting the size of the buffer may therefore alter the speed at which
- ufunc calculations of various sorts are completed.
- A simple interface for setting this variable is accessible using the function
-
-\end_layout
-
-\begin_layout Description
-setbufsize (size)
-\begin_inset LatexCommand index
-name "setbufsize"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Set the buffer size to the given number of elements in the current thread.
- Return the old buffer size (so that it can be reset later if desired).
-
-\end_layout
-
-\begin_layout Subsection
-Error handling
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "error handling"
-
-\end_inset
-
-Universal functions can trip special floating point status registers in
- your hardware (such as divide-by-zero).
- If available on your platform, these registers will be regularly checked
- during calculation.
- The user can determine what should be done if errors are encountered.
- Error handling is controlled on a per-thread basis.
- Four errors can be individually configured: divide-by-zero, overflow, underflow
-, and invalid.
- The errors can each be set to ignore, warn, raise, or call.
- The easiest way to configure the error mask is using the function
-\end_layout
-
-\begin_layout Description
-seterr (all=None, divide=None, over=None, under=None, invalid=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset LatexCommand index
-name "seterr"
-
-\end_inset
-
-This will set the current thread so that errors can be handled if desired.
- If one of the errors is set to 'call', then a function must be provided
- using the seterrcall() routine.
- If any of the arguments are None, then that error mask will be unchanged.
- The return value of this function is a dictionary with the old error conditions.
- Thus, you can restore the old condition after you are finished with your
- function by calling seterr(**old).
- If all is set, then all errors will be set to the specified value.
-
-\end_layout
-
-\begin_layout Description
-seterrcall (callable)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset LatexCommand index
-name "seterrcall"
-
-\end_inset
-
-This sets the function to call when an error is triggered for an error condition
- configured with the
-\begin_inset Quotes eld
-\end_inset
-
-call
-\begin_inset Quotes erd
-\end_inset
-
- handler.
- This function should take two arguments: a string showing the type of error
- that triggered the call, and an integer showing the state of the floating
- point status registers.
- Any return value of the call function will be ignored, but errors can be
- raised by the function.
- Only one error function handler can be specified for all the errors.
- The status argument shows which errors were raised.
- The return value of this routine is the old callable.
- The argument passed in to this function must be any callable object with
- the right signature or None.
-
-\end_layout
-
-\begin_layout Note
-FPE_DIVIDEBYZERO, FPE_OVERFLOW, FPE_UNDERFLOW, and FPE_INVALID, are all
- defined constants in NumPy.
- The status flag returned for a 'call' error handling type shows which errors
- were raised by adding these constants together.
-\end_layout
-
-\begin_layout Subsection
-Optional keyword arguments
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ufunc!keyword arguments"
-
-\end_inset
-
-All ufuncs take optional keyword arguments.
- These represent rather advanced usage and will likely not be used by most
- users.
-
-\end_layout
-
-\begin_layout Description
-sig= either a data-type, a tuple of data-types, or a special signature string
- indicating the input and output types of a ufunc.
- This argument allows you to specify a specific signature for a the 1-d
- loop to use in the underlying calculation.
- If the loop specified does not exist for the ufunc, then a TypeError is
- raised.
- Normally a suitable loop is found automatically by comparing the input
- types with what is available and searching for a loop with data-types to
- which all inputs can be cast safely.
- This key-word argument lets you by-pass that search and choose a loop you
- want.
- A list of available signatures is available in the
-\series bold
-types
-\series default
- attribute of the ufunc object.
-
-\end_layout
-
-\begin_layout Description
-extobj= a list of length 1, 2, or 3 specifying the ufunc buffer-size, the
- error mode integer, and the error call-back function.
- Normally, these values are looked-up in a thread-specific dictionary.
- Passing them here bypasses that look-up and uses the low-level specification
- provided for the error-mode.
- This may be useful as an optimization for calculations requiring lots of
- ufuncs on small arrays in a loop.
-
-\end_layout
-
-\begin_layout Section
-Attributes
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ufunc!attributes"
-
-\end_inset
-
-There are some informational attributes that universal functions possess.
- None of the attributes can be set.
-
-\end_layout
-
-\begin_layout Description
-__doc__
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A docstring for each ufunc.
- The first part of the docstring is dynamically generated from the number
- of outputs, the name, and the number of inputs.
- The second part of the doc string is provided at creation time and stored
- with the ufunc.
-
-\end_layout
-
-\begin_layout Description
-__name__
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The name of this ufunc.
-\end_layout
-
-\begin_layout Description
-nin
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The number of inputs
-\end_layout
-
-\begin_layout Description
-nout
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The number of outputs
-\end_layout
-
-\begin_layout Description
-nargs
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The total number of inputs + outputs
-\end_layout
-
-\begin_layout Description
-ntypes
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The total number of different types for which this ufunc is defined.
-\end_layout
-
-\begin_layout Description
-types
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A list of length ntypes containing strings showing the types for which
- this ufunc is defined.
- Other types may still be used as inputs (and as output arrays), they will
- just need casting.
- For inputs, standard casting rules will be used to determine which of the
- supplied internal functions that will be used (and therefore the default
- type of the output).
- Results will always be force-cast to any array provided to hold the output.
-
-\end_layout
-
-\begin_layout Description
-identity
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A 1, 0, or None to show the identity for this universal function.
- This identity is used for reduction on zero-sized arrays (arrays with a
- shape that includes a 0).
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float table
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-Universal function (ufunc) attributes.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="9" columns="2">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Name
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Description
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-__doc__
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Dynamic docstring.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-__name__
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Name of ufunc
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-nin
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Number of input arguments
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-nout
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Number of output arguments
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-nargs
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Total number of arguments
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-ntypes
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Number of defined inner loops.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-types
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-List showing types for which inner loop is defined.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-identity
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Identity for this ufunc.
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Casting Rules
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ufunc!casting rules"
-
-\end_inset
-
-At the core of every ufunc is a one-dimensional strided loop that implements
- the actual function for a specific type combination.
- When a ufunc is created, it is given a static list of inner loops and a
- corresponding list of type signatures over which the ufunc operates.
- The ufunc machinery uses this list to determine which inner loop to use
- for a particular case.
- You can inspect the
-\family typewriter
-.types
-\family default
- attribute for a particular ufunc to see which type combinations have a
- defined inner loop and which output type they produce (the character codes
- are used in that output for brevity).
-
-\end_layout
-
-\begin_layout Standard
-Casting must be done on one or more of the inputs whenever the ufunc does
- not have a core loop implementation for the input types provided.
- If an implementation for the input types cannot be found, then the algorithm
- searches for an implementation with a type signature to which all of the
- inputs can be cast
-\begin_inset Quotes eld
-\end_inset
-
-safely.
-\begin_inset Quotes erd
-\end_inset
-
- The first one it finds in its internal list of loops is selected and performed
- with types cast.
- Recall that internal copies during ufuncs (even for casting) are limited
- to the size of an internal buffer which is user settable.
-
-\end_layout
-
-\begin_layout Note
-Universal functions in NumPy are flexible enough to have mixed type signatures.
- Thus, for example, a universal function could be defined that works with
- floating point and integer values.
- See ldexp for an example.
-\end_layout
-
-\begin_layout Standard
-By the above description, the casting rules are essentially implemented
- by the question of when a data type can be cast
-\begin_inset Quotes eld
-\end_inset
-
-safely
-\begin_inset Quotes erd
-\end_inset
-
- to another data type.
- The answer to this question can be determined in Python with a function
- call: can_cast (fromtype, totype).
- Figure shows the results of this call for my 32-bit system on the 21 internally
- supported types.
- You can generate this table for your system with code shown in that Figure.
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float figure
-wide false
-sideways false
-status open
-
-\begin_layout MyCode
->>> def print_table(ntypes):
-\newline
-...
- print 'X',
-\newline
-...
- for char in ntypes: print char,
-\newline
-...
- print
-\newline
-...
- for row in ntypes:
-\newline
-...
- print row,
-\newline
-...
- for col in ntypes:
-\newline
-...
- print int(can_cast(row, col)),
-\newline
-...
- print
-\newline
->>> print_table(typecodes['All'])
-\newline
-X ? b h i l q p B H I L Q
- P f d g F D G S U V O
-\newline
-? 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-\newline
-b 0
- 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
-\newline
-h 0 0 1 1 1 1 1 0 0 0 0 0 0
- 1 1 1 1 1 1 1 1 1 1
-\newline
-i 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1
-\newline
-l 0 0
- 0 1 1 1 1 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1
-\newline
-q 0 0 0 0 0 1 0 0 0 0 0 0 0 0
- 1 1 0 1 1 1 1 1 1
-\newline
-p 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1
-\newline
-B 0 0 1
- 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
-\newline
-H 0 0 0 1 1 1 1 0 1 1 1 1 1 1 1
- 1 1 1 1 1 1 1 1
-\newline
-I 0 0 0 0 0 1 0 0 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1
-\newline
-L 0 0 0 0
- 0 1 0 0 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1
-\newline
-Q 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1
- 0 1 1 1 1 1 1
-\newline
-P 0 0 0 0 0 1 0 0 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1
-\newline
-f 0 0 0 0 0
- 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
-\newline
-d 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0
- 1 1 1 1 1 1
-\newline
-g 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 1 1
-\newline
-F 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1
-\newline
-D 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
- 1 1 1 1 1
-\newline
-G 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1
-\newline
-S 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
-\newline
-U 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
- 0 1 1 1
-\newline
-V 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
-\newline
-O 0 0 0 0 0 0 0 0
- 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1
-\end_layout
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-Code segment showing the can cast safely table for a 32-bit system.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-You should note that, while included in the table for completeness, the
- 'S', 'U', and 'V' types cannot be operated on by ufuncs.
- Also, note that on a 64-bit system the integer types may have different
- sizes resulting in a slightly altered table.
-
-\end_layout
-
-\begin_layout Standard
-Mixed scalar-array operations use a different set of casting rules that
- ensure that a scalar cannot upcast an array unless the scalar is of a fundament
-ally different kind of data (
-\emph on
-i.e.
-
-\emph default
- under a different hierachy in the data type hierarchy) then the array.
- This rule enables you to use scalar constants in your code (which as Python
- types are interpreted accordingly in ufuncs) without worrying about whether
- the precision of the scalar constant will cause upcasting on your large
- (small precision) array.
-
-\end_layout
-
-\begin_layout Section
-Methods
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ufunc!methods|("
-
-\end_inset
-
-All ufuncs have 4 methods.
- However, these methods only make sense on ufuncs that take two input arguments
- and return one output argument.
- Attempting to call these methods on other ufuncs will cause a
-\family typewriter
-ValueError
-\family default
-.
- The reduce-like methods all take an axis keyword and a dtype keyword, and
- the arrays must all have dimension >= 1.
- The
-\emph on
-axis
-\emph default
- keyword specifies which axis of the array the reduction will take place
- over and may be negative, but must be an integer.
- The
-\emph on
-dtype
-\emph default
- keyword allows you to manage a very common problem that arises when naively
- using <op>.reduce.
- Sometimes you may have an array of a certain data type and wish to add
- up all of its elements, but the result does not fit into the data type
- of the array.
- This commonly happens if you have an array of single-byte integers.
- The dtype keyword allows you to alter the data type that the reduction
- takes place over (and therefore the type of the output).
- Thus, you can ensure that the output is a data type with large-enough precision
- to handle your output.
- The responsibility of altering the reduce type is mostly up to you.
- There is one exception: if no dtype is given for a reduction on the
-\begin_inset Quotes eld
-\end_inset
-
-add
-\begin_inset Quotes erd
-\end_inset
-
- or
-\begin_inset Quotes eld
-\end_inset
-
-multiply
-\begin_inset Quotes erd
-\end_inset
-
- operations, then if the input type is an integer (or boolean) data-type
- and smaller than the size of the int_ data type, it will be internally
- upcast to the int_ (or uint) data type.
-
-\end_layout
-
-\begin_layout Warning
-A reduce-like operation on an array with a data type that has range
-\begin_inset Quotes eld
-\end_inset
-
-too small
-\begin_inset Quotes erd
-\end_inset
-
- to handle the result will silently wrap.
- You should use dtype to increase the data type over which reduction takes
- place.
-\end_layout
-
-\begin_layout Subsection
-Reduce
-\end_layout
-
-\begin_layout Description
-<op>.reduce (array=, axis=0, dtype=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset LatexCommand index
-name "ufunc!methods!reduce"
-
-\end_inset
-
-For each one-dimensional sequence along the
-\emph on
-axis
-\emph default
- dimension of the array, return a single number resulting from recursively
- applying the operation to succesive elements along that dimension.
- If the input array has
-\begin_inset Formula $N$
-\end_inset
-
- dimensions, then the returned array has
-\begin_inset Formula $N-1$
-\end_inset
-
- dimensions.
- This produces the equivalent of the following Python code :
-\end_layout
-
-\begin_layout LyX-Code
->>> indx = [index_exp[:]]*array.ndim
-\newline
->>> indx[axis] = 0; N=array.shape[axis]
-\newline
->>>
- result = array[indx].astype(dtype)
-\newline
->>> for i in range(1,N):
-\newline
-...
- indx[axis] = i
-\newline
-...
- <op>(result, array[indx], result)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Studying the above code can also help you gain an appreciation for how
- to do generic indexing in Python using
-\family typewriter
-index_exp
-\family default
-.
- For example, if <op> is add, then <op>.reduce produces a summation along
- the given axis.
- If <op> is prod, then a repeated multiply is performed.
-\end_layout
-
-\begin_layout Subsection
-Accumulate
-\end_layout
-
-\begin_layout Description
-<op>.accumulate (array=, axis=0, dtype=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset LatexCommand index
-name "ufunc!methods!accumulate"
-
-\end_inset
-
-This method is similar to reduce, except it returns an array of the same
- shape as the input, and keeps intermediate calculations.
- The operation is still performed along the access.
- This method underlies the operations of the cumsum and cumprod methods
- of arrays.
- The following Python code implements an equivalent of the accumulate method.
-\end_layout
-
-\begin_layout LyX-Code
->>> i1 = [index_exp[:]]*array.ndim
-\newline
->>> i2 = [index_exp[:]]*array.ndim
-\newline
->>> i1[axis]
- = 0; N=array.shape[axis]
-\newline
->>> result = array.astype(dtype)
-\newline
->>> for i in range(1,N):
-\newline
-...
- i1[axis] = i
-\newline
-...
- i2[axis] = i-1
-\newline
-...
- <op>(result[i1], array[i1], result[i2])
-\end_layout
-
-\begin_layout Subsection
-Reduceat
-\end_layout
-
-\begin_layout Description
-<op>.reduceat (array=, indices=, axis=0, dtype=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset LatexCommand index
-name "ufunc!methods!reduceat"
-
-\end_inset
-
-This method is a generalization of both reduce and accumulate.
- It offers the ability to reduce along an axis but only between certain
- indices.
- The indices input must be a one dimensional (index) sequence.
- Then, if
-\begin_inset Formula $I_{k}$
-\end_inset
-
- is the
-\begin_inset Formula $k^{\textrm{th}}$
-\end_inset
-
- element of indices, the reduceat method computes <op>.reduce(array[
-\begin_inset Formula $I_{k}$
-\end_inset
-
-:
-\begin_inset Formula $I_{k+1}$
-\end_inset
-
-]).
- This formula assumes
-\begin_inset Formula $I_{k+1}>I_{k}$
-\end_inset
-
-, and also that
-\begin_inset Formula $I_{k+1}$
-\end_inset
-
- is the length of the input array when
-\begin_inset Formula $I_{k}$
-\end_inset
-
- is the last element.
- There is no requirement that the indices be monotonic.
- If
-\begin_inset Formula $I_{k+1}\leq I_{k},$
-\end_inset
-
- then reduceat simply returns array[
-\begin_inset Formula $I_{k}$
-\end_inset
-
-] for that particular element of indices.
- In these formulas, we have assumed that array is one dimensional (or axis
- is 0).
- If the array is
-\begin_inset Formula $N$
-\end_inset
-
--dimensional and axis>0, then the index expression needs axis ':' (full
- slice objects) inserted (i.e.
- array[
-\begin_inset Formula $\underbrace{:,\ldots,:}_{\textrm{axis}},I_{k}:I_{k+1}$
-\end_inset
-
-]).
- The effect is to slice along the axis dimension.
- Equivalent Python code is
-\end_layout
-
-\begin_layout LyX-Code
->>> i1 = [index_exp[:]]*array.ndim
-\newline
->>> i2 = [index_exp[:]]*array.ndim
-\newline
->>> outshape
- = list(array.shape)
-\newline
->>> N = array.shape[axis]
-\newline
->>> outshape[axis] = len(indices)
-\newline
->>>
- result = zeros(outshape, dtype or array.dtype)
-\newline
->>> for k,Ik in enumerate(indices
-):
-\newline
-...
- i1[axis] = k
-\newline
-...
- try:
-\newline
-...
- Ikp1 = indices[k+1]
-\newline
-...
- except IndexError:
-\newline
-...
- Ikp1 = N
-\newline
-...
- if (Ikp1 > Ik):
-\end_layout
-
-\begin_layout LyX-Code
-...
- i2[axis] = index_exp[Ik:Ikp1]
-\newline
-...
- result[i1] = <op>.reduce(array[i2],axis=axis,dtype=dtype)
-\newline
-...
- else:
-\newline
-...
- result[i1] = array[Ik].astype(dtype)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The returned array has as many dimensions as the input array, and is the
- same shape except for the
-\emph on
-axis
-\emph default
- dimension which has shape equal to the length of indices (the number of
- reduce operations that were performed).
- If you ever have a need to compute multiple reductions over portions of
- an array, then (if you can get your mind around what it is doing) reduceat
- may be just what you were looking for.
-
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-Example: Suppose a is a two-dimensional array of shape
-\begin_inset Formula $10\times20$
-\end_inset
-
-.
- Then, res=add.reduce (a, [0,3,1]) returns a
-\begin_inset Formula $3\times20$
-\end_inset
-
- array with res[0,:] = add.reduce(a[:,0:3]), res[1,:] = a[:,3], and res[2,:]
- = add.reduce(a[:,1:]).
-
-\end_layout
-
-\end_deeper
-\begin_layout Subsection
-Outer
-\end_layout
-
-\begin_layout Description
-<op>.outer (a, b)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset LatexCommand index
-name "ufunc!methods!outer"
-
-\end_inset
-
-This method computes an outer operation on <op>.
- It computes <op>(a2, b2) where a2 is 'a' with b.ndim 1's post-pended to
- it's shape and b2 is 'b' with a.ndim 1's pre-pended to its shape (broadcasting
- takes care of this automatically in the code below).
- The return shape has a.ndim + b.ndim dimensions.
- Equivalent Python code is
-\end_layout
-
-\begin_layout LyX-Code
->>> a.shape += (1,)*b.ndim
-\newline
->>> <op>(a,b)
-\newline
->>> a = a.squeeze()
-\end_layout
-
-\begin_layout Standard
-\InsetSpace ~
- Among many other uses, arithmetic tables can be conveniently built using
- outer:
-\begin_inset LatexCommand index
-name "ufunc!methods|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout MyCode
->>> multiply.outer([1,7,9,12],arange(5,12))
-\newline
-array([[ 5, 6, 7, 8,
- 9, 10, 11],
-\newline
- [ 35, 42, 49, 56, 63, 70, 77],
-\newline
- [ 45, 54,
- 63, 72, 81, 90, 99],
-\newline
- [ 60, 72, 84, 96, 108, 120, 132]])
-\end_layout
-
-\begin_layout Section
-Available ufuncs
-\end_layout
-
-\begin_layout Standard
-There are currently more than 60 universal functions defined on one or more
- types, covering a wide variety of operations.
- Some of these ufuncs are called automatically on arrays when the relevant
- infix notation is used (i.e.
- add(a,b) is called internally when a + b is written and a or b is an ndarray).
- Nonetheless, you may still want to use the ufunc call in order to use the
- optional output argument(s) to place the output(s) in an object (or in
- objects) of your choice.
-
-\end_layout
-
-\begin_layout Standard
-Recall that each ufunc operates element-by-element.
- Therefore, each ufunc will be described as if acting on a set of scalar
- inputs to return a set of scalar outputs.
-\end_layout
-
-\begin_layout Note
-The ufunc still returns its output(s) even if you use the optional output
- argument(s).
-
-\end_layout
-
-\begin_layout Subsection
-Math operations
-\end_layout
-
-\begin_layout Description
-add (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "add"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=x_{1}+x_{2}$
-\end_inset
-
-.
- Called to implement
-\family typewriter
-x1+x2
-\family default
- for arrays
-\end_layout
-
-\begin_layout Description
-subtract (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "subtract"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=x_{1}-x_{2}$
-\end_inset
-
-.
- Called to implement
-\family typewriter
-x1-x2
-\family default
- for arrays
-\end_layout
-
-\begin_layout Description
-multiply (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "multiply"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=x_{1}\cdot x_{2}$
-\end_inset
-
-.
- Called to implement
-\family typewriter
-x1*x2
-\family default
- for arrays.
-\end_layout
-
-\begin_layout Description
-divide (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "divide"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=x_{1}/x_{2}$
-\end_inset
-
- Integer division results in truncation.
- Floating-point does not.
- Called to implement
-\family typewriter
-x1/x2
-\family default
- for arrays (when __future__.division is not active).
-
-\end_layout
-
-\begin_layout Description
-true_divide (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "true\\_divide"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This version of division always returns an inexact number so that integer
- division returns floating point.
- Called with __future__.division is active to implement
-\family typewriter
-x1/x2
-\family default
- for arrays.
-\end_layout
-
-\begin_layout Description
-floor_divide (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "floor\\_divide"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This version of division always results in truncation of an fractional
- part remaining.
- Called to implement
-\family typewriter
-x1//x2
-\family default
- for arrays.
-\end_layout
-
-\begin_layout Description
-negative (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "negative"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=-x$
-\end_inset
-
-.
- Called to implement
-\family typewriter
--x
-\family default
- for arrays.
-\end_layout
-
-\begin_layout Description
-power (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "power"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=x_{1}^{x_{2}}$
-\end_inset
-
-.
- There is no three-term power ufunc defined.
- This two-term power function is called to implement
-\family typewriter
-pow(x1,x2,<any>)
-\family default
- or
-\family typewriter
-x1**x2
-\family default
- for arrays.
- Note that the third term in
-\family typewriter
-pow
-\family default
- is ignored for array arguments.
-\end_layout
-
-\begin_layout Description
-remainder (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "remainder"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns
-\begin_inset Formula $x-y$
-\end_inset
-
-*floor(
-\begin_inset Formula $x/y$
-\end_inset
-
-).
- Result has the sign of
-\begin_inset Formula $y$
-\end_inset
-
-.
- Called to implement
-\family typewriter
-x1%x2
-\family default
-.
-\end_layout
-
-\begin_layout Description
-mod (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Same as remainder (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-]).
-
-\end_layout
-
-\begin_layout Description
-fmod (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $x_{1}=kx_{2}+y$
-\end_inset
-
- where
-\begin_inset Formula $k$
-\end_inset
-
- is the largest integer satisfying this equation.
- Computes C-like
-\begin_inset Formula $x_{1}\%x_{2}$
-\end_inset
-
- element-wise.
- This was the behavior of
-\family typewriter
-x1%x2
-\family default
- in old Numeric.
-\end_layout
-
-\begin_layout Description
-absolute (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "absolute"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=\left|x\right|.$
-\end_inset
-
- Called to implement
-\family typewriter
-abs(x)
-\family default
- for arrays.
-
-\end_layout
-
-\begin_layout Description
-rint (x, [, y])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Round
-\begin_inset Formula $x$
-\end_inset
-
- to the nearest integer.
- Rounds half-way cases to the nearest even integer.
-\end_layout
-
-\begin_layout Description
-sign (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Sets
-\begin_inset Formula $y$
-\end_inset
-
- according to
-\begin_inset Formula \[
-\textrm{sign}\left(x\right)=\left\{ \begin{array}{cc}
-1 & x:>0,\\
-0 & x=0,\\
--1 & x<0.\end{array}\right.\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-conj (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "conj"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-conjugate (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "conjugate"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=\overline{x}$
-\end_inset
-
-; in other words, the complex conjugate of
-\begin_inset Formula $x$
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Description
-exp (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "exp"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=e^{x}.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-log (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "log"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=\log\left(x\right)$
-\end_inset
-
-.
- In other words,
-\begin_inset Formula $y$
-\end_inset
-
- is the number so that
-\begin_inset Formula $e^{y}=x$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Description
-expm1 (
-\begin_inset Formula $x$
-\end_inset
-
-, [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=e^{x}-1.$
-\end_inset
-
- Calculated so that it is accurate for small
-\begin_inset Formula $\left|x\right|.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-log1p (
-\begin_inset Formula $x$
-\end_inset
-
-, [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=\log\left(1+x\right)$
-\end_inset
-
- but accurate for small
-\begin_inset Formula $\left|x\right|.$
-\end_inset
-
- Returns the number
-\begin_inset Formula $y$
-\end_inset
-
- such that
-\begin_inset Formula $e^{y}-1=x$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-log10 (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "log10"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=\log10\left(x\right)$
-\end_inset
-
-.
- In other words,
-\begin_inset Formula $y$
-\end_inset
-
- is the number so that
-\begin_inset Formula $10^{y}=x.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-sqrt (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "sqrt"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=\sqrt{x}.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-square (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=x*x$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-reciprocal (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=1/x$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-ones_like (
-\begin_inset Formula $x$
-\end_inset
-
-, [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset Formula $y=1$
-\end_inset
-
- If an output argument is not given the returned data-type is the same as
- the input data type.
-\end_layout
-
-\begin_layout Tip
-The optional output arguments can be used to help you save memory for large
- calculations.
- If your arrays are large, complicated expressions can take longer than
- absolutely necessary due to the creation and (later) destruction of temporary
- calculation spaces.
- For example, the expression 'G=a*b+c' is equivalent to t1=A*B; G=T1+C;
- del t1; It will be more quickly executed as G=A*B; add(G,C,G) which is
- the same as G=A*B; G+=C.
-\end_layout
-
-\begin_layout Subsection
-Trigonometric functions
-\end_layout
-
-\begin_layout Standard
-All trigonometric functions use radians when an angle is called for.
- The ratio of degrees to radians is
-\begin_inset Formula $180^{\circ}/\pi.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-sin (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "sin"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-cos (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "cos"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-tan (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "tan"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The standard trignometric functions.
-
-\begin_inset Formula $y=\sin\left(x\right),$
-\end_inset
-
-
-\begin_inset Formula $y=\cos\left(x\right),$
-\end_inset
-
- and
-\begin_inset Formula $y=\tan\left(x\right).$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-arcsin (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "arcsin"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-arccos (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "arccos"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-arctan (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "arctan"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The inverse trigonometric functions:
-\begin_inset Formula $y=\sin^{-1}\left(x\right),$
-\end_inset
-
-
-\begin_inset Formula $y=\cos^{-1}\left(x\right)$
-\end_inset
-
-,
-\begin_inset Formula $y=\tan^{-1}\left(x\right).$
-\end_inset
-
- These return the value of
-\begin_inset Formula $y$
-\end_inset
-
- (in radians) such that
-\begin_inset Formula $\sin\left(y\right)=x$
-\end_inset
-
- with
-\begin_inset Formula $y\in\left[-\frac{\pi}{2},\frac{\pi}{2}\right]$
-\end_inset
-
-;
-\begin_inset Formula $\cos\left(y\right)=x$
-\end_inset
-
- with
-\begin_inset Formula $y\in\left[0,\pi\right]$
-\end_inset
-
-; and
-\begin_inset Formula $\tan\left(y\right)=x$
-\end_inset
-
- with
-\begin_inset Formula $y\in\left[-\frac{\pi}{2},\frac{\pi}{2}\right]$
-\end_inset
-
-, respectively.
-
-\end_layout
-
-\begin_layout Description
-arctan2 (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "arctan2"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns
-\begin_inset Formula $\tan^{-1}\left(\frac{x_{1}}{x_{2}}\right)$
-\end_inset
-
- but takes into account the sign on
-\begin_inset Formula $x_{1}$
-\end_inset
-
- and
-\begin_inset Formula $x_{2}$
-\end_inset
-
- to place the angle in the correct quadrant.
- The angle
-\begin_inset Formula $y$
-\end_inset
-
- is returned in the full range
-\begin_inset Formula $-\pi<y\leq\pi$
-\end_inset
-
-.
- The angle is chosen so that
-\begin_inset Formula $\sin\left(y\right)=\frac{x_{1}}{\sqrt{x_{1}^{2}+x_{2}^{2}}},$
-\end_inset
-
- and
-\begin_inset Formula $\cos\left(y\right)=\frac{x_{2}}{\sqrt{x_{1}^{2}+x_{2}^{2}}}.$
-\end_inset
-
- Particular values are showin in the following table:
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="5" columns="3">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-\begin_inset Formula $x_{1}$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-\begin_inset Formula $x_{2}$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-\begin_inset Formula $y=\textrm{arctan2}\left(x_{1},x_{2}\right)$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-0
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-1
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-0
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-1
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-0
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-\begin_inset Formula $\frac{\pi}{2}$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-0
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
--1
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-\begin_inset Formula $\pi$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
--1
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-0
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-\begin_inset Formula $-\frac{\pi}{2}$
-\end_inset
-
-
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-hypot (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "hypot"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns
-\begin_inset Formula $y=\sqrt{x_{1}^{2}+x_{2}^{2}}.$
-\end_inset
-
- Given a complex number in cartesian form, arctan2 and hypot can be used
- to compute phase and magnitude, quickly.
-\end_layout
-
-\begin_layout Description
-sinh (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "sinh"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Computes
-\begin_inset Formula $y=\sinh\left(x\right)$
-\end_inset
-
- which is defined as
-\begin_inset Formula $\frac{1}{2}\left(e^{x}-e^{-x}\right).$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-cosh (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "cosh"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Computes
-\begin_inset Formula $y=\cosh\left(x\right)$
-\end_inset
-
- which is defined as
-\begin_inset Formula $\frac{1}{2}\left(e^{x}+e^{-x}\right).$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-tanh (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "tanh"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Computes
-\begin_inset Formula $y=\tanh\left(x\right)$
-\end_inset
-
- which is defined as
-\begin_inset Formula $\left(e^{x}-e^{-x}\right)/\left(e^{x}+e^{-x}\right).$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-arcsinh (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "arcsinh"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-arccosh (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "arccosh"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-arctanh (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "arctanh"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These compute the inverse hyperpolic functions.
-
-\begin_inset Formula $y=\textrm{arc}func\left(x\right)$
-\end_inset
-
- is the (principal) value of
-\begin_inset Formula $y$
-\end_inset
-
- such that
-\begin_inset Formula $func\left(y\right)=x.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Subsection
-Bit-twiddling functions
-\end_layout
-
-\begin_layout Standard
-These function all need integer arguments and they maniuplate the bit-pattern
- of those arguments.
-\end_layout
-
-\begin_layout Description
-bitwise_and (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "bitwise\\_and"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Each bit in
-\begin_inset Formula $y$
-\end_inset
-
- is the result of a bit-wise 'and' operation on the corresponding bits in
-
-\begin_inset Formula $x_{1}$
-\end_inset
-
- and
-\begin_inset Formula $x_{2}$
-\end_inset
-
-.
- Called to implement
-\family typewriter
-x1&x2
-\family default
- for arrays.
-
-\end_layout
-
-\begin_layout Description
-bitwise_or (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "bitwise\\_or"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Each bit in
-\begin_inset Formula $y$
-\end_inset
-
- is the result of a bit-wise 'or' operation on the corresponding bits in
-
-\begin_inset Formula $x_{1}$
-\end_inset
-
- and
-\begin_inset Formula $x_{2}$
-\end_inset
-
-.
- Called to implement
-\family typewriter
-x1|x2
-\family default
- for arrays.
-\end_layout
-
-\begin_layout Description
-bitwise_xor (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "bitwise\\_xor"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Each bit in
-\begin_inset Formula $y$
-\end_inset
-
- is the result of a bit-wise 'xor' operation on the corresponding bits in
-
-\begin_inset Formula $x_{1}$
-\end_inset
-
- and
-\begin_inset Formula $x_{2}$
-\end_inset
-
-.
- An xor operation sets the output to 1 if one and only one of the input
- bits is 1.
- Called to implement
-\family typewriter
-x1^x2
-\family default
- for arrays.
- Using the bitwise_xor operation and the optional output argument you can
- swap the values of two integer arrays of equivalent types without using
- temporary arrays.
-\end_layout
-
-\begin_layout MyCode
->>> a=arange(10)
-\newline
->>> b=arange(10,20)
-\newline
->>> bitwise_xor(a,b,a); bitwise_xor(a,b,b);
-\newline
->>
-> bitwise_xor(a,b,a)
-\newline
-array([10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
-\newline
->>> print
- a; print b
-\newline
-[10 11 12 13 14 15 16 17 18 19]
-\newline
-[0 1 2 3 4 5 6 7 8 9]
-\end_layout
-
-\begin_layout Description
-invert (
-\begin_inset Formula $x$
-\end_inset
-
-, [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "invert"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Each bit in
-\begin_inset Formula $y$
-\end_inset
-
- is the opposite of the corresponding bit in
-\begin_inset Formula $x$
-\end_inset
-
-.
- Called to implement
-\family typewriter
-~x
-\family default
- for arrays.
-\end_layout
-
-\begin_layout Description
-left_shift (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "left\\_shift"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Shifts the bits of
-\begin_inset Formula $x_{1}$
-\end_inset
-
- to the left by
-\begin_inset Formula $x_{2}$
-\end_inset
-
-.
- Called to implement
-\family typewriter
-x1<<x2
-\family default
- for arrays.
- Provided there is no overflow, the result is equal to
-\begin_inset Formula $y=x_{1}2^{x_{2}}.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-right_shift (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "right\\_shift"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Shifts the bits of
-\begin_inset Formula $x_{1}$
-\end_inset
-
- to the right by
-\begin_inset Formula $x_{2}$
-\end_inset
-
-.
- Called to implement
-\family typewriter
-x1>>x2
-\family default
- for arrays.
- Absent overflow, the result is equal to
-\begin_inset Formula $y=x_{1}2^{-x_{2}}$
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Subsection
-Comparison functions
-\end_layout
-
-\begin_layout Standard
-All of these functions (except maximum, minimum, and sign) return Boolean
- arrays.
-
-\end_layout
-
-\begin_layout Description
-greater (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "greater"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-greater_equal (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "greater\\_equal"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-less (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "less"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-less_equal (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "less\\_equal"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-not_equal (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "not\\_equal"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-equal (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "equal"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These functions are called to implement
-\family typewriter
-x1>x2
-\family default
-,
-\family typewriter
-x1>=x2
-\family default
-,
-\family typewriter
-x1<x2
-\family default
-,
-\family typewriter
-x1<=x2
-\family default
-,
-\family typewriter
-x1!=x2
-\family default
- (or
-\family typewriter
-x1<>x2
-\family default
-), and
-\family typewriter
-x1==x2
-\family default
-, respectively, for arrays.
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The fact that these functions return Boolean arrays make them very useful
- in combination with advanced array indexing.
- Thus, for example, arr[arr>10] = 10 clips large values to 10.
- Used in conjunction with bitwise operators quite complicated expressions
- are possible.
- For example, arr[~((arr<10)&(arr>5))] = 0 clips all values outside of the
- range
-\begin_inset Formula $\left(5,10\right)$
-\end_inset
-
- to 0.
-
-\end_layout
-
-\begin_layout Warning
-Do not use the Python keywords
-\family typewriter
-and
-\family default
- and
-\family typewriter
-or
-\family default
- to combine logical array expressions.
- These keywords will test the truth value of the entire array (not element-by-el
-ement as you might expect).
- Use the bitwise operators: & and | instead.
-\end_layout
-
-\begin_layout Description
-logical_and (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "logical\\_and"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The output is the truth value of
-\begin_inset Formula $x_{1}$
-\end_inset
-
-
-\series bold
-and
-\series default
-
-\begin_inset Formula $x_{2}$
-\end_inset
-
-.
- Numbers equal to 0 are considered False.
- Nonzero numbers are True.
-\end_layout
-
-\begin_layout Description
-logical_or (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "logical\\_or"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The output,
-\begin_inset Formula $y$
-\end_inset
-
-, is the truth value of
-\begin_inset Formula $x_{1}$
-\end_inset
-
-
-\series bold
-or
-\begin_inset Formula $x_{2}$
-\end_inset
-
-
-\series default
- .
-\end_layout
-
-\begin_layout Description
-logical_xor (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "logical\\_xor"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The output,
-\begin_inset Formula $y$
-\end_inset
-
-, is the truth value of
-\begin_inset Formula $x_{1}$
-\end_inset
-
-
-\series bold
-xor
-\begin_inset Formula $x_{2}$
-\end_inset
-
-
-\series default
-, which is the same as (
-\begin_inset Formula $x_{1}$
-\end_inset
-
- and not
-\begin_inset Formula $x_{2}$
-\end_inset
-
-) or (not
-\begin_inset Formula $x_{1}$
-\end_inset
-
- and
-\begin_inset Formula $x_{2}$
-\end_inset
-
-).
-\end_layout
-
-\begin_layout Description
-logical_not (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "logical\\_not"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The output,
-\begin_inset Formula $y$
-\end_inset
-
- is the truth value of
-\series bold
-not
-\series default
-
-\begin_inset Formula $x$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Warning
-The Bitwise operators (& and |) are the proper way to combine element-by-element
- array comparisons.
- Be sure to understand the operator precedence: (a>2) & (a<5) is the proper
- syntax because a>2 & a<5 will result in an error due to the fact that 2
- & a is evaluated first.
-\end_layout
-
-\begin_layout Description
-maximum (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "maximum"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The output,
-\begin_inset Formula $y$
-\end_inset
-
-, is the larger of
-\begin_inset Formula $x_{1}$
-\end_inset
-
- and
-\begin_inset Formula $x_{2}$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout MyCode
->>> maximum([1,0,5,10],[3,2,4,5])
-\newline
-array([ 3, 2, 5, 10])
-\newline
->>> max([1,0,5,10],[3,2,
-4,5])
-\newline
-[3, 2, 4, 5]
-\end_layout
-
-\begin_layout Tip
-The Python function max() will find the maximum over a one-dimensional array,
- but it will do so using a slower sequence interface.
- The reduce method of the maximum ufunc is much faster.
- Also, the max() method will not give answers you might expect for arrays
- with greater than one dimension.
- The reduce method of minimum also allows you to compute a total minimum
- over an array.
-\end_layout
-
-\begin_layout Description
-minimum (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "minimum"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The output,
-\begin_inset Formula $y$
-\end_inset
-
-, is the smaller of
-\begin_inset Formula $x_{1}$
-\end_inset
-
- and
-\begin_inset Formula $x_{2}$
-\end_inset
-
-.
-\end_layout
-
-\begin_layout MyCode
->>> minimum([1,0,5,10],[3,2,4,5])
-\newline
-array([1, 0, 4, 5])
-\newline
->>> min([1,0,5,10],[3,2,4,5]
-)
-\newline
-[1, 0, 5, 10]
-\end_layout
-
-\begin_layout Warning
-the behavior of maximum(a,b) is than that of max(a,b).
- As a ufunc, maximum(a,b) performs an element-by-element comparison of a
- and b and chooses each element of the result according to which element
- in the two arrays is larger.
- In contrast, max(a,b) treats the objects a and b as a whole, looks at the
- (total) truth value of a>b and uses it to return either a or b (as a whole).
- A similar difference exists between minimum(a,b) and min(a,b).
-
-\end_layout
-
-\begin_layout Subsection
-Floating functions
-\end_layout
-
-\begin_layout Standard
-Recall that all of these functions work element-by-element over an array,
- returning an array output.
- The description details only a single operation.
-\end_layout
-
-\begin_layout Description
-isreal (
-\begin_inset Formula $x$
-\end_inset
-
-)
-\begin_inset LatexCommand index
-name "isreal"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True if
-\begin_inset Formula $x$
-\end_inset
-
- has an imaginary part that is 0.
-\end_layout
-
-\begin_layout Description
-iscomplex (
-\begin_inset Formula $x$
-\end_inset
-
-)
-\begin_inset LatexCommand index
-name "iscomplex"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True if
-\begin_inset Formula $x$
-\end_inset
-
- has an imaginary part that is non-zero.
-
-\end_layout
-
-\begin_layout Description
-isfinite (
-\begin_inset Formula $x$
-\end_inset
-
-)
-\begin_inset LatexCommand index
-name "isfinite"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True if
-\begin_inset Formula $x$
-\end_inset
-
- is a finite floating point number (not a NaN or an Inf).
-
-\end_layout
-
-\begin_layout Description
-isinf (
-\begin_inset Formula $x$
-\end_inset
-
-)
-\begin_inset LatexCommand index
-name "isinf"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True if
-\begin_inset Formula $x$
-\end_inset
-
- is
-\begin_inset Formula $\pm\infty$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Description
-isnan (
-\begin_inset Formula $x$
-\end_inset
-
-)
-\begin_inset LatexCommand index
-name "isnan"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True if
-\begin_inset Formula $x$
-\end_inset
-
- is Not-a-Number.
- This represents invalid results.
- When a NaN is created, the invalid flag is set.
- If you set the error mode of invalid to 'warn', 'raise', or 'call', then
- the appropriate action will be performed on NaN creation.
-
-\end_layout
-
-\begin_layout Description
-signbit (
-\begin_inset Formula $x$
-\end_inset
-
-)
-\begin_inset LatexCommand index
-name "signbit"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True where the sign bit of the floating point number is set.
- This should correspond to
-\begin_inset Formula $x>0$
-\end_inset
-
- when
-\begin_inset Formula $x$
-\end_inset
-
- is a finite number.
- When,
-\begin_inset Formula $x$
-\end_inset
-
- is NaN or infinite, then this tests the actual signbit.
-
-\end_layout
-
-\begin_layout Description
-modf (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y_{1}$
-\end_inset
-
-,
-\begin_inset Formula $y_{2}$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "modf"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Breaks up the floating point value
-\begin_inset Formula $x$
-\end_inset
-
- into its fractional,
-\begin_inset Formula $y_{1}$
-\end_inset
-
-, and integral,
-\begin_inset Formula $y_{2}$
-\end_inset
-
-, parts.
- Thus,
-\begin_inset Formula $x=y_{1}+y_{2}$
-\end_inset
-
- with
-\family typewriter
-floor(y2)==y2
-\family default
-.
-
-\end_layout
-
-\begin_layout Description
-ldexp (
-\begin_inset Formula $x$
-\end_inset
-
-,
-\begin_inset Formula $n$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "ldexp"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Fast multiply of a floating point number by an integral power of 2:
-\begin_inset Formula $y=2^{n}x.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-frexp (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-,
-\begin_inset Formula $n$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "frexp"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Breaks up the floating point value
-\begin_inset Formula $x$
-\end_inset
-
- into a normalized fraction,
-\begin_inset Formula $y$
-\end_inset
-
- and an exponent,
-\begin_inset Formula $n$
-\end_inset
-
- which corresponds to how the value is represented in the computer.
- The results are such that
-\begin_inset Formula $x=y2^{n}.$
-\end_inset
-
- Effectively, the inverse of ldexp.
-
-\end_layout
-
-\begin_layout Description
-fmod (
-\begin_inset Formula $x_{1}$
-\end_inset
-
-,
-\begin_inset Formula $x_{2}$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
-])
-\begin_inset LatexCommand index
-name "fmod"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Computes the remainder of dividing
-\begin_inset Formula $x_{1}$
-\end_inset
-
- by
-\begin_inset Formula $x_{2}$
-\end_inset
-
-.
- The result,
-\begin_inset Formula $y$
-\end_inset
-
-, is
-\begin_inset Formula $x_{1}-nx_{2}$
-\end_inset
-
- where
-\begin_inset Formula $n$
-\end_inset
-
- is the quotient (rounded towards zero to an integer) of
-\begin_inset Formula $x_{1}/x_{2}.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-floor (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
- ])
-\begin_inset LatexCommand index
-name "floor"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return
-\begin_inset Formula $y=\left\lfloor x\right\rfloor $
-\end_inset
-
- where
-\begin_inset Formula $y$
-\end_inset
-
- is the nearest integer smaller-than or equal to
-\begin_inset Formula $x.$
-\end_inset
-
- Thus,
-\begin_inset Formula $ $
-\end_inset
-
-
-\begin_inset Formula $\left\lfloor x\right\rfloor \leq x<\left\lfloor x\right\rfloor +1$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Description
-ceil (
-\begin_inset Formula $x$
-\end_inset
-
- [,
-\begin_inset Formula $y$
-\end_inset
-
- ])
-\begin_inset LatexCommand index
-name "ceil"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return
-\begin_inset Formula $y=\left\lceil x\right\rceil $
-\end_inset
-
- where
-\begin_inset Formula $y$
-\end_inset
-
- is the nearest integer greater-than or equal to
-\begin_inset Formula $x$
-\end_inset
-
-.
- Thus,
-\begin_inset Formula $x\leq\left\lceil x\right\rceil <x+1.$
-\end_inset
-
-
-\begin_inset LatexCommand index
-name "ufunc|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Chapter
-Basic Modules
-\end_layout
-
-\begin_layout Quotation
-It is the mark of an educated mind to rest satisfied with the degree of
- precision which the nature of the subject admits and not to seek exactness
- where only an approximation is possible.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Aristotle
-\end_layout
-
-\begin_layout Quotation
-"Oh no.
- We're in the hands of engineers!"
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Malcolm, Ian in 'Jurassic Park'
-\end_layout
-
-\begin_layout Standard
-The NumPy distribution contains some basic functionality equivalent to what
- was available in the Numeric packages previously.
- This section documents the new interfaces.
- These are sub-packages of the NumPy namespace.
- The linalg and fft capabilities are useful but limited.
- You should install the full SciPy package to access more functionality.
- The numpy.dual module contains functions that are defined in both SciPy
- and NumPy.
- If SciPy defines func, then numpy.dual.func will point to the SciPy version,
- otherwise it will point to the NumPy version.
- It must be imported specifically to be used.
- Table
-\begin_inset LatexCommand ref
-reference "cap:Functions-in-numpy.dual"
-
-\end_inset
-
- shows the functions defined in numpy.dual that are in both NumPy and SciPy.
-\end_layout
-
-\begin_layout Standard
-\begin_inset Float table
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "cap:Functions-in-numpy.dual"
-
-\end_inset
-
-Functions in numpy.dual (both in NumPy and SciPy)
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="4" columns="2">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="middle" leftline="true" rightline="true" width="55text%">
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Family
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Functions
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Fourier Transforms
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-fft, ifft, fft2, ifft2, fftn, ifftn
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Linear Algebra
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-norm, det, inv, pinv, solve, eig, eigh, eigvals, eigvalsh, lstsq, cholesky,
- svd
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-Special Functions
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-i0
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Linear Algebra (
-\family typewriter
-linalg
-\family default
-)
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "linalg|("
-
-\end_inset
-
-These functions are in the numpy.linalg sub-package.
-\end_layout
-
-\begin_layout Description
-inv (A)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the (matrix) inverse of the 2-d array A.
- The result, X, is such that dot(A,X) is equal to eye(*A.shape) (to within
- machine precision).
-
-\end_layout
-
-\begin_layout Description
-solve (A,b)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Find the solution to the linear equation
-\begin_inset Formula $\mathbf{Ax}=\mathbf{b}$
-\end_inset
-
-, where
-\begin_inset Formula $A$
-\end_inset
-
- is a 2-d array and
-\begin_inset Formula $b$
-\end_inset
-
- is a 1-d or 2-d array.
-
-\end_layout
-
-\begin_layout Description
-tensorsolve (A, b, axes=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Find the solution,
-\begin_inset Formula $x_{kl}$
-\end_inset
-
-, to the multi-index linear equation
-\begin_inset Formula \[
-\sum_{kl}A_{ijkl}x_{kl}=b_{ij}.\]
-
-\end_inset
-
- The axes argument specifies which dimensions of
-\begin_inset Formula $A$
-\end_inset
-
- are summed over.
- If it is None, then the last A.ndim - b.ndim dimensions are summed over.
- The result, therefore, has dimension x.ndim = A.ndim-b.ndim.
-
-\end_layout
-
-\begin_layout Description
-tensorinv (A, ind=2)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Find the tensor inverse of
-\begin_inset Formula $A$
-\end_inset
-
-, defined to be the tensor such that tensordot (Ainv, A) is an identity
- operator.
-
-\end_layout
-
-\begin_layout Description
-cholesky (A)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return,
-\begin_inset Formula $\mathbf{L}$
-\end_inset
-
-, the Cholesky decomposition of
-\begin_inset Formula $\mathbf{A}$
-\end_inset
-
-.
- Cholesky decomposition is applicable to a Hermitian, positive definite
- matrices.
- When
-\begin_inset Formula $\mathbf{A}=\mathbf{A}^{H}$
-\end_inset
-
- and
-\begin_inset Formula $\mathbf{x}^{H}\mathbf{Ax}\geq0$
-\end_inset
-
- for all
-\begin_inset Formula $\mathbf{x}$
-\end_inset
-
-, then decompositions of
-\begin_inset Formula $\mathbf{A}$
-\end_inset
-
- can be found so that
-\begin_inset Formula $\mathbf{A}=\mathbf{LL}^{H}$
-\end_inset
-
-, where
-\begin_inset Formula $\mathbf{L}$
-\end_inset
-
- is lower-triangular.
-
-\end_layout
-
-\begin_layout Description
-eigvals (A)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return all solutions (
-\begin_inset Formula $\lambda$
-\end_inset
-
-) to the equation
-\begin_inset Formula $\mathbf{Ax}=\lambda\mathbf{x}$
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Description
-eig (A)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return all solutions
-\begin_inset Formula $\left(\lambda,\mathbf{x}\right)$
-\end_inset
-
- to the equation
-\begin_inset Formula $\mathbf{Ax}=\lambda\mathbf{x}$
-\end_inset
-
-.
- The first element of the return tuple contains all the eigenvalues.
- The second element of the return tuple contains the eigenvectors in the
- columns (x[:,i] is the ith eigenvector).
-\end_layout
-
-\begin_layout Description
-eigvalsh (U)
-\end_layout
-
-\begin_layout Description
-eigh (U)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- These functions are identical to eigvals and eig except they only work
- with Hermitian matrices where
-\begin_inset Formula $\mathbf{U}^{H}=\mathbf{U}$
-\end_inset
-
- (only the lower-triangular part of the array is used).
-\end_layout
-
-\begin_layout Description
-svd (A)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the singular value decomposition of the 2-d array
-\begin_inset Formula $\mathbf{A}$
-\end_inset
-
-.
- Every
-\begin_inset Formula $m\times n$
-\end_inset
-
- matrix can be decomposed into a pair of unitary matrices,
-\begin_inset Formula $\mathbf{U}=\mathbf{U}^{H}$
-\end_inset
-
- (
-\begin_inset Formula $m\times m$
-\end_inset
-
-) and
-\begin_inset Formula $\mathbf{V}=\mathbf{V}^{H}$
-\end_inset
-
- (
-\begin_inset Formula $n\times n$
-\end_inset
-
-) and an
-\begin_inset Formula $m\times n$
-\end_inset
-
-
-\begin_inset Quotes eld
-\end_inset
-
-diagonal
-\begin_inset Quotes erd
-\end_inset
-
- matrix
-\begin_inset Formula $\boldsymbol{\Sigma}$
-\end_inset
-
-, such that
-\begin_inset Formula $\mathbf{A}=\mathbf{U\boldsymbol{\Sigma}}\mathbf{V}^{H}$
-\end_inset
-
-.
- The only non-zero portion of
-\begin_inset Formula $\boldsymbol{\Sigma}$
-\end_inset
-
- is the upper
-\begin_inset Formula $r\times r$
-\end_inset
-
- block where
-\begin_inset Formula $r=\min\left(m,n\right)$
-\end_inset
-
-.
- The svd function returns three arrays as a tuple: (
-\begin_inset Formula $\mathbf{U}$
-\end_inset
-
-,
-\begin_inset Formula $\boldsymbol{\sigma}$
-\end_inset
-
-,
-\begin_inset Formula $\mathbf{V}^{H}$
-\end_inset
-
-).
- The singular values are returned in the 1-d array
-\begin_inset Formula $\boldsymbol{\sigma}$
-\end_inset
-
-.
- If needed, the array
-\begin_inset Formula $\boldsymbol{\Sigma}$
-\end_inset
-
- can be found (if really needed) using the command diag(
-\begin_inset Formula $\boldsymbol{\sigma}$
-\end_inset
-
-) which creates the
-\begin_inset Formula $r\times r$
-\end_inset
-
- diagonal block and then inserting this into a zeros matrix:
-\end_layout
-
-\begin_layout MyCode
->>> A = random.rand(3,5)
-\newline
->>> from numpy.dual import svd; U,s,Vh = svd(A)
-\newline
->>>
- r=min(*A.shape); Sig = zeros_like(A);
-\newline
->>> Sig[:r,:r] = diag(s); print Sig
-\newline
-[[
- 2.1634 0.
- 0.
- 0.
- 0.
- ]
-\newline
- [ 0.
- 0.7076 0.
- 0.
- 0.
- ]
-\newline
- [ 0.
- 0.
- 0.2098 0.
- 0.
- ]]
-\end_layout
-
-\begin_layout Description
-pinv (A, rcond=
-\begin_inset Formula $10^{-10}$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the generalized, pseudo inverse, of
-\begin_inset Formula $A$
-\end_inset
-
-.
- For invertible matrices, this is the same as the inverse.
-
-\end_layout
-
-\begin_layout Description
-det (A)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the determinant of the array.
- The determinant of an array is the product of its singular values.
-
-\end_layout
-
-\begin_layout Description
-lstsq (A, b, rcond=
-\begin_inset Formula $10^{-10}$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return (x, resids, rank, s) where x minimizes resids=
-\begin_inset Formula $\left\Vert \mathbf{Ax}-\mathbf{b}\right\Vert _{2}$
-\end_inset
-
-.
- The output rank is the rank of A and s is the singular values of a in descendin
-g order.
- Singular values less than s[0]*rcond are treated as 0.
- If the rank of A is less than the number of columns of A or greater than
- the number of rows, resids will be returned as an empty array.
-\begin_inset LatexCommand index
-name "linalg|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Discrete Fourier Transforms (
-\family typewriter
-fft
-\family default
-)
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "fft|("
-
-\end_inset
-
-All of the algorithms here are most efficient if the length of the data
- is a power of 2 (or decomposable into low prime factors).
-
-\end_layout
-
-\begin_layout Description
-fft (x, n=None, axis=-1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return, X, the N-point Discrete Fourier Transform (DFT) of x along the
- given axis using a fast algorithm.
- If N is larger than x.shape[axis], then x will be zero-padded.
- If N is smaller than x.shape[axis], then the first N items will be used.
- The result is computed for
-\begin_inset Formula $k=0\ldots n-1$
-\end_inset
-
- from the formula:
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-X\left[k\right]=\sum_{m=0}^{n-1}x[m]\exp\left(-j\frac{2\pi km}{n}\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Tip
-The fft returns values for
-\begin_inset Formula $k=0\ldots N-1$
-\end_inset
-
-.
- Because
-\begin_inset Formula $X\left[N-k\right]=X[-k]$
-\end_inset
-
- in the FFT formula, larger values of k correspond also to negative frequencies.
-\end_layout
-
-\begin_layout Description
-ifft (X, n=None, axis=-1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the inverse of the fft so that (ifft(fft(a)) == a within numerical
- precision.
- The order of frequencies must be the same as returned by fft.
- The result is computed (using a fast algorithm) for
-\begin_inset Formula $m=0\ldots n-1$
-\end_inset
-
- from the formula:
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-x\left[m\right]=\frac{1}{n}\sum_{k=0}^{n-1}X\left[k\right]\exp\left(j\frac{2\pi km}{n}\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Sometimes having the
-\begin_inset Quotes eld
-\end_inset
-
-negative
-\begin_inset Quotes erd
-\end_inset
-
- frequencies at the end of the output returned by fft can be a little confusing.
- There are two ways to deal with this confusion.
- In my opinion, the most useful way is to get a collection of DFT sample
- frequencies and use them to keep track of where each frequency is.
- The function
-\family typewriter
-fftfreq
-\family default
- provides these sample frequencies.
- Making an x-y plot, where the sample frequencies are along the
-\begin_inset Quotes eld
-\end_inset
-
-x
-\begin_inset Quotes erd
-\end_inset
-
--axis and the result of the DFT is along the
-\begin_inset Quotes eld
-\end_inset
-
-y
-\begin_inset Quotes erd
-\end_inset
-
--axis provides a useful visualization with the zero-frequency at the center
- of the plot.
- The advantage of this approach is that your data is still in proper order
- for using the
-\family typewriter
-ifft
-\family default
- function.
- Some people, however, prefer to simply swap one-half of the output with
- the other.
- This is exactly what the function
-\family typewriter
-fftshift
-\family default
- does.
- Of course, now the data is not in the proper order for the ifft function,
- but to each his own.
-
-\end_layout
-
-\begin_layout Standard
-The reason that the
-\begin_inset Quotes eld
-\end_inset
-
-negative
-\begin_inset Quotes erd
-\end_inset
-
- frequencies are in the upper part of the return signal was given in the
- description of the DFT.
- The reason is that the output of the DFT is just one period of a periodic
- function (with period
-\begin_inset Formula $n$
-\end_inset
-
-).
- The traditional output of the FFT algorithm is to provide the portion of
- the function from from
-\begin_inset Formula $k=0$
-\end_inset
-
- to
-\begin_inset Formula $k=n-1$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Description
-fftshift (x, axes=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Shift zero-frequency component to the center of the spectrum.
- This function swaps half-spaces for all axes listed (defaults to all of
- them).
-
-\end_layout
-
-\begin_layout Description
-ifftshift (x, axes=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Reverse the effect of the fftshift operation.
- Thus, it takes zero-centered data and shifts it into the correct order
- for the ifft operation.
-\end_layout
-
-\begin_layout Description
-fftfreq (n, d=1.0)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Provide the DFT sample frequencies.
- The returned float array contains the frequency bins in the order returned
- from the fft function.
- If given,
-\begin_inset Formula $d$
-\end_inset
-
- represents the sample-spacing.
- The units on the frequency bins are cycles / unit.
- For example, the following example computes the output frequencies (in
- Hz) of the fft of
-\begin_inset Formula $256$
-\end_inset
-
- samples of a voice signal sampled at 20000Hz.
-\end_layout
-
-\begin_layout MyCode
->>> from numpy.fft import fftfreq; f=fftfreq(256,d=1./20e3)
-\newline
->>> print f[0],
- f[1], f[2], f[128]
-\newline
-0.0 78.125 156.25 -10000.0
-\end_layout
-
-\begin_layout Description
-fft2 (x, s=None, axes=(-2,-1))
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the two-dimensional fft of the array x for each 2-d array formed
- by axes.
- The 2-d fft is computed as
-\begin_inset Formula \[
-X\left[k_{0},k_{1}\right]=\sum_{m_{0}=0}^{s[0]-1}\sum_{m_{1}=0}^{s[1]-1}x\left[m_{0},m_{1}\right]\exp\left(-j\frac{2\pi k_{0}m_{0}}{s[0]}\right)\exp\left[-j\frac{2\pi k_{1}m_{1}}{s\left[1\right]}\right]\]
-
-\end_inset
-
- and can be realized by repeated application of the 1-d fft (first over
- the axes[0] and then over axes[1]).
- In other-words fft2(x,s,axes) is equivalent to fft(fft(x, s[0], axes[0]),
- s[1], axes[1]).
- The 2-d fft is returned for
-\begin_inset Formula $k_{0}=0\ldots s[0]-1$
-\end_inset
-
- and
-\begin_inset Formula $k_{1}=0\ldots s[1]-1.$
-\end_inset
-
- Symmetry (
-\begin_inset Formula $X\left[s[0]-k_{0},s[1]-k_{1}\right]=X[-k_{0},-k_{1}]$
-\end_inset
-
-) ensures that higher values of
-\begin_inset Formula $k_{i}$
-\end_inset
-
- correspond to negative frequencies.
-
-\end_layout
-
-\begin_layout Description
-ifft2 (X, s=None, axes=(-2,-1))
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the inverse of the two-dimension fft.
- Thus, ifft2(fft2(x)) == x to within numerical precision.
- Note that the
-\begin_inset Quotes eld
-\end_inset
-
-negative frequencies
-\begin_inset Quotes erd
-\end_inset
-
- must be
-\end_layout
-
-\begin_layout Description
-fftn (x, s=None, axes=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the
-\begin_inset Formula $N$
-\end_inset
-
--dimensional fft of x.
- If s is not given, then if axes is given, then
-\begin_inset Formula $N$
-\end_inset
-
-=len(axes), otherwise
-\begin_inset Formula $N$
-\end_inset
-
-=x.ndim.
- If s is given, then
-\begin_inset Formula $N$
-\end_inset
-
-=len(s).
- Results are computed using a similar formula as for the 1- and 2-d FFT
- with
-\begin_inset Formula $N$
-\end_inset
-
- summations.
-
-\end_layout
-
-\begin_layout Description
-ifftn (X, s=None, axes=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the
-\begin_inset Formula $N$
-\end_inset
-
--dimensional inverse fft of
-\begin_inset Formula $X$
-\end_inset
-
-.
- Note that ifftn(fftn(x)) == x to within machine precision.
-
-\end_layout
-
-\begin_layout Standard
-The Discrete Fourier transform returns complex-valued data (even for real-valued
- input).
- If the data was originally real-valued, then much of the output of the
- full DFT is redundant.
- Notice that if
-\begin_inset Formula $x\left[m\right]$
-\end_inset
-
- is real, then
-\begin_inset Formula \begin{eqnarray*}
-X\left[n-k\right] & = & \sum_{m=0}^{n-1}x[m]\exp\left(-j\frac{2\pi\left(n-k\right)m}{n}\right)\\
- & = & \left[\sum_{m=0}^{n-1}x\left[m\right]\exp\left(-j\frac{2\pi km}{n}\right)\right]^{*}\\
- & = & X^{*}\left[k\right],\end{eqnarray*}
-
-\end_inset
-
-where
-\begin_inset Formula $a^{*}$
-\end_inset
-
- denotes the complex-conjugate of
-\begin_inset Formula $a$
-\end_inset
-
-.
- So, the upper half of the fft output (the negative frequencies) is determined
- exactly by the lower half of the output when the input is purely real.
- This kind of symmetry is called Hermitian symmetry.
- The real-valued Fourier transforms described next take advantage of Hermitian
- symmetry to compute only the unique outputs more quickly.
-
-\end_layout
-
-\begin_layout Standard
-The symmetry in higher dimensions is always about the origin.
- If
-\begin_inset Formula $N$
-\end_inset
-
- is the number of dimensions, then:
-\begin_inset Formula \[
-X[n_{1}-k_{1},n_{2}-k_{2},\ldots n_{N}-k_{N}]=X^{*}\left[k_{1},k_{2},\ldots,k_{N}\right].\]
-
-\end_inset
-
-Thus, the data-savings remains constant at about 1/2 for higher dimensions
- as well.
-
-\end_layout
-
-\begin_layout Description
-rfft (x, n=None, axis=-1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the first n//2+1 points of the
-\begin_inset Formula $n$
-\end_inset
-
--point discrete Fourier transform of the real valued data along the given
- axis.
- The returned array will be just the first half of the
-\family typewriter
-fft
-\family default
-, corresponding to positive frequencies: rfft(x) == fft(x)[:n//2+1]
-\end_layout
-
-\begin_layout Description
-irfft (X, n=None, axis=-1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the inverse
-\begin_inset Formula $n$
-\end_inset
-
--point discrete Fourier transform along the given axis using the first n//2+1
- points.
- To within numerical precision, irfft(rfft(x))==x.
-
-\end_layout
-
-\begin_layout Description
-rfft2 (x, s=None, axes=(-2, -1))
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute only the first half-plane of the two-dimensional discrete Fourier
- transform corresponding to unique values.
- s[0] and
-\begin_inset Formula $s[1]$
-\end_inset
-
--point DFTs will be computed along axes[0] and axes[1] dimensions, respectively.
- Requires a real array.
- If
-\begin_inset Formula $s$
-\end_inset
-
- is None it defaults to the shape of
-\begin_inset Formula $x.$
-\end_inset
-
- The real fft will be computed along the last axis specified in axes while
- a full fft will be computed in the other dimension.
-\end_layout
-
-\begin_layout Description
-irfft2 (X, s=None, axes=(-2, -1))
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the inverse of the 2-d DFT using only the first quadrant.
- Returns a real array such that to within numerical precision irfft2(rfft2(x))==
-x.
-\end_layout
-
-\begin_layout Description
-rfftn (x, s=None, axes=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute only the unique part of the
-\begin_inset Formula $N$
-\end_inset
-
--dimensional DFT from a real-valued array.
- If
-\begin_inset Formula $s$
-\end_inset
-
- is None it defaults to the shape of x.
- If axes is not given it defaults to all the axes (-n,
-\begin_inset Formula $\ldots$
-\end_inset
-
-, -1).
- The length of axes provides the dimensionality of the DFT.
- The unique part of the real
-\begin_inset Formula $N$
-\end_inset
-
--dimensional DFT is obtained by slicing the full fft along the last axis
- specified and taking n//2+1 slices.
- rfftn(x) == fft(x)[sliceobj] where sliceobj[axes[-1]] = slice(None,s[-1]//2+1,N
-one).
-\end_layout
-
-\begin_layout Description
-irfftn (X, s=None, axes=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Compute the inverse DFT from the unique portions of the N-dimensional DFT
- provided by
-\family typewriter
-rfftn
-\family default
-.
-\end_layout
-
-\begin_layout Standard
-Occasionally, the situation may arise where you have complex-valued data
- with Hermitian symmetry (or real-valued symmetric data).
- This ensures that the Fourier transform will be real.
- The two functions below can calculate it without wasting extra space for
- the zero-valued imaginary entries of the Discrete Fourier transform, or
- the entire signal.
-\end_layout
-
-\begin_layout Description
-hfft (x, n=None, axis=-1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Calculate the
-\begin_inset Formula $n$
-\end_inset
-
--point real-valued Fourier transform from (the first half of Hermitian-symmetric
- data, x.
-
-\end_layout
-
-\begin_layout Description
-ihfft (X, n=None, axis=-1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return (the first half-of) Hermitian-symmetric data from the real-valued
- Fourier transform, X.
-\begin_inset LatexCommand index
-name "fft|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Random Numbers (
-\family typewriter
-random
-\family default
-)
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "random|("
-
-\end_inset
-
-The random number capabilities surpass those that were available in Numeric.
- The random number facilities were generously contributed by Robert Kern,
- who has been a dedicated and patient help to many mailing list questioners.
- Robert built the random package using Pyrex to build on top of his own
- code as well as that of randomkit by Jean-Sebastien Roy as well as code
- by Ivan Frohne.
- The fundamental random number generator is the Mersenne Twister based on
- code written by Makoto Matsumoto and Takuji Nishimura (and modified for
- Python by Raymond Hettinger).
- Random numbers from discrete and continuous distributions are available,
- as well as some useful random-number-related utilities.
- Many of the random number generators are based on algorithms published
- by Luc Devroye in
-\begin_inset Quotes eld
-\end_inset
-
-Non-Uniform Random Variate Generation
-\begin_inset Quotes erd
-\end_inset
-
- available electronically at
-\begin_inset LatexCommand htmlurl
-target "http://cgm.cs.mcgill.ca/~luc/rnbookindex.html"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Each of the discrete and continuous random number generators take a size
- keyword.
- If this is None (default), then the size is determined from the additional
- inputs (using ufunc-like broadcasting).
- If no additional inputs are needed, or if these additional inputs are scalars,
- then a single number is generated from the selected distribution.
- If size is an integer, then a 1-d array of that size is generated filled
- with random numbers from the selected distribution.
- Finally, if size is a tuple, then an array of that shape is returned filled
- with random numbers.
-
-\end_layout
-
-\begin_layout Standard
-Many distributions take additional inputs as parameters.
- These additional inputs must be broadcastable to each other (and to the
- size parameter if it is not None).
- The broadcasting behavior of the additional inputs is ufunc-like.
-
-\end_layout
-
-\begin_layout Subsection
-Discrete Distributions
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "random!discrete|("
-
-\end_inset
-
-Discrete random numbers take on only a countable number of values (typically
- integers).
- Each distribution has associated with it a probability mass function (pmf),
-
-\begin_inset Formula $p_{m}\left(k;\cdot\right),$
-\end_inset
-
- that is defined as the probability that the returned random number is
-\begin_inset Formula $k$
-\end_inset
-
-.
- The arguments after
-\begin_inset Formula $k$
-\end_inset
-
- represent possible parameters to the distribution.
- Thus, let
-\begin_inset Formula $X\left(\cdot\right)$
-\end_inset
-
- represent the random number generator for a particular distribution.
- Then,
-\begin_inset Formula \[
-p_{m}\left(k;\cdot\right)=\textrm{Probability}\left\{ X\left(\cdot\right)=k\right\} .\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-It will be useful to define the discrete indicator function,
-\begin_inset Formula $I_{S}\left(k\right),$
-\end_inset
-
- where
-\begin_inset Formula $S$
-\end_inset
-
- is a set of integers (often represented by an interval).
-
-\begin_inset Formula $I_{S}\left(k\right)=1$
-\end_inset
-
- if
-\begin_inset Formula $k\in S$
-\end_inset
-
-, otherwise
-\begin_inset Formula $I_{S}\left(k\right)=0.$
-\end_inset
-
- This convenient notation isolates the relevance of a particular functional
- form to a certain range.
- Also, the formulas below make use of the following definition:
-\begin_inset Formula \[
-\left(\begin{array}{c}
-n\\
-k\end{array}\right)=\frac{n!}{k!\left(n-k\right)!}\]
-
-\end_inset
-
- where
-\begin_inset Formula $k!=k\cdot\left(k-1\right)\cdot\cdots\cdot2\cdot1.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-binomial (n, p, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This random number models the number of successes in
-\begin_inset Formula $n$
-\end_inset
-
- independent trials of a random experiment where the probability of success
- in each experiment is
-\begin_inset Formula $p$
-\end_inset
-
-.
-
-\begin_inset Formula \[
-p_{m}\left(k\right)=\left(\begin{array}{c}
-n\\
-k\end{array}\right)p^{k}\left(1-p\right)^{n-k}I_{\left[0,n\right]}\left(k\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-geometric (p, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This random number models the number of (independent) attempts required
- to obtain a success where the probability of success on each attempt is
-
-\begin_inset Formula $p$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-p_{m}\left(k;p\right)=\left(1-p\right)^{k-1}p\, I_{\left[1,\infty\right)}\left(k\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-hypergeometric (ngood, nbad, nsample, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Imagine a probability theorists favorite urn filled with
-\begin_inset Formula $n_{g}$
-\end_inset
-
-
-\begin_inset Quotes eld
-\end_inset
-
-good
-\begin_inset Quotes erd
-\end_inset
-
- objects and
-\begin_inset Formula $n_{b}$
-\end_inset
-
-
-\begin_inset Quotes eld
-\end_inset
-
-bad
-\begin_inset Quotes erd
-\end_inset
-
- objects.
- In other words there are two types of objects in a jar.
- The hypergeometric random number models how many
-\begin_inset Quotes eld
-\end_inset
-
-good
-\begin_inset Quotes erd
-\end_inset
-
- objects will be present when
-\begin_inset Formula $N$
-\end_inset
-
- items are taken out of the urn without replacement.
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-p\left(k;n_{g},n_{b},N\right)=\frac{\left(\begin{array}{c}
-n_{g}\\
-k\end{array}\right)\left(\begin{array}{c}
-n_{b}\\
-N-k\end{array}\right)}{\left(\begin{array}{c}
-n_{g}+n_{b}\\
-N\end{array}\right)}I_{\left[N-n_{b},\textrm{min}\left(n,N\right)\right]}\left(k\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-logseries (p, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A random number whose pmf with terms proportional to the Taylor series
- expansion of
-\begin_inset Formula $\log\left(1-p\right)$
-\end_inset
-
-.
- It has been used in biological studies to model the species abundance distribut
-ion.
-
-\begin_inset Formula \[
-p_{m}\left(k;p\right)=-\frac{p^{k}}{k\log\left(1-p\right)}\, I_{\left[1,\infty\right)}\left(k\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-multinomial (n, pvals, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This generator produces random vectors of length
-\begin_inset Formula $N$
-\end_inset
-
- where
-\begin_inset Formula $N=\textrm{len}\left(pvals\right)$
-\end_inset
-
-.
- The shape of the returned array is always the shape indicated by size +
- (
-\begin_inset Formula $N,$
-\end_inset
-
-).
- The multinomial distribution is a generalization of the binomial distribution.
- This time,
-\begin_inset Formula $n$
-\end_inset
-
- trials of an experiment are independently repeated but each trial results
- in
-\begin_inset Formula $N$
-\end_inset
-
- possible integers
-\begin_inset Formula $k_{1},k_{2},\ldots,k_{N}$
-\end_inset
-
- with
-\begin_inset Formula $\sum_{i=1}^{N}k_{i}=n.$
-\end_inset
-
-
-\begin_inset Formula \begin{eqnarray*}
-p_{m}\left(k_{1},k_{2},\ldots,k_{N};\cdot\right) & = & \textrm{Probability}\left\{ X\left(\cdot\right)=\left[k_{1},k_{2},\cdots,k_{N}\right]\right\} \\
- & = & \frac{n!}{k_{1}!k_{2}!\cdots k_{N}!}p_{1}^{k_{1}}p_{2}^{k_{2}}\cdots p_{N}^{k_{N}}\end{eqnarray*}
-
-\end_inset
-
-where
-\begin_inset Formula $pvals=[p_{1},p_{2},\ldots,p_{N}].$
-\end_inset
-
- It must be true that
-\begin_inset Formula $\sum_{i=1}^{N}p_{i}=1.$
-\end_inset
-
- Therefore, as long as
-\begin_inset Formula $\sum_{i=1}^{N-1}p_{i}\leq1,$
-\end_inset
-
- the last entry in
-\begin_inset Formula $pvals$
-\end_inset
-
- is computed as
-\begin_inset Formula $1-\sum_{i=1}^{N-1}p_{i}$
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Description
-negative_binomial (n, p, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Models the number of extra independent trials (beyond
-\begin_inset Formula $n$
-\end_inset
-
-) required to accumulate a total of
-\begin_inset Formula $n$
-\end_inset
-
- successes where the probability of success on each trial is
-\begin_inset Formula $p.$
-\end_inset
-
- Equivalently, this random number models the number of failures encountered
- while accumulating
-\begin_inset Formula $n$
-\end_inset
-
- successes during independent trials of the experiment that succeeds with
- probability,
-\begin_inset Formula $p$
-\end_inset
-
-.
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-p_{m}\left(k;n,p\right)=\left(\begin{array}{c}
-k+n-1\\
-n-1\end{array}\right)p^{n}\left(1-p\right)^{k}\, I_{\left[0,\infty\right)}\left(k\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-poisson (lam=1.0, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This random number counts the number of successes in
-\begin_inset Formula $n$
-\end_inset
-
- independent experiments (where the probability of success in each experiment
- is
-\begin_inset Formula $p$
-\end_inset
-
-) in the limit as
-\begin_inset Formula $n\rightarrow\infty$
-\end_inset
-
- and
-\begin_inset Formula $p\rightarrow0$
-\end_inset
-
- gets very small such that
-\begin_inset Formula $\lambda=np\geq0$
-\end_inset
-
- is a constant.
- It can be used, for example, to model how many typographical errors are
- on each page of a book.
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-p\left(k;\lambda\right)=e^{-\lambda}\frac{\lambda^{k}}{k!}\, I_{\left[0,\infty\right)}\left(k\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-zipf (a, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The probability mass function of this random number (also called the zeta
- distribution) is
-\begin_inset Formula \[
-p_{m}\left(k;a\right)=\frac{1}{\zeta\left(a\right)k^{a}}\, I_{\left[1,\infty\right)}\left(k\right),\]
-
-\end_inset
-
-where
-\begin_inset Formula \[
-\zeta\left(a\right)=\sum_{n=1}^{\infty}\frac{1}{n^{a}}\]
-
-\end_inset
-
-is the Riemann zeta function.
- Zipf distributions have been shown to characterize use of words in a natural
- language (like English), the popularity of library books, and even the
- use of the web.
- The Zipf distribution describes collections that have a few items whose
- probability of selection is very high, a medium number of items whose probabili
-ty of selection is medium, and a huge number of items whose probability
- of selection is very low.
-\begin_inset LatexCommand index
-name "random!discrete|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Subsection
-Continuous Distributions
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "random!continuous|("
-
-\end_inset
-
-Continuous random numbers can take on an uncountable number of values.
- Therefore, the value returned by a continuous distribution is denoted
-\begin_inset Formula $x$
-\end_inset
-
-.
- Because there is an uncountable number of possibilities for the random
- number
-\begin_inset Foot
-status open
-
-\begin_layout Standard
-A computer actually always generates a random number from a discrete distributio
-n because there are only a finite set of numbers that can be represented
- by a computer.
- However, for continuous random number generators, the resulting random
- numbers usually approximate the continuous distribution well enough to
- ignore the subtlety.
-\end_layout
-
-\end_inset
-
-, a continuous distribution is modeled by a probability density function,
-
-\begin_inset Formula $f\left(x;\cdot\right).$
-\end_inset
-
- To obtain the probability that the random number generated by
-\begin_inset Formula $X\left(\cdot\right)$
-\end_inset
-
- is in a certain interval, we integrate this density function:
-\begin_inset Formula \[
-\int_{-\infty}^{b}f\left(x\right)dx=\textrm{Probability}\left\{ X\left(\cdot\right)\leq b\right\} .\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-To obtain a probability, we have to integrate
-\begin_inset Formula $f\left(x\right)$
-\end_inset
-
- which is why it is called a density function.
- Most continuous distributions are defined by their probability density
- functions (pdf).
- Some have basic origins, a few are derived from other distributions, and
- some are used mainly for modelling unknown distributions.
-
-\end_layout
-
-\begin_layout Standard
-Some of the parameters of the distributions are labeled as location (
-\emph on
-loc
-\emph default
-) and
-\emph on
-scale
-\emph default
- parameters.
- These parameters are not shown in the equation for the pdf.
- because they affect the distribution in a known way.
- This is due to the fact that if
-\begin_inset Formula $X$
-\end_inset
-
- is a number drawn from a distribution with pdf
-\begin_inset Formula $f_{X}\left(x\right),$
-\end_inset
-
- then
-\begin_inset Formula $Y=Sx+L$
-\end_inset
-
- is a number drawn from a distribution with pdf
-\begin_inset Formula \[
-f_{Y}\left(y\right)=\frac{1}{S}f_{X}\left(\frac{y-L}{S}\right).\]
-
-\end_inset
-
- Thus, from the standard from provided, the pdf of the actual random numbers
- generated by fixing the location and scale parameters can be quickly found.
-\end_layout
-
-\begin_layout Standard
-In this section, the indicator function
-\begin_inset Formula $I_{A}\left(x\right)$
-\end_inset
-
- will be used where
-\begin_inset Formula $A$
-\end_inset
-
- is a set defined over all the real numbers.
- For clarity,
-\begin_inset Formula \[
-I_{A}\left(x\right)=\left\{ \begin{array}{cc}
-1 & x\in A,\\
-0 & x\not\in A.\end{array}\right.\]
-
-\end_inset
-
- Also, the following functions are used in the definitions:
-\begin_inset Formula \begin{eqnarray*}
-\Gamma\left(x\right) & = & \int_{0}^{\infty}t^{x-1}e^{-t}dt=\left(x-1\right)\Gamma\left(x-1\right),\\
-B\left(a,b\right) & = & \frac{\Gamma\left(a\right)\Gamma\left(b\right)}{\Gamma\left(a+b\right)}.\end{eqnarray*}
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-beta (
-\begin_inset Formula $a$
-\end_inset
-
-,
-\begin_inset Formula $b$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x;a,b\right)=\frac{1}{B\left(a,b\right)}x^{a-1}\left(1-x\right)^{b-1}I_{\left(0,1\right)}\left(x\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-chisquare (
-\begin_inset Formula $\nu$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If
-\begin_inset Formula $Z_{1},\ldots,Z_{\nu}$
-\end_inset
-
- are random numbers from standard normal distributions, then
-\begin_inset Formula $W=\sum_{k=1}^{\nu}Z_{k}^{2}$
-\end_inset
-
- is a random number from the chi-square
-\begin_inset Formula $\left(\chi^{2}\right)$
-\end_inset
-
- distribution with
-\begin_inset Formula $\nu$
-\end_inset
-
- degrees of freedom.
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x;\nu\right)=\frac{1}{2\Gamma\left(\frac{\nu}{2}\right)}\left(\frac{x}{2}\right)^{\nu/2-1}e^{-x/2}I_{\left[0,\infty\right)}\left(x\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-dirichlet (
-\begin_inset Formula $\boldsymbol{\alpha},$
-\end_inset
-
- size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A vector of random numbers which are drawn from a multivariate Dirichlet
- distribution.
- The length of the parameter vector,
-\begin_inset Formula $\boldsymbol{\alpha},$
-\end_inset
-
- is the length,
-\begin_inset Formula $N$
-\end_inset
-
-, of the random vector.
- The joint pdf is:
-\end_layout
-
-\begin_layout Description
-\begin_inset Formula \[
-f\left(\mathbf{x},\boldsymbol{\alpha}\right)=\frac{\prod_{i=1}^{N}\Gamma\left(\alpha_{i}\right)}{\Gamma\left(\sum_{i=1}^{N}\alpha_{i}\right)}\prod_{i=1}^{N}x_{i}^{\alpha_{i}-1}.\]
-
-\end_inset
-
-
-\series medium
-
-\end_layout
-
-\begin_layout Description
-exponential (scale=1.0, size=None)
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x\right)=e^{-x}I_{\left[0,\infty\right)}\left(x\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-f (
-\begin_inset Formula $\nu_{1}$
-\end_inset
-
-,
-\begin_inset Formula $\nu_{2}$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The distribution of
-\begin_inset Formula $\frac{X_{1}/\nu_{1}}{X_{2}/\nu_{2}}$
-\end_inset
-
- where
-\begin_inset Formula $X_{i}$
-\end_inset
-
- is chi-squared with
-\begin_inset Formula $\nu_{i}$
-\end_inset
-
- degrees of freedom.
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x;\nu_{1},\nu_{2}\right)=\frac{\nu_{2}^{\nu_{2}/2}\nu_{1}^{\nu_{1}/2}x^{\nu_{1}/2-1}}{\left(\nu_{2}+\nu_{1}x\right)^{\left(\nu_{1}+\nu_{2}\right)/2}B\left(\frac{\nu_{1}}{2},\frac{\nu_{2}}{2}\right)}I_{\left[0,\infty\right)}\left(x\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-gamma (
-\begin_inset Formula $a$
-\end_inset
-
-, scale=1.0, size=None)
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x;a\right)=\frac{1}{\Gamma\left(a\right)}x^{a-1}e^{-x}I_{\left[0,\infty\right)}\left(x\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-gumbel (loc=0.0, scale=1.0, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A right-skewed extreme value distribution.
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x\right)=\exp\left[-x-e^{-x}\right].\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-laplace (loc=0.0, scale=1.0, size=None)
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x\right)=\frac{1}{2}e^{-\left|x\right|}.\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-lognormal (
-\begin_inset Formula $\mu$
-\end_inset
-
-=0.0,
-\begin_inset Formula $\sigma$
-\end_inset
-
-=1.0, size=None)
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x;\mu,\sigma\right)=\frac{1}{\sigma x\sqrt{2\pi}}\exp\left[-\frac{1}{2}\left(\frac{\log x-\mu}{\sigma}\right)^{2}\right]I_{\left[0,\infty\right)}\left(x\right),\]
-
-\end_inset
-
-The parameters,
-\begin_inset Formula $\mu$
-\end_inset
-
- and
-\begin_inset Formula $\sigma$
-\end_inset
-
- are not the mean and variance of this distribution, but the parameters
- of the underlying normal distribution.
- Random numbers from this distribution are generated as
-\begin_inset Formula $e^{\sigma Z+\mu}$
-\end_inset
-
- where
-\begin_inset Formula $Z$
-\end_inset
-
- is a standard normal random number.
-
-\end_layout
-
-\begin_layout Description
-logistic (loc=0.0, scale=1.0, size=None)
-\begin_inset Formula \[
-f\left(x\right)=\frac{e^{-x}}{\left[1+e^{-x}\right]^{2}}I_{\left[0,\infty\right)}\left(x\right)\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-multivariate_normal (
-\begin_inset Formula $\mathbf{\boldsymbol{\mu}}$
-\end_inset
-
-,
-\begin_inset Formula $\mathbf{C}$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns a vector of random numbers which are jointly drawn from a multivariate
- normal distribution.
- The last-dimension of the output array contains the sample vector, which
- is of length
-\begin_inset Formula $N=\textrm{len}\left(mean\right).$
-\end_inset
-
- The covariance matrix must be
-\begin_inset Formula $N\times N$
-\end_inset
-
-.
- If
-\begin_inset Formula $\boldsymbol{\mu}\equiv mean$
-\end_inset
-
- and
-\begin_inset Formula $\mathbf{C}=cov$
-\end_inset
-
-, then the joint-pdf representing the returned random vector(s) is
-\begin_inset Formula \[
-f\left(\mathbf{x}\right)=\frac{1}{\sqrt{\left(2\pi\right)^{N}\left|\mathbf{C}\right|}}\exp\left[-\frac{1}{2}\left(\mathbf{x}-\boldsymbol{\mu}\right)^{T}\mathbf{C}^{-1}\left(\mathbf{x}-\boldsymbol{\mu}\right)\right].\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-noncentral_chisquare (
-\begin_inset Formula $\nu$
-\end_inset
-
-,
-\begin_inset Formula $\lambda$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This is the distribution of
-\begin_inset Formula $\sum_{i=1}^{\nu}\left(Z_{i}+\delta_{i}\right)^{2}$
-\end_inset
-
- where
-\begin_inset Formula $Z_{i}$
-\end_inset
-
- are independent standard normal random numbers and
-\begin_inset Formula $\delta_{i}$
-\end_inset
-
- are constants.
- It is a a generalized Rayleigh-Rice distribution:
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x;\nu,\lambda\right)=e^{-\left(\lambda+x\right)/2}\frac{1}{2}\left(\frac{x}{\lambda}\right)^{\left(\nu-2\right)/4}I_{\left(\nu-2\right)/2}\left(\sqrt{\lambda x}\right)I_{\left(0,\infty\right)}\left(x\right),\]
-
-\end_inset
-
- where
-\begin_inset Formula $I_{\nu}\left(z\right)$
-\end_inset
-
- (a real-number in the subscript, not an interval) is the modified Bessel
- Function of the first kind.
-
-\end_layout
-
-\end_deeper
-\begin_layout Description
-noncentral_f (
-\begin_inset Formula $\nu_{1}$
-\end_inset
-
-,
-\begin_inset Formula $\nu_{2}$
-\end_inset
-
-,
-\begin_inset Formula $\lambda$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The pdf of this distribution is
-\begin_inset Formula \begin{eqnarray*}
-f\left(x;\nu_{1},\nu_{2},\lambda\right) & = & \exp\left[\frac{\lambda}{2}+\frac{\lambda v_{1}x}{2\left(\nu_{1}x+\nu_{2}\right)}\right]\nu_{1}^{\nu_{1}/2}\nu_{2}^{\nu_{2}/2}x^{\nu_{1}/2-1}\\
- & & \times\left(\nu_{2}+\nu_{1}x\right)^{-\left(\nu_{1}+\nu_{2}\right)/2}\\
- & & \times\frac{\Gamma\left(\frac{\nu_{1}}{2}\right)\Gamma\left(1+\frac{\nu_{2}}{2}\right)L_{n_{2}/2}^{n_{1}/2-1}\left(-\frac{\lambda\nu_{1}x}{2\left(\nu_{1}x+\nu_{2}\right)}\right)}{B\left(\frac{\nu_{1}}{2},\frac{\nu_{2}}{2}\right)\Gamma\left(\frac{\nu_{1}+\nu_{2}}{2}\right)}.\end{eqnarray*}
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-normal (loc=0.0, scale=1.0, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The normal, or Gaussian, distribution is the limiting distribution of independe
-nt samples from any sufficiently well-behaved distributions (this is the
- content of the celebrated central limit theorem).
- The normal distribution is also the distribution of maximum entropy when
- the mean and variance alone are fixed.
- These two facts account for its name as well as the wide variety of situations
- that can be usefully modelled using the normal distribution.
- Because it is so widely used, the full pdf with the location
-\begin_inset Formula $\left(\mu\right)$
-\end_inset
-
- and scale
-\begin_inset Formula $\left(\sigma\right)$
-\end_inset
-
- parameters is provided:
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x\right)=\frac{1}{\sigma\sqrt{2\pi}}\exp\left[-\frac{\left(x-\mu\right)^{2}}{2\sigma^{2}}\right].\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-pareto (
-\begin_inset Formula $a$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x;a\right)=\frac{a}{x^{a+1}}I_{\left[1,\infty\right)}\left(x\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-power (
-\begin_inset Formula $a$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A special case of the beta distribution with
-\begin_inset Formula $b=1.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x;a\right)=ax^{a-1}I_{\left[0,1\right]}\left(x\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-rand (
-\begin_inset Formula $d_{1}$
-\end_inset
-
-,
-\begin_inset Formula $d_{2}$
-\end_inset
-
-,
-\begin_inset Formula $\ldots$
-\end_inset
-
-,
-\begin_inset Formula $d_{n}$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A convenient interface to obtain an array of shape
-\begin_inset Formula $\left(d_{1},d_{2},\ldots,d_{n}\right)$
-\end_inset
-
- of uniform random numbers in the interval
-\begin_inset Formula $\left[0,1\right).$
-\end_inset
-
- Notice the different convention for passing in the shape (as separate arguments
- instead of a tuple).
- The standard convention is used in the function numpy.random.random(shape)
- for which this function is merely a convenient short-hand.
- If you have a tuple named shape, then rand(*shape) will work correctly.
-\end_layout
-
-\begin_layout Description
-randint (low, high=None, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equally probably random integers in the range
-\begin_inset Formula $low\leq x<high$
-\end_inset
-
-.
- If
-\begin_inset Formula $high$
-\end_inset
-
- is None, then the range is
-\begin_inset Formula $0\leq x<low$
-\end_inset
-
-.
- Similar to random_integers, but check the difference on the bounds.
-\end_layout
-
-\begin_layout Description
-randn (
-\begin_inset Formula $d_{1}$
-\end_inset
-
-,
-\begin_inset Formula $d_{2}$
-\end_inset
-
-,
-\begin_inset Formula $\ldots$
-\end_inset
-
-,
-\begin_inset Formula $d_{n}$
-\end_inset
-
-)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A convenient interface to obtain an array of shape
-\begin_inset Formula $\left(d_{1},d_{2},\ldots,d_{n}\right)$
-\end_inset
-
- of standard normal
-\begin_inset Formula $\left(\mu=0,\,\sigma=1\right)$
-\end_inset
-
- random numbers.
- Notice the different convention for passing in the shape (as separate arguments
- intead of a tuple).
- The standard convention is used in the function numpy.random.standard_normal(shap
-e) for which this function is merely a convenient short-hand.
- If you have a tuple named shape, then randn(*shape) will work correctly.
-\end_layout
-
-\begin_layout Description
-random_integers (low, high=None, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Equally probably random integers in the range
-\begin_inset Formula $low\leq x\leq high$
-\end_inset
-
-.
- If high is None, then the range is
-\begin_inset Formula $1\leq x\leq low$
-\end_inset
-
-.
- Similar to randint, but check the difference on the bounds.
-\end_layout
-
-\begin_layout Description
-rayleigh (scale=1.0, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Rayleigh-distributed random numbers can be obtained as
-\begin_inset Formula $X=\sqrt{Z_{1}^{2}+Z_{2}^{2}}$
-\end_inset
-
- where
-\begin_inset Formula $Z_{i}$
-\end_inset
-
- are independent standard normal random numbers.
- The scale parameter is also the mode of the distribution (the value of
-
-\begin_inset Formula $X$
-\end_inset
-
- with highest probability).
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x\right)=xe^{-x^{2}/2}I_{[0,\infty)}\left(x\right)\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-standard_cauchy (size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A Cauchy distribution is a heavy-tailed distribution with no variance.
- It's distribution is that of the ratio of two standard normal distributions
-
-\begin_inset Formula $Z_{1}/Z_{2}.$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x\right)=\frac{1}{\pi\left(1+x^{2}\right)}.\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-standard_exponential (size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A standard exponetial random number with scale=1.0.
- The pdf was given under the description of
-\family typewriter
-random.exponential
-\family default
-.
-\end_layout
-
-\begin_layout Description
-standard_gamma (
-\begin_inset Formula $a$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A standard gamma random number with scale=1.0.
- The pdf was given under the description of
-\family typewriter
-random.gamma
-\family default
-.
-\end_layout
-
-\begin_layout Description
-standard_normal (size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A zero-mean, unit-variance, normally distributed random number often denoted
-
-\begin_inset Formula $Z.$
-\end_inset
-
-
-\begin_inset Formula \[
-f\left(x\right)=\frac{1}{\sqrt{2\pi}}e^{-x^{2}/2}.\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-standard_t (
-\begin_inset Formula $\nu$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Often called Student's t distribution, this random number distribution
- arises in the problem of estimating the mean of normally distributed samples
- when the sample-size is small.
- The first parameter,
-\begin_inset Formula $\nu$
-\end_inset
-
-, is the number of degrees of freedom of the distribution.
-
-\begin_inset Formula \[
-f\left(x;\nu\right)\frac{\Gamma\left(\frac{\nu+1}{2}\right)}{\sqrt{\pi\nu}\Gamma\left(\frac{\nu}{2}\right)\left[1+\frac{x^{2}}{\nu}\right]^{\frac{\nu+1}{2}}}.\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-triangular (left, mode, right, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns random numbers according to a triangularly-shaped density that
- starts at left, peaks at mode, and ends at right.
-\end_layout
-
-\begin_layout Description
-uniform (low=0.0, high=1.0, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns random numbers that are equally probable over the range
-\begin_inset Formula $\left[low,\, high\right).$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-vonmises (
-\begin_inset Formula $\mu$
-\end_inset
-
-,
-\begin_inset Formula $\kappa$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A continuous distribution that is well suited for circular attributes such
- as angles, time of day, day of the year, etc.
- The mean direction is
-\begin_inset Formula $\mu$
-\end_inset
-
- and concentration (or dispersion) parameter is
-\begin_inset Formula $\kappa.$
-\end_inset
-
- For small
-\begin_inset Formula $\kappa$
-\end_inset
-
- the distribution tends towards a uniform distribution over
-\begin_inset Formula $\left[-\pi,\pi\right].$
-\end_inset
-
- For large
-\begin_inset Formula $\kappa$
-\end_inset
-
-, the distribution tends towards a normal distribution with mean
-\begin_inset Formula $\mu$
-\end_inset
-
- and variance
-\begin_inset Formula $1/\kappa.$
-\end_inset
-
-
-\begin_inset Formula \[
-f\left(x\right)=\frac{e^{\kappa\cos\left(x-\mu\right)}}{2\pi I_{0}\left(\kappa\right)}I_{\left[-\pi,\pi\right]}\left(x\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-wald (
-\begin_inset Formula $\mu$
-\end_inset
-
-,
-\begin_inset Formula $\lambda$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This distribution is also called the inverse Gaussian distribution (and
- the Wald distribution considered as a special case when
-\begin_inset Formula $\mu=\lambda$
-\end_inset
-
-).
- It can be generated by noticing that if
-\begin_inset Formula $X$
-\end_inset
-
- is a wald random number then
-\begin_inset Formula $\frac{\lambda\left(X-\mu\right)^{2}}{\mu^{2}X}$
-\end_inset
-
- is the square of a standard normal random number (i.e.
- it is chi-square with one degree of freedom).
- The pdf is
-\begin_inset Formula \[
-f\left(x\right)=\sqrt{\frac{\lambda}{2\pi x^{3}}}e^{-\frac{\lambda\left(x-\mu\right)^{2}}{2\mu^{2}x}}.\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-weibull (
-\begin_inset Formula $a$
-\end_inset
-
-, size=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- An extreme-value distribution:
-\end_layout
-
-\begin_layout Standard
-\begin_inset Formula \[
-f\left(x;c\right)=ax^{a-1}\exp\left(-x^{a}\right)I_{\left(0,\infty\right)}\left(x\right).\]
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Subsection
-Miscellaneous utilities
-\end_layout
-
-\begin_layout Description
-bytes (length)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a string of random bytes of the provided length.
-\end_layout
-
-\begin_layout Description
-get_state ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an object that holds the state of the random number generator (allows
- you to restart simulations where you left off).
-\end_layout
-
-\begin_layout Description
-set_state (state)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Set the state of the random number generator.
- The argument should be the returned object of a previous get_state command.
-\end_layout
-
-\begin_layout Description
-shuffle (sequence)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Randomly permute the items of any sequence.
- If sequence is an array, then it must be 1-d.
-\end_layout
-
-\begin_layout Description
-permutation (n)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a permutation of the integers from 0 to n-1.
-
-\begin_inset LatexCommand index
-name "random!continuous|)"
-
-\end_inset
-
-
-\begin_inset LatexCommand index
-name "random|)"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section
-Matrix-specific functions (matlib)
-\end_layout
-
-\begin_layout Standard
-This module contains functions that are geared specifically toward matrix
- objects.
- In particular it includes the functions
-\series bold
-empty
-\series default
-,
-\series bold
-ones
-\series default
-,
-\series bold
-zeros
-\series default
-,
-\series bold
-identity
-\series default
-,
-\series bold
-eye
-\series default
-,
-\series bold
-rand
-\series default
-, and
-\series bold
-randn
-\series default
- each of which returns a matrix object by default instead of an ndarray
- object.
-\end_layout
-
-\begin_layout Section
-Ctypes utiltity functions (ctypeslib)
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "ctypeslib"
-
-\end_inset
-
-This module contains utility functions that make it easier to work with
- the ctypes module.
-
-\end_layout
-
-\begin_layout Description
-load_library (name, path)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Load a shared library named
-\begin_inset Quotes eld
-\end_inset
-
-name
-\begin_inset Quotes erd
-\end_inset
-
- (use the full name including any prefix but excluding the extension) located
- in the directory indicated by path and return a ctypes library object whose
- attributes are the functions in the library.
- If ctypes is not available, this function will raise an ImportError.
- If there is an error loading the library, ctypes raises an OSError.
- The extension is appended to the library name (on a platform-dependent
- basis) unless the name includes the
-\begin_inset Quotes eld
-\end_inset
-
-.
-\begin_inset Quotes erd
-\end_inset
-
- character in which case name is assumed to be the
-\begin_inset Quotes eld
-\end_inset
-
-full-name
-\begin_inset Quotes erd
-\end_inset
-
- of the library.
-
-\end_layout
-
-\begin_layout Description
-ndpointer (dtype=None, ndim=None, shape=None, flags=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create a class object that can be used in the argtypes list of a ctypes
- function that will do basic type, number-of-dimensions, shape, and flags
- checking on input array objects.
- Setting an argtypes entry with the result of this function allows passing
- arrays directly to ctypes-wrapped functions.
- The returned class object will contain a from_param method as required
- by ctypes.
- This from_param method takes the array object, does data-type, number-of-dimens
-ions, shape, and flags checking on the object and if all tests pass returns
- an object that ctypes can use as the data area of the array.
- Checking is not performed for any entries which are None in this class
- creation function.
-
-\end_layout
-
-\begin_layout Chapter
-Testing and Packaging
-\end_layout
-
-\begin_layout Quotation
-Research is what I'm doing when I don't know what I'm doing.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Werner von Braun
-\end_layout
-
-\begin_layout Quotation
-The most likely way for the world to be destroyed, most experts agree, is
- by accident.
- That's where we come in; we're computer professionals.
- We cause accidents.
-\end_layout
-
-\begin_layout Right Address
----
-\emph on
-Nathaniel Borenstein
-\end_layout
-
-\begin_layout Standard
-There are two additional sub-packages distributed with NumPy that simplify
- the process of distributing and testing code based on NumPy.
- The numpy.distutils sub-package extends the standard distutils package to
- handle Fortran code along with providing support for the auto-generated
- code in NumPy.
- The numpy.testing sub-package defines a few functions and classes for standardiz
-ing unit-tests in NumPy.
- These facilities can be used in your own packages that build on top of
- NumPy.
-
-\end_layout
-
-\begin_layout Section
-Testing
-\end_layout
-
-\begin_layout Standard
-In this sub-package are two classes and some useful utilities for writing
- unit-tests
-\end_layout
-
-\begin_layout Description
-NumpyTestCase a subclass of unittest.TestCase which adds a measure method
- that can determine the elasped time to execute a code string and enhances
- the __call__ method
-\end_layout
-
-\begin_layout Description
-NumpyTest the test manager for NumPy which was extracted originally from
- the SciPy code base.
- This test manager makes it easy to add unit-tests to a package simply by
- creating a tests sub-directory with files named test_<module>.py.
- These test files should then define sub-classes of NumpyTestCase (or unittest.Te
-stCase) named
-\begin_inset Quotes eld
-\end_inset
-
-test*
-\begin_inset Quotes erd
-\end_inset
-
-.
- These classes should then define functions named
-\begin_inset Quotes eld
-\end_inset
-
-test*
-\begin_inset Quotes erd
-\end_inset
-
- or
-\begin_inset Quotes eld
-\end_inset
-
-bench*
-\begin_inset Quotes erd
-\end_inset
-
- or
-\begin_inset Quotes eld
-\end_inset
-
-check*
-\begin_inset Quotes erd
-\end_inset
-
- that contain the actual unit-tests.
- The first keyword argument should specify the level above which this test
- should be run.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- To run the tests excecute NumpyTest(<package>).test(level=1, verbosity=1)
- which will run all tests above the given level using the given verbosity.
- Here <package> can be either a string or a previously imported module.
- You can get the level and verbosity arguments from sys.argv using NumpyTest(<pac
-kage>).run() with -v or --verbosity and -l or --level as command-line arguments.
-\end_layout
-
-\begin_layout Description
-set_local_path (reldir='', level=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- prepend local directory (+ reldir) to sys.path.
- The caller is responsible for removing this path using restore_path().
-\end_layout
-
-\begin_layout Description
-set_package_path (level=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- prepend package directory to sys.path.
- This should be called from a test_file.py that satisfies the tree structure:
- <somepath>/<somedir>/test_file.py.
- The, the first existing path name from the list <somepath>/build/lib.<platform>-
-<version>, <somepath>/..
- is pre-pended to sys.path.
- The caller is responsible for removing this path using restore_path().
-\end_layout
-
-\begin_layout Description
-restore_path ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Remove the first entry from sys.path.
-\end_layout
-
-\begin_layout Description
-assert_equal (actual, desired, err_msg='', verbose=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Raise an assertion error if the two items are not equal.
- Automatically calls assert_array_equal if actual or desired is an ndarray.
-
-\end_layout
-
-\begin_layout Description
-assert_almost_equal (actual, desired, decimal=7, err_msg='', verbose=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Raise an assertion error if the two items are not equal within decimal
- places.
- Automatically calls assert_array_almost_equal if actual or desired is an
- ndarray.
-\end_layout
-
-\begin_layout Description
-assert_approx_equal (actual, desired, significant=7, err_msg='', verbose=1)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Raise an assertion error if the two items are not equal to within the given
- significant digits.
- Does not work on arrays.
-
-\end_layout
-
-\begin_layout Description
-assert_array_equal (x, y, err_msg='')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Raise an error if the two arrays x and y are not equal at every element.
-
-\end_layout
-
-\begin_layout Description
-assert_array_less (x, y, err_msg='')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Raise an error if the two arrays x and y have different shapes or if x
- is not less than y at every element.
-
-\end_layout
-
-\begin_layout Description
-assert_array_almost_equal (x, y, decimal=6, err_msg='')
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Raise an error if x and y are not equal to decimal places at every element.
-\end_layout
-
-\begin_layout Description
-jiffies ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a number of 1/100ths of a second that this process has been scheduled
- in user mode.
- Implemented using time.time() unless on Linux where the special /proc directory
- filesystem is used.
-
-\end_layout
-
-\begin_layout Description
-memusage ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the virtual memory size in bytes of the running python.
- If the operation is not supported on the platform, then return None.
- This works only on linux for now.
-\end_layout
-
-\begin_layout Description
-rand (*args)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return an array of random numbers with the given shape using only the standard
- library random number generator.
-\end_layout
-
-\begin_layout Description
-runstring (astr, dict)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Run the given string in the dictionary provided.
- Functional form for (exec astr in dict) that is useful for the failUnlessRaises
- method of unittest.TestCase class.
-\end_layout
-
-\begin_layout Section
-NumPy Distutils
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "distutils"
-
-\end_inset
-
-NumPy provides enhanced distutils functionality to make it easier to build
- and install sub-packages, auto-generate code, and extension modules that
- use Fortran-compiled libraries.
- To use features of numpy distutils use the setup command from numpy.distutils.cor
-e.
- A useful Configuration class is also provided in numpy.distutils.misc_util
- that can make it easier to construct keyword arguments to pass to the setup
- function (by passing the dictionary obtained from the todict() method of
- the class).
- More information is available in the NumPy Distutils Users Guide in <site-packa
-ges>/numpy/doc/DISTUTILS.txt.
-\end_layout
-
-\begin_layout Subsection
-misc_util
-\end_layout
-
-\begin_layout Description
-Configuration (package_name=None, parent_name=None, top_path=None, package_path=
-None, **attrs)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
-
-\begin_inset LatexCommand index
-name "Configuration"
-
-\end_inset
-
-Construct a configuration instance for the given package name.
- If parent_name is not None, then construct the package as a sub-package
- of the parent_name package.
- If top_path and package_path are None then they are assumed equal to the
- path of the file this instance was created in.
- The setup.py files in the numpy distribution are good examples of how to
- use the Configuration instance.
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-self.todict ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a dictionary compatible with the keyword arguments of distutils
- setup function.
- Thus, this method may be used as setup(**config.todict()).
-\end_layout
-
-\begin_layout Description
-self.get_distribution ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the distutils distribution object for self.
-\end_layout
-
-\begin_layout Description
-self.get_subpackage (subpackage_name, subpackage_path=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a Configuration instance for the sub-package given.
- If subpackage_path is None then the path is assumed to be the local path
- plus the subpackage_name.
- If a setup.py file is not found in the subpackage_path, then a default configura
-tion is used.
-\end_layout
-
-\begin_layout Description
-self.add_subpackage (subpackage_name, subpackage_path=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Add a sub-package to the current Configuration instance.
- This is useful in a setup.py script for adding sub-packages to a package.
- The sub-package is contained in subpackage_path / subpackage_name and this
- directory may contain a setup.py script or else a default setup (suitable
- for Python-code-only subpackages) is assumed.
- If the subpackage_path is None, then it is assumed to be located in the
- local path / subpackage_name.
-
-\end_layout
-
-\begin_layout Description
-self.add_data_files (*files)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Add files to the list of data_files to be included with the package.
- The form of each element of the files sequence is very flexible allowing
- many combinations of where to get the files from the package and where
- they should ultimately be installed on the system.
- The most basic usage is for an element of the files argument sequence to
- be a simple filename.
- This will cause that file from the local path to be installed to the installati
-on path of the self.name package (package path).
- The file argument can also be a relative path in which case the entire
- relative path will be installed into the package directory.
- Finally, the file can be an absolute path name in which case the file will
- be found at the absolute path name but installed to the package path.
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- This basic behavior can be augmented by passing a 2-tuple in as the file
- argument.
- The first element of the tuple should specify the relative path (under
- the package install directory) where the remaining sequence of files should
- be installed to (it has nothing to do with the file-names in the source
- distribution).
- The second element of the tuple is the sequence of files that should be
- installed.
- The files in this sequence can be filenames, relative paths, or absolute
- paths.
- For absolute paths the file will be installed in the top-level package
- installation directory (regardless of the first argument).
- Filenames and relative path names will be installed in the package install
- directory under the path name given as the first element of the tuple.
- An example may clarify:
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-self.add_data_files('foo.dat',
-\newline
-('fun', ['gun.dat', 'nun/pun.dat', '/tmp/sun.dat']),
-
-\newline
-'bar/cat.dat',
-\newline
-'/full/path/to/can.dat')
-\end_layout
-
-\begin_layout Standard
-will install these data files to:
-\end_layout
-
-\begin_layout LyX-Code
-<package install directory>/
-\newline
- foo.dat
-\newline
- fun/
-\newline
- gun.dat
-\newline
- nun/
-\newline
- pun.dat
-\newline
- sun.dat
-\newline
-
- bar/
-\newline
- car.dat
-\newline
- can.dat
-\end_layout
-
-\begin_layout Standard
-where <package install directory> is the package (or sub-package) directory
- such as '/usr/lib/python2.4/site-packages/mypackage' ('C:
-\backslash
-
-\backslash
-Python2.4
-\backslash
-
-\backslash
-Lib
-\backslash
-
-\backslash
-site-packages
-\backslash
-
-\backslash
-mypackage') or '/usr/lib/python2.4/site-packages/mypackage/mysubpackage'
- ('C:
-\backslash
-
-\backslash
-Python2.4
-\backslash
-
-\backslash
-Lib
-\backslash
-
-\backslash
-site-packages
-\backslash
-
-\backslash
-mypackage
-\backslash
-
-\backslash
-mysubpackage').
-\end_layout
-
-\end_deeper
-\begin_layout Standard
-\InsetSpace ~
- An additional feature is that the path to a data-file can actually be a
- function that takes no arguments and returns the actual path(s) to the
- data-files.
- This is useful when the data files are generated while building the package.
-
-\end_layout
-
-\begin_layout Description
-self.add_data_dir (data_path)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Recursively add files under data_path to the list of data_files to be installed
- (and distributed).
- The data_path can be either a relative path-name, or an absolute path-name,
- or a 2-tuple where the first argument shows where in the install directory
- the data directory should be installed to.
- For example suppose the source directory contains fun/foo.dat and fun/bar/car.dat
-\end_layout
-
-\begin_layout LyX-Code
-self.add_data_dir('fun')
-\newline
-self.add_data_dir(('sun', 'fun'))
-\newline
-self.add_data_dir(('gun',
- '/full/path/to/fun'))
-\end_layout
-
-\begin_layout Standard
-\InsetSpace ~
- Will install data-files to the locations
-\end_layout
-
-\begin_layout LyX-Code
-<package install directory>/
-\newline
- fun/
-\newline
- foo.dat
-\newline
- bar/
-\newline
- car.dat
-\newline
- sun/
-\newline
-
- foo.dat
-\newline
- bar/
-\newline
- car.dat
-\newline
- gun/
-\newline
- foo.dat
-\newline
- car.dat
-\end_layout
-
-\begin_layout Description
-self.add_include_dirs (*paths)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Add the given sequence of paths to the beginning of the include_dirs list.
- This list will be visible to all extension modules of the current package.
-\end_layout
-
-\begin_layout Description
-self.add_headers (*files)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Add the given sequence of files to the beginning of the headers list.
- By default, headers will be installed under <python-include>/<self.name.replace('.
-','/')>/ directory.
- If an item of files is a tuple, then its first argument specifies the actual
- installation location relative to the <python-include> path.
-\end_layout
-
-\begin_layout Description
-self.add_extension (name, sources, **kw)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Create and add an Extension instance to the ext_modules list.
- The first argument defines the name of the extension module that will be
- installed under the self.name package.
- The second argument is a list of sources.
- This method also takes the following optional keyword arguments that are
- passed on to the Extension constructor: include_dirs, define_macros, undef_macr
-os, library_dirs, libraries, runtime_library_dirs, extra_objects, swig_opts,
- depends, language, f2py_options, module_dirs, and extra_info.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The self.paths(...) method is applied to all lists that may contain paths.
- The extra_info is a dictionary or a list of dictionaries whose content
- will be appended to the keyword arguments.
- The depends list 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.
-
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- The list of sources may contain functions (called source generators) which
- must take an extension instance and a build directory as inputs and return
- a source file or list of source files or None.
- If None is returned then no sources are generated.
- If the Extension instance has no sources after processing all source generators
-, then no extension module is built.
-
-\end_layout
-
-\begin_layout Description
-self.add_library (name, sources, **build_info)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Add a library to the list of libraries.
- Allowed keyword arguments are depends, macros, include_dirs, extra_compiler_arg
-s, and f2py_options.
- The name is the name of the library to be built and sources is a list of
- sources (or source generating functions) to add to the library.
-\end_layout
-
-\begin_layout Description
-self.add_scripts (*files)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Add the sequence of files to the beginning of the scripts list.
- Scripts will be installed under the <prefix>/bin/ directory.
-
-\end_layout
-
-\begin_layout Description
-self.paths (*paths)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Applies glob.glob(...) to each path in the sequence (if needed) and pre-pends
- the local_path if needed.
- Because this is called on all source lists, this allows wildcard characters
- to be specified in lists of sources for extension modules and libraries
- and scripts and allows path-names be relative to the source directory.
-\end_layout
-
-\begin_layout Description
-self.get_config_cmd ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the numpy.distutils config command instance.
-\end_layout
-
-\begin_layout Description
-self.get_build_temp_dir ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a path to a temporary directory where temporary files should be
- placed.
-\end_layout
-
-\begin_layout Description
-self.have_f77c ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True if a Fortran 77 compiler is available (because a simple Fortran 77
- code was able to be compiled successfully).
-\end_layout
-
-\begin_layout Description
-self.have_f90c ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- True if a Fortran 90 compiler is available (because a simple Fortran 90
- code was able to be compiled successfully)
-\end_layout
-
-\begin_layout Description
-self.get_version ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a version string of the current package or None if the version informati
-on could not be detected.
- This method scans files named __version__.py, <packagename>_version.py, version.py
-, and __svn_version__.py for string variables version, __version__, and <packagen
-ame>_version, until a version number is found.
-\end_layout
-
-\begin_layout Description
-self.make_svn_version_py ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Appends a data function to the data_files list that will generate __svn_version
-__.py file to the current package directory.
- This file will be removed from the source directory when Python exits (so
- that it can be re-generated next time the package is built).
- This is intended for working with source directories that are in an SVN
- repository.
-
-\end_layout
-
-\begin_layout Description
-self.make_config_py ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Generate a package __config__.py file containing system information used
- during the building of the package.
- This file is installed to the package installation directory.
-\end_layout
-
-\begin_layout Description
-self.get_info (*names)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return information (from system_info.get_info) for all of the names in the
- argument list in a single dictionary.
-
-\end_layout
-
-\end_deeper
-\begin_layout Description
-get_numpy_include_dirs ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the include directory where the numpy/arrayobject.h and numpy/ufuncobject.
-h files are found.
- This should be added to the include_dirs of any extension module built
- using NumPy.
- If numpy.distutils is used to build the extension, then this directory is
- added automatically.
-
-\end_layout
-
-\begin_layout Description
-get_numarray_include_dirs ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the include directory where the numpy/libnumarray.h file is found.
- This should be added to the include_dirs of any extension module that relies
- on the Numarray-compatible C-API.
-
-\end_layout
-
-\begin_layout Description
-dict_append (d, **kwds)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Add the keyword arguments given as entries in the dictionary provided as
- the first argument.
- If the entry is already present, then assume it is a list and extend the
- list with the keyword value.
-\end_layout
-
-\begin_layout Description
-appendpath (prefix, path)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Platform-independent intelligence for appending path to prefix.
- It replaces '/' in the prefix and the path with the correct path-separator
- on the platform ad returns a full path name that will be valid for the
- platform.
-
-\end_layout
-
-\begin_layout Description
-allpath (name)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert a '/' separated pathname to one using the platform's path separator.
-\end_layout
-
-\begin_layout Description
-dot_join (*args)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Converts a sequence of string arguments to a string joined by '.' (removing
- any empty strings).
-
-\end_layout
-
-\begin_layout Description
-generate_config_py (extension, build_dir)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- A suitable function that can be used in a source list.
- This constructs a python file that contains system_info information used
- during building the package.
- Generally easier to use a Configuration instance and the config.make_config_py()
- method.
-\end_layout
-
-\begin_layout Description
-get_cmd (cmdname, _cache={})
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns an instance of the distutils command object named cmdname if the
- setup distribution instance has been initialized.
- Caches the result in _cache[cmdname] and gets it from there if present.
-\end_layout
-
-\begin_layout Description
-terminal_has_colors ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Tries to determine if the stdout terminal can be written to using ANSI
- colors.
- Returns 1 if it can be determined that ANSI colors are acceptable or 0
- if not.
-
-\end_layout
-
-\begin_layout Description
-red_text (s)
-\end_layout
-
-\begin_layout Description
-green_text (s)
-\end_layout
-
-\begin_layout Description
-yellow_text (s)
-\end_layout
-
-\begin_layout Description
-blue_text (s)
-\end_layout
-
-\begin_layout Description
-cyan_text (s)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- If terminal_has_colors() is true, then these commands return a string with
- the necessary codes prepended to display the given string argument in the
- specified color on an ANSI terminal.
- If terminal_has_colors() is false, then these functions simply return the
- input argument.
-
-\end_layout
-
-\begin_layout Description
-cyg2win32 (path)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Convert a cygwin path beginning with /cygdrive to a standard win32 path
- name.
-
-\end_layout
-
-\begin_layout Description
-all_strings (lst)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return True if all items in the input list are string objects otherwise
- return False.
-\end_layout
-
-\begin_layout Description
-has_f_sources (sources)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return True if any of the source files listed in the input argument are
- Fortran files because its name matches against the compiled regular expression
-
-\series bold
-fortran_ext_match
-\series default
-.
-\end_layout
-
-\begin_layout Description
-has_cxx_sources (sources)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return True if any of the source files listed in the input argument are
- C++ files because its name matches against the compiled regular expression
-
-\series bold
-cxx_ext_match
-\series default
-.
-\end_layout
-
-\begin_layout Description
-filter_sources (sources)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- From the provided list of sources, return four lists of filenames containing
- C, C++, Fortran, and Fortran 90 module sources respectively.
- The compiled regular expressions used in this search (which are also available
- in the misc_util module) are cxx_ext_match, fortran_ext_match, f90_ext_match,
- and f90_module_name_match.
-
-\end_layout
-
-\begin_layout Description
-get_dependencies (sources)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Scan the files in the sources list for include statements.
-\end_layout
-
-\begin_layout Description
-is_local_src_dir (directory)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return True if the provided directory is the local current working directory.
-
-\end_layout
-
-\begin_layout Description
-get_ext_source_files (ext)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Get sources and any include files in the same directory from an Extension
- instance.
-\end_layout
-
-\begin_layout Description
-get_script_files (scripts)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Returns the list scripts with all non-string arguments removed.
-\end_layout
-
-\begin_layout Subsection
-Other modules
-\end_layout
-
-\begin_layout Description
-system_info.get_info (name)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- For the given string representing a particular resource, return a dictionary
- that is compatible with the distutils.setup keyword arguments.
- If this is an empty dictionary, then the requested resource is not available.
- Some of the names that can be checked are 'lapack_opt', 'blas_opt', 'fft_opt',
- 'fftw', 'fftw3', 'fftw2', 'djbfft', 'numpy', 'numarray', 'boost_python',
- 'agg2', 'wx', 'gdk', 'xft', 'freetype2'.
-
-\end_layout
-
-\begin_layout Description
-system_info.get_standard_file (filename)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return a list of length 0 to 3 containing the full-path filenames for the
- filename provided.
- The filename is searched for in three places in the following order 1)
- the system-wide location which is the directory that the system_info file
- is located in; 2) the directory specified by the environment variable HOME;
- and 3) the current local directory.
-
-\end_layout
-
-\begin_layout Description
-cpuinfo.cpu an instance of a cpuinfo class that defines methods for checking
- various aspects of the cpu.
- The info attribute is a list of length (# of CPUs).
- Each entry is a dictionary providing technical information about that CPU.
-
-\end_layout
-
-\begin_layout Description
-log.set_verbosity (level)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Set the distutils logging threshold and return the previously stored value.
- The level is an integer that corresponds to distutils.log thresholds: -1
- <--> ERROR, 0 <--> WARN, 1 <--> INFO, and 2 <--> DEBUG.
-
-\end_layout
-
-\begin_layout Description
-exec_command
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-exec_command (command, execute_in='', use_shell=None, use_tee=None, _with_python
-=1, **env)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return (status, output) of the executed command.
- The command input is a string of executable and arguments.
- The output contains both stderr and stdout messages.
- If execute_in is given, then change to the provided directory prior to
- executing the command and afterwords restore to the current directory.
- On NT, and DOS systems the returned status is correct for external commands.
- However, wild cards will not work for non-posix systems.
-\end_layout
-
-\begin_layout Description
-splitcmdline (line)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Inverse of ' '.join(sys.argv)
-\end_layout
-
-\begin_layout Description
-find_executable (exe, path=None)
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return full path of an executable using information from the PATH environment
- variable.
- Equivalent to the POSIX 'which' command.
-\end_layout
-
-\begin_layout Description
-get_pythonexe ()
-\end_layout
-
-\begin_layout Description
-\InsetSpace ~
- Return the full path to the python executable with some fixes for nt and
- dos to replace pythonw with python if it is encountered.
- A basic wrapper around sys.executable.
-\end_layout
-
-\end_deeper
-\begin_layout Section
-Conversion of .src files
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand index
-name "code generation"
-
-\end_inset
-
-NumPy distutils supports automatic conversion of source files named <somefile>.sr
-c.
- This facility can be used to maintain very similar code blocks requiring
- only simple changes between blocks.
- During the build phase of setup, if a template file named <somefile>.src
- is encountered, a new file named <somefile> is constructed from the template
- and placed in the build directory to be used instead.
- Two forms of template conversion are supported.
- The first form occurs for files named named <file>.ext.src where ext is a
- recognized Fortran extension (f, f90, f95, f77, for, ftn, pyf).
- The second form is used for all other cases.
-
-\end_layout
-
-\begin_layout Subsection
-Fortran files
-\end_layout
-
-\begin_layout Standard
-This template converter will replicate all
-\series bold
-function
-\series default
- and
-\series bold
-subroutine
-\series default
- blocks in the file with names that contain '<...>' according to the rules
- in '<...>'.
- The number of comma-separated words in '<...>' determines the number of times
- the block is repeated.
- What these words are indicates what that repeat rule, '<...>', should be replaced
- with in each block.
- All of the repeat rules in a block must contain the same number of comma-separa
-ted words indicating the number of times that block should be repeated.
- If the word in the repeat rule needs a comma, leftarrow, or rightarrow,
- then prepend it with a backslash '
-\backslash
-'.
- If a word in the repeat rule matches '
-\backslash
-
-\backslash
-<index>' then it will be replaced with the <index>-th word in the same repeat
- specification.
- There are two forms for the repeat rule: named and short.
-\end_layout
-
-\begin_layout Subsubsection
-Named repeat rule
-\end_layout
-
-\begin_layout Standard
-A named repeat rule is useful when the same set of repeats must be used
- several times in a block.
- It is specified using <rule1=item1, item2, item3,..., itemN>, where N is the
- number of times the block should be repeated.
- On each repeat of the block, the entire expression, '<...>' will be replaced
- first with item1, and then with item2, and so forth until N repeats are
- accomplished.
- Once a named repeat specification has been introduced, the same repeat
- rule may be used
-\series bold
-in the current block
-\series default
- by referring only to the name (i.e.
- <rule1>.
-
-\end_layout
-
-\begin_layout Subsubsection
-Short repeat rule
-\end_layout
-
-\begin_layout Standard
-A short repeat rule looks like <item1, item2, item3, ..., itemN>.
- The rule specifies that the entire expression, '<...>' should be replaced
- first with item1, and then with item2, and so forth until N repeats are
- accomplished.
-
-\end_layout
-
-\begin_layout Subsubsection
-Pre-defined names
-\end_layout
-
-\begin_layout Standard
-The following predefined named repeat rules are available:
-\end_layout
-
-\begin_layout Itemize
-<prefix=s,d,c,z>
-\end_layout
-
-\begin_layout Itemize
-<_c=s,d,c,z>
-\end_layout
-
-\begin_layout Itemize
-<_t=real, double precision, complex, double complex>
-\end_layout
-
-\begin_layout Itemize
-<ftype=real, double precision, complex, double complex>
-\end_layout
-
-\begin_layout Itemize
-<ctype=float, double, complex_float, complex_double>
-\end_layout
-
-\begin_layout Itemize
-<ftypereal=float, double precision,
-\backslash
-
-\backslash
-0,
-\backslash
-
-\backslash
-1>
-\end_layout
-
-\begin_layout Itemize
-<ctypereal=float, double,
-\backslash
-
-\backslash
-0,
-\backslash
-
-\backslash
-1>
-\end_layout
-
-\begin_layout Subsection
-Other files
-\end_layout
-
-\begin_layout Standard
-Non-Fortran files use a separate syntax for defining template blocks that
- should be repeated using a variable expansion similar to the named repeat
- rules of the Fortran-specific repeats.
- The template rules for these files are:
-\end_layout
-
-\begin_layout Enumerate
-\begin_inset Quotes eld
-\end_inset
-
-/**begin repeat
-\begin_inset Quotes erd
-\end_inset
-
- on a line by itself marks the beginning of a segment that should be repeated.
-\end_layout
-
-\begin_layout Enumerate
-Named variable expansions are defined using #name=item1, item2, item3, ...,
- itemN# and placed on successive lines.
- These variables are replaced in each repeat block with corresponding word.
- All named variables in the same repeat block must define the same number
- of words.
-
-\end_layout
-
-\begin_layout Enumerate
-In specifying the repeat rule for a named variable, item*N is short-hand
- for item, item, ..., item repeated N times.
- In addition, parenthesis in combination with *N can be used for grouping
- several items that should be repeated.
- Thus, #name=(item1, item2)*4# is equivalent to #name=item1, item2, item1,
- item2, item1, item2, item1, item2#
-\end_layout
-
-\begin_layout Enumerate
-\begin_inset Quotes eld
-\end_inset
-
-*/
-\begin_inset Quotes erd
-\end_inset
-
- on a line by itself marks the end of the the variable expansion naming.
- The next line is the first line that will be repeated using the named rules.
-\end_layout
-
-\begin_layout Enumerate
-Inside the block to be repeated, the variables that should be expanded are
- specified as @name@.
-
-\end_layout
-
-\begin_layout Enumerate
-\begin_inset Quotes eld
-\end_inset
-
-/**end repeat**/
-\begin_inset Quotes erd
-\end_inset
-
- on a line by itself marks the previous line as the last line of the block
- to be repeated.
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Include \input{capi.lyx}
-preview false
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand printindex
-
-\end_inset
-
-
-\end_layout
-
-\end_body
-\end_document
diff --git a/doc/numpybook/runcode.py b/doc/numpybook/runcode.py
deleted file mode 100644
index c8c532728..000000000
--- a/doc/numpybook/runcode.py
+++ /dev/null
@@ -1,151 +0,0 @@
-"""
-This script takes a lyx file and runs the python code in it.
- Then rewrites the lyx file again.
-
-Each section of code portion is assumed to be in the same namespace
-where a from numpy import * has been applied
-
- If a PYNEW inside a Note is encountered, the name space is restarted
-
-The output (if any) is replaced in the file
- by the output produced during the code run.
-
-Options:
- -n name of code section (default MyCode)
-
-"""
-from __future__ import division, absolute_import, print_function
-
-import sys
-import optparse
-import io
-import re
-import os
-
-newre = re.compile(r"\\begin_inset Note.*PYNEW\s+\\end_inset", re.DOTALL)
-
-def getoutput(tstr, dic):
- print("\n\nRunning...")
- print(tstr, end=' ')
- tempstr = io.StringIO()
- sys.stdout = tempstr
- code = compile(tstr, '<input>', 'exec')
- try:
- res = eval(tstr, dic)
- sys.stdout = sys.__stdout__
- except SyntaxError:
- try:
- res = None
- exec(code, dic)
- finally:
- sys.stdout = sys.__stdout__
- if res is None:
- res = tempstr.getvalue()
- else:
- res = tempstr.getvalue() + '\n' + repr(res)
- if res != '':
- print("\nOutput is")
- print(res, end=' ')
- return res
-
-# now find the code in the code segment
-def getnewcodestr(substr, dic):
- end = substr.find('\\layout ')
- lines = substr[:end].split('\\newline')
- outlines = []
- first = 1
- cmd = ''
- lines.append('dummy')
- for line in lines:
- line = line.strip()
- if (line[:3]=='>>>') or (line == 'dummy'):
- # we have a new output
- pyoutstr = getoutput(cmd, dic).strip()
- if pyoutstr != '':
- pyout = pyoutstr.split('\n')
- outlines.extend(pyout)
- cmd = line[4:]
- elif (line[:3]=='...'):
- # continuation output
- cmd += "\n%s" % line[4:]
- else:
- # first line or output
- if first:
- first = 0
- cmd = line
- else:
- continue
- if line != 'dummy':
- outlines.append(line)
- return "\n\\newline \n".join(outlines), end
-
-
-def runpycode(lyxstr, name='MyCode'):
- schobj = re.compile(r"\\layout %s\s+>>> " % name)
- outstr = io.StringIO()
- num = 0
- indx = []
- for it in schobj.finditer(lyxstr):
- indx.extend([it.start(), it.end()])
- num += 1
-
- if num == 0:
- print("Nothing found for %s" % name)
- return lyxstr
-
- start = 0
- del indx[0]
- indx.append(len(lyxstr))
- edic = {}
- exec('from numpy import *', edic)
- exec('set_printoptions(linewidth=65)', edic)
- # indx now contains [st0,en0, ..., stN,enN]
- # where stX is the start of code segment X
- # and enX is the start of \layout MyCode for
- # the X+1 code section (or string length if X=N)
- for k in range(num):
- # first write everything up to the start of the code segment
- substr = lyxstr[start:indx[2*k]]
- outstr.write(substr)
- if start > 0:
- mat = newre.search(substr)
- # if PYNEW found, then start a new namespace
- if mat:
- edic = {}
- exec('from numpy import *', edic)
- exec('set_printoptions(linewidth=65)', edic)
- # now find the code in the code segment
- # endoutput will contain the index just past any output
- # already present in the lyx string.
- substr = lyxstr[indx[2*k]:indx[2*k+1]]
- lyxcodestr, endcode = getnewcodestr(substr, edic)
- # write the lyx for the input + new output
- outstr.write(lyxcodestr)
- outstr.write('\n')
- start = endcode + indx[2*k]
-
- outstr.write(lyxstr[start:])
- return outstr.getvalue()
-
-
-def main(args):
- usage = "%prog {options} filename"
- parser = optparse.OptionParser(usage)
- parser.add_option('-n', '--name', default='MyCode')
-
- options, args = parser.parse_args(args)
- if len(args) < 1:
- parser.error("incorrect number of arguments")
-
- os.system('cp -f %s %s.bak' % (args[0], args[0]))
- fid = file(args[0])
- str = fid.read()
- fid.close()
- print("Processing %s" % options.name)
- newstr = runpycode(str, options.name)
- fid = file(args[0], 'w')
- fid.write(newstr)
- fid.close()
-
-if __name__ == "__main__":
- main(sys.argv[1:])
diff --git a/doc/pyrex/MANIFEST b/doc/pyrex/MANIFEST
deleted file mode 100644
index feb3ec22a..000000000
--- a/doc/pyrex/MANIFEST
+++ /dev/null
@@ -1,2 +0,0 @@
-numpyx.pyx
-setup.py
diff --git a/doc/pyrex/Makefile b/doc/pyrex/Makefile
deleted file mode 100644
index b5905e7be..000000000
--- a/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/doc/pyrex/README.txt b/doc/pyrex/README.txt
deleted file mode 100644
index 9df1e6c8e..000000000
--- a/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/doc/pyrex/c_numpy.pxd b/doc/pyrex/c_numpy.pxd
deleted file mode 100644
index 8064091e0..000000000
--- a/doc/pyrex/c_numpy.pxd
+++ /dev/null
@@ -1,126 +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
- cdef int flags
- 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/doc/pyrex/c_python.pxd b/doc/pyrex/c_python.pxd
deleted file mode 100644
index 53f6d9b19..000000000
--- a/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/doc/pyrex/notes b/doc/pyrex/notes
deleted file mode 100644
index 301581cee..000000000
--- a/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/doc/pyrex/numpyx.c b/doc/pyrex/numpyx.c
deleted file mode 100644
index e250eae19..000000000
--- a/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/doc/pyrex/numpyx.pyx b/doc/pyrex/numpyx.pyx
deleted file mode 100644
index 068d251f6..000000000
--- a/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/doc/pyrex/run_test.py b/doc/pyrex/run_test.py
deleted file mode 100755
index 5ffd7e80f..000000000
--- a/doc/pyrex/run_test.py
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/usr/bin/env python
-from __future__ import division, absolute_import, print_function
-
-from numpyx import test
-test()
diff --git a/doc/pyrex/setup.py b/doc/pyrex/setup.py
deleted file mode 100644
index 361ccb183..000000000
--- a/doc/pyrex/setup.py
+++ /dev/null
@@ -1,50 +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 __future__ import division, print_function
-
-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/doc/release/1.8.0-notes.rst b/doc/release/1.8.0-notes.rst
index b1adbf87e..f06785f5d 100644
--- a/doc/release/1.8.0-notes.rst
+++ b/doc/release/1.8.0-notes.rst
@@ -373,6 +373,14 @@ an inner loop for user types using the descr.
* PyUFunc_RegisterLoopForDescr
+C-API Developer Improvements
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The ``PyArray_Type`` instance creation function ``tp_new`` now
+uses ``tp_basicsize`` to determine how much memory to allocate.
+In previous releases only ``sizeof(PyArrayObject)`` bytes of
+memory were allocated, often requiring C-API subtypes to
+reimplement ``tp_new``.
+
Deprecations
============
diff --git a/doc/release/1.8.1-notes.rst b/doc/release/1.8.1-notes.rst
new file mode 100644
index 000000000..c26a03eff
--- /dev/null
+++ b/doc/release/1.8.1-notes.rst
@@ -0,0 +1,95 @@
+NumPy 1.8.1 Release Notes
+*************************
+
+This is a bugfix only release in the 1.8.x series.
+
+
+Issues fixed
+============
+
+* gh-4276: Fix mean, var, std methods for object arrays
+* gh-4262: remove insecure mktemp usage
+* gh-2385: absolute(complex(inf)) raises invalid warning in python3
+* gh-4024: Sequence assignment doesn't raise exception on shape mismatch
+* gh-4027: Fix chunked reading of strings longer than BUFFERSIZE
+* gh-4109: Fix object scalar return type of 0-d array indices
+* gh-4018: fix missing check for memory allocation failure in ufuncs
+* gh-4156: high order linalg.norm discards imaginary elements of complex arrays
+* gh-4144: linalg: norm fails on longdouble, signed int
+* gh-4094: fix NaT handling in _strided_to_strided_string_to_datetime
+* gh-4051: fix uninitialized use in _strided_to_strided_string_to_datetime
+* gh-4093: Loading compressed .npz file fails under Python 2.6.6
+* gh-4138: segfault with non-native endian memoryview in python 3.4
+* gh-4123: Fix missing NULL check in lexsort
+* gh-4170: fix native-only long long check in memoryviews
+* gh-4187: Fix large file support on 32 bit
+* gh-4152: fromfile: ensure file handle positions are in sync in python3
+* gh-4176: clang compatibility: Typos in conversion_utils
+* gh-4223: Fetching a non-integer item caused array return
+* gh-4197: fix minor memory leak in memoryview failure case
+* gh-4206: fix build with single-threaded python
+* gh-4220: add versionadded:: 1.8.0 to ufunc.at docstring
+* gh-4267: improve handling of memory allocation failure
+* gh-4267: fix use of capi without gil in ufunc.at
+* gh-4261: Detect vendor versions of GNU Compilers
+* gh-4253: IRR was returning nan instead of valid negative answer
+* gh-4254: fix unnecessary byte order flag change for byte arrays
+* gh-3263: numpy.random.shuffle clobbers mask of a MaskedArray
+* gh-4270: np.random.shuffle not work with flexible dtypes
+* gh-3173: Segmentation fault when 'size' argument to random.multinomial
+* gh-2799: allow using unique with lists of complex
+* gh-3504: fix linspace truncation for integer array scalar
+* gh-4191: get_info('openblas') does not read libraries key
+* gh-3348: Access violation in _descriptor_from_pep3118_format
+* gh-3175: segmentation fault with numpy.array() from bytearray
+* gh-4266: histogramdd - wrong result for entries very close to last boundary
+* gh-4408: Fix stride_stricks.as_strided function for object arrays
+* gh-4225: fix log1p and exmp1 return for np.inf on windows compiler builds
+* gh-4359: Fix infinite recursion in str.format of flex arrays
+* gh-4145: Incorrect shape of broadcast result with the exponent operator
+* gh-4483: Fix commutativity of {dot,multiply,inner}(scalar, matrix_of_objs)
+* gh-4466: Delay npyiter size check when size may change
+* gh-4485: Buffered stride was erroneously marked fixed
+* gh-4354: byte_bounds fails with datetime dtypes
+* gh-4486: segfault/error converting from/to high-precision datetime64 objects
+* gh-4428: einsum(None, None, None, None) causes segfault
+* gh-4134: uninitialized use for for size 1 object reductions
+
+Changes
+=======
+
+NDIter
+~~~~~~
+When ``NpyIter_RemoveAxis`` is now called, the iterator range will be reset.
+
+When a multi index is being tracked and an iterator is not buffered, it is
+possible to use ``NpyIter_RemoveAxis``. In this case an iterator can shrink
+in size. Because the total size of an iterator is limited, the iterator
+may be too large before these calls. In this case its size will be set to ``-1``
+and an error issued not at construction time but when removing the multi
+index, setting the iterator range, or getting the next function.
+
+This has no effect on currently working code, but highlights the necessity
+of checking for an error return if these conditions can occur. In most
+cases the arrays being iterated are as large as the iterator so that such
+a problem cannot occur.
+
+Optional reduced verbosity for np.distutils
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Set ``numpy.distutils.system_info.system_info.verbosity = 0`` and then
+calls to ``numpy.distutils.system_info.get_info('blas_opt')`` will not
+print anything on the output. This is mostly for other packages using
+numpy.distutils.
+
+Deprecations
+============
+
+C-API
+~~~~~
+
+The utility function npy_PyFile_Dup and npy_PyFile_DupClose are broken by the
+internal buffering python 3 applies to its file objects.
+To fix this two new functions npy_PyFile_Dup2 and npy_PyFile_DupClose2 are
+declared in npy_3kcompat.h and the old functions are deprecated.
+Due to the fragile nature of these functions it is recommended to instead use
+the python API when possible.
diff --git a/doc/release/1.9.0-notes.rst b/doc/release/1.9.0-notes.rst
index aaa2415f2..e1e958e9d 100644
--- a/doc/release/1.9.0-notes.rst
+++ b/doc/release/1.9.0-notes.rst
@@ -1,34 +1,244 @@
NumPy 1.9.0 Release Notes
*************************
-This release supports Python 2.6 -2.7 and 3.2 - 3.3.
+This release supports Python 2.6 - 2.7 and 3.2 - 3.4.
Highlights
==========
+* Addition of `__numpy_ufunc__` to allow overriding ufuncs in ndarray
+ subclasses.
+* Numerous performance improvements in various areas, most notably indexing and
+ operations on small arrays are significantly faster.
+ Indexing operations now also release the GIL.
+* Addition of `nanmedian` and `nanpercentile` rounds out the nanfunction set.
Dropped Support
===============
-The oldnumeric and numarray modules have been removed.
+* The oldnumeric and numarray modules have been removed.
+* The doc/pyrex and doc/cython directories have been removed.
+* The doc/numpybook directory has been removed.
+* The numpy/testing/numpytest.py file has been removed together with
+ the importall function it contained.
+
Future Changes
==============
+* The numpy/polynomial/polytemplate.py file will be removed in NumPy 1.10.0.
+* Default casting for inplace operations will change to 'same_kind' in
+ Numpy 1.10.0. This will certainly break some code that is currently
+ ignoring the warning.
+* Relaxed stride checking will be the default in 1.10.0
+* String version checks will break because, e.g., '1.9' > '1.10' is True. A
+ NumpyVersion class has been added that can be used for such comparisons.
+* The diagonal and diag functions will return writeable views in 1.10.0
+
Compatibility notes
===================
+The diagonal and diag functions return readonly views.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+In NumPy 1.8, the diagonal and diag functions returned readonly copies, in
+NumPy 1.9 they return readonly views, and in 1.10 they will return writeable
+views.
+
+Special scalar float values don't cause upcast to double anymore
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+In previous numpy versions operations involving floating point scalars
+containing special values ``NaN``, ``Inf`` and ``-Inf`` caused the result
+type to be at least ``float64``. As the special values can be represented
+in the smallest available floating point type, the upcast is not performed
+anymore.
+
+For example the dtype of:
+
+ ``np.array([1.], dtype=np.float32) * float('nan')``
+
+now remains ``float32`` instead of being cast to ``float64``.
+Operations involving non-special values have not been changed.
+
Percentile output changes
~~~~~~~~~~~~~~~~~~~~~~~~~
-If given more than one percentile to compute numpy.percentile returns an array
-instead of a list. A single percentile still returns a scalar.
-The array is equivalent to converting the the list returned in older versions
-to an array via `np.array`.
+If given more than one percentile to compute numpy.percentile returns an
+array instead of a list. A single percentile still returns a scalar. The
+array is equivalent to converting the list returned in older versions
+to an array via ``np.array``.
+
+If the ``overwrite_input`` option is used the input is only partially
+instead of fully sorted.
+
+ndarray.tofile exception type
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+All ``tofile`` exceptions are now ``IOError``, some were previously
+``ValueError``.
+
+Invalid fill value exceptions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Two changes to numpy.ma.core._check_fill_value:
+
+* When the fill value is a string and the array type is not one of
+ 'OSUV', TypeError is raised instead of the default fill value being used.
+
+* When the fill value overflows the array type, TypeError is raised instead
+ of OverflowError.
+
+Polynomial Classes no longer derived from PolyBase
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+This may cause problems with folks who depended on the polynomial classes
+being derived from PolyBase. They are now all derived from the abstract
+base class ABCPolyBase. Strictly speaking, there should be a deprecation
+involved, but no external code making use of the old baseclass could be
+found.
+
+Using numpy.random.binomial may change the RNG state vs. numpy < 1.9
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+A bug in one of the algorithms to generate a binomial random variate has
+been fixed. This change will likely alter the number of random draws
+performed, and hence the sequence location will be different after a
+call to distribution.c::rk_binomial_btpe. Any tests which rely on the RNG
+being in a known state should be checked and/or updated as a result.
+
+Random seed enforced to be a 32 bit unsigned integer
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+``np.random.seed`` and ``np.random.RandomState`` now throw a ``ValueError``
+if the seed cannot safely be converted to 32 bit unsigned integers.
+Applications that now fail can be fixed by masking the higher 32 bit values to
+zero: ``seed = seed & 0xFFFFFFFF``. This is what is done silently in older
+versions so the random stream remains the same.
+
+Argmin and argmax out argument
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The ``out`` argument to ``np.argmin`` and ``np.argmax`` and their
+equivalent C-API functions is now checked to match the desired output shape
+exactly. If the check fails a ``ValueError`` instead of ``TypeError`` is
+raised.
+
+Einsum
+~~~~~~
+Remove unnecessary broadcasting notation restrictions.
+``np.einsum('ijk,j->ijk', A, B)`` can also be written as
+``np.einsum('ij...,j->ij...', A, B)`` (ellipsis is no longer required on 'j')
+
+Indexing
+~~~~~~~~
+
+The NumPy indexing has seen a complete rewrite in this version. This makes
+most advanced integer indexing operations much faster and should have no
+other implications. However some subtle changes and deprecations were
+introduced in advanced indexing operations:
+
+* Boolean indexing into scalar arrays will always return a new 1-d array.
+ This means that ``array(1)[array(True)]`` gives ``array([1])`` and
+ not the original array.
+
+* Advanced indexing into one dimensional arrays used to have
+ (undocumented) special handling regarding repeating the value array in
+ assignments when the shape of the value array was too small or did not
+ match. Code using this will raise an error. For compatibility you can
+ use ``arr.flat[index] = values``, which uses the old code branch. (for
+ example ``a = np.ones(10); a[np.arange(10)] = [1, 2, 3]``)
+
+* The iteration order over advanced indexes used to be always C-order.
+ In NumPy 1.9. the iteration order adapts to the inputs and is not
+ guaranteed (with the exception of a *single* advanced index which is
+ never reversed for compatibility reasons). This means that the result
+ is undefined if multiple values are assigned to the same element. An
+ example for this is ``arr[[0, 0], [1, 1]] = [1, 2]``, which may set
+ ``arr[0, 1]`` to either 1 or 2.
+
+* Equivalent to the iteration order, the memory layout of the advanced
+ indexing result is adapted for faster indexing and cannot be predicted.
+
+* All indexing operations return a view or a copy. No indexing operation
+ will return the original array object. (For example ``arr[...]``)
+
+* In the future Boolean array-likes (such as lists of python bools) will
+ always be treated as Boolean indexes and Boolean scalars (including
+ python ``True``) will be a legal *boolean* index. At this time, this is
+ already the case for scalar arrays to allow the general
+ ``positive = a[a > 0]`` to work when ``a`` is zero dimensional.
+
+* In NumPy 1.8 it was possible to use ``array(True)`` and
+ ``array(False)`` equivalent to 1 and 0 if the result of the operation
+ was a scalar. This will raise an error in NumPy 1.9 and, as noted
+ above, treated as a boolean index in the future.
+
+* All non-integer array-likes are deprecated, object arrays of custom
+ integer like objects may have to be cast explicitly.
+
+* The error reporting for advanced indexing is more informative, however
+ the error type has changed in some cases. (Broadcasting errors of
+ indexing arrays are reported as ``IndexError``)
+
+* Indexing with more then one ellipsis (``...``) is deprecated.
+
+``promote_types`` and string dtype
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+``promote_types`` function now returns a valid string length when given an
+integer or float dtype as one argument and a string dtype as another
+argument. Previously it always returned the input string dtype, even if it
+wasn't long enough to store the max integer/float value converted to a
+string.
+
+``can_cast`` and string dtype
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+``can_cast`` function now returns False in "safe" casting mode for
+integer/float dtype and string dtype if the string dtype length is not long
+enough to store the max integer/float value converted to a string.
+Previously ``can_cast`` in "safe" mode returned True for integer/float
+dtype and a string dtype of any length.
+
+astype and string dtype
+~~~~~~~~~~~~~~~~~~~~~~~
+The ``astype`` method now returns an error if the string dtype to cast to
+is not long enough in "safe" casting mode to hold the max value of
+integer/float array that is being casted. Previously the casting was
+allowed even if the result was truncated.
-If the `overwrite_input` option is used the input is only partially instead of
-fully sorted.
+`npyio.recfromcsv` keyword arguments change
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+`npyio.recfromcsv` no longer accepts the undocumented `update` keyword,
+which used to override the `dtype` keyword.
+
+The ``doc/swig`` directory moved
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The ``doc/swig`` directory has been moved to ``tools/swig``.
+
+The ``npy_3kcompat.h`` header changed
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The unused ``simple_capsule_dtor`` function has been removed from
+``npy_3kcompat.h``. Note that this header is not meant to be used outside
+of numpy; other projects should be using their own copy of this file when
+needed.
+
+Negative indices in C-Api ``sq_item`` and ``sq_ass_item`` sequence methods
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+When directly accessing the ``sq_item`` or ``sq_ass_item`` PyObject slots
+for item getting, negative indices will not be supported anymore.
+``PySequence_GetItem`` and ``PySequence_SetItem`` however fix negative
+indices so that they can be used there.
+
+NDIter
+~~~~~~
+When ``NpyIter_RemoveAxis`` is now called, the iterator range will be reset.
+
+When a multi index is being tracked and an iterator is not buffered, it is
+possible to use ``NpyIter_RemoveAxis``. In this case an iterator can shrink
+in size. Because the total size of an iterator is limited, the iterator
+may be too large before these calls. In this case its size will be set to ``-1``
+and an error issued not at construction time but when removing the multi
+index, setting the iterator range, or getting the next function.
+
+This has no effect on currently working code, but highlights the necessity
+of checking for an error return if these conditions can occur. In most
+cases the arrays being iterated are as large as the iterator so that such
+a problem cannot occur.
+
+This change was already applied to the 1.8.1 release.
New Features
@@ -36,54 +246,145 @@ New Features
Percentile supports more interpolation options
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-`np.percentile` now has the interpolation keyword argument to specify in which
-way points should be interpolated if the percentiles fall between two values.
-See the documentation for the available options.
+``np.percentile`` now has the interpolation keyword argument to specify in
+which way points should be interpolated if the percentiles fall between two
+values. See the documentation for the available options.
+
+Generalized axis support for median and percentile
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+``np.median`` and ``np.percentile`` now support generalized axis arguments like
+ufunc reductions do since 1.7. One can now say axis=(index, index) to pick a
+list of axes for the reduction. The ``keepdims`` keyword argument was also
+added to allow convenient broadcasting to arrays of the original shape.
Ufunc and Dot Overrides
~~~~~~~~~~~~~~~~~~~~~~~
-
-For better compatibility with external objects you can now override universal
-functions (ufuncs), ``numpy.core._dotblas.dot``, and
+For better compatibility with external objects you can now override
+universal functions (ufuncs), ``numpy.core._dotblas.dot``, and
``numpy.core.multiarray.dot`` (the numpy.dot functions). By defining a
``__numpy_ufunc__`` method.
-Dtype parameter added to `np.linspace` and `np.logspace`
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-The returned data type from the `linspace` and `logspace` functions
-can now be specificed using the dtype parameter.
+Dtype parameter added to ``np.linspace`` and ``np.logspace``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The returned data type from the ``linspace`` and ``logspace`` functions can
+now be specified using the dtype parameter.
+
+More general ``np.triu`` and ``np.tril`` broadcasting
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+For arrays with ``ndim`` exceeding 2, these functions will now apply to the
+final two axes instead of raising an exception.
+
+``tobytes`` alias for ``tostring`` method
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+``ndarray.tobytes`` and ``MaskedArray.tobytes`` have been added as aliases
+for ``tostring`` which exports arrays as ``bytes``. This is more consistent
+in Python 3 where ``str`` and ``bytes`` are not the same.
+
+Build system
+~~~~~~~~~~~~
+Added experimental support for the ppc64le and OpenRISC architecture.
+
+Compatibility to python ``numbers`` module
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+All numerical numpy types are now registered with the type hierarchy in
+the python ``numbers`` module.
+
+``increasing`` parameter added to ``np.vander``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The ordering of the columns of the Vandermonde matrix can be specified with
+this new boolean argument.
+
+``unique_counts`` parameter added to ``np.unique``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The number of times each unique item comes up in the input can now be
+obtained as an optional return value.
+
+Support for median and percentile in nanfunctions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The ``np.nanmedian`` and ``np.nanpercentile`` functions behave like
+the median and percentile functions except that NaNs are ignored.
+
+NumpyVersion class added
+~~~~~~~~~~~~~~~~~~~~~~~~
+The class may be imported from numpy.lib and can be used for version
+comparison when the numpy version goes to 1.10.devel. For example::
+
+ >>> from numpy.lib import NumpyVersion
+ >>> if NumpyVersion(np.__version__) < '1.10.0'):
+ ... print('Wow, that is an old NumPy version!')
+
+Allow saving arrays with large number of named columns
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The numpy storage format 1.0 only allowed the array header to have a total size
+of 65535 bytes. This can be exceeded by structured arrays with a large number
+of columns. A new format 2.0 has been added which extends the header size to 4
+GiB. `np.save` will automatically save in 2.0 format if the data requires it,
+else it will always use the more compatible 1.0 format.
+
+Full broadcasting support for ``np.cross``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+``np.cross`` now properly broadcasts its two input arrays, even if they
+have different number of dimensions. In earlier versions this would result
+in either an error being raised, or wrong results computed.
+
Improvements
============
-Percentile implemented in terms of `np.partition`
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-`np.percentile` has been implemented interms of `np.partition` which only
-partially sorts the data via a selection algorithm. This improves the time
-complexcity from `O(nlog(n))` to `O(n)`.
+Percentile implemented in terms of ``np.partition``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+``np.percentile`` has been implemented in terms of ``np.partition`` which
+only partially sorts the data via a selection algorithm. This improves the
+time complexity from ``O(nlog(n))`` to ``O(n)``.
-Performance improvement for `np.array`
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Performance improvement for ``np.array``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The performance of converting lists containing arrays to arrays using
-`np.array` has been improved. It is now equivalent in speed to
-`np.vstack(list)`.
+``np.array`` has been improved. It is now equivalent in speed to
+``np.vstack(list)``.
+Performance improvement for ``np.searchsorted``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+For the built-in numeric types, ``np.searchsorted`` no longer relies on the
+data type's ``compare`` function to perform the search, but is now
+implemented by type specific functions. Depending on the size of the
+inputs, this can result in performance improvements over 2x.
-Changes
-=======
+Optional reduced verbosity for np.distutils
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Set ``numpy.distutils.system_info.system_info.verbosity = 0`` and then
+calls to ``numpy.distutils.system_info.get_info('blas_opt')`` will not
+print anything on the output. This is mostly for other packages using
+numpy.distutils.
-Argmin and argmax out argument
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Covariance check in ``np.random.multivariate_normal``
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+A ``RuntimeWarning`` warning is raised when the covariance matrix is not
+positive-semidefinite.
+
+Polynomial Classes no longer template based
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The polynomial classes have been refactored to use an abstract base class
+rather than a template in order to implement a common interface. This makes
+importing the polynomial package faster as the classes do not need to be
+compiled on import.
+
+More GIL releases
+~~~~~~~~~~~~~~~~~
+Several more functions now release the Global Interpreter Lock allowing more
+efficient parallization using the ``threading`` module. Most notably the GIL is
+now released for fancy indexing, ``np.where`` and the ``random`` module now
+uses a per-state lock instead of the GIL.
+
+MaskedArray support for more complicated base classes
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Built-in assumptions that the baseclass behaved like a plain array are being
+removed. In particalur, ``repr`` and ``str`` should now work more reliably.
-The `out` argument to `np.argmin` and `np.argmax` and their equivalent
-C-API functions is now checked to match the desired output shape exactly.
-If the check fails a `ValueError` instead of `TypeError` is raised.
-
C-API
~~~~~
-None
Deprecations
============
@@ -91,14 +392,47 @@ Deprecations
Non-integer scalars for sequence repetition
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using non-integer numpy scalars to repeat python sequences is deprecated.
-For example `np.float_(2) * [1]` will be an error in the future.
+For example ``np.float_(2) * [1]`` will be an error in the future.
-C-API
-~~~~~
+``select`` input deprecations
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The integer and empty input to ``select`` is deprecated. In the future only
+boolean arrays will be valid conditions and an empty ``condlist`` will be
+considered an input error instead of returning the default.
-None
+``rank`` function
+~~~~~~~~~~~~~~~~~
+The ``rank`` function has been deprecated to avoid confusion with
+``numpy.linalg.matrix_rank``.
+Object array equality comparisons
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+In the future object array comparisons both `==` and `np.equal` will not
+make use of identity checks anymore. For example:
-New Features
-============
+>>> a = np.array([np.array([1, 2, 3]), 1])
+>>> b = np.array([np.array([1, 2, 3]), 1])
+>>> a == b
+
+will consistently return False (and in the future an error) even if the array
+in `a` and `b` was the same object.
+
+The equality operator `==` will in the future raise errors like `np.equal`
+if broadcasting or element comparisons, etc. fails.
+
+Comparison with `arr == None` will in the future do an elementwise comparison
+instead of just returning False. Code should be using `arr is None`.
+
+All of these changes will give Deprecation- or FutureWarnings at this time.
+
+C-API
+~~~~~
+
+The utility function npy_PyFile_Dup and npy_PyFile_DupClose are broken by the
+internal buffering python 3 applies to its file objects.
+To fix this two new functions npy_PyFile_Dup2 and npy_PyFile_DupClose2 are
+declared in npy_3kcompat.h and the old functions are deprecated.
+Due to the fragile nature of these functions it is recommended to instead use
+the python API when possible.
+This change was already applied to the 1.8.1 release.
diff --git a/doc/scipy-sphinx-theme b/doc/scipy-sphinx-theme
-Subproject 65c59fe6a516e23db50ecb8ca160b9f9de12dc1
+Subproject c466764e2231ba132c09826b5b138fffa1cfcec
diff --git a/doc/source/_templates/indexcontent.html b/doc/source/_templates/indexcontent.html
index fb753e7b7..e3fe3ac9b 100644
--- a/doc/source/_templates/indexcontent.html
+++ b/doc/source/_templates/indexcontent.html
@@ -34,6 +34,7 @@
<td width="50%">
<p class="biglink"><a class="biglink" href="{{ pathto("bugs") }}">Reporting bugs</a></p>
<p class="biglink"><a class="biglink" href="{{ pathto("about") }}">About NumPy</a></p>
+ <p class="biglink"><a class="biglink" href="{{ pathto("neps/index") }}">Numpy Enhancement Proposals</a><br/>
</td><td width="50%">
<p class="biglink"><a class="biglink" href="{{ pathto("release") }}">Release Notes</a></p>
<p class="biglink"><a class="biglink" href="{{ pathto("license") }}">License of Numpy</a></p>
@@ -47,12 +48,14 @@
Public Domain in August 2008). The reference documentation for many of
the functions are written by numerous contributors and developers of
Numpy, both prior to and during the
- <a href="http://scipy.org/Developer_Zone/DocMarathon2008">Numpy Documentation Marathon</a>.
+ <a href="http://docs.scipy.org/numpy/">Numpy Documentation Marathon</a>.
</p>
<p>
- The Documentation Marathon is still ongoing. Please help us write
- better documentation for Numpy by joining it! Instructions on how to
- join and what to do can be found
- <a href="http://scipy.org/Developer_Zone/DocMarathon2008">on the scipy.org website</a>.
+ The preferred way to update the documentation is by submitting a pull
+ request on Github (see the
+ <a href="http://docs.scipy.org/doc/numpy-dev/dev/">Developer Guide</a>.
+ The <a href="http://docs.scipy.org/numpy/">Numpy Documentation Wiki</a>
+ can also still be used to submit documentation fixes.
+ Please help us to further improve the Numpy documentation!
</p>
{% endblock %}
diff --git a/doc/source/contents.rst b/doc/source/contents.rst
index 023ebb8a0..1d46e8c7b 100644
--- a/doc/source/contents.rst
+++ b/doc/source/contents.rst
@@ -8,6 +8,7 @@ Numpy manual contents
reference/index
f2py/index
dev/index
+ neps/index
release
about
bugs
diff --git a/doc/source/f2py/python-usage.rst b/doc/source/f2py/python-usage.rst
index 83454c440..c7c7e3fd0 100644
--- a/doc/source/f2py/python-usage.rst
+++ b/doc/source/f2py/python-usage.rst
@@ -17,20 +17,14 @@ computational part of such functions is implemented in C or Fortran
and wrapped with F2PY (or any other tool capable of providing CObject
of a function).
-.. example::
-
- Consider a `Fortran 77 file`__ ``ftype.f``:
+Consider a Fortran 77 file ``ftype.f``:
.. include:: ftype.f
:literal:
- and build a wrapper using::
-
- f2py -c ftype.f -m ftype
+and build a wrapper using ``f2py -c ftype.f -m ftype``.
- __ ftype.f
-
- In Python:
+In Python:
.. include:: ftype_session.dat
:literal:
@@ -54,18 +48,14 @@ type-casting only the real part of a complex number is used.
order to *in situ* changes to be effective. It is recommended to use
arrays with proper type but also other types work.
-.. example::
-
- Consider the following `Fortran 77 code`__:
+Consider the following Fortran 77 code:
.. include:: scalar.f
:literal:
- and wrap it using ``f2py -c -m scalar scalar.f``.
+and wrap it using ``f2py -c -m scalar scalar.f``.
- __ scalar.f
-
- In Python:
+In Python:
.. include:: scalar_session.dat
:literal:
@@ -88,18 +78,14 @@ Because Python strings are immutable, an ``intent(inout)`` argument
expects an array version of a string in order to *in situ* changes to
be effective.
-.. example::
-
- Consider the following `Fortran 77 code`__:
+Consider the following Fortran 77 code:
.. include:: string.f
:literal:
- and wrap it using ``f2py -c -m mystring string.f``.
+and wrap it using ``f2py -c -m mystring string.f``.
- __ string.f
-
- Python session:
+Python session:
.. include:: string_session.dat
:literal:
@@ -164,18 +150,14 @@ them to Fortran routines, use a function
``as_column_major_storage(<array>)`` that is provided by all F2PY
generated extension modules.
-.. example::
-
- Consider `Fortran 77 code`__:
+Consider Fortran 77 code:
.. include:: array.f
:literal:
- and wrap it using ``f2py -c -m arr array.f -DF2PY_REPORT_ON_ARRAY_COPY=1``.
+and wrap it using ``f2py -c -m arr array.f -DF2PY_REPORT_ON_ARRAY_COPY=1``.
- __ array.f
-
- In Python:
+In Python:
.. include:: array_session.dat
:literal:
@@ -187,19 +169,14 @@ Call-back arguments
F2PY supports calling Python functions from Fortran or C codes.
-
-.. example::
-
- Consider the following `Fortran 77 code`__
+Consider the following Fortran 77 code:
.. include:: callback.f
:literal:
- and wrap it using ``f2py -c -m callback callback.f``.
-
- __ callback.f
+and wrap it using ``f2py -c -m callback callback.f``.
- In Python:
+In Python:
.. include:: callback_session.dat
:literal:
@@ -217,53 +194,41 @@ block, use ``use`` statement as illustrated below. The same signature
of a callback argument can be referred in different routine
signatures.
-.. example::
-
- We use the same `Fortran 77 code`__ as in previous example but now
- we'll pretend that F2PY was not able to guess the signatures of
- call-back arguments correctly. First, we create an initial signature
- file ``callback2.pyf`` using F2PY::
+We use the same Fortran 77 code as in previous example but now
+we'll pretend that F2PY was not able to guess the signatures of
+call-back arguments correctly. First, we create an initial signature
+file ``callback2.pyf`` using F2PY::
f2py -m callback2 -h callback2.pyf callback.f
- Then modify it as follows
+Then modify it as follows
.. include:: callback2.pyf
:literal:
- Finally, build the extension module using::
-
- f2py -c callback2.pyf callback.f
-
- An example Python session would be identical to the previous example
- except that argument names would differ.
+Finally, build the extension module using ``f2py -c callback2.pyf callback.f``.
- __ callback.f
+An example Python session would be identical to the previous example
+except that argument names would differ.
Sometimes a Fortran package may require that users provide routines
that the package will use. F2PY can construct an interface to such
routines so that Python functions could be called from Fortran.
-.. example::
-
- Consider the following `Fortran 77 subroutine`__ that takes an array
- and applies a function ``func`` to its elements.
+Consider the following `Fortran 77 subroutine`__ that takes an array
+and applies a function ``func`` to its elements.
.. include:: calculate.f
:literal:
- __ calculate.f
-
- It is expected that function ``func`` has been defined
- externally. In order to use a Python function as ``func``, it must
- have an attribute ``intent(callback)`` (it must be specified before
- the ``external`` statement).
+It is expected that function ``func`` has been defined
+externally. In order to use a Python function as ``func``, it must
+have an attribute ``intent(callback)`` (it must be specified before
+the ``external`` statement).
- Finally, build an extension module using::
+Finally, build an extension module using ``f2py -c -m foo calculate.f``
- f2py -c -m foo calculate.f
-
- In Python:
+In Python:
.. include:: calculate_session.dat
:literal:
@@ -278,18 +243,14 @@ Then it is not necessary to pass the function in the argument list to
the Fortran function. This may be desired if the Fortran function calling
the python callback function is itself called by another Fortran function.
-.. example::
-
- Consider the following `Fortran 77 subroutine`__.
+Consider the following Fortran 77 subroutine:
.. include:: extcallback.f
:literal:
- __ extcallback.f
+and wrap it using ``f2py -c -m pfromf extcallback.f``.
- and wrap it using ``f2py -c -m pfromf extcallback.f``.
-
- In Python:
+In Python:
.. include:: extcallback_session.dat
:literal:
@@ -343,7 +304,6 @@ following rules are applied:
* If ``k > l``, then only ``x_1, ..., x_l`` are set.
-
Common blocks
==============
@@ -359,61 +319,51 @@ directly link to data members in common blocks. Data members can be
changed by direct assignment or by in-place changes to the
corresponding array objects.
-.. example::
-
- Consider the following `Fortran 77 code`__
+Consider the following Fortran 77 code:
.. include:: common.f
:literal:
- and wrap it using ``f2py -c -m common common.f``.
+and wrap it using ``f2py -c -m common common.f``.
- __ common.f
-
- In Python:
+In Python:
.. include:: common_session.dat
:literal:
+
Fortran 90 module data
=======================
The F2PY interface to Fortran 90 module data is similar to Fortran 77
common blocks.
-.. example::
-
- Consider the following `Fortran 90 code`__
+Consider the following Fortran 90 code:
.. include:: moddata.f90
:literal:
- and wrap it using ``f2py -c -m moddata moddata.f90``.
-
- __ moddata.f90
+and wrap it using ``f2py -c -m moddata moddata.f90``.
- In Python:
+In Python:
.. include:: moddata_session.dat
:literal:
+
Allocatable arrays
-------------------
F2PY has basic support for Fortran 90 module allocatable arrays.
-.. example::
-
- Consider the following `Fortran 90 code`__
+Consider the following Fortran 90 code:
.. include:: allocarr.f90
:literal:
- and wrap it using ``f2py -c -m allocarr allocarr.f90``.
-
- __ allocarr.f90
+and wrap it using ``f2py -c -m allocarr allocarr.f90``.
- In Python:
+In Python:
.. include:: allocarr_session.dat
:literal:
diff --git a/doc/source/f2py/usage.rst b/doc/source/f2py/usage.rst
index 2f9017faa..a6f093154 100644
--- a/doc/source/f2py/usage.rst
+++ b/doc/source/f2py/usage.rst
@@ -183,7 +183,7 @@ Other options:
without the ``-h`` switch.
``--build-dir <dirname>``
All F2PY generated files are created in ``<dirname>``. Default is
- ``tempfile.mktemp()``.
+ ``tempfile.mkdtemp()``.
``--quiet``
Run quietly.
``--verbose``
diff --git a/doc/source/neps/datetime-proposal.rst b/doc/source/neps/datetime-proposal.rst
new file mode 100644
index 000000000..05f0182b7
--- /dev/null
+++ b/doc/source/neps/datetime-proposal.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/datetime-proposal.rst
diff --git a/doc/source/neps/datetime-proposal3.rst b/doc/source/neps/datetime-proposal3.rst
new file mode 100644
index 000000000..fa9102a96
--- /dev/null
+++ b/doc/source/neps/datetime-proposal3.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/datetime-proposal3.rst
diff --git a/doc/source/neps/deferred-ufunc-evaluation.rst b/doc/source/neps/deferred-ufunc-evaluation.rst
new file mode 100644
index 000000000..b4a7a457d
--- /dev/null
+++ b/doc/source/neps/deferred-ufunc-evaluation.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/deferred-ufunc-evaluation.rst
diff --git a/doc/source/neps/generalized-ufuncs.rst b/doc/source/neps/generalized-ufuncs.rst
new file mode 100644
index 000000000..8b28f0224
--- /dev/null
+++ b/doc/source/neps/generalized-ufuncs.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/generalized-ufuncs.rst
diff --git a/doc/source/neps/groupby_additions.rst b/doc/source/neps/groupby_additions.rst
new file mode 100644
index 000000000..61abc951e
--- /dev/null
+++ b/doc/source/neps/groupby_additions.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/groupby_additions.rst
diff --git a/doc/source/neps/index.rst b/doc/source/neps/index.rst
new file mode 100644
index 000000000..94cf563a4
--- /dev/null
+++ b/doc/source/neps/index.rst
@@ -0,0 +1,37 @@
+===========================
+Numpy Enhancement Proposals
+===========================
+
+Numpy Enhancement Proposals (NEPs) describe proposed changes to Numpy.
+NEPs are modeled on Python Enhancement Proposals (PEPs), and are typically
+written up when large changes to Numpy are proposed.
+
+This page provides an overview of all NEPs, making only a distinction between
+the ones that have been implemented and those that have not been implemented.
+
+Implemented NEPs
+----------------
+
+.. toctree::
+ :maxdepth: 1
+
+ ufunc-overrides
+ generalized-ufuncs
+ new-iterator-ufunc
+ npy-format
+
+Other NEPs
+----------
+
+.. toctree::
+ :maxdepth: 1
+
+ missing-data
+ math_config_clean
+ groupby_additions
+ warnfix
+ newbugtracker
+ deferred-ufunc-evaluation
+ structured_array_extensions
+ datetime-proposal
+ datetime-proposal3
diff --git a/doc/source/neps/math_config_clean.rst b/doc/source/neps/math_config_clean.rst
new file mode 100644
index 000000000..25b340e51
--- /dev/null
+++ b/doc/source/neps/math_config_clean.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/math_config_clean.rst
diff --git a/doc/source/neps/missing-data.rst b/doc/source/neps/missing-data.rst
new file mode 100644
index 000000000..f9899f1b0
--- /dev/null
+++ b/doc/source/neps/missing-data.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/missing-data.rst
diff --git a/doc/source/neps/new-iterator-ufunc.rst b/doc/source/neps/new-iterator-ufunc.rst
new file mode 100644
index 000000000..7e06aa8ae
--- /dev/null
+++ b/doc/source/neps/new-iterator-ufunc.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/new-iterator-ufunc.rst
diff --git a/doc/source/neps/newbugtracker.rst b/doc/source/neps/newbugtracker.rst
new file mode 100644
index 000000000..70ea21f8c
--- /dev/null
+++ b/doc/source/neps/newbugtracker.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/newbugtracker.rst
diff --git a/doc/source/neps/npy-format.rst b/doc/source/neps/npy-format.rst
new file mode 100644
index 000000000..bd1f2bb5c
--- /dev/null
+++ b/doc/source/neps/npy-format.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/npy-format.rst
diff --git a/doc/source/neps/structured_array_extensions.rst b/doc/source/neps/structured_array_extensions.rst
new file mode 100644
index 000000000..341e6c955
--- /dev/null
+++ b/doc/source/neps/structured_array_extensions.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/structured_array_extensions.rst
diff --git a/doc/source/neps/ufunc-overrides.rst b/doc/source/neps/ufunc-overrides.rst
new file mode 100644
index 000000000..2e293ec44
--- /dev/null
+++ b/doc/source/neps/ufunc-overrides.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/ufunc-overrides.rst
diff --git a/doc/source/neps/warnfix.rst b/doc/source/neps/warnfix.rst
new file mode 100644
index 000000000..1b9b1b87b
--- /dev/null
+++ b/doc/source/neps/warnfix.rst
@@ -0,0 +1 @@
+.. include:: ../../neps/warnfix.rst
diff --git a/doc/source/reference/arrays.dtypes.rst b/doc/source/reference/arrays.dtypes.rst
index 2fc1add99..797f1f6f8 100644
--- a/doc/source/reference/arrays.dtypes.rst
+++ b/doc/source/reference/arrays.dtypes.rst
@@ -220,16 +220,20 @@ One-character strings
Array-protocol type strings (see :ref:`arrays.interface`)
The first character specifies the kind of data and the remaining
- characters specify how many bytes of data. The supported kinds are
+ characters specify the number of bytes per item. The item size may
+ be ignored for some kinds (i.e., boolean, object), rounded to the
+ next supported size (float, complex), or interpreted as the number
+ of characters (Unicode). The supported kinds are
================ ========================
- ``'b'`` Boolean
+ ``'b'`` boolean
``'i'`` (signed) integer
``'u'`` unsigned integer
``'f'`` floating-point
``'c'`` complex-floating point
- ``'S'``, ``'a'`` string
- ``'U'`` unicode
+ ``'O'`` (Python) objects
+ ``'S'``, ``'a'`` (byte-)string
+ ``'U'`` Unicode
``'V'`` raw data (:class:`void`)
================ ========================
diff --git a/doc/source/reference/arrays.indexing.rst b/doc/source/reference/arrays.indexing.rst
index e759b6ff8..ef0180e0f 100644
--- a/doc/source/reference/arrays.indexing.rst
+++ b/doc/source/reference/arrays.indexing.rst
@@ -21,8 +21,8 @@ slicing, advanced indexing. Which one occurs depends on *obj*.
for the former.
-Basic Slicing
--------------
+Basic Slicing and Indexing
+--------------------------
Basic slicing extends Python's basic concept of slicing to N
dimensions. Basic slicing occurs when *obj* is a :class:`slice` object
@@ -31,9 +31,9 @@ integer, or a tuple of slice objects and integers. :const:`Ellipsis`
and :const:`newaxis` objects can be interspersed with these as
well. In order to remain backward compatible with a common usage in
Numeric, basic slicing is also initiated if the selection object is
-any sequence (such as a :class:`list`) containing :class:`slice`
+any non-ndarray sequence (such as a :class:`list`) containing :class:`slice`
objects, the :const:`Ellipsis` object, or the :const:`newaxis` object,
-but no integer arrays or other embedded sequences.
+but not for integer arrays or other embedded sequences.
.. index::
triple: ndarray; special methods; getslice
@@ -46,8 +46,8 @@ scalar <arrays.scalars>` representing the corresponding item. As in
Python, all indices are zero-based: for the *i*-th index :math:`n_i`,
the valid range is :math:`0 \le n_i < d_i` where :math:`d_i` is the
*i*-th element of the shape of the array. Negative indices are
-interpreted as counting from the end of the array (*i.e.*, if *i < 0*,
-it means :math:`n_i + i`).
+interpreted as counting from the end of the array (*i.e.*, if
+:math:`n_i < 0`, it means :math:`n_i + d_i`).
All arrays generated by basic slicing are always :term:`views <view>`
@@ -84,7 +84,7 @@ concepts to remember include:
- Assume *n* is the number of elements in the dimension being
sliced. Then, if *i* is not given it defaults to 0 for *k > 0* and
- *n* for *k < 0* . If *j* is not given it defaults to *n* for *k > 0*
+ *n - 1* for *k < 0* . If *j* is not given it defaults to *n* for *k > 0*
and -1 for *k < 0* . If *k* is not given it defaults to 1. Note that
``::`` is the same as ``:`` and means select all indices along this
axis.
@@ -108,8 +108,8 @@ concepts to remember include:
[6]]])
- :const:`Ellipsis` expand to the number of ``:`` objects needed to
- make a selection tuple of the same length as ``x.ndim``. Only the
- first ellipsis is expanded, any others are interpreted as ``:``.
+ make a selection tuple of the same length as ``x.ndim``. There may
+ only be a single ellipsis present.
.. admonition:: Example
@@ -148,7 +148,7 @@ concepts to remember include:
``x[ind1,...,ind2,:]`` acts like ``x[ind1][...,ind2,:]`` under basic
slicing.
- .. warning:: The above is **not** true for advanced slicing.
+ .. warning:: The above is **not** true for advanced indexing.
- You may use slicing to set values in the array, but (unlike lists) you
can never grow the array. The size of the value to be set in
@@ -170,12 +170,12 @@ concepts to remember include:
.. data:: newaxis
- The :const:`newaxis` object can be used in all slicing operations
- as discussed above. :const:`None` can also be used instead of
- :const:`newaxis`.
+ The :const:`newaxis` object can be used in all slicing operations to
+ create an axis of length one. :const: :const:`newaxis` is an alias for
+ 'None', and 'None' can be used in place of this with the same result.
-Advanced indexing
+Advanced Indexing
-----------------
Advanced indexing is triggered when the selection object, *obj*, is a
@@ -187,139 +187,311 @@ and Boolean.
Advanced indexing always returns a *copy* of the data (contrast with
basic slicing that returns a :term:`view`).
-Integer
-^^^^^^^
+.. warning::
-Integer indexing allows selection of arbitrary items in the array
-based on their *N*-dimensional index. This kind of selection occurs
-when advanced indexing is triggered and the selection object is not
-an array of data type bool. For the discussion below, when the
-selection object is not a tuple, it will be referred to as if it had
-been promoted to a 1-tuple, which will be called the selection
-tuple. The rules of advanced integer-style indexing are:
+ The definition of advanced indexing means that ``x[(1,2,3),]`` is
+ fundamentally different than ``x[(1,2,3)]``. The latter is
+ equivalent to ``x[1,2,3]`` which will trigger basic selection while
+ the former will trigger advanced indexing. Be sure to understand
+ why this is occurs.
-- If the length of the selection tuple is larger than *N* an error is raised.
+ Also recognize that ``x[[1,2,3]]`` will trigger advanced indexing,
+ whereas ``x[[1,2,slice(None)]]`` will trigger basic slicing.
-- All sequences and scalars in the selection tuple are converted to
- :class:`intp` indexing arrays.
+Integer array indexing
+^^^^^^^^^^^^^^^^^^^^^^
-- All selection tuple objects must be convertible to :class:`intp`
- arrays, :class:`slice` objects, or the :const:`Ellipsis` object.
+Integer array indexing allows selection of arbitrary items in the array
+based on their *N*-dimensional index. Each integer array represents a number
+of indexes into that dimension.
-- The first :const:`Ellipsis` object will be expanded, and any other
- :const:`Ellipsis` objects will be treated as full slice (``:``)
- objects. The expanded :const:`Ellipsis` object is replaced with as
- many full slice (``:``) objects as needed to make the length of the
- selection tuple :math:`N`.
+Purely integer array indexing
+"""""""""""""""""""""""""""""
-- If the selection tuple is smaller than *N*, then as many ``:``
- objects as needed are added to the end of the selection tuple so
- that the modified selection tuple has length *N*.
+When the index consists of as many integer arrays as the array being indexed
+has dimensions, the indexing is straight forward, but different from slicing.
-- All the integer indexing arrays must be :ref:`broadcastable
- <arrays.broadcasting.broadcastable>` to the same shape.
+Advanced indexes always are :ref:`broadcast<ufuncs.broadcasting>` and
+iterated as *one*::
-- The shape of the output (or the needed shape of the object to be used
- for setting) is the broadcasted shape.
+ result[i_1, ..., i_M] == x[ind_1[i_1, ..., i_M], ind_2[i_1, ..., i_M],
+ ..., ind_N[i_1, ..., i_M]]
-- After expanding any ellipses and filling out any missing ``:``
- objects in the selection tuple, then let :math:`N_t` be the number
- of indexing arrays, and let :math:`N_s = N - N_t` be the number of
- slice objects. Note that :math:`N_t > 0` (or we wouldn't be doing
- advanced integer indexing).
+Note that the result shape is identical to the (broadcast) indexing array
+shapes ``ind_1, ..., ind_N``.
-- If :math:`N_s = 0` then the *M*-dimensional result is constructed by
- varying the index tuple ``(i_1, ..., i_M)`` over the range
- of the result shape and for each value of the index tuple
- ``(ind_1, ..., ind_M)``::
+.. admonition:: Example
- result[i_1, ..., i_M] == x[ind_1[i_1, ..., i_M], ind_2[i_1, ..., i_M],
- ..., ind_N[i_1, ..., i_M]]
+ From each row, a specific element should be selected. The row index is just
+ ``[0, 1, 2]`` and the column index specifies the element to choose for the
+ corresponding row, here ``[0, 1, 0]``. Using both together the task
+ can be solved using advanced indexing:
- .. admonition:: Example
+ >>> x = np.array([[1, 2], [3, 4], [5, 6]])
+ >>> x[[0, 1, 2], [0, 1, 0]]
+ array([1, 4, 5])
- Suppose the shape of the broadcasted indexing arrays is 3-dimensional
- and *N* is 2. Then the result is found by letting *i, j, k* run over
- the shape found by broadcasting ``ind_1`` and ``ind_2``, and each
- *i, j, k* yields::
-
- result[i,j,k] = x[ind_1[i,j,k], ind_2[i,j,k]]
-
-- If :math:`N_s > 0`, then partial indexing is done. This can be
- somewhat mind-boggling to understand, but if you think in terms of
- the shapes of the arrays involved, it can be easier to grasp what
- happens. In simple cases (*i.e.* one indexing array and *N - 1* slice
- objects) it does exactly what you would expect (concatenation of
- repeated application of basic slicing). The rule for partial
- indexing is that the shape of the result (or the interpreted shape
- of the object to be used in setting) is the shape of *x* with the
- indexed subspace replaced with the broadcasted indexing subspace. If
- the index subspaces are right next to each other, then the
- broadcasted indexing space directly replaces all of the indexed
- subspaces in *x*. If the indexing subspaces are separated (by slice
- objects), then the broadcasted indexing space is first, followed by
- the sliced subspace of *x*.
+To achieve a behaviour similar to the basic slicing above, broadcasting can be
+used. The function :func:`ix_` can help with this broadcasting. This is best
+understood with an example.
- .. admonition:: Example
+.. admonition:: Example
- Suppose ``x.shape`` is (10,20,30) and ``ind`` is a (2,3,4)-shaped
- indexing :class:`intp` array, then ``result = x[...,ind,:]`` has
- shape (10,2,3,4,30) because the (20,)-shaped subspace has been
- replaced with a (2,3,4)-shaped broadcasted indexing subspace. If
- we let *i, j, k* loop over the (2,3,4)-shaped subspace then
- ``result[...,i,j,k,:] = x[...,ind[i,j,k],:]``. This example
- produces the same result as :meth:`x.take(ind, axis=-2) <ndarray.take>`.
+ From a 4x3 array the corner elements should be selected using advanced
+ indexing. Thus all elements for which the column is one of ``[0, 2]`` and
+ the row is one of ``[0, 3]`` need to be selected. To use advanced indexing
+ one needs to select all elements *explicitly*. Using the method explained
+ previously one could write:
+
+ >>> x = array([[ 0, 1, 2],
+ ... [ 3, 4, 5],
+ ... [ 6, 7, 8],
+ ... [ 9, 10, 11]])
+ >>> rows = np.array([[0, 0],
+ ... [3, 3]], dtype=np.intp)
+ >>> columns = np.array([[0, 2],
+ ... [0, 2]], dtype=np.intp)
+ >>> x[rows, columns]
+ array([[ 0, 2],
+ [ 9, 11]])
+
+ However, since the indexing arrays above just repeat themselves,
+ broadcasting can be used (compare operations such as
+ ``rows[:, np.newaxis] + columns``) to simplify this:
+
+ >>> rows = np.array([0, 3], dtype=np.intp)
+ >>> columns = np.array([0, 2], dtype=np.intp)
+ >>> rows[:, np.newaxis]
+ array([[0],
+ [3]])
+ >>> x[rows[:, np.newaxis], columns]
+ array([[ 0, 2],
+ [ 9, 11]])
+
+ This broadcasting can also be achieved using the function :func:`ix_`:
+
+ >>> x[np.ix_(rows, columns)]
+ array([[ 0, 2],
+ [ 9, 11]])
+
+ Note that without the ``np.ix_`` call, only the diagonal elements would
+ be selected, as was used in the previous example. This difference is the
+ most important thing to remember about indexing with multiple advanced
+ indexes.
+
+Combining advanced and basic indexing
+"""""""""""""""""""""""""""""""""""""
+
+When there is at least one slice (``:``), ellipsis (``...``) or ``np.newaxis``
+in the index (or the array has more dimensions than there are advanced indexes),
+then the behaviour can be more complicated. It is like concatenating the
+indexing result for each advanced index element
+
+In the simplest case, there is only a *single* advanced index. A single
+advanced index can for example replace a slice and the result array will be
+the same, however, it is a copy and may have a different memory layout.
+A slice is preferable when it is possible.
- .. admonition:: Example
+.. admonition:: Example
+
+ >>> x[1:2, 1:3]
+ array([[4, 5]])
+ >>> x[1:2, [1, 2]]
+ array([[4, 5]])
+
+The easiest way to understand the situation may be to think in
+terms of the result shape. There are two parts to the indexing operation,
+the subspace defined by the basic indexing (excluding integers) and the
+subspace from the advanced indexing part. Two cases of index combination
+need to be distinguished:
+
+* The advanced indexes are separated by a slice, ellipsis or newaxis.
+ For example ``x[arr1, :, arr2]``.
+* The advanced indexes are all next to each other.
+ For example ``x[..., arr1, arr2, :]`` but *not* ``x[arr1, :, 1]``
+ since ``1`` is an advanced index in this regard.
+
+In the first case, the dimensions resulting from the advanced indexing
+operation come first in the result array, and the subspace dimensions after
+that.
+In the second case, the dimensions from the advanced indexing operations
+are inserted into the result array at the same spot as they were in the
+initial array (the latter logic is what makes simple advanced indexing
+behave just like slicing).
+
+.. admonition:: Example
+
+ Suppose ``x.shape`` is (10,20,30) and ``ind`` is a (2,3,4)-shaped
+ indexing :class:`intp` array, then ``result = x[...,ind,:]`` has
+ shape (10,2,3,4,30) because the (20,)-shaped subspace has been
+ replaced with a (2,3,4)-shaped broadcasted indexing subspace. If
+ we let *i, j, k* loop over the (2,3,4)-shaped subspace then
+ ``result[...,i,j,k,:] = x[...,ind[i,j,k],:]``. This example
+ produces the same result as :meth:`x.take(ind, axis=-2) <ndarray.take>`.
+
+.. admonition:: Example
- Now let ``x.shape`` be (10,20,30,40,50) and suppose ``ind_1``
- and ``ind_2`` are broadcastable to the shape (2,3,4). Then
- ``x[:,ind_1,ind_2]`` has shape (10,2,3,4,40,50) because the
- (20,30)-shaped subspace from X has been replaced with the
- (2,3,4) subspace from the indices. However,
- ``x[:,ind_1,:,ind_2]`` has shape (2,3,4,10,30,50) because there
- is no unambiguous place to drop in the indexing subspace, thus
- it is tacked-on to the beginning. It is always possible to use
- :meth:`.transpose() <ndarray.transpose>` to move the subspace
- anywhere desired. (Note that this example cannot be replicated
- using :func:`take`.)
+ Let ``x.shape`` be (10,20,30,40,50) and suppose ``ind_1``
+ and ``ind_2`` can be broadcast to the shape (2,3,4). Then
+ ``x[:,ind_1,ind_2]`` has shape (10,2,3,4,40,50) because the
+ (20,30)-shaped subspace from X has been replaced with the
+ (2,3,4) subspace from the indices. However,
+ ``x[:,ind_1,:,ind_2]`` has shape (2,3,4,10,30,50) because there
+ is no unambiguous place to drop in the indexing subspace, thus
+ it is tacked-on to the beginning. It is always possible to use
+ :meth:`.transpose() <ndarray.transpose>` to move the subspace
+ anywhere desired. Note that this example cannot be replicated
+ using :func:`take`.
-Boolean
-^^^^^^^
+Boolean array indexing
+^^^^^^^^^^^^^^^^^^^^^^
This advanced indexing occurs when obj is an array object of Boolean
-type (such as may be returned from comparison operators). It is always
-equivalent to (but faster than) ``x[obj.nonzero()]`` where, as
-described above, :meth:`obj.nonzero() <ndarray.nonzero>` returns a
+type, such as may be returned from comparison operators. A single
+boolean index array is practically identical to ``x[obj.nonzero()]`` where,
+as described above, :meth:`obj.nonzero() <ndarray.nonzero>` returns a
tuple (of length :attr:`obj.ndim <ndarray.ndim>`) of integer index
-arrays showing the :const:`True` elements of *obj*.
+arrays showing the :const:`True` elements of *obj*. However, it is
+faster when ``obj.shape == x.shape``.
-The special case when ``obj.ndim == x.ndim`` is worth mentioning. In
-this case ``x[obj]`` returns a 1-dimensional array filled with the
-elements of *x* corresponding to the :const:`True` values of *obj*.
+If ``obj.ndim == x.ndim``, ``x[obj]`` returns a 1-dimensional array
+filled with the elements of *x* corresponding to the :const:`True`
+values of *obj*.
The search order will be C-style (last index varies the fastest). If
*obj* has :const:`True` values at entries that are outside of the
-bounds of *x*, then an index error will be raised.
+bounds of *x*, then an index error will be raised. If *obj* is smaller
+than *x* it is identical to filling it with :const:`False`.
-You can also use Boolean arrays as element of the selection tuple. In
-such instances, they will always be interpreted as :meth:`nonzero(obj)
-<ndarray.nonzero>` and the equivalent integer indexing will be
-done.
+.. admonition:: Example
-.. warning::
+ A common use case for this is filtering for desired element values.
+ For example one may wish to select all entries from an array which
+ are not NaN:
- The definition of advanced indexing means that ``x[(1,2,3),]`` is
- fundamentally different than ``x[(1,2,3)]``. The latter is
- equivalent to ``x[1,2,3]`` which will trigger basic selection while
- the former will trigger advanced indexing. Be sure to understand
- why this is occurs.
+ >>> x = np.array([[1., 2.], [np.nan, 3.], [np.nan, np.nan]])
+ >>> x[~np.isnan(x)]
+ array([ 1., 2., 3.])
- Also recognize that ``x[[1,2,3]]`` will trigger advanced indexing,
- whereas ``x[[1,2,slice(None)]]`` will trigger basic slicing.
+ Or wish to add a constant to all negative elements:
+
+ >>> x = np.array([1., -1., -2., 3])
+ >>> x[x < 0] += 20
+ >>> x
+ array([ 1., 19., 18., 3.])
+
+In general if an index includes a Boolean array, the result will be
+identical to inserting ``obj.nonzero()`` into the same position
+and using the integer array indexing mechanism described above.
+``x[ind_1, boolean_array, ind_2]`` is equivalent to
+``x[(ind_1,) + boolean_array.nonzero() + (ind_2,)]``.
+
+If there is only one Boolean array and no integer indexing array present,
+this is straight forward. Care must only be taken to make sure that the
+boolean index has *exactly* as many dimensions as it is supposed to work
+with.
+
+.. admonition:: Example
+
+ From an array, select all rows which sum up to less or equal two:
+
+ >>> x = np.array([[0, 1], [1, 1], [2, 2]])
+ >>> rowsum = x.sum(-1)
+ >>> x[rowsum <= 2, :]
+ array([[0, 1],
+ [1, 1]])
+
+ But if ``rowsum`` would have two dimensions as well:
+
+ >>> rowsum = x.sum(-1, keepdims=True)
+ >>> rowsum.shape
+ (3, 1)
+ >>> x[rowsum <= 2, :] # fails
+ IndexError: too many indices
+ >>> x[rowsum <= 2]
+ array([0, 1])
+
+ The last one giving only the first elements because of the extra dimension.
+ Compare ``rowsum.nonzero()`` to understand this example.
+
+Combining multiple Boolean indexing arrays or a Boolean with an integer
+indexing array can best be understood with the
+:meth:`obj.nonzero() <ndarray.nonzero>` analogy. The function :func:`ix_`
+also supports boolean arrays and will work without any surprises.
+
+.. admonition:: Example
+
+ Use boolean indexing to select all rows adding up to an even
+ number. At the same time columns 0 and 2 should be selected with an
+ advanced integer index. Using the :func:`ix_` function this can be done
+ with:
+
+ >>> x = array([[ 0, 1, 2],
+ ... [ 3, 4, 5],
+ ... [ 6, 7, 8],
+ ... [ 9, 10, 11]])
+ >>> rows = (x.sum(-1) % 2) == 0
+ >>> rows
+ array([False, True, False, True], dtype=bool)
+ >>> columns = [0, 2]
+ >>> x[np.ix_(rows, columns)]
+ array([[ 3, 5],
+ [ 9, 11]])
+
+ Without the ``np.ix_`` call or only the diagonal elements would be
+ selected.
+
+ Or without ``np.ix_`` (compare the integer array examples):
+
+ >>> rows = rows.nonzero()[0]
+ >>> x[rows[:, np.newaxis], columns]
+ array([[ 3, 5],
+ [ 9, 11]])
+
+Detailed notes
+--------------
+
+These are some detailed notes, which are not of importance for day to day
+indexing (in no particular order):
+
+* The native NumPy indexing type is ``intp`` and may differ from the
+ default integer array type. ``intp`` is the smallest data type
+ sufficient to safely index any array; for advanced indexing it may be
+ faster than other types.
+* For advanced assignments, there is in general no guarantee for the
+ iteration order. This means that if an element is set more than once,
+ it is not possible to predict the final result.
+* An empty (tuple) index is a full scalar index into a zero dimensional array.
+ ``x[()]`` returns a *scalar* if ``x`` is zero dimensional and a view
+ otherwise. On the other hand ``x[...]`` always returns a view.
+* If a zero dimensional array is present in the index *and* it is a full
+ integer index the result will be a *scalar* and not a zero dimensional array.
+ (Advanced indexing is not triggered.)
+* When an ellipsis (``...``) is present but has no size (i.e. replaces zero
+ ``:``) the result will still always be an array. A view if no advanced index
+ is present, otherwise a copy.
+* the ``nonzero`` equivalence for Boolean arrays does not hold for zero
+ dimensional boolean arrays.
+* When the result of an advanced indexing operation has no elements but an
+ individual index is out of bounds, whether or not an ``IndexError`` is
+ raised is undefined (e.g. ``x[[], [123]]`` with ``123`` being out of bounds).
+* When a *casting* error occurs during assignment (for example updating a
+ numerical array using a sequence of strings), the array being assigned
+ to may end up in an unpredictable partially updated state.
+ However, if any other error (such as an out of bounds index) occurs, the
+ array will remain unchanged.
+* The memory layout of an advanced indexing result is optimized for each
+ indexing operation and no particular memory order can be assumed.
+* When using a subclass (especially one which manipulates its shape), the
+ default ``ndarray.__setitem__`` behaviour will call ``__getitem__`` for
+ *basic* indexing but not for *advanced* indexing. For such a subclass it may
+ be preferable to call ``ndarray.__setitem__`` with a *base class* ndarray
+ view on the data. This *must* be done if the subclasses ``__getitem__`` does
+ not return views.
.. _arrays.indexing.rec:
+
Record Access
-------------
diff --git a/doc/source/reference/arrays.ndarray.rst b/doc/source/reference/arrays.ndarray.rst
index 85e41c215..e9c0a6d87 100644
--- a/doc/source/reference/arrays.ndarray.rst
+++ b/doc/source/reference/arrays.ndarray.rst
@@ -294,6 +294,7 @@ Array conversion
ndarray.itemset
ndarray.setasflat
ndarray.tostring
+ ndarray.tobytes
ndarray.tofile
ndarray.dump
ndarray.dumps
diff --git a/doc/source/reference/c-api.array.rst b/doc/source/reference/c-api.array.rst
index 6e68a9a0e..baf804378 100644
--- a/doc/source/reference/c-api.array.rst
+++ b/doc/source/reference/c-api.array.rst
@@ -190,7 +190,7 @@ From scratch
.. cfunction:: PyObject* PyArray_NewFromDescr(PyTypeObject* subtype, PyArray_Descr* descr, int nd, npy_intp* dims, npy_intp* strides, void* data, int flags, PyObject* obj)
- This function steals a reference to *descr* if it is not NULL.
+ This function steals a reference to *descr*.
This is the main array creation function. Most new arrays are
created with this flexible function.
@@ -1036,7 +1036,10 @@ Converting data types
the casting rule *casting*. For simple types with :cdata:`NPY_SAFE_CASTING`,
this is basically a wrapper around :cfunc:`PyArray_CanCastSafely`, but
for flexible types such as strings or unicode, it produces results
- taking into account their sizes.
+ taking into account their sizes. Integer and float types can only be cast
+ to a string or unicode type using :cdata:`NPY_SAFE_CASTING` if the string
+ or unicode type is big enough to hold the max value of the integer/float
+ type being cast from.
.. cfunction:: int PyArray_CanCastArrayTo(PyArrayObject* arr, PyArray_Descr* totype, NPY_CASTING casting)
@@ -1073,7 +1076,8 @@ Converting data types
Finds the data type of smallest size and kind to which *type1* and
*type2* may be safely converted. This function is symmetric and
- associative.
+ associative. A string or unicode result will be the proper size for
+ storing the max value of the input types converted to a string or unicode.
.. cfunction:: PyArray_Descr* PyArray_ResultType(npy_intp narrs, PyArrayObject**arrs, npy_intp ndtypes, PyArray_Descr**dtypes)
@@ -1574,7 +1578,7 @@ Conversion
.. cfunction:: PyObject* PyArray_ToString(PyArrayObject* self, NPY_ORDER order)
- Equivalent to :meth:`ndarray.tostring` (*self*, *order*). Return the bytes
+ Equivalent to :meth:`ndarray.tobytes` (*self*, *order*). Return the bytes
of this array in a Python string.
.. cfunction:: PyObject* PyArray_ToFile(PyArrayObject* self, FILE* fp, char* sep, char* format)
@@ -1628,11 +1632,11 @@ Conversion
Shape Manipulation
^^^^^^^^^^^^^^^^^^
-.. cfunction:: PyObject* PyArray_Newshape(PyArrayObject* self, PyArray_Dims* newshape)
+.. cfunction:: PyObject* PyArray_Newshape(PyArrayObject* self, PyArray_Dims* newshape, NPY_ORDER order)
Result will be a new array (pointing to the same memory location
- as *self* if possible), but having a shape given by *newshape*
- . If the new shape is not compatible with the strides of *self*,
+ as *self* if possible), but having a shape given by *newshape*.
+ If the new shape is not compatible with the strides of *self*,
then a copy of the array with the new specified shape will be
returned.
@@ -1641,6 +1645,7 @@ Shape Manipulation
Equivalent to :meth:`ndarray.reshape` (*self*, *shape*) where *shape* is a
sequence. Converts *shape* to a :ctype:`PyArray_Dims` structure and
calls :cfunc:`PyArray_Newshape` internally.
+ For back-ward compatability -- Not recommended
.. cfunction:: PyObject* PyArray_Squeeze(PyArrayObject* self)
@@ -1877,6 +1882,18 @@ Calculation
Equivalent to :meth:`ndarray.argmin` (*self*, *axis*). Return the index of
the smallest element of *self* along *axis*.
+
+
+
+.. note::
+
+ The out argument specifies where to place the result. If out is
+ NULL, then the output array is created, otherwise the output is
+ placed in out which must be the correct size and type. A new
+ reference to the ouput array is always returned even when out
+ is not NULL. The caller of the routine has the responsability
+ to ``DECREF`` out if not NULL or a memory-leak will occur.
+
.. cfunction:: PyObject* PyArray_Max(PyArrayObject* self, int axis, PyArrayObject* out)
Equivalent to :meth:`ndarray.max` (*self*, *axis*). Return the largest
@@ -2583,7 +2600,7 @@ Data-type descriptors
unless otherwise noted. Therefore, you must own a reference to any
data-type object used as input to such a function.
-.. cfunction:: int PyArrayDescr_Check(PyObject* obj)
+.. cfunction:: int PyArray_DescrCheck(PyObject* obj)
Evaluates as true if *obj* is a data-type object ( :ctype:`PyArray_Descr *` ).
@@ -2883,10 +2900,14 @@ the C-API is needed then some additional steps must be taken.
.. code-block:: c
- #define PY_ARRAY_UNIQUE_SYMBOL cool_ARRAY_API
#define NO_IMPORT_ARRAY
+ #define PY_ARRAY_UNIQUE_SYMBOL cool_ARRAY_API
#include numpy/arrayobject.h
+ You can also put the common two last lines into an extension-local
+ header file as long as you make sure that NO_IMPORT_ARRAY is
+ #defined before #including that file.
+
Checking the API Version
^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/doc/source/reference/c-api.generalized-ufuncs.rst b/doc/source/reference/c-api.generalized-ufuncs.rst
index 870e5dbc4..14f33efcb 100644
--- a/doc/source/reference/c-api.generalized-ufuncs.rst
+++ b/doc/source/reference/c-api.generalized-ufuncs.rst
@@ -3,15 +3,12 @@ Generalized Universal Function API
==================================
There is a general need for looping over not only functions on scalars
-but also over functions on vectors (or arrays), as explained on
-http://scipy.org/scipy/numpy/wiki/GeneralLoopingFunctions. We propose
-to realize this concept by generalizing the universal functions
-(ufuncs), and provide a C implementation that adds ~500 lines
-to the numpy code base. In current (specialized) ufuncs, the elementary
-function is limited to element-by-element operations, whereas the
-generalized version supports "sub-array" by "sub-array" operations.
-The Perl vector library PDL provides a similar functionality and its
-terms are re-used in the following.
+but also over functions on vectors (or arrays).
+This concept is realized in Numpy by generalizing the universal functions
+(ufuncs). In regular ufuncs, the elementary function is limited to
+element-by-element operations, whereas the generalized version (gufuncs)
+supports "sub-array" by "sub-array" operations. The Perl vector library PDL
+provides a similar functionality and its terms are re-used in the following.
Each generalized ufunc has information associated with it that states
what the "core" dimensionality of the inputs is, as well as the
@@ -21,12 +18,12 @@ arguments is called the "signature" of a ufunc. For example, the
ufunc numpy.add has signature ``(),()->()`` defining two scalar inputs
and one scalar output.
-Another example is (see the GeneralLoopingFunctions page) the function
-``inner1d(a,b)`` with a signature of ``(i),(i)->()``. This applies the
-inner product along the last axis of each input, but keeps the
-remaining indices intact. For example, where ``a`` is of shape ``(3,5,N)``
+Another example is the function ``inner1d(a,b)`` with a signature of
+``(i),(i)->()``. This applies the inner product along the last axis of
+each input, but keeps the remaining indices intact.
+For example, where ``a`` is of shape ``(3,5,N)``
and ``b`` is of shape ``(5,N)``, this will return an output of shape ``(3,5)``.
-The underlying elementary function is called 3*5 times. In the
+The underlying elementary function is called ``3 * 5`` times. In the
signature, we specify one core dimension ``(i)`` for each input and zero core
dimensions ``()`` for the output, since it takes two 1-d arrays and
returns a scalar. By using the same name ``i``, we specify that the two
@@ -47,7 +44,6 @@ into core and loop dimensions:
#. The output is given by the loop dimensions plus the output core dimensions.
-
Definitions
-----------
diff --git a/doc/source/reference/c-api.iterator.rst b/doc/source/reference/c-api.iterator.rst
index b26845434..084fdcbce 100644
--- a/doc/source/reference/c-api.iterator.rst
+++ b/doc/source/reference/c-api.iterator.rst
@@ -229,7 +229,7 @@ is used to control the memory layout of the allocated result, typically
npy_intp i;
do {
npy_intp size = *innersizeptr;
- char *src = dataaddr[0], *dst = dataaddr[1];
+ char *src = dataptrarray[0], *dst = dataptrarray[1];
for(i = 0; i < size; i++, src += innerstride, dst += itemsize) {
memcpy(dst, src, itemsize);
}
@@ -369,7 +369,14 @@ Construction and Destruction
Causes the iterator to track a multi-index.
This prevents the iterator from coalescing axes to
- produce bigger inner loops.
+ produce bigger inner loops. If the loop is also not buffered
+ and no index is being tracked (`NpyIter_RemoveAxis` can be called),
+ then the iterator size can be ``-1`` to indicate that the iterator
+ is too large. This can happen due to complex broadcasting and
+ will result in errors being created when the setting the iterator
+ range, removing the multi index, or getting the next function.
+ However, it is possible to remove axes again and use the iterator
+ normally if the size is small enough after removal.
.. cvar:: NPY_ITER_EXTERNAL_LOOP
@@ -412,8 +419,9 @@ Construction and Destruction
Indicates that arrays with a size of zero should be permitted.
Since the typical iteration loop does not naturally work with
- zero-sized arrays, you must check that the IterSize is non-zero
- before entering the iteration loop.
+ zero-sized arrays, you must check that the IterSize is larger
+ than zero before entering the iteration loop.
+ Currently only the operands are checked, not a forced shape.
.. cvar:: NPY_ITER_REDUCE_OK
@@ -721,7 +729,7 @@ Construction and Destruction
**WARNING**: This function may change the internal memory layout of
the iterator. Any cached functions or pointers from the iterator
- must be retrieved again!
+ must be retrieved again! The iterator range will be reset as well.
Returns ``NPY_SUCCEED`` or ``NPY_FAIL``.
@@ -887,7 +895,11 @@ Construction and Destruction
.. cfunction:: npy_intp NpyIter_GetIterSize(NpyIter* iter)
Returns the number of elements being iterated. This is the product
- of all the dimensions in the shape.
+ of all the dimensions in the shape. When a multi index is being tracked
+ (and `NpyIter_RemoveAxis` may be called) the size may be ``-1`` to
+ indicate an iterator is too large. Such an iterator is invalid, but
+ may become valid after `NpyIter_RemoveAxis` is called. It is not
+ necessary to check for this case.
.. cfunction:: npy_intp NpyIter_GetIterIndex(NpyIter* iter)
diff --git a/doc/source/reference/c-api.types-and-structures.rst b/doc/source/reference/c-api.types-and-structures.rst
index 79a888912..4e32ab7be 100644
--- a/doc/source/reference/c-api.types-and-structures.rst
+++ b/doc/source/reference/c-api.types-and-structures.rst
@@ -466,10 +466,10 @@ PyArrayDescr_Type
A pointer to a function that compares two elements of the
array, ``arr``, pointed to by ``d1`` and ``d2``. This
- function requires behaved arrays. The return value is 1 if *
- ``d1`` > * ``d2``, 0 if * ``d1`` == * ``d2``, and -1 if *
- ``d1`` < * ``d2``. The array object arr is used to retrieve
- itemsize and field information for flexible arrays.
+ function requires behaved (aligned and not swapped) arrays.
+ The return value is 1 if * ``d1`` > * ``d2``, 0 if * ``d1`` == *
+ ``d2``, and -1 if * ``d1`` < * ``d2``. The array object ``arr`` is
+ used to retrieve itemsize and field information for flexible arrays.
.. cmember:: int argmax(void* data, npy_intp n, npy_intp* max_ind,
void* arr)
@@ -646,9 +646,9 @@ PyUFunc_Type
void **data;
int ntypes;
int check_return;
- char *name;
+ const char *name;
char *types;
- char *doc;
+ const char *doc;
void *ptr;
PyObject *obj;
PyObject *userloops;
@@ -1119,8 +1119,8 @@ PyArrayInterface
A character indicating what kind of array is present according to the
typestring convention with 't' -> bitfield, 'b' -> Boolean, 'i' ->
signed integer, 'u' -> unsigned integer, 'f' -> floating point, 'c' ->
- complex floating point, 'O' -> object, 'S' -> string, 'U' -> unicode,
- 'V' -> void.
+ complex floating point, 'O' -> object, 'S' -> (byte-)string, 'U' ->
+ unicode, 'V' -> void.
.. cmember:: int PyArrayInterface.itemsize
diff --git a/doc/source/reference/maskedarray.baseclass.rst b/doc/source/reference/maskedarray.baseclass.rst
index fd1fd7ae6..a1c90a45d 100644
--- a/doc/source/reference/maskedarray.baseclass.rst
+++ b/doc/source/reference/maskedarray.baseclass.rst
@@ -200,6 +200,7 @@ Conversion
MaskedArray.tolist
MaskedArray.torecords
MaskedArray.tostring
+ MaskedArray.tobytes
Shape manipulation
diff --git a/doc/source/reference/routines.array-creation.rst b/doc/source/reference/routines.array-creation.rst
index 23b35243b..c7c6ab815 100644
--- a/doc/source/reference/routines.array-creation.rst
+++ b/doc/source/reference/routines.array-creation.rst
@@ -20,6 +20,8 @@ Ones and zeros
ones_like
zeros
zeros_like
+ full
+ full_like
From existing data
------------------
diff --git a/doc/source/reference/routines.ma.rst b/doc/source/reference/routines.ma.rst
index 6eda37578..5cb38e83f 100644
--- a/doc/source/reference/routines.ma.rst
+++ b/doc/source/reference/routines.ma.rst
@@ -251,7 +251,7 @@ Conversion operations
ma.MaskedArray.tofile
ma.MaskedArray.tolist
ma.MaskedArray.torecords
- ma.MaskedArray.tostring
+ ma.MaskedArray.tobytes
Pickling and unpickling
diff --git a/doc/source/reference/routines.rst b/doc/source/reference/routines.rst
index 37b16de59..c2f091d83 100644
--- a/doc/source/reference/routines.rst
+++ b/doc/source/reference/routines.rst
@@ -36,8 +36,6 @@ indentation.
routines.ma
routines.math
routines.matlib
- routines.numarray
- routines.oldnumeric
routines.other
routines.padding
routines.polynomials
diff --git a/doc/source/reference/routines.testing.rst b/doc/source/reference/routines.testing.rst
index c0bcdaaeb..c43aeeed9 100644
--- a/doc/source/reference/routines.testing.rst
+++ b/doc/source/reference/routines.testing.rst
@@ -11,7 +11,7 @@ work right away.
Asserts
-=======
+-------
.. autosummary::
:toctree: generated/
@@ -25,6 +25,7 @@ Asserts
assert_array_less
assert_equal
assert_raises
+ assert_raises_regex
assert_warns
assert_string_equal
diff --git a/doc/source/reference/swig.interface-file.rst b/doc/source/reference/swig.interface-file.rst
index d835a4c4f..c381feb85 100644
--- a/doc/source/reference/swig.interface-file.rst
+++ b/doc/source/reference/swig.interface-file.rst
@@ -166,7 +166,7 @@ assignments in lines 19 and 20.
Using numpy.i
-------------
-The ``numpy.i`` file is currently located in the ``numpy/docs/swig``
+The ``numpy.i`` file is currently located in the ``tools/swig``
sub-directory under the ``numpy`` installation directory. Typically,
you will want to copy it to the directory where you are developing
your wrappers.
diff --git a/doc/source/user/c-info.how-to-extend.rst b/doc/source/user/c-info.how-to-extend.rst
index 5901ce3e3..db6c8e118 100644
--- a/doc/source/user/c-info.how-to-extend.rst
+++ b/doc/source/user/c-info.how-to-extend.rst
@@ -255,7 +255,7 @@ Reference counting
The biggest difficulty when writing extension modules is reference
counting. It is an important reason for the popularity of f2py, weave,
-pyrex, ctypes, etc.... If you mis-handle reference counts you can get
+Cython, ctypes, etc.... If you mis-handle reference counts you can get
problems from memory-leaks to segmentation faults. The only strategy I
know of to handle reference counts correctly is blood, sweat, and
tears. First, you force it into your head that every Python variable
diff --git a/doc/source/user/c-info.python-as-glue.rst b/doc/source/user/c-info.python-as-glue.rst
index 6ce266859..985d478e0 100644
--- a/doc/source/user/c-info.python-as-glue.rst
+++ b/doc/source/user/c-info.python-as-glue.rst
@@ -1385,7 +1385,7 @@ Simplified Wrapper and Interface Generator (SWIG) is an old and fairly
stable method for wrapping C/C++-libraries to a large variety of other
languages. It does not specifically understand NumPy arrays but can be
made useable with NumPy through the use of typemaps. There are some
-sample typemaps in the numpy/doc/swig directory under numpy.i along
+sample typemaps in the numpy/tools/swig directory under numpy.i together
with an example module that makes use of them. SWIG excels at wrapping
large C/C++ libraries because it can (almost) parse their headers and
auto-produce an interface. Technically, you need to generate a ``.i``
diff --git a/doc/source/user/install.rst b/doc/source/user/install.rst
index 18e036ab0..9d6f61e65 100644
--- a/doc/source/user/install.rst
+++ b/doc/source/user/install.rst
@@ -11,9 +11,9 @@ installable binary package for your operating system.
Windows
-------
-Good solutions for Windows are, The Enthought Python Distribution `(EPD)
-<http://www.enthought.com/products/epd.php>`_ (which provides binary
-installers for Windows, OS X and Redhat) and `Python (x, y)
+Good solutions for Windows are, `Enthought Canopy
+<https://www.enthought.com/products/canopy/>`_ (which provides binary
+installers for Windows, OS X and Linux) and `Python (x, y)
<http://www.pythonxy.com>`_. Both of these packages include Python, NumPy and
many additional packages.
diff --git a/doc/source/user/whatisnumpy.rst b/doc/source/user/whatisnumpy.rst
index 1c3f96b8b..cd74a8de3 100644
--- a/doc/source/user/whatisnumpy.rst
+++ b/doc/source/user/whatisnumpy.rst
@@ -86,14 +86,14 @@ code. In NumPy
c = a * b
does what the earlier examples do, at near-C speeds, but with the code
-simplicity we expect from something based on Python (indeed, the NumPy
-idiom is even simpler!). This last example illustrates two of NumPy's
+simplicity we expect from something based on Python. Indeed, the NumPy
+idiom is even simpler! This last example illustrates two of NumPy's
features which are the basis of much of its power: vectorization and
broadcasting.
Vectorization describes the absence of any explicit looping, indexing,
etc., in the code - these things are taking place, of course, just
-"behind the scenes" (in optimized, pre-compiled C code). Vectorized
+"behind the scenes" in optimized, pre-compiled C code. Vectorized
code has many advantages, among which are:
- vectorized code is more concise and easier to read
@@ -104,25 +104,25 @@ code has many advantages, among which are:
(making it easier, typically, to correctly code mathematical
constructs)
-- vectorization results in more "Pythonic" code (without
- vectorization, our code would still be littered with inefficient and
+- vectorization results in more "Pythonic" code. Without
+ vectorization, our code would be littered with inefficient and
difficult to read ``for`` loops.
Broadcasting is the term used to describe the implicit
element-by-element behavior of operations; generally speaking, in
-NumPy all operations (i.e., not just arithmetic operations, but
-logical, bit-wise, functional, etc.) behave in this implicit
+NumPy all operations, not just arithmetic operations, but
+logical, bit-wise, functional, etc., behave in this implicit
element-by-element fashion, i.e., they broadcast. Moreover, in the
example above, ``a`` and ``b`` could be multidimensional arrays of the
same shape, or a scalar and an array, or even two arrays of with
-different shapes. Provided that the smaller array is "expandable" to
+different shapes, provided that the smaller array is "expandable" to
the shape of the larger in such a way that the resulting broadcast is
-unambiguous (for detailed "rules" of broadcasting see
-`numpy.doc.broadcasting`).
+unambiguous. For detailed "rules" of broadcasting see
+`numpy.doc.broadcasting`.
NumPy fully supports an object-oriented approach, starting, once
again, with `ndarray`. For example, `ndarray` is a class, possessing
-numerous methods and attributes. Many, of it's methods mirror
-functions in the outer-most NumPy namespace, giving the programmer has
+numerous methods and attributes. Many of its methods mirror
+functions in the outer-most NumPy namespace, giving the programmer
complete freedom to code in whichever paradigm she prefers and/or
which seems most appropriate to the task at hand.
diff --git a/doc/sphinxext b/doc/sphinxext
-Subproject 447dd0b59c2fe91ca9643701036d3d04919ddc7
+Subproject 84cc897d266e0afc28fc5296edf01afb0800547
diff --git a/numpy/__init__.py b/numpy/__init__.py
index 1029652c8..772c75b63 100644
--- a/numpy/__init__.py
+++ b/numpy/__init__.py
@@ -121,6 +121,17 @@ class ModuleDeprecationWarning(DeprecationWarning):
pass
+class VisibleDeprecationWarning(UserWarning):
+ """Visible deprecation warning.
+
+ By default, python will not show deprecation warnings, so this class
+ can be used when a very visible warning is helpful, for example because
+ the usage is most likely a user bug.
+
+ """
+ pass
+
+
# oldnumeric and numarray were removed in 1.9. In case some packages import
# but do not use them, we define them here for backward compatibility.
oldnumeric = 'removed'
@@ -145,7 +156,7 @@ else:
except ImportError:
msg = """Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
- your python intepreter from there."""
+ your python interpreter from there."""
raise ImportError(msg)
from .version import git_revision as __git_revision__
from .version import version as __version__
@@ -157,7 +168,9 @@ else:
return loader(*packages, **options)
from . import add_newdocs
- __all__ = ['add_newdocs', 'ModuleDeprecationWarning']
+ __all__ = ['add_newdocs',
+ 'ModuleDeprecationWarning',
+ 'VisibleDeprecationWarning']
pkgload.__doc__ = PackageLoader.__call__.__doc__
diff --git a/numpy/_import_tools.py b/numpy/_import_tools.py
index 3343f6c05..526217359 100644
--- a/numpy/_import_tools.py
+++ b/numpy/_import_tools.py
@@ -111,13 +111,13 @@ class PackageLoader(object):
depend_dict[name] = getattr(info_module, 'depends', [])
package_names = []
- for name in depend_dict.keys():
+ for name in list(depend_dict.keys()):
if not depend_dict[name]:
package_names.append(name)
del depend_dict[name]
while depend_dict:
- for name, lst in depend_dict.items():
+ for name, lst in list(depend_dict.items()):
new_lst = [n for n in lst if n in depend_dict]
if not new_lst:
package_names.append(name)
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py
index 62ca6dca3..86ea4b8b6 100644
--- a/numpy/add_newdocs.py
+++ b/numpy/add_newdocs.py
@@ -1598,6 +1598,14 @@ add_newdoc('numpy.core.multiarray', 'can_cast',
out : bool
True if cast can occur according to the casting rule.
+ Notes
+ -----
+ Starting in NumPy 1.9, can_cast function now returns False in 'safe'
+ casting mode for integer/float dtype and string dtype if the string dtype
+ length is not long enough to store the max integer/float value converted
+ to a string. Previously can_cast in 'safe' mode returned True for
+ integer/float dtype and a string dtype of any length.
+
See also
--------
dtype, result_type
@@ -1618,7 +1626,7 @@ add_newdoc('numpy.core.multiarray', 'can_cast',
>>> np.can_cast('i8', 'f4')
False
>>> np.can_cast('i4', 'S4')
- True
+ False
Casting scalars
@@ -1693,6 +1701,11 @@ add_newdoc('numpy.core.multiarray', 'promote_types',
Notes
-----
.. versionadded:: 1.6.0
+ Starting in NumPy 1.9, promote_types function now returns a valid string
+ length when given an integer or float dtype as one argument and a string
+ dtype as another argument. Previously it always returned the input string
+ dtype, even if it wasn't long enough to store the max integer/float value
+ converted to a string.
See Also
--------
@@ -1709,10 +1722,8 @@ add_newdoc('numpy.core.multiarray', 'promote_types',
>>> np.promote_types('>i8', '<c8')
dtype('complex128')
- >>> np.promote_types('i1', 'S8')
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- TypeError: invalid type promotion
+ >>> np.promote_types('i4', 'S8')
+ dtype('S11')
""")
@@ -2078,6 +2089,8 @@ add_newdoc('numpy.core', 'einsum',
array([ 30, 80, 130, 180, 230])
>>> np.dot(a, b)
array([ 30, 80, 130, 180, 230])
+ >>> np.einsum('...j,j', a, b)
+ array([ 30, 80, 130, 180, 230])
>>> np.einsum('ji', c)
array([[0, 3],
@@ -2147,6 +2160,18 @@ add_newdoc('numpy.core', 'einsum',
[ 4796., 5162.],
[ 4928., 5306.]])
+ >>> a = np.arange(6).reshape((3,2))
+ >>> b = np.arange(12).reshape((4,3))
+ >>> np.einsum('ki,jk->ij', a, b)
+ array([[10, 28, 46, 64],
+ [13, 40, 67, 94]])
+ >>> np.einsum('ki,...k->i...', a, b)
+ array([[10, 28, 46, 64],
+ [13, 40, 67, 94]])
+ >>> np.einsum('k...,jk', a, b)
+ array([[10, 28, 46, 64],
+ [13, 40, 67, 94]])
+
""")
add_newdoc('numpy.core', 'alterdot',
@@ -3053,7 +3078,7 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('argsort',
add_newdoc('numpy.core.multiarray', 'ndarray', ('argpartition',
"""
- a.argpartition(kth, axis=-1, kind='quickselect', order=None)
+ a.argpartition(kth, axis=-1, kind='introselect', order=None)
Returns the indices that would partition this array.
@@ -3112,6 +3137,13 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('astype',
is a new array of the same shape as the input array, with dtype, order
given by `dtype`, `order`.
+ Notes
+ -----
+ Starting in NumPy 1.9, astype method now returns an error if the string
+ dtype to cast to is not long enough in 'safe' casting mode to hold the max
+ value of integer/float array that is being casted. Previously the casting
+ was allowed even if the result was truncated.
+
Raises
------
ComplexWarning
@@ -4372,7 +4404,7 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('tofile',
sep : str
Separator between array items for text output.
If "" (empty), a binary file is written, equivalent to
- ``file.write(a.tostring())``.
+ ``file.write(a.tobytes())``.
format : str
Format string for text file output.
Each entry in the array is formatted to text by first converting
@@ -4426,8 +4458,7 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('tolist',
"""))
-add_newdoc('numpy.core.multiarray', 'ndarray', ('tostring',
- """
+tobytesdoc = """
a.tostring(order='C')
Construct a Python string containing the raw data bytes in the array.
@@ -4438,9 +4469,11 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('tostring',
unless the F_CONTIGUOUS flag in the array is set, in which case it
means 'Fortran' order.
+ {deprecated}
+
Parameters
----------
- order : {'C', 'F', None}, optional
+ order : {{'C', 'F', None}}, optional
Order of the data for multidimensional arrays:
C, Fortran, or the same as for the original array.
@@ -4452,15 +4485,23 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('tostring',
Examples
--------
>>> x = np.array([[0, 1], [2, 3]])
- >>> x.tostring()
+ >>> x.tobytes()
'\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x03\\x00\\x00\\x00'
- >>> x.tostring('C') == x.tostring()
+ >>> x.tobytes('C') == x.tobytes()
True
- >>> x.tostring('F')
+ >>> x.tobytes('F')
'\\x00\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x03\\x00\\x00\\x00'
- """))
+ """
+add_newdoc('numpy.core.multiarray', 'ndarray',
+ ('tostring', tobytesdoc.format(deprecated=
+ 'This function is a compatibility '
+ 'alias for tobytes. Despite its '
+ 'name it returns bytes not '
+ 'strings.')))
+add_newdoc('numpy.core.multiarray', 'ndarray',
+ ('tobytes', tobytesdoc.format(deprecated='.. versionadded:: 1.9.0')))
add_newdoc('numpy.core.multiarray', 'ndarray', ('trace',
"""
@@ -4652,45 +4693,6 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('view',
#
##############################################################################
-add_newdoc('numpy.core.umath', 'frexp',
- """
- Return normalized fraction and exponent of 2 of input array, element-wise.
-
- Returns (`out1`, `out2`) from equation ``x` = out1 * 2**out2``.
-
- Parameters
- ----------
- x : array_like
- Input array.
-
- Returns
- -------
- (out1, out2) : tuple of ndarrays, (float, int)
- `out1` is a float array with values between -1 and 1.
- `out2` is an int array which represent the exponent of 2.
-
- See Also
- --------
- ldexp : Compute ``y = x1 * 2**x2``, the inverse of `frexp`.
-
- Notes
- -----
- Complex dtypes are not supported, they will raise a TypeError.
-
- Examples
- --------
- >>> x = np.arange(9)
- >>> y1, y2 = np.frexp(x)
- >>> y1
- array([ 0. , 0.5 , 0.5 , 0.75 , 0.5 , 0.625, 0.75 , 0.875,
- 0.5 ])
- >>> y2
- array([0, 1, 2, 2, 3, 3, 3, 3, 4])
- >>> y1 * 2**y2
- array([ 0., 1., 2., 3., 4., 5., 6., 7., 8.])
-
- """)
-
add_newdoc('numpy.core.umath', 'frompyfunc',
"""
frompyfunc(func, nin, nout)
@@ -4731,44 +4733,6 @@ add_newdoc('numpy.core.umath', 'frompyfunc',
""")
-add_newdoc('numpy.core.umath', 'ldexp',
- """
- Compute y = x1 * 2**x2.
-
- Parameters
- ----------
- x1 : array_like
- The array of multipliers.
- x2 : array_like
- The array of exponents.
-
- Returns
- -------
- y : array_like
- The output array, the result of ``x1 * 2**x2``.
-
- See Also
- --------
- frexp : Return (y1, y2) from ``x = y1 * 2**y2``, the inverse of `ldexp`.
-
- Notes
- -----
- Complex dtypes are not supported, they will raise a TypeError.
-
- `ldexp` is useful as the inverse of `frexp`, if used by itself it is
- more clear to simply use the expression ``x1 * 2**x2``.
-
- Examples
- --------
- >>> np.ldexp(5, np.arange(4))
- array([ 5., 10., 20., 40.], dtype=float32)
-
- >>> x = np.arange(6)
- >>> np.ldexp(*np.frexp(x))
- array([ 0., 1., 2., 3., 4., 5.])
-
- """)
-
add_newdoc('numpy.core.umath', 'geterrobj',
"""
geterrobj()
@@ -5672,12 +5636,13 @@ add_newdoc('numpy.core', 'ufunc', ('reduceat',
``ufunc.reduce(a[indices[i]:indices[i+1]])``, which becomes the i-th
generalized "row" parallel to `axis` in the final result (i.e., in a
2-D array, for example, if `axis = 0`, it becomes the i-th row, but if
- `axis = 1`, it becomes the i-th column). There are two exceptions to this:
+ `axis = 1`, it becomes the i-th column). There are three exceptions to this:
- * when ``i = len(indices) - 1`` (so for the last index),
- ``indices[i+1] = a.shape[axis]``.
- * if ``indices[i] >= indices[i + 1]``, the i-th generalized "row" is
- simply ``a[indices[i]]``.
+ * when ``i = len(indices) - 1`` (so for the last index),
+ ``indices[i+1] = a.shape[axis]``.
+ * if ``indices[i] >= indices[i + 1]``, the i-th generalized "row" is
+ simply ``a[indices[i]]``.
+ * if ``indices[i] >= len(a)`` or ``indices[i] < 0``, an error is raised.
The shape of the output depends on the size of `indices`, and may be
larger than `a` (this happens if ``len(indices) > a.shape[axis]``).
@@ -5836,6 +5801,8 @@ add_newdoc('numpy.core', 'ufunc', ('at',
increment the first element once because of buffering, whereas
`add.at(a, [0,0], 1)` will increment the first element twice.
+ .. versionadded:: 1.8.0
+
Parameters
----------
a : array_like
@@ -6151,7 +6118,19 @@ add_newdoc('numpy.core.multiarray', 'dtype', ('itemsize',
add_newdoc('numpy.core.multiarray', 'dtype', ('kind',
"""
- A character code (one of 'biufcSUV') identifying the general kind of data.
+ A character code (one of 'biufcOSUV') identifying the general kind of data.
+
+ = ======================
+ b boolean
+ i signed integer
+ u unsigned integer
+ f floating-point
+ c complex floating-point
+ O object
+ S (byte-)string
+ U Unicode
+ V void
+ = ======================
"""))
diff --git a/numpy/compat/py3k.py b/numpy/compat/py3k.py
index f5ac3f9f8..4607d9502 100644
--- a/numpy/compat/py3k.py
+++ b/numpy/compat/py3k.py
@@ -36,7 +36,7 @@ if sys.version_info[0] >= 3:
return str(s)
def isfileobj(f):
- return isinstance(f, (io.FileIO, io.BufferedReader))
+ return isinstance(f, (io.FileIO, io.BufferedReader, io.BufferedWriter))
def open_latin1(filename, mode='r'):
return open(filename, mode=mode, encoding='iso-8859-1')
diff --git a/numpy/compat/tests/test_compat.py b/numpy/compat/tests/test_compat.py
new file mode 100644
index 000000000..3df142e04
--- /dev/null
+++ b/numpy/compat/tests/test_compat.py
@@ -0,0 +1,19 @@
+from os.path import join
+
+from numpy.compat import isfileobj
+from numpy.testing import TestCase, assert_
+from numpy.testing.utils import tempdir
+
+
+def test_isfileobj():
+ with tempdir(prefix="numpy_test_compat_") as folder:
+ filename = join(folder, 'a.bin')
+
+ with open(filename, 'wb') as f:
+ assert_(isfileobj(f))
+
+ with open(filename, 'ab') as f:
+ assert_(isfileobj(f))
+
+ with open(filename, 'rb') as f:
+ assert_(isfileobj(f))
diff --git a/numpy/core/__init__.py b/numpy/core/__init__.py
index 79bc72a8c..0b8d5bb17 100644
--- a/numpy/core/__init__.py
+++ b/numpy/core/__init__.py
@@ -52,7 +52,11 @@ bench = Tester().bench
# The name numpy.core._ufunc_reconstruct must be
# available for unpickling to work.
def _ufunc_reconstruct(module, name):
- mod = __import__(module)
+ # The `fromlist` kwarg is required to ensure that `mod` points to the
+ # inner-most module rather than the parent package when module name is
+ # nested. This makes it possible to pickle non-toplevel ufuncs such as
+ # scipy.special.expit for instance.
+ mod = __import__(module, fromlist=[name])
return getattr(mod, name)
def _ufunc_reduce(func):
diff --git a/numpy/core/_methods.py b/numpy/core/_methods.py
index a064f70c7..00716e1b4 100644
--- a/numpy/core/_methods.py
+++ b/numpy/core/_methods.py
@@ -12,29 +12,33 @@ from numpy.core import umath as um
from numpy.core.numeric import asanyarray
from numpy.core import numerictypes as nt
+# save those O(100) nanoseconds!
+umr_maximum = um.maximum.reduce
+umr_minimum = um.minimum.reduce
+umr_sum = um.add.reduce
+umr_prod = um.multiply.reduce
+umr_any = um.logical_or.reduce
+umr_all = um.logical_and.reduce
+
+# avoid keyword arguments to speed up parsing, saves about 15%-20% for very
+# small reductions
def _amax(a, axis=None, out=None, keepdims=False):
- return um.maximum.reduce(a, axis=axis,
- out=out, keepdims=keepdims)
+ return umr_maximum(a, axis, None, out, keepdims)
def _amin(a, axis=None, out=None, keepdims=False):
- return um.minimum.reduce(a, axis=axis,
- out=out, keepdims=keepdims)
+ return umr_minimum(a, axis, None, out, keepdims)
def _sum(a, axis=None, dtype=None, out=None, keepdims=False):
- return um.add.reduce(a, axis=axis, dtype=dtype,
- out=out, keepdims=keepdims)
+ return umr_sum(a, axis, dtype, out, keepdims)
def _prod(a, axis=None, dtype=None, out=None, keepdims=False):
- return um.multiply.reduce(a, axis=axis, dtype=dtype,
- out=out, keepdims=keepdims)
+ return umr_prod(a, axis, dtype, out, keepdims)
def _any(a, axis=None, dtype=None, out=None, keepdims=False):
- return um.logical_or.reduce(a, axis=axis, dtype=dtype, out=out,
- keepdims=keepdims)
+ return umr_any(a, axis, dtype, out, keepdims)
def _all(a, axis=None, dtype=None, out=None, keepdims=False):
- return um.logical_and.reduce(a, axis=axis, dtype=dtype, out=out,
- keepdims=keepdims)
+ return umr_all(a, axis, dtype, out, keepdims)
def _count_reduce_items(arr, axis):
if axis is None:
@@ -59,12 +63,14 @@ def _mean(a, axis=None, dtype=None, out=None, keepdims=False):
if dtype is None and issubclass(arr.dtype.type, (nt.integer, nt.bool_)):
dtype = mu.dtype('f8')
- ret = um.add.reduce(arr, axis=axis, dtype=dtype, out=out, keepdims=keepdims)
+ ret = umr_sum(arr, axis, dtype, out, keepdims)
if isinstance(ret, mu.ndarray):
ret = um.true_divide(
ret, rcount, out=ret, casting='unsafe', subok=False)
- else:
+ elif hasattr(ret, 'dtype'):
ret = ret.dtype.type(ret / rcount)
+ else:
+ ret = ret / rcount
return ret
@@ -83,7 +89,7 @@ def _var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False):
# Compute the mean.
# Note that if dtype is not of inexact type then arraymean will
# not be either.
- arrmean = um.add.reduce(arr, axis=axis, dtype=dtype, keepdims=True)
+ arrmean = umr_sum(arr, axis, dtype, keepdims=True)
if isinstance(arrmean, mu.ndarray):
arrmean = um.true_divide(
arrmean, rcount, out=arrmean, casting='unsafe', subok=False)
@@ -98,7 +104,7 @@ def _var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False):
x = um.multiply(x, um.conjugate(x), out=x).real
else:
x = um.multiply(x, x, out=x)
- ret = um.add.reduce(x, axis=axis, dtype=dtype, out=out, keepdims=keepdims)
+ ret = umr_sum(x, axis, dtype, out, keepdims)
# Compute degrees of freedom and make sure it is not negative.
rcount = max([rcount - ddof, 0])
@@ -107,8 +113,10 @@ def _var(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False):
if isinstance(ret, mu.ndarray):
ret = um.true_divide(
ret, rcount, out=ret, casting='unsafe', subok=False)
- else:
+ elif hasattr(ret, 'dtype'):
ret = ret.dtype.type(ret / rcount)
+ else:
+ ret = ret / rcount
return ret
@@ -118,7 +126,9 @@ def _std(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False):
if isinstance(ret, mu.ndarray):
ret = um.sqrt(ret, out=ret)
- else:
+ elif hasattr(ret, 'dtype'):
ret = ret.dtype.type(um.sqrt(ret))
+ else:
+ ret = um.sqrt(ret)
return ret
diff --git a/numpy/core/bento.info b/numpy/core/bento.info
index 6089b5d7b..299bd8ca5 100644
--- a/numpy/core/bento.info
+++ b/numpy/core/bento.info
@@ -11,10 +11,12 @@ Library:
CompiledLibrary: npysort
Sources:
src/private/npy_partition.h.src,
+ src/private/npy_binsearch.h.src,
src/npysort/quicksort.c.src,
src/npysort/mergesort.c.src,
src/npysort/heapsort.c.src,
- src/npysort/selection.c.src
+ src/npysort/selection.c.src,
+ src/npysort/binsearch.c.src
Extension: multiarray
Sources:
src/multiarray/multiarraymodule_onefile.c
diff --git a/numpy/core/bscript b/numpy/core/bscript
index a2222eb66..5230aa428 100644
--- a/numpy/core/bscript
+++ b/numpy/core/bscript
@@ -416,7 +416,7 @@ def pre_build(context):
"lib", "npy-pkg-config", "mlib.ini"))
inifile_npymath = context.local_node.declare(os.path.join(
"lib", "npy-pkg-config", "npymath.ini"))
- context.register_outputs("numpy_gen_inifiles", "numpyconfig",
+ context.register_outputs("numpy_gen_inifiles", "numpyconfig",
[inifile_mlib, inifile_npymath])
context.register_category("numpy_gen_headers")
@@ -444,6 +444,7 @@ def pre_build(context):
bld(target="multiarray_templates", source=multiarray_templates)
if ENABLE_SEPARATE_COMPILATION:
sources = [pjoin('src', 'multiarray', 'arrayobject.c'),
+ pjoin('src', 'multiarray', 'alloc.c'),
pjoin('src', 'multiarray', 'arraytypes.c.src'),
pjoin('src', 'multiarray', 'array_assign.c'),
pjoin('src', 'multiarray', 'array_assign_array.c'),
@@ -491,7 +492,11 @@ def pre_build(context):
return context.default_builder(extension,
includes=includes,
source=sources,
- use="npysort npymath")
+ use="npysort npymath",
+ defines=['_FILE_OFFSET_BITS=64',
+ '_LARGEFILE_SOURCE=1',
+ '_LARGEFILE64_SOURCE=1']
+ )
context.register_builder("multiarray", builder_multiarray)
def build_ufunc(extension):
@@ -501,6 +506,7 @@ def pre_build(context):
name="ufunc_api")
ufunc_templates = [
+ "src/umath/loops.h.src",
"src/umath/loops.c.src",
"src/umath/funcs.inc.src",
"src/umath/simd.inc.src"]
@@ -513,6 +519,7 @@ def pre_build(context):
includes = ["src/umath", "src/multiarray", "src/private"]
if ENABLE_SEPARATE_COMPILATION:
sources = [
+ pjoin("src", "umath", "loops.h.src"),
pjoin("src", "umath", "loops.c.src"),
pjoin('src', 'umath', 'reduction.c'),
pjoin('src', 'umath', 'ufunc_object.c'),
diff --git a/numpy/core/code_generators/cversions.txt b/numpy/core/code_generators/cversions.txt
index 6ab422055..acfced812 100644
--- a/numpy/core/code_generators/cversions.txt
+++ b/numpy/core/code_generators/cversions.txt
@@ -4,16 +4,28 @@
0x00000001 = 603580d224763e58c5e7147f804dc0f5
0x00000002 = 8ecb29306758515ae69749c803a75da1
0x00000003 = bf22c0d05b31625d2a7015988d61ce5a
+
# Starting from here, the hash is defined from numpy_api.full_api dict
# version 4 added neighborhood iterators and PyArray_Correlate2
0x00000004 = 3d8940bf7b0d2a4e25be4338c14c3c85
0x00000005 = 77e2e846db87f25d7cf99f9d812076f0
+
# Version 6 (NumPy 1.6) added new iterator, half float and casting functions,
# PyArray_CountNonzero, PyArray_NewLikeArray and PyArray_MatrixProduct2.
0x00000006 = e61d5dc51fa1c6459328266e215d6987
+
# Version 7 (NumPy 1.7) improved datetime64, misc utilities.
0x00000007 = e396ba3912dcf052eaee1b0b203a7724
+
# Version 8 Added interface to MapIterObject
0x00000008 = 17321775fc884de0b1eda478cd61c74b
-# Version 9 Added interface for partition functions, PyArray_NEW_ZEROED
-0x00000009 = 327bd114df09c2eb7a0bcc6901e2a3ed
+
+# Version 9 (NumPy 1.8) Added interface for partition functions,
+# PyArray_NEW_ZEROED, commented out as the hash changed in
+# Numpy 1.9 due to annotation.
+#0x00000009 = 327bd114df09c2eb7a0bcc6901e2a3ed
+
+# Version 9 (NumPy 1.9) Added function annotations.
+# The interface has not changed, but the hash is different due to
+# the annotations, so keep the previous version number.
+0x00000009 = 982c4ebb6e7e4c194bf46b1535b4ef1b
diff --git a/numpy/core/code_generators/genapi.py b/numpy/core/code_generators/genapi.py
index ad054920a..84bd042f5 100644
--- a/numpy/core/code_generators/genapi.py
+++ b/numpy/core/code_generators/genapi.py
@@ -23,7 +23,8 @@ from os.path import join
__docformat__ = 'restructuredtext'
# The files under src/ that are scanned for API functions
-API_FILES = [join('multiarray', 'array_assign_array.c'),
+API_FILES = [join('multiarray', 'alloc.c'),
+ join('multiarray', 'array_assign_array.c'),
join('multiarray', 'array_assign_scalar.c'),
join('multiarray', 'arrayobject.c'),
join('multiarray', 'arraytypes.c.src'),
@@ -74,6 +75,29 @@ def remove_whitespace(s):
def _repl(str):
return str.replace('Bool', 'npy_bool')
+
+class StealRef:
+ def __init__(self, arg):
+ self.arg = arg # counting from 1
+
+ def __str__(self):
+ try:
+ return ' '.join('NPY_STEALS_REF_TO_ARG(%d)' % x for x in self.arg)
+ except TypeError:
+ return 'NPY_STEALS_REF_TO_ARG(%d)' % self.arg
+
+
+class NonNull:
+ def __init__(self, arg):
+ self.arg = arg # counting from 1
+
+ def __str__(self):
+ try:
+ return ' '.join('NPY_GCC_NONNULL(%d)' % x for x in self.arg)
+ except TypeError:
+ return 'NPY_GCC_NONNULL(%d)' % self.arg
+
+
class Function(object):
def __init__(self, name, return_type, args, doc=''):
self.name = name
@@ -350,9 +374,10 @@ NPY_NO_EXPORT PyBoolScalarObject _PyArrayScalar_BoolValues[2];
return astr
class FunctionApi(object):
- def __init__(self, name, index, return_type, args, api_name):
+ def __init__(self, name, index, annotations, return_type, args, api_name):
self.name = name
self.index = index
+ self.annotations = annotations
self.return_type = return_type
self.args = args
self.api_name = api_name
@@ -377,17 +402,21 @@ class FunctionApi(object):
return " (void *) %s" % self.name
def internal_define(self):
+ annstr = []
+ for a in self.annotations:
+ annstr.append(str(a))
+ annstr = ' '.join(annstr)
astr = """\
-NPY_NO_EXPORT %s %s \\\n (%s);""" % (self.return_type,
- self.name,
- self._argtypes_string())
+NPY_NO_EXPORT %s %s %s \\\n (%s);""" % (annstr, self.return_type,
+ self.name,
+ self._argtypes_string())
return astr
def order_dict(d):
"""Order dict by its values."""
o = list(d.items())
def _key(x):
- return (x[1], x[0])
+ return x[1] + (x[0],)
return sorted(o, key=_key)
def merge_api_dicts(dicts):
@@ -419,7 +448,7 @@ Same index has been used twice in api definition: %s
raise ValueError(msg)
# No 'hole' in the indexes may be allowed, and it must starts at 0
- indexes = set(d.values())
+ indexes = set(v[0] for v in d.values())
expected = set(range(len(indexes)))
if not indexes == expected:
diff = expected.symmetric_difference(indexes)
@@ -434,7 +463,7 @@ def get_api_functions(tagname, api_dict):
functions.extend(find_functions(f, tagname))
dfunctions = []
for func in functions:
- o = api_dict[func.name]
+ o = api_dict[func.name][0]
dfunctions.append( (o, func) )
dfunctions.sort()
return [a[1] for a in dfunctions]
@@ -444,13 +473,9 @@ def fullapi_hash(api_dicts):
of the list of items in the API (as a string)."""
a = []
for d in api_dicts:
- def sorted_by_values(d):
- """Sort a dictionary by its values. Assume the dictionary items is of
- the form func_name -> order"""
- return sorted(d.items(), key=lambda x_y: (x_y[1], x_y[0]))
- for name, index in sorted_by_values(d):
+ for name, data in order_dict(d):
a.extend(name)
- a.extend(str(index))
+ a.extend(','.join(map(str, data)))
return md5new(''.join(a).encode('ascii')).hexdigest()
diff --git a/numpy/core/code_generators/generate_numpy_api.py b/numpy/core/code_generators/generate_numpy_api.py
index ce270a6a0..415cbf7fc 100644
--- a/numpy/core/code_generators/generate_numpy_api.py
+++ b/numpy/core/code_generators/generate_numpy_api.py
@@ -8,8 +8,9 @@ from genapi import \
import numpy_api
+# use annotated api when running under cpychecker
h_template = r"""
-#ifdef _MULTIARRAYMODULE
+#if defined(_MULTIARRAYMODULE) || defined(WITH_CPYCHECKER_STEALS_REFERENCE_TO_ARG_ATTRIBUTE)
typedef struct {
PyObject_HEAD
@@ -183,13 +184,11 @@ def do_generate_api(targets, sources):
doc_file = targets[2]
global_vars = sources[0]
- global_vars_types = sources[1]
- scalar_bool_values = sources[2]
- types_api = sources[3]
- multiarray_funcs = sources[4]
+ scalar_bool_values = sources[1]
+ types_api = sources[2]
+ multiarray_funcs = sources[3]
- # Remove global_vars_type: not a api dict
- multiarray_api = sources[:1] + sources[2:]
+ multiarray_api = sources[:]
module_list = []
extension_list = []
@@ -208,18 +207,22 @@ def do_generate_api(targets, sources):
multiarray_api_dict = {}
for f in numpyapi_list:
name = f.name
- index = multiarray_funcs[name]
- multiarray_api_dict[f.name] = FunctionApi(f.name, index, f.return_type,
+ index = multiarray_funcs[name][0]
+ annotations = multiarray_funcs[name][1:]
+ multiarray_api_dict[f.name] = FunctionApi(f.name, index, annotations,
+ f.return_type,
f.args, api_name)
- for name, index in global_vars.items():
- type = global_vars_types[name]
+ for name, val in global_vars.items():
+ index, type = val
multiarray_api_dict[name] = GlobalVarApi(name, index, type, api_name)
- for name, index in scalar_bool_values.items():
+ for name, val in scalar_bool_values.items():
+ index = val[0]
multiarray_api_dict[name] = BoolValuesApi(name, index, api_name)
- for name, index in types_api.items():
+ for name, val in types_api.items():
+ index = val[0]
multiarray_api_dict[name] = TypeApi(name, index, 'PyTypeObject', api_name)
if len(multiarray_api_dict) != len(multiarray_api_index):
diff --git a/numpy/core/code_generators/generate_ufunc_api.py b/numpy/core/code_generators/generate_ufunc_api.py
index 6305385af..b594fccf7 100644
--- a/numpy/core/code_generators/generate_ufunc_api.py
+++ b/numpy/core/code_generators/generate_ufunc_api.py
@@ -172,11 +172,13 @@ def do_generate_api(targets, sources):
api_name = 'PyUFunc_API'
for f in ufunc_api_list:
name = f.name
- index = ufunc_api_index[name]
- ufunc_api_dict[name] = FunctionApi(f.name, index, f.return_type,
- f.args, api_name)
+ index = ufunc_api_index[name][0]
+ annotations = ufunc_api_index[name][1:]
+ ufunc_api_dict[name] = FunctionApi(f.name, index, annotations,
+ f.return_type, f.args, api_name)
- for name, index in numpy_api.ufunc_types_api.items():
+ for name, val in numpy_api.ufunc_types_api.items():
+ index = val[0]
ufunc_api_dict[name] = TypeApi(name, index, 'PyTypeObject', api_name)
# set up object API
diff --git a/numpy/core/code_generators/generate_umath.py b/numpy/core/code_generators/generate_umath.py
index e02cb8709..e3c9cf28b 100644
--- a/numpy/core/code_generators/generate_umath.py
+++ b/numpy/core/code_generators/generate_umath.py
@@ -369,7 +369,7 @@ defdict = {
'negative':
Ufunc(1, 1, None,
docstrings.get('numpy.core.umath.negative'),
- 'PyUFunc_SimpleUnaryOperationTypeResolver',
+ 'PyUFunc_NegativeTypeResolver',
TD(bints+flts+timedeltaonly),
TD(cmplx, f='neg'),
TD(O, f='PyNumber_Negative'),
diff --git a/numpy/core/code_generators/numpy_api.py b/numpy/core/code_generators/numpy_api.py
index 791bc6ffc..cd6d2f176 100644
--- a/numpy/core/code_generators/numpy_api.py
+++ b/numpy/core/code_generators/numpy_api.py
@@ -14,64 +14,64 @@ exception, so it should hopefully not get unnoticed).
"""
from __future__ import division, absolute_import, print_function
-multiarray_global_vars = {
- 'NPY_NUMUSERTYPES': 7,
- 'NPY_DEFAULT_ASSIGN_CASTING': 292,
-}
+from code_generators.genapi import StealRef, NonNull
-multiarray_global_vars_types = {
- 'NPY_NUMUSERTYPES': 'int',
- 'NPY_DEFAULT_ASSIGN_CASTING': 'NPY_CASTING',
+# index, type
+multiarray_global_vars = {
+ 'NPY_NUMUSERTYPES': (7, 'int'),
+ 'NPY_DEFAULT_ASSIGN_CASTING': (292, 'NPY_CASTING'),
}
multiarray_scalar_bool_values = {
- '_PyArrayScalar_BoolValues': 9
+ '_PyArrayScalar_BoolValues': (9,)
}
+# index, annotations
+# please mark functions that have been checked to not need any annotations
multiarray_types_api = {
- 'PyBigArray_Type': 1,
- 'PyArray_Type': 2,
- 'PyArrayDescr_Type': 3,
- 'PyArrayFlags_Type': 4,
- 'PyArrayIter_Type': 5,
- 'PyArrayMultiIter_Type': 6,
- 'PyBoolArrType_Type': 8,
- 'PyGenericArrType_Type': 10,
- 'PyNumberArrType_Type': 11,
- 'PyIntegerArrType_Type': 12,
- 'PySignedIntegerArrType_Type': 13,
- 'PyUnsignedIntegerArrType_Type': 14,
- 'PyInexactArrType_Type': 15,
- 'PyFloatingArrType_Type': 16,
- 'PyComplexFloatingArrType_Type': 17,
- 'PyFlexibleArrType_Type': 18,
- 'PyCharacterArrType_Type': 19,
- 'PyByteArrType_Type': 20,
- 'PyShortArrType_Type': 21,
- 'PyIntArrType_Type': 22,
- 'PyLongArrType_Type': 23,
- 'PyLongLongArrType_Type': 24,
- 'PyUByteArrType_Type': 25,
- 'PyUShortArrType_Type': 26,
- 'PyUIntArrType_Type': 27,
- 'PyULongArrType_Type': 28,
- 'PyULongLongArrType_Type': 29,
- 'PyFloatArrType_Type': 30,
- 'PyDoubleArrType_Type': 31,
- 'PyLongDoubleArrType_Type': 32,
- 'PyCFloatArrType_Type': 33,
- 'PyCDoubleArrType_Type': 34,
- 'PyCLongDoubleArrType_Type': 35,
- 'PyObjectArrType_Type': 36,
- 'PyStringArrType_Type': 37,
- 'PyUnicodeArrType_Type': 38,
- 'PyVoidArrType_Type': 39,
+ 'PyBigArray_Type': (1,),
+ 'PyArray_Type': (2,),
+ 'PyArrayDescr_Type': (3,),
+ 'PyArrayFlags_Type': (4,),
+ 'PyArrayIter_Type': (5,),
+ 'PyArrayMultiIter_Type': (6,),
+ 'PyBoolArrType_Type': (8,),
+ 'PyGenericArrType_Type': (10,),
+ 'PyNumberArrType_Type': (11,),
+ 'PyIntegerArrType_Type': (12,),
+ 'PySignedIntegerArrType_Type': (13,),
+ 'PyUnsignedIntegerArrType_Type': (14,),
+ 'PyInexactArrType_Type': (15,),
+ 'PyFloatingArrType_Type': (16,),
+ 'PyComplexFloatingArrType_Type': (17,),
+ 'PyFlexibleArrType_Type': (18,),
+ 'PyCharacterArrType_Type': (19,),
+ 'PyByteArrType_Type': (20,),
+ 'PyShortArrType_Type': (21,),
+ 'PyIntArrType_Type': (22,),
+ 'PyLongArrType_Type': (23,),
+ 'PyLongLongArrType_Type': (24,),
+ 'PyUByteArrType_Type': (25,),
+ 'PyUShortArrType_Type': (26,),
+ 'PyUIntArrType_Type': (27,),
+ 'PyULongArrType_Type': (28,),
+ 'PyULongLongArrType_Type': (29,),
+ 'PyFloatArrType_Type': (30,),
+ 'PyDoubleArrType_Type': (31,),
+ 'PyLongDoubleArrType_Type': (32,),
+ 'PyCFloatArrType_Type': (33,),
+ 'PyCDoubleArrType_Type': (34,),
+ 'PyCLongDoubleArrType_Type': (35,),
+ 'PyObjectArrType_Type': (36,),
+ 'PyStringArrType_Type': (37,),
+ 'PyUnicodeArrType_Type': (38,),
+ 'PyVoidArrType_Type': (39,),
# End 1.5 API
- 'PyTimeIntegerArrType_Type': 214,
- 'PyDatetimeArrType_Type': 215,
- 'PyTimedeltaArrType_Type': 216,
- 'PyHalfArrType_Type': 217,
- 'NpyIter_Type': 218,
+ 'PyTimeIntegerArrType_Type': (214,),
+ 'PyDatetimeArrType_Type': (215,),
+ 'PyTimedeltaArrType_Type': (216,),
+ 'PyHalfArrType_Type': (217,),
+ 'NpyIter_Type': (218,),
# End 1.6 API
}
@@ -80,318 +80,318 @@ multiarray_types_api = {
#define _PyArrayScalar_BoolValues ((PyBoolScalarObject *)PyArray_API[8])
multiarray_funcs_api = {
- 'PyArray_GetNDArrayCVersion': 0,
- 'PyArray_SetNumericOps': 40,
- 'PyArray_GetNumericOps': 41,
- 'PyArray_INCREF': 42,
- 'PyArray_XDECREF': 43,
- 'PyArray_SetStringFunction': 44,
- 'PyArray_DescrFromType': 45,
- 'PyArray_TypeObjectFromType': 46,
- 'PyArray_Zero': 47,
- 'PyArray_One': 48,
- 'PyArray_CastToType': 49,
- 'PyArray_CastTo': 50,
- 'PyArray_CastAnyTo': 51,
- 'PyArray_CanCastSafely': 52,
- 'PyArray_CanCastTo': 53,
- 'PyArray_ObjectType': 54,
- 'PyArray_DescrFromObject': 55,
- 'PyArray_ConvertToCommonType': 56,
- 'PyArray_DescrFromScalar': 57,
- 'PyArray_DescrFromTypeObject': 58,
- 'PyArray_Size': 59,
- 'PyArray_Scalar': 60,
- 'PyArray_FromScalar': 61,
- 'PyArray_ScalarAsCtype': 62,
- 'PyArray_CastScalarToCtype': 63,
- 'PyArray_CastScalarDirect': 64,
- 'PyArray_ScalarFromObject': 65,
- 'PyArray_GetCastFunc': 66,
- 'PyArray_FromDims': 67,
- 'PyArray_FromDimsAndDataAndDescr': 68,
- 'PyArray_FromAny': 69,
- 'PyArray_EnsureArray': 70,
- 'PyArray_EnsureAnyArray': 71,
- 'PyArray_FromFile': 72,
- 'PyArray_FromString': 73,
- 'PyArray_FromBuffer': 74,
- 'PyArray_FromIter': 75,
- 'PyArray_Return': 76,
- 'PyArray_GetField': 77,
- 'PyArray_SetField': 78,
- 'PyArray_Byteswap': 79,
- 'PyArray_Resize': 80,
- 'PyArray_MoveInto': 81,
- 'PyArray_CopyInto': 82,
- 'PyArray_CopyAnyInto': 83,
- 'PyArray_CopyObject': 84,
- 'PyArray_NewCopy': 85,
- 'PyArray_ToList': 86,
- 'PyArray_ToString': 87,
- 'PyArray_ToFile': 88,
- 'PyArray_Dump': 89,
- 'PyArray_Dumps': 90,
- 'PyArray_ValidType': 91,
- 'PyArray_UpdateFlags': 92,
- 'PyArray_New': 93,
- 'PyArray_NewFromDescr': 94,
- 'PyArray_DescrNew': 95,
- 'PyArray_DescrNewFromType': 96,
- 'PyArray_GetPriority': 97,
- 'PyArray_IterNew': 98,
- 'PyArray_MultiIterNew': 99,
- 'PyArray_PyIntAsInt': 100,
- 'PyArray_PyIntAsIntp': 101,
- 'PyArray_Broadcast': 102,
- 'PyArray_FillObjectArray': 103,
- 'PyArray_FillWithScalar': 104,
- 'PyArray_CheckStrides': 105,
- 'PyArray_DescrNewByteorder': 106,
- 'PyArray_IterAllButAxis': 107,
- 'PyArray_CheckFromAny': 108,
- 'PyArray_FromArray': 109,
- 'PyArray_FromInterface': 110,
- 'PyArray_FromStructInterface': 111,
- 'PyArray_FromArrayAttr': 112,
- 'PyArray_ScalarKind': 113,
- 'PyArray_CanCoerceScalar': 114,
- 'PyArray_NewFlagsObject': 115,
- 'PyArray_CanCastScalar': 116,
- 'PyArray_CompareUCS4': 117,
- 'PyArray_RemoveSmallest': 118,
- 'PyArray_ElementStrides': 119,
- 'PyArray_Item_INCREF': 120,
- 'PyArray_Item_XDECREF': 121,
- 'PyArray_FieldNames': 122,
- 'PyArray_Transpose': 123,
- 'PyArray_TakeFrom': 124,
- 'PyArray_PutTo': 125,
- 'PyArray_PutMask': 126,
- 'PyArray_Repeat': 127,
- 'PyArray_Choose': 128,
- 'PyArray_Sort': 129,
- 'PyArray_ArgSort': 130,
- 'PyArray_SearchSorted': 131,
- 'PyArray_ArgMax': 132,
- 'PyArray_ArgMin': 133,
- 'PyArray_Reshape': 134,
- 'PyArray_Newshape': 135,
- 'PyArray_Squeeze': 136,
- 'PyArray_View': 137,
- 'PyArray_SwapAxes': 138,
- 'PyArray_Max': 139,
- 'PyArray_Min': 140,
- 'PyArray_Ptp': 141,
- 'PyArray_Mean': 142,
- 'PyArray_Trace': 143,
- 'PyArray_Diagonal': 144,
- 'PyArray_Clip': 145,
- 'PyArray_Conjugate': 146,
- 'PyArray_Nonzero': 147,
- 'PyArray_Std': 148,
- 'PyArray_Sum': 149,
- 'PyArray_CumSum': 150,
- 'PyArray_Prod': 151,
- 'PyArray_CumProd': 152,
- 'PyArray_All': 153,
- 'PyArray_Any': 154,
- 'PyArray_Compress': 155,
- 'PyArray_Flatten': 156,
- 'PyArray_Ravel': 157,
- 'PyArray_MultiplyList': 158,
- 'PyArray_MultiplyIntList': 159,
- 'PyArray_GetPtr': 160,
- 'PyArray_CompareLists': 161,
- 'PyArray_AsCArray': 162,
- 'PyArray_As1D': 163,
- 'PyArray_As2D': 164,
- 'PyArray_Free': 165,
- 'PyArray_Converter': 166,
- 'PyArray_IntpFromSequence': 167,
- 'PyArray_Concatenate': 168,
- 'PyArray_InnerProduct': 169,
- 'PyArray_MatrixProduct': 170,
- 'PyArray_CopyAndTranspose': 171,
- 'PyArray_Correlate': 172,
- 'PyArray_TypestrConvert': 173,
- 'PyArray_DescrConverter': 174,
- 'PyArray_DescrConverter2': 175,
- 'PyArray_IntpConverter': 176,
- 'PyArray_BufferConverter': 177,
- 'PyArray_AxisConverter': 178,
- 'PyArray_BoolConverter': 179,
- 'PyArray_ByteorderConverter': 180,
- 'PyArray_OrderConverter': 181,
- 'PyArray_EquivTypes': 182,
- 'PyArray_Zeros': 183,
- 'PyArray_Empty': 184,
- 'PyArray_Where': 185,
- 'PyArray_Arange': 186,
- 'PyArray_ArangeObj': 187,
- 'PyArray_SortkindConverter': 188,
- 'PyArray_LexSort': 189,
- 'PyArray_Round': 190,
- 'PyArray_EquivTypenums': 191,
- 'PyArray_RegisterDataType': 192,
- 'PyArray_RegisterCastFunc': 193,
- 'PyArray_RegisterCanCast': 194,
- 'PyArray_InitArrFuncs': 195,
- 'PyArray_IntTupleFromIntp': 196,
- 'PyArray_TypeNumFromName': 197,
- 'PyArray_ClipmodeConverter': 198,
- 'PyArray_OutputConverter': 199,
- 'PyArray_BroadcastToShape': 200,
- '_PyArray_SigintHandler': 201,
- '_PyArray_GetSigintBuf': 202,
- 'PyArray_DescrAlignConverter': 203,
- 'PyArray_DescrAlignConverter2': 204,
- 'PyArray_SearchsideConverter': 205,
- 'PyArray_CheckAxis': 206,
- 'PyArray_OverflowMultiplyList': 207,
- 'PyArray_CompareString': 208,
- 'PyArray_MultiIterFromObjects': 209,
- 'PyArray_GetEndianness': 210,
- 'PyArray_GetNDArrayCFeatureVersion': 211,
- 'PyArray_Correlate2': 212,
- 'PyArray_NeighborhoodIterNew': 213,
+ 'PyArray_GetNDArrayCVersion': (0,),
+ 'PyArray_SetNumericOps': (40,),
+ 'PyArray_GetNumericOps': (41,),
+ 'PyArray_INCREF': (42,),
+ 'PyArray_XDECREF': (43,),
+ 'PyArray_SetStringFunction': (44,),
+ 'PyArray_DescrFromType': (45,),
+ 'PyArray_TypeObjectFromType': (46,),
+ 'PyArray_Zero': (47,),
+ 'PyArray_One': (48,),
+ 'PyArray_CastToType': (49, StealRef(2), NonNull(2)),
+ 'PyArray_CastTo': (50,),
+ 'PyArray_CastAnyTo': (51,),
+ 'PyArray_CanCastSafely': (52,),
+ 'PyArray_CanCastTo': (53,),
+ 'PyArray_ObjectType': (54,),
+ 'PyArray_DescrFromObject': (55,),
+ 'PyArray_ConvertToCommonType': (56,),
+ 'PyArray_DescrFromScalar': (57,),
+ 'PyArray_DescrFromTypeObject': (58,),
+ 'PyArray_Size': (59,),
+ 'PyArray_Scalar': (60,),
+ 'PyArray_FromScalar': (61, StealRef(2)),
+ 'PyArray_ScalarAsCtype': (62,),
+ 'PyArray_CastScalarToCtype': (63,),
+ 'PyArray_CastScalarDirect': (64,),
+ 'PyArray_ScalarFromObject': (65,),
+ 'PyArray_GetCastFunc': (66,),
+ 'PyArray_FromDims': (67,),
+ 'PyArray_FromDimsAndDataAndDescr': (68, StealRef(3)),
+ 'PyArray_FromAny': (69, StealRef(2)),
+ 'PyArray_EnsureArray': (70, StealRef(1)),
+ 'PyArray_EnsureAnyArray': (71, StealRef(1)),
+ 'PyArray_FromFile': (72,),
+ 'PyArray_FromString': (73,),
+ 'PyArray_FromBuffer': (74,),
+ 'PyArray_FromIter': (75, StealRef(2)),
+ 'PyArray_Return': (76, StealRef(1)),
+ 'PyArray_GetField': (77, StealRef(2), NonNull(2)),
+ 'PyArray_SetField': (78, StealRef(2), NonNull(2)),
+ 'PyArray_Byteswap': (79,),
+ 'PyArray_Resize': (80,),
+ 'PyArray_MoveInto': (81,),
+ 'PyArray_CopyInto': (82,),
+ 'PyArray_CopyAnyInto': (83,),
+ 'PyArray_CopyObject': (84,),
+ 'PyArray_NewCopy': (85, NonNull(1)),
+ 'PyArray_ToList': (86,),
+ 'PyArray_ToString': (87,),
+ 'PyArray_ToFile': (88,),
+ 'PyArray_Dump': (89,),
+ 'PyArray_Dumps': (90,),
+ 'PyArray_ValidType': (91,),
+ 'PyArray_UpdateFlags': (92,),
+ 'PyArray_New': (93, NonNull(1)),
+ 'PyArray_NewFromDescr': (94, StealRef(2), NonNull([1, 2])),
+ 'PyArray_DescrNew': (95,),
+ 'PyArray_DescrNewFromType': (96,),
+ 'PyArray_GetPriority': (97,),
+ 'PyArray_IterNew': (98,),
+ 'PyArray_MultiIterNew': (99,),
+ 'PyArray_PyIntAsInt': (100,),
+ 'PyArray_PyIntAsIntp': (101,),
+ 'PyArray_Broadcast': (102,),
+ 'PyArray_FillObjectArray': (103,),
+ 'PyArray_FillWithScalar': (104,),
+ 'PyArray_CheckStrides': (105,),
+ 'PyArray_DescrNewByteorder': (106,),
+ 'PyArray_IterAllButAxis': (107,),
+ 'PyArray_CheckFromAny': (108, StealRef(2)),
+ 'PyArray_FromArray': (109, StealRef(2)),
+ 'PyArray_FromInterface': (110,),
+ 'PyArray_FromStructInterface': (111,),
+ 'PyArray_FromArrayAttr': (112,),
+ 'PyArray_ScalarKind': (113,),
+ 'PyArray_CanCoerceScalar': (114,),
+ 'PyArray_NewFlagsObject': (115,),
+ 'PyArray_CanCastScalar': (116,),
+ 'PyArray_CompareUCS4': (117,),
+ 'PyArray_RemoveSmallest': (118,),
+ 'PyArray_ElementStrides': (119,),
+ 'PyArray_Item_INCREF': (120,),
+ 'PyArray_Item_XDECREF': (121,),
+ 'PyArray_FieldNames': (122,),
+ 'PyArray_Transpose': (123,),
+ 'PyArray_TakeFrom': (124,),
+ 'PyArray_PutTo': (125,),
+ 'PyArray_PutMask': (126,),
+ 'PyArray_Repeat': (127,),
+ 'PyArray_Choose': (128,),
+ 'PyArray_Sort': (129,),
+ 'PyArray_ArgSort': (130,),
+ 'PyArray_SearchSorted': (131,),
+ 'PyArray_ArgMax': (132,),
+ 'PyArray_ArgMin': (133,),
+ 'PyArray_Reshape': (134,),
+ 'PyArray_Newshape': (135,),
+ 'PyArray_Squeeze': (136,),
+ 'PyArray_View': (137, StealRef(2)),
+ 'PyArray_SwapAxes': (138,),
+ 'PyArray_Max': (139,),
+ 'PyArray_Min': (140,),
+ 'PyArray_Ptp': (141,),
+ 'PyArray_Mean': (142,),
+ 'PyArray_Trace': (143,),
+ 'PyArray_Diagonal': (144,),
+ 'PyArray_Clip': (145,),
+ 'PyArray_Conjugate': (146,),
+ 'PyArray_Nonzero': (147,),
+ 'PyArray_Std': (148,),
+ 'PyArray_Sum': (149,),
+ 'PyArray_CumSum': (150,),
+ 'PyArray_Prod': (151,),
+ 'PyArray_CumProd': (152,),
+ 'PyArray_All': (153,),
+ 'PyArray_Any': (154,),
+ 'PyArray_Compress': (155,),
+ 'PyArray_Flatten': (156,),
+ 'PyArray_Ravel': (157,),
+ 'PyArray_MultiplyList': (158,),
+ 'PyArray_MultiplyIntList': (159,),
+ 'PyArray_GetPtr': (160,),
+ 'PyArray_CompareLists': (161,),
+ 'PyArray_AsCArray': (162, StealRef(5)),
+ 'PyArray_As1D': (163,),
+ 'PyArray_As2D': (164,),
+ 'PyArray_Free': (165,),
+ 'PyArray_Converter': (166,),
+ 'PyArray_IntpFromSequence': (167,),
+ 'PyArray_Concatenate': (168,),
+ 'PyArray_InnerProduct': (169,),
+ 'PyArray_MatrixProduct': (170,),
+ 'PyArray_CopyAndTranspose': (171,),
+ 'PyArray_Correlate': (172,),
+ 'PyArray_TypestrConvert': (173,),
+ 'PyArray_DescrConverter': (174,),
+ 'PyArray_DescrConverter2': (175,),
+ 'PyArray_IntpConverter': (176,),
+ 'PyArray_BufferConverter': (177,),
+ 'PyArray_AxisConverter': (178,),
+ 'PyArray_BoolConverter': (179,),
+ 'PyArray_ByteorderConverter': (180,),
+ 'PyArray_OrderConverter': (181,),
+ 'PyArray_EquivTypes': (182,),
+ 'PyArray_Zeros': (183, StealRef(3)),
+ 'PyArray_Empty': (184, StealRef(3)),
+ 'PyArray_Where': (185,),
+ 'PyArray_Arange': (186,),
+ 'PyArray_ArangeObj': (187,),
+ 'PyArray_SortkindConverter': (188,),
+ 'PyArray_LexSort': (189,),
+ 'PyArray_Round': (190,),
+ 'PyArray_EquivTypenums': (191,),
+ 'PyArray_RegisterDataType': (192,),
+ 'PyArray_RegisterCastFunc': (193,),
+ 'PyArray_RegisterCanCast': (194,),
+ 'PyArray_InitArrFuncs': (195,),
+ 'PyArray_IntTupleFromIntp': (196,),
+ 'PyArray_TypeNumFromName': (197,),
+ 'PyArray_ClipmodeConverter': (198,),
+ 'PyArray_OutputConverter': (199,),
+ 'PyArray_BroadcastToShape': (200,),
+ '_PyArray_SigintHandler': (201,),
+ '_PyArray_GetSigintBuf': (202,),
+ 'PyArray_DescrAlignConverter': (203,),
+ 'PyArray_DescrAlignConverter2': (204,),
+ 'PyArray_SearchsideConverter': (205,),
+ 'PyArray_CheckAxis': (206,),
+ 'PyArray_OverflowMultiplyList': (207,),
+ 'PyArray_CompareString': (208,),
+ 'PyArray_MultiIterFromObjects': (209,),
+ 'PyArray_GetEndianness': (210,),
+ 'PyArray_GetNDArrayCFeatureVersion': (211,),
+ 'PyArray_Correlate2': (212,),
+ 'PyArray_NeighborhoodIterNew': (213,),
# End 1.5 API
- 'PyArray_SetDatetimeParseFunction': 219,
- 'PyArray_DatetimeToDatetimeStruct': 220,
- 'PyArray_TimedeltaToTimedeltaStruct': 221,
- 'PyArray_DatetimeStructToDatetime': 222,
- 'PyArray_TimedeltaStructToTimedelta': 223,
+ 'PyArray_SetDatetimeParseFunction': (219,),
+ 'PyArray_DatetimeToDatetimeStruct': (220,),
+ 'PyArray_TimedeltaToTimedeltaStruct': (221,),
+ 'PyArray_DatetimeStructToDatetime': (222,),
+ 'PyArray_TimedeltaStructToTimedelta': (223,),
# NDIter API
- 'NpyIter_New': 224,
- 'NpyIter_MultiNew': 225,
- 'NpyIter_AdvancedNew': 226,
- 'NpyIter_Copy': 227,
- 'NpyIter_Deallocate': 228,
- 'NpyIter_HasDelayedBufAlloc': 229,
- 'NpyIter_HasExternalLoop': 230,
- 'NpyIter_EnableExternalLoop': 231,
- 'NpyIter_GetInnerStrideArray': 232,
- 'NpyIter_GetInnerLoopSizePtr': 233,
- 'NpyIter_Reset': 234,
- 'NpyIter_ResetBasePointers': 235,
- 'NpyIter_ResetToIterIndexRange': 236,
- 'NpyIter_GetNDim': 237,
- 'NpyIter_GetNOp': 238,
- 'NpyIter_GetIterNext': 239,
- 'NpyIter_GetIterSize': 240,
- 'NpyIter_GetIterIndexRange': 241,
- 'NpyIter_GetIterIndex': 242,
- 'NpyIter_GotoIterIndex': 243,
- 'NpyIter_HasMultiIndex': 244,
- 'NpyIter_GetShape': 245,
- 'NpyIter_GetGetMultiIndex': 246,
- 'NpyIter_GotoMultiIndex': 247,
- 'NpyIter_RemoveMultiIndex': 248,
- 'NpyIter_HasIndex': 249,
- 'NpyIter_IsBuffered': 250,
- 'NpyIter_IsGrowInner': 251,
- 'NpyIter_GetBufferSize': 252,
- 'NpyIter_GetIndexPtr': 253,
- 'NpyIter_GotoIndex': 254,
- 'NpyIter_GetDataPtrArray': 255,
- 'NpyIter_GetDescrArray': 256,
- 'NpyIter_GetOperandArray': 257,
- 'NpyIter_GetIterView': 258,
- 'NpyIter_GetReadFlags': 259,
- 'NpyIter_GetWriteFlags': 260,
- 'NpyIter_DebugPrint': 261,
- 'NpyIter_IterationNeedsAPI': 262,
- 'NpyIter_GetInnerFixedStrideArray': 263,
- 'NpyIter_RemoveAxis': 264,
- 'NpyIter_GetAxisStrideArray': 265,
- 'NpyIter_RequiresBuffering': 266,
- 'NpyIter_GetInitialDataPtrArray': 267,
- 'NpyIter_CreateCompatibleStrides': 268,
+ 'NpyIter_New': (224,),
+ 'NpyIter_MultiNew': (225,),
+ 'NpyIter_AdvancedNew': (226,),
+ 'NpyIter_Copy': (227,),
+ 'NpyIter_Deallocate': (228,),
+ 'NpyIter_HasDelayedBufAlloc': (229,),
+ 'NpyIter_HasExternalLoop': (230,),
+ 'NpyIter_EnableExternalLoop': (231,),
+ 'NpyIter_GetInnerStrideArray': (232,),
+ 'NpyIter_GetInnerLoopSizePtr': (233,),
+ 'NpyIter_Reset': (234,),
+ 'NpyIter_ResetBasePointers': (235,),
+ 'NpyIter_ResetToIterIndexRange': (236,),
+ 'NpyIter_GetNDim': (237,),
+ 'NpyIter_GetNOp': (238,),
+ 'NpyIter_GetIterNext': (239,),
+ 'NpyIter_GetIterSize': (240,),
+ 'NpyIter_GetIterIndexRange': (241,),
+ 'NpyIter_GetIterIndex': (242,),
+ 'NpyIter_GotoIterIndex': (243,),
+ 'NpyIter_HasMultiIndex': (244,),
+ 'NpyIter_GetShape': (245,),
+ 'NpyIter_GetGetMultiIndex': (246,),
+ 'NpyIter_GotoMultiIndex': (247,),
+ 'NpyIter_RemoveMultiIndex': (248,),
+ 'NpyIter_HasIndex': (249,),
+ 'NpyIter_IsBuffered': (250,),
+ 'NpyIter_IsGrowInner': (251,),
+ 'NpyIter_GetBufferSize': (252,),
+ 'NpyIter_GetIndexPtr': (253,),
+ 'NpyIter_GotoIndex': (254,),
+ 'NpyIter_GetDataPtrArray': (255,),
+ 'NpyIter_GetDescrArray': (256,),
+ 'NpyIter_GetOperandArray': (257,),
+ 'NpyIter_GetIterView': (258,),
+ 'NpyIter_GetReadFlags': (259,),
+ 'NpyIter_GetWriteFlags': (260,),
+ 'NpyIter_DebugPrint': (261,),
+ 'NpyIter_IterationNeedsAPI': (262,),
+ 'NpyIter_GetInnerFixedStrideArray': (263,),
+ 'NpyIter_RemoveAxis': (264,),
+ 'NpyIter_GetAxisStrideArray': (265,),
+ 'NpyIter_RequiresBuffering': (266,),
+ 'NpyIter_GetInitialDataPtrArray': (267,),
+ 'NpyIter_CreateCompatibleStrides': (268,),
#
- 'PyArray_CastingConverter': 269,
- 'PyArray_CountNonzero': 270,
- 'PyArray_PromoteTypes': 271,
- 'PyArray_MinScalarType': 272,
- 'PyArray_ResultType': 273,
- 'PyArray_CanCastArrayTo': 274,
- 'PyArray_CanCastTypeTo': 275,
- 'PyArray_EinsteinSum': 276,
- 'PyArray_NewLikeArray': 277,
- 'PyArray_GetArrayParamsFromObject': 278,
- 'PyArray_ConvertClipmodeSequence': 279,
- 'PyArray_MatrixProduct2': 280,
+ 'PyArray_CastingConverter': (269,),
+ 'PyArray_CountNonzero': (270,),
+ 'PyArray_PromoteTypes': (271,),
+ 'PyArray_MinScalarType': (272,),
+ 'PyArray_ResultType': (273,),
+ 'PyArray_CanCastArrayTo': (274,),
+ 'PyArray_CanCastTypeTo': (275,),
+ 'PyArray_EinsteinSum': (276,),
+ 'PyArray_NewLikeArray': (277, StealRef(3), NonNull(1)),
+ 'PyArray_GetArrayParamsFromObject': (278,),
+ 'PyArray_ConvertClipmodeSequence': (279,),
+ 'PyArray_MatrixProduct2': (280,),
# End 1.6 API
- 'NpyIter_IsFirstVisit': 281,
- 'PyArray_SetBaseObject': 282,
- 'PyArray_CreateSortedStridePerm': 283,
- 'PyArray_RemoveAxesInPlace': 284,
- 'PyArray_DebugPrint': 285,
- 'PyArray_FailUnlessWriteable': 286,
- 'PyArray_SetUpdateIfCopyBase': 287,
- 'PyDataMem_NEW': 288,
- 'PyDataMem_FREE': 289,
- 'PyDataMem_RENEW': 290,
- 'PyDataMem_SetEventHook': 291,
- 'PyArray_MapIterSwapAxes': 293,
- 'PyArray_MapIterArray': 294,
- 'PyArray_MapIterNext': 295,
+ 'NpyIter_IsFirstVisit': (281,),
+ 'PyArray_SetBaseObject': (282, StealRef(2)),
+ 'PyArray_CreateSortedStridePerm': (283,),
+ 'PyArray_RemoveAxesInPlace': (284,),
+ 'PyArray_DebugPrint': (285,),
+ 'PyArray_FailUnlessWriteable': (286,),
+ 'PyArray_SetUpdateIfCopyBase': (287, StealRef(2)),
+ 'PyDataMem_NEW': (288,),
+ 'PyDataMem_FREE': (289,),
+ 'PyDataMem_RENEW': (290,),
+ 'PyDataMem_SetEventHook': (291,),
+ 'PyArray_MapIterSwapAxes': (293,),
+ 'PyArray_MapIterArray': (294,),
+ 'PyArray_MapIterNext': (295,),
# End 1.7 API
- 'PyArray_Partition': 296,
- 'PyArray_ArgPartition': 297,
- 'PyArray_SelectkindConverter': 298,
- 'PyDataMem_NEW_ZEROED': 299,
+ 'PyArray_Partition': (296,),
+ 'PyArray_ArgPartition': (297,),
+ 'PyArray_SelectkindConverter': (298,),
+ 'PyDataMem_NEW_ZEROED': (299,),
# End 1.8 API
}
ufunc_types_api = {
- 'PyUFunc_Type': 0
+ 'PyUFunc_Type': (0,)
}
ufunc_funcs_api = {
- 'PyUFunc_FromFuncAndData': 1,
- 'PyUFunc_RegisterLoopForType': 2,
- 'PyUFunc_GenericFunction': 3,
- 'PyUFunc_f_f_As_d_d': 4,
- 'PyUFunc_d_d': 5,
- 'PyUFunc_f_f': 6,
- 'PyUFunc_g_g': 7,
- 'PyUFunc_F_F_As_D_D': 8,
- 'PyUFunc_F_F': 9,
- 'PyUFunc_D_D': 10,
- 'PyUFunc_G_G': 11,
- 'PyUFunc_O_O': 12,
- 'PyUFunc_ff_f_As_dd_d': 13,
- 'PyUFunc_ff_f': 14,
- 'PyUFunc_dd_d': 15,
- 'PyUFunc_gg_g': 16,
- 'PyUFunc_FF_F_As_DD_D': 17,
- 'PyUFunc_DD_D': 18,
- 'PyUFunc_FF_F': 19,
- 'PyUFunc_GG_G': 20,
- 'PyUFunc_OO_O': 21,
- 'PyUFunc_O_O_method': 22,
- 'PyUFunc_OO_O_method': 23,
- 'PyUFunc_On_Om': 24,
- 'PyUFunc_GetPyValues': 25,
- 'PyUFunc_checkfperr': 26,
- 'PyUFunc_clearfperr': 27,
- 'PyUFunc_getfperr': 28,
- 'PyUFunc_handlefperr': 29,
- 'PyUFunc_ReplaceLoopBySignature': 30,
- 'PyUFunc_FromFuncAndDataAndSignature': 31,
- 'PyUFunc_SetUsesArraysAsData': 32,
+ 'PyUFunc_FromFuncAndData': (1,),
+ 'PyUFunc_RegisterLoopForType': (2,),
+ 'PyUFunc_GenericFunction': (3,),
+ 'PyUFunc_f_f_As_d_d': (4,),
+ 'PyUFunc_d_d': (5,),
+ 'PyUFunc_f_f': (6,),
+ 'PyUFunc_g_g': (7,),
+ 'PyUFunc_F_F_As_D_D': (8,),
+ 'PyUFunc_F_F': (9,),
+ 'PyUFunc_D_D': (10,),
+ 'PyUFunc_G_G': (11,),
+ 'PyUFunc_O_O': (12,),
+ 'PyUFunc_ff_f_As_dd_d': (13,),
+ 'PyUFunc_ff_f': (14,),
+ 'PyUFunc_dd_d': (15,),
+ 'PyUFunc_gg_g': (16,),
+ 'PyUFunc_FF_F_As_DD_D': (17,),
+ 'PyUFunc_DD_D': (18,),
+ 'PyUFunc_FF_F': (19,),
+ 'PyUFunc_GG_G': (20,),
+ 'PyUFunc_OO_O': (21,),
+ 'PyUFunc_O_O_method': (22,),
+ 'PyUFunc_OO_O_method': (23,),
+ 'PyUFunc_On_Om': (24,),
+ 'PyUFunc_GetPyValues': (25,),
+ 'PyUFunc_checkfperr': (26,),
+ 'PyUFunc_clearfperr': (27,),
+ 'PyUFunc_getfperr': (28,),
+ 'PyUFunc_handlefperr': (29,),
+ 'PyUFunc_ReplaceLoopBySignature': (30,),
+ 'PyUFunc_FromFuncAndDataAndSignature': (31,),
+ 'PyUFunc_SetUsesArraysAsData': (32,),
# End 1.5 API
- 'PyUFunc_e_e': 33,
- 'PyUFunc_e_e_As_f_f': 34,
- 'PyUFunc_e_e_As_d_d': 35,
- 'PyUFunc_ee_e': 36,
- 'PyUFunc_ee_e_As_ff_f': 37,
- 'PyUFunc_ee_e_As_dd_d': 38,
+ 'PyUFunc_e_e': (33,),
+ 'PyUFunc_e_e_As_f_f': (34,),
+ 'PyUFunc_e_e_As_d_d': (35,),
+ 'PyUFunc_ee_e': (36,),
+ 'PyUFunc_ee_e_As_ff_f': (37,),
+ 'PyUFunc_ee_e_As_dd_d': (38,),
# End 1.6 API
- 'PyUFunc_DefaultTypeResolver': 39,
- 'PyUFunc_ValidateCasting': 40,
+ 'PyUFunc_DefaultTypeResolver': (39,),
+ 'PyUFunc_ValidateCasting': (40,),
# End 1.7 API
- 'PyUFunc_RegisterLoopForDescr': 41,
+ 'PyUFunc_RegisterLoopForDescr': (41,),
# End 1.8 API
}
@@ -399,7 +399,6 @@ ufunc_funcs_api = {
# XXX: DO NOT CHANGE THE ORDER OF TUPLES BELOW !
multiarray_api = (
multiarray_global_vars,
- multiarray_global_vars_types,
multiarray_scalar_bool_values,
multiarray_types_api,
multiarray_funcs_api,
diff --git a/numpy/core/code_generators/ufunc_docstrings.py b/numpy/core/code_generators/ufunc_docstrings.py
index 59e877750..4d302969e 100644
--- a/numpy/core/code_generators/ufunc_docstrings.py
+++ b/numpy/core/code_generators/ufunc_docstrings.py
@@ -162,7 +162,7 @@ add_newdoc('numpy.core.umath', 'arccos',
add_newdoc('numpy.core.umath', 'arccosh',
"""
- Inverse hyperbolic cosine, elementwise.
+ Inverse hyperbolic cosine, element-wise.
Parameters
----------
@@ -272,7 +272,7 @@ add_newdoc('numpy.core.umath', 'arcsin',
add_newdoc('numpy.core.umath', 'arcsinh',
"""
- Inverse hyperbolic sine elementwise.
+ Inverse hyperbolic sine element-wise.
Parameters
----------
@@ -467,7 +467,7 @@ add_newdoc('numpy.core.umath', '_arg',
add_newdoc('numpy.core.umath', 'arctanh',
"""
- Inverse hyperbolic tangent elementwise.
+ Inverse hyperbolic tangent element-wise.
Parameters
----------
@@ -486,15 +486,15 @@ add_newdoc('numpy.core.umath', 'arctanh',
Notes
-----
`arctanh` is a multivalued function: for each `x` there are infinitely
- many numbers `z` such that `tanh(z) = x`. The convention is to return the
- `z` whose imaginary part lies in `[-pi/2, pi/2]`.
+ many numbers `z` such that `tanh(z) = x`. The convention is to return
+ the `z` whose imaginary part lies in `[-pi/2, pi/2]`.
For real-valued input data types, `arctanh` always returns real output.
- For each value that cannot be expressed as a real number or infinity, it
- yields ``nan`` and sets the `invalid` floating point error flag.
+ For each value that cannot be expressed as a real number or infinity,
+ it yields ``nan`` and sets the `invalid` floating point error flag.
- For complex-valued input, `arctanh` is a complex analytical function that
- has branch cuts `[-1, -inf]` and `[1, inf]` and is continuous from
+ For complex-valued input, `arctanh` is a complex analytical function
+ that has branch cuts `[-1, -inf]` and `[1, inf]` and is continuous from
above on the former and from below on the latter.
The inverse hyperbolic tangent is also known as `atanh` or ``tanh^-1``.
@@ -524,7 +524,7 @@ add_newdoc('numpy.core.umath', 'bitwise_and',
Parameters
----------
x1, x2 : array_like
- Only integer types are handled (including booleans).
+ Only integer and boolean types are handled.
Returns
-------
@@ -575,7 +575,7 @@ add_newdoc('numpy.core.umath', 'bitwise_or',
Parameters
----------
x1, x2 : array_like
- Only integer types are handled (including booleans).
+ Only integer and boolean types are handled.
out : ndarray, optional
Array into which the output is placed. Its type is preserved and it
must be of the right shape to hold the output. See doc.ufuncs.
@@ -634,7 +634,7 @@ add_newdoc('numpy.core.umath', 'bitwise_xor',
Parameters
----------
x1, x2 : array_like
- Only integer types are handled (including booleans).
+ Only integer and boolean types are handled.
Returns
-------
@@ -766,7 +766,7 @@ add_newdoc('numpy.core.umath', 'conjugate',
add_newdoc('numpy.core.umath', 'cos',
"""
- Cosine elementwise.
+ Cosine element-wise.
Parameters
----------
@@ -937,8 +937,8 @@ add_newdoc('numpy.core.umath', 'divide',
See Also
--------
- seterr : Set whether to raise or warn on overflow, underflow and division
- by zero.
+ seterr : Set whether to raise or warn on overflow, underflow and
+ division by zero.
Notes
-----
@@ -1048,8 +1048,8 @@ add_newdoc('numpy.core.umath', 'exp',
For complex arguments, ``x = a + ib``, we can write
:math:`e^x = e^a e^{ib}`. The first term, :math:`e^a`, is already
known (it is the real argument, described above). The second term,
- :math:`e^{ib}`, is :math:`\\cos b + i \\sin b`, a function with magnitude
- 1 and a periodic phase.
+ :math:`e^{ib}`, is :math:`\\cos b + i \\sin b`, a function with
+ magnitude 1 and a periodic phase.
References
----------
@@ -1137,7 +1137,7 @@ add_newdoc('numpy.core.umath', 'expm1',
Notes
-----
- This function provides greater precision than the formula ``exp(x) - 1``
+ This function provides greater precision than ``exp(x) - 1``
for small values of ``x``.
Examples
@@ -1155,10 +1155,10 @@ add_newdoc('numpy.core.umath', 'expm1',
add_newdoc('numpy.core.umath', 'fabs',
"""
- Compute the absolute values elementwise.
+ Compute the absolute values element-wise.
- This function returns the absolute values (positive magnitude) of the data
- in `x`. Complex values are not handled, use `absolute` to find the
+ This function returns the absolute values (positive magnitude) of the
+ data in `x`. Complex values are not handled, use `absolute` to find the
absolute values of complex data.
Parameters
@@ -1212,8 +1212,8 @@ add_newdoc('numpy.core.umath', 'floor',
Notes
-----
Some spreadsheet programs calculate the "floor-towards-zero", in other
- words ``floor(-2.5) == -2``. NumPy, however, uses the a definition of
- `floor` such that `floor(-2.5) == -3`.
+ words ``floor(-2.5) == -2``. NumPy instead uses the definition of
+ `floor` where `floor(-2.5) == -3`.
Examples
--------
@@ -1225,7 +1225,8 @@ add_newdoc('numpy.core.umath', 'floor',
add_newdoc('numpy.core.umath', 'floor_divide',
"""
- Return the largest integer smaller or equal to the division of the inputs.
+ Return the largest integer smaller or equal to the division of the
+ inputs.
Parameters
----------
@@ -1259,7 +1260,10 @@ add_newdoc('numpy.core.umath', 'fmod',
"""
Return the element-wise remainder of division.
- This is the NumPy implementation of the Python modulo operator `%`.
+ This is the NumPy implementation of the C library function fmod, the
+ remainder has the same sign as the dividend `x1`. It is equivalent to
+ the Matlab(TM) ``rem`` function and should not be confused with the
+ Python modulus operator ``x1 % x2``.
Parameters
----------
@@ -1275,15 +1279,16 @@ add_newdoc('numpy.core.umath', 'fmod',
See Also
--------
- remainder : Modulo operation where the quotient is `floor(x1/x2)`.
+ remainder : Equivalent to the Python ``%`` operator.
divide
Notes
-----
- The result of the modulo operation for negative dividend and divisors is
- bound by conventions. In `fmod`, the sign of the remainder is the sign of
- the dividend. In `remainder`, the sign of the divisor does not affect the
- sign of the result.
+ The result of the modulo operation for negative dividend and divisors
+ is bound by conventions. For `fmod`, the sign of result is the sign of
+ the dividend, while for `remainder` the sign of the result is the sign
+ of the divisor. The `fmod` function is equivalent to the Matlab(TM)
+ ``rem`` function.
Examples
--------
@@ -1414,17 +1419,17 @@ add_newdoc('numpy.core.umath', 'invert',
the integers in the input arrays. This ufunc implements the C/Python
operator ``~``.
- For signed integer inputs, the two's complement is returned.
- In a two's-complement system negative numbers are represented by the two's
+ For signed integer inputs, the two's complement is returned. In a
+ two's-complement system negative numbers are represented by the two's
complement of the absolute value. This is the most common method of
- representing signed integers on computers [1]_. A N-bit two's-complement
- system can represent every integer in the range
+ representing signed integers on computers [1]_. A N-bit
+ two's-complement system can represent every integer in the range
:math:`-2^{N-1}` to :math:`+2^{N-1}-1`.
Parameters
----------
x1 : array_like
- Only integer types are handled (including booleans).
+ Only integer and boolean types are handled.
Returns
-------
@@ -1488,7 +1493,7 @@ add_newdoc('numpy.core.umath', 'invert',
add_newdoc('numpy.core.umath', 'isfinite',
"""
- Test element-wise for finite-ness (not infinity or not Not a Number).
+ Test element-wise for finiteness (not infinity or not Not a Number).
The result is returned as a boolean array.
@@ -1508,9 +1513,10 @@ add_newdoc('numpy.core.umath', 'isfinite',
either positive infinity, negative infinity or Not a Number).
For array input, the result is a boolean array with the same
- dimensions as the input and the values are True if the corresponding
- element of the input is finite; otherwise the values are False (element
- is either positive infinity, negative infinity or Not a Number).
+ dimensions as the input and the values are True if the
+ corresponding element of the input is finite; otherwise the values
+ are False (element is either positive infinity, negative infinity
+ or Not a Number).
See Also
--------
@@ -1524,9 +1530,9 @@ add_newdoc('numpy.core.umath', 'isfinite',
Numpy uses the IEEE Standard for Binary Floating-Point for Arithmetic
(IEEE 754). This means that Not a Number is not equivalent to infinity.
Also that positive infinity is not equivalent to negative infinity. But
- infinity is equivalent to positive infinity.
- Errors result if the second argument is also supplied when `x` is a scalar
- input, or if first and second arguments have different shapes.
+ infinity is equivalent to positive infinity. Errors result if the
+ second argument is also supplied when `x` is a scalar input, or if
+ first and second arguments have different shapes.
Examples
--------
@@ -1556,8 +1562,8 @@ add_newdoc('numpy.core.umath', 'isinf',
"""
Test element-wise for positive or negative infinity.
- Return a bool-type array, the same shape as `x`, True where ``x ==
- +/-inf``, False everywhere else.
+ Returns a boolean array of the same shape as `x`, True where ``x ==
+ +/-inf``, otherwise False.
Parameters
----------
@@ -1568,19 +1574,19 @@ add_newdoc('numpy.core.umath', 'isinf',
Returns
-------
- y : bool (scalar) or bool-type ndarray
- For scalar input, the result is a new boolean with value True
- if the input is positive or negative infinity; otherwise the value
- is False.
+ y : bool (scalar) or boolean ndarray
+ For scalar input, the result is a new boolean with value True if
+ the input is positive or negative infinity; otherwise the value is
+ False.
- For array input, the result is a boolean array with the same
- shape as the input and the values are True where the
- corresponding element of the input is positive or negative
- infinity; elsewhere the values are False. If a second argument
- was supplied the result is stored there. If the type of that array
- is a numeric type the result is represented as zeros and ones, if
- the type is boolean then as False and True, respectively.
- The return value `y` is then a reference to that array.
+ For array input, the result is a boolean array with the same shape
+ as the input and the values are True where the corresponding
+ element of the input is positive or negative infinity; elsewhere
+ the values are False. If a second argument was supplied the result
+ is stored there. If the type of that array is a numeric type the
+ result is represented as zeros and ones, if the type is boolean
+ then as False and True, respectively. The return value `y` is then
+ a reference to that array.
See Also
--------
@@ -1617,7 +1623,7 @@ add_newdoc('numpy.core.umath', 'isinf',
add_newdoc('numpy.core.umath', 'isnan',
"""
- Test element-wise for Not a Number (NaN), return result as a bool array.
+ Test element-wise for NaN and return result as a boolean array.
Parameters
----------
@@ -1627,12 +1633,13 @@ add_newdoc('numpy.core.umath', 'isnan',
Returns
-------
y : {ndarray, bool}
- For scalar input, the result is a new boolean with value True
- if the input is NaN; otherwise the value is False.
+ For scalar input, the result is a new boolean with value True if
+ the input is NaN; otherwise the value is False.
- For array input, the result is a boolean array with the same
- dimensions as the input and the values are True if the corresponding
- element of the input is NaN; otherwise the values are False.
+ For array input, the result is a boolean array of the same
+ dimensions as the input and the values are True if the
+ corresponding element of the input is NaN; otherwise the values are
+ False.
See Also
--------
@@ -1753,7 +1760,8 @@ add_newdoc('numpy.core.umath', 'log',
Natural logarithm, element-wise.
The natural logarithm `log` is the inverse of the exponential function,
- so that `log(exp(x)) = x`. The natural logarithm is logarithm in base `e`.
+ so that `log(exp(x)) = x`. The natural logarithm is logarithm in base
+ `e`.
Parameters
----------
@@ -1772,8 +1780,8 @@ add_newdoc('numpy.core.umath', 'log',
Notes
-----
Logarithm is a multivalued function: for each `x` there is an infinite
- number of `z` such that `exp(z) = x`. The convention is to return the `z`
- whose imaginary part lies in `[-pi, pi]`.
+ number of `z` such that `exp(z) = x`. The convention is to return the
+ `z` whose imaginary part lies in `[-pi, pi]`.
For real-valued input data types, `log` always returns real output. For
each value that cannot be expressed as a real number or infinity, it
@@ -1819,17 +1827,17 @@ add_newdoc('numpy.core.umath', 'log10',
Notes
-----
Logarithm is a multivalued function: for each `x` there is an infinite
- number of `z` such that `10**z = x`. The convention is to return the `z`
- whose imaginary part lies in `[-pi, pi]`.
+ number of `z` such that `10**z = x`. The convention is to return the
+ `z` whose imaginary part lies in `[-pi, pi]`.
- For real-valued input data types, `log10` always returns real output. For
- each value that cannot be expressed as a real number or infinity, it
- yields ``nan`` and sets the `invalid` floating point error flag.
+ For real-valued input data types, `log10` always returns real output.
+ For each value that cannot be expressed as a real number or infinity,
+ it yields ``nan`` and sets the `invalid` floating point error flag.
For complex-valued input, `log10` is a complex analytical function that
- has a branch cut `[-inf, 0]` and is continuous from above on it. `log10`
- handles the floating-point negative zero as an infinitesimal negative
- number, conforming to the C99 standard.
+ has a branch cut `[-inf, 0]` and is continuous from above on it.
+ `log10` handles the floating-point negative zero as an infinitesimal
+ negative number, conforming to the C99 standard.
References
----------
@@ -1870,9 +1878,9 @@ add_newdoc('numpy.core.umath', 'log2',
number of `z` such that `2**z = x`. The convention is to return the `z`
whose imaginary part lies in `[-pi, pi]`.
- For real-valued input data types, `log2` always returns real output. For
- each value that cannot be expressed as a real number or infinity, it
- yields ``nan`` and sets the `invalid` floating point error flag.
+ For real-valued input data types, `log2` always returns real output.
+ For each value that cannot be expressed as a real number or infinity,
+ it yields ``nan`` and sets the `invalid` floating point error flag.
For complex-valued input, `log2` is a complex analytical function that
has a branch cut `[-inf, 0]` and is continuous from above on it. `log2`
@@ -1913,7 +1921,7 @@ add_newdoc('numpy.core.umath', 'logaddexp',
See Also
--------
- logaddexp2: Logarithm of the sum of exponentiations of inputs in base-2.
+ logaddexp2: Logarithm of the sum of exponentiations of inputs in base 2.
Notes
-----
@@ -1936,8 +1944,8 @@ add_newdoc('numpy.core.umath', 'logaddexp2',
Logarithm of the sum of exponentiations of the inputs in base-2.
Calculates ``log2(2**x1 + 2**x2)``. This function is useful in machine
- learning when the calculated probabilities of events may be so small
- as to exceed the range of normal floating point numbers. In such cases
+ learning when the calculated probabilities of events may be so small as
+ to exceed the range of normal floating point numbers. In such cases
the base-2 logarithm of the calculated probability can be used instead.
This function allows adding probabilities stored in such a fashion.
@@ -2002,14 +2010,14 @@ add_newdoc('numpy.core.umath', 'log1p',
number of `z` such that `exp(z) = 1 + x`. The convention is to return
the `z` whose imaginary part lies in `[-pi, pi]`.
- For real-valued input data types, `log1p` always returns real output. For
- each value that cannot be expressed as a real number or infinity, it
- yields ``nan`` and sets the `invalid` floating point error flag.
+ For real-valued input data types, `log1p` always returns real output.
+ For each value that cannot be expressed as a real number or infinity,
+ it yields ``nan`` and sets the `invalid` floating point error flag.
For complex-valued input, `log1p` is a complex analytical function that
- has a branch cut `[-inf, -1]` and is continuous from above on it. `log1p`
- handles the floating-point negative zero as an infinitesimal negative
- number, conforming to the C99 standard.
+ has a branch cut `[-inf, -1]` and is continuous from above on it.
+ `log1p` handles the floating-point negative zero as an infinitesimal
+ negative number, conforming to the C99 standard.
References
----------
@@ -2028,7 +2036,7 @@ add_newdoc('numpy.core.umath', 'log1p',
add_newdoc('numpy.core.umath', 'logical_and',
"""
- Compute the truth value of x1 AND x2 elementwise.
+ Compute the truth value of x1 AND x2 element-wise.
Parameters
----------
@@ -2062,7 +2070,7 @@ add_newdoc('numpy.core.umath', 'logical_and',
add_newdoc('numpy.core.umath', 'logical_not',
"""
- Compute the truth value of NOT x elementwise.
+ Compute the truth value of NOT x element-wise.
Parameters
----------
@@ -2094,7 +2102,7 @@ add_newdoc('numpy.core.umath', 'logical_not',
add_newdoc('numpy.core.umath', 'logical_or',
"""
- Compute the truth value of x1 OR x2 elementwise.
+ Compute the truth value of x1 OR x2 element-wise.
Parameters
----------
@@ -2171,11 +2179,11 @@ add_newdoc('numpy.core.umath', 'maximum',
Element-wise maximum of array elements.
Compare two arrays and returns a new array containing the element-wise
- maxima. If one of the elements being compared is a nan, then that element
- is returned. If both elements are nans then the first is returned. The
- latter distinction is important for complex nans, which are defined as at
- least one of the real or imaginary parts being a nan. The net effect is
- that nans are propagated.
+ maxima. If one of the elements being compared is a NaN, then that
+ element is returned. If both elements are NaNs then the first is
+ returned. The latter distinction is important for complex NaNs, which
+ are defined as at least one of the real or imaginary parts being a NaN.
+ The net effect is that NaNs are propagated.
Parameters
----------
@@ -2192,20 +2200,21 @@ add_newdoc('numpy.core.umath', 'maximum',
See Also
--------
minimum :
- Element-wise minimum of two arrays, propagating any NaNs.
+ Element-wise minimum of two arrays, propagates NaNs.
fmax :
- Element-wise maximum of two arrays, ignoring any NaNs.
+ Element-wise maximum of two arrays, ignores NaNs.
amax :
- The maximum value of an array along a given axis, propagating any NaNs.
+ The maximum value of an array along a given axis, propagates NaNs.
nanmax :
- The maximum value of an array along a given axis, ignoring any NaNs.
+ The maximum value of an array along a given axis, ignores NaNs.
fmin, amin, nanmin
Notes
-----
- The maximum is equivalent to ``np.where(x1 >= x2, x1, x2)`` when neither
- x1 nor x2 are nans, but it is faster and does proper broadcasting.
+ The maximum is equivalent to ``np.where(x1 >= x2, x1, x2)`` when
+ neither x1 nor x2 are nans, but it is faster and does proper
+ broadcasting.
Examples
--------
@@ -2228,11 +2237,11 @@ add_newdoc('numpy.core.umath', 'minimum',
Element-wise minimum of array elements.
Compare two arrays and returns a new array containing the element-wise
- minima. If one of the elements being compared is a nan, then that element
- is returned. If both elements are nans then the first is returned. The
- latter distinction is important for complex nans, which are defined as at
- least one of the real or imaginary parts being a nan. The net effect is
- that nans are propagated.
+ minima. If one of the elements being compared is a NaN, then that
+ element is returned. If both elements are NaNs then the first is
+ returned. The latter distinction is important for complex NaNs, which
+ are defined as at least one of the real or imaginary parts being a NaN.
+ The net effect is that NaNs are propagated.
Parameters
----------
@@ -2249,20 +2258,21 @@ add_newdoc('numpy.core.umath', 'minimum',
See Also
--------
maximum :
- Element-wise maximum of two arrays, propagating any NaNs.
+ Element-wise maximum of two arrays, propagates NaNs.
fmin :
- Element-wise minimum of two arrays, ignoring any NaNs.
+ Element-wise minimum of two arrays, ignores NaNs.
amin :
- The minimum value of an array along a given axis, propagating any NaNs.
+ The minimum value of an array along a given axis, propagates NaNs.
nanmin :
- The minimum value of an array along a given axis, ignoring any NaNs.
+ The minimum value of an array along a given axis, ignores NaNs.
fmax, amax, nanmax
Notes
-----
- The minimum is equivalent to ``np.where(x1 <= x2, x1, x2)`` when neither
- x1 nor x2 are nans, but it is faster and does proper broadcasting.
+ The minimum is equivalent to ``np.where(x1 <= x2, x1, x2)`` when
+ neither x1 nor x2 are NaNs, but it is faster and does proper
+ broadcasting.
Examples
--------
@@ -2285,11 +2295,11 @@ add_newdoc('numpy.core.umath', 'fmax',
Element-wise maximum of array elements.
Compare two arrays and returns a new array containing the element-wise
- maxima. If one of the elements being compared is a nan, then the non-nan
- element is returned. If both elements are nans then the first is returned.
- The latter distinction is important for complex nans, which are defined as
- at least one of the real or imaginary parts being a nan. The net effect is
- that nans are ignored when possible.
+ maxima. If one of the elements being compared is a NaN, then the
+ non-nan element is returned. If both elements are NaNs then the first
+ is returned. The latter distinction is important for complex NaNs,
+ which are defined as at least one of the real or imaginary parts being
+ a NaN. The net effect is that NaNs are ignored when possible.
Parameters
----------
@@ -2306,13 +2316,13 @@ add_newdoc('numpy.core.umath', 'fmax',
See Also
--------
fmin :
- Element-wise minimum of two arrays, ignoring any NaNs.
+ Element-wise minimum of two arrays, ignores NaNs.
maximum :
- Element-wise maximum of two arrays, propagating any NaNs.
+ Element-wise maximum of two arrays, propagates NaNs.
amax :
- The maximum value of an array along a given axis, propagating any NaNs.
+ The maximum value of an array along a given axis, propagates NaNs.
nanmax :
- The maximum value of an array along a given axis, ignoring any NaNs.
+ The maximum value of an array along a given axis, ignores NaNs.
minimum, amin, nanmin
@@ -2321,7 +2331,7 @@ add_newdoc('numpy.core.umath', 'fmax',
.. versionadded:: 1.3.0
The fmax is equivalent to ``np.where(x1 >= x2, x1, x2)`` when neither
- x1 nor x2 are nans, but it is faster and does proper broadcasting.
+ x1 nor x2 are NaNs, but it is faster and does proper broadcasting.
Examples
--------
@@ -2342,11 +2352,11 @@ add_newdoc('numpy.core.umath', 'fmin',
Element-wise minimum of array elements.
Compare two arrays and returns a new array containing the element-wise
- minima. If one of the elements being compared is a nan, then the non-nan
- element is returned. If both elements are nans then the first is returned.
- The latter distinction is important for complex nans, which are defined as
- at least one of the real or imaginary parts being a nan. The net effect is
- that nans are ignored when possible.
+ minima. If one of the elements being compared is a NaN, then the
+ non-nan element is returned. If both elements are NaNs then the first
+ is returned. The latter distinction is important for complex NaNs,
+ which are defined as at least one of the real or imaginary parts being
+ a NaN. The net effect is that NaNs are ignored when possible.
Parameters
----------
@@ -2363,13 +2373,13 @@ add_newdoc('numpy.core.umath', 'fmin',
See Also
--------
fmax :
- Element-wise maximum of two arrays, ignoring any NaNs.
+ Element-wise maximum of two arrays, ignores NaNs.
minimum :
- Element-wise minimum of two arrays, propagating any NaNs.
+ Element-wise minimum of two arrays, propagates NaNs.
amin :
- The minimum value of an array along a given axis, propagating any NaNs.
+ The minimum value of an array along a given axis, propagates NaNs.
nanmin :
- The minimum value of an array along a given axis, ignoring any NaNs.
+ The minimum value of an array along a given axis, ignores NaNs.
maximum, amax, nanmax
@@ -2378,7 +2388,7 @@ add_newdoc('numpy.core.umath', 'fmin',
.. versionadded:: 1.3.0
The fmin is equivalent to ``np.where(x1 <= x2, x1, x2)`` when neither
- x1 nor x2 are nans, but it is faster and does proper broadcasting.
+ x1 nor x2 are NaNs, but it is faster and does proper broadcasting.
Examples
--------
@@ -2461,7 +2471,7 @@ add_newdoc('numpy.core.umath', 'multiply',
add_newdoc('numpy.core.umath', 'negative',
"""
- Returns an array with the negative of each element of the original array.
+ Numerical negative, element-wise.
Parameters
----------
@@ -2515,10 +2525,9 @@ add_newdoc('numpy.core.umath', 'not_equal',
add_newdoc('numpy.core.umath', '_ones_like',
"""
- This function used to be the numpy.ones_like, but now a
- specific function for that has been written for consistency with
- the other *_like functions. It is only used internally in a limited
- fashion now.
+ This function used to be the numpy.ones_like, but now a specific
+ function for that has been written for consistency with the other
+ *_like functions. It is only used internally in a limited fashion now.
See Also
--------
@@ -2664,8 +2673,8 @@ add_newdoc('numpy.core.umath', 'reciprocal',
This function is not designed to work with integers.
For integer arguments with absolute value larger than 1 the result is
- always zero because of the way Python handles integer division.
- For integer zero the result is an overflow.
+ always zero because of the way Python handles integer division. For
+ integer zero the result is an overflow.
Examples
--------
@@ -2680,7 +2689,10 @@ add_newdoc('numpy.core.umath', 'remainder',
"""
Return element-wise remainder of division.
- Computes ``x1 - floor(x1 / x2) * x2``.
+ Computes ``x1 - floor(x1 / x2) * x2``, the result has the same sign as
+ the divisor `x2`. It is equivalent to the Python modulus operator
+ ``x1 % x2`` and should not be confused with the Matlab(TM) ``rem``
+ function.
Parameters
----------
@@ -2695,16 +2707,18 @@ add_newdoc('numpy.core.umath', 'remainder',
Returns
-------
y : ndarray
- The remainder of the quotient ``x1/x2``, element-wise. Returns a scalar
- if both `x1` and `x2` are scalars.
+ The remainder of the quotient ``x1/x2``, element-wise. Returns a
+ scalar if both `x1` and `x2` are scalars.
See Also
--------
+ fmod : Equivalent of the Matlab(TM) ``rem`` function.
divide, floor
Notes
-----
- Returns 0 when `x2` is 0 and both `x1` and `x2` are (arrays of) integers.
+ Returns 0 when `x2` is 0 and both `x1` and `x2` are (arrays of)
+ integers.
Examples
--------
@@ -2719,9 +2733,9 @@ add_newdoc('numpy.core.umath', 'right_shift',
"""
Shift the bits of an integer to the right.
- Bits are shifted to the right by removing `x2` bits at the right of `x1`.
- Since the internal representation of numbers is in binary format, this
- operation is equivalent to dividing `x1` by ``2**x2``.
+ Bits are shifted to the right `x2`. Because the internal
+ representation of numbers is in binary format, this operation is
+ equivalent to dividing `x1` by ``2**x2``.
Parameters
----------
@@ -2815,9 +2829,8 @@ add_newdoc('numpy.core.umath', 'signbit',
x : array_like
The input value(s).
out : ndarray, optional
- Array into which the output is placed. Its type is preserved
- and it must be of the right shape to hold the output.
- See `doc.ufuncs`.
+ Array into which the output is placed. Its type is preserved and it
+ must be of the right shape to hold the output. See `doc.ufuncs`.
Returns
-------
@@ -2874,8 +2887,7 @@ add_newdoc('numpy.core.umath', 'copysign',
add_newdoc('numpy.core.umath', 'nextafter',
"""
- Return the next representable floating-point value after x1 in the direction
- of x2 element-wise.
+ Return the next floating-point value after x1 towards x2, element-wise.
Parameters
----------
@@ -2923,7 +2935,7 @@ add_newdoc('numpy.core.umath', 'spacing',
should not be any representable number between ``x + spacing(x)`` and
x for any finite x.
- Spacing of +- inf and nan is nan.
+ Spacing of +- inf and NaN is NaN.
Examples
--------
@@ -2952,17 +2964,17 @@ add_newdoc('numpy.core.umath', 'sin',
Notes
-----
- The sine is one of the fundamental functions of trigonometry
- (the mathematical study of triangles). Consider a circle of radius
- 1 centered on the origin. A ray comes in from the :math:`+x` axis,
- makes an angle at the origin (measured counter-clockwise from that
- axis), and departs from the origin. The :math:`y` coordinate of
- the outgoing ray's intersection with the unit circle is the sine
- of that angle. It ranges from -1 for :math:`x=3\\pi / 2` to
- +1 for :math:`\\pi / 2.` The function has zeroes where the angle is
- a multiple of :math:`\\pi`. Sines of angles between :math:`\\pi` and
- :math:`2\\pi` are negative. The numerous properties of the sine and
- related functions are included in any standard trigonometry text.
+ The sine is one of the fundamental functions of trigonometry (the
+ mathematical study of triangles). Consider a circle of radius 1
+ centered on the origin. A ray comes in from the :math:`+x` axis, makes
+ an angle at the origin (measured counter-clockwise from that axis), and
+ departs from the origin. The :math:`y` coordinate of the outgoing
+ ray's intersection with the unit circle is the sine of that angle. It
+ ranges from -1 for :math:`x=3\\pi / 2` to +1 for :math:`\\pi / 2.` The
+ function has zeroes where the angle is a multiple of :math:`\\pi`.
+ Sines of angles between :math:`\\pi` and :math:`2\\pi` are negative.
+ The numerous properties of the sine and related functions are included
+ in any standard trigonometry text.
Examples
--------
@@ -3076,8 +3088,8 @@ add_newdoc('numpy.core.umath', 'sqrt',
-----
*sqrt* has--consistent with common convention--as its branch cut the
real "interval" [`-inf`, 0), and is continuous from above on it.
- (A branch cut is a curve in the complex plane across which a given
- complex function fails to be continuous.)
+ A branch cut is a curve in the complex plane across which a given
+ complex function fails to be continuous.
Examples
--------
@@ -3210,8 +3222,7 @@ add_newdoc('numpy.core.umath', 'tanh',
"""
Compute hyperbolic tangent element-wise.
- Equivalent to ``np.sinh(x)/np.cosh(x)`` or
- ``-1j * np.tan(1j*x)``.
+ Equivalent to ``np.sinh(x)/np.cosh(x)`` or ``-1j * np.tan(1j*x)``.
Parameters
----------
@@ -3285,10 +3296,10 @@ add_newdoc('numpy.core.umath', 'true_divide',
Notes
-----
- The floor division operator ``//`` was added in Python 2.2 making ``//``
- and ``/`` equivalent operators. The default floor division operation of
- ``/`` can be replaced by true division with
- ``from __future__ import division``.
+ The floor division operator ``//`` was added in Python 2.2 making
+ ``//`` and ``/`` equivalent operators. The default floor division
+ operation of ``/`` can be replaced by true division with ``from
+ __future__ import division``.
In Python 3.0, ``//`` is the floor division operator and ``/`` the
true division operator. The ``true_divide(x1, x2)`` function is
@@ -3312,3 +3323,97 @@ add_newdoc('numpy.core.umath', 'true_divide',
array([0, 0, 0, 0, 1])
""")
+
+# This doc is not currently used, but has been converted to a C string
+# that can be found in numpy/core/src/umath/umathmodule.c where the
+# frexp ufunc is constructed.
+add_newdoc('numpy.core.umath', 'frexp',
+ """
+ Decompose the elements of x into mantissa and twos exponent.
+
+ Returns (`mantissa`, `exponent`), where `x = mantissa * 2**exponent``.
+ The mantissa is lies in the open interval(-1, 1), while the twos
+ exponent is a signed integer.
+
+ Parameters
+ ----------
+ x : array_like
+ Array of numbers to be decomposed.
+ out1: ndarray, optional
+ Output array for the mantissa. Must have the same shape as `x`.
+ out2: ndarray, optional
+ Output array for the exponent. Must have the same shape as `x`.
+
+ Returns
+ -------
+ (mantissa, exponent) : tuple of ndarrays, (float, int)
+ `mantissa` is a float array with values between -1 and 1.
+ `exponent` is an int array which represents the exponent of 2.
+
+ See Also
+ --------
+ ldexp : Compute ``y = x1 * 2**x2``, the inverse of `frexp`.
+
+ Notes
+ -----
+ Complex dtypes are not supported, they will raise a TypeError.
+
+ Examples
+ --------
+ >>> x = np.arange(9)
+ >>> y1, y2 = np.frexp(x)
+ >>> y1
+ array([ 0. , 0.5 , 0.5 , 0.75 , 0.5 , 0.625, 0.75 , 0.875,
+ 0.5 ])
+ >>> y2
+ array([0, 1, 2, 2, 3, 3, 3, 3, 4])
+ >>> y1 * 2**y2
+ array([ 0., 1., 2., 3., 4., 5., 6., 7., 8.])
+
+ """)
+
+# This doc is not currently used, but has been converted to a C string
+# that can be found in numpy/core/src/umath/umathmodule.c where the
+# ldexp ufunc is constructed.
+add_newdoc('numpy.core.umath', 'ldexp',
+ """
+ Returns x1 * 2**x2, element-wise.
+
+ The mantissas `x1` and twos exponents `x2` are used to construct
+ floating point numbers ``x1 * 2**x2``.
+
+ Parameters
+ ----------
+ x1 : array_like
+ Array of multipliers.
+ x2 : array_like, int
+ Array of twos exponents.
+ out : ndarray, optional
+ Output array for the result.
+
+ Returns
+ -------
+ y : ndarray or scalar
+ The result of ``x1 * 2**x2``.
+
+ See Also
+ --------
+ frexp : Return (y1, y2) from ``x = y1 * 2**y2``, inverse to `ldexp`.
+
+ Notes
+ -----
+ Complex dtypes are not supported, they will raise a TypeError.
+
+ `ldexp` is useful as the inverse of `frexp`, if used by itself it is
+ more clear to simply use the expression ``x1 * 2**x2``.
+
+ Examples
+ --------
+ >>> np.ldexp(5, np.arange(4))
+ array([ 5., 10., 20., 40.], dtype=float32)
+
+ >>> x = np.arange(6)
+ >>> np.ldexp(*np.frexp(x))
+ array([ 0., 1., 2., 3., 4., 5.])
+
+ """)
diff --git a/numpy/core/code_generators/cversions.py b/numpy/core/cversions.py
index 840251aa8..7995dd993 100644
--- a/numpy/core/code_generators/cversions.py
+++ b/numpy/core/cversions.py
@@ -7,10 +7,9 @@ from __future__ import division, absolute_import, print_function
from os.path import dirname
-from genapi import fullapi_hash
-import numpy_api
-
+from code_generators.genapi import fullapi_hash
+from code_generators.numpy_api import full_api
if __name__ == '__main__':
curdir = dirname(__file__)
- print(fullapi_hash(numpy_api.full_api))
+ print(fullapi_hash(full_api))
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 152cceb1b..49fd57e29 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -4,7 +4,9 @@
from __future__ import division, absolute_import, print_function
import types
+import warnings
+from .. import VisibleDeprecationWarning
from . import multiarray as mu
from . import umath as um
from . import numerictypes as nt
@@ -90,6 +92,7 @@ def take(a, indices, axis=None, out=None, mode='raise'):
See Also
--------
+ compress : Take elements using a boolean mask
ndarray.take : equivalent method
Examples
@@ -583,7 +586,7 @@ def partition(a, kth, axis=-1, kind='introselect', order=None):
The various selection algorithms are characterized by their average speed,
worst case performance, work space size, and whether they are stable. A
stable sort keeps items with the same key in the same relative order. The
- three available algorithms have the following properties:
+ available algorithms have the following properties:
================= ======= ============= ============ =======
kind speed worst case work space stable
@@ -1087,7 +1090,7 @@ def squeeze(a, axis=None):
Returns
-------
squeezed : ndarray
- The input array, but with with all or a subset of the
+ The input array, but with all or a subset of the
dimensions of length 1 removed. This is always `a` itself
or a view into `a`.
@@ -1770,7 +1773,7 @@ def any(a, axis=None, out=None, keepdims=False):
Input array or object that can be converted to an array.
axis : None or int or tuple of ints, optional
Axis or axes along which a logical OR reduction is performed.
- The default (`axis` = `None`) is perform a logical OR over all
+ The default (`axis` = `None`) is to perform a logical OR over all
the dimensions of the input array. `axis` may be negative, in
which case it counts from the last to the first axis.
@@ -1848,7 +1851,7 @@ def all(a, axis=None, out=None, keepdims=False):
Input array or object that can be converted to an array.
axis : None or int or tuple of ints, optional
Axis or axes along which a logical AND reduction is performed.
- The default (`axis` = `None`) is perform a logical OR over all
+ The default (`axis` = `None`) is to perform a logical AND over all
the dimensions of the input array. `axis` may be negative, in
which case it counts from the last to the first axis.
@@ -2452,6 +2455,11 @@ def rank(a):
If `a` is not already an array, a conversion is attempted.
Scalars are zero dimensional.
+ .. note::
+ This function is deprecated in NumPy 1.9 to avoid confusion with
+ `numpy.linalg.matrix_rank`. The ``ndim`` attribute or function
+ should be used instead.
+
Parameters
----------
a : array_like
@@ -2485,6 +2493,10 @@ def rank(a):
0
"""
+ warnings.warn(
+ "`rank` is deprecated; use the `ndim` attribute or function instead. "
+ "To find the rank of a matrix see `numpy.linalg.matrix_rank`.",
+ VisibleDeprecationWarning)
try:
return a.ndim
except AttributeError:
diff --git a/numpy/core/function_base.py b/numpy/core/function_base.py
index 3396adf3d..400e75eb5 100644
--- a/numpy/core/function_base.py
+++ b/numpy/core/function_base.py
@@ -79,6 +79,10 @@ def linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None):
"""
num = int(num)
+ # Convert float/complex array scalars to float, gh-3504
+ start = start * 1.
+ stop = stop * 1.
+
if dtype is None:
dtype = result_type(start, stop, float(num))
diff --git a/numpy/core/include/numpy/_numpyconfig.h.in b/numpy/core/include/numpy/_numpyconfig.h.in
index 2a159f56d..20f21c1a7 100644
--- a/numpy/core/include/numpy/_numpyconfig.h.in
+++ b/numpy/core/include/numpy/_numpyconfig.h.in
@@ -30,6 +30,8 @@
@DEFINE_NPY_SIZEOF_PY_LONG_LONG@
@DEFINE_NPY_ENABLE_SEPARATE_COMPILATION@
+@DEFINE_NPY_RELAXED_STRIDES_CHECKING@
+
#define NPY_VISIBILITY_HIDDEN @VISIBILITY_HIDDEN@
@DEFINE_NPY_USE_C99_FORMATS@
diff --git a/numpy/core/include/numpy/ndarraytypes.h b/numpy/core/include/numpy/ndarraytypes.h
index fd64cd75f..21ff8cd1a 100644
--- a/numpy/core/include/numpy/ndarraytypes.h
+++ b/numpy/core/include/numpy/ndarraytypes.h
@@ -928,12 +928,14 @@ typedef int (PyArray_FinalizeFunc)(PyArrayObject *, PyObject *);
#define PyArray_IS_C_CONTIGUOUS(m) PyArray_CHKFLAGS(m, NPY_ARRAY_C_CONTIGUOUS)
#define PyArray_IS_F_CONTIGUOUS(m) PyArray_CHKFLAGS(m, NPY_ARRAY_F_CONTIGUOUS)
+/* the variable is used in some places, so always define it */
+#define NPY_BEGIN_THREADS_DEF PyThreadState *_save=NULL;
#if NPY_ALLOW_THREADS
#define NPY_BEGIN_ALLOW_THREADS Py_BEGIN_ALLOW_THREADS
#define NPY_END_ALLOW_THREADS Py_END_ALLOW_THREADS
-#define NPY_BEGIN_THREADS_DEF PyThreadState *_save=NULL;
#define NPY_BEGIN_THREADS do {_save = PyEval_SaveThread();} while (0);
-#define NPY_END_THREADS do {if (_save) PyEval_RestoreThread(_save);} while (0);
+#define NPY_END_THREADS do { if (_save) \
+ { PyEval_RestoreThread(_save); _save = NULL;} } while (0);
#define NPY_BEGIN_THREADS_THRESHOLDED(loop_size) do { if (loop_size > 500) \
{ _save = PyEval_SaveThread();} } while (0);
@@ -951,9 +953,9 @@ typedef int (PyArray_FinalizeFunc)(PyArrayObject *, PyObject *);
#else
#define NPY_BEGIN_ALLOW_THREADS
#define NPY_END_ALLOW_THREADS
-#define NPY_BEGIN_THREADS_DEF
#define NPY_BEGIN_THREADS
#define NPY_END_THREADS
+#define NPY_BEGIN_THREADS_THRESHOLDED(loop_size)
#define NPY_BEGIN_THREADS_DESCR(dtype)
#define NPY_END_THREADS_DESCR(dtype)
#define NPY_ALLOW_C_API_DEF
@@ -1254,8 +1256,12 @@ typedef struct {
#define PyArray_MultiIter_NOTDONE(multi) \
(_PyMIT(multi)->index < _PyMIT(multi)->size)
-/* Store the information needed for fancy-indexing over an array */
+/*
+ * Store the information needed for fancy-indexing over an array. The
+ * fields are slightly unordered to keep consec, dataptr and subspace
+ * where they were originally.
+ */
typedef struct {
PyObject_HEAD
/*
@@ -1270,33 +1276,71 @@ typedef struct {
npy_intp index; /* current index */
int nd; /* number of dims */
npy_intp dimensions[NPY_MAXDIMS]; /* dimensions */
- PyArrayIterObject *iters[NPY_MAXDIMS]; /* index object
- iterators */
- PyArrayIterObject *ait; /* flat Iterator for
- underlying array */
+ NpyIter *outer; /* index objects
+ iterator */
+ void *unused[NPY_MAXDIMS - 2];
+ PyArrayObject *array;
+ /* Flat iterator for the indexed array. For compatibility solely. */
+ PyArrayIterObject *ait;
- /* flat iterator for subspace (when numiter < nd) */
- PyArrayIterObject *subspace;
+ /*
+ * Subspace array. For binary compatibility (was an iterator,
+ * but only the check for NULL should be used).
+ */
+ PyArrayObject *subspace;
/*
* if subspace iteration, then this is the array of axes in
* the underlying array represented by the index objects
*/
int iteraxes[NPY_MAXDIMS];
- /*
- * if subspace iteration, the these are the coordinates to the
- * start of the subspace.
- */
- npy_intp bscoord[NPY_MAXDIMS];
+ npy_intp fancy_strides[NPY_MAXDIMS];
+
+ /* pointer when all fancy indices are 0 */
+ char *baseoffset;
- PyObject *indexobj; /* creating obj */
/*
- * consec is first used to indicate wether fancy indices are
- * consecutive and then denotes at which axis they are inserted
+ * after binding consec denotes at which axis the fancy axes
+ * are inserted.
*/
int consec;
char *dataptr;
+ int nd_fancy;
+ npy_intp fancy_dims[NPY_MAXDIMS];
+
+ /* Whether the iterator (any of the iterators) requires API */
+ int needs_api;
+
+ /*
+ * Extra op information.
+ */
+ PyArrayObject *extra_op;
+ PyArray_Descr *extra_op_dtype; /* desired dtype */
+ npy_uint32 *extra_op_flags; /* Iterator flags */
+
+ NpyIter *extra_op_iter;
+ NpyIter_IterNextFunc *extra_op_next;
+ char **extra_op_ptrs;
+
+ /*
+ * Information about the iteration state.
+ */
+ NpyIter_IterNextFunc *outer_next;
+ char **outer_ptrs;
+ npy_intp *outer_strides;
+
+ /*
+ * Information about the subspace iterator.
+ */
+ NpyIter *subspace_iter;
+ NpyIter_IterNextFunc *subspace_next;
+ char **subspace_ptrs;
+ npy_intp *subspace_strides;
+
+ /* Count for the external loop (which ever it is) for API iteration */
+ npy_intp iter_count;
+
} PyArrayMapIterObject;
enum {
@@ -1448,13 +1492,13 @@ PyArray_STRIDE(const PyArrayObject *arr, int istride)
return ((PyArrayObject_fields *)arr)->strides[istride];
}
-static NPY_INLINE PyObject *
+static NPY_INLINE NPY_RETURNS_BORROWED_REF PyObject *
PyArray_BASE(PyArrayObject *arr)
{
return ((PyArrayObject_fields *)arr)->base;
}
-static NPY_INLINE PyArray_Descr *
+static NPY_INLINE NPY_RETURNS_BORROWED_REF PyArray_Descr *
PyArray_DESCR(PyArrayObject *arr)
{
return ((PyArrayObject_fields *)arr)->descr;
diff --git a/numpy/core/include/numpy/npy_3kcompat.h b/numpy/core/include/numpy/npy_3kcompat.h
index f4078dad2..fec95779a 100644
--- a/numpy/core/include/numpy/npy_3kcompat.h
+++ b/numpy/core/include/numpy/npy_3kcompat.h
@@ -141,12 +141,11 @@ PyUnicode_Concat2(PyObject **left, PyObject *right)
* PyFile_* compatibility
*/
#if defined(NPY_PY3K)
-
/*
* Get a FILE* handle to the file represented by the Python object
*/
static NPY_INLINE FILE*
-npy_PyFile_Dup(PyObject *file, char *mode, npy_off_t *orig_pos)
+npy_PyFile_Dup2(PyObject *file, char *mode, npy_off_t *orig_pos)
{
int fd, fd2;
PyObject *ret, *os;
@@ -164,8 +163,10 @@ npy_PyFile_Dup(PyObject *file, char *mode, npy_off_t *orig_pos)
return NULL;
}
- /* The handle needs to be dup'd because we have to call fclose
- at the end */
+ /*
+ * The handle needs to be dup'd because we have to call fclose
+ * at the end
+ */
os = PyImport_ImportModule("os");
if (os == NULL) {
return NULL;
@@ -193,7 +194,8 @@ npy_PyFile_Dup(PyObject *file, char *mode, npy_off_t *orig_pos)
*orig_pos = npy_ftell(handle);
if (*orig_pos == -1) {
PyErr_SetString(PyExc_IOError, "obtaining file position failed");
- return -1;
+ fclose(handle);
+ return NULL;
}
/* Seek raw handle to the Python-side position */
@@ -202,7 +204,7 @@ npy_PyFile_Dup(PyObject *file, char *mode, npy_off_t *orig_pos)
fclose(handle);
return NULL;
}
- pos = PyNumber_AsSsize_t(ret, PyExc_OverflowError);
+ pos = PyLong_AsLongLong(ret);
Py_DECREF(ret);
if (PyErr_Occurred()) {
fclose(handle);
@@ -210,7 +212,8 @@ npy_PyFile_Dup(PyObject *file, char *mode, npy_off_t *orig_pos)
}
if (npy_fseek(handle, pos, SEEK_SET) == -1) {
PyErr_SetString(PyExc_IOError, "seeking file failed");
- return -1;
+ fclose(handle);
+ return NULL;
}
return handle;
}
@@ -219,7 +222,7 @@ npy_PyFile_Dup(PyObject *file, char *mode, npy_off_t *orig_pos)
* Close the dup-ed file handle, and seek the Python one to the current position
*/
static NPY_INLINE int
-npy_PyFile_DupClose(PyObject *file, FILE* handle, npy_off_t orig_pos)
+npy_PyFile_DupClose2(PyObject *file, FILE* handle, npy_off_t orig_pos)
{
int fd;
PyObject *ret;
@@ -230,8 +233,10 @@ npy_PyFile_DupClose(PyObject *file, FILE* handle, npy_off_t orig_pos)
/* Close the FILE* handle */
fclose(handle);
- /* Restore original file handle position, in order to not confuse
- Python-side data structures */
+ /*
+ * Restore original file handle position, in order to not confuse
+ * Python-side data structures
+ */
fd = PyObject_AsFileDescriptor(file);
if (fd == -1) {
return -1;
@@ -267,14 +272,71 @@ npy_PyFile_Check(PyObject *file)
return 1;
}
+/*
+ * DEPRECATED DO NOT USE
+ * use npy_PyFile_DupClose2 instead
+ * this function will mess ups python3 internal file object buffering
+ * Close the dup-ed file handle, and seek the Python one to the current position
+ */
+static NPY_INLINE int
+npy_PyFile_DupClose(PyObject *file, FILE* handle)
+{
+ PyObject *ret;
+ Py_ssize_t position;
+ position = npy_ftell(handle);
+ fclose(handle);
+
+ ret = PyObject_CallMethod(file, "seek", NPY_SSIZE_T_PYFMT "i", position, 0);
+ if (ret == NULL) {
+ return -1;
+ }
+ Py_DECREF(ret);
+ return 0;
+}
+
+
#else
-#define npy_PyFile_Dup(file, mode, orig_pos_p) PyFile_AsFile(file)
-#define npy_PyFile_DupClose(file, handle, orig_pos) (0)
+/* DEPRECATED, DO NOT USE */
+#define npy_PyFile_DupClose(f, h, p) npy_PyFile_DupClose2((f), (h), (p))
+
+/* use these */
+static NPY_INLINE FILE *
+npy_PyFile_Dup2(PyObject *file,
+ const char *NPY_UNUSED(mode), npy_off_t *NPY_UNUSED(orig_pos))
+{
+ return PyFile_AsFile(file);
+}
+
+static NPY_INLINE int
+npy_PyFile_DupClose2(PyObject *NPY_UNUSED(file), FILE* NPY_UNUSED(handle),
+ npy_off_t NPY_UNUSED(orig_pos))
+{
+ return 0;
+}
+
#define npy_PyFile_Check PyFile_Check
#endif
+/*
+ * DEPRECATED, DO NOT USE
+ * Use npy_PyFile_Dup2 instead.
+ * This function will mess up python3 internal file object buffering.
+ * Get a FILE* handle to the file represented by the Python object.
+ */
+static NPY_INLINE FILE*
+npy_PyFile_Dup(PyObject *file, char *mode)
+{
+ npy_off_t orig;
+ if (DEPRECATE("npy_PyFile_Dup is deprecated, use "
+ "npy_PyFile_Dup2") < 0) {
+ return NULL;
+ }
+
+ return npy_PyFile_Dup2(file, mode, &orig);
+}
+
static NPY_INLINE PyObject*
npy_PyFile_OpenFile(PyObject *filename, const char *mode)
{
@@ -389,12 +451,6 @@ NpyCapsule_Check(PyObject *ptr)
return PyCapsule_CheckExact(ptr);
}
-static NPY_INLINE void
-simple_capsule_dtor(PyObject *cap)
-{
- PyArray_free(PyCapsule_GetPointer(cap, NULL));
-}
-
#else
static NPY_INLINE PyObject *
@@ -428,12 +484,6 @@ NpyCapsule_Check(PyObject *ptr)
return PyCObject_Check(ptr);
}
-static NPY_INLINE void
-simple_capsule_dtor(void *ptr)
-{
- PyArray_free(ptr);
-}
-
#endif
/*
diff --git a/numpy/core/include/numpy/npy_common.h b/numpy/core/include/numpy/npy_common.h
index 15961e853..5cba8c9d2 100644
--- a/numpy/core/include/numpy/npy_common.h
+++ b/numpy/core/include/numpy/npy_common.h
@@ -18,6 +18,23 @@
#define NPY_GCC_UNROLL_LOOPS
#endif
+/* highest gcc optimization level, enabled autovectorizer */
+#ifdef HAVE_ATTRIBUTE_OPTIMIZE_OPT_3
+#define NPY_GCC_OPT_3 __attribute__((optimize("O3")))
+#else
+#define NPY_GCC_OPT_3
+#endif
+
+/*
+ * mark an argument (starting from 1) that must not be NULL and is not checked
+ * DO NOT USE IF FUNCTION CHECKS FOR NULL!! the compiler will remove the check
+ */
+#ifdef HAVE_ATTRIBUTE_NONNULL
+#define NPY_GCC_NONNULL(n) __attribute__((nonnull(n)))
+#else
+#define NPY_GCC_NONNULL(n)
+#endif
+
#if defined HAVE_XMMINTRIN_H && defined HAVE__MM_LOAD_PS
#define NPY_HAVE_SSE_INTRINSICS
#endif
@@ -56,9 +73,41 @@
#define NPY_INLINE
#endif
+#ifdef HAVE___THREAD
+ #define NPY_TLS __thread
+#else
+ #ifdef HAVE___DECLSPEC_THREAD_
+ #define NPY_TLS __declspec(thread)
+ #else
+ #define NPY_TLS
+ #endif
+#endif
+
+#ifdef WITH_CPYCHECKER_RETURNS_BORROWED_REF_ATTRIBUTE
+ #define NPY_RETURNS_BORROWED_REF \
+ __attribute__((cpychecker_returns_borrowed_ref))
+#else
+ #define NPY_RETURNS_BORROWED_REF
+#endif
+
+#ifdef WITH_CPYCHECKER_STEALS_REFERENCE_TO_ARG_ATTRIBUTE
+ #define NPY_STEALS_REF_TO_ARG(n) \
+ __attribute__((cpychecker_steals_reference_to_arg(n)))
+#else
+ #define NPY_STEALS_REF_TO_ARG(n)
+#endif
+
/* 64 bit file position support, also on win-amd64. Ticket #1660 */
-#if defined(_MSC_VER) && defined(_WIN64) && (_MSC_VER > 1400)
+#if defined(_MSC_VER) && defined(_WIN64) && (_MSC_VER > 1400) || \
+ defined(__MINGW32__) || defined(__MINGW64__)
#include <io.h>
+
+/* mingw based on 3.4.5 has lseek but not ftell/fseek */
+#if defined(__MINGW32__) || defined(__MINGW64__)
+extern int __cdecl _fseeki64(FILE *, long long, int);
+extern long long __cdecl _ftelli64(FILE *);
+#endif
+
#define npy_fseek _fseeki64
#define npy_ftell _ftelli64
#define npy_lseek _lseeki64
@@ -74,8 +123,16 @@
#error Unsupported size for type off_t
#endif
#else
+#ifdef HAVE_FSEEKO
+ #define npy_fseek fseeko
+#else
#define npy_fseek fseek
+#endif
+#ifdef HAVE_FTELLO
+ #define npy_ftell ftello
+#else
#define npy_ftell ftell
+#endif
#define npy_lseek lseek
#define npy_off_t off_t
diff --git a/numpy/core/include/numpy/npy_cpu.h b/numpy/core/include/numpy/npy_cpu.h
index 80bd5fc56..24d4ce1fc 100644
--- a/numpy/core/include/numpy/npy_cpu.h
+++ b/numpy/core/include/numpy/npy_cpu.h
@@ -5,6 +5,7 @@
* NPY_CPU_AMD64
* NPY_CPU_PPC
* NPY_CPU_PPC64
+ * NPY_CPU_PPC64LE
* NPY_CPU_SPARC
* NPY_CPU_S390
* NPY_CPU_IA64
@@ -41,6 +42,8 @@
* _ARCH_PPC is used by at least gcc on AIX
*/
#define NPY_CPU_PPC
+#elif defined(__ppc64le__)
+ #define NPY_CPU_PPC64LE
#elif defined(__ppc64__)
#define NPY_CPU_PPC64
#elif defined(__sparc__) || defined(__sparc)
@@ -66,6 +69,8 @@
#define NPY_CPU_MIPSEL
#elif defined(__MIPSEB__)
#define NPY_CPU_MIPSEB
+#elif defined(__or1k__)
+ #define NPY_CPU_OR1K
#elif defined(__aarch64__)
#define NPY_CPU_AARCH64
#elif defined(__mc68000__)
diff --git a/numpy/core/include/numpy/npy_endian.h b/numpy/core/include/numpy/npy_endian.h
index 36d09232f..3ba03d0e3 100644
--- a/numpy/core/include/numpy/npy_endian.h
+++ b/numpy/core/include/numpy/npy_endian.h
@@ -27,7 +27,8 @@
|| defined(NPY_CPU_ARMEL) \
|| defined(NPY_CPU_AARCH64) \
|| defined(NPY_CPU_SH_LE) \
- || defined(NPY_CPU_MIPSEL)
+ || defined(NPY_CPU_MIPSEL) \
+ || defined(NPY_CPU_PPC64LE)
#define NPY_BYTE_ORDER NPY_LITTLE_ENDIAN
#elif defined(NPY_CPU_PPC) \
|| defined(NPY_CPU_SPARC) \
@@ -37,6 +38,7 @@
|| defined(NPY_CPU_ARMEB) \
|| defined(NPY_CPU_SH_BE) \
|| defined(NPY_CPU_MIPSEB) \
+ || defined(NPY_CPU_OR1K) \
|| defined(NPY_CPU_M68K)
#define NPY_BYTE_ORDER NPY_BIG_ENDIAN
#else
diff --git a/numpy/core/include/numpy/numpyconfig.h b/numpy/core/include/numpy/numpyconfig.h
index 5ca171f21..9d6dce004 100644
--- a/numpy/core/include/numpy/numpyconfig.h
+++ b/numpy/core/include/numpy/numpyconfig.h
@@ -30,5 +30,6 @@
*/
#define NPY_1_7_API_VERSION 0x00000007
#define NPY_1_8_API_VERSION 0x00000008
+#define NPY_1_9_API_VERSION 0x00000008
#endif
diff --git a/numpy/core/include/numpy/ufuncobject.h b/numpy/core/include/numpy/ufuncobject.h
index 38e3dcf0f..a24a0d837 100644
--- a/numpy/core/include/numpy/ufuncobject.h
+++ b/numpy/core/include/numpy/ufuncobject.h
@@ -152,13 +152,13 @@ typedef struct _tagPyUFuncObject {
int check_return;
/* The name of the ufunc */
- char *name;
+ const char *name;
/* Array of type numbers, of size ('nargs' * 'ntypes') */
char *types;
/* Documentation string */
- char *doc;
+ const char *doc;
void *ptr;
PyObject *obj;
diff --git a/numpy/core/memmap.py b/numpy/core/memmap.py
index 4e0c194f3..b1c96ee29 100644
--- a/numpy/core/memmap.py
+++ b/numpy/core/memmap.py
@@ -38,6 +38,9 @@ class memmap(ndarray):
This class may at some point be turned into a factory function
which returns a view into an mmap buffer.
+ Delete the memmap instance to close.
+
+
Parameters
----------
filename : str or file-like object
@@ -91,8 +94,6 @@ class memmap(ndarray):
Methods
-------
- close
- Close the memmap file.
flush
Flush any changes in memory to file on disk.
When you delete a memmap object, flush is called first to write
diff --git a/numpy/core/numeric.py b/numpy/core/numeric.py
index 39e5a4cd5..12e690f1e 100644
--- a/numpy/core/numeric.py
+++ b/numpy/core/numeric.py
@@ -1,13 +1,16 @@
from __future__ import division, absolute_import, print_function
+import os
import sys
import warnings
import collections
from . import multiarray
from . import umath
-from .umath import *
+from .umath import (invert, sin, UFUNC_BUFSIZE_DEFAULT, ERR_IGNORE,
+ ERR_WARN, ERR_RAISE, ERR_CALL, ERR_PRINT, ERR_LOG,
+ ERR_DEFAULT, PINF, NAN)
from . import numerictypes
-from .numerictypes import *
+from .numerictypes import longlong, intc, int_, float_, complex_, bool_
if sys.version_info[0] >= 3:
import pickle
@@ -355,9 +358,6 @@ def extend_all(module):
if a not in adict:
__all__.append(a)
-extend_all(umath)
-extend_all(numerictypes)
-
newaxis = None
@@ -766,7 +766,7 @@ def argwhere(a):
[1, 2]])
"""
- return transpose(asanyarray(a).nonzero())
+ return transpose(nonzero(a))
def flatnonzero(a):
"""
@@ -941,6 +941,8 @@ def convolve(a,v,mode='full'):
scipy.signal.fftconvolve : Convolve two arrays using the Fast Fourier
Transform.
scipy.linalg.toeplitz : Used to construct the convolution operator.
+ polymul : Polynomial multiplication. Same output as convolve, but also
+ accepts poly1d objects as input.
Notes
-----
@@ -991,7 +993,7 @@ def convolve(a,v,mode='full'):
mode = _mode_from_name(mode)
return multiarray.correlate(a, v[::-1], mode)
-def outer(a, b):
+def outer(a, b, out=None):
"""
Compute the outer product of two vectors.
@@ -1012,6 +1014,10 @@ def outer(a, b):
b : (N,) array_like
Second input vector. Input is flattened if
not already 1-dimensional.
+ out : (M, N) ndarray, optional
+ A location where the result is stored
+
+ .. versionadded:: 1.9.0
Returns
-------
@@ -1065,12 +1071,20 @@ def outer(a, b):
"""
a = asarray(a)
b = asarray(b)
- return a.ravel()[:, newaxis]*b.ravel()[newaxis,:]
+ return multiply(a.ravel()[:, newaxis], b.ravel()[newaxis,:], out)
# try to import blas optimized dot if available
+envbak = os.environ.copy()
try:
# importing this changes the dot function for basic 4 types
# to blas-optimized versions.
+
+ # disables openblas affinity setting of the main thread that limits
+ # python threads or processes to one core
+ if 'OPENBLAS_MAIN_FREE' not in os.environ:
+ os.environ['OPENBLAS_MAIN_FREE'] = '1'
+ if 'GOTOBLAS_MAIN_FREE' not in os.environ:
+ os.environ['GOTOBLAS_MAIN_FREE'] = '1'
from ._dotblas import dot, vdot, inner, alterdot, restoredot
except ImportError:
# docstrings are in add_newdocs.py
@@ -1082,6 +1096,10 @@ except ImportError:
pass
def restoredot():
pass
+finally:
+ os.environ.clear()
+ os.environ.update(envbak)
+ del envbak
def tensordot(a, b, axes=2):
"""
@@ -1429,6 +1447,11 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None):
outer : Outer product.
ix_ : Construct index arrays.
+ Notes
+ -----
+ .. versionadded:: 1.9.0
+ Supports full broadcasting of the inputs.
+
Examples
--------
Vector cross-product.
@@ -1490,39 +1513,86 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None):
"""
if axis is not None:
- axisa, axisb, axisc=(axis,)*3
- a = asarray(a).swapaxes(axisa, 0)
- b = asarray(b).swapaxes(axisb, 0)
- msg = "incompatible dimensions for cross product\n"\
- "(dimension must be 2 or 3)"
- if (a.shape[0] not in [2, 3]) or (b.shape[0] not in [2, 3]):
+ axisa, axisb, axisc = (axis,) * 3
+ a = asarray(a)
+ b = asarray(b)
+ # Move working axis to the end of the shape
+ a = rollaxis(a, axisa, a.ndim)
+ b = rollaxis(b, axisb, b.ndim)
+ msg = ("incompatible dimensions for cross product\n"
+ "(dimension must be 2 or 3)")
+ if a.shape[-1] not in (2, 3) or b.shape[-1] not in (2, 3):
raise ValueError(msg)
- if a.shape[0] == 2:
- if (b.shape[0] == 2):
- cp = a[0]*b[1] - a[1]*b[0]
+
+ # Create the output array
+ shape = broadcast(a[..., 0], b[..., 0]).shape
+ if a.shape[-1] == 3 or b.shape[-1] == 3:
+ shape += (3,)
+ dtype = promote_types(a.dtype, b.dtype)
+ cp = empty(shape, dtype)
+
+ # create local aliases for readability
+ a0 = a[..., 0]
+ a1 = a[..., 1]
+ if a.shape[-1] == 3:
+ a2 = a[..., 2]
+ b0 = b[..., 0]
+ b1 = b[..., 1]
+ if b.shape[-1] == 3:
+ b2 = b[..., 2]
+ if cp.ndim != 0 and cp.shape[-1] == 3:
+ cp0 = cp[..., 0]
+ cp1 = cp[..., 1]
+ cp2 = cp[..., 2]
+
+ if a.shape[-1] == 2:
+ if b.shape[-1] == 2:
+ # a0 * b1 - a1 * b0
+ multiply(a0, b1, out=cp)
+ cp -= a1 * b0
if cp.ndim == 0:
return cp
else:
- return cp.swapaxes(0, axisc)
+ # This works because we are moving the last axis
+ return rollaxis(cp, -1, axisc)
else:
- x = a[1]*b[2]
- y = -a[0]*b[2]
- z = a[0]*b[1] - a[1]*b[0]
- elif a.shape[0] == 3:
- if (b.shape[0] == 3):
- x = a[1]*b[2] - a[2]*b[1]
- y = a[2]*b[0] - a[0]*b[2]
- z = a[0]*b[1] - a[1]*b[0]
+ # cp0 = a1 * b2 - 0 (a2 = 0)
+ # cp1 = 0 - a0 * b2 (a2 = 0)
+ # cp2 = a0 * b1 - a1 * b0
+ multiply(a1, b2, out=cp0)
+ multiply(a0, b2, out=cp1)
+ negative(cp1, out=cp1)
+ multiply(a0, b1, out=cp2)
+ cp2 -= a1 * b0
+ elif a.shape[-1] == 3:
+ if b.shape[-1] == 3:
+ # cp0 = a1 * b2 - a2 * b1
+ # cp1 = a2 * b0 - a0 * b2
+ # cp2 = a0 * b1 - a1 * b0
+ multiply(a1, b2, out=cp0)
+ tmp = array(a2 * b1)
+ cp0 -= tmp
+ multiply(a2, b0, out=cp1)
+ multiply(a0, b2, out=tmp)
+ cp1 -= tmp
+ multiply(a0, b1, out=cp2)
+ multiply(a1, b0, out=tmp)
+ cp2 -= tmp
else:
- x = -a[2]*b[1]
- y = a[2]*b[0]
- z = a[0]*b[1] - a[1]*b[0]
- cp = array([x, y, z])
+ # cp0 = 0 - a2 * b1 (b2 = 0)
+ # cp1 = a2 * b0 - 0 (b2 = 0)
+ # cp2 = a0 * b1 - a1 * b0
+ multiply(a2, b1, out=cp0)
+ negative(cp0, out=cp0)
+ multiply(a2, b0, out=cp1)
+ multiply(a0, b1, out=cp2)
+ cp2 -= a1 * b0
+
if cp.ndim == 1:
return cp
else:
- return cp.swapaxes(0, axisc)
-
+ # This works because we are moving the last axis
+ return rollaxis(cp, -1, axisc)
#Use numarray's printing function
from .arrayprint import array2string, get_printoptions, set_printoptions
@@ -2139,6 +2209,11 @@ def allclose(a, b, rtol=1.e-5, atol=1.e-8):
x = array(a, copy=False, ndmin=1)
y = array(b, copy=False, ndmin=1)
+ # make sure y is an inexact type to avoid abs(MIN_INT); will cause
+ # casting of x later.
+ dtype = multiarray.result_type(y, 1.)
+ y = array(y, dtype=dtype, copy=False)
+
xinf = isinf(x)
yinf = isinf(y)
if any(xinf) or any(yinf):
@@ -2154,7 +2229,7 @@ def allclose(a, b, rtol=1.e-5, atol=1.e-8):
# ignore invalid fpe's
with errstate(invalid='ignore'):
- r = all(less_equal(abs(x-y), atol + rtol * abs(y)))
+ r = all(less_equal(abs(x - y), atol + rtol * abs(y)))
return r
@@ -2329,10 +2404,12 @@ def array_equiv(a1, a2):
except:
return False
try:
- return bool(asarray(a1 == a2).all())
- except ValueError:
+ multiarray.broadcast(a1, a2)
+ except:
return False
+ return bool(asarray(a1 == a2).all())
+
_errdict = {"ignore":ERR_IGNORE,
"warn":ERR_WARN,
@@ -2404,7 +2481,7 @@ def seterr(all=None, divide=None, over=None, under=None, invalid=None):
>>> np.seterr(over='raise')
{'over': 'ignore', 'divide': 'ignore', 'invalid': 'ignore',
'under': 'ignore'}
- >>> np.seterr(all='ignore') # reset to default
+ >>> np.seterr(**old_settings) # reset to default
{'over': 'raise', 'divide': 'ignore', 'invalid': 'ignore', 'under': 'ignore'}
>>> np.int16(32000) * np.int16(3)
@@ -2754,6 +2831,10 @@ nan = NaN = NAN
False_ = bool_(False)
True_ = bool_(True)
+from .umath import *
+from .numerictypes import *
from . import fromnumeric
from .fromnumeric import *
extend_all(fromnumeric)
+extend_all(umath)
+extend_all(numerictypes)
diff --git a/numpy/core/numerictypes.py b/numpy/core/numerictypes.py
index 8dc4ca75e..1545bc734 100644
--- a/numpy/core/numerictypes.py
+++ b/numpy/core/numerictypes.py
@@ -98,6 +98,7 @@ from numpy.core.multiarray import (
import types as _types
import sys
from numpy.compat import bytes, long
+import numbers
# we don't export these for import *, but we do want them accessible
# as numerictypes.bool, etc.
@@ -960,6 +961,12 @@ def _can_coerce_all(dtypelist, start=0):
thisind += 1
return None
+def _register_types():
+ numbers.Integral.register(integer)
+ numbers.Complex.register(inexact)
+ numbers.Real.register(floating)
+_register_types()
+
def find_common_type(array_types, scalar_types):
"""
Determine common type following standard coercion rules.
diff --git a/numpy/core/setup.py b/numpy/core/setup.py
index 2cb2f3a8b..5da042413 100644
--- a/numpy/core/setup.py
+++ b/numpy/core/setup.py
@@ -175,12 +175,16 @@ def check_math_capabilities(config, moredefs, mathlibs):
headers=headers):
moredefs.append((fname2def(f), 1))
- for dec, fn in OPTIONAL_GCC_ATTRIBUTES:
- if config.check_funcs_once([fn],
- decl=dict((('%s %s' % (dec, fn), True),)),
- call=False):
+ for dec, fn in OPTIONAL_FUNCTION_ATTRIBUTES:
+ if config.check_func(fn, decl='int %s %s(void *);' % (dec, fn),
+ call=False):
moredefs.append((fname2def(fn), 1))
+ for fn in OPTIONAL_VARIABLE_ATTRIBUTES:
+ if config.check_func(fn, decl='int %s a;' % (fn), call=False):
+ m = fn.replace("(", "_").replace(")", "_")
+ moredefs.append((fname2def(m), 1))
+
# C99 functions: float and long double versions
check_funcs(C99_FUNCS_SINGLE)
check_funcs(C99_FUNCS_EXTENDED)
@@ -466,7 +470,7 @@ def configuration(parent_package='',top_path=None):
'MOTOROLA_EXTENDED_12_BYTES_BE',
'IEEE_QUAD_LE', 'IEEE_QUAD_BE',
'IEEE_DOUBLE_LE', 'IEEE_DOUBLE_BE',
- 'DOUBLE_DOUBLE_BE']:
+ 'DOUBLE_DOUBLE_BE', 'DOUBLE_DOUBLE_LE']:
moredefs.append(('HAVE_LDOUBLE_%s' % rep, 1))
else:
raise ValueError("Unrecognized long double format: %s" % rep)
@@ -629,6 +633,9 @@ def configuration(parent_package='',top_path=None):
config.add_include_dirs(join('src', 'npysort'))
config.add_define_macros([("HAVE_NPY_CONFIG_H", "1")])
+ config.add_define_macros([("_FILE_OFFSET_BITS", "64")])
+ config.add_define_macros([('_LARGEFILE_SOURCE', '1')])
+ config.add_define_macros([('_LARGEFILE64_SOURCE', '1')])
config.numpy_include_dirs.extend(config.paths('include'))
@@ -704,8 +711,11 @@ def configuration(parent_package='',top_path=None):
npysort_sources=[join('src', 'npysort', 'quicksort.c.src'),
join('src', 'npysort', 'mergesort.c.src'),
join('src', 'npysort', 'heapsort.c.src'),
- join('src','private', 'npy_partition.h.src'),
- join('src', 'npysort', 'selection.c.src')]
+ join('src', 'private', 'npy_partition.h.src'),
+ join('src', 'npysort', 'selection.c.src'),
+ join('src', 'private', 'npy_binsearch.h.src'),
+ join('src', 'npysort', 'binsearch.c.src'),
+ ]
config.add_library('npysort',
sources=npysort_sources,
include_dirs=[])
@@ -787,6 +797,7 @@ def configuration(parent_package='',top_path=None):
] + npysort_sources + npymath_sources
multiarray_src = [
+ join('src', 'multiarray', 'alloc.c'),
join('src', 'multiarray', 'arrayobject.c'),
join('src', 'multiarray', 'arraytypes.c.src'),
join('src', 'multiarray', 'array_assign.c'),
@@ -857,9 +868,8 @@ def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import get_cmd
subpath = join('src', 'umath')
- # NOTE: For manual template conversion of loops.h.src, read the note
- # in that file.
sources = [
+ join(local_dir, subpath, 'loops.h.src'),
join(local_dir, subpath, 'loops.c.src'),
join(local_dir, subpath, 'simd.inc.src')]
@@ -889,6 +899,7 @@ def configuration(parent_package='',top_path=None):
join('src', 'umath', 'reduction.c'),
join('src', 'umath', 'funcs.inc.src'),
join('src', 'umath', 'simd.inc.src'),
+ join('src', 'umath', 'loops.h.src'),
join('src', 'umath', 'loops.c.src'),
join('src', 'umath', 'ufunc_object.c'),
join('src', 'umath', 'ufunc_type_resolution.c')]
diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py
index bad3607fa..be5673a47 100644
--- a/numpy/core/setup_common.py
+++ b/numpy/core/setup_common.py
@@ -34,6 +34,7 @@ C_ABI_VERSION = 0x01000009
#
# 0x00000008 - 1.7.x
# 0x00000009 - 1.8.x
+# 0x00000009 - 1.9.x
C_API_VERSION = 0x00000009
class MismatchCAPIWarning(Warning):
@@ -98,7 +99,8 @@ MANDATORY_FUNCS = ["sin", "cos", "tan", "sinh", "cosh", "tanh", "fabs",
# replacement implementation. Note that some of these are C99 functions.
OPTIONAL_STDFUNCS = ["expm1", "log1p", "acosh", "asinh", "atanh",
"rint", "trunc", "exp2", "log2", "hypot", "atan2", "pow",
- "copysign", "nextafter"]
+ "copysign", "nextafter", "ftello", "fseeko",
+ "strtoll", "strtoull"]
OPTIONAL_HEADERS = [
@@ -120,16 +122,23 @@ OPTIONAL_INTRINSICS = [("__builtin_isnan", '5.'),
("_mm_load_pd", '(double*)0', "emmintrin.h"), # SSE2
]
-# gcc function attributes
-# (attribute as understood by gcc, function name),
+# function attributes
+# tested via "int %s %s(void *);" % (attribute, name)
# function name will be converted to HAVE_<upper-case-name> preprocessor macro
-OPTIONAL_GCC_ATTRIBUTES = [('__attribute__((optimize("unroll-loops")))',
- 'attribute_optimize_unroll_loops'),
- ]
+OPTIONAL_FUNCTION_ATTRIBUTES = [('__attribute__((optimize("unroll-loops")))',
+ 'attribute_optimize_unroll_loops'),
+ ('__attribute__((optimize("O3")))',
+ 'attribute_optimize_opt_3'),
+ ('__attribute__((nonnull (1)))',
+ 'attribute_nonnull'),
+ ]
+
+# variable attributes tested via "int %s a" % attribute
+OPTIONAL_VARIABLE_ATTRIBUTES = ["__thread", "__declspec(thread)"]
# Subset of OPTIONAL_STDFUNCS which may alreay have HAVE_* defined by Python.h
OPTIONAL_STDFUNCS_MAYBE = ["expm1", "log1p", "acosh", "atanh", "asinh", "hypot",
- "copysign"]
+ "copysign", "ftello", "fseeko"]
# C99 functions: float and long double versions
C99_FUNCS = ["sin", "cos", "tan", "sinh", "cosh", "tanh", "fabs", "floor",
@@ -256,6 +265,8 @@ _IEEE_QUAD_PREC_BE = ['300', '031', '326', '363', '105', '100', '000', '000',
_IEEE_QUAD_PREC_LE = _IEEE_QUAD_PREC_BE[::-1]
_DOUBLE_DOUBLE_BE = ['301', '235', '157', '064', '124', '000', '000', '000'] + \
['000'] * 8
+_DOUBLE_DOUBLE_LE = ['000', '000', '000', '124', '064', '157', '235', '301'] + \
+ ['000'] * 8
def long_double_representation(lines):
"""Given a binary dump as given by GNU od -b, look for long double
@@ -295,6 +306,8 @@ def long_double_representation(lines):
return 'IEEE_QUAD_LE'
elif read[8:-8] == _DOUBLE_DOUBLE_BE:
return 'DOUBLE_DOUBLE_BE'
+ elif read[8:-8] == _DOUBLE_DOUBLE_LE:
+ return 'DOUBLE_DOUBLE_LE'
elif read[:16] == _BEFORE_SEQ:
if read[16:-8] == _IEEE_DOUBLE_LE:
return 'IEEE_DOUBLE_LE'
diff --git a/numpy/core/src/dummymodule.c b/numpy/core/src/dummymodule.c
index e051cc6ff..718199f70 100644
--- a/numpy/core/src/dummymodule.c
+++ b/numpy/core/src/dummymodule.c
@@ -6,6 +6,7 @@
*/
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define NO_IMPORT_ARRAY
#include <Python.h>
#include <npy_pycompat.h>
diff --git a/numpy/core/src/multiarray/alloc.c b/numpy/core/src/multiarray/alloc.c
new file mode 100644
index 000000000..06c9ff296
--- /dev/null
+++ b/numpy/core/src/multiarray/alloc.c
@@ -0,0 +1,241 @@
+#define PY_SSIZE_T_CLEAN
+#include <Python.h>
+#include "structmember.h"
+
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+#include <numpy/ndarraytypes.h>
+#include "numpy/arrayobject.h"
+#include <numpy/npy_common.h>
+#include "npy_config.h"
+
+#include <assert.h>
+
+#define NBUCKETS 1024 /* number of buckets for data*/
+#define NBUCKETS_DIM 16 /* number of buckets for dimensions/strides */
+#define NCACHE 8 /* 1 + number of cache entries per bucket */
+static void * datacache[NBUCKETS][NCACHE];
+static void * dimcache[NBUCKETS_DIM][NCACHE];
+
+/*
+ * very simplistic small memory block cache to avoid more expensive libc
+ * allocations
+ * base function for data cache with 1 byte buckets and dimension cache with
+ * sizeof(npy_intp) byte buckets
+ */
+static NPY_INLINE void *
+_npy_alloc_cache(npy_uintp nelem, npy_uintp esz, npy_uint msz,
+ void * (*cache)[NCACHE], void * (*alloc)(size_t))
+{
+ assert((esz == 1 && cache == datacache) ||
+ (esz == sizeof(npy_intp) && cache == dimcache));
+ if (nelem < msz) {
+ /* first entry is used as fill counter */
+ npy_uintp * idx = (npy_uintp *)&(cache[nelem][0]);
+ if (*idx > 0) {
+ return cache[nelem][(*idx)--];
+ }
+ }
+ return alloc(nelem * esz);
+}
+
+/*
+ * return pointer p to cache, nelem is number of elements of the cache bucket
+ * size (1 or sizeof(npy_intp)) of the block pointed too
+ */
+static NPY_INLINE void
+_npy_free_cache(void * p, npy_uintp nelem, npy_uint msz,
+ void * (*cache)[NCACHE], void (*dealloc)(void *))
+{
+ if (p != NULL && nelem < msz) {
+ /* first entry is used as fill counter */
+ npy_uintp * idx = (npy_uintp *)&(cache[nelem][0]);
+ if (*idx < NCACHE - 1) {
+ cache[nelem][++(*idx)] = p;
+ return;
+ }
+ }
+ dealloc(p);
+}
+
+
+/*
+ * array data cache, sz is number of bytes to allocate
+ */
+NPY_NO_EXPORT void *
+npy_alloc_cache(npy_uintp sz)
+{
+ return _npy_alloc_cache(sz, 1, NBUCKETS, datacache, &PyDataMem_NEW);
+}
+
+/* zero initialized data, sz is number of bytes to allocate */
+NPY_NO_EXPORT void *
+npy_alloc_cache_zero(npy_uintp sz)
+{
+ void * p;
+ NPY_BEGIN_THREADS_DEF;
+ if (sz < NBUCKETS) {
+ p = _npy_alloc_cache(sz, 1, NBUCKETS, datacache, &PyDataMem_NEW);
+ memset(p, 0, sz);
+ return p;
+ }
+ NPY_BEGIN_THREADS;
+ p = PyDataMem_NEW_ZEROED(sz, 1);
+ NPY_END_THREADS;
+ return p;
+}
+
+NPY_NO_EXPORT void
+npy_free_cache(void * p, npy_uintp sz)
+{
+ _npy_free_cache(p, sz, NBUCKETS, datacache, &PyDataMem_FREE);
+}
+
+/*
+ * dimension/stride cache, uses a different allocator and is always a multiple
+ * of npy_intp
+ */
+NPY_NO_EXPORT void *
+npy_alloc_cache_dim(npy_uintp sz)
+{
+ /* dims + strides */
+ if (NPY_UNLIKELY(sz < 2)) {
+ sz = 2;
+ }
+ return _npy_alloc_cache(sz, sizeof(npy_intp), NBUCKETS_DIM, dimcache,
+ &PyArray_malloc);
+}
+
+NPY_NO_EXPORT void
+npy_free_cache_dim(void * p, npy_uintp sz)
+{
+ /* dims + strides */
+ if (NPY_UNLIKELY(sz < 2)) {
+ sz = 2;
+ }
+ _npy_free_cache(p, sz, NBUCKETS_DIM, dimcache,
+ &PyArray_free);
+}
+
+
+/* malloc/free/realloc hook */
+NPY_NO_EXPORT PyDataMem_EventHookFunc *_PyDataMem_eventhook;
+NPY_NO_EXPORT void *_PyDataMem_eventhook_user_data;
+
+/*NUMPY_API
+ * Sets the allocation event hook for numpy array data.
+ * Takes a PyDataMem_EventHookFunc *, which has the signature:
+ * void hook(void *old, void *new, size_t size, void *user_data).
+ * Also takes a void *user_data, and void **old_data.
+ *
+ * Returns a pointer to the previous hook or NULL. If old_data is
+ * non-NULL, the previous user_data pointer will be copied to it.
+ *
+ * If not NULL, hook will be called at the end of each PyDataMem_NEW/FREE/RENEW:
+ * result = PyDataMem_NEW(size) -> (*hook)(NULL, result, size, user_data)
+ * PyDataMem_FREE(ptr) -> (*hook)(ptr, NULL, 0, user_data)
+ * result = PyDataMem_RENEW(ptr, size) -> (*hook)(ptr, result, size, user_data)
+ *
+ * When the hook is called, the GIL will be held by the calling
+ * thread. The hook should be written to be reentrant, if it performs
+ * operations that might cause new allocation events (such as the
+ * creation/descruction numpy objects, or creating/destroying Python
+ * objects which might cause a gc)
+ */
+NPY_NO_EXPORT PyDataMem_EventHookFunc *
+PyDataMem_SetEventHook(PyDataMem_EventHookFunc *newhook,
+ void *user_data, void **old_data)
+{
+ PyDataMem_EventHookFunc *temp;
+ NPY_ALLOW_C_API_DEF
+ NPY_ALLOW_C_API
+ temp = _PyDataMem_eventhook;
+ _PyDataMem_eventhook = newhook;
+ if (old_data != NULL) {
+ *old_data = _PyDataMem_eventhook_user_data;
+ }
+ _PyDataMem_eventhook_user_data = user_data;
+ NPY_DISABLE_C_API
+ return temp;
+}
+
+/*NUMPY_API
+ * Allocates memory for array data.
+ */
+NPY_NO_EXPORT void *
+PyDataMem_NEW(size_t size)
+{
+ void *result;
+
+ result = malloc(size);
+ if (_PyDataMem_eventhook != NULL) {
+ NPY_ALLOW_C_API_DEF
+ NPY_ALLOW_C_API
+ if (_PyDataMem_eventhook != NULL) {
+ (*_PyDataMem_eventhook)(NULL, result, size,
+ _PyDataMem_eventhook_user_data);
+ }
+ NPY_DISABLE_C_API
+ }
+ return result;
+}
+
+/*NUMPY_API
+ * Allocates zeroed memory for array data.
+ */
+NPY_NO_EXPORT void *
+PyDataMem_NEW_ZEROED(size_t size, size_t elsize)
+{
+ void *result;
+
+ result = calloc(size, elsize);
+ if (_PyDataMem_eventhook != NULL) {
+ NPY_ALLOW_C_API_DEF
+ NPY_ALLOW_C_API
+ if (_PyDataMem_eventhook != NULL) {
+ (*_PyDataMem_eventhook)(NULL, result, size * elsize,
+ _PyDataMem_eventhook_user_data);
+ }
+ NPY_DISABLE_C_API
+ }
+ return result;
+}
+
+/*NUMPY_API
+ * Free memory for array data.
+ */
+NPY_NO_EXPORT void
+PyDataMem_FREE(void *ptr)
+{
+ free(ptr);
+ if (_PyDataMem_eventhook != NULL) {
+ NPY_ALLOW_C_API_DEF
+ NPY_ALLOW_C_API
+ if (_PyDataMem_eventhook != NULL) {
+ (*_PyDataMem_eventhook)(ptr, NULL, 0,
+ _PyDataMem_eventhook_user_data);
+ }
+ NPY_DISABLE_C_API
+ }
+}
+
+/*NUMPY_API
+ * Reallocate/resize memory for array data.
+ */
+NPY_NO_EXPORT void *
+PyDataMem_RENEW(void *ptr, size_t size)
+{
+ void *result;
+
+ result = realloc(ptr, size);
+ if (_PyDataMem_eventhook != NULL) {
+ NPY_ALLOW_C_API_DEF
+ NPY_ALLOW_C_API
+ if (_PyDataMem_eventhook != NULL) {
+ (*_PyDataMem_eventhook)(ptr, result, size,
+ _PyDataMem_eventhook_user_data);
+ }
+ NPY_DISABLE_C_API
+ }
+ return result;
+}
diff --git a/numpy/core/src/multiarray/alloc.h b/numpy/core/src/multiarray/alloc.h
new file mode 100644
index 000000000..8f6b167d0
--- /dev/null
+++ b/numpy/core/src/multiarray/alloc.h
@@ -0,0 +1,22 @@
+#ifndef _NPY_ARRAY_ALLOC_H_
+#define _NPY_ARRAY_ALLOC_H_
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+#define _MULTIARRAYMODULE
+#include <numpy/ndarraytypes.h>
+
+NPY_NO_EXPORT void *
+npy_alloc_cache(npy_uintp sz);
+
+NPY_NO_EXPORT void *
+npy_alloc_cache_zero(npy_uintp sz);
+
+NPY_NO_EXPORT void
+npy_free_cache(void * p, npy_uintp sd);
+
+NPY_NO_EXPORT void *
+npy_alloc_cache_dim(npy_uintp sz);
+
+NPY_NO_EXPORT void
+npy_free_cache_dim(void * p, npy_uintp sd);
+
+#endif
diff --git a/numpy/core/src/multiarray/array_assign_array.c b/numpy/core/src/multiarray/array_assign_array.c
index 1cf4b3a3b..67c98d8b5 100644
--- a/numpy/core/src/multiarray/array_assign_array.c
+++ b/numpy/core/src/multiarray/array_assign_array.c
@@ -99,9 +99,7 @@ raw_array_assign_array(int ndim, npy_intp *shape,
dst_data, dst_strides_it,
src_data, src_strides_it);
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
NPY_AUXDATA_FREE(transferdata);
@@ -194,9 +192,7 @@ raw_array_wheremasked_assign_array(int ndim, npy_intp *shape,
src_data, src_strides_it,
wheremask_data, wheremask_strides_it);
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
NPY_AUXDATA_FREE(transferdata);
@@ -238,9 +234,9 @@ PyArray_AssignArray(PyArrayObject *dst, PyArrayObject *src,
* case, first an in-place add is done, followed by an assignment,
* equivalently expressed like this:
*
- * tmp = a[1000:6000] # Calls array_subscript_nice in mapping.c
+ * tmp = a[1000:6000] # Calls array_subscript in mapping.c
* np.add(tmp, x, tmp)
- * a[1000:6000] = tmp # Calls array_ass_sub in mapping.c
+ * a[1000:6000] = tmp # Calls array_assign_subscript in mapping.c
*
* In the assignment the underlying data type, shape, strides, and
* data pointers are identical, but src != dst because they are separately
diff --git a/numpy/core/src/multiarray/array_assign_scalar.c b/numpy/core/src/multiarray/array_assign_scalar.c
index df7facad6..7c1b1f16a 100644
--- a/numpy/core/src/multiarray/array_assign_scalar.c
+++ b/numpy/core/src/multiarray/array_assign_scalar.c
@@ -72,7 +72,11 @@ raw_array_assign_scalar(int ndim, npy_intp *shape,
}
if (!needs_api) {
- NPY_BEGIN_THREADS;
+ npy_intp nitems = 1, i;
+ for (i = 0; i < ndim; i++) {
+ nitems *= shape_it[i];
+ }
+ NPY_BEGIN_THREADS_THRESHOLDED(nitems);
}
NPY_RAW_ITER_START(idim, ndim, coord, shape_it) {
@@ -82,9 +86,7 @@ raw_array_assign_scalar(int ndim, npy_intp *shape,
} NPY_RAW_ITER_ONE_NEXT(idim, ndim, coord,
shape_it, dst_data, dst_strides_it);
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
NPY_AUXDATA_FREE(transferdata);
@@ -145,7 +147,11 @@ raw_array_wheremasked_assign_scalar(int ndim, npy_intp *shape,
}
if (!needs_api) {
- NPY_BEGIN_THREADS;
+ npy_intp nitems = 1, i;
+ for (i = 0; i < ndim; i++) {
+ nitems *= shape_it[i];
+ }
+ NPY_BEGIN_THREADS_THRESHOLDED(nitems);
}
NPY_RAW_ITER_START(idim, ndim, coord, shape_it) {
@@ -157,9 +163,7 @@ raw_array_wheremasked_assign_scalar(int ndim, npy_intp *shape,
dst_data, dst_strides_it,
wheremask_data, wheremask_strides_it);
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
NPY_AUXDATA_FREE(transferdata);
@@ -234,10 +238,16 @@ PyArray_AssignRawScalar(PyArrayObject *dst,
}
else {
tmp_src_data = PyArray_malloc(PyArray_DESCR(dst)->elsize);
+ if (tmp_src_data == NULL) {
+ PyErr_NoMemory();
+ goto fail;
+ }
allocated_src_data = 1;
}
+
if (PyArray_CastRawArrays(1, src_data, tmp_src_data, 0, 0,
src_dtype, PyArray_DESCR(dst), 0) != NPY_SUCCEED) {
+ src_data = tmp_src_data;
goto fail;
}
diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c
index e3ac1e0d0..d92522a9f 100644
--- a/numpy/core/src/multiarray/arrayobject.c
+++ b/numpy/core/src/multiarray/arrayobject.c
@@ -50,6 +50,7 @@ maintainer email: oliphant.travis@ieee.org
#include "sequence.h"
#include "buffer.h"
#include "array_assign.h"
+#include "alloc.h"
/*NUMPY_API
Compute the size of an array (in number of items)
@@ -419,10 +420,11 @@ array_dealloc(PyArrayObject *self)
* self already...
*/
}
- PyDataMem_FREE(fa->data);
+ npy_free_cache(fa->data, PyArray_NBYTES(self));
}
- PyDimMem_FREE(fa->dimensions);
+ /* must match allocation in PyArray_NewFromDescr */
+ npy_free_cache_dim(fa->dimensions, 2 * fa->nd);
Py_DECREF(fa->descr);
Py_TYPE(self)->tp_free((PyObject *)self);
}
@@ -1269,11 +1271,12 @@ NPY_NO_EXPORT PyObject *
array_richcompare(PyArrayObject *self, PyObject *other, int cmp_op)
{
PyArrayObject *array_other;
+ PyObject *obj_self = (PyObject *)self;
PyObject *result = NULL;
switch (cmp_op) {
case Py_LT:
- if (needs_right_binop_forward(self, other, "__gt__", 0)) {
+ if (needs_right_binop_forward(obj_self, other, "__gt__", 0)) {
/* See discussion in number.c */
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
@@ -1282,7 +1285,7 @@ array_richcompare(PyArrayObject *self, PyObject *other, int cmp_op)
n_ops.less);
break;
case Py_LE:
- if (needs_right_binop_forward(self, other, "__ge__", 0)) {
+ if (needs_right_binop_forward(obj_self, other, "__ge__", 0)) {
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
@@ -1291,10 +1294,14 @@ array_richcompare(PyArrayObject *self, PyObject *other, int cmp_op)
break;
case Py_EQ:
if (other == Py_None) {
+ if (DEPRECATE_FUTUREWARNING("comparison to `None` will result in "
+ "an elementwise object comparison in the future.") < 0) {
+ return NULL;
+ }
Py_INCREF(Py_False);
return Py_False;
}
- if (needs_right_binop_forward(self, other, "__eq__", 0)) {
+ if (needs_right_binop_forward(obj_self, other, "__eq__", 0)) {
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
@@ -1324,16 +1331,16 @@ array_richcompare(PyArrayObject *self, PyObject *other, int cmp_op)
return Py_NotImplemented;
}
- _res = PyObject_RichCompareBool
- ((PyObject *)PyArray_DESCR(self),
- (PyObject *)PyArray_DESCR(array_other),
- Py_EQ);
- if (_res < 0) {
+ _res = PyArray_CanCastTypeTo(PyArray_DESCR(self),
+ PyArray_DESCR(array_other),
+ NPY_EQUIV_CASTING);
+ if (_res == 0) {
Py_DECREF(result);
Py_DECREF(array_other);
- return NULL;
+ Py_INCREF(Py_False);
+ return Py_False;
}
- if (_res) {
+ else {
Py_DECREF(result);
result = _void_compare(self, array_other, cmp_op);
}
@@ -1346,17 +1353,30 @@ array_richcompare(PyArrayObject *self, PyObject *other, int cmp_op)
* indicate that
*/
if (result == NULL) {
+ /*
+ * Comparisons should raise errors when element-wise comparison
+ * is not possible.
+ */
PyErr_Clear();
+ if (DEPRECATE("elementwise comparison failed; "
+ "this will raise the error in the future.") < 0) {
+ return NULL;
+ }
+
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
break;
case Py_NE:
if (other == Py_None) {
+ if (DEPRECATE_FUTUREWARNING("comparison to `None` will result in "
+ "an elementwise object comparison in the future.") < 0) {
+ return NULL;
+ }
Py_INCREF(Py_True);
return Py_True;
}
- if (needs_right_binop_forward(self, other, "__ne__", 0)) {
+ if (needs_right_binop_forward(obj_self, other, "__ne__", 0)) {
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
@@ -1385,16 +1405,16 @@ array_richcompare(PyArrayObject *self, PyObject *other, int cmp_op)
return Py_NotImplemented;
}
- _res = PyObject_RichCompareBool(
- (PyObject *)PyArray_DESCR(self),
- (PyObject *)PyArray_DESCR(array_other),
- Py_EQ);
- if (_res < 0) {
+ _res = PyArray_CanCastTypeTo(PyArray_DESCR(self),
+ PyArray_DESCR(array_other),
+ NPY_EQUIV_CASTING);
+ if (_res == 0) {
Py_DECREF(result);
Py_DECREF(array_other);
- return NULL;
+ Py_INCREF(Py_True);
+ return Py_True;
}
- if (_res) {
+ else {
Py_DECREF(result);
result = _void_compare(self, array_other, cmp_op);
Py_DECREF(array_other);
@@ -1403,13 +1423,22 @@ array_richcompare(PyArrayObject *self, PyObject *other, int cmp_op)
}
if (result == NULL) {
+ /*
+ * Comparisons should raise errors when element-wise comparison
+ * is not possible.
+ */
PyErr_Clear();
+ if (DEPRECATE("elementwise comparison failed; "
+ "this will raise the error in the future.") < 0) {
+ return NULL;
+ }
+
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
break;
case Py_GT:
- if (needs_right_binop_forward(self, other, "__lt__", 0)) {
+ if (needs_right_binop_forward(obj_self, other, "__lt__", 0)) {
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
@@ -1417,7 +1446,7 @@ array_richcompare(PyArrayObject *self, PyObject *other, int cmp_op)
n_ops.greater);
break;
case Py_GE:
- if (needs_right_binop_forward(self, other, "__le__", 0)) {
+ if (needs_right_binop_forward(obj_self, other, "__le__", 0)) {
Py_INCREF(Py_NotImplemented);
return Py_NotImplemented;
}
@@ -1434,7 +1463,11 @@ array_richcompare(PyArrayObject *self, PyObject *other, int cmp_op)
return result;
}
array_other = (PyArrayObject *)PyArray_FromObject(other,
- NPY_NOTYPE, 0, 0);
+ NPY_NOTYPE, 0, 0);
+ if (array_other == NULL) {
+ PyErr_Clear();
+ return result;
+ }
if (PyArray_ISSTRING(self) && PyArray_ISSTRING(array_other)) {
Py_DECREF(result);
result = _strings_richcompare(self, (PyArrayObject *)
@@ -1683,6 +1716,13 @@ array_alloc(PyTypeObject *type, Py_ssize_t NPY_UNUSED(nitems))
return obj;
}
+static void
+array_free(PyObject * v)
+{
+ /* avoid same deallocator as PyBaseObject, see gentype_free */
+ PyObject_Free(v);
+}
+
NPY_NO_EXPORT PyTypeObject PyArray_Type = {
#if defined(NPY_PY3K)
@@ -1737,9 +1777,9 @@ NPY_NO_EXPORT PyTypeObject PyArray_Type = {
0, /* tp_descr_set */
0, /* tp_dictoffset */
(initproc)0, /* tp_init */
- array_alloc, /* tp_alloc */
+ (allocfunc)array_alloc, /* tp_alloc */
(newfunc)array_new, /* tp_new */
- 0, /* tp_free */
+ (freefunc)array_free, /* tp_free */
0, /* tp_is_gc */
0, /* tp_bases */
0, /* tp_mro */
diff --git a/numpy/core/src/multiarray/arraytypes.c.src b/numpy/core/src/multiarray/arraytypes.c.src
index 1bfbf160d..8a0b1826b 100644
--- a/numpy/core/src/multiarray/arraytypes.c.src
+++ b/numpy/core/src/multiarray/arraytypes.c.src
@@ -18,6 +18,7 @@
#include "usertypes.h"
#include "_datetime.h"
#include "arrayobject.h"
+#include "alloc.h"
#include "numpyos.h"
@@ -105,6 +106,31 @@ MyPyLong_AsUnsigned@Type@ (PyObject *obj)
/**end repeat**/
+static npy_longlong
+npy_strtoll(const char *str, char **endptr, int base)
+{
+#if defined HAVE_STRTOLL
+ return strtoll(str, endptr, base);
+#elif defined _MSC_VER
+ return _strtoi64(str, endptr, base);
+#else
+ /* ok on 64 bit posix */
+ return PyOS_strtol(str, endptr, base);
+#endif
+}
+
+static npy_ulonglong
+npy_strtoull(const char *str, char **endptr, int base)
+{
+#if defined HAVE_STRTOULL
+ return strtoull(str, endptr, base);
+#elif defined _MSC_VER
+ return _strtoui64(str, endptr, base);
+#else
+ /* ok on 64 bit posix */
+ return PyOS_strtoul(str, endptr, base);
+#endif
+}
/*
*****************************************************************************
@@ -401,7 +427,7 @@ STRING_getitem(char *ip, PyArrayObject *ap)
int size = PyArray_DESCR(ap)->elsize;
ptr = ip + size - 1;
- while (*ptr-- == '\0' && size > 0) {
+ while (size > 0 && *ptr-- == '\0') {
size--;
}
return PyBytes_FromStringAndSize(ip,size);
@@ -519,6 +545,31 @@ OBJECT_setitem(PyObject *op, char *ov, PyArrayObject *ap)
/* VOID */
+/* unpack tuple of dtype->fields (descr, offset, title[not-needed]) */
+static int
+unpack_field(PyObject * value, PyArray_Descr ** descr, npy_intp * offset)
+{
+ PyObject * off;
+ if (PyTuple_GET_SIZE(value) < 2) {
+ return -1;
+ }
+ *descr = (PyArray_Descr *)PyTuple_GET_ITEM(value, 0);
+ off = PyTuple_GET_ITEM(value, 1);
+
+ if (PyInt_Check(off)) {
+ *offset = PyInt_AsSsize_t(off);
+ }
+ else if (PyLong_Check(off)) {
+ *offset = PyLong_AsSsize_t(off);
+ }
+ else {
+ return -1;
+ }
+
+ return 0;
+}
+
+
static PyObject *
VOID_getitem(char *ip, PyArrayObject *ap)
{
@@ -532,9 +583,7 @@ VOID_getitem(char *ip, PyArrayObject *ap)
PyObject *names;
int i, n;
PyObject *ret;
- PyObject *tup, *title;
- PyArray_Descr *new;
- int offset;
+ PyObject *tup;
int savedflags;
/* get the names from the fields dictionary*/
@@ -543,9 +592,11 @@ VOID_getitem(char *ip, PyArrayObject *ap)
ret = PyTuple_New(n);
savedflags = PyArray_FLAGS(ap);
for (i = 0; i < n; i++) {
+ npy_intp offset;
+ PyArray_Descr *new;
key = PyTuple_GET_ITEM(names, i);
tup = PyDict_GetItem(descr->fields, key);
- if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, &title)) {
+ if (unpack_field(tup, &new, &offset) < 0) {
Py_DECREF(ret);
((PyArrayObject_fields *)ap)->descr = descr;
return NULL;
@@ -662,9 +713,7 @@ VOID_setitem(PyObject *op, char *ip, PyArrayObject *ap)
PyObject *key;
PyObject *names;
int i, n;
- PyObject *tup, *title;
- PyArray_Descr *new;
- int offset;
+ PyObject *tup;
int savedflags;
res = -1;
@@ -678,9 +727,11 @@ VOID_setitem(PyObject *op, char *ip, PyArrayObject *ap)
}
savedflags = PyArray_FLAGS(ap);
for (i = 0; i < n; i++) {
+ PyArray_Descr *new;
+ npy_intp offset;
key = PyTuple_GET_ITEM(names, i);
tup = PyDict_GetItem(descr->fields, key);
- if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, &title)) {
+ if (unpack_field(tup, &new, &offset) < 0) {
((PyArrayObject_fields *)ap)->descr = descr;
return -1;
}
@@ -1506,8 +1557,10 @@ BOOL_scan(FILE *fp, npy_bool *ip, void *NPY_UNUSED(ignore),
* #type = npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int, npy_uint,
* npy_long, npy_ulong, npy_longlong, npy_ulonglong,
* npy_datetime, npy_timedelta#
- * #func = (l, ul)*5, l, l#
- * #btype = (npy_long, npy_ulong)*5, npy_long, npy_long#
+ * #func = (PyOS_strtol, PyOS_strtoul)*4, npy_strtoll, npy_strtoull,
+ * npy_strtoll*2#
+ * #btype = (npy_long, npy_ulong)*4, npy_longlong, npy_ulonglong,
+ * npy_longlong*2#
*/
static int
@fname@_fromstr(char *str, @type@ *ip, char **endptr,
@@ -1515,7 +1568,7 @@ static int
{
@btype@ result;
- result = PyOS_strto@func@(str, endptr, 10);
+ result = @func@(str, endptr, 10);
*ip = (@type@) result;
return 0;
}
@@ -1941,17 +1994,18 @@ VOID_copyswapn (char *dst, npy_intp dstride, char *src, npy_intp sstride,
return;
}
if (PyArray_HASFIELDS(arr)) {
- PyObject *key, *value, *title = NULL;
- PyArray_Descr *new, *descr;
- int offset;
+ PyObject *key, *value;
+ PyArray_Descr *descr;
Py_ssize_t pos = 0;
descr = PyArray_DESCR(arr);
while (PyDict_Next(descr->fields, &pos, &key, &value)) {
- if NPY_TITLE_KEY(key, value) {
+ npy_intp offset;
+ PyArray_Descr * new;
+ if (NPY_TITLE_KEY(key, value)) {
continue;
}
- if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) {
+ if (unpack_field(value, &new, &offset) < 0) {
((PyArrayObject_fields *)arr)->descr = descr;
return;
}
@@ -2009,17 +2063,18 @@ VOID_copyswap (char *dst, char *src, int swap, PyArrayObject *arr)
return;
}
if (PyArray_HASFIELDS(arr)) {
- PyObject *key, *value, *title = NULL;
- PyArray_Descr *new, *descr;
- int offset;
+ PyObject *key, *value;
+ PyArray_Descr *descr;
Py_ssize_t pos = 0;
descr = PyArray_DESCR(arr);
while (PyDict_Next(descr->fields, &pos, &key, &value)) {
- if NPY_TITLE_KEY(key, value) {
+ npy_intp offset;
+ PyArray_Descr * new;
+ if (NPY_TITLE_KEY(key, value)) {
continue;
}
- if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) {
+ if (unpack_field(value, &new, &offset) < 0) {
((PyArrayObject_fields *)arr)->descr = descr;
return;
}
@@ -2311,19 +2366,20 @@ VOID_nonzero (char *ip, PyArrayObject *ap)
npy_bool nonz = NPY_FALSE;
if (PyArray_HASFIELDS(ap)) {
- PyArray_Descr *descr, *new;
- PyObject *key, *value, *title;
- int savedflags, offset;
+ PyArray_Descr *descr;
+ PyObject *key, *value;
+ int savedflags;
Py_ssize_t pos = 0;
descr = PyArray_DESCR(ap);
savedflags = PyArray_FLAGS(ap);
while (PyDict_Next(descr->fields, &pos, &key, &value)) {
- if NPY_TITLE_KEY(key, value) {
+ PyArray_Descr * new;
+ npy_intp offset;
+ if (NPY_TITLE_KEY(key, value)) {
continue;
}
- if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset,
- &title)) {
+ if (unpack_field(value, &new, &offset) < 0) {
PyErr_Clear();
continue;
}
@@ -2618,11 +2674,11 @@ UNICODE_compare(npy_ucs4 *ip1, npy_ucs4 *ip2,
static int
VOID_compare(char *ip1, char *ip2, PyArrayObject *ap)
{
- PyArray_Descr *descr, *new;
+ PyArray_Descr *descr;
PyObject *names, *key;
- PyObject *tup, *title;
+ PyObject *tup;
char *nip1, *nip2;
- int i, offset, res = 0, swap=0;
+ int i, res = 0, swap=0;
if (!PyArray_HASFIELDS(ap)) {
return STRING_compare(ip1, ip2, ap);
@@ -2634,9 +2690,11 @@ VOID_compare(char *ip1, char *ip2, PyArrayObject *ap)
*/
names = descr->names;
for (i = 0; i < PyTuple_GET_SIZE(names); i++) {
+ PyArray_Descr * new;
+ npy_intp offset;
key = PyTuple_GET_ITEM(names, i);
tup = PyDict_GetItem(descr->fields, key);
- if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, &title)) {
+ if (unpack_field(tup, &new, &offset) < 0) {
goto finish;
}
/*
@@ -2648,9 +2706,9 @@ VOID_compare(char *ip1, char *ip2, PyArrayObject *ap)
nip1 = ip1 + offset;
nip2 = ip2 + offset;
if ((swap) || (new->alignment > 1)) {
- if ((swap) || (((npy_intp)(nip1) % new->alignment) != 0)) {
+ if ((swap) || (!npy_is_aligned(nip1, new->alignment))) {
/* create buffer and copy */
- nip1 = PyArray_malloc(new->elsize);
+ nip1 = npy_alloc_cache(new->elsize);
if (nip1 == NULL) {
goto finish;
}
@@ -2658,12 +2716,12 @@ VOID_compare(char *ip1, char *ip2, PyArrayObject *ap)
if (swap)
new->f->copyswap(nip1, NULL, swap, ap);
}
- if ((swap) || (((npy_intp)(nip2) % new->alignment) != 0)) {
+ if ((swap) || (!npy_is_aligned(nip2, new->alignment))) {
/* copy data to a buffer */
- nip2 = PyArray_malloc(new->elsize);
+ nip2 = npy_alloc_cache(new->elsize);
if (nip2 == NULL) {
if (nip1 != ip1 + offset) {
- PyArray_free(nip1);
+ npy_free_cache(nip1, new->elsize);
}
goto finish;
}
@@ -2675,10 +2733,10 @@ VOID_compare(char *ip1, char *ip2, PyArrayObject *ap)
res = new->f->compare(nip1, nip2, ap);
if ((swap) || (new->alignment > 1)) {
if (nip1 != ip1 + offset) {
- PyArray_free(nip1);
+ npy_free_cache(nip1, new->elsize);
}
if (nip2 != ip2 + offset) {
- PyArray_free(nip2);
+ npy_free_cache(nip2, new->elsize);
}
}
if (res != 0) {
@@ -2714,6 +2772,7 @@ finish:
* npy_half, npy_float, npy_double, npy_longdouble,
* npy_float, npy_double, npy_longdouble,
* npy_datetime, npy_timedelta#
+ * #isbool = 1, 0*19#
* #isfloat = 0*11, 1*7, 0*2#
* #isnan = nop*11, npy_half_isnan, npy_isnan*6, nop*2#
* #le = _LESS_THAN_OR_EQUAL*11, npy_half_le, _LESS_THAN_OR_EQUAL*8#
@@ -2744,6 +2803,12 @@ static int
return 0;
}
#endif
+#if @isbool@
+ if (mp) {
+ /* True encountered; it's maximal */
+ return 0;
+ }
+#endif
for (i = 1; i < n; i++) {
@incr@;
@@ -2772,6 +2837,12 @@ static int
break;
}
#endif
+#if @isbool@
+ if (mp) {
+ /* True encountered; it's maximal */
+ break;
+ }
+#endif
}
#endif
}
@@ -2794,6 +2865,7 @@ static int
* npy_half, npy_float, npy_double, npy_longdouble,
* npy_float, npy_double, npy_longdouble,
* npy_datetime, npy_timedelta#
+ * #isbool = 1, 0*19#
* #isfloat = 0*11, 1*7, 0*2#
* #isnan = nop*11, npy_half_isnan, npy_isnan*6, nop*2#
* #le = _LESS_THAN_OR_EQUAL*11, npy_half_le, _LESS_THAN_OR_EQUAL*8#
@@ -2824,6 +2896,12 @@ static int
return 0;
}
#endif
+#if @isbool@
+ if (!mp) {
+ /* False encountered; it's minimal */
+ return 0;
+ }
+#endif
for (i = 1; i < n; i++) {
@incr@;
@@ -2852,6 +2930,12 @@ static int
break;
}
#endif
+#if @isbool@
+ if (!mp) {
+ /* False encountered; it's minimal */
+ break;
+ }
+#endif
}
#endif
}
@@ -3501,16 +3585,23 @@ static int
NPY_CLIPMODE clipmode)
{
npy_intp i, j, k, tmp;
+ NPY_BEGIN_THREADS_DEF;
+
+ NPY_BEGIN_THREADS;
switch(clipmode) {
case NPY_RAISE:
for (i = 0; i < n_outer; i++) {
for (j = 0; j < m_middle; j++) {
tmp = indarray[j];
- /* We don't know what axis we're operating on, so don't report it in case of an error. */
- if (check_and_adjust_index(&tmp, nindarray, -1) < 0)
+ /*
+ * We don't know what axis we're operating on,
+ * so don't report it in case of an error.
+ */
+ if (check_and_adjust_index(&tmp, nindarray, -1, _save) < 0) {
return 1;
- if (nelem == 1) {
+ }
+ if (NPY_LIKELY(nelem == 1)) {
*dest++ = *(src + tmp);
}
else {
@@ -3536,7 +3627,7 @@ static int
tmp -= nindarray;
}
}
- if (nelem == 1) {
+ if (NPY_LIKELY(nelem == 1)) {
*dest++ = *(src+tmp);
}
else {
@@ -3558,7 +3649,7 @@ static int
else if (tmp >= nindarray) {
tmp = nindarray - 1;
}
- if (nelem == 1) {
+ if (NPY_LIKELY(nelem == 1)) {
*dest++ = *(src + tmp);
}
else {
@@ -3571,6 +3662,8 @@ static int
}
break;
}
+
+ NPY_END_THREADS;
return 0;
}
/**end repeat**/
@@ -3829,7 +3922,8 @@ NPY_NO_EXPORT PyArray_Descr @from@_Descr = {
/* elsize */
@num@ * sizeof(@fromtype@),
/* alignment */
- @num@ * _ALIGN(@fromtype@),
+ @num@ * _ALIGN(@fromtype@) > NPY_MAX_COPY_ALIGNMENT ?
+ NPY_MAX_COPY_ALIGNMENT : @num@ * _ALIGN(@fromtype@),
/* subarray */
NULL,
/* fields */
@@ -3950,7 +4044,7 @@ datetime_dtype_metadata_clone(NpyAuxData *data)
* Initializes the c_metadata field for the _builtin_descrs DATETIME
* and TIMEDELTA.
*/
-int
+static int
initialize_builtin_datetime_metadata(void)
{
PyArray_DatetimeDTypeMetaData *data1, *data2;
@@ -4171,7 +4265,8 @@ set_typeinfo(PyObject *dict)
#endif
NPY_@name@,
NPY_BITSOF_@name@,
- @num@ * _ALIGN(@type@),
+ @num@ * _ALIGN(@type@) > NPY_MAX_COPY_ALIGNMENT ?
+ NPY_MAX_COPY_ALIGNMENT : @num@ * _ALIGN(@type@),
(PyObject *) &Py@Name@ArrType_Type));
Py_DECREF(s);
diff --git a/numpy/core/src/multiarray/buffer.c b/numpy/core/src/multiarray/buffer.c
index e32bc76eb..ea1a885ed 100644
--- a/numpy/core/src/multiarray/buffer.c
+++ b/numpy/core/src/multiarray/buffer.c
@@ -444,7 +444,7 @@ static _buffer_info_t*
_buffer_info_new(PyArrayObject *arr)
{
_buffer_info_t *info;
- _tmp_string_t fmt = {0,0,0};
+ _tmp_string_t fmt = {NULL, 0, 0};
int k;
info = malloc(sizeof(_buffer_info_t));
@@ -454,6 +454,7 @@ _buffer_info_new(PyArrayObject *arr)
/* Fill in format */
if (_buffer_format_string(PyArray_DESCR(arr), &fmt, arr, NULL, NULL) != 0) {
+ free(fmt.s);
goto fail;
}
_append_char(&fmt, '\0');
@@ -804,18 +805,19 @@ _descriptor_from_pep3118_format(char *s)
if (*s == ':') {
in_name = !in_name;
*p = *s;
+ p++;
}
else if (in_name || !NumPyOS_ascii_isspace(*s)) {
*p = *s;
+ p++;
}
- ++p;
- ++s;
+ s++;
}
*p = '\0';
str = PyUString_FromStringAndSize(buf, strlen(buf));
- free(buf);
if (str == NULL) {
+ free(buf);
return NULL;
}
@@ -823,6 +825,7 @@ _descriptor_from_pep3118_format(char *s)
_numpy_internal = PyImport_ImportModule("numpy.core._internal");
if (_numpy_internal == NULL) {
Py_DECREF(str);
+ free(buf);
return NULL;
}
descr = PyObject_CallMethod(
@@ -832,14 +835,18 @@ _descriptor_from_pep3118_format(char *s)
if (descr == NULL) {
PyErr_Format(PyExc_ValueError,
"'%s' is not a valid PEP 3118 buffer format string", buf);
+ free(buf);
return NULL;
}
if (!PyArray_DescrCheck(descr)) {
PyErr_Format(PyExc_RuntimeError,
"internal error: numpy.core._internal._dtype_from_pep3118 "
"did not return a valid dtype, got %s", buf);
+ Py_DECREF(descr);
+ free(buf);
return NULL;
}
+ free(buf);
return (PyArray_Descr*)descr;
}
diff --git a/numpy/core/src/multiarray/common.c b/numpy/core/src/multiarray/common.c
index 87aecf41c..54b9e3c1a 100644
--- a/numpy/core/src/multiarray/common.c
+++ b/numpy/core/src/multiarray/common.c
@@ -205,6 +205,10 @@ PyArray_DTypeFromObjectHelper(PyObject *obj, int maxdims,
PyArray_Descr *dtype = NULL;
PyObject *ip;
Py_buffer buffer_view;
+ /* types for sequence handling */
+ PyObject ** objects;
+ PyObject * seq;
+ PyTypeObject * common_type;
/* Check if it's an ndarray */
if (PyArray_Check(obj)) {
@@ -514,31 +518,49 @@ PyArray_DTypeFromObjectHelper(PyObject *obj, int maxdims,
return 0;
}
- /* Recursive case */
- size = PySequence_Size(obj);
- if (size < 0) {
+ /* Recursive case, first check the sequence contains only one type */
+ seq = PySequence_Fast(obj, "Could not convert object to sequence");
+ if (seq == NULL) {
goto fail;
}
+ size = PySequence_Fast_GET_SIZE(seq);
+ objects = PySequence_Fast_ITEMS(seq);
+ common_type = size > 0 ? Py_TYPE(objects[0]) : NULL;
+ for (i = 1; i < size; ++i) {
+ if (Py_TYPE(objects[i]) != common_type) {
+ common_type = NULL;
+ break;
+ }
+ }
+
+ /* all types are the same and scalar, one recursive call is enough */
+ if (common_type != NULL && !string_type &&
+ (common_type == &PyFloat_Type ||
+/* TODO: we could add longs if we add a range check */
+#if !defined(NPY_PY3K)
+ common_type == &PyInt_Type ||
+#endif
+ common_type == &PyBool_Type ||
+ common_type == &PyComplex_Type)) {
+ size = 1;
+ }
+
/* Recursive call for each sequence item */
for (i = 0; i < size; ++i) {
- int res;
- ip = PySequence_GetItem(obj, i);
- if (ip == NULL) {
- goto fail;
- }
- res = PyArray_DTypeFromObjectHelper(ip, maxdims - 1,
- out_dtype, string_type);
+ int res = PyArray_DTypeFromObjectHelper(objects[i], maxdims - 1,
+ out_dtype, string_type);
if (res < 0) {
- Py_DECREF(ip);
+ Py_DECREF(seq);
goto fail;
}
else if (res > 0) {
- Py_DECREF(ip);
+ Py_DECREF(seq);
return res;
}
- Py_DECREF(ip);
}
+ Py_DECREF(seq);
+
return 0;
@@ -618,7 +640,7 @@ index2ptr(PyArrayObject *mp, npy_intp i)
return NULL;
}
dim0 = PyArray_DIMS(mp)[0];
- if (check_and_adjust_index(&i, dim0, 0) < 0)
+ if (check_and_adjust_index(&i, dim0, 0, NULL) < 0)
return NULL;
if (i == 0) {
return PyArray_DATA(mp);
@@ -650,14 +672,12 @@ _IsAligned(PyArrayObject *ap)
{
unsigned int i;
npy_uintp aligned;
- const unsigned int alignment = PyArray_DESCR(ap)->alignment;
+ npy_uintp alignment = PyArray_DESCR(ap)->alignment;
- /* The special casing for STRING and VOID types was removed
- * in accordance with http://projects.scipy.org/numpy/ticket/1227
- * It used to be that IsAligned always returned True for these
- * types, which is indeed the case when they are created using
- * PyArray_DescrConverter(), but not necessarily when using
- * PyArray_DescrAlignConverter(). */
+ /* alignment 1 types should have a efficient alignment for copy loops */
+ if (PyArray_ISFLEXIBLE(ap) || PyArray_ISSTRING(ap)) {
+ alignment = NPY_MAX_COPY_ALIGNMENT;
+ }
if (alignment == 1) {
return 1;
@@ -761,24 +781,62 @@ offset_bounds_from_strides(const int itemsize, const int nd,
}
-NPY_NO_EXPORT int
-_is_basic_python_type(PyObject * obj)
+/**
+ * Convert an array shape to a string such as "(1, 2)".
+ *
+ * @param Dimensionality of the shape
+ * @param npy_intp pointer to shape array
+ * @param String to append after the shape `(1, 2)%s`.
+ *
+ * @return Python unicode string
+ */
+NPY_NO_EXPORT PyObject *
+convert_shape_to_string(npy_intp n, npy_intp *vals, char *ending)
{
- if (obj == Py_None ||
- /* Basic number types */
-#if !defined(NPY_PY3K)
- PyInt_CheckExact(obj) ||
-#endif
- PyLong_CheckExact(obj) ||
- PyFloat_CheckExact(obj) ||
- PyComplex_CheckExact(obj) ||
- /* Basic sequence types */
- PyList_CheckExact(obj) ||
- PyTuple_CheckExact(obj) ||
- PyDict_CheckExact(obj) ||
- PyAnySet_CheckExact(obj)) {
- return 1;
+ npy_intp i;
+ PyObject *ret, *tmp;
+
+ /*
+ * Negative dimension indicates "newaxis", which can
+ * be discarded for printing if it's a leading dimension.
+ * Find the first non-"newaxis" dimension.
+ */
+ for (i = 0; i < n && vals[i] < 0; i++);
+
+ if (i == n) {
+ return PyUString_FromFormat("()%s", ending);
+ }
+ else {
+ ret = PyUString_FromFormat("(%" NPY_INTP_FMT, vals[i++]);
+ if (ret == NULL) {
+ return NULL;
+ }
}
- return 0;
+ for (; i < n; ++i) {
+ if (vals[i] < 0) {
+ tmp = PyUString_FromString(",newaxis");
+ }
+ else {
+ tmp = PyUString_FromFormat(",%" NPY_INTP_FMT, vals[i]);
+ }
+ if (tmp == NULL) {
+ Py_DECREF(ret);
+ return NULL;
+ }
+
+ PyUString_ConcatAndDel(&ret, tmp);
+ if (ret == NULL) {
+ return NULL;
+ }
+ }
+
+ if (i == 1) {
+ tmp = PyUString_FromFormat(",)%s", ending);
+ }
+ else {
+ tmp = PyUString_FromFormat(")%s", ending);
+ }
+ PyUString_ConcatAndDel(&ret, tmp);
+ return ret;
}
diff --git a/numpy/core/src/multiarray/common.h b/numpy/core/src/multiarray/common.h
index e2a3b006d..6b49d6b4c 100644
--- a/numpy/core/src/multiarray/common.h
+++ b/numpy/core/src/multiarray/common.h
@@ -2,9 +2,21 @@
#define _NPY_PRIVATE_COMMON_H_
#include <numpy/npy_common.h>
#include <numpy/npy_cpu.h>
+#include <numpy/ndarraytypes.h>
#define error_converting(x) (((x) == -1) && PyErr_Occurred())
+#ifdef NPY_ALLOW_THREADS
+#define NPY_BEGIN_THREADS_NDITER(iter) \
+ do { \
+ if (!NpyIter_IterationNeedsAPI(iter)) { \
+ NPY_BEGIN_THREADS_THRESHOLDED(NpyIter_GetIterSize(iter)); \
+ } \
+ } while(0)
+#else
+#define NPY_BEGIN_THREADS_NDITER(iter)
+#endif
+
/*
* Recursively examines the object to determine an appropriate dtype
* to use for converting to an ndarray.
@@ -52,14 +64,14 @@ _IsAligned(PyArrayObject *ap);
NPY_NO_EXPORT npy_bool
_IsWriteable(PyArrayObject *ap);
-NPY_NO_EXPORT int
-_is_basic_python_type(PyObject * obj);
-
NPY_NO_EXPORT void
offset_bounds_from_strides(const int itemsize, const int nd,
const npy_intp *dims, const npy_intp *strides,
npy_intp *lower_offset, npy_intp *upper_offset);
+NPY_NO_EXPORT PyObject *
+convert_shape_to_string(npy_intp n, npy_intp *vals, char *ending);
+
/*
* Returns -1 and sets an exception if *index is an invalid index for
@@ -67,12 +79,17 @@ offset_bounds_from_strides(const int itemsize, const int nd,
* 0 <= *index < max_item, and returns 0.
* 'axis' should be the array axis that is being indexed over, if known. If
* unknown, use -1.
+ * If _save is NULL it is assumed the GIL is taken
+ * If _save is not NULL it is assumed the GIL is not taken and it
+ * is acquired in the case of an error
*/
static NPY_INLINE int
-check_and_adjust_index(npy_intp *index, npy_intp max_item, int axis)
+check_and_adjust_index(npy_intp *index, npy_intp max_item, int axis,
+ PyThreadState * _save)
{
/* Check that index is valid, taking into account negative indices */
- if ((*index < -max_item) || (*index >= max_item)) {
+ if (NPY_UNLIKELY((*index < -max_item) || (*index >= max_item))) {
+ NPY_END_THREADS;
/* Try to be as clear as possible about what went wrong. */
if (axis >= 0) {
PyErr_Format(PyExc_IndexError,
@@ -82,8 +99,7 @@ check_and_adjust_index(npy_intp *index, npy_intp max_item, int axis)
} else {
PyErr_Format(PyExc_IndexError,
"index %"NPY_INTP_FMT" is out of bounds "
- "for size %"NPY_INTP_FMT,
- *index, max_item);
+ "for size %"NPY_INTP_FMT, *index, max_item);
}
return -1;
}
@@ -164,6 +180,34 @@ npy_memchr(char * haystack, char needle,
return p;
}
+static NPY_INLINE int
+_is_basic_python_type(PyObject * obj)
+{
+ if (obj == Py_None ||
+ PyBool_Check(obj) ||
+ /* Basic number types */
+#if !defined(NPY_PY3K)
+ PyInt_CheckExact(obj) ||
+ PyString_CheckExact(obj) ||
+#endif
+ PyLong_CheckExact(obj) ||
+ PyFloat_CheckExact(obj) ||
+ PyComplex_CheckExact(obj) ||
+ /* Basic sequence types */
+ PyList_CheckExact(obj) ||
+ PyTuple_CheckExact(obj) ||
+ PyDict_CheckExact(obj) ||
+ PyAnySet_CheckExact(obj) ||
+ PyUnicode_CheckExact(obj) ||
+ PyBytes_CheckExact(obj) ||
+ PySlice_Check(obj)) {
+
+ return 1;
+ }
+
+ return 0;
+}
+
#include "ucsnarrow.h"
#endif
diff --git a/numpy/core/src/multiarray/conversion_utils.c b/numpy/core/src/multiarray/conversion_utils.c
index 1f56f942c..b84dff864 100644
--- a/numpy/core/src/multiarray/conversion_utils.c
+++ b/numpy/core/src/multiarray/conversion_utils.c
@@ -395,6 +395,9 @@ PyArray_SortkindConverter(PyObject *obj, NPY_SORTKIND *sortkind)
if (PyUnicode_Check(obj)) {
obj = tmp = PyUnicode_AsASCIIString(obj);
+ if (obj == NULL) {
+ return NPY_FAIL;
+ }
}
*sortkind = NPY_QUICKSORT;
@@ -440,6 +443,9 @@ PyArray_SelectkindConverter(PyObject *obj, NPY_SELECTKIND *selectkind)
if (PyUnicode_Check(obj)) {
obj = tmp = PyUnicode_AsASCIIString(obj);
+ if (obj == NULL) {
+ return NPY_FAIL;
+ }
}
*selectkind = NPY_INTROSELECT;
@@ -591,6 +597,9 @@ PyArray_ClipmodeConverter(PyObject *object, NPY_CLIPMODE *val)
PyObject *tmp;
int ret;
tmp = PyUnicode_AsASCIIString(object);
+ if (tmp == NULL) {
+ return NPY_FAIL;
+ }
ret = PyArray_ClipmodeConverter(tmp, val);
Py_DECREF(tmp);
return ret;
@@ -774,7 +783,7 @@ PyArray_PyIntAsIntp(PyObject *o)
* an exact check, since otherwise __index__ is used.
*/
#if !defined(NPY_PY3K)
- if PyInt_CheckExact(o) {
+ if (PyInt_CheckExact(o)) {
#if (NPY_SIZEOF_LONG <= NPY_SIZEOF_INTP)
/* No overflow is possible, so we can just return */
return PyInt_AS_LONG(o);
@@ -785,7 +794,7 @@ PyArray_PyIntAsIntp(PyObject *o)
}
else
#endif
- if PyLong_CheckExact(o) {
+ if (PyLong_CheckExact(o)) {
#if (NPY_SIZEOF_LONG < NPY_SIZEOF_INTP)
long_value = PyLong_AsLongLong(o);
#else
diff --git a/numpy/core/src/multiarray/convert.c b/numpy/core/src/multiarray/convert.c
index 62b9034c2..b610343cc 100644
--- a/numpy/core/src/multiarray/convert.c
+++ b/numpy/core/src/multiarray/convert.c
@@ -88,9 +88,8 @@ PyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format)
if (n3 == 0) {
/* binary data */
if (PyDataType_FLAGCHK(PyArray_DESCR(self), NPY_LIST_PICKLE)) {
- PyErr_SetString(PyExc_ValueError, "cannot write " \
- "object arrays to a file in " \
- "binary mode");
+ PyErr_SetString(PyExc_IOError,
+ "cannot write object arrays to a file in binary mode");
return -1;
}
@@ -126,7 +125,7 @@ PyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format)
#endif
NPY_END_ALLOW_THREADS;
if (n < size) {
- PyErr_Format(PyExc_ValueError,
+ PyErr_Format(PyExc_IOError,
"%ld requested and %ld written",
(long) size, (long) n);
return -1;
@@ -143,9 +142,8 @@ PyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format)
1, fp) < 1) {
NPY_END_THREADS;
PyErr_Format(PyExc_IOError,
- "problem writing element"\
- " %"NPY_INTP_FMT" to file",
- it->index);
+ "problem writing element %" NPY_INTP_FMT
+ " to file", it->index);
Py_DECREF(it);
return -1;
}
@@ -218,7 +216,7 @@ PyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format)
#endif
if (n < n2) {
PyErr_Format(PyExc_IOError,
- "problem writing element %"NPY_INTP_FMT\
+ "problem writing element %" NPY_INTP_FMT
" to file", it->index);
Py_DECREF(strobj);
Py_DECREF(it);
@@ -228,8 +226,7 @@ PyArray_ToFile(PyArrayObject *self, FILE *fp, char *sep, char *format)
if (it->index != it->size-1) {
if (fwrite(sep, 1, n3, fp) < n3) {
PyErr_Format(PyExc_IOError,
- "problem writing "\
- "separator to file");
+ "problem writing separator to file");
Py_DECREF(strobj);
Py_DECREF(it);
return -1;
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c
index 4f0202ffb..1db3bfe85 100644
--- a/numpy/core/src/multiarray/convert_datatype.c
+++ b/numpy/core/src/multiarray/convert_datatype.c
@@ -10,6 +10,7 @@
#include "npy_config.h"
#include "npy_pycompat.h"
+#include "numpy/npy_math.h"
#include "common.h"
#include "scalartypes.h"
@@ -19,11 +20,23 @@
#include "_datetime.h"
#include "datetime_strings.h"
+
+/*
+ * Required length of string when converting from unsigned integer type.
+ * Array index is integer size in bytes.
+ * - 3 chars needed for cast to max value of 255 or 127
+ * - 5 chars needed for cast to max value of 65535 or 32767
+ * - 10 chars needed for cast to max value of 4294967295 or 2147483647
+ * - 20 chars needed for cast to max value of 18446744073709551615
+ * or 9223372036854775807
+ */
+NPY_NO_EXPORT npy_intp REQUIRED_STR_LEN[] = {0, 3, 5, 10, 10, 20, 20, 20, 20};
+
/*NUMPY_API
* For backward compatibility
*
* Cast an array using typecode structure.
- * steals reference to at --- cannot be NULL
+ * steals reference to dtype --- cannot be NULL
*
* This function always makes a copy of arr, even if the dtype
* doesn't change.
@@ -140,7 +153,6 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
PyArray_Descr *dtype = NULL;
int ndim = 0;
npy_intp dims[NPY_MAXDIMS];
- PyObject *list = NULL;
int result;
if (*flex_dtype == NULL) {
@@ -166,7 +178,7 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
flex_type_num == NPY_VOID) {
(*flex_dtype)->elsize = data_dtype->elsize;
}
- else {
+ else if (flex_type_num == NPY_STRING || flex_type_num == NPY_UNICODE) {
npy_intp size = 8;
/*
@@ -176,37 +188,35 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
*/
switch (data_dtype->type_num) {
case NPY_BOOL:
- size = 8;
- break;
case NPY_UBYTE:
- size = 8;
- break;
case NPY_BYTE:
- size = 8;
- break;
case NPY_USHORT:
- size = 8;
- break;
case NPY_SHORT:
- size = 8;
- break;
case NPY_UINT:
- size = 16;
- break;
case NPY_INT:
- size = 16;
- break;
case NPY_ULONG:
- size = 24;
- break;
case NPY_LONG:
- size = 24;
- break;
case NPY_ULONGLONG:
- size = 24;
- break;
case NPY_LONGLONG:
- size = 24;
+ if (data_dtype->kind == 'b') {
+ /* 5 chars needed for cast to 'True' or 'False' */
+ size = 5;
+ }
+ else if (data_dtype->elsize > 8 ||
+ data_dtype->elsize < 0) {
+ /*
+ * Element size should never be greater than 8 or
+ * less than 0 for integer type, but just in case...
+ */
+ break;
+ }
+ else if (data_dtype->kind == 'u') {
+ size = REQUIRED_STR_LEN[data_dtype->elsize];
+ }
+ else if (data_dtype->kind == 'i') {
+ /* Add character for sign symbol */
+ size = REQUIRED_STR_LEN[data_dtype->elsize] + 1;
+ }
break;
case NPY_HALF:
case NPY_FLOAT:
@@ -224,12 +234,14 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
if ((flex_type_num == NPY_STRING ||
flex_type_num == NPY_UNICODE) &&
data_obj != NULL) {
+ PyObject *list;
+
if (PyArray_CheckScalar(data_obj)) {
- PyObject *scalar = PyArray_ToList(data_obj);
- if (scalar != NULL) {
- PyObject *s = PyObject_Str(scalar);
+ list = PyArray_ToList((PyArrayObject *)data_obj);
+ if (list != NULL) {
+ PyObject *s = PyObject_Str(list);
if (s == NULL) {
- Py_DECREF(scalar);
+ Py_DECREF(list);
Py_DECREF(*flex_dtype);
*flex_dtype = NULL;
return;
@@ -238,7 +250,7 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
size = PyObject_Length(s);
Py_DECREF(s);
}
- Py_DECREF(scalar);
+ Py_DECREF(list);
}
}
else if (PyArray_Check(data_obj)) {
@@ -247,7 +259,7 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
* GetArrayParamsFromObject won't iterate over
* array.
*/
- list = PyArray_ToList(data_obj);
+ list = PyArray_ToList((PyArrayObject *)data_obj);
result = PyArray_GetArrayParamsFromObject(
list,
*flex_dtype,
@@ -305,6 +317,16 @@ PyArray_AdaptFlexibleDType(PyObject *data_obj, PyArray_Descr *data_dtype,
(*flex_dtype)->elsize = size * 4;
}
}
+ else {
+ /*
+ * We should never get here, but just in case someone adds
+ * a new flex dtype...
+ */
+ PyErr_SetString(PyExc_TypeError,
+ "don't know how to adapt flex dtype");
+ *flex_dtype = NULL;
+ return;
+ }
}
/* Flexible type with generic time unit that adapts */
else if (flex_type_num == NPY_DATETIME ||
@@ -489,10 +511,53 @@ PyArray_CanCastTo(PyArray_Descr *from, PyArray_Descr *to)
NPY_SAFE_CASTING);
}
/*
- * TODO: If to_type_num is STRING or unicode
+ * If to_type_num is STRING or unicode
* see if the length is long enough to hold the
* stringified value of the object.
*/
+ else if (to_type_num == NPY_STRING || to_type_num == NPY_UNICODE) {
+ /*
+ * Boolean value cast to string type is 5 characters max
+ * for string 'False'.
+ */
+ int char_size = 1;
+ if (to_type_num == NPY_UNICODE) {
+ char_size = 4;
+ }
+
+ ret = 0;
+ if (to->elsize == 0) {
+ ret = 1;
+ }
+ /*
+ * Need at least 5 characters to convert from boolean
+ * to 'True' or 'False'.
+ */
+ else if (from->kind == 'b' && to->elsize >= 5 * char_size) {
+ ret = 1;
+ }
+ else if (from->kind == 'u') {
+ /* Guard against unexpected integer size */
+ if (from->elsize > 8 || from->elsize < 0) {
+ ret = 0;
+ }
+ else if (to->elsize >=
+ REQUIRED_STR_LEN[from->elsize] * char_size) {
+ ret = 1;
+ }
+ }
+ else if (from->kind == 'i') {
+ /* Guard against unexpected integer size */
+ if (from->elsize > 8 || from->elsize < 0) {
+ ret = 0;
+ }
+ /* Extra character needed for sign */
+ else if (to->elsize >=
+ (REQUIRED_STR_LEN[from->elsize] + 1) * char_size) {
+ ret = 1;
+ }
+ }
+ }
}
return ret;
}
@@ -577,7 +642,13 @@ NPY_NO_EXPORT npy_bool
PyArray_CanCastTypeTo(PyArray_Descr *from, PyArray_Descr *to,
NPY_CASTING casting)
{
- if (casting == NPY_INTERNAL_UNSAFE_CASTING_BUT_WARN_UNLESS_SAME_KIND) {
+ /* fast path for basic types */
+ if (NPY_LIKELY(from->type_num < NPY_OBJECT) &&
+ NPY_LIKELY(from->type_num == to->type_num) &&
+ NPY_LIKELY(from->byteorder == to->byteorder)) {
+ return 1;
+ }
+ else if (casting == NPY_INTERNAL_UNSAFE_CASTING_BUT_WARN_UNLESS_SAME_KIND) {
npy_bool unsafe_ok, same_kind_ok;
unsafe_ok = PyArray_CanCastTypeTo_impl(from, to, NPY_UNSAFE_CASTING);
same_kind_ok = PyArray_CanCastTypeTo_impl(from, to,
@@ -1017,12 +1088,25 @@ PyArray_PromoteTypes(PyArray_Descr *type1, PyArray_Descr *type2)
switch (type_num1) {
/* BOOL can convert to anything except datetime/void */
case NPY_BOOL:
- if (type_num2 != NPY_DATETIME && type_num2 != NPY_VOID) {
+ if (type_num2 == NPY_STRING || type_num2 == NPY_UNICODE) {
+ int char_size = 1;
+ if (type_num2 == NPY_UNICODE) {
+ char_size = 4;
+ }
+ if (type2->elsize < 5 * char_size) {
+ PyArray_Descr *ret = NULL;
+ PyArray_Descr *temp = PyArray_DescrNew(type2);
+ ret = ensure_dtype_nbo(temp);
+ ret->elsize = 5 * char_size;
+ Py_DECREF(temp);
+ return ret;
+ }
return ensure_dtype_nbo(type2);
}
- else {
- break;
+ else if (type_num2 != NPY_DATETIME && type_num2 != NPY_VOID) {
+ return ensure_dtype_nbo(type2);
}
+ break;
/* For strings and unicodes, take the larger size */
case NPY_STRING:
if (type_num2 == NPY_STRING) {
@@ -1048,8 +1132,20 @@ PyArray_PromoteTypes(PyArray_Descr *type1, PyArray_Descr *type2)
}
/* Allow NUMBER -> STRING */
else if (PyTypeNum_ISNUMBER(type_num2)) {
- return ensure_dtype_nbo(type1);
+ PyArray_Descr *ret = NULL;
+ PyArray_Descr *temp = PyArray_DescrNew(type1);
+ temp->elsize = 0;
+ PyArray_AdaptFlexibleDType(NULL, type2, &temp);
+ if (temp->elsize > type1->elsize) {
+ ret = ensure_dtype_nbo(temp);
+ }
+ else {
+ ret = ensure_dtype_nbo(type1);
+ }
+ Py_DECREF(temp);
+ return ret;
}
+ break;
case NPY_UNICODE:
if (type_num2 == NPY_UNICODE) {
if (type1->elsize > type2->elsize) {
@@ -1074,7 +1170,18 @@ PyArray_PromoteTypes(PyArray_Descr *type1, PyArray_Descr *type2)
}
/* Allow NUMBER -> UNICODE */
else if (PyTypeNum_ISNUMBER(type_num2)) {
- return ensure_dtype_nbo(type1);
+ PyArray_Descr *ret = NULL;
+ PyArray_Descr *temp = PyArray_DescrNew(type1);
+ temp->elsize = 0;
+ PyArray_AdaptFlexibleDType(NULL, type2, &temp);
+ if (temp->elsize > type1->elsize) {
+ ret = ensure_dtype_nbo(temp);
+ }
+ else {
+ ret = ensure_dtype_nbo(type1);
+ }
+ Py_DECREF(temp);
+ return ret;
}
break;
case NPY_DATETIME:
@@ -1088,22 +1195,58 @@ PyArray_PromoteTypes(PyArray_Descr *type1, PyArray_Descr *type2)
switch (type_num2) {
/* BOOL can convert to almost anything */
case NPY_BOOL:
- if (type_num1 != NPY_DATETIME && type_num1 != NPY_TIMEDELTA &&
+ if (type_num2 == NPY_STRING || type_num2 == NPY_UNICODE) {
+ int char_size = 1;
+ if (type_num2 == NPY_UNICODE) {
+ char_size = 4;
+ }
+ if (type2->elsize < 5 * char_size) {
+ PyArray_Descr *ret = NULL;
+ PyArray_Descr *temp = PyArray_DescrNew(type2);
+ ret = ensure_dtype_nbo(temp);
+ ret->elsize = 5 * char_size;
+ Py_DECREF(temp);
+ return ret;
+ }
+ return ensure_dtype_nbo(type2);
+ }
+ else if (type_num1 != NPY_DATETIME && type_num1 != NPY_TIMEDELTA &&
type_num1 != NPY_VOID) {
return ensure_dtype_nbo(type1);
}
- else {
- break;
- }
+ break;
case NPY_STRING:
/* Allow NUMBER -> STRING */
if (PyTypeNum_ISNUMBER(type_num1)) {
- return ensure_dtype_nbo(type2);
+ PyArray_Descr *ret = NULL;
+ PyArray_Descr *temp = PyArray_DescrNew(type2);
+ temp->elsize = 0;
+ PyArray_AdaptFlexibleDType(NULL, type1, &temp);
+ if (temp->elsize > type2->elsize) {
+ ret = ensure_dtype_nbo(temp);
+ }
+ else {
+ ret = ensure_dtype_nbo(type2);
+ }
+ Py_DECREF(temp);
+ return ret;
}
+ break;
case NPY_UNICODE:
/* Allow NUMBER -> UNICODE */
if (PyTypeNum_ISNUMBER(type_num1)) {
- return ensure_dtype_nbo(type2);
+ PyArray_Descr *ret = NULL;
+ PyArray_Descr *temp = PyArray_DescrNew(type2);
+ temp->elsize = 0;
+ PyArray_AdaptFlexibleDType(NULL, type1, &temp);
+ if (temp->elsize > type2->elsize) {
+ ret = ensure_dtype_nbo(temp);
+ }
+ else {
+ ret = ensure_dtype_nbo(type2);
+ }
+ Py_DECREF(temp);
+ return ret;
}
break;
case NPY_TIMEDELTA:
@@ -1339,14 +1482,14 @@ static int min_scalar_type_num(char *valueptr, int type_num,
}
case NPY_FLOAT: {
float value = *(float *)valueptr;
- if (value > -65000 && value < 65000) {
+ if ((value > -65000 && value < 65000) || !npy_isfinite(value)) {
return NPY_HALF;
}
break;
}
case NPY_DOUBLE: {
double value = *(double *)valueptr;
- if (value > -65000 && value < 65000) {
+ if ((value > -65000 && value < 65000) || !npy_isfinite(value)) {
return NPY_HALF;
}
else if (value > -3.4e38 && value < 3.4e38) {
@@ -1356,7 +1499,7 @@ static int min_scalar_type_num(char *valueptr, int type_num,
}
case NPY_LONGDOUBLE: {
npy_longdouble value = *(npy_longdouble *)valueptr;
- if (value > -65000 && value < 65000) {
+ if ((value > -65000 && value < 65000) || !npy_isfinite(value)) {
return NPY_HALF;
}
else if (value > -3.4e38 && value < 3.4e38) {
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c
index a47b8625a..3da2dfae7 100644
--- a/numpy/core/src/multiarray/ctors.c
+++ b/numpy/core/src/multiarray/ctors.c
@@ -26,6 +26,8 @@
#include "array_assign.h"
#include "mapping.h" /* for array_item_asarray */
#include "scalarmathmodule.h" /* for npy_mul_with_overflow_intp */
+#include "alloc.h"
+#include <assert.h>
/*
* Reading from a file or a string.
@@ -316,7 +318,7 @@ _strided_byte_swap(void *p, npy_intp stride, npy_intp n, int size)
case 1: /* no byteswap necessary */
break;
case 4:
- if (npy_is_aligned(p, sizeof(npy_uint32))) {
+ if (npy_is_aligned((void*)((npy_intp)p | stride), sizeof(npy_uint32))) {
for (a = (char*)p; n > 0; n--, a += stride) {
npy_uint32 * a_ = (npy_uint32 *)a;
*a_ = npy_bswap4(*a_);
@@ -329,7 +331,7 @@ _strided_byte_swap(void *p, npy_intp stride, npy_intp n, int size)
}
break;
case 8:
- if (npy_is_aligned(p, sizeof(npy_uint64))) {
+ if (npy_is_aligned((void*)((npy_intp)p | stride), sizeof(npy_uint64))) {
for (a = (char*)p; n > 0; n--, a += stride) {
npy_uint64 * a_ = (npy_uint64 *)a;
*a_ = npy_bswap8(*a_);
@@ -342,7 +344,7 @@ _strided_byte_swap(void *p, npy_intp stride, npy_intp n, int size)
}
break;
case 2:
- if (npy_is_aligned(p, sizeof(npy_uint16))) {
+ if (npy_is_aligned((void*)((npy_intp)p | stride), sizeof(npy_uint16))) {
for (a = (char*)p; n > 0; n--, a += stride) {
npy_uint16 * a_ = (npy_uint16 *)a;
*a_ = npy_bswap2(*a_);
@@ -503,15 +505,18 @@ setArrayFromSequence(PyArrayObject *a, PyObject *s,
}
/* Copy element by element */
else {
+ PyObject * seq;
+ seq = PySequence_Fast(s, "Could not convert object to sequence");
+ if (seq == NULL) {
+ goto fail;
+ }
for (i = 0; i < slen; i++) {
- PyObject *o = PySequence_GetItem(s, i);
- if (o == NULL) {
- goto fail;
- }
+ PyObject * o = PySequence_Fast_GET_ITEM(seq, i);
if ((PyArray_NDIM(a) - dim) > 1) {
PyArrayObject * tmp =
(PyArrayObject *)array_item_asarray(dst, i);
if (tmp == NULL) {
+ Py_DECREF(seq);
goto fail;
}
@@ -522,11 +527,12 @@ setArrayFromSequence(PyArrayObject *a, PyObject *s,
char * b = (PyArray_BYTES(dst) + i * PyArray_STRIDES(dst)[0]);
res = PyArray_DESCR(dst)->f->setitem(o, b, dst);
}
- Py_DECREF(o);
if (res < 0) {
+ Py_DECREF(seq);
goto fail;
}
}
+ Py_DECREF(seq);
}
Py_DECREF(s);
@@ -640,6 +646,7 @@ discover_dimensions(PyObject *obj, int *maxndim, npy_intp *d, int check_it,
PyObject *e;
int r, n, i;
Py_buffer buffer_view;
+ PyObject * seq;
if (*maxndim == 0) {
return 0;
@@ -782,75 +789,63 @@ discover_dimensions(PyObject *obj, int *maxndim, npy_intp *d, int check_it,
}
}
- n = PySequence_Size(obj);
-
- if (n < 0) {
- return -1;
+ seq = PySequence_Fast(obj, "Could not convert object to sequence");
+ if (seq == NULL) {
+ /*
+ * PySequence_Check detects whether an old type object is a
+ * sequence by the presence of the __getitem__ attribute, and
+ * for new type objects that aren't dictionaries by the
+ * presence of the __len__ attribute as well. In either case it
+ * is possible to have an object that tests as a sequence but
+ * doesn't behave as a sequence and consequently, the
+ * PySequence_GetItem call can fail. When that happens and the
+ * object looks like a dictionary, we truncate the dimensions
+ * and set the object creation flag, otherwise we pass the
+ * error back up the call chain.
+ */
+ if (PyErr_ExceptionMatches(PyExc_KeyError)) {
+ PyErr_Clear();
+ *maxndim = 0;
+ *out_is_object = 1;
+ return 0;
+ }
+ else {
+ return -1;
+ }
}
+ n = PySequence_Fast_GET_SIZE(seq);
d[0] = n;
/* 1-dimensional sequence */
if (n == 0 || *maxndim == 1) {
*maxndim = 1;
+ Py_DECREF(seq);
return 0;
}
else {
npy_intp dtmp[NPY_MAXDIMS];
int j, maxndim_m1 = *maxndim - 1;
+ e = PySequence_Fast_GET_ITEM(seq, 0);
- if ((e = PySequence_GetItem(obj, 0)) == NULL) {
- /*
- * PySequence_Check detects whether an old type object is a
- * sequence by the presence of the __getitem__ attribute, and
- * for new type objects that aren't dictionaries by the
- * presence of the __len__ attribute as well. In either case it
- * is possible to have an object that tests as a sequence but
- * doesn't behave as a sequence and consequently, the
- * PySequence_GetItem call can fail. When that happens and the
- * object looks like a dictionary, we truncate the dimensions
- * and set the object creation flag, otherwise we pass the
- * error back up the call chain.
- */
- if (PyErr_ExceptionMatches(PyExc_KeyError)) {
- PyErr_Clear();
- *maxndim = 0;
- *out_is_object = 1;
- return 0;
- }
- else {
- return -1;
- }
- }
r = discover_dimensions(e, &maxndim_m1, d + 1, check_it,
stop_at_string, stop_at_tuple,
out_is_object);
- Py_DECREF(e);
if (r < 0) {
+ Py_DECREF(seq);
return r;
}
/* For the dimension truncation check below */
*maxndim = maxndim_m1 + 1;
for (i = 1; i < n; ++i) {
+ e = PySequence_Fast_GET_ITEM(seq, i);
/* Get the dimensions of the first item */
- if ((e = PySequence_GetItem(obj, i)) == NULL) {
- /* see comment above */
- if (PyErr_ExceptionMatches(PyExc_KeyError)) {
- PyErr_Clear();
- *maxndim = 0;
- *out_is_object = 1;
- return 0;
- }
- else {
- return -1;
- }
- }
r = discover_dimensions(e, &maxndim_m1, dtmp, check_it,
stop_at_string, stop_at_tuple,
out_is_object);
- Py_DECREF(e);
if (r < 0) {
+ Py_DECREF(seq);
return r;
}
@@ -872,6 +867,8 @@ discover_dimensions(PyObject *obj, int *maxndim, npy_intp *d, int check_it,
}
}
+ Py_DECREF(seq);
+
return 0;
}
@@ -995,7 +992,7 @@ PyArray_NewFromDescr_int(PyTypeObject *subtype, PyArray_Descr *descr, int nd,
fa->weakreflist = (PyObject *)NULL;
if (nd > 0) {
- fa->dimensions = PyDimMem_NEW(3*nd);
+ fa->dimensions = npy_alloc_cache_dim(2 * nd);
if (fa->dimensions == NULL) {
PyErr_NoMemory();
goto fail;
@@ -1035,10 +1032,10 @@ PyArray_NewFromDescr_int(PyTypeObject *subtype, PyArray_Descr *descr, int nd,
* which could also be sub-fields of a VOID array
*/
if (zeroed || PyDataType_FLAGCHK(descr, NPY_NEEDS_INIT)) {
- data = PyDataMem_NEW_ZEROED(sd, 1);
+ data = npy_alloc_cache_zero(sd);
}
else {
- data = PyDataMem_NEW(sd);
+ data = npy_alloc_cache(sd);
}
if (data == NULL) {
PyErr_NoMemory();
@@ -1057,12 +1054,12 @@ PyArray_NewFromDescr_int(PyTypeObject *subtype, PyArray_Descr *descr, int nd,
fa->data = data;
/*
- * If the strides were provided to the function, need to
- * update the flags to get the right CONTIGUOUS, ALIGN properties
+ * always update the flags to get the right CONTIGUOUS, ALIGN properties
+ * not owned data and input strides may not be aligned and on some
+ * platforms (debian sparc) malloc does not provide enough alignment for
+ * long double types
*/
- if (strides != NULL) {
- PyArray_UpdateFlags((PyArrayObject *)fa, NPY_ARRAY_UPDATE_ALL);
- }
+ PyArray_UpdateFlags((PyArrayObject *)fa, NPY_ARRAY_UPDATE_ALL);
/*
* call the __array_finalize__
@@ -1312,7 +1309,9 @@ _array_from_buffer_3118(PyObject *obj, PyObject **out)
else {
d = view->len;
for (k = 0; k < nd; ++k) {
- d /= view->shape[k];
+ if (view->shape[k] != 0) {
+ d /= view->shape[k];
+ }
strides[k] = d;
}
}
@@ -1335,8 +1334,11 @@ _array_from_buffer_3118(PyObject *obj, PyObject **out)
r = PyArray_NewFromDescr(&PyArray_Type, descr,
nd, shape, strides, view->buf,
flags, NULL);
- if (PyArray_SetBaseObject((PyArrayObject *)r, memoryview) < 0) {
- goto fail;
+ if (r == NULL ||
+ PyArray_SetBaseObject((PyArrayObject *)r, memoryview) < 0) {
+ Py_XDECREF(r);
+ Py_DECREF(memoryview);
+ return -1;
}
PyArray_UpdateFlags((PyArrayObject *)r, NPY_ARRAY_UPDATE_ALL);
@@ -1382,7 +1384,7 @@ fail:
* npy_intp dims[NPY_MAXDIMS];
*
* if (PyArray_GetArrayParamsFromObject(op, NULL, 1, &dtype,
- * &ndim, &dims, &arr, NULL) < 0) {
+ * &ndim, dims, &arr, NULL) < 0) {
* return NULL;
* }
* if (arr == NULL) {
@@ -1839,7 +1841,7 @@ PyArray_CheckFromAny(PyObject *op, PyArray_Descr *descr, int min_depth,
else if (descr && !PyArray_ISNBO(descr->byteorder)) {
PyArray_DESCR_REPLACE(descr);
}
- if (descr) {
+ if (descr && descr->byteorder != NPY_IGNORE) {
descr->byteorder = NPY_NATIVE;
}
}
@@ -2632,9 +2634,7 @@ PyArray_CopyAsFlat(PyArrayObject *dst, PyArrayObject *src, NPY_ORDER order)
}
}
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
NPY_AUXDATA_FREE(transferdata);
NpyIter_Deallocate(dst_iter);
@@ -2842,6 +2842,7 @@ PyArray_Arange(double start, double stop, double step, int type_num)
PyArray_ArrFuncs *funcs;
PyObject *obj;
int ret;
+ NPY_BEGIN_THREADS_DEF;
if (_safe_ceil_to_intp((stop - start)/step, &length)) {
PyErr_SetString(PyExc_OverflowError,
@@ -2889,7 +2890,9 @@ PyArray_Arange(double start, double stop, double step, int type_num)
Py_DECREF(range);
return NULL;
}
+ NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(range));
funcs->fill(PyArray_DATA(range), length, range);
+ NPY_END_THREADS;
if (PyErr_Occurred()) {
goto fail;
}
@@ -2986,6 +2989,7 @@ PyArray_ArangeObj(PyObject *start, PyObject *stop, PyObject *step, PyArray_Descr
npy_intp length;
PyArray_Descr *native = NULL;
int swap;
+ NPY_BEGIN_THREADS_DEF;
/* Datetime arange is handled specially */
if ((dtype != NULL && (dtype->type_num == NPY_DATETIME ||
@@ -3102,7 +3106,9 @@ PyArray_ArangeObj(PyObject *start, PyObject *stop, PyObject *step, PyArray_Descr
Py_DECREF(range);
goto fail;
}
+ NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(range));
funcs->fill(PyArray_DATA(range), length, range);
+ NPY_END_THREADS;
if (PyErr_Occurred()) {
goto fail;
}
@@ -3132,18 +3138,18 @@ static PyArrayObject *
array_fromfile_binary(FILE *fp, PyArray_Descr *dtype, npy_intp num, size_t *nread)
{
PyArrayObject *r;
- npy_intp start, numbytes;
+ npy_off_t start, numbytes;
if (num < 0) {
int fail = 0;
- start = (npy_intp) npy_ftell(fp);
+ start = npy_ftell(fp);
if (start < 0) {
fail = 1;
}
if (npy_fseek(fp, 0, SEEK_END) < 0) {
fail = 1;
}
- numbytes = (npy_intp) npy_ftell(fp);
+ numbytes = npy_ftell(fp);
if (numbytes < 0) {
fail = 1;
}
diff --git a/numpy/core/src/multiarray/datetime.c b/numpy/core/src/multiarray/datetime.c
index 5c32c519a..272127f00 100644
--- a/numpy/core/src/multiarray/datetime.c
+++ b/numpy/core/src/multiarray/datetime.c
@@ -1193,7 +1193,7 @@ get_datetime_conversion_factor(PyArray_DatetimeMetaData *src_meta,
}
/* If something overflowed, make both num and denom 0 */
- if (denom == 0) {
+ if (denom == 0 || num == 0) {
PyErr_Format(PyExc_OverflowError,
"Integer overflow while computing the conversion "
"factor between NumPy datetime units %s and %s",
diff --git a/numpy/core/src/multiarray/datetime_busdaycal.c b/numpy/core/src/multiarray/datetime_busdaycal.c
index 67ab5284c..91ba24c97 100644
--- a/numpy/core/src/multiarray/datetime_busdaycal.c
+++ b/numpy/core/src/multiarray/datetime_busdaycal.c
@@ -158,12 +158,10 @@ invalid_weekmask_string:
}
else {
int i;
- PyObject *f;
for (i = 0; i < 7; ++i) {
long val;
-
- f = PySequence_GetItem(obj, i);
+ PyObject *f = PySequence_GetItem(obj, i);
if (f == NULL) {
Py_DECREF(obj);
return 0;
@@ -171,6 +169,7 @@ invalid_weekmask_string:
val = PyInt_AsLong(f);
if (val == -1 && PyErr_Occurred()) {
+ Py_DECREF(f);
Py_DECREF(obj);
return 0;
}
@@ -184,9 +183,11 @@ invalid_weekmask_string:
PyErr_SetString(PyExc_ValueError,
"A business day weekmask array must have all "
"1's and 0's");
+ Py_DECREF(f);
Py_DECREF(obj);
return 0;
}
+ Py_DECREF(f);
}
goto finish;
diff --git a/numpy/core/src/multiarray/datetime_strings.c b/numpy/core/src/multiarray/datetime_strings.c
index e74da0384..54587cb5c 100644
--- a/numpy/core/src/multiarray/datetime_strings.c
+++ b/numpy/core/src/multiarray/datetime_strings.c
@@ -1554,6 +1554,9 @@ array_datetime_as_string(PyObject *NPY_UNUSED(self), PyObject *args,
op[0] = (PyArrayObject *)PyArray_FromAny(arr_in,
NULL, 0, 0, 0, NULL);
+ if (op[0] == NULL) {
+ goto fail;
+ }
if (PyArray_DESCR(op[0])->type_num != NPY_DATETIME) {
PyErr_SetString(PyExc_TypeError,
"input must have type NumPy datetime");
diff --git a/numpy/core/src/multiarray/descriptor.c b/numpy/core/src/multiarray/descriptor.c
index 10d4023d5..8b55c9fbd 100644
--- a/numpy/core/src/multiarray/descriptor.c
+++ b/numpy/core/src/multiarray/descriptor.c
@@ -63,7 +63,7 @@ _arraydescr_fromctypes(PyObject *obj)
/* derived type */
PyObject *newtup;
PyArray_Descr *derived;
- newtup = Py_BuildValue("NO", newdescr, length);
+ newtup = Py_BuildValue("NN", newdescr, length);
ret = PyArray_DescrConverter(newtup, &derived);
Py_DECREF(newtup);
if (ret == NPY_SUCCEED) {
@@ -286,6 +286,8 @@ _convert_from_tuple(PyObject *obj)
*/
PyArray_Dims shape = {NULL, -1};
PyArray_Descr *newdescr;
+ npy_intp items;
+ int i;
if (!(PyArray_IntpConverter(val, &shape)) || (shape.len > NPY_MAXDIMS)) {
PyDimMem_FREE(shape.ptr);
@@ -310,28 +312,75 @@ _convert_from_tuple(PyObject *obj)
PyDimMem_FREE(shape.ptr);
goto fail;
}
- newdescr->elsize = type->elsize;
- newdescr->elsize *= PyArray_MultiplyList(shape.ptr, shape.len);
- PyDimMem_FREE(shape.ptr);
+
+ /* validate and set shape */
+ for (i=0; i < shape.len; i++) {
+ if (shape.ptr[i] < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid shape in fixed-type tuple: "
+ "dimension smaller then zero.");
+ PyDimMem_FREE(shape.ptr);
+ goto fail;
+ }
+ if (shape.ptr[i] > NPY_MAX_INT) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid shape in fixed-type tuple: "
+ "dimension does not fit into a C int.");
+ PyDimMem_FREE(shape.ptr);
+ goto fail;
+ }
+ }
+ items = PyArray_OverflowMultiplyList(shape.ptr, shape.len);
+ if ((items < 0) || (items > (NPY_MAX_INT / type->elsize))) {
+ PyErr_SetString(PyExc_ValueError,
+ "invalid shape in fixed-type tuple: dtype size in "
+ "bytes must fit into a C int.");
+ PyDimMem_FREE(shape.ptr);
+ goto fail;
+ }
+ newdescr->elsize = type->elsize * items;
+ if (newdescr->elsize == -1) {
+ PyDimMem_FREE(shape.ptr);
+ goto fail;
+ }
+
newdescr->subarray = PyArray_malloc(sizeof(PyArray_ArrayDescr));
+ if (newdescr->subarray == NULL) {
+ Py_DECREF(newdescr);
+ PyErr_NoMemory();
+ goto fail;
+ }
newdescr->flags = type->flags;
+ newdescr->alignment = type->alignment;
newdescr->subarray->base = type;
type = NULL;
Py_XDECREF(newdescr->fields);
Py_XDECREF(newdescr->names);
newdescr->fields = NULL;
newdescr->names = NULL;
- /* Force subarray->shape to always be a tuple */
- if (PyTuple_Check(val)) {
- Py_INCREF(val);
- newdescr->subarray->shape = val;
- } else {
- newdescr->subarray->shape = Py_BuildValue("(O)", val);
- if (newdescr->subarray->shape == NULL) {
- Py_DECREF(newdescr);
+
+ /*
+ * Create a new subarray->shape tuple (it can be an arbitrary
+ * sequence of integer like objects, neither of which is safe.
+ */
+ newdescr->subarray->shape = PyTuple_New(shape.len);
+ if (newdescr->subarray->shape == NULL) {
+ PyDimMem_FREE(shape.ptr);
+ goto fail;
+ }
+ for (i=0; i < shape.len; i++) {
+ PyTuple_SET_ITEM(newdescr->subarray->shape, i,
+ PyInt_FromLong((long)shape.ptr[i]));
+
+ if (PyTuple_GET_ITEM(newdescr->subarray->shape, i) == NULL) {
+ Py_DECREF(newdescr->subarray->shape);
+ newdescr->subarray->shape = NULL;
+ PyDimMem_FREE(shape.ptr);
goto fail;
}
}
+
+ PyDimMem_FREE(shape.ptr);
type = newdescr;
}
return type;
@@ -361,7 +410,8 @@ _convert_from_array_descr(PyObject *obj, int align)
PyObject *nameslist;
PyArray_Descr *new;
PyArray_Descr *conv;
- char dtypeflags = 0;
+ /* Types with fields need the Python C API for field access */
+ char dtypeflags = NPY_NEEDS_PYAPI;
int maxalign = 0;
n = PyList_GET_SIZE(obj);
@@ -550,7 +600,8 @@ _convert_from_list(PyObject *obj, int align)
PyObject *nameslist = NULL;
int ret;
int maxalign = 0;
- char dtypeflags = 0;
+ /* Types with fields need the Python C API for field access */
+ char dtypeflags = NPY_NEEDS_PYAPI;
n = PyList_GET_SIZE(obj);
/*
@@ -657,6 +708,7 @@ _convert_from_commastring(PyObject *obj, int align)
if (!PyList_Check(listobj) || PyList_GET_SIZE(listobj) < 1) {
PyErr_SetString(PyExc_RuntimeError,
"_commastring is not returning a list with len >= 1");
+ Py_DECREF(listobj);
return NULL;
}
if (PyList_GET_SIZE(listobj) == 1) {
@@ -885,7 +937,8 @@ _convert_from_dict(PyObject *obj, int align)
int n, i;
int totalsize, itemsize;
int maxalign = 0;
- char dtypeflags = 0;
+ /* Types with fields need the Python C API for field access */
+ char dtypeflags = NPY_NEEDS_PYAPI;
int has_out_of_order_fields = 0;
fields = PyDict_New();
@@ -1528,6 +1581,10 @@ PyArray_DescrNew(PyArray_Descr *base)
Py_XINCREF(newdescr->names);
if (newdescr->subarray) {
newdescr->subarray = PyArray_malloc(sizeof(PyArray_ArrayDescr));
+ if (newdescr->subarray == NULL) {
+ Py_DECREF(newdescr);
+ return (PyArray_Descr *)PyErr_NoMemory();
+ }
memcpy(newdescr->subarray, base->subarray, sizeof(PyArray_ArrayDescr));
Py_INCREF(newdescr->subarray->shape);
Py_INCREF(newdescr->subarray->base);
@@ -1641,12 +1698,14 @@ arraydescr_protocol_typestr_get(PyArray_Descr *self)
static PyObject *
arraydescr_typename_get(PyArray_Descr *self)
{
- int len;
+ static const char np_prefix[] = "numpy.";
+ const int np_prefix_len = sizeof(np_prefix) - 1;
PyTypeObject *typeobj = self->typeobj;
PyObject *res;
char *s;
- /* fixme: not reentrant */
- static int prefix_len = 0;
+ int len;
+ int prefix_len;
+ int suffix_len;
if (PyTypeNum_ISUSERDEF(self->type_num)) {
s = strrchr(typeobj->tp_name, '.');
@@ -1659,14 +1718,31 @@ arraydescr_typename_get(PyArray_Descr *self)
return res;
}
else {
- if (prefix_len == 0) {
- prefix_len = strlen("numpy.");
- }
+ /*
+ * NumPy type or subclass
+ *
+ * res is derived from typeobj->tp_name with the following rules:
+ * - if starts with "numpy.", that prefix is removed
+ * - if ends with "_", that suffix is removed
+ */
len = strlen(typeobj->tp_name);
- if (*(typeobj->tp_name + (len-1)) == '_') {
- len -= 1;
+
+ if (! strncmp(typeobj->tp_name, np_prefix, np_prefix_len)) {
+ prefix_len = np_prefix_len;
+ }
+ else {
+ prefix_len = 0;
}
+
+ if (typeobj->tp_name[len - 1] == '_') {
+ suffix_len = 1;
+ }
+ else {
+ suffix_len = 0;
+ }
+
len -= prefix_len;
+ len -= suffix_len;
res = PyUString_FromStringAndSize(typeobj->tp_name+prefix_len, len);
}
if (PyTypeNum_ISFLEXIBLE(self->type_num) && self->elsize != 0) {
@@ -2677,7 +2753,7 @@ PyArray_DescrNewByteorder(PyArray_Descr *self, char newendian)
if (endian != NPY_IGNORE) {
if (newendian == NPY_SWAP) {
/* swap byteorder */
- if PyArray_ISNBO(endian) {
+ if (PyArray_ISNBO(endian)) {
endian = NPY_OPPBYTE;
}
else {
diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c
index 3bd362c24..7a7379ad5 100644
--- a/numpy/core/src/multiarray/dtype_transfer.c
+++ b/numpy/core/src/multiarray/dtype_transfer.c
@@ -151,7 +151,7 @@ typedef struct {
} _strided_zero_pad_data;
/* zero-padded data copy function */
-NpyAuxData *_strided_zero_pad_data_clone(NpyAuxData *data)
+static NpyAuxData *_strided_zero_pad_data_clone(NpyAuxData *data)
{
_strided_zero_pad_data *newdata =
(_strided_zero_pad_data *)PyArray_malloc(
@@ -258,7 +258,7 @@ typedef struct {
} _align_wrap_data;
/* transfer data free function */
-void _align_wrap_data_free(NpyAuxData *data)
+static void _align_wrap_data_free(NpyAuxData *data)
{
_align_wrap_data *d = (_align_wrap_data *)data;
NPY_AUXDATA_FREE(d->wrappeddata);
@@ -268,7 +268,7 @@ void _align_wrap_data_free(NpyAuxData *data)
}
/* transfer data copy function */
-NpyAuxData *_align_wrap_data_clone(NpyAuxData *data)
+static NpyAuxData *_align_wrap_data_clone(NpyAuxData *data)
{
_align_wrap_data *d = (_align_wrap_data *)data;
_align_wrap_data *newdata;
@@ -485,7 +485,7 @@ typedef struct {
} _wrap_copy_swap_data;
/* wrap copy swap data free function */
-void _wrap_copy_swap_data_free(NpyAuxData *data)
+static void _wrap_copy_swap_data_free(NpyAuxData *data)
{
_wrap_copy_swap_data *d = (_wrap_copy_swap_data *)data;
Py_DECREF(d->arr);
@@ -493,7 +493,7 @@ void _wrap_copy_swap_data_free(NpyAuxData *data)
}
/* wrap copy swap data copy function */
-NpyAuxData *_wrap_copy_swap_data_clone(NpyAuxData *data)
+static NpyAuxData *_wrap_copy_swap_data_clone(NpyAuxData *data)
{
_wrap_copy_swap_data *newdata =
(_wrap_copy_swap_data *)PyArray_malloc(sizeof(_wrap_copy_swap_data));
@@ -572,7 +572,7 @@ typedef struct {
} _strided_cast_data;
/* strided cast data free function */
-void _strided_cast_data_free(NpyAuxData *data)
+static void _strided_cast_data_free(NpyAuxData *data)
{
_strided_cast_data *d = (_strided_cast_data *)data;
Py_DECREF(d->aip);
@@ -581,7 +581,7 @@ void _strided_cast_data_free(NpyAuxData *data)
}
/* strided cast data copy function */
-NpyAuxData *_strided_cast_data_clone(NpyAuxData *data)
+static NpyAuxData *_strided_cast_data_clone(NpyAuxData *data)
{
_strided_cast_data *newdata =
(_strided_cast_data *)PyArray_malloc(sizeof(_strided_cast_data));
@@ -716,7 +716,7 @@ typedef struct {
} _strided_datetime_cast_data;
/* strided datetime cast data free function */
-void _strided_datetime_cast_data_free(NpyAuxData *data)
+static void _strided_datetime_cast_data_free(NpyAuxData *data)
{
_strided_datetime_cast_data *d = (_strided_datetime_cast_data *)data;
PyArray_free(d->tmp_buffer);
@@ -724,7 +724,7 @@ void _strided_datetime_cast_data_free(NpyAuxData *data)
}
/* strided datetime cast data copy function */
-NpyAuxData *_strided_datetime_cast_data_clone(NpyAuxData *data)
+static NpyAuxData *_strided_datetime_cast_data_clone(NpyAuxData *data)
{
_strided_datetime_cast_data *newdata =
(_strided_datetime_cast_data *)PyArray_malloc(
@@ -1547,7 +1547,7 @@ typedef struct {
} _one_to_n_data;
/* transfer data free function */
-void _one_to_n_data_free(NpyAuxData *data)
+static void _one_to_n_data_free(NpyAuxData *data)
{
_one_to_n_data *d = (_one_to_n_data *)data;
NPY_AUXDATA_FREE(d->data);
@@ -1556,7 +1556,7 @@ void _one_to_n_data_free(NpyAuxData *data)
}
/* transfer data copy function */
-NpyAuxData *_one_to_n_data_clone(NpyAuxData *data)
+static NpyAuxData *_one_to_n_data_clone(NpyAuxData *data)
{
_one_to_n_data *d = (_one_to_n_data *)data;
_one_to_n_data *newdata;
@@ -1750,7 +1750,7 @@ typedef struct {
} _n_to_n_data;
/* transfer data free function */
-void _n_to_n_data_free(NpyAuxData *data)
+static void _n_to_n_data_free(NpyAuxData *data)
{
_n_to_n_data *d = (_n_to_n_data *)data;
NPY_AUXDATA_FREE(d->data);
@@ -1758,7 +1758,7 @@ void _n_to_n_data_free(NpyAuxData *data)
}
/* transfer data copy function */
-NpyAuxData *_n_to_n_data_clone(NpyAuxData *data)
+static NpyAuxData *_n_to_n_data_clone(NpyAuxData *data)
{
_n_to_n_data *d = (_n_to_n_data *)data;
_n_to_n_data *newdata;
@@ -1929,7 +1929,7 @@ typedef struct {
} _subarray_broadcast_data;
/* transfer data free function */
-void _subarray_broadcast_data_free(NpyAuxData *data)
+static void _subarray_broadcast_data_free(NpyAuxData *data)
{
_subarray_broadcast_data *d = (_subarray_broadcast_data *)data;
NPY_AUXDATA_FREE(d->data);
@@ -1939,7 +1939,7 @@ void _subarray_broadcast_data_free(NpyAuxData *data)
}
/* transfer data copy function */
-NpyAuxData *_subarray_broadcast_data_clone( NpyAuxData *data)
+static NpyAuxData *_subarray_broadcast_data_clone( NpyAuxData *data)
{
_subarray_broadcast_data *d = (_subarray_broadcast_data *)data;
_subarray_broadcast_data *newdata;
@@ -2381,7 +2381,7 @@ typedef struct {
} _field_transfer_data;
/* transfer data free function */
-void _field_transfer_data_free(NpyAuxData *data)
+static void _field_transfer_data_free(NpyAuxData *data)
{
_field_transfer_data *d = (_field_transfer_data *)data;
npy_intp i, field_count;
@@ -2397,7 +2397,7 @@ void _field_transfer_data_free(NpyAuxData *data)
}
/* transfer data copy function */
-NpyAuxData *_field_transfer_data_clone(NpyAuxData *data)
+static NpyAuxData *_field_transfer_data_clone(NpyAuxData *data)
{
_field_transfer_data *d = (_field_transfer_data *)data;
_field_transfer_data *newdata;
@@ -2997,7 +2997,7 @@ typedef struct {
} _masked_wrapper_transfer_data;
/* transfer data free function */
-void _masked_wrapper_transfer_data_free(NpyAuxData *data)
+static void _masked_wrapper_transfer_data_free(NpyAuxData *data)
{
_masked_wrapper_transfer_data *d = (_masked_wrapper_transfer_data *)data;
NPY_AUXDATA_FREE(d->transferdata);
@@ -3006,7 +3006,7 @@ void _masked_wrapper_transfer_data_free(NpyAuxData *data)
}
/* transfer data copy function */
-NpyAuxData *_masked_wrapper_transfer_data_clone(NpyAuxData *data)
+static NpyAuxData *_masked_wrapper_transfer_data_clone(NpyAuxData *data)
{
_masked_wrapper_transfer_data *d = (_masked_wrapper_transfer_data *)data;
_masked_wrapper_transfer_data *newdata;
@@ -3040,7 +3040,7 @@ NpyAuxData *_masked_wrapper_transfer_data_clone(NpyAuxData *data)
return (NpyAuxData *)newdata;
}
-void _strided_masked_wrapper_decsrcref_transfer_function(
+static void _strided_masked_wrapper_decsrcref_transfer_function(
char *dst, npy_intp dst_stride,
char *src, npy_intp src_stride,
npy_bool *mask, npy_intp mask_stride,
@@ -3060,14 +3060,16 @@ void _strided_masked_wrapper_decsrcref_transfer_function(
while (N > 0) {
/* Skip masked values, still calling decsrcref for move_references */
- mask = npy_memchr((char *)mask, 0, mask_stride, N, &subloopsize, 1);
+ mask = (npy_bool*)npy_memchr((char *)mask, 0, mask_stride, N,
+ &subloopsize, 1);
decsrcref_stransfer(NULL, 0, src, src_stride,
subloopsize, src_itemsize, decsrcref_transferdata);
dst += subloopsize * dst_stride;
src += subloopsize * src_stride;
N -= subloopsize;
/* Process unmasked values */
- mask = npy_memchr((char *)mask, 0, mask_stride, N, &subloopsize, 0);
+ mask = (npy_bool*)npy_memchr((char *)mask, 0, mask_stride, N,
+ &subloopsize, 0);
unmasked_stransfer(dst, dst_stride, src, src_stride,
subloopsize, src_itemsize, unmasked_transferdata);
dst += subloopsize * dst_stride;
@@ -3076,7 +3078,7 @@ void _strided_masked_wrapper_decsrcref_transfer_function(
}
}
-void _strided_masked_wrapper_transfer_function(
+static void _strided_masked_wrapper_transfer_function(
char *dst, npy_intp dst_stride,
char *src, npy_intp src_stride,
npy_bool *mask, npy_intp mask_stride,
@@ -3095,12 +3097,14 @@ void _strided_masked_wrapper_transfer_function(
while (N > 0) {
/* Skip masked values */
- mask = npy_memchr((char *)mask, 0, mask_stride, N, &subloopsize, 1);
+ mask = (npy_bool*)npy_memchr((char *)mask, 0, mask_stride, N,
+ &subloopsize, 1);
dst += subloopsize * dst_stride;
src += subloopsize * src_stride;
N -= subloopsize;
/* Process unmasked values */
- mask = npy_memchr((char *)mask, 0, mask_stride, N, &subloopsize, 0);
+ mask = (npy_bool*)npy_memchr((char *)mask, 0, mask_stride, N,
+ &subloopsize, 0);
unmasked_stransfer(dst, dst_stride, src, src_stride,
subloopsize, src_itemsize, unmasked_transferdata);
dst += subloopsize * dst_stride;
@@ -3168,7 +3172,7 @@ typedef struct {
} _dst_memset_zero_data;
/* zero-padded data copy function */
-NpyAuxData *_dst_memset_zero_data_clone(NpyAuxData *data)
+static NpyAuxData *_dst_memset_zero_data_clone(NpyAuxData *data)
{
_dst_memset_zero_data *newdata =
(_dst_memset_zero_data *)PyArray_malloc(
diff --git a/numpy/core/src/multiarray/einsum.c.src b/numpy/core/src/multiarray/einsum.c.src
index 7a94c9305..b3148f573 100644
--- a/numpy/core/src/multiarray/einsum.c.src
+++ b/numpy/core/src/multiarray/einsum.c.src
@@ -22,6 +22,7 @@
#include <ctype.h>
#include "convert.h"
+#include "common.h"
#ifdef NPY_HAVE_SSE_INTRINSICS
#define EINSUM_USE_SSE1 1
@@ -64,13 +65,6 @@
#endif
/**********************************************/
-typedef enum {
- BROADCAST_NONE,
- BROADCAST_LEFT,
- BROADCAST_RIGHT,
- BROADCAST_MIDDLE
-} EINSUM_BROADCAST;
-
/**begin repeat
* #name = byte, short, int, long, longlong,
* ubyte, ushort, uint, ulong, ulonglong,
@@ -1802,11 +1796,10 @@ parse_operand_subscripts(char *subscripts, int length,
char *out_label_counts,
int *out_min_label,
int *out_max_label,
- int *out_num_labels,
- EINSUM_BROADCAST *out_broadcast)
+ int *out_num_labels)
{
int i, idim, ndim_left, label;
- int left_labels = 0, right_labels = 0, ellipsis = 0;
+ int ellipsis = 0;
/* Process the labels from the end until the ellipsis */
idim = ndim-1;
@@ -1828,7 +1821,6 @@ parse_operand_subscripts(char *subscripts, int length,
(*out_num_labels)++;
}
out_label_counts[label]++;
- right_labels = 1;
}
else {
PyErr_Format(PyExc_ValueError,
@@ -1897,7 +1889,6 @@ parse_operand_subscripts(char *subscripts, int length,
(*out_num_labels)++;
}
out_label_counts[label]++;
- left_labels = 1;
}
else {
PyErr_Format(PyExc_ValueError,
@@ -1947,19 +1938,6 @@ parse_operand_subscripts(char *subscripts, int length,
}
}
- if (!ellipsis) {
- *out_broadcast = BROADCAST_NONE;
- }
- else if (left_labels && right_labels) {
- *out_broadcast = BROADCAST_MIDDLE;
- }
- else if (!left_labels) {
- *out_broadcast = BROADCAST_RIGHT;
- }
- else {
- *out_broadcast = BROADCAST_LEFT;
- }
-
return 1;
}
@@ -1972,11 +1950,10 @@ static int
parse_output_subscripts(char *subscripts, int length,
int ndim_broadcast,
const char *label_counts,
- char *out_labels,
- EINSUM_BROADCAST *out_broadcast)
+ char *out_labels)
{
int i, nlabels, label, idim, ndim, ndim_left;
- int left_labels = 0, right_labels = 0, ellipsis = 0;
+ int ellipsis = 0;
/* Count the labels, making sure they're all unique and valid */
nlabels = 0;
@@ -2031,7 +2008,6 @@ parse_output_subscripts(char *subscripts, int length,
"too many output subscripts");
return -1;
}
- right_labels = 1;
}
/* The end of the ellipsis */
else if (label == '.') {
@@ -2081,7 +2057,6 @@ parse_output_subscripts(char *subscripts, int length,
"too many subscripts for the output");
return -1;
}
- left_labels = 1;
}
else {
PyErr_SetString(PyExc_ValueError,
@@ -2097,19 +2072,6 @@ parse_output_subscripts(char *subscripts, int length,
out_labels[idim++] = 0;
}
- if (!ellipsis) {
- *out_broadcast = BROADCAST_NONE;
- }
- else if (left_labels && right_labels) {
- *out_broadcast = BROADCAST_MIDDLE;
- }
- else if (!left_labels) {
- *out_broadcast = BROADCAST_RIGHT;
- }
- else {
- *out_broadcast = BROADCAST_LEFT;
- }
-
return ndim;
}
@@ -2328,136 +2290,44 @@ get_combined_dims_view(PyArrayObject *op, int iop, char *labels)
static int
prepare_op_axes(int ndim, int iop, char *labels, int *axes,
- int ndim_iter, char *iter_labels, EINSUM_BROADCAST broadcast)
+ int ndim_iter, char *iter_labels)
{
int i, label, ibroadcast;
- /* Regular broadcasting */
- if (broadcast == BROADCAST_RIGHT) {
- /* broadcast dimensions get placed in rightmost position */
- ibroadcast = ndim-1;
- for (i = ndim_iter-1; i >= 0; --i) {
- label = iter_labels[i];
- /*
- * If it's an unlabeled broadcast dimension, choose
- * the next broadcast dimension from the operand.
- */
- if (label == 0) {
- while (ibroadcast >= 0 && labels[ibroadcast] != 0) {
- --ibroadcast;
- }
- /*
- * If we used up all the operand broadcast dimensions,
- * extend it with a "newaxis"
- */
- if (ibroadcast < 0) {
- axes[i] = -1;
- }
- /* Otherwise map to the broadcast axis */
- else {
- axes[i] = ibroadcast;
- --ibroadcast;
- }
- }
- /* It's a labeled dimension, find the matching one */
- else {
- char *match = memchr(labels, label, ndim);
- /* If the op doesn't have the label, broadcast it */
- if (match == NULL) {
- axes[i] = -1;
- }
- /* Otherwise use it */
- else {
- axes[i] = match - labels;
- }
+ ibroadcast = ndim-1;
+ for (i = ndim_iter-1; i >= 0; --i) {
+ label = iter_labels[i];
+ /*
+ * If it's an unlabeled broadcast dimension, choose
+ * the next broadcast dimension from the operand.
+ */
+ if (label == 0) {
+ while (ibroadcast >= 0 && labels[ibroadcast] != 0) {
+ --ibroadcast;
}
- }
- }
- /* Reverse broadcasting */
- else if (broadcast == BROADCAST_LEFT) {
- /* broadcast dimensions get placed in leftmost position */
- ibroadcast = 0;
- for (i = 0; i < ndim_iter; ++i) {
- label = iter_labels[i];
/*
- * If it's an unlabeled broadcast dimension, choose
- * the next broadcast dimension from the operand.
+ * If we used up all the operand broadcast dimensions,
+ * extend it with a "newaxis"
*/
- if (label == 0) {
- while (ibroadcast < ndim && labels[ibroadcast] != 0) {
- ++ibroadcast;
- }
- /*
- * If we used up all the operand broadcast dimensions,
- * extend it with a "newaxis"
- */
- if (ibroadcast >= ndim) {
- axes[i] = -1;
- }
- /* Otherwise map to the broadcast axis */
- else {
- axes[i] = ibroadcast;
- ++ibroadcast;
- }
+ if (ibroadcast < 0) {
+ axes[i] = -1;
}
- /* It's a labeled dimension, find the matching one */
+ /* Otherwise map to the broadcast axis */
else {
- char *match = memchr(labels, label, ndim);
- /* If the op doesn't have the label, broadcast it */
- if (match == NULL) {
- axes[i] = -1;
- }
- /* Otherwise use it */
- else {
- axes[i] = match - labels;
- }
+ axes[i] = ibroadcast;
+ --ibroadcast;
}
}
- }
- /* Middle or None broadcasting */
- else {
- /* broadcast dimensions get placed in leftmost position */
- ibroadcast = 0;
- for (i = 0; i < ndim_iter; ++i) {
- label = iter_labels[i];
- /*
- * If it's an unlabeled broadcast dimension, choose
- * the next broadcast dimension from the operand.
- */
- if (label == 0) {
- while (ibroadcast < ndim && labels[ibroadcast] != 0) {
- ++ibroadcast;
- }
- /*
- * If we used up all the operand broadcast dimensions,
- * it's an error
- */
- if (ibroadcast >= ndim) {
- PyErr_Format(PyExc_ValueError,
- "operand %d did not have enough dimensions "
- "to match the broadcasting, and couldn't be "
- "extended because einstein sum subscripts "
- "were specified at both the start and end",
- iop);
- return 0;
- }
- /* Otherwise map to the broadcast axis */
- else {
- axes[i] = ibroadcast;
- ++ibroadcast;
- }
+ /* It's a labeled dimension, find the matching one */
+ else {
+ char *match = memchr(labels, label, ndim);
+ /* If the op doesn't have the label, broadcast it */
+ if (match == NULL) {
+ axes[i] = -1;
}
- /* It's a labeled dimension, find the matching one */
+ /* Otherwise use it */
else {
- char *match = memchr(labels, label, ndim);
- /* If the op doesn't have the label, broadcast it */
- if (match == NULL) {
- axes[i] = -1;
- }
- /* Otherwise use it */
- else {
- axes[i] = match - labels;
- }
+ axes[i] = match - labels;
}
}
}
@@ -2737,7 +2607,6 @@ PyArray_EinsteinSum(char *subscripts, npy_intp nop,
char output_labels[NPY_MAXDIMS], *iter_labels;
int idim, ndim_output, ndim_broadcast, ndim_iter;
- EINSUM_BROADCAST broadcast[NPY_MAXARGS];
PyArrayObject *op[NPY_MAXARGS], *ret = NULL;
PyArray_Descr *op_dtypes_array[NPY_MAXARGS], **op_dtypes;
@@ -2783,8 +2652,7 @@ PyArray_EinsteinSum(char *subscripts, npy_intp nop,
if (!parse_operand_subscripts(subscripts, length,
PyArray_NDIM(op_in[iop]),
iop, op_labels[iop], label_counts,
- &min_label, &max_label, &num_labels,
- &broadcast[iop])) {
+ &min_label, &max_label, &num_labels)) {
return NULL;
}
@@ -2845,7 +2713,7 @@ PyArray_EinsteinSum(char *subscripts, npy_intp nop,
/* Parse the output subscript string */
ndim_output = parse_output_subscripts(outsubscripts, length,
ndim_broadcast, label_counts,
- output_labels, &broadcast[nop]);
+ output_labels);
}
else {
if (subscripts[0] != '-' || subscripts[1] != '>') {
@@ -2859,7 +2727,7 @@ PyArray_EinsteinSum(char *subscripts, npy_intp nop,
/* Parse the output subscript string */
ndim_output = parse_output_subscripts(subscripts, strlen(subscripts),
ndim_broadcast, label_counts,
- output_labels, &broadcast[nop]);
+ output_labels);
}
if (ndim_output < 0) {
return NULL;
@@ -2961,7 +2829,7 @@ PyArray_EinsteinSum(char *subscripts, npy_intp nop,
op_axes[iop] = op_axes_arrays[iop];
if (!prepare_op_axes(PyArray_NDIM(op[iop]), iop, op_labels[iop],
- op_axes[iop], ndim_iter, iter_labels, broadcast[iop])) {
+ op_axes[iop], ndim_iter, iter_labels)) {
goto fail;
}
}
@@ -3102,7 +2970,6 @@ PyArray_EinsteinSum(char *subscripts, npy_intp nop,
char **dataptr;
npy_intp *stride;
npy_intp *countptr;
- int needs_api = NpyIter_IterationNeedsAPI(iter);
NPY_BEGIN_THREADS_DEF;
iternext = NpyIter_GetIterNext(iter, NULL);
@@ -3115,19 +2982,15 @@ PyArray_EinsteinSum(char *subscripts, npy_intp nop,
stride = NpyIter_GetInnerStrideArray(iter);
countptr = NpyIter_GetInnerLoopSizePtr(iter);
- if (!needs_api) {
- NPY_BEGIN_THREADS;
- }
+ NPY_BEGIN_THREADS_NDITER(iter);
NPY_EINSUM_DBG_PRINT("Einsum loop\n");
do {
sop(nop, dataptr, stride, *countptr);
} while(iternext(iter));
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
/* If the API was needed, it may have thrown an error */
- if (needs_api && PyErr_Occurred()) {
+ if (NpyIter_IterationNeedsAPI(iter) && PyErr_Occurred()) {
Py_DECREF(ret);
ret = NULL;
}
diff --git a/numpy/core/src/multiarray/getset.c b/numpy/core/src/multiarray/getset.c
index 6ad4cc13a..5374f42e7 100644
--- a/numpy/core/src/multiarray/getset.c
+++ b/numpy/core/src/multiarray/getset.c
@@ -267,6 +267,7 @@ array_interface_get(PyArrayObject *self)
}
if (array_might_be_written(self) < 0) {
+ Py_DECREF(dict);
return NULL;
}
@@ -868,10 +869,7 @@ array_flat_set(PyArrayObject *self, PyObject *val)
}
while(selfit->index < selfit->size) {
- memmove(selfit->dataptr, arrit->dataptr, PyArray_DESCR(self)->elsize);
- if (swap) {
- copyswap(selfit->dataptr, NULL, swap, self);
- }
+ copyswap(selfit->dataptr, arrit->dataptr, swap, self);
PyArray_ITER_NEXT(selfit);
PyArray_ITER_NEXT(arrit);
if (arrit->index == arrit->size) {
diff --git a/numpy/core/src/multiarray/item_selection.c b/numpy/core/src/multiarray/item_selection.c
index 5538627dd..b2bf17f4c 100644
--- a/numpy/core/src/multiarray/item_selection.c
+++ b/numpy/core/src/multiarray/item_selection.c
@@ -22,6 +22,7 @@
#include "item_selection.h"
#include "npy_sort.h"
#include "npy_partition.h"
+#include "npy_binsearch.h"
/*NUMPY_API
* Take
@@ -128,12 +129,15 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis,
func = PyArray_DESCR(self)->f->fasttake;
if (func == NULL) {
+ NPY_BEGIN_THREADS_DEF;
+ NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(self));
switch(clipmode) {
case NPY_RAISE:
for (i = 0; i < n; i++) {
for (j = 0; j < m; j++) {
tmp = ((npy_intp *)(PyArray_DATA(indices)))[j];
- if (check_and_adjust_index(&tmp, max_item, axis) < 0) {
+ if (check_and_adjust_index(&tmp, max_item, axis,
+ _save) < 0) {
goto fail;
}
tmp_src = src + tmp * chunk;
@@ -215,8 +219,10 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis,
}
break;
}
+ NPY_END_THREADS;
}
else {
+ /* no gil release, need it for error reporting */
err = func(dest, src, (npy_intp *)(PyArray_DATA(indices)),
max_item, n, m, nelem, clipmode);
if (err) {
@@ -299,7 +305,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
for (i = 0; i < ni; i++) {
src = PyArray_BYTES(values) + chunk*(i % nv);
tmp = ((npy_intp *)(PyArray_DATA(indices)))[i];
- if (check_and_adjust_index(&tmp, max_item, 0) < 0) {
+ if (check_and_adjust_index(&tmp, max_item, 0, NULL) < 0) {
goto fail;
}
PyArray_Item_INCREF(src, PyArray_DESCR(self));
@@ -344,12 +350,14 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
}
}
else {
+ NPY_BEGIN_THREADS_DEF;
+ NPY_BEGIN_THREADS_THRESHOLDED(ni);
switch(clipmode) {
case NPY_RAISE:
for (i = 0; i < ni; i++) {
src = PyArray_BYTES(values) + chunk * (i % nv);
tmp = ((npy_intp *)(PyArray_DATA(indices)))[i];
- if (check_and_adjust_index(&tmp, max_item, 0) < 0) {
+ if (check_and_adjust_index(&tmp, max_item, 0, _save) < 0) {
goto fail;
}
memmove(dest + tmp * chunk, src, chunk);
@@ -386,6 +394,7 @@ PyArray_PutTo(PyArrayObject *self, PyObject* values0, PyObject *indices0,
}
break;
}
+ NPY_END_THREADS;
}
finish:
@@ -481,6 +490,8 @@ PyArray_PutMask(PyArrayObject *self, PyObject* values0, PyObject* mask0)
}
}
else {
+ NPY_BEGIN_THREADS_DEF;
+ NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(self));
func = PyArray_DESCR(self)->f->fastputmask;
if (func == NULL) {
for (i = 0; i < ni; i++) {
@@ -494,6 +505,7 @@ PyArray_PutMask(PyArrayObject *self, PyObject* values0, PyObject* mask0)
else {
func(dest, PyArray_DATA(mask), ni, PyArray_DATA(values), nv);
}
+ NPY_END_THREADS;
}
Py_XDECREF(values);
@@ -1257,7 +1269,7 @@ PyArray_Partition(PyArrayObject *op, PyArrayObject * ktharray, int axis, NPY_SEL
PyArray_PartitionFunc * part = get_partition_func(PyArray_TYPE(op), which);
n = PyArray_NDIM(op);
- if ((n == 0)) {
+ if (n == 0) {
return 0;
}
if (axis < 0) {
@@ -1866,196 +1878,6 @@ PyArray_LexSort(PyObject *sort_keys, int axis)
}
-/** @brief Use bisection of sorted array to find first entries >= keys.
- *
- * For each key use bisection to find the first index i s.t. key <= arr[i].
- * When there is no such index i, set i = len(arr). Return the results in ret.
- * Both arr and key must be of the same comparable type.
- *
- * @param arr 1d, strided, sorted array to be searched.
- * @param key contiguous array of keys.
- * @param ret contiguous array of intp for returned indices.
- * @return void
- */
-static void
-local_search_left(PyArrayObject *arr, PyArrayObject *key, PyArrayObject *ret)
-{
- PyArray_CompareFunc *compare = PyArray_DESCR(key)->f->compare;
- npy_intp nelts = PyArray_DIMS(arr)[PyArray_NDIM(arr) - 1];
- npy_intp nkeys = PyArray_SIZE(key);
- char *parr = PyArray_DATA(arr);
- char *pkey = PyArray_DATA(key);
- npy_intp *pret = (npy_intp *)PyArray_DATA(ret);
- int elsize = PyArray_DESCR(key)->elsize;
- npy_intp arrstride = *PyArray_STRIDES(arr);
- npy_intp i;
-
- for (i = 0; i < nkeys; ++i) {
- npy_intp imin = 0;
- npy_intp imax = nelts;
- while (imin < imax) {
- npy_intp imid = imin + ((imax - imin) >> 1);
- if (compare(parr + arrstride*imid, pkey, key) < 0) {
- imin = imid + 1;
- }
- else {
- imax = imid;
- }
- }
- *pret = imin;
- pret += 1;
- pkey += elsize;
- }
-}
-
-
-/** @brief Use bisection of sorted array to find first entries > keys.
- *
- * For each key use bisection to find the first index i s.t. key < arr[i].
- * When there is no such index i, set i = len(arr). Return the results in ret.
- * Both arr and key must be of the same comparable type.
- *
- * @param arr 1d, strided, sorted array to be searched.
- * @param key contiguous array of keys.
- * @param ret contiguous array of intp for returned indices.
- * @return void
- */
-static void
-local_search_right(PyArrayObject *arr, PyArrayObject *key, PyArrayObject *ret)
-{
- PyArray_CompareFunc *compare = PyArray_DESCR(key)->f->compare;
- npy_intp nelts = PyArray_DIMS(arr)[PyArray_NDIM(arr) - 1];
- npy_intp nkeys = PyArray_SIZE(key);
- char *parr = PyArray_DATA(arr);
- char *pkey = PyArray_DATA(key);
- npy_intp *pret = (npy_intp *)PyArray_DATA(ret);
- int elsize = PyArray_DESCR(key)->elsize;
- npy_intp arrstride = *PyArray_STRIDES(arr);
- npy_intp i;
-
- for(i = 0; i < nkeys; ++i) {
- npy_intp imin = 0;
- npy_intp imax = nelts;
- while (imin < imax) {
- npy_intp imid = imin + ((imax - imin) >> 1);
- if (compare(parr + arrstride*imid, pkey, key) <= 0) {
- imin = imid + 1;
- }
- else {
- imax = imid;
- }
- }
- *pret = imin;
- pret += 1;
- pkey += elsize;
- }
-}
-
-/** @brief Use bisection of sorted array to find first entries >= keys.
- *
- * For each key use bisection to find the first index i s.t. key <= arr[i].
- * When there is no such index i, set i = len(arr). Return the results in ret.
- * Both arr and key must be of the same comparable type.
- *
- * @param arr 1d, strided array to be searched.
- * @param key contiguous array of keys.
- * @param sorter 1d, strided array of intp that sorts arr.
- * @param ret contiguous array of intp for returned indices.
- * @return int
- */
-static int
-local_argsearch_left(PyArrayObject *arr, PyArrayObject *key,
- PyArrayObject *sorter, PyArrayObject *ret)
-{
- PyArray_CompareFunc *compare = PyArray_DESCR(key)->f->compare;
- npy_intp nelts = PyArray_DIMS(arr)[PyArray_NDIM(arr) - 1];
- npy_intp nkeys = PyArray_SIZE(key);
- char *parr = PyArray_DATA(arr);
- char *pkey = PyArray_DATA(key);
- char *psorter = PyArray_DATA(sorter);
- npy_intp *pret = (npy_intp *)PyArray_DATA(ret);
- int elsize = PyArray_DESCR(key)->elsize;
- npy_intp arrstride = *PyArray_STRIDES(arr);
- npy_intp sorterstride = *PyArray_STRIDES(sorter);
- npy_intp i;
-
- for (i = 0; i < nkeys; ++i) {
- npy_intp imin = 0;
- npy_intp imax = nelts;
- while (imin < imax) {
- npy_intp imid = imin + ((imax - imin) >> 1);
- npy_intp indx = *(npy_intp *)(psorter + sorterstride * imid);
-
- if (indx < 0 || indx >= nelts) {
- return -1;
- }
- if (compare(parr + arrstride*indx, pkey, key) < 0) {
- imin = imid + 1;
- }
- else {
- imax = imid;
- }
- }
- *pret = imin;
- pret += 1;
- pkey += elsize;
- }
- return 0;
-}
-
-
-/** @brief Use bisection of sorted array to find first entries > keys.
- *
- * For each key use bisection to find the first index i s.t. key < arr[i].
- * When there is no such index i, set i = len(arr). Return the results in ret.
- * Both arr and key must be of the same comparable type.
- *
- * @param arr 1d, strided array to be searched.
- * @param key contiguous array of keys.
- * @param sorter 1d, strided array of intp that sorts arr.
- * @param ret contiguous array of intp for returned indices.
- * @return int
- */
-static int
-local_argsearch_right(PyArrayObject *arr, PyArrayObject *key,
- PyArrayObject *sorter, PyArrayObject *ret)
-{
- PyArray_CompareFunc *compare = PyArray_DESCR(key)->f->compare;
- npy_intp nelts = PyArray_DIMS(arr)[PyArray_NDIM(arr) - 1];
- npy_intp nkeys = PyArray_SIZE(key);
- char *parr = PyArray_DATA(arr);
- char *pkey = PyArray_DATA(key);
- char *psorter = PyArray_DATA(sorter);
- npy_intp *pret = (npy_intp *)PyArray_DATA(ret);
- int elsize = PyArray_DESCR(key)->elsize;
- npy_intp arrstride = *PyArray_STRIDES(arr);
- npy_intp sorterstride = *PyArray_STRIDES(sorter);
- npy_intp i;
-
- for(i = 0; i < nkeys; ++i) {
- npy_intp imin = 0;
- npy_intp imax = nelts;
- while (imin < imax) {
- npy_intp imid = imin + ((imax - imin) >> 1);
- npy_intp indx = *(npy_intp *)(psorter + sorterstride * imid);
-
- if (indx < 0 || indx >= nelts) {
- return -1;
- }
- if (compare(parr + arrstride*indx, pkey, key) <= 0) {
- imin = imid + 1;
- }
- else {
- imax = imid;
- }
- }
- *pret = imin;
- pret += 1;
- pkey += elsize;
- }
- return 0;
-}
-
/*NUMPY_API
*
* Search the sorted array op1 for the location of the items in op2. The
@@ -2096,6 +1918,8 @@ PyArray_SearchSorted(PyArrayObject *op1, PyObject *op2,
PyArrayObject *ret = NULL;
PyArray_Descr *dtype;
int ap1_flags = NPY_ARRAY_NOTSWAPPED | NPY_ARRAY_ALIGNED;
+ PyArray_BinSearchFunc *binsearch = NULL;
+ PyArray_ArgBinSearchFunc *argbinsearch = NULL;
NPY_BEGIN_THREADS_DEF;
/* Find common type */
@@ -2103,40 +1927,54 @@ PyArray_SearchSorted(PyArrayObject *op1, PyObject *op2,
if (dtype == NULL) {
return NULL;
}
+ /* refs to dtype we own = 1 */
+
+ /* Look for binary search function */
+ if (perm) {
+ argbinsearch = get_argbinsearch_func(dtype, side);
+ }
+ else {
+ binsearch = get_binsearch_func(dtype, side);
+ }
+ if (binsearch == NULL && argbinsearch == NULL) {
+ PyErr_SetString(PyExc_TypeError, "compare not supported for type");
+ /* refs to dtype we own = 1 */
+ Py_DECREF(dtype);
+ /* refs to dtype we own = 0 */
+ return NULL;
+ }
/* need ap2 as contiguous array and of right type */
+ /* refs to dtype we own = 1 */
Py_INCREF(dtype);
+ /* refs to dtype we own = 2 */
ap2 = (PyArrayObject *)PyArray_CheckFromAny(op2, dtype,
0, 0,
NPY_ARRAY_CARRAY_RO | NPY_ARRAY_NOTSWAPPED,
NULL);
+ /* refs to dtype we own = 1, array creation steals one even on failure */
if (ap2 == NULL) {
Py_DECREF(dtype);
+ /* refs to dtype we own = 0 */
return NULL;
}
/*
* If the needle (ap2) is larger than the haystack (op1) we copy the
- * haystack to a continuous array for improved cache utilization.
+ * haystack to a contiguous array for improved cache utilization.
*/
if (PyArray_SIZE(ap2) > PyArray_SIZE(op1)) {
ap1_flags |= NPY_ARRAY_CARRAY_RO;
}
-
ap1 = (PyArrayObject *)PyArray_CheckFromAny((PyObject *)op1, dtype,
1, 1, ap1_flags, NULL);
+ /* refs to dtype we own = 0, array creation steals one even on failure */
if (ap1 == NULL) {
goto fail;
}
- /* check that comparison function exists */
- if (PyArray_DESCR(ap2)->f->compare == NULL) {
- PyErr_SetString(PyExc_TypeError,
- "compare not supported for type");
- goto fail;
- }
if (perm) {
- /* need ap3 as contiguous array and of right type */
+ /* need ap3 as a 1D aligned, not swapped, array of right type */
ap3 = (PyArrayObject *)PyArray_CheckFromAny(perm, NULL,
1, 1,
NPY_ARRAY_ALIGNED | NPY_ARRAY_NOTSWAPPED,
@@ -2167,7 +2005,7 @@ PyArray_SearchSorted(PyArrayObject *op1, PyObject *op2,
}
}
- /* ret is a contiguous array of intp type to hold returned indices */
+ /* ret is a contiguous array of intp type to hold returned indexes */
ret = (PyArrayObject *)PyArray_New(Py_TYPE(ap2), PyArray_NDIM(ap2),
PyArray_DIMS(ap2), NPY_INTP,
NULL, NULL, 0, 0, (PyObject *)ap2);
@@ -2176,33 +2014,32 @@ PyArray_SearchSorted(PyArrayObject *op1, PyObject *op2,
}
if (ap3 == NULL) {
- if (side == NPY_SEARCHLEFT) {
- NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(ap2));
- local_search_left(ap1, ap2, ret);
- NPY_END_THREADS_DESCR(PyArray_DESCR(ap2));
- }
- else if (side == NPY_SEARCHRIGHT) {
- NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(ap2));
- local_search_right(ap1, ap2, ret);
- NPY_END_THREADS_DESCR(PyArray_DESCR(ap2));
- }
+ /* do regular binsearch */
+ NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(ap2));
+ binsearch((const char *)PyArray_DATA(ap1),
+ (const char *)PyArray_DATA(ap2),
+ (char *)PyArray_DATA(ret),
+ PyArray_SIZE(ap1), PyArray_SIZE(ap2),
+ PyArray_STRIDES(ap1)[0], PyArray_DESCR(ap2)->elsize,
+ NPY_SIZEOF_INTP, ap2);
+ NPY_END_THREADS_DESCR(PyArray_DESCR(ap2));
}
else {
- int err=0;
-
- if (side == NPY_SEARCHLEFT) {
- NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(ap2));
- err = local_argsearch_left(ap1, ap2, sorter, ret);
- NPY_END_THREADS_DESCR(PyArray_DESCR(ap2));
- }
- else if (side == NPY_SEARCHRIGHT) {
- NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(ap2));
- err = local_argsearch_right(ap1, ap2, sorter, ret);
- NPY_END_THREADS_DESCR(PyArray_DESCR(ap2));
- }
- if (err < 0) {
+ /* do binsearch with a sorter array */
+ int error = 0;
+ NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(ap2));
+ error = argbinsearch((const char *)PyArray_DATA(ap1),
+ (const char *)PyArray_DATA(ap2),
+ (const char *)PyArray_DATA(sorter),
+ (char *)PyArray_DATA(ret),
+ PyArray_SIZE(ap1), PyArray_SIZE(ap2),
+ PyArray_STRIDES(ap1)[0],
+ PyArray_DESCR(ap2)->elsize,
+ PyArray_STRIDES(sorter)[0], NPY_SIZEOF_INTP, ap2);
+ NPY_END_THREADS_DESCR(PyArray_DESCR(ap2));
+ if (error < 0) {
PyErr_SetString(PyExc_ValueError,
- "Sorter index out of range.");
+ "Sorter index out of range.");
goto fail;
}
Py_DECREF(ap3);
@@ -2398,41 +2235,51 @@ PyArray_Compress(PyArrayObject *self, PyObject *condition, int axis,
}
/*
- * count number of nonzero bytes in 16 byte block
+ * count number of nonzero bytes in 48 byte block
* w must be aligned to 8 bytes
*
* even though it uses 64 bit types its faster than the bytewise sum on 32 bit
* but a 32 bit type version would make it even faster on these platforms
*/
-static NPY_INLINE int
-count_nonzero_bytes_128(const npy_uint64 * w)
+static NPY_INLINE npy_intp
+count_nonzero_bytes_384(const npy_uint64 * w)
{
const npy_uint64 w1 = w[0];
const npy_uint64 w2 = w[1];
+ const npy_uint64 w3 = w[2];
+ const npy_uint64 w4 = w[3];
+ const npy_uint64 w5 = w[4];
+ const npy_uint64 w6 = w[5];
+ npy_intp r;
+
+ /*
+ * last part of sideways add popcount, first three bisections can be
+ * skipped as we are dealing with bytes.
+ * multiplication equivalent to (x + (x>>8) + (x>>16) + (x>>24)) & 0xFF
+ * multiplication overflow well defined for unsigned types.
+ * w1 + w2 guaranteed to not overflow as we only have 0 and 1 data.
+ */
+ r = ((w1 + w2 + w3 + w4 + w5 + w6) * 0x0101010101010101ULL) >> 56ULL;
/*
* bytes not exclusively 0 or 1, sum them individually.
* should only happen if one does weird stuff with views or external
* buffers.
+ * Doing this after the optimistic computation allows saving registers and
+ * better pipelining
*/
- if (NPY_UNLIKELY(((w1 | w2) & 0xFEFEFEFEFEFEFEFEULL) != 0)) {
+ if (NPY_UNLIKELY(
+ ((w1 | w2 | w3 | w4 | w5 | w6) & 0xFEFEFEFEFEFEFEFEULL) != 0)) {
/* reload from pointer to avoid a unnecessary stack spill with gcc */
const char * c = (const char *)w;
npy_uintp i, count = 0;
- for (i = 0; i < 16; i++) {
+ for (i = 0; i < 48; i++) {
count += (c[i] != 0);
}
return count;
}
- /*
- * last part of sideways add popcount, first three bisections can be
- * skipped as we are dealing with bytes.
- * multiplication equivalent to (x + (x>>8) + (x>>16) + (x>>24)) & 0xFF
- * multiplication overflow well defined for unsigned types.
- * w1 + w2 guaranteed to not overflow as we only have 0 and 1 data.
- */
- return ((w1 + w2) * 0x0101010101010101ULL) >> 56ULL;
+ return r;
}
/*
@@ -2448,6 +2295,7 @@ count_boolean_trues(int ndim, char *data, npy_intp *ashape, npy_intp *astrides)
npy_intp shape[NPY_MAXDIMS], strides[NPY_MAXDIMS];
npy_intp i, coord[NPY_MAXDIMS];
npy_intp count = 0;
+ NPY_BEGIN_THREADS_DEF;
/* Use raw iteration with no heap memory allocation */
if (PyArray_PrepareOneRawArrayIter(
@@ -2463,6 +2311,8 @@ count_boolean_trues(int ndim, char *data, npy_intp *ashape, npy_intp *astrides)
return 0;
}
+ NPY_BEGIN_THREADS_THRESHOLDED(shape[0]);
+
/* Special case for contiguous inner loop */
if (strides[0] == 1) {
NPY_RAW_ITER_START(idim, ndim, coord, shape) {
@@ -2471,9 +2321,9 @@ count_boolean_trues(int ndim, char *data, npy_intp *ashape, npy_intp *astrides)
const char *e = data + shape[0];
if (NPY_CPU_HAVE_UNALIGNED_ACCESS ||
npy_is_aligned(d, sizeof(npy_uint64))) {
- npy_uintp stride = 2 * sizeof(npy_uint64);
+ npy_uintp stride = 6 * sizeof(npy_uint64);
for (; d < e - (shape[0] % stride); d += stride) {
- count += count_nonzero_bytes_128((const npy_uint64 *)d);
+ count += count_nonzero_bytes_384((const npy_uint64 *)d);
}
}
for (; d < e; ++d) {
@@ -2492,6 +2342,8 @@ count_boolean_trues(int ndim, char *data, npy_intp *ashape, npy_intp *astrides)
} NPY_RAW_ITER_ONE_NEXT(idim, ndim, coord, shape, data, strides);
}
+ NPY_END_THREADS;
+
return count;
}
@@ -2512,6 +2364,7 @@ PyArray_CountNonzero(PyArrayObject *self)
NpyIter_IterNextFunc *iternext;
char **dataptr;
npy_intp *strideptr, *innersizeptr;
+ NPY_BEGIN_THREADS_DEF;
/* Special low-overhead version specific to the boolean type */
if (PyArray_DESCR(self)->type_num == NPY_BOOL) {
@@ -2561,6 +2414,9 @@ PyArray_CountNonzero(PyArrayObject *self)
NpyIter_Deallocate(iter);
return -1;
}
+
+ NPY_BEGIN_THREADS_NDITER(iter);
+
dataptr = NpyIter_GetDataPtrArray(iter);
strideptr = NpyIter_GetInnerStrideArray(iter);
innersizeptr = NpyIter_GetInnerLoopSizePtr(iter);
@@ -2580,6 +2436,8 @@ PyArray_CountNonzero(PyArrayObject *self)
} while(iternext(iter));
+ NPY_END_THREADS;
+
NpyIter_Deallocate(iter);
return PyErr_Occurred() ? -1 : nonzero_count;
@@ -2598,10 +2456,7 @@ PyArray_Nonzero(PyArrayObject *self)
PyObject *ret_tuple;
npy_intp ret_dims[2];
PyArray_NonzeroFunc *nonzero = PyArray_DESCR(self)->f->nonzero;
- char *data;
- npy_intp stride, count;
npy_intp nonzero_count;
- npy_intp *multi_index;
NpyIter *iter;
NpyIter_IterNextFunc *iternext;
@@ -2628,23 +2483,51 @@ PyArray_Nonzero(PyArrayObject *self)
/* If it's a one-dimensional result, don't use an iterator */
if (ndim <= 1) {
- npy_intp j;
+ npy_intp * multi_index = (npy_intp *)PyArray_DATA(ret);
+ char * data = PyArray_BYTES(self);
+ npy_intp stride = (ndim == 0) ? 0 : PyArray_STRIDE(self, 0);
+ npy_intp count = (ndim == 0) ? 1 : PyArray_DIM(self, 0);
+ NPY_BEGIN_THREADS_DEF;
- multi_index = (npy_intp *)PyArray_DATA(ret);
- data = PyArray_BYTES(self);
- stride = (ndim == 0) ? 0 : PyArray_STRIDE(self, 0);
- count = (ndim == 0) ? 1 : PyArray_DIM(self, 0);
+ /* nothing to do */
+ if (nonzero_count == 0) {
+ goto finish;
+ }
+ NPY_BEGIN_THREADS_THRESHOLDED(count);
+
+ /* avoid function call for bool */
if (PyArray_ISBOOL(self)) {
- /* avoid function call for bool */
- for (j = 0; j < count; ++j) {
- if (*data != 0) {
- *multi_index++ = j;
+ /*
+ * use fast memchr variant for sparse data, see gh-4370
+ * the fast bool count is followed by this sparse path is faster
+ * than combining the two loops, even for larger arrays
+ */
+ if (((double)nonzero_count / count) <= 0.1) {
+ npy_intp subsize;
+ npy_intp j = 0;
+ while (1) {
+ npy_memchr(data + j * stride, 0, stride, count - j,
+ &subsize, 1);
+ j += subsize;
+ if (j >= count) {
+ break;
+ }
+ *multi_index++ = j++;
+ }
+ }
+ else {
+ npy_intp j;
+ for (j = 0; j < count; ++j) {
+ if (*data != 0) {
+ *multi_index++ = j;
+ }
+ data += stride;
}
- data += stride;
}
}
else {
+ npy_intp j;
for (j = 0; j < count; ++j) {
if (nonzero(data, self)) {
*multi_index++ = j;
@@ -2653,6 +2536,8 @@ PyArray_Nonzero(PyArrayObject *self)
}
}
+ NPY_END_THREADS;
+
goto finish;
}
@@ -2672,6 +2557,8 @@ PyArray_Nonzero(PyArrayObject *self)
}
if (NpyIter_GetIterSize(iter) != 0) {
+ npy_intp * multi_index;
+ NPY_BEGIN_THREADS_DEF;
/* Get the pointers for inner loop iteration */
iternext = NpyIter_GetIterNext(iter, NULL);
if (iternext == NULL) {
@@ -2685,6 +2572,9 @@ PyArray_Nonzero(PyArrayObject *self)
Py_DECREF(ret);
return NULL;
}
+
+ NPY_BEGIN_THREADS_NDITER(iter);
+
dataptr = NpyIter_GetDataPtrArray(iter);
multi_index = (npy_intp *)PyArray_DATA(ret);
@@ -2707,6 +2597,8 @@ PyArray_Nonzero(PyArrayObject *self)
}
} while(iternext(iter));
}
+
+ NPY_END_THREADS;
}
NpyIter_Deallocate(iter);
@@ -2732,7 +2624,7 @@ finish:
else {
for (i = 0; i < ndim; ++i) {
PyArrayObject *view;
- stride = ndim*NPY_SIZEOF_INTP;
+ npy_intp stride = ndim * NPY_SIZEOF_INTP;
view = (PyArrayObject *)PyArray_New(Py_TYPE(self), 1,
&nonzero_count,
@@ -2775,7 +2667,7 @@ PyArray_MultiIndexGetItem(PyArrayObject *self, npy_intp *multi_index)
npy_intp shapevalue = shape[idim];
npy_intp ind = multi_index[idim];
- if (check_and_adjust_index(&ind, shapevalue, idim) < 0) {
+ if (check_and_adjust_index(&ind, shapevalue, idim, NULL) < 0) {
return NULL;
}
data += ind * strides[idim];
@@ -2804,7 +2696,7 @@ PyArray_MultiIndexSetItem(PyArrayObject *self, npy_intp *multi_index,
npy_intp shapevalue = shape[idim];
npy_intp ind = multi_index[idim];
- if (check_and_adjust_index(&ind, shapevalue, idim) < 0) {
+ if (check_and_adjust_index(&ind, shapevalue, idim, NULL) < 0) {
return -1;
}
data += ind * strides[idim];
diff --git a/numpy/core/src/multiarray/iterators.c b/numpy/core/src/multiarray/iterators.c
index b8e7c5366..81c6b2a8e 100644
--- a/numpy/core/src/multiarray/iterators.c
+++ b/numpy/core/src/multiarray/iterators.c
@@ -71,7 +71,7 @@ parse_index_entry(PyObject *op, npy_intp *step_size,
*n_steps = SINGLE_INDEX;
*step_size = 0;
if (check_index) {
- if (check_and_adjust_index(&i, max, axis) < 0) {
+ if (check_and_adjust_index(&i, max, axis, NULL) < 0) {
goto fail;
}
}
@@ -668,7 +668,7 @@ iter_subscript_int(PyArrayIterObject *self, PyArrayObject *ind)
itemsize = PyArray_DESCR(self->ao)->elsize;
if (PyArray_NDIM(ind) == 0) {
num = *((npy_intp *)PyArray_DATA(ind));
- if (check_and_adjust_index(&num, self->size, -1) < 0) {
+ if (check_and_adjust_index(&num, self->size, -1, NULL) < 0) {
PyArray_ITER_RESET(self);
return NULL;
}
@@ -702,7 +702,7 @@ iter_subscript_int(PyArrayIterObject *self, PyArrayObject *ind)
swap = (PyArray_ISNOTSWAPPED(ret) != PyArray_ISNOTSWAPPED(self->ao));
while (counter--) {
num = *((npy_intp *)(ind_it->dataptr));
- if (check_and_adjust_index(&num, self->size, -1) < 0) {
+ if (check_and_adjust_index(&num, self->size, -1, NULL) < 0) {
Py_DECREF(ind_it);
Py_DECREF(ret);
PyArray_ITER_RESET(self);
@@ -926,7 +926,7 @@ iter_ass_sub_int(PyArrayIterObject *self, PyArrayObject *ind,
copyswap = PyArray_DESCR(self->ao)->f->copyswap;
if (PyArray_NDIM(ind) == 0) {
num = *((npy_intp *)PyArray_DATA(ind));
- if (check_and_adjust_index(&num, self->size, -1) < 0) {
+ if (check_and_adjust_index(&num, self->size, -1, NULL) < 0) {
return -1;
}
PyArray_ITER_GOTO1D(self, num);
@@ -940,7 +940,7 @@ iter_ass_sub_int(PyArrayIterObject *self, PyArrayObject *ind,
counter = ind_it->size;
while (counter--) {
num = *((npy_intp *)(ind_it->dataptr));
- if (check_and_adjust_index(&num, self->size, -1) < 0) {
+ if (check_and_adjust_index(&num, self->size, -1, NULL) < 0) {
Py_DECREF(ind_it);
return -1;
}
@@ -1017,7 +1017,7 @@ iter_ass_subscript(PyArrayIterObject *self, PyObject *ind, PyObject *val)
PyErr_Clear();
}
else {
- if (check_and_adjust_index(&start, self->size, -1) < 0) {
+ if (check_and_adjust_index(&start, self->size, -1, NULL) < 0) {
goto finish;
}
retval = 0;
@@ -1489,6 +1489,10 @@ PyArray_MultiIterFromObjects(PyObject **mps, int n, int nadd, ...)
}
else {
multi->iters[i] = (PyArrayIterObject *)PyArray_IterNew(arr);
+ if (multi->iters[i] == NULL) {
+ err = 1;
+ break;
+ }
Py_DECREF(arr);
}
}
@@ -1549,6 +1553,10 @@ PyArray_MultiIterNew(int n, ...)
}
else {
multi->iters[i] = (PyArrayIterObject *)PyArray_IterNew(arr);
+ if (multi->iters[i] == NULL) {
+ err = 1;
+ break;
+ }
Py_DECREF(arr);
}
}
diff --git a/numpy/core/src/multiarray/lowlevel_strided_loops.c.src b/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
index 638ae4d1e..38e7656f3 100644
--- a/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
+++ b/numpy/core/src/multiarray/lowlevel_strided_loops.c.src
@@ -189,9 +189,10 @@ static void
* specialized copy and swap for source stride 0,
* interestingly unrolling here is like above is only marginally profitable for
* small types and detrimental for >= 8byte moves on x86
+ * but it profits from vectorization enabled with -O3
*/
#if (@src_contig@ == 0) && @is_aligned@
-static void
+static NPY_GCC_OPT_3 void
@prefix@_@oper@_size@elsize@_srcstride0(char *dst,
npy_intp dst_stride,
char *src, npy_intp NPY_UNUSED(src_stride),
@@ -792,7 +793,7 @@ NPY_NO_EXPORT PyArray_StridedUnaryOp *
#endif
-static void
+static NPY_GCC_OPT_3 void
@prefix@_cast_@name1@_to_@name2@(
char *dst, npy_intp dst_stride,
char *src, npy_intp src_stride,
@@ -1353,3 +1354,414 @@ PyArray_TransferMaskedStridedToNDim(npy_intp ndim,
}
}
}
+
+
+/***************************************************************************/
+/****************** MapIter (Advanced indexing) Get/Set ********************/
+/***************************************************************************/
+
+/**begin repeat
+ * #name = set, get#
+ * #isget = 0, 1#
+ */
+
+/*
+ * Advanded indexing iteration of arrays when there is a single indexing
+ * array which has the same memory order as the value array and both
+ * can be trivally iterated (single stride, aligned, no casting necessary).
+ */
+NPY_NO_EXPORT int
+mapiter_trivial_@name@(PyArrayObject *self, PyArrayObject *ind,
+ PyArrayObject *result)
+{
+ char *base_ptr, *ind_ptr, *result_ptr;
+ npy_intp self_stride, ind_stride, result_stride;
+ npy_intp fancy_dim = PyArray_DIM(self, 0);
+
+ npy_intp itersize;
+
+ int is_aligned = PyArray_ISALIGNED(self) && PyArray_ISALIGNED(result);
+ int needs_api = PyDataType_REFCHK(PyArray_DESCR(self));
+
+ PyArray_CopySwapFunc *copyswap = PyArray_DESCR(self)->f->copyswap;
+ NPY_BEGIN_THREADS_DEF;
+
+ base_ptr = PyArray_BYTES(self);
+ self_stride = PyArray_STRIDE(self, 0);
+
+ PyArray_PREPARE_TRIVIAL_PAIR_ITERATION(ind, result, itersize,
+ ind_ptr, result_ptr,
+ ind_stride, result_stride)
+
+ if (!needs_api) {
+ NPY_BEGIN_THREADS_THRESHOLDED(PyArray_SIZE(ind));
+ }
+#if !@isget@
+ /* Check the indices beforehand */
+ while (itersize--) {
+ npy_intp indval = *((npy_intp*)ind_ptr);
+ if (check_and_adjust_index(&indval, fancy_dim, 1, _save) < 0 ) {
+ return -1;
+ }
+ ind_ptr += ind_stride;
+ }
+
+ /*
+ * Reset the ind_ptr and itersize, due to broadcasting it is always
+ * the size of ind.
+ */
+ ind_ptr = PyArray_BYTES(ind);
+ itersize = PyArray_SIZE(ind);
+#endif
+
+ /* Optimization for aligned types that do not need the api */
+ switch ((is_aligned && !needs_api) ? PyArray_ITEMSIZE(self) : 0) {
+
+/**begin repeat1
+ * #elsize = 1, 2, 4, 8, 0#
+ * #copytype = npy_uint8, npy_uint16, npy_uint32, npy_uint64, 0#
+ */
+
+#if @elsize@
+ case @elsize@:
+#else
+ default:
+#endif
+ while (itersize--) {
+ char * self_ptr;
+ npy_intp indval = *((npy_intp*)ind_ptr);
+ assert(npy_is_aligned(ind_ptr, _ALIGN(npy_intp)));
+#if @isget@
+ if (check_and_adjust_index(&indval, fancy_dim, 1, _save) < 0 ) {
+ return -1;
+ }
+#else
+ if (indval < 0) {
+ indval += fancy_dim;
+ }
+#endif
+ self_ptr = base_ptr + indval * self_stride;
+
+#if @isget@
+#if @elsize@
+ assert(npy_is_aligned(result_ptr, _ALIGN(@copytype@)));
+ assert(npy_is_aligned(self_ptr, _ALIGN(@copytype@)));
+ *(@copytype@ *)result_ptr = *(@copytype@ *)self_ptr;
+#else
+ copyswap(result_ptr, self_ptr, 0, self);
+#endif
+
+#else /* !@isget@ */
+#if @elsize@
+ assert(npy_is_aligned(result_ptr, _ALIGN(@copytype@)));
+ assert(npy_is_aligned(self_ptr, _ALIGN(@copytype@)));
+ *(@copytype@ *)self_ptr = *(@copytype@ *)result_ptr;
+#else
+ copyswap(self_ptr, result_ptr, 0, self);
+#endif
+#endif
+
+ ind_ptr += ind_stride;
+ result_ptr += result_stride;
+ }
+ break;
+
+/**end repeat1**/
+ }
+
+ NPY_END_THREADS;
+
+ return 0;
+}
+
+
+/*
+ * General advanced indexing iteration.
+ */
+NPY_NO_EXPORT int
+mapiter_@name@(PyArrayMapIterObject *mit)
+{
+ npy_intp *counter, count;
+ int i, is_aligned;
+
+ /* Cached mit info */
+ int numiter = mit->numiter;
+ int needs_api = mit->needs_api;
+ /* Constant information */
+ npy_intp fancy_dims[NPY_MAXDIMS];
+ npy_intp fancy_strides[NPY_MAXDIMS];
+#if @isget@
+ int iteraxis;
+#endif
+
+ char *baseoffset = mit->baseoffset;
+ char **outer_ptrs = mit->outer_ptrs;
+ npy_intp *outer_strides = mit->outer_strides;
+ PyArrayObject *array= mit->array;
+
+ /* Fill constant information */
+#if @isget@
+ iteraxis = mit->iteraxes[0];
+#endif
+ for (i = 0; i < numiter; i++) {
+ fancy_dims[i] = mit->fancy_dims[i];
+ fancy_strides[i] = mit->fancy_strides[i];
+ }
+
+ /*
+ * Alignment information (swapping is never needed, since we buffer),
+ * could also check extra_op is buffered, but it should rarely matter.
+ */
+
+ is_aligned = PyArray_ISALIGNED(array) && PyArray_ISALIGNED(mit->extra_op);
+
+ if (mit->size == 0) {
+ return 0;
+ }
+
+ if (mit->subspace_iter == NULL) {
+ /*
+ * Item by item copy situation, the operand is buffered
+ * so use copyswap.
+ */
+ PyArray_CopySwapFunc *copyswap = PyArray_DESCR(array)->f->copyswap;
+
+ /* We have only one iterator handling everything */
+ counter = NpyIter_GetInnerLoopSizePtr(mit->outer);
+
+ /************ Optimized inner loops without subspace *************/
+
+/**begin repeat1
+ * #one_iter = 1, 0#
+ * #numiter = 1, numiter#
+ */
+
+#if @one_iter@
+ if (numiter == 1) {
+#else
+ else {
+#endif
+ NPY_BEGIN_THREADS_DEF;
+ if (!needs_api) {
+ NPY_BEGIN_THREADS;
+ }
+
+ /* Optimization for aligned types that do not need the api */
+ switch ((is_aligned && !needs_api) ? PyArray_ITEMSIZE(array) : 0) {
+
+/**begin repeat2
+ * #elsize = 1, 2, 4, 8, 0#
+ * #copytype = npy_uint8, npy_uint16, npy_uint32, npy_uint64, 0#
+ */
+
+#if @elsize@
+ case @elsize@:
+#else
+ default:
+#endif
+ /* Outer iteration (safe because mit->size != 0) */
+ do {
+#if !@isget@
+ /*
+ * When the API is needed the casting might fail
+ * TODO: (only if buffering is enabled).
+ */
+ if (needs_api && PyErr_Occurred()) {
+ return -1;
+ }
+#endif
+ count = *counter;
+ while (count--) {
+ char * self_ptr = baseoffset;
+ for (i=0; i < @numiter@; i++) {
+ npy_intp indval = *((npy_intp*)outer_ptrs[i]);
+ assert(npy_is_aligned(outer_ptrs[i],
+ _ALIGN(npy_intp)));
+
+#if @isget@ && @one_iter@
+ if (check_and_adjust_index(&indval, fancy_dims[i],
+ iteraxis, _save) < 0 ) {
+ return -1;
+ }
+#else
+ if (indval < 0) {
+ indval += fancy_dims[i];
+ }
+#endif
+ self_ptr += indval * fancy_strides[i];
+
+ /* advance indexing arrays */
+ outer_ptrs[i] += outer_strides[i];
+ }
+
+#if @isget@
+#if @elsize@
+ assert(npy_is_aligned(outer_ptrs[i], _ALIGN(@copytype@)));
+ assert(npy_is_aligned(self_ptr, _ALIGN(@copytype@)));
+ *(@copytype@ *)(outer_ptrs[i]) = *(@copytype@ *)self_ptr;
+#else
+ copyswap(outer_ptrs[i], self_ptr, 0, array);
+#endif
+#else /* !@isget@ */
+#if @elsize@
+ assert(npy_is_aligned(outer_ptrs[i], _ALIGN(@copytype@)));
+ assert(npy_is_aligned(self_ptr, _ALIGN(@copytype@)));
+ *(@copytype@ *)self_ptr = *(@copytype@ *)(outer_ptrs[i]);
+#else
+ copyswap(self_ptr, outer_ptrs[i], 0, array);
+#endif
+#endif
+ /* advance extra operand */
+ outer_ptrs[i] += outer_strides[i];
+ }
+ } while (mit->outer_next(mit->outer));
+
+ break;
+
+/**end repeat2**/
+ }
+ NPY_END_THREADS;
+ }
+/**end repeat1**/
+ }
+
+ /******************* Nested Iteration Situation *******************/
+ else {
+ char *subspace_baseptrs[2];
+ char **subspace_ptrs = mit->subspace_ptrs;
+ npy_intp *subspace_strides = mit->subspace_strides;
+ int skip = 0;
+
+ /* Use strided transfer functions for the inner loop */
+ PyArray_StridedUnaryOp *stransfer = NULL;
+ NpyAuxData *transferdata = NULL;
+ npy_intp fixed_strides[2];
+
+#if @isget@
+ npy_intp src_itemsize = PyArray_ITEMSIZE(array);
+#else
+ npy_intp src_itemsize = PyArray_ITEMSIZE(mit->extra_op);
+#endif
+
+ /*
+ * Get a dtype transfer function, since there are no
+ * buffers, this is safe.
+ */
+ NpyIter_GetInnerFixedStrideArray(mit->subspace_iter, fixed_strides);
+
+ if (PyArray_GetDTypeTransferFunction(is_aligned,
+#if @isget@
+ fixed_strides[0], fixed_strides[1],
+ PyArray_DESCR(array), PyArray_DESCR(mit->extra_op),
+#else
+ fixed_strides[1], fixed_strides[0],
+ PyArray_DESCR(mit->extra_op), PyArray_DESCR(array),
+#endif
+ 0,
+ &stransfer, &transferdata,
+ &needs_api) != NPY_SUCCEED) {
+ return -1;
+ }
+
+ counter = NpyIter_GetInnerLoopSizePtr(mit->subspace_iter);
+ if (*counter == PyArray_SIZE(mit->subspace)) {
+ skip = 1;
+ }
+
+/**begin repeat1
+ * #one_iter = 1, 0#
+ * #numiter = 1, numiter#
+ */
+
+#if @one_iter@
+ if (numiter == 1) {
+#else
+ else {
+#endif
+ NPY_BEGIN_THREADS_DEF;
+ if (!needs_api) {
+ NPY_BEGIN_THREADS;
+ }
+
+ /* Outer iteration (safe because mit->size != 0) */
+ do {
+ char * self_ptr = baseoffset;
+ for (i=0; i < @numiter@; i++) {
+ npy_intp indval = *((npy_intp*)outer_ptrs[i]);
+
+#if @isget@ && @one_iter@
+ if (check_and_adjust_index(&indval, fancy_dims[i],
+ iteraxis, _save) < 0 ) {
+ NPY_AUXDATA_FREE(transferdata);
+ return -1;
+ }
+#else
+ if (indval < 0) {
+ indval += fancy_dims[i];
+ }
+#endif
+
+ self_ptr += indval * fancy_strides[i];
+ }
+
+ /*
+ * Resetting is slow, so skip if the subspace iteration has
+ * only a single inner loop.
+ */
+ if (!skip) {
+ char * errmsg = NULL;
+ subspace_baseptrs[0] = self_ptr;
+ subspace_baseptrs[1] = mit->extra_op_ptrs[0];
+
+ /* (can't really fail, since no buffering necessary) */
+ if (!NpyIter_ResetBasePointers(mit->subspace_iter,
+ subspace_baseptrs,
+ &errmsg)) {
+ NPY_END_THREADS;
+ PyErr_SetString(PyExc_ValueError, errmsg);
+ NPY_AUXDATA_FREE(transferdata);
+ return -1;
+ }
+ }
+ else {
+ subspace_ptrs[0] = self_ptr;
+ subspace_ptrs[1] = mit->extra_op_ptrs[0];
+ }
+
+#if !@isget@
+ /*
+ * When the API is needed the casting might fail
+ * TODO: Could only check if casting is unsafe, or even just
+ * not at all...
+ */
+ if (needs_api && PyErr_Occurred()) {
+ NPY_AUXDATA_FREE(transferdata);
+ return -1;
+ }
+#endif
+
+ do {
+
+#if @isget@
+ stransfer(subspace_ptrs[1], subspace_strides[1],
+ subspace_ptrs[0], subspace_strides[0],
+ *counter, src_itemsize, transferdata);
+#else
+ stransfer(subspace_ptrs[0], subspace_strides[0],
+ subspace_ptrs[1], subspace_strides[1],
+ *counter, src_itemsize, transferdata);
+#endif
+ } while (mit->subspace_next(mit->subspace_iter));
+
+ mit->extra_op_next(mit->extra_op_iter);
+ } while (mit->outer_next(mit->outer));
+ NPY_END_THREADS;
+ }
+/**end repeat1**/
+
+ NPY_AUXDATA_FREE(transferdata);
+ }
+ return 0;
+}
+
+/**end repeat**/
diff --git a/numpy/core/src/multiarray/mapping.c b/numpy/core/src/multiarray/mapping.c
index 6bc4fb42d..1255b15ea 100644
--- a/numpy/core/src/multiarray/mapping.c
+++ b/numpy/core/src/multiarray/mapping.c
@@ -18,14 +18,26 @@
#include "lowlevel_strided_loops.h"
#include "item_selection.h"
-#define SOBJ_NOTFANCY 0
-#define SOBJ_ISFANCY 1
-#define SOBJ_BADARRAY 2
-#define SOBJ_TOOMANY 3
-#define SOBJ_LISTTUP 4
-static PyObject *
-array_subscript_simple(PyArrayObject *self, PyObject *op, int check_index);
+#define HAS_INTEGER 1
+#define HAS_NEWAXIS 2
+#define HAS_SLICE 4
+#define HAS_ELLIPSIS 8
+/* HAS_FANCY can be mixed with HAS_0D_BOOL, be careful when to use & or == */
+#define HAS_FANCY 16
+#define HAS_BOOL 32
+/* NOTE: Only set if it is neither fancy nor purely integer index! */
+#define HAS_SCALAR_ARRAY 64
+/*
+ * Indicate that this is a fancy index that comes from a 0d boolean.
+ * This means that the index does not operate along a real axis. The
+ * corresponding index type is just HAS_FANCY.
+ */
+#define HAS_0D_BOOL (HAS_FANCY | 128)
+
+
+static int
+_nonzero_indices(PyObject *myBool, PyArrayObject **arrays);
/******************************************************************************
*** IMPLEMENT MAPPING PROTOCOL ***
@@ -42,137 +54,12 @@ array_length(PyArrayObject *self)
}
}
-/* Get array item as scalar type */
-NPY_NO_EXPORT PyObject *
-array_item_asscalar(PyArrayObject *self, npy_intp i)
-{
- char *item;
- npy_intp dim0;
-
- /* Bounds check and get the data pointer */
- dim0 = PyArray_DIM(self, 0);
- if (i < 0) {
- i += dim0;
- }
- if (i < 0 || i >= dim0) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return NULL;
- }
- item = PyArray_BYTES(self) + i * PyArray_STRIDE(self, 0);
- return PyArray_Scalar(item, PyArray_DESCR(self), (PyObject *)self);
-}
-
-/* Get array item as ndarray type */
-NPY_NO_EXPORT PyObject *
-array_item_asarray(PyArrayObject *self, npy_intp i)
-{
- char *item;
- PyArrayObject *ret;
- npy_intp dim0;
-
- if(PyArray_NDIM(self) == 0) {
- PyErr_SetString(PyExc_IndexError,
- "0-d arrays can't be indexed");
- return NULL;
- }
-
- /* Bounds check and get the data pointer */
- dim0 = PyArray_DIM(self, 0);
- if (check_and_adjust_index(&i, dim0, 0) < 0) {
- return NULL;
- }
- item = PyArray_BYTES(self) + i * PyArray_STRIDE(self, 0);
-
- /* Create the view array */
- Py_INCREF(PyArray_DESCR(self));
- ret = (PyArrayObject *)PyArray_NewFromDescr(Py_TYPE(self),
- PyArray_DESCR(self),
- PyArray_NDIM(self)-1,
- PyArray_DIMS(self)+1,
- PyArray_STRIDES(self)+1, item,
- PyArray_FLAGS(self),
- (PyObject *)self);
- if (ret == NULL) {
- return NULL;
- }
-
- /* Set the base object */
- Py_INCREF(self);
- if (PyArray_SetBaseObject(ret, (PyObject *)self) < 0) {
- Py_DECREF(ret);
- return NULL;
- }
-
- PyArray_UpdateFlags(ret, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_F_CONTIGUOUS);
- return (PyObject *)ret;
-}
-
-/* Get array item at given index */
-NPY_NO_EXPORT PyObject *
-array_item(PyArrayObject *self, Py_ssize_t _i)
-{
- /* Workaround Python 2.4: Py_ssize_t not the same as npyint_p */
- npy_intp i = _i;
-
- if (PyArray_NDIM(self) == 1) {
- return array_item_asscalar(self, (npy_intp) i);
- }
- else {
- return array_item_asarray(self, (npy_intp) i);
- }
-}
-
-NPY_NO_EXPORT int
-array_ass_item_object(PyArrayObject *self, npy_intp i, PyObject *v)
-{
- PyArrayObject *tmp;
- char *item;
- npy_intp dim0;
- int ret;
-
- if (v == NULL) {
- PyErr_SetString(PyExc_ValueError,
- "can't delete array elements");
- return -1;
- }
-
- if (PyArray_FailUnlessWriteable(self, "assignment destination") < 0) {
- return -1;
- }
-
- if (PyArray_NDIM(self) == 0) {
- PyErr_SetString(PyExc_IndexError,
- "0-d arrays can't be indexed");
- return -1;
- }
-
-
- /* For multi-dimensional arrays, use CopyObject */
- if (PyArray_NDIM(self) > 1) {
- tmp = (PyArrayObject *)array_item_asarray(self, i);
- if(tmp == NULL) {
- return -1;
- }
- ret = PyArray_CopyObject(tmp, v);
- Py_DECREF(tmp);
- return ret;
- }
-
- /* Bounds check and get the data pointer */
- dim0 = PyArray_DIM(self, 0);
- if (check_and_adjust_index(&i, dim0, 0) < 0) {
- return -1;
- }
- item = PyArray_BYTES(self) + i * PyArray_STRIDE(self, 0);
-
- return PyArray_SETITEM(self, item, v);
-}
/* -------------------------------------------------------------- */
/*NUMPY_API
*
-*/
+ */
NPY_NO_EXPORT void
PyArray_MapIterSwapAxes(PyArrayMapIterObject *mit, PyArrayObject **ret, int getmap)
{
@@ -225,7 +112,7 @@ PyArray_MapIterSwapAxes(PyArrayMapIterObject *mit, PyArrayObject **ret, int getm
* For setting the array the tuple for transpose is
* (n2,...,n1+n2-1,0,...,n2-1,n1+n2,...n3-1)
*/
- n1 = mit->iters[0]->nd_m1 + 1;
+ n1 = mit->nd_fancy;
n2 = mit->consec; /* axes to insert at */
n3 = mit->nd;
@@ -249,364 +136,789 @@ PyArray_MapIterSwapAxes(PyArrayMapIterObject *mit, PyArrayObject **ret, int getm
*ret = (PyArrayObject *)new;
}
-static PyObject *
-PyArray_GetMap(PyArrayMapIterObject *mit)
+
+/**
+ * Prepare an npy_index_object from the python slicing object.
+ *
+ * This function handles all index preparations with the exception
+ * of field access. It fills the array of index_info structs correctly.
+ * It already handles the boolean array special case for fancy indexing,
+ * i.e. if the index type is boolean, it is exactly one matching boolean
+ * array. If the index type is fancy, the boolean array is already
+ * converted to integer arrays. There is (as before) no checking of the
+ * boolean dimension.
+ *
+ * Checks everything but the bounds.
+ *
+ * @param the array being indexed
+ * @param the index object
+ * @param index info struct being filled (size of NPY_MAXDIMS * 2 + 1)
+ * @param number of indices found
+ * @param dimension of the indexing result
+ * @param dimension of the fancy/advanced indices part
+ * @param whether to allow the boolean special case
+ *
+ * @returns the index_type or -1 on failure and fills the number of indices.
+ */
+NPY_NO_EXPORT int
+prepare_index(PyArrayObject *self, PyObject *index,
+ npy_index_info *indices,
+ int *num, int *ndim, int *out_fancy_ndim, int allow_boolean)
{
+ int new_ndim, fancy_ndim, used_ndim, index_ndim;
+ int curr_idx, get_idx;
- PyArrayObject *ret, *temp;
- PyArrayIterObject *it;
- npy_intp counter;
- int swap;
- PyArray_CopySwapFunc *copyswap;
+ npy_intp i, n;
- /* Unbound map iterator --- Bind should have been called */
- if (mit->ait == NULL) {
- return NULL;
- }
+ npy_bool make_tuple = 0;
+ PyObject *obj = NULL;
+ PyArrayObject *arr;
- /* This relies on the map iterator object telling us the shape
- of the new array in nd and dimensions.
- */
- temp = mit->ait->ao;
- Py_INCREF(PyArray_DESCR(temp));
- ret = (PyArrayObject *)
- PyArray_NewFromDescr(Py_TYPE(temp),
- PyArray_DESCR(temp),
- mit->nd, mit->dimensions,
- NULL, NULL,
- PyArray_ISFORTRAN(temp),
- (PyObject *)temp);
- if (ret == NULL) {
- return NULL;
- }
+ int index_type = 0;
+ int ellipsis_pos = -1;
/*
- * Now just iterate through the new array filling it in
- * with the next object from the original array as
- * defined by the mapping iterator
+ * The index might be a multi-dimensional index, but not yet a tuple
+ * this makes it a tuple in that case.
+ *
+ * TODO: Refactor into its own function.
*/
+ if (!PyTuple_CheckExact(index)
+ /* Next three are just to avoid slow checks */
+#if !defined(NPY_PY3K)
+ && (!PyInt_CheckExact(index))
+#else
+ && (!PyLong_CheckExact(index))
+#endif
+ && (index != Py_None)
+ && (!PySlice_Check(index))
+ && (!PyArray_Check(index))
+ && (PySequence_Check(index))) {
+ /*
+ * Sequences < NPY_MAXDIMS with any slice objects
+ * or newaxis, Ellipsis or other arrays or sequences
+ * embedded, are considered equivalent to an indexing
+ * tuple. (`a[[[1,2], [3,4]]] == a[[1,2], [3,4]]`)
+ */
- if ((it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)ret)) == NULL) {
- Py_DECREF(ret);
- return NULL;
- }
- counter = it->size;
- swap = (PyArray_ISNOTSWAPPED(temp) != PyArray_ISNOTSWAPPED(ret));
- copyswap = PyArray_DESCR(ret)->f->copyswap;
- PyArray_MapIterReset(mit);
- while (counter--) {
- copyswap(it->dataptr, mit->dataptr, swap, ret);
- PyArray_MapIterNext(mit);
- PyArray_ITER_NEXT(it);
- }
- Py_DECREF(it);
+ if (PyTuple_Check(index)) {
+ /* If it is already a tuple, make it an exact tuple anyway */
+ n = 0;
+ make_tuple = 1;
+ }
+ n = PySequence_Size(index);
+ if (n < 0 || n >= NPY_MAXDIMS) {
+ n = 0;
+ }
+ for (i = 0; i < n; i++) {
+ PyObject *tmp_obj = PySequence_GetItem(index, i);
+ if (tmp_obj == NULL) {
+ make_tuple = 1;
+ break;
+ }
+ if (PyArray_Check(tmp_obj) || PySequence_Check(tmp_obj)
+ || PySlice_Check(tmp_obj) || tmp_obj == Py_Ellipsis
+ || tmp_obj == Py_None) {
+ make_tuple = 1;
+ Py_DECREF(tmp_obj);
+ break;
+ }
+ Py_DECREF(tmp_obj);
+ }
- /* check for consecutive axes */
- if ((mit->subspace != NULL) && (mit->consec)) {
- PyArray_MapIterSwapAxes(mit, &ret, 1);
+ if (make_tuple) {
+ /* We want to interpret it as a tuple, so make it one */
+ index = PySequence_Tuple(index);
+ if (index == NULL) {
+ return -1;
+ }
+ }
}
- return (PyObject *)ret;
-}
-NPY_NO_EXPORT int
-array_ass_item(PyArrayObject *self, Py_ssize_t i, PyObject *v)
-{
- return array_ass_item_object(self, (npy_intp) i, v);
-}
-
-static int
-PyArray_SetMap(PyArrayMapIterObject *mit, PyObject *op)
-{
- PyArrayObject *arr = NULL;
- PyArrayIterObject *it;
- npy_intp counter;
- int swap;
- PyArray_CopySwapFunc *copyswap;
- PyArray_Descr *descr;
-
- /* Unbound Map Iterator */
- if (mit->ait == NULL) {
- return -1;
- }
- descr = PyArray_DESCR(mit->ait->ao);
- Py_INCREF(descr);
- arr = (PyArrayObject *)PyArray_FromAny(op, descr,
- 0, 0, NPY_ARRAY_FORCECAST, NULL);
- if (arr == NULL) {
- return -1;
+ /* If the index is not a tuple, handle it the same as (index,) */
+ if (!PyTuple_CheckExact(index)) {
+ obj = index;
+ index_ndim = 1;
}
- if ((mit->subspace != NULL) && (mit->consec)) {
- PyArray_MapIterSwapAxes(mit, &arr, 0);
- if (arr == NULL) {
- return -1;
+ else {
+ n = PyTuple_GET_SIZE(index);
+ if (n > NPY_MAXDIMS * 2) {
+ PyErr_SetString(PyExc_IndexError,
+ "too many indices for array");
+ goto fail;
}
+ index_ndim = (int)n;
+ obj = NULL;
}
- /* Be sure values array is "broadcastable"
- to shape of mit->dimensions, mit->nd */
+ /*
+ * Parse all indices into the `indices` array of index_info structs
+ */
+ used_ndim = 0;
+ new_ndim = 0;
+ fancy_ndim = 0;
+ get_idx = 0;
+ curr_idx = 0;
+
+ while (get_idx < index_ndim) {
+ if (curr_idx > NPY_MAXDIMS * 2) {
+ PyErr_SetString(PyExc_IndexError,
+ "too many indices for array");
+ goto failed_building_indices;
+ }
- if ((it = (PyArrayIterObject *)\
- PyArray_BroadcastToShape((PyObject *)arr,
- mit->dimensions, mit->nd))==NULL) {
- Py_DECREF(arr);
- return -1;
- }
+ /* Check for single index. obj is already set then. */
+ if ((curr_idx != 0) || (obj == NULL)) {
+ obj = PyTuple_GET_ITEM(index, get_idx++);
+ }
+ else {
+ /* only one loop */
+ get_idx += 1;
+ }
+
+ /**** Try the cascade of possible indices ****/
+
+ /* Index is an ellipsis (`...`) */
+ if (obj == Py_Ellipsis) {
+ /*
+ * If there is more then one Ellipsis, it is replaced. Deprecated,
+ * since it is hard to imagine anyone using two Ellipsis and
+ * actually planning on all but the first being automatically
+ * replaced with a slice.
+ */
+ if (index_type & HAS_ELLIPSIS) {
+ if (DEPRECATE(
+ "an index can only have a single Ellipsis (`...`); "
+ "replace all but one with slices (`:`).") < 0) {
+ goto failed_building_indices;
+ }
+ index_type |= HAS_SLICE;
- counter = mit->size;
- swap = (PyArray_ISNOTSWAPPED(mit->ait->ao) !=
- (PyArray_ISNOTSWAPPED(arr)));
- copyswap = PyArray_DESCR(arr)->f->copyswap;
- PyArray_MapIterReset(mit);
- /* Need to decref arrays with objects in them */
- if (PyDataType_FLAGCHK(descr, NPY_ITEM_HASOBJECT)) {
- while (counter--) {
- PyArray_Item_INCREF(it->dataptr, PyArray_DESCR(arr));
- PyArray_Item_XDECREF(mit->dataptr, PyArray_DESCR(arr));
- memmove(mit->dataptr, it->dataptr, PyArray_ITEMSIZE(arr));
- /* ignored unless VOID array with object's */
- if (swap) {
- copyswap(mit->dataptr, NULL, swap, arr);
+ indices[curr_idx].type = HAS_SLICE;
+ indices[curr_idx].object = PySlice_New(NULL, NULL, NULL);
+
+ if (indices[curr_idx].object == NULL) {
+ goto failed_building_indices;
+ }
+
+ used_ndim += 1;
+ new_ndim += 1;
+ curr_idx += 1;
+ continue;
}
- PyArray_MapIterNext(mit);
- PyArray_ITER_NEXT(it);
+ index_type |= HAS_ELLIPSIS;
+
+ indices[curr_idx].type = HAS_ELLIPSIS;
+ indices[curr_idx].object = NULL;
+ /* number of slices it is worth, won't update if it is 0: */
+ indices[curr_idx].value = 0;
+
+ ellipsis_pos = curr_idx;
+ /* the used and new ndim will be found later */
+ used_ndim += 0;
+ new_ndim += 0;
+ curr_idx += 1;
+ continue;
}
- Py_DECREF(arr);
- Py_DECREF(it);
- return 0;
- }
- else {
- while(counter--) {
- memmove(mit->dataptr, it->dataptr, PyArray_ITEMSIZE(arr));
- if (swap) {
- copyswap(mit->dataptr, NULL, swap, arr);
- }
- PyArray_MapIterNext(mit);
- PyArray_ITER_NEXT(it);
+
+ /* Index is np.newaxis/None */
+ else if (obj == Py_None) {
+ index_type |= HAS_NEWAXIS;
+
+ indices[curr_idx].type = HAS_NEWAXIS;
+ indices[curr_idx].object = NULL;
+
+ used_ndim += 0;
+ new_ndim += 1;
+ curr_idx += 1;
+ continue;
}
- Py_DECREF(arr);
- Py_DECREF(it);
- return 0;
- }
-}
-NPY_NO_EXPORT int
-count_new_axes_0d(PyObject *tuple)
-{
- int i, argument_count;
- int ellipsis_count = 0;
- int newaxis_count = 0;
+ /* Index is a slice object. */
+ else if (PySlice_Check(obj)) {
+ index_type |= HAS_SLICE;
- argument_count = PyTuple_GET_SIZE(tuple);
- for (i = 0; i < argument_count; ++i) {
- PyObject *arg = PyTuple_GET_ITEM(tuple, i);
- if (arg == Py_Ellipsis && !ellipsis_count) {
- ellipsis_count++;
+ Py_INCREF(obj);
+ indices[curr_idx].object = obj;
+ indices[curr_idx].type = HAS_SLICE;
+ used_ndim += 1;
+ new_ndim += 1;
+ curr_idx += 1;
+ continue;
}
- else if (arg == Py_None) {
- newaxis_count++;
+
+ /*
+ * Special case to allow 0-d boolean indexing with scalars.
+ * Should be removed after boolean as integer deprecation.
+ * Since this is always an error if it was not a boolean, we can
+ * allow the 0-d special case before the rest.
+ */
+ else if (PyArray_NDIM(self) != 0) {
+ /*
+ * Single integer index, there are two cases here.
+ * It could be an array, a 0-d array is handled
+ * a bit weird however, so need to special case it.
+ */
+#if !defined(NPY_PY3K)
+ if (PyInt_CheckExact(obj) || !PyArray_Check(obj)) {
+#else
+ if (PyLong_CheckExact(obj) || !PyArray_Check(obj)) {
+#endif
+ i = PyArray_PyIntAsIntp(obj);
+ if ((i == -1) && PyErr_Occurred()) {
+ PyErr_Clear();
+ }
+ else {
+ index_type |= HAS_INTEGER;
+ indices[curr_idx].object = NULL;
+ indices[curr_idx].value = i;
+ indices[curr_idx].type = HAS_INTEGER;
+ used_ndim += 1;
+ new_ndim += 0;
+ curr_idx += 1;
+ continue;
+ }
+ }
}
- else {
- break;
+
+ /*
+ * At this point, we must have an index array (or array-like).
+ * It might still be a (purely) bool special case, a 0-d integer
+ * array (an array scalar) or something invalid.
+ */
+
+ if (!PyArray_Check(obj)) {
+ PyArrayObject *tmp_arr;
+ tmp_arr = (PyArrayObject *)PyArray_FromAny(obj, NULL, 0, 0, 0, NULL);
+ if (tmp_arr == NULL) {
+ /* TODO: Should maybe replace the error here? */
+ goto failed_building_indices;
+ }
+
+ /*
+ * For example an empty list can be cast to an integer array,
+ * however it will default to a float one.
+ */
+ if (PyArray_SIZE(tmp_arr) == 0) {
+ PyArray_Descr *indtype = PyArray_DescrFromType(NPY_INTP);
+
+ arr = (PyArrayObject *)PyArray_FromArray(tmp_arr, indtype,
+ NPY_ARRAY_FORCECAST);
+ Py_DECREF(tmp_arr);
+ if (arr == NULL) {
+ goto failed_building_indices;
+ }
+ }
+ /*
+ * Special case to allow 0-d boolean indexing with
+ * scalars. Should be removed after boolean-array
+ * like as integer-array like deprecation.
+ * (does not cover ufunc.at, because it does not use the
+ * boolean special case, but that should not matter...)
+ * Since all but strictly boolean indices are invalid,
+ * there is no need for any further conversion tries.
+ */
+ else if (PyArray_NDIM(self) == 0) {
+ arr = tmp_arr;
+ }
+ else {
+ /*
+ * These Checks can be removed after deprecation, since
+ * they should then be either correct already or error out
+ * later just like a normal array.
+ */
+ if (PyArray_ISBOOL(tmp_arr)) {
+ if (DEPRECATE_FUTUREWARNING(
+ "in the future, boolean array-likes will be "
+ "handled as a boolean array index") < 0) {
+ Py_DECREF(tmp_arr);
+ goto failed_building_indices;
+ }
+ if (PyArray_NDIM(tmp_arr) == 0) {
+ /*
+ * Need to raise an error here, since the
+ * DeprecationWarning before was not triggered.
+ * TODO: A `False` triggers a Deprecation *not* a
+ * a FutureWarning.
+ */
+ PyErr_SetString(PyExc_IndexError,
+ "in the future, 0-d boolean arrays will be "
+ "interpreted as a valid boolean index");
+ Py_DECREF(tmp_arr);
+ goto failed_building_indices;
+ }
+ else {
+ arr = tmp_arr;
+ }
+ }
+ /*
+ * Note: Down the road, the integers will be cast to intp.
+ * The user has to make sure they can be safely cast.
+ * If not, we might index wrong instead of an giving
+ * an error.
+ */
+ else if (!PyArray_ISINTEGER(tmp_arr)) {
+ if (PyArray_NDIM(tmp_arr) == 0) {
+ /* match integer deprecation warning */
+ if (DEPRECATE(
+ "using a non-integer number instead of an "
+ "integer will result in an error in the "
+ "future") < 0) {
+
+ /* The error message raised in the future */
+ PyErr_SetString(PyExc_IndexError,
+ "only integers, slices (`:`), ellipsis (`...`), "
+ "numpy.newaxis (`None`) and integer or boolean "
+ "arrays are valid indices");
+ Py_DECREF((PyObject *)tmp_arr);
+ goto failed_building_indices;
+ }
+ }
+ else {
+ if (DEPRECATE(
+ "non integer (and non boolean) array-likes "
+ "will not be accepted as indices in the "
+ "future") < 0) {
+
+ /* Error message to be raised in the future */
+ PyErr_SetString(PyExc_IndexError,
+ "non integer (and non boolean) array-likes will "
+ "not be accepted as indices in the future");
+ Py_DECREF((PyObject *)tmp_arr);
+ goto failed_building_indices;
+ }
+ }
+ }
+
+ arr = (PyArrayObject *)PyArray_FromArray(tmp_arr,
+ PyArray_DescrFromType(NPY_INTP),
+ NPY_ARRAY_FORCECAST);
+
+ if (arr == NULL) {
+ /* Since this will be removed, handle this later */
+ PyErr_Clear();
+ arr = tmp_arr;
+ }
+ else {
+ Py_DECREF((PyObject *)tmp_arr);
+ }
+ }
}
- }
- if (i < argument_count) {
- PyErr_SetString(PyExc_IndexError,
- "0-d arrays can only use a single ()"
- " or a list of newaxes (and a single ...)"
- " as an index");
- return -1;
- }
- if (newaxis_count > NPY_MAXDIMS) {
- PyErr_SetString(PyExc_IndexError, "too many dimensions");
- return -1;
- }
- return newaxis_count;
-}
+ else {
+ Py_INCREF(obj);
+ arr = (PyArrayObject *)obj;
+ }
+
+ /* Check if the array is valid and fill the information */
+ if (PyArray_ISBOOL(arr)) {
+ /*
+ * There are two types of boolean indices (which are equivalent,
+ * for the most part though). A single boolean index of matching
+ * dimensionality and size is a boolean index.
+ * If this is not the case, it is instead expanded into (multiple)
+ * integer array indices.
+ */
+ PyArrayObject *nonzero_result[NPY_MAXDIMS];
+
+ if ((index_ndim == 1) && allow_boolean) {
+ /*
+ * If ndim and size match, this can be optimized as a single
+ * boolean index. The size check is necessary only to support
+ * old non-matching sizes by using fancy indexing instead.
+ * The reason for that is that fancy indexing uses nonzero,
+ * and only the result of nonzero is checked for legality.
+ */
+ if ((PyArray_NDIM(arr) == PyArray_NDIM(self))
+ && PyArray_SIZE(arr) == PyArray_SIZE(self)) {
+
+ index_type = HAS_BOOL;
+ indices[curr_idx].type = HAS_BOOL;
+ indices[curr_idx].object = (PyObject *)arr;
+
+ /* keep track anyway, just to be complete */
+ used_ndim = PyArray_NDIM(self);
+ fancy_ndim = PyArray_NDIM(self);
+ curr_idx += 1;
+ break;
+ }
+ }
-NPY_NO_EXPORT PyObject *
-add_new_axes_0d(PyArrayObject *arr, int newaxis_count)
-{
- PyArrayObject *ret;
- npy_intp dimensions[NPY_MAXDIMS];
- int i;
+ if (PyArray_NDIM(arr) == 0) {
+ /*
+ * TODO, WARNING: This code block cannot be used due to
+ * FutureWarnings at this time. So instead
+ * just raise an IndexError.
+ */
+ PyErr_SetString(PyExc_IndexError,
+ "in the future, 0-d boolean arrays will be "
+ "interpreted as a valid boolean index");
+ Py_DECREF((PyObject *)arr);
+ goto failed_building_indices;
+ /*
+ * This can actually be well defined. A new axis is added,
+ * but at the same time no axis is "used". So if we have True,
+ * we add a new axis (a bit like with np.newaxis). If it is
+ * False, we add a new axis, but this axis has 0 entries.
+ */
+
+ index_type |= HAS_FANCY;
+ indices[curr_idx].type = HAS_0D_BOOL;
+
+ /* TODO: This can't fail, right? Is there a faster way? */
+ if (PyObject_IsTrue((PyObject *)arr)) {
+ n = 1;
+ }
+ else {
+ n = 0;
+ }
+ indices[curr_idx].object = PyArray_Zeros(1, &n,
+ PyArray_DescrFromType(NPY_INTP), 0);
+ Py_DECREF(arr);
- for (i = 0; i < newaxis_count; ++i) {
- dimensions[i] = 1;
- }
- Py_INCREF(PyArray_DESCR(arr));
- ret = (PyArrayObject *)PyArray_NewFromDescr(Py_TYPE(arr),
- PyArray_DESCR(arr),
- newaxis_count, dimensions,
- NULL, PyArray_DATA(arr),
- PyArray_FLAGS(arr),
- (PyObject *)arr);
- if (ret == NULL) {
- return NULL;
- }
+ if (indices[curr_idx].object == NULL) {
+ goto failed_building_indices;
+ }
- Py_INCREF(arr);
- if (PyArray_SetBaseObject(ret, (PyObject *)arr) < 0) {
- Py_DECREF(ret);
- return NULL;
- }
+ used_ndim += 0;
+ if (fancy_ndim < 1) {
+ fancy_ndim = 1;
+ }
+ curr_idx += 1;
+ continue;
+ }
- return (PyObject *)ret;
-}
+ /* Convert the boolean array into multiple integer ones */
+ n = _nonzero_indices((PyObject *)arr, nonzero_result);
+ Py_DECREF(arr);
+ if (n < 0) {
+ goto failed_building_indices;
+ }
-/* This checks the args for any fancy indexing objects */
+ /* Check that we will not run out of indices to store new ones */
+ if (curr_idx + n >= NPY_MAXDIMS * 2) {
+ PyErr_SetString(PyExc_IndexError,
+ "too many indices for array");
+ for (i=0; i < n; i++) {
+ Py_DECREF(nonzero_result[i]);
+ }
+ goto failed_building_indices;
+ }
-static int
-fancy_indexing_check(PyObject *args)
-{
- int i, n;
- int retval = SOBJ_NOTFANCY;
+ /* Add the arrays from the nonzero result to the index */
+ index_type |= HAS_FANCY;
+ for (i=0; i < n; i++) {
+ indices[curr_idx].type = HAS_FANCY;
+ indices[curr_idx].object = (PyObject *)nonzero_result[i];
- if (PyTuple_Check(args)) {
- n = PyTuple_GET_SIZE(args);
- if (n >= NPY_MAXDIMS) {
- return SOBJ_TOOMANY;
- }
- for (i = 0; i < n; i++) {
- PyObject *obj = PyTuple_GET_ITEM(args,i);
- if (PyArray_Check(obj)) {
- int type_num = PyArray_DESCR((PyArrayObject *)obj)->type_num;
- if (PyTypeNum_ISINTEGER(type_num) ||
- PyTypeNum_ISBOOL(type_num)) {
- retval = SOBJ_ISFANCY;
+ used_ndim += 1;
+ curr_idx += 1;
+ }
+
+ /* All added indices have 1 dimension */
+ if (fancy_ndim < 1) {
+ fancy_ndim = 1;
+ }
+ continue;
+ }
+
+ /* Normal case of an integer array */
+ else if (PyArray_ISINTEGER(arr)) {
+ if (PyArray_NDIM(arr) == 0) {
+ /*
+ * A 0-d integer array is an array scalar and can
+ * be dealt with the HAS_SCALAR_ARRAY flag.
+ * We could handle 0-d arrays early on, but this makes
+ * sure that array-likes or odder arrays are always
+ * handled right.
+ */
+ i = PyArray_PyIntAsIntp((PyObject *)arr);
+ Py_DECREF(arr);
+ if ((i == -1) && PyErr_Occurred()) {
+ goto failed_building_indices;
}
else {
- retval = SOBJ_BADARRAY;
- break;
+ index_type |= (HAS_INTEGER | HAS_SCALAR_ARRAY);
+ indices[curr_idx].object = NULL;
+ indices[curr_idx].value = i;
+ indices[curr_idx].type = HAS_INTEGER;
+ used_ndim += 1;
+ new_ndim += 0;
+ curr_idx += 1;
+ continue;
}
}
- else if (PySequence_Check(obj)) {
- retval = SOBJ_ISFANCY;
+
+ index_type |= HAS_FANCY;
+ indices[curr_idx].type = HAS_FANCY;
+ indices[curr_idx].object = (PyObject *)arr;
+
+ used_ndim += 1;
+ if (fancy_ndim < PyArray_NDIM(arr)) {
+ fancy_ndim = PyArray_NDIM(arr);
}
+ curr_idx += 1;
+ continue;
}
- }
- else if (PyArray_Check(args)) {
- int type_num = PyArray_DESCR((PyArrayObject *)args)->type_num;
- if (PyTypeNum_ISINTEGER(type_num) || PyTypeNum_ISBOOL(type_num)) {
- return SOBJ_ISFANCY;
+
+ /*
+ * The array does not have a valid type.
+ */
+ if ((PyObject *)arr == obj) {
+ /* The input was an array already */
+ PyErr_SetString(PyExc_IndexError,
+ "arrays used as indices must be of integer (or boolean) type");
}
else {
- return SOBJ_BADARRAY;
+ /* The input was not an array, so give a general error message */
+ PyErr_SetString(PyExc_IndexError,
+ "only integers, slices (`:`), ellipsis (`...`), "
+ "numpy.newaxis (`None`) and integer or boolean "
+ "arrays are valid indices");
}
+ Py_DECREF(arr);
+ goto failed_building_indices;
+ }
+
+ /*
+ * Compare dimension of the index to the real ndim. this is
+ * to find the ellipsis value or append an ellipsis if necessary.
+ */
+ if (used_ndim < PyArray_NDIM(self)) {
+ if (index_type & HAS_ELLIPSIS) {
+ indices[ellipsis_pos].value = PyArray_NDIM(self) - used_ndim;
+ used_ndim = PyArray_NDIM(self);
+ new_ndim += indices[ellipsis_pos].value;
+ }
+ else {
+ /*
+ * There is no ellipsis yet, but it is not a full index
+ * so we append an ellipsis to the end.
+ */
+ index_type |= HAS_ELLIPSIS;
+ indices[curr_idx].object = NULL;
+ indices[curr_idx].type = HAS_ELLIPSIS;
+ indices[curr_idx].value = PyArray_NDIM(self) - used_ndim;
+ ellipsis_pos = curr_idx;
+
+ used_ndim = PyArray_NDIM(self);
+ new_ndim += indices[curr_idx].value;
+ curr_idx += 1;
+ }
+ }
+ else if (used_ndim > PyArray_NDIM(self)) {
+ PyErr_SetString(PyExc_IndexError,
+ "too many indices for array");
+ goto failed_building_indices;
}
- else if (PySequence_Check(args)) {
+ else if (index_ndim == 0) {
/*
- * Sequences < NPY_MAXDIMS with any slice objects
- * or newaxis, or Ellipsis is considered standard
- * as long as there are also no Arrays and or additional
- * sequences embedded.
+ * 0-d index into 0-d array, i.e. array[()]
+ * We consider this an integer index. Which means it will return
+ * the scalar.
+ * This makes sense, because then array[...] gives
+ * an array and array[()] gives the scalar.
*/
- retval = SOBJ_ISFANCY;
- n = PySequence_Size(args);
- if (n < 0 || n >= NPY_MAXDIMS) {
- return SOBJ_ISFANCY;
+ used_ndim = 0;
+ index_type = HAS_INTEGER;
+ }
+
+ /* HAS_SCALAR_ARRAY requires cleaning up the index_type */
+ if (index_type & HAS_SCALAR_ARRAY) {
+ /* clear as info is unnecessary and makes life harder later */
+ if (index_type & HAS_FANCY) {
+ index_type -= HAS_SCALAR_ARRAY;
}
- for (i = 0; i < n; i++) {
- PyObject *obj = PySequence_GetItem(args, i);
- if (obj == NULL) {
- return SOBJ_ISFANCY;
- }
- if (PyArray_Check(obj)) {
- int type_num = PyArray_DESCR((PyArrayObject *)obj)->type_num;
- if (PyTypeNum_ISINTEGER(type_num) ||
- PyTypeNum_ISBOOL(type_num)) {
- retval = SOBJ_LISTTUP;
- }
- else {
- retval = SOBJ_BADARRAY;
- }
- }
- else if (PySequence_Check(obj)) {
- retval = SOBJ_LISTTUP;
- }
- else if (PySlice_Check(obj) || obj == Py_Ellipsis ||
- obj == Py_None) {
- retval = SOBJ_NOTFANCY;
- }
- Py_DECREF(obj);
- if (retval > SOBJ_ISFANCY) {
- return retval;
- }
+ /* A full integer index sees array scalars as part of itself */
+ else if (index_type == (HAS_INTEGER | HAS_SCALAR_ARRAY)) {
+ index_type -= HAS_SCALAR_ARRAY;
}
}
- return retval;
+
+ /*
+ * At this point indices are all set correctly, no bounds checking
+ * has been made and the new array may still have more dimensions
+ * then is possible.
+ *
+ * Check this now so we do not have to worry about it later.
+ * It can happen for fancy indexing or with newaxis.
+ * This means broadcasting errors in the case of too many dimensions
+ * take less priority.
+ */
+ if (index_type & (HAS_NEWAXIS | HAS_FANCY)) {
+ if (new_ndim + fancy_ndim > NPY_MAXDIMS) {
+ PyErr_Format(PyExc_IndexError,
+ "number of dimensions must be within [0, %d], "
+ "indexing result would have %d",
+ NPY_MAXDIMS, (new_ndim + fancy_ndim));
+ goto failed_building_indices;
+ }
+ }
+
+ *num = curr_idx;
+ *ndim = new_ndim + fancy_ndim;
+ *out_fancy_ndim = fancy_ndim;
+
+ if (make_tuple) {
+ Py_DECREF(index);
+ }
+
+ return index_type;
+
+ failed_building_indices:
+ for (i=0; i < curr_idx; i++) {
+ Py_XDECREF(indices[i].object);
+ }
+ fail:
+ if (make_tuple) {
+ Py_DECREF(index);
+ }
+ return -1;
}
-/*
- * Called when treating array object like a mapping -- called first from
- * Python when using a[object] unless object is a standard slice object
- * (not an extended one).
+
+/**
+ * Get pointer for an integer index.
*
- * There are two situations:
+ * For a purely integer index, set ptr to the memory address.
+ * Returns 0 on success, -1 on failure.
+ * The caller must ensure that the index is a full integer
+ * one.
*
- * 1 - the subscript is a standard view and a reference to the
- * array can be returned
+ * @param Array being indexed
+ * @param result pointer
+ * @param parsed index information
+ * @param number of indices
*
- * 2 - the subscript uses Boolean masks or integer indexing and
- * therefore a new array is created and returned.
+ * @return 0 on success -1 on failure
*/
+static int
+get_item_pointer(PyArrayObject *self, char **ptr,
+ npy_index_info *indices, int index_num) {
+ int i;
+ *ptr = PyArray_BYTES(self);
+ for (i=0; i < index_num; i++) {
+ if ((check_and_adjust_index(&(indices[i].value),
+ PyArray_DIMS(self)[i], i, NULL)) < 0) {
+ return -1;
+ }
+ *ptr += PyArray_STRIDE(self, i) * indices[i].value;
+ }
+ return 0;
+}
-NPY_NO_EXPORT PyObject *
-array_subscript_simple(PyArrayObject *self, PyObject *op, int check_index)
-{
- npy_intp dimensions[NPY_MAXDIMS], strides[NPY_MAXDIMS];
- npy_intp offset;
- int nd;
- PyArrayObject *ret;
- npy_intp value;
- if (!(PyArray_Check(op) && (PyArray_SIZE((PyArrayObject*)op) > 1))) {
- value = PyArray_PyIntAsIntp(op);
+/**
+ * Get view into an array using all non-array indices.
+ *
+ * For any index, get a view of the subspace into the original
+ * array. If there are no fancy indices, this is the result of
+ * the indexing operation.
+ * Ensure_array allows to fetch a safe subspace view for advanced
+ * indexing.
+ *
+ * @param Array being indexed
+ * @param resulting array (new reference)
+ * @param parsed index information
+ * @param number of indices
+ * @param Whether result should inherit the type from self
+ *
+ * @return 0 on success -1 on failure
+ */
+static int
+get_view_from_index(PyArrayObject *self, PyArrayObject **view,
+ npy_index_info *indices, int index_num, int ensure_array) {
+ npy_intp new_strides[NPY_MAXDIMS];
+ npy_intp new_shape[NPY_MAXDIMS];
+ int i, j;
+ int new_dim = 0;
+ int orig_dim = 0;
+ char *data_ptr = PyArray_BYTES(self);
+
+ /* for slice parsing */
+ npy_intp start, stop, step, n_steps;
+
+ for (i=0; i < index_num; i++) {
+ switch (indices[i].type) {
+ case HAS_INTEGER:
+ if ((check_and_adjust_index(&indices[i].value,
+ PyArray_DIMS(self)[orig_dim], orig_dim,
+ NULL)) < 0) {
+ return -1;
+ }
+ data_ptr += PyArray_STRIDE(self, orig_dim) * indices[i].value;
- if (value == -1 && PyErr_Occurred()) {
- if (PyErr_ExceptionMatches(PyExc_TypeError)) {
- /* Operand is not an integer type */
- PyErr_Clear();
- }
- else {
- PyErr_SetString(PyExc_IndexError,
- "cannot convert index to integer");
- return NULL;
- }
- }
- else {
- return array_item_asarray(self, value);
- }
- }
+ new_dim += 0;
+ orig_dim += 1;
+ break;
+ case HAS_ELLIPSIS:
+ for (j=0; j < indices[i].value; j++) {
+ new_strides[new_dim] = PyArray_STRIDE(self, orig_dim);
+ new_shape[new_dim] = PyArray_DIMS(self)[orig_dim];
+ new_dim += 1;
+ orig_dim += 1;
+ }
+ break;
+ case HAS_SLICE:
+ if (slice_GetIndices((PySliceObject *)indices[i].object,
+ PyArray_DIMS(self)[orig_dim],
+ &start, &stop, &step, &n_steps) < 0) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_IndexError, "invalid slice");
+ }
+ return -1;
+ }
+ if (n_steps <= 0) {
+ /* TODO: Always points to start then, could change that */
+ n_steps = 0;
+ step = 1;
+ start = 0;
+ }
- /* Standard (view-based) Indexing */
- nd = parse_index(self, op, dimensions,
- strides, &offset, check_index);
- if (nd == -1) {
- return NULL;
+ data_ptr += PyArray_STRIDE(self, orig_dim) * start;
+ new_strides[new_dim] = PyArray_STRIDE(self, orig_dim) * step;
+ new_shape[new_dim] = n_steps;
+ new_dim += 1;
+ orig_dim += 1;
+ break;
+ case HAS_NEWAXIS:
+ new_strides[new_dim] = 0;
+ new_shape[new_dim] = 1;
+ new_dim += 1;
+ break;
+ /* Fancy and 0-d boolean indices are ignored here */
+ case HAS_0D_BOOL:
+ break;
+ default:
+ new_dim += 0;
+ orig_dim += 1;
+ break;
+ }
}
- /* Create a view using the indexing result */
+ /* Create the new view and set the base array */
Py_INCREF(PyArray_DESCR(self));
- ret = (PyArrayObject *)PyArray_NewFromDescr(Py_TYPE(self),
+ *view = (PyArrayObject *)PyArray_NewFromDescr(
+ ensure_array ? &PyArray_Type : Py_TYPE(self),
PyArray_DESCR(self),
- nd, dimensions,
- strides, PyArray_BYTES(self) + offset,
+ new_dim, new_shape,
+ new_strides, data_ptr,
PyArray_FLAGS(self),
- (PyObject *)self);
- if (ret == NULL) {
- return NULL;
+ ensure_array ? NULL : (PyObject *)self);
+ if (*view == NULL) {
+ return -1;
}
+
Py_INCREF(self);
- if (PyArray_SetBaseObject(ret, (PyObject *)self) < 0) {
- Py_DECREF(ret);
- return NULL;
+ if (PyArray_SetBaseObject(*view, (PyObject *)self) < 0) {
+ Py_DECREF(*view);
+ return -1;
}
- PyArray_UpdateFlags(ret, NPY_ARRAY_UPDATE_ALL);
- return (PyObject *)ret;
+ return 0;
}
+
/*
* Implements boolean indexing. This produces a one-dimensional
* array which picks out all of the elements of 'self' for which
@@ -626,36 +938,15 @@ array_boolean_subscript(PyArrayObject *self,
PyArray_Descr *dtype;
PyArrayObject *ret;
int needs_api = 0;
- npy_intp bmask_size;
-
- if (PyArray_DESCR(bmask)->type_num != NPY_BOOL) {
- PyErr_SetString(PyExc_TypeError,
- "NumPy boolean array indexing requires a boolean index");
- return NULL;
- }
-
- if (PyArray_NDIM(bmask) != PyArray_NDIM(self)) {
- PyErr_SetString(PyExc_ValueError,
- "The boolean mask assignment indexing array "
- "must have the same number of dimensions as "
- "the array being indexed");
- return NULL;
- }
-
size = count_boolean_trues(PyArray_NDIM(bmask), PyArray_DATA(bmask),
PyArray_DIMS(bmask), PyArray_STRIDES(bmask));
- /* Correction factor for broadcasting 'bmask' to 'self' */
- bmask_size = PyArray_SIZE(bmask);
- if (bmask_size > 0) {
- size *= PyArray_SIZE(self) / bmask_size;
- }
/* Allocate the output of the boolean indexing */
dtype = PyArray_DESCR(self);
Py_INCREF(dtype);
- ret = (PyArrayObject *)PyArray_NewFromDescr(Py_TYPE(self), dtype, 1, &size,
- NULL, NULL, 0, (PyObject *)self);
+ ret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, dtype, 1, &size,
+ NULL, NULL, 0, NULL);
if (ret == NULL) {
return NULL;
}
@@ -679,6 +970,7 @@ array_boolean_subscript(PyArrayObject *self,
npy_intp self_stride, bmask_stride, subloopsize;
char *self_data;
char *bmask_data;
+ NPY_BEGIN_THREADS_DEF;
/* Set up the iterator */
flags = NPY_ITER_EXTERNAL_LOOP | NPY_ITER_REFS_OK;
@@ -713,6 +1005,9 @@ array_boolean_subscript(PyArrayObject *self,
NPY_AUXDATA_FREE(transferdata);
return NULL;
}
+
+ NPY_BEGIN_THREADS_NDITER(iter);
+
innerstrides = NpyIter_GetInnerStrideArray(iter);
dataptrs = NpyIter_GetDataPtrArray(iter);
@@ -740,10 +1035,34 @@ array_boolean_subscript(PyArrayObject *self,
}
} while (iternext(iter));
+ NPY_END_THREADS;
+
NpyIter_Deallocate(iter);
NPY_AUXDATA_FREE(transferdata);
}
+ if (!PyArray_CheckExact(self)) {
+ PyArrayObject *tmp = ret;
+
+ Py_INCREF(dtype);
+ ret = (PyArrayObject *)PyArray_NewFromDescr(Py_TYPE(self), dtype, 1,
+ &size, PyArray_STRIDES(ret), PyArray_BYTES(ret),
+ 0, (PyObject *)self);
+
+ if (ret == NULL) {
+ Py_DECREF(tmp);
+ return NULL;
+ }
+
+ if (PyArray_SetBaseObject(ret, (PyObject *)tmp) < 0) {
+ Py_DECREF(ret);
+ return NULL;
+ }
+ if (_IsWriteable(ret)) {
+ PyArray_ENABLEFLAGS(ret, NPY_ARRAY_WRITEABLE);
+ }
+ }
+
return ret;
}
@@ -760,7 +1079,7 @@ array_boolean_subscript(PyArrayObject *self,
* Returns 0 on success, -1 on failure.
*/
NPY_NO_EXPORT int
-array_ass_boolean_subscript(PyArrayObject *self,
+array_assign_boolean_subscript(PyArrayObject *self,
PyArrayObject *bmask, PyArrayObject *v, NPY_ORDER order)
{
npy_intp size, src_itemsize, v_stride;
@@ -834,6 +1153,7 @@ array_ass_boolean_subscript(PyArrayObject *self,
npy_intp self_stride, bmask_stride, subloopsize;
char *self_data;
char *bmask_data;
+ NPY_BEGIN_THREADS_DEF;
/* Set up the iterator */
flags = NPY_ITER_EXTERNAL_LOOP | NPY_ITER_REFS_OK;
@@ -852,6 +1172,9 @@ array_ass_boolean_subscript(PyArrayObject *self,
NpyIter_Deallocate(iter);
return -1;
}
+
+ NPY_BEGIN_THREADS_NDITER(iter);
+
innerstrides = NpyIter_GetInnerStrideArray(iter);
dataptrs = NpyIter_GetDataPtrArray(iter);
@@ -893,119 +1216,96 @@ array_ass_boolean_subscript(PyArrayObject *self,
}
} while (iternext(iter));
+ NPY_END_THREADS;
+
NPY_AUXDATA_FREE(transferdata);
NpyIter_Deallocate(iter);
}
+ if (needs_api) {
+ /*
+ * FIXME?: most assignment operations stop after the first occurrence
+ * of an error. Boolean does not currently, but should at least
+ * report the error. (This is only relevant for things like str->int
+ * casts which call into python)
+ */
+ if (PyErr_Occurred()) {
+ return -1;
+ }
+ }
+
return 0;
}
-/* Check if ind is a tuple and if it has as many elements as arr has axes. */
-static NPY_INLINE int
-_is_full_index(PyObject *ind, PyArrayObject *arr)
-{
- return PyTuple_Check(ind) && (PyTuple_GET_SIZE(ind) == PyArray_NDIM(arr));
-}
-
/*
- * Returns 0 if tuple-object seq is not a tuple of integers.
- * If the return value is positive, vals will be filled with the elements
- * from the tuple.
+ * C-level integer indexing always returning an array and never a scalar.
+ * Works also for subclasses, but it will not be called on one from the
+ * Python API.
+ *
+ * This function does not accept negative indices because it is called by
+ * PySequence_GetItem (through array_item) and that converts them to
+ * positive indices.
*/
-static int
-_tuple_of_integers(PyObject *seq, npy_intp *vals, int maxvals)
+NPY_NO_EXPORT PyObject *
+array_item_asarray(PyArrayObject *self, npy_intp i)
{
- int i;
- PyObject *obj;
- npy_intp temp;
+ npy_index_info indices[2];
+ PyObject *result;
- for(i=0; i<maxvals; i++) {
- obj = PyTuple_GET_ITEM(seq, i);
- if ((PyArray_Check(obj) && PyArray_NDIM((PyArrayObject *)obj) > 0)
- || PyList_Check(obj)) {
- return 0;
- }
- temp = PyArray_PyIntAsIntp(obj);
- if (error_converting(temp)) {
- PyErr_Clear();
- return 0;
- }
- vals[i] = temp;
+ if (PyArray_NDIM(self) == 0) {
+ PyErr_SetString(PyExc_IndexError,
+ "too many indices for array");
+ return NULL;
+ }
+ if (i < 0) {
+ /* This is an error, but undo PySequence_GetItem fix for message */
+ i -= PyArray_DIM(self, 0);
}
- return 1;
-}
-
-/* return TRUE if ellipses are found else return FALSE */
-static npy_bool
-_check_ellipses(PyObject *op)
-{
- if ((op == Py_Ellipsis) || PyString_Check(op) || PyUnicode_Check(op)) {
- return NPY_TRUE;
- }
- else if (PyBool_Check(op) || PyArray_IsScalar(op, Bool) ||
- (PyArray_Check(op) &&
- (PyArray_DIMS((PyArrayObject *)op)==0) &&
- PyArray_ISBOOL((PyArrayObject *)op))) {
- return NPY_TRUE;
- }
- else if (PySequence_Check(op)) {
- Py_ssize_t n, i;
- PyObject *temp;
-
- n = PySequence_Size(op);
- i = 0;
- while (i < n) {
- temp = PySequence_GetItem(op, i);
- if (temp == Py_Ellipsis) {
- Py_DECREF(temp);
- return NPY_TRUE;
- }
- Py_DECREF(temp);
- i++;
- }
+ indices[0].value = i;
+ indices[0].type = HAS_INTEGER;
+ indices[1].value = PyArray_NDIM(self) - 1;
+ indices[1].type = HAS_ELLIPSIS;
+ if (get_view_from_index(self, (PyArrayObject **)&result,
+ indices, 2, 0) < 0) {
+ return NULL;
}
- return NPY_FALSE;
+ return result;
}
+
+/*
+ * Python C-Api level item subscription (implementation for PySequence_GetItem)
+ *
+ * Negative indices are not accepted because PySequence_GetItem converts
+ * them to positive indices before calling this.
+ */
NPY_NO_EXPORT PyObject *
-array_subscript_fancy(PyArrayObject *self, PyObject *op, int fancy)
- {
- int oned;
- PyObject *other;
- PyArrayMapIterObject *mit;
+array_item(PyArrayObject *self, Py_ssize_t i)
+{
+ if (PyArray_NDIM(self) == 1) {
+ char *item;
+ npy_index_info index;
- oned = ((PyArray_NDIM(self) == 1) &&
- !(PyTuple_Check(op) && PyTuple_GET_SIZE(op) > 1));
+ if (i < 0) {
+ /* This is an error, but undo PySequence_GetItem fix for message */
+ i -= PyArray_DIM(self, 0);
+ }
- /* wrap arguments into a mapiter object */
- mit = (PyArrayMapIterObject *) PyArray_MapIterNew(op, oned, fancy);
- if (mit == NULL) {
- return NULL;
- }
- if (oned) {
- PyArrayIterObject *it;
- PyObject *rval;
- it = (PyArrayIterObject *) PyArray_IterNew((PyObject *)self);
- if (it == NULL) {
- Py_DECREF(mit);
+ index.value = i;
+ index.type = HAS_INTEGER;
+ if (get_item_pointer(self, &item, &index, 1) < 0) {
return NULL;
}
- rval = iter_subscript(it, mit->indexobj);
- Py_DECREF(it);
- Py_DECREF(mit);
- return rval;
+ return PyArray_Scalar(item, PyArray_DESCR(self), (PyObject *)self);
}
- if (PyArray_MapIterBind(mit, self) != 0) {
- Py_DECREF(mit);
- return NULL;
+ else {
+ return array_item_asarray(self, i);
}
- other = (PyObject *)PyArray_GetMap(mit);
- Py_DECREF(mit);
- return other;
}
+
/* make sure subscript always returns an array object */
NPY_NO_EXPORT PyObject *
array_subscript_asarray(PyArrayObject *self, PyObject *op)
@@ -1013,317 +1313,421 @@ array_subscript_asarray(PyArrayObject *self, PyObject *op)
return PyArray_EnsureAnyArray(array_subscript(self, op));
}
+
+/*
+ * General function for indexing a NumPy array with a Python object.
+ */
NPY_NO_EXPORT PyObject *
-array_subscript_fromobject(PyArrayObject *self, PyObject *op)
+array_subscript(PyArrayObject *self, PyObject *op)
{
- int fancy;
- npy_intp vals[NPY_MAXDIMS];
-
- /* Integer index */
- if (PyArray_IsIntegerScalar(op) || (PyIndex_Check(op) &&
- !PySequence_Check(op))) {
- npy_intp value = PyArray_PyIntAsIntp(op);
- if (value == -1 && PyErr_Occurred()) {
- /* fail on error */
- PyErr_SetString(PyExc_IndexError,
- "cannot convert index to integer");
+ int index_type;
+ int index_num;
+ int i, ndim, fancy_ndim, fancy;
+ /*
+ * Index info array. We can have twice as many indices as dimensions
+ * (because of None). The + 1 is to not need to check as much.
+ */
+ npy_index_info indices[NPY_MAXDIMS * 2 + 1];
+
+ PyArrayObject *view = NULL;
+ PyObject *result = NULL;
+
+ PyArrayMapIterObject * mit = NULL;
+
+ /* Check for multiple field access */
+ if (PyDataType_HASFIELDS(PyArray_DESCR(self))) {
+ /* Check for single field access */
+ /*
+ * TODO: Moving this code block into the HASFIELDS, means that
+ * string integers temporarily work as indices.
+ */
+ if (PyString_Check(op) || PyUnicode_Check(op)) {
+ PyObject *temp, *obj;
+
+ if (PyDataType_HASFIELDS(PyArray_DESCR(self))) {
+ obj = PyDict_GetItem(PyArray_DESCR(self)->fields, op);
+ if (obj != NULL) {
+ PyArray_Descr *descr;
+ int offset;
+ PyObject *title;
+
+ if (PyArg_ParseTuple(obj, "Oi|O", &descr, &offset, &title)) {
+ Py_INCREF(descr);
+ return PyArray_GetField(self, descr, offset);
+ }
+ }
+ }
+
+ temp = op;
+ if (PyUnicode_Check(op)) {
+ temp = PyUnicode_AsUnicodeEscapeString(op);
+ }
+ PyErr_Format(PyExc_ValueError,
+ "field named %s not found",
+ PyBytes_AsString(temp));
+ if (temp != op) {
+ Py_DECREF(temp);
+ }
return NULL;
}
- else {
- return array_item(self, (Py_ssize_t) value);
- }
- }
- /* optimization for a tuple of integers */
- if (PyArray_NDIM(self) > 1 && _is_full_index(op, self)) {
- int ret = _tuple_of_integers(op, vals, PyArray_NDIM(self));
-
- if (ret > 0) {
- int idim, ndim = PyArray_NDIM(self);
- npy_intp *shape = PyArray_DIMS(self);
- npy_intp *strides = PyArray_STRIDES(self);
- char *item = PyArray_BYTES(self);
- for (idim = 0; idim < ndim; idim++) {
- npy_intp v = vals[idim];
- if (check_and_adjust_index(&v, shape[idim], idim) < 0) {
- return NULL;
+
+ else if (PySequence_Check(op) && !PyTuple_Check(op)) {
+ int seqlen, i;
+ PyObject *obj;
+ seqlen = PySequence_Size(op);
+ for (i = 0; i < seqlen; i++) {
+ obj = PySequence_GetItem(op, i);
+ if (!PyString_Check(obj) && !PyUnicode_Check(obj)) {
+ Py_DECREF(obj);
+ break;
}
- item += v * strides[idim];
+ Py_DECREF(obj);
+ }
+ /*
+ * Extract multiple fields if all elements in sequence
+ * are either string or unicode (i.e. no break occurred).
+ */
+ fancy = ((seqlen > 0) && (i == seqlen));
+ if (fancy) {
+ PyObject *_numpy_internal;
+ _numpy_internal = PyImport_ImportModule("numpy.core._internal");
+ if (_numpy_internal == NULL) {
+ return NULL;
+ }
+ obj = PyObject_CallMethod(_numpy_internal,
+ "_index_fields", "OO", self, op);
+ Py_DECREF(_numpy_internal);
+ if (obj == NULL) {
+ return NULL;
+ }
+ PyArray_ENABLEFLAGS((PyArrayObject*)obj, NPY_ARRAY_WARN_ON_WRITE);
+ return obj;
}
- return PyArray_Scalar(item, PyArray_DESCR(self), (PyObject *)self);
}
}
- /* Check for single field access */
- if (PyString_Check(op) || PyUnicode_Check(op)) {
- PyObject *temp, *obj;
+ /* Prepare the indices */
+ index_type = prepare_index(self, op, indices, &index_num,
+ &ndim, &fancy_ndim, 1);
- if (PyDataType_HASFIELDS(PyArray_DESCR(self))) {
- obj = PyDict_GetItem(PyArray_DESCR(self)->fields, op);
- if (obj != NULL) {
- PyArray_Descr *descr;
- int offset;
- PyObject *title;
+ if (index_type < 0) {
+ return NULL;
+ }
- if (PyArg_ParseTuple(obj, "Oi|O", &descr, &offset, &title)) {
- Py_INCREF(descr);
- return PyArray_GetField(self, descr, offset);
- }
- }
+ /* Full integer index */
+ else if (index_type == HAS_INTEGER) {
+ char *item;
+ if (get_item_pointer(self, &item, indices, index_num) < 0) {
+ goto finish;
}
+ result = (PyObject *) PyArray_Scalar(item, PyArray_DESCR(self),
+ (PyObject *)self);
+ /* Because the index is full integer, we do not need to decref */
+ return result;
+ }
- temp = op;
- if (PyUnicode_Check(op)) {
- temp = PyUnicode_AsUnicodeEscapeString(op);
- }
- PyErr_Format(PyExc_ValueError,
- "field named %s not found",
- PyBytes_AsString(temp));
- if (temp != op) {
- Py_DECREF(temp);
- }
- return NULL;
+ /* Single boolean array */
+ else if (index_type == HAS_BOOL) {
+ result = (PyObject *)array_boolean_subscript(self,
+ (PyArrayObject *)indices[0].object,
+ NPY_CORDER);
+ goto finish;
}
- /* Check for multiple field access */
- if (PyDataType_HASFIELDS(PyArray_DESCR(self)) &&
- PySequence_Check(op) &&
- !PyTuple_Check(op)) {
- int seqlen, i;
- PyObject *obj;
- seqlen = PySequence_Size(op);
- for (i = 0; i < seqlen; i++) {
- obj = PySequence_GetItem(op, i);
- if (!PyString_Check(obj) && !PyUnicode_Check(obj)) {
- Py_DECREF(obj);
- break;
- }
- Py_DECREF(obj);
+ /* If it is only a single ellipsis, just return a view */
+ else if (index_type == HAS_ELLIPSIS) {
+ /*
+ * TODO: Should this be a view or not? The only reason not would be
+ * optimization (i.e. of array[...] += 1) I think.
+ * Before, it was just self for a single ellipsis.
+ */
+ result = PyArray_View(self, NULL, NULL);
+ /* A single ellipsis, so no need to decref */
+ return result;
+ }
+
+ /*
+ * View based indexing.
+ * There are two cases here. First we need to create a simple view,
+ * second we need to create a (possibly invalid) view for the
+ * subspace to the fancy index. This procedure is identical.
+ */
+
+ else if (index_type & (HAS_SLICE | HAS_NEWAXIS |
+ HAS_ELLIPSIS | HAS_INTEGER)) {
+ if (get_view_from_index(self, &view, indices, index_num,
+ (index_type & HAS_FANCY)) < 0) {
+ goto finish;
}
+
/*
- * Extract multiple fields if all elements in sequence
- * are either string or unicode (i.e. no break occurred).
+ * There is a scalar array, so we need to force a copy to simulate
+ * fancy indexing.
*/
- fancy = ((seqlen > 0) && (i == seqlen));
- if (fancy) {
- PyObject *_numpy_internal;
- _numpy_internal = PyImport_ImportModule("numpy.core._internal");
- if (_numpy_internal == NULL) {
- return NULL;
- }
- obj = PyObject_CallMethod(_numpy_internal,
- "_index_fields", "OO", self, op);
- Py_DECREF(_numpy_internal);
- if (obj == NULL) {
- return NULL;
- }
- PyArray_ENABLEFLAGS((PyArrayObject*)obj, NPY_ARRAY_WARN_ON_WRITE);
- return obj;
+ if (index_type & HAS_SCALAR_ARRAY) {
+ result = PyArray_NewCopy(view, NPY_KEEPORDER);
+ goto finish;
}
}
- /* Check for Ellipsis index */
- if (op == Py_Ellipsis) {
- Py_INCREF(self);
- return (PyObject *)self;
+ /* If there is no fancy indexing, we have the result */
+ if (!(index_type & HAS_FANCY)) {
+ result = (PyObject *)view;
+ Py_INCREF(result);
+ goto finish;
}
- if (PyArray_NDIM(self) == 0) {
- int nd;
- /* Check for None index */
- if (op == Py_None) {
- return add_new_axes_0d(self, 1);
- }
- /* Check for (empty) tuple index */
- if (PyTuple_Check(op)) {
- if (0 == PyTuple_GET_SIZE(op)) {
- Py_INCREF(self);
- return (PyObject *)self;
- }
- nd = count_new_axes_0d(op);
- if (nd == -1) {
- return NULL;
- }
- return add_new_axes_0d(self, nd);
- }
- /* Allow Boolean mask selection also */
- if ((PyArray_Check(op) && (PyArray_DIMS((PyArrayObject *)op)==0)
- && PyArray_ISBOOL((PyArrayObject *)op))) {
- if (PyObject_IsTrue(op)) {
- Py_INCREF(self);
- return (PyObject *)self;
+ /*
+ * Special case for very simple 1-d fancy indexing, which however
+ * is quite common. This saves not only a lot of setup time in the
+ * iterator, but also is faster (must be exactly fancy because
+ * we don't support 0-d booleans here)
+ */
+ if (index_type == HAS_FANCY && index_num == 1) {
+ /* The array being indexed has one dimension and it is a fancy index */
+ PyArrayObject *ind = (PyArrayObject*)indices[0].object;
+
+ /* Check if the index is simple enough */
+ if (PyArray_TRIVIALLY_ITERABLE(ind) &&
+ /* Check if the type is equivalent to INTP */
+ PyArray_ITEMSIZE(ind) == sizeof(npy_intp) &&
+ PyArray_DESCR(ind)->kind == 'i' &&
+ PyArray_ISALIGNED(ind) &&
+ PyDataType_ISNOTSWAPPED(PyArray_DESCR(ind))) {
+
+ Py_INCREF(PyArray_DESCR(self));
+ result = PyArray_NewFromDescr(&PyArray_Type,
+ PyArray_DESCR(self),
+ PyArray_NDIM(ind),
+ PyArray_SHAPE(ind),
+ NULL, NULL,
+ /* Same order as indices */
+ PyArray_ISFORTRAN(ind) ?
+ NPY_ARRAY_F_CONTIGUOUS : 0,
+ NULL);
+ if (result == NULL) {
+ goto finish;
}
- else {
- npy_intp oned = 0;
- Py_INCREF(PyArray_DESCR(self));
- return PyArray_NewFromDescr(Py_TYPE(self),
- PyArray_DESCR(self),
- 1, &oned,
- NULL, NULL,
- NPY_ARRAY_DEFAULT,
- NULL);
+
+ if (mapiter_trivial_get(self, ind, (PyArrayObject *)result) < 0) {
+ Py_DECREF(result);
+ result = NULL;
+ goto finish;
}
+
+ goto wrap_out_array;
}
- PyErr_SetString(PyExc_IndexError,
- "0-dimensional arrays can't be indexed");
- return NULL;
}
- fancy = fancy_indexing_check(op);
- if (fancy != SOBJ_NOTFANCY) {
- return array_subscript_fancy(self, op, fancy);
+ /* fancy indexing has to be used. And view is the subspace. */
+ mit = (PyArrayMapIterObject *)PyArray_MapIterNew(indices, index_num,
+ index_type,
+ ndim, fancy_ndim,
+ self, view, 0,
+ NPY_ITER_READONLY,
+ NPY_ITER_WRITEONLY,
+ NULL, PyArray_DESCR(self));
+ if (mit == NULL) {
+ goto finish;
}
- else {
- return array_subscript_simple(self, op, 1);
+
+ if (mit->numiter > 1) {
+ /*
+ * If it is one, the inner loop checks indices, otherwise
+ * check indices beforehand, because it is much faster if
+ * broadcasting occurs and most likely no big overhead
+ */
+ if (PyArray_MapIterCheckIndices(mit) < 0) {
+ goto finish;
+ }
}
-}
-NPY_NO_EXPORT PyObject *
-array_subscript(PyArrayObject *self, PyObject *op)
-{
- int fancy;
- PyObject *ret = NULL;
- if (!PyArray_Check(op)) {
- ret = array_subscript_fromobject(self, op);
+ /* Reset the outer iterator */
+ if (NpyIter_Reset(mit->outer, NULL) < 0) {
+ goto finish;
}
- /* Boolean indexing special case */
- /* The SIZE check is to ensure old behaviour for non-matching arrays. */
- else if (PyArray_ISBOOL((PyArrayObject *)op)
- && (PyArray_NDIM(self) == PyArray_NDIM((PyArrayObject *)op))
- && (PyArray_SIZE((PyArrayObject *)op) == PyArray_SIZE(self))) {
- return (PyObject *)array_boolean_subscript(self,
- (PyArrayObject *)op, NPY_CORDER);
+ if (mapiter_get(mit) < 0) {
+ goto finish;
}
- /* Error case when indexing 0-dim array with non-boolean. */
- else if (PyArray_NDIM(self) == 0) {
- PyErr_SetString(PyExc_IndexError,
- "0-dimensional arrays can't be indexed");
- return NULL;
+
+ result = (PyObject *)mit->extra_op;
+ Py_INCREF(result);
+
+ if (mit->consec) {
+ PyArray_MapIterSwapAxes(mit, (PyArrayObject **)&result, 1);
}
- else {
- fancy = fancy_indexing_check(op);
- if (fancy != SOBJ_NOTFANCY) {
- ret = array_subscript_fancy(self, op, fancy);
- }
- else {
- ret = array_subscript_simple(self, op, 1);
+ wrap_out_array:
+ if (!PyArray_CheckExact(self)) {
+ /*
+ * Need to create a new array as if the old one never existed.
+ */
+ PyArrayObject *tmp_arr = (PyArrayObject *)result;
+
+ Py_INCREF(PyArray_DESCR(tmp_arr));
+ result = PyArray_NewFromDescr(Py_TYPE(self),
+ PyArray_DESCR(tmp_arr),
+ PyArray_NDIM(tmp_arr),
+ PyArray_SHAPE(tmp_arr),
+ PyArray_STRIDES(tmp_arr),
+ PyArray_BYTES(tmp_arr),
+ 0, /* TODO: Flags? */
+ (PyObject *)self);
+
+ if (result == NULL) {
+ Py_DECREF(tmp_arr);
+ goto finish;
}
- }
- if (ret == NULL) {
- return NULL;
+ if (PyArray_SetBaseObject((PyArrayObject *)result,
+ (PyObject *)tmp_arr) < 0) {
+ Py_DECREF(result);
+ result = NULL;
+ goto finish;
+ }
+ if (_IsWriteable(result)) {
+ PyArray_ENABLEFLAGS(result, NPY_ARRAY_WRITEABLE);
+ }
}
- if (PyArray_Check(ret) && PyArray_NDIM((PyArrayObject *)ret) == 0
- && !_check_ellipses(op)) {
- return PyArray_Return((PyArrayObject *)ret);
+ finish:
+ Py_XDECREF(mit);
+ Py_XDECREF(view);
+ /* Clean up indices */
+ for (i=0; i < index_num; i++) {
+ Py_XDECREF(indices[i].object);
}
- return ret;
+ return result;
}
+
/*
- * Another assignment hacked by using CopyObject.
- * This only works if subscript returns a standard view.
- * Again there are two cases. In the first case, PyArray_CopyObject
- * can be used. In the second case, a new indexing function has to be
- * used.
+ * Python C-Api level item assignment (implementation for PySequence_SetItem)
+ *
+ * Negative indices are not accepted because PySequence_SetItem converts
+ * them to positive indices before calling this.
*/
-
-static int
-array_ass_sub_simple(PyArrayObject *self, PyObject *ind, PyObject *op)
+NPY_NO_EXPORT int
+array_assign_item(PyArrayObject *self, Py_ssize_t i, PyObject *op)
{
- int ret;
- PyArrayObject *tmp;
- npy_intp value;
+ npy_index_info indices[2];
- value = PyArray_PyIntAsIntp(ind);
- if (value == -1 && PyErr_Occurred()) {
- if (PyErr_ExceptionMatches(PyExc_TypeError)) {
- /* Operand is not an integer type */
- PyErr_Clear();
- }
- else {
- return -1;
- }
+ if (op == NULL) {
+ PyErr_SetString(PyExc_ValueError,
+ "cannot delete array elements");
+ return -1;
}
- else {
- return array_ass_item_object(self, value, op);
+ if (PyArray_FailUnlessWriteable(self, "assignment destination") < 0) {
+ return -1;
+ }
+ if (PyArray_NDIM(self) == 0) {
+ PyErr_SetString(PyExc_IndexError,
+ "too many indices for array");
+ return -1;
}
- /* Rest of standard (view-based) indexing */
- if (PyArray_CheckExact(self)) {
- tmp = (PyArrayObject *)array_subscript_simple(self, ind, 1);
- if (tmp == NULL) {
+ if (i < 0) {
+ /* This is an error, but undo PySequence_SetItem fix for message */
+ i -= PyArray_DIM(self, 0);
+ }
+
+ indices[0].value = i;
+ indices[0].type = HAS_INTEGER;
+ if (PyArray_NDIM(self) == 1) {
+ char *item;
+ if (get_item_pointer(self, &item, indices, 1) < 0) {
+ return -1;
+ }
+ if (PyArray_SETITEM(self, item, op) < 0) {
return -1;
}
}
else {
- PyObject *tmp0;
-
- /*
- * Note: this code path should never be reached with an index that
- * produces scalars -- those are handled earlier in array_ass_sub
- */
+ PyArrayObject *view;
- tmp0 = PyObject_GetItem((PyObject *)self, ind);
- if (tmp0 == NULL) {
+ indices[1].value = PyArray_NDIM(self) - 1;
+ indices[1].type = HAS_ELLIPSIS;
+ if (get_view_from_index(self, &view, indices, 2, 0) < 0) {
return -1;
}
- if (!PyArray_Check(tmp0)) {
- PyErr_SetString(PyExc_RuntimeError,
- "Getitem not returning array");
- Py_DECREF(tmp0);
+ if (PyArray_CopyObject(view, op) < 0) {
+ Py_DECREF(view);
return -1;
}
- tmp = (PyArrayObject *)tmp0;
+ Py_DECREF(view);
}
-
- ret = PyArray_CopyObject(tmp, op);
- Py_DECREF(tmp);
- return ret;
+ return 0;
}
-static int
-array_ass_sub_fancy(PyArrayObject *self, PyObject *ind, PyObject *op, int fancy)
+
+/*
+ * This fallback takes the old route of `arr.flat[index] = values`
+ * for one dimensional `arr`. The route can sometimes fail slightly
+ * differently (ValueError instead of IndexError), in which case we
+ * warn users about the change. But since it does not actually care *at all*
+ * about shapes, it should only fail for out of bound indexes or
+ * casting errors.
+ */
+NPY_NO_EXPORT int
+attempt_1d_fallback(PyArrayObject *self, PyObject *ind, PyObject *op)
{
- int oned, ret;
- PyArrayMapIterObject *mit;
- oned = ((PyArray_NDIM(self) == 1) &&
- !(PyTuple_Check(ind) && PyTuple_GET_SIZE(ind) > 1));
- mit = (PyArrayMapIterObject *) PyArray_MapIterNew(ind, oned, fancy);
- if (mit == NULL) {
- return -1;
- }
- if (oned) {
- PyArrayIterObject *it;
- int rval;
+ PyObject *err = PyErr_Occurred();
+ PyArrayIterObject *self_iter = NULL;
- it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);
- if (it == NULL) {
- Py_DECREF(mit);
- return -1;
- }
- rval = iter_ass_subscript(it, mit->indexobj, op);
- Py_DECREF(it);
- Py_DECREF(mit);
- return rval;
+ Py_INCREF(err);
+ PyErr_Clear();
+
+ self_iter = (PyArrayIterObject *)PyArray_IterNew((PyObject *)self);
+ if (self_iter == NULL) {
+ goto fail;
}
- if (PyArray_MapIterBind(mit, self) != 0) {
- Py_DECREF(mit);
+ if (iter_ass_subscript(self_iter, ind, op) < 0) {
+ goto fail;
+ }
+
+ Py_XDECREF((PyObject *)self_iter);
+ Py_DECREF(err);
+
+ if (DEPRECATE(
+ "assignment will raise an error in the future, most likely "
+ "because your index result shape does not match the value array "
+ "shape. You can use `arr.flat[index] = values` to keep the old "
+ "behaviour.") < 0) {
return -1;
}
- ret = PyArray_SetMap(mit, op);
- Py_DECREF(mit);
- return ret;
+ return 0;
+
+ fail:
+ if (!PyErr_ExceptionMatches(err)) {
+ PyObject *err, *val, *tb;
+ PyErr_Fetch(&err, &val, &tb);
+ DEPRECATE_FUTUREWARNING(
+ "assignment exception type will change in the future");
+ PyErr_Restore(err, val, tb);
+ }
+
+ Py_XDECREF((PyObject *)self_iter);
+ Py_DECREF(err);
+ return -1;
}
+/*
+ * General assignment with python indexing objects.
+ */
static int
-array_ass_sub(PyArrayObject *self, PyObject *ind, PyObject *op)
+array_assign_subscript(PyArrayObject *self, PyObject *ind, PyObject *op)
{
- int fancy;
- npy_intp vals[NPY_MAXDIMS];
+ int index_type;
+ int index_num;
+ int i, ndim, fancy_ndim;
+ PyArray_Descr *descr = PyArray_DESCR(self);
+ PyArrayObject *view = NULL;
+ PyArrayObject *tmp_arr = NULL;
+ npy_index_info indices[NPY_MAXDIMS * 2 + 1];
+
+ PyArrayMapIterObject *mit = NULL;
if (op == NULL) {
PyErr_SetString(PyExc_ValueError,
@@ -1334,24 +1738,9 @@ array_ass_sub(PyArrayObject *self, PyObject *ind, PyObject *op)
return -1;
}
- /* Integer index */
- if (PyArray_IsIntegerScalar(ind) || (PyIndex_Check(ind) &&
- !PySequence_Check(ind))) {
- npy_intp value = PyArray_PyIntAsIntp(ind);
- if (value == -1 && PyErr_Occurred()) {
- /* fail on error */
- PyErr_SetString(PyExc_IndexError,
- "cannot convert index to integer");
- return -1;
- }
- else {
- return array_ass_item_object(self, value, op);
- }
- }
-
/* Single field access */
- if (PyString_Check(ind) || PyUnicode_Check(ind)) {
- if (PyDataType_HASFIELDS(PyArray_DESCR(self))) {
+ if (PyDataType_HASFIELDS(PyArray_DESCR(self))) {
+ if (PyString_Check(ind) || PyUnicode_Check(ind)) {
PyObject *obj;
obj = PyDict_GetItem(PyArray_DESCR(self)->fields, ind);
@@ -1365,138 +1754,298 @@ array_ass_sub(PyArrayObject *self, PyObject *ind, PyObject *op)
return PyArray_SetField(self, descr, offset, op);
}
}
- }
#if defined(NPY_PY3K)
- PyErr_Format(PyExc_ValueError,
+ PyErr_Format(PyExc_ValueError,
"field named %S not found",
ind);
#else
- PyErr_Format(PyExc_ValueError,
+ PyErr_Format(PyExc_ValueError,
"field named %s not found",
PyString_AsString(ind));
#endif
+ return -1;
+ }
+ }
+
+
+ /* Prepare the indices */
+ index_type = prepare_index(self, ind, indices, &index_num,
+ &ndim, &fancy_ndim, 1);
+
+ if (index_type < 0) {
return -1;
}
- /* Ellipsis index */
- if (ind == Py_Ellipsis ||
- (PyTuple_Check(ind) && 1 == PyTuple_GET_SIZE(ind) &&
- Py_Ellipsis == PyTuple_GET_ITEM(ind, 0))) {
- /*
- * Doing "a[...] += 1" triggers assigning an array to itself,
- * so this check is needed.
- */
- if ((PyObject *)self == op) {
- return 0;
+ /* Full integer index */
+ if (index_type == HAS_INTEGER) {
+ char *item;
+ if (get_item_pointer(self, &item, indices, index_num) < 0) {
+ return -1;
}
- else {
- return PyArray_CopyObject(self, op);
+ if (PyArray_SETITEM(self, item, op) < 0) {
+ return -1;
}
+ /* integers do not store objects in indices */
+ return 0;
}
- if (PyArray_NDIM(self) == 0) {
- /*
- * Several different exceptions to the 0-d no-indexing rule
- *
- * 1) ellipses or tuple with ellipses (handled above generally)
- * 2) empty tuple
- * 3) Using newaxis (None)
- * 4) Boolean mask indexing
- */
-
- /* Check for None or empty tuple */
- if (ind == Py_None || (PyTuple_Check(ind) &&
- (0 == PyTuple_GET_SIZE(ind) ||
- count_new_axes_0d(ind) > 0))) {
- return PyArray_SETITEM(self, PyArray_DATA(self), op);
- }
- /* Check for boolean index */
- if (PyBool_Check(ind) || PyArray_IsScalar(ind, Bool) ||
- (PyArray_Check(ind) &&
- (PyArray_NDIM((PyArrayObject *)ind)==0) &&
- PyArray_ISBOOL((PyArrayObject *)ind))) {
- if (PyObject_IsTrue(ind)) {
- return PyArray_CopyObject(self, op);
+ /* Single boolean array */
+ if (index_type == HAS_BOOL) {
+ if (!PyArray_Check(op)) {
+ Py_INCREF(PyArray_DESCR(self));
+ tmp_arr = (PyArrayObject *)PyArray_FromAny(op,
+ PyArray_DESCR(self), 0, 0,
+ NPY_ARRAY_FORCECAST, NULL);
+ if (tmp_arr == NULL) {
+ goto fail;
}
- else { /* False: don't do anything */
- return 0;
+ }
+ else {
+ Py_INCREF(op);
+ tmp_arr = (PyArrayObject *)op;
+ }
+
+ if (array_assign_boolean_subscript(self,
+ (PyArrayObject *)indices[0].object,
+ tmp_arr, NPY_CORDER) < 0) {
+ /*
+ * Deprecated case. The old boolean indexing seemed to have some
+ * check to allow wrong dimensional boolean arrays in all cases.
+ */
+ if (PyArray_NDIM(tmp_arr) > 1) {
+ if (attempt_1d_fallback(self, indices[0].object, tmp_arr) < 0) {
+ goto fail;
+ }
+ goto success;
}
+ goto fail;
}
- PyErr_SetString(PyExc_IndexError,
- "0-dimensional arrays can't be indexed");
- return -1;
+ goto success;
}
- /* Integer-tuple index */
- if (_is_full_index(ind, self)) {
- int ret = _tuple_of_integers(ind, vals, PyArray_NDIM(self));
- if (ret > 0) {
- int idim, ndim = PyArray_NDIM(self);
- npy_intp *shape = PyArray_DIMS(self);
- npy_intp *strides = PyArray_STRIDES(self);
- char *item = PyArray_BYTES(self);
- for (idim = 0; idim < ndim; idim++) {
- npy_intp v = vals[idim];
- if (check_and_adjust_index(&v, shape[idim], idim) < 0) {
- return -1;
- }
- item += v * strides[idim];
- }
- return PyArray_SETITEM(self, item, op);
+ /*
+ * Single ellipsis index, no need to create a new view.
+ * Note that here, we do *not* go through self.__getitem__ for subclasses
+ * (defchar array failed then, due to uninitialized values...)
+ */
+ else if (index_type == HAS_ELLIPSIS) {
+ if ((PyObject *)self == op) {
+ /*
+ * CopyObject does not handle this case gracefully and
+ * there is nothing to do. Removing the special case
+ * will cause segfaults, though it is unclear what exactly
+ * happens.
+ */
+ return 0;
}
+ /* we can just use self, but incref for error handling */
+ Py_INCREF((PyObject *)self);
+ view = self;
}
- /* Boolean indexing special case */
- if (PyArray_Check(ind) &&
- (PyArray_TYPE((PyArrayObject *)ind) == NPY_BOOL) &&
- (PyArray_NDIM(self) == PyArray_NDIM((PyArrayObject *)ind)) &&
- (PyArray_SIZE(self) == PyArray_SIZE((PyArrayObject *)ind))) {
- int retcode;
- PyArrayObject *op_arr;
- PyArray_Descr *dtype = NULL;
+ /*
+ * WARNING: There is a huge special case here. If this is not a
+ * base class array, we have to get the view through its
+ * very own index machinery.
+ * Many subclasses should probably call __setitem__
+ * with a base class ndarray view to avoid this.
+ */
+ else if (!(index_type & (HAS_FANCY | HAS_SCALAR_ARRAY))
+ && !PyArray_CheckExact(self)) {
+ view = (PyArrayObject *)PyObject_GetItem((PyObject *)self, ind);
+ if (view == NULL) {
+ goto fail;
+ }
+ if (!PyArray_Check(view)) {
+ PyErr_SetString(PyExc_RuntimeError,
+ "Getitem not returning array");
+ goto fail;
+ }
+ }
- if (!PyArray_Check(op)) {
- dtype = PyArray_DTYPE(self);
- Py_INCREF(dtype);
- op_arr = (PyArrayObject *)PyArray_FromAny(op, dtype, 0, 0, 0, NULL);
- if (op_arr == NULL) {
- return -1;
- }
+ /*
+ * View based indexing.
+ * There are two cases here. First we need to create a simple view,
+ * second we need to create a (possibly invalid) view for the
+ * subspace to the fancy index. This procedure is identical.
+ */
+ else if (index_type & (HAS_SLICE | HAS_NEWAXIS |
+ HAS_ELLIPSIS | HAS_INTEGER)) {
+ if (get_view_from_index(self, &view, indices, index_num,
+ (index_type & HAS_FANCY)) < 0) {
+ goto fail;
+ }
+ }
+ else {
+ view = NULL;
+ }
+
+ /* If there is no fancy indexing, we have the array to assign to */
+ if (!(index_type & HAS_FANCY)) {
+ if (PyArray_CopyObject(view, op) < 0) {
+ goto fail;
+ }
+ goto success;
+ }
+
+ if (!PyArray_Check(op)) {
+ /*
+ * If the array is of object converting the values to an array
+ * might not be legal even though normal assignment works.
+ * So allocate a temporary array of the right size and use the
+ * normal assignment to handle this case.
+ */
+ if (PyDataType_REFCHK(descr) && PySequence_Check(op)) {
+ tmp_arr = NULL;
}
else {
- op_arr = op;
- Py_INCREF(op_arr);
+ /* There is nothing fancy possible, so just make an array */
+ Py_INCREF(descr);
+ tmp_arr = (PyArrayObject *)PyArray_FromAny(op, descr, 0, 0,
+ NPY_ARRAY_FORCECAST, NULL);
+ if (tmp_arr == NULL) {
+ goto fail;
+ }
}
+ }
+ else {
+ Py_INCREF(op);
+ tmp_arr = (PyArrayObject *)op;
+ }
- if (PyArray_NDIM(op_arr) < 2) {
- retcode = array_ass_boolean_subscript(self,
- (PyArrayObject *)ind,
- op_arr, NPY_CORDER);
- Py_DECREF(op_arr);
- return retcode;
+ /*
+ * Special case for very simple 1-d fancy indexing, which however
+ * is quite common. This saves not only a lot of setup time in the
+ * iterator, but also is faster (must be exactly fancy because
+ * we don't support 0-d booleans here)
+ */
+ if (index_type == HAS_FANCY &&
+ index_num == 1 && tmp_arr) {
+ /* The array being indexed has one dimension and it is a fancy index */
+ PyArrayObject *ind = (PyArrayObject*)indices[0].object;
+
+ /* Check if the type is equivalent */
+ if (PyArray_EquivTypes(PyArray_DESCR(self),
+ PyArray_DESCR(tmp_arr)) &&
+ /*
+ * Either they are equivalent, or the values must
+ * be a scalar
+ */
+ (PyArray_EQUIVALENTLY_ITERABLE(ind, tmp_arr) ||
+ (PyArray_NDIM(tmp_arr) == 0 &&
+ PyArray_TRIVIALLY_ITERABLE(tmp_arr))) &&
+ /* Check if the type is equivalent to INTP */
+ PyArray_ITEMSIZE(ind) == sizeof(npy_intp) &&
+ PyArray_DESCR(ind)->kind == 'i' &&
+ PyArray_ISALIGNED(ind) &&
+ PyDataType_ISNOTSWAPPED(PyArray_DESCR(ind))) {
+
+ /* trivial_set checks the index for us */
+ if (mapiter_trivial_set(self, ind, tmp_arr) < 0) {
+ goto fail;
+ }
+ goto success;
}
+ }
+
+ /*
+ * NOTE: If tmp_arr was not allocated yet, mit should
+ * handle the allocation.
+ * The NPY_ITER_READWRITE is necessary for automatic
+ * allocation. Readwrite would not allow broadcasting
+ * correctly, but such an operand always has the full
+ * size anyway.
+ */
+ mit = (PyArrayMapIterObject *)PyArray_MapIterNew(indices,
+ index_num, index_type,
+ ndim, fancy_ndim, self,
+ view, 0,
+ NPY_ITER_WRITEONLY,
+ ((tmp_arr == NULL) ?
+ NPY_ITER_READWRITE :
+ NPY_ITER_READONLY),
+ tmp_arr, descr);
+
+ if (mit == NULL) {
/*
- * Assigning from multi-dimensional 'op' in this case seems
- * inconsistent, so falling through to old code for backwards
- * compatibility.
+ * This is a deprecated special case to allow non-matching shapes
+ * for the index and value arrays.
*/
- Py_DECREF(op_arr);
+ if (index_type != HAS_FANCY || index_num != 1) {
+ /* This is not a "flat like" 1-d special case */
+ goto fail;
+ }
+ if (attempt_1d_fallback(self, indices[0].object, op) < 0) {
+ goto fail;
+ }
+ goto success;
+ }
+
+ if (tmp_arr == NULL) {
+ /* Fill extra op */
+
+ if (PyArray_CopyObject(mit->extra_op, op) < 0) {
+ /*
+ * This is a deprecated special case to allow non-matching shapes
+ * for the index and value arrays.
+ */
+ if (index_type != HAS_FANCY || index_num != 1) {
+ /* This is not a "flat like" 1-d special case */
+ goto fail;
+ }
+ if (attempt_1d_fallback(self, indices[0].object, op) < 0) {
+ goto fail;
+ }
+ goto success;
+ }
}
- fancy = fancy_indexing_check(ind);
- if (fancy != SOBJ_NOTFANCY) {
- return array_ass_sub_fancy(self, ind, op, fancy);
+ /* Can now reset the outer iterator (delayed bufalloc) */
+ if (NpyIter_Reset(mit->outer, NULL) < 0) {
+ goto fail;
}
- else {
- return array_ass_sub_simple(self, ind, op);
+
+ if (PyArray_MapIterCheckIndices(mit) < 0) {
+ goto fail;
}
+
+ /*
+ * Could add a casting check, but apparently most assignments do
+ * not care about safe casting.
+ */
+
+ if (mapiter_set(mit) < 0) {
+ goto fail;
+ }
+
+ Py_DECREF(mit);
+ goto success;
+
+ /* Clean up temporary variables and indices */
+ fail:
+ Py_XDECREF((PyObject *)view);
+ Py_XDECREF((PyObject *)tmp_arr);
+ Py_XDECREF((PyObject *)mit);
+ for (i=0; i < index_num; i++) {
+ Py_XDECREF(indices[i].object);
+ }
+ return -1;
+
+ success:
+ Py_XDECREF((PyObject *)view);
+ Py_XDECREF((PyObject *)tmp_arr);
+ for (i=0; i < index_num; i++) {
+ Py_XDECREF(indices[i].object);
+ }
+ return 0;
}
+
NPY_NO_EXPORT PyMappingMethods array_as_mapping = {
(lenfunc)array_length, /*mp_length*/
(binaryfunc)array_subscript, /*mp_subscript*/
- (objobjargproc)array_ass_sub, /*mp_ass_subscript*/
+ (objobjargproc)array_assign_subscript, /*mp_ass_subscript*/
};
/****************** End of Mapping Protocol ******************************/
@@ -1513,9 +2062,11 @@ NPY_NO_EXPORT PyMappingMethods array_as_mapping = {
/*
* This function takes a Boolean array and constructs index objects and
* iterators as if nonzero(Bool) had been called
+ *
+ * Must not be called on a 0-d array.
*/
static int
-_nonzero_indices(PyObject *myBool, PyArrayIterObject **iters)
+_nonzero_indices(PyObject *myBool, PyArrayObject **arrays)
{
PyArray_Descr *typecode;
PyArrayObject *ba = NULL, *new = NULL;
@@ -1524,6 +2075,8 @@ _nonzero_indices(PyObject *myBool, PyArrayIterObject **iters)
npy_bool *ptr;
npy_intp coords[NPY_MAXDIMS], dims_m1[NPY_MAXDIMS];
npy_intp *dptr[NPY_MAXDIMS];
+ static npy_intp one = 1;
+ NPY_BEGIN_THREADS_DEF;
typecode=PyArray_DescrFromType(NPY_BOOL);
ba = (PyArrayObject *)PyArray_FromAny(myBool, typecode, 0, 0,
@@ -1533,26 +2086,17 @@ _nonzero_indices(PyObject *myBool, PyArrayIterObject **iters)
}
nd = PyArray_NDIM(ba);
- if (nd == 0) {
- PyErr_SetString(PyExc_IndexError,
- "only scalars can be indexed by 0-dimensional "
- "boolean arrays");
- goto fail;
- }
-
for (j = 0; j < nd; j++) {
- iters[j] = NULL;
+ arrays[j] = NULL;
}
size = PyArray_SIZE(ba);
ptr = (npy_bool *)PyArray_DATA(ba);
- count = 0;
- /* pre-determine how many nonzero entries there are */
- for (i = 0; i < size; i++) {
- if (*(ptr++)) {
- count++;
- }
- }
+ /*
+ * pre-determine how many nonzero entries there are,
+ * ignore dimensionality of input as its a CARRAY
+ */
+ count = count_boolean_trues(1, (char*)ptr, &size, &one);
/* create count-sized index arrays for each dimension */
for (j = 0; j < nd; j++) {
@@ -1562,26 +2106,21 @@ _nonzero_indices(PyObject *myBool, PyArrayIterObject **iters)
if (new == NULL) {
goto fail;
}
- iters[j] = (PyArrayIterObject *)
- PyArray_IterNew((PyObject *)new);
- Py_DECREF(new);
- if (iters[j] == NULL) {
- goto fail;
- }
- dptr[j] = (npy_intp *)PyArray_DATA(iters[j]->ao);
+ arrays[j] = new;
+
+ dptr[j] = (npy_intp *)PyArray_DATA(new);
coords[j] = 0;
dims_m1[j] = PyArray_DIMS(ba)[j]-1;
}
- ptr = (npy_bool *)PyArray_DATA(ba);
if (count == 0) {
goto finish;
}
/*
-
* Loop through the Boolean array and copy coordinates
* for non-zero entries
*/
+ NPY_BEGIN_THREADS_THRESHOLDED(size);
for (i = 0; i < size; i++) {
if (*(ptr++)) {
for (j = 0; j < nd; j++) {
@@ -1599,6 +2138,7 @@ _nonzero_indices(PyObject *myBool, PyArrayIterObject **iters)
}
}
}
+ NPY_END_THREADS;
finish:
Py_DECREF(ba);
@@ -1606,551 +2146,1100 @@ _nonzero_indices(PyObject *myBool, PyArrayIterObject **iters)
fail:
for (j = 0; j < nd; j++) {
- Py_XDECREF(iters[j]);
+ Py_XDECREF(arrays[j]);
}
Py_XDECREF(ba);
return -1;
}
-/* convert an indexing object to an INTP indexing array iterator
- if possible -- otherwise, it is a Slice, Ellipsis or None object
- and has to be interpreted on bind to a particular
- array so leave it NULL for now.
-*/
-static int
-_convert_obj(PyObject *obj, PyArrayIterObject **iter)
-{
- PyArray_Descr *indtype;
- PyObject *arr;
-
- if (PySlice_Check(obj) || (obj == Py_Ellipsis) || (obj == Py_None)) {
- return 0;
- }
- else if (PyArray_Check(obj) && PyArray_ISBOOL((PyArrayObject *)obj)) {
- return _nonzero_indices(obj, iter);
- }
- else {
- indtype = PyArray_DescrFromType(NPY_INTP);
- arr = PyArray_FromAny(obj, indtype, 0, 0, NPY_ARRAY_FORCECAST, NULL);
- if (arr == NULL) {
- return -1;
- }
- *iter = (PyArrayIterObject *)PyArray_IterNew(arr);
- Py_DECREF(arr);
- if (*iter == NULL) {
- return -1;
- }
- }
- return 1;
-}
/* Reset the map iterator to the beginning */
NPY_NO_EXPORT void
PyArray_MapIterReset(PyArrayMapIterObject *mit)
{
- int i,j; npy_intp coord[NPY_MAXDIMS];
- PyArrayIterObject *it;
- PyArray_CopySwapFunc *copyswap;
+ npy_intp indval;
+ char *baseptrs[2];
+ int i;
- mit->index = 0;
+ if (mit->size == 0) {
+ return;
+ }
- if (mit->numiter > 0) {
- copyswap = PyArray_DESCR(mit->iters[0]->ao)->f->copyswap;
+ NpyIter_Reset(mit->outer, NULL);
+ if (mit->extra_op_iter) {
+ NpyIter_Reset(mit->extra_op_iter, NULL);
+
+ baseptrs[1] = mit->extra_op_ptrs[0];
}
- if (mit->subspace != NULL) {
- memcpy(coord, mit->bscoord, sizeof(npy_intp)*PyArray_NDIM(mit->ait->ao));
- PyArray_ITER_RESET(mit->subspace);
- for (i = 0; i < mit->numiter; i++) {
- it = mit->iters[i];
- PyArray_ITER_RESET(it);
- j = mit->iteraxes[i];
- copyswap(coord+j,it->dataptr, !PyArray_ISNOTSWAPPED(it->ao),
- it->ao);
+ baseptrs[0] = mit->baseoffset;
+
+ for (i = 0; i < mit->numiter; i++) {
+ indval = *((npy_intp*)mit->outer_ptrs[i]);
+ if (indval < 0) {
+ indval += mit->fancy_dims[i];
}
- PyArray_ITER_GOTO(mit->ait, coord);
- mit->subspace->dataptr = mit->ait->dataptr;
- mit->dataptr = mit->subspace->dataptr;
+ baseptrs[0] += indval * mit->fancy_strides[i];
+ }
+ mit->dataptr = baseptrs[0];
+
+ if (mit->subspace_iter) {
+ NpyIter_ResetBasePointers(mit->subspace_iter, baseptrs, NULL);
+ mit->iter_count = *NpyIter_GetInnerLoopSizePtr(mit->subspace_iter);
}
else {
- for (i = 0; i < mit->numiter; i++) {
- it = mit->iters[i];
- if (it->size != 0) {
- PyArray_ITER_RESET(it);
- copyswap(coord+i,it->dataptr, !PyArray_ISNOTSWAPPED(it->ao),
- it->ao);
- }
- else {
- coord[i] = 0;
- }
- }
- PyArray_ITER_GOTO(mit->ait, coord);
- mit->dataptr = mit->ait->dataptr;
+ mit->iter_count = *NpyIter_GetInnerLoopSizePtr(mit->outer);
}
+
return;
}
+
/*NUMPY_API
* This function needs to update the state of the map iterator
* and point mit->dataptr to the memory-location of the next object
+ *
+ * Note that this function never handles an extra operand but provides
+ * compatibility for an old (exposed) API.
*/
NPY_NO_EXPORT void
PyArray_MapIterNext(PyArrayMapIterObject *mit)
{
- int i, j;
- npy_intp coord[NPY_MAXDIMS];
- PyArrayIterObject *it;
- PyArray_CopySwapFunc *copyswap;
+ int i;
+ char *baseptr;
+ npy_intp indval;
- mit->index += 1;
- if (mit->index >= mit->size) {
- return;
- }
+ if (mit->subspace_iter) {
+ if (--mit->iter_count > 0) {
+ mit->subspace_ptrs[0] += mit->subspace_strides[0];
+ mit->dataptr = mit->subspace_ptrs[0];
+ return;
+ }
+ else if (mit->subspace_next(mit->subspace_iter)) {
+ mit->iter_count = *NpyIter_GetInnerLoopSizePtr(mit->subspace_iter);
+ mit->dataptr = mit->subspace_ptrs[0];
+ }
+ else {
+ if (!mit->outer_next(mit->outer)) {
+ return;
+ }
- if (mit->numiter > 0) {
- copyswap = PyArray_DESCR(mit->iters[0]->ao)->f->copyswap;
- }
+ baseptr = mit->baseoffset;
- /* Sub-space iteration */
- if (mit->subspace != NULL) {
- PyArray_ITER_NEXT(mit->subspace);
- if (mit->subspace->index >= mit->subspace->size) {
- /* reset coord to coordinates of beginning of the subspace */
- memcpy(coord, mit->bscoord,
- sizeof(npy_intp)*PyArray_NDIM(mit->ait->ao));
- PyArray_ITER_RESET(mit->subspace);
for (i = 0; i < mit->numiter; i++) {
- it = mit->iters[i];
- PyArray_ITER_NEXT(it);
- j = mit->iteraxes[i];
- copyswap(coord+j,it->dataptr, !PyArray_ISNOTSWAPPED(it->ao),
- it->ao);
+ indval = *((npy_intp*)mit->outer_ptrs[i]);
+ if (indval < 0) {
+ indval += mit->fancy_dims[i];
+ }
+ baseptr += indval * mit->fancy_strides[i];
}
- PyArray_ITER_GOTO(mit->ait, coord);
- mit->subspace->dataptr = mit->ait->dataptr;
+ NpyIter_ResetBasePointers(mit->subspace_iter, &baseptr, NULL);
+ mit->iter_count = *NpyIter_GetInnerLoopSizePtr(mit->subspace_iter);
+
+ mit->dataptr = mit->subspace_ptrs[0];
}
- mit->dataptr = mit->subspace->dataptr;
}
else {
- for (i = 0; i < mit->numiter; i++) {
- it = mit->iters[i];
- PyArray_ITER_NEXT(it);
- copyswap(coord+i,it->dataptr,
- !PyArray_ISNOTSWAPPED(it->ao),
- it->ao);
+ if (--mit->iter_count > 0) {
+ baseptr = mit->baseoffset;
+
+ for (i = 0; i < mit->numiter; i++) {
+ mit->outer_ptrs[i] += mit->outer_strides[i];
+
+ indval = *((npy_intp*)mit->outer_ptrs[i]);
+ if (indval < 0) {
+ indval += mit->fancy_dims[i];
+ }
+ baseptr += indval * mit->fancy_strides[i];
+ }
+
+ mit->dataptr = baseptr;
+ return;
+ }
+ else {
+ if (!mit->outer_next(mit->outer)) {
+ return;
+ }
+ mit->iter_count = *NpyIter_GetInnerLoopSizePtr(mit->outer);
+ baseptr = mit->baseoffset;
+
+ for (i = 0; i < mit->numiter; i++) {
+ indval = *((npy_intp*)mit->outer_ptrs[i]);
+ if (indval < 0) {
+ indval += mit->fancy_dims[i];
+ }
+ baseptr += indval * mit->fancy_strides[i];
+ }
+
+ mit->dataptr = baseptr;
}
- PyArray_ITER_GOTO(mit->ait, coord);
- mit->dataptr = mit->ait->dataptr;
}
- return;
}
-/*
- * Bind a mapiteration to a particular array
- *
- * Determine if subspace iteration is necessary. If so,
- * 1) Fill in mit->iteraxes
- * 2) Create subspace iterator
- * 3) Update nd, dimensions, and size.
+
+/**
+ * Fill information about the iterator. The MapIterObject does not
+ * need to have any information set for this function to work.
+ * (PyArray_MapIterSwapAxes requires also nd and nd_fancy info)
*
- * Subspace iteration is necessary if: PyArray_NDIM(arr) > mit->numiter
+ * Sets the following information:
+ * * mit->consec: The axis where the fancy indices need transposing to.
+ * * mit->iteraxes: The axis which the fancy index corresponds to.
+ * * mit-> fancy_dims: the dimension of `arr` along the indexed dimension
+ * for each fancy index.
+ * * mit->fancy_strides: the strides for the dimension being indexed
+ * by each fancy index.
+ * * mit->dimensions: Broadcast dimension of the fancy indices and
+ * the subspace iteration dimension.
*
- * Need to check for index-errors somewhere.
+ * @param MapIterObject
+ * @param The parsed indices object
+ * @param Number of indices
+ * @param The array that is being iterated
*
- * Let's do it at bind time and also convert all <0 values to >0 here
- * as well.
+ * @return 0 on success -1 on failure
*/
-NPY_NO_EXPORT int
-PyArray_MapIterBind(PyArrayMapIterObject *mit, PyArrayObject *arr)
+static int
+mapiter_fill_info(PyArrayMapIterObject *mit, npy_index_info *indices,
+ int index_num, PyArrayObject *arr)
{
- int subnd;
- PyObject *sub, *obj = NULL;
- int i, j, n, curraxis, ellipexp, noellip, newaxes;
- PyArrayIterObject *it;
- npy_intp dimsize;
- npy_intp *indptr;
-
- subnd = PyArray_NDIM(arr) - mit->numiter;
- if (subnd < 0) {
- PyErr_SetString(PyExc_IndexError,
- "too many indices for array");
- return -1;
+ int j = 0, i;
+ int curr_dim = 0;
+ /* dimension of index result (up to first fancy index) */
+ int result_dim = 0;
+ /* -1 init; 0 found fancy; 1 fancy stopped; 2 found not consecutive fancy */
+ int consec_status = -1;
+ int axis, broadcast_axis;
+ npy_intp dimension;
+ PyObject *errmsg, *tmp;
+
+ for (i = 0; i < mit->nd_fancy; i++) {
+ mit->dimensions[i] = 1;
+ }
+
+ mit->consec = 0;
+ for (i = 0; i < index_num; i++) {
+ /* integer and fancy indexes are transposed together */
+ if (indices[i].type & (HAS_FANCY | HAS_INTEGER)) {
+ /* there was no previous fancy index, so set consec */
+ if (consec_status == -1) {
+ mit->consec = result_dim;
+ consec_status = 0;
+ }
+ /* there was already a non-fancy index after a fancy one */
+ else if (consec_status == 1) {
+ consec_status = 2;
+ mit->consec = 0;
+ }
+ }
+ else {
+ /* consec_status == 0 means there was a fancy index before */
+ if (consec_status == 0) {
+ consec_status = 1;
+ }
+ }
+
+ /* (iterating) fancy index, store the iterator */
+ if (indices[i].type == HAS_FANCY) {
+ mit->fancy_strides[j] = PyArray_STRIDE(arr, curr_dim);
+ mit->fancy_dims[j] = PyArray_DIM(arr, curr_dim);
+ mit->iteraxes[j++] = curr_dim++;
+
+ /* Check broadcasting */
+ broadcast_axis = mit->nd_fancy;
+ /* Fill from back, we know how many dims there are */
+ for (axis = PyArray_NDIM((PyArrayObject *)indices[i].object) - 1;
+ axis >= 0; axis--) {
+ broadcast_axis--;
+ dimension = PyArray_DIM((PyArrayObject *)indices[i].object, axis);
+
+ /* If it is 1, we can broadcast */
+ if (dimension != 1) {
+ if (dimension != mit->dimensions[broadcast_axis]) {
+ if (mit->dimensions[broadcast_axis] != 1) {
+ goto broadcast_error;
+ }
+ mit->dimensions[broadcast_axis] = dimension;
+ }
+ }
+ }
+ }
+ else if (indices[i].type == HAS_0D_BOOL) {
+ mit->fancy_strides[j] = 0;
+ mit->fancy_dims[j] = 1;
+ /* Does not exist */
+ mit->iteraxes[j++] = -1;
+ }
+
+ /* advance curr_dim for non-fancy indices */
+ else if (indices[i].type == HAS_ELLIPSIS) {
+ curr_dim += indices[i].value;
+ result_dim += indices[i].value;
+ }
+ else if (indices[i].type != HAS_NEWAXIS){
+ curr_dim += 1;
+ result_dim += 1;
+ }
+ else {
+ result_dim += 1;
+ }
}
- mit->ait = (PyArrayIterObject *)PyArray_IterNew((PyObject *)arr);
- if (mit->ait == NULL) {
- return -1;
+ /* Fill dimension of subspace */
+ if (mit->subspace) {
+ for (i = 0; i < PyArray_NDIM(mit->subspace); i++) {
+ mit->dimensions[mit->nd_fancy + i] = PyArray_DIM(mit->subspace, i);
+ }
}
+ return 0;
+
+ broadcast_error:
/*
- * all indexing arrays have been converted to 0
- * therefore we can extract the subspace with a simple
- * getitem call which will use view semantics, but
- * without index checking since all original normal
- * indexes are checked later as fancy ones.
- *
- * But, be sure to do it with a true array.
+ * Attempt to set a meaningful exception. Could also find out
+ * if a boolean index was converted.
*/
- if (PyArray_CheckExact(arr)) {
- sub = array_subscript_simple(arr, mit->indexobj, 0);
+ errmsg = PyUString_FromString("shape mismatch: indexing arrays could not "
+ "be broadcast together with shapes ");
+ if (errmsg == NULL) {
+ return -1;
}
- else {
- Py_INCREF(arr);
- obj = PyArray_EnsureArray((PyObject *)arr);
- if (obj == NULL) {
+
+ for (i = 0; i < index_num; i++) {
+ if (indices[i].type != HAS_FANCY) {
+ continue;
+ }
+ tmp = convert_shape_to_string(
+ PyArray_NDIM((PyArrayObject *)indices[i].object),
+ PyArray_SHAPE((PyArrayObject *)indices[i].object),
+ " ");
+ if (tmp == NULL) {
+ return -1;
+ }
+ PyUString_ConcatAndDel(&errmsg, tmp);
+ if (errmsg == NULL) {
return -1;
}
- sub = array_subscript_simple((PyArrayObject *)obj, mit->indexobj, 0);
- Py_DECREF(obj);
}
- if (sub == NULL) {
- return -1;
+ PyErr_SetObject(PyExc_IndexError, errmsg);
+ Py_DECREF(errmsg);
+ return -1;
+}
+
+
+/*
+ * Check whether the fancy indices are out of bounds.
+ * Returns 0 on success and -1 on failure.
+ * (Gets operands from the outer iterator, but iterates them independently)
+ */
+NPY_NO_EXPORT int
+PyArray_MapIterCheckIndices(PyArrayMapIterObject *mit)
+{
+ PyArrayObject *op;
+ NpyIter *op_iter;
+ NpyIter_IterNextFunc *op_iternext;
+ npy_intp outer_dim, indval;
+ int outer_axis;
+ npy_intp itersize, iterstride;
+ char **iterptr;
+ PyArray_Descr *intp_type;
+ int i;
+ NPY_BEGIN_THREADS_DEF;
+
+ if (mit->size == 0) {
+ /* All indices got broadcast away, do *not* check as it always was */
+ return 0;
}
- subnd = PyArray_NDIM(sub);
- /* no subspace iteration needed. Finish up and Return */
- if (subnd == 0) {
- n = PyArray_NDIM(arr);
- for (i = 0; i < n; i++) {
- mit->iteraxes[i] = i;
+ intp_type = PyArray_DescrFromType(NPY_INTP);
+
+ NPY_BEGIN_THREADS;
+
+ for (i=0; i < mit->numiter; i++) {
+ op = NpyIter_GetOperandArray(mit->outer)[i];
+
+ outer_dim = mit->fancy_dims[i];
+ outer_axis = mit->iteraxes[i];
+
+ /* See if it is possible to just trivially iterate the array */
+ if (PyArray_TRIVIALLY_ITERABLE(op) &&
+ /* Check if the type is equivalent to INTP */
+ PyArray_ITEMSIZE(op) == sizeof(npy_intp) &&
+ PyArray_DESCR(op)->kind == 'i' &&
+ PyArray_ISALIGNED(op) &&
+ PyDataType_ISNOTSWAPPED(PyArray_DESCR(op))) {
+ char *data;
+ npy_intp stride;
+ /* release GIL if it was taken by nditer below */
+ if (_save == NULL) {
+ NPY_BEGIN_THREADS;
+ }
+
+ PyArray_PREPARE_TRIVIAL_ITERATION(op, itersize, data, stride);
+
+ while (itersize--) {
+ indval = *((npy_intp*)data);
+ if (check_and_adjust_index(&indval,
+ outer_dim, outer_axis, _save) < 0) {
+ return -1;
+ }
+ data += stride;
+ }
+ /* GIL retake at end of function or if nditer path required */
+ continue;
}
- Py_DECREF(sub);
- goto finish;
+
+ /* Use NpyIter if the trivial iteration is not possible */
+ NPY_END_THREADS;
+ op_iter = NpyIter_New(op,
+ NPY_ITER_BUFFERED | NPY_ITER_NBO | NPY_ITER_ALIGNED |
+ NPY_ITER_EXTERNAL_LOOP | NPY_ITER_GROWINNER |
+ NPY_ITER_READONLY,
+ NPY_KEEPORDER, NPY_SAME_KIND_CASTING, intp_type);
+
+ if (op_iter == NULL) {
+ Py_DECREF(intp_type);
+ return -1;
+ }
+
+ op_iternext = NpyIter_GetIterNext(op_iter, NULL);
+ if (op_iternext == NULL) {
+ Py_DECREF(intp_type);
+ NpyIter_Deallocate(op_iter);
+ return -1;
+ }
+
+ NPY_BEGIN_THREADS_NDITER(op_iter);
+ iterptr = NpyIter_GetDataPtrArray(op_iter);
+ iterstride = NpyIter_GetInnerStrideArray(op_iter)[0];
+ do {
+ itersize = *NpyIter_GetInnerLoopSizePtr(op_iter);
+ while (itersize--) {
+ indval = *((npy_intp*)*iterptr);
+ if (check_and_adjust_index(&indval,
+ outer_dim, outer_axis, _save) < 0) {
+ Py_DECREF(intp_type);
+ NpyIter_Deallocate(op_iter);
+ return -1;
+ }
+ *iterptr += iterstride;
+ }
+ } while (op_iternext(op_iter));
+
+ NPY_END_THREADS;
+ NpyIter_Deallocate(op_iter);
}
- mit->subspace = (PyArrayIterObject *)PyArray_IterNew(sub);
- Py_DECREF(sub);
- if (mit->subspace == NULL) {
- return -1;
+ NPY_END_THREADS;
+ Py_DECREF(intp_type);
+ return 0;
+}
+
+
+/*
+ * Create new mapiter.
+ *
+ * NOTE: The outer iteration (and subspace if requested buffered) is
+ * created with DELAY_BUFALLOC. It must be reset before usage!
+ *
+ * @param Index information filled by prepare_index.
+ * @param Number of indices (gotten through prepare_index).
+ * @param Kind of index (gotten through preprare_index).
+ * @param NpyIter flags for an extra array. If 0 assume that there is no
+ * extra operand. NPY_ITER_ALLOCATE can make sense here.
+ * @param Array being indexed
+ * @param subspace (result of getting view for the indices)
+ * @param Subspace iterator flags can be used to enable buffering.
+ * NOTE: When no subspace is necessary, the extra operand will
+ * always be buffered! Buffering the subspace when not
+ * necessary is very slow when the subspace is small.
+ * @param Subspace operand flags (should just be 0 normally)
+ * @param Operand iteration flags for the extra operand, this must not be
+ * 0 if an extra operand should be used, otherwise it must be 0.
+ * Should be at least READONLY, WRITEONLY or READWRITE.
+ * @param Extra operand. For getmap, this would be the result, for setmap
+ * this would be the arrays to get from. Can be NULL, and will be
+ * allocated in that case.
+ * The operand has no effect on the shape.
+ * @param Dtype for the extra operand, borrows the reference and must not
+ * be NULL (if extra_op_flags is not 0).
+ *
+ * @return A new MapIter (PyObject *) or NULL.
+ */
+NPY_NO_EXPORT PyObject *
+PyArray_MapIterNew(npy_index_info *indices , int index_num, int index_type,
+ int ndim, int fancy_ndim,
+ PyArrayObject *arr, PyArrayObject *subspace,
+ npy_uint32 subspace_iter_flags, npy_uint32 subspace_flags,
+ npy_uint32 extra_op_flags, PyArrayObject *extra_op,
+ PyArray_Descr *extra_op_dtype)
+{
+ PyObject *errmsg, *tmp;
+ /* For shape reporting on error */
+ PyArrayObject *original_extra_op = extra_op;
+
+ PyArrayObject *index_arrays[NPY_MAXDIMS];
+ PyArray_Descr *dtypes[NPY_MAXDIMS];
+
+ npy_uint32 op_flags[NPY_MAXDIMS];
+ npy_uint32 outer_flags;
+
+ PyArrayMapIterObject *mit;
+
+ int single_op_axis[NPY_MAXDIMS];
+ int *op_axes[NPY_MAXDIMS] = {NULL};
+ int i, j, dummy_array = 0;
+ int nops;
+ int uses_subspace;
+
+ /* create new MapIter object */
+ mit = (PyArrayMapIterObject *)PyArray_malloc(sizeof(PyArrayMapIterObject));
+ if (mit == NULL) {
+ return NULL;
}
+ /* set all attributes of mapiter to zero */
+ memset(mit, 0, sizeof(PyArrayMapIterObject));
+ PyObject_Init((PyObject *)mit, &PyArrayMapIter_Type);
- if (mit->nd + subnd > NPY_MAXDIMS) {
- PyErr_Format(PyExc_ValueError,
- "number of dimensions must be within [0, %d], "
- "indexed array has %d",
- NPY_MAXDIMS, mit->nd + subnd);
- return -1;
+ Py_INCREF(arr);
+ mit->array = arr;
+ Py_XINCREF(subspace);
+ mit->subspace = subspace;
+
+ /*
+ * The subspace, the part of the array which is not indexed by
+ * arrays, needs to be iterated when the size of the subspace
+ * is larger than 1. If it is one, it has only an effect on the
+ * result shape. (Optimizes for example np.newaxis usage)
+ */
+ if ((subspace == NULL) || PyArray_SIZE(subspace) == 1) {
+ uses_subspace = 0;
+ }
+ else {
+ uses_subspace = 1;
}
- /* Expand dimensions of result */
- for (i = 0; i < subnd; i++) {
- mit->dimensions[mit->nd+i] = PyArray_DIMS(mit->subspace->ao)[i];
+ /* Fill basic information about the mapiter */
+ mit->nd = ndim;
+ mit->nd_fancy = fancy_ndim;
+ if (mapiter_fill_info(mit, indices, index_num, arr) < 0) {
+ Py_DECREF(mit);
+ return NULL;
}
- mit->nd += subnd;
/*
- * Now, we still need to interpret the ellipsis, slice and None
- * objects to determine which axes the indexing arrays are
- * referring to
+ * Set iteration information of the indexing arrays.
*/
- n = PyTuple_GET_SIZE(mit->indexobj);
- /* The number of dimensions an ellipsis takes up */
- newaxes = subnd - (PyArray_NDIM(arr) - mit->numiter);
- ellipexp = PyArray_NDIM(arr) + newaxes - n + 1;
+ for (i=0; i < index_num; i++) {
+ if (indices[i].type & HAS_FANCY) {
+ index_arrays[mit->numiter] = (PyArrayObject *)indices[i].object;
+ dtypes[mit->numiter] = PyArray_DescrFromType(NPY_INTP);
+
+ op_flags[mit->numiter] = (NPY_ITER_NBO |
+ NPY_ITER_ALIGNED |
+ NPY_ITER_READONLY);
+ mit->numiter += 1;
+ }
+ }
+
+ if (mit->numiter == 0) {
+ /*
+ * For MapIterArray, it is possible that there is no fancy index.
+ * to support this case, add a a dummy iterator.
+ * Since it is 0-d its transpose, etc. does not matter.
+ */
+
+ /* signal necessity to decref... */
+ dummy_array = 1;
+
+ index_arrays[0] = (PyArrayObject *)PyArray_Zeros(0, NULL,
+ PyArray_DescrFromType(NPY_INTP), 0);
+ if (index_arrays[0] == NULL) {
+ Py_DECREF(mit);
+ return NULL;
+ }
+ dtypes[0] = PyArray_DescrFromType(NPY_INTP);
+ op_flags[0] = NPY_ITER_NBO | NPY_ITER_ALIGNED | NPY_ITER_READONLY;
+
+ mit->fancy_dims[0] = 1;
+ mit->numiter = 1;
+ }
+
/*
- * Now fill in iteraxes -- remember indexing arrays have been
- * converted to 0's in mit->indexobj
+ * Now there are two general cases how extra_op is used:
+ * 1. No subspace iteration is necessary, so the extra_op can
+ * be included into the index iterator (it will be buffered)
+ * 2. Subspace iteration is necessary, so the extra op is iterated
+ * independently, and the iteration order is fixed at C (could
+ * also use Fortran order if the array is Fortran order).
+ * In this case the subspace iterator is not buffered.
+ *
+ * If subspace iteration is necessary and an extra_op was given,
+ * it may also be necessary to transpose the extra_op (or signal
+ * the transposing to the advanced iterator).
*/
- curraxis = 0;
- j = 0;
- /* Only expand the first ellipsis */
- noellip = 1;
- /* count newaxes before iter axes */
- newaxes = 0;
- memset(mit->bscoord, 0, sizeof(npy_intp)*PyArray_NDIM(arr));
- for (i = 0; i < n; i++) {
+
+ if (extra_op != NULL) {
/*
- * We need to fill in the starting coordinates for
- * the subspace
+ * If we have an extra_op given, need to prepare it.
+ * 1. Subclasses might mess with the shape, so need a baseclass
+ * 2. Need to make sure the shape is compatible
+ * 3. May need to remove leading 1s and transpose dimensions.
+ * Normal assignments allows broadcasting away leading 1s, but
+ * the transposing code does not like this.
*/
- obj = PyTuple_GET_ITEM(mit->indexobj, i);
- if (PyInt_Check(obj) || PyLong_Check(obj)) {
- mit->iteraxes[j++] = curraxis++;
- }
- else if (noellip && obj == Py_Ellipsis) {
- curraxis += ellipexp;
- noellip = 0;
- }
- else if (obj == Py_None) {
- if (j == 0) {
- newaxes += 1;
+ if (!PyArray_CheckExact(extra_op)) {
+ extra_op = (PyArrayObject *)PyArray_View(extra_op, NULL,
+ &PyArray_Type);
+ if (extra_op == NULL) {
+ goto fail;
}
}
else {
- npy_intp start = 0;
- npy_intp stop, step;
- /* Should be slice object or another Ellipsis */
- if (obj == Py_Ellipsis) {
- mit->bscoord[curraxis] = 0;
+ Py_INCREF(extra_op);
+ }
+
+ if (PyArray_NDIM(extra_op) > mit->nd) {
+ /*
+ * Usual assignments allows removal of leading one dimensions.
+ * (or equivalently adding of one dimensions to the array being
+ * assigned to). To implement this, reshape the array.
+ */
+ PyArrayObject *tmp_arr;
+ PyArray_Dims permute;
+
+ permute.len = mit->nd;
+ permute.ptr = &PyArray_DIMS(extra_op)[
+ PyArray_NDIM(extra_op) - mit->nd];
+ tmp_arr = (PyArrayObject*)PyArray_Newshape(extra_op, &permute,
+ NPY_CORDER);
+ if (tmp_arr == NULL) {
+ goto broadcast_error;
}
- else if (!PySlice_Check(obj) ||
- (slice_GetIndices((PySliceObject *)obj,
- PyArray_DIMS(arr)[curraxis],
- &start, &stop, &step,
- &dimsize) < 0)) {
- PyErr_Format(PyExc_ValueError,
- "unexpected object " \
- "(%s) in selection position %d",
- Py_TYPE(obj)->tp_name, i);
- return -1;
+ Py_DECREF(extra_op);
+ extra_op = tmp_arr;
+ }
+
+ /*
+ * If dimensions need to be prepended (and no swapaxis is needed),
+ * use op_axes after extra_op is allocated for sure.
+ */
+ if (mit->consec) {
+ PyArray_MapIterSwapAxes(mit, &extra_op, 0);
+ if (extra_op == NULL) {
+ goto fail;
+ }
+ }
+
+ if (subspace && !uses_subspace) {
+ /*
+ * We are not using the subspace, so its size is 1.
+ * All dimensions of the extra_op corresponding to the
+ * subspace must be equal to 1.
+ */
+ if (PyArray_NDIM(subspace) <= PyArray_NDIM(extra_op)) {
+ j = PyArray_NDIM(subspace);
}
else {
- mit->bscoord[curraxis] = start;
+ j = PyArray_NDIM(extra_op);
+ }
+ for (i = 1; i < j + 1; i++) {
+ if (PyArray_DIM(extra_op, PyArray_NDIM(extra_op) - i) != 1) {
+ goto broadcast_error;
+ }
}
- curraxis += 1;
}
}
- if (mit->consec) {
- mit->consec = mit->iteraxes[0] + newaxes;
- }
- finish:
- /* Here check the indexes (now that we have iteraxes) */
- mit->size = PyArray_OverflowMultiplyList(mit->dimensions, mit->nd);
- if (mit->size < 0) {
- PyErr_SetString(PyExc_ValueError,
- "dimensions too large in fancy indexing");
- return -1;
- }
- if (mit->ait->size == 0 && mit->size != 0) {
- PyErr_SetString(PyExc_IndexError,
- "invalid index into a 0-size array");
- return -1;
- }
+ /*
+ * If subspace is not NULL, NpyIter cannot allocate extra_op for us.
+ * This is a bit of a kludge. A dummy iterator is created to find
+ * the correct output shape and stride permutation.
+ * TODO: This can at least partially be replaced, since the shape
+ * is found for broadcasting errors.
+ */
+ else if (extra_op_flags && (subspace != NULL)) {
+ npy_uint32 tmp_op_flags[NPY_MAXDIMS];
+
+ NpyIter *tmp_iter;
+ npy_intp stride;
+ npy_intp strides[NPY_MAXDIMS];
+ npy_stride_sort_item strideperm[NPY_MAXDIMS];
+
+ for (i=0; i < mit->numiter; i++) {
+ tmp_op_flags[i] = NPY_ITER_READONLY;
+ }
+
+ Py_INCREF(extra_op_dtype);
+ mit->extra_op_dtype = extra_op_dtype;
+
+ /* Create an iterator, just to broadcast the arrays?! */
+ tmp_iter = NpyIter_MultiNew(mit->numiter, index_arrays,
+ NPY_ITER_ZEROSIZE_OK |
+ NPY_ITER_REFS_OK |
+ NPY_ITER_MULTI_INDEX |
+ NPY_ITER_DONT_NEGATE_STRIDES,
+ NPY_KEEPORDER,
+ NPY_UNSAFE_CASTING,
+ tmp_op_flags, NULL);
+ if (tmp_iter == NULL) {
+ goto fail;
+ }
- for (i = 0; i < mit->numiter; i++) {
- npy_intp indval;
- it = mit->iters[i];
- PyArray_ITER_RESET(it);
- dimsize = PyArray_DIMS(arr)[mit->iteraxes[i]];
- while (it->index < it->size) {
- indptr = ((npy_intp *)it->dataptr);
- indval = *indptr;
- if (check_and_adjust_index(&indval, dimsize, mit->iteraxes[i]) < 0) {
- return -1;
+ if (PyArray_SIZE(subspace) == 1) {
+ /*
+ * nditer allows itemsize with npy_intp type, so it works
+ * here, but it would *not* work directly, since elsize
+ * is limited to int.
+ */
+ if (!NpyIter_CreateCompatibleStrides(tmp_iter,
+ extra_op_dtype->elsize * PyArray_SIZE(subspace),
+ strides)) {
+ PyErr_SetString(PyExc_ValueError,
+ "internal error: failed to find output array strides");
+ goto fail;
}
- PyArray_ITER_NEXT(it);
}
- PyArray_ITER_RESET(it);
- }
- return 0;
-}
-
+ else {
+ /* Just use C-order strides (TODO: allow also F-order) */
+ stride = extra_op_dtype->elsize * PyArray_SIZE(subspace);
+ for (i=mit->nd_fancy - 1; i >= 0; i--) {
+ strides[i] = stride;
+ stride *= mit->dimensions[i];
+ }
+ }
+ NpyIter_Deallocate(tmp_iter);
-NPY_NO_EXPORT PyObject *
-PyArray_MapIterNew(PyObject *indexobj, int oned, int fancy)
-{
- PyArrayMapIterObject *mit;
- PyArray_Descr *indtype;
- PyArrayObject *arr = NULL;
- int i, n, started, nonindex;
+ /* shape is set, and strides is set up to mit->nd, set rest */
+ PyArray_CreateSortedStridePerm(PyArray_NDIM(subspace),
+ PyArray_STRIDES(subspace), strideperm);
+ stride = extra_op_dtype->elsize;
+ for (i=PyArray_NDIM(subspace) - 1; i >= 0; i--) {
+ strides[mit->nd_fancy + strideperm[i].perm] = stride;
+ stride *= PyArray_DIM(subspace, strideperm[i].perm);
+ }
- if (fancy == SOBJ_BADARRAY) {
- PyErr_SetString(PyExc_IndexError,
- "arrays used as indices must be of "
- "integer (or boolean) type");
- return NULL;
+ /*
+ * Allocate new array. Note: Always base class, because
+ * subclasses might mess with the shape.
+ */
+ Py_INCREF(extra_op_dtype);
+ extra_op = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type,
+ extra_op_dtype,
+ mit->nd_fancy + PyArray_NDIM(subspace),
+ mit->dimensions, strides,
+ NULL, 0, NULL);
+ if (extra_op == NULL) {
+ goto fail;
+ }
}
- if (fancy == SOBJ_TOOMANY) {
- PyErr_SetString(PyExc_IndexError, "too many indices");
- return NULL;
+
+ /*
+ * The extra op is now either allocated, can be allocated by
+ * NpyIter (no subspace) or is not used at all.
+ *
+ * Need to set the axis remapping for the extra_op. This needs
+ * to cause ignoring of subspace dimensions and prepending -1
+ * for broadcasting.
+ */
+ if (extra_op) {
+ for (j=0; j < mit->nd - PyArray_NDIM(extra_op); j++) {
+ single_op_axis[j] = -1;
+ }
+ for (i=0; i < PyArray_NDIM(extra_op); i++) {
+ /* (fills subspace dimensions too, but they are not unused) */
+ single_op_axis[j++] = i;
+ }
}
- mit = (PyArrayMapIterObject *)PyArray_malloc(sizeof(PyArrayMapIterObject));
- if (mit == NULL) {
- return NULL;
+ /*
+ * NOTE: If for some reason someone wishes to use REDUCE_OK, be
+ * careful and fix the error message replacement at the end.
+ */
+ outer_flags = NPY_ITER_ZEROSIZE_OK |
+ NPY_ITER_REFS_OK |
+ NPY_ITER_BUFFERED |
+ NPY_ITER_DELAY_BUFALLOC |
+ NPY_ITER_GROWINNER;
+
+ /*
+ * For a single 1-d operand, guarantee iteration order
+ * (scipy used this). Note that subspace may be used.
+ */
+ if ((mit->numiter == 1) && (PyArray_NDIM(index_arrays[0]) == 1)) {
+ outer_flags |= NPY_ITER_DONT_NEGATE_STRIDES;
}
- /* set all attributes of mapiter to zero */
- memset(mit, 0, sizeof(PyArrayMapIterObject));
- PyObject_Init((PyObject *)mit, &PyArrayMapIter_Type);
- /* initialize mapiter attributes */
- mit->consec = 1;
- if (fancy == SOBJ_LISTTUP) {
- PyObject *newobj;
- newobj = PySequence_Tuple(indexobj);
- if (newobj == NULL) {
+ /* If external array is iterated, and no subspace is needed */
+ nops = mit->numiter;
+ if (extra_op_flags && !uses_subspace) {
+ /*
+ * NOTE: This small limitation should practically not matter.
+ * (replaces npyiter error)
+ */
+ if (mit->numiter > NPY_MAXDIMS - 1) {
+ PyErr_Format(PyExc_IndexError,
+ "when no subspace is given, the number of index "
+ "arrays cannot be above %d, but %d index arrays found",
+ NPY_MAXDIMS - 1, mit->numiter);
goto fail;
}
- indexobj = newobj;
- mit->indexobj = indexobj;
+
+ nops += 1;
+ index_arrays[mit->numiter] = extra_op;
+
+ Py_INCREF(extra_op_dtype);
+ dtypes[mit->numiter] = extra_op_dtype;
+ op_flags[mit->numiter] = (extra_op_flags |
+ NPY_ITER_ALLOCATE |
+ NPY_ITER_NO_SUBTYPE);
+
+ if (extra_op) {
+ /* Use the axis remapping */
+ op_axes[mit->numiter] = single_op_axis;
+ mit->outer = NpyIter_AdvancedNew(nops, index_arrays, outer_flags,
+ NPY_KEEPORDER, NPY_UNSAFE_CASTING, op_flags, dtypes,
+ mit->nd_fancy, op_axes, mit->dimensions, 0);
+ }
+ else {
+ mit->outer = NpyIter_MultiNew(nops, index_arrays, outer_flags,
+ NPY_KEEPORDER, NPY_UNSAFE_CASTING, op_flags, dtypes);
+ }
+
}
else {
- Py_INCREF(indexobj);
- mit->indexobj = indexobj;
+ /* TODO: Maybe add test for the CORDER, and maybe also allow F */
+ mit->outer = NpyIter_MultiNew(nops, index_arrays, outer_flags,
+ NPY_CORDER, NPY_UNSAFE_CASTING, op_flags, dtypes);
}
-
- if (oned) {
- return (PyObject *)mit;
+ /* NpyIter cleanup and information: */
+ for (i=0; i < nops; i++) {
+ Py_DECREF(dtypes[i]);
+ }
+ if (dummy_array) {
+ Py_DECREF(index_arrays[0]);
+ }
+ if (mit->outer == NULL) {
+ goto fail;
+ }
+ if (!uses_subspace) {
+ NpyIter_EnableExternalLoop(mit->outer);
}
- /*
- * Must have some kind of fancy indexing if we are here
- * indexobj is either a list, an arrayobject, or a tuple
- * (with at least 1 list or arrayobject or Bool object)
- */
- /* convert all inputs to iterators */
- if (PyArray_Check(indexobj) && PyArray_ISBOOL(indexobj)
- && !PyArray_IsZeroDim(indexobj)) {
- mit->numiter = _nonzero_indices(indexobj, mit->iters);
- if (mit->numiter < 0) {
+ mit->outer_next = NpyIter_GetIterNext(mit->outer, NULL);
+ if (mit->outer_next == NULL) {
+ goto fail;
+ }
+ mit->outer_ptrs = NpyIter_GetDataPtrArray(mit->outer);
+ if (!uses_subspace) {
+ mit->outer_strides = NpyIter_GetInnerStrideArray(mit->outer);
+ }
+ if (NpyIter_IterationNeedsAPI(mit->outer)) {
+ mit->needs_api = 1;
+ /* We may be doing a cast for the buffer, and that may have failed */
+ if (PyErr_Occurred()) {
goto fail;
}
- mit->nd = 1;
- mit->dimensions[0] = mit->iters[0]->dims_m1[0]+1;
- Py_DECREF(mit->indexobj);
- mit->indexobj = PyTuple_New(mit->numiter);
- if (mit->indexobj == NULL) {
- goto fail;
+ }
+
+ /* Get the allocated extra_op */
+ if (extra_op_flags) {
+ if (extra_op == NULL) {
+ mit->extra_op = NpyIter_GetOperandArray(mit->outer)[mit->numiter];
}
- for (i = 0; i < mit->numiter; i++) {
- PyTuple_SET_ITEM(mit->indexobj, i, PyInt_FromLong(0));
+ else {
+ mit->extra_op = extra_op;
}
+ Py_INCREF(mit->extra_op);
}
- else if (PyArray_Check(indexobj) || !PyTuple_Check(indexobj)) {
- mit->numiter = 1;
- indtype = PyArray_DescrFromType(NPY_INTP);
- arr = (PyArrayObject *)PyArray_FromAny(indexobj, indtype, 0, 0,
- NPY_ARRAY_FORCECAST, NULL);
- if (arr == NULL) {
+
+ /*
+ * If extra_op is being tracked but subspace is used, we need
+ * to create a dedicated iterator for the outer iteration of
+ * the extra operand.
+ */
+ if (extra_op_flags && uses_subspace) {
+ op_axes[0] = single_op_axis;
+ mit->extra_op_iter = NpyIter_AdvancedNew(1, &extra_op,
+ NPY_ITER_ZEROSIZE_OK |
+ NPY_ITER_REFS_OK |
+ NPY_ITER_GROWINNER,
+ NPY_CORDER,
+ NPY_NO_CASTING,
+ &extra_op_flags,
+ NULL,
+ mit->nd_fancy, op_axes,
+ mit->dimensions, 0);
+
+ if (mit->extra_op_iter == NULL) {
goto fail;
}
- mit->iters[0] = (PyArrayIterObject *)PyArray_IterNew((PyObject *)arr);
- if (mit->iters[0] == NULL) {
- Py_DECREF(arr);
+
+ mit->extra_op_next = NpyIter_GetIterNext(mit->extra_op_iter, NULL);
+ if (mit->extra_op_next == NULL) {
goto fail;
}
- mit->nd = PyArray_NDIM(arr);
- memcpy(mit->dimensions, PyArray_DIMS(arr), mit->nd*sizeof(npy_intp));
- mit->size = PyArray_SIZE(arr);
- Py_DECREF(arr);
- Py_DECREF(mit->indexobj);
- mit->indexobj = Py_BuildValue("(N)", PyInt_FromLong(0));
+ mit->extra_op_ptrs = NpyIter_GetDataPtrArray(mit->extra_op_iter);
+ }
+
+ /* Get the full dimension information */
+ if (subspace != NULL) {
+ mit->baseoffset = PyArray_BYTES(subspace);
}
else {
- /* must be a tuple */
- PyObject *obj;
- PyArrayIterObject **iterp;
- PyObject *new;
- int numiters, j, n2;
+ mit->baseoffset = PyArray_BYTES(arr);
+ }
+
+ /* Calculate total size of the MapIter */
+ mit->size = PyArray_OverflowMultiplyList(mit->dimensions, mit->nd);
+ if (mit->size < 0) {
+ PyErr_SetString(PyExc_ValueError,
+ "advanced indexing operation result is too large");
+ goto fail;
+ }
+
+ /* Can now return early if no subspace is being used */
+ if (!uses_subspace) {
+ Py_XDECREF(extra_op);
+ return (PyObject *)mit;
+ }
+
+ /* Fill in the last bit of mapiter information needed */
+
+ /*
+ * Now just need to create the correct subspace iterator.
+ */
+ index_arrays[0] = subspace;
+ dtypes[0] = NULL;
+ op_flags[0] = subspace_flags;
+ op_axes[0] = NULL;
+
+ if (extra_op_flags) {
+ /* We should iterate the extra_op as well */
+ nops = 2;
+ index_arrays[1] = extra_op;
+
+ op_axes[1] = &single_op_axis[mit->nd_fancy];
+
/*
- * Make a copy of the tuple -- we will be replacing
- * index objects with 0's
+ * Buffering is never used here, but in case someone plugs it in
+ * somewhere else, set the type correctly then.
*/
- n = PyTuple_GET_SIZE(indexobj);
- n2 = n;
- new = PyTuple_New(n2);
- if (new == NULL) {
- goto fail;
+ if ((subspace_iter_flags & NPY_ITER_BUFFERED)) {
+ dtypes[1] = extra_op_dtype;
}
- started = 0;
- nonindex = 0;
- j = 0;
- for (i = 0; i < n; i++) {
- obj = PyTuple_GET_ITEM(indexobj,i);
- iterp = mit->iters + mit->numiter;
- if ((numiters=_convert_obj(obj, iterp)) < 0) {
- Py_DECREF(new);
- goto fail;
- }
- if (numiters > 0) {
- started = 1;
- if (nonindex) {
- mit->consec = 0;
- }
- mit->numiter += numiters;
- if (numiters == 1) {
- PyTuple_SET_ITEM(new,j++, PyInt_FromLong(0));
- }
- else {
- /*
- * we need to grow the new indexing object and fill
- * it with 0s for each of the iterators produced
- */
- int k;
- n2 += numiters - 1;
- if (_PyTuple_Resize(&new, n2) < 0) {
- goto fail;
- }
- for (k = 0; k < numiters; k++) {
- PyTuple_SET_ITEM(new, j++, PyInt_FromLong(0));
- }
- }
- }
- else {
- if (started) {
- nonindex = 1;
- }
- Py_INCREF(obj);
- PyTuple_SET_ITEM(new,j++,obj);
- }
+ else {
+ dtypes[1] = NULL;
}
- Py_DECREF(mit->indexobj);
- mit->indexobj = new;
+ op_flags[1] = extra_op_flags;
+ }
+ else {
+ nops = 1;
+ }
+
+ mit->subspace_iter = NpyIter_AdvancedNew(nops, index_arrays,
+ NPY_ITER_ZEROSIZE_OK |
+ NPY_ITER_REFS_OK |
+ NPY_ITER_GROWINNER |
+ NPY_ITER_EXTERNAL_LOOP |
+ NPY_ITER_DELAY_BUFALLOC |
+ subspace_iter_flags,
+ (nops == 1 ? NPY_CORDER : NPY_KEEPORDER),
+ NPY_UNSAFE_CASTING,
+ op_flags, dtypes,
+ PyArray_NDIM(subspace), op_axes,
+ &mit->dimensions[mit->nd_fancy], 0);
+
+ if (mit->subspace_iter == NULL) {
+ goto fail;
+ }
+
+ mit->subspace_next = NpyIter_GetIterNext(mit->subspace_iter, NULL);
+ if (mit->subspace_next == NULL) {
+ goto fail;
+ }
+ mit->subspace_ptrs = NpyIter_GetDataPtrArray(mit->subspace_iter);
+ mit->subspace_strides = NpyIter_GetInnerStrideArray(mit->subspace_iter);
+
+ if (NpyIter_IterationNeedsAPI(mit->outer)) {
+ mit->needs_api = 1;
/*
- * Store the number of iterators actually converted
- * These will be mapped to actual axes at bind time
+ * NOTE: In this case, need to call PyErr_Occurred() after
+ * basepointer resetting (buffer allocation)
*/
- if (PyArray_Broadcast((PyArrayMultiIterObject *)mit) < 0) {
- goto fail;
- }
}
+ Py_XDECREF(extra_op);
return (PyObject *)mit;
- fail:
+ fail:
+ /*
+ * Check whether the operand could not be broadcast and replace the error
+ * in that case. This should however normally be found early with a
+ * direct goto to broadcast_error
+ */
+ if (extra_op == NULL) {
+ goto finish;
+ }
+
+ j = mit->nd;
+ for (i = PyArray_NDIM(extra_op) - 1; i >= 0; i--) {
+ j--;
+ if ((PyArray_DIM(extra_op, i) != 1) &&
+ /* (j < 0 is currently impossible, extra_op is reshaped) */
+ j >= 0 &&
+ PyArray_DIM(extra_op, i) != mit->dimensions[j]) {
+ /* extra_op cannot be broadcast to the indexing result */
+ goto broadcast_error;
+ }
+ }
+ goto finish;
+
+ broadcast_error:
+ errmsg = PyUString_FromString("shape mismatch: value array "
+ "of shape ");
+ if (errmsg == NULL) {
+ goto finish;
+ }
+
+ /* Report the shape of the original array if it exists */
+ if (original_extra_op == NULL) {
+ original_extra_op = extra_op;
+ }
+
+ tmp = convert_shape_to_string(PyArray_NDIM(original_extra_op),
+ PyArray_DIMS(original_extra_op), " ");
+ if (tmp == NULL) {
+ goto finish;
+ }
+ PyUString_ConcatAndDel(&errmsg, tmp);
+ if (errmsg == NULL) {
+ goto finish;
+ }
+
+ tmp = PyUString_FromString("could not be broadcast to indexing "
+ "result of shape ");
+ PyUString_ConcatAndDel(&errmsg, tmp);
+ if (errmsg == NULL) {
+ goto finish;
+ }
+
+ tmp = convert_shape_to_string(mit->nd, mit->dimensions, "");
+ if (tmp == NULL) {
+ goto finish;
+ }
+ PyUString_ConcatAndDel(&errmsg, tmp);
+ if (errmsg == NULL) {
+ goto finish;
+ }
+
+ PyErr_SetObject(PyExc_ValueError, errmsg);
+ Py_DECREF(errmsg);
+
+ finish:
+ Py_XDECREF(extra_op);
Py_DECREF(mit);
return NULL;
}
+
/*NUMPY_API
-*/
+ *
+ * Use advanced indexing to iterate an array. Please note
+ * that most of this public API is currently not guaranteed
+ * to stay the same between versions. If you plan on using
+ * it, please consider adding more utility functions here
+ * to accommodate new features.
+ */
NPY_NO_EXPORT PyObject *
PyArray_MapIterArray(PyArrayObject * a, PyObject * index)
{
- PyArrayMapIterObject * mit;
- int fancy = fancy_indexing_check(index);
+ PyArrayMapIterObject * mit = NULL;
+ PyArrayObject *subspace = NULL;
+ npy_index_info indices[NPY_MAXDIMS * 2 + 1];
+ int i, index_num, ndim, fancy_ndim, index_type;
- /*
- * MapIterNew supports a special mode that allows more efficient 1-d iteration,
- * but clients that want to make use of this need to use a different API just
- * for the one-d cases. For the public interface this is confusing, so we
- * unconditionally disable the 1-d optimized mode, and use the generic
- * implementation in all cases.
- */
- int oned = 0;
+ index_type = prepare_index(a, index, indices, &index_num,
+ &ndim, &fancy_ndim, 0);
- mit = (PyArrayMapIterObject *) PyArray_MapIterNew(index, oned, fancy);
- if (mit == NULL) {
+ if (index_type < 0) {
return NULL;
}
- if (PyArray_MapIterBind(mit, a) != 0) {
- Py_DECREF(mit);
- return NULL;
+ /* If it is not a pure fancy index, need to get the subspace */
+ if (index_type != HAS_FANCY) {
+ if (get_view_from_index(a, &subspace, indices, index_num, 1) < 0) {
+ goto fail;
+ }
+ }
+
+ mit = (PyArrayMapIterObject *)PyArray_MapIterNew(indices, index_num,
+ index_type, ndim,
+ fancy_ndim,
+ a, subspace, 0,
+ NPY_ITER_READWRITE,
+ 0, NULL, NULL);
+ if (mit == NULL) {
+ goto fail;
+ }
+
+ /* Required for backward compatibility */
+ mit->ait = (PyArrayIterObject *)PyArray_IterNew((PyObject *)a);
+ if (mit->ait == NULL) {
+ goto fail;
+ }
+
+ if (PyArray_MapIterCheckIndices(mit) < 0) {
+ goto fail;
}
+
+ Py_XDECREF(subspace);
PyArray_MapIterReset(mit);
- return mit;
+
+ for (i=0; i < index_num; i++) {
+ Py_XDECREF(indices[i].object);
+ }
+
+ return (PyObject *)mit;
+
+ fail:
+ Py_XDECREF(subspace);
+ Py_XDECREF((PyObject *)mit);
+ for (i=0; i < index_num; i++) {
+ Py_XDECREF(indices[i].object);
+ }
+ return NULL;
}
-#undef SOBJ_NOTFANCY
-#undef SOBJ_ISFANCY
-#undef SOBJ_BADARRAY
-#undef SOBJ_TOOMANY
-#undef SOBJ_LISTTUP
+#undef HAS_INTEGER
+#undef HAS_NEWAXIS
+#undef HAS_SLICE
+#undef HAS_ELLIPSIS
+#undef HAS_FANCY
+#undef HAS_BOOL
+#undef HAS_SCALAR_ARRAY
+#undef HAS_0D_BOOL
+
static void
arraymapiter_dealloc(PyArrayMapIterObject *mit)
{
- int i;
- Py_XDECREF(mit->indexobj);
+ Py_XDECREF(mit->array);
Py_XDECREF(mit->ait);
Py_XDECREF(mit->subspace);
- for (i = 0; i < mit->numiter; i++) {
- Py_XDECREF(mit->iters[i]);
+ Py_XDECREF(mit->extra_op);
+ Py_XDECREF(mit->extra_op_dtype);
+ if (mit->outer != NULL) {
+ NpyIter_Deallocate(mit->outer);
+ }
+ if (mit->subspace_iter != NULL) {
+ NpyIter_Deallocate(mit->subspace_iter);
+ }
+ if (mit->extra_op_iter != NULL) {
+ NpyIter_Deallocate(mit->extra_op_iter);
}
PyArray_free(mit);
}
@@ -2162,9 +3251,9 @@ arraymapiter_dealloc(PyArrayMapIterObject *mit)
* This was the orginal intention, but currently that does not work.
* Do not expose the MapIter_Type to Python.
*
- * It's not very useful anyway, since mapiter(indexobj); mapiter.bind(a);
- * mapiter is equivalent to a[indexobj].flat but the latter gets to use
- * slice syntax.
+ * The original mapiter(indexobj); mapiter.bind(a); idea is now fully
+ * removed. This is not very useful anyway, since mapiter is equivalent
+ * to a[indexobj].flat but the latter gets to use slice syntax.
*/
NPY_NO_EXPORT PyTypeObject PyArrayMapIter_Type = {
#if defined(NPY_PY3K)
@@ -2174,7 +3263,7 @@ NPY_NO_EXPORT PyTypeObject PyArrayMapIter_Type = {
0, /* ob_size */
#endif
"numpy.mapiter", /* tp_name */
- sizeof(PyArrayIterObject), /* tp_basicsize */
+ sizeof(PyArrayMapIterObject), /* tp_basicsize */
0, /* tp_itemsize */
/* methods */
(destructor)arraymapiter_dealloc, /* tp_dealloc */
@@ -2223,7 +3312,7 @@ NPY_NO_EXPORT PyTypeObject PyArrayMapIter_Type = {
0, /* tp_subclasses */
0, /* tp_weaklist */
0, /* tp_del */
+#if PY_VERSION_HEX >= 0x02060000
0, /* tp_version_tag */
+#endif
};
-
-/** END of Subscript Iterator **/
diff --git a/numpy/core/src/multiarray/mapping.h b/numpy/core/src/multiarray/mapping.h
index 224e28412..f59f6bb22 100644
--- a/numpy/core/src/multiarray/mapping.h
+++ b/numpy/core/src/multiarray/mapping.h
@@ -7,6 +7,25 @@ extern NPY_NO_EXPORT PyMappingMethods array_as_mapping;
NPY_NO_EXPORT PyMappingMethods array_as_mapping;
#endif
+
+/*
+ * Struct into which indices are parsed.
+ * I.e. integer ones should only be parsed once, slices and arrays
+ * need to be validated later and for the ellipsis we need to find how
+ * many slices it represents.
+ */
+typedef struct {
+ /*
+ * Object of index: slice, array, or NULL. Owns a reference.
+ */
+ PyObject *object;
+ /* Value of an integer index or number of slices an Ellipsis is worth */
+ npy_intp value;
+ /* kind of index, see constants in mapping.c */
+ int type;
+} npy_index_info;
+
+
NPY_NO_EXPORT Py_ssize_t
array_length(PyArrayObject *self);
@@ -26,13 +45,7 @@ NPY_NO_EXPORT PyObject *
array_subscript(PyArrayObject *self, PyObject *op);
NPY_NO_EXPORT int
-array_ass_item(PyArrayObject *self, Py_ssize_t i, PyObject *v);
-
-NPY_NO_EXPORT PyObject *
-add_new_axes_0d(PyArrayObject *, int);
-
-NPY_NO_EXPORT int
-count_new_axes_0d(PyObject *tuple);
+array_assign_item(PyArrayObject *self, Py_ssize_t i, PyObject *v);
/*
* Prototypes for Mapping calls --- not part of the C-API
@@ -45,9 +58,16 @@ NPY_NO_EXPORT void
PyArray_MapIterNext(PyArrayMapIterObject *mit);
NPY_NO_EXPORT int
-PyArray_MapIterBind(PyArrayMapIterObject *, PyArrayObject *);
+PyArray_MapIterCheckIndices(PyArrayMapIterObject *mit);
-NPY_NO_EXPORT PyObject*
-PyArray_MapIterNew(PyObject *, int, int);
+NPY_NO_EXPORT void
+PyArray_MapIterSwapAxes(PyArrayMapIterObject *mit, PyArrayObject **ret, int getmap);
+NPY_NO_EXPORT PyObject*
+PyArray_MapIterNew(npy_index_info *indices , int index_num, int index_type,
+ int ndim, int fancy_ndim,
+ PyArrayObject *arr, PyArrayObject *subspace,
+ npy_uint32 subspace_iter_flags, npy_uint32 subspace_flags,
+ npy_uint32 extra_op_flags, PyArrayObject *extra_op,
+ PyArray_Descr *extra_op_dtype);
#endif
diff --git a/numpy/core/src/multiarray/methods.c b/numpy/core/src/multiarray/methods.c
index 37b7d3c18..5fab174ba 100644
--- a/numpy/core/src/multiarray/methods.c
+++ b/numpy/core/src/multiarray/methods.c
@@ -65,8 +65,9 @@ get_forwarding_ndarray_method(const char *name)
"NumPy internal error: could not find function "
"numpy.core._methods.%s", name);
}
-
- Py_INCREF(callable);
+ else {
+ Py_INCREF(callable);
+ }
Py_DECREF(module_methods);
return callable;
}
@@ -351,9 +352,9 @@ array_swapaxes(PyArrayObject *self, PyObject *args)
}
-/* steals typed reference */
/*NUMPY_API
Get a subset of bytes from each element of the array
+ steals reference to typed, must not be NULL
*/
NPY_NO_EXPORT PyObject *
PyArray_GetField(PyArrayObject *self, PyArray_Descr *typed, int offset)
@@ -409,6 +410,7 @@ array_getfield(PyArrayObject *self, PyObject *args, PyObject *kwds)
/*NUMPY_API
Set a subset of bytes from each element of the array
+ steals reference to dtype, must not be NULL
*/
NPY_NO_EXPORT int
PyArray_SetField(PyArrayObject *self, PyArray_Descr *dtype,
@@ -542,7 +544,7 @@ array_tolist(PyArrayObject *self, PyObject *args)
static PyObject *
-array_tostring(PyArrayObject *self, PyObject *args, PyObject *kwds)
+array_tobytes(PyArrayObject *self, PyObject *args, PyObject *kwds)
{
NPY_ORDER order = NPY_CORDER;
static char *kwlist[] = {"order", NULL};
@@ -588,7 +590,7 @@ array_tofile(PyArrayObject *self, PyObject *args, PyObject *kwds)
own = 0;
}
- fd = npy_PyFile_Dup(file, "wb", &orig_pos);
+ fd = npy_PyFile_Dup2(file, "wb", &orig_pos);
if (fd == NULL) {
PyErr_SetString(PyExc_IOError,
"first argument must be a string or open file");
@@ -597,7 +599,7 @@ array_tofile(PyArrayObject *self, PyObject *args, PyObject *kwds)
if (PyArray_ToFile(self, fd, sep, format) < 0) {
goto fail;
}
- if (npy_PyFile_DupClose(file, fd, orig_pos) < 0) {
+ if (npy_PyFile_DupClose2(file, fd, orig_pos) < 0) {
goto fail;
}
if (own && npy_PyFile_CloseFile(file) < 0) {
@@ -647,7 +649,7 @@ array_toscalar(PyArrayObject *self, PyObject *args)
return NULL;
}
- if (check_and_adjust_index(&value, size, -1) < 0) {
+ if (check_and_adjust_index(&value, size, -1, NULL) < 0) {
return NULL;
}
@@ -724,7 +726,7 @@ array_setscalar(PyArrayObject *self, PyObject *args)
return NULL;
}
- if (check_and_adjust_index(&value, size, -1) < 0) {
+ if (check_and_adjust_index(&value, size, -1, NULL) < 0) {
return NULL;
}
@@ -1457,7 +1459,7 @@ array_deepcopy(PyArrayObject *self, PyObject *args)
Py_DECREF(deepcopy);
Py_DECREF(it);
}
- return PyArray_Return(ret);
+ return (PyObject*)ret;
}
/* Convert Array to flat list (using getitem) */
@@ -1712,6 +1714,9 @@ array_setstate(PyArrayObject *self, PyObject *args)
if (nd > 0) {
fa->dimensions = PyDimMem_NEW(3*nd);
+ if (fa->dimensions == NULL) {
+ return PyErr_NoMemory();
+ }
fa->strides = PyArray_DIMS(self) + nd;
memcpy(PyArray_DIMS(self), dimensions, sizeof(npy_intp)*nd);
_array_fill_strides(PyArray_STRIDES(self), dimensions, nd,
@@ -1820,6 +1825,7 @@ PyArray_Dump(PyObject *self, PyObject *file, int protocol)
if (PyBytes_Check(file) || PyUnicode_Check(file)) {
file = npy_PyFile_OpenFile(file, "wb");
if (file == NULL) {
+ Py_DECREF(cpick);
return -1;
}
}
@@ -2456,6 +2462,9 @@ NPY_NO_EXPORT PyMethodDef array_methods[] = {
{"take",
(PyCFunction)array_take,
METH_VARARGS | METH_KEYWORDS, NULL},
+ {"tobytes",
+ (PyCFunction)array_tobytes,
+ METH_VARARGS | METH_KEYWORDS, NULL},
{"tofile",
(PyCFunction)array_tofile,
METH_VARARGS | METH_KEYWORDS, NULL},
@@ -2463,7 +2472,7 @@ NPY_NO_EXPORT PyMethodDef array_methods[] = {
(PyCFunction)array_tolist,
METH_VARARGS, NULL},
{"tostring",
- (PyCFunction)array_tostring,
+ (PyCFunction)array_tobytes,
METH_VARARGS | METH_KEYWORDS, NULL},
{"trace",
(PyCFunction)array_trace,
diff --git a/numpy/core/src/multiarray/multiarray_tests.c.src b/numpy/core/src/multiarray/multiarray_tests.c.src
index 9f327b24e..bd0366bd5 100644
--- a/numpy/core/src/multiarray/multiarray_tests.c.src
+++ b/numpy/core/src/multiarray/multiarray_tests.c.src
@@ -690,6 +690,139 @@ get_buffer_info(PyObject *NPY_UNUSED(self), PyObject *args)
#undef GET_PYBUF_FLAG
+/*
+ * Test C-api level item getting.
+ */
+static PyObject *
+array_indexing(PyObject *NPY_UNUSED(self), PyObject *args)
+{
+ int mode;
+ Py_ssize_t i;
+ PyObject *arr, *op = NULL;
+
+ if (!PyArg_ParseTuple(args, "iOn|O", &mode, &arr, &i, &op)) {
+ return NULL;
+ }
+
+ if (mode == 0) {
+ return PySequence_GetItem(arr, i);
+ }
+ if (mode == 1) {
+ if (PySequence_SetItem(arr, i, op) < 0) {
+ return NULL;
+ }
+ Py_RETURN_NONE;
+ }
+
+ PyErr_SetString(PyExc_ValueError,
+ "invalid mode. 0: item 1: assign");
+ return NULL;
+}
+
+
+/*
+ * Test nditer of too large arrays using remove axis, etc.
+ */
+static PyObject *
+test_nditer_too_large(PyObject *NPY_UNUSED(self), PyObject *args) {
+ NpyIter *iter;
+ PyObject *array_tuple, *arr;
+ PyArrayObject *arrays[NPY_MAXARGS];
+ npy_uint32 op_flags[NPY_MAXARGS];
+ Py_ssize_t nop;
+ int i, axis, mode;
+
+ npy_intp index[NPY_MAXARGS] = {0};
+ char *msg;
+
+ if (!PyArg_ParseTuple(args, "Oii", &array_tuple, &axis, &mode)) {
+ return NULL;
+ }
+
+ if (!PyTuple_CheckExact(array_tuple)) {
+ PyErr_SetString(PyExc_ValueError, "tuple required as first argument");
+ return NULL;
+ }
+ nop = PyTuple_Size(array_tuple);
+ if (nop > NPY_MAXARGS) {
+ PyErr_SetString(PyExc_ValueError, "tuple must be smaller then maxargs");
+ return NULL;
+ }
+
+ for (i=0; i < nop; i++) {
+ arr = PyTuple_GET_ITEM(array_tuple, i);
+ if (!PyArray_CheckExact(arr)) {
+ PyErr_SetString(PyExc_ValueError, "require base class ndarray");
+ return NULL;
+ }
+ arrays[i] = (PyArrayObject *)arr;
+ op_flags[i] = NPY_ITER_READONLY;
+ }
+
+ iter = NpyIter_MultiNew(nop, arrays, NPY_ITER_MULTI_INDEX | NPY_ITER_RANGED,
+ NPY_KEEPORDER, NPY_NO_CASTING, op_flags, NULL);
+
+ if (iter == NULL) {
+ return NULL;
+ }
+
+ /* Remove an axis (negative, do not remove any) */
+ if (axis >= 0) {
+ if (!NpyIter_RemoveAxis(iter, axis)) {
+ goto fail;
+ }
+ }
+
+ switch (mode) {
+ /* Test IterNext getting */
+ case 0:
+ if (NpyIter_GetIterNext(iter, NULL) == NULL) {
+ goto fail;
+ }
+ break;
+ case 1:
+ if (NpyIter_GetIterNext(iter, &msg) == NULL) {
+ PyErr_SetString(PyExc_ValueError, msg);
+ goto fail;
+ }
+ break;
+ /* Test Multi Index removal */
+ case 2:
+ if (!NpyIter_RemoveMultiIndex(iter)) {
+ goto fail;
+ }
+ break;
+ /* Test GotoMultiIndex (just 0 hardcoded) */
+ case 3:
+ if (!NpyIter_GotoMultiIndex(iter, index)) {
+ goto fail;
+ }
+ break;
+ /* Test setting iterrange (hardcoded range of 0, 1) */
+ case 4:
+ if (!NpyIter_ResetToIterIndexRange(iter, 0, 1, NULL)) {
+ goto fail;
+ }
+ break;
+ case 5:
+ if (!NpyIter_ResetToIterIndexRange(iter, 0, 1, &msg)) {
+ PyErr_SetString(PyExc_ValueError, msg);
+ goto fail;
+ }
+ break;
+ /* Do nothing */
+ default:
+ break;
+ }
+
+ NpyIter_Deallocate(iter);
+ Py_RETURN_NONE;
+ fail:
+ NpyIter_Deallocate(iter);
+ return NULL;
+}
+
+
static PyMethodDef Multiarray_TestsMethods[] = {
{"test_neighborhood_iterator",
test_neighborhood_iterator,
@@ -714,6 +847,12 @@ static PyMethodDef Multiarray_TestsMethods[] = {
{"get_buffer_info",
get_buffer_info,
METH_VARARGS, NULL},
+ {"array_indexing",
+ array_indexing,
+ METH_VARARGS, NULL},
+ {"test_nditer_too_large",
+ test_nditer_too_large,
+ METH_VARARGS, NULL},
{NULL, NULL, 0, NULL} /* Sentinel */
};
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c
index 23cb7e368..682705a1b 100644
--- a/numpy/core/src/multiarray/multiarraymodule.c
+++ b/numpy/core/src/multiarray/multiarraymodule.c
@@ -20,6 +20,7 @@
#define NPY_NO_DEPRECATED_API NPY_API_VERSION
#define _MULTIARRAYMODULE
+#include <numpy/npy_common.h>
#include "numpy/arrayobject.h"
#include "numpy/arrayscalars.h"
@@ -1007,8 +1008,15 @@ PyArray_MatrixProduct2(PyObject *op1, PyObject *op2, PyArrayObject* out)
axis = PyArray_NDIM(ap1)-1;
it1 = (PyArrayIterObject *)
PyArray_IterAllButAxis((PyObject *)ap1, &axis);
+ if (it1 == NULL) {
+ goto fail;
+ }
it2 = (PyArrayIterObject *)
PyArray_IterAllButAxis((PyObject *)ap2, &matchDim);
+ if (it2 == NULL) {
+ Py_DECREF(it1);
+ goto fail;
+ }
NPY_BEGIN_THREADS_DESCR(PyArray_DESCR(ap2));
while (it1->index < it1->size) {
while (it2->index < it2->size) {
@@ -1393,7 +1401,9 @@ array_putmask(PyObject *NPY_UNUSED(module), PyObject *args, PyObject *kwds)
static int
_equivalent_fields(PyObject *field1, PyObject *field2) {
- int same, val;
+ Py_ssize_t ppos;
+ PyObject *key;
+ PyObject *tuple1, *tuple2;
if (field1 == field2) {
return 1;
@@ -1401,20 +1411,33 @@ _equivalent_fields(PyObject *field1, PyObject *field2) {
if (field1 == NULL || field2 == NULL) {
return 0;
}
-#if defined(NPY_PY3K)
- val = PyObject_RichCompareBool(field1, field2, Py_EQ);
- if (val != 1 || PyErr_Occurred()) {
-#else
- val = PyObject_Compare(field1, field2);
- if (val != 0 || PyErr_Occurred()) {
-#endif
- same = 0;
+
+ if (PyDict_Size(field1) != PyDict_Size(field2)) {
+ return 0;
}
- else {
- same = 1;
+
+ /* Iterate over all the fields and compare for equivalency */
+ ppos = 0;
+ while (PyDict_Next(field1, &ppos, &key, &tuple1)) {
+ if ((tuple2 = PyDict_GetItem(field2, key)) == NULL) {
+ return 0;
+ }
+ /* Compare the dtype of the field for equivalency */
+ if (!PyArray_CanCastTypeTo((PyArray_Descr *)PyTuple_GET_ITEM(tuple1, 0),
+ (PyArray_Descr *)PyTuple_GET_ITEM(tuple2, 0),
+ NPY_EQUIV_CASTING)) {
+ return 0;
+ }
+ /* Compare the byte position of the field */
+ if (PyObject_RichCompareBool(PyTuple_GET_ITEM(tuple1, 1),
+ PyTuple_GET_ITEM(tuple2, 1),
+ Py_EQ) != 1) {
+ PyErr_Clear();
+ return 0;
+ }
}
- PyErr_Clear();
- return same;
+
+ return 1;
}
/*
@@ -1517,7 +1540,7 @@ PyArray_EquivTypenums(int typenum1, int typenum2)
* NPY_RELAXED_STRIDES_CHECKING: If the strides logic is changed, the
* order specific stride setting is not necessary.
*/
-static PyObject *
+static NPY_STEALS_REF_TO_ARG(1) PyObject *
_prepend_ones(PyArrayObject *arr, int nd, int ndmin, NPY_ORDER order)
{
npy_intp newdims[NPY_MAXDIMS];
@@ -1633,7 +1656,7 @@ _array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws)
}
else {
ret = (PyArrayObject *)PyArray_NewCopy(oparr, order);
- if (oldtype == type) {
+ if (oldtype == type || ret == NULL) {
goto finish;
}
Py_INCREF(oldtype);
@@ -1992,7 +2015,7 @@ array_fromfile(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds)
Py_INCREF(file);
own = 0;
}
- fp = npy_PyFile_Dup(file, "rb", &orig_pos);
+ fp = npy_PyFile_Dup2(file, "rb", &orig_pos);
if (fp == NULL) {
PyErr_SetString(PyExc_IOError,
"first argument must be an open file");
@@ -2004,7 +2027,7 @@ array_fromfile(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *keywds)
}
ret = PyArray_FromFile(fp, type, (npy_intp) nin, sep);
- if (npy_PyFile_DupClose(file, fp, orig_pos) < 0) {
+ if (npy_PyFile_DupClose2(file, fp, orig_pos) < 0) {
goto fail;
}
if (own && npy_PyFile_CloseFile(file) < 0) {
@@ -2085,15 +2108,16 @@ static PyObject *
array_matrixproduct(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject* kwds)
{
int errval;
- static PyObject *cached_npy_dot = NULL;
+ static PyUFuncObject *cached_npy_dot = NULL;
PyObject *override = NULL;
PyObject *v, *a, *o = NULL;
char* kwlist[] = {"a", "b", "out", NULL };
PyObject *module;
-
+
if (cached_npy_dot == NULL) {
module = PyImport_ImportModule("numpy.core.multiarray");
- cached_npy_dot = PyDict_GetItemString(PyModule_GetDict(module), "dot");
+ cached_npy_dot = (PyUFuncObject*)PyDict_GetItemString(
+ PyModule_GetDict(module), "dot");
Py_INCREF(cached_npy_dot);
Py_DECREF(module);
@@ -2291,7 +2315,7 @@ einsum_sub_op_from_lists(PyObject *args,
/* Set the operands to NULL */
for (i = 0; i < nop; ++i) {
- op[nop] = NULL;
+ op[i] = NULL;
}
/* Get the operands and build the subscript string */
@@ -2679,6 +2703,28 @@ array_set_datetimeparse_function(PyObject *NPY_UNUSED(self),
return NULL;
}
+/*
+ * inner loop with constant size memcpy arguments
+ * this allows the compiler to replace function calls while still handling the
+ * alignment requirements of the platform.
+ */
+#define INNER_WHERE_LOOP(size) \
+ do { \
+ npy_intp i; \
+ for (i = 0; i < n; i++) { \
+ if (*csrc) { \
+ memcpy(dst, xsrc, size); \
+ } \
+ else { \
+ memcpy(dst, ysrc, size); \
+ } \
+ dst += size; \
+ xsrc += xstride; \
+ ysrc += ystride; \
+ csrc += cstride; \
+ } \
+ } while(0)
+
/*NUMPY_API
* Where
@@ -2686,9 +2732,8 @@ array_set_datetimeparse_function(PyObject *NPY_UNUSED(self),
NPY_NO_EXPORT PyObject *
PyArray_Where(PyObject *condition, PyObject *x, PyObject *y)
{
- PyArrayObject *arr;
- PyObject *tup = NULL, *obj = NULL;
- PyObject *ret = NULL, *zero = NULL;
+ PyArrayObject *arr, *ax, *ay;
+ PyObject *ret = NULL;
arr = (PyArrayObject *)PyArray_FromAny(condition, NULL, 0, 0, 0, NULL);
if (arr == NULL) {
@@ -2706,26 +2751,132 @@ PyArray_Where(PyObject *condition, PyObject *x, PyObject *y)
return NULL;
}
-
- zero = PyInt_FromLong((long) 0);
- obj = PyArray_EnsureAnyArray(PyArray_GenericBinaryFunction(arr, zero,
- n_ops.not_equal));
- Py_DECREF(zero);
- Py_DECREF(arr);
- if (obj == NULL) {
- return NULL;
+ ax = (PyArrayObject*)PyArray_FromAny(x, NULL, 0, 0, 0 ,NULL);
+ ay = (PyArrayObject*)PyArray_FromAny(y, NULL, 0, 0, 0 ,NULL);
+ if (ax == NULL || ay == NULL) {
+ goto fail;
}
- tup = Py_BuildValue("(OO)", y, x);
- if (tup == NULL) {
- Py_DECREF(obj);
- return NULL;
+ else {
+ npy_uint32 flags = NPY_ITER_EXTERNAL_LOOP | NPY_ITER_BUFFERED |
+ NPY_ITER_REFS_OK | NPY_ITER_ZEROSIZE_OK;
+ PyArrayObject * op_in[4] = {
+ NULL, arr, ax, ay
+ };
+ npy_uint32 op_flags[4] = {
+ NPY_ITER_WRITEONLY | NPY_ITER_ALLOCATE,
+ NPY_ITER_READONLY, NPY_ITER_READONLY, NPY_ITER_READONLY
+ };
+ PyArray_Descr * common_dt = PyArray_ResultType(2, &op_in[0] + 2,
+ 0, NULL);
+ PyArray_Descr * op_dt[4] = {common_dt, PyArray_DescrFromType(NPY_BOOL),
+ common_dt, common_dt};
+ NpyIter * iter;
+ int needs_api;
+ NPY_BEGIN_THREADS_DEF;
+
+ if (common_dt == NULL || op_dt[1] == NULL) {
+ Py_XDECREF(op_dt[1]);
+ Py_XDECREF(common_dt);
+ goto fail;
+ }
+ iter = NpyIter_MultiNew(4, op_in, flags,
+ NPY_KEEPORDER, NPY_UNSAFE_CASTING,
+ op_flags, op_dt);
+ Py_DECREF(op_dt[1]);
+ Py_DECREF(common_dt);
+ if (iter == NULL) {
+ goto fail;
+ }
+
+ needs_api = NpyIter_IterationNeedsAPI(iter);
+
+ /* Get the result from the iterator object array */
+ ret = (PyObject*)NpyIter_GetOperandArray(iter)[0];
+
+ NPY_BEGIN_THREADS_NDITER(iter);
+
+ if (NpyIter_GetIterSize(iter) != 0) {
+ NpyIter_IterNextFunc *iternext = NpyIter_GetIterNext(iter, NULL);
+ npy_intp * innersizeptr = NpyIter_GetInnerLoopSizePtr(iter);
+ char **dataptrarray = NpyIter_GetDataPtrArray(iter);
+
+ do {
+ PyArray_Descr * dtx = NpyIter_GetDescrArray(iter)[2];
+ PyArray_Descr * dty = NpyIter_GetDescrArray(iter)[3];
+ int axswap = PyDataType_ISBYTESWAPPED(dtx);
+ int ayswap = PyDataType_ISBYTESWAPPED(dty);
+ PyArray_CopySwapFunc *copyswapx = dtx->f->copyswap;
+ PyArray_CopySwapFunc *copyswapy = dty->f->copyswap;
+ int native = (axswap == ayswap) && (axswap == 0) && !needs_api;
+ npy_intp n = (*innersizeptr);
+ npy_intp itemsize = NpyIter_GetDescrArray(iter)[0]->elsize;
+ npy_intp cstride = NpyIter_GetInnerStrideArray(iter)[1];
+ npy_intp xstride = NpyIter_GetInnerStrideArray(iter)[2];
+ npy_intp ystride = NpyIter_GetInnerStrideArray(iter)[3];
+ char * dst = dataptrarray[0];
+ char * csrc = dataptrarray[1];
+ char * xsrc = dataptrarray[2];
+ char * ysrc = dataptrarray[3];
+
+ /* constant sizes so compiler replaces memcpy */
+ if (native && itemsize == 16) {
+ INNER_WHERE_LOOP(16);
+ }
+ else if (native && itemsize == 8) {
+ INNER_WHERE_LOOP(8);
+ }
+ else if (native && itemsize == 4) {
+ INNER_WHERE_LOOP(4);
+ }
+ else if (native && itemsize == 2) {
+ INNER_WHERE_LOOP(2);
+ }
+ else if (native && itemsize == 1) {
+ INNER_WHERE_LOOP(1);
+ }
+ else {
+ /* copyswap is faster than memcpy even if we are native */
+ npy_intp i;
+ for (i = 0; i < n; i++) {
+ if (*csrc) {
+ copyswapx(dst, xsrc, axswap, ret);
+ }
+ else {
+ copyswapy(dst, ysrc, ayswap, ret);
+ }
+ dst += itemsize;
+ xsrc += xstride;
+ ysrc += ystride;
+ csrc += cstride;
+ }
+ }
+ } while (iternext(iter));
+ }
+
+ NPY_END_THREADS;
+
+ Py_INCREF(ret);
+ Py_DECREF(arr);
+ Py_DECREF(ax);
+ Py_DECREF(ay);
+
+ if (NpyIter_Deallocate(iter) != NPY_SUCCEED) {
+ Py_DECREF(ret);
+ return NULL;
+ }
+
+ return ret;
}
- ret = PyArray_Choose((PyArrayObject *)obj, tup, NULL, NPY_RAISE);
- Py_DECREF(obj);
- Py_DECREF(tup);
- return ret;
+
+ fail:
+ Py_DECREF(arr);
+ Py_XDECREF(ax);
+ Py_XDECREF(ay);
+ return NULL;
}
+#undef INNER_WHERE_LOOP
+
static PyObject *
array_where(PyObject *NPY_UNUSED(ignored), PyObject *args)
{
@@ -2858,8 +3009,8 @@ static PyObject *
array_result_type(PyObject *NPY_UNUSED(dummy), PyObject *args)
{
npy_intp i, len, narr = 0, ndtypes = 0;
- PyArrayObject *arr[NPY_MAXARGS];
- PyArray_Descr *dtypes[NPY_MAXARGS];
+ PyArrayObject **arr = NULL;
+ PyArray_Descr **dtypes = NULL;
PyObject *ret = NULL;
len = PyTuple_GET_SIZE(args);
@@ -2869,25 +3020,21 @@ array_result_type(PyObject *NPY_UNUSED(dummy), PyObject *args)
goto finish;
}
+ arr = PyArray_malloc(2 * len * sizeof(void *));
+ if (arr == NULL) {
+ return PyErr_NoMemory();
+ }
+ dtypes = (PyArray_Descr**)&arr[len];
+
for (i = 0; i < len; ++i) {
PyObject *obj = PyTuple_GET_ITEM(args, i);
if (PyArray_Check(obj)) {
- if (narr == NPY_MAXARGS) {
- PyErr_SetString(PyExc_ValueError,
- "too many arguments");
- goto finish;
- }
Py_INCREF(obj);
arr[narr] = (PyArrayObject *)obj;
++narr;
}
else if (PyArray_IsScalar(obj, Generic) ||
PyArray_IsPythonNumber(obj)) {
- if (narr == NPY_MAXARGS) {
- PyErr_SetString(PyExc_ValueError,
- "too many arguments");
- goto finish;
- }
arr[narr] = (PyArrayObject *)PyArray_FromAny(obj,
NULL, 0, 0, 0, NULL);
if (arr[narr] == NULL) {
@@ -2896,11 +3043,6 @@ array_result_type(PyObject *NPY_UNUSED(dummy), PyObject *args)
++narr;
}
else {
- if (ndtypes == NPY_MAXARGS) {
- PyErr_SetString(PyExc_ValueError,
- "too many arguments");
- goto finish;
- }
if (!PyArray_DescrConverter(obj, &dtypes[ndtypes])) {
goto finish;
}
@@ -2917,6 +3059,7 @@ finish:
for (i = 0; i < ndtypes; ++i) {
Py_DECREF(dtypes[i]);
}
+ PyArray_free(arr);
return ret;
}
@@ -3397,7 +3540,8 @@ _vec_string(PyObject *NPY_UNUSED(dummy), PyObject *args, PyObject *kwds)
#ifndef __NPY_PRIVATE_NO_SIGNAL
-NPY_SIGJMP_BUF _NPY_SIGINT_BUF;
+static NPY_TLS int sigint_buf_init = 0;
+static NPY_TLS NPY_SIGJMP_BUF _NPY_SIGINT_BUF;
/*NUMPY_API
*/
@@ -3405,7 +3549,17 @@ NPY_NO_EXPORT void
_PyArray_SigintHandler(int signum)
{
PyOS_setsig(signum, SIG_IGN);
- NPY_SIGLONGJMP(_NPY_SIGINT_BUF, signum);
+ /*
+ * jump buffer may be unitialized as SIGINT allowing functions are usually
+ * run in other threads than the master thread that receives the signal
+ */
+ if (sigint_buf_init > 0) {
+ NPY_SIGLONGJMP(_NPY_SIGINT_BUF, signum);
+ }
+ /*
+ * sending SIGINT to the worker threads to cancel them is job of the
+ * application
+ */
}
/*NUMPY_API
@@ -3413,6 +3567,7 @@ _PyArray_SigintHandler(int signum)
NPY_NO_EXPORT void*
_PyArray_GetSigintBuf(void)
{
+ sigint_buf_init = 1;
return (void *)&_NPY_SIGINT_BUF;
}
@@ -3462,122 +3617,6 @@ test_interrupt(PyObject *NPY_UNUSED(self), PyObject *args)
return PyInt_FromLong(a);
}
-/* malloc/free/realloc hook */
-NPY_NO_EXPORT PyDataMem_EventHookFunc *_PyDataMem_eventhook;
-NPY_NO_EXPORT void *_PyDataMem_eventhook_user_data;
-
-/*NUMPY_API
- * Sets the allocation event hook for numpy array data.
- * Takes a PyDataMem_EventHookFunc *, which has the signature:
- * void hook(void *old, void *new, size_t size, void *user_data).
- * Also takes a void *user_data, and void **old_data.
- *
- * Returns a pointer to the previous hook or NULL. If old_data is
- * non-NULL, the previous user_data pointer will be copied to it.
- *
- * If not NULL, hook will be called at the end of each PyDataMem_NEW/FREE/RENEW:
- * result = PyDataMem_NEW(size) -> (*hook)(NULL, result, size, user_data)
- * PyDataMem_FREE(ptr) -> (*hook)(ptr, NULL, 0, user_data)
- * result = PyDataMem_RENEW(ptr, size) -> (*hook)(ptr, result, size, user_data)
- *
- * When the hook is called, the GIL will be held by the calling
- * thread. The hook should be written to be reentrant, if it performs
- * operations that might cause new allocation events (such as the
- * creation/descruction numpy objects, or creating/destroying Python
- * objects which might cause a gc)
- */
-NPY_NO_EXPORT PyDataMem_EventHookFunc *
-PyDataMem_SetEventHook(PyDataMem_EventHookFunc *newhook,
- void *user_data, void **old_data)
-{
- PyGILState_STATE gilstate = PyGILState_Ensure();
- PyDataMem_EventHookFunc *temp = _PyDataMem_eventhook;
- _PyDataMem_eventhook = newhook;
- if (old_data != NULL) {
- *old_data = _PyDataMem_eventhook_user_data;
- }
- _PyDataMem_eventhook_user_data = user_data;
- PyGILState_Release(gilstate);
- return temp;
-}
-
-/*NUMPY_API
- * Allocates memory for array data.
- */
-NPY_NO_EXPORT void *
-PyDataMem_NEW(size_t size)
-{
- void *result;
-
- result = malloc(size);
- if (_PyDataMem_eventhook != NULL) {
- PyGILState_STATE gilstate = PyGILState_Ensure();
- if (_PyDataMem_eventhook != NULL) {
- (*_PyDataMem_eventhook)(NULL, result, size,
- _PyDataMem_eventhook_user_data);
- }
- PyGILState_Release(gilstate);
- }
- return result;
-}
-
-/*NUMPY_API
- * Allocates zeroed memory for array data.
- */
-NPY_NO_EXPORT void *
-PyDataMem_NEW_ZEROED(size_t size, size_t elsize)
-{
- void *result;
-
- result = calloc(size, elsize);
- if (_PyDataMem_eventhook != NULL) {
- PyGILState_STATE gilstate = PyGILState_Ensure();
- if (_PyDataMem_eventhook != NULL) {
- (*_PyDataMem_eventhook)(NULL, result, size * elsize,
- _PyDataMem_eventhook_user_data);
- }
- PyGILState_Release(gilstate);
- }
- return result;
-}
-
-/*NUMPY_API
- * Free memory for array data.
- */
-NPY_NO_EXPORT void
-PyDataMem_FREE(void *ptr)
-{
- free(ptr);
- if (_PyDataMem_eventhook != NULL) {
- PyGILState_STATE gilstate = PyGILState_Ensure();
- if (_PyDataMem_eventhook != NULL) {
- (*_PyDataMem_eventhook)(ptr, NULL, 0,
- _PyDataMem_eventhook_user_data);
- }
- PyGILState_Release(gilstate);
- }
-}
-
-/*NUMPY_API
- * Reallocate/resize memory for array data.
- */
-NPY_NO_EXPORT void *
-PyDataMem_RENEW(void *ptr, size_t size)
-{
- void *result;
-
- result = realloc(ptr, size);
- if (_PyDataMem_eventhook != NULL) {
- PyGILState_STATE gilstate = PyGILState_Ensure();
- if (_PyDataMem_eventhook != NULL) {
- (*_PyDataMem_eventhook)(ptr, result, size,
- _PyDataMem_eventhook_user_data);
- }
- PyGILState_Release(gilstate);
- }
- return result;
-}
-
static PyObject *
array_may_share_memory(PyObject *NPY_UNUSED(ignored), PyObject *args)
{
@@ -4017,7 +4056,6 @@ PyMODINIT_FUNC initmultiarray(void) {
if (!d) {
goto err;
}
- PyArray_Type.tp_free = PyObject_Free;
if (PyType_Ready(&PyArray_Type) < 0) {
return RETVAL;
}
diff --git a/numpy/core/src/multiarray/multiarraymodule_onefile.c b/numpy/core/src/multiarray/multiarraymodule_onefile.c
index 9410263e4..2d05c20ef 100644
--- a/numpy/core/src/multiarray/multiarraymodule_onefile.c
+++ b/numpy/core/src/multiarray/multiarraymodule_onefile.c
@@ -21,6 +21,7 @@
#include "descriptor.c"
#include "flagsobject.c"
+#include "alloc.c"
#include "ctors.c"
#include "iterators.c"
#include "mapping.c"
diff --git a/numpy/core/src/multiarray/nditer_api.c b/numpy/core/src/multiarray/nditer_api.c
index 905a19d55..17108f02c 100644
--- a/numpy/core/src/multiarray/nditer_api.c
+++ b/numpy/core/src/multiarray/nditer_api.c
@@ -14,6 +14,7 @@
/* Indicate that this .c file is allowed to include the header */
#define NPY_ITERATOR_IMPLEMENTATION_CODE
#include "nditer_impl.h"
+#include "scalarmathmodule.h"
/* Internal helper functions private to this file */
static npy_intp
@@ -127,13 +128,23 @@ NpyIter_RemoveAxis(NpyIter *iter, int axis)
perm[idim] = p;
}
- /* Adjust the iteration size */
- NIT_ITERSIZE(iter) /= NAD_SHAPE(axisdata_del);
-
/* Shift all the axisdata structures by one */
axisdata = NIT_INDEX_AXISDATA(axisdata_del, 1);
memmove(axisdata_del, axisdata, (ndim-1-xdim)*sizeof_axisdata);
+ /* Adjust the iteration size and reset iterend */
+ NIT_ITERSIZE(iter) = 1;
+ axisdata = NIT_AXISDATA(iter);
+ for (idim = 0; idim < ndim-1; ++idim) {
+ if (npy_mul_with_overflow_intp(&NIT_ITERSIZE(iter),
+ NIT_ITERSIZE(iter), NAD_SHAPE(axisdata))) {
+ NIT_ITERSIZE(iter) = -1;
+ break;
+ }
+ NIT_ADVANCE_AXISDATA(axisdata, 1);
+ }
+ NIT_ITEREND(iter) = NIT_ITERSIZE(iter);
+
/* Shrink the iterator */
NIT_NDIM(iter) = ndim - 1;
/* If it is now 0-d fill the singleton dimension */
@@ -166,6 +177,11 @@ NpyIter_RemoveMultiIndex(NpyIter *iter)
itflags = NIT_ITFLAGS(iter);
if (itflags&NPY_ITFLAG_HASMULTIINDEX) {
+ if (NIT_ITERSIZE(iter) < 0) {
+ PyErr_SetString(PyExc_ValueError, "iterator is too large");
+ return NPY_FAIL;
+ }
+
NIT_ITFLAGS(iter) = itflags & ~NPY_ITFLAG_HASMULTIINDEX;
npyiter_coalesce_axes(iter);
}
@@ -349,6 +365,15 @@ NpyIter_ResetToIterIndexRange(NpyIter *iter,
}
if (istart < 0 || iend > NIT_ITERSIZE(iter)) {
+ if (NIT_ITERSIZE(iter) < 0) {
+ if (errmsg == NULL) {
+ PyErr_SetString(PyExc_ValueError, "iterator is too large");
+ }
+ else {
+ *errmsg = "iterator is too large";
+ }
+ return NPY_FAIL;
+ }
if (errmsg == NULL) {
PyErr_Format(PyExc_ValueError,
"Out-of-bounds range [%d, %d) passed to "
@@ -454,6 +479,10 @@ NpyIter_GotoMultiIndex(NpyIter *iter, npy_intp *multi_index)
}
if (iterindex < NIT_ITERSTART(iter) || iterindex >= NIT_ITEREND(iter)) {
+ if (NIT_ITERSIZE(iter) < 0) {
+ PyErr_SetString(PyExc_ValueError, "iterator is too large");
+ return NPY_FAIL;
+ }
PyErr_SetString(PyExc_IndexError,
"Iterator GotoMultiIndex called with a multi-index outside the "
"restricted iteration range");
@@ -574,6 +603,10 @@ NpyIter_GotoIterIndex(NpyIter *iter, npy_intp iterindex)
}
if (iterindex < NIT_ITERSTART(iter) || iterindex >= NIT_ITEREND(iter)) {
+ if (NIT_ITERSIZE(iter) < 0) {
+ PyErr_SetString(PyExc_ValueError, "iterator is too large");
+ return NPY_FAIL;
+ }
PyErr_SetString(PyExc_IndexError,
"Iterator GotoIterIndex called with an iterindex outside the "
"iteration range.");
@@ -752,8 +785,8 @@ NpyIter_IsFirstVisit(NpyIter *iter, int iop)
if (itflags&NPY_ITFLAG_BUFFER) {
NpyIter_BufferData *bufferdata = NIT_BUFFERDATA(iter);
/* The outer reduce loop */
- if (NBF_REDUCE_OUTERSTRIDES(bufferdata)[iop] == 0 &&
- NBF_REDUCE_POS(bufferdata) != 0) {
+ if (NBF_REDUCE_POS(bufferdata) != 0 &&
+ NBF_REDUCE_OUTERSTRIDES(bufferdata)[iop] == 0) {
return 0;
}
}
@@ -1298,21 +1331,20 @@ NpyIter_GetInnerFixedStrideArray(NpyIter *iter, npy_intp *out_strides)
out_strides[iop] = stride;
}
/*
- * Otherwise it's a fixed stride if the stride is 0
- * for all inner dimensions of the reduction double loop
+ * Otherwise it's guaranteed to be a fixed stride if the
+ * stride is 0 for all the dimensions.
*/
else {
NpyIter_AxisData *axisdata = axisdata0;
- int idim,
- reduce_outerdim = NBF_REDUCE_OUTERDIM(data);
- for (idim = 0; idim < reduce_outerdim; ++idim) {
+ int idim;
+ for (idim = 0; idim < ndim; ++idim) {
if (NAD_STRIDES(axisdata)[iop] != 0) {
break;
}
NIT_ADVANCE_AXISDATA(axisdata, 1);
}
/* If all the strides were 0, the stride won't change */
- if (idim == reduce_outerdim) {
+ if (idim == ndim) {
out_strides[iop] = stride;
}
else {
@@ -1377,7 +1409,8 @@ NpyIter_DebugPrint(NpyIter *iter)
NpyIter_AxisData *axisdata;
npy_intp sizeof_axisdata;
- PyGILState_STATE gilstate = PyGILState_Ensure();
+ NPY_ALLOW_C_API_DEF
+ NPY_ALLOW_C_API
printf("\n------ BEGIN ITERATOR DUMP ------\n");
printf("| Iterator Address: %p\n", (void *)iter);
@@ -1598,7 +1631,7 @@ NpyIter_DebugPrint(NpyIter *iter)
printf("------- END ITERATOR DUMP -------\n");
fflush(stdout);
- PyGILState_Release(gilstate);
+ NPY_DISABLE_C_API
}
NPY_NO_EXPORT void
diff --git a/numpy/core/src/multiarray/nditer_constr.c b/numpy/core/src/multiarray/nditer_constr.c
index 964b51e22..b7f700e60 100644
--- a/numpy/core/src/multiarray/nditer_constr.c
+++ b/numpy/core/src/multiarray/nditer_constr.c
@@ -261,6 +261,12 @@ NpyIter_AdvancedNew(int nop, PyArrayObject **op_in, npy_uint32 flags,
buffersize = NIT_ITERSIZE(iter);
}
NBF_BUFFERSIZE(bufferdata) = buffersize;
+
+ /*
+ * Initialize for use in FirstVisit, which may be called before
+ * the buffers are filled and the reduce pos is updated.
+ */
+ NBF_REDUCE_POS(bufferdata) = 0;
}
/*
@@ -1255,54 +1261,6 @@ npyiter_casting_to_string(NPY_CASTING casting)
}
}
-static PyObject *
-npyiter_shape_string(npy_intp n, npy_intp *vals, char *ending)
-{
- npy_intp i;
- PyObject *ret, *tmp;
-
- /*
- * Negative dimension indicates "newaxis", which can
- * be discarded for printing if it's a leading dimension.
- * Find the first non-"newaxis" dimension.
- */
- i = 0;
- while (i < n && vals[i] < 0) {
- ++i;
- }
-
- if (i == n) {
- return PyUString_FromFormat("()%s", ending);
- }
- else {
- ret = PyUString_FromFormat("(%" NPY_INTP_FMT, vals[i++]);
- if (ret == NULL) {
- return NULL;
- }
- }
-
- for (; i < n; ++i) {
- if (vals[i] < 0) {
- tmp = PyUString_FromString(",newaxis");
- }
- else {
- tmp = PyUString_FromFormat(",%" NPY_INTP_FMT, vals[i]);
- }
- if (tmp == NULL) {
- Py_DECREF(ret);
- return NULL;
- }
-
- PyUString_ConcatAndDel(&ret, tmp);
- if (ret == NULL) {
- return NULL;
- }
- }
-
- tmp = PyUString_FromFormat(")%s", ending);
- PyUString_ConcatAndDel(&ret, tmp);
- return ret;
-}
static int
npyiter_check_casting(int nop, PyArrayObject **op,
@@ -1704,8 +1662,21 @@ npyiter_fill_axisdata(NpyIter *iter, npy_uint32 flags, npyiter_opitflags *op_itf
for (idim = 0; idim < ndim; ++idim) {
if (npy_mul_with_overflow_intp(&NIT_ITERSIZE(iter),
NIT_ITERSIZE(iter), broadcast_shape[idim])) {
- PyErr_SetString(PyExc_ValueError, "iterator is too large");
- return 0;
+ if ((itflags & NPY_ITFLAG_HASMULTIINDEX) &&
+ !(itflags & NPY_ITFLAG_HASINDEX) &&
+ !(itflags & NPY_ITFLAG_BUFFER)) {
+ /*
+ * If RemoveAxis may be called, the size check is delayed
+ * until either the multi index is removed, or GetIterNext
+ * is called.
+ */
+ NIT_ITERSIZE(iter) = -1;
+ break;
+ }
+ else {
+ PyErr_SetString(PyExc_ValueError, "iterator is too large");
+ return 0;
+ }
}
}
/* The range defaults to everything */
@@ -1727,7 +1698,7 @@ broadcast_error: {
}
for (iop = 0; iop < nop; ++iop) {
if (op[iop] != NULL) {
- tmp = npyiter_shape_string(PyArray_NDIM(op[iop]),
+ tmp = convert_shape_to_string(PyArray_NDIM(op[iop]),
PyArray_DIMS(op[iop]),
" ");
if (tmp == NULL) {
@@ -1751,7 +1722,7 @@ broadcast_error: {
return 0;
}
- tmp = npyiter_shape_string(ndim, itershape, "");
+ tmp = convert_shape_to_string(ndim, itershape, "");
if (tmp == NULL) {
Py_DECREF(errmsg);
return 0;
@@ -1774,7 +1745,7 @@ broadcast_error: {
int *axes = op_axes[iop];
tmpstr = (axes == NULL) ? " " : "->";
- tmp = npyiter_shape_string(PyArray_NDIM(op[iop]),
+ tmp = convert_shape_to_string(PyArray_NDIM(op[iop]),
PyArray_DIMS(op[iop]),
tmpstr);
if (tmp == NULL) {
@@ -1796,7 +1767,7 @@ broadcast_error: {
remdims[idim] = -1;
}
}
- tmp = npyiter_shape_string(ndim, remdims, " ");
+ tmp = convert_shape_to_string(ndim, remdims, " ");
if (tmp == NULL) {
return 0;
}
@@ -1818,7 +1789,7 @@ broadcast_error: {
return 0;
}
- tmp = npyiter_shape_string(ndim, itershape, "");
+ tmp = convert_shape_to_string(ndim, itershape, "");
if (tmp == NULL) {
Py_DECREF(errmsg);
return 0;
@@ -1854,7 +1825,7 @@ operand_different_than_broadcast: {
}
/* Operand shape */
- tmp = npyiter_shape_string(PyArray_NDIM(op[iop]),
+ tmp = convert_shape_to_string(PyArray_NDIM(op[iop]),
PyArray_DIMS(op[iop]), "");
if (tmp == NULL) {
return 0;
@@ -1887,7 +1858,7 @@ operand_different_than_broadcast: {
return 0;
}
- tmp = npyiter_shape_string(ndim, remdims, "]");
+ tmp = convert_shape_to_string(ndim, remdims, "]");
if (tmp == NULL) {
return 0;
}
@@ -1907,7 +1878,7 @@ operand_different_than_broadcast: {
}
/* Broadcast shape */
- tmp = npyiter_shape_string(ndim, broadcast_shape, "");
+ tmp = convert_shape_to_string(ndim, broadcast_shape, "");
if (tmp == NULL) {
return 0;
}
diff --git a/numpy/core/src/multiarray/nditer_pywrap.c b/numpy/core/src/multiarray/nditer_pywrap.c
index b3eda8669..7e40377b2 100644
--- a/numpy/core/src/multiarray/nditer_pywrap.c
+++ b/numpy/core/src/multiarray/nditer_pywrap.c
@@ -37,12 +37,16 @@ struct NewNpyArrayIterObject_tag {
char writeflags[NPY_MAXARGS];
};
-void npyiter_cache_values(NewNpyArrayIterObject *self)
+static int npyiter_cache_values(NewNpyArrayIterObject *self)
{
NpyIter *iter = self->iter;
/* iternext and get_multi_index functions */
self->iternext = NpyIter_GetIterNext(iter, NULL);
+ if (self->iternext == NULL) {
+ return -1;
+ }
+
if (NpyIter_HasMultiIndex(iter) && !NpyIter_HasDelayedBufAlloc(iter)) {
self->get_multi_index = NpyIter_GetGetMultiIndex(iter, NULL);
}
@@ -67,6 +71,7 @@ void npyiter_cache_values(NewNpyArrayIterObject *self)
/* The read/write settings */
NpyIter_GetReadFlags(iter, self->readflags);
NpyIter_GetWriteFlags(iter, self->writeflags);
+ return 0;
}
static PyObject *
@@ -803,7 +808,9 @@ npyiter_init(NewNpyArrayIterObject *self, PyObject *args, PyObject *kwds)
}
/* Cache some values for the member functions to use */
- npyiter_cache_values(self);
+ if (npyiter_cache_values(self) < 0) {
+ goto fail;
+ }
if (NpyIter_GetIterSize(self->iter) == 0) {
self->started = 1;
@@ -1068,7 +1075,10 @@ NpyIter_NestedIters(PyObject *NPY_UNUSED(self),
}
/* Cache some values for the member functions to use */
- npyiter_cache_values(iter);
+ if (npyiter_cache_values(iter) < 0) {
+ Py_DECREF(ret);
+ goto fail;
+ }
if (NpyIter_GetIterSize(iter->iter) == 0) {
iter->started = 1;
@@ -1242,7 +1252,10 @@ npyiter_copy(NewNpyArrayIterObject *self)
}
/* Cache some values for the member functions to use */
- npyiter_cache_values(iter);
+ if (npyiter_cache_values(iter) < 0) {
+ Py_DECREF(iter);
+ return NULL;
+ }
iter->started = self->started;
iter->finished = self->finished;
@@ -1287,7 +1300,9 @@ npyiter_remove_axis(NewNpyArrayIterObject *self, PyObject *args)
return NULL;
}
/* RemoveAxis invalidates cached values */
- npyiter_cache_values(self);
+ if (npyiter_cache_values(self) < 0) {
+ return NULL;
+ }
/* RemoveAxis also resets the iterator */
if (NpyIter_GetIterSize(self->iter) == 0) {
self->started = 1;
@@ -1532,6 +1547,9 @@ static PyObject *npyiter_multi_index_get(NewNpyArrayIterObject *self)
ndim = NpyIter_GetNDim(self->iter);
self->get_multi_index(self->iter, multi_index);
ret = PyTuple_New(ndim);
+ if (ret == NULL) {
+ return NULL;
+ }
for (idim = 0; idim < ndim; ++idim) {
PyTuple_SET_ITEM(ret, idim,
PyInt_FromLong(multi_index[idim]));
@@ -1590,6 +1608,7 @@ npyiter_multi_index_set(NewNpyArrayIterObject *self, PyObject *value)
PyObject *v = PySequence_GetItem(value, idim);
multi_index[idim] = PyInt_AsLong(v);
if (multi_index[idim]==-1 && PyErr_Occurred()) {
+ Py_XDECREF(v);
return -1;
}
}
@@ -2003,9 +2022,12 @@ npyiter_seq_item(NewNpyArrayIterObject *self, Py_ssize_t i)
ret_ndim, &innerloopsize,
&innerstride, dataptr,
self->writeflags[i] ? NPY_ARRAY_WRITEABLE : 0, NULL);
+ if (ret == NULL) {
+ return NULL;
+ }
Py_INCREF(self);
if (PyArray_SetBaseObject(ret, (PyObject *)self) < 0) {
- Py_DECREF(ret);
+ Py_XDECREF(ret);
return NULL;
}
diff --git a/numpy/core/src/multiarray/nditer_templ.c.src b/numpy/core/src/multiarray/nditer_templ.c.src
index 59aae244b..8976b132e 100644
--- a/numpy/core/src/multiarray/nditer_templ.c.src
+++ b/numpy/core/src/multiarray/nditer_templ.c.src
@@ -347,6 +347,16 @@ NpyIter_GetIterNext(NpyIter *iter, char **errmsg)
int ndim = NIT_NDIM(iter);
int nop = NIT_NOP(iter);
+ if (NIT_ITERSIZE(iter) < 0) {
+ if (errmsg == NULL) {
+ PyErr_SetString(PyExc_ValueError, "iterator is too large");
+ }
+ else {
+ *errmsg = "iterator is too large";
+ }
+ return NULL;
+ }
+
/*
* When there is just one iteration and buffering is disabled
* the iternext function is very simple.
diff --git a/numpy/core/src/multiarray/number.c b/numpy/core/src/multiarray/number.c
index 483a22776..a26a93c1d 100644
--- a/numpy/core/src/multiarray/number.c
+++ b/numpy/core/src/multiarray/number.c
@@ -115,7 +115,7 @@ has_ufunc_attr(PyObject * obj) {
NPY_NO_EXPORT int
needs_right_binop_forward(PyObject *self, PyObject *other,
- char *right_name, int inplace_op)
+ const char *right_name, int inplace_op)
{
if (other == NULL ||
self == NULL ||
@@ -127,7 +127,7 @@ needs_right_binop_forward(PyObject *self, PyObject *other,
*/
return 0;
}
- if (!inplace_op && PyType_IsSubtype(Py_TYPE(other), Py_TYPE(self)) ||
+ if ((!inplace_op && PyType_IsSubtype(Py_TYPE(other), Py_TYPE(self))) ||
!PyArray_Check(self)) {
/*
* Bail out if Python would already have called the right-hand
@@ -146,7 +146,8 @@ needs_right_binop_forward(PyObject *self, PyObject *other,
#define GIVE_UP_IF_HAS_RIGHT_BINOP(m1, m2, left_name, right_name, inplace) \
do { \
- if (needs_right_binop_forward(m1, m2, right_name, inplace)) { \
+ if (needs_right_binop_forward((PyObject *)m1, m2, right_name, \
+ inplace)) { \
Py_INCREF(Py_NotImplemented); \
return Py_NotImplemented; \
} \
@@ -390,32 +391,41 @@ is_scalar_with_conversion(PyObject *o2, double* out_exponent)
*out_exponent = PyFloat_AsDouble(o2);
return NPY_FLOAT_SCALAR;
}
- if ((PyArray_IsZeroDim(o2) &&
- ((PyArray_ISINTEGER((PyArrayObject *)o2) ||
- (optimize_fpexps && PyArray_ISFLOAT((PyArrayObject *)o2))))) ||
- PyArray_IsScalar(o2, Integer) ||
- (optimize_fpexps && PyArray_IsScalar(o2, Floating))) {
- temp = Py_TYPE(o2)->tp_as_number->nb_float(o2);
- if (temp != NULL) {
+ if (PyArray_Check(o2)) {
+ if ((PyArray_NDIM((PyArrayObject *)o2) == 0) &&
+ ((PyArray_ISINTEGER((PyArrayObject *)o2) ||
+ (optimize_fpexps && PyArray_ISFLOAT((PyArrayObject *)o2))))) {
+ temp = Py_TYPE(o2)->tp_as_number->nb_float(o2);
+ if (temp == NULL) {
+ return NPY_NOSCALAR;
+ }
*out_exponent = PyFloat_AsDouble(o2);
Py_DECREF(temp);
- if (PyArray_IsZeroDim(o2)) {
- if (PyArray_ISINTEGER((PyArrayObject *)o2)) {
- return NPY_INTPOS_SCALAR;
- }
- else { /* ISFLOAT */
- return NPY_FLOAT_SCALAR;
- }
+ if (PyArray_ISINTEGER((PyArrayObject *)o2)) {
+ return NPY_INTPOS_SCALAR;
}
- else if PyArray_IsScalar(o2, Integer) {
- return NPY_INTPOS_SCALAR;
- }
- else { /* IsScalar(o2, Floating) */
+ else { /* ISFLOAT */
return NPY_FLOAT_SCALAR;
}
}
}
- if (PyIndex_Check(o2)) {
+ else if (PyArray_IsScalar(o2, Integer) ||
+ (optimize_fpexps && PyArray_IsScalar(o2, Floating))) {
+ temp = Py_TYPE(o2)->tp_as_number->nb_float(o2);
+ if (temp == NULL) {
+ return NPY_NOSCALAR;
+ }
+ *out_exponent = PyFloat_AsDouble(o2);
+ Py_DECREF(temp);
+
+ if (PyArray_IsScalar(o2, Integer)) {
+ return NPY_INTPOS_SCALAR;
+ }
+ else { /* IsScalar(o2, Floating) */
+ return NPY_FLOAT_SCALAR;
+ }
+ }
+ else if (PyIndex_Check(o2)) {
PyObject* value = PyNumber_Index(o2);
Py_ssize_t val;
if (value==NULL) {
diff --git a/numpy/core/src/multiarray/number.h b/numpy/core/src/multiarray/number.h
index 63ea40696..4667b6b99 100644
--- a/numpy/core/src/multiarray/number.h
+++ b/numpy/core/src/multiarray/number.h
@@ -70,7 +70,7 @@ PyArray_GenericAccumulateFunction(PyArrayObject *m1, PyObject *op, int axis,
int rtype, PyArrayObject *out);
NPY_NO_EXPORT int
-needs_right_binop_forward(PyObject *self, PyObject *other, char *right_name,
- int is_inplace);
+needs_right_binop_forward(PyObject *self, PyObject *other,
+ const char *right_name, int is_inplace);
#endif
diff --git a/numpy/core/src/multiarray/numpymemoryview.c b/numpy/core/src/multiarray/numpymemoryview.c
index 27c02e592..ccc5f33ed 100644
--- a/numpy/core/src/multiarray/numpymemoryview.c
+++ b/numpy/core/src/multiarray/numpymemoryview.c
@@ -252,7 +252,6 @@ NPY_NO_EXPORT PyObject *
PyMemorySimpleView_FromObject(PyObject *base)
{
PyMemorySimpleViewObject *mview = NULL;
- Py_buffer view;
if (Py_TYPE(base)->tp_as_buffer == NULL ||
Py_TYPE(base)->tp_as_buffer->bf_getbuffer == NULL) {
@@ -263,17 +262,19 @@ PyMemorySimpleView_FromObject(PyObject *base)
return NULL;
}
- memset(&view, 0, sizeof(Py_buffer));
- if (PyObject_GetBuffer(base, &view, PyBUF_FULL_RO) < 0)
- return NULL;
-
mview = (PyMemorySimpleViewObject *)
PyObject_GC_New(PyMemorySimpleViewObject, &PyMemorySimpleView_Type);
if (mview == NULL) {
- PyBuffer_Release(&view);
return NULL;
}
- memcpy(&mview->view, &view, sizeof(Py_buffer));
+
+ memset(&mview->view, 0, sizeof(Py_buffer));
+ mview->base = NULL;
+ if (PyObject_GetBuffer(base, &mview->view, PyBUF_FULL_RO) < 0) {
+ Py_DECREF(mview);
+ return NULL;
+ }
+
mview->base = base;
Py_INCREF(base);
diff --git a/numpy/core/src/multiarray/refcount.c b/numpy/core/src/multiarray/refcount.c
index b067cd948..eab11e933 100644
--- a/numpy/core/src/multiarray/refcount.c
+++ b/numpy/core/src/multiarray/refcount.c
@@ -70,7 +70,7 @@ PyArray_Item_XDECREF(char *data, PyArray_Descr *descr)
NPY_COPY_PYOBJECT_PTR(&temp, data);
Py_XDECREF(temp);
}
- else if PyDataType_HASFIELDS(descr) {
+ else if (PyDataType_HASFIELDS(descr)) {
PyObject *key, *value, *title = NULL;
PyArray_Descr *new;
int offset;
diff --git a/numpy/core/src/multiarray/scalarapi.c b/numpy/core/src/multiarray/scalarapi.c
index 9dfd3c4c8..d71823566 100644
--- a/numpy/core/src/multiarray/scalarapi.c
+++ b/numpy/core/src/multiarray/scalarapi.c
@@ -275,6 +275,9 @@ PyArray_FromScalar(PyObject *scalar, PyArray_Descr *outcode)
/* convert to 0-dim array of scalar typecode */
typecode = PyArray_DescrFromScalar(scalar);
+ if (typecode == NULL) {
+ return NULL;
+ }
if ((typecode->type_num == NPY_VOID) &&
!(((PyVoidScalarObject *)scalar)->flags & NPY_ARRAY_OWNDATA) &&
outcode == NULL) {
@@ -544,6 +547,9 @@ PyArray_DescrFromScalar(PyObject *sc)
/* Timedelta */
descr = PyArray_DescrNewFromType(NPY_TIMEDELTA);
}
+ if (descr == NULL) {
+ return NULL;
+ }
dt_data = &(((PyArray_DatetimeDTypeMetaData *)descr->c_metadata)->meta);
memcpy(dt_data, &((PyDatetimeScalarObject *)sc)->obmeta,
sizeof(PyArray_DatetimeMetaData));
@@ -628,7 +634,7 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)
copyswap = descr->f->copyswap;
type = descr->typeobj;
swap = !PyArray_ISNBO(descr->byteorder);
- if PyTypeNum_ISSTRING(type_num) {
+ if (PyTypeNum_ISSTRING(type_num)) {
/* Eliminate NULL bytes */
char *dptr = data;
@@ -825,8 +831,9 @@ PyArray_Scalar(void *data, PyArray_Descr *descr, PyObject *base)
/*NUMPY_API
*
- *Return either an array or the appropriate Python object if the array
- *is 0d and matches a Python type.
+ * Return either an array or the appropriate Python object if the array
+ * is 0d and matches a Python type.
+ * steals reference to mp
*/
NPY_NO_EXPORT PyObject *
PyArray_Return(PyArrayObject *mp)
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src
index 8b7269676..110bef248 100644
--- a/numpy/core/src/multiarray/scalartypes.c.src
+++ b/numpy/core/src/multiarray/scalartypes.c.src
@@ -128,6 +128,18 @@ gentype_dealloc(PyObject *v)
Py_TYPE(v)->tp_free(v);
}
+static void
+gentype_free(PyObject *v)
+{
+ /*
+ * have an explicit tp_free to enforce inheritance from it.
+ * PyObject_Free is also the tp_free of PyBaseObject so python does not
+ * COPYSLOT it, instead it takes the next parent PyInt which has a
+ * different allocator
+ */
+ PyObject_Free(v);
+}
+
static PyObject *
gentype_power(PyObject *m1, PyObject *m2, PyObject *NPY_UNUSED(m3))
@@ -421,8 +433,7 @@ gentype_format(PyObject *self, PyObject *args)
Py_DECREF(dtype);
}
else {
- obj = self;
- Py_INCREF(obj);
+ obj = PyObject_Str(self);
}
if (obj == NULL) {
@@ -965,6 +976,9 @@ static PyObject *
dval = (double)(((Py@CHAR@LongDoubleScalarObject *)self)->obval)@POST@;
obj = Py@KIND@_FromDouble(dval);
+ if (obj == NULL) {
+ return NULL;
+ }
ret = Py_TYPE(obj)->tp_as_number->nb_@name@(obj);
Py_DECREF(obj);
return ret;
@@ -989,6 +1003,9 @@ static PyObject *
dval = (double)(((Py@CHAR@LongDoubleScalarObject *)self)->obval)@POST@;
obj = Py@KIND@_FromDouble(dval);
+ if (obj == NULL) {
+ return NULL;
+ }
ret = Py_TYPE(obj)->tp_as_number->nb_@name@(obj);
Py_DECREF(obj);
return ret;
@@ -1065,7 +1082,11 @@ gentype_richcompare(PyObject *self, PyObject *other, int cmp_op)
if (arr == NULL) {
return NULL;
}
- ret = Py_TYPE(arr)->tp_richcompare(arr, other, cmp_op);
+ /*
+ * Call via PyObject_RichCompare to ensure that other.__eq__
+ * has a chance to run when necessary
+ */
+ ret = PyObject_RichCompare(arr, other, cmp_op);
Py_DECREF(arr);
return ret;
}
@@ -1104,6 +1125,21 @@ voidtype_dtypedescr_get(PyVoidScalarObject *self)
static PyObject *
+inttype_numerator_get(PyObject *self)
+{
+ Py_INCREF(self);
+ return self;
+}
+
+
+static PyObject *
+inttype_denominator_get(PyObject *self)
+{
+ return PyInt_FromLong(1);
+}
+
+
+static PyObject *
gentype_data_get(PyObject *self)
{
#if defined(NPY_PY3K)
@@ -1487,9 +1523,9 @@ gentype_wraparray(PyObject *NPY_UNUSED(scalar), PyObject *args)
*/
/**begin repeat
*
- * #name = tolist, item, tostring, astype, copy, __deepcopy__, searchsorted,
- * view, swapaxes, conj, conjugate, nonzero, flatten, ravel, fill,
- * transpose, newbyteorder#
+ * #name = tolist, item, tostring, tobytes, astype, copy, __deepcopy__,
+ * searchsorted, view, swapaxes, conj, conjugate, nonzero, flatten,
+ * ravel, fill, transpose, newbyteorder#
*/
static PyObject *
gentype_@name@(PyObject *self, PyObject *args)
@@ -1833,6 +1869,9 @@ static PyMethodDef gentype_methods[] = {
{"itemset",
(PyCFunction)gentype_itemset,
METH_VARARGS, NULL},
+ {"tobytes",
+ (PyCFunction)gentype_tobytes,
+ METH_VARARGS, NULL},
{"tofile",
(PyCFunction)gentype_tofile,
METH_VARARGS | METH_KEYWORDS, NULL},
@@ -2044,6 +2083,20 @@ static PyMethodDef voidtype_methods[] = {
{NULL, NULL, 0, NULL}
};
+static PyGetSetDef inttype_getsets[] = {
+ {"numerator",
+ (getter)inttype_numerator_get,
+ (setter)0,
+ "numerator of value (the value itself)",
+ NULL},
+ {"denominator",
+ (getter)inttype_denominator_get,
+ (setter)0,
+ "denominator of value (1)",
+ NULL},
+ {NULL, NULL, NULL, NULL, NULL}
+};
+
/**begin repeat
* #name = cfloat,clongdouble#
*/
@@ -2435,10 +2488,13 @@ object_arrtype_dealloc(PyObject *v)
/* We are inheriting from a Python type as well so \
give it first dibs on conversion */ \
sup = (PyTypeObject *)PyTuple_GET_ITEM(type->tp_bases, num); \
- robj = sup->tp_new(type, args, kwds); \
- if (robj != NULL) goto finish; \
- if (PyTuple_GET_SIZE(args)!=1) return NULL; \
- PyErr_Clear(); \
+ /* Prevent recursion */ \
+ if (thisfunc != sup->tp_new) { \
+ robj = sup->tp_new(type, args, kwds); \
+ if (robj != NULL) goto finish; \
+ if (PyTuple_GET_SIZE(args)!=1) return NULL; \
+ PyErr_Clear(); \
+ } \
/* now do default conversion */ \
}
@@ -2474,6 +2530,9 @@ static PyObject *
PyObject *robj;
PyArrayObject *arr;
PyArray_Descr *typecode = NULL;
+#if (@work@ != 0) || (@default@ == 1)
+ void *thisfunc = (void *)@name@_arrtype_new;
+#endif
#if !(@default@ == 2)
int itemsize;
void *dest, *src;
@@ -2930,7 +2989,7 @@ long_arrtype_hash(PyObject *obj)
* #Char = ,U#
* #Word = ,Unsigned#
*/
-static npy_hash_t
+static NPY_INLINE npy_hash_t
@char@longlong_arrtype_hash(PyObject *obj)
{
PyObject * l = PyLong_From@Word@LongLong(
@@ -3342,33 +3401,15 @@ gen_arrtype_subscript(PyObject *self, PyObject *key)
* the data where N is the number of None's in <???>.
*/
PyObject *res, *ret;
- int N;
- if (key == Py_Ellipsis || key == Py_None ||
- PyTuple_Check(key)) {
- res = PyArray_FromScalar(self, NULL);
- }
- else {
+ res = PyArray_FromScalar(self, NULL);
+
+ ret = array_subscript((PyArrayObject *)res, key);
+ Py_DECREF(res);
+ if (ret == NULL) {
PyErr_SetString(PyExc_IndexError,
- "invalid index to scalar variable.");
- return NULL;
+ "invalid index to scalar variable.");
}
- if (key == Py_Ellipsis) {
- return res;
- }
- if (key == Py_None) {
- ret = add_new_axes_0d((PyArrayObject *)res, 1);
- Py_DECREF(res);
- return ret;
- }
- /* Must be a Tuple */
- N = count_new_axes_0d(key);
- if (N < 0) {
- Py_DECREF(res);
- return NULL;
- }
- ret = add_new_axes_0d((PyArrayObject *)res, N);
- Py_DECREF(res);
return ret;
}
@@ -3985,7 +4026,7 @@ initialize_numeric_types(void)
PyGenericArrType_Type.tp_getset = gentype_getsets;
PyGenericArrType_Type.tp_new = NULL;
PyGenericArrType_Type.tp_alloc = gentype_alloc;
- PyGenericArrType_Type.tp_free = PyObject_Free;
+ PyGenericArrType_Type.tp_free = (freefunc)gentype_free;
PyGenericArrType_Type.tp_repr = gentype_repr;
PyGenericArrType_Type.tp_str = gentype_str;
PyGenericArrType_Type.tp_richcompare = gentype_richcompare;
@@ -4009,7 +4050,7 @@ initialize_numeric_types(void)
PyBoolArrType_Type.tp_as_number->nb_index = (unaryfunc)bool_index;
PyStringArrType_Type.tp_alloc = NULL;
- PyStringArrType_Type.tp_free = PyObject_Free;
+ PyStringArrType_Type.tp_free = NULL;
PyStringArrType_Type.tp_repr = stringtype_repr;
PyStringArrType_Type.tp_str = stringtype_str;
@@ -4022,6 +4063,8 @@ initialize_numeric_types(void)
PyVoidArrType_Type.tp_as_mapping = &voidtype_as_mapping;
PyVoidArrType_Type.tp_as_sequence = &voidtype_as_sequence;
+ PyIntegerArrType_Type.tp_getset = inttype_getsets;
+
/**begin repeat
* #NAME= Number, Integer, SignedInteger, UnsignedInteger, Inexact,
* Floating, ComplexFloating, Flexible, Character#
diff --git a/numpy/core/src/multiarray/sequence.c b/numpy/core/src/multiarray/sequence.c
index 310c01084..520732acf 100644
--- a/numpy/core/src/multiarray/sequence.c
+++ b/numpy/core/src/multiarray/sequence.c
@@ -88,7 +88,7 @@ array_slice(PyArrayObject *self, Py_ssize_t ilow, Py_ssize_t ihigh)
static int
-array_ass_slice(PyArrayObject *self, Py_ssize_t ilow,
+array_assign_slice(PyArrayObject *self, Py_ssize_t ilow,
Py_ssize_t ihigh, PyObject *v) {
int ret;
PyArrayObject *tmp;
@@ -135,8 +135,8 @@ NPY_NO_EXPORT PySequenceMethods array_as_sequence = {
(ssizeargfunc)NULL,
(ssizeargfunc)array_item,
(ssizessizeargfunc)array_slice,
- (ssizeobjargproc)array_ass_item, /*sq_ass_item*/
- (ssizessizeobjargproc)array_ass_slice, /*sq_ass_slice*/
+ (ssizeobjargproc)array_assign_item, /*sq_ass_item*/
+ (ssizessizeobjargproc)array_assign_slice, /*sq_ass_slice*/
(objobjproc) array_contains, /*sq_contains */
(binaryfunc) NULL, /*sg_inplace_concat */
(ssizeargfunc)NULL,
diff --git a/numpy/core/src/multiarray/shape.c b/numpy/core/src/multiarray/shape.c
index 41c670df4..8b73f4709 100644
--- a/numpy/core/src/multiarray/shape.c
+++ b/numpy/core/src/multiarray/shape.c
@@ -93,7 +93,8 @@ PyArray_Resize(PyArrayObject *self, PyArray_Dims *newshape, int refcheck,
|| (PyArray_BASE(self) != NULL)
|| (((PyArrayObject_fields *)self)->weakreflist != NULL)) {
PyErr_SetString(PyExc_ValueError,
- "cannot resize an array references or is referenced\n"\
+ "cannot resize an array that "\
+ "references or is referenced\n"\
"by another array in this way. Use the resize function");
return NULL;
}
@@ -775,7 +776,8 @@ PyArray_Transpose(PyArrayObject *ap, PyArray_Dims *permute)
PyArray_DIMS(ret)[i] = PyArray_DIMS(ap)[permutation[i]];
PyArray_STRIDES(ret)[i] = PyArray_STRIDES(ap)[permutation[i]];
}
- PyArray_UpdateFlags(ret, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_F_CONTIGUOUS);
+ PyArray_UpdateFlags(ret, NPY_ARRAY_C_CONTIGUOUS | NPY_ARRAY_F_CONTIGUOUS |
+ NPY_ARRAY_ALIGNED);
return (PyObject *)ret;
}
@@ -783,7 +785,7 @@ PyArray_Transpose(PyArrayObject *ap, PyArray_Dims *permute)
* Sorts items so stride is descending, because C-order
* is the default in the face of ambiguity.
*/
-int _npy_stride_sort_item_comparator(const void *a, const void *b)
+static int _npy_stride_sort_item_comparator(const void *a, const void *b)
{
npy_intp astride = ((const npy_stride_sort_item *)a)->stride,
bstride = ((const npy_stride_sort_item *)b)->stride;
diff --git a/numpy/core/src/npymath/ieee754.c.src b/numpy/core/src/npymath/ieee754.c.src
index 4b007f18d..b8f6889e1 100644
--- a/numpy/core/src/npymath/ieee754.c.src
+++ b/numpy/core/src/npymath/ieee754.c.src
@@ -46,7 +46,7 @@ int _npy_signbit_ld(long double x)
* p >= 0, returnx x + nulp
* p < 0, returnx x - nulp
*/
-double _next(double x, int p)
+static double _next(double x, int p)
{
volatile double t;
npy_int32 hx, hy, ix;
@@ -92,7 +92,7 @@ double _next(double x, int p)
return x;
}
-float _nextf(float x, int p)
+static float _nextf(float x, int p)
{
volatile float t;
npy_int32 hx, hy, ix;
@@ -133,7 +133,8 @@ float _nextf(float x, int p)
return x;
}
-#ifdef HAVE_LDOUBLE_DOUBLE_DOUBLE_BE
+#if defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE) || \
+ defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_LE)
/*
* FIXME: this is ugly and untested. The asm part only works with gcc, and we
@@ -178,7 +179,7 @@ do { \
(d) = qw_u.value; \
} while (0)
-npy_longdouble _nextl(npy_longdouble x, int p)
+static npy_longdouble _nextl(npy_longdouble x, int p)
{
npy_int64 hx,ihx,ilx;
npy_uint64 lx;
@@ -256,7 +257,7 @@ npy_longdouble _nextl(npy_longdouble x, int p)
}
}
#else
-npy_longdouble _nextl(npy_longdouble x, int p)
+static npy_longdouble _nextl(npy_longdouble x, int p)
{
volatile npy_longdouble t;
union IEEEl2bitsrep ux;
diff --git a/numpy/core/src/npymath/npy_math.c.src b/numpy/core/src/npymath/npy_math.c.src
index 61f1d79ab..05af0b132 100644
--- a/numpy/core/src/npymath/npy_math.c.src
+++ b/numpy/core/src/npymath/npy_math.c.src
@@ -65,14 +65,19 @@
#ifndef HAVE_EXPM1
double npy_expm1(double x)
{
- const double u = npy_exp(x);
-
- if (u == 1.0) {
+ if (npy_isinf(x) && x > 0) {
return x;
- } else if (u - 1.0 == -1.0) {
- return -1;
- } else {
- return (u - 1.0) * x/npy_log(u);
+ }
+ else {
+ const double u = npy_exp(x);
+
+ if (u == 1.0) {
+ return x;
+ } else if (u - 1.0 == -1.0) {
+ return -1;
+ } else {
+ return (u - 1.0) * x/npy_log(u);
+ }
}
}
#endif
@@ -80,13 +85,18 @@ double npy_expm1(double x)
#ifndef HAVE_LOG1P
double npy_log1p(double x)
{
- const double u = 1. + x;
- const double d = u - 1.;
-
- if (d == 0) {
+ if (npy_isinf(x) && x > 0) {
return x;
- } else {
- return npy_log(u) * x / d;
+ }
+ else {
+ const double u = 1. + x;
+ const double d = u - 1.;
+
+ if (d == 0) {
+ return x;
+ } else {
+ return npy_log(u) * x / d;
+ }
}
}
#endif
@@ -289,7 +299,35 @@ double npy_exp2(double x)
#ifndef HAVE_LOG2
double npy_log2(double x)
{
- return NPY_LOG2E*npy_log(x);
+#ifdef HAVE_FREXP
+ if (!npy_isfinite(x) || x <= 0.) {
+ /* special value result */
+ return npy_log(x);
+ }
+ else {
+ /*
+ * fallback implementation copied from python3.4 math.log2
+ * provides int(log(2**i)) == i for i 1-64 in default rounding mode.
+ *
+ * We want log2(m * 2**e) == log(m) / log(2) + e. Care is needed when
+ * x is just greater than 1.0: in that case e is 1, log(m) is negative,
+ * and we get significant cancellation error from the addition of
+ * log(m) / log(2) to e. The slight rewrite of the expression below
+ * avoids this problem.
+ */
+ int e;
+ double m = frexp(x, &e);
+ if (x >= 1.0) {
+ return log(2.0 * m) / log(2.0) + (e - 1);
+ }
+ else {
+ return log(m) / log(2.0) + e;
+ }
+ }
+#else
+ /* does not provide int(log(2**i)) == i */
+ return NPY_LOG2E * npy_log(x);
+#endif
}
#endif
diff --git a/numpy/core/src/npymath/npy_math_private.h b/numpy/core/src/npymath/npy_math_private.h
index 2bca6bf60..b3b1690be 100644
--- a/numpy/core/src/npymath/npy_math_private.h
+++ b/numpy/core/src/npymath/npy_math_private.h
@@ -435,7 +435,8 @@ do { \
typedef npy_uint32 ldouble_sign_t;
#endif
-#ifndef HAVE_LDOUBLE_DOUBLE_DOUBLE_BE
+#if !defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE) && \
+ !defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_LE)
/* Get the sign bit of x. x should be of type IEEEl2bitsrep */
#define GET_LDOUBLE_SIGN(x) \
(((x).a[LDBL_SIGN_INDEX] & LDBL_SIGN_MASK) >> LDBL_SIGN_SHIFT)
diff --git a/numpy/core/src/npysort/binsearch.c.src b/numpy/core/src/npysort/binsearch.c.src
new file mode 100644
index 000000000..a1a07039a
--- /dev/null
+++ b/numpy/core/src/npysort/binsearch.c.src
@@ -0,0 +1,240 @@
+/* -*- c -*- */
+#define NPY_NO_DEPRECATED_API NPY_API_VERSION
+
+#include "npy_sort.h"
+#include "npysort_common.h"
+#include "npy_binsearch.h"
+
+#define NOT_USED NPY_UNUSED(unused)
+
+/*
+ *****************************************************************************
+ ** NUMERIC SEARCHES **
+ *****************************************************************************
+ */
+
+/**begin repeat
+ *
+ * #TYPE = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
+ * LONGLONG, ULONGLONG, HALF, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE, DATETIME, TIMEDELTA#
+ * #suff = bool, byte, ubyte, short, ushort, int, uint, long, ulong,
+ * longlong, ulonglong, half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble, datetime, timedelta#
+ * #type = npy_bool, npy_byte, npy_ubyte, npy_short, npy_ushort, npy_int,
+ * npy_uint, npy_long, npy_ulong, npy_longlong, npy_ulonglong,
+ * npy_ushort, npy_float, npy_double, npy_longdouble, npy_cfloat,
+ * npy_cdouble, npy_clongdouble, npy_datetime, npy_timedelta#
+ */
+
+#define @TYPE@_LTE(a, b) (!@TYPE@_LT((b), (a)))
+
+/**begin repeat1
+ *
+ * #side = left, right#
+ * #CMP = LT, LTE#
+ */
+
+NPY_VISIBILITY_HIDDEN void
+binsearch_@side@_@suff@(const char *arr, const char *key, char *ret,
+ npy_intp arr_len, npy_intp key_len,
+ npy_intp arr_str, npy_intp key_str, npy_intp ret_str,
+ PyArrayObject *NOT_USED)
+{
+ npy_intp min_idx = 0;
+ npy_intp max_idx = arr_len;
+ @type@ last_key_val = *(const @type@ *)key;
+
+ for (; key_len > 0; key_len--, key += key_str, ret += ret_str) {
+ const @type@ key_val = *(const @type@ *)key;
+ /*
+ * Updating only one of the indices based on the previous key
+ * gives the search a big boost when keys are sorted, but slightly
+ * slows down things for purely random ones.
+ */
+ if (@TYPE@_LT(last_key_val, key_val)) {
+ max_idx = arr_len;
+ }
+ else {
+ min_idx = 0;
+ max_idx = (max_idx < arr_len) ? (max_idx + 1) : arr_len;
+ }
+
+ last_key_val = key_val;
+
+ while (min_idx < max_idx) {
+ const npy_intp mid_idx = min_idx + ((max_idx - min_idx) >> 1);
+ const @type@ mid_val = *(const @type@ *)(arr + mid_idx*arr_str);
+ if (@TYPE@_@CMP@(mid_val, key_val)) {
+ min_idx = mid_idx + 1;
+ }
+ else {
+ max_idx = mid_idx;
+ }
+ }
+ *(npy_intp *)ret = min_idx;
+ }
+}
+
+NPY_VISIBILITY_HIDDEN int
+argbinsearch_@side@_@suff@(const char *arr, const char *key,
+ const char *sort, char *ret,
+ npy_intp arr_len, npy_intp key_len,
+ npy_intp arr_str, npy_intp key_str,
+ npy_intp sort_str, npy_intp ret_str,
+ PyArrayObject *NOT_USED)
+{
+ npy_intp min_idx = 0;
+ npy_intp max_idx = arr_len;
+ @type@ last_key_val = *(const @type@ *)key;
+
+ for (; key_len > 0; key_len--, key += key_str, ret += ret_str) {
+ const @type@ key_val = *(const @type@ *)key;
+ /*
+ * Updating only one of the indices based on the previous key
+ * gives the search a big boost when keys are sorted, but slightly
+ * slows down things for purely random ones.
+ */
+ if (@TYPE@_LT(last_key_val, key_val)) {
+ max_idx = arr_len;
+ }
+ else {
+ min_idx = 0;
+ max_idx = (max_idx < arr_len) ? (max_idx + 1) : arr_len;
+ }
+
+ last_key_val = key_val;
+
+ while (min_idx < max_idx) {
+ const npy_intp mid_idx = min_idx + ((max_idx - min_idx) >> 1);
+ const npy_intp sort_idx = *(npy_intp *)(sort + mid_idx*sort_str);
+ @type@ mid_val;
+
+ if (sort_idx < 0 || sort_idx >= arr_len) {
+ return -1;
+ }
+
+ mid_val = *(const @type@ *)(arr + sort_idx*arr_str);
+
+ if (@TYPE@_@CMP@(mid_val, key_val)) {
+ min_idx = mid_idx + 1;
+ }
+ else {
+ max_idx = mid_idx;
+ }
+ }
+ *(npy_intp *)ret = min_idx;
+ }
+ return 0;
+}
+
+/**end repeat1**/
+/**end repeat**/
+
+/*
+ *****************************************************************************
+ ** GENERIC SEARCH **
+ *****************************************************************************
+ */
+
+ /**begin repeat
+ *
+ * #side = left, right#
+ * #CMP = <, <=#
+ */
+
+NPY_VISIBILITY_HIDDEN void
+npy_binsearch_@side@(const char *arr, const char *key, char *ret,
+ npy_intp arr_len, npy_intp key_len,
+ npy_intp arr_str, npy_intp key_str, npy_intp ret_str,
+ PyArrayObject *cmp)
+{
+ PyArray_CompareFunc *compare = PyArray_DESCR(cmp)->f->compare;
+ npy_intp min_idx = 0;
+ npy_intp max_idx = arr_len;
+ const char *last_key = key;
+
+ for (; key_len > 0; key_len--, key += key_str, ret += ret_str) {
+ /*
+ * Updating only one of the indices based on the previous key
+ * gives the search a big boost when keys are sorted, but slightly
+ * slows down things for purely random ones.
+ */
+ if (compare(last_key, key, cmp) @CMP@ 0) {
+ max_idx = arr_len;
+ }
+ else {
+ min_idx = 0;
+ max_idx = (max_idx < arr_len) ? (max_idx + 1) : arr_len;
+ }
+
+ last_key = key;
+
+ while (min_idx < max_idx) {
+ const npy_intp mid_idx = min_idx + ((max_idx - min_idx) >> 1);
+ const char *arr_ptr = arr + mid_idx*arr_str;
+
+ if (compare(arr_ptr, key, cmp) @CMP@ 0) {
+ min_idx = mid_idx + 1;
+ }
+ else {
+ max_idx = mid_idx;
+ }
+ }
+ *(npy_intp *)ret = min_idx;
+ }
+}
+
+NPY_VISIBILITY_HIDDEN int
+npy_argbinsearch_@side@(const char *arr, const char *key,
+ const char *sort, char *ret,
+ npy_intp arr_len, npy_intp key_len,
+ npy_intp arr_str, npy_intp key_str,
+ npy_intp sort_str, npy_intp ret_str,
+ PyArrayObject *cmp)
+{
+ PyArray_CompareFunc *compare = PyArray_DESCR(cmp)->f->compare;
+ npy_intp min_idx = 0;
+ npy_intp max_idx = arr_len;
+ const char *last_key = key;
+
+ for (; key_len > 0; key_len--, key += key_str, ret += ret_str) {
+ /*
+ * Updating only one of the indices based on the previous key
+ * gives the search a big boost when keys are sorted, but slightly
+ * slows down things for purely random ones.
+ */
+ if (compare(last_key, key, cmp) @CMP@ 0) {
+ max_idx = arr_len;
+ }
+ else {
+ min_idx = 0;
+ max_idx = (max_idx < arr_len) ? (max_idx + 1) : arr_len;
+ }
+
+ last_key = key;
+
+ while (min_idx < max_idx) {
+ const npy_intp mid_idx = min_idx + ((max_idx - min_idx) >> 1);
+ const npy_intp sort_idx = *(npy_intp *)(sort + mid_idx*sort_str);
+ const char *arr_ptr;
+
+ if (sort_idx < 0 || sort_idx >= arr_len) {
+ return -1;
+ }
+
+ arr_ptr = arr + sort_idx*arr_str;
+
+ if (compare(arr_ptr, key, cmp) @CMP@ 0) {
+ min_idx = mid_idx + 1;
+ }
+ else {
+ max_idx = mid_idx;
+ }
+ }
+ *(npy_intp *)ret = min_idx;
+ }
+ return 0;
+}
+
+/**end repeat**/
diff --git a/numpy/core/src/npysort/selection.c.src b/numpy/core/src/npysort/selection.c.src
index 073b5847f..4167b2694 100644
--- a/numpy/core/src/npysort/selection.c.src
+++ b/numpy/core/src/npysort/selection.c.src
@@ -69,6 +69,7 @@ static NPY_INLINE void store_pivot(npy_intp pivot, npy_intp kth,
* npy_uint, npy_long, npy_ulong, npy_longlong, npy_ulonglong,
* npy_ushort, npy_float, npy_double, npy_longdouble, npy_cfloat,
* npy_cdouble, npy_clongdouble#
+ * #inexact = 0*11, 1*7#
*/
static npy_intp
@@ -322,6 +323,20 @@ int
store_pivot(kth, kth, pivots, npiv);
return 0;
}
+ else if (@inexact@ && kth == num - 1) {
+ /* useful to check if NaN present via partition(d, (x, -1)) */
+ npy_intp k;
+ npy_intp maxidx = low;
+ @type@ maxval = v[IDX(low)];
+ for (k = low + 1; k < num; k++) {
+ if (!@TYPE@_LT(v[IDX(k)], maxval)) {
+ maxidx = k;
+ maxval = v[IDX(k)];
+ }
+ }
+ SWAP(SORTEE(kth), SORTEE(maxidx));
+ return 0;
+ }
/* dumb integer msb, float npy_log2 too slow for small parititions */
{
@@ -375,7 +390,10 @@ int
/* move pivot into position */
SWAP(SORTEE(low), SORTEE(hh));
- store_pivot(hh, kth, pivots, npiv);
+ /* kth pivot stored later */
+ if (hh != kth) {
+ store_pivot(hh, kth, pivots, npiv);
+ }
if (hh >= kth)
high = hh - 1;
@@ -385,10 +403,11 @@ int
/* two elements */
if (high == low + 1) {
- if (@TYPE@_LT(v[IDX(high)], v[IDX(low)]))
+ if (@TYPE@_LT(v[IDX(high)], v[IDX(low)])) {
SWAP(SORTEE(high), SORTEE(low))
- store_pivot(low, kth, pivots, npiv);
+ }
}
+ store_pivot(kth, kth, pivots, npiv);
return 0;
}
diff --git a/numpy/core/src/private/lowlevel_strided_loops.h b/numpy/core/src/private/lowlevel_strided_loops.h
index f2e5d02c3..a6bb4c7eb 100644
--- a/numpy/core/src/private/lowlevel_strided_loops.h
+++ b/numpy/core/src/private/lowlevel_strided_loops.h
@@ -326,6 +326,20 @@ PyArray_TransferMaskedStridedToNDim(npy_intp ndim,
PyArray_MaskedStridedUnaryOp *stransfer,
NpyAuxData *data);
+NPY_NO_EXPORT int
+mapiter_trivial_get(PyArrayObject *self, PyArrayObject *ind,
+ PyArrayObject *result);
+
+NPY_NO_EXPORT int
+mapiter_trivial_set(PyArrayObject *self, PyArrayObject *ind,
+ PyArrayObject *result);
+
+NPY_NO_EXPORT int
+mapiter_get(PyArrayMapIterObject *mit);
+
+NPY_NO_EXPORT int
+mapiter_set(PyArrayMapIterObject *mit);
+
/*
* Prepares shape and strides for a simple raw array iteration.
* This sorts the strides into FORTRAN order, reverses any negative
@@ -654,7 +668,7 @@ npy_bswap8_unaligned(char * x)
PyArray_DIMS(arr2), \
PyArray_NDIM(arr1)) && \
(PyArray_FLAGS(arr1)&(NPY_ARRAY_C_CONTIGUOUS| \
- NPY_ARRAY_F_CONTIGUOUS)) == \
+ NPY_ARRAY_F_CONTIGUOUS)) & \
(PyArray_FLAGS(arr2)&(NPY_ARRAY_C_CONTIGUOUS| \
NPY_ARRAY_F_CONTIGUOUS)) \
)
@@ -665,12 +679,12 @@ npy_bswap8_unaligned(char * x)
PyArray_CHKFLAGS(arr, NPY_ARRAY_F_CONTIGUOUS) \
)
#define PyArray_PREPARE_TRIVIAL_ITERATION(arr, count, data, stride) \
- count = PyArray_SIZE(arr), \
- data = PyArray_BYTES(arr), \
+ count = PyArray_SIZE(arr); \
+ data = PyArray_BYTES(arr); \
stride = ((PyArray_NDIM(arr) == 0) ? 0 : \
((PyArray_NDIM(arr) == 1) ? \
PyArray_STRIDE(arr, 0) : \
- PyArray_ITEMSIZE(arr))) \
+ PyArray_ITEMSIZE(arr)));
#define PyArray_TRIVIALLY_ITERABLE_PAIR(arr1, arr2) (\
diff --git a/numpy/core/src/private/npy_binsearch.h.src b/numpy/core/src/private/npy_binsearch.h.src
new file mode 100644
index 000000000..3b2c59487
--- /dev/null
+++ b/numpy/core/src/private/npy_binsearch.h.src
@@ -0,0 +1,140 @@
+#ifndef __NPY_BINSEARCH_H__
+#define __NPY_BINSEARCH_H__
+
+#include "npy_sort.h"
+#include <numpy/npy_common.h>
+#include <numpy/ndarraytypes.h>
+
+typedef void (PyArray_BinSearchFunc)(const char*, const char*, char*,
+ npy_intp, npy_intp,
+ npy_intp, npy_intp, npy_intp,
+ PyArrayObject*);
+
+typedef int (PyArray_ArgBinSearchFunc)(const char*, const char*,
+ const char*, char*,
+ npy_intp, npy_intp, npy_intp,
+ npy_intp, npy_intp, npy_intp,
+ PyArrayObject*);
+
+struct binsearch_map {
+ enum NPY_TYPES typenum;
+ PyArray_BinSearchFunc *binsearch[NPY_NSEARCHSIDES];
+};
+
+struct argbinsearch_map {
+ enum NPY_TYPES typenum;
+ PyArray_ArgBinSearchFunc *argbinsearch[NPY_NSEARCHSIDES];
+};
+
+/**begin repeat
+ *
+ * #side = left, right#
+ */
+
+/**begin repeat1
+ *
+ * #suff = bool, byte, ubyte, short, ushort, int, uint, long, ulong,
+ * longlong, ulonglong, half, float, double, longdouble,
+ * cfloat, cdouble, clongdouble, datetime, timedelta#
+ */
+
+NPY_VISIBILITY_HIDDEN void
+binsearch_@side@_@suff@(const char *arr, const char *key, char *ret,
+ npy_intp arr_len, npy_intp key_len,
+ npy_intp arr_str, npy_intp key_str, npy_intp ret_str,
+ PyArrayObject *unused);
+NPY_VISIBILITY_HIDDEN int
+argbinsearch_@side@_@suff@(const char *arr, const char *key,
+ const char *sort, char *ret,
+ npy_intp arr_len, npy_intp key_len,
+ npy_intp arr_str, npy_intp key_str,
+ npy_intp sort_str, npy_intp ret_str,
+ PyArrayObject *unused);
+/**end repeat1**/
+
+NPY_VISIBILITY_HIDDEN void
+npy_binsearch_@side@(const char *arr, const char *key, char *ret,
+ npy_intp arr_len, npy_intp key_len,
+ npy_intp arr_str, npy_intp key_str,
+ npy_intp ret_str, PyArrayObject *cmp);
+NPY_VISIBILITY_HIDDEN int
+npy_argbinsearch_@side@(const char *arr, const char *key,
+ const char *sort, char *ret,
+ npy_intp arr_len, npy_intp key_len,
+ npy_intp arr_str, npy_intp key_str,
+ npy_intp sort_str, npy_intp ret_str,
+ PyArrayObject *cmp);
+/**end repeat**/
+
+/**begin repeat
+ *
+ * #arg = , arg#
+ * #Arg = , Arg#
+ */
+
+static struct @arg@binsearch_map _@arg@binsearch_map[] = {
+ /* If adding new types, make sure to keep them ordered by type num */
+ /**begin repeat1
+ *
+ * #TYPE = BOOL, BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG,
+ * LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE,
+ * CFLOAT, CDOUBLE, CLONGDOUBLE, DATETIME, TIMEDELTA, HALF#
+ * #suff = bool, byte, ubyte, short, ushort, int, uint, long, ulong,
+ * longlong, ulonglong, float, double, longdouble,
+ * cfloat, cdouble, clongdouble, datetime, timedelta, half#
+ */
+ {NPY_@TYPE@,
+ {
+ &@arg@binsearch_left_@suff@,
+ &@arg@binsearch_right_@suff@,
+ },
+ },
+ /**end repeat1**/
+};
+
+static PyArray_@Arg@BinSearchFunc *gen@arg@binsearch_map[] = {
+ &npy_@arg@binsearch_left,
+ &npy_@arg@binsearch_right,
+};
+
+static NPY_INLINE PyArray_@Arg@BinSearchFunc*
+get_@arg@binsearch_func(PyArray_Descr *dtype, NPY_SEARCHSIDE side)
+{
+ static npy_intp num_funcs = sizeof(_@arg@binsearch_map) /
+ sizeof(_@arg@binsearch_map[0]);
+ npy_intp min_idx = 0;
+ npy_intp max_idx = num_funcs;
+ int type = dtype->type_num;
+
+ if (side >= NPY_NSEARCHSIDES) {
+ return NULL;
+ }
+
+ /*
+ * It seems only fair that a binary search function be searched for
+ * using a binary search...
+ */
+ while (min_idx < max_idx) {
+ npy_intp mid_idx = min_idx + ((max_idx - min_idx) >> 1);
+
+ if (_@arg@binsearch_map[mid_idx].typenum < type) {
+ min_idx = mid_idx + 1;
+ }
+ else {
+ max_idx = mid_idx;
+ }
+ }
+
+ if (min_idx < num_funcs && _@arg@binsearch_map[min_idx].typenum == type) {
+ return _@arg@binsearch_map[min_idx].@arg@binsearch[side];
+ }
+
+ if (dtype->f->compare) {
+ return gen@arg@binsearch_map[side];
+ }
+
+ return NULL;
+}
+/**end repeat**/
+
+#endif
diff --git a/numpy/core/src/private/npy_config.h b/numpy/core/src/private/npy_config.h
index 453dbd065..71d448ee9 100644
--- a/numpy/core/src/private/npy_config.h
+++ b/numpy/core/src/private/npy_config.h
@@ -10,6 +10,17 @@
#undef HAVE_HYPOT
#endif
+/*
+ * largest alignment the copy loops might require
+ * required as string, void and complex types might get copied using larger
+ * instructions than required to operate on them. E.g. complex float is copied
+ * in 8 byte moves but arithmetic on them only loads in 4 byte moves.
+ * the sparc platform may need that alignment for long doubles.
+ * amd64 is not harmed much by the bloat as the system provides 16 byte
+ * alignment by default.
+ */
+#define NPY_MAX_COPY_ALIGNMENT 16
+
/* Safe to use ldexp and frexp for long double for MSVC builds */
#if (NPY_SIZEOF_LONGDOUBLE == NPY_SIZEOF_DOUBLE) || defined(_MSC_VER)
#ifdef HAVE_LDEXP
diff --git a/numpy/core/src/private/npy_fpmath.h b/numpy/core/src/private/npy_fpmath.h
index 8a120cab7..86b9cf3da 100644
--- a/numpy/core/src/private/npy_fpmath.h
+++ b/numpy/core/src/private/npy_fpmath.h
@@ -29,6 +29,8 @@
#define HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE
#elif defined(NPY_CPU_PPC) || defined(NPY_CPU_PPC64)
#define HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_BE
+ #elif defined(NPY_CPU_PPC64LE)
+ #define HAVE_LDOUBLE_IEEE_DOUBLE_16_BYTES_LE
#endif
#endif
#endif
@@ -41,7 +43,8 @@
defined(HAVE_LDOUBLE_INTEL_EXTENDED_16_BYTES_LE) || \
defined(HAVE_LDOUBLE_INTEL_EXTENDED_12_BYTES_LE) || \
defined(HAVE_LDOUBLE_MOTOROLA_EXTENDED_12_BYTES_BE) || \
- defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE))
+ defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_BE) || \
+ defined(HAVE_LDOUBLE_DOUBLE_DOUBLE_LE))
#error No long double representation defined
#endif
diff --git a/numpy/core/src/private/npy_partition.h.src b/numpy/core/src/private/npy_partition.h.src
index c03ecb0de..fd79068f7 100644
--- a/numpy/core/src/private/npy_partition.h.src
+++ b/numpy/core/src/private/npy_partition.h.src
@@ -41,28 +41,35 @@
* npy_cdouble, npy_clongdouble#
*/
-int introselect_@suff@(@type@ *v, npy_intp num,
- npy_intp kth,
- npy_intp * pivots,
- npy_intp * npiv,
- void *NOT_USED);
-int aintroselect_@suff@(@type@ *v, npy_intp* tosort, npy_intp num,
- npy_intp kth,
- npy_intp * pivots,
- npy_intp * npiv,
- void *NOT_USED);
+NPY_VISIBILITY_HIDDEN int introselect_@suff@(@type@ *v, npy_intp num,
+ npy_intp kth,
+ npy_intp * pivots,
+ npy_intp * npiv,
+ void *NOT_USED);
+NPY_VISIBILITY_HIDDEN int aintroselect_@suff@(@type@ *v, npy_intp* tosort, npy_intp num,
+ npy_intp kth,
+ npy_intp * pivots,
+ npy_intp * npiv,
+ void *NOT_USED);
/**end repeat**/
-int introselect_string(npy_char *vec, npy_intp cnt, npy_intp kth, PyArrayObject *arr);
-int aintroselect_string(npy_char *vec, npy_intp *ind, npy_intp cnt, npy_intp kth, void *null);
+NPY_VISIBILITY_HIDDEN int introselect_string(npy_char *vec, npy_intp cnt,
+ npy_intp kth, PyArrayObject *arr);
+NPY_VISIBILITY_HIDDEN int aintroselect_string(npy_char *vec, npy_intp *ind,
+ npy_intp cnt, npy_intp kth,
+ void *null);
-int introselect_unicode(npy_ucs4 *vec, npy_intp cnt, npy_intp kth, PyArrayObject *arr);
-int aintroselect_unicode(npy_ucs4 *vec, npy_intp *ind, npy_intp cnt, npy_intp kth, void *null);
+NPY_VISIBILITY_HIDDEN int introselect_unicode(npy_ucs4 *vec, npy_intp cnt,
+ npy_intp kth, PyArrayObject *arr);
+NPY_VISIBILITY_HIDDEN int aintroselect_unicode(npy_ucs4 *vec, npy_intp *ind,
+ npy_intp cnt, npy_intp kth,
+ void *null);
-int npy_introselect(void *base, size_t num, size_t size, size_t kth, npy_comparator cmp);
+NPY_VISIBILITY_HIDDEN int npy_introselect(void *base, size_t num, size_t size,
+ size_t kth, npy_comparator cmp);
typedef struct {
enum NPY_TYPES typenum;
diff --git a/numpy/core/src/private/ufunc_override.h b/numpy/core/src/private/ufunc_override.h
index 380aef714..c47c46a66 100644
--- a/numpy/core/src/private/ufunc_override.h
+++ b/numpy/core/src/private/ufunc_override.h
@@ -3,6 +3,154 @@
#include <npy_config.h>
#include "numpy/arrayobject.h"
#include "common.h"
+#include <string.h>
+#include "numpy/ufuncobject.h"
+
+static void
+normalize___call___args(PyUFuncObject *ufunc, PyObject *args,
+ PyObject **normal_args, PyObject **normal_kwds,
+ int nin)
+{
+ /* ufunc.__call__(*args, **kwds) */
+ int nargs = PyTuple_GET_SIZE(args);
+ PyObject *obj;
+
+ *normal_args = PyTuple_GetSlice(args, 0, nin);
+
+ /* If we have more args than nin, they must be the output variables.*/
+ if (nargs > nin) {
+ if ((nargs - nin) == 1) {
+ obj = PyTuple_GET_ITEM(args, nargs - 1);
+ PyDict_SetItemString(*normal_kwds, "out", obj);
+ }
+ else {
+ obj = PyTuple_GetSlice(args, nin, nargs);
+ PyDict_SetItemString(*normal_kwds, "out", obj);
+ Py_DECREF(obj);
+ }
+ }
+}
+
+static void
+normalize_reduce_args(PyUFuncObject *ufunc, PyObject *args,
+ PyObject **normal_args, PyObject **normal_kwds)
+{
+ /* ufunc.reduce(a[, axis, dtype, out, keepdims]) */
+ int nargs = PyTuple_GET_SIZE(args);
+ int i;
+ PyObject *obj;
+
+ for (i = 0; i < nargs; i++) {
+ obj = PyTuple_GET_ITEM(args, i);
+ if (i == 0) {
+ *normal_args = PyTuple_GetSlice(args, 0, 1);
+ }
+ else if (i == 1) {
+ /* axis */
+ PyDict_SetItemString(*normal_kwds, "axis", obj);
+ }
+ else if (i == 2) {
+ /* dtype */
+ PyDict_SetItemString(*normal_kwds, "dtype", obj);
+ }
+ else if (i == 3) {
+ /* out */
+ PyDict_SetItemString(*normal_kwds, "out", obj);
+ }
+ else {
+ /* keepdims */
+ PyDict_SetItemString(*normal_kwds, "keepdims", obj);
+ }
+ }
+ return;
+}
+
+static void
+normalize_accumulate_args(PyUFuncObject *ufunc, PyObject *args,
+ PyObject **normal_args, PyObject **normal_kwds)
+{
+ /* ufunc.accumulate(a[, axis, dtype, out]) */
+ int nargs = PyTuple_GET_SIZE(args);
+ int i;
+ PyObject *obj;
+
+ for (i = 0; i < nargs; i++) {
+ obj = PyTuple_GET_ITEM(args, i);
+ if (i == 0) {
+ *normal_args = PyTuple_GetSlice(args, 0, 1);
+ }
+ else if (i == 1) {
+ /* axis */
+ PyDict_SetItemString(*normal_kwds, "axis", obj);
+ }
+ else if (i == 2) {
+ /* dtype */
+ PyDict_SetItemString(*normal_kwds, "dtype", obj);
+ }
+ else {
+ /* out */
+ PyDict_SetItemString(*normal_kwds, "out", obj);
+ }
+ }
+ return;
+}
+
+static void
+normalize_reduceat_args(PyUFuncObject *ufunc, PyObject *args,
+ PyObject **normal_args, PyObject **normal_kwds)
+{
+ /* ufunc.reduceat(a, indicies[, axis, dtype, out]) */
+ int i;
+ int nargs = PyTuple_GET_SIZE(args);
+ PyObject *obj;
+
+ for (i = 0; i < nargs; i++) {
+ obj = PyTuple_GET_ITEM(args, i);
+ if (i == 0) {
+ /* a and indicies */
+ *normal_args = PyTuple_GetSlice(args, 0, 2);
+ }
+ else if (i == 1) {
+ /* Handled above, when i == 0. */
+ continue;
+ }
+ else if (i == 2) {
+ /* axis */
+ PyDict_SetItemString(*normal_kwds, "axis", obj);
+ }
+ else if (i == 3) {
+ /* dtype */
+ PyDict_SetItemString(*normal_kwds, "dtype", obj);
+ }
+ else {
+ /* out */
+ PyDict_SetItemString(*normal_kwds, "out", obj);
+ }
+ }
+ return;
+}
+
+static void
+normalize_outer_args(PyUFuncObject *ufunc, PyObject *args,
+ PyObject **normal_args, PyObject **normal_kwds)
+{
+ /* ufunc.outer(A, B)
+ * This has no kwds so we don't need to do any kwd stuff.
+ */
+ *normal_args = PyTuple_GetSlice(args, 0, 2);
+ return;
+}
+
+static void
+normalize_at_args(PyUFuncObject *ufunc, PyObject *args,
+ PyObject **normal_args, PyObject **normal_kwds)
+{
+ /* ufunc.at(a, indices[, b]) */
+ int nargs = PyTuple_GET_SIZE(args);
+
+ *normal_args = PyTuple_GetSlice(args, 0, nargs);
+ return;
+}
/*
* Check a set of args for the `__numpy_ufunc__` method. If more than one of
@@ -16,8 +164,8 @@
* result of the operation, if any. If *result is NULL, there is no override.
*/
static int
-PyUFunc_CheckOverride(PyObject *ufunc, char *method,
- PyObject *args, PyObject *kwds,
+PyUFunc_CheckOverride(PyUFuncObject *ufunc, char *method,
+ PyObject *args, PyObject *kwds,
PyObject **result,
int nin)
{
@@ -35,23 +183,23 @@ PyUFunc_CheckOverride(PyObject *ufunc, char *method,
PyObject *normal_args = NULL; /* normal_* holds normalized arguments. */
PyObject *normal_kwds = NULL;
- PyObject *with_override[NPY_MAXARGS];
+ PyObject *with_override[NPY_MAXARGS];
/* Pos of each override in args */
int with_override_pos[NPY_MAXARGS];
- /*
+ /*
* Check inputs
*/
if (!PyTuple_Check(args)) {
- PyErr_SetString(PyExc_ValueError,
+ PyErr_SetString(PyExc_ValueError,
"Internal Numpy error: call to PyUFunc_CheckOverride "
"with non-tuple");
goto fail;
}
if (PyTuple_GET_SIZE(args) > NPY_MAXARGS) {
- PyErr_SetString(PyExc_ValueError,
+ PyErr_SetString(PyExc_ValueError,
"Internal Numpy error: too many arguments in call "
"to PyUFunc_CheckOverride");
goto fail;
@@ -59,7 +207,12 @@ PyUFunc_CheckOverride(PyObject *ufunc, char *method,
for (i = 0; i < nargs; ++i) {
obj = PyTuple_GET_ITEM(args, i);
- if (PyArray_CheckExact(obj) || PyArray_IsAnyScalar(obj)) {
+ /*
+ * TODO: could use PyArray_GetAttrString_SuppressException if it
+ * weren't private to multiarray.so
+ */
+ if (PyArray_CheckExact(obj) || PyArray_IsScalar(obj, Generic) ||
+ _is_basic_python_type(obj)) {
continue;
}
if (PyObject_HasAttrString(obj, "__numpy_ufunc__")) {
@@ -75,14 +228,15 @@ PyUFunc_CheckOverride(PyObject *ufunc, char *method,
return 0;
}
- /*
- * Normalize ufunc arguments.
- */
- normal_args = PyTuple_GetSlice(args, 0, nin);
- if (normal_args == NULL) {
+ method_name = PyUString_FromString(method);
+ if (method_name == NULL) {
goto fail;
}
+ /*
+ * Normalize ufunc arguments.
+ */
+
/* Build new kwds */
if (kwds && PyDict_CheckExact(kwds)) {
normal_kwds = PyDict_Copy(kwds);
@@ -94,21 +248,38 @@ PyUFunc_CheckOverride(PyObject *ufunc, char *method,
goto fail;
}
- /* If we have more args than nin, they must be the output variables.*/
- if (nargs > nin) {
- if ((nargs - nin) == 1) {
- obj = PyTuple_GET_ITEM(args, nargs - 1);
- PyDict_SetItemString(normal_kwds, "out", obj);
- }
- else {
- obj = PyTuple_GetSlice(args, nin, nargs);
- PyDict_SetItemString(normal_kwds, "out", obj);
- Py_DECREF(obj);
- }
+ /* decide what to do based on the method. */
+ /* ufunc.__call__ */
+ if (strcmp(method, "__call__") == 0) {
+ normalize___call___args(ufunc, args, &normal_args, &normal_kwds, nin);
}
- method_name = PyUString_FromString(method);
- if (method_name == NULL) {
+ /* ufunc.reduce */
+ else if (strcmp(method, "reduce") == 0) {
+ normalize_reduce_args(ufunc, args, &normal_args, &normal_kwds);
+ }
+
+ /* ufunc.accumulate */
+ else if (strcmp(method, "accumulate") == 0) {
+ normalize_accumulate_args(ufunc, args, &normal_args, &normal_kwds);
+ }
+
+ /* ufunc.reduceat */
+ else if (strcmp(method, "reduceat") == 0) {
+ normalize_reduceat_args(ufunc, args, &normal_args, &normal_kwds);
+ }
+
+ /* ufunc.outer */
+ else if (strcmp(method, "outer") == 0) {
+ normalize_outer_args(ufunc, args, &normal_args, &normal_kwds);
+ }
+
+ /* ufunc.at */
+ else if (strcmp(method, "at") == 0) {
+ normalize_at_args(ufunc, args, &normal_args, &normal_kwds);
+ }
+
+ if (normal_args == NULL) {
goto fail;
}
@@ -138,7 +309,7 @@ PyUFunc_CheckOverride(PyObject *ufunc, char *method,
for (j = i + 1; j < noa; j++) {
other_obj = with_override[j];
if (PyObject_Type(other_obj) != PyObject_Type(obj) &&
- PyObject_IsInstance(other_obj,
+ PyObject_IsInstance(other_obj,
PyObject_Type(override_obj))) {
override_obj = NULL;
break;
@@ -155,19 +326,19 @@ PyUFunc_CheckOverride(PyObject *ufunc, char *method,
/* Check if there is a method left to call */
if (!override_obj) {
/* No acceptable override found. */
- PyErr_SetString(PyExc_TypeError,
+ PyErr_SetString(PyExc_TypeError,
"__numpy_ufunc__ not implemented for this type.");
goto fail;
}
/* Call the override */
- numpy_ufunc = PyObject_GetAttrString(override_obj,
+ numpy_ufunc = PyObject_GetAttrString(override_obj,
"__numpy_ufunc__");
if (numpy_ufunc == NULL) {
goto fail;
}
- override_args = Py_BuildValue("OOiO", ufunc, method_name,
+ override_args = Py_BuildValue("OOiO", ufunc, method_name,
override_pos, normal_args);
if (override_args == NULL) {
Py_DECREF(numpy_ufunc);
@@ -175,7 +346,7 @@ PyUFunc_CheckOverride(PyObject *ufunc, char *method,
}
*result = PyObject_Call(numpy_ufunc, override_args, normal_kwds);
-
+
Py_DECREF(numpy_ufunc);
Py_DECREF(override_args);
@@ -206,5 +377,4 @@ fail:
Py_XDECREF(normal_kwds);
return 1;
}
-
#endif
diff --git a/numpy/core/src/umath/loops.c.src b/numpy/core/src/umath/loops.c.src
index 2eef4c94a..035a27fd2 100644
--- a/numpy/core/src/umath/loops.c.src
+++ b/numpy/core/src/umath/loops.c.src
@@ -5,7 +5,8 @@
#include "Python.h"
-#ifdef ENABLE_SEPARATE_COMPILATION
+#include "npy_config.h"
+#ifdef ENABLE_SEPARATE_COMPILATION
#define PY_ARRAY_UNIQUE_SYMBOL _npy_umathmodule_ARRAY_API
#define NO_IMPORT_ARRAY
#endif
@@ -51,6 +52,19 @@
&& (steps[0] == steps[2])\
&& (steps[0] == 0))
+/* binary loop input and output continous */
+#define IS_BINARY_CONT(tin, tout) (steps[0] == sizeof(tin) && \
+ steps[1] == sizeof(tin) && \
+ steps[2] == sizeof(tout))
+/* binary loop input and output continous with first scalar */
+#define IS_BINARY_CONT_S1(tin, tout) (steps[0] == 0 && \
+ steps[1] == sizeof(tin) && \
+ steps[2] == sizeof(tout))
+/* binary loop input and output continous with second scalar */
+#define IS_BINARY_CONT_S2(tin, tout) (steps[0] == sizeof(tin) && \
+ steps[1] == 0 && \
+ steps[2] == sizeof(tout))
+
#define OUTPUT_LOOP\
char *op1 = args[1];\
npy_intp os1 = steps[1];\
@@ -634,32 +648,6 @@ BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED
}
/**end repeat**/
-
-NPY_NO_EXPORT void
-BOOL_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
-{
- BINARY_LOOP {
- npy_bool in1 = *((npy_bool *)ip1) != 0;
- npy_bool in2 = *((npy_bool *)ip2) != 0;
- *((npy_bool *)op1)= (in1 && !in2) || (!in1 && in2);
- }
-}
-
-/**begin repeat
- * #kind = maximum, minimum#
- * #OP = >, <#
- **/
-NPY_NO_EXPORT void
-BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
-{
- BINARY_LOOP {
- npy_bool in1 = *((npy_bool *)ip1) != 0;
- npy_bool in2 = *((npy_bool *)ip2) != 0;
- *((npy_bool *)op1) = (in1 @OP@ in2) ? in1 : in2;
- }
-}
-/**end repeat**/
-
/**begin repeat
* #kind = absolute, logical_not#
* #OP = !=, ==#
@@ -802,13 +790,45 @@ NPY_NO_EXPORT void
* #OP = ==, !=, >, >=, <, <=, &&, ||#
*/
-NPY_NO_EXPORT void
+NPY_NO_EXPORT NPY_GCC_OPT_3 void
@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
- BINARY_LOOP {
- const @type@ in1 = *(@type@ *)ip1;
- const @type@ in2 = *(@type@ *)ip2;
- *((npy_bool *)op1) = in1 @OP@ in2;
+ /*
+ * gcc vectorization of this is not good (PR60575) but manual integer
+ * vectorization is too tedious to be worthwhile
+ */
+ if (IS_BINARY_CONT(@type@, npy_bool)) {
+ npy_intp i, n = dimensions[0];
+ @type@ * a = (@type@ *)args[0], * b = (@type@ *)args[1];
+ npy_bool * o = (npy_bool *)args[2];
+ for (i = 0; i < n; i++) {
+ o[i] = a[i] @OP@ b[i];
+ }
+ }
+ else if (IS_BINARY_CONT_S1(@type@, npy_bool)) {
+ npy_intp i, n = dimensions[0];
+ @type@ a = *(@type@ *)args[0];
+ @type@ * b = (@type@ *)args[1];
+ npy_bool * o = (npy_bool *)args[2];
+ for (i = 0; i < n; i++) {
+ o[i] = a @OP@ b[i];
+ }
+ }
+ else if (IS_BINARY_CONT_S2(@type@, npy_bool)) {
+ npy_intp i, n = dimensions[0];
+ @type@ * a = (@type@ *)args[0];
+ @type@ b = *(@type@*)args[1];
+ npy_bool * o = (npy_bool *)args[2];
+ for (i = 0; i < n; i++) {
+ o[i] = a[i] @OP@ b;
+ }
+ }
+ else {
+ BINARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ const @type@ in2 = *(@type@ *)ip2;
+ *((npy_bool *)op1) = in1 @OP@ in2;
+ }
}
}
@@ -1513,13 +1533,18 @@ NPY_NO_EXPORT void
/**begin repeat1
* #kind = isnan, isinf, isfinite, signbit#
* #func = npy_isnan, npy_isinf, npy_isfinite, npy_signbit#
+ * #isnan = 1, 0*3#
**/
NPY_NO_EXPORT void
@TYPE@_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
- UNARY_LOOP {
- const @type@ in1 = *(@type@ *)ip1;
- *((npy_bool *)op1) = @func@(in1) != 0;
+ char * margs[] = {args[0], args[0], args[1]};
+ npy_intp msteps[] = {steps[0], steps[0], steps[1]};
+ if (!@isnan@ || !run_binary_simd_not_equal_@TYPE@(margs, dimensions, msteps)) {
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((npy_bool *)op1) = @func@(in1) != 0;
+ }
}
}
/**end repeat1**/
@@ -1691,9 +1716,11 @@ NPY_NO_EXPORT void
NPY_NO_EXPORT void
@TYPE@_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
- UNARY_LOOP {
- const @type@ in1 = *(@type@ *)ip1;
- *((@type@ *)op1) = -in1;
+ if (!run_unary_simd_negative_@TYPE@(args, dimensions, steps)) {
+ UNARY_LOOP {
+ const @type@ in1 = *(@type@ *)ip1;
+ *((@type@ *)op1) = -in1;
+ }
}
}
@@ -1790,20 +1817,19 @@ NPY_NO_EXPORT void
HALF_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func))
{
if (IS_BINARY_REDUCE) {
+ char *iop1 = args[0];
+ float io1 = npy_half_to_float(*(npy_half *)iop1);
#if @PW@
- npy_half * iop1 = (npy_half *)args[0];
npy_intp n = dimensions[0];
- *iop1 @OP@= npy_float_to_half(pairwise_sum_HALF((npy_half *)args[1], n,
- steps[1] / (npy_intp)sizeof(npy_half)));
+ io1 @OP@= pairwise_sum_HALF((npy_half *)args[1], n,
+ steps[1] / (npy_intp)sizeof(npy_half));
#else
- char *iop1 = args[0];
- float io1 = npy_half_to_float(*(npy_half *)iop1);
BINARY_REDUCE_LOOP_INNER {
io1 @OP@= npy_half_to_float(*(npy_half *)ip2);
}
- *((npy_half *)iop1) = npy_float_to_half(io1);
#endif
+ *((npy_half *)iop1) = npy_float_to_half(io1);
}
else {
BINARY_LOOP {
@@ -2132,7 +2158,7 @@ pairwise_sum_@TYPE@(@ftype@ *rr, @ftype@ * ri, @ftype@ * a, npy_uintp n,
}
else if (n <= PW_BLOCKSIZE) {
npy_intp i;
- @ftype@ r[8], res;
+ @ftype@ r[8];
/*
* sum a block with 8 accumulators
@@ -2510,18 +2536,72 @@ NPY_NO_EXPORT void
/**begin repeat
* #kind = equal, not_equal, greater, greater_equal, less, less_equal#
* #OP = EQ, NE, GT, GE, LT, LE#
+ * #identity = NPY_TRUE, NPY_FALSE, -1*4#
*/
NPY_NO_EXPORT void
OBJECT_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func)) {
BINARY_LOOP {
+ int ret;
+ PyObject *ret_obj;
PyObject *in1 = *(PyObject **)ip1;
PyObject *in2 = *(PyObject **)ip2;
- int ret = PyObject_RichCompareBool(
- in1 ? in1 : Py_None,
- in2 ? in2 : Py_None, Py_@OP@);
+
+ in1 = in1 ? in1 : Py_None;
+ in2 = in2 ? in2 : Py_None;
+
+ /*
+ * Do not use RichCompareBool because it includes an identity check
+ * (for == and !=).
+ * This is wrong for elementwise behaviour, since it means
+ * that NaN can be equal to NaN and an array is equal to itself.
+ */
+ ret_obj = PyObject_RichCompare(in1, in2, Py_@OP@);
+ if (ret_obj == NULL) {
+#if @identity@ != -1
+ if (in1 == in2) {
+ PyErr_Clear();
+ if (DEPRECATE("numpy @kind@ will not check object identity "
+ "in the future. The comparison error will "
+ "be raised.") < 0) {
+ return;
+ }
+ *((npy_bool *)op1) = @identity@;
+ continue;
+ }
+#endif
+ return;
+ }
+ ret = PyObject_IsTrue(ret_obj);
+ Py_DECREF(ret_obj);
if (ret == -1) {
+#if @identity@ != -1
+ if (in1 == in2) {
+ PyErr_Clear();
+ if (DEPRECATE("numpy @kind@ will not check object identity "
+ "in the future. The error trying to get the "
+ "boolean value of the comparison result will "
+ "be raised.") < 0) {
+ return;
+ }
+ *((npy_bool *)op1) = @identity@;
+ continue;
+ }
+#endif
return;
}
+#if @identity@ != -1
+ if ((in1 == in2) && ((npy_bool)ret != @identity@)) {
+ if (DEPRECATE_FUTUREWARNING(
+ "numpy @kind@ will not check object identity "
+ "in the future. The comparison did not return the "
+ "same result as suggested by the identity (`is`)) "
+ "and will change.") < 0) {
+ return;
+ }
+ *((npy_bool *)op1) = @identity@;
+ continue;
+ }
+#endif
*((npy_bool *)op1) = (npy_bool)ret;
}
}
@@ -2537,9 +2617,12 @@ OBJECT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED
PyObject **out = (PyObject **)op1;
int v;
PyObject *ret;
- PyObject_Cmp(in1 ? in1 : Py_None, zero, &v);
+ if (PyObject_Cmp(in1 ? in1 : Py_None, zero, &v) == -1) {
+ return;
+ }
ret = PyLong_FromLong(v);
if (PyErr_Occurred()) {
+ Py_DECREF(zero);
return;
}
Py_XDECREF(*out);
@@ -2554,6 +2637,7 @@ OBJECT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED
PyObject *ret = PyInt_FromLong(
PyObject_Compare(in1 ? in1 : Py_None, zero));
if (PyErr_Occurred()) {
+ Py_DECREF(zero);
return;
}
Py_XDECREF(*out);
diff --git a/numpy/core/src/umath/loops.h b/numpy/core/src/umath/loops.h
deleted file mode 100644
index 62890f370..000000000
--- a/numpy/core/src/umath/loops.h
+++ /dev/null
@@ -1,2728 +0,0 @@
-
-/*
- *****************************************************************************
- ** This file was autogenerated from a template DO NOT EDIT!!!! **
- ** Changes should be made to the original source (.src) file **
- *****************************************************************************
- */
-
-#line 1
-/* -*- c -*- */
-/*
- * vim:syntax=c
- */
-
-/*
- *****************************************************************************
- ** IMPORTANT NOTE for loops.h.src -> loops.h **
- *****************************************************************************
- * The template file loops.h.src is not automatically converted into
- * loops.h by the build system. If you edit this file, you must manually
- * do the conversion using numpy/distutils/conv_template.py from the
- * command line as follows:
- *
- * $ cd <NumPy source root directory>
- * $ python numpy/distutils/conv_template.py numpy/core/src/umath/loops.h.src
- * $
- */
-
-#ifndef _NPY_UMATH_LOOPS_H_
-#define _NPY_UMATH_LOOPS_H_
-
-#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
-#define BOOL_fmax BOOL_maximum
-#define BOOL_fmin BOOL_minimum
-
-/*
- *****************************************************************************
- ** BOOLEAN LOOPS **
- *****************************************************************************
- */
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 46
-
-NPY_NO_EXPORT void
-BOOL_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 55
-NPY_NO_EXPORT void
-BOOL_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 55
-NPY_NO_EXPORT void
-BOOL_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 63
-NPY_NO_EXPORT void
-BOOL_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 63
-NPY_NO_EXPORT void
-BOOL_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-BOOL__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-/*
- *****************************************************************************
- ** INTEGER LOOPS
- *****************************************************************************
- */
-
-#line 79
-
-#line 85
-
-#define BYTE_floor_divide BYTE_divide
-#define BYTE_fmax BYTE_maximum
-#define BYTE_fmin BYTE_minimum
-
-NPY_NO_EXPORT void
-BYTE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-BYTE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-BYTE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-BYTE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-BYTE_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-BYTE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-BYTE_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 117
-NPY_NO_EXPORT void
-BYTE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-BYTE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-BYTE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-BYTE_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-BYTE_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-BYTE_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-BYTE_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-BYTE_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-#line 127
-NPY_NO_EXPORT void
-BYTE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-BYTE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-BYTE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-BYTE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-BYTE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-BYTE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-BYTE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-BYTE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-BYTE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-BYTE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-BYTE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-BYTE_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-BYTE_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-BYTE_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 85
-
-#define UBYTE_floor_divide UBYTE_divide
-#define UBYTE_fmax UBYTE_maximum
-#define UBYTE_fmin UBYTE_minimum
-
-NPY_NO_EXPORT void
-UBYTE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-UBYTE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-UBYTE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-UBYTE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UBYTE_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UBYTE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UBYTE_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 117
-NPY_NO_EXPORT void
-UBYTE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UBYTE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UBYTE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UBYTE_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UBYTE_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UBYTE_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UBYTE_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UBYTE_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-#line 127
-NPY_NO_EXPORT void
-UBYTE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UBYTE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UBYTE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UBYTE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UBYTE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UBYTE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UBYTE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UBYTE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-UBYTE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-UBYTE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-UBYTE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-UBYTE_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UBYTE_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UBYTE_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-NPY_NO_EXPORT void
-UBYTE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-BYTE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UBYTE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-BYTE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-BYTE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UBYTE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-BYTE_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UBYTE_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 79
-
-#line 85
-
-#define SHORT_floor_divide SHORT_divide
-#define SHORT_fmax SHORT_maximum
-#define SHORT_fmin SHORT_minimum
-
-NPY_NO_EXPORT void
-SHORT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-SHORT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-SHORT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-SHORT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-SHORT_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-SHORT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-SHORT_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 117
-NPY_NO_EXPORT void
-SHORT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-SHORT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-SHORT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-SHORT_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-SHORT_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-SHORT_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-SHORT_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-SHORT_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-#line 127
-NPY_NO_EXPORT void
-SHORT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-SHORT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-SHORT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-SHORT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-SHORT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-SHORT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-SHORT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-SHORT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-SHORT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-SHORT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-SHORT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-SHORT_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-SHORT_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-SHORT_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 85
-
-#define USHORT_floor_divide USHORT_divide
-#define USHORT_fmax USHORT_maximum
-#define USHORT_fmin USHORT_minimum
-
-NPY_NO_EXPORT void
-USHORT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-USHORT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-USHORT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-USHORT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-USHORT_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-USHORT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-USHORT_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 117
-NPY_NO_EXPORT void
-USHORT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-USHORT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-USHORT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-USHORT_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-USHORT_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-USHORT_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-USHORT_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-USHORT_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-#line 127
-NPY_NO_EXPORT void
-USHORT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-USHORT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-USHORT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-USHORT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-USHORT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-USHORT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-USHORT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-USHORT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-USHORT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-USHORT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-USHORT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-USHORT_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-USHORT_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-USHORT_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-NPY_NO_EXPORT void
-USHORT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-SHORT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-USHORT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-SHORT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-SHORT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-USHORT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-SHORT_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-USHORT_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 79
-
-#line 85
-
-#define INT_floor_divide INT_divide
-#define INT_fmax INT_maximum
-#define INT_fmin INT_minimum
-
-NPY_NO_EXPORT void
-INT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-INT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-INT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-INT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-INT_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-INT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-INT_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 117
-NPY_NO_EXPORT void
-INT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-INT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-INT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-INT_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-INT_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-INT_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-INT_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-INT_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-#line 127
-NPY_NO_EXPORT void
-INT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-INT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-INT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-INT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-INT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-INT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-INT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-INT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-INT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-INT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-INT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-INT_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-INT_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-INT_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 85
-
-#define UINT_floor_divide UINT_divide
-#define UINT_fmax UINT_maximum
-#define UINT_fmin UINT_minimum
-
-NPY_NO_EXPORT void
-UINT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-UINT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-UINT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-UINT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UINT_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UINT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UINT_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 117
-NPY_NO_EXPORT void
-UINT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UINT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UINT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UINT_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UINT_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UINT_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UINT_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-UINT_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-#line 127
-NPY_NO_EXPORT void
-UINT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UINT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UINT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UINT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UINT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UINT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UINT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-UINT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-UINT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-UINT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-UINT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-UINT_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UINT_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UINT_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-NPY_NO_EXPORT void
-UINT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-INT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UINT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-INT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-INT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UINT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-INT_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-UINT_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 79
-
-#line 85
-
-#define LONG_floor_divide LONG_divide
-#define LONG_fmax LONG_maximum
-#define LONG_fmin LONG_minimum
-
-NPY_NO_EXPORT void
-LONG__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-LONG_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-LONG_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-LONG_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONG_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONG_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONG_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 117
-NPY_NO_EXPORT void
-LONG_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONG_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONG_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONG_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONG_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONG_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONG_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONG_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-#line 127
-NPY_NO_EXPORT void
-LONG_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONG_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONG_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONG_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONG_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONG_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONG_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONG_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-LONG_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-LONG_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-LONG_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-LONG_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONG_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONG_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 85
-
-#define ULONG_floor_divide ULONG_divide
-#define ULONG_fmax ULONG_maximum
-#define ULONG_fmin ULONG_minimum
-
-NPY_NO_EXPORT void
-ULONG__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-ULONG_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-ULONG_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-ULONG_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONG_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONG_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONG_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 117
-NPY_NO_EXPORT void
-ULONG_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONG_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONG_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONG_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONG_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONG_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONG_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONG_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-#line 127
-NPY_NO_EXPORT void
-ULONG_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONG_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONG_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONG_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONG_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONG_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONG_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONG_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-ULONG_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-ULONG_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-ULONG_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-ULONG_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONG_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONG_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-NPY_NO_EXPORT void
-ULONG_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONG_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONG_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONG_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONG_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONG_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONG_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONG_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 79
-
-#line 85
-
-#define LONGLONG_floor_divide LONGLONG_divide
-#define LONGLONG_fmax LONGLONG_maximum
-#define LONGLONG_fmin LONGLONG_minimum
-
-NPY_NO_EXPORT void
-LONGLONG__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-LONGLONG_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-LONGLONG_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-LONGLONG_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGLONG_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGLONG_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGLONG_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 117
-NPY_NO_EXPORT void
-LONGLONG_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONGLONG_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONGLONG_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONGLONG_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONGLONG_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONGLONG_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONGLONG_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-LONGLONG_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-#line 127
-NPY_NO_EXPORT void
-LONGLONG_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONGLONG_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONGLONG_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONGLONG_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONGLONG_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONGLONG_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONGLONG_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-LONGLONG_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-LONGLONG_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-LONGLONG_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-LONGLONG_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-LONGLONG_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGLONG_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGLONG_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 85
-
-#define ULONGLONG_floor_divide ULONGLONG_divide
-#define ULONGLONG_fmax ULONGLONG_maximum
-#define ULONGLONG_fmin ULONGLONG_minimum
-
-NPY_NO_EXPORT void
-ULONGLONG__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-ULONGLONG_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-ULONGLONG_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-ULONGLONG_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONGLONG_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONGLONG_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONGLONG_invert(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 117
-NPY_NO_EXPORT void
-ULONGLONG_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONGLONG_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONGLONG_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONGLONG_bitwise_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONGLONG_bitwise_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONGLONG_bitwise_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONGLONG_left_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 117
-NPY_NO_EXPORT void
-ULONGLONG_right_shift(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-#line 127
-NPY_NO_EXPORT void
-ULONGLONG_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONGLONG_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONGLONG_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONGLONG_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONGLONG_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONGLONG_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONGLONG_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 127
-NPY_NO_EXPORT void
-ULONGLONG_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-ULONGLONG_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-ULONGLONG_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 138
-NPY_NO_EXPORT void
-ULONGLONG_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-ULONGLONG_true_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONGLONG_power(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONGLONG_fmod(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-NPY_NO_EXPORT void
-ULONGLONG_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGLONG_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONGLONG_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGLONG_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGLONG_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONGLONG_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGLONG_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-ULONGLONG_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-/*
- *****************************************************************************
- ** FLOAT LOOPS **
- *****************************************************************************
- */
-
-#line 187
-NPY_NO_EXPORT void
-FLOAT_sqrt(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 187
-NPY_NO_EXPORT void
-DOUBLE_sqrt(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 197
-
-
-#line 204
-NPY_NO_EXPORT void
-HALF_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-HALF_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-HALF_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-HALF_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 213
-NPY_NO_EXPORT void
-HALF_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-HALF_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-HALF_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-HALF_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-HALF_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-HALF_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-HALF_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-HALF_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-HALF_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-HALF_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-HALF_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-HALF_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-HALF_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-HALF_signbit(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-HALF_copysign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-HALF_nextafter(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-HALF_spacing(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 235
-NPY_NO_EXPORT void
-HALF_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 235
-NPY_NO_EXPORT void
-HALF_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 243
-NPY_NO_EXPORT void
-HALF_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 243
-NPY_NO_EXPORT void
-HALF_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-HALF_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-HALF_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-HALF_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-HALF_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-
-NPY_NO_EXPORT void
-HALF__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-HALF_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-HALF_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-HALF_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-HALF_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-HALF_modf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#ifdef HAVE_FREXPF
-NPY_NO_EXPORT void
-HALF_frexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#endif
-
-#ifdef HAVE_LDEXPF
-NPY_NO_EXPORT void
-HALF_ldexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-NPY_NO_EXPORT void
-HALF_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#endif
-
-#define HALF_true_divide HALF_divide
-
-
-#line 197
-
-
-#line 204
-NPY_NO_EXPORT void
-FLOAT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-FLOAT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-FLOAT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-FLOAT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 213
-NPY_NO_EXPORT void
-FLOAT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-FLOAT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-FLOAT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-FLOAT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-FLOAT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-FLOAT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-FLOAT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-FLOAT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-FLOAT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-FLOAT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-FLOAT_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-FLOAT_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-FLOAT_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-FLOAT_signbit(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-FLOAT_copysign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-FLOAT_nextafter(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-FLOAT_spacing(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 235
-NPY_NO_EXPORT void
-FLOAT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 235
-NPY_NO_EXPORT void
-FLOAT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 243
-NPY_NO_EXPORT void
-FLOAT_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 243
-NPY_NO_EXPORT void
-FLOAT_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-FLOAT_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-FLOAT_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-FLOAT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-FLOAT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-
-NPY_NO_EXPORT void
-FLOAT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-FLOAT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-FLOAT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-FLOAT_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-FLOAT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-FLOAT_modf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#ifdef HAVE_FREXPF
-NPY_NO_EXPORT void
-FLOAT_frexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#endif
-
-#ifdef HAVE_LDEXPF
-NPY_NO_EXPORT void
-FLOAT_ldexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-NPY_NO_EXPORT void
-FLOAT_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#endif
-
-#define FLOAT_true_divide FLOAT_divide
-
-
-#line 197
-
-
-#line 204
-NPY_NO_EXPORT void
-DOUBLE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-DOUBLE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-DOUBLE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-DOUBLE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 213
-NPY_NO_EXPORT void
-DOUBLE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-DOUBLE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-DOUBLE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-DOUBLE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-DOUBLE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-DOUBLE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-DOUBLE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-DOUBLE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-DOUBLE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-DOUBLE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-DOUBLE_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-DOUBLE_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-DOUBLE_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-DOUBLE_signbit(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-DOUBLE_copysign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-DOUBLE_nextafter(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-DOUBLE_spacing(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 235
-NPY_NO_EXPORT void
-DOUBLE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 235
-NPY_NO_EXPORT void
-DOUBLE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 243
-NPY_NO_EXPORT void
-DOUBLE_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 243
-NPY_NO_EXPORT void
-DOUBLE_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-DOUBLE_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-DOUBLE_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-DOUBLE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-DOUBLE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-
-NPY_NO_EXPORT void
-DOUBLE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-DOUBLE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-DOUBLE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-DOUBLE_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-DOUBLE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-DOUBLE_modf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#ifdef HAVE_FREXP
-NPY_NO_EXPORT void
-DOUBLE_frexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#endif
-
-#ifdef HAVE_LDEXP
-NPY_NO_EXPORT void
-DOUBLE_ldexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-NPY_NO_EXPORT void
-DOUBLE_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#endif
-
-#define DOUBLE_true_divide DOUBLE_divide
-
-
-#line 197
-
-
-#line 204
-NPY_NO_EXPORT void
-LONGDOUBLE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-LONGDOUBLE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-LONGDOUBLE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 204
-NPY_NO_EXPORT void
-LONGDOUBLE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 213
-NPY_NO_EXPORT void
-LONGDOUBLE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-LONGDOUBLE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-LONGDOUBLE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-LONGDOUBLE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-LONGDOUBLE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-LONGDOUBLE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-LONGDOUBLE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 213
-NPY_NO_EXPORT void
-LONGDOUBLE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-LONGDOUBLE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGDOUBLE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-LONGDOUBLE_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-LONGDOUBLE_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-LONGDOUBLE_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-LONGDOUBLE_signbit(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-LONGDOUBLE_copysign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-LONGDOUBLE_nextafter(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 227
-NPY_NO_EXPORT void
-LONGDOUBLE_spacing(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 235
-NPY_NO_EXPORT void
-LONGDOUBLE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 235
-NPY_NO_EXPORT void
-LONGDOUBLE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 243
-NPY_NO_EXPORT void
-LONGDOUBLE_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 243
-NPY_NO_EXPORT void
-LONGDOUBLE_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-LONGDOUBLE_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGDOUBLE_remainder(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGDOUBLE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-LONGDOUBLE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-
-NPY_NO_EXPORT void
-LONGDOUBLE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-LONGDOUBLE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGDOUBLE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-LONGDOUBLE_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-LONGDOUBLE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-LONGDOUBLE_modf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#ifdef HAVE_FREXPL
-NPY_NO_EXPORT void
-LONGDOUBLE_frexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#endif
-
-#ifdef HAVE_LDEXPL
-NPY_NO_EXPORT void
-LONGDOUBLE_ldexp(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-NPY_NO_EXPORT void
-LONGDOUBLE_ldexp_long(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#endif
-
-#define LONGDOUBLE_true_divide LONGDOUBLE_divide
-
-
-
-
-/*
- *****************************************************************************
- ** COMPLEX LOOPS **
- *****************************************************************************
- */
-
-#define CGE(xr,xi,yr,yi) (xr > yr || (xr == yr && xi >= yi));
-#define CLE(xr,xi,yr,yi) (xr < yr || (xr == yr && xi <= yi));
-#define CGT(xr,xi,yr,yi) (xr > yr || (xr == yr && xi > yi));
-#define CLT(xr,xi,yr,yi) (xr < yr || (xr == yr && xi < yi));
-#define CEQ(xr,xi,yr,yi) (xr == yr && xi == yi);
-#define CNE(xr,xi,yr,yi) (xr != yr || xi != yi);
-
-#line 316
-
-#line 322
-NPY_NO_EXPORT void
-CFLOAT_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 322
-NPY_NO_EXPORT void
-CFLOAT_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-NPY_NO_EXPORT void
-CFLOAT_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CFLOAT_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CFLOAT_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CFLOAT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CFLOAT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CFLOAT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CFLOAT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CFLOAT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CFLOAT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 349
-NPY_NO_EXPORT void
-CFLOAT_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 349
-NPY_NO_EXPORT void
-CFLOAT_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-CFLOAT_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CFLOAT_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 363
-NPY_NO_EXPORT void
-CFLOAT_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 363
-NPY_NO_EXPORT void
-CFLOAT_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 363
-NPY_NO_EXPORT void
-CFLOAT_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-CFLOAT_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-CFLOAT_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-CFLOAT__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-CFLOAT_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CFLOAT_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CFLOAT__arg(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CFLOAT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 392
-NPY_NO_EXPORT void
-CFLOAT_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 392
-NPY_NO_EXPORT void
-CFLOAT_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 400
-NPY_NO_EXPORT void
-CFLOAT_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 400
-NPY_NO_EXPORT void
-CFLOAT_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#define CFLOAT_true_divide CFLOAT_divide
-
-
-#line 316
-
-#line 322
-NPY_NO_EXPORT void
-CDOUBLE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 322
-NPY_NO_EXPORT void
-CDOUBLE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-NPY_NO_EXPORT void
-CDOUBLE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CDOUBLE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CDOUBLE_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CDOUBLE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CDOUBLE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CDOUBLE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CDOUBLE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CDOUBLE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CDOUBLE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 349
-NPY_NO_EXPORT void
-CDOUBLE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 349
-NPY_NO_EXPORT void
-CDOUBLE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-CDOUBLE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CDOUBLE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 363
-NPY_NO_EXPORT void
-CDOUBLE_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 363
-NPY_NO_EXPORT void
-CDOUBLE_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 363
-NPY_NO_EXPORT void
-CDOUBLE_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-CDOUBLE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-CDOUBLE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-CDOUBLE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-CDOUBLE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CDOUBLE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CDOUBLE__arg(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CDOUBLE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 392
-NPY_NO_EXPORT void
-CDOUBLE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 392
-NPY_NO_EXPORT void
-CDOUBLE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 400
-NPY_NO_EXPORT void
-CDOUBLE_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 400
-NPY_NO_EXPORT void
-CDOUBLE_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#define CDOUBLE_true_divide CDOUBLE_divide
-
-
-#line 316
-
-#line 322
-NPY_NO_EXPORT void
-CLONGDOUBLE_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 322
-NPY_NO_EXPORT void
-CLONGDOUBLE_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-NPY_NO_EXPORT void
-CLONGDOUBLE_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CLONGDOUBLE_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CLONGDOUBLE_floor_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CLONGDOUBLE_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CLONGDOUBLE_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CLONGDOUBLE_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CLONGDOUBLE_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CLONGDOUBLE_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 340
-NPY_NO_EXPORT void
-CLONGDOUBLE_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 349
-NPY_NO_EXPORT void
-CLONGDOUBLE_logical_and(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 349
-NPY_NO_EXPORT void
-CLONGDOUBLE_logical_or(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-CLONGDOUBLE_logical_xor(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CLONGDOUBLE_logical_not(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-#line 363
-NPY_NO_EXPORT void
-CLONGDOUBLE_isnan(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 363
-NPY_NO_EXPORT void
-CLONGDOUBLE_isinf(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 363
-NPY_NO_EXPORT void
-CLONGDOUBLE_isfinite(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-CLONGDOUBLE_square(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-CLONGDOUBLE_reciprocal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-CLONGDOUBLE__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-CLONGDOUBLE_conjugate(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CLONGDOUBLE_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CLONGDOUBLE__arg(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-CLONGDOUBLE_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 392
-NPY_NO_EXPORT void
-CLONGDOUBLE_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 392
-NPY_NO_EXPORT void
-CLONGDOUBLE_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 400
-NPY_NO_EXPORT void
-CLONGDOUBLE_fmax(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 400
-NPY_NO_EXPORT void
-CLONGDOUBLE_fmin(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#define CLONGDOUBLE_true_divide CLONGDOUBLE_divide
-
-
-
-#undef CGE
-#undef CLE
-#undef CGT
-#undef CLT
-#undef CEQ
-#undef CNE
-
-/*
- *****************************************************************************
- ** DATETIME LOOPS **
- *****************************************************************************
- */
-
-NPY_NO_EXPORT void
-TIMEDELTA_negative(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-TIMEDELTA_absolute(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-TIMEDELTA_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 433
-
-NPY_NO_EXPORT void
-DATETIME__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-#line 441
-NPY_NO_EXPORT void
-DATETIME_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 441
-NPY_NO_EXPORT void
-DATETIME_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 441
-NPY_NO_EXPORT void
-DATETIME_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 441
-NPY_NO_EXPORT void
-DATETIME_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 441
-NPY_NO_EXPORT void
-DATETIME_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 441
-NPY_NO_EXPORT void
-DATETIME_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 449
-NPY_NO_EXPORT void
-DATETIME_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 449
-NPY_NO_EXPORT void
-DATETIME_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-#line 433
-
-NPY_NO_EXPORT void
-TIMEDELTA__ones_like(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-#line 441
-NPY_NO_EXPORT void
-TIMEDELTA_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 441
-NPY_NO_EXPORT void
-TIMEDELTA_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 441
-NPY_NO_EXPORT void
-TIMEDELTA_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 441
-NPY_NO_EXPORT void
-TIMEDELTA_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 441
-NPY_NO_EXPORT void
-TIMEDELTA_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 441
-NPY_NO_EXPORT void
-TIMEDELTA_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-#line 449
-NPY_NO_EXPORT void
-TIMEDELTA_maximum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 449
-NPY_NO_EXPORT void
-TIMEDELTA_minimum(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-
-
-NPY_NO_EXPORT void
-DATETIME_Mm_M_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(data));
-
-NPY_NO_EXPORT void
-DATETIME_mM_M_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-TIMEDELTA_mm_m_add(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-DATETIME_Mm_M_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-DATETIME_MM_m_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-TIMEDELTA_mm_m_subtract(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-TIMEDELTA_mq_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-TIMEDELTA_qm_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-TIMEDELTA_md_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-TIMEDELTA_dm_m_multiply(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-TIMEDELTA_mq_m_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-TIMEDELTA_md_m_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-NPY_NO_EXPORT void
-TIMEDELTA_mm_d_divide(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-/* Special case equivalents to above functions */
-
-#define TIMEDELTA_mq_m_true_divide TIMEDELTA_mq_m_divide
-#define TIMEDELTA_md_m_true_divide TIMEDELTA_md_m_divide
-#define TIMEDELTA_mm_d_true_divide TIMEDELTA_mm_d_divide
-#define TIMEDELTA_mq_m_floor_divide TIMEDELTA_mq_m_divide
-#define TIMEDELTA_md_m_floor_divide TIMEDELTA_md_m_divide
-/* #define TIMEDELTA_mm_d_floor_divide TIMEDELTA_mm_d_divide */
-#define TIMEDELTA_fmin TIMEDELTA_minimum
-#define TIMEDELTA_fmax TIMEDELTA_maximum
-#define DATETIME_fmin DATETIME_minimum
-#define DATETIME_fmax DATETIME_maximum
-
-/*
- *****************************************************************************
- ** OBJECT LOOPS **
- *****************************************************************************
- */
-
-#line 517
-NPY_NO_EXPORT void
-OBJECT_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 517
-NPY_NO_EXPORT void
-OBJECT_not_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 517
-NPY_NO_EXPORT void
-OBJECT_greater(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 517
-NPY_NO_EXPORT void
-OBJECT_greater_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 517
-NPY_NO_EXPORT void
-OBJECT_less(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-#line 517
-NPY_NO_EXPORT void
-OBJECT_less_equal(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-
-NPY_NO_EXPORT void
-OBJECT_sign(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-
-/*
- *****************************************************************************
- ** END LOOPS **
- *****************************************************************************
- */
-
-#endif
diff --git a/numpy/core/src/umath/loops.h.src b/numpy/core/src/umath/loops.h.src
index a8a58c5de..fdc9230de 100644
--- a/numpy/core/src/umath/loops.h.src
+++ b/numpy/core/src/umath/loops.h.src
@@ -3,20 +3,6 @@
* vim:syntax=c
*/
-/*
- *****************************************************************************
- ** IMPORTANT NOTE for loops.h.src -> loops.h **
- *****************************************************************************
- * The template file loops.h.src is not automatically converted into
- * loops.h by the build system. If you edit this file, you must manually
- * do the conversion using numpy/distutils/conv_template.py from the
- * command line as follows:
- *
- * $ cd <NumPy source root directory>
- * $ python numpy/distutils/conv_template.py numpy/core/src/umath/loops.h.src
- * $
- */
-
#ifndef _NPY_UMATH_LOOPS_H_
#define _NPY_UMATH_LOOPS_H_
@@ -25,12 +11,16 @@
#define BOOL_add BOOL_logical_or
#define BOOL_bitwise_and BOOL_logical_and
#define BOOL_bitwise_or BOOL_logical_or
+#define BOOL_logical_xor BOOL_not_equal
#define BOOL_bitwise_xor BOOL_logical_xor
#define BOOL_multiply BOOL_logical_and
#define BOOL_subtract BOOL_logical_xor
+#define BOOL_maximum BOOL_logical_or
+#define BOOL_minimum BOOL_logical_and
#define BOOL_fmax BOOL_maximum
#define BOOL_fmin BOOL_minimum
+
/*
*****************************************************************************
** BOOLEAN LOOPS **
@@ -39,26 +29,7 @@
/**begin repeat
* #kind = equal, not_equal, greater, greater_equal, less, less_equal,
- * logical_and, logical_or, logical_xor, add, bitwise_or,
- * bitwise_xor, bitwise_and, fmax, fmin, invert, multiply, negative,
- * subtract#
- **/
-
-NPY_NO_EXPORT void
-BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-/**end repeat**/
-
-/**begin repeat
- * #kind = maximum, minimum#
- * #OP = >, <#
- **/
-NPY_NO_EXPORT void
-BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
-/**end repeat**/
-
-/**begin repeat
- * #kind = absolute, logical_not#
- * #OP = !=, ==#
+ * logical_and, logical_or, absolute, logical_not#
**/
NPY_NO_EXPORT void
BOOL_@kind@(char **args, npy_intp *dimensions, npy_intp *steps, void *NPY_UNUSED(func));
diff --git a/numpy/core/src/umath/simd.inc.src b/numpy/core/src/umath/simd.inc.src
index 3a7c4f75b..7944d5f47 100644
--- a/numpy/core/src/umath/simd.inc.src
+++ b/numpy/core/src/umath/simd.inc.src
@@ -84,34 +84,6 @@
#define LOOP_BLOCKED_END\
for (; i < n; i++)
-/* fanout two bits to two bytes */
-static const npy_int16 fanout_2[] = {
- 0x0000,
- 0x0001,
- 0x0100,
- 0x0101,
-};
-
-/* fanout four bits to four bytes */
-static const npy_int32 fanout_4[] = {
- 0x00000000,
- 0x00000001,
- 0x00000100,
- 0x00000101,
- 0x00010000,
- 0x00010001,
- 0x00010100,
- 0x00010101,
- 0x01000000,
- 0x01000001,
- 0x01000100,
- 0x01000101,
- 0x01010000,
- 0x01010001,
- 0x01010100,
- 0x01010101
-};
-
/*
* Dispatcher functions
@@ -133,10 +105,10 @@ static const npy_int32 fanout_4[] = {
*/
/**begin repeat1
- * #func = sqrt, absolute, minimum, maximum#
- * #check = IS_BLOCKABLE_UNARY, IS_BLOCKABLE_UNARY, IS_BLOCKABLE_REDUCE, IS_BLOCKABLE_REDUCE#
- * #name = unary, unary, unary_reduce, unary_reduce#
- * #minmax = 0, 0, 1, 1#
+ * #func = sqrt, absolute, negative, minimum, maximum#
+ * #check = IS_BLOCKABLE_UNARY*3, IS_BLOCKABLE_REDUCE*2 #
+ * #name = unary*3, unary_reduce*2#
+ * #minmax = 0*3, 1*2#
*/
#if @vector@ && defined NPY_HAVE_SSE2_INTRINSICS
@@ -274,10 +246,15 @@ run_binary_simd_@kind@_@TYPE@(char **args, npy_intp *dimensions, npy_intp *steps
* # kind = logical_or, logical_and#
*/
+#if defined NPY_HAVE_SSE2_INTRINSICS
static void
sse2_binary_@kind@_BOOL(npy_bool * op, npy_bool * ip1, npy_bool * ip2,
npy_intp n);
+static void
+sse2_reduce_@kind@_BOOL(npy_bool * op, npy_bool * ip, npy_intp n);
+#endif
+
static NPY_INLINE int
run_binary_simd_@kind@_BOOL(char **args, npy_intp *dimensions, npy_intp *steps)
{
@@ -292,9 +269,6 @@ run_binary_simd_@kind@_BOOL(char **args, npy_intp *dimensions, npy_intp *steps)
}
-static void
-sse2_reduce_@kind@_BOOL(npy_bool * op, npy_bool * ip, npy_intp n);
-
static NPY_INLINE int
run_reduce_simd_@kind@_BOOL(char **args, npy_intp *dimensions, npy_intp *steps)
{
@@ -314,8 +288,10 @@ run_reduce_simd_@kind@_BOOL(char **args, npy_intp *dimensions, npy_intp *steps)
* # kind = absolute, logical_not#
*/
+#if defined NPY_HAVE_SSE2_INTRINSICS
static void
sse2_@kind@_BOOL(npy_bool *, npy_bool *, const npy_intp n);
+#endif
static NPY_INLINE int
run_unary_simd_@kind@_BOOL(char **args, npy_intp *dimensions, npy_intp *steps)
@@ -377,8 +353,8 @@ static NPY_INLINE npy_double sse2_horizontal_@VOP@___m128d(__m128d v)
* #vsuf = ps, pd#
* #vsufs = ss, sd#
* #nan = NPY_NANF, NPY_NAN#
- * #mtype = npy_int32, npy_int16#
- * #fanout = fanout_4, fanout_2#
+ * #double = 0, 1#
+ * #cast = _mm_castps_si128, _mm_castpd_si128#
*/
@@ -504,10 +480,34 @@ sse2_binary_scalar2_@kind@_@TYPE@(@type@ * op, @type@ * ip1, @type@ * ip2, npy_i
/**end repeat1**/
+/*
+ * compress 4 vectors to 4/8 bytes in op with filled with 0 or 1
+ * the last vector is passed as a pointer as MSVC 2010 is unable to ignore the
+ * calling convention leading to C2719 on 32 bit, see #4795
+ */
+static NPY_INLINE void
+sse2_compress4_to_byte_@TYPE@(@vtype@ r1, @vtype@ r2, @vtype@ r3, @vtype@ * r4,
+ npy_bool * op)
+{
+ const __m128i mask = @vpre@_set1_epi8(0x1);
+ __m128i ir1 = @vpre@_packs_epi32(@cast@(r1), @cast@(r2));
+ __m128i ir2 = @vpre@_packs_epi32(@cast@(r3), @cast@(*r4));
+ __m128i rr = @vpre@_packs_epi16(ir1, ir2);
+#if @double@
+ rr = @vpre@_packs_epi16(rr, rr);
+ rr = @vpre@_and_si128(rr, mask);
+ @vpre@_storel_epi64((__m128i*)op, rr);
+#else
+ rr = @vpre@_and_si128(rr, mask);
+ @vpre@_storeu_si128((__m128i*)op, rr);
+#endif
+}
+
/**begin repeat1
* #kind = equal, not_equal, less, less_equal, greater, greater_equal#
* #OP = ==, !=, <, <=, >, >=#
* #VOP = cmpeq, cmpneq, cmplt, cmple, cmpgt, cmpge#
+ * #neq = 0, 1, 0*4#
*/
/* sets invalid fpu flag on QNaN for consistency with packed compare */
@@ -525,19 +525,39 @@ sse2_ordered_cmp_@kind@_@TYPE@(const @type@ a, const @type@ b)
static void
sse2_binary_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, @type@ * ip2, npy_intp n)
{
- npy_bool * r;
LOOP_BLOCK_ALIGN_VAR(ip1, @type@, 16) {
op[i] = sse2_ordered_cmp_@kind@_@TYPE@(ip1[i], ip2[i]);
}
- r = &op[i];
- LOOP_BLOCKED(@type@, 16) {
- @vtype@ a = @vpre@_load_@vsuf@(&ip1[i]);
- @vtype@ b = @vpre@_loadu_@vsuf@(&ip2[i]);
- @vtype@ c = @vpre@_@VOP@_@vsuf@(a, b);
- @mtype@ ir = @fanout@[@vpre@_movemask_@vsuf@(c)];
- /* may be unaligned */
- memcpy(r, &ir, sizeof(ir));
- r += sizeof(ir);
+ /* isnan special unary case */
+ if (@neq@ && ip1 == ip2) {
+ LOOP_BLOCKED(@type@, 64) {
+ @vtype@ a = @vpre@_load_@vsuf@(&ip1[i + 0 * 16 / sizeof(@type@)]);
+ @vtype@ b = @vpre@_load_@vsuf@(&ip1[i + 1 * 16 / sizeof(@type@)]);
+ @vtype@ c = @vpre@_load_@vsuf@(&ip1[i + 2 * 16 / sizeof(@type@)]);
+ @vtype@ d = @vpre@_load_@vsuf@(&ip1[i + 3 * 16 / sizeof(@type@)]);
+ @vtype@ r1 = @vpre@_@VOP@_@vsuf@(a, a);
+ @vtype@ r2 = @vpre@_@VOP@_@vsuf@(b, b);
+ @vtype@ r3 = @vpre@_@VOP@_@vsuf@(c, c);
+ @vtype@ r4 = @vpre@_@VOP@_@vsuf@(d, d);
+ sse2_compress4_to_byte_@TYPE@(r1, r2, r3, &r4, &op[i]);
+ }
+ }
+ else {
+ LOOP_BLOCKED(@type@, 64) {
+ @vtype@ a1 = @vpre@_load_@vsuf@(&ip1[i + 0 * 16 / sizeof(@type@)]);
+ @vtype@ b1 = @vpre@_load_@vsuf@(&ip1[i + 1 * 16 / sizeof(@type@)]);
+ @vtype@ c1 = @vpre@_load_@vsuf@(&ip1[i + 2 * 16 / sizeof(@type@)]);
+ @vtype@ d1 = @vpre@_load_@vsuf@(&ip1[i + 3 * 16 / sizeof(@type@)]);
+ @vtype@ a2 = @vpre@_loadu_@vsuf@(&ip2[i + 0 * 16 / sizeof(@type@)]);
+ @vtype@ b2 = @vpre@_loadu_@vsuf@(&ip2[i + 1 * 16 / sizeof(@type@)]);
+ @vtype@ c2 = @vpre@_loadu_@vsuf@(&ip2[i + 2 * 16 / sizeof(@type@)]);
+ @vtype@ d2 = @vpre@_loadu_@vsuf@(&ip2[i + 3 * 16 / sizeof(@type@)]);
+ @vtype@ r1 = @vpre@_@VOP@_@vsuf@(a1, a2);
+ @vtype@ r2 = @vpre@_@VOP@_@vsuf@(b1, b2);
+ @vtype@ r3 = @vpre@_@VOP@_@vsuf@(c1, c2);
+ @vtype@ r4 = @vpre@_@VOP@_@vsuf@(d1, d2);
+ sse2_compress4_to_byte_@TYPE@(r1, r2, r3, &r4, &op[i]);
+ }
}
LOOP_BLOCKED_END {
op[i] = sse2_ordered_cmp_@kind@_@TYPE@(ip1[i], ip2[i]);
@@ -548,19 +568,20 @@ sse2_binary_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, @type@ * ip2, npy_intp n)
static void
sse2_binary_scalar1_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, @type@ * ip2, npy_intp n)
{
- npy_bool * r;
- @vtype@ a = @vpre@_set1_@vsuf@(ip1[0]);
+ @vtype@ s = @vpre@_set1_@vsuf@(ip1[0]);
LOOP_BLOCK_ALIGN_VAR(ip2, @type@, 16) {
op[i] = sse2_ordered_cmp_@kind@_@TYPE@(ip1[0], ip2[i]);
}
- r = &op[i];
- LOOP_BLOCKED(@type@, 16) {
- @vtype@ b = @vpre@_load_@vsuf@(&ip2[i]);
- @vtype@ c = @vpre@_@VOP@_@vsuf@(a, b);
- @mtype@ ir = @fanout@[@vpre@_movemask_@vsuf@(c)];
- /* may be unaligned */
- memcpy(r, &ir, sizeof(ir));
- r += sizeof(ir);
+ LOOP_BLOCKED(@type@, 64) {
+ @vtype@ a = @vpre@_load_@vsuf@(&ip2[i + 0 * 16 / sizeof(@type@)]);
+ @vtype@ b = @vpre@_load_@vsuf@(&ip2[i + 1 * 16 / sizeof(@type@)]);
+ @vtype@ c = @vpre@_load_@vsuf@(&ip2[i + 2 * 16 / sizeof(@type@)]);
+ @vtype@ d = @vpre@_load_@vsuf@(&ip2[i + 3 * 16 / sizeof(@type@)]);
+ @vtype@ r1 = @vpre@_@VOP@_@vsuf@(s, a);
+ @vtype@ r2 = @vpre@_@VOP@_@vsuf@(s, b);
+ @vtype@ r3 = @vpre@_@VOP@_@vsuf@(s, c);
+ @vtype@ r4 = @vpre@_@VOP@_@vsuf@(s, d);
+ sse2_compress4_to_byte_@TYPE@(r1, r2, r3, &r4, &op[i]);
}
LOOP_BLOCKED_END {
op[i] = sse2_ordered_cmp_@kind@_@TYPE@(ip1[0], ip2[i]);
@@ -571,19 +592,20 @@ sse2_binary_scalar1_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, @type@ * ip2, npy
static void
sse2_binary_scalar2_@kind@_@TYPE@(npy_bool * op, @type@ * ip1, @type@ * ip2, npy_intp n)
{
- npy_bool * r;
- @vtype@ b = @vpre@_set1_@vsuf@(ip2[0]);
+ @vtype@ s = @vpre@_set1_@vsuf@(ip2[0]);
LOOP_BLOCK_ALIGN_VAR(ip1, @type@, 16) {
op[i] = sse2_ordered_cmp_@kind@_@TYPE@(ip1[i], ip2[0]);
}
- r = &op[i];
- LOOP_BLOCKED(@type@, 16) {
- @vtype@ a = @vpre@_load_@vsuf@(&ip1[i]);
- @vtype@ c = @vpre@_@VOP@_@vsuf@(a, b);
- @mtype@ ir = @fanout@[@vpre@_movemask_@vsuf@(c)];
- /* may be unaligned */
- memcpy(r, &ir, sizeof(ir));
- r += sizeof(ir);
+ LOOP_BLOCKED(@type@, 64) {
+ @vtype@ a = @vpre@_load_@vsuf@(&ip1[i + 0 * 16 / sizeof(@type@)]);
+ @vtype@ b = @vpre@_load_@vsuf@(&ip1[i + 1 * 16 / sizeof(@type@)]);
+ @vtype@ c = @vpre@_load_@vsuf@(&ip1[i + 2 * 16 / sizeof(@type@)]);
+ @vtype@ d = @vpre@_load_@vsuf@(&ip1[i + 3 * 16 / sizeof(@type@)]);
+ @vtype@ r1 = @vpre@_@VOP@_@vsuf@(a, s);
+ @vtype@ r2 = @vpre@_@VOP@_@vsuf@(b, s);
+ @vtype@ r3 = @vpre@_@VOP@_@vsuf@(c, s);
+ @vtype@ r4 = @vpre@_@VOP@_@vsuf@(d, s);
+ sse2_compress4_to_byte_@TYPE@(r1, r2, r3, &r4, &op[i]);
}
LOOP_BLOCKED_END {
op[i] = sse2_ordered_cmp_@kind@_@TYPE@(ip1[i], ip2[0]);
@@ -617,41 +639,56 @@ sse2_sqrt_@TYPE@(@type@ * op, @type@ * ip, const npy_intp n)
}
+static NPY_INLINE
+@type@ scalar_abs_@type@(@type@ v)
+{
+ /* add 0 to clear -0.0 */
+ return (v > 0 ? v: -v) + 0;
+}
+
+static NPY_INLINE
+@type@ scalar_neg_@type@(@type@ v)
+{
+ return -v;
+}
+
+/**begin repeat1
+ * #kind = absolute, negative#
+ * #VOP = andnot, xor#
+ * #scalar = scalar_abs, scalar_neg#
+ **/
static void
-sse2_absolute_@TYPE@(@type@ * op, @type@ * ip, const npy_intp n)
+sse2_@kind@_@TYPE@(@type@ * op, @type@ * ip, const npy_intp n)
{
/*
* get 0x7FFFFFFF mask (everything but signbit set)
- * float & ~mask will remove the sign
+ * float & ~mask will remove the sign, float ^ mask flips the sign
* this is equivalent to how the compiler implements fabs on amd64
*/
const @vtype@ mask = @vpre@_set1_@vsuf@(-0.@c@);
/* align output to 16 bytes */
LOOP_BLOCK_ALIGN_VAR(op, @type@, 16) {
- const @type@ tmp = ip[i] > 0 ? ip[i]: -ip[i];
- /* add 0 to clear -0.0 */
- op[i] = tmp + 0;
+ op[i] = @scalar@_@type@(ip[i]);
}
assert(n < (16 / sizeof(@type@)) || npy_is_aligned(&op[i], 16));
if (npy_is_aligned(&ip[i], 16)) {
LOOP_BLOCKED(@type@, 16) {
@vtype@ a = @vpre@_load_@vsuf@(&ip[i]);
- @vpre@_store_@vsuf@(&op[i], @vpre@_andnot_@vsuf@(mask, a));
+ @vpre@_store_@vsuf@(&op[i], @vpre@_@VOP@_@vsuf@(mask, a));
}
}
else {
LOOP_BLOCKED(@type@, 16) {
@vtype@ a = @vpre@_loadu_@vsuf@(&ip[i]);
- @vpre@_store_@vsuf@(&op[i], @vpre@_andnot_@vsuf@(mask, a));
+ @vpre@_store_@vsuf@(&op[i], @vpre@_@VOP@_@vsuf@(mask, a));
}
}
LOOP_BLOCKED_END {
- const @type@ tmp = ip[i] > 0 ? ip[i]: -ip[i];
- /* add 0 to clear -0.0 */
- op[i] = tmp + 0;
+ op[i] = @scalar@_@type@(ip[i]);
}
}
+/**end repeat1**/
/**begin repeat1
diff --git a/numpy/core/src/umath/test_rational.c.src b/numpy/core/src/umath/test_rational.c.src
index d8f90f9e5..5ce792266 100644
--- a/numpy/core/src/umath/test_rational.c.src
+++ b/numpy/core/src/umath/test_rational.c.src
@@ -846,7 +846,6 @@ npyrational_compare(const void* d0, const void* d1, void* arr) {
data = (rational*)data_; \
best_i = 0; \
best_r = data[0]; \
- i; \
for (i = 1; i < n; i++) { \
if (rational_##op(data[i],best_r)) { \
best_i = i; \
@@ -1240,8 +1239,9 @@ PyMODINIT_FUNC inittest_rational(void) {
} \
if (sizeof(_types)/sizeof(int)!=ufunc->nargs) { \
PyErr_Format(PyExc_AssertionError, \
- "ufunc %s takes %d arguments, our loop takes %ld", \
- #name, ufunc->nargs, sizeof(_types)/sizeof(int)); \
+ "ufunc %s takes %d arguments, our loop takes %lu", \
+ #name, ufunc->nargs, (unsigned long) \
+ (sizeof(_types)/sizeof(int))); \
Py_DECREF(ufunc); \
goto fail; \
} \
diff --git a/numpy/core/src/umath/ufunc_object.c b/numpy/core/src/umath/ufunc_object.c
index 5b881c0c7..45966902b 100644
--- a/numpy/core/src/umath/ufunc_object.c
+++ b/numpy/core/src/umath/ufunc_object.c
@@ -73,7 +73,7 @@ static int
_does_loop_use_arrays(void *data);
static int
-_extract_pyvals(PyObject *ref, char *name, int *bufsize,
+_extract_pyvals(PyObject *ref, const char *name, int *bufsize,
int *errmask, PyObject **errobj);
static int
@@ -237,7 +237,7 @@ static int PyUFunc_NUM_NODEFAULTS = 0;
#endif
static PyObject *
-_get_global_ext_obj(char * name)
+get_global_ext_obj(void)
{
PyObject *thedict;
PyObject *ref = NULL;
@@ -259,12 +259,12 @@ _get_global_ext_obj(char * name)
static int
-_get_bufsize_errmask(PyObject * extobj, char * ufunc_name,
+_get_bufsize_errmask(PyObject * extobj, const char *ufunc_name,
int *buffersize, int *errormask)
{
/* Get the buffersize and errormask */
if (extobj == NULL) {
- extobj = _get_global_ext_obj(ufunc_name);
+ extobj = get_global_ext_obj();
}
if (_extract_pyvals(extobj, ufunc_name,
buffersize, errormask, NULL) < 0) {
@@ -430,7 +430,7 @@ _find_array_prepare(PyObject *args, PyObject *kwds,
* if an error handling method is 'call'
*/
static int
-_extract_pyvals(PyObject *ref, char *name, int *bufsize,
+_extract_pyvals(PyObject *ref, const char *name, int *bufsize,
int *errmask, PyObject **errobj)
{
PyObject *retval;
@@ -518,41 +518,41 @@ _extract_pyvals(PyObject *ref, char *name, int *bufsize,
NPY_NO_EXPORT int
PyUFunc_GetPyValues(char *name, int *bufsize, int *errmask, PyObject **errobj)
{
- PyObject *ref = _get_global_ext_obj(name);
+ PyObject *ref = get_global_ext_obj();
return _extract_pyvals(ref, name, bufsize, errmask, errobj);
}
-#define _GETATTR_(str, rstr) do {if (strcmp(name, #str) == 0) \
+#define GETATTR(str, rstr) do {if (strcmp(name, #str) == 0) \
return PyObject_HasAttrString(op, "__" #rstr "__");} while (0);
static int
-_has_reflected_op(PyObject *op, char *name)
+_has_reflected_op(PyObject *op, const char *name)
{
- _GETATTR_(add, radd);
- _GETATTR_(subtract, rsub);
- _GETATTR_(multiply, rmul);
- _GETATTR_(divide, rdiv);
- _GETATTR_(true_divide, rtruediv);
- _GETATTR_(floor_divide, rfloordiv);
- _GETATTR_(remainder, rmod);
- _GETATTR_(power, rpow);
- _GETATTR_(left_shift, rlshift);
- _GETATTR_(right_shift, rrshift);
- _GETATTR_(bitwise_and, rand);
- _GETATTR_(bitwise_xor, rxor);
- _GETATTR_(bitwise_or, ror);
+ GETATTR(add, radd);
+ GETATTR(subtract, rsub);
+ GETATTR(multiply, rmul);
+ GETATTR(divide, rdiv);
+ GETATTR(true_divide, rtruediv);
+ GETATTR(floor_divide, rfloordiv);
+ GETATTR(remainder, rmod);
+ GETATTR(power, rpow);
+ GETATTR(left_shift, rlshift);
+ GETATTR(right_shift, rrshift);
+ GETATTR(bitwise_and, rand);
+ GETATTR(bitwise_xor, rxor);
+ GETATTR(bitwise_or, ror);
/* Comparisons */
- _GETATTR_(equal, eq);
- _GETATTR_(not_equal, ne);
- _GETATTR_(greater, lt);
- _GETATTR_(less, gt);
- _GETATTR_(greater_equal, le);
- _GETATTR_(less_equal, ge);
+ GETATTR(equal, eq);
+ GETATTR(not_equal, ne);
+ GETATTR(greater, lt);
+ GETATTR(less, gt);
+ GETATTR(greater_equal, le);
+ GETATTR(less_equal, ge);
return 0;
}
-#undef _GETATTR_
+#undef GETATTR
/* Return the position of next non-white-space char in the string */
@@ -779,7 +779,7 @@ static int get_ufunc_arguments(PyUFuncObject *ufunc,
int i, nargs, nin = ufunc->nin;
PyObject *obj, *context;
PyObject *str_key_obj = NULL;
- char *ufunc_name;
+ const char *ufunc_name;
int type_num;
int any_flexible = 0, any_object = 0, any_flexible_userloops = 0;
@@ -1153,9 +1153,7 @@ trivial_two_operand_loop(PyArrayObject **op,
innerloop(data, count, stride, innerloopdata);
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
}
static void
@@ -1186,9 +1184,7 @@ trivial_three_operand_loop(PyArrayObject **op,
innerloop(data, count, stride, innerloopdata);
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
}
/*
@@ -1270,7 +1266,6 @@ iterator_loop(PyUFuncObject *ufunc,
npy_uint32 op_flags[NPY_MAXARGS];
NpyIter *iter;
char *baseptrs[NPY_MAXARGS];
- int needs_api;
NpyIter_IterNextFunc *iternext;
char **dataptr;
@@ -1325,8 +1320,6 @@ iterator_loop(PyUFuncObject *ufunc,
return -1;
}
- needs_api = NpyIter_IterationNeedsAPI(iter);
-
/* Copy any allocated outputs */
op_it = NpyIter_GetOperandArray(iter);
for (i = nin; i < nop; ++i) {
@@ -1370,9 +1363,7 @@ iterator_loop(PyUFuncObject *ufunc,
stride = NpyIter_GetInnerStrideArray(iter);
count_ptr = NpyIter_GetInnerLoopSizePtr(iter);
- if (!needs_api) {
- NPY_BEGIN_THREADS;
- }
+ NPY_BEGIN_THREADS_NDITER(iter);
/* Execute the loop */
do {
@@ -1380,9 +1371,7 @@ iterator_loop(PyUFuncObject *ufunc,
innerloop(dataptr, count_ptr, stride, innerloopdata);
} while (iternext(iter));
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
}
NpyIter_Deallocate(iter);
@@ -1579,8 +1568,6 @@ execute_fancy_ufunc_loop(PyUFuncObject *ufunc,
PyArrayObject **op_it;
npy_uint32 iter_flags;
- NPY_BEGIN_THREADS_DEF;
-
if (wheremask != NULL) {
if (nop + 1 > NPY_MAXARGS) {
PyErr_SetString(PyExc_ValueError,
@@ -1669,6 +1656,7 @@ execute_fancy_ufunc_loop(PyUFuncObject *ufunc,
NpyAuxData *innerloopdata;
npy_intp fixed_strides[2*NPY_MAXARGS];
PyArray_Descr **iter_dtypes;
+ NPY_BEGIN_THREADS_DEF;
/* Validate that the prepare_ufunc_output didn't mess with pointers */
for (i = nin; i < nop; ++i) {
@@ -1708,9 +1696,7 @@ execute_fancy_ufunc_loop(PyUFuncObject *ufunc,
strides = NpyIter_GetInnerStrideArray(iter);
countptr = NpyIter_GetInnerLoopSizePtr(iter);
- if (!needs_api) {
- NPY_BEGIN_THREADS;
- }
+ NPY_BEGIN_THREADS_NDITER(iter);
NPY_UF_DBG_PRINT("Actual inner loop:\n");
/* Execute the loop */
@@ -1721,9 +1707,7 @@ execute_fancy_ufunc_loop(PyUFuncObject *ufunc,
*countptr, innerloopdata);
} while (iternext(iter));
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
NPY_AUXDATA_FREE(innerloopdata);
}
@@ -1777,8 +1761,8 @@ make_arr_prep_args(npy_intp nin, PyObject *args, PyObject *kwds)
* may be null, in which case the thread global one is fetched
* - ufunc_name: name of ufunc
*/
-static int
-_check_ufunc_fperr(int errmask, PyObject *extobj, char* ufunc_name) {
+static int
+_check_ufunc_fperr(int errmask, PyObject *extobj, const char *ufunc_name) {
int fperr;
PyObject *errobj = NULL;
int ret;
@@ -1794,7 +1778,7 @@ _check_ufunc_fperr(int errmask, PyObject *extobj, char* ufunc_name) {
/* Get error object globals */
if (extobj == NULL) {
- extobj = _get_global_ext_obj(ufunc_name);
+ extobj = get_global_ext_obj();
}
if (_extract_pyvals(extobj, ufunc_name,
NULL, NULL, &errobj) < 0) {
@@ -1816,7 +1800,7 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc,
{
int nin, nout;
int i, j, idim, nop;
- char *ufunc_name;
+ const char *ufunc_name;
int retval = -1, subok = 1;
int needs_api = 0;
@@ -2167,6 +2151,11 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc,
*/
inner_strides = (npy_intp *)PyArray_malloc(
NPY_SIZEOF_INTP * (nop+core_dim_ixs_size));
+ if (inner_strides == NULL) {
+ PyErr_NoMemory();
+ retval = -1;
+ goto fail;
+ }
/* Copy the strides after the first nop */
idim = nop;
for (i = 0; i < nop; ++i) {
@@ -2241,7 +2230,6 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc,
/* Get the variables needed for the loop */
iternext = NpyIter_GetIterNext(iter, NULL);
if (iternext == NULL) {
- NpyIter_Deallocate(iter);
retval = -1;
goto fail;
}
@@ -2273,11 +2261,13 @@ PyUFunc_GeneralizedFunction(PyUFuncObject *ufunc,
PyErr_Format(PyExc_ValueError,
"ufunc %s ",
ufunc_name);
+ retval = -1;
goto fail;
default:
PyErr_Format(PyExc_ValueError,
"ufunc %s has an invalid identity for reduction",
ufunc_name);
+ retval = -1;
goto fail;
}
}
@@ -2335,7 +2325,7 @@ PyUFunc_GenericFunction(PyUFuncObject *ufunc,
{
int nin, nout;
int i, nop;
- char *ufunc_name;
+ const char *ufunc_name;
int retval = -1, subok = 1;
int need_fancy = 0;
@@ -2438,7 +2428,7 @@ PyUFunc_GenericFunction(PyUFuncObject *ufunc,
*/
if (nin == 2 && nout == 1 && dtypes[1]->type_num == NPY_OBJECT) {
PyObject *_obj = PyTuple_GET_ITEM(args, 1);
- if (!PyArray_CheckExact(_obj)) {
+ if (!PyArray_Check(_obj)) {
double self_prio, other_prio;
self_prio = PyArray_GetPriority(PyTuple_GET_ITEM(args, 0),
NPY_SCALAR_PRIORITY);
@@ -2650,7 +2640,7 @@ reduce_type_resolver(PyUFuncObject *ufunc, PyArrayObject *arr,
int i, retcode;
PyArrayObject *op[3] = {arr, arr, NULL};
PyArray_Descr *dtypes[3] = {NULL, NULL, NULL};
- char *ufunc_name = ufunc->name ? ufunc->name : "(unknown)";
+ const char *ufunc_name = ufunc->name ? ufunc->name : "(unknown)";
PyObject *type_tup = NULL;
*out_dtype = NULL;
@@ -2742,9 +2732,7 @@ reduce_loop(NpyIter *iter, char **dataptrs, npy_intp *strides,
return -1;
}
- if (!needs_api) {
- NPY_BEGIN_THREADS;
- }
+ NPY_BEGIN_THREADS_NDITER(iter);
if (skip_first_count > 0) {
do {
@@ -2797,9 +2785,7 @@ reduce_loop(NpyIter *iter, char **dataptrs, npy_intp *strides,
} while (iternext(iter));
finish_loop:
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
return (needs_api && PyErr_Occurred()) ? -1 : 0;
}
@@ -2830,7 +2816,7 @@ PyUFunc_Reduce(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *out,
PyArray_Descr *dtype;
PyArrayObject *result;
PyArray_AssignReduceIdentityFunc *assign_identity = NULL;
- char *ufunc_name = ufunc->name ? ufunc->name : "(unknown)";
+ const char *ufunc_name = ufunc->name ? ufunc->name : "(unknown)";
/* These parameters come from a TLS global */
int buffersize = 0, errormask = 0;
@@ -2926,7 +2912,7 @@ PyUFunc_Accumulate(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *out,
PyUFuncGenericFunction innerloop = NULL;
void *innerloopdata = NULL;
- char *ufunc_name = ufunc->name ? ufunc->name : "(unknown)";
+ const char *ufunc_name = ufunc->name ? ufunc->name : "(unknown)";
/* These parameters come from extobj= or from a TLS global */
int buffersize = 0, errormask = 0;
@@ -3126,9 +3112,7 @@ PyUFunc_Accumulate(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *out,
needs_api = NpyIter_IterationNeedsAPI(iter);
- if (!needs_api) {
- NPY_BEGIN_THREADS;
- }
+ NPY_BEGIN_THREADS_NDITER(iter);
do {
@@ -3158,9 +3142,7 @@ PyUFunc_Accumulate(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *out,
}
} while (iternext(iter));
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
}
else if (iter == NULL) {
char *dataptr_copy[3];
@@ -3215,15 +3197,13 @@ PyUFunc_Accumulate(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *out,
needs_api = PyDataType_REFCHK(op_dtypes[0]);
if (!needs_api) {
- NPY_BEGIN_THREADS;
+ NPY_BEGIN_THREADS_THRESHOLDED(count);
}
innerloop(dataptr_copy, &count,
stride_copy, innerloopdata);
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
}
}
@@ -3274,7 +3254,7 @@ PyUFunc_Reduceat(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *ind,
op_axes_arrays[2]};
npy_uint32 op_flags[3];
int i, idim, ndim, otype_final;
- int needs_api, need_outer_iterator;
+ int need_outer_iterator;
NpyIter *iter = NULL;
@@ -3285,7 +3265,7 @@ PyUFunc_Reduceat(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *ind,
PyUFuncGenericFunction innerloop = NULL;
void *innerloopdata = NULL;
- char *ufunc_name = ufunc->name ? ufunc->name : "(unknown)";
+ const char *ufunc_name = ufunc->name ? ufunc->name : "(unknown)";
char *opname = "reduceat";
/* These parameters come from extobj= or from a TLS global */
@@ -3519,11 +3499,7 @@ PyUFunc_Reduceat(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *ind,
stride_copy[1] = stride1;
stride_copy[2] = stride0;
- needs_api = NpyIter_IterationNeedsAPI(iter);
-
- if (!needs_api) {
- NPY_BEGIN_THREADS;
- }
+ NPY_BEGIN_THREADS_NDITER(iter);
do {
@@ -3560,9 +3536,7 @@ PyUFunc_Reduceat(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *ind,
}
} while (iternext(iter));
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
}
else if (iter == NULL) {
char *dataptr_copy[3];
@@ -3575,7 +3549,7 @@ PyUFunc_Reduceat(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *ind,
/* Execute the loop with no iterators */
npy_intp stride0 = 0, stride1 = PyArray_STRIDE(op[1], axis);
- needs_api = PyDataType_REFCHK(op_dtypes[0]);
+ int needs_api = PyDataType_REFCHK(op_dtypes[0]);
NPY_UF_DBG_PRINT("UFunc: Reduce loop with no iterators\n");
@@ -3619,9 +3593,7 @@ PyUFunc_Reduceat(PyUFuncObject *ufunc, PyArrayObject *arr, PyArrayObject *ind,
}
}
- if (!needs_api) {
- NPY_END_THREADS;
- }
+ NPY_END_THREADS;
}
finish:
@@ -4093,7 +4065,7 @@ ufunc_generic_call(PyUFuncObject *ufunc, PyObject *args, PyObject *kwds)
mps[i] = NULL;
}
- errval = PyUFunc_CheckOverride(ufunc, "__call__", args, kwds, &override,
+ errval = PyUFunc_CheckOverride(ufunc, "__call__", args, kwds, &override,
ufunc->nin);
if (errval) {
return NULL;
@@ -4333,7 +4305,7 @@ NPY_NO_EXPORT PyObject *
PyUFunc_FromFuncAndData(PyUFuncGenericFunction *func, void **data,
char *types, int ntypes,
int nin, int nout, int identity,
- char *name, char *doc, int check_return)
+ const char *name, const char *doc, int check_return)
{
return PyUFunc_FromFuncAndDataAndSignature(func, data, types, ntypes,
nin, nout, identity, name, doc, check_return, NULL);
@@ -4344,7 +4316,7 @@ NPY_NO_EXPORT PyObject *
PyUFunc_FromFuncAndDataAndSignature(PyUFuncGenericFunction *func, void **data,
char *types, int ntypes,
int nin, int nout, int identity,
- char *name, char *doc,
+ const char *name, const char *doc,
int check_return, const char *signature)
{
PyUFuncObject *ufunc;
@@ -4778,6 +4750,8 @@ static PyObject *
ufunc_outer(PyUFuncObject *ufunc, PyObject *args, PyObject *kwds)
{
int i;
+ int errval;
+ PyObject *override = NULL;
PyObject *ret;
PyArrayObject *ap1 = NULL, *ap2 = NULL, *ap_new = NULL;
PyObject *new_args, *tmp;
@@ -4802,6 +4776,15 @@ ufunc_outer(PyUFuncObject *ufunc, PyObject *args, PyObject *kwds)
return NULL;
}
+ /* `nin`, the last arg, is unused. So we put 0. */
+ errval = PyUFunc_CheckOverride(ufunc, "outer", args, kwds, &override, 0);
+ if (errval) {
+ return NULL;
+ }
+ else if (override) {
+ return override;
+ }
+
tmp = PySequence_GetItem(args, 0);
if (tmp == NULL) {
return NULL;
@@ -4871,8 +4854,8 @@ ufunc_reduce(PyUFuncObject *ufunc, PyObject *args, PyObject *kwds)
int errval;
PyObject *override = NULL;
- errval = PyUFunc_CheckOverride(ufunc, "reduce", args, kwds, &override,
- ufunc->nin);
+ /* `nin`, the last arg, is unused. So we put 0. */
+ errval = PyUFunc_CheckOverride(ufunc, "reduce", args, kwds, &override, 0);
if (errval) {
return NULL;
}
@@ -4888,8 +4871,8 @@ ufunc_accumulate(PyUFuncObject *ufunc, PyObject *args, PyObject *kwds)
int errval;
PyObject *override = NULL;
- errval = PyUFunc_CheckOverride(ufunc, "accumulate", args, kwds, &override,
- ufunc->nin);
+ /* `nin`, the last arg, is unused. So we put 0. */
+ errval = PyUFunc_CheckOverride(ufunc, "accumulate", args, kwds, &override, 0);
if (errval) {
return NULL;
}
@@ -4905,8 +4888,8 @@ ufunc_reduceat(PyUFuncObject *ufunc, PyObject *args, PyObject *kwds)
int errval;
PyObject *override = NULL;
- errval = PyUFunc_CheckOverride(ufunc, "reduceat", args, kwds, &override,
- ufunc->nin);
+ /* `nin`, the last arg, is unused. So we put 0. */
+ errval = PyUFunc_CheckOverride(ufunc, "reduceat", args, kwds, &override, 0);
if (errval) {
return NULL;
}
@@ -4958,13 +4941,27 @@ ufunc_at(PyUFuncObject *ufunc, PyObject *args)
int i;
int nop;
+ /* override vars */
+ int errval;
+ PyObject *override = NULL;
+
NpyIter *iter_buffer;
NpyIter_IterNextFunc *iternext;
npy_uint32 op_flags[NPY_MAXARGS];
int buffersize;
int errormask = 0;
+ char * err_msg = NULL;
NPY_BEGIN_THREADS_DEF;
+ /* `nin`, the last arg, is unused. So we put 0. */
+ errval = PyUFunc_CheckOverride(ufunc, "at", args, NULL, &override, 0);
+ if (errval) {
+ return NULL;
+ }
+ else if (override) {
+ return override;
+ }
+
if (ufunc->nin > 2) {
PyErr_SetString(PyExc_ValueError,
"Only unary and binary ufuncs supported at this time");
@@ -5162,7 +5159,11 @@ ufunc_at(PyUFuncObject *ufunc, PyObject *args)
}
/* Reset NpyIter data pointers which will trigger a buffer copy */
- NpyIter_ResetBasePointers(iter_buffer, dataptr, NULL);
+ NpyIter_ResetBasePointers(iter_buffer, dataptr, &err_msg);
+ if (err_msg) {
+ break;
+ }
+
buffer_dataptr = NpyIter_GetDataPtrArray(iter_buffer);
innerloop(buffer_dataptr, count, stride, innerloopdata);
@@ -5185,8 +5186,10 @@ ufunc_at(PyUFuncObject *ufunc, PyObject *args)
i--;
}
- if (!needs_api) {
- NPY_END_THREADS;
+ NPY_END_THREADS;
+
+ if (err_msg) {
+ PyErr_SetString(PyExc_ValueError, err_msg);
}
NpyIter_Deallocate(iter_buffer);
diff --git a/numpy/core/src/umath/ufunc_type_resolution.c b/numpy/core/src/umath/ufunc_type_resolution.c
index 12d8e406b..3beb25cf1 100644
--- a/numpy/core/src/umath/ufunc_type_resolution.c
+++ b/numpy/core/src/umath/ufunc_type_resolution.c
@@ -58,7 +58,7 @@ PyUFunc_ValidateCasting(PyUFuncObject *ufunc,
PyArray_Descr **dtypes)
{
int i, nin = ufunc->nin, nop = nin + ufunc->nout;
- char *ufunc_name;
+ const char *ufunc_name;
ufunc_name = ufunc->name ? ufunc->name : "<unnamed ufunc>";
@@ -186,7 +186,7 @@ PyUFunc_SimpleBinaryComparisonTypeResolver(PyUFuncObject *ufunc,
PyArray_Descr **out_dtypes)
{
int i, type_num1, type_num2;
- char *ufunc_name;
+ const char *ufunc_name;
ufunc_name = ufunc->name ? ufunc->name : "<unnamed ufunc>";
@@ -292,7 +292,7 @@ PyUFunc_SimpleUnaryOperationTypeResolver(PyUFuncObject *ufunc,
PyArray_Descr **out_dtypes)
{
int i, type_num1;
- char *ufunc_name;
+ const char *ufunc_name;
ufunc_name = ufunc->name ? ufunc->name : "<unnamed ufunc>";
@@ -367,6 +367,34 @@ PyUFunc_SimpleUnaryOperationTypeResolver(PyUFuncObject *ufunc,
return 0;
}
+
+NPY_NO_EXPORT int
+PyUFunc_NegativeTypeResolver(PyUFuncObject *ufunc,
+ NPY_CASTING casting,
+ PyArrayObject **operands,
+ PyObject *type_tup,
+ PyArray_Descr **out_dtypes)
+{
+ int ret;
+ ret = PyUFunc_SimpleUnaryOperationTypeResolver(ufunc, casting, operands,
+ type_tup, out_dtypes);
+ if (ret < 0) {
+ return ret;
+ }
+
+ /* The type resolver would have upcast already */
+ if (out_dtypes[0]->type_num == NPY_BOOL) {
+ if (DEPRECATE("numpy boolean negative (the unary `-` operator) is "
+ "deprecated, use the bitwise_xor (the `^` operator) "
+ "or the logical_xor function instead.") < 0) {
+ return -1;
+ }
+ }
+
+ return ret;
+}
+
+
/*
* The ones_like function shouldn't really be a ufunc, but while it
* still is, this provides type resolution that always forces UNSAFE
@@ -405,7 +433,7 @@ PyUFunc_SimpleBinaryOperationTypeResolver(PyUFuncObject *ufunc,
PyArray_Descr **out_dtypes)
{
int i, type_num1, type_num2;
- char *ufunc_name;
+ const char *ufunc_name;
ufunc_name = ufunc->name ? ufunc->name : "<unnamed ufunc>";
@@ -563,7 +591,7 @@ PyUFunc_AdditionTypeResolver(PyUFuncObject *ufunc,
{
int type_num1, type_num2;
int i;
- char *ufunc_name;
+ const char *ufunc_name;
ufunc_name = ufunc->name ? ufunc->name : "<unnamed ufunc>";
@@ -753,7 +781,7 @@ PyUFunc_SubtractionTypeResolver(PyUFuncObject *ufunc,
{
int type_num1, type_num2;
int i;
- char *ufunc_name;
+ const char *ufunc_name;
ufunc_name = ufunc->name ? ufunc->name : "<unnamed ufunc>";
@@ -762,8 +790,22 @@ PyUFunc_SubtractionTypeResolver(PyUFuncObject *ufunc,
/* Use the default when datetime and timedelta are not involved */
if (!PyTypeNum_ISDATETIME(type_num1) && !PyTypeNum_ISDATETIME(type_num2)) {
- return PyUFunc_SimpleBinaryOperationTypeResolver(ufunc, casting,
- operands, type_tup, out_dtypes);
+ int ret;
+ ret = PyUFunc_SimpleBinaryOperationTypeResolver(ufunc, casting,
+ operands, type_tup, out_dtypes);
+ if (ret < 0) {
+ return ret;
+ }
+
+ /* The type resolver would have upcast already */
+ if (out_dtypes[0]->type_num == NPY_BOOL) {
+ if (DEPRECATE("numpy boolean subtract (the binary `-` operator) is "
+ "deprecated, use the bitwise_xor (the `^` operator) "
+ "or the logical_xor function instead.") < 0) {
+ return -1;
+ }
+ }
+ return ret;
}
if (type_num1 == NPY_TIMEDELTA) {
@@ -921,7 +963,7 @@ PyUFunc_MultiplicationTypeResolver(PyUFuncObject *ufunc,
{
int type_num1, type_num2;
int i;
- char *ufunc_name;
+ const char *ufunc_name;
ufunc_name = ufunc->name ? ufunc->name : "<unnamed ufunc>";
@@ -1064,7 +1106,7 @@ PyUFunc_DivisionTypeResolver(PyUFuncObject *ufunc,
{
int type_num1, type_num2;
int i;
- char *ufunc_name;
+ const char *ufunc_name;
ufunc_name = ufunc->name ? ufunc->name : "<unnamed ufunc>";
@@ -1833,7 +1875,7 @@ linear_search_type_resolver(PyUFuncObject *self,
{
npy_intp i, j, nin = self->nin, nop = nin + self->nout;
int types[NPY_MAXARGS];
- char *ufunc_name;
+ const char *ufunc_name;
int no_castable_output, use_min_scalar;
/* For making a better error message on coercion error */
@@ -1942,7 +1984,7 @@ type_tuple_type_resolver(PyUFuncObject *self,
npy_intp i, j, n, nin = self->nin, nop = nin + self->nout;
int n_specified = 0;
int specified_types[NPY_MAXARGS], types[NPY_MAXARGS];
- char *ufunc_name;
+ const char *ufunc_name;
int no_castable_output, use_min_scalar;
/* For making a better error message on coercion error */
diff --git a/numpy/core/src/umath/ufunc_type_resolution.h b/numpy/core/src/umath/ufunc_type_resolution.h
index a1241827e..a1e28d75b 100644
--- a/numpy/core/src/umath/ufunc_type_resolution.h
+++ b/numpy/core/src/umath/ufunc_type_resolution.h
@@ -16,6 +16,13 @@ PyUFunc_SimpleUnaryOperationTypeResolver(PyUFuncObject *ufunc,
PyArray_Descr **out_dtypes);
NPY_NO_EXPORT int
+PyUFunc_NegativeTypeResolver(PyUFuncObject *ufunc,
+ NPY_CASTING casting,
+ PyArrayObject **operands,
+ PyObject *type_tup,
+ PyArray_Descr **out_dtypes);
+
+NPY_NO_EXPORT int
PyUFunc_OnesLikeTypeResolver(PyUFuncObject *ufunc,
NPY_CASTING casting,
PyArrayObject **operands,
diff --git a/numpy/core/src/umath/umathmodule.c b/numpy/core/src/umath/umathmodule.c
index f395d5096..52aa2e48d 100644
--- a/numpy/core/src/umath/umathmodule.c
+++ b/numpy/core/src/umath/umathmodule.c
@@ -54,16 +54,15 @@ object_ufunc_type_resolver(PyUFuncObject *ufunc,
PyArray_Descr **out_dtypes)
{
int i, nop = ufunc->nin + ufunc->nout;
- PyArray_Descr *obj_dtype;
- obj_dtype = PyArray_DescrFromType(NPY_OBJECT);
- if (obj_dtype == NULL) {
+ out_dtypes[0] = PyArray_DescrFromType(NPY_OBJECT);
+ if (out_dtypes[0] == NULL) {
return -1;
}
- for (i = 0; i < nop; ++i) {
- Py_INCREF(obj_dtype);
- out_dtypes[i] = obj_dtype;
+ for (i = 1; i < nop; ++i) {
+ Py_INCREF(out_dtypes[0]);
+ out_dtypes[i] = out_dtypes[0];
}
return 0;
@@ -215,9 +214,6 @@ static PyUFuncGenericFunction frexp_functions[] = {
#endif
};
-static void * blank3_data[] = { (void *)NULL, (void *)NULL, (void *)NULL};
-static void * blank6_data[] = { (void *)NULL, (void *)NULL, (void *)NULL,
- (void *)NULL, (void *)NULL, (void *)NULL};
static char frexp_signatures[] = {
#ifdef HAVE_FREXPF
NPY_HALF, NPY_HALF, NPY_INT,
@@ -228,6 +224,7 @@ static char frexp_signatures[] = {
,NPY_LONGDOUBLE, NPY_LONGDOUBLE, NPY_INT
#endif
};
+static void * blank_data[12];
#if NPY_SIZEOF_LONG == NPY_SIZEOF_INT
#define LDEXP_LONG(typ) typ##_ldexp
@@ -251,6 +248,50 @@ static PyUFuncGenericFunction ldexp_functions[] = {
#endif
};
+static const char frdoc[] =
+ " Decompose the elements of x into mantissa and twos exponent.\n"
+ "\n"
+ " Returns (`mantissa`, `exponent`), where `x = mantissa * 2**exponent``.\n"
+ " The mantissa is lies in the open interval(-1, 1), while the twos\n"
+ " exponent is a signed integer.\n"
+ "\n"
+ " Parameters\n"
+ " ----------\n"
+ " x : array_like\n"
+ " Array of numbers to be decomposed.\n"
+ " out1: ndarray, optional\n"
+ " Output array for the mantissa. Must have the same shape as `x`.\n"
+ " out2: ndarray, optional\n"
+ " Output array for the exponent. Must have the same shape as `x`.\n"
+ "\n"
+ " Returns\n"
+ " -------\n"
+ " (mantissa, exponent) : tuple of ndarrays, (float, int)\n"
+ " `mantissa` is a float array with values between -1 and 1.\n"
+ " `exponent` is an int array which represents the exponent of 2.\n"
+ "\n"
+ " See Also\n"
+ " --------\n"
+ " ldexp : Compute ``y = x1 * 2**x2``, the inverse of `frexp`.\n"
+ "\n"
+ " Notes\n"
+ " -----\n"
+ " Complex dtypes are not supported, they will raise a TypeError.\n"
+ "\n"
+ " Examples\n"
+ " --------\n"
+ " >>> x = np.arange(9)\n"
+ " >>> y1, y2 = np.frexp(x)\n"
+ " >>> y1\n"
+ " array([ 0. , 0.5 , 0.5 , 0.75 , 0.5 , 0.625, 0.75 , 0.875,\n"
+ " 0.5 ])\n"
+ " >>> y2\n"
+ " array([0, 1, 2, 2, 3, 3, 3, 3, 4])\n"
+ " >>> y1 * 2**y2\n"
+ " array([ 0., 1., 2., 3., 4., 5., 6., 7., 8.])\n"
+ "\n";
+
+
static char ldexp_signatures[] = {
#ifdef HAVE_LDEXPF
NPY_HALF, NPY_INT, NPY_HALF,
@@ -266,24 +307,66 @@ static char ldexp_signatures[] = {
#endif
};
+static const char lddoc[] =
+ " Returns x1 * 2**x2, element-wise.\n"
+ "\n"
+ " The mantissas `x1` and twos exponents `x2` are used to construct\n"
+ " floating point numbers ``x1 * 2**x2``.\n"
+ "\n"
+ " Parameters\n"
+ " ----------\n"
+ " x1 : array_like\n"
+ " Array of multipliers.\n"
+ " x2 : array_like, int\n"
+ " Array of twos exponents.\n"
+ " out : ndarray, optional\n"
+ " Output array for the result.\n"
+ "\n"
+ " Returns\n"
+ " -------\n"
+ " y : ndarray or scalar\n"
+ " The result of ``x1 * 2**x2``.\n"
+ "\n"
+ " See Also\n"
+ " --------\n"
+ " frexp : Return (y1, y2) from ``x = y1 * 2**y2``, inverse to `ldexp`.\n"
+ "\n"
+ " Notes\n"
+ " -----\n"
+ " Complex dtypes are not supported, they will raise a TypeError.\n"
+ "\n"
+ " `ldexp` is useful as the inverse of `frexp`, if used by itself it is\n"
+ " more clear to simply use the expression ``x1 * 2**x2``.\n"
+ "\n"
+ " Examples\n"
+ " --------\n"
+ " >>> np.ldexp(5, np.arange(4))\n"
+ " array([ 5., 10., 20., 40.], dtype=float32)\n"
+ "\n"
+ " >>> x = np.arange(6)\n"
+ " >>> np.ldexp(*np.frexp(x))\n"
+ " array([ 0., 1., 2., 3., 4., 5.])\n"
+ "\n";
+
+
static void
InitOtherOperators(PyObject *dictionary) {
PyObject *f;
int num;
num = sizeof(frexp_functions) / sizeof(frexp_functions[0]);
- f = PyUFunc_FromFuncAndData(frexp_functions, blank3_data,
+ assert(sizeof(blank_data) / sizeof(blank_data[0]) >= num);
+ f = PyUFunc_FromFuncAndData(frexp_functions, blank_data,
frexp_signatures, num,
- 1, 2, PyUFunc_None, "frexp",
- "Split the number, x, into a normalized"\
- " fraction (y1) and exponent (y2)",0);
+ 1, 2, PyUFunc_None, "frexp", frdoc, 0);
PyDict_SetItemString(dictionary, "frexp", f);
Py_DECREF(f);
num = sizeof(ldexp_functions) / sizeof(ldexp_functions[0]);
- f = PyUFunc_FromFuncAndData(ldexp_functions, blank6_data, ldexp_signatures, num,
- 2, 1, PyUFunc_None, "ldexp",
- "Compute y = x1 * 2**x2.",0);
+ assert(sizeof(blank_data) / sizeof(blank_data[0]) >= num);
+ f = PyUFunc_FromFuncAndData(ldexp_functions, blank_data,
+ ldexp_signatures, num,
+ 2, 1, PyUFunc_None, "ldexp", lddoc, 0);
PyDict_SetItemString(dictionary, "ldexp", f);
Py_DECREF(f);
@@ -306,13 +389,13 @@ NPY_VISIBILITY_HIDDEN PyObject * npy_um_str_pyvals_name = NULL;
static int
intern_strings(void)
{
- npy_um_str_out = PyUString_FromString("out");
- npy_um_str_subok = PyUString_FromString("subok");
- npy_um_str_array_prepare = PyUString_FromString("__array_prepare__");
- npy_um_str_array_wrap = PyUString_FromString("__array_wrap__");
- npy_um_str_array_finalize = PyUString_FromString("__array_finalize__");
- npy_um_str_ufunc = PyUString_FromString("__numpy_ufunc__");
- npy_um_str_pyvals_name = PyUString_FromString(UFUNC_PYVALS_NAME);
+ npy_um_str_out = PyUString_InternFromString("out");
+ npy_um_str_subok = PyUString_InternFromString("subok");
+ npy_um_str_array_prepare = PyUString_InternFromString("__array_prepare__");
+ npy_um_str_array_wrap = PyUString_InternFromString("__array_wrap__");
+ npy_um_str_array_finalize = PyUString_InternFromString("__array_finalize__");
+ npy_um_str_ufunc = PyUString_InternFromString("__numpy_ufunc__");
+ npy_um_str_pyvals_name = PyUString_InternFromString(UFUNC_PYVALS_NAME);
return npy_um_str_out && npy_um_str_subok && npy_um_str_array_prepare &&
npy_um_str_array_wrap && npy_um_str_array_finalize && npy_um_str_ufunc;
diff --git a/numpy/core/tests/test_abc.py b/numpy/core/tests/test_abc.py
new file mode 100644
index 000000000..54edd7e90
--- /dev/null
+++ b/numpy/core/tests/test_abc.py
@@ -0,0 +1,45 @@
+from __future__ import division, absolute_import, print_function
+
+import numpy as np
+from numpy.testing import TestCase, assert_
+
+import numbers
+from numpy.core.numerictypes import sctypes
+
+class ABC(TestCase):
+ def test_floats(self):
+ for t in sctypes['float']:
+ assert_(isinstance(t(), numbers.Real),
+ "{0} is not instance of Real".format(t.__name__))
+ assert_(issubclass(t, numbers.Real),
+ "{0} is not subclass of Real".format(t.__name__))
+ assert_(not isinstance(t(), numbers.Rational),
+ "{0} is instance of Rational".format(t.__name__))
+ assert_(not issubclass(t, numbers.Rational),
+ "{0} is subclass of Rational".format(t.__name__))
+
+ def test_complex(self):
+ for t in sctypes['complex']:
+ assert_(isinstance(t(), numbers.Complex),
+ "{0} is not instance of Complex".format(t.__name__))
+ assert_(issubclass(t, numbers.Complex),
+ "{0} is not subclass of Complex".format(t.__name__))
+ assert_(not isinstance(t(), numbers.Real),
+ "{0} is instance of Real".format(t.__name__))
+ assert_(not issubclass(t, numbers.Real),
+ "{0} is subclass of Real".format(t.__name__))
+
+ def test_int(self):
+ for t in sctypes['int']:
+ assert_(isinstance(t(), numbers.Integral),
+ "{0} is not instance of Integral".format(t.__name__))
+ assert_(issubclass(t, numbers.Integral),
+ "{0} is not subclass of Integral".format(t.__name__))
+
+ def test_uint(self):
+ for t in sctypes['uint']:
+ assert_(isinstance(t(), numbers.Integral),
+ "{0} is not instance of Integral".format(t.__name__))
+ assert_(issubclass(t, numbers.Integral),
+ "{0} is not subclass of Integral".format(t.__name__))
+
diff --git a/numpy/core/tests/test_api.py b/numpy/core/tests/test_api.py
index a1a3f896c..2fd6463c7 100644
--- a/numpy/core/tests/test_api.py
+++ b/numpy/core/tests/test_api.py
@@ -278,6 +278,12 @@ def test_array_astype():
b = np.ndarray(buffer=a, dtype='uint32', shape=2)
assert_(b.size == 2)
+ a = np.array([1000], dtype='i4')
+ assert_raises(TypeError, a.astype, 'S1', casting='safe')
+
+ a = np.array(1000, dtype='i4')
+ assert_raises(TypeError, a.astype, 'U1', casting='safe')
+
def test_copyto_fromscalar():
a = np.arange(6, dtype='f4').reshape(2, 3)
diff --git a/numpy/core/tests/test_datetime.py b/numpy/core/tests/test_datetime.py
index 74aa0d5b9..bf0ba6807 100644
--- a/numpy/core/tests/test_datetime.py
+++ b/numpy/core/tests/test_datetime.py
@@ -592,6 +592,15 @@ class TestDateTime(TestCase):
assert_raises(OverflowError, np.promote_types,
np.dtype('m8[s]'), np.dtype('m8[as]'))
+ def test_cast_overflow(self):
+ # gh-4486
+ def cast():
+ numpy.datetime64("1971-01-01 00:00:00.000000000000000").astype("<M8[D]")
+ assert_raises(OverflowError, cast)
+ def cast2():
+ numpy.datetime64("2014").astype("<M8[fs]")
+ assert_raises(OverflowError, cast2)
+
def test_pyobject_roundtrip(self):
# All datetime types should be able to roundtrip through object
diff --git a/numpy/core/tests/test_defchararray.py b/numpy/core/tests/test_defchararray.py
index 09fcff0d0..2b45ba4bc 100644
--- a/numpy/core/tests/test_defchararray.py
+++ b/numpy/core/tests/test_defchararray.py
@@ -128,9 +128,9 @@ class TestWhitespace(TestCase):
assert_(all(self.A == self.B))
assert_(all(self.A >= self.B))
assert_(all(self.A <= self.B))
- assert_(all(negative(self.A > self.B)))
- assert_(all(negative(self.A < self.B)))
- assert_(all(negative(self.A != self.B)))
+ assert_(not any(self.A > self.B))
+ assert_(not any(self.A < self.B))
+ assert_(not any(self.A != self.B))
class TestChar(TestCase):
def setUp(self):
@@ -138,7 +138,7 @@ class TestChar(TestCase):
def test_it(self):
assert_equal(self.A.shape, (4,))
- assert_equal(self.A.upper()[:2].tostring(), asbytes('AB'))
+ assert_equal(self.A.upper()[:2].tobytes(), asbytes('AB'))
class TestComparisons(TestCase):
def setUp(self):
diff --git a/numpy/core/tests/test_deprecations.py b/numpy/core/tests/test_deprecations.py
index 55ca0f573..a1f4664a5 100644
--- a/numpy/core/tests/test_deprecations.py
+++ b/numpy/core/tests/test_deprecations.py
@@ -11,7 +11,8 @@ import warnings
from nose.plugins.skip import SkipTest
import numpy as np
-from numpy.testing import dec, run_module_suite, assert_raises
+from numpy.testing import (dec, run_module_suite, assert_raises,
+ assert_warns, assert_array_equal)
class _DeprecationTestCase(object):
@@ -85,7 +86,7 @@ class _DeprecationTestCase(object):
elif not ignore_others:
raise AssertionError("expected DeprecationWarning but %s given"
% warning.category)
- if num_found != num:
+ if num is not None and num_found != num:
raise AssertionError("%i warnings found but %i expected"
% (len(self.log), num))
@@ -151,7 +152,7 @@ class TestFloatNonIntegerArgumentDeprecation(_DeprecationTestCase):
assert_deprecated(lambda: a[0.0,:])
assert_deprecated(lambda: a[:, 0.0])
assert_deprecated(lambda: a[:, 0.0,:])
- assert_deprecated(lambda: a[0.0,:,:], num=2) # [1]
+ assert_deprecated(lambda: a[0.0,:,:])
assert_deprecated(lambda: a[0, 0, 0.0])
assert_deprecated(lambda: a[0.0, 0, 0])
assert_deprecated(lambda: a[0, 0.0, 0])
@@ -161,11 +162,10 @@ class TestFloatNonIntegerArgumentDeprecation(_DeprecationTestCase):
assert_deprecated(lambda: a[-1.4,:])
assert_deprecated(lambda: a[:, -1.4])
assert_deprecated(lambda: a[:, -1.4,:])
- assert_deprecated(lambda: a[-1.4,:,:], num=2) # [1]
+ assert_deprecated(lambda: a[-1.4,:,:])
assert_deprecated(lambda: a[0, 0, -1.4])
assert_deprecated(lambda: a[-1.4, 0, 0])
assert_deprecated(lambda: a[0, -1.4, 0])
- # [1] These are duplicate because of the _tuple_of_integers quick check
# Test that the slice parameter deprecation warning doesn't mask
# the scalar index warning.
@@ -296,5 +296,189 @@ class TestArrayToIndexDeprecation(_DeprecationTestCase):
self.assert_deprecated(lambda: a[a:a:a], exceptions=(), num=3)
+class TestNonIntegerArrayLike(_DeprecationTestCase):
+ """Tests that array likes, i.e. lists give a deprecation warning
+ when they cannot be safely cast to an integer.
+ """
+ message = "non integer \(and non boolean\) array-likes will not be " \
+ "accepted as indices in the future"
+
+ def test_basic(self):
+ a = np.arange(10)
+ self.assert_deprecated(a.__getitem__, args=([0.5, 1.5],),
+ exceptions=IndexError)
+ self.assert_deprecated(a.__getitem__, args=((['1', '2'],),),
+ exceptions=IndexError)
+
+ self.assert_not_deprecated(a.__getitem__, ([],))
+
+
+ def test_boolean_futurewarning(self):
+ a = np.arange(10)
+ with warnings.catch_warnings():
+ warnings.filterwarnings('always')
+ assert_warns(FutureWarning, a.__getitem__, [True])
+ # Unfortunatly, the deprecation warning takes precedence:
+ #assert_warns(FutureWarning, a.__getitem__, True)
+
+ with warnings.catch_warnings():
+ warnings.filterwarnings('error')
+ assert_raises(FutureWarning, a.__getitem__, [True])
+ #assert_raises(FutureWarning, a.__getitem__, True)
+
+
+class TestMultipleEllipsisDeprecation(_DeprecationTestCase):
+ message = "an index can only have a single Ellipsis \(`...`\); replace " \
+ "all but one with slices \(`:`\)."
+
+ def test_basic(self):
+ a = np.arange(10)
+ self.assert_deprecated(a.__getitem__, args=((Ellipsis, Ellipsis),))
+
+ with warnings.catch_warnings():
+ warnings.filterwarnings('ignore', '', DeprecationWarning)
+ # Just check that this works:
+ b = a[...,...]
+ assert_array_equal(a, b)
+ assert_raises(IndexError, a.__getitem__, ((Ellipsis, ) * 3,))
+
+
+class TestBooleanSubtractDeprecations(_DeprecationTestCase):
+ """Test deprecation of boolean `-`. While + and * are well
+ defined, - is not and even a corrected form seems to have
+ no real uses.
+
+ The deprecation process was started in NumPy 1.9.
+ """
+ message = r"numpy boolean .* \(the .* `-` operator\) is deprecated, " \
+ "use the bitwise"
+
+ def test_operator_deprecation(self):
+ array = np.array([True])
+ generic = np.bool_(True)
+
+ # Minus operator/subtract ufunc:
+ self.assert_deprecated(operator.sub, args=(array, array))
+ self.assert_deprecated(operator.sub, args=(generic, generic))
+
+ # Unary minus/negative ufunc:
+ self.assert_deprecated(operator.neg, args=(array,))
+ self.assert_deprecated(operator.neg, args=(generic,))
+
+
+class TestRankDeprecation(_DeprecationTestCase):
+ """Test that np.rank is deprecated. The function should simply be
+ removed. The VisibleDeprecationWarning may become unnecessary.
+ """
+ def test(self):
+ a = np.arange(10)
+ assert_warns(np.VisibleDeprecationWarning, np.rank, a)
+
+
+class TestComparisonDepreactions(_DeprecationTestCase):
+ """This tests the deprecation, for non-elementwise comparison logic.
+ This used to mean that when an error occured during element-wise comparison
+ (i.e. broadcasting) NotImplemented was returned, but also in the comparison
+ itself, False was given instead of the error.
+
+ Also test FutureWarning for the None comparison.
+ """
+
+ message = "elementwise comparison failed; " \
+ "this will raise the error in the future."
+
+ def test_normal_types(self):
+ for op in (operator.eq, operator.ne):
+ # Broadcasting errors:
+ self.assert_deprecated(op, args=(np.zeros(3), []))
+ a = np.zeros(3, dtype='i,i')
+ # (warning is issued a couple of times here)
+ self.assert_deprecated(op, args=(a, a[:-1]), num=None)
+
+ # Element comparison error (numpy array can't be compared).
+ a = np.array([1, np.array([1,2,3])], dtype=object)
+ b = np.array([1, np.array([1,2,3])], dtype=object)
+ self.assert_deprecated(op, args=(a, b), num=None)
+
+
+ def test_string(self):
+ # For two string arrays, strings always raised the broadcasting error:
+ a = np.array(['a', 'b'])
+ b = np.array(['a', 'b', 'c'])
+ assert_raises(ValueError, lambda x, y: x == y, a, b)
+
+ # The empty list is not cast to string, this is only to document
+ # that fact (it likely should be changed). This means that the
+ # following works (and returns False) due to dtype mismatch:
+ a == []
+
+
+ def test_none_comparison(self):
+ # Test comparison of None, which should result in elementwise
+ # comparison in the future. [1, 2] == None should be [False, False].
+ with warnings.catch_warnings():
+ warnings.filterwarnings('always', '', FutureWarning)
+ assert_warns(FutureWarning, operator.eq, np.arange(3), None)
+ assert_warns(FutureWarning, operator.ne, np.arange(3), None)
+
+ with warnings.catch_warnings():
+ warnings.filterwarnings('error', '', FutureWarning)
+ assert_raises(FutureWarning, operator.eq, np.arange(3), None)
+ assert_raises(FutureWarning, operator.ne, np.arange(3), None)
+
+
+class TestIdentityComparisonDepreactions(_DeprecationTestCase):
+ """This tests the equal and not_equal object ufuncs identity check
+ deprecation. This was due to the usage of PyObject_RichCompareBool.
+
+ This tests that for example for `a = np.array([np.nan], dtype=object)`
+ `a == a` it is warned that False and not `np.nan is np.nan` is returned.
+
+ Should be kept in sync with TestComparisonDepreactions and new tests
+ added when the deprecation is over. Requires only removing of @identity@
+ (and blocks) from the ufunc loops.c.src of the OBJECT comparisons.
+ """
+
+ message = "numpy .* will not check object identity in the future."
+
+ def test_identity_equality_mismatch(self):
+ a = np.array([np.nan], dtype=object)
+
+ with warnings.catch_warnings():
+ warnings.filterwarnings('always', '', FutureWarning)
+ assert_warns(FutureWarning, np.equal, a, a)
+ assert_warns(FutureWarning, np.not_equal, a, a)
+
+ with warnings.catch_warnings():
+ warnings.filterwarnings('error', '', FutureWarning)
+ assert_raises(FutureWarning, np.equal, a, a)
+ assert_raises(FutureWarning, np.not_equal, a, a)
+ # And the other do not warn:
+ with np.errstate(invalid='ignore'):
+ np.less(a, a)
+ np.greater(a, a)
+ np.less_equal(a, a)
+ np.greater_equal(a, a)
+
+
+ def test_comparison_error(self):
+ class FunkyType(object):
+ def __eq__(self, other):
+ raise TypeError("I won't compare")
+ def __ne__(self, other):
+ raise TypeError("I won't compare")
+
+ a = np.array([FunkyType()])
+ self.assert_deprecated(np.equal, args=(a, a))
+ self.assert_deprecated(np.not_equal, args=(a, a))
+
+
+ def test_bool_error(self):
+ # The comparison result cannot be interpreted as a bool
+ a = np.array([np.array([1, 2, 3]), None], dtype=object)
+ self.assert_deprecated(np.equal, args=(a, a))
+ self.assert_deprecated(np.not_equal, args=(a, a))
+
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/core/tests/test_dtype.py b/numpy/core/tests/test_dtype.py
index 83017ea6a..18660351c 100644
--- a/numpy/core/tests/test_dtype.py
+++ b/numpy/core/tests/test_dtype.py
@@ -291,6 +291,53 @@ class TestSubarray(TestCase):
np.dtype(([('a', [('a', 'i4', 6)], (2, 1)), ('b', 'f8', (1, 3))], (2, 2))),
np.dtype(([('a', [('a', 'u4', 6)], (2, 1)), ('b', 'f8', (1, 3))], (2, 2))))
+ def test_shape_sequence(self):
+ # Any sequence of integers should work as shape, but the result
+ # should be a tuple (immutable) of base type integers.
+ a = np.array([1, 2, 3], dtype=np.int16)
+ l = [1, 2, 3]
+ # Array gets converted
+ dt = np.dtype([('a', 'f4', a)])
+ assert_(isinstance(dt['a'].shape, tuple))
+ assert_(isinstance(dt['a'].shape[0], int))
+ # List gets converted
+ dt = np.dtype([('a', 'f4', l)])
+ assert_(isinstance(dt['a'].shape, tuple))
+ #
+ class IntLike(object):
+ def __index__(self):
+ return 3
+ def __int__(self):
+ # (a PyNumber_Check fails without __int__)
+ return 3
+ dt = np.dtype([('a', 'f4', IntLike())])
+ assert_(isinstance(dt['a'].shape, tuple))
+ assert_(isinstance(dt['a'].shape[0], int))
+ dt = np.dtype([('a', 'f4', (IntLike(),))])
+ assert_(isinstance(dt['a'].shape, tuple))
+ assert_(isinstance(dt['a'].shape[0], int))
+
+ def test_shape_invalid(self):
+ # Check that the shape is valid.
+ max_int = np.iinfo(np.intc).max
+ max_intp = np.iinfo(np.intp).max
+ # Too large values (the datatype is part of this)
+ assert_raises(ValueError, np.dtype, [('a', 'f4', max_int // 4 + 1)])
+ assert_raises(ValueError, np.dtype, [('a', 'f4', max_int + 1)])
+ assert_raises(ValueError, np.dtype, [('a', 'f4', (max_int, 2))])
+ # Takes a different code path (fails earlier:
+ assert_raises(ValueError, np.dtype, [('a', 'f4', max_intp + 1)])
+ # Negative values
+ assert_raises(ValueError, np.dtype, [('a', 'f4', -1)])
+ assert_raises(ValueError, np.dtype, [('a', 'f4', (-1, -1))])
+
+ def test_alignment(self):
+ #Check that subarrays are aligned
+ t1 = np.dtype('1i4', align=True)
+ t2 = np.dtype('2i4', align=True)
+ assert_equal(t1.alignment, t2.alignment)
+
+
class TestMonsterType(TestCase):
"""Test deeply nested subtypes."""
def test1(self):
@@ -449,6 +496,10 @@ class TestString(TestCase):
# Issue gh-2798
a = np.array(['a'], dtype="O").astype(("O", [("name", "O")]))
+ def test_empty_string_to_object(self):
+ # Pull request #4722
+ np.array(["", ""]).astype(object)
+
class TestDtypeAttributeDeletion(object):
def test_dtype_non_writable_attributes_deletion(self):
@@ -472,6 +523,20 @@ class TestDtypeAttributeDeletion(object):
for s in attr:
assert_raises(AttributeError, delattr, dt, s)
+class TestDtypeAttributes(TestCase):
+
+ def test_name_builtin(self):
+ for t in np.typeDict.values():
+ name = t.__name__
+ if name.endswith('_'):
+ name = name[:-1]
+ assert_equal(np.dtype(t).name, name)
+
+ def test_name_dtype_subclass(self):
+ # Ticket #4357
+ class user_def_subcls(np.void): pass
+ assert_equal(np.dtype(user_def_subcls).name, 'user_def_subcls')
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/core/tests/test_einsum.py b/numpy/core/tests/test_einsum.py
index 31f94bf07..226bde0a3 100644
--- a/numpy/core/tests/test_einsum.py
+++ b/numpy/core/tests/test_einsum.py
@@ -31,6 +31,9 @@ class TestEinSum(TestCase):
# other keyword arguments are rejected
assert_raises(TypeError, np.einsum, "", 0, bad_arg=0)
+ # issue 4528 revealed a segfault with this call
+ assert_raises(TypeError, np.einsum, *(None,)*63)
+
# number of operands must match count in subscripts string
assert_raises(ValueError, np.einsum, "", 0, 0)
assert_raises(ValueError, np.einsum, ",", 0, [0], [0])
@@ -498,5 +501,73 @@ class TestEinSum(TestCase):
[[[1, 3], [3, 9], [5, 15], [7, 21]],
[[8, 16], [16, 32], [24, 48], [32, 64]]])
+ def test_einsum_broadcast(self):
+ # Issue #2455 change in handling ellipsis
+ # remove the 'middle broadcast' error
+ # only use the 'RIGHT' iteration in prepare_op_axes
+ # adds auto broadcast on left where it belongs
+ # broadcast on right has to be explicit
+
+ A = np.arange(2*3*4).reshape(2,3,4)
+ B = np.arange(3)
+ ref = np.einsum('ijk,j->ijk',A, B)
+ assert_equal(np.einsum('ij...,j...->ij...',A, B), ref)
+ assert_equal(np.einsum('ij...,...j->ij...',A, B), ref)
+ assert_equal(np.einsum('ij...,j->ij...',A, B), ref) # used to raise error
+
+ A = np.arange(12).reshape((4,3))
+ B = np.arange(6).reshape((3,2))
+ ref = np.einsum('ik,kj->ij', A, B)
+ assert_equal(np.einsum('ik...,k...->i...', A, B), ref)
+ assert_equal(np.einsum('ik...,...kj->i...j', A, B), ref)
+ assert_equal(np.einsum('...k,kj', A, B), ref) # used to raise error
+ assert_equal(np.einsum('ik,k...->i...', A, B), ref) # used to raise error
+
+ dims=[2,3,4,5];
+ a = np.arange(np.prod(dims)).reshape(dims)
+ v = np.arange(dims[2])
+ ref = np.einsum('ijkl,k->ijl', a, v)
+ assert_equal(np.einsum('ijkl,k', a, v), ref)
+ assert_equal(np.einsum('...kl,k', a, v), ref) # used to raise error
+ assert_equal(np.einsum('...kl,k...', a, v), ref)
+ # no real diff from 1st
+
+ J,K,M=160,160,120;
+ A=np.arange(J*K*M).reshape(1,1,1,J,K,M)
+ B=np.arange(J*K*M*3).reshape(J,K,M,3)
+ ref = np.einsum('...lmn,...lmno->...o', A, B)
+ assert_equal(np.einsum('...lmn,lmno->...o', A, B), ref) # used to raise error
+
+ def test_einsum_fixedstridebug(self):
+ # Issue #4485 obscure einsum bug
+ # This case revealed a bug in nditer where it reported a stride
+ # as 'fixed' (0) when it was in fact not fixed during processing
+ # (0 or 4). The reason for the bug was that the check for a fixed
+ # stride was using the information from the 2D inner loop reuse
+ # to restrict the iteration dimensions it had to validate to be
+ # the same, but that 2D inner loop reuse logic is only triggered
+ # during the buffer copying step, and hence it was invalid to
+ # rely on those values. The fix is to check all the dimensions
+ # of the stride in question, which in the test case reveals that
+ # the stride is not fixed.
+ #
+ # NOTE: This test is triggered by the fact that the default buffersize,
+ # used by einsum, is 8192, and 3*2731 = 8193, is larger than that
+ # and results in a mismatch between the buffering and the
+ # striding for operand A.
+ A = np.arange(2*3).reshape(2,3).astype(np.float32)
+ B = np.arange(2*3*2731).reshape(2,3,2731).astype(np.int16)
+ es = np.einsum('cl,cpx->lpx', A, B)
+ tp = np.tensordot(A, B, axes=(0, 0))
+ assert_equal(es, tp)
+ # The following is the original test case from the bug report,
+ # made repeatable by changing random arrays to aranges.
+ A = np.arange(3*3).reshape(3,3).astype(np.float64)
+ B = np.arange(3*3*64*64).reshape(3,3,64,64).astype(np.float32)
+ es = np.einsum ('cl,cpxy->lpxy', A,B)
+ tp = np.tensordot(A,B, axes=(0,0))
+ assert_equal(es, tp)
+
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/core/tests/test_function_base.py b/numpy/core/tests/test_function_base.py
index b43452e1c..f6ffd5a10 100644
--- a/numpy/core/tests/test_function_base.py
+++ b/numpy/core/tests/test_function_base.py
@@ -1,8 +1,7 @@
from __future__ import division, absolute_import, print_function
from numpy.testing import *
-from numpy import logspace, linspace, dtype
-
+from numpy import logspace, linspace, dtype, array
class TestLogspace(TestCase):
@@ -55,3 +54,58 @@ class TestLinspace(TestCase):
assert_equal(y.dtype, dtype('float64'))
y = linspace(0, 6, dtype='int32')
assert_equal(y.dtype, dtype('int32'))
+
+ def test_array_scalar(self):
+ lim1 = array([-120, 100], dtype="int8")
+ lim2 = array([120, -100], dtype="int8")
+ lim3 = array([1200, 1000], dtype="uint16")
+ t1 = linspace(lim1[0], lim1[1], 5)
+ t2 = linspace(lim2[0], lim2[1], 5)
+ t3 = linspace(lim3[0], lim3[1], 5)
+ t4 = linspace(-120.0, 100.0, 5)
+ t5 = linspace(120.0, -100.0, 5)
+ t6 = linspace(1200.0, 1000.0, 5)
+ assert_equal(t1, t4)
+ assert_equal(t2, t5)
+ assert_equal(t3, t6)
+
+ def test_complex(self):
+ lim1 = linspace(1 + 2j, 3 + 4j, 5)
+ t1 = array([ 1.0+2.j , 1.5+2.5j, 2.0+3.j , 2.5+3.5j, 3.0+4.j])
+ lim2 = linspace(1j, 10, 5)
+ t2 = array([ 0.0+1.j , 2.5+0.75j, 5.0+0.5j , 7.5+0.25j, 10.0+0.j])
+ assert_equal(lim1, t1)
+ assert_equal(lim2, t2)
+
+ def test_physical_quantities(self):
+ class PhysicalQuantity(float):
+ def __new__(cls, value):
+ return float.__new__(cls, value)
+
+ def __add__(self, x):
+ assert_(isinstance(x, PhysicalQuantity))
+ return PhysicalQuantity(float(x) + float(self))
+ __radd__ = __add__
+
+ def __sub__(self, x):
+ assert_(isinstance(x, PhysicalQuantity))
+ return PhysicalQuantity(float(self) - float(x))
+
+ def __rsub__(self, x):
+ assert_(isinstance(x, PhysicalQuantity))
+ return PhysicalQuantity(float(x) - float(self))
+
+ def __mul__(self, x):
+ return PhysicalQuantity(float(x) * float(self))
+ __rmul__ = __mul__
+
+ def __div__(self, x):
+ return PhysicalQuantity(float(self) / float(x))
+
+ def __rdiv__(self, x):
+ return PhysicalQuantity(float(x) / float(self))
+
+
+ a = PhysicalQuantity(0.0)
+ b = PhysicalQuantity(1.0)
+ assert_equal(linspace(a, b), linspace(0.0, 1.0)) \ No newline at end of file
diff --git a/numpy/core/tests/test_indexing.py b/numpy/core/tests/test_indexing.py
index ad792eb08..bb1341455 100644
--- a/numpy/core/tests/test_indexing.py
+++ b/numpy/core/tests/test_indexing.py
@@ -1,10 +1,20 @@
from __future__ import division, absolute_import, print_function
+import sys
+import warnings
+import functools
+
import numpy as np
+from numpy.core.multiarray_tests import array_indexing
from itertools import product
-from numpy.compat import asbytes
from numpy.testing import *
-import sys, warnings, gc
+
+
+try:
+ cdll = np.ctypeslib.load_library('multiarray', np.core.multiarray.__file__)
+ _HAS_CTYPE = True
+except ImportError:
+ _HAS_CTYPE = False
class TestIndexing(TestCase):
@@ -22,6 +32,36 @@ class TestIndexing(TestCase):
a = np.array(0)
assert_(isinstance(a[()], np.int_))
+ # Regression, it needs to fall through integer and fancy indexing
+ # cases, so need the with statement to ignore the non-integer error.
+ with warnings.catch_warnings():
+ warnings.filterwarnings('ignore', '', DeprecationWarning)
+ a = np.array([1.])
+ assert_(isinstance(a[0.], np.float_))
+
+ a = np.array([np.array(1)], dtype=object)
+ assert_(isinstance(a[0.], np.ndarray))
+
+ def test_same_kind_index_casting(self):
+ # Indexes should be cast with same-kind and not safe, even if
+ # that is somewhat unsafe. So test various different code paths.
+ index = np.arange(5)
+ u_index = index.astype(np.uintp)
+ arr = np.arange(10)
+
+ assert_array_equal(arr[index], arr[u_index])
+ arr[u_index] = np.arange(5)
+ assert_array_equal(arr, np.arange(10))
+
+ arr = np.arange(10).reshape(5, 2)
+ assert_array_equal(arr[index], arr[u_index])
+
+ arr[u_index] = np.arange(5)[:,None]
+ assert_array_equal(arr, np.arange(5)[:,None].repeat(2, axis=1))
+
+ arr = np.arange(25).reshape(5, 5)
+ assert_array_equal(arr[u_index, u_index], arr[index, index])
+
def test_empty_fancy_index(self):
# Empty list index creates an empty array
# with the same dtype (but with weird shape)
@@ -42,7 +82,7 @@ class TestIndexing(TestCase):
[4, 5, 6],
[7, 8, 9]])
assert_equal(a[...], a)
- assert_(a[...] is a)
+ assert_(a[...].base is a) # `a[...]` was `a` in numpy <1.9.)
# Slicing with ellipsis can skip an
# arbitrary number of dimensions
@@ -85,8 +125,14 @@ class TestIndexing(TestCase):
#assert_equal(a[False], a[0])
# Same with NumPy boolean scalar
- assert_equal(a[np.array(True)], a[1])
- assert_equal(a[np.array(False)], a[0])
+ # Before DEPRECATE, this is an error (as always, but telling about
+ # future change):
+ assert_raises(IndexError, a.__getitem__, np.array(True))
+ assert_raises(IndexError, a.__getitem__, np.array(False))
+ # After DEPRECATE, this behaviour can be enabled:
+ #assert_equal(a[np.array(True)], a[None])
+ #assert_equal(a[np.array(False), a[None][0:0]])
+
def test_boolean_indexing_onedim(self):
# Indexing a 2-dimensional array with
@@ -98,9 +144,10 @@ class TestIndexing(TestCase):
a[b] = 1.
assert_equal(a, [[1., 1., 1.]])
+
def test_boolean_assignment_value_mismatch(self):
# A boolean assignment should fail when the shape of the values
- # cannot be broadcasted to the subscription. (see also gh-3458)
+ # cannot be broadcast to the subscription. (see also gh-3458)
a = np.arange(4)
def f(a, v):
a[a > -1] = v
@@ -109,6 +156,7 @@ class TestIndexing(TestCase):
assert_raises(ValueError, f, a, [1, 2, 3])
assert_raises(ValueError, f, a[:1], [1, 2, 3])
+
def test_boolean_indexing_twodim(self):
# Indexing a 2-dimensional array with
# 2-dimensional boolean array
@@ -129,16 +177,371 @@ class TestIndexing(TestCase):
[0, 8, 0]])
+ def test_reverse_strides_and_subspace_bufferinit(self):
+ # This tests that the strides are not reversed for simple and
+ # subspace fancy indexing.
+ a = np.ones(5)
+ b = np.zeros(5, dtype=np.intp)[::-1]
+ c = np.arange(5)[::-1]
+
+ a[b] = c
+ # If the strides are not reversed, the 0 in the arange comes last.
+ assert_equal(a[0], 0)
+
+ # This also tests that the subspace buffer is initialized:
+ a = np.ones((5, 2))
+ c = np.arange(10).reshape(5, 2)[::-1]
+ a[b, :] = c
+ assert_equal(a[0], [0, 1])
+
+ def test_reversed_strides_result_allocation(self):
+ # Test a bug when calculating the output strides for a result array
+ # when the subspace size was 1 (and test other cases as well)
+ a = np.arange(10)[:, None]
+ i = np.arange(10)[::-1]
+ assert_array_equal(a[i], a[i.copy('C')])
+
+ a = np.arange(20).reshape(-1, 2)
+
+
+ def test_uncontiguous_subspace_assignment(self):
+ # During development there was a bug activating a skip logic
+ # based on ndim instead of size.
+ a = np.full((3, 4, 2), -1)
+ b = np.full((3, 4, 2), -1)
+
+ a[[0, 1]] = np.arange(2 * 4 * 2).reshape(2, 4, 2).T
+ b[[0, 1]] = np.arange(2 * 4 * 2).reshape(2, 4, 2).T.copy()
+
+ assert_equal(a, b)
+
+
+ def test_too_many_fancy_indices_special_case(self):
+ # Just documents behaviour, this is a small limitation.
+ a = np.ones((1,) * 32) # 32 is NPY_MAXDIMS
+ assert_raises(IndexError, a.__getitem__, (np.array([0]),) * 32)
+
+
+ def test_scalar_array_bool(self):
+ # Numpy bools can be used as boolean index (python ones as of yet not)
+ a = np.array(1)
+ assert_equal(a[np.bool_(True)], a[np.array(True)])
+ assert_equal(a[np.bool_(False)], a[np.array(False)])
+
+ # After deprecating bools as integers:
+ #a = np.array([0,1,2])
+ #assert_equal(a[True, :], a[None, :])
+ #assert_equal(a[:, True], a[:, None])
+ #
+ #assert_(not np.may_share_memory(a, a[True, :]))
+
+
+ def test_everything_returns_views(self):
+ # Before `...` would return a itself.
+ a = np.arange(5)
+
+ assert_(a is not a[()])
+ assert_(a is not a[...])
+ assert_(a is not a[:])
+
+
+ def test_broaderrors_indexing(self):
+ a = np.zeros((5, 5))
+ assert_raises(IndexError, a.__getitem__, ([0, 1], [0, 1, 2]))
+ assert_raises(IndexError, a.__setitem__, ([0, 1], [0, 1, 2]), 0)
+
+
+ def test_trivial_fancy_out_of_bounds(self):
+ a = np.zeros(5)
+ ind = np.ones(20, dtype=np.intp)
+ ind[-1] = 10
+ assert_raises(IndexError, a.__getitem__, ind)
+ assert_raises(IndexError, a.__setitem__, ind, 0)
+ ind = np.ones(20, dtype=np.intp)
+ ind[0] = 11
+ assert_raises(IndexError, a.__getitem__, ind)
+ assert_raises(IndexError, a.__setitem__, ind, 0)
+
+
+ def test_nonbaseclass_values(self):
+ class SubClass(np.ndarray):
+ def __array_finalize__(self, old):
+ # Have array finalize do funny things
+ self.fill(99)
+
+ a = np.zeros((5, 5))
+ s = a.copy().view(type=SubClass)
+ s.fill(1)
+
+ a[[0, 1, 2, 3, 4], :] = s
+ assert_((a == 1).all())
+
+ # Subspace is last, so transposing might want to finalize
+ a[:, [0, 1, 2, 3, 4]] = s
+ assert_((a == 1).all())
+
+ a.fill(0)
+ a[...] = s
+ assert_((a == 1).all())
+
+
+ def test_subclass_writeable(self):
+ d = np.rec.array([('NGC1001', 11), ('NGC1002', 1.), ('NGC1003', 1.)],
+ dtype=[('target', 'S20'), ('V_mag', '>f4')])
+ ind = np.array([False, True, True], dtype=bool)
+ assert_(d[ind].flags.writeable)
+ ind = np.array([0, 1])
+ assert_(d[ind].flags.writeable)
+ assert_(d[...].flags.writeable)
+ assert_(d[0].flags.writeable)
+
+
+ def test_memory_order(self):
+ # This is not necessary to preserve. Memory layouts for
+ # more complex indices are not as simple.
+ a = np.arange(10)
+ b = np.arange(10).reshape(5,2).T
+ assert_(a[b].flags.f_contiguous)
+
+ # Takes a different implementation branch:
+ a = a.reshape(-1, 1)
+ assert_(a[b, 0].flags.f_contiguous)
+
+
+ def test_scalar_return_type(self):
+ # Full scalar indices should return scalars and object
+ # arrays should not call PyArray_Return on their items
+ class Zero(object):
+ # The most basic valid indexing
+ def __index__(self):
+ return 0
+ z = Zero()
+
+ class ArrayLike(object):
+ # Simple array, should behave like the array
+ def __array__(self):
+ return np.array(0)
+
+ a = np.zeros(())
+ assert_(isinstance(a[()], np.float_))
+ a = np.zeros(1)
+ assert_(isinstance(a[z], np.float_))
+ a = np.zeros((1, 1))
+ assert_(isinstance(a[z, np.array(0)], np.float_))
+ assert_(isinstance(a[z, ArrayLike()], np.float_))
+
+ # And object arrays do not call it too often:
+ b = np.array(0)
+ a = np.array(0, dtype=object)
+ a[()] = b
+ assert_(isinstance(a[()], np.ndarray))
+ a = np.array([b, None])
+ assert_(isinstance(a[z], np.ndarray))
+ a = np.array([[b, None]])
+ assert_(isinstance(a[z, np.array(0)], np.ndarray))
+ assert_(isinstance(a[z, ArrayLike()], np.ndarray))
+
+
+ def test_small_regressions(self):
+ # Reference count of intp for index checks
+ a = np.array([0])
+ refcount = sys.getrefcount(np.dtype(np.intp))
+ # item setting always checks indices in separate function:
+ a[np.array([0], dtype=np.intp)] = 1
+ a[np.array([0], dtype=np.uint8)] = 1
+ assert_raises(IndexError, a.__setitem__,
+ np.array([1], dtype=np.intp), 1)
+ assert_raises(IndexError, a.__setitem__,
+ np.array([1], dtype=np.uint8), 1)
+
+ assert_equal(sys.getrefcount(np.dtype(np.intp)), refcount)
+
+ def test_unaligned(self):
+ v = (np.zeros(64, dtype=np.int8) + ord('a'))[1:-7]
+ d = v.view(np.dtype("S8"))
+ # unaligned source
+ x = (np.zeros(16, dtype=np.int8) + ord('a'))[1:-7]
+ x = x.view(np.dtype("S8"))
+ x[...] = np.array("b" * 8, dtype="S")
+ b = np.arange(d.size)
+ #trivial
+ assert_equal(d[b], d)
+ d[b] = x
+ # nontrivial
+ # unaligned index array
+ b = np.zeros(d.size + 1).view(np.int8)[1:-(np.intp(0).itemsize - 1)]
+ b = b.view(np.intp)[:d.size]
+ b[...] = np.arange(d.size)
+ assert_equal(d[b.astype(np.int16)], d)
+ d[b.astype(np.int16)] = x
+ # boolean
+ d[b % 2 == 0]
+ d[b % 2 == 0] = x[::2]
+
+
+class TestFieldIndexing(TestCase):
+ def test_scalar_return_type(self):
+ # Field access on an array should return an array, even if it
+ # is 0-d.
+ a = np.zeros((), [('a','f8')])
+ assert_(isinstance(a['a'], np.ndarray))
+ assert_(isinstance(a[['a']], np.ndarray))
+
+
+class TestBroadcastedAssignments(TestCase):
+ def assign(self, a, ind, val):
+ a[ind] = val
+ return a
+
+
+ def test_prepending_ones(self):
+ a = np.zeros((3, 2))
+
+ a[...] = np.ones((1, 3, 2))
+ # Fancy with subspace with and without transpose
+ a[[0, 1, 2], :] = np.ones((1, 3, 2))
+ a[:, [0, 1]] = np.ones((1, 3, 2))
+ # Fancy without subspace (with broadcasting)
+ a[[[0], [1], [2]], [0, 1]] = np.ones((1, 3, 2))
+
+
+ def test_prepend_not_one(self):
+ assign = self.assign
+ s_ = np.s_
+
+ a = np.zeros(5)
+
+ # Too large and not only ones.
+ assert_raises(ValueError, assign, a, s_[...], np.ones((2, 1)))
+
+ with warnings.catch_warnings():
+ # Will be a ValueError as well.
+ warnings.simplefilter("error", DeprecationWarning)
+ assert_raises(DeprecationWarning, assign, a, s_[[1, 2, 3],],
+ np.ones((2, 1)))
+ assert_raises(DeprecationWarning, assign, a, s_[[[1], [2]],],
+ np.ones((2,2,1)))
+
+
+ def test_simple_broadcasting_errors(self):
+ assign = self.assign
+ s_ = np.s_
+
+ a = np.zeros((5, 1))
+ assert_raises(ValueError, assign, a, s_[...], np.zeros((5, 2)))
+ assert_raises(ValueError, assign, a, s_[...], np.zeros((5, 0)))
+
+ assert_raises(ValueError, assign, a, s_[:, [0]], np.zeros((5, 2)))
+ assert_raises(ValueError, assign, a, s_[:, [0]], np.zeros((5, 0)))
+
+ assert_raises(ValueError, assign, a, s_[[0], :], np.zeros((2, 1)))
+
+
+ def test_index_is_larger(self):
+ # Simple case of fancy index broadcasting of the index.
+ a = np.zeros((5, 5))
+ a[[[0], [1], [2]], [0, 1, 2]] = [2, 3, 4]
+
+ assert_((a[:3, :3] == [2, 3, 4]).all())
+
+
+ def test_broadcast_subspace(self):
+ a = np.zeros((100, 100))
+ v = np.arange(100)[:,None]
+ b = np.arange(100)[::-1]
+ a[b] = v
+ assert_((a[::-1] == v).all())
+
+
+class TestSubclasses(TestCase):
+ def test_basic(self):
+ class SubClass(np.ndarray):
+ pass
+
+ s = np.arange(5).view(SubClass)
+ assert_(isinstance(s[:3], SubClass))
+ assert_(s[:3].base is s)
+
+ assert_(isinstance(s[[0, 1, 2]], SubClass))
+ assert_(isinstance(s[s > 0], SubClass))
+
+
+ def test_matrix_fancy(self):
+ # The matrix class messes with the shape. While this is always
+ # weird (getitem is not used, it does not have setitem nor knows
+ # about fancy indexing), this tests gh-3110
+ m = np.matrix([[1, 2], [3, 4]])
+
+ assert_(isinstance(m[[0,1,0], :], np.matrix))
+
+ # gh-3110. Note the transpose currently because matrices do *not*
+ # support dimension fixing for fancy indexing correctly.
+ x = np.asmatrix(np.arange(50).reshape(5,10))
+ assert_equal(x[:2, np.array(-1)], x[:2, -1].T)
+
+
+ def test_finalize_gets_full_info(self):
+ # Array finalize should be called on the filled array.
+ class SubClass(np.ndarray):
+ def __array_finalize__(self, old):
+ self.finalize_status = np.array(self)
+ self.old = old
+
+ s = np.arange(10).view(SubClass)
+ new_s = s[:3]
+ assert_array_equal(new_s.finalize_status, new_s)
+ assert_array_equal(new_s.old, s)
+
+ new_s = s[[0,1,2,3]]
+ assert_array_equal(new_s.finalize_status, new_s)
+ assert_array_equal(new_s.old, s)
+
+ new_s = s[s > 0]
+ assert_array_equal(new_s.finalize_status, new_s)
+ assert_array_equal(new_s.old, s)
+
+
+class TestFancyIndexingEquivalence(TestCase):
+ def test_object_assign(self):
+ # Check that the field and object special case using copyto is active.
+ # The right hand side cannot be converted to an array here.
+ a = np.arange(5, dtype=object)
+ b = a.copy()
+ a[:3] = [1, (1,2), 3]
+ b[[0, 1, 2]] = [1, (1,2), 3]
+ assert_array_equal(a, b)
+
+ # test same for subspace fancy indexing
+ b = np.arange(5, dtype=object)[None, :]
+ b[[0], :3] = [[1, (1,2), 3]]
+ assert_array_equal(a, b[0])
+
+
+ def test_cast_equivalence(self):
+ # Yes, normal slicing uses unsafe casting.
+ a = np.arange(5)
+ b = a.copy()
+
+ a[:3] = np.array(['2', '-3', '-1'])
+ b[[0, 2, 1]] = np.array(['2', '-1', '-3'])
+ assert_array_equal(a, b)
+
+ # test the same for subspace fancy indexing
+ b = np.arange(5)[None, :]
+ b[[0], :3] = np.array([['2', '-3', '-1']])
+ assert_array_equal(a, b[0])
+
+
class TestMultiIndexingAutomated(TestCase):
"""
These test use code to mimic the C-Code indexing for selection.
NOTE: * This still lacks tests for complex item setting.
- * If you change behavoir of indexing, you might want to modify
+ * If you change behavior of indexing, you might want to modify
these tests to try more combinations.
* Behavior was written to match numpy version 1.8. (though a
first version matched 1.7.)
- * Only tuple indicies are supported by the mimicing code.
+ * Only tuple indices are supported by the mimicking code.
(and tested as of writing this)
* Error types should match most of the time as long as there
is only one error. For multiple errors, what gets raised
@@ -161,11 +564,11 @@ class TestMultiIndexingAutomated(TestCase):
slice(4, -1, -2),
slice(None, None, -3),
# Some Fancy indexes:
- np.empty((0, 1, 1), dtype=np.intp), # empty broadcastable
+ np.empty((0, 1, 1), dtype=np.intp), # empty and can be broadcast
np.array([0, 1, -2]),
np.array([[2], [0], [1]]),
- np.array([[0, -1], [0, 1]]),
- np.array([2, -1]),
+ np.array([[0, -1], [0, 1]], dtype=np.dtype('intp').newbyteorder()),
+ np.array([2, -1], dtype=np.int8),
np.zeros([1]*31, dtype=int), # trigger too large array.
np.array([0., 1.])] # invalid datatype
# Some simpler indices that still cover a bit more
@@ -208,7 +611,7 @@ class TestMultiIndexingAutomated(TestCase):
fancy_dim = 0
# NOTE: This is a funny twist (and probably OK to change).
# The boolean array has illegal indexes, but this is
- # allowed if the broadcasted fancy-indices are 0-sized.
+ # allowed if the broadcast fancy-indices are 0-sized.
# This variable is to catch that case.
error_unless_broadcast_to_empty = False
@@ -231,9 +634,7 @@ class TestMultiIndexingAutomated(TestCase):
if ellipsis_pos is None:
ellipsis_pos = i
continue # do not increment ndim counter
- in_indices[i] = slice(None, None)
- ndim += 1
- continue
+ raise IndexError
if isinstance(indx, slice):
ndim += 1
continue
@@ -255,7 +656,7 @@ class TestMultiIndexingAutomated(TestCase):
if arr.ndim - ndim < 0:
# we can't take more dimensions then we have, not even for 0-d arrays.
# since a[()] makes sense, but not a[(),]. We will raise an error
- # lateron, unless a broadcasting error occurs first.
+ # later on, unless a broadcasting error occurs first.
raise IndexError
if ndim == 0 and not None in in_indices:
@@ -267,7 +668,7 @@ class TestMultiIndexingAutomated(TestCase):
for ax, indx in enumerate(in_indices):
if isinstance(indx, slice):
- # convert to an index array anways:
+ # convert to an index array
indx = np.arange(*indx.indices(arr.shape[ax]))
indices.append(['s', indx])
continue
@@ -300,10 +701,23 @@ class TestMultiIndexingAutomated(TestCase):
indx = flat_indx
else:
# This could be changed, a 0-d boolean index can
- # make sense (even outide the 0-d indexed array case)
+ # make sense (even outside the 0-d indexed array case)
# Note that originally this is could be interpreted as
# integer in the full integer special case.
raise IndexError
+ else:
+ # If the index is a singleton, the bounds check is done
+ # before the broadcasting. This used to be different in <1.9
+ if indx.ndim == 0:
+ if indx >= arr.shape[ax] or indx < -arr.shape[ax]:
+ raise IndexError
+ if indx.ndim == 0:
+ # The index is a scalar. This used to be two fold, but if fancy
+ # indexing was active, the check was done later, possibly
+ # after broadcasting it away (1.7. or earlier). Now it is always
+ # done.
+ if indx >= arr.shape[ax] or indx < - arr.shape[ax]:
+ raise IndexError
if len(indices) > 0 and indices[-1][0] == 'f' and ax != ellipsis_pos:
# NOTE: There could still have been a 0-sized Ellipsis
# between them. Checked that with ellipsis_pos.
@@ -339,7 +753,7 @@ class TestMultiIndexingAutomated(TestCase):
arr = arr.transpose(*(fancy_axes + axes))
# We only have one 'f' index now and arr is transposed accordingly.
- # Now handle newaxes by reshaping...
+ # Now handle newaxis by reshaping...
ax = 0
for indx in indices:
if indx[0] == 'f':
@@ -357,7 +771,7 @@ class TestMultiIndexingAutomated(TestCase):
res = np.broadcast(*indx[1:]) # raises ValueError...
else:
res = indx[1]
- # unfortunatly the indices might be out of bounds. So check
+ # unfortunately the indices might be out of bounds. So check
# that first, and use mode='wrap' then. However only if
# there are any indices...
if res.size != 0:
@@ -495,7 +909,7 @@ class TestMultiIndexingAutomated(TestCase):
# spot and the simple ones in one other spot.
with warnings.catch_warnings():
# This is so that np.array(True) is not accepted in a full integer
- # index, when running the file seperatly.
+ # index, when running the file separately.
warnings.filterwarnings('error', '', DeprecationWarning)
for simple_pos in [0, 2, 3]:
tocheck = [self.fill_indices, self.complex_indices,
@@ -524,6 +938,44 @@ class TestMultiIndexingAutomated(TestCase):
self._check_single_index(a, index)
+class TestCApiAccess(TestCase):
+ def test_getitem(self):
+ subscript = functools.partial(array_indexing, 0)
+
+ # 0-d arrays don't work:
+ assert_raises(IndexError, subscript, np.ones(()), 0)
+ # Out of bound values:
+ assert_raises(IndexError, subscript, np.ones(10), 11)
+ assert_raises(IndexError, subscript, np.ones(10), -11)
+ assert_raises(IndexError, subscript, np.ones((10, 10)), 11)
+ assert_raises(IndexError, subscript, np.ones((10, 10)), -11)
+
+ a = np.arange(10)
+ assert_array_equal(a[4], subscript(a, 4))
+ a = a.reshape(5, 2)
+ assert_array_equal(a[-4], subscript(a, -4))
+
+ def test_setitem(self):
+ assign = functools.partial(array_indexing, 1)
+
+ # Deletion is impossible:
+ assert_raises(ValueError, assign, np.ones(10), 0)
+ # 0-d arrays don't work:
+ assert_raises(IndexError, assign, np.ones(()), 0, 0)
+ # Out of bound values:
+ assert_raises(IndexError, assign, np.ones(10), 11, 0)
+ assert_raises(IndexError, assign, np.ones(10), -11, 0)
+ assert_raises(IndexError, assign, np.ones((10, 10)), 11, 0)
+ assert_raises(IndexError, assign, np.ones((10, 10)), -11, 0)
+
+ a = np.arange(10)
+ assign(a, 4, 10)
+ assert_(a[4] == 10)
+
+ a = a.reshape(5, 2)
+ assign(a, 4, 10)
+ assert_array_equal(a[-1], [10, 10])
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/core/tests/test_item_selection.py b/numpy/core/tests/test_item_selection.py
index e501588c9..d8e9e6fd0 100644
--- a/numpy/core/tests/test_item_selection.py
+++ b/numpy/core/tests/test_item_selection.py
@@ -60,6 +60,11 @@ class TestTake(TestCase):
del a
assert_(all(sys.getrefcount(o) == 3 for o in objects))
+ def test_unicode_mode(self):
+ d = np.arange(10)
+ k = b'\xc3\xa4'.decode("UTF8")
+ assert_raises(ValueError, d.take, 5, mode=k)
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/core/tests/test_memmap.py b/numpy/core/tests/test_memmap.py
index 6de6319ef..b364f5eb9 100644
--- a/numpy/core/tests/test_memmap.py
+++ b/numpy/core/tests/test_memmap.py
@@ -1,8 +1,9 @@
from __future__ import division, absolute_import, print_function
import sys
-from tempfile import NamedTemporaryFile, TemporaryFile, mktemp
+from tempfile import NamedTemporaryFile, TemporaryFile, mktemp, mkdtemp
import os
+import shutil
from numpy import memmap
from numpy import arange, allclose, asarray
@@ -11,6 +12,7 @@ from numpy.testing import *
class TestMemmap(TestCase):
def setUp(self):
self.tmpfp = NamedTemporaryFile(prefix='mmap')
+ self.tempdir = mkdtemp()
self.shape = (3, 4)
self.dtype = 'float32'
self.data = arange(12, dtype=self.dtype)
@@ -18,6 +20,7 @@ class TestMemmap(TestCase):
def tearDown(self):
self.tmpfp.close()
+ shutil.rmtree(self.tempdir)
def test_roundtrip(self):
# Write data to file
@@ -33,12 +36,11 @@ class TestMemmap(TestCase):
assert_array_equal(self.data, newfp)
def test_open_with_filename(self):
- tmpname = mktemp('', 'mmap')
+ tmpname = mktemp('', 'mmap', dir=self.tempdir)
fp = memmap(tmpname, dtype=self.dtype, mode='w+',
shape=self.shape)
fp[:] = self.data[:]
del fp
- os.unlink(tmpname)
def test_unnamed_file(self):
with TemporaryFile() as f:
@@ -55,7 +57,7 @@ class TestMemmap(TestCase):
del fp
def test_filename(self):
- tmpname = mktemp('', 'mmap')
+ tmpname = mktemp('', 'mmap', dir=self.tempdir)
fp = memmap(tmpname, dtype=self.dtype, mode='w+',
shape=self.shape)
abspath = os.path.abspath(tmpname)
@@ -65,7 +67,6 @@ class TestMemmap(TestCase):
self.assertEqual(abspath, b.filename)
del b
del fp
- os.unlink(tmpname)
def test_filename_fileobj(self):
fp = memmap(self.tmpfp, dtype=self.dtype, mode="w+",
diff --git a/numpy/core/tests/test_multiarray.py b/numpy/core/tests/test_multiarray.py
index 6336d41c7..cb5c0095c 100644
--- a/numpy/core/tests/test_multiarray.py
+++ b/numpy/core/tests/test_multiarray.py
@@ -3,6 +3,7 @@ from __future__ import division, absolute_import, print_function
import tempfile
import sys
import os
+import shutil
import warnings
import operator
import io
@@ -10,6 +11,8 @@ if sys.version_info[0] >= 3:
import builtins
else:
import __builtin__ as builtins
+from decimal import Decimal
+
import numpy as np
from nose import SkipTest
@@ -294,8 +297,8 @@ class TestZeroRank(TestCase):
a, b = self.d
self.assertEqual(a[...], 0)
self.assertEqual(b[...], 'x')
- self.assertTrue(a[...] is a)
- self.assertTrue(b[...] is b)
+ self.assertTrue(a[...].base is a) # `a[...] is a` in numpy <1.9.
+ self.assertTrue(b[...].base is b) # `b[...] is b` in numpy <1.9.
def test_empty_subscript(self):
a, b = self.d
@@ -508,6 +511,22 @@ class TestCreation(TestCase):
assert_array_equal(d, [0] * 13)
assert_equal(np.count_nonzero(d), 0)
+ def test_sequence_non_homogenous(self):
+ assert_equal(np.array([4, 2**80]).dtype, np.object)
+ assert_equal(np.array([4, 2**80, 4]).dtype, np.object)
+ assert_equal(np.array([2**80, 4]).dtype, np.object)
+ assert_equal(np.array([2**80] * 3).dtype, np.object)
+ assert_equal(np.array([[1, 1],[1j, 1j]]).dtype, np.complex)
+ assert_equal(np.array([[1j, 1j],[1, 1]]).dtype, np.complex)
+ assert_equal(np.array([[1, 1, 1],[1, 1j, 1.], [1, 1, 1]]).dtype, np.complex)
+
+ @dec.skipif(sys.version_info[0] >= 3)
+ def test_sequence_long(self):
+ assert_equal(np.array([long(4), long(4)]).dtype, np.long)
+ assert_equal(np.array([long(4), 2**80]).dtype, np.object)
+ assert_equal(np.array([long(4), 2**80, long(4)]).dtype, np.object)
+ assert_equal(np.array([2**80, long(4)]).dtype, np.object)
+
def test_non_sequence_sequence(self):
"""Should not segfault.
@@ -542,8 +561,9 @@ class TestStructured(TestCase):
a = np.zeros((3, 5), dtype=[('a', ('i4', (2, 2)))])
a['a'] = np.arange(60).reshape(3, 5, 2, 2)
- # Since the subarray is always in C-order, these aren't equal
- assert_(np.any(a['a'].T != a.T['a']))
+ # Since the subarray is always in C-order, a transpose
+ # does not swap the subarray:
+ assert_array_equal(a.T['a'], a['a'].transpose(1, 0, 2, 3))
# In Fortran order, the subarray gets appended
# like in all other cases, not prepended as a special case
@@ -604,6 +624,12 @@ class TestStructured(TestCase):
y = np.zeros((1,), dtype=[('a', ('f4', (2,))), ('b', 'i1')])
assert_equal(x == y, False)
+ # Check that structured arrays that are different only in
+ # byte-order work
+ a = np.array([(5, 42), (10, 1)], dtype=[('a', '>i8'), ('b', '<f8')])
+ b = np.array([(5, 43), (10, 1)], dtype=[('a', '<i8'), ('b', '>f8')])
+ assert_equal(a == b, [False, True])
+
class TestBool(TestCase):
def test_test_interning(self):
@@ -653,6 +679,16 @@ class TestBool(TestCase):
# covers all cases of the 16 byte unrolled code
self.check_count_nonzero(17, 17)
+ def test_count_nonzero_unaligned(self):
+ # prevent mistakes as e.g. gh-4060
+ for o in range(7):
+ a = np.zeros((18,), dtype=np.bool)[o+1:]
+ a[:o] = True
+ self.assertEqual(np.count_nonzero(a), builtins.sum(a.tolist()))
+ a = np.ones((18,), dtype=np.bool)[o+1:]
+ a[:o] = False
+ self.assertEqual(np.count_nonzero(a), builtins.sum(a.tolist()))
+
class TestMethods(TestCase):
def test_test_round(self):
assert_equal(array([1.2, 1.5]).round(), [1, 2])
@@ -994,6 +1030,12 @@ class TestMethods(TestCase):
a = np.array(['aaaaaaaaa' for i in range(100)], dtype=np.unicode)
assert_equal(a.argsort(kind='m'), r)
+ def test_sort_unicode_kind(self):
+ d = np.arange(10)
+ k = b'\xc3\xa4'.decode("UTF8")
+ assert_raises(ValueError, d.sort, kind=k)
+ assert_raises(ValueError, d.argsort, kind=k)
+
def test_searchsorted(self):
# test for floats and complex containing nans. The logic is the
# same for all float types so only test double types for now.
@@ -1063,6 +1105,31 @@ class TestMethods(TestCase):
b = a.searchsorted(unaligned, 'r')
assert_equal(b, a + 1)
+ # Test smart resetting of binsearch indices
+ a = np.arange(5)
+ b = a.searchsorted([6, 5, 4], 'l')
+ assert_equal(b, [5, 5, 4])
+ b = a.searchsorted([6, 5, 4], 'r')
+ assert_equal(b, [5, 5, 5])
+
+ # Test all type specific binary search functions
+ types = ''.join((np.typecodes['AllInteger'], np.typecodes['AllFloat'],
+ np.typecodes['Datetime'], '?O'))
+ for dt in types:
+ if dt == 'M':
+ dt = 'M8[D]'
+ if dt == '?':
+ a = np.arange(2, dtype=dt)
+ out = np.arange(2)
+ else:
+ a = np.arange(0, 5, dtype=dt)
+ out = np.arange(5)
+ b = a.searchsorted(a, 'l')
+ assert_equal(b, out)
+ b = a.searchsorted(a, 'r')
+ assert_equal(b, out + 1)
+
+
def test_searchsorted_unicode(self):
# Test searchsorted on unicode strings.
@@ -1137,6 +1204,40 @@ class TestMethods(TestCase):
b = a.searchsorted(unaligned, 'r', s)
assert_equal(b, keys + 1)
+ # Test all type specific indirect binary search functions
+ types = ''.join((np.typecodes['AllInteger'], np.typecodes['AllFloat'],
+ np.typecodes['Datetime'], '?O'))
+ for dt in types:
+ if dt == 'M':
+ dt = 'M8[D]'
+ if dt == '?':
+ a = np.array([1, 0], dtype=dt)
+ # We want the sorter array to be of a type that is different
+ # from np.intp in all platforms, to check for #4698
+ s = np.array([1, 0], dtype=np.int16)
+ out = np.array([1, 0])
+ else:
+ a = np.array([3, 4, 1, 2, 0], dtype=dt)
+ # We want the sorter array to be of a type that is different
+ # from np.intp in all platforms, to check for #4698
+ s = np.array([4, 2, 3, 0, 1], dtype=np.int16)
+ out = np.array([3, 4, 1, 2, 0], dtype=np.intp)
+ b = a.searchsorted(a, 'l', s)
+ assert_equal(b, out)
+ b = a.searchsorted(a, 'r', s)
+ assert_equal(b, out + 1)
+
+ # Test non-contiguous sorter array
+ a = np.array([3, 4, 1, 2, 0])
+ srt = np.empty((10,), dtype=np.intp)
+ srt[1::2] = -1
+ srt[::2] = [4, 2, 3, 0, 1]
+ s = srt[::2]
+ out = np.array([3, 4, 1, 2, 0], dtype=np.intp)
+ b = a.searchsorted(a, 'l', s)
+ assert_equal(b, out)
+ b = a.searchsorted(a, 'r', s)
+ assert_equal(b, out + 1)
def test_partition(self):
d = np.arange(10)
@@ -1231,6 +1332,16 @@ class TestMethods(TestCase):
mid = x.size // 2 + 1
assert_equal(np.partition(x, mid)[mid], mid)
+ # max
+ d = np.ones(10); d[1] = 4;
+ assert_equal(np.partition(d, (2, -1))[-1], 4)
+ assert_equal(np.partition(d, (2, -1))[2], 1)
+ assert_equal(d[np.argpartition(d, (2, -1))][-1], 4)
+ assert_equal(d[np.argpartition(d, (2, -1))][2], 1)
+ d[1] = np.nan
+ assert_(np.isnan(d[np.argpartition(d, (2, -1))][-1]))
+ assert_(np.isnan(np.partition(d, (2, -1))[-1]))
+
# equal elements
d = np.arange((47)) % 7
tgt = np.sort(np.arange((47)) % 7)
@@ -1245,6 +1356,12 @@ class TestMethods(TestCase):
d[i:].partition(0, kind=k)
assert_array_equal(d, tgt)
+ d = np.array([0, 1, 2, 3, 4, 5, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 9])
+ kth = [0, 3, 19, 20]
+ assert_equal(np.partition(d, kth, kind=k)[kth], (0, 3, 7, 7))
+ assert_equal(d[np.argpartition(d, kth, kind=k)][kth], (0, 3, 7, 7))
+
d = np.array([2, 1])
d.partition(0, kind=k)
assert_raises(ValueError, d.partition, 2)
@@ -1434,6 +1551,24 @@ class TestMethods(TestCase):
assert_equal(np.partition(d, k)[k], tgt[k])
assert_equal(d[np.argpartition(d, k)][k], tgt[k])
+ def test_partition_unicode_kind(self):
+ d = np.arange(10)
+ k = b'\xc3\xa4'.decode("UTF8")
+ assert_raises(ValueError, d.partition, 2, kind=k)
+ assert_raises(ValueError, d.argpartition, 2, kind=k)
+
+ def test_partition_fuzz(self):
+ # a few rounds of random data testing
+ for j in range(10, 30):
+ for i in range(1, j - 2):
+ d = np.arange(j)
+ np.random.shuffle(d)
+ d = d % np.random.randint(2, 30)
+ idx = np.random.randint(d.size)
+ kth = [0, idx, i, i + 1]
+ tgt = np.sort(d)[kth]
+ assert_array_equal(np.partition(d, kth)[kth], tgt,
+ err_msg="data: %r\n kth: %r" % (d, kth))
def test_flatten(self):
x0 = np.array([[1, 2, 3], [4, 5, 6]], np.int32)
@@ -1946,6 +2081,11 @@ class TestArgmax(TestCase):
([timedelta(days=10, seconds=24), timedelta(days=10, seconds=5),
timedelta(days=10, seconds=43)], 2),
+ ([False, False, False, False, True], 4),
+ ([False, False, False, True, False], 3),
+ ([True, False, False, False, False], 0),
+ ([True, False, True, False, False], 0),
+
# Can't reduce a "flexible type"
#(['a', 'z', 'aa', 'zz'], 3),
#(['zz', 'a', 'aa', 'a'], 0),
@@ -2032,6 +2172,11 @@ class TestArgmin(TestCase):
([timedelta(days=10, seconds=24), timedelta(days=10, seconds=5),
timedelta(days=10, seconds=43)], 1),
+ ([True, True, True, True, False], 4),
+ ([True, True, True, False, True], 3),
+ ([False, True, True, True, True], 0),
+ ([False, True, False, True, True], 0),
+
# Can't reduce a "flexible type"
#(['a', 'z', 'aa', 'zz'], 0),
#(['zz', 'a', 'aa', 'a'], 1),
@@ -2298,7 +2443,7 @@ class TestLexsort(TestCase):
class TestIO(object):
- """Test tofile, fromfile, tostring, and fromstring"""
+ """Test tofile, fromfile, tobytes, and fromstring"""
def setUp(self):
shape = (2, 4, 3)
@@ -2306,18 +2451,29 @@ class TestIO(object):
self.x = rand(shape) + rand(shape).astype(np.complex)*1j
self.x[0,:, 1] = [nan, inf, -inf, nan]
self.dtype = self.x.dtype
- self.filename = tempfile.mktemp()
+ self.tempdir = tempfile.mkdtemp()
+ self.filename = tempfile.mktemp(dir=self.tempdir)
def tearDown(self):
- if os.path.isfile(self.filename):
- os.unlink(self.filename)
- #tmp_file.close()
+ shutil.rmtree(self.tempdir)
def test_bool_fromstring(self):
v = np.array([True, False, True, False], dtype=np.bool_)
y = np.fromstring('1 0 -2.3 0.0', sep=' ', dtype=np.bool_)
assert_array_equal(v, y)
+ def test_uint64_fromstring(self):
+ d = np.fromstring("9923372036854775807 104783749223640",
+ dtype=np.uint64, sep=' ');
+ e = np.array([9923372036854775807, 104783749223640], dtype=np.uint64)
+ assert_array_equal(d, e)
+
+ def test_int64_fromstring(self):
+ d = np.fromstring("-25041670086757 104783749223640",
+ dtype=np.int64, sep=' ');
+ e = np.array([-25041670086757, 104783749223640], dtype=np.int64)
+ assert_array_equal(d, e)
+
def test_empty_files_binary(self):
f = open(self.filename, 'w')
f.close()
@@ -2339,7 +2495,6 @@ class TestIO(object):
y = np.fromfile(f, dtype=self.dtype)
f.close()
assert_array_equal(y, self.x.flat)
- os.unlink(self.filename)
def test_roundtrip_filename(self):
self.x.tofile(self.filename)
@@ -2347,11 +2502,11 @@ class TestIO(object):
assert_array_equal(y, self.x.flat)
def test_roundtrip_binary_str(self):
- s = self.x.tostring()
+ s = self.x.tobytes()
y = np.fromstring(s, dtype=self.dtype)
assert_array_equal(y, self.x.flat)
- s = self.x.tostring('F')
+ s = self.x.tobytes('F')
y = np.fromstring(s, dtype=self.dtype)
assert_array_equal(y, self.x.flatten('F'))
@@ -2392,8 +2547,6 @@ class TestIO(object):
f.close()
assert_equal(pos, 10, err_msg=err_msg)
- os.unlink(self.filename)
-
def test_file_position_after_tofile(self):
# gh-4118
sizes = [io.DEFAULT_BUFFER_SIZE//8,
@@ -2415,13 +2568,12 @@ class TestIO(object):
f = open(self.filename, 'r+b')
f.read(2)
+ f.seek(0, 1) # seek between read&write required by ANSI C
np.array([0], dtype=np.float64).tofile(f)
pos = f.tell()
f.close()
assert_equal(pos, 10, err_msg=err_msg)
- os.unlink(self.filename)
-
def _check_from(self, s, value, **kw):
y = np.fromstring(asbytes(s), **kw)
assert_array_equal(y, value)
@@ -2524,7 +2676,6 @@ class TestIO(object):
s = f.read()
f.close()
assert_equal(s, '1.51,2.0,3.51,4.0')
- os.unlink(self.filename)
def test_tofile_format(self):
x = np.array([1.51, 2, 3.51, 4], dtype=float)
@@ -2556,7 +2707,7 @@ class TestFromBuffer(object):
for dtype in [float, int, np.complex]:
dt = np.dtype(dtype).newbyteorder(byteorder)
x = (np.random.random((4, 7))*5).astype(dt)
- buf = x.tostring()
+ buf = x.tobytes()
yield self.tst_basic, buf, x.flat, {'dtype':dt}
def test_empty(self):
@@ -2704,8 +2855,8 @@ class TestRecord(TestCase):
# byte string indexing fails gracefully
assert_raises(ValueError, a.__setitem__, asbytes('f1'), 1)
assert_raises(ValueError, a.__getitem__, asbytes('f1'))
- assert_raises(ValueError, a['f1'].__setitem__, asbytes('sf1'), 1)
- assert_raises(ValueError, a['f1'].__getitem__, asbytes('sf1'))
+ assert_raises(IndexError, a['f1'].__setitem__, asbytes('sf1'), 1)
+ assert_raises(IndexError, a['f1'].__getitem__, asbytes('sf1'))
else:
funcs = (str, unicode)
for func in funcs:
@@ -2829,6 +2980,8 @@ class TestStats(TestCase):
np.random.seed(range(3))
self.rmat = np.random.random((4, 5))
self.cmat = self.rmat + 1j * self.rmat
+ self.omat = np.array([Decimal(repr(r)) for r in self.rmat.flat])
+ self.omat = self.omat.reshape(4, 5)
def test_keepdims(self):
mat = np.eye(3)
@@ -2855,9 +3008,20 @@ class TestStats(TestCase):
assert_raises(ValueError, f, mat, axis=1, out=out)
def test_dtype_from_input(self):
+
icodes = np.typecodes['AllInteger']
fcodes = np.typecodes['AllFloat']
+ # object type
+ for f in self.funcs:
+ mat = np.array([[Decimal(1)]*3]*3)
+ tgt = mat.dtype.type
+ res = f(mat, axis=1).dtype.type
+ assert_(res is tgt)
+ # scalar case
+ res = type(f(mat, axis=None))
+ assert_(res is Decimal)
+
# integer types
for f in self.funcs:
for c in icodes:
@@ -2868,6 +3032,7 @@ class TestStats(TestCase):
# scalar case
res = f(mat, axis=None).dtype.type
assert_(res is tgt)
+
# mean for float types
for f in [_mean]:
for c in fcodes:
@@ -2878,10 +3043,12 @@ class TestStats(TestCase):
# scalar case
res = f(mat, axis=None).dtype.type
assert_(res is tgt)
+
# var, std for float types
for f in [_var, _std]:
for c in fcodes:
mat = np.eye(3, dtype=c)
+ # deal with complex types
tgt = mat.real.dtype.type
res = f(mat, axis=1).dtype.type
assert_(res is tgt)
@@ -2957,7 +3124,7 @@ class TestStats(TestCase):
assert_equal(f(A, axis=axis), np.zeros([]))
def test_mean_values(self):
- for mat in [self.rmat, self.cmat]:
+ for mat in [self.rmat, self.cmat, self.omat]:
for axis in [0, 1]:
tgt = mat.sum(axis=axis)
res = _mean(mat, axis=axis) * mat.shape[axis]
@@ -2968,16 +3135,16 @@ class TestStats(TestCase):
assert_almost_equal(res, tgt)
def test_var_values(self):
- for mat in [self.rmat, self.cmat]:
+ for mat in [self.rmat, self.cmat, self.omat]:
for axis in [0, 1, None]:
msqr = _mean(mat * mat.conj(), axis=axis)
mean = _mean(mat, axis=axis)
- tgt = msqr - mean * mean.conj()
+ tgt = msqr - mean * mean.conjugate()
res = _var(mat, axis=axis)
assert_almost_equal(res, tgt)
def test_std_values(self):
- for mat in [self.rmat, self.cmat]:
+ for mat in [self.rmat, self.cmat, self.omat]:
for axis in [0, 1, None]:
tgt = np.sqrt(_var(mat, axis=axis))
res = _std(mat, axis=axis)
@@ -3064,6 +3231,23 @@ class TestDot(TestCase):
r = np.empty((1024, 32), dtype=int)
assert_raises(ValueError, dot, f, v, r)
+ def test_dot_scalar_and_matrix_of_objects(self):
+ # Ticket #2469
+ arr = np.matrix([1, 2], dtype=object)
+ desired = np.matrix([[3, 6]], dtype=object)
+ assert_equal(np.dot(arr, 3), desired)
+ assert_equal(np.dot(3, arr), desired)
+
+
+class TestInner(TestCase):
+
+ def test_inner_scalar_and_matrix_of_objects(self):
+ # Ticket #4482
+ arr = np.matrix([1, 2], dtype=object)
+ desired = np.matrix([[3, 6]], dtype=object)
+ assert_equal(np.inner(arr, 3), desired)
+ assert_equal(np.inner(3, arr), desired)
+
class TestSummarization(TestCase):
def test_1d(self):
@@ -3105,12 +3289,6 @@ class TestChoose(TestCase):
A = np.choose(self.ind, (self.x, self.y2))
assert_equal(A, [[2, 2, 3], [2, 2, 3]])
-def can_use_decimal():
- try:
- from decimal import Decimal
- return True
- except ImportError:
- return False
# TODO: test for multidimensional
NEIGH_MODE = {'zero': 0, 'one': 1, 'constant': 2, 'circular': 3, 'mirror': 4}
@@ -3146,11 +3324,7 @@ class TestNeighborhoodIter(TestCase):
def test_simple2d(self):
self._test_simple2d(np.float)
- @dec.skipif(not can_use_decimal(),
- "Skip neighborhood iterator tests for decimal objects " \
- "(decimal module not available")
def test_simple2d_object(self):
- from decimal import Decimal
self._test_simple2d(Decimal)
def _test_mirror2d(self, dt):
@@ -3166,11 +3340,7 @@ class TestNeighborhoodIter(TestCase):
def test_mirror2d(self):
self._test_mirror2d(np.float)
- @dec.skipif(not can_use_decimal(),
- "Skip neighborhood iterator tests for decimal objects " \
- "(decimal module not available")
def test_mirror2d_object(self):
- from decimal import Decimal
self._test_mirror2d(Decimal)
# Simple, 1d tests
@@ -3192,11 +3362,7 @@ class TestNeighborhoodIter(TestCase):
def test_simple_float(self):
self._test_simple(np.float)
- @dec.skipif(not can_use_decimal(),
- "Skip neighborhood iterator tests for decimal objects " \
- "(decimal module not available")
def test_simple_object(self):
- from decimal import Decimal
self._test_simple(Decimal)
# Test mirror modes
@@ -3211,11 +3377,7 @@ class TestNeighborhoodIter(TestCase):
def test_mirror(self):
self._test_mirror(np.float)
- @dec.skipif(not can_use_decimal(),
- "Skip neighborhood iterator tests for decimal objects " \
- "(decimal module not available")
def test_mirror_object(self):
- from decimal import Decimal
self._test_mirror(Decimal)
# Circular mode
@@ -3229,11 +3391,7 @@ class TestNeighborhoodIter(TestCase):
def test_circular(self):
self._test_circular(np.float)
- @dec.skipif(not can_use_decimal(),
- "Skip neighborhood iterator tests for decimal objects " \
- "(decimal module not available")
def test_circular_object(self):
- from decimal import Decimal
self._test_circular(Decimal)
# Test stacking neighborhood iterators
@@ -3866,7 +4024,8 @@ class TestMemEventHook(TestCase):
# multiarray/multiarray_tests.c.src
test_pydatamem_seteventhook_start()
# force an allocation and free of a numpy array
- a = np.zeros(10)
+ # needs to be larger then limit of small memory cacher in ctors.c
+ a = np.zeros(1000)
del a
test_pydatamem_seteventhook_end()
@@ -4082,5 +4241,150 @@ class TestConversion(TestCase):
"type %s and %s failed" % (dt1, dt2))
+class TestWhere(TestCase):
+ def test_basic(self):
+ dts = [np.bool, np.int16, np.int32, np.int64, np.double, np.complex128,
+ np.longdouble, np.clongdouble]
+ for dt in dts:
+ c = np.ones(53, dtype=np.bool)
+ assert_equal(np.where( c, dt(0), dt(1)), dt(0))
+ assert_equal(np.where(~c, dt(0), dt(1)), dt(1))
+ assert_equal(np.where(True, dt(0), dt(1)), dt(0))
+ assert_equal(np.where(False, dt(0), dt(1)), dt(1))
+ d = np.ones_like(c).astype(dt)
+ e = np.zeros_like(d)
+ r = d.astype(dt)
+ c[7] = False
+ r[7] = e[7]
+ assert_equal(np.where(c, e, e), e)
+ assert_equal(np.where(c, d, e), r)
+ assert_equal(np.where(c, d, e[0]), r)
+ assert_equal(np.where(c, d[0], e), r)
+ assert_equal(np.where(c[::2], d[::2], e[::2]), r[::2])
+ assert_equal(np.where(c[1::2], d[1::2], e[1::2]), r[1::2])
+ assert_equal(np.where(c[::3], d[::3], e[::3]), r[::3])
+ assert_equal(np.where(c[1::3], d[1::3], e[1::3]), r[1::3])
+ assert_equal(np.where(c[::-2], d[::-2], e[::-2]), r[::-2])
+ assert_equal(np.where(c[::-3], d[::-3], e[::-3]), r[::-3])
+ assert_equal(np.where(c[1::-3], d[1::-3], e[1::-3]), r[1::-3])
+
+ def test_exotic(self):
+ # object
+ assert_array_equal(np.where(True, None, None), np.array(None))
+ # zero sized
+ m = np.array([], dtype=bool).reshape(0, 3)
+ b = np.array([], dtype=np.float64).reshape(0, 3)
+ assert_array_equal(np.where(m, 0, b), np.array([]).reshape(0, 3))
+
+ # object cast
+ d = np.array([-1.34, -0.16, -0.54, -0.31, -0.08, -0.95, 0.000, 0.313,
+ 0.547, -0.18, 0.876, 0.236, 1.969, 0.310, 0.699, 1.013,
+ 1.267, 0.229, -1.39, 0.487])
+ nan = float('NaN')
+ e = np.array(['5z', '0l', nan, 'Wz', nan, nan, 'Xq', 'cs', nan, nan,
+ 'QN', nan, nan, 'Fd', nan, nan, 'kp', nan, '36', 'i1'],
+ dtype=object);
+ m = np.array([0,0,1,0,1,1,0,0,1,1,0,1,1,0,1,1,0,1,0,0], dtype=bool)
+
+ r = e[:]
+ r[np.where(m)] = d[np.where(m)]
+ assert_array_equal(np.where(m, d, e), r)
+
+ r = e[:]
+ r[np.where(~m)] = d[np.where(~m)]
+ assert_array_equal(np.where(m, e, d), r)
+
+ assert_array_equal(np.where(m, e, e), e)
+
+ # minimal dtype result with NaN scalar (e.g required by pandas)
+ d = np.array([1., 2.], dtype=np.float32)
+ e = float('NaN')
+ assert_equal(np.where(True, d, e).dtype, np.float32)
+ e = float('Infinity')
+ assert_equal(np.where(True, d, e).dtype, np.float32)
+ e = float('-Infinity')
+ assert_equal(np.where(True, d, e).dtype, np.float32)
+ # also check upcast
+ e = float(1e150)
+ assert_equal(np.where(True, d, e).dtype, np.float64)
+
+ def test_ndim(self):
+ c = [True, False]
+ a = np.zeros((2, 25))
+ b = np.ones((2, 25))
+ r = np.where(np.array(c)[:,np.newaxis], a, b)
+ assert_array_equal(r[0], a[0])
+ assert_array_equal(r[1], b[0])
+
+ a = a.T
+ b = b.T
+ r = np.where(c, a, b)
+ assert_array_equal(r[:,0], a[:,0])
+ assert_array_equal(r[:,1], b[:,0])
+
+ def test_dtype_mix(self):
+ c = np.array([False, True, False, False, False, False, True, False,
+ False, False, True, False])
+ a = np.uint32(1)
+ b = np.array([5., 0., 3., 2., -1., -4., 0., -10., 10., 1., 0., 3.],
+ dtype=np.float64)
+ r = np.array([5., 1., 3., 2., -1., -4., 1., -10., 10., 1., 1., 3.],
+ dtype=np.float64)
+ assert_equal(np.where(c, a, b), r)
+
+ a = a.astype(np.float32)
+ b = b.astype(np.int64)
+ assert_equal(np.where(c, a, b), r)
+
+ # non bool mask
+ c = c.astype(np.int)
+ c[c != 0] = 34242324
+ assert_equal(np.where(c, a, b), r)
+ # invert
+ tmpmask = c != 0
+ c[c == 0] = 41247212
+ c[tmpmask] = 0
+ assert_equal(np.where(c, b, a), r)
+
+ def test_foreign(self):
+ c = np.array([False, True, False, False, False, False, True, False,
+ False, False, True, False])
+ r = np.array([5., 1., 3., 2., -1., -4., 1., -10., 10., 1., 1., 3.],
+ dtype=np.float64)
+ a = np.ones(1, dtype='>i4')
+ b = np.array([5., 0., 3., 2., -1., -4., 0., -10., 10., 1., 0., 3.],
+ dtype=np.float64)
+ assert_equal(np.where(c, a, b), r)
+
+ b = b.astype('>f8')
+ assert_equal(np.where(c, a, b), r)
+
+ a = a.astype('<i4')
+ assert_equal(np.where(c, a, b), r)
+
+ c = c.astype('>i4')
+ assert_equal(np.where(c, a, b), r)
+
+ def test_error(self):
+ c = [True, True]
+ a = np.ones((4, 5))
+ b = np.ones((5, 5))
+ assert_raises(ValueError, np.where, c, a, a)
+ assert_raises(ValueError, np.where, c[0], a, b)
+
+ def test_string(self):
+ # gh-4778 check strings are properly filled with nulls
+ a = np.array("abc")
+ b = np.array("x" * 753)
+ assert_equal(np.where(True, a, b), "abc")
+ assert_equal(np.where(False, b, a), "abc")
+
+ # check native datatype sized strings
+ a = np.array("abcd")
+ b = np.array("x" * 8)
+ assert_equal(np.where(True, a, b), "abcd")
+ assert_equal(np.where(False, b, a), "abcd")
+
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/core/tests/test_nditer.py b/numpy/core/tests/test_nditer.py
index 95c127316..0055c038b 100644
--- a/numpy/core/tests/test_nditer.py
+++ b/numpy/core/tests/test_nditer.py
@@ -6,7 +6,7 @@ import numpy as np
from numpy import array, arange, nditer, all
from numpy.compat import asbytes, sixu
from numpy.testing import *
-
+from numpy.core.multiarray_tests import test_nditer_too_large
def iter_multi_index(i):
@@ -657,9 +657,9 @@ def test_iter_broadcasting_errors():
# The message should contain "shape->remappedshape" for each operand
assert_(msg.find('(2,3)->(2,3)') >= 0,
'Message "%s" doesn\'t contain operand shape (2,3)->(2,3)' % msg)
- assert_(msg.find('(2)->(2,newaxis)') >= 0,
+ assert_(msg.find('(2,)->(2,newaxis)') >= 0,
('Message "%s" doesn\'t contain remapped operand shape' +
- '(2)->(2,newaxis)') % msg)
+ '(2,)->(2,newaxis)') % msg)
# The message should contain the itershape parameter
assert_(msg.find('(4,3)') >= 0,
'Message "%s" doesn\'t contain itershape parameter (4,3)' % msg)
@@ -2586,6 +2586,44 @@ def test_iter_too_large():
size = np.iinfo(np.intp).max // 1024
arr = np.lib.stride_tricks.as_strided(np.zeros(1), (size,), (0,))
assert_raises(ValueError, nditer, (arr, arr[:, None]))
+ # test the same for multiindex. That may get more interesting when
+ # removing 0 dimensional axis is allowed (since an iterator can grow then)
+ assert_raises(ValueError, nditer,
+ (arr, arr[:, None]), flags=['multi_index'])
+
+
+def test_iter_too_large_with_multiindex():
+ # When a multi index is being tracked, the error is delayed this
+ # checks the delayed error messages and getting below that by
+ # removing an axis.
+ base_size = 2**10
+ num = 1
+ while base_size**num < np.iinfo(np.intp).max:
+ num += 1
+
+ shape_template = [1, 1] * num
+ arrays = []
+ for i in range(num):
+ shape = shape_template[:]
+ shape[i * 2] = 2**10
+ arrays.append(np.empty(shape))
+ arrays = tuple(arrays)
+
+ # arrays are now too large to be broadcast. The different modes test
+ # different nditer functionality with or without GIL.
+ for mode in range(6):
+ assert_raises(ValueError, test_nditer_too_large, arrays, -1, mode)
+ # but if we do nothing with the nditer, it can be constructed:
+ test_nditer_too_large(arrays, -1, 7)
+
+ # When an axis is removed, things should work again (half the time):
+ for i in range(num):
+ for mode in range(6):
+ # an axis with size 1024 is removed:
+ test_nditer_too_large(arrays, i*2, mode)
+ # an axis with size 1 is removed:
+ assert_raises(ValueError, test_nditer_too_large,
+ arrays, i*2 + 1, mode)
if __name__ == "__main__":
diff --git a/numpy/core/tests/test_numeric.py b/numpy/core/tests/test_numeric.py
index ac341468c..c85c5cf3e 100644
--- a/numpy/core/tests/test_numeric.py
+++ b/numpy/core/tests/test_numeric.py
@@ -5,6 +5,7 @@ import platform
from decimal import Decimal
import warnings
import itertools
+import platform
import numpy as np
from numpy.core import *
@@ -346,33 +347,54 @@ class TestBoolCmp(TestCase):
self.ed[s:s+4] = [(i & 2**x) != 0 for x in range(4)]
s += 4
+ self.nf = self.f.copy()
+ self.nd = self.d.copy()
+ self.nf[self.ef] = np.nan
+ self.nd[self.ed] = np.nan
+
def test_float(self):
# offset for alignment test
for i in range(4):
- assert_array_equal(self.f[i:] != 0, self.ef[i:])
assert_array_equal(self.f[i:] > 0, self.ef[i:])
assert_array_equal(self.f[i:] - 1 >= 0, self.ef[i:])
assert_array_equal(self.f[i:] == 0, ~self.ef[i:])
assert_array_equal(-self.f[i:] < 0, self.ef[i:])
assert_array_equal(-self.f[i:] + 1 <= 0, self.ef[i:])
-
- assert_array_equal(0 != self.f[i:], self.ef[i:])
- assert_array_equal(np.zeros_like(self.f)[i:] != self.f[i:],
- self.ef[i:])
+ r = self.f[i:] != 0
+ assert_array_equal(r, self.ef[i:])
+ r2 = self.f[i:] != np.zeros_like(self.f[i:])
+ r3 = 0 != self.f[i:]
+ assert_array_equal(r, r2)
+ assert_array_equal(r, r3)
+ # check bool == 0x1
+ assert_array_equal(r.view(np.int8), r.astype(np.int8))
+ assert_array_equal(r2.view(np.int8), r2.astype(np.int8))
+ assert_array_equal(r3.view(np.int8), r3.astype(np.int8))
+
+ # isnan on amd64 takes the same codepath
+ assert_array_equal(np.isnan(self.nf[i:]), self.ef[i:])
def test_double(self):
# offset for alignment test
for i in range(2):
- assert_array_equal(self.d[i:] != 0, self.ed[i:])
assert_array_equal(self.d[i:] > 0, self.ed[i:])
assert_array_equal(self.d[i:] - 1 >= 0, self.ed[i:])
assert_array_equal(self.d[i:] == 0, ~self.ed[i:])
assert_array_equal(-self.d[i:] < 0, self.ed[i:])
assert_array_equal(-self.d[i:] + 1 <= 0, self.ed[i:])
+ r = self.d[i:] != 0
+ assert_array_equal(r, self.ed[i:])
+ r2 = self.d[i:] != np.zeros_like(self.d[i:])
+ r3 = 0 != self.d[i:]
+ assert_array_equal(r, r2)
+ assert_array_equal(r, r3)
+ # check bool == 0x1
+ assert_array_equal(r.view(np.int8), r.astype(np.int8))
+ assert_array_equal(r2.view(np.int8), r2.astype(np.int8))
+ assert_array_equal(r3.view(np.int8), r3.astype(np.int8))
- assert_array_equal(0 != self.d[i:], self.ed[i:])
- assert_array_equal(np.zeros_like(self.d)[i:] != self.d[i:],
- self.ed[i:])
+ # isnan on amd64 takes the same codepath
+ assert_array_equal(np.isnan(self.nd[i:]), self.ed[i:])
class TestSeterr(TestCase):
@@ -686,10 +708,10 @@ class TestTypes(TestCase):
assert_equal(np.promote_types('<i8', '<i8'), np.dtype('i8'))
assert_equal(np.promote_types('>i8', '>i8'), np.dtype('i8'))
- assert_equal(np.promote_types('>i8', '>U16'), np.dtype('U16'))
- assert_equal(np.promote_types('<i8', '<U16'), np.dtype('U16'))
- assert_equal(np.promote_types('>U16', '>i8'), np.dtype('U16'))
- assert_equal(np.promote_types('<U16', '<i8'), np.dtype('U16'))
+ assert_equal(np.promote_types('>i8', '>U16'), np.dtype('U21'))
+ assert_equal(np.promote_types('<i8', '<U16'), np.dtype('U21'))
+ assert_equal(np.promote_types('>U16', '>i8'), np.dtype('U21'))
+ assert_equal(np.promote_types('<U16', '<i8'), np.dtype('U21'))
assert_equal(np.promote_types('<S5', '<U8'), np.dtype('U8'))
assert_equal(np.promote_types('>S5', '>U8'), np.dtype('U8'))
@@ -703,6 +725,39 @@ class TestTypes(TestCase):
assert_equal(np.promote_types('<m8', '<m8'), np.dtype('m8'))
assert_equal(np.promote_types('>m8', '>m8'), np.dtype('m8'))
+ def test_promote_types_strings(self):
+ assert_equal(np.promote_types('bool', 'S'), np.dtype('S5'))
+ assert_equal(np.promote_types('b', 'S'), np.dtype('S4'))
+ assert_equal(np.promote_types('u1', 'S'), np.dtype('S3'))
+ assert_equal(np.promote_types('u2', 'S'), np.dtype('S5'))
+ assert_equal(np.promote_types('u4', 'S'), np.dtype('S10'))
+ assert_equal(np.promote_types('u8', 'S'), np.dtype('S20'))
+ assert_equal(np.promote_types('i1', 'S'), np.dtype('S4'))
+ assert_equal(np.promote_types('i2', 'S'), np.dtype('S6'))
+ assert_equal(np.promote_types('i4', 'S'), np.dtype('S11'))
+ assert_equal(np.promote_types('i8', 'S'), np.dtype('S21'))
+ assert_equal(np.promote_types('bool', 'U'), np.dtype('U5'))
+ assert_equal(np.promote_types('b', 'U'), np.dtype('U4'))
+ assert_equal(np.promote_types('u1', 'U'), np.dtype('U3'))
+ assert_equal(np.promote_types('u2', 'U'), np.dtype('U5'))
+ assert_equal(np.promote_types('u4', 'U'), np.dtype('U10'))
+ assert_equal(np.promote_types('u8', 'U'), np.dtype('U20'))
+ assert_equal(np.promote_types('i1', 'U'), np.dtype('U4'))
+ assert_equal(np.promote_types('i2', 'U'), np.dtype('U6'))
+ assert_equal(np.promote_types('i4', 'U'), np.dtype('U11'))
+ assert_equal(np.promote_types('i8', 'U'), np.dtype('U21'))
+ assert_equal(np.promote_types('bool', 'S1'), np.dtype('S5'))
+ assert_equal(np.promote_types('bool', 'S30'), np.dtype('S30'))
+ assert_equal(np.promote_types('b', 'S1'), np.dtype('S4'))
+ assert_equal(np.promote_types('b', 'S30'), np.dtype('S30'))
+ assert_equal(np.promote_types('u1', 'S1'), np.dtype('S3'))
+ assert_equal(np.promote_types('u1', 'S30'), np.dtype('S30'))
+ assert_equal(np.promote_types('u2', 'S1'), np.dtype('S5'))
+ assert_equal(np.promote_types('u2', 'S30'), np.dtype('S30'))
+ assert_equal(np.promote_types('u4', 'S1'), np.dtype('S10'))
+ assert_equal(np.promote_types('u4', 'S30'), np.dtype('S30'))
+ assert_equal(np.promote_types('u8', 'S1'), np.dtype('S20'))
+ assert_equal(np.promote_types('u8', 'S30'), np.dtype('S30'))
def test_can_cast(self):
assert_(np.can_cast(np.int32, np.int64))
@@ -711,7 +766,7 @@ class TestTypes(TestCase):
assert_(np.can_cast('i8', 'f8'))
assert_(not np.can_cast('i8', 'f4'))
- assert_(np.can_cast('i4', 'S4'))
+ assert_(np.can_cast('i4', 'S11'))
assert_(np.can_cast('i8', 'i8', 'no'))
assert_(not np.can_cast('<i8', '>i8', 'no'))
@@ -727,6 +782,54 @@ class TestTypes(TestCase):
assert_(np.can_cast('<i8', '>u4', 'unsafe'))
+ assert_(np.can_cast('bool', 'S5'))
+ assert_(not np.can_cast('bool', 'S4'))
+
+ assert_(np.can_cast('b', 'S4'))
+ assert_(not np.can_cast('b', 'S3'))
+
+ assert_(np.can_cast('u1', 'S3'))
+ assert_(not np.can_cast('u1', 'S2'))
+ assert_(np.can_cast('u2', 'S5'))
+ assert_(not np.can_cast('u2', 'S4'))
+ assert_(np.can_cast('u4', 'S10'))
+ assert_(not np.can_cast('u4', 'S9'))
+ assert_(np.can_cast('u8', 'S20'))
+ assert_(not np.can_cast('u8', 'S19'))
+
+ assert_(np.can_cast('i1', 'S4'))
+ assert_(not np.can_cast('i1', 'S3'))
+ assert_(np.can_cast('i2', 'S6'))
+ assert_(not np.can_cast('i2', 'S5'))
+ assert_(np.can_cast('i4', 'S11'))
+ assert_(not np.can_cast('i4', 'S10'))
+ assert_(np.can_cast('i8', 'S21'))
+ assert_(not np.can_cast('i8', 'S20'))
+
+ assert_(np.can_cast('bool', 'S5'))
+ assert_(not np.can_cast('bool', 'S4'))
+
+ assert_(np.can_cast('b', 'U4'))
+ assert_(not np.can_cast('b', 'U3'))
+
+ assert_(np.can_cast('u1', 'U3'))
+ assert_(not np.can_cast('u1', 'U2'))
+ assert_(np.can_cast('u2', 'U5'))
+ assert_(not np.can_cast('u2', 'U4'))
+ assert_(np.can_cast('u4', 'U10'))
+ assert_(not np.can_cast('u4', 'U9'))
+ assert_(np.can_cast('u8', 'U20'))
+ assert_(not np.can_cast('u8', 'U19'))
+
+ assert_(np.can_cast('i1', 'U4'))
+ assert_(not np.can_cast('i1', 'U3'))
+ assert_(np.can_cast('i2', 'U6'))
+ assert_(not np.can_cast('i2', 'U5'))
+ assert_(np.can_cast('i4', 'U11'))
+ assert_(not np.can_cast('i4', 'U10'))
+ assert_(np.can_cast('i8', 'U21'))
+ assert_(not np.can_cast('i8', 'U20'))
+
assert_raises(TypeError, np.can_cast, 'i4', None)
assert_raises(TypeError, np.can_cast, None, 'i4')
@@ -829,11 +932,26 @@ class TestNonzero(TestCase):
assert_equal(np.nonzero(x['a']), ([0, 1, 1, 2], [2, 0, 1, 1]))
assert_equal(np.nonzero(x['b']), ([0, 0, 1, 2, 2], [0, 2, 0, 1, 2]))
+ assert_(not x['a'].T.flags.aligned)
assert_equal(np.count_nonzero(x['a'].T), 4)
assert_equal(np.count_nonzero(x['b'].T), 5)
assert_equal(np.nonzero(x['a'].T), ([0, 1, 1, 2], [1, 1, 2, 0]))
assert_equal(np.nonzero(x['b'].T), ([0, 0, 1, 2, 2], [0, 1, 2, 0, 2]))
+ def test_sparse(self):
+ # test special sparse condition boolean code path
+ for i in range(20):
+ c = np.zeros(200, dtype=np.bool)
+ c[i::20] = True
+ assert_equal(np.nonzero(c)[0], np.arange(i, 200 + i, 20))
+
+ c = np.zeros(400, dtype=np.bool)
+ c[10 + i:20 + i] = True
+ c[20 + i*2] = True
+ assert_equal(np.nonzero(c)[0],
+ np.concatenate((np.arange(10 +i, 20 + i), [20 +i*2])))
+
+
class TestIndex(TestCase):
def test_boolean(self):
a = rand(3, 5, 8)
@@ -932,7 +1050,15 @@ class TestArrayComparisons(TestCase):
def assert_array_strict_equal(x, y):
assert_array_equal(x, y)
# Check flags
- assert_(x.flags == y.flags)
+ if 'sparc' not in platform.platform().lower():
+ assert_(x.flags == y.flags)
+ else:
+ # sparc arrays may not be aligned for long double types
+ assert_(x.flags.owndata == y.flags.owndata)
+ assert_(x.flags.writeable == y.flags.writeable)
+ assert_(x.flags.c_contiguous == y.flags.c_contiguous)
+ assert_(x.flags.f_contiguous == y.flags.f_contiguous)
+ assert_(x.flags.updateifcopy == y.flags.updateifcopy)
# check endianness
assert_(x.dtype.isnative == y.dtype.isnative)
@@ -1420,6 +1546,13 @@ class TestAllclose(object):
assert_array_equal(y, array([0, inf]))
+ def test_min_int(self):
+ # Could make problems because of abs(min_int) == min_int
+ min_int = np.iinfo(np.int_).min
+ a = np.array([min_int], dtype=np.int_)
+ assert_(allclose(a, a))
+
+
class TestIsclose(object):
rtol = 1e-5
atol = 1e-8
@@ -1870,6 +2003,88 @@ class TestRoll(TestCase):
x = np.array([])
assert_equal(np.roll(x, 1), np.array([]))
+class TestCross(TestCase):
+ def test_2x2(self):
+ u = [1, 2]
+ v = [3, 4]
+ z = -2
+ cp = np.cross(u, v)
+ assert_equal(cp, z)
+ cp = np.cross(v, u)
+ assert_equal(cp, -z)
+
+ def test_2x3(self):
+ u = [1, 2]
+ v = [3, 4, 5]
+ z = np.array([10, -5, -2])
+ cp = np.cross(u, v)
+ assert_equal(cp, z)
+ cp = np.cross(v, u)
+ assert_equal(cp, -z)
+
+ def test_3x3(self):
+ u = [1, 2, 3]
+ v = [4, 5, 6]
+ z = np.array([-3, 6, -3])
+ cp = cross(u, v)
+ assert_equal(cp, z)
+ cp = np.cross(v, u)
+ assert_equal(cp, -z)
+
+ def test_broadcasting(self):
+ # Ticket #2624 (Trac #2032)
+ u = np.tile([1, 2], (11, 1))
+ v = np.tile([3, 4], (11, 1))
+ z = -2
+ assert_equal(np.cross(u, v), z)
+ assert_equal(np.cross(v, u), -z)
+ assert_equal(np.cross(u, u), 0)
+
+ u = np.tile([1, 2], (11, 1)).T
+ v = np.tile([3, 4, 5], (11, 1))
+ z = np.tile([10, -5, -2], (11, 1))
+ assert_equal(np.cross(u, v, axisa=0), z)
+ assert_equal(np.cross(v, u.T), -z)
+ assert_equal(np.cross(v, v), 0)
+
+ u = np.tile([1, 2, 3], (11, 1)).T
+ v = np.tile([3, 4], (11, 1)).T
+ z = np.tile([-12, 9, -2], (11, 1))
+ assert_equal(np.cross(u, v, axisa=0, axisb=0), z)
+ assert_equal(np.cross(v.T, u.T), -z)
+ assert_equal(np.cross(u.T, u.T), 0)
+
+ u = np.tile([1, 2, 3], (5, 1))
+ v = np.tile([4, 5, 6], (5, 1)).T
+ z = np.tile([-3, 6, -3], (5, 1))
+ assert_equal(np.cross(u, v, axisb=0), z)
+ assert_equal(np.cross(v.T, u), -z)
+ assert_equal(np.cross(u, u), 0)
+
+ def test_broadcasting_shapes(self):
+ u = np.ones((2, 1, 3))
+ v = np.ones((5, 3))
+ assert_equal(np.cross(u, v).shape, (2, 5, 3))
+ u = np.ones((10, 3, 5))
+ v = np.ones((2, 5))
+ assert_equal(np.cross(u, v, axisa=1, axisb=0).shape, (10, 5, 3))
+ assert_raises(ValueError, np.cross, u, v, axisa=1, axisb=2)
+ assert_raises(ValueError, np.cross, u, v, axisa=3, axisb=0)
+ u = np.ones((10, 3, 5, 7))
+ v = np.ones((5, 7, 2))
+ assert_equal(np.cross(u, v, axisa=1, axisc=2).shape, (10, 5, 3, 7))
+ assert_raises(ValueError, np.cross, u, v, axisa=-5, axisb=2)
+ assert_raises(ValueError, np.cross, u, v, axisa=1, axisb=-4)
+
+def test_outer_out_param():
+ arr1 = np.ones((5,))
+ arr2 = np.ones((2,))
+ arr3 = np.linspace(-2, 2, 5)
+ out1 = np.ndarray(shape=(5,5))
+ out2 = np.ndarray(shape=(2, 5))
+ res1 = np.outer(arr1, arr3, out1)
+ assert_equal(res1, out1)
+ assert_equal(np.outer(arr2, arr3, out2), out2)
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/core/tests/test_numerictypes.py b/numpy/core/tests/test_numerictypes.py
index 3cafcf65e..077e94475 100644
--- a/numpy/core/tests/test_numerictypes.py
+++ b/numpy/core/tests/test_numerictypes.py
@@ -365,7 +365,7 @@ class TestMultipleFields(TestCase):
def _bad_call(self):
return self.ary['f0', 'f1']
def test_no_tuple(self):
- self.assertRaises(ValueError, self._bad_call)
+ self.assertRaises(IndexError, self._bad_call)
def test_return(self):
res = self.ary[['f0', 'f2']].tolist()
assert_(res == [(1, 3), (5, 7)])
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index e35bbb320..726f0efb9 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -1,5 +1,6 @@
from __future__ import division, absolute_import, print_function
+import copy
import pickle
import sys
import platform
@@ -153,7 +154,8 @@ class TestRegression(TestCase):
{'names':['a'],'formats':['foo']}, align=1)
@dec.knownfailureif((sys.version_info[0] >= 3) or
- (sys.platform == "win32" and platform.architecture()[0] == "64bit"),
+ (sys.platform == "win32" and
+ platform.architecture()[0] == "64bit"),
"numpy.intp('0xff', 16) not supported on Py3, "
"as it does not inherit from Python int")
def test_intp(self,level=rlevel):
@@ -179,7 +181,7 @@ class TestRegression(TestCase):
assert_(np.all(b[yb] > 0.5))
def test_endian_where(self,level=rlevel):
- """GitHuB issue #369"""
+ """GitHub issue #369"""
net = np.zeros(3, dtype='>f4')
net[1] = 0.00458849
net[2] = 0.605202
@@ -286,11 +288,11 @@ class TestRegression(TestCase):
b = np.array('world')
a == b
- def test_tostring_FORTRANORDER_discontiguous(self,level=rlevel):
+ def test_tobytes_FORTRANORDER_discontiguous(self,level=rlevel):
"""Fix in r2836"""
- # Create discontiguous Fortran-ordered array
+ # Create non-contiguous Fortran ordered array
x = np.array(np.random.rand(3, 3), order='F')[:, :2]
- assert_array_almost_equal(x.ravel(), np.fromstring(x.tostring()))
+ assert_array_almost_equal(x.ravel(), np.fromstring(x.tobytes()))
def test_flat_assignment(self,level=rlevel):
"""Correct behaviour of ticket #194"""
@@ -309,7 +311,7 @@ class TestRegression(TestCase):
self.assertRaises(ValueError, bfb)
def test_nonarray_assignment(self):
- # See also Issue gh-2870, test for nonarray assignment
+ # See also Issue gh-2870, test for non-array assignment
# and equivalent unsafe casted array assignment
a = np.arange(10)
b = np.ones(10, dtype=bool)
@@ -447,7 +449,10 @@ class TestRegression(TestCase):
res1 = getattr(arr, func_meth)()
res2 = getattr(np, func)(arr2)
if res1 is None:
- assert_(abs(arr-res2).max() < 1e-8, func)
+ res1 = arr
+
+ if res1.dtype.kind in 'uib':
+ assert_((res1 == res2).all(), func)
else:
assert_(abs(res1-res2).max() < 1e-8, func)
@@ -555,7 +560,7 @@ class TestRegression(TestCase):
assert_(a.reshape(5, 1).strides[0] == 0)
def test_reshape_zero_size(self, level=rlevel):
- """Github Issue #2700, setting shape failed for 0-sized arrays"""
+ """GitHub Issue #2700, setting shape failed for 0-sized arrays"""
a = np.ones((0, 2))
a.shape = (-1, 2)
@@ -563,7 +568,7 @@ class TestRegression(TestCase):
# With NPY_RELAXED_STRIDES_CHECKING the test becomes superfluous.
@dec.skipif(np.ones(1).strides[0] == np.iinfo(np.intp).max)
def test_reshape_trailing_ones_strides(self):
- # Github issue gh-2949, bad strides for trailing ones of new shape
+ # GitHub issue gh-2949, bad strides for trailing ones of new shape
a = np.zeros(12, dtype=np.int32)[::2] # not contiguous
strides_c = (16, 8, 8, 8)
strides_f = (8, 24, 48, 48)
@@ -751,8 +756,14 @@ class TestRegression(TestCase):
s = np.ones(10, dtype=float)
x = np.array((15,), dtype=float)
def ia(x, s, v): x[(s>0)]=v
- self.assertRaises(ValueError, ia, x, s, np.zeros(9, dtype=float))
- self.assertRaises(ValueError, ia, x, s, np.zeros(11, dtype=float))
+ # After removing deprecation, the following are ValueErrors.
+ # This might seem odd as compared to the value error below. This
+ # is due to the fact that the new code always uses "nonzero" logic
+ # and the boolean special case is not taken.
+ self.assertRaises(IndexError, ia, x, s, np.zeros(9, dtype=float))
+ self.assertRaises(IndexError, ia, x, s, np.zeros(11, dtype=float))
+ # Old special case (different code path):
+ self.assertRaises(ValueError, ia, x.flat, s, np.zeros(9, dtype=float))
def test_mem_scalar_indexing(self, level=rlevel):
"""Ticket #603"""
@@ -837,7 +848,7 @@ class TestRegression(TestCase):
cnt0_b = cnt(b)
cnt0_c = cnt(c)
- # -- 0d -> 1d broadcasted slice assignment
+ # -- 0d -> 1-d broadcast slice assignment
arr = np.zeros(5, dtype=np.object_)
@@ -854,7 +865,7 @@ class TestRegression(TestCase):
del arr
- # -- 1d -> 2d broadcasted slice assignment
+ # -- 1-d -> 2-d broadcast slice assignment
arr = np.zeros((5, 2), dtype=np.object_)
arr0 = np.zeros(2, dtype=np.object_)
@@ -873,7 +884,7 @@ class TestRegression(TestCase):
del arr, arr0
- # -- 2d copying + flattening
+ # -- 2-d copying + flattening
arr = np.zeros((5, 2), dtype=np.object_)
@@ -1018,8 +1029,8 @@ class TestRegression(TestCase):
b = np.zeros((2, 1), dtype = np.single)
try:
a.compress([True, False], axis = 1, out = b)
- raise AssertionError("compress with an out which cannot be " \
- "safely casted should not return "\
+ raise AssertionError("compress with an out which cannot be "
+ "safely casted should not return "
"successfully")
except TypeError:
pass
@@ -1200,7 +1211,7 @@ class TestRegression(TestCase):
#that void scalar contains original data.
test_string = np.array("test")
test_string_void_scalar = np.core.multiarray.scalar(
- np.dtype(("V", test_string.dtype.itemsize)), test_string.tostring())
+ np.dtype(("V", test_string.dtype.itemsize)), test_string.tobytes())
assert_(test_string_void_scalar.view(test_string.dtype) == test_string)
@@ -1208,7 +1219,7 @@ class TestRegression(TestCase):
#reconstructed scalar is correct.
test_record = np.ones((), "i,i")
test_record_void_scalar = np.core.multiarray.scalar(
- test_record.dtype, test_record.tostring())
+ test_record.dtype, test_record.tobytes())
assert_(test_record_void_scalar == test_record)
@@ -1378,10 +1389,10 @@ class TestRegression(TestCase):
y = x.byteswap()
if x.dtype.byteorder == z.dtype.byteorder:
# little-endian machine
- assert_equal(x, np.fromstring(y.tostring(), dtype=dtype.newbyteorder()))
+ assert_equal(x, np.fromstring(y.tobytes(), dtype=dtype.newbyteorder()))
else:
# big-endian machine
- assert_equal(x, np.fromstring(y.tostring(), dtype=dtype))
+ assert_equal(x, np.fromstring(y.tobytes(), dtype=dtype))
# double check real and imaginary parts:
assert_equal(x.real, y.real.byteswap())
assert_equal(x.imag, y.imag.byteswap())
@@ -1527,7 +1538,7 @@ class TestRegression(TestCase):
# file handle out of sync
f0 = tempfile.NamedTemporaryFile()
f = f0.file
- f.write(np.arange(255, dtype='u1').tostring())
+ f.write(np.arange(255, dtype='u1').tobytes())
f.seek(20)
ret = np.fromfile(f, count=4, dtype='u1')
@@ -1904,7 +1915,7 @@ class TestRegression(TestCase):
# 2D array
arr2 = np.reshape(arr, (2, 5))
# Fortran write followed by (C or F) read caused bus error
- data_str = arr2.tostring('F')
+ data_str = arr2.tobytes('F')
data_back = np.ndarray(arr2.shape,
arr2.dtype,
buffer=data_str,
@@ -1940,5 +1951,62 @@ class TestRegression(TestCase):
arr.__setitem__(slice(None), [9])
assert_equal(arr, [9, 9, 9])
+ def test_format_on_flex_array_element(self):
+ # Ticket #4369.
+ dt = np.dtype([('date', '<M8[D]'), ('val', '<f8')])
+ arr = np.array([('2000-01-01', 1)], dt)
+ formatted = '{0}'.format(arr[0])
+ assert_equal(formatted, str(arr[0]))
+
+ def test_deepcopy_on_0d_array(self):
+ # Ticket #3311.
+ arr = np.array(3)
+ arr_cp = copy.deepcopy(arr)
+
+ assert_equal(arr, arr_cp)
+ assert_equal(arr.shape, arr_cp.shape)
+ assert_equal(int(arr), int(arr_cp))
+ self.assertTrue(arr is not arr_cp)
+ self.assertTrue(isinstance(arr_cp, type(arr)))
+
+ def test_bool_subscript_crash(self):
+ # gh-4494
+ c = np.rec.array([(1, 2, 3), (4, 5, 6)])
+ masked = c[np.array([True, False])]
+ base = masked.base
+ del masked, c
+ base.dtype
+
+ def test_richcompare_crash(self):
+ # gh-4613
+ import operator as op
+
+ # dummy class where __array__ throws exception
+ class Foo(object):
+ __array_priority__ = 1002
+ def __array__(self,*args,**kwargs):
+ raise Exception()
+
+ rhs = Foo()
+ lhs = np.array(1)
+ for f in [op.lt, op.le, op.gt, op.ge]:
+ if sys.version_info[0] >= 3:
+ assert_raises(TypeError, f, lhs, rhs)
+ else:
+ f(lhs, rhs)
+ assert_(not op.eq(lhs, rhs))
+ assert_(op.ne(lhs, rhs))
+
+ def test_richcompare_scalar_and_subclass(self):
+ # gh-4709
+ class Foo(np.ndarray):
+ def __eq__(self, other):
+ return "OK"
+ x = np.array([1,2,3]).view(Foo)
+ assert_equal(10 == x, "OK")
+ assert_equal(np.int32(10) == x, "OK")
+ assert_equal(np.array([10]) == x, "OK")
+
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/core/tests/test_scalarinherit.py b/numpy/core/tests/test_scalarinherit.py
new file mode 100644
index 000000000..6f394196c
--- /dev/null
+++ b/numpy/core/tests/test_scalarinherit.py
@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+""" Test printing of scalar types.
+
+"""
+
+import numpy as np
+from numpy.testing import TestCase, run_module_suite
+
+
+class A(object): pass
+class B(A, np.float64): pass
+
+class C(B): pass
+class D(C, B): pass
+
+class B0(np.float64, A): pass
+class C0(B0): pass
+
+class TestInherit(TestCase):
+ def test_init(self):
+ x = B(1.0)
+ assert str(x) == '1.0'
+ y = C(2.0)
+ assert str(y) == '2.0'
+ z = D(3.0)
+ assert str(z) == '3.0'
+ def test_init2(self):
+ x = B0(1.0)
+ assert str(x) == '1.0'
+ y = C0(2.0)
+ assert str(y) == '2.0'
+
+if __name__ == "__main__":
+ run_module_suite()
diff --git a/numpy/core/tests/test_scalarmath.py b/numpy/core/tests/test_scalarmath.py
index 7bbb62be2..d823e963f 100644
--- a/numpy/core/tests/test_scalarmath.py
+++ b/numpy/core/tests/test_scalarmath.py
@@ -45,6 +45,12 @@ class TestTypes(TestCase):
b = atype([1, 2, 3])
assert_equal(a, b)
+ def test_leak(self):
+ # test leak of scalar objects
+ # a leak would show up in valgrind as still-reachable of ~2.6MB
+ for i in range(200000):
+ np.add(1, 1)
+
class TestBaseMath(TestCase):
def test_blocked(self):
@@ -163,6 +169,12 @@ class TestConversion(TestCase):
for code in 'lLqQ':
assert_raises(OverflowError, Overflow_error_func, code)
+ def test_longdouble_int(self):
+ # gh-627
+ x = np.longdouble(np.inf)
+ assert_raises(OverflowError, x.__int__)
+ x = np.clongdouble(np.inf)
+ assert_raises(OverflowError, x.__int__)
def test_numpy_scalar_relational_operators(self):
#All integer
diff --git a/numpy/core/tests/test_shape_base.py b/numpy/core/tests/test_shape_base.py
index e94e964b2..f1f5311c9 100644
--- a/numpy/core/tests/test_shape_base.py
+++ b/numpy/core/tests/test_shape_base.py
@@ -183,7 +183,7 @@ def test_concatenate_axis_None():
assert_equal(r.size, a.size + len(b))
assert_equal(r.dtype, a.dtype)
r = np.concatenate((a, b, c), axis=None)
- d = array(['0', '1', '2', '3',
+ d = array(['0.0', '1.0', '2.0', '3.0',
'0', '1', '2', 'x'])
assert_array_equal(r, d)
diff --git a/numpy/core/tests/test_ufunc.py b/numpy/core/tests/test_ufunc.py
index b217936f7..c9267671f 100644
--- a/numpy/core/tests/test_ufunc.py
+++ b/numpy/core/tests/test_ufunc.py
@@ -14,6 +14,10 @@ class TestUfunc(TestCase):
import pickle
assert pickle.loads(pickle.dumps(np.sin)) is np.sin
+ # Check that ufunc not defined in the top level numpy namespace such as
+ # numpy.core.test_rational.test_add can also be pickled
+ assert pickle.loads(pickle.dumps(test_add)) is test_add
+
def test_pickle_withstring(self):
import pickle
astring = asbytes("cnumpy.core\n_ufunc_reconstruct\np0\n"
@@ -340,6 +344,10 @@ class TestUfunc(TestCase):
assert_almost_equal(np.sum(d[-1::-2]), 250.)
assert_almost_equal(np.sum(d[::-3]), 167.)
assert_almost_equal(np.sum(d[-1::-3]), 167.)
+ # sum with first reduction entry != 0
+ d = np.ones((1,), dtype=dt)
+ d += d
+ assert_almost_equal(d, 2.)
def test_sum_complex(self):
for dt in (np.complex64, np.complex128, np.clongdouble):
@@ -361,6 +369,10 @@ class TestUfunc(TestCase):
assert_almost_equal(np.sum(d[-1::-2]), 250. + 250j)
assert_almost_equal(np.sum(d[::-3]), 167. + 167j)
assert_almost_equal(np.sum(d[-1::-3]), 167. + 167j)
+ # sum with first reduction entry != 0
+ d = np.ones((1,), dtype=dt) + 1j
+ d += d
+ assert_almost_equal(d, 2. + 2j)
def test_inner1d(self):
a = np.arange(6).reshape((2, 3))
@@ -580,6 +592,15 @@ class TestUfunc(TestCase):
assert_equal(np.all(a), False)
assert_equal(np.max(a), True)
assert_equal(np.min(a), False)
+ assert_equal(np.array([[1]], dtype=object).sum(), 1)
+ assert_equal(np.array([[[1, 2]]], dtype=object).sum((0, 1)), [1, 2])
+
+ def test_object_scalar_multiply(self):
+ # Tickets #2469 and #4482
+ arr = np.matrix([1, 2], dtype=object)
+ desired = np.matrix([[3, 6]], dtype=object)
+ assert_equal(np.multiply(arr, 3), desired)
+ assert_equal(np.multiply(3, arr), desired)
def test_zerosize_reduction(self):
# Test with default dtype and object dtype
diff --git a/numpy/core/tests/test_umath.py b/numpy/core/tests/test_umath.py
index 6db95e9a6..b3ddc2398 100644
--- a/numpy/core/tests/test_umath.py
+++ b/numpy/core/tests/test_umath.py
@@ -2,6 +2,7 @@ from __future__ import division, absolute_import, print_function
import sys
import platform
+import warnings
from numpy.testing import *
from numpy.testing.utils import _gen_alignment_data
@@ -175,6 +176,11 @@ class TestPower(TestCase):
x = np.array([1, 2, 3], np.int16)
assert_((x**2.00001).dtype is (x**2.0).dtype)
+ # Check that the fast path ignores 1-element not 0-d arrays
+ res = x ** np.array([[[2]]])
+ assert_equal(res.shape, (1, 1, 3))
+
+
class TestLog2(TestCase):
def test_log2_values(self) :
x = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024]
@@ -184,6 +190,27 @@ class TestLog2(TestCase):
yf = np.array(y, dtype=dt)
assert_almost_equal(np.log2(xf), yf)
+ def test_log2_ints(self):
+ # a good log2 implementation should provide this,
+ # might fail on OS with bad libm
+ for i in range(1, 65):
+ v = np.log2(2.**i)
+ assert_equal(v, float(i), err_msg='at exponent %d' % i)
+
+ def test_log2_special(self):
+ assert_equal(np.log2(1.), 0.)
+ assert_equal(np.log2(np.inf), np.inf)
+ assert_(np.isnan(np.log2(np.nan)))
+
+ with warnings.catch_warnings(record=True) as w:
+ warnings.filterwarnings('always', '', RuntimeWarning)
+ assert_(np.isnan(np.log2(-1.)))
+ assert_(np.isnan(np.log2(-np.inf)))
+ assert_equal(np.log2(0.), -np.inf)
+ assert_(w[0].category is RuntimeWarning)
+ assert_(w[1].category is RuntimeWarning)
+ assert_(w[2].category is RuntimeWarning)
+
class TestExp2(TestCase):
def test_exp2_values(self) :
@@ -305,12 +332,28 @@ class TestLog1p(TestCase):
assert_almost_equal(ncu.log1p(0.2), ncu.log(1.2))
assert_almost_equal(ncu.log1p(1e-6), ncu.log(1+1e-6))
+ def test_special(self):
+ assert_equal(ncu.log1p(np.nan), np.nan)
+ assert_equal(ncu.log1p(np.inf), np.inf)
+ with np.errstate(divide="ignore"):
+ assert_equal(ncu.log1p(-1.), -np.inf)
+ with np.errstate(invalid="ignore"):
+ assert_equal(ncu.log1p(-2.), np.nan)
+ assert_equal(ncu.log1p(-np.inf), np.nan)
+
class TestExpm1(TestCase):
def test_expm1(self):
assert_almost_equal(ncu.expm1(0.2), ncu.exp(0.2)-1)
assert_almost_equal(ncu.expm1(1e-6), ncu.exp(1e-6)-1)
+ def test_special(self):
+ assert_equal(ncu.expm1(np.inf), np.inf)
+ assert_equal(ncu.expm1(0.), 0.)
+ assert_equal(ncu.expm1(-0.), -0.)
+ assert_equal(ncu.expm1(np.inf), np.inf)
+ assert_equal(ncu.expm1(-np.inf), -1.)
+
class TestHypot(TestCase, object):
def test_simple(self):
@@ -642,6 +685,24 @@ class TestFmin(_FilterInvalids):
assert_equal(np.fmin(arg1, arg2), out)
+class TestBool(TestCase):
+ def test_truth_table(self):
+ arg1 = [False, False, True, True]
+ arg2 = [False, True, False, True]
+ # OR
+ out = [False, True, True, True]
+ for func in (np.logical_or, np.bitwise_or, np.maximum):
+ assert_equal(func(arg1, arg2), out)
+ # AND
+ out = [False, False, False, True]
+ for func in (np.logical_and, np.bitwise_and, np.minimum):
+ assert_equal(func(arg1, arg2), out)
+ # XOR
+ out = [False, True, True, False]
+ for func in (np.logical_xor, np.bitwise_xor, np.not_equal):
+ assert_equal(func(arg1, arg2), out)
+
+
class TestFloatingPoint(TestCase):
def test_floating_point(self):
assert_equal(ncu.FLOATING_POINT_SUPPORT, 1)
@@ -693,8 +754,8 @@ class TestMinMax(TestCase):
assert_equal(inp.min(), -1e10, err_msg=msg)
-class TestAbsolute(TestCase):
- def test_abs_blocked(self):
+class TestAbsoluteNegative(TestCase):
+ def test_abs_neg_blocked(self):
# simd tests on abs, test all alignments for vz + 2 * (vs - 1) + 1
for dt, sz in [(np.float32, 11), (np.float64, 5)]:
for out, inp, msg in _gen_alignment_data(dtype=dt, type='unary',
@@ -704,6 +765,10 @@ class TestAbsolute(TestCase):
assert_equal(out, tgt, err_msg=msg)
self.assertTrue((out >= 0).all())
+ tgt = [-1*(i) for i in inp]
+ np.negative(inp, out=out)
+ assert_equal(out, tgt, err_msg=msg)
+
# will throw invalid flag depending on compiler optimizations
with np.errstate(invalid='ignore'):
for v in [np.nan, -np.inf, np.inf]:
@@ -716,6 +781,10 @@ class TestAbsolute(TestCase):
np.abs(inp, out=out)
assert_array_equal(out, d, err_msg=msg)
+ assert_array_equal(-inp, -1*inp, err_msg=msg)
+ np.negative(inp, out=out)
+ assert_array_equal(out, -1*inp, err_msg=msg)
+
class TestSpecialMethods(TestCase):
def test_wrap(self):
@@ -900,9 +969,9 @@ class TestSpecialMethods(TestCase):
assert_equal(res1[4], (a, b))
assert_equal(res0[5], {})
assert_equal(res1[5], {})
-
+
def test_ufunc_override_mro(self):
-
+
# Some multi arg functions for testing.
def tres_mul(a, b, c):
return a * b * c
@@ -929,7 +998,7 @@ class TestSpecialMethods(TestCase):
class C(object):
def __numpy_ufunc__(self, func, method, pos, inputs, **kwargs):
return NotImplemented
-
+
class CSub(object):
def __numpy_ufunc__(self, func, method, pos, inputs, **kwargs):
return NotImplemented
@@ -961,7 +1030,7 @@ class TestSpecialMethods(TestCase):
assert_equal(three_mul_ufunc(a, 1, 2), "A")
assert_equal(three_mul_ufunc(1, a, 2), "A")
assert_equal(three_mul_ufunc(1, 2, a), "A")
-
+
assert_equal(three_mul_ufunc(a, a, 6), "A")
assert_equal(three_mul_ufunc(a, 2, a), "A")
assert_equal(three_mul_ufunc(a, 2, b), "A")
@@ -997,39 +1066,105 @@ class TestSpecialMethods(TestCase):
def test_ufunc_override_methods(self):
class A(object):
def __numpy_ufunc__(self, ufunc, method, pos, inputs, **kwargs):
- if method == "__call__":
- return method
- if method == "reduce":
- return method
- if method == "accumulate":
- return method
- if method == "reduceat":
- return method
+ return self, ufunc, method, pos, inputs, kwargs
+ # __call__
a = A()
- res = np.multiply(1, a)
- assert_equal(res, "__call__")
-
- res = np.multiply.reduce(1, a)
- assert_equal(res, "reduce")
-
- res = np.multiply.accumulate(1, a)
- assert_equal(res, "accumulate")
-
- res = np.multiply.reduceat(1, a)
- assert_equal(res, "reduceat")
-
- res = np.multiply(a, 1)
- assert_equal(res, "__call__")
-
- res = np.multiply.reduce(a, 1)
- assert_equal(res, "reduce")
-
- res = np.multiply.accumulate(a, 1)
- assert_equal(res, "accumulate")
-
- res = np.multiply.reduceat(a, 1)
- assert_equal(res, "reduceat")
+ res = np.multiply.__call__(1, a, foo='bar', answer=42)
+ assert_equal(res[0], a)
+ assert_equal(res[1], np.multiply)
+ assert_equal(res[2], '__call__')
+ assert_equal(res[3], 1)
+ assert_equal(res[4], (1, a))
+ assert_equal(res[5], {'foo': 'bar', 'answer': 42})
+
+ # reduce, positional args
+ res = np.multiply.reduce(a, 'axis0', 'dtype0', 'out0', 'keep0')
+ assert_equal(res[0], a)
+ assert_equal(res[1], np.multiply)
+ assert_equal(res[2], 'reduce')
+ assert_equal(res[3], 0)
+ assert_equal(res[4], (a,))
+ assert_equal(res[5], {'dtype':'dtype0',
+ 'out': 'out0',
+ 'keepdims': 'keep0',
+ 'axis': 'axis0'})
+
+ # reduce, kwargs
+ res = np.multiply.reduce(a, axis='axis0', dtype='dtype0', out='out0',
+ keepdims='keep0')
+ assert_equal(res[0], a)
+ assert_equal(res[1], np.multiply)
+ assert_equal(res[2], 'reduce')
+ assert_equal(res[3], 0)
+ assert_equal(res[4], (a,))
+ assert_equal(res[5], {'dtype':'dtype0',
+ 'out': 'out0',
+ 'keepdims': 'keep0',
+ 'axis': 'axis0'})
+
+ # accumulate, pos args
+ res = np.multiply.accumulate(a, 'axis0', 'dtype0', 'out0')
+ assert_equal(res[0], a)
+ assert_equal(res[1], np.multiply)
+ assert_equal(res[2], 'accumulate')
+ assert_equal(res[3], 0)
+ assert_equal(res[4], (a,))
+ assert_equal(res[5], {'dtype':'dtype0',
+ 'out': 'out0',
+ 'axis': 'axis0'})
+
+ # accumulate, kwargs
+ res = np.multiply.accumulate(a, axis='axis0', dtype='dtype0',
+ out='out0')
+ assert_equal(res[0], a)
+ assert_equal(res[1], np.multiply)
+ assert_equal(res[2], 'accumulate')
+ assert_equal(res[3], 0)
+ assert_equal(res[4], (a,))
+ assert_equal(res[5], {'dtype':'dtype0',
+ 'out': 'out0',
+ 'axis': 'axis0'})
+
+ # reduceat, pos args
+ res = np.multiply.reduceat(a, [4, 2], 'axis0', 'dtype0', 'out0')
+ assert_equal(res[0], a)
+ assert_equal(res[1], np.multiply)
+ assert_equal(res[2], 'reduceat')
+ assert_equal(res[3], 0)
+ assert_equal(res[4], (a, [4, 2]))
+ assert_equal(res[5], {'dtype':'dtype0',
+ 'out': 'out0',
+ 'axis': 'axis0'})
+
+ # reduceat, kwargs
+ res = np.multiply.reduceat(a, [4, 2], axis='axis0', dtype='dtype0',
+ out='out0')
+ assert_equal(res[0], a)
+ assert_equal(res[1], np.multiply)
+ assert_equal(res[2], 'reduceat')
+ assert_equal(res[3], 0)
+ assert_equal(res[4], (a, [4, 2]))
+ assert_equal(res[5], {'dtype':'dtype0',
+ 'out': 'out0',
+ 'axis': 'axis0'})
+
+ # outer
+ res = np.multiply.outer(a, 42)
+ assert_equal(res[0], a)
+ assert_equal(res[1], np.multiply)
+ assert_equal(res[2], 'outer')
+ assert_equal(res[3], 0)
+ assert_equal(res[4], (a, 42))
+ assert_equal(res[5], {})
+
+ # at
+ res = np.multiply.at(a, [4, 2], 'b0')
+ assert_equal(res[0], a)
+ assert_equal(res[1], np.multiply)
+ assert_equal(res[2], 'at')
+ assert_equal(res[3], 0)
+ assert_equal(res[4], (a, [4, 2], 'b0'))
def test_ufunc_override_out(self):
class A(object):
@@ -1065,7 +1200,6 @@ class TestSpecialMethods(TestCase):
assert_equal(res7['out'][0], 'out0')
assert_equal(res7['out'][1], 'out1')
-
def test_ufunc_override_exception(self):
class A(object):
def __numpy_ufunc__(self, *a, **kwargs):
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py
index 5d363eb4e..0086e3632 100644
--- a/numpy/distutils/command/config.py
+++ b/numpy/distutils/command/config.py
@@ -307,7 +307,10 @@ int main ()
self._check_compiler()
body = []
if decl:
- body.append("int %s (void);" % func)
+ if type(decl) == str:
+ body.append(decl)
+ else:
+ body.append("int %s (void);" % func)
# Handle MSVC intrinsics: 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 intrinsic and our 'fake' test
@@ -401,7 +404,7 @@ int main ()
def get_output(self, body, headers=None, include_dirs=None,
libraries=None, library_dirs=None,
- lang="c"):
+ lang="c", use_tee=None):
"""Try to compile, link to an executable, and run a program
built from 'body' and 'headers'. Returns the exit status code
of the program and its output.
@@ -426,7 +429,8 @@ int main ()
grabber.restore()
raise
exe = os.path.join('.', exe)
- exitstatus, output = exec_command(exe, execute_in='.')
+ exitstatus, output = exec_command(exe, execute_in='.',
+ use_tee=use_tee)
if hasattr(os, 'WEXITSTATUS'):
exitcode = os.WEXITSTATUS(exitstatus)
if os.WIFSIGNALED(exitstatus):
diff --git a/numpy/distutils/command/install.py b/numpy/distutils/command/install.py
index 2da21542f..a1dd47755 100644
--- a/numpy/distutils/command/install.py
+++ b/numpy/distutils/command/install.py
@@ -7,9 +7,10 @@ if 'setuptools' in sys.modules:
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
+old_install = old_install_mod.install
+
class install(old_install):
# Always run install_clib - the command is cheap, so no need to bypass it;
@@ -28,9 +29,11 @@ class install(old_install):
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.
"""
+ from distutils.command.install import install as distutils_install
+
# 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)
+ return distutils_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
@@ -48,7 +51,7 @@ class install(old_install):
# 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)
+ distutils_install.run(self)
else:
self.do_egg_install()
diff --git a/numpy/distutils/exec_command.py b/numpy/distutils/exec_command.py
index 648a98efb..baf81f337 100644
--- a/numpy/distutils/exec_command.py
+++ b/numpy/distutils/exec_command.py
@@ -120,7 +120,7 @@ def find_executable(exe, path=None, _cache={}):
if not os.path.islink(f_ext):
f_ext = realpath(f_ext)
if os.path.isfile(f_ext) and os.access(f_ext, os.X_OK):
- log.good('Found executable %s' % f_ext)
+ log.info('Found executable %s' % f_ext)
_cache[key] = f_ext
return f_ext
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index 5ee3df2dc..b786c0a46 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -35,13 +35,13 @@ class GnuFCompiler(FCompiler):
def gnu_version_match(self, version_string):
"""Handle the different versions of GNU fortran compilers"""
- m = re.match(r'GNU Fortran', version_string)
+ m = re.search(r'GNU Fortran', version_string)
if not m:
return None
- m = re.match(r'GNU Fortran\s+95.*?([0-9-.]+)', version_string)
+ m = re.search(r'GNU Fortran\s+95.*?([0-9-.]+)', version_string)
if m:
return ('gfortran', m.group(1))
- m = re.match(r'GNU Fortran.*?\-?([0-9-.]+)', version_string)
+ m = re.search(r'GNU Fortran.*?\-?([0-9-.]+)', version_string)
if m:
v = m.group(1)
if v.startswith('0') or v.startswith('2') or v.startswith('3'):
diff --git a/numpy/distutils/fcompiler/intel.py b/numpy/distutils/fcompiler/intel.py
index 21a3c5eaf..a80e525e3 100644
--- a/numpy/distutils/fcompiler/intel.py
+++ b/numpy/distutils/fcompiler/intel.py
@@ -68,7 +68,7 @@ class IntelFCompiler(BaseIntelFCompiler):
opt.remove('-shared')
except ValueError:
idx = 0
- opt[idx:idx] = ['-dynamiclib', '-Wl,-undefined,dynamic_lookup', '-Wl,-framework,Python']
+ opt[idx:idx] = ['-dynamiclib', '-Wl,-undefined,dynamic_lookup']
return opt
class IntelItaniumFCompiler(IntelFCompiler):
@@ -162,7 +162,7 @@ class IntelVisualFCompiler(BaseIntelFCompiler):
return ['/4Yb', '/d2']
def get_flags_opt(self):
- return ['/O2']
+ return ['/O1'] # Scipy test failures with /O2
def get_flags_arch(self):
return ["/arch:IA-32", "/QaxSSE3"]
diff --git a/numpy/distutils/system_info.py b/numpy/distutils/system_info.py
index 5ed12db6e..48c92c548 100644
--- a/numpy/distutils/system_info.py
+++ b/numpy/distutils/system_info.py
@@ -137,6 +137,9 @@ from numpy.distutils.misc_util import is_sequence, is_string, \
get_shared_lib_extension
from numpy.distutils.command.config import config as cmd_config
from numpy.distutils.compat import get_exception
+import distutils.ccompiler
+import tempfile
+import shutil
# Determine number of bits
@@ -300,7 +303,10 @@ def get_info(name, notfound_action=0):
'lapack_atlas': lapack_atlas_info, # use lapack_opt instead
'lapack_atlas_threads': lapack_atlas_threads_info, # ditto
'mkl': mkl_info,
+ # openblas which may or may not have embedded lapack
'openblas': openblas_info, # use blas_opt instead
+ # openblas with embedded lapack
+ 'openblas_lapack': openblas_lapack_info, # use blas_opt instead
'lapack_mkl': lapack_mkl_info, # use lapack_opt instead
'blas_mkl': blas_mkl_info, # use blas_opt instead
'x11': x11_info,
@@ -449,7 +455,6 @@ class system_info:
self.__class__.info = {}
self.local_prefixes = []
defaults = {}
- defaults['libraries'] = ''
defaults['library_dirs'] = os.pathsep.join(default_lib_dirs)
defaults['include_dirs'] = os.pathsep.join(default_include_dirs)
defaults['src_dirs'] = os.pathsep.join(default_src_dirs)
@@ -703,7 +708,7 @@ class system_info:
else:
found_libs = self._lib_list(lib_dirs, libs, exts)
found_dirs = [lib_dirs]
- if len(found_libs) == len(libs):
+ if len(found_libs) > 0 and len(found_libs) == len(libs):
info = {'libraries': found_libs, 'library_dirs': found_dirs}
# Now, check for optional libraries
if is_sequence(lib_dirs):
@@ -756,9 +761,6 @@ class fftw_info(system_info):
'includes':['fftw.h', 'rfftw.h'],
'macros':[('SCIPY_FFTW_H', None)]}]
- def __init__(self):
- system_info.__init__(self)
-
def calc_ver_info(self, ver_param):
"""Returns True on successful version detection, else False"""
lib_dirs = self.get_lib_dirs()
@@ -1302,11 +1304,13 @@ def get_atlas_version(**config):
info = {}
try:
s, o = c.get_output(atlas_version_c_text,
- libraries=libraries, library_dirs=library_dirs)
+ libraries=libraries, library_dirs=library_dirs,
+ use_tee=(system_info.verbosity > 0))
if s and re.search(r'undefined reference to `_gfortran', o, re.M):
s, o = c.get_output(atlas_version_c_text,
libraries=libraries + ['gfortran'],
- library_dirs=library_dirs)
+ library_dirs=library_dirs,
+ use_tee=(system_info.verbosity > 0))
if not s:
warnings.warn("""
*****************************************************
@@ -1369,7 +1373,7 @@ class lapack_opt_info(system_info):
def calc_info(self):
- openblas_info = get_info('openblas')
+ openblas_info = get_info('openblas_lapack')
if openblas_info:
self.set_info(**openblas_info)
return
@@ -1480,7 +1484,7 @@ class blas_opt_info(system_info):
if not atlas_info:
atlas_info = get_info('atlas_blas')
- if sys.platform == 'darwin'and not atlas_info:
+ if sys.platform == 'darwin' and not atlas_info:
# Use the system BLAS from Accelerate or vecLib under OSX
args = []
link_args = []
@@ -1562,17 +1566,59 @@ class openblas_info(blas_info):
_lib_names = ['openblas']
notfounderror = BlasNotFoundError
+ def check_embedded_lapack(self, info):
+ return True
+
def calc_info(self):
lib_dirs = self.get_lib_dirs()
- openblas_libs = self.get_libs('openblas_libs', self._lib_names)
+ openblas_libs = self.get_libs('libraries', self._lib_names)
+ if openblas_libs == self._lib_names: # backward compat with 1.8.0
+ openblas_libs = self.get_libs('openblas_libs', self._lib_names)
info = self.check_libs(lib_dirs, openblas_libs, [])
if info is None:
return
+
+ if not self.check_embedded_lapack(info):
+ return None
+
info['language'] = 'f77' # XXX: is it generally true?
self.set_info(**info)
+class openblas_lapack_info(openblas_info):
+ section = 'openblas'
+ dir_env_var = 'OPENBLAS'
+ _lib_names = ['openblas']
+ notfounderror = BlasNotFoundError
+
+ def check_embedded_lapack(self, info):
+ res = False
+ c = distutils.ccompiler.new_compiler()
+ tmpdir = tempfile.mkdtemp()
+ s = """void zungqr();
+ int main(int argc, const char *argv[])
+ {
+ zungqr_();
+ return 0;
+ }"""
+ src = os.path.join(tmpdir, 'source.c')
+ out = os.path.join(tmpdir, 'a.out')
+ try:
+ with open(src, 'wt') as f:
+ f.write(s)
+ obj = c.compile([src], output_dir=tmpdir)
+ try:
+ c.link_executable(obj, out, libraries=info['libraries'],
+ library_dirs=info['library_dirs'])
+ res = True
+ except distutils.ccompiler.LinkError:
+ res = False
+ finally:
+ shutil.rmtree(tmpdir)
+ return res
+
+
class blas_src_info(system_info):
section = 'blas_src'
dir_env_var = 'BLAS_SRC'
diff --git a/numpy/doc/broadcasting.py b/numpy/doc/broadcasting.py
index 43b725b83..717914cda 100644
--- a/numpy/doc/broadcasting.py
+++ b/numpy/doc/broadcasting.py
@@ -68,8 +68,8 @@ they are compatible::
Scale (1d array): 3
Result (3d array): 256 x 256 x 3
-When either of the dimensions compared is one, the larger of the two is
-used. In other words, the smaller of two axes is stretched or "copied"
+When either of the dimensions compared is one, the other is
+used. In other words, dimensions with size 1 are stretched or "copied"
to match the other.
In the following example, both the ``A`` and ``B`` arrays have axes with
@@ -171,7 +171,7 @@ Here the ``newaxis`` index operator inserts a new axis into ``a``,
making it a two-dimensional ``4x1`` array. Combining the ``4x1`` array
with ``b``, which has shape ``(3,)``, yields a ``4x3`` array.
-See `this article <http://www.scipy.org/EricsBroadcastingDoc>`_
+See `this article <http://wiki.scipy.org/EricsBroadcastingDoc>`_
for illustrations of broadcasting concepts.
"""
diff --git a/numpy/doc/byteswapping.py b/numpy/doc/byteswapping.py
index ffefe3168..430683d30 100644
--- a/numpy/doc/byteswapping.py
+++ b/numpy/doc/byteswapping.py
@@ -101,7 +101,7 @@ the correct endianness:
Note the the array has not changed in memory:
->>> fixed_end_dtype_arr.tostring() == big_end_str
+>>> fixed_end_dtype_arr.tobytes() == big_end_str
True
Data and type endianness don't match, change data to match dtype
@@ -117,7 +117,7 @@ that needs a certain byte ordering.
Now the array *has* changed in memory:
->>> fixed_end_mem_arr.tostring() == big_end_str
+>>> fixed_end_mem_arr.tobytes() == big_end_str
False
Data and dtype endianness match, swap data and dtype
@@ -131,7 +131,7 @@ the previous operations:
>>> swapped_end_arr = big_end_arr.byteswap().newbyteorder()
>>> swapped_end_arr[0]
1
->>> swapped_end_arr.tostring() == big_end_str
+>>> swapped_end_arr.tobytes() == big_end_str
False
An easier way of casting the data to a specific dtype and byte ordering
@@ -140,7 +140,7 @@ can be achieved with the ndarray astype method:
>>> swapped_end_arr = big_end_arr.astype('<i2')
>>> swapped_end_arr[0]
1
->>> swapped_end_arr.tostring() == big_end_str
+>>> swapped_end_arr.tobytes() == big_end_str
False
"""
diff --git a/numpy/doc/misc.py b/numpy/doc/misc.py
index 311e6e0c8..1709ad66d 100644
--- a/numpy/doc/misc.py
+++ b/numpy/doc/misc.py
@@ -3,8 +3,8 @@
Miscellaneous
=============
-IEEE 754 Floating Point Special Values:
------------------------------------------------
+IEEE 754 Floating Point Special Values
+--------------------------------------
Special values defined in numpy: nan, inf,
@@ -46,8 +46,8 @@ from the results: ::
>>> np.nansum(x)
42.0
-How numpy handles numerical exceptions:
-------------------------------------------
+How numpy handles numerical exceptions
+--------------------------------------
The default is to ``'warn'`` for ``invalid``, ``divide``, and ``overflow``
and ``'ignore'`` for ``underflow``. But this can be changed, and it can be
@@ -72,8 +72,8 @@ These behaviors can be set for all kinds of errors or specific ones:
Note that integer divide-by-zero is handled by the same machinery.
These behaviors are set on a per-thread basis.
-Examples:
-------------
+Examples
+--------
::
@@ -96,8 +96,8 @@ Examples:
>>> j = np.seterr(**oldsettings) # restore previous
... # error-handling settings
-Interfacing to C:
------------------
+Interfacing to C
+----------------
Only a survey of the choices. Little detail on how each works.
1) Bare metal, wrap your own C-code manually.
@@ -121,29 +121,22 @@ Only a survey of the choices. Little detail on how each works.
- API will change for Python 3.0!
-2) pyrex
+2) Cython
- Plusses:
- avoid learning C API's
- no dealing with reference counting
- - can code in psuedo python and generate C code
+ - can code in pseudo python and generate C code
- can also interface to existing C code
- should shield you from changes to Python C api
- - become pretty popular within Python community
+ - has become the de-facto standard within the scientific Python community
+ - fast indexing support for arrays
- Minuses:
- Can write code in non-standard form which may become obsolete
- Not as flexible as manual wrapping
- - Maintainers not easily adaptable to new features
-
-Thus:
-
-3) cython - fork of pyrex to allow needed features for SAGE
-
- - being considered as the standard scipy/numpy wrapping tool
- - fast indexing support for arrays
4) ctypes
@@ -180,16 +173,15 @@ Thus:
- generates lots of code between Python and the C code
- can cause performance problems that are nearly impossible to optimize
- out
+ out
- interface files can be hard to write
- doesn't necessarily avoid reference counting issues or needing to know
API's
-7) Weave
+7) scipy.weave
- Plusses:
- - Phenomenal tool
- can turn many numpy expressions into C code
- dynamic compiling and loading of generated C code
- can embed pure C code in Python module and have weave extract, generate
@@ -197,7 +189,8 @@ Thus:
- Minuses:
- - Future uncertain--lacks a champion
+ - Future very uncertain: it's the only part of Scipy not ported to Python 3
+ and is effectively deprecated in favor of Cython.
8) Psyco
@@ -214,15 +207,19 @@ Thus:
Interfacing to Fortran:
-----------------------
-Fortran: Clear choice is f2py. (Pyfort is an older alternative, but not
-supported any longer)
+The clear choice to wrap Fortran code is
+`f2py <http://docs.scipy.org/doc/numpy-dev/f2py/>`_.
+
+Pyfort is an older alternative, but not supported any longer.
+Fwrap is a newer project that looked promising but isn't being developed any
+longer.
Interfacing to C++:
-------------------
- 1) CXX
- 2) Boost.python
- 3) SWIG
- 4) Sage has used cython to wrap C++ (not pretty, but it can be done)
+ 1) Cython
+ 2) CXX
+ 3) Boost.python
+ 4) SWIG
5) SIP (used mainly in PyQT)
"""
diff --git a/numpy/f2py/__init__.py b/numpy/f2py/__init__.py
index ccdbd4e0b..fcfd1853e 100644
--- a/numpy/f2py/__init__.py
+++ b/numpy/f2py/__init__.py
@@ -28,20 +28,20 @@ def compile(source,
from numpy.distutils.exec_command import exec_command
import tempfile
if source_fn is None:
- fname = os.path.join(tempfile.mktemp()+'.f')
+ f = tempfile.NamedTemporaryFile(suffix='.f')
else:
- fname = source_fn
-
- f = open(fname, 'w')
- f.write(source)
- f.close()
-
- args = ' -c -m %s %s %s'%(modulename, fname, extra_args)
- c = '%s -c "import numpy.f2py as f2py2e;f2py2e.main()" %s' %(sys.executable, args)
- s, o = exec_command(c)
- if source_fn is None:
- try: os.remove(fname)
- except OSError: pass
+ f = open(source_fn, 'w')
+
+ try:
+ f.write(source)
+ f.flush()
+
+ args = ' -c -m %s %s %s'%(modulename, f.name, extra_args)
+ c = '%s -c "import numpy.f2py as f2py2e;f2py2e.main()" %s' % \
+ (sys.executable, args)
+ s, o = exec_command(c)
+ finally:
+ f.close()
return s
from numpy.testing import Tester
diff --git a/numpy/f2py/cfuncs.py b/numpy/f2py/cfuncs.py
index 5a5d2bf64..7fb630697 100644
--- a/numpy/f2py/cfuncs.py
+++ b/numpy/f2py/cfuncs.py
@@ -75,7 +75,7 @@ typedef long long long_long;
typedef unsigned long long unsigned_long_long;
#endif
"""
-typedefs['insinged_long_long']="""\
+typedefs['unsigned_long_long']="""\
#ifdef _WIN32
typedef __uint64 long_long;
#else
@@ -312,7 +312,7 @@ cppmacros['pyobj_from_complex_float1']='#define pyobj_from_complex_float1(v) (Py
needs['pyobj_from_string1']=['string']
cppmacros['pyobj_from_string1']='#define pyobj_from_string1(v) (PyString_FromString((char *)v))'
needs['pyobj_from_string1size']=['string']
-cppmacros['pyobj_from_string1size']='#define pyobj_from_string1size(v,len) (PyString_FromStringAndSize((char *)v, len))'
+cppmacros['pyobj_from_string1size']='#define pyobj_from_string1size(v,len) (PyUString_FromStringAndSize((char *)v, len))'
needs['TRYPYARRAYTEMPLATE']=['PRINTPYOBJERR']
cppmacros['TRYPYARRAYTEMPLATE']="""\
/* New SciPy */
diff --git a/numpy/f2py/f2py2e.py b/numpy/f2py/f2py2e.py
index ff9d19e9d..25407d421 100755
--- a/numpy/f2py/f2py2e.py
+++ b/numpy/f2py/f2py2e.py
@@ -91,7 +91,7 @@ Options:
--lower is assumed with -h key, and --no-lower without -h key.
--build-dir <dirname> All f2py generated files are created in <dirname>.
- Default is tempfile.mktemp().
+ Default is tempfile.mkdtemp().
--overwrite-signature Overwrite existing signature file.
@@ -424,7 +424,7 @@ def run_compile():
del sys.argv[i]
else:
remove_build_dir = 1
- build_dir = os.path.join(tempfile.mktemp())
+ build_dir = tempfile.mkdtemp()
_reg1 = re.compile(r'[-][-]link[-]')
sysinfo_flags = [_m for _m in sys.argv[1:] if _reg1.match(_m)]
diff --git a/numpy/f2py/src/fortranobject.c b/numpy/f2py/src/fortranobject.c
index c07de99c0..9c96c1f46 100644
--- a/numpy/f2py/src/fortranobject.c
+++ b/numpy/f2py/src/fortranobject.c
@@ -335,7 +335,7 @@ fortran_call(PyFortranObject *fp, PyObject *arg, PyObject *kw) {
name=%s,func=%p,data=%p,%p\n",fp->defs[i].name,
fp->defs[i].func,fp->defs[i].data,&fp->defs[i].data); */
if (fp->defs[i].rank==-1) {/* is Fortran routine */
- if ((fp->defs[i].func==NULL)) {
+ if (fp->defs[i].func==NULL) {
PyErr_Format(PyExc_RuntimeError, "no function to call");
return NULL;
}
@@ -741,14 +741,12 @@ PyArrayObject* array_from_pyobj(const int type_num,
return arr;
}
- if ((intent & F2PY_INTENT_INOUT)
- || (intent & F2PY_INTENT_INPLACE)
- || (intent & F2PY_INTENT_CACHE)) {
- sprintf(mess,"failed to initialize intent(inout|inplace|cache) array"
- " -- input must be array but got %s",
- PyString_AsString(PyObject_Str(PyObject_Type(obj)))
- );
- PyErr_SetString(PyExc_TypeError,mess);
+ if ((intent & F2PY_INTENT_INOUT) ||
+ (intent & F2PY_INTENT_INPLACE) ||
+ (intent & F2PY_INTENT_CACHE)) {
+ PyErr_SetString(PyExc_TypeError,
+ "failed to initialize intent(inout|inplace|cache) "
+ "array, input not an array");
return NULL;
}
diff --git a/numpy/f2py/src/fortranobject.h b/numpy/f2py/src/fortranobject.h
index 76a357b5e..689f78c92 100644
--- a/numpy/f2py/src/fortranobject.h
+++ b/numpy/f2py/src/fortranobject.h
@@ -20,6 +20,7 @@ extern "C" {
#define PyString_GET_SIZE PyBytes_GET_SIZE
#define PyString_AS_STRING PyBytes_AS_STRING
#define PyString_FromString PyBytes_FromString
+#define PyUString_FromStringAndSize PyUnicode_FromStringAndSize
#define PyString_ConcatAndDel PyBytes_ConcatAndDel
#define PyString_AsString PyBytes_AsString
@@ -29,6 +30,10 @@ extern "C" {
#define PyInt_AsLong PyLong_AsLong
#define PyNumber_Int PyNumber_Long
+
+#else
+
+#define PyUString_FromStringAndSize PyString_FromStringAndSize
#endif
diff --git a/numpy/f2py/tests/test_array_from_pyobj.py b/numpy/f2py/tests/test_array_from_pyobj.py
index 09d613293..de954c374 100644
--- a/numpy/f2py/tests/test_array_from_pyobj.py
+++ b/numpy/f2py/tests/test_array_from_pyobj.py
@@ -4,6 +4,7 @@ import unittest
import os
import sys
import copy
+import platform
import nose
@@ -81,37 +82,45 @@ class Intent(object):
intent = Intent()
-class Type(object):
- _type_names = ['BOOL', 'BYTE', 'UBYTE', 'SHORT', 'USHORT', 'INT', 'UINT',
- 'LONG', 'ULONG', 'LONGLONG', 'ULONGLONG',
- 'FLOAT', 'DOUBLE', 'LONGDOUBLE', 'CFLOAT', 'CDOUBLE',
- 'CLONGDOUBLE']
- _type_cache = {}
-
- _cast_dict = {'BOOL':['BOOL']}
- _cast_dict['BYTE'] = _cast_dict['BOOL'] + ['BYTE']
- _cast_dict['UBYTE'] = _cast_dict['BOOL'] + ['UBYTE']
- _cast_dict['BYTE'] = ['BYTE']
- _cast_dict['UBYTE'] = ['UBYTE']
- _cast_dict['SHORT'] = _cast_dict['BYTE'] + ['UBYTE', 'SHORT']
- _cast_dict['USHORT'] = _cast_dict['UBYTE'] + ['BYTE', 'USHORT']
- _cast_dict['INT'] = _cast_dict['SHORT'] + ['USHORT', 'INT']
- _cast_dict['UINT'] = _cast_dict['USHORT'] + ['SHORT', 'UINT']
-
- _cast_dict['LONG'] = _cast_dict['INT'] + ['LONG']
- _cast_dict['ULONG'] = _cast_dict['UINT'] + ['ULONG']
-
- _cast_dict['LONGLONG'] = _cast_dict['LONG'] + ['LONGLONG']
- _cast_dict['ULONGLONG'] = _cast_dict['ULONG'] + ['ULONGLONG']
-
- _cast_dict['FLOAT'] = _cast_dict['SHORT'] + ['USHORT', 'FLOAT']
- _cast_dict['DOUBLE'] = _cast_dict['INT'] + ['UINT', 'FLOAT', 'DOUBLE']
- _cast_dict['LONGDOUBLE'] = _cast_dict['LONG'] + ['ULONG', 'FLOAT', 'DOUBLE', 'LONGDOUBLE']
-
- _cast_dict['CFLOAT'] = _cast_dict['FLOAT'] + ['CFLOAT']
+_type_names = ['BOOL', 'BYTE', 'UBYTE', 'SHORT', 'USHORT', 'INT', 'UINT',
+ 'LONG', 'ULONG', 'LONGLONG', 'ULONGLONG',
+ 'FLOAT', 'DOUBLE', 'CFLOAT']
+
+_cast_dict = {'BOOL':['BOOL']}
+_cast_dict['BYTE'] = _cast_dict['BOOL'] + ['BYTE']
+_cast_dict['UBYTE'] = _cast_dict['BOOL'] + ['UBYTE']
+_cast_dict['BYTE'] = ['BYTE']
+_cast_dict['UBYTE'] = ['UBYTE']
+_cast_dict['SHORT'] = _cast_dict['BYTE'] + ['UBYTE', 'SHORT']
+_cast_dict['USHORT'] = _cast_dict['UBYTE'] + ['BYTE', 'USHORT']
+_cast_dict['INT'] = _cast_dict['SHORT'] + ['USHORT', 'INT']
+_cast_dict['UINT'] = _cast_dict['USHORT'] + ['SHORT', 'UINT']
+
+_cast_dict['LONG'] = _cast_dict['INT'] + ['LONG']
+_cast_dict['ULONG'] = _cast_dict['UINT'] + ['ULONG']
+
+_cast_dict['LONGLONG'] = _cast_dict['LONG'] + ['LONGLONG']
+_cast_dict['ULONGLONG'] = _cast_dict['ULONG'] + ['ULONGLONG']
+
+_cast_dict['FLOAT'] = _cast_dict['SHORT'] + ['USHORT', 'FLOAT']
+_cast_dict['DOUBLE'] = _cast_dict['INT'] + ['UINT', 'FLOAT', 'DOUBLE']
+
+_cast_dict['CFLOAT'] = _cast_dict['FLOAT'] + ['CFLOAT']
+
+# (debian) sparc system malloc does not provide the alignment required by
+# 16 byte long double types this means the inout intent cannot be satisfied and
+# several tests fail as the alignment flag can be randomly true or fals
+# when numpy gains an aligned allocator the tests could be enabled again
+if 'sparc' not in platform.platform().lower():
+ _type_names.extend(['LONGDOUBLE', 'CDOUBLE', 'CLONGDOUBLE'])
+ _cast_dict['LONGDOUBLE'] = _cast_dict['LONG'] + \
+ ['ULONG', 'FLOAT', 'DOUBLE', 'LONGDOUBLE']
+ _cast_dict['CLONGDOUBLE'] = _cast_dict['LONGDOUBLE'] + \
+ ['CFLOAT', 'CDOUBLE', 'CLONGDOUBLE']
_cast_dict['CDOUBLE'] = _cast_dict['DOUBLE'] + ['CFLOAT', 'CDOUBLE']
- _cast_dict['CLONGDOUBLE'] = _cast_dict['LONGDOUBLE'] + ['CFLOAT', 'CDOUBLE', 'CLONGDOUBLE']
+class Type(object):
+ _type_cache = {}
def __new__(cls, name):
if isinstance(name, dtype):
@@ -138,15 +147,15 @@ class Type(object):
self.dtypechar = typeinfo[self.NAME][0]
def cast_types(self):
- return [self.__class__(_m) for _m in self._cast_dict[self.NAME]]
+ return [self.__class__(_m) for _m in _cast_dict[self.NAME]]
def all_types(self):
- return [self.__class__(_m) for _m in self._type_names]
+ return [self.__class__(_m) for _m in _type_names]
def smaller_types(self):
bits = typeinfo[self.NAME][3]
types = []
- for name in self._type_names:
+ for name in _type_names:
if typeinfo[name][3]<bits:
types.append(Type(name))
return types
@@ -154,7 +163,7 @@ class Type(object):
def equal_types(self):
bits = typeinfo[self.NAME][3]
types = []
- for name in self._type_names:
+ for name in _type_names:
if name==self.NAME: continue
if typeinfo[name][3]==bits:
types.append(Type(name))
@@ -163,7 +172,7 @@ class Type(object):
def larger_types(self):
bits = typeinfo[self.NAME][3]
types = []
- for name in self._type_names:
+ for name in _type_names:
if typeinfo[name][3]>bits:
types.append(Type(name))
return types
@@ -227,7 +236,8 @@ class Array(object):
assert_(self.arr_attr[2]==self.pyarr_attr[2]) # dimensions
if self.arr_attr[1]<=1:
assert_(self.arr_attr[3]==self.pyarr_attr[3],\
- repr((self.arr_attr[3], self.pyarr_attr[3], self.arr.tostring(), self.pyarr.tostring()))) # strides
+ repr((self.arr_attr[3], self.pyarr_attr[3],
+ self.arr.tobytes(), self.pyarr.tobytes()))) # strides
assert_(self.arr_attr[5][-2:]==self.pyarr_attr[5][-2:],\
repr((self.arr_attr[5], self.pyarr_attr[5]))) # descr
assert_(self.arr_attr[6]==self.pyarr_attr[6],\
@@ -531,7 +541,7 @@ class _test_shared_memory:
assert_(obj.dtype.type is self.type.dtype) # obj type is changed inplace!
-for t in Type._type_names:
+for t in _type_names:
exec('''\
class test_%s_gen(unittest.TestCase,
_test_shared_memory
diff --git a/numpy/f2py/tests/test_callback.py b/numpy/f2py/tests/test_callback.py
index 98a90a28c..16464140f 100644
--- a/numpy/f2py/tests/test_callback.py
+++ b/numpy/f2py/tests/test_callback.py
@@ -34,6 +34,17 @@ cf2py intent(out) a
external fun
call fun(a)
end
+
+ subroutine string_callback(callback, a)
+ external callback
+ double precision callback
+ double precision a
+ character*1 r
+cf2py intent(out) a
+ r = 'r'
+ a = callback(r)
+ end
+
"""
@dec.slow
@@ -103,6 +114,19 @@ cf2py intent(out) a
r = t(a.mth)
assert_( r==9, repr(r))
+ def test_string_callback(self):
+
+ def callback(code):
+ if code == 'r':
+ return 0
+ else:
+ return 1
+
+ f = getattr(self.module, 'string_callback')
+ r = f(callback)
+ assert_(r == 0, repr(r))
+
+
if __name__ == "__main__":
import nose
nose.runmodule()
diff --git a/numpy/fft/fftpack.py b/numpy/fft/fftpack.py
index 9a169b04c..706fcdd2f 100644
--- a/numpy/fft/fftpack.py
+++ b/numpy/fft/fftpack.py
@@ -53,10 +53,12 @@ def _raw_fft(a, n=None, axis=-1, init_function=fftpack.cffti,
raise ValueError("Invalid number of FFT data points (%d) specified." % n)
try:
- wsave = fft_cache[n]
- except(KeyError):
+ # Thread-safety note: We rely on list.pop() here to atomically
+ # retrieve-and-remove a wsave from the cache. This ensures that no
+ # other thread can get the same wsave while we're using it.
+ wsave = fft_cache.setdefault(n, []).pop()
+ except (IndexError):
wsave = init_function(n)
- fft_cache[n] = wsave
if a.shape[axis] != n:
s = list(a.shape)
@@ -77,6 +79,12 @@ def _raw_fft(a, n=None, axis=-1, init_function=fftpack.cffti,
r = work_function(a, wsave)
if axis != -1:
r = swapaxes(r, axis, -1)
+
+ # As soon as we put wsave back into the cache, another thread could pick it
+ # up and start using it, so we must not do this until after we're
+ # completely done using it ourselves.
+ fft_cache[n].append(wsave)
+
return r
@@ -296,7 +304,7 @@ def rfft(a, n=None, axis=-1):
conjugates of the corresponding positive-frequency terms, and the
negative-frequency terms are therefore redundant. This function does not
compute the negative frequency terms, and the length of the transformed
- axis of the output is therefore ``n//2+1``.
+ axis of the output is therefore ``n//2 + 1``.
When ``A = rfft(a)`` and fs is the sampling frequency, ``A[0]`` contains
the zero-frequency term 0*fs, which is real due to Hermitian symmetry.
@@ -821,11 +829,16 @@ def fft2(a, s=None, axes=(-2, -1)):
--------
>>> a = np.mgrid[:5, :5][0]
>>> np.fft.fft2(a)
- array([[ 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
- [ 5.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
- [ 10.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
- [ 15.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j],
- [ 20.+0.j, 0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j]])
+ array([[ 50.0 +0.j , 0.0 +0.j , 0.0 +0.j ,
+ 0.0 +0.j , 0.0 +0.j ],
+ [-12.5+17.20477401j, 0.0 +0.j , 0.0 +0.j ,
+ 0.0 +0.j , 0.0 +0.j ],
+ [-12.5 +4.0614962j , 0.0 +0.j , 0.0 +0.j ,
+ 0.0 +0.j , 0.0 +0.j ],
+ [-12.5 -4.0614962j , 0.0 +0.j , 0.0 +0.j ,
+ 0.0 +0.j , 0.0 +0.j ],
+ [-12.5-17.20477401j, 0.0 +0.j , 0.0 +0.j ,
+ 0.0 +0.j , 0.0 +0.j ]])
"""
diff --git a/numpy/fft/fftpack_litemodule.c b/numpy/fft/fftpack_litemodule.c
index 6f6a6c9f3..95da3194f 100644
--- a/numpy/fft/fftpack_litemodule.c
+++ b/numpy/fft/fftpack_litemodule.c
@@ -44,14 +44,14 @@ fftpack_cfftf(PyObject *NPY_UNUSED(self), PyObject *args)
nrepeats = PyArray_SIZE(data)/npts;
dptr = (double *)PyArray_DATA(data);
- NPY_SIGINT_ON;
Py_BEGIN_ALLOW_THREADS;
+ NPY_SIGINT_ON;
for (i = 0; i < nrepeats; i++) {
cfftf(npts, dptr, wsave);
dptr += npts*2;
}
- Py_END_ALLOW_THREADS;
NPY_SIGINT_OFF;
+ Py_END_ALLOW_THREADS;
PyArray_Free(op2, (char *)wsave);
return (PyObject *)data;
@@ -97,14 +97,14 @@ fftpack_cfftb(PyObject *NPY_UNUSED(self), PyObject *args)
nrepeats = PyArray_SIZE(data)/npts;
dptr = (double *)PyArray_DATA(data);
- NPY_SIGINT_ON;
Py_BEGIN_ALLOW_THREADS;
+ NPY_SIGINT_ON;
for (i = 0; i < nrepeats; i++) {
cfftb(npts, dptr, wsave);
dptr += npts*2;
}
- Py_END_ALLOW_THREADS;
NPY_SIGINT_OFF;
+ Py_END_ALLOW_THREADS;
PyArray_Free(op2, (char *)wsave);
return (PyObject *)data;
@@ -134,11 +134,11 @@ fftpack_cffti(PyObject *NPY_UNUSED(self), PyObject *args)
return NULL;
}
- NPY_SIGINT_ON;
Py_BEGIN_ALLOW_THREADS;
+ NPY_SIGINT_ON;
cffti(n, (double *)PyArray_DATA((PyArrayObject*)op));
- Py_END_ALLOW_THREADS;
NPY_SIGINT_OFF;
+ Py_END_ALLOW_THREADS;
return (PyObject *)op;
}
@@ -188,8 +188,8 @@ fftpack_rfftf(PyObject *NPY_UNUSED(self), PyObject *args)
dptr = (double *)PyArray_DATA(data);
- NPY_SIGINT_ON;
Py_BEGIN_ALLOW_THREADS;
+ NPY_SIGINT_ON;
for (i = 0; i < nrepeats; i++) {
memcpy((char *)(rptr+1), dptr, npts*sizeof(double));
rfftf(npts, rptr+1, wsave);
@@ -198,8 +198,8 @@ fftpack_rfftf(PyObject *NPY_UNUSED(self), PyObject *args)
rptr += rstep;
dptr += npts;
}
- Py_END_ALLOW_THREADS;
NPY_SIGINT_OFF;
+ Py_END_ALLOW_THREADS;
PyArray_Free(op2, (char *)wsave);
Py_DECREF(data);
return (PyObject *)ret;
@@ -252,8 +252,8 @@ fftpack_rfftb(PyObject *NPY_UNUSED(self), PyObject *args)
rptr = (double *)PyArray_DATA(ret);
dptr = (double *)PyArray_DATA(data);
- NPY_SIGINT_ON;
Py_BEGIN_ALLOW_THREADS;
+ NPY_SIGINT_ON;
for (i = 0; i < nrepeats; i++) {
memcpy((char *)(rptr + 1), (dptr + 2), (npts - 1)*sizeof(double));
rptr[0] = dptr[0];
@@ -261,8 +261,8 @@ fftpack_rfftb(PyObject *NPY_UNUSED(self), PyObject *args)
rptr += npts;
dptr += npts*2;
}
- Py_END_ALLOW_THREADS;
NPY_SIGINT_OFF;
+ Py_END_ALLOW_THREADS;
PyArray_Free(op2, (char *)wsave);
Py_DECREF(data);
return (PyObject *)ret;
@@ -294,11 +294,11 @@ fftpack_rffti(PyObject *NPY_UNUSED(self), PyObject *args)
if (op == NULL) {
return NULL;
}
- NPY_SIGINT_ON;
Py_BEGIN_ALLOW_THREADS;
+ NPY_SIGINT_ON;
rffti(n, (double *)PyArray_DATA((PyArrayObject*)op));
- Py_END_ALLOW_THREADS;
NPY_SIGINT_OFF;
+ Py_END_ALLOW_THREADS;
return (PyObject *)op;
}
diff --git a/numpy/fft/tests/test_fftpack.py b/numpy/fft/tests/test_fftpack.py
index 50702ab3c..ac892c83b 100644
--- a/numpy/fft/tests/test_fftpack.py
+++ b/numpy/fft/tests/test_fftpack.py
@@ -2,6 +2,14 @@ from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import TestCase, run_module_suite, assert_array_almost_equal
+from numpy.testing import assert_array_equal
+import threading
+import sys
+if sys.version_info[0] >= 3:
+ import queue
+else:
+ import Queue as queue
+
def fft1(x):
L = len(x)
@@ -9,6 +17,7 @@ def fft1(x):
phase = np.arange(L).reshape(-1, 1) * phase
return np.sum(x*np.exp(phase), axis=1)
+
class TestFFTShift(TestCase):
def test_fft_n(self):
@@ -23,5 +32,44 @@ class TestFFT1D(TestCase):
assert_array_almost_equal(fft1(x), np.fft.fft(x))
+class TestFFTThreadSafe(TestCase):
+ threads = 16
+ input_shape = (800, 200)
+
+ def _test_mtsame(self, func, *args):
+ def worker(args, q):
+ q.put(func(*args))
+
+ q = queue.Queue()
+ expected = func(*args)
+
+ # Spin off a bunch of threads to call the same function simultaneously
+ t = [threading.Thread(target=worker, args=(args, q))
+ for i in range(self.threads)]
+ [x.start() for x in t]
+
+ # Make sure all threads returned the correct value
+ for i in range(self.threads):
+ assert_array_equal(q.get(timeout=5), expected,
+ 'Function returned wrong value in multithreaded context')
+ [x.join() for x in t]
+
+ def test_fft(self):
+ a = np.ones(self.input_shape) * 1+0j
+ self._test_mtsame(np.fft.fft, a)
+
+ def test_ifft(self):
+ a = np.ones(self.input_shape) * 1+0j
+ self._test_mtsame(np.fft.ifft, a)
+
+ def test_rfft(self):
+ a = np.ones(self.input_shape)
+ self._test_mtsame(np.fft.rfft, a)
+
+ def test_irfft(self):
+ a = np.ones(self.input_shape) * 1+0j
+ self._test_mtsame(np.fft.irfft, a)
+
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/lib/__init__.py b/numpy/lib/__init__.py
index 73e4b2306..8c420b0c3 100644
--- a/numpy/lib/__init__.py
+++ b/numpy/lib/__init__.py
@@ -23,6 +23,7 @@ from .npyio import *
from .financial import *
from .arrayterator import *
from .arraypad import *
+from ._version import *
__all__ = ['emath', 'math']
__all__ += type_check.__all__
diff --git a/numpy/lib/_version.py b/numpy/lib/_version.py
new file mode 100644
index 000000000..4eaabd0ff
--- /dev/null
+++ b/numpy/lib/_version.py
@@ -0,0 +1,155 @@
+"""Utility to compare (Numpy) version strings.
+
+The NumpyVersion class allows properly comparing numpy version strings.
+The LooseVersion and StrictVersion classes that distutils provides don't
+work; they don't recognize anything like alpha/beta/rc/dev versions.
+
+"""
+from __future__ import division, absolute_import, print_function
+
+import re
+
+from numpy.compat import basestring
+
+
+__all__ = ['NumpyVersion']
+
+
+class NumpyVersion():
+ """Parse and compare numpy version strings.
+
+ Numpy has the following versioning scheme (numbers given are examples; they
+ can be > 9) in principle):
+
+ - Released version: '1.8.0', '1.8.1', etc.
+ - Alpha: '1.8.0a1', '1.8.0a2', etc.
+ - Beta: '1.8.0b1', '1.8.0b2', etc.
+ - Release candidates: '1.8.0rc1', '1.8.0rc2', etc.
+ - Development versions: '1.8.0.dev-f1234afa' (git commit hash appended)
+ - Development versions after a1: '1.8.0a1.dev-f1234afa',
+ '1.8.0b2.dev-f1234afa',
+ '1.8.1rc1.dev-f1234afa', etc.
+ - Development versions (no git hash available): '1.8.0.dev-Unknown'
+
+ Comparing needs to be done against a valid version string or other
+ `NumpyVersion` instance. Note that all development versions of the same
+ (pre-)release compare equal.
+
+ .. versionadded:: 1.9.0
+
+ Parameters
+ ----------
+ vstring : str
+ Numpy version string (``np.__version__``).
+
+ Examples
+ --------
+ >>> from numpy.lib import NumpyVersion
+ >>> if NumpyVersion(np.__version__) < '1.7.0'):
+ ... print('skip')
+ skip
+
+ >>> NumpyVersion('1.7') # raises ValueError, add ".0"
+
+ """
+ def __init__(self, vstring):
+ self.vstring = vstring
+ ver_main = re.match(r'\d[.]\d+[.]\d+', vstring)
+ if not ver_main:
+ raise ValueError("Not a valid numpy version string")
+
+ self.version = ver_main.group()
+ self.major, self.minor, self.bugfix = [int(x) for x in
+ self.version.split('.')]
+ if len(vstring) == ver_main.end():
+ self.pre_release = 'final'
+ else:
+ alpha = re.match(r'a\d', vstring[ver_main.end():])
+ beta = re.match(r'b\d', vstring[ver_main.end():])
+ rc = re.match(r'rc\d', vstring[ver_main.end():])
+ pre_rel = [m for m in [alpha, beta, rc] if m is not None]
+ if pre_rel:
+ self.pre_release = pre_rel[0].group()
+ else:
+ self.pre_release = ''
+
+ self.is_devversion = bool(re.search(r'.dev', vstring))
+
+ def _compare_version(self, other):
+ """Compare major.minor.bugfix"""
+ if self.major == other.major:
+ if self.minor == other.minor:
+ if self.bugfix == other.bugfix:
+ vercmp = 0
+ elif self.bugfix > other.bugfix:
+ vercmp = 1
+ else:
+ vercmp = -1
+ elif self.minor > other.minor:
+ vercmp = 1
+ else:
+ vercmp = -1
+ elif self.major > other.major:
+ vercmp = 1
+ else:
+ vercmp = -1
+
+ return vercmp
+
+ def _compare_pre_release(self, other):
+ """Compare alpha/beta/rc/final."""
+ if self.pre_release == other.pre_release:
+ vercmp = 0
+ elif self.pre_release == 'final':
+ vercmp = 1
+ elif other.pre_release == 'final':
+ vercmp = -1
+ elif self.pre_release > other.pre_release:
+ vercmp = 1
+ else:
+ vercmp = -1
+
+ return vercmp
+
+ def _compare(self, other):
+ if not isinstance(other, (basestring, NumpyVersion)):
+ raise ValueError("Invalid object to compare with NumpyVersion.")
+
+ if isinstance(other, basestring):
+ other = NumpyVersion(other)
+
+ vercmp = self._compare_version(other)
+ if vercmp == 0:
+ # Same x.y.z version, check for alpha/beta/rc
+ vercmp = self._compare_pre_release(other)
+ if vercmp == 0:
+ # Same version and same pre-release, check if dev version
+ if self.is_devversion is other.is_devversion:
+ vercmp = 0
+ elif self.is_devversion:
+ vercmp = -1
+ else:
+ vercmp = 1
+
+ return vercmp
+
+ def __lt__(self, other):
+ return self._compare(other) < 0
+
+ def __le__(self, other):
+ return self._compare(other) <= 0
+
+ def __eq__(self, other):
+ return self._compare(other) == 0
+
+ def __ne__(self, other):
+ return self._compare(other) != 0
+
+ def __gt__(self, other):
+ return self._compare(other) > 0
+
+ def __ge__(self, other):
+ return self._compare(other) >= 0
+
+ def __repr(self):
+ return "NumpyVersion(%s)" % self.vstring
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py
index 5cd535703..005703d16 100644
--- a/numpy/lib/arraysetops.py
+++ b/numpy/lib/arraysetops.py
@@ -90,7 +90,7 @@ def ediff1d(ary, to_end=None, to_begin=None):
return ed
-def unique(ar, return_index=False, return_inverse=False):
+def unique(ar, return_index=False, return_inverse=False, return_counts=False):
"""
Find the unique elements of an array.
@@ -109,6 +109,10 @@ def unique(ar, return_index=False, return_inverse=False):
return_inverse : bool, optional
If True, also return the indices of the unique array that can be used
to reconstruct `ar`.
+ return_counts : bool, optional
+ .. versionadded:: 1.9.0
+ If True, also return the number of times each unique value comes up
+ in `ar`.
Returns
-------
@@ -120,6 +124,10 @@ def unique(ar, return_index=False, return_inverse=False):
unique_inverse : ndarray, optional
The indices to reconstruct the (flattened) original array from the
unique array. Only provided if `return_inverse` is True.
+ unique_counts : ndarray, optional
+ .. versionadded:: 1.9.0
+ The number of times each of the unique values comes up in the
+ original array. Only provided if `return_counts` is True.
See Also
--------
@@ -159,45 +167,46 @@ def unique(ar, return_index=False, return_inverse=False):
array([1, 2, 6, 4, 2, 3, 2])
"""
- try:
- ar = ar.flatten()
- except AttributeError:
- if not return_inverse and not return_index:
- items = sorted(set(ar))
- return np.asarray(items)
- else:
- ar = np.asanyarray(ar).flatten()
+ ar = np.asanyarray(ar).flatten()
+
+ optional_indices = return_index or return_inverse
+ optional_returns = optional_indices or return_counts
if ar.size == 0:
- if return_inverse and return_index:
- return ar, np.empty(0, np.bool), np.empty(0, np.bool)
- elif return_inverse or return_index:
- return ar, np.empty(0, np.bool)
+ if not optional_returns:
+ ret = ar
else:
- return ar
+ ret = (ar,)
+ if return_index:
+ ret += (np.empty(0, np.bool),)
+ if return_inverse:
+ ret += (np.empty(0, np.bool),)
+ if return_counts:
+ ret += (np.empty(0, np.intp),)
+ return ret
+
+ if optional_indices:
+ perm = ar.argsort(kind='mergesort' if return_index else 'quicksort')
+ aux = ar[perm]
+ else:
+ ar.sort()
+ aux = ar
+ flag = np.concatenate(([True], aux[1:] != aux[:-1]))
- if return_inverse or return_index:
+ if not optional_returns:
+ ret = aux[flag]
+ else:
+ ret = (aux[flag],)
if return_index:
- perm = ar.argsort(kind='mergesort')
- else:
- perm = ar.argsort()
- aux = ar[perm]
- flag = np.concatenate(([True], aux[1:] != aux[:-1]))
+ ret += (perm[flag],)
if return_inverse:
iflag = np.cumsum(flag) - 1
iperm = perm.argsort()
- if return_index:
- return aux[flag], perm[flag], iflag[iperm]
- else:
- return aux[flag], iflag[iperm]
- else:
- return aux[flag], perm[flag]
-
- else:
- ar.sort()
- flag = np.concatenate(([True], ar[1:] != ar[:-1]))
- return ar[flag]
-
+ ret += (np.take(iflag, iperm),)
+ if return_counts:
+ idx = np.concatenate(np.nonzero(flag) + ([ar.size],))
+ ret += (np.diff(idx),)
+ return ret
def intersect1d(ar1, ar2, assume_unique=False):
"""
diff --git a/numpy/lib/bscript b/numpy/lib/bscript
index a9200d043..61debfe41 100644
--- a/numpy/lib/bscript
+++ b/numpy/lib/bscript
@@ -4,4 +4,8 @@ from bento.commands import hooks
def build(context):
context.tweak_extension("_compiled_base",
includes=["../core/include", "../core/include/numpy", "../core",
- "../core/src/private"])
+ "../core/src/private"],
+ defines=['_FILE_OFFSET_BITS=64',
+ '_LARGEFILE_SOURCE=1',
+ '_LARGEFILE64_SOURCE=1']
+ )
diff --git a/numpy/lib/financial.py b/numpy/lib/financial.py
index ec642afd3..c085a5d53 100644
--- a/numpy/lib/financial.py
+++ b/numpy/lib/financial.py
@@ -628,21 +628,29 @@ def irr(values):
Examples
--------
- >>> print round(np.irr([-100, 39, 59, 55, 20]), 5)
+ >>> round(irr([-100, 39, 59, 55, 20]), 5)
0.28095
+ >>> round(irr([-100, 0, 0, 74]), 5)
+ -0.0955
+ >>> round(irr([-100, 100, 0, -7]), 5)
+ -0.0833
+ >>> round(irr([-100, 100, 0, 7]), 5)
+ 0.06206
+ >>> round(irr([-5, 10.5, 1, -8, 1]), 5)
+ 0.0886
(Compare with the Example given for numpy.lib.financial.npv)
"""
res = np.roots(values[::-1])
- # Find the root(s) between 0 and 1
- mask = (res.imag == 0) & (res.real > 0) & (res.real <= 1)
- res = res[mask].real
+ mask = (res.imag == 0) & (res.real > 0)
if res.size == 0:
return np.nan
+ res = res[mask].real
+ # NPV(rate) = 0 can have more than one solution so we return
+ # only the solution closest to zero.
rate = 1.0/res - 1
- if rate.size == 1:
- rate = rate.item()
+ rate = rate.item(np.argmin(np.abs(rate)))
return rate
def npv(rate, values):
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index 4cfbbe05d..6083312de 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -139,6 +139,7 @@ from __future__ import division, absolute_import, print_function
import numpy
import sys
import io
+import warnings
from numpy.lib.utils import safe_eval
from numpy.compat import asbytes, isfileobj, long, basestring
@@ -151,6 +152,14 @@ MAGIC_PREFIX = asbytes('\x93NUMPY')
MAGIC_LEN = len(MAGIC_PREFIX) + 2
BUFFER_SIZE = 2 ** 18 #size of buffer for reading npz files in bytes
+# difference between version 1.0 and 2.0 is a 4 byte (I) header length
+# instead of 2 bytes (H) allowing storage of large structured arrays
+
+def _check_version(version):
+ if version not in [(1, 0), (2, 0), None]:
+ msg = "we only support format version (1,0) and (2, 0), not %s"
+ raise ValueError(msg % (version,))
+
def magic(major, minor):
""" Return the magic string for the given file format version.
@@ -258,8 +267,8 @@ def header_data_from_array_1_0(array):
d['descr'] = dtype_to_descr(array.dtype)
return d
-def write_array_header_1_0(fp, d):
- """ Write the header for an array using the 1.0 format.
+def _write_array_header(fp, d, version=None):
+ """ Write the header for an array and returns the version used
Parameters
----------
@@ -267,6 +276,14 @@ def write_array_header_1_0(fp, d):
d : dict
This has the appropriate entries for writing its string representation
to the header of the file.
+ version: tuple or None
+ None means use oldest that works
+ explicit version will raise a ValueError if the format does not
+ allow saving this data. Default: None
+ Returns
+ -------
+ version : tuple of int
+ the file version which needs to be used to store the data
"""
import struct
header = ["{"]
@@ -282,11 +299,52 @@ def write_array_header_1_0(fp, d):
current_header_len = MAGIC_LEN + 2 + len(header) + 1 # 1 for the newline
topad = 16 - (current_header_len % 16)
header = asbytes(header + ' '*topad + '\n')
- if len(header) >= (256*256):
- raise ValueError("header does not fit inside %s bytes" % (256*256))
- header_len_str = struct.pack('<H', len(header))
+
+ if len(header) >= (256*256) and version == (1, 0):
+ raise ValueError("header does not fit inside %s bytes required by the"
+ " 1.0 format" % (256*256))
+ if len(header) < (256*256):
+ header_len_str = struct.pack('<H', len(header))
+ version = (1, 0)
+ elif len(header) < (2**32):
+ header_len_str = struct.pack('<I', len(header))
+ version = (2, 0)
+ else:
+ raise ValueError("header does not fit inside 4 GiB required by "
+ "the 2.0 format")
+
+ fp.write(magic(*version))
fp.write(header_len_str)
fp.write(header)
+ return version
+
+def write_array_header_1_0(fp, d):
+ """ Write the header for an array using the 1.0 format.
+
+ Parameters
+ ----------
+ fp : filelike object
+ d : dict
+ This has the appropriate entries for writing its string representation
+ to the header of the file.
+ """
+ _write_array_header(fp, d, (1, 0))
+
+
+def write_array_header_2_0(fp, d):
+ """ Write the header for an array using the 2.0 format.
+ The 2.0 format allows storing very large structured arrays.
+
+ .. versionadded:: 1.9.0
+
+ Parameters
+ ----------
+ fp : filelike object
+ d : dict
+ This has the appropriate entries for writing its string representation
+ to the header of the file.
+ """
+ _write_array_header(fp, d, (2, 0))
def read_array_header_1_0(fp):
"""
@@ -317,12 +375,58 @@ def read_array_header_1_0(fp):
If the data is invalid.
"""
+ _read_array_header(fp, version=(1, 0))
+
+def read_array_header_2_0(fp):
+ """
+ Read an array header from a filelike object using the 2.0 file format
+ version.
+
+ This will leave the file object located just after the header.
+
+ .. versionadded:: 1.9.0
+
+ Parameters
+ ----------
+ fp : filelike object
+ A file object or something with a `.read()` method like a file.
+
+ Returns
+ -------
+ shape : tuple of int
+ The shape of the array.
+ fortran_order : bool
+ The array data will be written out directly if it is either C-contiguous
+ or Fortran-contiguous. Otherwise, it will be made contiguous before
+ writing it out.
+ dtype : dtype
+ The dtype of the file's data.
+
+ Raises
+ ------
+ ValueError
+ If the data is invalid.
+
+ """
+ _read_array_header(fp, version=(2, 0))
+
+def _read_array_header(fp, version):
+ """
+ see read_array_header_1_0
+ """
# Read an unsigned, little-endian short int which has the length of the
# header.
import struct
- hlength_str = _read_bytes(fp, 2, "array header length")
- header_length = struct.unpack('<H', hlength_str)[0]
- header = _read_bytes(fp, header_length, "array header")
+ if version == (1, 0):
+ hlength_str = _read_bytes(fp, 2, "array header length")
+ header_length = struct.unpack('<H', hlength_str)[0]
+ header = _read_bytes(fp, header_length, "array header")
+ elif version == (2, 0):
+ hlength_str = _read_bytes(fp, 4, "array header length")
+ header_length = struct.unpack('<I', hlength_str)[0]
+ header = _read_bytes(fp, header_length, "array header")
+ else:
+ raise ValueError("Invalid version %r" % version)
# The header is a pretty-printed string representation of a literal Python
# dictionary with trailing newlines padded to a 16-byte boundary. The keys
@@ -359,7 +463,7 @@ def read_array_header_1_0(fp):
return d['shape'], d['fortran_order'], dtype
-def write_array(fp, array, version=(1, 0)):
+def write_array(fp, array, version=None):
"""
Write an array to an NPY file, including a header.
@@ -374,8 +478,9 @@ def write_array(fp, array, version=(1, 0)):
method.
array : ndarray
The array to write to disk.
- version : (int, int), optional
- The version number of the format. Default: (1, 0)
+ version : (int, int) or None, optional
+ The version number of the format. None means use the oldest supported
+ version that is able to store the data. Default: None
Raises
------
@@ -387,11 +492,13 @@ def write_array(fp, array, version=(1, 0)):
are not picklable.
"""
- if version != (1, 0):
- msg = "we only support format version (1,0), not %s"
- raise ValueError(msg % (version,))
- fp.write(magic(*version))
- write_array_header_1_0(fp, header_data_from_array_1_0(array))
+ _check_version(version)
+ used_ver = _write_array_header(fp, header_data_from_array_1_0(array),
+ version)
+ # this warning can be removed when 1.9 has aged enough
+ if version != (2, 0) and used_ver == (2, 0):
+ warnings.warn("Stored array in format 2.0. It can only be"
+ "read by NumPy >= 1.9", UserWarning)
# Set buffer size to 16 MiB to hide the Python loop overhead.
buffersize = max(16 * 1024 ** 2 // array.itemsize, 1)
@@ -407,7 +514,7 @@ def write_array(fp, array, version=(1, 0)):
for chunk in numpy.nditer(
array, flags=['external_loop', 'buffered', 'zerosize_ok'],
buffersize=buffersize, order='F'):
- fp.write(chunk.tostring('C'))
+ fp.write(chunk.tobytes('C'))
else:
if isfileobj(fp):
array.tofile(fp)
@@ -415,7 +522,7 @@ def write_array(fp, array, version=(1, 0)):
for chunk in numpy.nditer(
array, flags=['external_loop', 'buffered', 'zerosize_ok'],
buffersize=buffersize, order='C'):
- fp.write(chunk.tostring('C'))
+ fp.write(chunk.tobytes('C'))
def read_array(fp):
@@ -440,10 +547,8 @@ def read_array(fp):
"""
version = read_magic(fp)
- if version != (1, 0):
- msg = "only support version (1,0) of file format, not %r"
- raise ValueError(msg % (version,))
- shape, fortran_order, dtype = read_array_header_1_0(fp)
+ _check_version(version)
+ shape, fortran_order, dtype = _read_array_header(fp, version)
if len(shape) == 0:
count = 1
else:
@@ -486,7 +591,7 @@ def read_array(fp):
def open_memmap(filename, mode='r+', dtype=None, shape=None,
- fortran_order=False, version=(1, 0)):
+ fortran_order=False, version=None):
"""
Open a .npy file as a memory-mapped array.
@@ -513,9 +618,11 @@ def open_memmap(filename, mode='r+', dtype=None, shape=None,
Whether the array should be Fortran-contiguous (True) or
C-contiguous (False, the default) if we are creating a new file
in "write" mode.
- version : tuple of int (major, minor)
+ version : tuple of int (major, minor) or None
If the mode is a "write" mode, then this is the version of the file
- format used to create the file. Default: (1,0)
+ format used to create the file.
+ None means use the oldest supported version that is able to store the
+ data. Default: None
Returns
-------
@@ -541,9 +648,7 @@ def open_memmap(filename, mode='r+', dtype=None, shape=None,
if 'w' in mode:
# We are creating the file, not reading it.
# Check if we ought to create the file.
- if version != (1, 0):
- msg = "only support version (1,0) of file format, not %r"
- raise ValueError(msg % (version,))
+ _check_version(version)
# Ensure that the given dtype is an authentic dtype object rather than
# just something that can be interpreted as a dtype object.
dtype = numpy.dtype(dtype)
@@ -558,8 +663,11 @@ def open_memmap(filename, mode='r+', dtype=None, shape=None,
# If we got here, then it should be safe to create the file.
fp = open(filename, mode+'b')
try:
- fp.write(magic(*version))
- write_array_header_1_0(fp, d)
+ used_ver = _write_array_header(fp, d, version)
+ # this warning can be removed when 1.9 has aged enough
+ if version != (2, 0) and used_ver == (2, 0):
+ warnings.warn("Stored array in format 2.0. It can only be"
+ "read by NumPy >= 1.9", UserWarning)
offset = fp.tell()
finally:
fp.close()
@@ -568,10 +676,9 @@ def open_memmap(filename, mode='r+', dtype=None, shape=None,
fp = open(filename, 'rb')
try:
version = read_magic(fp)
- if version != (1, 0):
- msg = "only support version (1,0) of file format, not %r"
- raise ValueError(msg % (version,))
- shape, fortran_order, dtype = read_array_header_1_0(fp)
+ _check_version(version)
+
+ shape, fortran_order, dtype = _read_array_header(fp, version)
if dtype.hasobject:
msg = "Array can't be memory-mapped: Python objects in dtype."
raise ValueError(msg)
diff --git a/numpy/lib/function_base.py b/numpy/lib/function_base.py
index 63b191b07..f625bcb90 100644
--- a/numpy/lib/function_base.py
+++ b/numpy/lib/function_base.py
@@ -13,6 +13,7 @@ __all__ = [
import warnings
import sys
import collections
+import operator
import numpy as np
import numpy.core.numeric as _nx
@@ -20,7 +21,7 @@ from numpy.core import linspace, atleast_1d, atleast_2d
from numpy.core.numeric import (
ones, zeros, arange, concatenate, array, asarray, asanyarray, empty,
empty_like, ndarray, around, floor, ceil, take, ScalarType, dot, where,
- newaxis, intp, integer, isscalar
+ intp, integer, isscalar
)
from numpy.core.umath import (
pi, multiply, add, arctan2, frompyfunc, cos, less_equal, sqrt, sin,
@@ -256,22 +257,22 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
range : sequence, optional
A sequence of lower and upper bin edges to be used if the edges are
- not given explicitely in `bins`. Defaults to the minimum and maximum
+ not given explicitly in `bins`. Defaults to the minimum and maximum
values along each dimension.
normed : bool, optional
- If False, returns the number of samples in each bin. If True, returns
- the bin density, ie, the bin count divided by the bin hypervolume.
+ If False, returns the number of samples in each bin. If True,
+ returns the bin density ``bin_count / sample_count / bin_volume``.
weights : array_like (N,), optional
An array of values `w_i` weighing each sample `(x_i, y_i, z_i, ...)`.
- Weights are normalized to 1 if normed is True. If normed is False, the
- values of the returned histogram are equal to the sum of the weights
- belonging to the samples falling into each bin.
+ Weights are normalized to 1 if normed is True. If normed is False,
+ the values of the returned histogram are equal to the sum of the
+ weights belonging to the samples falling into each bin.
Returns
-------
H : ndarray
- The multidimensional histogram of sample x. See normed and weights for
- the different possible semantics.
+ The multidimensional histogram of sample x. See normed and weights
+ for the different possible semantics.
edges : list
A list of D arrays describing the bin edges for each dimension.
@@ -335,6 +336,11 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
smin[i] = smin[i] - .5
smax[i] = smax[i] + .5
+ # avoid rounding issues for comparisons when dealing with inexact types
+ if np.issubdtype(sample.dtype, np.inexact):
+ edge_dt = sample.dtype
+ else:
+ edge_dt = float
# Create edge arrays
for i in arange(D):
if isscalar(bins[i]):
@@ -343,9 +349,9 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
"Element at index %s in `bins` should be a positive "
"integer." % i)
nbin[i] = bins[i] + 2 # +2 for outlier bins
- edges[i] = linspace(smin[i], smax[i], nbin[i]-1)
+ edges[i] = linspace(smin[i], smax[i], nbin[i]-1, dtype=edge_dt)
else:
- edges[i] = asarray(bins[i], float)
+ edges[i] = asarray(bins[i], edge_dt)
nbin[i] = len(edges[i]) + 1 # +1 for outlier bins
dedges[i] = diff(edges[i])
if np.any(np.asarray(dedges[i]) <= 0):
@@ -373,10 +379,10 @@ def histogramdd(sample, bins=10, range=None, normed=False, weights=None):
if not np.isinf(mindiff):
decimal = int(-log10(mindiff)) + 6
# Find which points are on the rightmost edge.
- on_edge = where(around(sample[:, i], decimal) ==
- around(edges[i][-1], decimal))[0]
+ not_smaller_than_edge = (sample[:, i] >= edges[i][-1])
+ on_edge = (around(sample[:, i], decimal) == around(edges[i][-1], decimal))
# Shift these points one bin to the left.
- Ncount[i][on_edge] -= 1
+ Ncount[i][where(on_edge & not_smaller_than_edge)[0]] -= 1
# Flattened histogram matrix (1D)
# Reshape is used so that overlarge arrays
@@ -650,7 +656,7 @@ def piecewise(x, condlist, funclist, *args, **kw):
The output is the same shape and type as x and is found by
calling the functions in `funclist` on the appropriate portions of `x`,
as defined by the boolean arrays in `condlist`. Portions not covered
- by any condition have undefined values.
+ by any condition have a default value of 0.
See Also
@@ -692,32 +698,24 @@ def piecewise(x, condlist, funclist, *args, **kw):
if (isscalar(condlist) or not (isinstance(condlist[0], list) or
isinstance(condlist[0], ndarray))):
condlist = [condlist]
- condlist = [asarray(c, dtype=bool) for c in condlist]
+ condlist = array(condlist, dtype=bool)
n = len(condlist)
- if n == n2 - 1: # compute the "otherwise" condition.
- totlist = condlist[0]
- for k in range(1, n):
- totlist |= condlist[k]
- condlist.append(~totlist)
- n += 1
- if (n != n2):
- raise ValueError(
- "function list and condition list must be the same")
- zerod = False
# This is a hack to work around problems with NumPy's
# handling of 0-d arrays and boolean indexing with
# numpy.bool_ scalars
+ zerod = False
if x.ndim == 0:
x = x[None]
zerod = True
- newcondlist = []
- for k in range(n):
- if condlist[k].ndim == 0:
- condition = condlist[k][None]
- else:
- condition = condlist[k]
- newcondlist.append(condition)
- condlist = newcondlist
+ if condlist.shape[-1] != 1:
+ condlist = condlist.T
+ if n == n2 - 1: # compute the "otherwise" condition.
+ totlist = np.logical_or.reduce(condlist, axis=0)
+ condlist = np.vstack([condlist, ~totlist])
+ n += 1
+ if (n != n2):
+ raise ValueError(
+ "function list and condition list must be the same")
y = zeros(x.shape, x.dtype)
for k in range(n):
@@ -770,29 +768,68 @@ def select(condlist, choicelist, default=0):
array([ 0, 1, 2, 0, 0, 0, 36, 49, 64, 81])
"""
- n = len(condlist)
- n2 = len(choicelist)
- if n2 != n:
+ # Check the size of condlist and choicelist are the same, or abort.
+ if len(condlist) != len(choicelist):
raise ValueError(
- "list of cases must be same length as list of conditions")
- choicelist = [default] + choicelist
- S = 0
- pfac = 1
- for k in range(1, n+1):
- S += k * pfac * asarray(condlist[k-1])
- if k < n:
- pfac *= (1-asarray(condlist[k-1]))
- # handle special case of a 1-element condition but
- # a multi-element choice
- if type(S) in ScalarType or max(asarray(S).shape) == 1:
- pfac = asarray(1)
- for k in range(n2+1):
- pfac = pfac + asarray(choicelist[k])
- if type(S) in ScalarType:
- S = S*ones(asarray(pfac).shape, type(S))
- else:
- S = S*ones(asarray(pfac).shape, S.dtype)
- return choose(S, tuple(choicelist))
+ 'list of cases must be same length as list of conditions')
+
+ # Now that the dtype is known, handle the deprecated select([], []) case
+ if len(condlist) == 0:
+ warnings.warn("select with an empty condition list is not possible"
+ "and will be deprecated",
+ DeprecationWarning)
+ return np.asarray(default)[()]
+
+ choicelist = [np.asarray(choice) for choice in choicelist]
+ choicelist.append(np.asarray(default))
+
+ # need to get the result type before broadcasting for correct scalar
+ # behaviour
+ dtype = np.result_type(*choicelist)
+
+ # Convert conditions to arrays and broadcast conditions and choices
+ # as the shape is needed for the result. Doing it seperatly optimizes
+ # for example when all choices are scalars.
+ condlist = np.broadcast_arrays(*condlist)
+ choicelist = np.broadcast_arrays(*choicelist)
+
+ # If cond array is not an ndarray in boolean format or scalar bool, abort.
+ deprecated_ints = False
+ for i in range(len(condlist)):
+ cond = condlist[i]
+ if cond.dtype.type is not np.bool_:
+ if np.issubdtype(cond.dtype, np.integer):
+ # A previous implementation accepted int ndarrays accidentally.
+ # Supported here deliberately, but deprecated.
+ condlist[i] = condlist[i].astype(bool)
+ deprecated_ints = True
+ else:
+ raise ValueError(
+ 'invalid entry in choicelist: should be boolean ndarray')
+
+ if deprecated_ints:
+ msg = "select condlists containing integer ndarrays is deprecated " \
+ "and will be removed in the future. Use `.astype(bool)` to " \
+ "convert to bools."
+ warnings.warn(msg, DeprecationWarning)
+
+ if choicelist[0].ndim == 0:
+ # This may be common, so avoid the call.
+ result_shape = condlist[0].shape
+ else:
+ result_shape = np.broadcast_arrays(condlist[0], choicelist[0])[0].shape
+
+ result = np.full(result_shape, choicelist[-1], dtype)
+
+ # Use np.copyto to burn each choicelist array onto result, using the
+ # corresponding condlist as a boolean mask. This is done in reverse
+ # order since the first choice should take precedence.
+ choicelist = choicelist[-2::-1]
+ condlist = condlist[::-1]
+ for choice, cond in zip(choicelist, condlist):
+ np.copyto(result, choice, where=cond)
+
+ return result
def copy(a, order='K'):
@@ -1101,7 +1138,7 @@ def interp(x, xp, fp, left=None, right=None):
-----
Does not check that the x-coordinate sequence `xp` is increasing.
If `xp` is not increasing, the results are nonsense.
- A simple check for increasingness is::
+ A simple check for increasing is::
np.all(np.diff(xp) > 0)
@@ -1578,20 +1615,22 @@ class vectorize(object):
The `vectorize` function is provided primarily for convenience, not for
performance. The implementation is essentially a for loop.
- If `otypes` is not specified, then a call to the function with the first
- argument will be used to determine the number of outputs. The results of
- this call will be cached if `cache` is `True` to prevent calling the
- function twice. However, to implement the cache, the original function
- must be wrapped which will slow down subsequent calls, so only do this if
- your function is expensive.
+ If `otypes` is not specified, then a call to the function with the
+ first argument will be used to determine the number of outputs. The
+ results of this call will be cached if `cache` is `True` to prevent
+ calling the function twice. However, to implement the cache, the
+ original function must be wrapped which will slow down subsequent
+ calls, so only do this if your function is expensive.
+
+ The new keyword argument interface and `excluded` argument support
+ further degrades performance.
- The new keyword argument interface and `excluded` argument support further
- degrades performance.
"""
def __init__(self, pyfunc, otypes='', doc=None, excluded=None,
cache=False):
self.pyfunc = pyfunc
self.cache = cache
+ self._ufunc = None # Caching to improve default performance
if doc is None:
self.__doc__ = pyfunc.__doc__
@@ -1615,9 +1654,6 @@ class vectorize(object):
excluded = set()
self.excluded = set(excluded)
- if self.otypes and not self.excluded:
- self._ufunc = None # Caching to improve default performance
-
def __call__(self, *args, **kwargs):
"""
Return arrays with the results of `pyfunc` broadcast (vectorized) over
@@ -1651,7 +1687,8 @@ class vectorize(object):
def _get_ufunc_and_otypes(self, func, args):
"""Return (ufunc, otypes)."""
# frompyfunc will fail if args is empty
- assert args
+ if not args:
+ raise ValueError('args can not be empty')
if self.otypes:
otypes = self.otypes
@@ -1810,9 +1847,11 @@ def cov(m, y=None, rowvar=1, bias=0, ddof=None):
"ddof must be integer")
# Handles complex arrays too
+ m = np.asarray(m)
if y is None:
dtype = np.result_type(m, np.float64)
else:
+ y = np.asarray(y)
dtype = np.result_type(m, y, np.float64)
X = array(m, ndmin=2, dtype=dtype)
@@ -1821,11 +1860,9 @@ def cov(m, y=None, rowvar=1, bias=0, ddof=None):
if rowvar:
N = X.shape[1]
axis = 0
- tup = (slice(None), newaxis)
else:
N = X.shape[0]
axis = 1
- tup = (newaxis, slice(None))
# check ddof
if ddof is None:
@@ -1842,7 +1879,7 @@ def cov(m, y=None, rowvar=1, bias=0, ddof=None):
y = array(y, copy=False, ndmin=2, dtype=dtype)
X = concatenate((X, y), axis)
- X -= X.mean(axis=1-axis)[tup]
+ X -= X.mean(axis=1-axis, keepdims=True)
if not rowvar:
return (dot(X.T, X.conj()) / fact).squeeze()
else:
@@ -1909,7 +1946,7 @@ def blackman(M):
"""
Return the Blackman window.
- The Blackman window is a taper formed by using the the first three
+ The Blackman window is a taper formed by using the first three
terms of a summation of cosines. It was designed to have close to the
minimal leakage possible. It is close to optimal, only slightly worse
than a Kaiser window.
@@ -2139,9 +2176,10 @@ def hanning(M):
.. math:: w(n) = 0.5 - 0.5cos\\left(\\frac{2\\pi{n}}{M-1}\\right)
\\qquad 0 \\leq n \\leq M-1
- The Hanning was named for Julius van Hann, an Austrian meterologist. It is
- also known as the Cosine Bell. Some authors prefer that it be called a
- Hann window, to help avoid confusion with the very similar Hamming window.
+ The Hanning was named for Julius van Hann, an Austrian meteorologist.
+ It is also known as the Cosine Bell. Some authors prefer that it be
+ called a Hann window, to help avoid confusion with the very similar
+ Hamming window.
Most references to the Hanning window come from the signal processing
literature, where it is used as one of many windowing functions for
@@ -2238,9 +2276,9 @@ def hamming(M):
.. math:: w(n) = 0.54 - 0.46cos\\left(\\frac{2\\pi{n}}{M-1}\\right)
\\qquad 0 \\leq n \\leq M-1
- The Hamming was named for R. W. Hamming, an associate of J. W. Tukey and
- is described in Blackman and Tukey. It was recommended for smoothing the
- truncated autocovariance function in the time domain.
+ The Hamming was named for R. W. Hamming, an associate of J. W. Tukey
+ and is described in Blackman and Tukey. It was recommended for
+ smoothing the truncated autocovariance function in the time domain.
Most references to the Hamming window come from the signal processing
literature, where it is used as one of many windowing functions for
smoothing values. It is also known as an apodization (which means
@@ -2420,11 +2458,11 @@ def i0(x):
Notes
-----
We use the algorithm published by Clenshaw [1]_ and referenced by
- Abramowitz and Stegun [2]_, for which the function domain is partitioned
- into the two intervals [0,8] and (8,inf), and Chebyshev polynomial
- expansions are employed in each interval. Relative error on the domain
- [0,30] using IEEE arithmetic is documented [3]_ as having a peak of 5.8e-16
- with an rms of 1.4e-16 (n = 30000).
+ Abramowitz and Stegun [2]_, for which the function domain is
+ partitioned into the two intervals [0,8] and (8,inf), and Chebyshev
+ polynomial expansions are employed in each interval. Relative error on
+ the domain [0,30] using IEEE arithmetic is documented [3]_ as having a
+ peak of 5.8e-16 with an rms of 1.4e-16 (n = 30000).
References
----------
@@ -2494,12 +2532,11 @@ def kaiser(M, beta):
where :math:`I_0` is the modified zeroth-order Bessel function.
- The Kaiser was named for Jim Kaiser, who discovered a simple approximation
- to the DPSS window based on Bessel functions.
- The Kaiser window is a very good approximation to the Digital Prolate
- Spheroidal Sequence, or Slepian window, which is the transform which
- maximizes the energy in the main lobe of the window relative to total
- energy.
+ The Kaiser was named for Jim Kaiser, who discovered a simple
+ approximation to the DPSS window based on Bessel functions. The Kaiser
+ window is a very good approximation to the Digital Prolate Spheroidal
+ Sequence, or Slepian window, which is the transform which maximizes the
+ energy in the main lobe of the window relative to total energy.
The Kaiser can approximate many other windows by varying the beta
parameter.
@@ -2609,8 +2646,8 @@ def sinc(x):
The name sinc is short for "sine cardinal" or "sinus cardinalis".
The sinc function is used in various signal processing applications,
- including in anti-aliasing, in the construction of a
- Lanczos resampling filter, and in interpolation.
+ including in anti-aliasing, in the construction of a Lanczos resampling
+ filter, and in interpolation.
For bandlimited interpolation of discrete-time signals, the ideal
interpolation kernel is proportional to the sinc function.
@@ -2692,7 +2729,67 @@ def msort(a):
return b
-def median(a, axis=None, out=None, overwrite_input=False):
+def _ureduce(a, func, **kwargs):
+ """
+ Internal Function.
+ Call `func` with `a` as first argument swapping the axes to use extended
+ axis on functions that don't support it natively.
+
+ Returns result and a.shape with axis dims set to 1.
+
+ Parameters
+ ----------
+ a : array_like
+ Input array or object that can be converted to an array.
+ func : callable
+ Reduction function Kapable of receiving an axis argument.
+ It is is called with `a` as first argument followed by `kwargs`.
+ kwargs : keyword arguments
+ additional keyword arguments to pass to `func`.
+
+ Returns
+ -------
+ result : tuple
+ Result of func(a, **kwargs) and a.shape with axis dims set to 1
+ which can be used to reshape the result to the same shape a ufunc with
+ keepdims=True would produce.
+
+ """
+ a = np.asanyarray(a)
+ axis = kwargs.get('axis', None)
+ if axis is not None:
+ keepdim = list(a.shape)
+ nd = a.ndim
+ try:
+ axis = operator.index(axis)
+ if axis >= nd or axis < -nd:
+ raise IndexError("axis %d out of bounds (%d)" % (axis, a.ndim))
+ keepdim[axis] = 1
+ except TypeError:
+ sax = set()
+ for x in axis:
+ if x >= nd or x < -nd:
+ raise IndexError("axis %d out of bounds (%d)" % (x, nd))
+ if x in sax:
+ raise ValueError("duplicate value in axis")
+ sax.add(x % nd)
+ keepdim[x] = 1
+ keep = sax.symmetric_difference(frozenset(range(nd)))
+ nkeep = len(keep)
+ # swap axis that should not be reduced to front
+ for i, s in enumerate(sorted(keep)):
+ a = a.swapaxes(i, s)
+ # merge reduced axis
+ a = a.reshape(a.shape[:nkeep] + (-1,))
+ kwargs['axis'] = -1
+ else:
+ keepdim = [1] * a.ndim
+
+ r = func(a, **kwargs)
+ return r, keepdim
+
+
+def median(a, axis=None, out=None, overwrite_input=False, keepdims=False):
"""
Compute the median along the specified axis.
@@ -2702,27 +2799,35 @@ def median(a, axis=None, out=None, overwrite_input=False):
----------
a : array_like
Input array or object that can be converted to an array.
- axis : int, optional
+ axis : int or sequence of int, optional
Axis along which the medians are computed. The default (axis=None)
is to compute the median along a flattened version of the array.
+ A sequence of axes is supported since version 1.9.0.
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 (of the output) will be cast if necessary.
+ 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 (of the output) will be cast if necessary.
overwrite_input : bool, optional
If True, then allow use of memory of input array (a) for
calculations. The input array will be modified by the call to
- median. This will save memory when you do not need to preserve
- the contents of the input array. Treat the input as undefined,
- but it will probably be fully or partially sorted. Default is
- False. Note that, if `overwrite_input` is True and the input
- is not already an ndarray, an error will be raised.
+ median. This will save memory when you do not need to preserve the
+ contents of the input array. Treat the input as undefined, but it
+ will probably be fully or partially sorted. Default is False. Note
+ that, if `overwrite_input` is True and the input is not already an
+ ndarray, an error will be raised.
+ keepdims : bool, optional
+ If this is set to True, the axes which are reduced are left
+ in the result as dimensions with size one. With this option,
+ the result will broadcast correctly against the original `arr`.
+
+ .. versionadded:: 1.9.0
+
Returns
-------
median : ndarray
- A new array holding the result (unless `out` is specified, in
- which case that array is returned instead). If the input contains
+ A new array holding the result (unless `out` is specified, in which
+ case that array is returned instead). If the input contains
integers, or floats of smaller precision than 64, then the output
data-type is float64. Otherwise, the output data-type is the same
as that of the input.
@@ -2766,6 +2871,16 @@ def median(a, axis=None, out=None, overwrite_input=False):
>>> assert not np.all(a==b)
"""
+ r, k = _ureduce(a, func=_median, axis=axis, out=out,
+ overwrite_input=overwrite_input)
+ if keepdims:
+ return r.reshape(k)
+ else:
+ return r
+
+def _median(a, axis=None, out=None, overwrite_input=False):
+ # can't be reasonably be implemented in terms of percentile as we have to
+ # call mean to not break astropy
a = np.asanyarray(a)
if axis is not None and axis >= a.ndim:
raise IndexError(
@@ -2815,7 +2930,7 @@ def median(a, axis=None, out=None, overwrite_input=False):
def percentile(a, q, axis=None, out=None,
- overwrite_input=False, interpolation='linear'):
+ overwrite_input=False, interpolation='linear', keepdims=False):
"""
Compute the qth percentile of the data along the specified axis.
@@ -2827,9 +2942,10 @@ def percentile(a, q, axis=None, out=None,
Input array or object that can be converted to an array.
q : float in range of [0,100] (or sequence of floats)
Percentile to compute which must be between 0 and 100 inclusive.
- axis : int, optional
+ axis : int or sequence of int, optional
Axis along which the percentiles are computed. The default (None)
is to compute the percentiles along a flattened version of the array.
+ A sequence of axes is supported since version 1.9.0.
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,
@@ -2855,17 +2971,23 @@ def percentile(a, q, axis=None, out=None,
* midpoint: (`i` + `j`) / 2.
.. versionadded:: 1.9.0
+ keepdims : bool, optional
+ If this is set to True, the axes which are reduced are left
+ in the result as dimensions with size one. With this option,
+ the result will broadcast correctly against the original `arr`.
+
+ .. versionadded:: 1.9.0
Returns
-------
percentile : scalar or ndarray
- If a single percentile `q` is given and axis=None a scalar is returned.
- If multiple percentiles `q` are given an array holding the result is
- returned. The results are listed in the first axis.
- (If `out` is specified, in which case that array is returned instead).
- If the input contains integers, or floats of smaller precision than 64,
- then the output data-type is float64. Otherwise, the output data-type
- is the same as that of the input.
+ If a single percentile `q` is given and axis=None a scalar is
+ returned. If multiple percentiles `q` are given an array holding
+ the result is returned. The results are listed in the first axis.
+ (If `out` is specified, in which case that array is returned
+ instead). If the input contains integers, or floats of smaller
+ precision than 64, then the output data-type is float64. Otherwise,
+ the output data-type is the same as that of the input.
See Also
--------
@@ -2873,12 +2995,12 @@ def percentile(a, q, axis=None, out=None,
Notes
-----
- Given a vector V of length N, the qth percentile of V is the qth ranked
- value in a sorted copy of V. The values and distances of the two nearest
- neighbors as well as the `interpolation` parameter will determine the
- percentile if the normalized ranking does not match q exactly. This
- function is the same as the median if ``q=50``, the same as the minimum
- if ``q=0``and the same as the maximum if ``q=100``.
+ Given a vector V of length N, the q-th percentile of V is the q-th ranked
+ value in a sorted copy of V. The values and distances of the two
+ nearest neighbors as well as the `interpolation` parameter will
+ determine the percentile if the normalized ranking does not match q
+ exactly. This function is the same as the median if ``q=50``, the same
+ as the minimum if ``q=0``and the same as the maximum if ``q=100``.
Examples
--------
@@ -2911,8 +3033,22 @@ def percentile(a, q, axis=None, out=None,
array([ 3.5])
"""
+ q = asarray(q, dtype=np.float64)
+ r, k = _ureduce(a, func=_percentile, q=q, axis=axis, out=out,
+ overwrite_input=overwrite_input,
+ interpolation=interpolation)
+ if keepdims:
+ if q.ndim == 0:
+ return r.reshape(k)
+ else:
+ return r.reshape([len(q)] + k)
+ else:
+ return r
+
+
+def _percentile(a, q, axis=None, out=None,
+ overwrite_input=False, interpolation='linear', keepdims=False):
a = asarray(a)
- q = asarray(q)
if q.ndim == 0:
# Do not allow 0-d arrays because following code fails for scalar
zerod = True
@@ -2920,10 +3056,17 @@ def percentile(a, q, axis=None, out=None,
else:
zerod = False
- q = q / 100.0
- if (q < 0).any() or (q > 1).any():
- raise ValueError(
- "Percentiles must be in the range [0,100]")
+ # avoid expensive reductions, relevant for arrays with < O(1000) elements
+ if q.size < 10:
+ for i in range(q.size):
+ if q[i] < 0. or q[i] > 100.:
+ raise ValueError("Percentiles must be in the range [0,100]")
+ q[i] /= 100.
+ else:
+ # faster than any()
+ if np.count_nonzero(q < 0.) or np.count_nonzero(q > 100.):
+ raise ValueError("Percentiles must be in the range [0,100]")
+ q /= 100.
# prepare a for partioning
if overwrite_input:
@@ -3029,10 +3172,11 @@ def trapz(y, x=None, dx=1.0, axis=-1):
Notes
-----
- Image [2]_ illustrates trapezoidal rule -- y-axis locations of points will
- be taken from `y` array, by default x-axis distances between points will be
- 1.0, alternatively they can be provided with `x` array or with `dx` scalar.
- Return value will be equal to combined area under the red lines.
+ Image [2]_ illustrates trapezoidal rule -- y-axis locations of points
+ will be taken from `y` array, by default x-axis distances between
+ points will be 1.0, alternatively they can be provided with `x` array
+ or with `dx` scalar. Return value will be equal to combined area under
+ the red lines.
References
@@ -3130,7 +3274,7 @@ def meshgrid(*xi, **kwargs):
Make N-D coordinate arrays for vectorized evaluations of
N-D scalar/vector fields over N-D grids, given
one-dimensional coordinate arrays x1, x2,..., xn.
-
+
.. versionchanged:: 1.9
1-D and 0-D cases are allowed.
@@ -3141,16 +3285,22 @@ def meshgrid(*xi, **kwargs):
indexing : {'xy', 'ij'}, optional
Cartesian ('xy', default) or matrix ('ij') indexing of output.
See Notes for more details.
+
+ .. versionadded:: 1.7.0
sparse : bool, optional
- If True a sparse grid is returned in order to conserve memory.
- Default is False.
+ If True a sparse grid is returned in order to conserve memory.
+ Default is False.
+
+ .. versionadded:: 1.7.0
copy : bool, optional
- If False, a view into the original arrays are returned in
- order to conserve memory. Default is True. Please note that
- ``sparse=False, copy=False`` will likely return non-contiguous arrays.
- Furthermore, more than one element of a broadcast array may refer to
- a single memory location. If you need to write to the arrays, make
- copies first.
+ If False, a view into the original arrays are returned in order to
+ conserve memory. Default is True. Please note that
+ ``sparse=False, copy=False`` will likely return non-contiguous
+ arrays. Furthermore, more than one element of a broadcast array
+ may refer to a single memory location. If you need to write to the
+ arrays, make copies first.
+
+ .. versionadded:: 1.7.0
Returns
-------
@@ -3164,13 +3314,13 @@ def meshgrid(*xi, **kwargs):
Notes
-----
This function supports both indexing conventions through the indexing
- keyword argument. Giving the string 'ij' returns a meshgrid with matrix
- indexing, while 'xy' returns a meshgrid with Cartesian indexing. In the
- 2-D case with inputs of length M and N, the outputs are of shape (N, M) for
- 'xy' indexing and (M, N) for 'ij' indexing. In the 3-D case with inputs of
- length M, N and P, outputs are of shape (N, M, P) for 'xy' indexing and
- (M, N, P) for 'ij' indexing. The difference is illustrated by the
- following code snippet::
+ keyword argument. Giving the string 'ij' returns a meshgrid with
+ matrix indexing, while 'xy' returns a meshgrid with Cartesian indexing.
+ In the 2-D case with inputs of length M and N, the outputs are of shape
+ (N, M) for 'xy' indexing and (M, N) for 'ij' indexing. In the 3-D case
+ with inputs of length M, N and P, outputs are of shape (N, M, P) for
+ 'xy' indexing and (M, N, P) for 'ij' indexing. The difference is
+ illustrated by the following code snippet::
xv, yv = meshgrid(x, y, sparse=False, indexing='ij')
for i in range(nx):
@@ -3181,7 +3331,7 @@ def meshgrid(*xi, **kwargs):
for i in range(nx):
for j in range(ny):
# treat xv[j,i], yv[j,i]
-
+
In the 1-D and 0-D case, the indexing and sparse keywords have no effect.
See Also
@@ -3221,9 +3371,13 @@ def meshgrid(*xi, **kwargs):
"""
ndim = len(xi)
- copy_ = kwargs.get('copy', True)
- sparse = kwargs.get('sparse', False)
- indexing = kwargs.get('indexing', 'xy')
+ copy_ = kwargs.pop('copy', True)
+ sparse = kwargs.pop('sparse', False)
+ indexing = kwargs.pop('indexing', 'xy')
+
+ if kwargs:
+ raise TypeError("meshgrid() got an unexpected keyword argument '%s'"
+ % (list(kwargs)[0],))
if not indexing in ['xy', 'ij']:
raise ValueError(
@@ -3258,7 +3412,8 @@ def meshgrid(*xi, **kwargs):
def delete(arr, obj, axis=None):
"""
Return a new array with sub-arrays along an axis deleted. For a one
- dimensional array, this returns those entries not returned by `arr[obj]`.
+ dimensional array, this returns those entries not returned by
+ `arr[obj]`.
Parameters
----------
@@ -3285,9 +3440,11 @@ def delete(arr, obj, axis=None):
Notes
-----
Often it is preferable to use a boolean mask. For example:
+
>>> mask = np.ones(len(arr), dtype=bool)
>>> mask[[0,2,4]] = False
>>> result = arr[mask,...]
+
Is equivalent to `np.delete(arr, [0,2,4], axis=0)`, but allows further
use of `mask`.
@@ -3465,7 +3622,8 @@ def insert(arr, obj, values, axis=None):
.. versionadded:: 1.8.0
Support for multiple insertions when `obj` is a single scalar or a
- sequence with one element (similar to calling insert multiple times).
+ sequence with one element (similar to calling insert multiple
+ times).
values : array_like
Values to insert into `arr`. If the type of `values` is different
from that of `arr`, `values` is converted to the type of `arr`.
@@ -3664,19 +3822,19 @@ def append(arr, values, axis=None):
Values are appended to a copy of this array.
values : array_like
These values are appended to a copy of `arr`. It must be of the
- correct shape (the same shape as `arr`, excluding `axis`). If `axis`
- is not specified, `values` can be any shape and will be flattened
- before use.
+ correct shape (the same shape as `arr`, excluding `axis`). If
+ `axis` is not specified, `values` can be any shape and will be
+ flattened before use.
axis : int, optional
- The axis along which `values` are appended. If `axis` is not given,
- both `arr` and `values` are flattened before use.
+ The axis along which `values` are appended. If `axis` is not
+ given, both `arr` and `values` are flattened before use.
Returns
-------
append : ndarray
- A copy of `arr` with `values` appended to `axis`. Note that `append`
- does not occur in-place: a new array is allocated and filled. If
- `axis` is None, `out` is a flattened array.
+ A copy of `arr` with `values` appended to `axis`. Note that
+ `append` does not occur in-place: a new array is allocated and
+ filled. If `axis` is None, `out` is a flattened array.
See Also
--------
diff --git a/numpy/lib/nanfunctions.py b/numpy/lib/nanfunctions.py
index 5766084ab..7120760b5 100644
--- a/numpy/lib/nanfunctions.py
+++ b/numpy/lib/nanfunctions.py
@@ -17,12 +17,14 @@ Functions
from __future__ import division, absolute_import, print_function
import warnings
+import operator
import numpy as np
-
+from numpy.core.fromnumeric import partition
+from numpy.lib.function_base import _ureduce as _ureduce
__all__ = [
'nansum', 'nanmax', 'nanmin', 'nanargmax', 'nanargmin', 'nanmean',
- 'nanvar', 'nanstd'
+ 'nanmedian', 'nanpercentile', 'nanvar', 'nanstd'
]
@@ -228,7 +230,7 @@ def nanmin(a, axis=None, out=None, keepdims=False):
# Check for all-NaN axis
mask = np.all(mask, axis=axis, keepdims=keepdims)
if np.any(mask):
- res = _copyto(res, mask, np.nan)
+ res = _copyto(res, np.nan, mask)
warnings.warn("All-NaN axis encountered", RuntimeWarning)
return res
@@ -327,7 +329,7 @@ def nanmax(a, axis=None, out=None, keepdims=False):
# Check for all-NaN axis
mask = np.all(mask, axis=axis, keepdims=keepdims)
if np.any(mask):
- res = _copyto(res, mask, np.nan)
+ res = _copyto(res, np.nan, mask)
warnings.warn("All-NaN axis encountered", RuntimeWarning)
return res
@@ -601,6 +603,335 @@ def nanmean(a, axis=None, dtype=None, out=None, keepdims=False):
return avg
+def _nanmedian1d(arr1d, overwrite_input=False):
+ """
+ Private function for rank 1 arrays. Compute the median ignoring NaNs.
+ See nanmedian for parameter usage
+ """
+ c = np.isnan(arr1d)
+ s = np.where(c)[0]
+ if s.size == arr1d.size:
+ warnings.warn("All-NaN slice encountered", RuntimeWarning)
+ return np.nan
+ elif s.size == 0:
+ return np.median(arr1d, overwrite_input=overwrite_input)
+ else:
+ if overwrite_input:
+ x = arr1d
+ else:
+ x = arr1d.copy()
+ # select non-nans at end of array
+ enonan = arr1d[-s.size:][~c[-s.size:]]
+ # fill nans in beginning of array with non-nans of end
+ x[s[:enonan.size]] = enonan
+ # slice nans away
+ return np.median(x[:-s.size], overwrite_input=True)
+
+
+def _nanmedian(a, axis=None, out=None, overwrite_input=False):
+ """
+ Private function that doesn't support extended axis or keepdims.
+ These methods are extended to this function using _ureduce
+ See nanmedian for parameter usage
+
+ """
+ if axis is None or a.ndim == 1:
+ part = a.ravel()
+ if out is None:
+ return _nanmedian1d(part, overwrite_input)
+ else:
+ out[...] = _nanmedian1d(part, overwrite_input)
+ return out
+ else:
+ # for small medians use sort + indexing which is still faster than
+ # apply_along_axis
+ if a.shape[axis] < 400:
+ return _nanmedian_small(a, axis, out, overwrite_input)
+ result = np.apply_along_axis(_nanmedian1d, axis, a, overwrite_input)
+ if out is not None:
+ out[...] = result
+ return result
+
+def _nanmedian_small(a, axis=None, out=None, overwrite_input=False):
+ """
+ sort + indexing median, faster for small medians along multiple dimensions
+ due to the high overhead of apply_along_axis
+ see nanmedian for parameter usage
+ """
+ a = np.ma.masked_array(a, np.isnan(a))
+ m = np.ma.median(a, axis=axis, overwrite_input=overwrite_input)
+ for i in range(np.count_nonzero(m.mask.ravel())):
+ warnings.warn("All-NaN slice encountered", RuntimeWarning)
+ if out is not None:
+ out[...] = m.filled(np.nan)
+ return out
+ return m.filled(np.nan)
+
+def nanmedian(a, axis=None, out=None, overwrite_input=False, keepdims=False):
+ """
+ Compute the median along the specified axis, while ignoring NaNs.
+
+ Returns the median of the array elements.
+
+ .. versionadded:: 1.9.0
+
+ Parameters
+ ----------
+ a : array_like
+ Input array or object that can be converted to an array.
+ axis : int, optional
+ Axis along which the medians are computed. The default (axis=None)
+ is to compute the median along a flattened version of the array.
+ A sequence of axes is supported since version 1.9.0.
+ 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 (of the output) will be cast if necessary.
+ overwrite_input : bool, optional
+ If True, then allow use of memory of input array (a) for
+ calculations. The input array will be modified by the call to
+ median. This will save memory when you do not need to preserve
+ the contents of the input array. Treat the input as undefined,
+ but it will probably be fully or partially sorted. Default is
+ False. Note that, if `overwrite_input` is True and the input
+ is not already an ndarray, an error will be raised.
+ keepdims : bool, optional
+ If this is set to True, the axes which are reduced are left
+ in the result as dimensions with size one. With this option,
+ the result will broadcast correctly against the original `arr`.
+
+
+
+ Returns
+ -------
+ median : ndarray
+ A new array holding the result. If the input contains integers, or
+ floats of smaller precision than 64, then the output data-type is
+ float64. Otherwise, the output data-type is the same as that of the
+ input.
+
+ See Also
+ --------
+ mean, median, percentile
+
+ Notes
+ -----
+ Given a vector V of length N, the median of V is the middle value of
+ a sorted copy of V, ``V_sorted`` - i.e., ``V_sorted[(N-1)/2]``, when N is
+ odd. When N is even, it is the average of the two middle values of
+ ``V_sorted``.
+
+ Examples
+ --------
+ >>> a = np.array([[10.0, 7, 4], [3, 2, 1]])
+ >>> a[0, 1] = np.nan
+ >>> a
+ array([[ 10., nan, 4.],
+ [ 3., 2., 1.]])
+ >>> np.median(a)
+ nan
+ >>> np.nanmedian(a)
+ 3.0
+ >>> np.nanmedian(a, axis=0)
+ array([ 6.5, 2., 2.5])
+ >>> np.median(a, axis=1)
+ array([ 7., 2.])
+ >>> b = a.copy()
+ >>> np.nanmedian(b, axis=1, overwrite_input=True)
+ array([ 7., 2.])
+ >>> assert not np.all(a==b)
+ >>> b = a.copy()
+ >>> np.nanmedian(b, axis=None, overwrite_input=True)
+ 3.0
+ >>> assert not np.all(a==b)
+
+ """
+ a = np.asanyarray(a)
+ # apply_along_axis in _nanmedian doesn't handle empty arrays well,
+ # so deal them upfront
+ if a.size == 0:
+ return np.nanmean(a, axis, out=out, keepdims=keepdims)
+
+ r, k = _ureduce(a, func=_nanmedian, axis=axis, out=out,
+ overwrite_input=overwrite_input)
+ if keepdims:
+ return r.reshape(k)
+ else:
+ return r
+
+
+def nanpercentile(a, q, axis=None, out=None, overwrite_input=False,
+ interpolation='linear', keepdims=False):
+ """
+ Compute the qth percentile of the data along the specified axis, while
+ ignoring nan values.
+
+ Returns the qth percentile of the array elements.
+
+ Parameters
+ ----------
+ a : array_like
+ Input array or object that can be converted to an array.
+ q : float in range of [0,100] (or sequence of floats)
+ Percentile to compute which must be between 0 and 100 inclusive.
+ axis : int or sequence of int, optional
+ Axis along which the percentiles are computed. The default (None)
+ is to compute the percentiles along a flattened version of the array.
+ A sequence of axes is supported since version 1.9.0.
+ 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 (of the output) will be cast if necessary.
+ overwrite_input : bool, optional
+ If True, then allow use of memory of input array `a` for
+ calculations. The input array will be modified by the call to
+ percentile. This will save memory when you do not need to preserve
+ the contents of the input array. In this case you should not make
+ any assumptions about the content of the passed in array `a` after
+ this function completes -- treat it as undefined. Default is False.
+ Note that, if the `a` input is not already an array this parameter
+ will have no effect, `a` will be converted to an array internally
+ regardless of the value of this parameter.
+ interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}
+ This optional parameter specifies the interpolation method to use,
+ when the desired quantile lies between two data points `i` and `j`:
+ * linear: `i + (j - i) * fraction`, where `fraction` is the
+ fractional part of the index surrounded by `i` and `j`.
+ * lower: `i`.
+ * higher: `j`.
+ * nearest: `i` or `j` whichever is nearest.
+ * midpoint: (`i` + `j`) / 2.
+
+ keepdims : bool, optional
+ If this is set to True, the axes which are reduced are left
+ in the result as dimensions with size one. With this option,
+ the result will broadcast correctly against the original `arr`.
+
+
+ Returns
+ -------
+ nanpercentile : scalar or ndarray
+ If a single percentile `q` is given and axis=None a scalar is
+ returned. If multiple percentiles `q` are given an array holding
+ the result is returned. The results are listed in the first axis.
+ (If `out` is specified, in which case that array is returned
+ instead). If the input contains integers, or floats of smaller
+ precision than 64, then the output data-type is float64. Otherwise,
+ the output data-type is the same as that of the input.
+
+ See Also
+ --------
+ nanmean, nanmedian, percentile, median, mean
+
+ Notes
+ -----
+ Given a vector V of length N, the q-th percentile of V is the q-th ranked
+ value in a sorted copy of V. The values and distances of the two
+ nearest neighbors as well as the `interpolation` parameter will
+ determine the percentile if the normalized ranking does not match q
+ exactly. This function is the same as the median if ``q=50``, the same
+ as the minimum if ``q=0``and the same as the maximum if ``q=100``.
+
+ Examples
+ --------
+ >>> a = np.array([[10., 7., 4.], [3., 2., 1.]])
+ >>> a[0][1] = np.nan
+ >>> a
+ array([[ 10., nan, 4.],
+ [ 3., 2., 1.]])
+ >>> np.percentile(a, 50)
+ nan
+ >>> np.nanpercentile(a, 50)
+ 3.5
+ >>> np.nanpercentile(a, 50, axis=0)
+ array([[ 6.5, 4.5, 2.5]])
+ >>> np.nanpercentile(a, 50, axis=1)
+ array([[ 7.],
+ [ 2.]])
+ >>> m = np.nanpercentile(a, 50, axis=0)
+ >>> out = np.zeros_like(m)
+ >>> np.nanpercentile(a, 50, axis=0, out=m)
+ array([[ 6.5, 4.5, 2.5]])
+ >>> m
+ array([[ 6.5, 4.5, 2.5]])
+ >>> b = a.copy()
+ >>> np.nanpercentile(b, 50, axis=1, overwrite_input=True)
+ array([[ 7.],
+ [ 2.]])
+ >>> assert not np.all(a==b)
+ >>> b = a.copy()
+ >>> np.nanpercentile(b, 50, axis=None, overwrite_input=True)
+ array([ 3.5])
+
+ """
+
+ a = np.asanyarray(a)
+ q = np.asanyarray(q)
+ # apply_along_axis in _nanpercentile doesn't handle empty arrays well,
+ # so deal them upfront
+ if a.size == 0:
+ return np.nanmean(a, axis, out=out, keepdims=keepdims)
+
+ r, k = _ureduce(a, func=_nanpercentile, q=q, axis=axis, out=out,
+ overwrite_input=overwrite_input,
+ interpolation=interpolation)
+ if keepdims:
+ if q.ndim == 0:
+ return r.reshape(k)
+ else:
+ return r.reshape([len(q)] + k)
+ else:
+ return r
+
+
+def _nanpercentile(a, q, axis=None, out=None, overwrite_input=False,
+ interpolation='linear', keepdims=False):
+ """
+ Private function that doesn't support extended axis or keepdims.
+ These methods are extended to this function using _ureduce
+ See nanpercentile for parameter usage
+
+ """
+ if axis is None:
+ part = a.ravel()
+ result = _nanpercentile1d(part, q, overwrite_input, interpolation)
+ else:
+ result = np.apply_along_axis(_nanpercentile1d, axis, a, q,
+ overwrite_input, interpolation)
+
+ if out is not None:
+ out[...] = result
+ return result
+
+
+def _nanpercentile1d(arr1d, q, overwrite_input=False, interpolation='linear'):
+ """
+ Private function for rank 1 arrays. Compute percentile ignoring NaNs.
+ See nanpercentile for parameter usage
+
+ """
+ c = np.isnan(arr1d)
+ s = np.where(c)[0]
+ if s.size == arr1d.size:
+ warnings.warn("All-NaN slice encountered", RuntimeWarning)
+ return np.nan
+ elif s.size == 0:
+ return np.percentile(arr1d, q, overwrite_input=overwrite_input,
+ interpolation=interpolation)
+ else:
+ if overwrite_input:
+ x = arr1d
+ else:
+ x = arr1d.copy()
+ # select non-nans at end of array
+ enonan = arr1d[-s.size:][~c[-s.size:]]
+ # fill nans in beginning of array with non-nans of end
+ x[s[:enonan.size]] = enonan
+ # slice nans away
+ return np.percentile(x[:-s.size], q, overwrite_input=True,
+ interpolation=interpolation)
+
+
def nanvar(a, axis=None, dtype=None, out=None, ddof=0, keepdims=False):
"""
Compute the variance along the specified axis, while ignoring NaNs.
diff --git a/numpy/lib/npyio.py b/numpy/lib/npyio.py
index af259cfef..42a539f78 100644
--- a/numpy/lib/npyio.py
+++ b/numpy/lib/npyio.py
@@ -285,21 +285,22 @@ def load(file, mmap_mode=None):
Parameters
----------
file : file-like object or string
- The file to read. It must support ``seek()`` and ``read()`` methods.
- If the filename extension is ``.gz``, the file is first decompressed.
+ The file to read. File-like objects must support the
+ ``seek()`` and ``read()`` methods. Pickled files require that the
+ file-like object support the ``readline()`` method as well.
mmap_mode : {None, 'r+', 'r', 'w+', 'c'}, optional
- If not None, then memory-map the file, using the given mode
- (see `numpy.memmap` for a detailed description of the modes).
- A memory-mapped array is kept on disk. However, it can be accessed
- and sliced like any ndarray. Memory mapping is especially useful for
- accessing small fragments of large files without reading the entire
- file into memory.
+ If not None, then memory-map the file, using the given mode (see
+ `numpy.memmap` for a detailed description of the modes). A
+ memory-mapped array is kept on disk. However, it can be accessed
+ and sliced like any ndarray. Memory mapping is especially useful
+ for accessing small fragments of large files without reading the
+ entire file into memory.
Returns
-------
result : array, tuple, dict, etc.
- Data stored in the file. For ``.npz`` files, the returned instance of
- NpzFile class must be closed to avoid leaking file descriptors.
+ Data stored in the file. For ``.npz`` files, the returned instance
+ of NpzFile class must be closed to avoid leaking file descriptors.
Raises
------
@@ -308,7 +309,7 @@ def load(file, mmap_mode=None):
See Also
--------
- save, savez, loadtxt
+ save, savez, savez_compressed, loadtxt
memmap : Create a memory-map to an array stored in a file on disk.
Notes
@@ -319,13 +320,14 @@ def load(file, mmap_mode=None):
- If the file is a ``.npz`` file, then a dictionary-like object is
returned, containing ``{filename: array}`` key-value pairs, one for
each file in the archive.
- - If the file is a ``.npz`` file, the returned value supports the context
- manager protocol in a similar fashion to the open function::
+ - If the file is a ``.npz`` file, the returned value supports the
+ context manager protocol in a similar fashion to the open function::
with load('foo.npz') as data:
a = data['a']
- The underlying file descriptor is closed when exiting the 'with' block.
+ The underlying file descriptor is closed when exiting the 'with'
+ block.
Examples
--------
@@ -549,6 +551,7 @@ def savez_compressed(file, *args, **kwds):
See Also
--------
numpy.savez : Save several arrays into an uncompressed ``.npz`` file format
+ numpy.load : Load the files created by savez_compressed.
"""
_savez(file, args, kwds, True)
@@ -668,6 +671,7 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None,
The returned array will have at least `ndmin` dimensions.
Otherwise mono-dimensional axes will be squeezed.
Legal values: 0 (default), 1 or 2.
+
.. versionadded:: 1.6.0
Returns
@@ -840,6 +844,11 @@ def loadtxt(fname, dtype=float, comments='#', delimiter=None,
continue
if usecols:
vals = [vals[i] for i in usecols]
+ if len(vals) != N:
+ line_num = i + skiprows + 1
+ raise ValueError("Wrong number of columns at line %d"
+ % line_num)
+
# Convert each value according to its column and store
items = [conv(val) for (conv, val) in zip(converters, vals)]
# Then pack it according to the dtype's nesting
@@ -906,22 +915,26 @@ def savetxt(fname, X, fmt='%.18e', delimiter=' ', newline='\n', header='',
and imaginary part must have separate specifiers,
e.g. `['%.3e + %.3ej', '(%.15e%+.15ej)']` for 2 columns
delimiter : str, optional
- Character separating columns.
+ String or character separating columns.
newline : str, optional
+ String or character separating lines.
+
.. versionadded:: 1.5.0
header : str, optional
String that will be written at the beginning of the file.
+
.. versionadded:: 1.7.0
footer : str, optional
String that will be written at the end of the file.
+
.. versionadded:: 1.7.0
comments : str, optional
String that will be prepended to the ``header`` and ``footer`` strings,
to mark them as comments. Default: '# ', as expected by e.g.
``numpy.loadtxt``.
+
.. versionadded:: 1.7.0
- Character separating lines.
See Also
--------
@@ -1191,14 +1204,20 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
The string used to separate values. By default, any consecutive
whitespaces act as delimiter. An integer or sequence of integers
can also be provided as width(s) of each field.
+ skip_rows : int, optional
+ `skip_rows` was deprecated in numpy 1.5, and will be removed in
+ numpy 2.0. Please use `skip_header` instead.
skip_header : int, optional
- The numbers of lines to skip at the beginning of the file.
+ The number of lines to skip at the beginning of the file.
skip_footer : int, optional
- The numbers of lines to skip at the end of the file
+ The number of lines to skip at the end of the file.
converters : variable, optional
The set of functions that convert the data of a column to a value.
The converters can also be used to provide a default value
for missing data: ``converters = {3: lambda s: float(s or 0)}``.
+ missing : variable, optional
+ `missing` was deprecated in numpy 1.5, and will be removed in
+ numpy 2.0. Please use `missing_values` instead.
missing_values : variable, optional
The set of strings corresponding to missing data.
filling_values : variable, optional
@@ -1236,6 +1255,8 @@ def genfromtxt(fname, dtype=float, comments='#', delimiter=None,
usemask : bool, optional
If True, return a masked array.
If False, return a regular array.
+ loose : bool, optional
+ If True, do not raise errors for invalid values.
invalid_raise : bool, optional
If True, an exception is raised if an inconsistency is detected in the
number of columns.
@@ -1840,7 +1861,7 @@ def recfromtxt(fname, **kwargs):
array will be determined from the data.
"""
- kwargs.update(dtype=kwargs.get('dtype', None))
+ kwargs.setdefault("dtype", None)
usemask = kwargs.get('usemask', False)
output = genfromtxt(fname, **kwargs)
if usemask:
@@ -1867,17 +1888,20 @@ def recfromcsv(fname, **kwargs):
--------
numpy.genfromtxt : generic function to load ASCII data.
+ Notes
+ -----
+ By default, `dtype` is None, which means that the data-type of the output
+ array will be determined from the data.
+
"""
- case_sensitive = kwargs.get('case_sensitive', "lower") or "lower"
- names = kwargs.get('names', True)
- if names is None:
- names = True
- kwargs.update(dtype=kwargs.get('update', None),
- delimiter=kwargs.get('delimiter', ",") or ",",
- names=names,
- case_sensitive=case_sensitive)
- usemask = kwargs.get("usemask", False)
+ # Set default kwargs for genfromtxt as relevant to csv import.
+ kwargs.setdefault("case_sensitive", "lower")
+ kwargs.setdefault("names", True)
+ kwargs.setdefault("delimiter", ",")
+ kwargs.setdefault("dtype", None)
output = genfromtxt(fname, **kwargs)
+
+ usemask = kwargs.get("usemask", False)
if usemask:
from numpy.ma.mrecords import MaskedRecords
output = output.view(MaskedRecords)
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py
index 8545375cd..10ae32a60 100644
--- a/numpy/lib/polynomial.py
+++ b/numpy/lib/polynomial.py
@@ -127,7 +127,7 @@ def poly(seq_of_zeros):
elif len(sh) == 1:
pass
else:
- raise ValueError("input must be 1d or square 2d array.")
+ raise ValueError("input must be 1d or non-empty square 2d array.")
if len(seq_of_zeros) == 0:
return 1.0
@@ -806,6 +806,8 @@ def polymul(a1, a2):
poly1d : A one-dimensional polynomial class.
poly, polyadd, polyder, polydiv, polyfit, polyint, polysub,
polyval
+ convolve : Array convolution. Same output as polymul, but has parameter
+ for overlap mode.
Examples
--------
@@ -1191,10 +1193,12 @@ class poly1d(object):
__rtruediv__ = __rdiv__
def __eq__(self, other):
- return NX.alltrue(self.coeffs == other.coeffs)
+ if self.coeffs.shape != other.coeffs.shape:
+ return False
+ return (self.coeffs == other.coeffs).all()
def __ne__(self, other):
- return NX.any(self.coeffs != other.coeffs)
+ return not self.__eq__(other)
def __setattr__(self, key, val):
raise ValueError("Attributes cannot be changed this way.")
diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py
index 4fdaba349..a6d391728 100644
--- a/numpy/lib/shape_base.py
+++ b/numpy/lib/shape_base.py
@@ -12,7 +12,7 @@ from numpy.core.numeric import asarray, zeros, newaxis, outer, \
from numpy.core.fromnumeric import product, reshape
from numpy.core import hstack, vstack, atleast_3d
-def apply_along_axis(func1d,axis,arr,*args):
+def apply_along_axis(func1d, axis, arr, *args, **kwargs):
"""
Apply a function to 1-D slices along the given axis.
@@ -30,6 +30,11 @@ def apply_along_axis(func1d,axis,arr,*args):
Input array.
args : any
Additional arguments to `func1d`.
+ kwargs: any
+ Additional named arguments to `func1d`.
+
+ .. versionadded:: 1.9.0
+
Returns
-------
@@ -78,7 +83,7 @@ def apply_along_axis(func1d,axis,arr,*args):
i[axis] = slice(None, None)
outshape = asarray(arr.shape).take(indlist)
i.put(indlist, ind)
- res = func1d(arr[tuple(i.tolist())],*args)
+ res = func1d(arr[tuple(i.tolist())], *args, **kwargs)
# if res is a number, then we have a smaller output array
if isscalar(res):
outarr = zeros(outshape, asarray(res).dtype)
@@ -94,7 +99,7 @@ def apply_along_axis(func1d,axis,arr,*args):
ind[n] = 0
n -= 1
i.put(indlist, ind)
- res = func1d(arr[tuple(i.tolist())],*args)
+ res = func1d(arr[tuple(i.tolist())], *args, **kwargs)
outarr[tuple(ind)] = res
k += 1
return outarr
@@ -115,7 +120,7 @@ def apply_along_axis(func1d,axis,arr,*args):
ind[n] = 0
n -= 1
i.put(indlist, ind)
- res = func1d(arr[tuple(i.tolist())],*args)
+ res = func1d(arr[tuple(i.tolist())], *args, **kwargs)
outarr[tuple(i.tolist())] = res
k += 1
return outarr
@@ -153,6 +158,12 @@ def apply_over_axes(func, a, axes):
apply_along_axis :
Apply a function to 1-D slices of an array along the given axis.
+ Notes
+ ------
+ This function is equivalent to tuple axis arguments to reorderable ufuncs
+ with keepdims=True. Tuple axis arguments to ufuncs have been availabe since
+ version 1.7.0.
+
Examples
--------
>>> a = np.arange(24).reshape(2,3,4)
@@ -172,6 +183,13 @@ def apply_over_axes(func, a, axes):
[ 92],
[124]]])
+ Tuple axis arguments to ufuncs are equivalent:
+
+ >>> np.sum(a, axis=(0,2), keepdims=True)
+ array([[[ 60],
+ [ 92],
+ [124]]])
+
"""
val = asarray(a)
N = a.ndim
@@ -274,10 +292,6 @@ def column_stack(tup):
--------
hstack, vstack, concatenate
- Notes
- -----
- This function is equivalent to ``np.vstack(tup).T``.
-
Examples
--------
>>> a = np.array((1,2,3))
@@ -638,7 +652,7 @@ def dsplit(ary, indices_or_sections):
"""
if len(_nx.shape(ary)) < 3:
- raise ValueError('vsplit only works on arrays of 3 or more dimensions')
+ raise ValueError('dsplit only works on arrays of 3 or more dimensions')
return split(ary, indices_or_sections, 2)
def get_array_prepare(*args):
diff --git a/numpy/lib/src/_compiled_base.c b/numpy/lib/src/_compiled_base.c
index 328fc2d14..a461613e3 100644
--- a/numpy/lib/src/_compiled_base.c
+++ b/numpy/lib/src/_compiled_base.c
@@ -60,29 +60,44 @@ decr_slot_right_(double x, double * bins, npy_intp lbins)
return 0;
}
-/**
+/*
* Returns -1 if the array is monotonic decreasing,
* +1 if the array is monotonic increasing,
* and 0 if the array is not monotonic.
*/
static int
-check_array_monotonic(double * a, int lena)
+check_array_monotonic(const double *a, npy_int lena)
{
- int i;
+ npy_intp i;
+ double next;
+ double last = a[0];
+
+ /* Skip repeated values at the beginning of the array */
+ for (i = 1; (i < lena) && (a[i] == last); i++);
+
+ if (i == lena) {
+ /* all bin edges hold the same value */
+ return 1;
+ }
- if (a [0] <= a [1]) {
- /* possibly monotonic increasing */
- for (i = 1; i < lena - 1; i ++) {
- if (a [i] > a [i + 1]) {
+ next = a[i];
+ if (last < next) {
+ /* Possibly monotonic increasing */
+ for (i += 1; i < lena; i++) {
+ last = next;
+ next = a[i];
+ if (last > next) {
return 0;
}
}
return 1;
}
else {
- /* possibly monotonic decreasing */
- for (i = 1; i < lena - 1; i ++) {
- if (a [i] < a [i + 1]) {
+ /* last > next, possibly monotonic decreasing */
+ for (i += 1; i < lena; i++) {
+ last = next;
+ next = a[i];
+ if (last < next) {
return 0;
}
}
@@ -90,39 +105,26 @@ check_array_monotonic(double * a, int lena)
}
}
-
-
-/* find the index of the maximum element of an integer array */
-static npy_intp
-mxx (npy_intp *i , npy_intp len)
+/* Find the minimum and maximum of an integer array */
+static void
+minmax(const npy_intp *data, npy_intp data_len, npy_intp *mn, npy_intp *mx)
{
- npy_intp mx = 0, max = i[0];
- npy_intp j;
+ npy_intp min = *data;
+ npy_intp max = *data;
- for ( j = 1; j < len; j ++ ) {
- if ( i [j] > max ) {
- max = i [j];
- mx = j;
+ while (--data_len) {
+ const npy_intp val = *(++data);
+ if (val < min) {
+ min = val;
+ }
+ else if (val > max) {
+ max = val;
}
}
- return mx;
-}
-/* find the index of the minimum element of an integer array */
-static npy_intp
-mnx (npy_intp *i , npy_intp len)
-{
- npy_intp mn = 0, min = i [0];
- npy_intp j;
-
- for ( j = 1; j < len; j ++ )
- if ( i [j] < min )
- {min = i [j];
- mn = j;}
- return mn;
+ *mn = min;
+ *mx = max;
}
-
-
/*
* arr_bincount is registered as bincount.
*
@@ -142,7 +144,7 @@ arr_bincount(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
PyArray_Descr *type;
PyObject *list = NULL, *weight=Py_None, *mlength=Py_None;
PyArrayObject *lst=NULL, *ans=NULL, *wts=NULL;
- npy_intp *numbers, *ians, len , mxi, mni, ans_size, minlength;
+ npy_intp *numbers, *ians, len , mx, mn, ans_size, minlength;
int i;
double *weights , *dans;
static char *kwlist[] = {"list", "weights", "minlength", NULL};
@@ -159,14 +161,22 @@ arr_bincount(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
len = PyArray_SIZE(lst);
type = PyArray_DescrFromType(NPY_INTP);
- /* handle empty list */
- if (len < 1) {
- if (mlength == Py_None) {
- minlength = 0;
- }
- else if (!(minlength = PyArray_PyIntAsIntp(mlength))) {
+ if (mlength == Py_None) {
+ minlength = 0;
+ }
+ else {
+ minlength = PyArray_PyIntAsIntp(mlength);
+ if (minlength <= 0) {
+ if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ValueError,
+ "minlength must be positive");
+ }
goto fail;
}
+ }
+
+ /* handle empty list */
+ if (len == 0) {
if (!(ans = (PyArrayObject *)PyArray_Zeros(1, &minlength, type, 0))){
goto fail;
}
@@ -175,24 +185,14 @@ arr_bincount(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds)
}
numbers = (npy_intp *) PyArray_DATA(lst);
- mxi = mxx(numbers, len);
- mni = mnx(numbers, len);
- if (numbers[mni] < 0) {
+ minmax(numbers, len, &mn, &mx);
+ if (mn < 0) {
PyErr_SetString(PyExc_ValueError,
"The first argument of bincount must be non-negative");
goto fail;
}
- ans_size = numbers [mxi] + 1;
+ ans_size = mx + 1;
if (mlength != Py_None) {
- if (!(minlength = PyArray_PyIntAsIntp(mlength))) {
- goto fail;
- }
- if (minlength <= 0) {
- /* superfluous, but may catch incorrect usage */
- PyErr_SetString(PyExc_ValueError,
- "minlength must be positive");
- goto fail;
- }
if (ans_size < minlength) {
ans_size = minlength;
}
@@ -680,8 +680,15 @@ arr_interp(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
slopes[i] = (dy[i + 1] - dy[i])/(dx[i + 1] - dx[i]);
}
for (i = 0; i < lenx; i++) {
- npy_intp j = binary_search(dz[i], dx, lenxp);
+ const double x = dz[i];
+ npy_intp j;
+ if (npy_isnan(x)) {
+ dres[i] = x;
+ continue;
+ }
+
+ j = binary_search(x, dx, lenxp);
if (j == -1) {
dres[i] = lval;
}
@@ -692,7 +699,7 @@ arr_interp(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
dres[i] = rval;
}
else {
- dres[i] = slopes[j]*(dz[i] - dx[j]) + dy[j];
+ dres[i] = slopes[j]*(x - dx[j]) + dy[j];
}
}
NPY_END_ALLOW_THREADS;
@@ -701,8 +708,15 @@ arr_interp(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
else {
NPY_BEGIN_ALLOW_THREADS;
for (i = 0; i < lenx; i++) {
- npy_intp j = binary_search(dz[i], dx, lenxp);
+ const double x = dz[i];
+ npy_intp j;
+
+ if (npy_isnan(x)) {
+ dres[i] = x;
+ continue;
+ }
+ j = binary_search(x, dx, lenxp);
if (j == -1) {
dres[i] = lval;
}
@@ -713,8 +727,8 @@ arr_interp(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
dres[i] = rval;
}
else {
- double slope = (dy[j + 1] - dy[j])/(dx[j + 1] - dx[j]);
- dres[i] = slope*(dz[i] - dx[j]) + dy[j];
+ const double slope = (dy[j + 1] - dy[j])/(dx[j + 1] - dx[j]);
+ dres[i] = slope*(x - dx[j]) + dy[j];
}
}
NPY_END_ALLOW_THREADS;
@@ -1402,6 +1416,9 @@ _packbits( void *In,
npy_intp out_Nm1;
int maxi, remain, nonzero, j;
char *outptr,*inptr;
+ NPY_BEGIN_THREADS_DEF;
+
+ NPY_BEGIN_THREADS_THRESHOLDED(out_N);
outptr = Out; /* pointer to output buffer */
inptr = In; /* pointer to input buffer */
@@ -1436,6 +1453,8 @@ _packbits( void *In,
*outptr = build;
outptr += out_stride;
}
+
+ NPY_END_THREADS;
return;
}
@@ -1453,6 +1472,9 @@ _unpackbits(void *In,
unsigned char mask;
int i, index;
char *inptr, *outptr;
+ NPY_BEGIN_THREADS_DEF;
+
+ NPY_BEGIN_THREADS_THRESHOLDED(in_N);
outptr = Out;
inptr = In;
@@ -1465,6 +1487,8 @@ _unpackbits(void *In,
}
inptr += in_stride;
}
+
+ NPY_END_THREADS;
return;
}
diff --git a/numpy/lib/stride_tricks.py b/numpy/lib/stride_tricks.py
index d092f92a8..1ffaaee36 100644
--- a/numpy/lib/stride_tricks.py
+++ b/numpy/lib/stride_tricks.py
@@ -29,7 +29,8 @@ def as_strided(x, shape=None, strides=None):
interface['strides'] = tuple(strides)
array = np.asarray(DummyArray(interface, base=x))
# Make sure dtype is correct in case of custom dtype
- array.dtype = x.dtype
+ if array.dtype.kind == 'V':
+ array.dtype = x.dtype
return array
def broadcast_arrays(*args):
diff --git a/numpy/lib/tests/test__version.py b/numpy/lib/tests/test__version.py
new file mode 100644
index 000000000..bbafe68eb
--- /dev/null
+++ b/numpy/lib/tests/test__version.py
@@ -0,0 +1,57 @@
+"""Tests for the NumpyVersion class.
+
+"""
+from __future__ import division, absolute_import, print_function
+
+from numpy.testing import assert_, run_module_suite, assert_raises
+from numpy.lib import NumpyVersion
+
+
+def test_main_versions():
+ assert_(NumpyVersion('1.8.0') == '1.8.0')
+ for ver in ['1.9.0', '2.0.0', '1.8.1']:
+ assert_(NumpyVersion('1.8.0') < ver)
+
+ for ver in ['1.7.0', '1.7.1', '0.9.9']:
+ assert_(NumpyVersion('1.8.0') > ver)
+
+
+def test_version_1_point_10():
+ # regression test for gh-2998.
+ assert_(NumpyVersion('1.9.0') < '1.10.0')
+ assert_(NumpyVersion('1.11.0') < '1.11.1')
+ assert_(NumpyVersion('1.11.0') == '1.11.0')
+ assert_(NumpyVersion('1.99.11') < '1.99.12')
+
+
+def test_alpha_beta_rc():
+ assert_(NumpyVersion('1.8.0rc1') == '1.8.0rc1')
+ for ver in ['1.8.0', '1.8.0rc2']:
+ assert_(NumpyVersion('1.8.0rc1') < ver)
+
+ for ver in ['1.8.0a2', '1.8.0b3', '1.7.2rc4']:
+ assert_(NumpyVersion('1.8.0rc1') > ver)
+
+ assert_(NumpyVersion('1.8.0b1') > '1.8.0a2')
+
+
+def test_dev_version():
+ assert_(NumpyVersion('1.9.0.dev-Unknown') < '1.9.0')
+ for ver in ['1.9.0', '1.9.0a1', '1.9.0b2', '1.9.0b2.dev-ffffffff']:
+ assert_(NumpyVersion('1.9.0.dev-f16acvda') < ver)
+
+ assert_(NumpyVersion('1.9.0.dev-f16acvda') == '1.9.0.dev-11111111')
+
+
+def test_dev_a_b_rc_mixed():
+ assert_(NumpyVersion('1.9.0a2.dev-f16acvda') == '1.9.0a2.dev-11111111')
+ assert_(NumpyVersion('1.9.0a2.dev-6acvda54') < '1.9.0a2')
+
+
+def test_raises():
+ for ver in ['1.9', '1,9.0', '1.7.x']:
+ assert_raises(ValueError, NumpyVersion, ver)
+
+
+if __name__ == "__main__":
+ run_module_suite()
diff --git a/numpy/lib/tests/test_arraysetops.py b/numpy/lib/tests/test_arraysetops.py
index 5934ca05a..271943abc 100644
--- a/numpy/lib/tests/test_arraysetops.py
+++ b/numpy/lib/tests/test_arraysetops.py
@@ -14,31 +14,59 @@ class TestSetOps(TestCase):
def test_unique(self):
- def check_all(a, b, i1, i2, dt):
- msg = "check values failed for type '%s'" % dt
+ def check_all(a, b, i1, i2, c, dt):
+ base_msg = 'check {0} failed for type {1}'
+
+ msg = base_msg.format('values', dt)
v = unique(a)
assert_array_equal(v, b, msg)
- msg = "check indexes failed for type '%s'" % dt
- v, j = unique(a, 1, 0)
+ msg = base_msg.format('return_index', dt)
+ v, j = unique(a, 1, 0, 0)
assert_array_equal(v, b, msg)
assert_array_equal(j, i1, msg)
- msg = "check reverse indexes failed for type '%s'" % dt
- v, j = unique(a, 0, 1)
+ msg = base_msg.format('return_inverse', dt)
+ v, j = unique(a, 0, 1, 0)
assert_array_equal(v, b, msg)
assert_array_equal(j, i2, msg)
- msg = "check with all indexes failed for type '%s'" % dt
- v, j1, j2 = unique(a, 1, 1)
+ msg = base_msg.format('return_counts', dt)
+ v, j = unique(a, 0, 0, 1)
+ assert_array_equal(v, b, msg)
+ assert_array_equal(j, c, msg)
+
+ msg = base_msg.format('return_index and return_inverse', dt)
+ v, j1, j2 = unique(a, 1, 1, 0)
+ assert_array_equal(v, b, msg)
+ assert_array_equal(j1, i1, msg)
+ assert_array_equal(j2, i2, msg)
+
+ msg = base_msg.format('return_index and return_counts', dt)
+ v, j1, j2 = unique(a, 1, 0, 1)
+ assert_array_equal(v, b, msg)
+ assert_array_equal(j1, i1, msg)
+ assert_array_equal(j2, c, msg)
+
+ msg = base_msg.format('return_inverse and return_counts', dt)
+ v, j1, j2 = unique(a, 0, 1, 1)
+ assert_array_equal(v, b, msg)
+ assert_array_equal(j1, i2, msg)
+ assert_array_equal(j2, c, msg)
+
+ msg = base_msg.format(('return_index, return_inverse '
+ 'and return_counts'), dt)
+ v, j1, j2, j3 = unique(a, 1, 1, 1)
assert_array_equal(v, b, msg)
assert_array_equal(j1, i1, msg)
assert_array_equal(j2, i2, msg)
+ assert_array_equal(j3, c, msg)
a = [5, 7, 1, 2, 1, 5, 7]*10
b = [1, 2, 5, 7]
i1 = [2, 3, 0, 1]
i2 = [2, 3, 0, 1, 0, 2, 3]*10
+ c = np.multiply([2, 1, 2, 2], 10)
# test for numeric arrays
types = []
@@ -49,7 +77,7 @@ class TestSetOps(TestCase):
for dt in types:
aa = np.array(a, dt)
bb = np.array(b, dt)
- check_all(aa, bb, i1, i2, dt)
+ check_all(aa, bb, i1, i2, c, dt)
# test for object arrays
dt = 'O'
@@ -57,13 +85,27 @@ class TestSetOps(TestCase):
aa[:] = a
bb = np.empty(len(b), dt)
bb[:] = b
- check_all(aa, bb, i1, i2, dt)
+ check_all(aa, bb, i1, i2, c, dt)
# test for structured arrays
dt = [('', 'i'), ('', 'i')]
aa = np.array(list(zip(a, a)), dt)
bb = np.array(list(zip(b, b)), dt)
- check_all(aa, bb, i1, i2, dt)
+ check_all(aa, bb, i1, i2, c, dt)
+
+ # test for ticket #2799
+ aa = [1.+0.j, 1- 1.j, 1]
+ assert_array_equal(np.unique(aa), [ 1.-1.j, 1.+0.j])
+
+ # test for ticket #4785
+ a = [(1, 2), (1, 2), (2, 3)]
+ unq = [1, 2, 3]
+ inv = [0, 1, 0, 1, 1, 2]
+ a1 = unique(a)
+ assert_array_equal(a1, unq)
+ a2, a2_inv = unique(a, return_inverse=True)
+ assert_array_equal(a2, unq)
+ assert_array_equal(a2_inv, inv)
def test_intersect1d(self):
# unique inputs
diff --git a/numpy/lib/tests/test_financial.py b/numpy/lib/tests/test_financial.py
index 6b7c6ef53..41a060a3f 100644
--- a/numpy/lib/tests/test_financial.py
+++ b/numpy/lib/tests/test_financial.py
@@ -13,6 +13,21 @@ class TestFinancial(TestCase):
v = [-150000, 15000, 25000, 35000, 45000, 60000]
assert_almost_equal(np.irr(v),
0.0524, 2)
+ v = [-100, 0, 0, 74]
+ assert_almost_equal(np.irr(v),
+ -0.0955, 2)
+ v = [-100, 39, 59, 55, 20]
+ assert_almost_equal(np.irr(v),
+ 0.28095, 2)
+ v = [-100, 100, 0, -7]
+ assert_almost_equal(np.irr(v),
+ -0.0833, 2)
+ v = [-100, 100, 0, 7]
+ assert_almost_equal(np.irr(v),
+ 0.06206, 2)
+ v = [-5, 10.5, 1, -8, 1]
+ assert_almost_equal(np.irr(v),
+ 0.0886, 2)
def test_pv(self):
assert_almost_equal(np.pv(0.07, 20, 12000, 0),
diff --git a/numpy/lib/tests/test_format.py b/numpy/lib/tests/test_format.py
index b9be643c8..1034b5125 100644
--- a/numpy/lib/tests/test_format.py
+++ b/numpy/lib/tests/test_format.py
@@ -280,6 +280,7 @@ import sys
import os
import shutil
import tempfile
+import warnings
from io import BytesIO
import numpy as np
@@ -521,19 +522,71 @@ def test_compressed_roundtrip():
assert_array_equal(arr, arr1)
-def test_write_version_1_0():
+def test_version_2_0():
+ f = BytesIO()
+ # requires more than 2 byte for header
+ dt = [(("%d" % i) * 100, float) for i in range(500)]
+ d = np.ones(1000, dtype=dt)
+
+ format.write_array(f, d, version=(2, 0))
+ with warnings.catch_warnings(record=True) as w:
+ warnings.filterwarnings('always', '', UserWarning)
+ format.write_array(f, d)
+ assert_(w[0].category is UserWarning)
+
+ f.seek(0)
+ n = format.read_array(f)
+ assert_array_equal(d, n)
+
+ # 1.0 requested but data cannot be saved this way
+ assert_raises(ValueError, format.write_array, f, d, (1, 0))
+
+
+def test_version_2_0_memmap():
+ # requires more than 2 byte for header
+ dt = [(("%d" % i) * 100, float) for i in range(500)]
+ d = np.ones(1000, dtype=dt)
+ tf = tempfile.mktemp('', 'mmap', dir=tempdir)
+
+ # 1.0 requested but data cannot be saved this way
+ assert_raises(ValueError, format.open_memmap, tf, mode='w+', dtype=d.dtype,
+ shape=d.shape, version=(1, 0))
+
+ ma = format.open_memmap(tf, mode='w+', dtype=d.dtype,
+ shape=d.shape, version=(2, 0))
+ ma[...] = d
+ del ma
+
+ with warnings.catch_warnings(record=True) as w:
+ warnings.filterwarnings('always', '', UserWarning)
+ ma = format.open_memmap(tf, mode='w+', dtype=d.dtype,
+ shape=d.shape, version=None)
+ assert_(w[0].category is UserWarning)
+ ma[...] = d
+ del ma
+
+ ma = format.open_memmap(tf, mode='r')
+ assert_array_equal(ma, d)
+
+
+def test_write_version():
f = BytesIO()
arr = np.arange(1)
# These should pass.
format.write_array(f, arr, version=(1, 0))
format.write_array(f, arr)
+ format.write_array(f, arr, version=None)
+ format.write_array(f, arr)
+
+ format.write_array(f, arr, version=(2, 0))
+ format.write_array(f, arr)
+
# These should all fail.
bad_versions = [
(1, 1),
(0, 0),
(0, 1),
- (2, 0),
(2, 2),
(255, 255),
]
@@ -620,5 +673,32 @@ def test_bad_header():
format.write_array_header_1_0(s, d)
assert_raises(ValueError, format.read_array_header_1_0, s)
+
+def test_large_file_support():
+ from nose import SkipTest
+ # try creating a large sparse file
+ with tempfile.NamedTemporaryFile() as tf:
+ try:
+ # seek past end would work too, but linux truncate somewhat
+ # increases the chances that we have a sparse filesystem and can
+ # avoid actually writing 5GB
+ import subprocess as sp
+ sp.check_call(["truncate", "-s", "5368709120", tf.name])
+ except:
+ raise SkipTest("Could not create 5GB large file")
+ # write a small array to the end
+ f = open(tf.name, "wb")
+ f.seek(5368709120)
+ d = np.arange(5)
+ np.save(f, d)
+ f.close()
+ # read it back
+ f = open(tf.name, "rb")
+ f.seek(5368709120)
+ r = np.load(f)
+ f.close()
+ assert_array_equal(r, d)
+
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py
index 494b512f7..ac677a308 100644
--- a/numpy/lib/tests/test_function_base.py
+++ b/numpy/lib/tests/test_function_base.py
@@ -6,7 +6,7 @@ import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_array_equal,
assert_almost_equal, assert_array_almost_equal, assert_raises,
- assert_allclose, assert_array_max_ulp, assert_warns
+ assert_allclose, assert_array_max_ulp, assert_warns, assert_raises_regex
)
from numpy.random import rand
from numpy.lib import *
@@ -150,6 +150,13 @@ class TestAverage(TestCase):
class TestSelect(TestCase):
+ choices = [np.array([1, 2, 3]),
+ np.array([4, 5, 6]),
+ np.array([7, 8, 9])]
+ conditions = [np.array([False, False, False]),
+ np.array([False, True, False]),
+ np.array([False, False, True])]
+
def _select(self, cond, values, default=0):
output = []
for m in range(len(cond)):
@@ -157,18 +164,62 @@ class TestSelect(TestCase):
return output
def test_basic(self):
- choices = [np.array([1, 2, 3]),
- np.array([4, 5, 6]),
- np.array([7, 8, 9])]
- conditions = [np.array([0, 0, 0]),
- np.array([0, 1, 0]),
- np.array([0, 0, 1])]
+ choices = self.choices
+ conditions = self.conditions
assert_array_equal(select(conditions, choices, default=15),
self._select(conditions, choices, default=15))
assert_equal(len(choices), 3)
assert_equal(len(conditions), 3)
+ def test_broadcasting(self):
+ conditions = [np.array(True), np.array([False, True, False])]
+ choices = [1, np.arange(12).reshape(4, 3)]
+ assert_array_equal(select(conditions, choices), np.ones((4, 3)))
+ # default can broadcast too:
+ assert_equal(select([True], [0], default=[0]).shape, (1,))
+
+ def test_return_dtype(self):
+ assert_equal(select(self.conditions, self.choices, 1j).dtype,
+ np.complex_)
+ # But the conditions need to be stronger then the scalar default
+ # if it is scalar.
+ choices = [choice.astype(np.int8) for choice in self.choices]
+ assert_equal(select(self.conditions, choices).dtype, np.int8)
+
+ d = np.array([1, 2, 3, np.nan, 5, 7])
+ m = np.isnan(d)
+ assert_equal(select([m], [d]), [0, 0, 0, np.nan, 0, 0])
+
+ def test_deprecated_empty(self):
+ with warnings.catch_warnings(record=True):
+ warnings.simplefilter("always")
+ assert_equal(select([], [], 3j), 3j)
+
+ with warnings.catch_warnings():
+ warnings.simplefilter("always")
+ assert_warns(DeprecationWarning, select, [], [])
+ warnings.simplefilter("error")
+ assert_raises(DeprecationWarning, select, [], [])
+
+ def test_non_bool_deprecation(self):
+ choices = self.choices
+ conditions = self.conditions[:]
+ with warnings.catch_warnings():
+ warnings.filterwarnings("always")
+ conditions[0] = conditions[0].astype(np.int_)
+ assert_warns(DeprecationWarning, select, conditions, choices)
+ conditions[0] = conditions[0].astype(np.uint8)
+ assert_warns(DeprecationWarning, select, conditions, choices)
+ warnings.filterwarnings("error")
+ assert_raises(DeprecationWarning, select, conditions, choices)
+
+ def test_many_arguments(self):
+ # This used to be limited by NPY_MAXARGS == 32
+ conditions = [np.array([False])] * 100
+ choices = [np.array([1])] * 100
+ select(conditions, choices)
+
class TestInsert(TestCase):
def test_basic(self):
@@ -249,7 +300,7 @@ class TestInsert(TestCase):
assert_(isinstance(np.insert(a, [], []), SubClass))
assert_(isinstance(np.insert(a, [0, 1], [1, 2]), SubClass))
assert_(isinstance(np.insert(a, slice(1, 2), [1, 2]), SubClass))
- assert_(isinstance(np.insert(a, slice(1, -2), []), SubClass))
+ assert_(isinstance(np.insert(a, slice(1, -2, -1), []), SubClass))
# This is an error in the future:
a = np.array(1).view(SubClass)
assert_(isinstance(np.insert(a, 0, [0]), SubClass))
@@ -721,6 +772,12 @@ class TestVectorize(TestCase):
assert_array_equal(f(x), x*x)
assert_equal(_calls[0], len(x))
+ def test_otypes(self):
+ f = np.vectorize(lambda x: x)
+ f.otypes = 'i'
+ x = np.arange(5)
+ assert_array_equal(f(x), x)
+
class TestDigitize(TestCase):
def test_forward(self):
@@ -761,6 +818,22 @@ class TestDigitize(TestCase):
bins = np.linspace(x.min(), x.max(), 10)
assert_(np.all(digitize(x, bins, True) != 10))
+ def test_monotonic(self):
+ x = [-1, 0, 1, 2]
+ bins = [0, 0, 1]
+ assert_array_equal(digitize(x, bins, False), [0, 2, 3, 3])
+ assert_array_equal(digitize(x, bins, True), [0, 0, 2, 3])
+ bins = [1, 1, 0]
+ assert_array_equal(digitize(x, bins, False), [3, 2, 0, 0])
+ assert_array_equal(digitize(x, bins, True), [3, 3, 2, 0])
+ bins = [1, 1, 1, 1]
+ assert_array_equal(digitize(x, bins, False), [0, 0, 4, 4])
+ assert_array_equal(digitize(x, bins, True), [0, 0, 0, 4])
+ bins = [0, 0, 1, 0]
+ assert_raises(ValueError, digitize, x, bins)
+ bins = [1, 1, 0, 1]
+ assert_raises(ValueError, digitize, x, bins)
+
class TestUnwrap(TestCase):
def test_simple(self):
@@ -997,6 +1070,13 @@ class TestHistogram(TestCase):
h, b = histogram(a, weights=np.ones(10, float))
assert_(issubdtype(h.dtype, float))
+ def test_f32_rounding(self):
+ # gh-4799, check that the rounding of the edges works with float32
+ x = np.array([276.318359 , -69.593948 , 21.329449], dtype=np.float32)
+ y = np.array([5005.689453, 4481.327637, 6010.369629], dtype=np.float32)
+ counts_hist, xedges, yedges = np.histogram2d(x, y, bins=100)
+ assert_equal(counts_hist.sum(), 3.)
+
def test_weights(self):
v = rand(100)
w = np.ones(100) * 5
@@ -1139,6 +1219,30 @@ class TestHistogramdd(TestCase):
h, e = np.histogramdd(x, bins=[3, [-np.inf, 3, np.inf]])
assert_allclose(h, expected)
+ def test_rightmost_binedge(self):
+ """Test event very close to rightmost binedge.
+ See Github issue #4266"""
+ x = [0.9999999995]
+ bins = [[0.,0.5,1.0]]
+ hist, _ = histogramdd(x, bins=bins)
+ assert_(hist[0] == 0.0)
+ assert_(hist[1] == 1.)
+ x = [1.0]
+ bins = [[0.,0.5,1.0]]
+ hist, _ = histogramdd(x, bins=bins)
+ assert_(hist[0] == 0.0)
+ assert_(hist[1] == 1.)
+ x = [1.0000000001]
+ bins = [[0.,0.5,1.0]]
+ hist, _ = histogramdd(x, bins=bins)
+ assert_(hist[0] == 0.0)
+ assert_(hist[1] == 1.)
+ x = [1.0001]
+ bins = [[0.,0.5,1.0]]
+ hist, _ = histogramdd(x, bins=bins)
+ assert_(hist[0] == 0.0)
+ assert_(hist[1] == 0.0)
+
class TestUnique(TestCase):
def test_simple(self):
@@ -1188,6 +1292,10 @@ class TestCorrCoef(TestCase):
[0.66318558, 0.88157256, 0.71483595, -0.51366032, 1., 0.98317823],
[0.51532523, 0.78052386, 0.83053601, -0.66173113, 0.98317823, 1.]])
+ def test_non_array(self):
+ assert_almost_equal(np.corrcoef([0, 1, 0], [1, 0, 1]),
+ [[1., -1.], [-1., 1.]])
+
def test_simple(self):
assert_almost_equal(corrcoef(self.A), self.res1)
assert_almost_equal(corrcoef(self.A, self.B), self.res2)
@@ -1206,8 +1314,8 @@ class TestCorrCoef(TestCase):
assert_allclose(np.corrcoef(x, y), np.array([[1., -1.j], [1.j, 1.]]))
def test_empty(self):
- with warnings.catch_warnings():
- warnings.simplefilter('ignore', RuntimeWarning)
+ with warnings.catch_warnings(record=True):
+ warnings.simplefilter('always', RuntimeWarning)
assert_array_equal(corrcoef(np.array([])), np.nan)
assert_array_equal(corrcoef(np.array([]).reshape(0, 2)),
np.array([]).reshape(0, 0))
@@ -1216,8 +1324,8 @@ class TestCorrCoef(TestCase):
def test_wrong_ddof(self):
x = np.array([[0, 2], [1, 1], [2, 0]]).T
- with warnings.catch_warnings():
- warnings.simplefilter('ignore', RuntimeWarning)
+ with warnings.catch_warnings(record=True):
+ warnings.simplefilter('always', RuntimeWarning)
assert_array_equal(corrcoef(x, ddof=5),
np.array([[np.nan, np.nan], [np.nan, np.nan]]))
@@ -1237,8 +1345,8 @@ class TestCov(TestCase):
assert_allclose(cov(x, y), np.array([[1., -1.j], [1.j, 1.]]))
def test_empty(self):
- with warnings.catch_warnings():
- warnings.simplefilter('ignore', RuntimeWarning)
+ with warnings.catch_warnings(record=True):
+ warnings.simplefilter('always', RuntimeWarning)
assert_array_equal(cov(np.array([])), np.nan)
assert_array_equal(cov(np.array([]).reshape(0, 2)),
np.array([]).reshape(0, 0))
@@ -1247,8 +1355,8 @@ class TestCov(TestCase):
def test_wrong_ddof(self):
x = np.array([[0, 2], [1, 1], [2, 0]]).T
- with warnings.catch_warnings():
- warnings.simplefilter('ignore', RuntimeWarning)
+ with warnings.catch_warnings(record=True):
+ warnings.simplefilter('always', RuntimeWarning)
assert_array_equal(cov(x, ddof=5),
np.array([[np.inf, -np.inf], [-np.inf, np.inf]]))
@@ -1353,6 +1461,13 @@ class TestMeshgrid(TestCase):
assert_array_equal(X, np.array([[1, 2, 3]]))
assert_array_equal(Y, np.array([[4], [5], [6], [7]]))
+ def test_invalid_arguments(self):
+ # Test that meshgrid complains about invalid arguments
+ # Regression test for issue #4755:
+ # https://github.com/numpy/numpy/issues/4755
+ assert_raises(TypeError, meshgrid,
+ [1, 2, 3], [4, 5, 6, 7], indices='ij')
+
class TestPiecewise(TestCase):
def test_simple(self):
@@ -1379,6 +1494,7 @@ class TestPiecewise(TestCase):
x = piecewise([0, 0], [[False, True]], [lambda x:-1])
assert_array_equal(x, [0, -1])
+ def test_two_conditions(self):
x = piecewise([1, 2], [[True, False], [False, True]], [3, 4])
assert_array_equal(x, [3, 4])
@@ -1397,6 +1513,15 @@ class TestPiecewise(TestCase):
assert_(y.ndim == 0)
assert_(y == 0)
+ x = 5
+ y = piecewise(x, [[True], [False]], [1, 0])
+ assert_(y.ndim == 0)
+ assert_(y == 1)
+
+ def test_0d_comparison(self):
+ x = 3
+ y = piecewise(x, [x <= 3, x > 3], [4, 0])
+
class TestBincount(TestCase):
def test_simple(self):
@@ -1445,6 +1570,23 @@ class TestBincount(TestCase):
y = np.bincount(x, minlength=5)
assert_array_equal(y, np.zeros(5, dtype=int))
+ def test_with_incorrect_minlength(self):
+ x = np.array([], dtype=int)
+ assert_raises_regex(TypeError, "an integer is required",
+ lambda: np.bincount(x, minlength="foobar"))
+ assert_raises_regex(ValueError, "must be positive",
+ lambda: np.bincount(x, minlength=-1))
+ assert_raises_regex(ValueError, "must be positive",
+ lambda: np.bincount(x, minlength=0))
+
+ x = np.arange(5)
+ assert_raises_regex(TypeError, "an integer is required",
+ lambda: np.bincount(x, minlength="foobar"))
+ assert_raises_regex(ValueError, "minlength must be positive",
+ lambda: np.bincount(x, minlength=-1))
+ assert_raises_regex(ValueError, "minlength must be positive",
+ lambda: np.bincount(x, minlength=0))
+
class TestInterp(TestCase):
def test_exceptions(self):
@@ -1474,6 +1616,8 @@ class TestInterp(TestCase):
assert_almost_equal(np.interp(x0, x, y), x0)
x0 = np.float64(.3)
assert_almost_equal(np.interp(x0, x, y), x0)
+ x0 = np.nan
+ assert_almost_equal(np.interp(x0, x, y), x0)
def test_zero_dimensional_interpolation_point(self):
x = np.linspace(0, 1, 5)
@@ -1636,6 +1780,8 @@ class TestScoreatpercentile(TestCase):
interpolation='foobar')
assert_raises(ValueError, np.percentile, [1], 101)
assert_raises(ValueError, np.percentile, [1], -1)
+ assert_raises(ValueError, np.percentile, [1], list(range(50)) + [101])
+ assert_raises(ValueError, np.percentile, [1], list(range(50)) + [-0.1])
def test_percentile_list(self):
assert_equal(np.percentile([1, 2, 3], 0), 1)
@@ -1727,6 +1873,65 @@ class TestScoreatpercentile(TestCase):
b = np.percentile([2, 3, 4, 1], [50], overwrite_input=True)
assert_equal(b, np.array([2.5]))
+ def test_extended_axis(self):
+ o = np.random.normal(size=(71, 23))
+ x = np.dstack([o] * 10)
+ assert_equal(np.percentile(x, 30, axis=(0, 1)), np.percentile(o, 30))
+ x = np.rollaxis(x, -1, 0)
+ assert_equal(np.percentile(x, 30, axis=(-2, -1)), np.percentile(o, 30))
+ x = x.swapaxes(0, 1).copy()
+ assert_equal(np.percentile(x, 30, axis=(0, -1)), np.percentile(o, 30))
+ x = x.swapaxes(0, 1).copy()
+
+ assert_equal(np.percentile(x, [25, 60], axis=(0, 1, 2)),
+ np.percentile(x, [25, 60], axis=None))
+ assert_equal(np.percentile(x, [25, 60], axis=(0,)),
+ np.percentile(x, [25, 60], axis=0))
+
+ d = np.arange(3 * 5 * 7 * 11).reshape(3, 5, 7, 11)
+ np.random.shuffle(d)
+ assert_equal(np.percentile(d, 25, axis=(0, 1, 2))[0],
+ np.percentile(d[:, :, :, 0].flatten(), 25))
+ assert_equal(np.percentile(d, [10, 90], axis=(0, 1, 3))[:, 1],
+ np.percentile(d[:, :, 1, :].flatten(), [10, 90]))
+ assert_equal(np.percentile(d, 25, axis=(3, 1, -4))[2],
+ np.percentile(d[:, :, 2, :].flatten(), 25))
+ assert_equal(np.percentile(d, 25, axis=(3, 1, 2))[2],
+ np.percentile(d[2, :, :, :].flatten(), 25))
+ assert_equal(np.percentile(d, 25, axis=(3, 2))[2, 1],
+ np.percentile(d[2, 1, :, :].flatten(), 25))
+ assert_equal(np.percentile(d, 25, axis=(1, -2))[2, 1],
+ np.percentile(d[2, :, :, 1].flatten(), 25))
+ assert_equal(np.percentile(d, 25, axis=(1, 3))[2, 2],
+ np.percentile(d[2, :, 2, :].flatten(), 25))
+
+ def test_extended_axis_invalid(self):
+ d = np.ones((3, 5, 7, 11))
+ assert_raises(IndexError, np.percentile, d, axis=-5, q=25)
+ assert_raises(IndexError, np.percentile, d, axis=(0, -5), q=25)
+ assert_raises(IndexError, np.percentile, d, axis=4, q=25)
+ assert_raises(IndexError, np.percentile, d, axis=(0, 4), q=25)
+ assert_raises(ValueError, np.percentile, d, axis=(1, 1), q=25)
+
+ def test_keepdims(self):
+ d = np.ones((3, 5, 7, 11))
+ assert_equal(np.percentile(d, 7, axis=None, keepdims=True).shape,
+ (1, 1, 1, 1))
+ assert_equal(np.percentile(d, 7, axis=(0, 1), keepdims=True).shape,
+ (1, 1, 7, 11))
+ assert_equal(np.percentile(d, 7, axis=(0, 3), keepdims=True).shape,
+ (1, 5, 7, 1))
+ assert_equal(np.percentile(d, 7, axis=(1,), keepdims=True).shape,
+ (3, 1, 7, 11))
+ assert_equal(np.percentile(d, 7, (0, 1, 2, 3), keepdims=True).shape,
+ (1, 1, 1, 1))
+ assert_equal(np.percentile(d, 7, axis=(0, 1, 3), keepdims=True).shape,
+ (1, 1, 7, 1))
+
+ assert_equal(np.percentile(d, [1, 7], axis=(0, 1, 3),
+ keepdims=True).shape, (2, 1, 1, 7, 1))
+ assert_equal(np.percentile(d, [1, 7], axis=(0, 3),
+ keepdims=True).shape, (2, 1, 5, 7, 1))
class TestMedian(TestCase):
@@ -1734,19 +1939,23 @@ class TestMedian(TestCase):
a0 = np.array(1)
a1 = np.arange(2)
a2 = np.arange(6).reshape(2, 3)
- assert_allclose(np.median(a0), 1)
+ assert_equal(np.median(a0), 1)
assert_allclose(np.median(a1), 0.5)
assert_allclose(np.median(a2), 2.5)
assert_allclose(np.median(a2, axis=0), [1.5, 2.5, 3.5])
- assert_allclose(np.median(a2, axis=1), [1, 4])
+ assert_equal(np.median(a2, axis=1), [1, 4])
assert_allclose(np.median(a2, axis=None), 2.5)
a = np.array([0.0444502, 0.0463301, 0.141249, 0.0606775])
assert_almost_equal((a[1] + a[3]) / 2., np.median(a))
a = np.array([0.0463301, 0.0444502, 0.141249])
- assert_almost_equal(a[0], np.median(a))
+ assert_equal(a[0], np.median(a))
a = np.array([0.0444502, 0.141249, 0.0463301])
- assert_almost_equal(a[-1], np.median(a))
+ assert_equal(a[-1], np.median(a))
+ # check array scalar result
+ assert_equal(np.median(a).ndim, 0)
+ a[1] = np.nan
+ assert_equal(np.median(a).ndim, 0)
def test_axis_keyword(self):
a3 = np.array([[2, 3],
@@ -1820,6 +2029,66 @@ class TestMedian(TestCase):
a = MySubClass([1,2,3])
assert_equal(np.median(a), -7)
+ def test_object(self):
+ o = np.arange(7.);
+ assert_(type(np.median(o.astype(object))), float)
+ o[2] = np.nan
+ assert_(type(np.median(o.astype(object))), float)
+
+ def test_extended_axis(self):
+ o = np.random.normal(size=(71, 23))
+ x = np.dstack([o] * 10)
+ assert_equal(np.median(x, axis=(0, 1)), np.median(o))
+ x = np.rollaxis(x, -1, 0)
+ assert_equal(np.median(x, axis=(-2, -1)), np.median(o))
+ x = x.swapaxes(0, 1).copy()
+ assert_equal(np.median(x, axis=(0, -1)), np.median(o))
+
+ assert_equal(np.median(x, axis=(0, 1, 2)), np.median(x, axis=None))
+ assert_equal(np.median(x, axis=(0, )), np.median(x, axis=0))
+ assert_equal(np.median(x, axis=(-1, )), np.median(x, axis=-1))
+
+ d = np.arange(3 * 5 * 7 * 11).reshape(3, 5, 7, 11)
+ np.random.shuffle(d)
+ assert_equal(np.median(d, axis=(0, 1, 2))[0],
+ np.median(d[:, :, :, 0].flatten()))
+ assert_equal(np.median(d, axis=(0, 1, 3))[1],
+ np.median(d[:, :, 1, :].flatten()))
+ assert_equal(np.median(d, axis=(3, 1, -4))[2],
+ np.median(d[:, :, 2, :].flatten()))
+ assert_equal(np.median(d, axis=(3, 1, 2))[2],
+ np.median(d[2, :, :, :].flatten()))
+ assert_equal(np.median(d, axis=(3, 2))[2, 1],
+ np.median(d[2, 1, :, :].flatten()))
+ assert_equal(np.median(d, axis=(1, -2))[2, 1],
+ np.median(d[2, :, :, 1].flatten()))
+ assert_equal(np.median(d, axis=(1, 3))[2, 2],
+ np.median(d[2, :, 2, :].flatten()))
+
+ def test_extended_axis_invalid(self):
+ d = np.ones((3, 5, 7, 11))
+ assert_raises(IndexError, np.median, d, axis=-5)
+ assert_raises(IndexError, np.median, d, axis=(0, -5))
+ assert_raises(IndexError, np.median, d, axis=4)
+ assert_raises(IndexError, np.median, d, axis=(0, 4))
+ assert_raises(ValueError, np.median, d, axis=(1, 1))
+
+ def test_keepdims(self):
+ d = np.ones((3, 5, 7, 11))
+ assert_equal(np.median(d, axis=None, keepdims=True).shape,
+ (1, 1, 1, 1))
+ assert_equal(np.median(d, axis=(0, 1), keepdims=True).shape,
+ (1, 1, 7, 11))
+ assert_equal(np.median(d, axis=(0, 3), keepdims=True).shape,
+ (1, 5, 7, 1))
+ assert_equal(np.median(d, axis=(1,), keepdims=True).shape,
+ (3, 1, 7, 11))
+ assert_equal(np.median(d, axis=(0, 1, 2, 3), keepdims=True).shape,
+ (1, 1, 1, 1))
+ assert_equal(np.median(d, axis=(0, 1, 3), keepdims=True).shape,
+ (1, 1, 7, 1))
+
+
class TestAdd_newdoc_ufunc(TestCase):
diff --git a/numpy/lib/tests/test_io.py b/numpy/lib/tests/test_io.py
index e3ccb391c..03e238261 100644
--- a/numpy/lib/tests/test_io.py
+++ b/numpy/lib/tests/test_io.py
@@ -4,7 +4,7 @@ import sys
import gzip
import os
import threading
-from tempfile import mkstemp, mktemp, NamedTemporaryFile
+from tempfile import mkstemp, NamedTemporaryFile
import time
import warnings
import gc
@@ -17,9 +17,12 @@ from numpy.lib._iotools import (ConverterError, ConverterLockError,
ConversionWarning)
from numpy.compat import asbytes, asbytes_nested, bytes, asstr
from nose import SkipTest
-from numpy.ma.testutils import (TestCase, assert_equal, assert_array_equal,
- assert_raises, run_module_suite)
+from numpy.ma.testutils import (
+ TestCase, assert_equal, assert_array_equal,
+ assert_raises, assert_raises_regex, run_module_suite
+)
from numpy.testing import assert_warns, assert_, build_err_msg
+from numpy.testing.utils import tempdir
class TextIO(BytesIO):
@@ -77,32 +80,32 @@ class RoundtripTest(object):
file_on_disk = kwargs.get('file_on_disk', False)
if file_on_disk:
- # Do not delete the file on windows, because we can't
- # reopen an already opened file on that platform, so we
- # need to close the file and reopen it, implying no
- # automatic deletion.
- if sys.platform == 'win32' and MAJVER >= 2 and MINVER >= 6:
- target_file = NamedTemporaryFile(delete=False)
- else:
- target_file = NamedTemporaryFile()
+ target_file = NamedTemporaryFile(delete=False)
load_file = target_file.name
else:
target_file = BytesIO()
load_file = target_file
- arr = args
+ try:
+ arr = args
- save_func(target_file, *arr, **save_kwds)
- target_file.flush()
- target_file.seek(0)
+ save_func(target_file, *arr, **save_kwds)
+ target_file.flush()
+ target_file.seek(0)
- if sys.platform == 'win32' and not isinstance(target_file, BytesIO):
- target_file.close()
+ if sys.platform == 'win32' and not isinstance(target_file, BytesIO):
+ target_file.close()
- arr_reloaded = np.load(load_file, **load_kwds)
+ arr_reloaded = np.load(load_file, **load_kwds)
- self.arr = arr
- self.arr_reloaded = arr_reloaded
+ self.arr = arr
+ self.arr_reloaded = arr_reloaded
+ finally:
+ if not isinstance(target_file, BytesIO):
+ target_file.close()
+ # holds an open file descriptor so it can't be deleted on win
+ if not isinstance(arr_reloaded, np.lib.npyio.NpzFile):
+ os.remove(target_file.name)
def check_roundtrips(self, a):
self.roundtrip(a)
@@ -155,6 +158,13 @@ class RoundtripTest(object):
a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')])
self.check_roundtrips(a)
+ def test_format_2_0(self):
+ dt = [(("%d" % i) * 100, float) for i in range(500)]
+ a = np.ones(1000, dtype=dt)
+ with warnings.catch_warnings(record=True):
+ warnings.filterwarnings('always', '', UserWarning)
+ self.check_roundtrips(a)
+
class TestSaveLoad(RoundtripTest, TestCase):
def roundtrip(self, *args, **kwargs):
@@ -167,24 +177,30 @@ class TestSaveLoad(RoundtripTest, TestCase):
class TestSavezLoad(RoundtripTest, TestCase):
def roundtrip(self, *args, **kwargs):
RoundtripTest.roundtrip(self, np.savez, *args, **kwargs)
- for n, arr in enumerate(self.arr):
- reloaded = self.arr_reloaded['arr_%d' % n]
- assert_equal(arr, reloaded)
- assert_equal(arr.dtype, reloaded.dtype)
- assert_equal(arr.flags.fnc, reloaded.flags.fnc)
+ try:
+ for n, arr in enumerate(self.arr):
+ reloaded = self.arr_reloaded['arr_%d' % n]
+ assert_equal(arr, reloaded)
+ assert_equal(arr.dtype, reloaded.dtype)
+ assert_equal(arr.flags.fnc, reloaded.flags.fnc)
+ finally:
+ # delete tempfile, must be done here on windows
+ if self.arr_reloaded.fid:
+ self.arr_reloaded.fid.close()
+ os.remove(self.arr_reloaded.fid.name)
@np.testing.dec.skipif(not IS_64BIT, "Works only with 64bit systems")
@np.testing.dec.slow
def test_big_arrays(self):
L = (1 << 31) + 100000
- tmp = mktemp(suffix='.npz')
a = np.empty(L, dtype=np.uint8)
- np.savez(tmp, a=a)
- del a
- npfile = np.load(tmp)
- a = npfile['a']
- npfile.close()
- os.remove(tmp)
+ with tempdir(prefix="numpy_test_big_arrays_") as tmpdir:
+ tmp = os.path.join(tmpdir, "file.npz")
+ np.savez(tmp, a=a)
+ del a
+ npfile = np.load(tmp)
+ a = npfile['a']
+ npfile.close()
def test_multiple_arrays(self):
a = np.array([[1, 2], [3, 4]], float)
@@ -287,13 +303,14 @@ class TestSavezLoad(RoundtripTest, TestCase):
# Check that zipfile owns file and can close it.
# This needs to pass a file name to load for the
# test.
- fd, tmp = mkstemp(suffix='.npz')
- os.close(fd)
- np.savez(tmp, lab='place holder')
- data = np.load(tmp)
- fp = data.zip.fp
- data.close()
- assert_(fp.closed)
+ with tempdir(prefix="numpy_test_closing_zipfile_after_load_") as tmpdir:
+ fd, tmp = mkstemp(suffix='.npz', dir=tmpdir)
+ os.close(fd)
+ np.savez(tmp, lab='place holder')
+ data = np.load(tmp)
+ fp = data.zip.fp
+ data.close()
+ assert_(fp.closed)
class TestSaveTxt(TestCase):
@@ -750,6 +767,14 @@ class TestLoadTxt(TestCase):
res = np.loadtxt(count())
assert_array_equal(res, np.arange(10))
+ def test_bad_line(self):
+ c = TextIO()
+ c.write('1 2 3\n4 5 6\n2 3')
+ c.seek(0)
+
+ # Check for exception and that exception contains line number
+ assert_raises_regex(ValueError, "3", np.loadtxt, c)
+
class Testfromregex(TestCase):
# np.fromregex expects files opened in binary mode.
@@ -1563,6 +1588,14 @@ M 33 21.99
dtype=[('a', np.int), ('b', np.int)])
self.assertTrue(isinstance(test, np.recarray))
assert_equal(test, control)
+ #
+ data = TextIO('A,B\n0,1\n2,3')
+ dtype = [('a', np.int), ('b', np.float)]
+ test = np.recfromcsv(data, missing_values='N/A', dtype=dtype)
+ control = np.array([(0, 1), (2, 3)],
+ dtype=dtype)
+ self.assertTrue(isinstance(test, np.recarray))
+ assert_equal(test, control)
def test_gft_using_filename(self):
# Test that we can load data from a filename as well as a file object
diff --git a/numpy/lib/tests/test_nanfunctions.py b/numpy/lib/tests/test_nanfunctions.py
index af01a7167..c5af61434 100644
--- a/numpy/lib/tests/test_nanfunctions.py
+++ b/numpy/lib/tests/test_nanfunctions.py
@@ -5,21 +5,21 @@ import warnings
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_almost_equal,
- assert_raises
+ assert_raises, assert_array_equal
)
# Test data
_ndat = np.array([[0.6244, np.nan, 0.2692, 0.0116, np.nan, 0.1170],
- [0.5351, 0.9403, np.nan, 0.2100, 0.4759, 0.2833],
- [np.nan, np.nan, np.nan, 0.1042, np.nan, 0.5954],
+ [0.5351, -0.9403, np.nan, 0.2100, 0.4759, 0.2833],
+ [np.nan, np.nan, np.nan, 0.1042, np.nan, -0.5954],
[0.1610, np.nan, np.nan, 0.1859, 0.3146, np.nan]])
# Rows of _ndat with nans removed
_rdat = [np.array([ 0.6244, 0.2692, 0.0116, 0.1170]),
- np.array([ 0.5351, 0.9403, 0.2100, 0.4759, 0.2833]),
- np.array([ 0.1042, 0.5954]),
+ np.array([ 0.5351, -0.9403, 0.2100, 0.4759, 0.2833]),
+ np.array([ 0.1042, -0.5954]),
np.array([ 0.1610, 0.1859, 0.3146])]
@@ -114,6 +114,31 @@ class TestNanFunctions_MinMax(TestCase):
assert_(res.shape == (3, 1))
res = f(mat)
assert_(np.isscalar(res))
+ # check that rows of nan are dealt with for subclasses (#4628)
+ mat[1] = np.nan
+ for f in self.nanfuncs:
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter('always')
+ res = f(mat, axis=0)
+ assert_(isinstance(res, np.matrix))
+ assert_(not np.any(np.isnan(res)))
+ assert_(len(w) == 0)
+
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter('always')
+ res = f(mat, axis=1)
+ assert_(isinstance(res, np.matrix))
+ assert_(np.isnan(res[1, 0]) and not np.isnan(res[0, 0])
+ and not np.isnan(res[2, 0]))
+ assert_(len(w) == 1, 'no warning raised')
+ assert_(issubclass(w[0].category, RuntimeWarning))
+
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter('always')
+ res = f(mat)
+ assert_(np.isscalar(res))
+ assert_(res != np.nan)
+ assert_(len(w) == 0)
class TestNanFunctions_ArgminArgmax(TestCase):
@@ -130,8 +155,8 @@ class TestNanFunctions_ArgminArgmax(TestCase):
def test_result_values(self):
for f, fcmp in zip(self.nanfuncs, [np.greater, np.less]):
for row in _ndat:
- with warnings.catch_warnings():
- warnings.simplefilter('ignore')
+ with warnings.catch_warnings(record=True):
+ warnings.simplefilter('always')
ind = f(row)
val = row[ind]
# comparing with NaN is tricky as the result
@@ -502,5 +527,232 @@ class TestNanFunctions_MeanVarStd(TestCase):
assert_(np.isscalar(res))
+class TestNanFunctions_Median(TestCase):
+
+ def test_mutation(self):
+ # Check that passed array is not modified.
+ ndat = _ndat.copy()
+ np.nanmedian(ndat)
+ assert_equal(ndat, _ndat)
+
+ def test_keepdims(self):
+ mat = np.eye(3)
+ for axis in [None, 0, 1]:
+ tgt = np.median(mat, axis=axis, out=None, overwrite_input=False)
+ res = np.nanmedian(mat, axis=axis, out=None, overwrite_input=False)
+ assert_(res.ndim == tgt.ndim)
+
+ d = np.ones((3, 5, 7, 11))
+ # Randomly set some elements to NaN:
+ w = np.random.random((4, 200)) * np.array(d.shape)[:, None]
+ w = w.astype(np.intp)
+ d[tuple(w)] = np.nan
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter('always', RuntimeWarning)
+ res = np.nanmedian(d, axis=None, keepdims=True)
+ assert_equal(res.shape, (1, 1, 1, 1))
+ res = np.nanmedian(d, axis=(0, 1), keepdims=True)
+ assert_equal(res.shape, (1, 1, 7, 11))
+ res = np.nanmedian(d, axis=(0, 3), keepdims=True)
+ assert_equal(res.shape, (1, 5, 7, 1))
+ res = np.nanmedian(d, axis=(1,), keepdims=True)
+ assert_equal(res.shape, (3, 1, 7, 11))
+ res = np.nanmedian(d, axis=(0, 1, 2, 3), keepdims=True)
+ assert_equal(res.shape, (1, 1, 1, 1))
+ res = np.nanmedian(d, axis=(0, 1, 3), keepdims=True)
+ assert_equal(res.shape, (1, 1, 7, 1))
+
+ def test_out(self):
+ mat = np.random.rand(3, 3)
+ nan_mat = np.insert(mat, [0, 2], np.nan, axis=1)
+ resout = np.zeros(3)
+ tgt = np.median(mat, axis=1)
+ res = np.nanmedian(nan_mat, axis=1, out=resout)
+ assert_almost_equal(res, resout)
+ assert_almost_equal(res, tgt)
+ # 0-d output:
+ resout = np.zeros(())
+ tgt = np.median(mat, axis=None)
+ res = np.nanmedian(nan_mat, axis=None, out=resout)
+ assert_almost_equal(res, resout)
+ assert_almost_equal(res, tgt)
+ res = np.nanmedian(nan_mat, axis=(0, 1), out=resout)
+ assert_almost_equal(res, resout)
+ assert_almost_equal(res, tgt)
+
+ def test_small_large(self):
+ # test the small and large code paths, current cutoff 400 elements
+ for s in [5, 20, 51, 200, 1000]:
+ d = np.random.randn(4, s)
+ # Randomly set some elements to NaN:
+ w = np.random.randint(0, d.size, size=d.size // 5)
+ d.ravel()[w] = np.nan
+ d[:,0] = 1. # ensure at least one good value
+ # use normal median without nans to compare
+ tgt = []
+ for x in d:
+ nonan = np.compress(~np.isnan(x), x)
+ tgt.append(np.median(nonan, overwrite_input=True))
+
+ assert_array_equal(np.nanmedian(d, axis=-1), tgt)
+
+ def test_result_values(self):
+ tgt = [np.median(d) for d in _rdat]
+ res = np.nanmedian(_ndat, axis=1)
+ assert_almost_equal(res, tgt)
+
+ def test_allnans(self):
+ mat = np.array([np.nan]*9).reshape(3, 3)
+ for axis in [None, 0, 1]:
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter('always')
+ assert_(np.isnan(np.nanmedian(mat, axis=axis)).all())
+ if axis is None:
+ assert_(len(w) == 1)
+ else:
+ assert_(len(w) == 3)
+ assert_(issubclass(w[0].category, RuntimeWarning))
+ # Check scalar
+ assert_(np.isnan(np.nanmedian(np.nan)))
+ if axis is None:
+ assert_(len(w) == 2)
+ else:
+ assert_(len(w) == 4)
+ assert_(issubclass(w[0].category, RuntimeWarning))
+
+ def test_empty(self):
+ mat = np.zeros((0, 3))
+ for axis in [0, None]:
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter('always')
+ assert_(np.isnan(np.nanmedian(mat, axis=axis)).all())
+ assert_(len(w) == 1)
+ assert_(issubclass(w[0].category, RuntimeWarning))
+ for axis in [1]:
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter('always')
+ assert_equal(np.nanmedian(mat, axis=axis), np.zeros([]))
+ assert_(len(w) == 0)
+
+ def test_scalar(self):
+ assert_(np.nanmedian(0.) == 0.)
+
+ def test_extended_axis_invalid(self):
+ d = np.ones((3, 5, 7, 11))
+ assert_raises(IndexError, np.nanmedian, d, axis=-5)
+ assert_raises(IndexError, np.nanmedian, d, axis=(0, -5))
+ assert_raises(IndexError, np.nanmedian, d, axis=4)
+ assert_raises(IndexError, np.nanmedian, d, axis=(0, 4))
+ assert_raises(ValueError, np.nanmedian, d, axis=(1, 1))
+
+
+class TestNanFunctions_Percentile(TestCase):
+
+ def test_mutation(self):
+ # Check that passed array is not modified.
+ ndat = _ndat.copy()
+ np.nanpercentile(ndat, 30)
+ assert_equal(ndat, _ndat)
+
+ def test_keepdims(self):
+ mat = np.eye(3)
+ for axis in [None, 0, 1]:
+ tgt = np.percentile(mat, 70, axis=axis, out=None,
+ overwrite_input=False)
+ res = np.nanpercentile(mat, 70, axis=axis, out=None,
+ overwrite_input=False)
+ assert_(res.ndim == tgt.ndim)
+
+ d = np.ones((3, 5, 7, 11))
+ # Randomly set some elements to NaN:
+ w = np.random.random((4, 200)) * np.array(d.shape)[:, None]
+ w = w.astype(np.intp)
+ d[tuple(w)] = np.nan
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter('always', RuntimeWarning)
+ res = np.nanpercentile(d, 90, axis=None, keepdims=True)
+ assert_equal(res.shape, (1, 1, 1, 1))
+ res = np.nanpercentile(d, 90, axis=(0, 1), keepdims=True)
+ assert_equal(res.shape, (1, 1, 7, 11))
+ res = np.nanpercentile(d, 90, axis=(0, 3), keepdims=True)
+ assert_equal(res.shape, (1, 5, 7, 1))
+ res = np.nanpercentile(d, 90, axis=(1,), keepdims=True)
+ assert_equal(res.shape, (3, 1, 7, 11))
+ res = np.nanpercentile(d, 90, axis=(0, 1, 2, 3), keepdims=True)
+ assert_equal(res.shape, (1, 1, 1, 1))
+ res = np.nanpercentile(d, 90, axis=(0, 1, 3), keepdims=True)
+ assert_equal(res.shape, (1, 1, 7, 1))
+
+ def test_out(self):
+ mat = np.random.rand(3, 3)
+ nan_mat = np.insert(mat, [0, 2], np.nan, axis=1)
+ resout = np.zeros(3)
+ tgt = np.percentile(mat, 42, axis=1)
+ res = np.nanpercentile(nan_mat, 42, axis=1, out=resout)
+ assert_almost_equal(res, resout)
+ assert_almost_equal(res, tgt)
+ # 0-d output:
+ resout = np.zeros(())
+ tgt = np.percentile(mat, 42, axis=None)
+ res = np.nanpercentile(nan_mat, 42, axis=None, out=resout)
+ assert_almost_equal(res, resout)
+ assert_almost_equal(res, tgt)
+ res = np.nanpercentile(nan_mat, 42, axis=(0, 1), out=resout)
+ assert_almost_equal(res, resout)
+ assert_almost_equal(res, tgt)
+
+ def test_result_values(self):
+ tgt = [np.percentile(d, 28) for d in _rdat]
+ res = np.nanpercentile(_ndat, 28, axis=1)
+ assert_almost_equal(res, tgt)
+ tgt = [np.percentile(d, (28, 98)) for d in _rdat]
+ res = np.nanpercentile(_ndat, (28, 98), axis=1)
+ assert_almost_equal(res, tgt)
+
+ def test_allnans(self):
+ mat = np.array([np.nan]*9).reshape(3, 3)
+ for axis in [None, 0, 1]:
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter('always')
+ assert_(np.isnan(np.nanpercentile(mat, 60, axis=axis)).all())
+ if axis is None:
+ assert_(len(w) == 1)
+ else:
+ assert_(len(w) == 3)
+ assert_(issubclass(w[0].category, RuntimeWarning))
+ # Check scalar
+ assert_(np.isnan(np.nanpercentile(np.nan, 60)))
+ if axis is None:
+ assert_(len(w) == 2)
+ else:
+ assert_(len(w) == 4)
+ assert_(issubclass(w[0].category, RuntimeWarning))
+
+ def test_empty(self):
+ mat = np.zeros((0, 3))
+ for axis in [0, None]:
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter('always')
+ assert_(np.isnan(np.nanpercentile(mat, 40, axis=axis)).all())
+ assert_(len(w) == 1)
+ assert_(issubclass(w[0].category, RuntimeWarning))
+ for axis in [1]:
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter('always')
+ assert_equal(np.nanpercentile(mat, 40, axis=axis), np.zeros([]))
+ assert_(len(w) == 0)
+
+ def test_scalar(self):
+ assert_(np.nanpercentile(0., 100) == 0.)
+
+ def test_extended_axis_invalid(self):
+ d = np.ones((3, 5, 7, 11))
+ assert_raises(IndexError, np.nanpercentile, d, q=5, axis=-5)
+ assert_raises(IndexError, np.nanpercentile, d, q=5, axis=(0, -5))
+ assert_raises(IndexError, np.nanpercentile, d, q=5, axis=4)
+ assert_raises(IndexError, np.nanpercentile, d, q=5, axis=(0, 4))
+ assert_raises(ValueError, np.nanpercentile, d, q=5, axis=(1, 1))
+
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/lib/tests/test_stride_tricks.py b/numpy/lib/tests/test_stride_tricks.py
index 4d57d2ca7..3adcf0b41 100644
--- a/numpy/lib/tests/test_stride_tricks.py
+++ b/numpy/lib/tests/test_stride_tricks.py
@@ -3,6 +3,7 @@ from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import *
from numpy.lib.stride_tricks import broadcast_arrays
+from numpy.lib.stride_tricks import as_strided
def assert_shapes_correct(input_shapes, expected_shape):
@@ -214,6 +215,22 @@ def test_same_as_ufunc():
assert_same_as_ufunc(input_shapes[0], input_shapes[1], False, True)
assert_same_as_ufunc(input_shapes[0], input_shapes[1], True, True)
+def test_as_strided():
+ a = np.array([None])
+ a_view = as_strided(a)
+ expected = np.array([None])
+ assert_array_equal(a_view, np.array([None]))
+
+ a = np.array([1, 2, 3, 4])
+ a_view = as_strided(a, shape=(2,), strides=(2 * a.itemsize,))
+ expected = np.array([1, 3])
+ assert_array_equal(a_view, expected)
+
+ a = np.array([1, 2, 3, 4])
+ a_view = as_strided(a, shape=(3, 4), strides=(0, 1 * a.itemsize))
+ expected = np.array([[1, 2, 3, 4], [1, 2, 3, 4], [1, 2, 3, 4]])
+ assert_array_equal(a_view, expected)
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/lib/tests/test_twodim_base.py b/numpy/lib/tests/test_twodim_base.py
index 8d0275a25..f5b8fab4a 100644
--- a/numpy/lib/tests/test_twodim_base.py
+++ b/numpy/lib/tests/test_twodim_base.py
@@ -254,7 +254,7 @@ class TestHistogram2d(TestCase):
assert_array_almost_equal(H, answer, 3)
def test_all_outliers(self):
- r = rand(100)+1.
+ r = rand(100) + 1. + 1e6 # histogramdd rounds by decimal=6
H, xed, yed = histogram2d(r, r, (4, 5), range=([0, 1], [0, 1]))
assert_array_equal(H, 0)
@@ -275,16 +275,41 @@ class TestTri(TestCase):
assert_array_equal(tri(3, dtype=bool), out.astype(bool))
-def test_tril_triu():
+def test_tril_triu_ndim2():
for dtype in np.typecodes['AllFloat'] + np.typecodes['AllInteger']:
a = np.ones((2, 2), dtype=dtype)
b = np.tril(a)
c = np.triu(a)
- assert_array_equal(b, [[1, 0], [1, 1]])
- assert_array_equal(c, b.T)
+ yield assert_array_equal, b, [[1, 0], [1, 1]]
+ yield assert_array_equal, c, b.T
# should return the same dtype as the original array
- assert_equal(b.dtype, a.dtype)
- assert_equal(c.dtype, a.dtype)
+ yield assert_equal, b.dtype, a.dtype
+ yield assert_equal, c.dtype, a.dtype
+
+
+def test_tril_triu_ndim3():
+ for dtype in np.typecodes['AllFloat'] + np.typecodes['AllInteger']:
+ a = np.array([
+ [[1, 1], [1, 1]],
+ [[1, 1], [1, 0]],
+ [[1, 1], [0, 0]],
+ ], dtype=dtype)
+ a_tril_desired = np.array([
+ [[1, 0], [1, 1]],
+ [[1, 0], [1, 0]],
+ [[1, 0], [0, 0]],
+ ], dtype=dtype)
+ a_triu_desired = np.array([
+ [[1, 1], [0, 1]],
+ [[1, 1], [0, 0]],
+ [[1, 1], [0, 0]],
+ ], dtype=dtype)
+ a_triu_observed = np.triu(a)
+ a_tril_observed = np.tril(a)
+ yield assert_array_equal, a_triu_observed, a_triu_desired
+ yield assert_array_equal, a_tril_observed, a_tril_desired
+ yield assert_equal, a_triu_observed.dtype, a.dtype
+ yield assert_equal, a_tril_observed.dtype, a.dtype
def test_mask_indices():
@@ -300,16 +325,21 @@ def test_mask_indices():
def test_tril_indices():
# indices without and with offset
il1 = tril_indices(4)
- il2 = tril_indices(4, 2)
+ il2 = tril_indices(4, k=2)
+ il3 = tril_indices(4, m=5)
+ il4 = tril_indices(4, k=2, m=5)
a = np.array([[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12],
[13, 14, 15, 16]])
+ b = np.arange(1, 21).reshape(4, 5)
# indexing:
yield (assert_array_equal, a[il1],
array([1, 5, 6, 9, 10, 11, 13, 14, 15, 16]))
+ yield (assert_array_equal, b[il3],
+ array([1, 6, 7, 11, 12, 13, 16, 17, 18, 19]))
# And for assigning values:
a[il1] = -1
@@ -318,7 +348,12 @@ def test_tril_indices():
[-1, -1, 7, 8],
[-1, -1, -1, 12],
[-1, -1, -1, -1]]))
-
+ b[il3] = -1
+ yield (assert_array_equal, b,
+ array([[-1, 2, 3, 4, 5],
+ [-1, -1, 8, 9, 10],
+ [-1, -1, -1, 14, 15],
+ [-1, -1, -1, -1, 20]]))
# These cover almost the whole array (two diagonals right of the main one):
a[il2] = -10
yield (assert_array_equal, a,
@@ -326,21 +361,32 @@ def test_tril_indices():
[-10, -10, -10, -10],
[-10, -10, -10, -10],
[-10, -10, -10, -10]]))
+ b[il4] = -10
+ yield (assert_array_equal, b,
+ array([[-10, -10, -10, 4, 5],
+ [-10, -10, -10, -10, 10],
+ [-10, -10, -10, -10, -10],
+ [-10, -10, -10, -10, -10]]))
class TestTriuIndices(object):
def test_triu_indices(self):
iu1 = triu_indices(4)
- iu2 = triu_indices(4, 2)
+ iu2 = triu_indices(4, k=2)
+ iu3 = triu_indices(4, m=5)
+ iu4 = triu_indices(4, k=2, m=5)
a = np.array([[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12],
[13, 14, 15, 16]])
+ b = np.arange(1, 21).reshape(4, 5)
# Both for indexing:
yield (assert_array_equal, a[iu1],
array([1, 2, 3, 4, 6, 7, 8, 11, 12, 16]))
+ yield (assert_array_equal, b[iu3],
+ array([1, 2, 3, 4, 5, 7, 8, 9, 10, 13, 14, 15, 19, 20]))
# And for assigning values:
a[iu1] = -1
@@ -349,6 +395,12 @@ class TestTriuIndices(object):
[5, -1, -1, -1],
[9, 10, -1, -1],
[13, 14, 15, -1]]))
+ b[iu3] = -1
+ yield (assert_array_equal, b,
+ array([[-1, -1, -1, -1, -1],
+ [ 6, -1, -1, -1, -1],
+ [11, 12, -1, -1, -1],
+ [16, 17, 18, -1, -1]]))
# These cover almost the whole array (two diagonals right of the
# main one):
@@ -358,20 +410,26 @@ class TestTriuIndices(object):
[5, -1, -1, -10],
[9, 10, -1, -1],
[13, 14, 15, -1]]))
+ b[iu4] = -10
+ yield (assert_array_equal, b,
+ array([[-1, -1, -10, -10, -10],
+ [6, -1, -1, -10, -10],
+ [11, 12, -1, -1, -10],
+ [16, 17, 18, -1, -1]]))
class TestTrilIndicesFrom(object):
def test_exceptions(self):
assert_raises(ValueError, tril_indices_from, np.ones((2,)))
assert_raises(ValueError, tril_indices_from, np.ones((2, 2, 2)))
- assert_raises(ValueError, tril_indices_from, np.ones((2, 3)))
+ # assert_raises(ValueError, tril_indices_from, np.ones((2, 3)))
class TestTriuIndicesFrom(object):
def test_exceptions(self):
assert_raises(ValueError, triu_indices_from, np.ones((2,)))
assert_raises(ValueError, triu_indices_from, np.ones((2, 2, 2)))
- assert_raises(ValueError, triu_indices_from, np.ones((2, 3)))
+ # assert_raises(ValueError, triu_indices_from, np.ones((2, 3)))
class TestVander(object):
diff --git a/numpy/lib/tests/test_utils.py b/numpy/lib/tests/test_utils.py
index 93c674766..36d5d6428 100644
--- a/numpy/lib/tests/test_utils.py
+++ b/numpy/lib/tests/test_utils.py
@@ -1,6 +1,7 @@
from __future__ import division, absolute_import, print_function
import sys
+from numpy.core import arange
from numpy.testing import *
import numpy.lib.utils as utils
from numpy.lib import deprecate
@@ -46,9 +47,17 @@ def test_deprecate_fn():
assert_('old_func3' in new_func3.__doc__)
assert_('new_func3' in new_func3.__doc__)
+
def test_safe_eval_nameconstant():
# Test if safe_eval supports Python 3.4 _ast.NameConstant
utils.safe_eval('None')
+
+def test_byte_bounds():
+ a = arange(12).reshape(3, 4)
+ low, high = utils.byte_bounds(a)
+ assert_equal(high - low, a.size * a.itemsize)
+
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/lib/twodim_base.py b/numpy/lib/twodim_base.py
index 12c0f9bb3..a8925592a 100644
--- a/numpy/lib/twodim_base.py
+++ b/numpy/lib/twodim_base.py
@@ -11,8 +11,23 @@ __all__ = ['diag', 'diagflat', 'eye', 'fliplr', 'flipud', 'rot90', 'tri',
from numpy.core.numeric import (
asanyarray, subtract, arange, zeros, greater_equal, multiply, ones,
- asarray, where,
+ asarray, where, less, int8, int16, int32, int64, empty, promote_types
)
+from numpy.core import iinfo
+
+
+i1 = iinfo(int8)
+i2 = iinfo(int16)
+i4 = iinfo(int32)
+def _min_int(low, high):
+ """ get small int that fits the range """
+ if high <= i1.max and low >= i1.min:
+ return int8
+ if high <= i2.max and low >= i2.min:
+ return int16
+ if high <= i4.max and low >= i4.min:
+ return int32
+ return int64
def fliplr(m):
@@ -25,7 +40,7 @@ def fliplr(m):
Parameters
----------
m : array_like
- Input array.
+ Input array, must be at least 2-D.
Returns
-------
@@ -40,8 +55,7 @@ def fliplr(m):
Notes
-----
- Equivalent to A[:,::-1]. Does not require the array to be
- two-dimensional.
+ Equivalent to A[:,::-1]. Requires the array to be at least 2-D.
Examples
--------
@@ -373,6 +387,7 @@ def tri(N, M=None, k=0, dtype=float):
dtype : dtype, optional
Data type of the returned array. The default is float.
+
Returns
-------
tri : ndarray of shape (N, M)
@@ -394,8 +409,14 @@ def tri(N, M=None, k=0, dtype=float):
"""
if M is None:
M = N
- m = greater_equal(subtract.outer(arange(N), arange(M)), -k)
- return m.astype(dtype)
+
+ m = greater_equal.outer(arange(N, dtype=_min_int(0, N)),
+ arange(-k, M-k, dtype=_min_int(-k, M - k)))
+
+ # Avoid making a copy if the requested type is already bool
+ m = m.astype(dtype, copy=False)
+
+ return m
def tril(m, k=0):
@@ -431,8 +452,7 @@ def tril(m, k=0):
"""
m = asanyarray(m)
- out = multiply(tri(m.shape[0], m.shape[1], k=k, dtype=m.dtype), m)
- return out
+ return multiply(tri(*m.shape[-2:], k=k, dtype=bool), m, dtype=m.dtype)
def triu(m, k=0):
@@ -458,22 +478,20 @@ def triu(m, k=0):
"""
m = asanyarray(m)
- out = multiply((1 - tri(m.shape[0], m.shape[1], k - 1, dtype=m.dtype)), m)
- return out
+ return multiply(~tri(*m.shape[-2:], k=k-1, dtype=bool), m, dtype=m.dtype)
# Originally borrowed from John Hunter and matplotlib
-def vander(x, N=None, order='decreasing'):
+def vander(x, N=None, increasing=False):
"""
Generate a Vandermonde matrix.
- The columns of the output matrix are powers of the input vector. The
- order of the powers is determined by the `order` argument, either
- "decreasing" (the default) or "increasing". Specifically, when
- `order` is "decreasing", the `i`-th output column is the input vector
- raised element-wise to the power of ``N - i - 1``. Such a matrix with
- a geometric progression in each row is named for Alexandre-Theophile
- Vandermonde.
+ The columns of the output matrix are powers of the input vector. The
+ order of the powers is determined by the `increasing` boolean argument.
+ Specifically, when `increasing` is False, the `i`-th output column is
+ the input vector raised element-wise to the power of ``N - i - 1``. Such
+ a matrix with a geometric progression in each row is named for Alexandre-
+ Theophile Vandermonde.
Parameters
----------
@@ -482,16 +500,18 @@ def vander(x, N=None, order='decreasing'):
N : int, optional
Number of columns in the output. If `N` is not specified, a square
array is returned (``N = len(x)``).
- order : str, optional
- Order of the powers of the columns. Must be either 'decreasing'
- (the default) or 'increasing'.
+ increasing : bool, optional
+ Order of the powers of the columns. If True, the powers increase
+ from left to right, if False (the default) they are reversed.
+
+ .. versionadded:: 1.9.0
Returns
-------
out : ndarray
- Vandermonde matrix. If `order` is "decreasing", the first column is
- ``x^(N-1)``, the second ``x^(N-2)`` and so forth. If `order` is
- "increasing", the columns are ``x^0, x^1, ..., x^(N-1)``.
+ Vandermonde matrix. If `increasing` is False, the first column is
+ ``x^(N-1)``, the second ``x^(N-2)`` and so forth. If `increasing` is
+ True, the columns are ``x^0, x^1, ..., x^(N-1)``.
See Also
--------
@@ -519,7 +539,7 @@ def vander(x, N=None, order='decreasing'):
[ 8, 4, 2, 1],
[ 27, 9, 3, 1],
[125, 25, 5, 1]])
- >>> np.vander(x, order='increasing')
+ >>> np.vander(x, increasing=True)
array([[ 1, 1, 1, 1],
[ 1, 2, 4, 8],
[ 1, 3, 9, 27],
@@ -534,22 +554,22 @@ def vander(x, N=None, order='decreasing'):
48
"""
- if order not in ['decreasing', 'increasing']:
- raise ValueError("Invalid order %r; order must be either "
- "'decreasing' or 'increasing'." % (order,))
x = asarray(x)
if x.ndim != 1:
raise ValueError("x must be a one-dimensional array or sequence.")
if N is None:
N = len(x)
- if order == "decreasing":
- powers = arange(N - 1, -1, -1)
- else:
- powers = arange(N)
- V = x.reshape(-1, 1) ** powers
+ v = empty((len(x), N), dtype=promote_types(x.dtype, int))
+ tmp = v[:, ::-1] if not increasing else v
+
+ if N > 0:
+ tmp[:, 0] = 1
+ if N > 1:
+ tmp[:, 1:] = x[:, None]
+ multiply.accumulate(tmp[:, 1:], out=tmp[:, 1:], axis=1)
- return V
+ return v
def histogram2d(x, y, bins=10, range=None, normed=False, weights=None):
@@ -559,9 +579,11 @@ def histogram2d(x, y, bins=10, range=None, normed=False, weights=None):
Parameters
----------
x : array_like, shape (N,)
- An array containing the x coordinates of the points to be histogrammed.
+ An array containing the x coordinates of the points to be
+ histogrammed.
y : array_like, shape (N,)
- An array containing the y coordinates of the points to be histogrammed.
+ An array containing the y coordinates of the points to be
+ histogrammed.
bins : int or [int, int] or array_like or [array, array], optional
The bin specification:
@@ -579,13 +601,13 @@ def histogram2d(x, y, bins=10, range=None, normed=False, weights=None):
``[[xmin, xmax], [ymin, ymax]]``. All values outside of this range
will be considered outliers and not tallied in the histogram.
normed : bool, optional
- If False, returns the number of samples in each bin. If True, returns
- the bin density, i.e. the bin count divided by the bin area.
+ If False, returns the number of samples in each bin. If True,
+ returns the bin density ``bin_count / sample_count / bin_area``.
weights : array_like, shape(N,), optional
- An array of values ``w_i`` weighing each sample ``(x_i, y_i)``. Weights
- are normalized to 1 if `normed` is True. If `normed` is False, the
- values of the returned histogram are equal to the sum of the weights
- belonging to the samples falling into each bin.
+ An array of values ``w_i`` weighing each sample ``(x_i, y_i)``.
+ Weights are normalized to 1 if `normed` is True. If `normed` is
+ False, the values of the returned histogram are equal to the sum of
+ the weights belonging to the samples falling into each bin.
Returns
-------
@@ -605,20 +627,15 @@ def histogram2d(x, y, bins=10, range=None, normed=False, weights=None):
Notes
-----
- When `normed` is True, then the returned histogram is the sample density,
- defined such that:
-
- .. math::
- \\sum_{i=0}^{nx-1} \\sum_{j=0}^{ny-1} H_{i,j} \\Delta x_i \\Delta y_j = 1
-
- where `H` is the histogram array and :math:`\\Delta x_i \\Delta y_i`
- the area of bin ``{i,j}``.
+ When `normed` is True, then the returned histogram is the sample
+ density, defined such that the sum over bins of the product
+ ``bin_value * bin_area`` is 1.
Please note that the histogram does not follow the Cartesian convention
- where `x` values are on the abcissa and `y` values on the ordinate axis.
- Rather, `x` is histogrammed along the first dimension of the array
- (vertical), and `y` along the second dimension of the array (horizontal).
- This ensures compatibility with `histogramdd`.
+ where `x` values are on the abscissa and `y` values on the ordinate
+ axis. Rather, `x` is histogrammed along the first dimension of the
+ array (vertical), and `y` along the second dimension of the array
+ (horizontal). This ensures compatibility with `histogramdd`.
Examples
--------
@@ -650,14 +667,14 @@ def histogram2d(x, y, bins=10, range=None, normed=False, weights=None):
>>> fig = plt.figure(figsize=(7, 3))
>>> ax = fig.add_subplot(131)
- >>> ax.set_title('imshow:\nequidistant')
+ >>> ax.set_title('imshow: equidistant')
>>> im = plt.imshow(H, interpolation='nearest', origin='low',
- extent=[xedges[0], xedges[-1], yedges[0], yedges[-1]])
+ extent=[xedges[0], xedges[-1], yedges[0], yedges[-1]])
pcolormesh can display exact bin edges:
>>> ax = fig.add_subplot(132)
- >>> ax.set_title('pcolormesh:\nexact bin edges')
+ >>> ax.set_title('pcolormesh: exact bin edges')
>>> X, Y = np.meshgrid(xedges, yedges)
>>> ax.pcolormesh(X, Y, H)
>>> ax.set_aspect('equal')
@@ -665,7 +682,7 @@ def histogram2d(x, y, bins=10, range=None, normed=False, weights=None):
NonUniformImage displays exact bin edges with interpolation:
>>> ax = fig.add_subplot(133)
- >>> ax.set_title('NonUniformImage:\ninterpolated')
+ >>> ax.set_title('NonUniformImage: interpolated')
>>> im = mpl.image.NonUniformImage(ax, interpolation='bilinear')
>>> xcenters = xedges[:-1] + 0.5 * (xedges[1:] - xedges[:-1])
>>> ycenters = yedges[:-1] + 0.5 * (yedges[1:] - yedges[:-1])
@@ -761,17 +778,24 @@ def mask_indices(n, mask_func, k=0):
return where(a != 0)
-def tril_indices(n, k=0):
+def tril_indices(n, k=0, m=None):
"""
- Return the indices for the lower-triangle of an (n, n) array.
+ Return the indices for the lower-triangle of an (n, m) array.
Parameters
----------
n : int
- The row dimension of the square arrays for which the returned
+ The row dimension of the arrays for which the returned
indices will be valid.
k : int, optional
Diagonal offset (see `tril` for details).
+ m : int, optional
+ .. versionadded:: 1.9.0
+
+ The column dimension of the arrays for which the returned
+ arrays will be valid.
+ By default `m` is taken equal to `n`.
+
Returns
-------
@@ -831,7 +855,7 @@ def tril_indices(n, k=0):
[-10, -10, -10, -10]])
"""
- return mask_indices(n, tril, k)
+ return where(tri(n, m, k=k, dtype=bool))
def tril_indices_from(arr, k=0):
@@ -857,14 +881,14 @@ def tril_indices_from(arr, k=0):
.. versionadded:: 1.4.0
"""
- if not (arr.ndim == 2 and arr.shape[0] == arr.shape[1]):
- raise ValueError("input array must be 2-d and square")
- return tril_indices(arr.shape[0], k)
+ if arr.ndim != 2:
+ raise ValueError("input array must be 2-d")
+ return tril_indices(arr.shape[-2], k=k, m=arr.shape[-1])
-def triu_indices(n, k=0):
+def triu_indices(n, k=0, m=None):
"""
- Return the indices for the upper-triangle of an (n, n) array.
+ Return the indices for the upper-triangle of an (n, m) array.
Parameters
----------
@@ -873,6 +897,13 @@ def triu_indices(n, k=0):
be valid.
k : int, optional
Diagonal offset (see `triu` for details).
+ m : int, optional
+ .. versionadded:: 1.9.0
+
+ The column dimension of the arrays for which the returned
+ arrays will be valid.
+ By default `m` is taken equal to `n`.
+
Returns
-------
@@ -934,12 +965,12 @@ def triu_indices(n, k=0):
[ 12, 13, 14, -1]])
"""
- return mask_indices(n, triu, k)
+ return where(~tri(n, m, k=k-1, dtype=bool))
def triu_indices_from(arr, k=0):
"""
- Return the indices for the upper-triangle of a (N, N) array.
+ Return the indices for the upper-triangle of arr.
See `triu_indices` for full details.
@@ -964,6 +995,6 @@ def triu_indices_from(arr, k=0):
.. versionadded:: 1.4.0
"""
- if not (arr.ndim == 2 and arr.shape[0] == arr.shape[1]):
- raise ValueError("input array must be 2-d and square")
- return triu_indices(arr.shape[0], k)
+ if arr.ndim != 2:
+ raise ValueError("input array must be 2-d")
+ return triu_indices(arr.shape[-2], k=k, m=arr.shape[-1])
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index 1f1cdfc8a..6d41e8eb4 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -6,7 +6,7 @@ import types
import re
from numpy.core.numerictypes import issubclass_, issubsctype, issubdtype
-from numpy.core import product, ndarray, ufunc
+from numpy.core import product, ndarray, ufunc, asarray
__all__ = [
'issubclass_', 'issubsctype', 'issubdtype', 'deprecate',
@@ -210,8 +210,9 @@ def byte_bounds(a):
a_data = ai['data'][0]
astrides = ai['strides']
ashape = ai['shape']
- bytes_a = int(ai['typestr'][2:])
-
+
+ bytes_a = asarray(a).dtype.itemsize
+
a_low = a_high = a_data
if astrides is None: # contiguous case
a_high += a.size * bytes_a
diff --git a/numpy/linalg/lapack_lite/python_xerbla.c b/numpy/linalg/lapack_lite/python_xerbla.c
index bc5d41f58..2296cc53f 100644
--- a/numpy/linalg/lapack_lite/python_xerbla.c
+++ b/numpy/linalg/lapack_lite/python_xerbla.c
@@ -26,16 +26,22 @@ int xerbla_(char *srname, integer *info)
6 for name, 4 for param. num. */
int len = 0; /* length of subroutine name*/
+#ifdef WITH_THREAD
PyGILState_STATE save;
+#endif
while( len<6 && srname[len]!='\0' )
len++;
while( len && srname[len-1]==' ' )
len--;
-
- PyOS_snprintf(buf, sizeof(buf), format, len, srname, *info);
+#ifdef WITH_THREAD
save = PyGILState_Ensure();
+#endif
+ PyOS_snprintf(buf, sizeof(buf), format, len, srname, *info);
PyErr_SetString(PyExc_ValueError, buf);
+#ifdef WITH_THREAD
PyGILState_Release(save);
+#endif
+
return 0;
}
diff --git a/numpy/linalg/lapack_litemodule.c b/numpy/linalg/lapack_litemodule.c
index 5a5c6f010..f9f515bb7 100644
--- a/numpy/linalg/lapack_litemodule.c
+++ b/numpy/linalg/lapack_litemodule.c
@@ -17,31 +17,11 @@ typedef struct { float r, i; } f2c_complex;
typedef struct { double r, i; } f2c_doublecomplex;
/* typedef long int (*L_fp)(); */
-extern int FNAME(dgeev)(char *jobvl, char *jobvr, int *n,
- double a[], int *lda, double wr[], double wi[],
- double vl[], int *ldvl, double vr[], int *ldvr,
- double work[], int lwork[], int *info);
-extern int FNAME(zgeev)(char *jobvl, char *jobvr, int *n,
- f2c_doublecomplex a[], int *lda,
- f2c_doublecomplex w[],
- f2c_doublecomplex vl[], int *ldvl,
- f2c_doublecomplex vr[], int *ldvr,
- f2c_doublecomplex work[], int *lwork,
- double rwork[], int *info);
-
-extern int FNAME(dsyevd)(char *jobz, char *uplo, int *n,
- double a[], int *lda, double w[], double work[],
- int *lwork, int iwork[], int *liwork, int *info);
-extern int FNAME(zheevd)(char *jobz, char *uplo, int *n,
- f2c_doublecomplex a[], int *lda,
- double w[], f2c_doublecomplex work[],
- int *lwork, double rwork[], int *lrwork, int iwork[],
- int *liwork, int *info);
-
extern int FNAME(dgelsd)(int *m, int *n, int *nrhs,
double a[], int *lda, double b[], int *ldb,
double s[], double *rcond, int *rank,
double work[], int *lwork, int iwork[], int *info);
+
extern int FNAME(zgelsd)(int *m, int *n, int *nrhs,
f2c_doublecomplex a[], int *lda,
f2c_doublecomplex b[], int *ldb,
@@ -49,34 +29,6 @@ extern int FNAME(zgelsd)(int *m, int *n, int *nrhs,
f2c_doublecomplex work[], int *lwork,
double rwork[], int iwork[], int *info);
-extern int FNAME(dgesv)(int *n, int *nrhs,
- double a[], int *lda, int ipiv[],
- double b[], int *ldb, int *info);
-extern int FNAME(zgesv)(int *n, int *nrhs,
- f2c_doublecomplex a[], int *lda, int ipiv[],
- f2c_doublecomplex b[], int *ldb, int *info);
-
-extern int FNAME(dgetrf)(int *m, int *n,
- double a[], int *lda, int ipiv[], int *info);
-extern int FNAME(zgetrf)(int *m, int *n,
- f2c_doublecomplex a[], int *lda, int ipiv[],
- int *info);
-
-extern int FNAME(dpotrf)(char *uplo, int *n, double a[], int *lda, int *info);
-extern int FNAME(zpotrf)(char *uplo, int *n,
- f2c_doublecomplex a[], int *lda, int *info);
-
-extern int FNAME(dgesdd)(char *jobz, int *m, int *n,
- double a[], int *lda, double s[], double u[],
- int *ldu, double vt[], int *ldvt, double work[],
- int *lwork, int iwork[], int *info);
-extern int FNAME(zgesdd)(char *jobz, int *m, int *n,
- f2c_doublecomplex a[], int *lda,
- double s[], f2c_doublecomplex u[], int *ldu,
- f2c_doublecomplex vt[], int *ldvt,
- f2c_doublecomplex work[], int *lwork,
- double rwork[], int iwork[], int *info);
-
extern int FNAME(dgeqrf)(int *m, int *n, double a[], int *lda,
double tau[], double work[],
int *lwork, int *info);
@@ -141,225 +93,6 @@ check_object(PyObject *ob, int t, char *obname,
#define IDATA(p) ((int *) PyArray_DATA((PyArrayObject *)p))
static PyObject *
-lapack_lite_dgeev(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- int lapack_lite_status;
- char jobvl;
- char jobvr;
- int n;
- PyObject *a;
- int lda;
- PyObject *wr;
- PyObject *wi;
- PyObject *vl;
- int ldvl;
- PyObject *vr;
- int ldvr;
- PyObject *work;
- int lwork;
- int info;
- TRY(PyArg_ParseTuple(args,"cciOiOOOiOiOii",
- &jobvl,&jobvr,&n,&a,&lda,&wr,&wi,&vl,&ldvl,
- &vr,&ldvr,&work,&lwork,&info));
-
- TRY(check_object(a,NPY_DOUBLE,"a","NPY_DOUBLE","dgeev"));
- TRY(check_object(wr,NPY_DOUBLE,"wr","NPY_DOUBLE","dgeev"));
- TRY(check_object(wi,NPY_DOUBLE,"wi","NPY_DOUBLE","dgeev"));
- TRY(check_object(vl,NPY_DOUBLE,"vl","NPY_DOUBLE","dgeev"));
- TRY(check_object(vr,NPY_DOUBLE,"vr","NPY_DOUBLE","dgeev"));
- TRY(check_object(work,NPY_DOUBLE,"work","NPY_DOUBLE","dgeev"));
-
- lapack_lite_status =
- FNAME(dgeev)(&jobvl,&jobvr,&n,DDATA(a),&lda,DDATA(wr),DDATA(wi),
- DDATA(vl),&ldvl,DDATA(vr),&ldvr,DDATA(work),&lwork,
- &info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- return Py_BuildValue("{s:i,s:c,s:c,s:i,s:i,s:i,s:i,s:i,s:i}","dgeev_",
- lapack_lite_status,"jobvl",jobvl,"jobvr",jobvr,
- "n",n,"lda",lda,"ldvl",ldvl,"ldvr",ldvr,
- "lwork",lwork,"info",info);
-}
-
-static PyObject *
-lapack_lite_dsyevd(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- /* Arguments */
- /* ========= */
-
- char jobz;
- /* JOBZ (input) CHARACTER*1 */
- /* = 'N': Compute eigenvalues only; */
- /* = 'V': Compute eigenvalues and eigenvectors. */
-
- char uplo;
- /* UPLO (input) CHARACTER*1 */
- /* = 'U': Upper triangle of A is stored; */
- /* = 'L': Lower triangle of A is stored. */
-
- int n;
- /* N (input) INTEGER */
- /* The order of the matrix A. N >= 0. */
-
- PyObject *a;
- /* A (input/output) DOUBLE PRECISION array, dimension (LDA, N) */
- /* On entry, the symmetric matrix A. If UPLO = 'U', the */
- /* leading N-by-N upper triangular part of A contains the */
- /* upper triangular part of the matrix A. If UPLO = 'L', */
- /* the leading N-by-N lower triangular part of A contains */
- /* the lower triangular part of the matrix A. */
- /* On exit, if JOBZ = 'V', then if INFO = 0, A contains the */
- /* orthonormal eigenvectors of the matrix A. */
- /* If JOBZ = 'N', then on exit the lower triangle (if UPLO='L') */
- /* or the upper triangle (if UPLO='U') of A, including the */
- /* diagonal, is destroyed. */
-
- int lda;
- /* LDA (input) INTEGER */
- /* The leading dimension of the array A. LDA >= max(1,N). */
-
- PyObject *w;
- /* W (output) DOUBLE PRECISION array, dimension (N) */
- /* If INFO = 0, the eigenvalues in ascending order. */
-
- PyObject *work;
- /* WORK (workspace/output) DOUBLE PRECISION array, dimension (LWORK) */
- /* On exit, if INFO = 0, WORK(1) returns the optimal LWORK. */
-
- int lwork;
- /* LWORK (input) INTEGER */
- /* The length of the array WORK. LWORK >= max(1,3*N-1). */
- /* For optimal efficiency, LWORK >= (NB+2)*N, */
- /* where NB is the blocksize for DSYTRD returned by ILAENV. */
-
- PyObject *iwork;
- int liwork;
-
- int info;
- /* INFO (output) INTEGER */
- /* = 0: successful exit */
- /* < 0: if INFO = -i, the i-th argument had an illegal value */
- /* > 0: if INFO = i, the algorithm failed to converge; i */
- /* off-diagonal elements of an intermediate tridiagonal */
- /* form did not converge to zero. */
-
- int lapack_lite_status;
-
- TRY(PyArg_ParseTuple(args,"cciOiOOiOii",
- &jobz,&uplo,&n,&a,&lda,&w,&work,&lwork,
- &iwork,&liwork,&info));
-
- TRY(check_object(a,NPY_DOUBLE,"a","NPY_DOUBLE","dsyevd"));
- TRY(check_object(w,NPY_DOUBLE,"w","NPY_DOUBLE","dsyevd"));
- TRY(check_object(work,NPY_DOUBLE,"work","NPY_DOUBLE","dsyevd"));
- TRY(check_object(iwork,NPY_INT,"iwork","NPY_INT","dsyevd"));
-
- lapack_lite_status =
- FNAME(dsyevd)(&jobz,&uplo,&n,DDATA(a),&lda,DDATA(w),DDATA(work),
- &lwork,IDATA(iwork),&liwork,&info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- return Py_BuildValue("{s:i,s:c,s:c,s:i,s:i,s:i,s:i,s:i}","dsyevd_",
- lapack_lite_status,"jobz",jobz,"uplo",uplo,
- "n",n,"lda",lda,"lwork",lwork,"liwork",liwork,"info",info);
-}
-
-static PyObject *
-lapack_lite_zheevd(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- /* Arguments */
- /* ========= */
-
- char jobz;
- /* JOBZ (input) CHARACTER*1 */
- /* = 'N': Compute eigenvalues only; */
- /* = 'V': Compute eigenvalues and eigenvectors. */
-
- char uplo;
- /* UPLO (input) CHARACTER*1 */
- /* = 'U': Upper triangle of A is stored; */
- /* = 'L': Lower triangle of A is stored. */
-
- int n;
- /* N (input) INTEGER */
- /* The order of the matrix A. N >= 0. */
-
- PyObject *a;
- /* A (input/output) COMPLEX*16 array, dimension (LDA, N) */
- /* On entry, the Hermitian matrix A. If UPLO = 'U', the */
- /* leading N-by-N upper triangular part of A contains the */
- /* upper triangular part of the matrix A. If UPLO = 'L', */
- /* the leading N-by-N lower triangular part of A contains */
- /* the lower triangular part of the matrix A. */
- /* On exit, if JOBZ = 'V', then if INFO = 0, A contains the */
- /* orthonormal eigenvectors of the matrix A. */
- /* If JOBZ = 'N', then on exit the lower triangle (if UPLO='L') */
- /* or the upper triangle (if UPLO='U') of A, including the */
- /* diagonal, is destroyed. */
-
- int lda;
- /* LDA (input) INTEGER */
- /* The leading dimension of the array A. LDA >= max(1,N). */
-
- PyObject *w;
- /* W (output) DOUBLE PRECISION array, dimension (N) */
- /* If INFO = 0, the eigenvalues in ascending order. */
-
- PyObject *work;
- /* WORK (workspace/output) COMPLEX*16 array, dimension (LWORK) */
- /* On exit, if INFO = 0, WORK(1) returns the optimal LWORK. */
-
- int lwork;
- /* LWORK (input) INTEGER */
- /* The length of the array WORK. LWORK >= max(1,3*N-1). */
- /* For optimal efficiency, LWORK >= (NB+2)*N, */
- /* where NB is the blocksize for DSYTRD returned by ILAENV. */
-
- PyObject *rwork;
- /* RWORK (workspace) DOUBLE PRECISION array, dimension (max(1, 3*N-2)) */
- int lrwork;
-
- PyObject *iwork;
- int liwork;
-
- int info;
- /* INFO (output) INTEGER */
- /* = 0: successful exit */
- /* < 0: if INFO = -i, the i-th argument had an illegal value */
- /* > 0: if INFO = i, the algorithm failed to converge; i */
- /* off-diagonal elements of an intermediate tridiagonal */
- /* form did not converge to zero. */
-
- int lapack_lite_status;
-
- TRY(PyArg_ParseTuple(args,"cciOiOOiOiOii",
- &jobz,&uplo,&n,&a,&lda,&w,&work,&lwork,&rwork,
- &lrwork,&iwork,&liwork,&info));
-
- TRY(check_object(a,NPY_CDOUBLE,"a","NPY_CDOUBLE","zheevd"));
- TRY(check_object(w,NPY_DOUBLE,"w","NPY_DOUBLE","zheevd"));
- TRY(check_object(work,NPY_CDOUBLE,"work","NPY_CDOUBLE","zheevd"));
- TRY(check_object(w,NPY_DOUBLE,"rwork","NPY_DOUBLE","zheevd"));
- TRY(check_object(iwork,NPY_INT,"iwork","NPY_INT","zheevd"));
-
- lapack_lite_status =
- FNAME(zheevd)(&jobz,&uplo,&n,ZDATA(a),&lda,DDATA(w),ZDATA(work),
- &lwork,DDATA(rwork),&lrwork,IDATA(iwork),&liwork,&info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- return Py_BuildValue("{s:i,s:c,s:c,s:i,s:i,s:i,s:i,s:i,s:i}","zheevd_",
- lapack_lite_status,"jobz",jobz,"uplo",uplo,"n",n,
- "lda",lda,"lwork",lwork,"lrwork",lrwork,
- "liwork",liwork,"info",info);
-}
-
-static PyObject *
lapack_lite_dgelsd(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status;
@@ -402,152 +135,6 @@ lapack_lite_dgelsd(PyObject *NPY_UNUSED(self), PyObject *args)
}
static PyObject *
-lapack_lite_dgesv(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- int lapack_lite_status;
- int n;
- int nrhs;
- PyObject *a;
- int lda;
- PyObject *ipiv;
- PyObject *b;
- int ldb;
- int info;
- TRY(PyArg_ParseTuple(args,"iiOiOOii",&n,&nrhs,&a,&lda,&ipiv,&b,&ldb,&info));
-
- TRY(check_object(a,NPY_DOUBLE,"a","NPY_DOUBLE","dgesv"));
- TRY(check_object(ipiv,NPY_INT,"ipiv","NPY_INT","dgesv"));
- TRY(check_object(b,NPY_DOUBLE,"b","NPY_DOUBLE","dgesv"));
-
- lapack_lite_status =
- FNAME(dgesv)(&n,&nrhs,DDATA(a),&lda,IDATA(ipiv),DDATA(b),&ldb,&info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- return Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:i}","dgesv_",
- lapack_lite_status,"n",n,"nrhs",nrhs,"lda",lda,
- "ldb",ldb,"info",info);
-}
-
-static PyObject *
-lapack_lite_dgesdd(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- int lapack_lite_status;
- char jobz;
- int m;
- int n;
- PyObject *a;
- int lda;
- PyObject *s;
- PyObject *u;
- int ldu;
- PyObject *vt;
- int ldvt;
- PyObject *work;
- int lwork;
- PyObject *iwork;
- int info;
- TRY(PyArg_ParseTuple(args,"ciiOiOOiOiOiOi",
- &jobz,&m,&n,&a,&lda,&s,&u,&ldu,&vt,&ldvt,
- &work,&lwork,&iwork,&info));
-
- TRY(check_object(a,NPY_DOUBLE,"a","NPY_DOUBLE","dgesdd"));
- TRY(check_object(s,NPY_DOUBLE,"s","NPY_DOUBLE","dgesdd"));
- TRY(check_object(u,NPY_DOUBLE,"u","NPY_DOUBLE","dgesdd"));
- TRY(check_object(vt,NPY_DOUBLE,"vt","NPY_DOUBLE","dgesdd"));
- TRY(check_object(work,NPY_DOUBLE,"work","NPY_DOUBLE","dgesdd"));
- TRY(check_object(iwork,NPY_INT,"iwork","NPY_INT","dgesdd"));
-
- lapack_lite_status =
- FNAME(dgesdd)(&jobz,&m,&n,DDATA(a),&lda,DDATA(s),DDATA(u),&ldu,
- DDATA(vt),&ldvt,DDATA(work),&lwork,IDATA(iwork),
- &info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- if (info == 0 && lwork == -1) {
- /* We need to check the result because
- sometimes the "optimal" value is actually
- too small.
- Change it to the maximum of the minimum and the optimal.
- */
- long work0 = (long) *DDATA(work);
- int mn = PyArray_MIN(m,n);
- int mx = PyArray_MAX(m,n);
-
- switch(jobz){
- case 'N':
- work0 = PyArray_MAX(work0,3*mn + PyArray_MAX(mx,6*mn)+500);
- break;
- case 'O':
- work0 = PyArray_MAX(work0,3*mn*mn +
- PyArray_MAX(mx,5*mn*mn+4*mn+500));
- break;
- case 'S':
- case 'A':
- work0 = PyArray_MAX(work0,3*mn*mn +
- PyArray_MAX(mx,4*mn*(mn+1))+500);
- break;
- }
- *DDATA(work) = (double) work0;
- }
- return Py_BuildValue("{s:i,s:c,s:i,s:i,s:i,s:i,s:i,s:i,s:i}","dgesdd_",
- lapack_lite_status,"jobz",jobz,"m",m,"n",n,
- "lda",lda,"ldu",ldu,"ldvt",ldvt,"lwork",lwork,
- "info",info);
-}
-
-static PyObject *
-lapack_lite_dgetrf(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- int lapack_lite_status;
- int m;
- int n;
- PyObject *a;
- int lda;
- PyObject *ipiv;
- int info;
- TRY(PyArg_ParseTuple(args,"iiOiOi",&m,&n,&a,&lda,&ipiv,&info));
-
- TRY(check_object(a,NPY_DOUBLE,"a","NPY_DOUBLE","dgetrf"));
- TRY(check_object(ipiv,NPY_INT,"ipiv","NPY_INT","dgetrf"));
-
- lapack_lite_status =
- FNAME(dgetrf)(&m,&n,DDATA(a),&lda,IDATA(ipiv),&info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- return Py_BuildValue("{s:i,s:i,s:i,s:i,s:i}","dgetrf_", lapack_lite_status,
- "m",m,"n",n,"lda",lda,"info",info);
-}
-
-static PyObject *
-lapack_lite_dpotrf(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- int lapack_lite_status;
- int n;
- PyObject *a;
- int lda;
- char uplo;
- int info;
-
- TRY(PyArg_ParseTuple(args,"ciOii",&uplo,&n,&a,&lda,&info));
- TRY(check_object(a,NPY_DOUBLE,"a","NPY_DOUBLE","dpotrf"));
-
- lapack_lite_status =
- FNAME(dpotrf)(&uplo,&n,DDATA(a),&lda,&info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- return Py_BuildValue("{s:i,s:i,s:i,s:i}","dpotrf_", lapack_lite_status,
- "n",n,"lda",lda,"info",info);
-}
-
-static PyObject *
lapack_lite_dgeqrf(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status;
@@ -602,49 +189,6 @@ lapack_lite_dorgqr(PyObject *NPY_UNUSED(self), PyObject *args)
static PyObject *
-lapack_lite_zgeev(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- int lapack_lite_status;
- char jobvl;
- char jobvr;
- int n;
- PyObject *a;
- int lda;
- PyObject *w;
- PyObject *vl;
- int ldvl;
- PyObject *vr;
- int ldvr;
- PyObject *work;
- int lwork;
- PyObject *rwork;
- int info;
- TRY(PyArg_ParseTuple(args,"cciOiOOiOiOiOi",
- &jobvl,&jobvr,&n,&a,&lda,&w,&vl,&ldvl,
- &vr,&ldvr,&work,&lwork,&rwork,&info));
-
- TRY(check_object(a,NPY_CDOUBLE,"a","NPY_CDOUBLE","zgeev"));
- TRY(check_object(w,NPY_CDOUBLE,"w","NPY_CDOUBLE","zgeev"));
- TRY(check_object(vl,NPY_CDOUBLE,"vl","NPY_CDOUBLE","zgeev"));
- TRY(check_object(vr,NPY_CDOUBLE,"vr","NPY_CDOUBLE","zgeev"));
- TRY(check_object(work,NPY_CDOUBLE,"work","NPY_CDOUBLE","zgeev"));
- TRY(check_object(rwork,NPY_DOUBLE,"rwork","NPY_DOUBLE","zgeev"));
-
- lapack_lite_status =
- FNAME(zgeev)(&jobvl,&jobvr,&n,ZDATA(a),&lda,ZDATA(w),ZDATA(vl),
- &ldvl,ZDATA(vr),&ldvr,ZDATA(work),&lwork,
- DDATA(rwork),&info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- return Py_BuildValue("{s:i,s:c,s:c,s:i,s:i,s:i,s:i,s:i,s:i}","zgeev_",
- lapack_lite_status,"jobvl",jobvl,"jobvr",jobvr,
- "n",n,"lda",lda,"ldvl",ldvl,"ldvr",ldvr,
- "lwork",lwork,"info",info);
-}
-
-static PyObject *
lapack_lite_zgelsd(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status;
@@ -687,127 +231,6 @@ lapack_lite_zgelsd(PyObject *NPY_UNUSED(self), PyObject *args)
}
static PyObject *
-lapack_lite_zgesv(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- int lapack_lite_status;
- int n;
- int nrhs;
- PyObject *a;
- int lda;
- PyObject *ipiv;
- PyObject *b;
- int ldb;
- int info;
- TRY(PyArg_ParseTuple(args,"iiOiOOii",&n,&nrhs,&a,&lda,&ipiv,&b,&ldb,&info));
-
- TRY(check_object(a,NPY_CDOUBLE,"a","NPY_CDOUBLE","zgesv"));
- TRY(check_object(ipiv,NPY_INT,"ipiv","NPY_INT","zgesv"));
- TRY(check_object(b,NPY_CDOUBLE,"b","NPY_CDOUBLE","zgesv"));
-
- lapack_lite_status =
- FNAME(zgesv)(&n,&nrhs,ZDATA(a),&lda,IDATA(ipiv),ZDATA(b),&ldb,&info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- return Py_BuildValue("{s:i,s:i,s:i,s:i,s:i,s:i}","zgesv_",
- lapack_lite_status,"n",n,"nrhs",nrhs,"lda",lda,
- "ldb",ldb,"info",info);
-}
-
-static PyObject *
-lapack_lite_zgesdd(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- int lapack_lite_status;
- char jobz;
- int m;
- int n;
- PyObject *a;
- int lda;
- PyObject *s;
- PyObject *u;
- int ldu;
- PyObject *vt;
- int ldvt;
- PyObject *work;
- int lwork;
- PyObject *rwork;
- PyObject *iwork;
- int info;
- TRY(PyArg_ParseTuple(args,"ciiOiOOiOiOiOOi",
- &jobz,&m,&n,&a,&lda,&s,&u,&ldu,
- &vt,&ldvt,&work,&lwork,&rwork,&iwork,&info));
-
- TRY(check_object(a,NPY_CDOUBLE,"a","NPY_CDOUBLE","zgesdd"));
- TRY(check_object(s,NPY_DOUBLE,"s","NPY_DOUBLE","zgesdd"));
- TRY(check_object(u,NPY_CDOUBLE,"u","NPY_CDOUBLE","zgesdd"));
- TRY(check_object(vt,NPY_CDOUBLE,"vt","NPY_CDOUBLE","zgesdd"));
- TRY(check_object(work,NPY_CDOUBLE,"work","NPY_CDOUBLE","zgesdd"));
- TRY(check_object(rwork,NPY_DOUBLE,"rwork","NPY_DOUBLE","zgesdd"));
- TRY(check_object(iwork,NPY_INT,"iwork","NPY_INT","zgesdd"));
-
- lapack_lite_status =
- FNAME(zgesdd)(&jobz,&m,&n,ZDATA(a),&lda,DDATA(s),ZDATA(u),&ldu,
- ZDATA(vt),&ldvt,ZDATA(work),&lwork,DDATA(rwork),
- IDATA(iwork),&info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- return Py_BuildValue("{s:i,s:c,s:i,s:i,s:i,s:i,s:i,s:i,s:i}","zgesdd_",
- lapack_lite_status,"jobz",jobz,"m",m,"n",n,
- "lda",lda,"ldu",ldu,"ldvt",ldvt,"lwork",lwork,
- "info",info);
-}
-
-static PyObject *
-lapack_lite_zgetrf(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- int lapack_lite_status;
- int m;
- int n;
- PyObject *a;
- int lda;
- PyObject *ipiv;
- int info;
- TRY(PyArg_ParseTuple(args,"iiOiOi",&m,&n,&a,&lda,&ipiv,&info));
-
- TRY(check_object(a,NPY_CDOUBLE,"a","NPY_CDOUBLE","zgetrf"));
- TRY(check_object(ipiv,NPY_INT,"ipiv","NPY_INT","zgetrf"));
-
- lapack_lite_status =
- FNAME(zgetrf)(&m,&n,ZDATA(a),&lda,IDATA(ipiv),&info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- return Py_BuildValue("{s:i,s:i,s:i,s:i,s:i}","zgetrf_",
- lapack_lite_status,"m",m,"n",n,"lda",lda,"info",info);
-}
-
-static PyObject *
-lapack_lite_zpotrf(PyObject *NPY_UNUSED(self), PyObject *args)
-{
- int lapack_lite_status;
- int n;
- PyObject *a;
- int lda;
- char uplo;
- int info;
-
- TRY(PyArg_ParseTuple(args,"ciOii",&uplo,&n,&a,&lda,&info));
- TRY(check_object(a,NPY_CDOUBLE,"a","NPY_CDOUBLE","zpotrf"));
- lapack_lite_status =
- FNAME(zpotrf)(&uplo,&n,ZDATA(a),&lda,&info);
- if (PyErr_Occurred()) {
- return NULL;
- }
-
- return Py_BuildValue("{s:i,s:i,s:i,s:i}","zpotrf_",
- lapack_lite_status,"n",n,"lda",lda,"info",info);
-}
-
-static PyObject *
lapack_lite_zgeqrf(PyObject *NPY_UNUSED(self), PyObject *args)
{
int lapack_lite_status;
@@ -882,22 +305,10 @@ lapack_lite_xerbla(PyObject *NPY_UNUSED(self), PyObject *args)
#define STR(x) #x
#define lameth(name) {STR(name), lapack_lite_##name, METH_VARARGS, NULL}
static struct PyMethodDef lapack_lite_module_methods[] = {
- lameth(zheevd),
- lameth(dsyevd),
- lameth(dgeev),
lameth(dgelsd),
- lameth(dgesv),
- lameth(dgesdd),
- lameth(dgetrf),
- lameth(dpotrf),
lameth(dgeqrf),
lameth(dorgqr),
- lameth(zgeev),
lameth(zgelsd),
- lameth(zgesv),
- lameth(zgesdd),
- lameth(zgetrf),
- lameth(zpotrf),
lameth(zgeqrf),
lameth(zungqr),
lameth(xerbla),
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py
index a7e12aa08..e5d13efc8 100644
--- a/numpy/linalg/linalg.py
+++ b/numpy/linalg/linalg.py
@@ -1763,7 +1763,7 @@ def lstsq(a, b, rcond=-1):
residuals : {(), (1,), (K,)} ndarray
Sums of residuals; squared Euclidean 2-norm for each column in
``b - a*x``.
- If the rank of `a` is < N or > M, this is an empty array.
+ If the rank of `a` is < N or M <= N, this is an empty array.
If `b` is 1-dimensional, this is a (1,) shape array.
Otherwise the shape is (K,).
rank : int
@@ -2053,7 +2053,12 @@ def norm(x, ord=None, axis=None):
# Check the default case first and handle it immediately.
if ord is None and axis is None:
- return sqrt(add.reduce((x.conj() * x).real, axis=None))
+ x = x.ravel(order='K')
+ if isComplexType(x.dtype.type):
+ sqnorm = dot(x.real, x.real) + dot(x.imag, x.imag)
+ else:
+ sqnorm = dot(x, x)
+ return sqrt(sqnorm)
# Normalize the `axis` argument to a tuple.
nd = x.ndim
diff --git a/numpy/linalg/tests/test_build.py b/numpy/linalg/tests/test_build.py
index 27fbd6429..0d237c81c 100644
--- a/numpy/linalg/tests/test_build.py
+++ b/numpy/linalg/tests/test_build.py
@@ -20,16 +20,16 @@ class FindDependenciesLdd(object):
except OSError:
raise RuntimeError("command %s cannot be run" % self.cmd)
- def get_dependencies(self, file):
- p = Popen(self.cmd + [file], stdout=PIPE, stderr=PIPE)
+ def get_dependencies(self, lfile):
+ p = Popen(self.cmd + [lfile], stdout=PIPE, stderr=PIPE)
stdout, stderr = p.communicate()
if not (p.returncode == 0):
- raise RuntimeError("Failed to check dependencies for %s" % libfile)
+ raise RuntimeError("failed dependencies check for %s" % lfile)
return stdout
- def grep_dependencies(self, file, deps):
- stdout = self.get_dependencies(file)
+ def grep_dependencies(self, lfile, deps):
+ stdout = self.get_dependencies(lfile)
rdeps = dict([(dep, re.compile(dep)) for dep in deps])
founds = []
diff --git a/numpy/linalg/tests/test_linalg.py b/numpy/linalg/tests/test_linalg.py
index 0c21a4229..8edf36aa6 100644
--- a/numpy/linalg/tests/test_linalg.py
+++ b/numpy/linalg/tests/test_linalg.py
@@ -1130,13 +1130,13 @@ def test_xerbla_override():
os._exit(os.EX_CONFIG)
try:
- a = np.array([[1]])
- np.linalg.lapack_lite.dgetrf(
- 1, 1, a.astype(np.double),
+ a = np.array([[1.]])
+ np.linalg.lapack_lite.dorgqr(
+ 1, 1, 1, a,
0, # <- invalid value
- a.astype(np.intc), 0)
+ a, a, 0, 0)
except ValueError as e:
- if "DGETRF parameter number 4" in str(e):
+ if "DORGQR parameter number 5" in str(e):
# success
os._exit(os.EX_OK)
diff --git a/numpy/linalg/tests/test_regression.py b/numpy/linalg/tests/test_regression.py
index 4ff14a6a5..18d212cdc 100644
--- a/numpy/linalg/tests/test_regression.py
+++ b/numpy/linalg/tests/test_regression.py
@@ -69,5 +69,22 @@ class TestRegression(TestCase):
bp = linalg.cholesky(b)
assert_array_equal(ap, bp)
+ def test_large_svd_32bit(self):
+ # See gh-4442, 64bit would require very large/slow matrices.
+ x = np.eye(1000, 66)
+ np.linalg.svd(x)
+
+ def test_svd_no_uv(self):
+ # gh-4733
+ for shape in (3, 4), (4, 4), (4, 3):
+ for t in float, complex:
+ a = np.ones(shape, dtype=t)
+ w = linalg.svd(a, compute_uv=False)
+ c = np.count_nonzero(np.absolute(w) > 0.5)
+ assert_equal(c, 1)
+ assert_equal(np.linalg.matrix_rank(a), 1)
+ assert_array_less(1, np.linalg.norm(a, ord=2))
+
+
if __name__ == '__main__':
run_module_suite()
diff --git a/numpy/linalg/umath_linalg.c.src b/numpy/linalg/umath_linalg.c.src
index 4b50bf1f6..a09d2c10a 100644
--- a/numpy/linalg/umath_linalg.c.src
+++ b/numpy/linalg/umath_linalg.c.src
@@ -2208,10 +2208,10 @@ process_@lapack_func@_results(GEEV_PARAMS_t *NPY_UNUSED(params))
/**begin repeat
- #TYPE=FLOAT,DOUBLE,CFLOAT,CDOUBLE#
- #COMPLEXTYPE=CFLOAT,CDOUBLE,CFLOAT,CDOUBLE#
- #ftype=fortran_real,fortran_doublereal,fortran_complex,fortran_doublecomplex#
- #lapack_func=sgeev,dgeev,cgeev,zgeev#
+ #TYPE=FLOAT,DOUBLE,CDOUBLE#
+ #COMPLEXTYPE=CFLOAT,CDOUBLE,CDOUBLE#
+ #ftype=fortran_real,fortran_doublereal,fortran_doublecomplex#
+ #lapack_func=sgeev,dgeev,zgeev#
*/
static inline void
@@ -2875,27 +2875,6 @@ static char equal_3_types[] = {
NPY_CDOUBLE, NPY_CDOUBLE, NPY_CDOUBLE
};
-static char equal_4_types[] = {
- NPY_FLOAT, NPY_FLOAT, NPY_FLOAT, NPY_FLOAT,
- NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE,
- NPY_CFLOAT, NPY_CFLOAT, NPY_CFLOAT, NPY_CFLOAT,
- NPY_CDOUBLE, NPY_CDOUBLE, NPY_CDOUBLE, NPY_CDOUBLE
-};
-
-static char equal_5_types[] = {
- NPY_FLOAT, NPY_FLOAT, NPY_FLOAT, NPY_FLOAT, NPY_FLOAT,
- NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE,
- NPY_CFLOAT, NPY_CFLOAT, NPY_CFLOAT, NPY_CFLOAT, NPY_CFLOAT,
- NPY_CDOUBLE, NPY_CDOUBLE, NPY_CDOUBLE, NPY_CDOUBLE, NPY_CDOUBLE
-};
-
-static char equal_6_types[] = {
- NPY_FLOAT, NPY_FLOAT, NPY_FLOAT, NPY_FLOAT, NPY_FLOAT, NPY_FLOAT,
- NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE, NPY_DOUBLE,
- NPY_CFLOAT, NPY_CFLOAT, NPY_CFLOAT, NPY_CFLOAT, NPY_CFLOAT, NPY_CFLOAT,
- NPY_CDOUBLE, NPY_CDOUBLE, NPY_CDOUBLE, NPY_CDOUBLE, NPY_CDOUBLE, NPY_CDOUBLE
-};
-
/* second result is logdet, that will always be a REAL */
static char slogdet_types[] = {
NPY_FLOAT, NPY_FLOAT, NPY_FLOAT,
@@ -3073,7 +3052,7 @@ GUFUNC_DESCRIPTOR_t gufunc_descriptors [] = {
"svd when n>=m. ",
4, 1, 1,
FUNC_ARRAY_NAME(svd_N),
- equal_2_types
+ svd_1_1_types
},
{
"svd_n",
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 8dc2ca86e..6c0a8f345 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -46,7 +46,7 @@ __docformat__ = "restructuredtext en"
__all__ = ['MAError', 'MaskError', 'MaskType', 'MaskedArray',
'bool_',
'abs', 'absolute', 'add', 'all', 'allclose', 'allequal', 'alltrue',
- 'amax', 'amin', 'angle', 'anom', 'anomalies', 'any', 'arange',
+ 'amax', 'amin', 'angle', 'anom', 'anomalies', 'any', 'append', 'arange',
'arccos', 'arccosh', 'arcsin', 'arcsinh', 'arctan', 'arctan2',
'arctanh', 'argmax', 'argmin', 'argsort', 'around',
'array', 'asarray', 'asanyarray',
@@ -416,14 +416,19 @@ def _check_fill_value(fill_value, ndtype):
fill_value = np.array(_recursive_set_fill_value(fill_value, descr),
dtype=ndtype)
else:
- if isinstance(fill_value, basestring) and (ndtype.char not in 'SVU'):
- fill_value = default_fill_value(ndtype)
+ if isinstance(fill_value, basestring) and (ndtype.char not in 'OSVU'):
+ err_msg = "Cannot set fill value of string with array of dtype %s"
+ raise TypeError(err_msg % ndtype)
else:
- # In case we want to convert 1e+20 to int...
+ # In case we want to convert 1e20 to int...
try:
- fill_value = np.array(fill_value, copy=False, dtype=ndtype)#.item()
+ fill_value = np.array(fill_value, copy=False, dtype=ndtype)
except OverflowError:
- fill_value = default_fill_value(ndtype)
+ # Raise TypeError instead of OverflowError. OverflowError
+ # is seldom used, and the real problem here is that the
+ # passed fill_value is not compatible with the ndtype.
+ err_msg = "Fill value %s overflows dtype %s"
+ raise TypeError(err_msg % (fill_value, ndtype))
return np.array(fill_value)
@@ -838,8 +843,7 @@ class _MaskedUnaryOperation:
d = getdata(a)
# Case 1.1. : Domained function
if self.domain is not None:
- with np.errstate():
- np.seterr(divide='ignore', invalid='ignore')
+ with np.errstate(divide='ignore', invalid='ignore'):
result = self.f(d, *args, **kwargs)
# Make a mask
m = ~umath.isfinite(result)
@@ -927,8 +931,7 @@ class _MaskedBinaryOperation:
else:
m = umath.logical_or(ma, mb)
# Get the result
- with np.errstate():
- np.seterr(divide='ignore', invalid='ignore')
+ with np.errstate(divide='ignore', invalid='ignore'):
result = self.f(da, db, *args, **kwargs)
# check it worked
if result is NotImplemented:
@@ -940,11 +943,8 @@ class _MaskedBinaryOperation:
return result
# Case 2. : array
# Revert result to da where masked
- if m.any():
- np.copyto(result, 0, casting='unsafe', where=m)
- # This only makes sense if the operation preserved the dtype
- if result.dtype == da.dtype:
- result += m * da
+ if m is not nomask:
+ np.copyto(result, da, casting='unsafe', where=m)
# Transforms to a (subclass of) MaskedArray
result = result.view(get_masked_subclass(a, b))
result._mask = m
@@ -1068,8 +1068,7 @@ class _DomainedBinaryOperation:
(da, db) = (getdata(a, subok=False), getdata(b, subok=False))
(ma, mb) = (getmask(a), getmask(b))
# Get the result
- with np.errstate():
- np.seterr(divide='ignore', invalid='ignore')
+ with np.errstate(divide='ignore', invalid='ignore'):
result = self.f(da, db, *args, **kwargs)
# check it worked
if result is NotImplemented:
@@ -1089,8 +1088,7 @@ class _DomainedBinaryOperation:
else:
return result
# When the mask is True, put back da
- np.copyto(result, 0, casting='unsafe', where=m)
- result += m * da
+ np.copyto(result, da, casting='unsafe', where=m)
result = result.view(get_masked_subclass(a, b))
result._mask = m
if isinstance(b, MaskedArray):
@@ -2465,7 +2463,6 @@ class _arraymethod(object):
return result
-
class MaskedIterator(object):
"""
Flat iterator object to iterate over masked arrays.
@@ -2529,8 +2526,14 @@ class MaskedIterator(object):
result = self.dataiter.__getitem__(indx).view(type(self.ma))
if self.maskiter is not None:
_mask = self.maskiter.__getitem__(indx)
- _mask.shape = result.shape
- result._mask = _mask
+ if isinstance(_mask, ndarray):
+ # set shape to match that of data; this is needed for matrices
+ _mask.shape = result.shape
+ result._mask = _mask
+ elif isinstance(_mask, np.void):
+ return mvoid(result, mask=_mask, hardmask=self.ma._hardmask)
+ elif _mask: # Just a scalar, masked
+ return masked
return result
### This won't work is ravel makes a copy
@@ -2562,8 +2565,12 @@ class MaskedIterator(object):
"""
d = next(self.dataiter)
- if self.maskiter is not None and next(self.maskiter):
- d = masked
+ if self.maskiter is not None:
+ m = next(self.maskiter)
+ if isinstance(m, np.void):
+ return mvoid(d, mask=m, hardmask=self.ma._hardmask)
+ elif m: # Just a scalar, masked
+ return masked
return d
next = __next__
@@ -3580,9 +3587,8 @@ class MaskedArray(ndarray):
if m.dtype.names:
m = m.view((bool, len(m.dtype)))
if m.any():
- r = np.array(self._data.tolist(), dtype=object)
- np.copyto(r, f, where=m)
- return str(tuple(r))
+ return str(tuple((f if _m else _d) for _d, _m in
+ zip(self._data.tolist(), m)))
else:
return str(self._data)
elif m:
@@ -3593,7 +3599,7 @@ class MaskedArray(ndarray):
names = self.dtype.names
if names is None:
res = self._data.astype("O")
- res[m] = f
+ res.view(ndarray)[m] = f
else:
rdtype = _recursive_make_descr(self.dtype, "O")
res = self._data.astype(rdtype)
@@ -3607,19 +3613,22 @@ class MaskedArray(ndarray):
"""
n = len(self.shape)
- name = repr(self._data).split('(')[0]
+ if self._baseclass is np.ndarray:
+ name = 'array'
+ else:
+ name = self._baseclass.__name__
+
parameters = dict(name=name, nlen=" " * len(name),
- data=str(self), mask=str(self._mask),
- fill=str(self.fill_value), dtype=str(self.dtype))
+ data=str(self), mask=str(self._mask),
+ fill=str(self.fill_value), dtype=str(self.dtype))
if self.dtype.names:
if n <= 1:
return _print_templates['short_flx'] % parameters
- return _print_templates['long_flx'] % parameters
+ return _print_templates['long_flx'] % parameters
elif n <= 1:
return _print_templates['short_std'] % parameters
return _print_templates['long_std'] % parameters
-
def __eq__(self, other):
"Check whether other equals self elementwise"
if self is masked:
@@ -3824,8 +3833,7 @@ class MaskedArray(ndarray):
"Raise self to the power other, in place."
other_data = getdata(other)
other_mask = getmask(other)
- with np.errstate():
- np.seterr(divide='ignore', invalid='ignore')
+ with np.errstate(divide='ignore', invalid='ignore'):
ndarray.__ipow__(self._data, np.where(self._mask, 1, other_data))
invalid = np.logical_not(np.isfinite(self._data))
if invalid.any():
@@ -3976,21 +3984,16 @@ class MaskedArray(ndarray):
"""
m = self._mask
s = self.shape
- ls = len(s)
if m is nomask:
- if ls == 0:
- return 1
- if ls == 1:
- return s[0]
if axis is None:
return self.size
else:
n = s[axis]
t = list(s)
del t[axis]
- return np.ones(t) * n
+ return np.full(t, n, dtype=np.intp)
n1 = np.size(m, axis)
- n2 = m.astype(int).sum(axis)
+ n2 = np.sum(m, axis=axis, dtype=np.intp)
if axis is None:
return (n1 - n2)
else:
@@ -5071,12 +5074,12 @@ class MaskedArray(ndarray):
filler = maximum_fill_value(self)
else:
filler = fill_value
- idx = np.indices(self.shape)
+ idx = np.meshgrid(*[np.arange(x) for x in self.shape], sparse=True,
+ indexing='ij')
idx[axis] = self.filled(filler).argsort(axis=axis, kind=kind,
order=order)
- idx_l = idx.tolist()
- tmp_mask = self._mask[idx_l].flat
- tmp_data = self._data[idx_l].flat
+ tmp_mask = self._mask[idx].flat
+ tmp_data = self._data[idx].flat
self._data.flat = tmp_data
self._mask.flat = tmp_mask
return
@@ -5387,10 +5390,20 @@ class MaskedArray(ndarray):
#........................
def tostring(self, fill_value=None, order='C'):
"""
+ This function is a compatibility alias for tobytes. Despite its name it
+ returns bytes not strings.
+ """
+
+ return self.tobytes(fill_value, order='C')
+ #........................
+ def tobytes(self, fill_value=None, order='C'):
+ """
Return the array data as a string containing the raw bytes in the array.
The array is filled with a fill value before the string conversion.
+ .. versionadded:: 1.9.0
+
Parameters
----------
fill_value : scalar, optional
@@ -5406,22 +5419,22 @@ class MaskedArray(ndarray):
See Also
--------
- ndarray.tostring
+ ndarray.tobytes
tolist, tofile
Notes
-----
- As for `ndarray.tostring`, information about the shape, dtype, etc.,
+ As for `ndarray.tobytes`, information about the shape, dtype, etc.,
but also about `fill_value`, will be lost.
Examples
--------
>>> x = np.ma.array(np.array([[1, 2], [3, 4]]), mask=[[0, 1], [1, 0]])
- >>> x.tostring()
+ >>> x.tobytes()
'\\x01\\x00\\x00\\x00?B\\x0f\\x00?B\\x0f\\x00\\x04\\x00\\x00\\x00'
"""
- return self.filled(fill_value).tostring(order=order)
+ return self.filled(fill_value).tobytes(order=order)
#........................
def tofile(self, fid, sep="", format="%s"):
"""
@@ -5503,9 +5516,9 @@ class MaskedArray(ndarray):
self.shape,
self.dtype,
self.flags.fnc,
- self._data.tostring(cf),
+ self._data.tobytes(cf),
#self._data.tolist(),
- getmaskarray(self).tostring(cf),
+ getmaskarray(self).tobytes(cf),
#getmaskarray(self).tolist(),
self._fill_value,
)
@@ -6089,8 +6102,7 @@ def power(a, b, third=None):
else:
basetype = MaskedArray
# Get the result and view it as a (subclass of) MaskedArray
- with np.errstate():
- np.seterr(divide='ignore', invalid='ignore')
+ with np.errstate(divide='ignore', invalid='ignore'):
result = np.where(m, fa, umath.power(fa, fb)).view(basetype)
result._update_from(a)
# Find where we're in trouble w/ NaNs and Infs
@@ -6151,7 +6163,7 @@ def argmax(a, axis=None, fill_value=None):
pass
d = filled(a, fill_value)
return d.argmax(axis=axis)
-argmin.__doc__ = MaskedArray.argmax.__doc__
+argmax.__doc__ = MaskedArray.argmax.__doc__
def sort(a, axis= -1, kind='quicksort', order=None, endwith=True, fill_value=None):
"Function version of the eponymous method."
@@ -6167,7 +6179,8 @@ def sort(a, axis= -1, kind='quicksort', order=None, endwith=True, fill_value=Non
else:
filler = fill_value
# return
- indx = np.indices(a.shape).tolist()
+ indx = np.meshgrid(*[np.arange(x) for x in a.shape], sparse=True,
+ indexing='ij')
indx[axis] = filled(a, filler).argsort(axis=axis, kind=kind, order=order)
return a[indx]
sort.__doc__ = MaskedArray.sort.__doc__
@@ -6921,6 +6934,13 @@ def allclose (a, b, masked_equal=True, rtol=1e-5, atol=1e-8):
"""
x = masked_array(a, copy=False)
y = masked_array(b, copy=False)
+
+ # make sure y is an inexact type to avoid abs(MIN_INT); will cause
+ # casting of x later.
+ dtype = np.result_type(y, 1.)
+ if y.dtype != dtype:
+ y = masked_array(y, dtype=dtype, copy=False)
+
m = mask_or(getmask(x), getmask(y))
xinf = np.isinf(masked_array(x, copy=False, mask=m)).filled(False)
# If we have some infs, they should fall at the same place.
@@ -6932,13 +6952,16 @@ def allclose (a, b, masked_equal=True, rtol=1e-5, atol=1e-8):
atol + rtol * umath.absolute(y)),
masked_equal)
return np.all(d)
+
if not np.all(filled(x[xinf] == y[xinf], masked_equal)):
return False
x = x[~xinf]
y = y[~xinf]
+
d = filled(umath.less_equal(umath.absolute(x - y),
atol + rtol * umath.absolute(y)),
masked_equal)
+
return np.all(d)
#..............................................................................
@@ -7243,3 +7266,41 @@ zeros = _convert2ma('zeros', params=dict(fill_value=None, hardmask=False))
zeros_like = np.zeros_like
###############################################################################
+def append(a, b, axis=None):
+ """Append values to the end of an array.
+
+ .. versionadded:: 1.9.0
+
+ Parameters
+ ----------
+ arr : array_like
+ Values are appended to a copy of this array.
+ values : array_like
+ These values are appended to a copy of `arr`. It must be of the
+ correct shape (the same shape as `arr`, excluding `axis`). If `axis`
+ is not specified, `values` can be any shape and will be flattened
+ before use.
+ axis : int, optional
+ The axis along which `values` are appended. If `axis` is not given,
+ both `arr` and `values` are flattened before use.
+
+ Returns
+ -------
+ append : MaskedArray
+ A copy of `arr` with `values` appended to `axis`. Note that `append`
+ does not occur in-place: a new array is allocated and filled. If
+ `axis` is None, the result is a flattened array.
+
+ See Also
+ --------
+ numpy.append : Equivalent function in the top-level NumPy module.
+
+ Examples
+ --------
+ >>> import numpy.ma as ma
+ >>> a = ma.masked_values([1, 2, 3], 2)
+ >>> b = ma.masked_values([[4, 5, 6], [7, 8, 9]], 7)
+ >>> print(ma.append(a, b))
+ [1 -- 3 4 5 6 -- 8 9]
+ """
+ return concatenate([a, b], axis)
diff --git a/numpy/ma/extras.py b/numpy/ma/extras.py
index d14812093..82a61a67c 100644
--- a/numpy/ma/extras.py
+++ b/numpy/ma/extras.py
@@ -416,26 +416,53 @@ def apply_over_axes(func, a, axes):
"""
(This docstring will be overwritten)
"""
- val = np.asarray(a)
- msk = getmaskarray(a)
+ val = asarray(a)
N = a.ndim
if array(axes).ndim == 0:
axes = (axes,)
for axis in axes:
if axis < 0: axis = N + axis
args = (val, axis)
- res = ma.array(func(*(val, axis)), mask=func(*(msk, axis)))
+ res = func(*args)
if res.ndim == val.ndim:
- (val, msk) = (res._data, res._mask)
+ val = res
else:
res = ma.expand_dims(res, axis)
if res.ndim == val.ndim:
- (val, msk) = (res._data, res._mask)
+ val = res
else:
- raise ValueError("Function is not returning"\
- " an array of correct shape")
+ raise ValueError("function is not returning "
+ "an array of the correct shape")
return val
-apply_over_axes.__doc__ = np.apply_over_axes.__doc__
+apply_over_axes.__doc__ = np.apply_over_axes.__doc__[
+ :np.apply_over_axes.__doc__.find('Notes')].rstrip() + \
+ """
+
+ Examples
+ --------
+ >>> a = ma.arange(24).reshape(2,3,4)
+ >>> a[:,0,1] = ma.masked
+ >>> a[:,1,:] = ma.masked
+ >>> print a
+ [[[0 -- 2 3]
+ [-- -- -- --]
+ [8 9 10 11]]
+
+ [[12 -- 14 15]
+ [-- -- -- --]
+ [20 21 22 23]]]
+ >>> print ma.apply_over_axes(ma.sum, a, [0,2])
+ [[[46]
+ [--]
+ [124]]]
+
+ Tuple axis arguments to ufuncs are equivalent:
+
+ >>> print ma.sum(a, axis=(0,2)).reshape((1,-1,1))
+ [[[46]
+ [--]
+ [124]]]
+"""
def average(a, axis=None, weights=None, returned=False):
@@ -448,8 +475,8 @@ def average(a, axis=None, weights=None, returned=False):
Data to be averaged.
Masked entries are not taken into account in the computation.
axis : int, optional
- Axis along which the variance is computed. The default is to compute
- the variance of the flattened array.
+ Axis along which the average is computed. The default is to compute
+ the average of the flattened array.
weights : array_like, optional
The importance that each element has in the computation of the average.
The weights array can either be 1-D (in which case its length must be
@@ -540,7 +567,7 @@ def average(a, axis=None, weights=None, returned=False):
else:
if weights is None:
n = add.reduce(a, axis)
- d = umath.add.reduce((-mask), axis=axis, dtype=float)
+ d = umath.add.reduce((~mask), axis=axis, dtype=float)
else:
w = filled(weights, 0.0)
wsh = w.shape
@@ -641,15 +668,9 @@ def median(a, axis=None, out=None, overwrite_input=False):
fill_value = 1e+20)
"""
- def _median1D(data):
- counts = filled(count(data), 0)
- (idx, rmd) = divmod(counts, 2)
- if rmd:
- choice = slice(idx, idx + 1)
- else:
- choice = slice(idx - 1, idx + 1)
- return data[choice].mean(0)
- #
+ if not hasattr(a, 'mask') or np.count_nonzero(a.mask) == 0:
+ return masked_array(np.median(a, axis=axis, out=out,
+ overwrite_input=overwrite_input), copy=False)
if overwrite_input:
if axis is None:
asorted = a.ravel()
@@ -660,14 +681,29 @@ def median(a, axis=None, out=None, overwrite_input=False):
else:
asorted = sort(a, axis=axis)
if axis is None:
- result = _median1D(asorted)
+ axis = 0
+ elif axis < 0:
+ axis += a.ndim
+
+ counts = asorted.shape[axis] - (asorted.mask).sum(axis=axis)
+ h = counts // 2
+ # create indexing mesh grid for all but reduced axis
+ axes_grid = [np.arange(x) for i, x in enumerate(asorted.shape)
+ if i != axis]
+ ind = np.meshgrid(*axes_grid, sparse=True, indexing='ij')
+ # insert indices of low and high median
+ ind.insert(axis, h - 1)
+ low = asorted[ind]
+ ind[axis] = h
+ high = asorted[ind]
+ # duplicate high if odd number of elements so mean does nothing
+ odd = counts % 2 == 1
+ if asorted.ndim == 1:
+ if odd:
+ low = high
else:
- result = apply_along_axis(_median1D, axis, asorted)
- if out is not None:
- out = result
- return result
-
-
+ low[odd] = high[odd]
+ return np.ma.mean([low, high], axis=0, out=out)
#..............................................................................
@@ -842,9 +878,9 @@ def mask_rowcols(a, axis=None):
fill_value=999999)
"""
- a = asarray(a)
+ a = array(a, subok=False)
if a.ndim != 2:
- raise NotImplementedError("compress2d works for 2D arrays only.")
+ raise NotImplementedError("mask_rowcols works for 2D arrays only.")
m = getmask(a)
# Nothing is masked: return a
if m is nomask or not m.any():
@@ -1735,7 +1771,7 @@ def _ezclump(mask):
#def clump_masked(a):
if mask.ndim > 1:
mask = mask.ravel()
- idx = (mask[1:] - mask[:-1]).nonzero()
+ idx = (mask[1:] ^ mask[:-1]).nonzero()
idx = idx[0] + 1
slices = [slice(left, right)
for (left, right) in zip(itertools.chain([0], idx),
diff --git a/numpy/ma/mrecords.py b/numpy/ma/mrecords.py
index a2380d813..e66596509 100644
--- a/numpy/ma/mrecords.py
+++ b/numpy/ma/mrecords.py
@@ -426,8 +426,8 @@ The fieldname base is either `_data` or `_mask`."""
self.shape,
self.dtype,
self.flags.fnc,
- self._data.tostring(),
- self._mask.tostring(),
+ self._data.tobytes(),
+ self._mask.tobytes(),
self._fill_value,
)
return state
diff --git a/numpy/ma/tests/test_core.py b/numpy/ma/tests/test_core.py
index 764915236..8172335a8 100644
--- a/numpy/ma/tests/test_core.py
+++ b/numpy/ma/tests/test_core.py
@@ -13,6 +13,8 @@ import sys
import pickle
from functools import reduce
+from nose.tools import assert_raises
+
import numpy as np
import numpy.ma.core
import numpy.core.fromnumeric as fromnumeric
@@ -192,8 +194,7 @@ class TestMaskedArray(TestCase):
def test_fix_invalid(self):
# Checks fix_invalid.
- with np.errstate():
- np.seterr(invalid='ignore')
+ with np.errstate(invalid='ignore'):
data = masked_array([np.nan, 0., 1.], mask=[0, 0, 1])
data_fixed = fix_invalid(data)
assert_equal(data_fixed._data, [data.fill_value, 0., 1.])
@@ -354,6 +355,13 @@ class TestMaskedArray(TestCase):
assert_equal(copied.mask, [0, 0, 0])
assert_equal(a.mask, [0, 1, 0])
+ def test_str_repr(self):
+ a = array([0, 1, 2], mask=[False, True, False])
+ assert_equal(str(a), '[0 -- 2]')
+ assert_equal(repr(a), 'masked_array(data = [0 -- 2],\n'
+ ' mask = [False True False],\n'
+ ' fill_value = 999999)\n')
+
def test_pickling(self):
# Tests pickling
a = arange(10)
@@ -474,6 +482,10 @@ class TestMaskedArray(TestCase):
atest[idx] = btest[idx]
assert_equal(atest, [20])
+ def test_filled_w_object_dtype(self):
+ a = np.ma.masked_all(1, dtype='O')
+ assert_equal(a.filled('x')[0], 'x')
+
def test_filled_w_flexible_dtype(self):
# Test filled w/ flexible dtype
flexi = array([(1, 1, 1)],
@@ -795,23 +807,29 @@ class TestMaskedArrayArithmetic(TestCase):
def test_count_func(self):
# Tests count
- ott = array([0., 1., 2., 3.], mask=[1, 0, 0, 0])
- if sys.version_info[0] >= 3:
- self.assertTrue(isinstance(count(ott), np.integer))
- else:
- self.assertTrue(isinstance(count(ott), int))
- assert_equal(3, count(ott))
assert_equal(1, count(1))
assert_equal(0, array(1, mask=[1]))
+
+ ott = array([0., 1., 2., 3.], mask=[1, 0, 0, 0])
+ res = count(ott)
+ self.assertTrue(res.dtype.type is np.intp)
+ assert_equal(3, res)
+
ott = ott.reshape((2, 2))
- assert_(isinstance(count(ott, 0), ndarray))
- if sys.version_info[0] >= 3:
- assert_(isinstance(count(ott), np.integer))
- else:
- assert_(isinstance(count(ott), int))
- assert_equal(3, count(ott))
- assert_(getmask(count(ott, 0)) is nomask)
- assert_equal([1, 2], count(ott, 0))
+ res = count(ott)
+ assert_(res.dtype.type is np.intp)
+ assert_equal(3, res)
+ res = count(ott, 0)
+ assert_(isinstance(res, ndarray))
+ assert_equal([1, 2], res)
+ assert_(getmask(res) is nomask)
+
+ ott= array([0., 1., 2., 3.])
+ res = count(ott, 0)
+ assert_(isinstance(res, ndarray))
+ assert_(res.dtype.type is np.intp)
+
+ assert_raises(IndexError, ott.count, 1)
def test_minmax_func(self):
# Tests minimum and maximum.
@@ -1275,23 +1293,64 @@ class TestMaskedArrayAttributes(TestCase):
assert_equal(a.mask, nomask)
def test_flat(self):
+ # Test that flat can return all types of items [#4585, #4615]
+ # test simple access
+ test = masked_array(np.matrix([[1, 2, 3]]), mask=[0, 0, 1])
+ assert_equal(test.flat[1], 2)
+ assert_equal(test.flat[2], masked)
+ self.assertTrue(np.all(test.flat[0:2] == test[0, 0:2]))
# Test flat on masked_matrices
test = masked_array(np.matrix([[1, 2, 3]]), mask=[0, 0, 1])
test.flat = masked_array([3, 2, 1], mask=[1, 0, 0])
control = masked_array(np.matrix([[3, 2, 1]]), mask=[1, 0, 0])
assert_equal(test, control)
- #
+ # Test setting
test = masked_array(np.matrix([[1, 2, 3]]), mask=[0, 0, 1])
testflat = test.flat
testflat[:] = testflat[[2, 1, 0]]
assert_equal(test, control)
+ testflat[0] = 9
+ assert_equal(test[0, 0], 9)
+ # test 2-D record array
+ # ... on structured array w/ masked records
+ x = array([[(1, 1.1, 'one'), (2, 2.2, 'two'), (3, 3.3, 'thr')],
+ [(4, 4.4, 'fou'), (5, 5.5, 'fiv'), (6, 6.6, 'six')]],
+ dtype=[('a', int), ('b', float), ('c', '|S8')])
+ x['a'][0, 1] = masked
+ x['b'][1, 0] = masked
+ x['c'][0, 2] = masked
+ x[-1, -1] = masked
+ xflat = x.flat
+ assert_equal(xflat[0], x[0, 0])
+ assert_equal(xflat[1], x[0, 1])
+ assert_equal(xflat[2], x[0, 2])
+ assert_equal(xflat[:3], x[0])
+ assert_equal(xflat[3], x[1, 0])
+ assert_equal(xflat[4], x[1, 1])
+ assert_equal(xflat[5], x[1, 2])
+ assert_equal(xflat[3:], x[1])
+ assert_equal(xflat[-1], x[-1, -1])
+ i = 0
+ j = 0
+ for xf in xflat:
+ assert_equal(xf, x[j, i])
+ i += 1
+ if i >= x.shape[-1]:
+ i = 0
+ j += 1
+ # test that matrices keep the correct shape (#4615)
+ a = masked_array(np.matrix(np.eye(2)), mask=0)
+ b = a.flat
+ b01 = b[:2]
+ assert_equal(b01.data, array([[1., 0.]]))
+ assert_equal(b01.mask, array([[False, False]]))
#------------------------------------------------------------------------------
class TestFillingValues(TestCase):
- #
+
def test_check_on_scalar(self):
- # Test _check_fill_value
+ # Test _check_fill_value set to valid and invalid values
_check_fill_value = np.ma.core._check_fill_value
#
fval = _check_fill_value(0, int)
@@ -1303,9 +1362,8 @@ class TestFillingValues(TestCase):
assert_equal(fval, asbytes("0"))
fval = _check_fill_value(None, "|S3")
assert_equal(fval, default_fill_value("|S3"))
- #
- fval = _check_fill_value(1e+20, int)
- assert_equal(fval, default_fill_value(0))
+ self.assertRaises(TypeError, _check_fill_value, 1e+20, int)
+ self.assertRaises(TypeError, _check_fill_value, 'stuff', int)
def test_check_on_fields(self):
# Tests _check_fill_value with records
@@ -1991,6 +2049,10 @@ class TestMaskedArrayMethods(TestCase):
a[0] = 0
self.assertTrue(allclose(a, 0, masked_equal=True))
+ # Test that the function works for MIN_INT integer typed arrays
+ a = masked_array([np.iinfo(np.int_).min], dtype=np.int_)
+ self.assertTrue(allclose(a, a))
+
def test_allany(self):
# Checks the any/all methods/functions.
x = np.array([[0.13, 0.26, 0.90],
@@ -3571,6 +3633,45 @@ def test_masked_array():
a = np.ma.array([0, 1, 2, 3], mask=[0, 0, 1, 0])
assert_equal(np.argwhere(a), [[1], [3]])
+def test_append_masked_array():
+ a = np.ma.masked_equal([1,2,3], value=2)
+ b = np.ma.masked_equal([4,3,2], value=2)
+
+ result = np.ma.append(a, b)
+ expected_data = [1, 2, 3, 4, 3, 2]
+ expected_mask = [False, True, False, False, False, True]
+ assert_array_equal(result.data, expected_data)
+ assert_array_equal(result.mask, expected_mask)
+
+ a = np.ma.masked_all((2,2))
+ b = np.ma.ones((3,1))
+
+ result = np.ma.append(a, b)
+ expected_data = [1] * 3
+ expected_mask = [True] * 4 + [False] * 3
+ assert_array_equal(result.data[-3], expected_data)
+ assert_array_equal(result.mask, expected_mask)
+
+ result = np.ma.append(a, b, axis=None)
+ assert_array_equal(result.data[-3], expected_data)
+ assert_array_equal(result.mask, expected_mask)
+
+
+def test_append_masked_array_along_axis():
+ a = np.ma.masked_equal([1,2,3], value=2)
+ b = np.ma.masked_values([[4, 5, 6], [7, 8, 9]], 7)
+
+ # When `axis` is specified, `values` must have the correct shape.
+ assert_raises(ValueError, np.ma.append, a, b, axis=0)
+
+ result = np.ma.append(a[np.newaxis,:], b, axis=0)
+ expected = np.ma.arange(1, 10)
+ expected[[1, 6]] = np.ma.masked
+ expected = expected.reshape((3,3))
+ assert_array_equal(result.data, expected.data)
+ assert_array_equal(result.mask, expected.mask)
+
+
###############################################################################
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/ma/tests/test_extras.py b/numpy/ma/tests/test_extras.py
index dc0f87b92..6ce1dc346 100644
--- a/numpy/ma/tests/test_extras.py
+++ b/numpy/ma/tests/test_extras.py
@@ -479,6 +479,16 @@ class TestApplyAlongAxis(TestCase):
xa = apply_along_axis(myfunc, 2, a)
assert_equal(xa, [[1, 4], [7, 10]])
+ # Tests kwargs functions
+ def test_3d_kwargs(self):
+ a = arange(12).reshape(2, 2, 3)
+
+ def myfunc(b, offset=0):
+ return b[1+offset]
+
+ xa = apply_along_axis(myfunc, 2, a, offset=1)
+ assert_equal(xa, [[2, 5], [8, 11]])
+
class TestApplyOverAxes(TestCase):
# Tests apply_over_axes
@@ -489,7 +499,8 @@ class TestApplyOverAxes(TestCase):
assert_equal(test, ctrl)
a[(a % 2).astype(np.bool)] = masked
test = apply_over_axes(np.sum, a, [0, 2])
- ctrl = np.array([[[30], [44], [60]]])
+ ctrl = np.array([[[28], [44], [60]]])
+ assert_equal(test, ctrl)
class TestMedian(TestCase):
@@ -530,6 +541,19 @@ class TestMedian(TestCase):
x[x % 5 == 0] = masked
assert_equal(median(x, 0), [[12, 10], [8, 9], [16, 17]])
+ def test_neg_axis(self):
+ x = masked_array(np.arange(30).reshape(10, 3))
+ x[:3] = x[-3:] = masked
+ assert_equal(median(x, axis=-1), median(x, axis=1))
+
+ def test_out(self):
+ x = masked_array(np.arange(30).reshape(10, 3))
+ x[:3] = x[-3:] = masked
+ out = masked_array(np.ones(10))
+ r = median(x, axis=1, out=out)
+ assert_equal(r, out)
+ assert_(type(r) == MaskedArray)
+
class TestCov(TestCase):
diff --git a/numpy/ma/tests/test_old_ma.py b/numpy/ma/tests/test_old_ma.py
index 27d699385..047f91c77 100644
--- a/numpy/ma/tests/test_old_ma.py
+++ b/numpy/ma/tests/test_old_ma.py
@@ -153,19 +153,14 @@ class TestMa(TestCase):
def test_xtestCount(self):
# Test count
ott = array([0., 1., 2., 3.], mask=[1, 0, 0, 0])
- if sys.version_info[0] >= 3:
- self.assertTrue(isinstance(count(ott), np.integer))
- else:
- self.assertTrue(isinstance(count(ott), int))
+ self.assertTrue(count(ott).dtype.type is np.intp)
self.assertEqual(3, count(ott))
self.assertEqual(1, count(1))
self.assertTrue(eq(0, array(1, mask=[1])))
ott = ott.reshape((2, 2))
+ self.assertTrue(count(ott).dtype.type is np.intp)
assert_(isinstance(count(ott, 0), np.ndarray))
- if sys.version_info[0] >= 3:
- assert_(isinstance(count(ott), np.integer))
- else:
- assert_(isinstance(count(ott), int))
+ self.assertTrue(count(ott).dtype.type is np.intp)
self.assertTrue(eq(3, count(ott)))
assert_(getmask(count(ott, 0)) is nomask)
self.assertTrue(eq([1, 2], count(ott, 0)))
@@ -612,8 +607,7 @@ class TestMa(TestCase):
def test_testScalarArithmetic(self):
xm = array(0, mask=1)
#TODO FIXME: Find out what the following raises a warning in r8247
- with np.errstate():
- np.seterr(divide='ignore')
+ with np.errstate(divide='ignore'):
self.assertTrue((1 / array(0)).mask)
self.assertTrue((1 + xm).mask)
self.assertTrue((-xm).mask)
diff --git a/numpy/ma/tests/test_subclassing.py b/numpy/ma/tests/test_subclassing.py
index c2c9b8ec9..ade5c59da 100644
--- a/numpy/ma/tests/test_subclassing.py
+++ b/numpy/ma/tests/test_subclassing.py
@@ -82,6 +82,24 @@ class MMatrix(MaskedArray, np.matrix,):
mmatrix = MMatrix
+# also a subclass that overrides __str__, __repr__ and __setitem__, disallowing
+# setting to non-class values (and thus np.ma.core.masked_print_option)
+class ComplicatedSubArray(SubArray):
+ def __str__(self):
+ return 'myprefix {0} mypostfix'.format(
+ super(ComplicatedSubArray, self).__str__())
+
+ def __repr__(self):
+ # Return a repr that does not start with 'name('
+ return '<{0} {1}>'.format(self.__class__.__name__, self)
+
+ def __setitem__(self, item, value):
+ # this ensures direct assignment to masked_print_option will fail
+ if not isinstance(value, ComplicatedSubArray):
+ raise ValueError("Can only set to MySubArray values")
+ super(ComplicatedSubArray, self).__setitem__(item, value)
+
+
class TestSubclassing(TestCase):
# Test suite for masked subclasses of ndarray.
@@ -187,6 +205,31 @@ class TestSubclassing(TestCase):
assert_equal(mxsub.info, xsub.info)
assert_equal(mxsub._mask, m)
+ def test_subclass_repr(self):
+ """test that repr uses the name of the subclass
+ and 'array' for np.ndarray"""
+ x = np.arange(5)
+ mx = masked_array(x, mask=[True, False, True, False, False])
+ self.assertTrue(repr(mx).startswith('masked_array'))
+ xsub = SubArray(x)
+ mxsub = masked_array(xsub, mask=[True, False, True, False, False])
+ self.assertTrue(repr(mxsub).startswith(
+ 'masked_{0}(data = [-- 1 -- 3 4]'.format(SubArray.__name__)))
+
+ def test_subclass_str(self):
+ """test str with subclass that has overridden str, setitem"""
+ # first without override
+ x = np.arange(5)
+ xsub = SubArray(x)
+ mxsub = masked_array(xsub, mask=[True, False, True, False, False])
+ self.assertTrue(str(mxsub) == '[-- 1 -- 3 4]')
+
+ xcsub = ComplicatedSubArray(x)
+ assert_raises(ValueError, xcsub.__setitem__, 0,
+ np.ma.core.masked_print_option)
+ mxcsub = masked_array(xcsub, mask=[True, False, True, False, False])
+ self.assertTrue(str(mxcsub) == 'myprefix [-- 1 -- 3 4] mypostfix')
+
###############################################################################
if __name__ == '__main__':
diff --git a/numpy/matrixlib/tests/test_defmatrix.py b/numpy/matrixlib/tests/test_defmatrix.py
index d1a4e4ab5..a06a564aa 100644
--- a/numpy/matrixlib/tests/test_defmatrix.py
+++ b/numpy/matrixlib/tests/test_defmatrix.py
@@ -285,8 +285,8 @@ class TestMatrixReturn(TestCase):
'getA', 'getA1', 'item', 'nonzero', 'put', 'putmask', 'resize',
'searchsorted', 'setflags', 'setfield', 'sort',
'partition', 'argpartition',
- 'take', 'tofile', 'tolist', 'tostring', 'all', 'any', 'sum',
- 'argmax', 'argmin', 'min', 'max', 'mean', 'var', 'ptp',
+ 'take', 'tofile', 'tolist', 'tostring', 'tobytes', 'all', 'any',
+ 'sum', 'argmax', 'argmin', 'min', 'max', 'mean', 'var', 'ptp',
'prod', 'std', 'ctypes', 'itemset', 'setasflat'
]
for attrib in dir(a):
diff --git a/numpy/polynomial/_polybase.py b/numpy/polynomial/_polybase.py
new file mode 100644
index 000000000..23608c74a
--- /dev/null
+++ b/numpy/polynomial/_polybase.py
@@ -0,0 +1,964 @@
+"""
+Abstract base class for the various polynomial Classes.
+
+The ABCPolyBase class provides the methods needed to implement the common API
+for the various polynomial classes. It operates as a mixin, but uses the
+abc module from the stdlib, hence it is only available for Python >= 2.6.
+
+"""
+from __future__ import division, absolute_import, print_function
+
+from abc import ABCMeta, abstractmethod, abstractproperty
+from numbers import Number
+
+import numpy as np
+from . import polyutils as pu
+
+__all__ = ['ABCPolyBase']
+
+class ABCPolyBase(object):
+ """An abstract base class for series classes.
+
+ ABCPolyBase provides the standard Python numerical methods
+ '+', '-', '*', '//', '%', 'divmod', '**', and '()' along with the
+ methods listed below.
+
+ .. versionadded:: 1.9.0
+
+ Parameters
+ ----------
+ coef : array_like
+ Series coefficients in order of increasing degree, i.e.,
+ ``(1, 2, 3)`` gives ``1*P_0(x) + 2*P_1(x) + 3*P_2(x)``, where
+ ``P_i`` is the basis polynomials of degree ``i``.
+ domain : (2,) array_like, optional
+ Domain to use. The interval ``[domain[0], domain[1]]`` is mapped
+ to the interval ``[window[0], window[1]]`` by shifting and scaling.
+ The default value is the derived class domain.
+ window : (2,) array_like, optional
+ Window, see domain for its use. The default value is the
+ derived class window.
+
+ Attributes
+ ----------
+ coef : (N,) ndarray
+ Series coefficients in order of increasing degree.
+ domain : (2,) ndarray
+ Domain that is mapped to window.
+ window : (2,) ndarray
+ Window that domain is mapped to.
+
+ Class Attributes
+ ----------------
+ maxpower : int
+ Maximum power allowed, i.e., the largest number ``n`` such that
+ ``p(x)**n`` is allowed. This is to limit runaway polynomial size.
+ domain : (2,) ndarray
+ Default domain of the class.
+ window : (2,) ndarray
+ Default window of the class.
+
+ """
+ __metaclass__ = ABCMeta
+
+ # Not hashable
+ __hash__ = None
+
+ # Don't let participate in array operations. Value doesn't matter.
+ __array_priority__ = 1000
+
+ # Limit runaway size. T_n^m has degree n*m
+ maxpower = 100
+
+ @abstractproperty
+ def domain(self):
+ pass
+
+ @abstractproperty
+ def window(self):
+ pass
+
+ @abstractproperty
+ def nickname(self):
+ pass
+
+ @abstractmethod
+ def _add(self):
+ pass
+
+ @abstractmethod
+ def _sub(self):
+ pass
+
+ @abstractmethod
+ def _mul(self):
+ pass
+
+ @abstractmethod
+ def _div(self):
+ pass
+
+ @abstractmethod
+ def _pow(self):
+ pass
+
+ @abstractmethod
+ def _val(self):
+ pass
+
+ @abstractmethod
+ def _int(self):
+ pass
+
+ @abstractmethod
+ def _der(self):
+ pass
+
+ @abstractmethod
+ def _fit(self):
+ pass
+
+ @abstractmethod
+ def _line(self):
+ pass
+
+ @abstractmethod
+ def _roots(self):
+ pass
+
+ @abstractmethod
+ def _fromroots(self):
+ pass
+
+ def has_samecoef(self, other):
+ """Check if coefficients match.
+
+ .. versionadded:: 1.6.0
+
+ Parameters
+ ----------
+ other : class instance
+ The other class must have the ``coef`` attribute.
+
+ Returns
+ -------
+ bool : boolean
+ True if the coefficients are the same, False otherwise.
+
+ """
+ if len(self.coef) != len(other.coef):
+ return False
+ elif not np.all(self.coef == other.coef):
+ return False
+ else:
+ return True
+
+ def has_samedomain(self, other):
+ """Check if domains match.
+
+ .. versionadded:: 1.6.0
+
+ Parameters
+ ----------
+ other : class instance
+ The other class must have the ``domain`` attribute.
+
+ Returns
+ -------
+ bool : boolean
+ True if the domains are the same, False otherwise.
+
+ """
+ return np.all(self.domain == other.domain)
+
+ def has_samewindow(self, other):
+ """Check if windows match.
+
+ .. versionadded:: 1.6.0
+
+ Parameters
+ ----------
+ other : class instance
+ The other class must have the ``window`` attribute.
+
+ Returns
+ -------
+ bool : boolean
+ True if the windows are the same, False otherwise.
+
+ """
+ return np.all(self.window == other.window)
+
+ def has_sametype(self, other):
+ """Check if types match.
+
+ .. versionadded:: 1.7.0
+
+ Parameters
+ ----------
+ other : object
+ Class instance.
+
+ Returns
+ -------
+ bool : boolean
+ True if other is same class as self
+
+ """
+ return isinstance(other, self.__class__)
+
+ def _get_coefficients(self, other):
+ """Interpret other as polynomial coefficients.
+
+ The `other` argument is checked to see if it is of the same
+ class as self with identical domain and window. If so,
+ return its coefficients, otherwise return `other`.
+
+ .. versionadded:: 1.9.0
+
+ Parameters
+ ----------
+ other : anything
+ Object to be checked.
+
+ Returns
+ -------
+ coef:
+ The coefficients of`other` if it is a compatible instance,
+ of ABCPolyBase, otherwise `other`.
+
+ Raises
+ ------
+ TypeError:
+ When `other` is an incompatible instance of ABCPolyBase.
+
+ """
+ if isinstance(other, ABCPolyBase):
+ if not isinstance(other, self.__class__):
+ raise TypeError("Polynomial types differ")
+ elif not np.all(self.domain == other.domain):
+ raise TypeError("Domains differ")
+ elif not np.all(self.window == other.window):
+ raise TypeError("Windows differ")
+ return other.coef
+ return other
+
+ def __init__(self, coef, domain=None, window=None):
+ [coef] = pu.as_series([coef], trim=False)
+ self.coef = coef
+
+ if domain is not None:
+ [domain] = pu.as_series([domain], trim=False)
+ if len(domain) != 2:
+ raise ValueError("Domain has wrong number of elements.")
+ self.domain = domain
+
+ if window is not None:
+ [window] = pu.as_series([window], trim=False)
+ if len(window) != 2:
+ raise ValueError("Window has wrong number of elements.")
+ self.window = window
+
+ def __repr__(self):
+ format = "%s(%s, %s, %s)"
+ coef = repr(self.coef)[6:-1]
+ domain = repr(self.domain)[6:-1]
+ window = repr(self.window)[6:-1]
+ name = self.__class__.__name__
+ return format % (name, coef, domain, window)
+
+ def __str__(self):
+ format = "%s(%s)"
+ coef = str(self.coef)
+ name = self.nickname
+ return format % (name, coef)
+
+ # Pickle and copy
+
+ def __getstate__(self):
+ ret = self.__dict__.copy()
+ ret['coef'] = self.coef.copy()
+ ret['domain'] = self.domain.copy()
+ ret['window'] = self.window.copy()
+ return ret
+
+ def __setstate__(self, dict):
+ self.__dict__ = dict
+
+ # Call
+
+ def __call__(self, arg):
+ off, scl = pu.mapparms(self.domain, self.window)
+ arg = off + scl*arg
+ return self._val(arg, self.coef)
+
+ def __iter__(self):
+ return iter(self.coef)
+
+ def __len__(self):
+ return len(self.coef)
+
+ # Numeric properties.
+
+ def __neg__(self):
+ return self.__class__(-self.coef, self.domain, self.window)
+
+ def __pos__(self):
+ return self
+
+ def __add__(self, other):
+ try:
+ othercoef = self._get_coefficients(other)
+ coef = self._add(self.coef, othercoef)
+ except TypeError as e:
+ raise e
+ except:
+ return NotImplemented
+ return self.__class__(coef, self.domain, self.window)
+
+ def __sub__(self, other):
+ try:
+ othercoef = self._get_coefficients(other)
+ coef = self._sub(self.coef, othercoef)
+ except TypeError as e:
+ raise e
+ except:
+ return NotImplemented
+ return self.__class__(coef, self.domain, self.window)
+
+ def __mul__(self, other):
+ try:
+ othercoef = self._get_coefficients(other)
+ coef = self._mul(self.coef, othercoef)
+ except TypeError as e:
+ raise e
+ except:
+ return NotImplemented
+ return self.__class__(coef, self.domain, self.window)
+
+ def __div__(self, other):
+ # set to __floordiv__, /, for now.
+ return self.__floordiv__(other)
+
+ def __truediv__(self, other):
+ # there is no true divide if the rhs is not a Number, although it
+ # could return the first n elements of an infinite series.
+ # It is hard to see where n would come from, though.
+ if not isinstance(other, Number) or isinstance(other, bool):
+ form = "unsupported types for true division: '%s', '%s'"
+ raise TypeError(form % (type(self), type(other)))
+ return self.__floordiv__(other)
+
+ def __floordiv__(self, other):
+ res = self.__divmod__(other)
+ if res is NotImplemented:
+ return res
+ return res[0]
+
+ def __mod__(self, other):
+ res = self.__divmod__(other)
+ if res is NotImplemented:
+ return res
+ return res[1]
+
+ def __divmod__(self, other):
+ try:
+ othercoef = self._get_coefficients(other)
+ quo, rem = self._div(self.coef, othercoef)
+ except (TypeError, ZeroDivisionError) as e:
+ raise e
+ except:
+ return NotImplemented
+ quo = self.__class__(quo, self.domain, self.window)
+ rem = self.__class__(rem, self.domain, self.window)
+ return quo, rem
+
+ def __pow__(self, other):
+ coef = self._pow(self.coef, other, maxpower = self.maxpower)
+ res = self.__class__(coef, self.domain, self.window)
+ return res
+
+ def __radd__(self, other):
+ try:
+ coef = self._add(other, self.coef)
+ except:
+ return NotImplemented
+ return self.__class__(coef, self.domain, self.window)
+
+ def __rsub__(self, other):
+ try:
+ coef = self._sub(other, self.coef)
+ except:
+ return NotImplemented
+ return self.__class__(coef, self.domain, self.window)
+
+ def __rmul__(self, other):
+ try:
+ coef = self._mul(other, self.coef)
+ except:
+ return NotImplemented
+ return self.__class__(coef, self.domain, self.window)
+
+ def __rdiv__(self, other):
+ # set to __floordiv__ /.
+ return self.__rfloordiv__(other)
+
+ def __rtruediv__(self, other):
+ # An instance of ABCPolyBase is not considered a
+ # Number.
+ return NotImplemented
+
+ def __rfloordiv__(self, other):
+ res = self.__rdivmod__(other)
+ if res is NotImplemented:
+ return res
+ return res[0]
+
+ def __rmod__(self, other):
+ res = self.__rdivmod__(other)
+ if res is NotImplemented:
+ return res
+ return res[1]
+
+ def __rdivmod__(self, other):
+ try:
+ quo, rem = self._div(other, self.coef)
+ except ZeroDivisionError as e:
+ raise e
+ except:
+ return NotImplemented
+ quo = self.__class__(quo, self.domain, self.window)
+ rem = self.__class__(rem, self.domain, self.window)
+ return quo, rem
+
+ # Enhance me
+ # some augmented arithmetic operations could be added here
+
+ def __eq__(self, other):
+ res = (isinstance(other, self.__class__) and
+ np.all(self.domain == other.domain) and
+ np.all(self.window == other.window) and
+ (self.coef.shape == other.coef.shape) and
+ np.all(self.coef == other.coef))
+ return res
+
+ def __ne__(self, other):
+ return not self.__eq__(other)
+
+ #
+ # Extra methods.
+ #
+
+ def copy(self):
+ """Return a copy.
+
+ Returns
+ -------
+ new_series : series
+ Copy of self.
+
+ """
+ return self.__class__(self.coef, self.domain, self.window)
+
+ def degree(self):
+ """The degree of the series.
+
+ .. versionadded:: 1.5.0
+
+ Returns
+ -------
+ degree : int
+ Degree of the series, one less than the number of coefficients.
+
+ """
+ return len(self) - 1
+
+ def cutdeg(self, deg):
+ """Truncate series to the given degree.
+
+ Reduce the degree of the series to `deg` by discarding the
+ high order terms. If `deg` is greater than the current degree a
+ copy of the current series is returned. This can be useful in least
+ squares where the coefficients of the high degree terms may be very
+ small.
+
+ .. versionadded:: 1.5.0
+
+ Parameters
+ ----------
+ deg : non-negative int
+ The series is reduced to degree `deg` by discarding the high
+ order terms. The value of `deg` must be a non-negative integer.
+
+ Returns
+ -------
+ new_series : series
+ New instance of series with reduced degree.
+
+ """
+ return self.truncate(deg + 1)
+
+ def trim(self, tol=0):
+ """Remove trailing coefficients
+
+ Remove trailing coefficients until a coefficient is reached whose
+ absolute value greater than `tol` or the beginning of the series is
+ reached. If all the coefficients would be removed the series is set
+ to ``[0]``. A new series instance is returned with the new
+ coefficients. The current instance remains unchanged.
+
+ Parameters
+ ----------
+ tol : non-negative number.
+ All trailing coefficients less than `tol` will be removed.
+
+ Returns
+ -------
+ new_series : series
+ Contains the new set of coefficients.
+
+ """
+ coef = pu.trimcoef(self.coef, tol)
+ return self.__class__(coef, self.domain, self.window)
+
+ def truncate(self, size):
+ """Truncate series to length `size`.
+
+ Reduce the series to length `size` by discarding the high
+ degree terms. The value of `size` must be a positive integer. This
+ can be useful in least squares where the coefficients of the
+ high degree terms may be very small.
+
+ Parameters
+ ----------
+ size : positive int
+ The series is reduced to length `size` by discarding the high
+ degree terms. The value of `size` must be a positive integer.
+
+ Returns
+ -------
+ new_series : series
+ New instance of series with truncated coefficients.
+
+ """
+ isize = int(size)
+ if isize != size or isize < 1:
+ raise ValueError("size must be a positive integer")
+ if isize >= len(self.coef):
+ coef = self.coef
+ else:
+ coef = self.coef[:isize]
+ return self.__class__(coef, self.domain, self.window)
+
+ def convert(self, domain=None, kind=None, window=None):
+ """Convert series to a different kind and/or domain and/or window.
+
+ Parameters
+ ----------
+ domain : array_like, optional
+ The domain of the converted series. If the value is None,
+ the default domain of `kind` is used.
+ kind : class, optional
+ The polynomial series type class to which the current instance
+ should be converted. If kind is None, then the class of the
+ current instance is used.
+ window : array_like, optional
+ The window of the converted series. If the value is None,
+ the default window of `kind` is used.
+
+ Returns
+ -------
+ new_series : series
+ The returned class can be of different type than the current
+ instance and/or have a different domain and/or different
+ window.
+
+ Notes
+ -----
+ Conversion between domains and class types can result in
+ numerically ill defined series.
+
+ Examples
+ --------
+
+ """
+ if kind is None:
+ kind = self.__class__
+ if domain is None:
+ domain = kind.domain
+ if window is None:
+ window = kind.window
+ return self(kind.identity(domain, window=window))
+
+ def mapparms(self):
+ """Return the mapping parameters.
+
+ The returned values define a linear map ``off + scl*x`` that is
+ applied to the input arguments before the series is evaluated. The
+ map depends on the ``domain`` and ``window``; if the current
+ ``domain`` is equal to the ``window`` the resulting map is the
+ identity. If the coefficients of the series instance are to be
+ used by themselves outside this class, then the linear function
+ must be substituted for the ``x`` in the standard representation of
+ the base polynomials.
+
+ Returns
+ -------
+ off, scl : float or complex
+ The mapping function is defined by ``off + scl*x``.
+
+ Notes
+ -----
+ If the current domain is the interval ``[l1, r1]`` and the window
+ is ``[l2, r2]``, then the linear mapping function ``L`` is
+ defined by the equations::
+
+ L(l1) = l2
+ L(r1) = r2
+
+ """
+ return pu.mapparms(self.domain, self.window)
+
+ def integ(self, m=1, k=[], lbnd=None):
+ """Integrate.
+
+ Return a series instance that is the definite integral of the
+ current series.
+
+ Parameters
+ ----------
+ m : non-negative int
+ The number of integrations to perform.
+ k : array_like
+ Integration constants. The first constant is applied to the
+ first integration, the second to the second, and so on. The
+ list of values must less than or equal to `m` in length and any
+ missing values are set to zero.
+ lbnd : Scalar
+ The lower bound of the definite integral.
+
+ Returns
+ -------
+ new_series : series
+ A new series representing the integral. The domain is the same
+ as the domain of the integrated series.
+
+ """
+ off, scl = self.mapparms()
+ if lbnd is None:
+ lbnd = 0
+ else:
+ lbnd = off + scl*lbnd
+ coef = self._int(self.coef, m, k, lbnd, 1./scl)
+ return self.__class__(coef, self.domain, self.window)
+
+ def deriv(self, m=1):
+ """Differentiate.
+
+ Return a series instance of that is the derivative of the current
+ series.
+
+ Parameters
+ ----------
+ m : non-negative int
+ The number of integrations to perform.
+
+ Returns
+ -------
+ new_series : series
+ A new series representing the derivative. The domain is the same
+ as the domain of the differentiated series.
+
+ """
+ off, scl = self.mapparms()
+ coef = self._der(self.coef, m, scl)
+ return self.__class__(coef, self.domain, self.window)
+
+ def roots(self):
+ """Return the roots of the series polynomial.
+
+ Compute the roots for the series. Note that the accuracy of the
+ roots decrease the further outside the domain they lie.
+
+ Returns
+ -------
+ roots : ndarray
+ Array containing the roots of the series.
+
+ """
+ roots = self._roots(self.coef)
+ return pu.mapdomain(roots, self.window, self.domain)
+
+ def linspace(self, n=100, domain=None):
+ """Return x, y values at equally spaced points in domain.
+
+ Returns the x, y values at `n` linearly spaced points across the
+ domain. Here y is the value of the polynomial at the points x. By
+ default the domain is the same as that of the series instance.
+ This method is intended mostly as a plotting aid.
+
+ .. versionadded:: 1.5.0
+
+ Parameters
+ ----------
+ n : int, optional
+ Number of point pairs to return. The default value is 100.
+ domain : {None, array_like}, optional
+ If not None, the specified domain is used instead of that of
+ the calling instance. It should be of the form ``[beg,end]``.
+ The default is None which case the class domain is used.
+
+ Returns
+ -------
+ x, y : ndarray
+ x is equal to linspace(self.domain[0], self.domain[1], n) and
+ y is the series evaluated at element of x.
+
+ """
+ if domain is None:
+ domain = self.domain
+ x = np.linspace(domain[0], domain[1], n)
+ y = self(x)
+ return x, y
+
+
+
+ @classmethod
+ def fit(cls, x, y, deg, domain=None, rcond=None, full=False, w=None,
+ window=None):
+ """Least squares fit to data.
+
+ Return a series instance that is the least squares fit to the data
+ `y` sampled at `x`. The domain of the returned instance can be
+ specified and this will often result in a superior fit with less
+ chance of ill conditioning.
+
+ Parameters
+ ----------
+ x : array_like, shape (M,)
+ x-coordinates of the M sample points ``(x[i], y[i])``.
+ y : array_like, shape (M,) or (M, K)
+ y-coordinates of the sample points. Several data sets of sample
+ points sharing the same x-coordinates can be fitted at once by
+ passing in a 2D-array that contains one dataset per column.
+ deg : int
+ Degree of the fitting polynomial.
+ domain : {None, [beg, end], []}, optional
+ Domain to use for the returned series. If ``None``,
+ then a minimal domain that covers the points `x` is chosen. If
+ ``[]`` the class domain is used. The default value was the
+ class domain in NumPy 1.4 and ``None`` in later versions.
+ The ``[]`` option was added in numpy 1.5.0.
+ rcond : float, optional
+ Relative condition number of the fit. Singular values smaller
+ than this relative to the largest singular value will be
+ ignored. The default value is len(x)*eps, where eps is the
+ relative precision of the float type, about 2e-16 in most
+ cases.
+ full : bool, optional
+ Switch determining nature of return value. When it is False
+ (the default) just the coefficients are returned, when True
+ diagnostic information from the singular value decomposition is
+ also returned.
+ w : array_like, shape (M,), optional
+ Weights. If not None the contribution of each point
+ ``(x[i],y[i])`` to the fit is weighted by `w[i]`. Ideally the
+ weights are chosen so that the errors of the products
+ ``w[i]*y[i]`` all have the same variance. The default value is
+ None.
+
+ .. versionadded:: 1.5.0
+ window : {[beg, end]}, optional
+ Window to use for the returned series. The default
+ value is the default class domain
+
+ .. versionadded:: 1.6.0
+
+ Returns
+ -------
+ new_series : series
+ A series that represents the least squares fit to the data and
+ has the domain specified in the call.
+
+ [resid, rank, sv, rcond] : list
+ These values are only returned if `full` = True
+
+ resid -- sum of squared residuals of the least squares fit
+ rank -- the numerical rank of the scaled Vandermonde matrix
+ sv -- singular values of the scaled Vandermonde matrix
+ rcond -- value of `rcond`.
+
+ For more details, see `linalg.lstsq`.
+
+ """
+ if domain is None:
+ domain = pu.getdomain(x)
+ elif type(domain) is list and len(domain) == 0:
+ domain = cls.domain
+
+ if window is None:
+ window = cls.window
+
+ xnew = pu.mapdomain(x, domain, window)
+ res = cls._fit(xnew, y, deg, w=w, rcond=rcond, full=full)
+ if full:
+ [coef, status] = res
+ return cls(coef, domain=domain, window=window), status
+ else:
+ coef = res
+ return cls(coef, domain=domain, window=window)
+
+ @classmethod
+ def fromroots(cls, roots, domain=[], window=None):
+ """Return series instance that has the specified roots.
+
+ Returns a series representing the product
+ ``(x - r[0])*(x - r[1])*...*(x - r[n-1])``, where ``r`` is a
+ list of roots.
+
+ Parameters
+ ----------
+ roots : array_like
+ List of roots.
+ domain : {[], None, array_like}, optional
+ Domain for the resulting series. If None the domain is the
+ interval from the smallest root to the largest. If [] the
+ domain is the class domain. The default is [].
+ window : {None, array_like}, optional
+ Window for the returned series. If None the class window is
+ used. The default is None.
+
+ Returns
+ -------
+ new_series : series
+ Series with the specified roots.
+
+ """
+ [roots] = pu.as_series([roots], trim=False)
+ if domain is None:
+ domain = pu.getdomain(roots)
+ elif type(domain) is list and len(domain) == 0:
+ domain = cls.domain
+
+ if window is None:
+ window = cls.window
+
+ deg = len(roots)
+ off, scl = pu.mapparms(domain, window)
+ rnew = off + scl*roots
+ coef = cls._fromroots(rnew) / scl**deg
+ return cls(coef, domain=domain, window=window)
+
+ @classmethod
+ def identity(cls, domain=None, window=None):
+ """Identity function.
+
+ If ``p`` is the returned series, then ``p(x) == x`` for all
+ values of x.
+
+ Parameters
+ ----------
+ domain : {None, array_like}, optional
+ If given, the array must be of the form ``[beg, end]``, where
+ ``beg`` and ``end`` are the endpoints of the domain. If None is
+ given then the class domain is used. The default is None.
+ window : {None, array_like}, optional
+ If given, the resulting array must be if the form
+ ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of
+ the window. If None is given then the class window is used. The
+ default is None.
+
+ Returns
+ -------
+ new_series : series
+ Series of representing the identity.
+
+ """
+ if domain is None:
+ domain = cls.domain
+ if window is None:
+ window = cls.window
+ off, scl = pu.mapparms(window, domain)
+ coef = cls._line(off, scl)
+ return cls(coef, domain, window)
+
+ @classmethod
+ def basis(cls, deg, domain=None, window=None):
+ """Series basis polynomial of degree `deg`.
+
+ Returns the series representing the basis polynomial of degree `deg`.
+
+ .. versionadded:: 1.7.0
+
+ Parameters
+ ----------
+ deg : int
+ Degree of the basis polynomial for the series. Must be >= 0.
+ domain : {None, array_like}, optional
+ If given, the array must be of the form ``[beg, end]``, where
+ ``beg`` and ``end`` are the endpoints of the domain. If None is
+ given then the class domain is used. The default is None.
+ window : {None, array_like}, optional
+ If given, the resulting array must be if the form
+ ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of
+ the window. If None is given then the class window is used. The
+ default is None.
+
+ Returns
+ -------
+ new_series : series
+ A series with the coefficient of the `deg` term set to one and
+ all others zero.
+
+ """
+ if domain is None:
+ domain = cls.domain
+ if window is None:
+ window = cls.window
+ ideg = int(deg)
+
+ if ideg != deg or ideg < 0:
+ raise ValueError("deg must be non-negative integer")
+ return cls([0]*ideg + [1], domain, window)
+
+ @classmethod
+ def cast(cls, series, domain=None, window=None):
+ """Convert series to series of this class.
+
+ The `series` is expected to be an instance of some polynomial
+ series of one of the types supported by by the numpy.polynomial
+ module, but could be some other class that supports the convert
+ method.
+
+ .. versionadded:: 1.7.0
+
+ Parameters
+ ----------
+ series : series
+ The series instance to be converted.
+ domain : {None, array_like}, optional
+ If given, the array must be of the form ``[beg, end]``, where
+ ``beg`` and ``end`` are the endpoints of the domain. If None is
+ given then the class domain is used. The default is None.
+ window : {None, array_like}, optional
+ If given, the resulting array must be if the form
+ ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of
+ the window. If None is given then the class window is used. The
+ default is None.
+
+ Returns
+ -------
+ new_series : series
+ A series of the same kind as the calling class and equal to
+ `series` when evaluated.
+
+ See Also
+ --------
+ convert : similar instance method
+
+ """
+ if domain is None:
+ domain = cls.domain
+ if window is None:
+ window = cls.window
+ return series.convert(domain, cls, window)
diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py
index 6a2394382..b4acbbeab 100644
--- a/numpy/polynomial/chebyshev.py
+++ b/numpy/polynomial/chebyshev.py
@@ -87,11 +87,12 @@ References
"""
from __future__ import division, absolute_import, print_function
+import warnings
import numpy as np
import numpy.linalg as la
+
from . import polyutils as pu
-import warnings
-from .polytemplate import polytemplate
+from ._polybase import ABCPolyBase
__all__ = ['chebzero', 'chebone', 'chebx', 'chebdomain', 'chebline',
'chebadd', 'chebsub', 'chebmulx', 'chebmul', 'chebdiv', 'chebpow',
@@ -1607,11 +1608,6 @@ def chebfit(x, y, deg, rcond=None, full=False, w=None):
where `n` is `deg`.
- Since numpy version 1.7.0, chebfit also supports NA. If any of the
- elements of `x`, `y`, or `w` are NA, then the corresponding rows of the
- linear least squares problem (see Notes) are set to 0. If `y` is 2-D,
- then an NA in any row of `y` invalidates that whole row.
-
Parameters
----------
x : array_like, shape (M,)
@@ -1646,10 +1642,15 @@ def chebfit(x, y, deg, rcond=None, full=False, w=None):
the coefficients for the data in column k of `y` are in column
`k`.
- [residuals, rank, singular_values, rcond] : present when `full` = True
- Residuals of the least-squares fit, the effective rank of the
- scaled Vandermonde matrix and its singular values, and the
- specified value of `rcond`. For more details, see `linalg.lstsq`.
+ [residuals, rank, singular_values, rcond] : list
+ These values are only returned if `full` = True
+
+ resid -- sum of squared residuals of the least squares fit
+ rank -- the numerical rank of the scaled Vandermonde matrix
+ sv -- singular values of the scaled Vandermonde matrix
+ rcond -- value of `rcond`.
+
+ For more details, see `linalg.lstsq`.
Warns
-----
@@ -2012,4 +2013,43 @@ def chebpts2(npts):
# Chebyshev series class
#
-exec(polytemplate.substitute(name='Chebyshev', nick='cheb', domain='[-1,1]'))
+class Chebyshev(ABCPolyBase):
+ """A Chebyshev series class.
+
+ The Chebyshev class provides the standard Python numerical methods
+ '+', '-', '*', '//', '%', 'divmod', '**', and '()' as well as the
+ methods listed below.
+
+ Parameters
+ ----------
+ coef : array_like
+ Chebyshev coefficients in order of increasing degree, i.e.,
+ ``(1, 2, 3)`` gives ``1*T_0(x) + 2*T_1(x) + 3*T_2(x)``.
+ domain : (2,) array_like, optional
+ Domain to use. The interval ``[domain[0], domain[1]]`` is mapped
+ to the interval ``[window[0], window[1]]`` by shifting and scaling.
+ The default value is [-1, 1].
+ window : (2,) array_like, optional
+ Window, see `domain` for its use. The default value is [-1, 1].
+
+ .. versionadded:: 1.6.0
+
+ """
+ # Virtual Functions
+ _add = staticmethod(chebadd)
+ _sub = staticmethod(chebsub)
+ _mul = staticmethod(chebmul)
+ _div = staticmethod(chebdiv)
+ _pow = staticmethod(chebpow)
+ _val = staticmethod(chebval)
+ _int = staticmethod(chebint)
+ _der = staticmethod(chebder)
+ _fit = staticmethod(chebfit)
+ _line = staticmethod(chebline)
+ _roots = staticmethod(chebroots)
+ _fromroots = staticmethod(chebfromroots)
+
+ # Virtual properties
+ nickname = 'cheb'
+ domain = np.array(chebdomain)
+ window = np.array(chebdomain)
diff --git a/numpy/polynomial/hermite.py b/numpy/polynomial/hermite.py
index 4140acfb7..43ede58ac 100644
--- a/numpy/polynomial/hermite.py
+++ b/numpy/polynomial/hermite.py
@@ -59,11 +59,12 @@ See also
"""
from __future__ import division, absolute_import, print_function
+import warnings
import numpy as np
import numpy.linalg as la
+
from . import polyutils as pu
-import warnings
-from .polytemplate import polytemplate
+from ._polybase import ABCPolyBase
__all__ = ['hermzero', 'hermone', 'hermx', 'hermdomain', 'hermline',
'hermadd', 'hermsub', 'hermmulx', 'hermmul', 'hermdiv', 'hermpow',
@@ -109,7 +110,7 @@ def poly2herm(pol) :
Examples
--------
- >>> from numpy.polynomial.hermite_e import poly2herme
+ >>> from numpy.polynomial.hermite import poly2herm
>>> poly2herm(np.arange(4))
array([ 1. , 2.75 , 0.5 , 0.375])
@@ -1379,11 +1380,6 @@ def hermfit(x, y, deg, rcond=None, full=False, w=None):
where `n` is `deg`.
- Since numpy version 1.7.0, hermfit also supports NA. If any of the
- elements of `x`, `y`, or `w` are NA, then the corresponding rows of the
- linear least squares problem (see Notes) are set to 0. If `y` is 2-D,
- then an NA in any row of `y` invalidates that whole row.
-
Parameters
----------
x : array_like, shape (M,)
@@ -1416,10 +1412,15 @@ def hermfit(x, y, deg, rcond=None, full=False, w=None):
the coefficients for the data in column k of `y` are in column
`k`.
- [residuals, rank, singular_values, rcond] : present when `full` = True
- Residuals of the least-squares fit, the effective rank of the
- scaled Vandermonde matrix and its singular values, and the
- specified value of `rcond`. For more details, see `linalg.lstsq`.
+ [residuals, rank, singular_values, rcond] : list
+ These values are only returned if `full` = True
+
+ resid -- sum of squared residuals of the least squares fit
+ rank -- the numerical rank of the scaled Vandermonde matrix
+ sv -- singular values of the scaled Vandermonde matrix
+ rcond -- value of `rcond`.
+
+ For more details, see `linalg.lstsq`.
Warns
-----
@@ -1747,4 +1748,43 @@ def hermweight(x):
# Hermite series class
#
-exec(polytemplate.substitute(name='Hermite', nick='herm', domain='[-1,1]'))
+class Hermite(ABCPolyBase):
+ """An Hermite series class.
+
+ The Hermite class provides the standard Python numerical methods
+ '+', '-', '*', '//', '%', 'divmod', '**', and '()' as well as the
+ attributes and methods listed in the `ABCPolyBase` documentation.
+
+ Parameters
+ ----------
+ coef : array_like
+ Laguerre coefficients in order of increasing degree, i.e,
+ ``(1, 2, 3)`` gives ``1*H_0(x) + 2*H_1(X) + 3*H_2(x)``.
+ domain : (2,) array_like, optional
+ Domain to use. The interval ``[domain[0], domain[1]]`` is mapped
+ to the interval ``[window[0], window[1]]`` by shifting and scaling.
+ The default value is [-1, 1].
+ window : (2,) array_like, optional
+ Window, see `domain` for its use. The default value is [-1, 1].
+
+ .. versionadded:: 1.6.0
+
+ """
+ # Virtual Functions
+ _add = staticmethod(hermadd)
+ _sub = staticmethod(hermsub)
+ _mul = staticmethod(hermmul)
+ _div = staticmethod(hermdiv)
+ _pow = staticmethod(hermpow)
+ _val = staticmethod(hermval)
+ _int = staticmethod(hermint)
+ _der = staticmethod(hermder)
+ _fit = staticmethod(hermfit)
+ _line = staticmethod(hermline)
+ _roots = staticmethod(hermroots)
+ _fromroots = staticmethod(hermfromroots)
+
+ # Virtual properties
+ nickname = 'herm'
+ domain = np.array(hermdomain)
+ window = np.array(hermdomain)
diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py
index 735ca9470..874b42470 100644
--- a/numpy/polynomial/hermite_e.py
+++ b/numpy/polynomial/hermite_e.py
@@ -59,11 +59,12 @@ See also
"""
from __future__ import division, absolute_import, print_function
+import warnings
import numpy as np
import numpy.linalg as la
+
from . import polyutils as pu
-import warnings
-from .polytemplate import polytemplate
+from ._polybase import ABCPolyBase
__all__ = ['hermezero', 'hermeone', 'hermex', 'hermedomain', 'hermeline',
'hermeadd', 'hermesub', 'hermemulx', 'hermemul', 'hermediv', 'hermpow',
@@ -1375,11 +1376,6 @@ def hermefit(x, y, deg, rcond=None, full=False, w=None):
where `n` is `deg`.
- Since numpy version 1.7.0, hermefit also supports NA. If any of the
- elements of `x`, `y`, or `w` are NA, then the corresponding rows of the
- linear least squares problem (see Notes) are set to 0. If `y` is 2-D,
- then an NA in any row of `y` invalidates that whole row.
-
Parameters
----------
x : array_like, shape (M,)
@@ -1412,10 +1408,15 @@ def hermefit(x, y, deg, rcond=None, full=False, w=None):
the coefficients for the data in column k of `y` are in column
`k`.
- [residuals, rank, singular_values, rcond] : present when `full` = True
- Residuals of the least-squares fit, the effective rank of the
- scaled Vandermonde matrix and its singular values, and the
- specified value of `rcond`. For more details, see `linalg.lstsq`.
+ [residuals, rank, singular_values, rcond] : list
+ These values are only returned if `full` = True
+
+ resid -- sum of squared residuals of the least squares fit
+ rank -- the numerical rank of the scaled Vandermonde matrix
+ sv -- singular values of the scaled Vandermonde matrix
+ rcond -- value of `rcond`.
+
+ For more details, see `linalg.lstsq`.
Warns
-----
@@ -1743,4 +1744,43 @@ def hermeweight(x):
# HermiteE series class
#
-exec(polytemplate.substitute(name='HermiteE', nick='herme', domain='[-1,1]'))
+class HermiteE(ABCPolyBase):
+ """An HermiteE series class.
+
+ The HermiteE class provides the standard Python numerical methods
+ '+', '-', '*', '//', '%', 'divmod', '**', and '()' as well as the
+ attributes and methods listed in the `ABCPolyBase` documentation.
+
+ Parameters
+ ----------
+ coef : array_like
+ Laguerre coefficients in order of increasing degree, i.e,
+ ``(1, 2, 3)`` gives ``1*He_0(x) + 2*He_1(X) + 3*He_2(x)``.
+ domain : (2,) array_like, optional
+ Domain to use. The interval ``[domain[0], domain[1]]`` is mapped
+ to the interval ``[window[0], window[1]]`` by shifting and scaling.
+ The default value is [-1, 1].
+ window : (2,) array_like, optional
+ Window, see `domain` for its use. The default value is [-1, 1].
+
+ .. versionadded:: 1.6.0
+
+ """
+ # Virtual Functions
+ _add = staticmethod(hermeadd)
+ _sub = staticmethod(hermesub)
+ _mul = staticmethod(hermemul)
+ _div = staticmethod(hermediv)
+ _pow = staticmethod(hermepow)
+ _val = staticmethod(hermeval)
+ _int = staticmethod(hermeint)
+ _der = staticmethod(hermeder)
+ _fit = staticmethod(hermefit)
+ _line = staticmethod(hermeline)
+ _roots = staticmethod(hermeroots)
+ _fromroots = staticmethod(hermefromroots)
+
+ # Virtual properties
+ nickname = 'herme'
+ domain = np.array(hermedomain)
+ window = np.array(hermedomain)
diff --git a/numpy/polynomial/laguerre.py b/numpy/polynomial/laguerre.py
index b7ffe9b0c..9d88162ce 100644
--- a/numpy/polynomial/laguerre.py
+++ b/numpy/polynomial/laguerre.py
@@ -59,11 +59,12 @@ See also
"""
from __future__ import division, absolute_import, print_function
+import warnings
import numpy as np
import numpy.linalg as la
+
from . import polyutils as pu
-import warnings
-from .polytemplate import polytemplate
+from ._polybase import ABCPolyBase
__all__ = ['lagzero', 'lagone', 'lagx', 'lagdomain', 'lagline',
'lagadd', 'lagsub', 'lagmulx', 'lagmul', 'lagdiv', 'lagpow',
@@ -1378,11 +1379,6 @@ def lagfit(x, y, deg, rcond=None, full=False, w=None):
where `n` is `deg`.
- Since numpy version 1.7.0, lagfit also supports NA. If any of the
- elements of `x`, `y`, or `w` are NA, then the corresponding rows of the
- linear least squares problem (see Notes) are set to 0. If `y` is 2-D,
- then an NA in any row of `y` invalidates that whole row.
-
Parameters
----------
x : array_like, shape (M,)
@@ -1415,10 +1411,15 @@ def lagfit(x, y, deg, rcond=None, full=False, w=None):
the coefficients for the data in column k of `y` are in column
`k`.
- [residuals, rank, singular_values, rcond] : present when `full` = True
- Residuals of the least-squares fit, the effective rank of the
- scaled Vandermonde matrix and its singular values, and the
- specified value of `rcond`. For more details, see `linalg.lstsq`.
+ [residuals, rank, singular_values, rcond] : list
+ These values are only returned if `full` = True
+
+ resid -- sum of squared residuals of the least squares fit
+ rank -- the numerical rank of the scaled Vandermonde matrix
+ sv -- singular values of the scaled Vandermonde matrix
+ rcond -- value of `rcond`.
+
+ For more details, see `linalg.lstsq`.
Warns
-----
@@ -1739,4 +1740,43 @@ def lagweight(x):
# Laguerre series class
#
-exec(polytemplate.substitute(name='Laguerre', nick='lag', domain='[-1,1]'))
+class Laguerre(ABCPolyBase):
+ """A Laguerre series class.
+
+ The Laguerre class provides the standard Python numerical methods
+ '+', '-', '*', '//', '%', 'divmod', '**', and '()' as well as the
+ attributes and methods listed in the `ABCPolyBase` documentation.
+
+ Parameters
+ ----------
+ coef : array_like
+ Laguerre coefficients in order of increasing degree, i.e,
+ ``(1, 2, 3)`` gives ``1*L_0(x) + 2*L_1(X) + 3*L_2(x)``.
+ domain : (2,) array_like, optional
+ Domain to use. The interval ``[domain[0], domain[1]]`` is mapped
+ to the interval ``[window[0], window[1]]`` by shifting and scaling.
+ The default value is [0, 1].
+ window : (2,) array_like, optional
+ Window, see `domain` for its use. The default value is [0, 1].
+
+ .. versionadded:: 1.6.0
+
+ """
+ # Virtual Functions
+ _add = staticmethod(lagadd)
+ _sub = staticmethod(lagsub)
+ _mul = staticmethod(lagmul)
+ _div = staticmethod(lagdiv)
+ _pow = staticmethod(lagpow)
+ _val = staticmethod(lagval)
+ _int = staticmethod(lagint)
+ _der = staticmethod(lagder)
+ _fit = staticmethod(lagfit)
+ _line = staticmethod(lagline)
+ _roots = staticmethod(lagroots)
+ _fromroots = staticmethod(lagfromroots)
+
+ # Virtual properties
+ nickname = 'lag'
+ domain = np.array(lagdomain)
+ window = np.array(lagdomain)
diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py
index 8d89c8412..58c130b7e 100644
--- a/numpy/polynomial/legendre.py
+++ b/numpy/polynomial/legendre.py
@@ -83,11 +83,12 @@ numpy.polynomial.hermite_e
"""
from __future__ import division, absolute_import, print_function
+import warnings
import numpy as np
import numpy.linalg as la
+
from . import polyutils as pu
-import warnings
-from .polytemplate import polytemplate
+from ._polybase import ABCPolyBase
__all__ = ['legzero', 'legone', 'legx', 'legdomain', 'legline',
'legadd', 'legsub', 'legmulx', 'legmul', 'legdiv', 'legpow', 'legval',
@@ -1408,11 +1409,6 @@ def legfit(x, y, deg, rcond=None, full=False, w=None):
where `n` is `deg`.
- Since numpy version 1.7.0, legfit also supports NA. If any of the
- elements of `x`, `y`, or `w` are NA, then the corresponding rows of the
- linear least squares problem (see Notes) are set to 0. If `y` is 2-D,
- then an NA in any row of `y` invalidates that whole row.
-
Parameters
----------
x : array_like, shape (M,)
@@ -1447,10 +1443,15 @@ def legfit(x, y, deg, rcond=None, full=False, w=None):
the coefficients for the data in column k of `y` are in column
`k`.
- [residuals, rank, singular_values, rcond] : present when `full` = True
- Residuals of the least-squares fit, the effective rank of the
- scaled Vandermonde matrix and its singular values, and the
- specified value of `rcond`. For more details, see `linalg.lstsq`.
+ [residuals, rank, singular_values, rcond] : list
+ These values are only returned if `full` = True
+
+ resid -- sum of squared residuals of the least squares fit
+ rank -- the numerical rank of the scaled Vandermonde matrix
+ sv -- singular values of the scaled Vandermonde matrix
+ rcond -- value of `rcond`.
+
+ For more details, see `linalg.lstsq`.
Warns
-----
@@ -1765,4 +1766,43 @@ def legweight(x):
# Legendre series class
#
-exec(polytemplate.substitute(name='Legendre', nick='leg', domain='[-1,1]'))
+class Legendre(ABCPolyBase):
+ """A Legendre series class.
+
+ The Legendre class provides the standard Python numerical methods
+ '+', '-', '*', '//', '%', 'divmod', '**', and '()' as well as the
+ attributes and methods listed in the `ABCPolyBase` documentation.
+
+ Parameters
+ ----------
+ coef : array_like
+ Legendre coefficients in order of increasing degree, i.e.,
+ ``(1, 2, 3)`` gives ``1*P_0(x) + 2*P_1(x) + 3*P_2(x)``.
+ domain : (2,) array_like, optional
+ Domain to use. The interval ``[domain[0], domain[1]]`` is mapped
+ to the interval ``[window[0], window[1]]`` by shifting and scaling.
+ The default value is [-1, 1].
+ window : (2,) array_like, optional
+ Window, see `domain` for its use. The default value is [-1, 1].
+
+ .. versionadded:: 1.6.0
+
+ """
+ # Virtual Functions
+ _add = staticmethod(legadd)
+ _sub = staticmethod(legsub)
+ _mul = staticmethod(legmul)
+ _div = staticmethod(legdiv)
+ _pow = staticmethod(legpow)
+ _val = staticmethod(legval)
+ _int = staticmethod(legint)
+ _der = staticmethod(legder)
+ _fit = staticmethod(legfit)
+ _line = staticmethod(legline)
+ _roots = staticmethod(legroots)
+ _fromroots = staticmethod(legfromroots)
+
+ # Virtual properties
+ nickname = 'leg'
+ domain = np.array(legdomain)
+ window = np.array(legdomain)
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py
index 9acdcbe52..92cc83821 100644
--- a/numpy/polynomial/polynomial.py
+++ b/numpy/polynomial/polynomial.py
@@ -48,7 +48,7 @@ Classes
-------
- `Polynomial` -- polynomial class.
-See also
+See Also
--------
`numpy.polynomial`
@@ -61,11 +61,12 @@ __all__ = ['polyzero', 'polyone', 'polyx', 'polydomain', 'polyline',
'polyfit', 'polytrim', 'polyroots', 'Polynomial', 'polyval2d',
'polyval3d', 'polygrid2d', 'polygrid3d', 'polyvander2d', 'polyvander3d']
+import warnings
import numpy as np
import numpy.linalg as la
+
from . import polyutils as pu
-import warnings
-from .polytemplate import polytemplate
+from ._polybase import ABCPolyBase
polytrim = pu.trimcoef
@@ -112,7 +113,7 @@ def polyline(off, scl) :
Examples
--------
- >>> from numpy import polynomial as P
+ >>> from numpy.polynomial import polynomial as P
>>> P.polyline(1,-1)
array([ 1, -1])
>>> P.polyval(1, P.polyline(1,-1)) # should be 0
@@ -175,7 +176,7 @@ def polyfromroots(roots) :
Examples
--------
- >>> import numpy.polynomial as P
+ >>> from numpy.polynomial import polynomial as P
>>> P.polyfromroots((-1,0,1)) # x(x - 1)(x + 1) = x^3 - x
array([ 0., -1., 0., 1.])
>>> j = complex(0,1)
@@ -224,7 +225,7 @@ def polyadd(c1, c2):
Examples
--------
- >>> from numpy import polynomial as P
+ >>> from numpy.polynomial import polynomial as P
>>> c1 = (1,2,3)
>>> c2 = (3,2,1)
>>> sum = P.polyadd(c1,c2); sum
@@ -269,7 +270,7 @@ def polysub(c1, c2):
Examples
--------
- >>> from numpy import polynomial as P
+ >>> from numpy.polynomial import polynomial as P
>>> c1 = (1,2,3)
>>> c2 = (3,2,1)
>>> P.polysub(c1,c2)
@@ -351,7 +352,7 @@ def polymul(c1, c2):
Examples
--------
- >>> import numpy.polynomial as P
+ >>> from numpy.polynomial import polynomial as P
>>> c1 = (1,2,3)
>>> c2 = (3,2,1)
>>> P.polymul(c1,c2)
@@ -388,7 +389,7 @@ def polydiv(c1, c2):
Examples
--------
- >>> import numpy.polynomial as P
+ >>> from numpy.polynomial import polynomial as P
>>> c1 = (1,2,3)
>>> c2 = (3,2,1)
>>> P.polydiv(c1,c2)
@@ -512,7 +513,7 @@ def polyder(c, m=1, scl=1, axis=0):
Examples
--------
- >>> from numpy import polynomial as P
+ >>> from numpy.polynomial import polynomial as P
>>> c = (1,2,3,4) # 1 + 2x + 3x**2 + 4x**3
>>> P.polyder(c) # (d/dx)(c) = 2 + 6x + 12x**2
array([ 2., 6., 12.])
@@ -623,7 +624,7 @@ def polyint(c, m=1, k=[], lbnd=0, scl=1, axis=0):
Examples
--------
- >>> from numpy import polynomial as P
+ >>> from numpy.polynomial import polynomial as P
>>> c = (1,2,3)
>>> P.polyint(c) # should return array([0, 1, 1, 1])
array([ 0., 1., 1., 1.])
@@ -823,7 +824,7 @@ def polyval2d(x, y, c):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
try:
@@ -883,7 +884,7 @@ def polygrid2d(x, y, c):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
c = polyval(x, c)
@@ -936,7 +937,7 @@ def polyval3d(x, y, z, c):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
try:
@@ -1000,7 +1001,7 @@ def polygrid3d(x, y, z, c):
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
c = polyval(x, c)
@@ -1173,7 +1174,7 @@ def polyvander3d(x, y, z, deg) :
Notes
-----
- .. versionadded::1.7.0
+ .. versionadded:: 1.7.0
"""
ideg = [int(d) for d in deg]
@@ -1207,11 +1208,6 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None):
where `n` is `deg`.
- Since numpy version 1.7.0, polyfit also supports NA. If any of the
- elements of `x`, `y`, or `w` are NA, then the corresponding rows of the
- linear least squares problem (see Notes) are set to 0. If `y` is 2-D,
- then an NA in any row of `y` invalidates that whole row.
-
Parameters
----------
x : array_like, shape (`M`,)
@@ -1249,12 +1245,16 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None):
the coefficients in column `k` of `coef` represent the polynomial
fit to the data in `y`'s `k`-th column.
- [residuals, rank, singular_values, rcond] : present when `full` == True
- Sum of the squared residuals (SSR) of the least-squares fit; the
- effective rank of the scaled Vandermonde matrix; its singular
- values; and the specified value of `rcond`. For more information,
- see `linalg.lstsq`.
+ [residuals, rank, singular_values, rcond] : list
+ These values are only returned if `full` = True
+
+ resid -- sum of squared residuals of the least squares fit
+ rank -- the numerical rank of the scaled Vandermonde matrix
+ sv -- singular values of the scaled Vandermonde matrix
+ rcond -- value of `rcond`.
+ For more details, see `linalg.lstsq`.
+
Raises
------
RankWarning
@@ -1310,7 +1310,7 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None):
Examples
--------
- >>> from numpy import polynomial as P
+ >>> from numpy.polynomial import polynomial as P
>>> x = np.linspace(-1,1,51) # x "data": [-1, -0.96, ..., 0.96, 1]
>>> y = x**3 - x + np.random.randn(len(x)) # x^3 - x + N(0,1) "noise"
>>> c, stats = P.polyfit(x,y,3,full=True)
@@ -1490,4 +1490,43 @@ def polyroots(c):
# polynomial class
#
-exec(polytemplate.substitute(name='Polynomial', nick='poly', domain='[-1,1]'))
+class Polynomial(ABCPolyBase):
+ """A power series class.
+
+ The Polynomial class provides the standard Python numerical methods
+ '+', '-', '*', '//', '%', 'divmod', '**', and '()' as well as the
+ attributes and methods listed in the `ABCPolyBase` documentation.
+
+ Parameters
+ ----------
+ coef : array_like
+ Polynomial coefficients in order of increasing degree, i.e.,
+ ``(1, 2, 3)`` give ``1 + 2*x + 3*x**2``.
+ domain : (2,) array_like, optional
+ Domain to use. The interval ``[domain[0], domain[1]]`` is mapped
+ to the interval ``[window[0], window[1]]`` by shifting and scaling.
+ The default value is [-1, 1].
+ window : (2,) array_like, optional
+ Window, see `domain` for its use. The default value is [-1, 1].
+
+ .. versionadded:: 1.6.0
+
+ """
+ # Virtual Functions
+ _add = staticmethod(polyadd)
+ _sub = staticmethod(polysub)
+ _mul = staticmethod(polymul)
+ _div = staticmethod(polydiv)
+ _pow = staticmethod(polypow)
+ _val = staticmethod(polyval)
+ _int = staticmethod(polyint)
+ _der = staticmethod(polyder)
+ _fit = staticmethod(polyfit)
+ _line = staticmethod(polyline)
+ _roots = staticmethod(polyroots)
+ _fromroots = staticmethod(polyfromroots)
+
+ # Virtual properties
+ nickname = 'poly'
+ domain = np.array(polydomain)
+ window = np.array(polydomain)
diff --git a/numpy/polynomial/polytemplate.py b/numpy/polynomial/polytemplate.py
index f315915d6..e68dd18ef 100644
--- a/numpy/polynomial/polytemplate.py
+++ b/numpy/polynomial/polytemplate.py
@@ -13,6 +13,13 @@ from __future__ import division, absolute_import, print_function
import string
import sys
+import warnings
+from number import Number
+
+from numpy import ModuleDeprecationWarning
+
+warnings.warn("The polytemplate module will be removed in Numpy 1.10.0.",
+ ModuleDeprecationWarning)
polytemplate = string.Template('''
from __future__ import division, absolute_import, print_function
@@ -281,15 +288,13 @@ class $name(pu.PolyBase) :
return self.__floordiv__(other)
def __truediv__(self, other) :
- # there is no true divide if the rhs is not a scalar, although it
+ # there is no true divide if the rhs is not a Number, although it
# could return the first n elements of an infinite series.
# It is hard to see where n would come from, though.
- if np.isscalar(other) :
- # this might be overly restrictive
- coef = self.coef/other
- return self.__class__(coef, self.domain, self.window)
- else :
- return NotImplemented
+ if not isinstance(other, Number) or isinstance(other, bool):
+ form = "unsupported types for true division: '%s', '%s'"
+ raise TypeError(form % (type(self), type(other)))
+ return self.__floordiv__(other)
def __floordiv__(self, other) :
"""Returns the quotient."""
@@ -378,20 +383,14 @@ class $name(pu.PolyBase) :
return self.__rfloordiv__(other)
def __rtruediv__(self, other) :
- # there is no true divide if the rhs is not a scalar, although it
- # could return the first n elements of an infinite series.
- # It is hard to see where n would come from, though.
- if len(self.coef) == 1 :
- try :
- quo, rem = ${nick}div(other, self.coef[0])
- except :
- return NotImplemented
- return self.__class__(quo, self.domain, self.window)
+ # An instance of PolyBase is not considered a
+ # Number.
+ return NotImplemented
def __rfloordiv__(self, other) :
try :
quo, rem = ${nick}div(other, self.coef)
- except :
+ except:
return NotImplemented
return self.__class__(quo, self.domain, self.window)
@@ -738,7 +737,7 @@ class $name(pu.PolyBase) :
then a minimal domain that covers the points `x` is chosen. If
``[]`` the default domain ``$domain`` is used. The default
value is $domain in numpy 1.4.x and ``None`` in later versions.
- The ``'[]`` value was added in numpy 1.5.0.
+ The ``[]`` value was added in numpy 1.5.0.
rcond : float, optional
Relative condition number of the fit. Singular values smaller
than this relative to the largest singular value will be
@@ -781,10 +780,10 @@ class $name(pu.PolyBase) :
"""
if domain is None:
domain = pu.getdomain(x)
- elif domain == []:
+ elif type(domain) is list and len(domain) == 0:
domain = $domain
- if window == []:
+ if type(window) is list and len(window) == 0:
window = $domain
xnew = pu.mapdomain(x, domain, window)
diff --git a/numpy/polynomial/polyutils.py b/numpy/polynomial/polyutils.py
index 63743bb40..99f508521 100644
--- a/numpy/polynomial/polyutils.py
+++ b/numpy/polynomial/polyutils.py
@@ -1,41 +1,53 @@
"""
-Utililty objects for the polynomial modules.
+Utililty classes and functions for the polynomial modules.
This module provides: error and warning objects; a polynomial base class;
and some routines used in both the `polynomial` and `chebyshev` modules.
Error objects
-------------
-- `PolyError` -- base class for this sub-package's errors.
-- `PolyDomainError` -- raised when domains are "mismatched."
+
+.. autosummary::
+ :toctree: generated/
+
+ PolyError base class for this sub-package's errors.
+ PolyDomainError raised when domains are mismatched.
Warning objects
---------------
-- `RankWarning` -- raised by a least-squares fit when a rank-deficient
- matrix is encountered.
+
+.. autosummary::
+ :toctree: generated/
+
+ RankWarning raised in least-squares fit for rank-deficient matrix.
Base class
----------
-- `PolyBase` -- The base class for the `Polynomial` and `Chebyshev`
- classes.
+
+.. autosummary::
+ :toctree: generated/
+
+ PolyBase Obsolete base class for the polynomial classes. Do not use.
Functions
---------
-- `as_series` -- turns a list of array_likes into 1-D arrays of common
- type.
-- `trimseq` -- removes trailing zeros.
-- `trimcoef` -- removes trailing coefficients that are less than a given
- magnitude (thereby removing the corresponding terms).
-- `getdomain` -- returns a domain appropriate for a given set of abscissae.
-- `mapdomain` -- maps points between domains.
-- `mapparms` -- parameters of the linear map between domains.
+
+.. autosummary::
+ :toctree: generated/
+
+ as_series convert list of array_likes into 1-D arrays of common type.
+ trimseq remove trailing zeros.
+ trimcoef remove small trailing coefficients.
+ getdomain return the domain appropriate for a given set of abscissae.
+ mapdomain maps points between domains.
+ mapparms parameters of the linear map between domains.
"""
from __future__ import division, absolute_import, print_function
-__all__ = ['RankWarning', 'PolyError', 'PolyDomainError', 'PolyBase',
- 'as_series', 'trimseq', 'trimcoef', 'getdomain', 'mapdomain',
- 'mapparms']
+__all__ = ['RankWarning', 'PolyError', 'PolyDomainError', 'as_series',
+ 'trimseq', 'trimcoef', 'getdomain', 'mapdomain', 'mapparms',
+ 'PolyBase']
import warnings
import numpy as np
@@ -67,6 +79,15 @@ class PolyDomainError(PolyError) :
#
class PolyBase(object) :
+ """
+ Base class for all polynomial types.
+
+ Deprecated in numpy 1.9.0, use the abstract
+ ABCPolyBase class instead. Note that the latter
+ reguires a number of virtual functions to be
+ implemented.
+
+ """
pass
#
diff --git a/numpy/polynomial/tests/test_classes.py b/numpy/polynomial/tests/test_classes.py
index 09b30a9e9..f9134b8c1 100644
--- a/numpy/polynomial/tests/test_classes.py
+++ b/numpy/polynomial/tests/test_classes.py
@@ -5,6 +5,9 @@ This tests the convert and cast methods of all the polynomial classes.
"""
from __future__ import division, absolute_import, print_function
+import operator as op
+from numbers import Number
+
import numpy as np
from numpy.polynomial import (
Polynomial, Legendre, Chebyshev, Laguerre,
@@ -13,6 +16,7 @@ from numpy.testing import (
TestCase, assert_almost_equal, assert_raises,
assert_equal, assert_, run_module_suite, dec)
from numpy.testing.noseclasses import KnownFailure
+from numpy.compat import long
classes = (
@@ -37,6 +41,7 @@ def test_class_methods():
yield check_sub, Poly
yield check_mul, Poly
yield check_floordiv, Poly
+ yield check_truediv, Poly
yield check_mod, Poly
yield check_divmod, Poly
yield check_pow, Poly
@@ -221,12 +226,12 @@ def check_add(Poly):
assert_poly_almost_equal(tuple(c2) + p1, p3)
assert_poly_almost_equal(p1 + np.array(c2), p3)
assert_poly_almost_equal(np.array(c2) + p1, p3)
- assert_raises(TypeError, p1.__add__, Poly([0], domain=Poly.domain + 1))
- assert_raises(TypeError, p1.__add__, Poly([0], window=Poly.window + 1))
+ assert_raises(TypeError, op.add, p1, Poly([0], domain=Poly.domain + 1))
+ assert_raises(TypeError, op.add, p1, Poly([0], window=Poly.window + 1))
if Poly is Polynomial:
- assert_raises(TypeError, p1.__add__, Chebyshev([0]))
+ assert_raises(TypeError, op.add, p1, Chebyshev([0]))
else:
- assert_raises(TypeError, p1.__add__, Polynomial([0]))
+ assert_raises(TypeError, op.add, p1, Polynomial([0]))
def check_sub(Poly):
@@ -243,12 +248,12 @@ def check_sub(Poly):
assert_poly_almost_equal(tuple(c2) - p1, -p3)
assert_poly_almost_equal(p1 - np.array(c2), p3)
assert_poly_almost_equal(np.array(c2) - p1, -p3)
- assert_raises(TypeError, p1.__sub__, Poly([0], domain=Poly.domain + 1))
- assert_raises(TypeError, p1.__sub__, Poly([0], window=Poly.window + 1))
+ assert_raises(TypeError, op.sub, p1, Poly([0], domain=Poly.domain + 1))
+ assert_raises(TypeError, op.sub, p1, Poly([0], window=Poly.window + 1))
if Poly is Polynomial:
- assert_raises(TypeError, p1.__sub__, Chebyshev([0]))
+ assert_raises(TypeError, op.sub, p1, Chebyshev([0]))
else:
- assert_raises(TypeError, p1.__sub__, Polynomial([0]))
+ assert_raises(TypeError, op.sub, p1, Polynomial([0]))
def check_mul(Poly):
@@ -266,12 +271,12 @@ def check_mul(Poly):
assert_poly_almost_equal(np.array(c2) * p1, p3)
assert_poly_almost_equal(p1 * 2, p1 * Poly([2]))
assert_poly_almost_equal(2 * p1, p1 * Poly([2]))
- assert_raises(TypeError, p1.__mul__, Poly([0], domain=Poly.domain + 1))
- assert_raises(TypeError, p1.__mul__, Poly([0], window=Poly.window + 1))
+ assert_raises(TypeError, op.mul, p1, Poly([0], domain=Poly.domain + 1))
+ assert_raises(TypeError, op.mul, p1, Poly([0], window=Poly.window + 1))
if Poly is Polynomial:
- assert_raises(TypeError, p1.__mul__, Chebyshev([0]))
+ assert_raises(TypeError, op.mul, p1, Chebyshev([0]))
else:
- assert_raises(TypeError, p1.__mul__, Polynomial([0]))
+ assert_raises(TypeError, op.mul, p1, Polynomial([0]))
def check_floordiv(Poly):
@@ -293,13 +298,40 @@ def check_floordiv(Poly):
assert_poly_almost_equal(2 // p2, Poly([0]))
assert_poly_almost_equal(p2 // 2, 0.5*p2)
assert_raises(
- TypeError, p1.__floordiv__, Poly([0], domain=Poly.domain + 1))
+ TypeError, op.floordiv, p1, Poly([0], domain=Poly.domain + 1))
assert_raises(
- TypeError, p1.__floordiv__, Poly([0], window=Poly.window + 1))
+ TypeError, op.floordiv, p1, Poly([0], window=Poly.window + 1))
if Poly is Polynomial:
- assert_raises(TypeError, p1.__floordiv__, Chebyshev([0]))
+ assert_raises(TypeError, op.floordiv, p1, Chebyshev([0]))
else:
- assert_raises(TypeError, p1.__floordiv__, Polynomial([0]))
+ assert_raises(TypeError, op.floordiv, p1, Polynomial([0]))
+
+
+def check_truediv(Poly):
+ # true division is valid only if the denominator is a Number and
+ # not a python bool.
+ p1 = Poly([1,2,3])
+ p2 = p1 * 5
+
+ for stype in np.ScalarType:
+ if not issubclass(stype, Number) or issubclass(stype, bool):
+ continue
+ s = stype(5)
+ assert_poly_almost_equal(op.truediv(p2, s), p1)
+ assert_raises(TypeError, op.truediv, s, p2)
+ for stype in (int, long, float):
+ s = stype(5)
+ assert_poly_almost_equal(op.truediv(p2, s), p1)
+ assert_raises(TypeError, op.truediv, s, p2)
+ for stype in [complex]:
+ s = stype(5, 0)
+ assert_poly_almost_equal(op.truediv(p2, s), p1)
+ assert_raises(TypeError, op.truediv, s, p2)
+ for s in [tuple(), list(), dict(), bool(), np.array([1])]:
+ assert_raises(TypeError, op.truediv, p2, s)
+ assert_raises(TypeError, op.truediv, s, p2)
+ for ptype in classes:
+ assert_raises(TypeError, op.truediv, p2, ptype(1))
def check_mod(Poly):
@@ -321,12 +353,12 @@ def check_mod(Poly):
assert_poly_almost_equal(np.array(c4) % p2, p3)
assert_poly_almost_equal(2 % p2, Poly([2]))
assert_poly_almost_equal(p2 % 2, Poly([0]))
- assert_raises(TypeError, p1.__mod__, Poly([0], domain=Poly.domain + 1))
- assert_raises(TypeError, p1.__mod__, Poly([0], window=Poly.window + 1))
+ assert_raises(TypeError, op.mod, p1, Poly([0], domain=Poly.domain + 1))
+ assert_raises(TypeError, op.mod, p1, Poly([0], window=Poly.window + 1))
if Poly is Polynomial:
- assert_raises(TypeError, p1.__mod__, Chebyshev([0]))
+ assert_raises(TypeError, op.mod, p1, Chebyshev([0]))
else:
- assert_raises(TypeError, p1.__mod__, Polynomial([0]))
+ assert_raises(TypeError, op.mod, p1, Polynomial([0]))
def check_divmod(Poly):
@@ -464,8 +496,8 @@ def check_pow(Poly):
for i in range(5):
assert_poly_almost_equal(tst**i, tgt)
tgt = tgt * tst
- assert_raises(ValueError, tgt.__pow__, 1.5)
- assert_raises(ValueError, tgt.__pow__, -1)
+ assert_raises(ValueError, op.pow, tgt, 1.5)
+ assert_raises(ValueError, op.pow, tgt, -1)
def check_call(Poly):
diff --git a/numpy/random/__init__.py b/numpy/random/__init__.py
index 614b25a1c..388267c97 100644
--- a/numpy/random/__init__.py
+++ b/numpy/random/__init__.py
@@ -106,8 +106,16 @@ def __RandomState_ctor():
"""Return a RandomState instance.
This function exists solely to assist (un)pickling.
+
+ Note that the state of the RandomState returned here is irrelevant, as this function's
+ entire purpose is to return a newly allocated RandomState whose state pickle can set.
+ Consequently the RandomState returned by this function is a freshly allocated copy
+ with a seed=0.
+
+ See https://github.com/numpy/numpy/issues/4763 for a detailed discussion
+
"""
- return RandomState()
+ return RandomState(seed=0)
from numpy.testing import Tester
test = Tester().test
diff --git a/numpy/random/mtrand/distributions.c b/numpy/random/mtrand/distributions.c
index 4a752ad8c..001e2f6a1 100644
--- a/numpy/random/mtrand/distributions.c
+++ b/numpy/random/mtrand/distributions.c
@@ -323,23 +323,20 @@ long rk_binomial_btpe(rk_state *state, long n, double p)
F = 1.0;
if (m < y)
{
- for (i=m; i<=y; i++)
+ for (i=m+1; i<=y; i++)
{
F *= (a/i - s);
}
}
else if (m > y)
{
- for (i=y; i<=m; i++)
+ for (i=y+1; i<=m; i++)
{
F /= (a/i - s);
}
}
- else
- {
- if (v > F) goto Step10;
- goto Step60;
- }
+ if (v > F) goto Step10;
+ goto Step60;
Step52:
rho = (k/(nrq))*((k*(k/3.0 + 0.625) + 0.16666666666666666)/nrq + 0.5);
@@ -559,7 +556,7 @@ double rk_standard_t(rk_state *state, double df)
*/
double rk_vonmises(rk_state *state, double mu, double kappa)
{
- double r, rho, s;
+ double s;
double U, V, W, Y, Z;
double result, mod;
int neg;
@@ -570,9 +567,19 @@ double rk_vonmises(rk_state *state, double mu, double kappa)
}
else
{
- r = 1 + sqrt(1 + 4*kappa*kappa);
- rho = (r - sqrt(2*r))/(2*kappa);
- s = (1 + rho*rho)/(2*rho);
+ /* with double precision rho is zero until 1.4e-8 */
+ if (kappa < 1e-5) {
+ /*
+ * second order taylor expansion around kappa = 0
+ * precise until relatively large kappas as second order is 0
+ */
+ s = (1./kappa + kappa);
+ }
+ else {
+ double r = 1 + sqrt(1 + 4*kappa*kappa);
+ double rho = (r - sqrt(2*r)) / (2*kappa);
+ s = (1 + rho*rho)/(2*rho);
+ }
while (1)
{
diff --git a/numpy/random/mtrand/initarray.h b/numpy/random/mtrand/initarray.h
index f764895d1..f5e5e5332 100644
--- a/numpy/random/mtrand/initarray.h
+++ b/numpy/random/mtrand/initarray.h
@@ -1,4 +1,5 @@
#include "Python.h"
+#define NO_IMPORT_ARRAY
#include "numpy/arrayobject.h"
#include "randomkit.h"
diff --git a/numpy/random/mtrand/mtrand.c b/numpy/random/mtrand/mtrand.c
deleted file mode 100644
index a508efba1..000000000
--- a/numpy/random/mtrand/mtrand.c
+++ /dev/null
@@ -1,26337 +0,0 @@
-/* Generated by Cython 0.19 on Fri Jun 28 16:46:58 2013 */
-
-#define PY_SSIZE_T_CLEAN
-#ifndef CYTHON_USE_PYLONG_INTERNALS
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#else
-#include "pyconfig.h"
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 1
-#else
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#endif
-#endif
-#endif
-#include "Python.h"
-#ifndef Py_PYTHON_H
- #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02040000
- #error Cython requires Python 2.4+.
-#else
-#include <stddef.h> /* For offsetof */
-#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
-#endif
-#if !defined(WIN32) && !defined(MS_WINDOWS)
- #ifndef __stdcall
- #define __stdcall
- #endif
- #ifndef __cdecl
- #define __cdecl
- #endif
- #ifndef __fastcall
- #define __fastcall
- #endif
-#endif
-#ifndef DL_IMPORT
- #define DL_IMPORT(t) t
-#endif
-#ifndef DL_EXPORT
- #define DL_EXPORT(t) t
-#endif
-#ifndef PY_LONG_LONG
- #define PY_LONG_LONG LONG_LONG
-#endif
-#ifndef Py_HUGE_VAL
- #define Py_HUGE_VAL HUGE_VAL
-#endif
-#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
-#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
-#endif
-#if PY_VERSION_HEX < 0x02050000
- typedef int Py_ssize_t;
- #define PY_SSIZE_T_MAX INT_MAX
- #define PY_SSIZE_T_MIN INT_MIN
- #define PY_FORMAT_SIZE_T ""
- #define CYTHON_FORMAT_SSIZE_T ""
- #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
- #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o)
- #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
- (PyErr_Format(PyExc_TypeError, \
- "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
- (PyObject*)0))
- #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
- !PyComplex_Check(o))
- #define PyIndex_Check __Pyx_PyIndex_Check
- #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
- #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
- #define __PYX_BUILD_PY_SSIZE_T "n"
- #define CYTHON_FORMAT_SSIZE_T "z"
- #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
- #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
- #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
- #define PyVarObject_HEAD_INIT(type, size) \
- PyObject_HEAD_INIT(type) size,
- #define PyType_Modified(t)
- typedef struct {
- void *buf;
- PyObject *obj;
- Py_ssize_t len;
- Py_ssize_t itemsize;
- int readonly;
- int ndim;
- char *format;
- Py_ssize_t *shape;
- Py_ssize_t *strides;
- Py_ssize_t *suboffsets;
- void *internal;
- } Py_buffer;
- #define PyBUF_SIMPLE 0
- #define PyBUF_WRITABLE 0x0001
- #define PyBUF_FORMAT 0x0004
- #define PyBUF_ND 0x0008
- #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
- #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
- #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
- #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
- #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
- #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
- #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
- typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
- typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
-#endif
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
- PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-#else
- #define __Pyx_BUILTIN_MODULE_NAME "builtins"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
- PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
- #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define Py_TPFLAGS_CHECKTYPES 0
- #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
- #define Py_TPFLAGS_HAVE_NEWBUFFER 0
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define Py_TPFLAGS_HAVE_VERSION_TAG 0
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
- #define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
- 0 : _PyUnicode_Ready((PyObject *)(op)))
- #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
- #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
- #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
-#else
- #define CYTHON_PEP393_ENABLED 0
- #define __Pyx_PyUnicode_READY(op) (0)
- #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
- #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
- #define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyBaseString_Type PyUnicode_Type
- #define PyStringObject PyUnicodeObject
- #define PyString_Type PyUnicode_Type
- #define PyString_Check PyUnicode_Check
- #define PyString_CheckExact PyUnicode_CheckExact
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define PyBytesObject PyStringObject
- #define PyBytes_Type PyString_Type
- #define PyBytes_Check PyString_Check
- #define PyBytes_CheckExact PyString_CheckExact
- #define PyBytes_FromString PyString_FromString
- #define PyBytes_FromStringAndSize PyString_FromStringAndSize
- #define PyBytes_FromFormat PyString_FromFormat
- #define PyBytes_DecodeEscape PyString_DecodeEscape
- #define PyBytes_AsString PyString_AsString
- #define PyBytes_AsStringAndSize PyString_AsStringAndSize
- #define PyBytes_Size PyString_Size
- #define PyBytes_AS_STRING PyString_AS_STRING
- #define PyBytes_GET_SIZE PyString_GET_SIZE
- #define PyBytes_Repr PyString_Repr
- #define PyBytes_Concat PyString_Concat
- #define PyBytes_ConcatAndDel PyString_ConcatAndDel
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
- #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
- #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
- PyString_Check(obj) || PyUnicode_Check(obj))
- #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type)
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
- #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
-#endif
-#ifndef PySet_CheckExact
- #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
-#endif
-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
-#if PY_MAJOR_VERSION >= 3
- #define PyIntObject PyLongObject
- #define PyInt_Type PyLong_Type
- #define PyInt_Check(op) PyLong_Check(op)
- #define PyInt_CheckExact(op) PyLong_CheckExact(op)
- #define PyInt_FromString PyLong_FromString
- #define PyInt_FromUnicode PyLong_FromUnicode
- #define PyInt_FromLong PyLong_FromLong
- #define PyInt_FromSize_t PyLong_FromSize_t
- #define PyInt_FromSsize_t PyLong_FromSsize_t
- #define PyInt_AsLong PyLong_AsLong
- #define PyInt_AS_LONG PyLong_AS_LONG
- #define PyInt_AsSsize_t PyLong_AsSsize_t
- #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
- #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyBoolObject PyLongObject
-#endif
-#if PY_VERSION_HEX < 0x03020000
- typedef long Py_hash_t;
- #define __Pyx_PyInt_FromHash_t PyInt_FromLong
- #define __Pyx_PyInt_AsHash_t PyInt_AsLong
-#else
- #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
- #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
-#endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
- #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
- #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
- #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
-#else
- #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
- #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
- #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
-#endif
-#if PY_VERSION_HEX < 0x02050000
- #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
- #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
- #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
-#else
- #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
- #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
- #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
-#endif
-#if PY_VERSION_HEX < 0x02050000
- #define __Pyx_NAMESTR(n) ((char *)(n))
- #define __Pyx_DOCSTR(n) ((char *)(n))
-#else
- #define __Pyx_NAMESTR(n) (n)
- #define __Pyx_DOCSTR(n) (n)
-#endif
-#ifndef CYTHON_INLINE
- #if defined(__GNUC__)
- #define CYTHON_INLINE __inline__
- #elif defined(_MSC_VER)
- #define CYTHON_INLINE __inline
- #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
- #define CYTHON_INLINE inline
- #else
- #define CYTHON_INLINE
- #endif
-#endif
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
- /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
- a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
- a quiet NaN. */
- float value;
- memset(&value, 0xFF, sizeof(value));
- return value;
-}
-#endif
-
-
-#if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
-#else
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
-#endif
-
-#ifndef __PYX_EXTERN_C
- #ifdef __cplusplus
- #define __PYX_EXTERN_C extern "C"
- #else
- #define __PYX_EXTERN_C extern
- #endif
-#endif
-
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#define __PYX_HAVE__mtrand
-#define __PYX_HAVE_API__mtrand
-#include "string.h"
-#include "math.h"
-#include "numpy/npy_no_deprecated_api.h"
-#include "numpy/arrayobject.h"
-#include "mtrand_py_helper.h"
-#include "randomkit.h"
-#include "distributions.h"
-#include "initarray.h"
-#ifdef _OPENMP
-#include <omp.h>
-#endif /* _OPENMP */
-
-#ifdef PYREX_WITHOUT_ASSERTIONS
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-#ifndef CYTHON_UNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define CYTHON_UNUSED __attribute__ ((__unused__))
-# else
-# define CYTHON_UNUSED
-# endif
-# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
-# define CYTHON_UNUSED __attribute__ ((__unused__))
-# else
-# define CYTHON_UNUSED
-# endif
-#endif
-typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
- const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyBytes_FromString PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
- #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
- #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
- #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
- const Py_UNICODE *u_end = u;
- while (*u_end++) ;
- return u_end - u - 1;
-}
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
-#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
-#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
-#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params() {
- PyObject* sys = NULL;
- PyObject* default_encoding = NULL;
- PyObject* ascii_chars_u = NULL;
- PyObject* ascii_chars_b = NULL;
- sys = PyImport_ImportModule("sys");
- if (sys == NULL) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
- if (default_encoding == NULL) goto bad;
- if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
- __Pyx_sys_getdefaultencoding_not_ascii = 0;
- } else {
- const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
- char ascii_chars[128];
- int c;
- for (c = 0; c < 128; c++) {
- ascii_chars[c] = c;
- }
- __Pyx_sys_getdefaultencoding_not_ascii = 1;
- ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
- if (ascii_chars_u == NULL) goto bad;
- ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
- if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
- PyErr_Format(
- PyExc_ValueError,
- "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.",
- default_encoding_c);
- goto bad;
- }
- }
- Py_XDECREF(sys);
- Py_XDECREF(default_encoding);
- Py_XDECREF(ascii_chars_u);
- Py_XDECREF(ascii_chars_b);
- return 0;
-bad:
- Py_XDECREF(sys);
- Py_XDECREF(default_encoding);
- Py_XDECREF(ascii_chars_u);
- Py_XDECREF(ascii_chars_b);
- return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params() {
- PyObject* sys = NULL;
- PyObject* default_encoding = NULL;
- char* default_encoding_c;
- sys = PyImport_ImportModule("sys");
- if (sys == NULL) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
- if (default_encoding == NULL) goto bad;
- default_encoding_c = PyBytes_AS_STRING(default_encoding);
- __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
- strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
- Py_DECREF(sys);
- Py_DECREF(default_encoding);
- return 0;
-bad:
- Py_XDECREF(sys);
- Py_XDECREF(default_encoding);
- return -1;
-}
-#endif
-#endif
-
-
-#ifdef __GNUC__
- /* Test for GCC > 2.95 */
- #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
- #define likely(x) __builtin_expect(!!(x), 1)
- #define unlikely(x) __builtin_expect(!!(x), 0)
- #else /* __GNUC__ > 2 ... */
- #define likely(x) (x)
- #define unlikely(x) (x)
- #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
- #define likely(x) (x)
- #define unlikely(x) (x)
-#endif /* __GNUC__ */
-
-static PyObject *__pyx_m;
-static PyObject *__pyx_d;
-static PyObject *__pyx_b;
-static PyObject *__pyx_empty_tuple;
-static PyObject *__pyx_empty_bytes;
-static int __pyx_lineno;
-static int __pyx_clineno = 0;
-static const char * __pyx_cfilenm= __FILE__;
-static const char *__pyx_filename;
-
-
-static const char *__pyx_f[] = {
- "mtrand.pyx",
- "numpy.pxd",
-};
-
-/*--- Type declarations ---*/
-struct __pyx_obj_6mtrand_RandomState;
-
-/* "mtrand.pyx":107
- * long rk_logseries(rk_state *state, double p)
- *
- * ctypedef double (* rk_cont0)(rk_state *state) # <<<<<<<<<<<<<<
- * ctypedef double (* rk_cont1)(rk_state *state, double a)
- * ctypedef double (* rk_cont2)(rk_state *state, double a, double b)
- */
-typedef double (*__pyx_t_6mtrand_rk_cont0)(rk_state *);
-
-/* "mtrand.pyx":108
- *
- * ctypedef double (* rk_cont0)(rk_state *state)
- * ctypedef double (* rk_cont1)(rk_state *state, double a) # <<<<<<<<<<<<<<
- * ctypedef double (* rk_cont2)(rk_state *state, double a, double b)
- * ctypedef double (* rk_cont3)(rk_state *state, double a, double b, double c)
- */
-typedef double (*__pyx_t_6mtrand_rk_cont1)(rk_state *, double);
-
-/* "mtrand.pyx":109
- * ctypedef double (* rk_cont0)(rk_state *state)
- * ctypedef double (* rk_cont1)(rk_state *state, double a)
- * ctypedef double (* rk_cont2)(rk_state *state, double a, double b) # <<<<<<<<<<<<<<
- * ctypedef double (* rk_cont3)(rk_state *state, double a, double b, double c)
- *
- */
-typedef double (*__pyx_t_6mtrand_rk_cont2)(rk_state *, double, double);
-
-/* "mtrand.pyx":110
- * ctypedef double (* rk_cont1)(rk_state *state, double a)
- * ctypedef double (* rk_cont2)(rk_state *state, double a, double b)
- * ctypedef double (* rk_cont3)(rk_state *state, double a, double b, double c) # <<<<<<<<<<<<<<
- *
- * ctypedef long (* rk_disc0)(rk_state *state)
- */
-typedef double (*__pyx_t_6mtrand_rk_cont3)(rk_state *, double, double, double);
-
-/* "mtrand.pyx":112
- * 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)
- */
-typedef long (*__pyx_t_6mtrand_rk_disc0)(rk_state *);
-
-/* "mtrand.pyx":113
- *
- * 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)
- */
-typedef long (*__pyx_t_6mtrand_rk_discnp)(rk_state *, long, double);
-
-/* "mtrand.pyx":114
- * 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)
- */
-typedef long (*__pyx_t_6mtrand_rk_discdd)(rk_state *, double, double);
-
-/* "mtrand.pyx":115
- * 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)
- *
- */
-typedef long (*__pyx_t_6mtrand_rk_discnmN)(rk_state *, long, long, long);
-
-/* "mtrand.pyx":116
- * 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) # <<<<<<<<<<<<<<
- *
- *
- */
-typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *, double);
-
-/* "mtrand.pyx":525
- * return sum
- *
- * cdef class RandomState: # <<<<<<<<<<<<<<
- * """
- * RandomState(seed=None)
- */
-struct __pyx_obj_6mtrand_RandomState {
- PyObject_HEAD
- rk_state *internal_state;
-};
-
-#ifndef CYTHON_REFNANNY
- #define CYTHON_REFNANNY 0
-#endif
-#if CYTHON_REFNANNY
- typedef struct {
- void (*INCREF)(void*, PyObject*, int);
- void (*DECREF)(void*, PyObject*, int);
- void (*GOTREF)(void*, PyObject*, int);
- void (*GIVEREF)(void*, PyObject*, int);
- void* (*SetupContext)(const char*, int, const char*);
- void (*FinishContext)(void**);
- } __Pyx_RefNannyAPIStruct;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
- #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
-#ifdef WITH_THREAD
- #define __Pyx_RefNannySetupContext(name, acquire_gil) \
- if (acquire_gil) { \
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
- PyGILState_Release(__pyx_gilstate_save); \
- } else { \
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
- }
-#else
- #define __Pyx_RefNannySetupContext(name, acquire_gil) \
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
-#endif
- #define __Pyx_RefNannyFinishContext() \
- __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
- #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
- #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
- #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
- #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
-#else
- #define __Pyx_RefNannyDeclarations
- #define __Pyx_RefNannySetupContext(name, acquire_gil)
- #define __Pyx_RefNannyFinishContext()
- #define __Pyx_INCREF(r) Py_INCREF(r)
- #define __Pyx_DECREF(r) Py_DECREF(r)
- #define __Pyx_GOTREF(r)
- #define __Pyx_GIVEREF(r)
- #define __Pyx_XINCREF(r) Py_XINCREF(r)
- #define __Pyx_XDECREF(r) Py_XDECREF(r)
- #define __Pyx_XGOTREF(r)
- #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
-#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
-#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
- PyTypeObject* tp = Py_TYPE(obj);
- if (likely(tp->tp_getattro))
- return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
- if (likely(tp->tp_getattr))
- return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
- return PyObject_GetAttr(obj, attr_name);
-}
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
-
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
-
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
- const char* function_name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
- Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
- (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
- (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck);
-#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
- (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
- int is_list, int wraparound, int boundscheck);
-
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
- PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
- PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
- int has_cstart, int has_cstop, int wraparound);
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-#define __Pyx_PyObject_DelSlice(obj, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound) \
- __Pyx_PyObject_SetSlice(obj, (PyObject*)NULL, cstart, cstop, py_start, py_stop, py_slice, has_cstart, has_cstop, wraparound)
-static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
- PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
- PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
- int has_cstart, int has_cstop, int wraparound);
-
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
-static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
- PyTypeObject* tp = Py_TYPE(obj);
- if (likely(tp->tp_setattro))
- return tp->tp_setattro(obj, attr_name, value);
-#if PY_MAJOR_VERSION < 3
- if (likely(tp->tp_setattr))
- return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
-#endif
- return PyObject_SetAttr(obj, attr_name, value);
-}
-#else
-#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
-#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
-#endif
-
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
-
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
- PyListObject* L = (PyListObject*) list;
- Py_ssize_t len = Py_SIZE(list);
- if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
- Py_INCREF(x);
- PyList_SET_ITEM(list, len, x);
- Py_SIZE(list) = len+1;
- return 0;
- }
- return PyList_Append(list, x);
-}
-#else
-#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
-#endif
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
-static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(PyObject* src, Py_ssize_t start, Py_ssize_t stop);
-#else
-#define __Pyx_PyList_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
-#define __Pyx_PyTuple_GetSlice(seq, start, stop) PySequence_GetSlice(seq, start, stop)
-#endif
-
-static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/
-
-#ifndef __PYX_FORCE_INIT_THREADS
- #define __PYX_FORCE_INIT_THREADS 0
-#endif
-
-#define __Pyx_SetItemInt(o, i, v, size, to_py_func, is_list, wraparound, boundscheck) \
- (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_SetItemInt_Fast(o, i, v, is_list, wraparound, boundscheck) : \
- __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
- int is_list, int wraparound, int boundscheck);
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-static CYTHON_INLINE npy_intp __Pyx_PyInt_from_py_npy_intp(PyObject *);
-
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp);
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
-
-static int __Pyx_check_binary_version(void);
-
-#if !defined(__Pyx_PyIdentifier_FromString)
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
-#else
- #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
-#endif
-#endif
-
-static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
-
-typedef struct {
- int code_line;
- PyCodeObject* code_object;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
- int count;
- int max_count;
- __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
-
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename); /*proto*/
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-
-
-/* Module declarations from 'numpy' */
-
-/* Module declarations from 'mtrand' */
-static PyTypeObject *__pyx_ptype_6mtrand_dtype = 0;
-static PyTypeObject *__pyx_ptype_6mtrand_ndarray = 0;
-static PyTypeObject *__pyx_ptype_6mtrand_flatiter = 0;
-static PyTypeObject *__pyx_ptype_6mtrand_broadcast = 0;
-static PyTypeObject *__pyx_ptype_6mtrand_RandomState = 0;
-static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *, __pyx_t_6mtrand_rk_cont0, PyObject *); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *, __pyx_t_6mtrand_rk_cont1, PyObject *, double); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *, __pyx_t_6mtrand_rk_cont1, PyObject *, PyArrayObject *); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *, __pyx_t_6mtrand_rk_cont2, PyObject *, double, double); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *, __pyx_t_6mtrand_rk_cont2, PyObject *, PyArrayObject *, PyArrayObject *); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *, __pyx_t_6mtrand_rk_cont3, PyObject *, double, double, double); /*proto*/
-static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *, __pyx_t_6mtrand_rk_cont3, PyObject *, PyArrayObject *, PyArrayObject *, PyArrayObject *); /*proto*/
-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*/
-static PyObject *__pyx_f_6mtrand_discd_array(rk_state *, __pyx_t_6mtrand_rk_discd, PyObject *, PyArrayObject *); /*proto*/
-static double __pyx_f_6mtrand_kahan_sum(double *, npy_intp); /*proto*/
-#define __Pyx_MODULE_NAME "mtrand"
-int __pyx_module_is_main_mtrand = 0;
-
-/* Implementation of 'mtrand' */
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_TypeError;
-static int __pyx_pf_6mtrand_11RandomState___init__(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_seed); /* proto */
-static void __pyx_pf_6mtrand_11RandomState_2__dealloc__(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_4seed(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_seed); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_6get_state(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_8set_state(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_10__getstate__(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_12__setstate__(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_14__reduce__(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_16random_sample(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_18tomaxint(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_20randint(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_low, PyObject *__pyx_v_high, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_22bytes(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, npy_intp __pyx_v_length); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_size, PyObject *__pyx_v_replace, PyObject *__pyx_v_p); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_low, PyObject *__pyx_v_high, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_28rand(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_30randn(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_low, PyObject *__pyx_v_high, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_34standard_normal(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_scale, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_scale, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_42standard_exponential(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_scale, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_dfnum, PyObject *__pyx_v_dfden, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_dfnum, PyObject *__pyx_v_dfden, PyObject *__pyx_v_nonc, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_df, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_df, PyObject *__pyx_v_nonc, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_56standard_cauchy(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_df, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_mu, PyObject *__pyx_v_kappa, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_scale, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_scale, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_scale, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_mean, PyObject *__pyx_v_sigma, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_scale, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_mean, PyObject *__pyx_v_scale, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_left, PyObject *__pyx_v_mode, PyObject *__pyx_v_right, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_p, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_p, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_lam, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_ngood, PyObject *__pyx_v_nbad, PyObject *__pyx_v_nsample, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_mean, PyObject *__pyx_v_cov, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, npy_intp __pyx_v_n, PyObject *__pyx_v_pvals, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_size); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
-static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
-static PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static char __pyx_k_1[] = "size is not compatible with inputs";
-static char __pyx_k_9[] = "algorithm must be 'MT19937'";
-static char __pyx_k_13[] = "state must be 624 longs";
-static char __pyx_k_15[] = "low >= high";
-static char __pyx_k_18[] = "a must be 1-dimensional or an integer";
-static char __pyx_k_20[] = "a must be greater than 0";
-static char __pyx_k_22[] = "a must be 1-dimensional";
-static char __pyx_k_24[] = "a must be non-empty";
-static char __pyx_k_26[] = "p must be 1-dimensional";
-static char __pyx_k_28[] = "a and p must have same size";
-static char __pyx_k_30[] = "probabilities are not non-negative";
-static char __pyx_k_32[] = "probabilities do not sum to 1";
-static char __pyx_k_34[] = "Cannot take a larger sample than population when 'replace=False'";
-static char __pyx_k_36[] = "Fewer non-zero entries in p than size";
-static char __pyx_k_44[] = "scale <= 0";
-static char __pyx_k_47[] = "a <= 0";
-static char __pyx_k_49[] = "b <= 0";
-static char __pyx_k_56[] = "shape <= 0";
-static char __pyx_k_66[] = "dfnum <= 0";
-static char __pyx_k_68[] = "dfden <= 0";
-static char __pyx_k_70[] = "dfnum <= 1";
-static char __pyx_k_73[] = "nonc < 0";
-static char __pyx_k_78[] = "df <= 0";
-static char __pyx_k_82[] = "nonc <= 0";
-static char __pyx_k_84[] = "df <= 1";
-static char __pyx_k_89[] = "kappa < 0";
-static char __pyx_k__a[] = "a";
-static char __pyx_k__b[] = "b";
-static char __pyx_k__f[] = "f";
-static char __pyx_k__l[] = "l";
-static char __pyx_k__n[] = "n";
-static char __pyx_k__p[] = "p";
-static char __pyx_k_112[] = "sigma <= 0";
-static char __pyx_k_114[] = "sigma <= 0.0";
-static char __pyx_k_118[] = "scale <= 0.0";
-static char __pyx_k_120[] = "mean <= 0";
-static char __pyx_k_123[] = "mean <= 0.0";
-static char __pyx_k_126[] = "left > mode";
-static char __pyx_k_128[] = "mode > right";
-static char __pyx_k_130[] = "left == right";
-static char __pyx_k_135[] = "n < 0";
-static char __pyx_k_137[] = "p < 0";
-static char __pyx_k_139[] = "p > 1";
-static char __pyx_k_144[] = "n <= 0";
-static char __pyx_k_152[] = "lam < 0";
-static char __pyx_k_154[] = "lam value too large";
-static char __pyx_k_157[] = "lam value too large.";
-static char __pyx_k_159[] = "a <= 1.0";
-static char __pyx_k_162[] = "p < 0.0";
-static char __pyx_k_164[] = "p > 1.0";
-static char __pyx_k_168[] = "ngood < 0";
-static char __pyx_k_170[] = "nbad < 0";
-static char __pyx_k_172[] = "nsample < 1";
-static char __pyx_k_174[] = "ngood + nbad < nsample";
-static char __pyx_k_180[] = "p <= 0.0";
-static char __pyx_k_182[] = "p >= 1.0";
-static char __pyx_k_186[] = "mean must be 1 dimensional";
-static char __pyx_k_188[] = "cov must be 2 dimensional and square";
-static char __pyx_k_190[] = "mean and cov must have same length";
-static char __pyx_k_193[] = "numpy.dual";
-static char __pyx_k_194[] = "sum(pvals[:-1]) > 1.0";
-static char __pyx_k_199[] = "standard_exponential";
-static char __pyx_k_200[] = "noncentral_chisquare";
-static char __pyx_k_201[] = "RandomState.random_sample (line 722)";
-static char __pyx_k_202[] = "\n random_sample(size=None)\n\n Return random floats in the half-open interval [0.0, 1.0).\n\n Results are from the \"continuous uniform\" distribution over the\n stated interval. To sample :math:`Unif[a, b), b > a` multiply\n the output of `random_sample` by `(b-a)` and add `a`::\n\n (b - a) * random_sample() + a\n\n Parameters\n ----------\n size : int or tuple of ints, optional\n Defines the shape of the returned array of random floats. If None\n (the default), returns a single float.\n\n Returns\n -------\n out : float or ndarray of floats\n Array of random floats of shape `size` (unless ``size=None``, in which\n case a single float is returned).\n\n Examples\n --------\n >>> np.random.random_sample()\n 0.47108547995356098\n >>> type(np.random.random_sample())\n <type 'float'>\n >>> np.random.random_sample((5,))\n array([ 0.30220482, 0.86820401, 0.1654503 , 0.11659149, 0.54323428])\n\n Three-by-two array of random numbers from [-5, 0):\n\n >>> 5 * np.random.random_sample((3, 2)) - 5\n array([[-3.99149989, -0.52338984],\n [-2.99091858, -0.79479508],\n [-1.23204345, -1.75224494]])\n\n ";
-static char __pyx_k_203[] = "RandomState.tomaxint (line 765)";
-static char __pyx_k_204[] = "\n tomaxint(size=None)\n\n Random integers between 0 and ``sys.maxint``, inclusive.\n\n Return a sample of uniformly distributed random integers in the interval\n [0, ``sys.maxint``].\n\n Parameters\n ----------\n size : tuple of ints, int, optional\n Shape of output. If this is, for example, (m,n,k), m*n*k samples\n are generated. If no shape is specified, a single sample is\n returned.\n\n Returns\n -------\n out : ndarray\n Drawn samples, with shape `size`.\n\n See Also\n --------\n randint : Uniform sampling over a given half-open interval of integers.\n random_integers : Uniform sampling over a given closed interval of\n integers.\n\n Examples\n --------\n >>> RS = np.random.mtrand.RandomState() # need a RandomState object\n >>> RS.tomaxint((2,2,2))\n array([[[1170048599, 1600360186],\n [ 739731006, 1947757578]],\n [[1871712945, 752307660],\n [1601631370, 1479324245]]])\n >>> import sys\n >>> sys.maxint\n 2147483647\n >>> RS.tomaxint((2,2,2)) < sys.maxint\n array([[[ True, True],\n [ True, True]],\n [[ True, True],\n [ True, True]]], dtype=bool)\n\n ";
-static char __pyx_k_205[] = "RandomState.randint (line 812)";
-static char __pyx_k_206[] = "\n randint(low, high=None, size=None)\n\n Return random integers from `low` (inclusive) to `high` (exclusive).\n\n Return random integers from the \"discrete uniform\" distribution in the\n \"half-open\" interval [`low`, `high`). If `high` is None (the default),\n then results are from [0, `low`).\n\n Parameters\n ----------\n low : int\n Lowest (signed) integer to be drawn from the distribution (unless\n ``high=None``, in which case this parameter is the *highest* such\n integer).\n high : int, optional\n If provided, one above the largest (signed) integer to be drawn\n from the distribution (see above for behavior if ``high=None``).\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single int is\n returned.\n\n Returns\n -------\n out : int or ndarray of ints\n `size`-shaped array of random integers from the appropriate\n distribution, or a single such random int if `size` not provided.\n\n See Also\n --------\n random.random_integers : similar to `randint`, only for the closed\n interval [`low`, `high`], and 1 is the lowest value if `high` is\n omitted. In particular, this other one is the one to use to generate\n uniformly distributed discrete non-integers.\n\n Examples\n --------\n >>> np.random.randint(2, size=10)\n array([1, 0, 0, 0, 1, 1, 0, 0, 1, 0])\n >>> np.random.randint(1, size=10)\n array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n\n Generate a 2 x 4 array of ints between 0 and 4, inclusive:\n\n >>> np.random.randint(5, size=(2, 4))\n array([[4, 0, 2, 1],\n [3, 2, 2, 0]])\n\n ";
-static char __pyx_k_207[] = "RandomState.bytes (line 892)";
-static char __pyx_k_208[] = "\n bytes(length)\n\n Return random bytes.\n\n Parameters\n ----------\n length : int\n Number of random bytes.\n\n Returns\n -------\n out : str\n String of length `length`.\n\n Examples\n --------\n >>> np.random.bytes(10)\n ' eh\\x85\\x022SZ\\xbf\\xa4' #random\n\n ";
-static char __pyx_k_209[] = "RandomState.choice (line 920)";
-static char __pyx_k_210[] = "\n choice(a, size=None, replace=True, p=None)\n\n Generates a random sample from a given 1-D array\n\n .. versionadded:: 1.7.0\n\n Parameters\n -----------\n a : 1-D array-like or int\n If an ndarray, a random sample is generated from its elements.\n If an int, the random sample is generated as if a was np.arange(n)\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single value is\n returned.\n replace : boolean, optional\n Whether the sample is with or without replacement\n p : 1-D array-like, optional\n The probabilities associated with each entry in a.\n If not given the sample assumes a uniform distribtion over all\n entries in a.\n\n Returns\n --------\n samples : 1-D ndarray, shape (size,)\n The generated random samples\n\n Raises\n -------\n ValueError\n If a is an int and less than zero, if a or p are not 1-dimensional,\n if a is an array-like of size 0, if p is not a vector of\n probabilities, if a and p have different lengths, or if\n replace=False and the sample size is greater than the population\n size\n\n See Also\n ---------\n randint, shuffle, permutation\n\n Examples\n ---------\n Generate a uniform random sample from np.arange(5) of size 3:\n\n >>> np.random.choice(5, 3)\n array([0, 3, 4])\n >>> #This is equivalent to np.random.randint(0,5,3)\n\n Generate a non-uniform random sample from np.arange(5) of size 3:\n\n >>> np.random.choice(5, 3, p=[0.1, 0, 0.3, 0.6, 0])\n array([3, 3, 0])\n\n Generate a uniform random sample from np.arange(5) of size 3 without\n replacement:\n\n >>> np.random.choice(5, 3, replace=False)\n array([3,1,0])\n "" >>> #This is equivalent to np.random.shuffle(np.arange(5))[:3]\n\n Generate a non-uniform random sample from np.arange(5) of size\n 3 without replacement:\n\n >>> np.random.choice(5, 3, replace=False, p=[0.1, 0, 0.3, 0.6, 0])\n array([2, 3, 0])\n\n Any of the above can be repeated with an arbitrary array-like\n instead of just integers. For instance:\n\n >>> aa_milne_arr = ['pooh', 'rabbit', 'piglet', 'Christopher']\n >>> np.random.choice(aa_milne_arr, 5, p=[0.5, 0.1, 0.1, 0.3])\n array(['pooh', 'pooh', 'pooh', 'Christopher', 'piglet'],\n dtype='|S11')\n\n ";
-static char __pyx_k_211[] = "RandomState.uniform (line 1092)";
-static char __pyx_k_212[] = "\n uniform(low=0.0, high=1.0, size=1)\n\n Draw samples from a uniform distribution.\n\n Samples are uniformly distributed over the half-open interval\n ``[low, high)`` (includes low, but excludes high). In other words,\n any value within the given interval is equally likely to be drawn\n by `uniform`.\n\n Parameters\n ----------\n low : float, optional\n Lower boundary of the output interval. All values generated will be\n greater than or equal to low. The default value is 0.\n high : float\n Upper boundary of the output interval. All values generated will be\n less than high. The default value is 1.0.\n size : int or tuple of ints, optional\n Shape of output. If the given size is, for example, (m,n,k),\n m*n*k samples are generated. If no shape is specified, a single sample\n is returned.\n\n Returns\n -------\n out : ndarray\n Drawn samples, with shape `size`.\n\n See Also\n --------\n randint : Discrete uniform distribution, yielding integers.\n random_integers : Discrete uniform distribution over the closed\n interval ``[low, high]``.\n random_sample : Floats uniformly distributed over ``[0, 1)``.\n random : Alias for `random_sample`.\n rand : Convenience function that accepts dimensions as input, e.g.,\n ``rand(2,2)`` would generate a 2-by-2 array of floats,\n uniformly distributed over ``[0, 1)``.\n\n Notes\n -----\n The probability density function of the uniform distribution is\n\n .. math:: p(x) = \\frac{1}{b - a}\n\n anywhere within the interval ``[a, b)``, and zero elsewhere.\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> s = np.random.uniform(-1,0,1000)\n\n All values are w""ithin the given interval:\n\n >>> np.all(s >= -1)\n True\n >>> np.all(s < 0)\n True\n\n Display the histogram of the samples, along with the\n probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 15, normed=True)\n >>> plt.plot(bins, np.ones_like(bins), linewidth=2, color='r')\n >>> plt.show()\n\n ";
-static char __pyx_k_213[] = "RandomState.rand (line 1179)";
-static char __pyx_k_214[] = "\n rand(d0, d1, ..., dn)\n\n Random values in a given shape.\n\n Create an array of the given shape and propagate it with\n random samples from a uniform distribution\n over ``[0, 1)``.\n\n Parameters\n ----------\n d0, d1, ..., dn : int, optional\n The dimensions of the returned array, should all be positive.\n If no argument is given a single Python float is returned.\n\n Returns\n -------\n out : ndarray, shape ``(d0, d1, ..., dn)``\n Random values.\n\n See Also\n --------\n random\n\n Notes\n -----\n This is a convenience function. If you want an interface that\n takes a shape-tuple as the first argument, refer to\n np.random.random_sample .\n\n Examples\n --------\n >>> np.random.rand(3,2)\n array([[ 0.14022471, 0.96360618], #random\n [ 0.37601032, 0.25528411], #random\n [ 0.49313049, 0.94909878]]) #random\n\n ";
-static char __pyx_k_215[] = "RandomState.randn (line 1223)";
-static char __pyx_k_216[] = "\n randn(d0, d1, ..., dn)\n\n Return a sample (or samples) from the \"standard normal\" distribution.\n\n If positive, int_like or int-convertible arguments are provided,\n `randn` generates an array of shape ``(d0, d1, ..., dn)``, filled\n with random floats sampled from a univariate \"normal\" (Gaussian)\n distribution of mean 0 and variance 1 (if any of the :math:`d_i` are\n floats, they are first converted to integers by truncation). A single\n float randomly sampled from the distribution is returned if no\n argument is provided.\n\n This is a convenience function. If you want an interface that takes a\n tuple as the first argument, use `numpy.random.standard_normal` instead.\n\n Parameters\n ----------\n d0, d1, ..., dn : int, optional\n The dimensions of the returned array, should be all positive.\n If no argument is given a single Python float is returned.\n\n Returns\n -------\n Z : ndarray or float\n A ``(d0, d1, ..., dn)``-shaped array of floating-point samples from\n the standard normal distribution, or a single such float if\n no parameters were supplied.\n\n See Also\n --------\n random.standard_normal : Similar, but takes a tuple as its argument.\n\n Notes\n -----\n For random samples from :math:`N(\\mu, \\sigma^2)`, use:\n\n ``sigma * np.random.randn(...) + mu``\n\n Examples\n --------\n >>> np.random.randn()\n 2.1923875335537315 #random\n\n Two-by-four array of samples from N(3, 6.25):\n\n >>> 2.5 * np.random.randn(2, 4) + 3\n array([[-4.49401501, 4.00950034, -1.81814867, 7.29718677], #random\n [ 0.39924804, 4.68456316, 4.99394529, 4.84057254]]) #random\n\n ";
-static char __pyx_k_217[] = "RandomState.random_integers (line 1280)";
-static char __pyx_k_218[] = "\n random_integers(low, high=None, size=None)\n\n Return random integers between `low` and `high`, inclusive.\n\n Return random integers from the \"discrete uniform\" distribution in the\n closed interval [`low`, `high`]. If `high` is None (the default),\n then results are from [1, `low`].\n\n Parameters\n ----------\n low : int\n Lowest (signed) integer to be drawn from the distribution (unless\n ``high=None``, in which case this parameter is the *highest* such\n integer).\n high : int, optional\n If provided, the largest (signed) integer to be drawn from the\n distribution (see above for behavior if ``high=None``).\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single int is returned.\n\n Returns\n -------\n out : int or ndarray of ints\n `size`-shaped array of random integers from the appropriate\n distribution, or a single such random int if `size` not provided.\n\n See Also\n --------\n random.randint : Similar to `random_integers`, only for the half-open\n interval [`low`, `high`), and 0 is the lowest value if `high` is\n omitted.\n\n Notes\n -----\n To sample from N evenly spaced floating-point numbers between a and b,\n use::\n\n a + (b - a) * (np.random.random_integers(N) - 1) / (N - 1.)\n\n Examples\n --------\n >>> np.random.random_integers(5)\n 4\n >>> type(np.random.random_integers(5))\n <type 'int'>\n >>> np.random.random_integers(5, size=(3.,2.))\n array([[5, 4],\n [3, 3],\n [4, 5]])\n\n Choose five random numbers from the set of five evenly-spaced\n numbers between 0 and 2.5, inclusive (*i.e.*, from the set\n :math:`{0, 5/8, 10/8, 15/8, 20/8}`):\n""\n >>> 2.5 * (np.random.random_integers(5, size=(5,)) - 1) / 4.\n array([ 0.625, 1.25 , 0.625, 0.625, 2.5 ])\n\n Roll two six sided dice 1000 times and sum the results:\n\n >>> d1 = np.random.random_integers(1, 6, 1000)\n >>> d2 = np.random.random_integers(1, 6, 1000)\n >>> dsums = d1 + d2\n\n Display results as a histogram:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(dsums, 11, normed=True)\n >>> plt.show()\n\n ";
-static char __pyx_k_219[] = "RandomState.standard_normal (line 1358)";
-static char __pyx_k_220[] = "\n standard_normal(size=None)\n\n Returns samples from a Standard Normal distribution (mean=0, stdev=1).\n\n Parameters\n ----------\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single value is\n returned.\n\n Returns\n -------\n out : float or ndarray\n Drawn samples.\n\n Examples\n --------\n >>> s = np.random.standard_normal(8000)\n >>> s\n array([ 0.6888893 , 0.78096262, -0.89086505, ..., 0.49876311, #random\n -0.38672696, -0.4685006 ]) #random\n >>> s.shape\n (8000,)\n >>> s = np.random.standard_normal(size=(3, 4, 2))\n >>> s.shape\n (3, 4, 2)\n\n ";
-static char __pyx_k_221[] = "RandomState.normal (line 1390)";
-static char __pyx_k_222[] = "\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 ";
-static char __pyx_k_223[] = "RandomState.standard_exponential (line 1603)";
-static char __pyx_k_224[] = "\n standard_exponential(size=None)\n\n Draw samples from the standard exponential distribution.\n\n `standard_exponential` is identical to the exponential distribution\n with a scale parameter of 1.\n\n Parameters\n ----------\n size : int or tuple of ints\n Shape of the output.\n\n Returns\n -------\n out : float or ndarray\n Drawn samples.\n\n Examples\n --------\n Output a 3x8000 array:\n\n >>> n = np.random.standard_exponential((3, 8000))\n\n ";
-static char __pyx_k_225[] = "RandomState.standard_gamma (line 1631)";
-static char __pyx_k_226[] = "\n standard_gamma(shape, size=None)\n\n Draw samples from a Standard Gamma distribution.\n\n Samples are drawn from a Gamma distribution with specified parameters,\n shape (sometimes designated \"k\") and scale=1.\n\n Parameters\n ----------\n shape : float\n Parameter, should be > 0.\n size : int or 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 Returns\n -------\n samples : ndarray or scalar\n The drawn samples.\n\n See Also\n --------\n scipy.stats.distributions.gamma : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Gamma distribution is\n\n .. math:: p(x) = x^{k-1}\\frac{e^{-x/\\theta}}{\\theta^k\\Gamma(k)},\n\n where :math:`k` is the shape and :math:`\\theta` the scale,\n and :math:`\\Gamma` is the Gamma function.\n\n The Gamma distribution is often used to model the times to failure of\n electronic components, and arises naturally in processes for which the\n waiting times between Poisson distributed events are relevant.\n\n References\n ----------\n .. [1] Weisstein, Eric W. \"Gamma Distribution.\" From MathWorld--A\n Wolfram Web Resource.\n http://mathworld.wolfram.com/GammaDistribution.html\n .. [2] Wikipedia, \"Gamma-distribution\",\n http://en.wikipedia.org/wiki/Gamma-distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> shape, scale = 2., 1. # mean and width\n >>> s = np.random.standard_gamma(shape, 1000000)\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 >>> y = bins**(shape-1) * ((np.exp(-bins/scale))/ \\\n ... (sps.gamma(shape) * scale**shape))\n >>> plt.plot(bins, y, linewidth=2, color='r')\n >>> plt.show()\n\n ";
-static char __pyx_k_227[] = "RandomState.gamma (line 1713)";
-static char __pyx_k_228[] = "\n gamma(shape, scale=1.0, size=None)\n\n Draw samples from a Gamma distribution.\n\n Samples are drawn from a Gamma distribution with specified parameters,\n `shape` (sometimes designated \"k\") and `scale` (sometimes designated\n \"theta\"), where both parameters are > 0.\n\n Parameters\n ----------\n shape : scalar > 0\n The shape of the gamma distribution.\n scale : scalar > 0, optional\n The scale of the gamma distribution. Default is equal to 1.\n size : shape_tuple, optional\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 out : ndarray, float\n Returns one sample unless `size` parameter is specified.\n\n See Also\n --------\n scipy.stats.distributions.gamma : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Gamma distribution is\n\n .. math:: p(x) = x^{k-1}\\frac{e^{-x/\\theta}}{\\theta^k\\Gamma(k)},\n\n where :math:`k` is the shape and :math:`\\theta` the scale,\n and :math:`\\Gamma` is the Gamma function.\n\n The Gamma distribution is often used to model the times to failure of\n electronic components, and arises naturally in processes for which the\n waiting times between Poisson distributed events are relevant.\n\n References\n ----------\n .. [1] Weisstein, Eric W. \"Gamma Distribution.\" From MathWorld--A\n Wolfram Web Resource.\n http://mathworld.wolfram.com/GammaDistribution.html\n .. [2] Wikipedia, \"Gamma-distribution\",\n http://en.wikipedia.org/wiki/Gamma-distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> shape, scale = 2.,"" 2. # mean and dispersion\n >>> s = np.random.gamma(shape, scale, 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 >>> y = bins**(shape-1)*(np.exp(-bins/scale) /\n ... (sps.gamma(shape)*scale**shape))\n >>> plt.plot(bins, y, linewidth=2, color='r')\n >>> plt.show()\n\n ";
-static char __pyx_k_229[] = "RandomState.f (line 1804)";
-static char __pyx_k_230[] = "\n f(dfnum, dfden, size=None)\n\n Draw samples from a F distribution.\n\n Samples are drawn from an F distribution with specified parameters,\n `dfnum` (degrees of freedom in numerator) and `dfden` (degrees of freedom\n in denominator), where both parameters should be greater than zero.\n\n The random variate of the F distribution (also known as the\n Fisher distribution) is a continuous probability distribution\n that arises in ANOVA tests, and is the ratio of two chi-square\n variates.\n\n Parameters\n ----------\n dfnum : float\n Degrees of freedom in numerator. Should be greater than zero.\n dfden : float\n Degrees of freedom in denominator. Should be greater than zero.\n size : {tuple, int}, optional\n Output shape. If the given shape is, e.g., ``(m, n, k)``,\n then ``m * n * k`` samples are drawn. By default only one sample\n is returned.\n\n Returns\n -------\n samples : {ndarray, scalar}\n Samples from the Fisher distribution.\n\n See Also\n --------\n scipy.stats.distributions.f : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The F statistic is used to compare in-group variances to between-group\n variances. Calculating the distribution depends on the sampling, and\n so it is a function of the respective degrees of freedom in the\n problem. The variable `dfnum` is the number of samples minus one, the\n between-groups degrees of freedom, while `dfden` is the within-groups\n degrees of freedom, the sum of the number of samples in each group\n minus the number of groups.\n\n References\n ----------\n .. [1] Glantz, Stanton A. \"Primer of Biostatistics.\", McGraw-Hill,\n Fifth Edition, 2002.""\n .. [2] Wikipedia, \"F-distribution\",\n http://en.wikipedia.org/wiki/F-distribution\n\n Examples\n --------\n An example from Glantz[1], pp 47-40.\n Two groups, children of diabetics (25 people) and children from people\n without diabetes (25 controls). Fasting blood glucose was measured,\n case group had a mean value of 86.1, controls had a mean value of\n 82.2. Standard deviations were 2.09 and 2.49 respectively. Are these\n data consistent with the null hypothesis that the parents diabetic\n status does not affect their children's blood glucose levels?\n Calculating the F statistic from the data gives a value of 36.01.\n\n Draw samples from the distribution:\n\n >>> dfnum = 1. # between group degrees of freedom\n >>> dfden = 48. # within groups degrees of freedom\n >>> s = np.random.f(dfnum, dfden, 1000)\n\n The lower bound for the top 1% of the samples is :\n\n >>> sort(s)[-10]\n 7.61988120985\n\n So there is about a 1% chance that the F statistic will exceed 7.62,\n the measured value is 36, so the null hypothesis is rejected at the 1%\n level.\n\n ";
-static char __pyx_k_231[] = "RandomState.noncentral_f (line 1906)";
-static char __pyx_k_232[] = "\n noncentral_f(dfnum, dfden, nonc, size=None)\n\n Draw samples from the noncentral F distribution.\n\n Samples are drawn from an F distribution with specified parameters,\n `dfnum` (degrees of freedom in numerator) and `dfden` (degrees of\n freedom in denominator), where both parameters > 1.\n `nonc` is the non-centrality parameter.\n\n Parameters\n ----------\n dfnum : int\n Parameter, should be > 1.\n dfden : int\n Parameter, should be > 1.\n nonc : float\n Parameter, should be >= 0.\n size : int or 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 Returns\n -------\n samples : scalar or ndarray\n Drawn samples.\n\n Notes\n -----\n When calculating the power of an experiment (power = probability of\n rejecting the null hypothesis when a specific alternative is true) the\n non-central F statistic becomes important. When the null hypothesis is\n true, the F statistic follows a central F distribution. When the null\n hypothesis is not true, then it follows a non-central F statistic.\n\n References\n ----------\n Weisstein, Eric W. \"Noncentral F-Distribution.\" From MathWorld--A Wolfram\n Web Resource. http://mathworld.wolfram.com/NoncentralF-Distribution.html\n\n Wikipedia, \"Noncentral F distribution\",\n http://en.wikipedia.org/wiki/Noncentral_F-distribution\n\n Examples\n --------\n In a study, testing for a specific alternative to the null hypothesis\n requires use of the Noncentral F distribution. We need to calculate the\n area in the tail of the distribution that exceeds the value of the F\n distribution for the null hypothesis. We'll plot the two probability\n distributions for comp""arison.\n\n >>> dfnum = 3 # between group deg of freedom\n >>> dfden = 20 # within groups degrees of freedom\n >>> nonc = 3.0\n >>> nc_vals = np.random.noncentral_f(dfnum, dfden, nonc, 1000000)\n >>> NF = np.histogram(nc_vals, bins=50, normed=True)\n >>> c_vals = np.random.f(dfnum, dfden, 1000000)\n >>> F = np.histogram(c_vals, bins=50, normed=True)\n >>> plt.plot(F[1][1:], F[0])\n >>> plt.plot(NF[1][1:], NF[0])\n >>> plt.show()\n\n ";
-static char __pyx_k_233[] = "RandomState.chisquare (line 2001)";
-static char __pyx_k_234[] = "\n chisquare(df, size=None)\n\n Draw samples from a chi-square distribution.\n\n When `df` independent random variables, each with standard normal\n distributions (mean 0, variance 1), are squared and summed, the\n resulting distribution is chi-square (see Notes). This distribution\n 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 `NIST/SEMATECH e-Handbook of Statistical Methods\n <http://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm>`_\n\n Examples\n --------\n >>> np.random.chisquare(2,4)\n array([ 1.89920014, 9.00867716, 3.13710533, 5.62318272])\n\n ";
-static char __pyx_k_235[] = "RandomState.noncentral_chisquare (line 2079)";
-static char __pyx_k_236[] = "\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, should be >= 1.\n nonc : float\n Non-centrality, should be > 0.\n size : int or tuple of ints\n Shape of the output.\n\n Notes\n -----\n The probability density function for the noncentral Chi-square distribution\n is\n\n .. math:: P(x;df,nonc) = \\sum^{\\infty}_{i=0}\n \\frac{e^{-nonc/2}(nonc/2)^{i}}{i!}P_{Y_{df+2i}}(x),\n\n where :math:`Y_{q}` is the Chi-square with q degrees of freedom.\n\n In Delhi (2007), it is noted that the noncentral chi-square is useful in\n bombing and coverage problems, the probability of killing the point target\n given by the noncentral chi-squared distribution.\n\n References\n ----------\n .. [1] Delhi, M.S. Holla, \"On a noncentral chi-square distribution in the\n analysis of weapon systems effectiveness\", Metrika, Volume 15,\n Number 1 / December, 1970.\n .. [2] Wikipedia, \"Noncentral chi-square distribution\"\n http://en.wikipedia.org/wiki/Noncentral_chi-square_distribution\n\n Examples\n --------\n Draw values from the distribution and plot the histogram\n\n >>> import matplotlib.pyplot as plt\n >>> values = plt.hist(np.random.noncentral_chisquare(3, 20, 100000),\n ... bins=200, normed=True)\n >>> plt.show()\n\n Draw values from a noncentral chisquare with very small noncentrality,\n and compare to a chisquare.\n\n >>> plt.figure()\n >>> values = plt.hist(np.random.noncentral_chisquare(3, .0000001, 100000),\n "" ... bins=np.arange(0., 25, .1), normed=True)\n >>> values2 = plt.hist(np.random.chisquare(3, 100000),\n ... bins=np.arange(0., 25, .1), normed=True)\n >>> plt.plot(values[1][0:-1], values[0]-values2[0], 'ob')\n >>> plt.show()\n\n Demonstrate how large values of non-centrality lead to a more symmetric\n distribution.\n\n >>> plt.figure()\n >>> values = plt.hist(np.random.noncentral_chisquare(3, 20, 100000),\n ... bins=200, normed=True)\n >>> plt.show()\n\n ";
-static char __pyx_k_237[] = "RandomState.standard_cauchy (line 2171)";
-static char __pyx_k_238[] = "\n standard_cauchy(size=None)\n\n Standard Cauchy distribution with mode = 0.\n\n Also known as the Lorentz distribution.\n\n Parameters\n ----------\n size : int or tuple of ints\n Shape of the output.\n\n Returns\n -------\n samples : ndarray or scalar\n The drawn samples.\n\n Notes\n -----\n The probability density function for the full Cauchy distribution is\n\n .. math:: P(x; x_0, \\gamma) = \\frac{1}{\\pi \\gamma \\bigl[ 1+\n (\\frac{x-x_0}{\\gamma})^2 \\bigr] }\n\n and the Standard Cauchy distribution just sets :math:`x_0=0` and\n :math:`\\gamma=1`\n\n The Cauchy distribution arises in the solution to the driven harmonic\n oscillator problem, and also describes spectral line broadening. It\n also describes the distribution of values at which a line tilted at\n a random angle will cut the x axis.\n\n When studying hypothesis tests that assume normality, seeing how the\n tests perform on data from a Cauchy distribution is a good indicator of\n their sensitivity to a heavy-tailed distribution, since the Cauchy looks\n very much like a Gaussian distribution, but with heavier tails.\n\n References\n ----------\n .. [1] NIST/SEMATECH e-Handbook of Statistical Methods, \"Cauchy\n Distribution\",\n http://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm\n .. [2] Weisstein, Eric W. \"Cauchy Distribution.\" From MathWorld--A\n Wolfram Web Resource.\n http://mathworld.wolfram.com/CauchyDistribution.html\n .. [3] Wikipedia, \"Cauchy distribution\"\n http://en.wikipedia.org/wiki/Cauchy_distribution\n\n Examples\n --------\n Draw samples and plot the distribution:\n\n >>> s = np.random.standard_cauchy(1000000)\n >>> s = s[(s>-25) & (s<""25)] # truncate distribution so it plots well\n >>> plt.hist(s, bins=100)\n >>> plt.show()\n\n ";
-static char __pyx_k_239[] = "RandomState.standard_t (line 2232)";
-static char __pyx_k_240[] = "\n standard_t(df, size=None)\n\n Standard Student's t distribution with df degrees of freedom.\n\n A special case of the hyperbolic distribution.\n As `df` gets large, the result resembles that of the standard normal\n distribution (`standard_normal`).\n\n Parameters\n ----------\n df : int\n Degrees of freedom, should be > 0.\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single value is\n returned.\n\n Returns\n -------\n samples : ndarray or scalar\n Drawn samples.\n\n Notes\n -----\n The probability density function for the t distribution is\n\n .. math:: P(x, df) = \\frac{\\Gamma(\\frac{df+1}{2})}{\\sqrt{\\pi df}\n \\Gamma(\\frac{df}{2})}\\Bigl( 1+\\frac{x^2}{df} \\Bigr)^{-(df+1)/2}\n\n The t test is based on an assumption that the data come from a Normal\n distribution. The t test provides a way to test whether the sample mean\n (that is the mean calculated from the data) is a good estimate of the true\n mean.\n\n The derivation of the t-distribution was forst published in 1908 by William\n Gisset while working for the Guinness Brewery in Dublin. Due to proprietary\n issues, he had to publish under a pseudonym, and so he used the name\n Student.\n\n References\n ----------\n .. [1] Dalgaard, Peter, \"Introductory Statistics With R\",\n Springer, 2002.\n .. [2] Wikipedia, \"Student's t-distribution\"\n http://en.wikipedia.org/wiki/Student's_t-distribution\n\n Examples\n --------\n From Dalgaard page 83 [1]_, suppose the daily energy intake for 11\n women in Kj is:\n\n >>> intake = np.array([5260., 5470, 5640, 6180, 6390, 6515, 6805, 7515, \\\n ... 7515, 8230, 8770])\n\n Doe""s their energy intake deviate systematically from the recommended\n value of 7725 kJ?\n\n We have 10 degrees of freedom, so is the sample mean within 95% of the\n recommended value?\n\n >>> s = np.random.standard_t(10, size=100000)\n >>> np.mean(intake)\n 6753.636363636364\n >>> intake.std(ddof=1)\n 1142.1232221373727\n\n Calculate the t statistic, setting the ddof parameter to the unbiased\n value so the divisor in the standard deviation will be degrees of\n freedom, N-1.\n\n >>> t = (np.mean(intake)-7725)/(intake.std(ddof=1)/np.sqrt(len(intake)))\n >>> import matplotlib.pyplot as plt\n >>> h = plt.hist(s, bins=100, normed=True)\n\n For a one-sided t-test, how far out in the distribution does the t\n statistic appear?\n\n >>> >>> np.sum(s<t) / float(len(s))\n 0.0090699999999999999 #random\n\n So the p-value is about 0.009, which says the null hypothesis has a\n probability of about 99% of being true.\n\n ";
-static char __pyx_k_241[] = "RandomState.vonmises (line 2333)";
-static char __pyx_k_242[] = "\n vonmises(mu, kappa, size=None)\n\n Draw samples from a von Mises distribution.\n\n Samples are drawn from a von Mises distribution with specified mode\n (mu) 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 unit\n circle. It may be thought of as the circular analogue of the normal\n distribution.\n\n Parameters\n ----------\n mu : float\n Mode (\"center\") of the distribution.\n kappa : float\n Dispersion of the distribution, has to be >=0.\n size : int or tuple of 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 : scalar or ndarray\n The returned samples, which are in the interval [-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 is named for Richard Edler von Mises, who was 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 Abramowitz, M. and Stegun, I. A. (ed.), *Handbook of Mathematical\n Functions*, New York: Dover, 1965.\n\n "" von Mises, R., *Mathematical Theory of Probability and Statistics*,\n New York: Academic Press, 1964.\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 = np.arange(-np.pi, np.pi, 2*np.pi/50.)\n >>> y = -np.exp(kappa*np.cos(x-mu))/(2*np.pi*sps.jn(0,kappa))\n >>> plt.plot(x, y/max(y), linewidth=2, color='r')\n >>> plt.show()\n\n ";
-static char __pyx_k_243[] = "RandomState.pareto (line 2427)";
-static char __pyx_k_244[] = "\n pareto(a, size=None)\n\n Draw samples from a Pareto II or Lomax distribution with specified shape.\n\n The Lomax or Pareto II distribution is a shifted Pareto distribution. The\n classical Pareto distribution can be obtained from the Lomax distribution\n by adding the location parameter m, see below. The smallest value of the\n Lomax distribution is zero while for the classical Pareto distribution it\n is m, where the standard Pareto distribution has location m=1.\n Lomax can also be considered as a simplified version of the Generalized\n Pareto distribution (available in SciPy), with the scale set to one and\n the location set to zero.\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.lomax.pdf : probability density function,\n distribution or cumulative density function, etc.\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 probl""ems.\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 ";
-static char __pyx_k_245[] = "RandomState.weibull (line 2523)";
-static char __pyx_k_246[] = "\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 `a`.\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 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_max\n scipy.stats.distributions.weibull_min\n scipy.stats.distributions.genextreme\n gumbel\n\n Notes\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 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 General""stabens 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 >>> x = np.arange(1,100.)/50.\n >>> def weib(x,n,a):\n ... return (a / n) * (x / n)**(a - 1) * np.exp(-(x / n)**a)\n\n >>> count, bins, ignored = plt.hist(np.random.weibull(5.,1000))\n >>> x = np.arange(1,100.)/50.\n >>> scale = count.max()/weib(x, 1., 5.).max()\n >>> plt.plot(x, weib(x, 1., 5.)*scale)\n >>> plt.show()\n\n ";
-static char __pyx_k_247[] = "RandomState.power (line 2623)";
-static char __pyx_k_248[] = "\n power(a, size=None)\n\n Draws samples in [0, 1] from a power distribution with positive\n exponent a - 1.\n\n Also known as the power function distribution.\n\n Parameters\n ----------\n a : float\n parameter, > 0\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 Returns\n -------\n samples : {ndarray, scalar}\n The returned samples lie in [0, 1].\n\n Raises\n ------\n ValueError\n If a<1.\n\n Notes\n -----\n The probability density function is\n\n .. math:: P(x; a) = ax^{a-1}, 0 \\le x \\le 1, a>0.\n\n The power function distribution is just the inverse of the Pareto\n distribution. It may also be seen as a special case of the Beta\n distribution.\n\n It is used, for example, in modeling the over-reporting of insurance\n claims.\n\n References\n ----------\n .. [1] Christian Kleiber, Samuel Kotz, \"Statistical size distributions\n in economics and actuarial sciences\", Wiley, 2003.\n .. [2] Heckert, N. A. and Filliben, James J. (2003). NIST Handbook 148:\n Dataplot Reference Manual, Volume 2: Let Subcommands and Library\n Functions\", National Institute of Standards and Technology Handbook\n Series, June 2003.\n http://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/powpdf.pdf\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> a = 5. # shape\n >>> samples = 1000\n >>> s = np.random.power(a, samples)\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, bins=""30)\n >>> x = np.linspace(0, 1, 100)\n >>> y = a*x**(a-1.)\n >>> normed_y = samples*np.diff(bins)[0]*y\n >>> plt.plot(x, normed_y)\n >>> plt.show()\n\n Compare the power function distribution to the inverse of the Pareto.\n\n >>> from scipy import stats\n >>> rvs = np.random.power(5, 1000000)\n >>> rvsp = np.random.pareto(5, 1000000)\n >>> xx = np.linspace(0,1,100)\n >>> powpdf = stats.powerlaw.pdf(xx,5)\n\n >>> plt.figure()\n >>> plt.hist(rvs, bins=50, normed=True)\n >>> plt.plot(xx,powpdf,'r-')\n >>> plt.title('np.random.power(5)')\n\n >>> plt.figure()\n >>> plt.hist(1./(1.+rvsp), bins=50, normed=True)\n >>> plt.plot(xx,powpdf,'r-')\n >>> plt.title('inverse of 1 + np.random.pareto(5)')\n\n >>> plt.figure()\n >>> plt.hist(1./(1.+rvsp), bins=50, normed=True)\n >>> plt.plot(xx,powpdf,'r-')\n >>> plt.title('inverse of stats.pareto(5)')\n\n ";
-static char __pyx_k_249[] = "RandomState.laplace (line 2732)";
-static char __pyx_k_250[] = "\n laplace(loc=0.0, scale=1.0, size=None)\n\n Draw samples from the Laplace or double exponential distribution with\n specified location (or mean) and scale (decay).\n\n The Laplace distribution is similar to the Gaussian/normal distribution,\n but is sharper at the peak and has fatter tails. It represents the\n difference between two independent, identically distributed exponential\n random variables.\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 Notes\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 first law of Laplace, from 1774, states that the frequency of an error\n can be expressed as an exponential function of the absolute magnitude of\n the error, which leads to the Laplace distribution. For many problems in\n Economics and Health sciences, this distribution seems to model the data\n better than the standard Gaussian distribution\n\n\n References\n ----------\n .. [1] Abramowitz, M. and Stegun, I. A. (Eds.). Handbook of Mathematical\n Functions with Formulas, Graphs, and Mathematical Tables, 9th\n printing. New York: Dover, 1972.\n\n .. [2] The Laplace distribution and generalizations\n By Samuel Kotz, Tomasz J. Kozubowski, Krzysztof Podgorski,\n Birkhauser, 2001.\n\n .. [3] Weisstein, Eric W. \"Laplace Distribution.\"\n From MathWorld--A Wolfram Web Resource.\n http://mathworld.wolfram.com/LaplaceDistribution.html\n\n .. [4] Wikipedia, \"Laplace distribution\",\n http://en.wikipedia.org/wik""i/Laplace_distribution\n\n Examples\n --------\n Draw samples from the distribution\n\n >>> loc, scale = 0., 1.\n >>> s = np.random.laplace(loc, scale, 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 >>> x = np.arange(-8., 8., .01)\n >>> pdf = np.exp(-abs(x-loc/scale))/(2.*scale)\n >>> plt.plot(x, pdf)\n\n Plot Gaussian for comparison:\n\n >>> g = (1/(scale * np.sqrt(2 * np.pi)) * \n ... np.exp( - (x - loc)**2 / (2 * scale**2) ))\n >>> plt.plot(x,g)\n\n ";
-static char __pyx_k_251[] = "RandomState.gumbel (line 2822)";
-static char __pyx_k_252[] = "\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 and scale.\n For more information on the Gumbel distribution, see Notes and References\n below.\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 Returns\n -------\n out : ndarray\n The samples\n\n See Also\n --------\n scipy.stats.gumbel_l\n scipy.stats.gumbel_r\n scipy.stats.genextreme\n probability density function, distribution, or cumulative density\n function, etc. for each of the above\n weibull\n\n Notes\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.\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` is\n 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\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 Gumbel, E. J., *Statistics of Extremes*, New York: Columbia University\n Press, 1958.\n\n Reiss, R.-D. and Thomas, M., *Statistical Analysis of Extreme Values from\n Insurance, Finance, Hydrology and Other Fields*, Basel: Birkhauser Verlag,\n 2001.\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 ";
-static char __pyx_k_253[] = "RandomState.logistic (line 2953)";
-static char __pyx_k_254[] = "\n logistic(loc=0.0, scale=1.0, size=None)\n\n Draw samples from a Logistic distribution.\n\n Samples are drawn from a Logistic distribution with specified\n parameters, loc (location or mean, also median), and scale (>0).\n\n Parameters\n ----------\n loc : float\n\n scale : float > 0.\n\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 where the values are all integers in [0, n].\n\n See Also\n --------\n scipy.stats.distributions.logistic : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Logistic distribution is\n\n .. math:: P(x) = P(x) = \\frac{e^{-(x-\\mu)/s}}{s(1+e^{-(x-\\mu)/s})^2},\n\n where :math:`\\mu` = location and :math:`s` = scale.\n\n The Logistic distribution is used in Extreme Value problems where it\n can act as a mixture of Gumbel distributions, in Epidemiology, and by\n the World Chess Federation (FIDE) where it is used in the Elo ranking\n system, assuming the performance of each player is a logistically\n distributed random variable.\n\n References\n ----------\n .. [1] Reiss, R.-D. and Thomas M. (2001), Statistical Analysis of Extreme\n Values, from Insurance, Finance, Hydrology and Other Fields,\n Birkhauser Verlag, Basel, pp 132-133.\n .. [2] Weisstein, Eric W. \"Logistic Distribution.\" From\n MathWorld--A Wolfram Web Resource.\n http://mathworld.wolfram.com/LogisticDistribution.html\n .. [3] Wikipedia, \"Logistic-distribution\",\n http://en.wikipedia.org/wiki/Logistic-distribution\n\n Examples\n "" --------\n Draw samples from the distribution:\n\n >>> loc, scale = 10, 1\n >>> s = np.random.logistic(loc, scale, 10000)\n >>> count, bins, ignored = plt.hist(s, bins=50)\n\n # plot against distribution\n\n >>> def logist(x, loc, scale):\n ... return exp((loc-x)/scale)/(scale*(1+exp((loc-x)/scale))**2)\n >>> plt.plot(bins, logist(bins, loc, scale)*count.max()/\\\n ... logist(bins, loc, scale).max())\n >>> plt.show()\n\n ";
-static char __pyx_k_255[] = "RandomState.lognormal (line 3041)";
-static char __pyx_k_256[] = "\n lognormal(mean=0.0, sigma=1.0, size=None)\n\n Return samples drawn from a log-normal distribution.\n\n Draw samples from a log-normal distribution with specified mean,\n standard deviation, and array shape. Note that the mean and standard\n deviation are not the values for the distribution itself, but of the\n underlying normal distribution it is derived from.\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 Returns\n -------\n samples : ndarray or float\n The desired samples. An array of the same shape as `size` if given,\n if `size` is None a float is returned.\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. The probability density function for the log-normal\n 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\n deviation of the normally distributed logarithm of the variable.\n A log-normal distribution results if a random variable is the *product*\n of a large number of independent, identically-distributed variables in\n the same way that a normal distribution results if the variable is the\n *sum* of a large number of independent, identically-distributed\n variables.\n\n Reference""s\n ----------\n Limpert, E., Stahel, W. A., and Abbt, M., \"Log-normal Distributions\n across the Sciences: Keys and Clues,\" *BioScience*, Vol. 51, No. 5,\n May, 2001. http://stat.ethz.ch/~stahel/lognormal/bioscience.pdf\n\n Reiss, R.D. and Thomas, M., *Statistical Analysis of Extreme Values*,\n Basel: Birkhauser Verlag, 2001, pp. 31-32.\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='mid')\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 probability density function.\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 >>> count, bins, ignored = plt.hist(b, 100, normed=True, align='center')\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, co""lor='r', linewidth=2)\n >>> plt.show()\n\n ";
-static char __pyx_k_257[] = "RandomState.rayleigh (line 3162)";
-static char __pyx_k_258[] = "\n rayleigh(scale=1.0, size=None)\n\n Draw samples from a Rayleigh distribution.\n\n The :math:`\\chi` and Weibull distributions are generalizations of the\n Rayleigh.\n\n Parameters\n ----------\n scale : scalar\n Scale, also equals the mode. Should be >= 0.\n size : int or tuple of ints, optional\n Shape of the output. Default is None, in which case a single\n value is returned.\n\n Notes\n -----\n The probability density function for the Rayleigh distribution is\n\n .. math:: P(x;scale) = \\frac{x}{scale^2}e^{\\frac{-x^2}{2 \\cdotp scale^2}}\n\n The Rayleigh distribution arises if the wind speed and wind direction are\n both gaussian variables, then the vector wind velocity forms a Rayleigh\n distribution. The Rayleigh distribution is used to model the expected\n output from wind turbines.\n\n References\n ----------\n .. [1] Brighton Webs Ltd., Rayleigh Distribution,\n http://www.brighton-webs.co.uk/distributions/rayleigh.asp\n .. [2] Wikipedia, \"Rayleigh distribution\"\n http://en.wikipedia.org/wiki/Rayleigh_distribution\n\n Examples\n --------\n Draw values from the distribution and plot the histogram\n\n >>> values = hist(np.random.rayleigh(3, 100000), bins=200, normed=True)\n\n Wave heights tend to follow a Rayleigh distribution. If the mean wave\n height is 1 meter, what fraction of waves are likely to be larger than 3\n meters?\n\n >>> meanvalue = 1\n >>> modevalue = np.sqrt(2 / np.pi) * meanvalue\n >>> s = np.random.rayleigh(modevalue, 1000000)\n\n The percentage of waves larger than 3 meters is:\n\n >>> 100.*sum(s>3)/1000000.\n 0.087300000000000003\n\n ";
-static char __pyx_k_259[] = "RandomState.wald (line 3234)";
-static char __pyx_k_260[] = "\n wald(mean, scale, size=None)\n\n Draw samples from a Wald, or Inverse Gaussian, distribution.\n\n As the scale approaches infinity, the distribution becomes more like a\n Gaussian.\n\n Some references claim that the Wald is an Inverse Gaussian with mean=1, but\n this is by no means universal.\n\n The Inverse Gaussian distribution was first studied in relationship to\n Brownian motion. In 1956 M.C.K. Tweedie used the name Inverse Gaussian\n because there is an inverse relationship between the time to cover a unit\n distance and distance covered in unit time.\n\n Parameters\n ----------\n mean : scalar\n Distribution mean, should be > 0.\n scale : scalar\n Scale parameter, should be >= 0.\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single value is\n returned.\n\n Returns\n -------\n samples : ndarray or scalar\n Drawn sample, all greater than zero.\n\n Notes\n -----\n The probability density function for the Wald distribution is\n\n .. math:: P(x;mean,scale) = \\sqrt{\\frac{scale}{2\\pi x^3}}e^\n \\frac{-scale(x-mean)^2}{2\\cdotp mean^2x}\n\n As noted above the Inverse Gaussian distribution first arise from attempts\n to model Brownian Motion. It is also a competitor to the Weibull for use in\n reliability modeling and modeling stock returns and interest rate\n processes.\n\n References\n ----------\n .. [1] Brighton Webs Ltd., Wald Distribution,\n http://www.brighton-webs.co.uk/distributions/wald.asp\n .. [2] Chhikara, Raj S., and Folks, J. Leroy, \"The Inverse Gaussian\n Distribution: Theory : Methodology, and Applications\", CRC Press,\n 1988.\n .. [3] Wikipedia, \"Wald distribu""tion\"\n http://en.wikipedia.org/wiki/Wald_distribution\n\n Examples\n --------\n Draw values from the distribution and plot the histogram:\n\n >>> import matplotlib.pyplot as plt\n >>> h = plt.hist(np.random.wald(3, 2, 100000), bins=200, normed=True)\n >>> plt.show()\n\n ";
-static char __pyx_k_261[] = "RandomState.triangular (line 3320)";
-static char __pyx_k_262[] = "\n triangular(left, mode, right, size=None)\n\n Draw samples from the triangular distribution.\n\n The triangular distribution is a continuous probability distribution with\n lower limit left, peak at mode, and upper limit right. Unlike the other\n distributions, these parameters directly define the shape of the pdf.\n\n Parameters\n ----------\n left : scalar\n Lower limit.\n mode : scalar\n The value where the peak of the distribution occurs.\n The value should fulfill the condition ``left <= mode <= right``.\n right : scalar\n Upper limit, should be larger than `left`.\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single value is\n returned.\n\n Returns\n -------\n samples : ndarray or scalar\n The returned samples all lie in the interval [left, right].\n\n Notes\n -----\n The probability density function for the Triangular distribution is\n\n .. math:: P(x;l, m, r) = \\begin{cases}\n \\frac{2(x-l)}{(r-l)(m-l)}& \\text{for $l \\leq x \\leq m$},\\\\\n \\frac{2(m-x)}{(r-l)(r-m)}& \\text{for $m \\leq x \\leq r$},\\\\\n 0& \\text{otherwise}.\n \\end{cases}\n\n The triangular distribution is often used in ill-defined problems where the\n underlying distribution is not known, but some knowledge of the limits and\n mode exists. Often it is used in simulations.\n\n References\n ----------\n .. [1] Wikipedia, \"Triangular distribution\"\n http://en.wikipedia.org/wiki/Triangular_distribution\n\n Examples\n --------\n Draw values from the distribution and plot the histogram:\n\n >>> import matplotlib.pyplot as plt\n >>> h = plt.hist(np.random.triangular(-3, 0, 8, 100000), bins=""200,\n ... normed=True)\n >>> plt.show()\n\n ";
-static char __pyx_k_263[] = "RandomState.binomial (line 3408)";
-static char __pyx_k_264[] = "\n binomial(n, p, size=None)\n\n Draw samples from a binomial distribution.\n\n Samples are drawn from a Binomial distribution with specified\n parameters, n trials and p probability of success where\n n an integer >= 0 and p is in the interval [0,1]. (n may be\n input as a float, but it is truncated to an integer in use)\n\n Parameters\n ----------\n n : float (but truncated to an integer)\n parameter, >= 0.\n p : float\n parameter, >= 0 and <=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 where the values are all integers in [0, n].\n\n See Also\n --------\n scipy.stats.distributions.binom : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Binomial distribution is\n\n .. math:: P(N) = \\binom{n}{N}p^N(1-p)^{n-N},\n\n where :math:`n` is the number of trials, :math:`p` is the probability\n of success, and :math:`N` is the number of successes.\n\n When estimating the standard error of a proportion in a population by\n using a random sample, the normal distribution works well unless the\n product p*n <=5, where p = population proportion estimate, and n =\n number of samples, in which case the binomial distribution is used\n instead. For example, a sample of 15 people shows 4 who are left\n handed, and 11 who are right handed. Then p = 4/15 = 27%. 0.27*15 = 4,\n so the binomial distribution should be used in this case.\n\n References\n ----------\n .. [1] Dalgaard, Peter, \"Introductory Statistics with R\",\n Springer-Verlag, 2002.""\n .. [2] Glantz, Stanton A. \"Primer of Biostatistics.\", McGraw-Hill,\n Fifth Edition, 2002.\n .. [3] Lentner, Marvin, \"Elementary Applied Statistics\", Bogden\n and Quigley, 1972.\n .. [4] Weisstein, Eric W. \"Binomial Distribution.\" From MathWorld--A\n Wolfram Web Resource.\n http://mathworld.wolfram.com/BinomialDistribution.html\n .. [5] Wikipedia, \"Binomial-distribution\",\n http://en.wikipedia.org/wiki/Binomial_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> n, p = 10, .5 # number of trials, probability of each trial\n >>> s = np.random.binomial(n, p, 1000)\n # result of flipping a coin 10 times, tested 1000 times.\n\n A real world example. A company drills 9 wild-cat oil exploration\n wells, each with an estimated probability of success of 0.1. All nine\n wells fail. What is the probability of that happening?\n\n Let's do 20,000 trials of the model, and count the number that\n generate zero positive results.\n\n >>> sum(np.random.binomial(9,0.1,20000)==0)/20000.\n answer = 0.38885, or 38%.\n\n ";
-static char __pyx_k_265[] = "RandomState.negative_binomial (line 3516)";
-static char __pyx_k_266[] = "\n negative_binomial(n, p, size=None)\n\n Draw samples from a negative_binomial distribution.\n\n Samples are drawn from a negative_Binomial distribution with specified\n parameters, `n` trials and `p` probability of success where `n` is an\n integer > 0 and `p` is in the interval [0, 1].\n\n Parameters\n ----------\n n : int\n Parameter, > 0.\n p : float\n Parameter, >= 0 and <=1.\n size : int or 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 Returns\n -------\n samples : int or ndarray of ints\n Drawn samples.\n\n Notes\n -----\n The probability density for the Negative Binomial distribution is\n\n .. math:: P(N;n,p) = \\binom{N+n-1}{n-1}p^{n}(1-p)^{N},\n\n where :math:`n-1` is the number of successes, :math:`p` is the probability\n of success, and :math:`N+n-1` is the number of trials.\n\n The negative binomial distribution gives the probability of n-1 successes\n and N failures in N+n-1 trials, and success on the (N+n)th trial.\n\n If one throws a die repeatedly until the third time a \"1\" appears, then the\n probability distribution of the number of non-\"1\"s that appear before the\n third \"1\" is a negative binomial distribution.\n\n References\n ----------\n .. [1] Weisstein, Eric W. \"Negative Binomial Distribution.\" From\n MathWorld--A Wolfram Web Resource.\n http://mathworld.wolfram.com/NegativeBinomialDistribution.html\n .. [2] Wikipedia, \"Negative binomial distribution\",\n http://en.wikipedia.org/wiki/Negative_binomial_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n A real world example. A company drills wild-cat oil exploration well""s, each\n with an estimated probability of success of 0.1. What is the probability\n of having one success for each successive well, that is what is the\n probability of a single success after drilling 5 wells, after 6 wells,\n etc.?\n\n >>> s = np.random.negative_binomial(1, 0.1, 100000)\n >>> for i in range(1, 11):\n ... probability = sum(s<i) / 100000.\n ... print i, \"wells drilled, probability of one success =\", probability\n\n ";
-static char __pyx_k_267[] = "RandomState.poisson (line 3611)";
-static char __pyx_k_268[] = "\n poisson(lam=1.0, size=None)\n\n Draw samples from a Poisson distribution.\n\n The Poisson distribution is the limit of the Binomial\n distribution for large N.\n\n Parameters\n ----------\n lam : float\n Expectation of interval, should be >= 0.\n size : int or tuple of ints, optional\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n Notes\n -----\n The Poisson distribution\n\n .. math:: f(k; \\lambda)=\\frac{\\lambda^k e^{-\\lambda}}{k!}\n\n For events with an expected separation :math:`\\lambda` the Poisson\n distribution :math:`f(k; \\lambda)` describes the probability of\n :math:`k` events occurring within the observed interval :math:`\\lambda`.\n\n Because the output is limited to the range of the C long type, a\n ValueError is raised when `lam` is within 10 sigma of the maximum\n representable value.\n\n References\n ----------\n .. [1] Weisstein, Eric W. \"Poisson Distribution.\" From MathWorld--A Wolfram\n Web Resource. http://mathworld.wolfram.com/PoissonDistribution.html\n .. [2] Wikipedia, \"Poisson distribution\",\n http://en.wikipedia.org/wiki/Poisson_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> import numpy as np\n >>> s = np.random.poisson(5, 10000)\n\n Display histogram of the sample:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 14, normed=True)\n >>> plt.show()\n\n ";
-static char __pyx_k_269[] = "RandomState.zipf (line 3682)";
-static char __pyx_k_270[] = "\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\n `a` > 1.\n\n The Zipf distribution (also known as the zeta distribution) is a\n continuous probability distribution that satisfies Zipf's law: the\n frequency of an item is inversely proportional to its rank in a\n frequency table.\n\n Parameters\n ----------\n a : float > 1\n Distribution parameter.\n size : int or tuple of int, optional\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn; a single integer is equivalent in\n its result to providing a mono-tuple, i.e., a 1-D array of length\n *size* is returned. The default is None, in which case a single\n scalar is returned.\n\n Returns\n -------\n samples : scalar or ndarray\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 It is named for the American linguist George Kingsley Zipf, who noted\n that the frequency of any word in a sample of a language is inversely\n proportional to its rank in the frequency table.\n\n References\n ----------\n Zipf, G. K., *Selected Studies of the Principle of Relative Frequency\n in Language*, Cambridge, MA: Harvard Univ. Press, 1932.\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 = np.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 ";
-static char __pyx_k_271[] = "RandomState.geometric (line 3770)";
-static char __pyx_k_272[] = "\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 ";
-static char __pyx_k_273[] = "RandomState.hypergeometric (line 3836)";
-static char __pyx_k_274[] = "\n hypergeometric(ngood, nbad, nsample, size=None)\n\n Draw samples from a Hypergeometric distribution.\n\n Samples are drawn from a Hypergeometric distribution with specified\n parameters, ngood (ways to make a good selection), nbad (ways to make\n a bad selection), and nsample = number of items sampled, which is less\n than or equal to the sum ngood + nbad.\n\n Parameters\n ----------\n ngood : int or array_like\n Number of ways to make a good selection. Must be nonnegative.\n nbad : int or array_like\n Number of ways to make a bad selection. Must be nonnegative.\n nsample : int or array_like\n Number of items sampled. Must be at least 1 and at most\n ``ngood + nbad``.\n size : int or tuple of 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 or scalar\n The values are all integers in [0, n].\n\n See Also\n --------\n scipy.stats.distributions.hypergeom : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Hypergeometric distribution is\n\n .. math:: P(x) = \\frac{\\binom{m}{n}\\binom{N-m}{n-x}}{\\binom{N}{n}},\n\n where :math:`0 \\le x \\le m` and :math:`n+m-N \\le x \\le n`\n\n for P(x) the probability of x successes, n = ngood, m = nbad, and\n N = number of samples.\n\n Consider an urn with black and white marbles in it, ngood of them\n black and nbad are white. If you draw nsample balls without\n replacement, then the Hypergeometric distribution describes the\n distribution of black balls in the drawn sample.\n\n Note that this distribution is very similar to the Binomial\n distrib""ution, except that in this case, samples are drawn without\n replacement, whereas in the Binomial case samples are drawn with\n replacement (or the sample space is infinite). As the sample space\n becomes large, this distribution approaches the Binomial.\n\n References\n ----------\n .. [1] Lentner, Marvin, \"Elementary Applied Statistics\", Bogden\n and Quigley, 1972.\n .. [2] Weisstein, Eric W. \"Hypergeometric Distribution.\" From\n MathWorld--A Wolfram Web Resource.\n http://mathworld.wolfram.com/HypergeometricDistribution.html\n .. [3] Wikipedia, \"Hypergeometric-distribution\",\n http://en.wikipedia.org/wiki/Hypergeometric-distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> ngood, nbad, nsamp = 100, 2, 10\n # number of good, number of bad, and number of samples\n >>> s = np.random.hypergeometric(ngood, nbad, nsamp, 1000)\n >>> hist(s)\n # note that it is very unlikely to grab both bad items\n\n Suppose you have an urn with 15 white and 15 black marbles.\n If you pull 15 marbles at random, how likely is it that\n 12 or more of them are one color?\n\n >>> s = np.random.hypergeometric(15, 15, 15, 100000)\n >>> sum(s>=12)/100000. + sum(s<=3)/100000.\n # answer = 0.003 ... pretty unlikely!\n\n ";
-static char __pyx_k_275[] = "RandomState.logseries (line 3955)";
-static char __pyx_k_276[] = "\n logseries(p, size=None)\n\n Draw samples from a Logarithmic Series distribution.\n\n Samples are drawn from a Log Series distribution with specified\n parameter, p (probability, 0 < p < 1).\n\n Parameters\n ----------\n loc : float\n\n scale : float > 0.\n\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 where the values are all integers in [0, n].\n\n See Also\n --------\n scipy.stats.distributions.logser : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Log Series distribution is\n\n .. math:: P(k) = \\frac{-p^k}{k \\ln(1-p)},\n\n where p = probability.\n\n The Log Series distribution is frequently used to represent species\n richness and occurrence, first proposed by Fisher, Corbet, and\n Williams in 1943 [2]. It may also be used to model the numbers of\n occupants seen in cars [3].\n\n References\n ----------\n .. [1] Buzas, Martin A.; Culver, Stephen J., Understanding regional\n species diversity through the log series distribution of\n occurrences: BIODIVERSITY RESEARCH Diversity & Distributions,\n Volume 5, Number 5, September 1999 , pp. 187-195(9).\n .. [2] Fisher, R.A,, A.S. Corbet, and C.B. Williams. 1943. The\n relation between the number of species and the number of\n individuals in a random sample of an animal population.\n Journal of Animal Ecology, 12:42-58.\n .. [3] D. J. Hand, F. Daly, D. Lunn, E. Ostrowski, A Handbook of Small\n Data Sets, CRC Press, 1994.\n .. [4] Wikipedia, \"Log""arithmic-distribution\",\n http://en.wikipedia.org/wiki/Logarithmic-distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> a = .6\n >>> s = np.random.logseries(a, 10000)\n >>> count, bins, ignored = plt.hist(s)\n\n # plot against distribution\n\n >>> def logseries(k, p):\n ... return -p**k/(k*log(1-p))\n >>> plt.plot(bins, logseries(bins, a)*count.max()/\n logseries(bins, a).max(), 'r')\n >>> plt.show()\n\n ";
-static char __pyx_k_277[] = "RandomState.multivariate_normal (line 4050)";
-static char __pyx_k_278[] = "\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 generalization of the one-dimensional normal distribution to higher\n dimensions. Such a distribution is specified by its mean and\n covariance matrix. These parameters are analogous to the mean\n (average or \"center\") and variance (standard deviation, or \"width,\"\n squared) of the one-dimensional normal distribution.\n\n Parameters\n ----------\n mean : 1-D array_like, of length N\n Mean of the N-dimensional distribution.\n cov : 2-D array_like, of shape (N, N)\n Covariance matrix of the distribution. Must be symmetric and\n positive semi-definite for \"physically meaningful\" results.\n size : int or 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\n each sample is `N`-dimensional, the output shape is ``(m,n,k,N)``.\n If no shape is specified, a single (`N`-D) sample is returned.\n\n Returns\n -------\n out : ndarray\n The drawn samples, of shape *size*, if that was provided. If not,\n the shape is ``(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, w""e 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 Papoulis, A., *Probability, Random Variables, and Stochastic Processes*,\n 3rd ed., New York: McGraw-Hill, 1991.\n\n Duda, R. O., Hart, P. E., and Stork, D. G., *Pattern Classification*,\n 2nd ed., New York: 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 ";
-static char __pyx_k_279[] = "RandomState.multinomial (line 4182)";
-static char __pyx_k_280[] = "\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 ";
-static char __pyx_k_281[] = "RandomState.dirichlet (line 4275)";
-static char __pyx_k_282[] = "\n dirichlet(alpha, size=None)\n\n Draw samples from the Dirichlet distribution.\n\n Draw `size` samples of dimension k from a Dirichlet distribution. A\n Dirichlet-distributed random variable can be seen as a multivariate\n generalization of a Beta distribution. Dirichlet pdf is the conjugate\n prior of a multinomial in Bayesian inference.\n\n Parameters\n ----------\n alpha : array\n Parameter of the distribution (k dimension for sample of\n dimension k).\n size : array\n Number of samples to draw.\n\n Returns\n -------\n samples : ndarray,\n The drawn samples, of shape (alpha.ndim, size).\n\n Notes\n -----\n .. math:: X \\approx \\prod_{i=1}^{k}{x^{\\alpha_i-1}_i}\n\n Uses the following property for computation: for each dimension,\n draw a random sample y_i from a standard gamma generator of shape\n `alpha_i`, then\n :math:`X = \\frac{1}{\\sum_{i=1}^k{y_i}} (y_1, \\ldots, y_n)` is\n Dirichlet distributed.\n\n References\n ----------\n .. [1] David McKay, \"Information Theory, Inference and Learning\n Algorithms,\" chapter 23,\n http://www.inference.phy.cam.ac.uk/mackay/\n .. [2] Wikipedia, \"Dirichlet distribution\",\n http://en.wikipedia.org/wiki/Dirichlet_distribution\n\n Examples\n --------\n Taking an example cited in Wikipedia, this distribution can be used if\n one wanted to cut strings (each of initial length 1.0) into K pieces\n with different lengths, where each piece had, on average, a designated\n average length, but allowing some variation in the relative sizes of the\n pieces.\n\n >>> s = np.random.dirichlet((10, 5, 3), 20).transpose()\n\n >>> plt.barh(range(20), s[0])\n >>> plt.barh(range(20), s[1], left=s[0], color='g')""\n >>> plt.barh(range(20), s[2], left=s[0]+s[1], color='r')\n >>> plt.title(\"Lengths of Strings\")\n\n ";
-static char __pyx_k_283[] = "RandomState.shuffle (line 4391)";
-static char __pyx_k_284[] = "\n shuffle(x)\n\n Modify a sequence in-place by shuffling its contents.\n\n Parameters\n ----------\n x : array_like\n The array or list to be shuffled.\n\n Returns\n -------\n None\n\n Examples\n --------\n >>> arr = np.arange(10)\n >>> np.random.shuffle(arr)\n >>> arr\n [1 7 5 2 9 4 3 6 0 8]\n\n This function only shuffles the array along the first index of a\n multi-dimensional array:\n\n >>> arr = np.arange(9).reshape((3, 3))\n >>> np.random.shuffle(arr)\n >>> arr\n array([[3, 4, 5],\n [6, 7, 8],\n [0, 1, 2]])\n\n ";
-static char __pyx_k_285[] = "RandomState.permutation (line 4449)";
-static char __pyx_k_286[] = "\n permutation(x)\n\n Randomly permute a sequence, or return a permuted range.\n\n If `x` is a multi-dimensional array, it is only shuffled along its\n first index.\n\n Parameters\n ----------\n x : int or array_like\n If `x` is an integer, randomly permute ``np.arange(x)``.\n If `x` is an array, make a copy and shuffle the elements\n randomly.\n\n Returns\n -------\n out : ndarray\n Permuted sequence or array range.\n\n Examples\n --------\n >>> np.random.permutation(10)\n array([1, 7, 4, 3, 0, 9, 2, 5, 8, 6])\n\n >>> np.random.permutation([1, 4, 9, 12, 15])\n array([15, 1, 9, 4, 12])\n\n >>> arr = np.arange(9).reshape((3, 3))\n >>> np.random.permutation(arr)\n array([[6, 7, 8],\n [0, 1, 2],\n [3, 4, 5]])\n\n ";
-static char __pyx_k__df[] = "df";
-static char __pyx_k__mu[] = "mu";
-static char __pyx_k__np[] = "np";
-static char __pyx_k__add[] = "add";
-static char __pyx_k__any[] = "any";
-static char __pyx_k__cov[] = "cov";
-static char __pyx_k__dot[] = "dot";
-static char __pyx_k__int[] = "int";
-static char __pyx_k__lam[] = "lam";
-static char __pyx_k__loc[] = "loc";
-static char __pyx_k__low[] = "low";
-static char __pyx_k__max[] = "max";
-static char __pyx_k__sum[] = "sum";
-static char __pyx_k__svd[] = "svd";
-static char __pyx_k__beta[] = "beta";
-static char __pyx_k__copy[] = "copy";
-static char __pyx_k__high[] = "high";
-static char __pyx_k__intp[] = "intp";
-static char __pyx_k__item[] = "item";
-static char __pyx_k__left[] = "left";
-static char __pyx_k__less[] = "less";
-static char __pyx_k__mean[] = "mean";
-static char __pyx_k__mode[] = "mode";
-static char __pyx_k__nbad[] = "nbad";
-static char __pyx_k__ndim[] = "ndim";
-static char __pyx_k__nonc[] = "nonc";
-static char __pyx_k__prod[] = "prod";
-static char __pyx_k__rand[] = "rand";
-static char __pyx_k__seed[] = "seed";
-static char __pyx_k__side[] = "side";
-static char __pyx_k__size[] = "size";
-static char __pyx_k__sort[] = "sort";
-static char __pyx_k__sqrt[] = "sqrt";
-static char __pyx_k__take[] = "take";
-static char __pyx_k__uint[] = "uint";
-static char __pyx_k__wald[] = "wald";
-static char __pyx_k__zipf[] = "zipf";
-static char __pyx_k___rand[] = "_rand";
-static char __pyx_k__alpha[] = "alpha";
-static char __pyx_k__array[] = "array";
-static char __pyx_k__bytes[] = "bytes";
-static char __pyx_k__dfden[] = "dfden";
-static char __pyx_k__dfnum[] = "dfnum";
-static char __pyx_k__dtype[] = "dtype";
-static char __pyx_k__empty[] = "empty";
-static char __pyx_k__equal[] = "equal";
-static char __pyx_k__gamma[] = "gamma";
-static char __pyx_k__iinfo[] = "iinfo";
-static char __pyx_k__index[] = "index";
-static char __pyx_k__kappa[] = "kappa";
-static char __pyx_k__ndmin[] = "ndmin";
-static char __pyx_k__ngood[] = "ngood";
-static char __pyx_k__numpy[] = "numpy";
-static char __pyx_k__power[] = "power";
-static char __pyx_k__pvals[] = "pvals";
-static char __pyx_k__randn[] = "randn";
-static char __pyx_k__ravel[] = "ravel";
-static char __pyx_k__right[] = "right";
-static char __pyx_k__scale[] = "scale";
-static char __pyx_k__shape[] = "shape";
-static char __pyx_k__sigma[] = "sigma";
-static char __pyx_k__zeros[] = "zeros";
-static char __pyx_k__arange[] = "arange";
-static char __pyx_k__choice[] = "choice";
-static char __pyx_k__cumsum[] = "cumsum";
-static char __pyx_k__double[] = "double";
-static char __pyx_k__gumbel[] = "gumbel";
-static char __pyx_k__normal[] = "normal";
-static char __pyx_k__pareto[] = "pareto";
-static char __pyx_k__random[] = "random";
-static char __pyx_k__reduce[] = "reduce";
-static char __pyx_k__uint32[] = "uint32";
-static char __pyx_k__unique[] = "unique";
-static char __pyx_k__MT19937[] = "MT19937";
-static char __pyx_k__asarray[] = "asarray";
-static char __pyx_k__float64[] = "float64";
-static char __pyx_k__greater[] = "greater";
-static char __pyx_k__integer[] = "integer";
-static char __pyx_k__laplace[] = "laplace";
-static char __pyx_k__ndarray[] = "ndarray";
-static char __pyx_k__nsample[] = "nsample";
-static char __pyx_k__poisson[] = "poisson";
-static char __pyx_k__randint[] = "randint";
-static char __pyx_k__replace[] = "replace";
-static char __pyx_k__shuffle[] = "shuffle";
-static char __pyx_k__uniform[] = "uniform";
-static char __pyx_k__weibull[] = "weibull";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k__allclose[] = "allclose";
-static char __pyx_k__binomial[] = "binomial";
-static char __pyx_k__logistic[] = "logistic";
-static char __pyx_k__multiply[] = "multiply";
-static char __pyx_k__operator[] = "operator";
-static char __pyx_k__rayleigh[] = "rayleigh";
-static char __pyx_k__subtract[] = "subtract";
-static char __pyx_k__vonmises[] = "vonmises";
-static char __pyx_k__TypeError[] = "TypeError";
-static char __pyx_k__chisquare[] = "chisquare";
-static char __pyx_k__dirichlet[] = "dirichlet";
-static char __pyx_k__geometric[] = "geometric";
-static char __pyx_k__get_state[] = "get_state";
-static char __pyx_k__lognormal[] = "lognormal";
-static char __pyx_k__logseries[] = "logseries";
-static char __pyx_k__set_state[] = "set_state";
-static char __pyx_k__ValueError[] = "ValueError";
-static char __pyx_k____import__[] = "__import__";
-static char __pyx_k__less_equal[] = "less_equal";
-static char __pyx_k__standard_t[] = "standard_t";
-static char __pyx_k__triangular[] = "triangular";
-static char __pyx_k__exponential[] = "exponential";
-static char __pyx_k__multinomial[] = "multinomial";
-static char __pyx_k__permutation[] = "permutation";
-static char __pyx_k__noncentral_f[] = "noncentral_f";
-static char __pyx_k__return_index[] = "return_index";
-static char __pyx_k__searchsorted[] = "searchsorted";
-static char __pyx_k__greater_equal[] = "greater_equal";
-static char __pyx_k__random_sample[] = "random_sample";
-static char __pyx_k__hypergeometric[] = "hypergeometric";
-static char __pyx_k__standard_gamma[] = "standard_gamma";
-static char __pyx_k__poisson_lam_max[] = "poisson_lam_max";
-static char __pyx_k__random_integers[] = "random_integers";
-static char __pyx_k__standard_cauchy[] = "standard_cauchy";
-static char __pyx_k__standard_normal[] = "standard_normal";
-static char __pyx_k__negative_binomial[] = "negative_binomial";
-static char __pyx_k____RandomState_ctor[] = "__RandomState_ctor";
-static char __pyx_k__multivariate_normal[] = "multivariate_normal";
-static PyObject *__pyx_kp_s_1;
-static PyObject *__pyx_kp_s_112;
-static PyObject *__pyx_kp_s_114;
-static PyObject *__pyx_kp_s_118;
-static PyObject *__pyx_kp_s_120;
-static PyObject *__pyx_kp_s_123;
-static PyObject *__pyx_kp_s_126;
-static PyObject *__pyx_kp_s_128;
-static PyObject *__pyx_kp_s_13;
-static PyObject *__pyx_kp_s_130;
-static PyObject *__pyx_kp_s_135;
-static PyObject *__pyx_kp_s_137;
-static PyObject *__pyx_kp_s_139;
-static PyObject *__pyx_kp_s_144;
-static PyObject *__pyx_kp_s_15;
-static PyObject *__pyx_kp_s_152;
-static PyObject *__pyx_kp_s_154;
-static PyObject *__pyx_kp_s_157;
-static PyObject *__pyx_kp_s_159;
-static PyObject *__pyx_kp_s_162;
-static PyObject *__pyx_kp_s_164;
-static PyObject *__pyx_kp_s_168;
-static PyObject *__pyx_kp_s_170;
-static PyObject *__pyx_kp_s_172;
-static PyObject *__pyx_kp_s_174;
-static PyObject *__pyx_kp_s_18;
-static PyObject *__pyx_kp_s_180;
-static PyObject *__pyx_kp_s_182;
-static PyObject *__pyx_kp_s_186;
-static PyObject *__pyx_kp_s_188;
-static PyObject *__pyx_kp_s_190;
-static PyObject *__pyx_n_s_193;
-static PyObject *__pyx_kp_s_194;
-static PyObject *__pyx_n_s_199;
-static PyObject *__pyx_kp_s_20;
-static PyObject *__pyx_n_s_200;
-static PyObject *__pyx_kp_u_201;
-static PyObject *__pyx_kp_u_202;
-static PyObject *__pyx_kp_u_203;
-static PyObject *__pyx_kp_u_204;
-static PyObject *__pyx_kp_u_205;
-static PyObject *__pyx_kp_u_206;
-static PyObject *__pyx_kp_u_207;
-static PyObject *__pyx_kp_u_208;
-static PyObject *__pyx_kp_u_209;
-static PyObject *__pyx_kp_u_210;
-static PyObject *__pyx_kp_u_211;
-static PyObject *__pyx_kp_u_212;
-static PyObject *__pyx_kp_u_213;
-static PyObject *__pyx_kp_u_214;
-static PyObject *__pyx_kp_u_215;
-static PyObject *__pyx_kp_u_216;
-static PyObject *__pyx_kp_u_217;
-static PyObject *__pyx_kp_u_218;
-static PyObject *__pyx_kp_u_219;
-static PyObject *__pyx_kp_s_22;
-static PyObject *__pyx_kp_u_220;
-static PyObject *__pyx_kp_u_221;
-static PyObject *__pyx_kp_u_222;
-static PyObject *__pyx_kp_u_223;
-static PyObject *__pyx_kp_u_224;
-static PyObject *__pyx_kp_u_225;
-static PyObject *__pyx_kp_u_226;
-static PyObject *__pyx_kp_u_227;
-static PyObject *__pyx_kp_u_228;
-static PyObject *__pyx_kp_u_229;
-static PyObject *__pyx_kp_u_230;
-static PyObject *__pyx_kp_u_231;
-static PyObject *__pyx_kp_u_232;
-static PyObject *__pyx_kp_u_233;
-static PyObject *__pyx_kp_u_234;
-static PyObject *__pyx_kp_u_235;
-static PyObject *__pyx_kp_u_236;
-static PyObject *__pyx_kp_u_237;
-static PyObject *__pyx_kp_u_238;
-static PyObject *__pyx_kp_u_239;
-static PyObject *__pyx_kp_s_24;
-static PyObject *__pyx_kp_u_240;
-static PyObject *__pyx_kp_u_241;
-static PyObject *__pyx_kp_u_242;
-static PyObject *__pyx_kp_u_243;
-static PyObject *__pyx_kp_u_244;
-static PyObject *__pyx_kp_u_245;
-static PyObject *__pyx_kp_u_246;
-static PyObject *__pyx_kp_u_247;
-static PyObject *__pyx_kp_u_248;
-static PyObject *__pyx_kp_u_249;
-static PyObject *__pyx_kp_u_250;
-static PyObject *__pyx_kp_u_251;
-static PyObject *__pyx_kp_u_252;
-static PyObject *__pyx_kp_u_253;
-static PyObject *__pyx_kp_u_254;
-static PyObject *__pyx_kp_u_255;
-static PyObject *__pyx_kp_u_256;
-static PyObject *__pyx_kp_u_257;
-static PyObject *__pyx_kp_u_258;
-static PyObject *__pyx_kp_u_259;
-static PyObject *__pyx_kp_s_26;
-static PyObject *__pyx_kp_u_260;
-static PyObject *__pyx_kp_u_261;
-static PyObject *__pyx_kp_u_262;
-static PyObject *__pyx_kp_u_263;
-static PyObject *__pyx_kp_u_264;
-static PyObject *__pyx_kp_u_265;
-static PyObject *__pyx_kp_u_266;
-static PyObject *__pyx_kp_u_267;
-static PyObject *__pyx_kp_u_268;
-static PyObject *__pyx_kp_u_269;
-static PyObject *__pyx_kp_u_270;
-static PyObject *__pyx_kp_u_271;
-static PyObject *__pyx_kp_u_272;
-static PyObject *__pyx_kp_u_273;
-static PyObject *__pyx_kp_u_274;
-static PyObject *__pyx_kp_u_275;
-static PyObject *__pyx_kp_u_276;
-static PyObject *__pyx_kp_u_277;
-static PyObject *__pyx_kp_u_278;
-static PyObject *__pyx_kp_u_279;
-static PyObject *__pyx_kp_s_28;
-static PyObject *__pyx_kp_u_280;
-static PyObject *__pyx_kp_u_281;
-static PyObject *__pyx_kp_u_282;
-static PyObject *__pyx_kp_u_283;
-static PyObject *__pyx_kp_u_284;
-static PyObject *__pyx_kp_u_285;
-static PyObject *__pyx_kp_u_286;
-static PyObject *__pyx_kp_s_30;
-static PyObject *__pyx_kp_s_32;
-static PyObject *__pyx_kp_s_34;
-static PyObject *__pyx_kp_s_36;
-static PyObject *__pyx_kp_s_44;
-static PyObject *__pyx_kp_s_47;
-static PyObject *__pyx_kp_s_49;
-static PyObject *__pyx_kp_s_56;
-static PyObject *__pyx_kp_s_66;
-static PyObject *__pyx_kp_s_68;
-static PyObject *__pyx_kp_s_70;
-static PyObject *__pyx_kp_s_73;
-static PyObject *__pyx_kp_s_78;
-static PyObject *__pyx_kp_s_82;
-static PyObject *__pyx_kp_s_84;
-static PyObject *__pyx_kp_s_89;
-static PyObject *__pyx_kp_s_9;
-static PyObject *__pyx_n_s__MT19937;
-static PyObject *__pyx_n_s__TypeError;
-static PyObject *__pyx_n_s__ValueError;
-static PyObject *__pyx_n_s____RandomState_ctor;
-static PyObject *__pyx_n_s____import__;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s___rand;
-static PyObject *__pyx_n_s__a;
-static PyObject *__pyx_n_s__add;
-static PyObject *__pyx_n_s__allclose;
-static PyObject *__pyx_n_s__alpha;
-static PyObject *__pyx_n_s__any;
-static PyObject *__pyx_n_s__arange;
-static PyObject *__pyx_n_s__array;
-static PyObject *__pyx_n_s__asarray;
-static PyObject *__pyx_n_s__b;
-static PyObject *__pyx_n_s__beta;
-static PyObject *__pyx_n_s__binomial;
-static PyObject *__pyx_n_s__bytes;
-static PyObject *__pyx_n_s__chisquare;
-static PyObject *__pyx_n_s__choice;
-static PyObject *__pyx_n_s__copy;
-static PyObject *__pyx_n_s__cov;
-static PyObject *__pyx_n_s__cumsum;
-static PyObject *__pyx_n_s__df;
-static PyObject *__pyx_n_s__dfden;
-static PyObject *__pyx_n_s__dfnum;
-static PyObject *__pyx_n_s__dirichlet;
-static PyObject *__pyx_n_s__dot;
-static PyObject *__pyx_n_s__double;
-static PyObject *__pyx_n_s__dtype;
-static PyObject *__pyx_n_s__empty;
-static PyObject *__pyx_n_s__equal;
-static PyObject *__pyx_n_s__exponential;
-static PyObject *__pyx_n_s__f;
-static PyObject *__pyx_n_s__float64;
-static PyObject *__pyx_n_s__gamma;
-static PyObject *__pyx_n_s__geometric;
-static PyObject *__pyx_n_s__get_state;
-static PyObject *__pyx_n_s__greater;
-static PyObject *__pyx_n_s__greater_equal;
-static PyObject *__pyx_n_s__gumbel;
-static PyObject *__pyx_n_s__high;
-static PyObject *__pyx_n_s__hypergeometric;
-static PyObject *__pyx_n_s__iinfo;
-static PyObject *__pyx_n_s__index;
-static PyObject *__pyx_n_s__int;
-static PyObject *__pyx_n_s__integer;
-static PyObject *__pyx_n_s__intp;
-static PyObject *__pyx_n_s__item;
-static PyObject *__pyx_n_s__kappa;
-static PyObject *__pyx_n_s__l;
-static PyObject *__pyx_n_s__lam;
-static PyObject *__pyx_n_s__laplace;
-static PyObject *__pyx_n_s__left;
-static PyObject *__pyx_n_s__less;
-static PyObject *__pyx_n_s__less_equal;
-static PyObject *__pyx_n_s__loc;
-static PyObject *__pyx_n_s__logistic;
-static PyObject *__pyx_n_s__lognormal;
-static PyObject *__pyx_n_s__logseries;
-static PyObject *__pyx_n_s__low;
-static PyObject *__pyx_n_s__max;
-static PyObject *__pyx_n_s__mean;
-static PyObject *__pyx_n_s__mode;
-static PyObject *__pyx_n_s__mu;
-static PyObject *__pyx_n_s__multinomial;
-static PyObject *__pyx_n_s__multiply;
-static PyObject *__pyx_n_s__multivariate_normal;
-static PyObject *__pyx_n_s__n;
-static PyObject *__pyx_n_s__nbad;
-static PyObject *__pyx_n_s__ndarray;
-static PyObject *__pyx_n_s__ndim;
-static PyObject *__pyx_n_s__ndmin;
-static PyObject *__pyx_n_s__negative_binomial;
-static PyObject *__pyx_n_s__ngood;
-static PyObject *__pyx_n_s__nonc;
-static PyObject *__pyx_n_s__noncentral_f;
-static PyObject *__pyx_n_s__normal;
-static PyObject *__pyx_n_s__np;
-static PyObject *__pyx_n_s__nsample;
-static PyObject *__pyx_n_s__numpy;
-static PyObject *__pyx_n_s__operator;
-static PyObject *__pyx_n_s__p;
-static PyObject *__pyx_n_s__pareto;
-static PyObject *__pyx_n_s__permutation;
-static PyObject *__pyx_n_s__poisson;
-static PyObject *__pyx_n_s__poisson_lam_max;
-static PyObject *__pyx_n_s__power;
-static PyObject *__pyx_n_s__prod;
-static PyObject *__pyx_n_s__pvals;
-static PyObject *__pyx_n_s__rand;
-static PyObject *__pyx_n_s__randint;
-static PyObject *__pyx_n_s__randn;
-static PyObject *__pyx_n_s__random;
-static PyObject *__pyx_n_s__random_integers;
-static PyObject *__pyx_n_s__random_sample;
-static PyObject *__pyx_n_s__ravel;
-static PyObject *__pyx_n_s__rayleigh;
-static PyObject *__pyx_n_s__reduce;
-static PyObject *__pyx_n_s__replace;
-static PyObject *__pyx_n_s__return_index;
-static PyObject *__pyx_n_s__right;
-static PyObject *__pyx_n_s__scale;
-static PyObject *__pyx_n_s__searchsorted;
-static PyObject *__pyx_n_s__seed;
-static PyObject *__pyx_n_s__set_state;
-static PyObject *__pyx_n_s__shape;
-static PyObject *__pyx_n_s__shuffle;
-static PyObject *__pyx_n_s__side;
-static PyObject *__pyx_n_s__sigma;
-static PyObject *__pyx_n_s__size;
-static PyObject *__pyx_n_s__sort;
-static PyObject *__pyx_n_s__sqrt;
-static PyObject *__pyx_n_s__standard_cauchy;
-static PyObject *__pyx_n_s__standard_gamma;
-static PyObject *__pyx_n_s__standard_normal;
-static PyObject *__pyx_n_s__standard_t;
-static PyObject *__pyx_n_s__subtract;
-static PyObject *__pyx_n_s__sum;
-static PyObject *__pyx_n_s__svd;
-static PyObject *__pyx_n_s__take;
-static PyObject *__pyx_n_s__triangular;
-static PyObject *__pyx_n_s__uint;
-static PyObject *__pyx_n_s__uint32;
-static PyObject *__pyx_n_s__uniform;
-static PyObject *__pyx_n_s__unique;
-static PyObject *__pyx_n_s__vonmises;
-static PyObject *__pyx_n_s__wald;
-static PyObject *__pyx_n_s__weibull;
-static PyObject *__pyx_n_s__zeros;
-static PyObject *__pyx_n_s__zipf;
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_3;
-static PyObject *__pyx_int_5;
-static PyObject *__pyx_int_10;
-static PyObject *__pyx_int_624;
-static PyObject *__pyx_k_17;
-static PyObject *__pyx_k_40;
-static PyObject *__pyx_k_41;
-static PyObject *__pyx_k_42;
-static PyObject *__pyx_k_43;
-static PyObject *__pyx_k_53;
-static PyObject *__pyx_k_59;
-static PyObject *__pyx_k_98;
-static PyObject *__pyx_k_99;
-static PyObject *__pyx_k_102;
-static PyObject *__pyx_k_103;
-static PyObject *__pyx_k_106;
-static PyObject *__pyx_k_107;
-static PyObject *__pyx_k_110;
-static PyObject *__pyx_k_111;
-static PyObject *__pyx_k_116;
-static PyObject *__pyx_k_151;
-static PyObject *__pyx_k_tuple_2;
-static PyObject *__pyx_k_tuple_3;
-static PyObject *__pyx_k_tuple_4;
-static PyObject *__pyx_k_tuple_5;
-static PyObject *__pyx_k_tuple_6;
-static PyObject *__pyx_k_tuple_7;
-static PyObject *__pyx_k_tuple_8;
-static PyObject *__pyx_k_slice_11;
-static PyObject *__pyx_k_slice_12;
-static PyObject *__pyx_k_tuple_10;
-static PyObject *__pyx_k_tuple_14;
-static PyObject *__pyx_k_tuple_16;
-static PyObject *__pyx_k_tuple_19;
-static PyObject *__pyx_k_tuple_21;
-static PyObject *__pyx_k_tuple_23;
-static PyObject *__pyx_k_tuple_25;
-static PyObject *__pyx_k_tuple_27;
-static PyObject *__pyx_k_tuple_29;
-static PyObject *__pyx_k_tuple_31;
-static PyObject *__pyx_k_tuple_33;
-static PyObject *__pyx_k_tuple_35;
-static PyObject *__pyx_k_tuple_37;
-static PyObject *__pyx_k_tuple_38;
-static PyObject *__pyx_k_tuple_39;
-static PyObject *__pyx_k_tuple_45;
-static PyObject *__pyx_k_tuple_46;
-static PyObject *__pyx_k_tuple_48;
-static PyObject *__pyx_k_tuple_50;
-static PyObject *__pyx_k_tuple_51;
-static PyObject *__pyx_k_tuple_52;
-static PyObject *__pyx_k_tuple_54;
-static PyObject *__pyx_k_tuple_55;
-static PyObject *__pyx_k_tuple_57;
-static PyObject *__pyx_k_tuple_58;
-static PyObject *__pyx_k_tuple_60;
-static PyObject *__pyx_k_tuple_61;
-static PyObject *__pyx_k_tuple_62;
-static PyObject *__pyx_k_tuple_63;
-static PyObject *__pyx_k_tuple_64;
-static PyObject *__pyx_k_tuple_65;
-static PyObject *__pyx_k_tuple_67;
-static PyObject *__pyx_k_tuple_69;
-static PyObject *__pyx_k_tuple_71;
-static PyObject *__pyx_k_tuple_72;
-static PyObject *__pyx_k_tuple_74;
-static PyObject *__pyx_k_tuple_75;
-static PyObject *__pyx_k_tuple_76;
-static PyObject *__pyx_k_tuple_77;
-static PyObject *__pyx_k_tuple_79;
-static PyObject *__pyx_k_tuple_80;
-static PyObject *__pyx_k_tuple_81;
-static PyObject *__pyx_k_tuple_83;
-static PyObject *__pyx_k_tuple_85;
-static PyObject *__pyx_k_tuple_86;
-static PyObject *__pyx_k_tuple_87;
-static PyObject *__pyx_k_tuple_88;
-static PyObject *__pyx_k_tuple_90;
-static PyObject *__pyx_k_tuple_91;
-static PyObject *__pyx_k_tuple_92;
-static PyObject *__pyx_k_tuple_93;
-static PyObject *__pyx_k_tuple_94;
-static PyObject *__pyx_k_tuple_95;
-static PyObject *__pyx_k_tuple_96;
-static PyObject *__pyx_k_tuple_97;
-static PyObject *__pyx_k_slice_192;
-static PyObject *__pyx_k_slice_196;
-static PyObject *__pyx_k_tuple_100;
-static PyObject *__pyx_k_tuple_101;
-static PyObject *__pyx_k_tuple_104;
-static PyObject *__pyx_k_tuple_105;
-static PyObject *__pyx_k_tuple_108;
-static PyObject *__pyx_k_tuple_109;
-static PyObject *__pyx_k_tuple_113;
-static PyObject *__pyx_k_tuple_115;
-static PyObject *__pyx_k_tuple_117;
-static PyObject *__pyx_k_tuple_119;
-static PyObject *__pyx_k_tuple_121;
-static PyObject *__pyx_k_tuple_122;
-static PyObject *__pyx_k_tuple_124;
-static PyObject *__pyx_k_tuple_125;
-static PyObject *__pyx_k_tuple_127;
-static PyObject *__pyx_k_tuple_129;
-static PyObject *__pyx_k_tuple_131;
-static PyObject *__pyx_k_tuple_132;
-static PyObject *__pyx_k_tuple_133;
-static PyObject *__pyx_k_tuple_134;
-static PyObject *__pyx_k_tuple_136;
-static PyObject *__pyx_k_tuple_138;
-static PyObject *__pyx_k_tuple_140;
-static PyObject *__pyx_k_tuple_141;
-static PyObject *__pyx_k_tuple_142;
-static PyObject *__pyx_k_tuple_143;
-static PyObject *__pyx_k_tuple_145;
-static PyObject *__pyx_k_tuple_146;
-static PyObject *__pyx_k_tuple_147;
-static PyObject *__pyx_k_tuple_148;
-static PyObject *__pyx_k_tuple_149;
-static PyObject *__pyx_k_tuple_150;
-static PyObject *__pyx_k_tuple_153;
-static PyObject *__pyx_k_tuple_155;
-static PyObject *__pyx_k_tuple_156;
-static PyObject *__pyx_k_tuple_158;
-static PyObject *__pyx_k_tuple_160;
-static PyObject *__pyx_k_tuple_161;
-static PyObject *__pyx_k_tuple_163;
-static PyObject *__pyx_k_tuple_165;
-static PyObject *__pyx_k_tuple_166;
-static PyObject *__pyx_k_tuple_167;
-static PyObject *__pyx_k_tuple_169;
-static PyObject *__pyx_k_tuple_171;
-static PyObject *__pyx_k_tuple_173;
-static PyObject *__pyx_k_tuple_175;
-static PyObject *__pyx_k_tuple_176;
-static PyObject *__pyx_k_tuple_177;
-static PyObject *__pyx_k_tuple_178;
-static PyObject *__pyx_k_tuple_179;
-static PyObject *__pyx_k_tuple_181;
-static PyObject *__pyx_k_tuple_183;
-static PyObject *__pyx_k_tuple_184;
-static PyObject *__pyx_k_tuple_185;
-static PyObject *__pyx_k_tuple_187;
-static PyObject *__pyx_k_tuple_189;
-static PyObject *__pyx_k_tuple_191;
-static PyObject *__pyx_k_tuple_195;
-static PyObject *__pyx_k_tuple_197;
-static PyObject *__pyx_k_tuple_198;
-
-/* "mtrand.pyx":129
- * import operator
- *
- * cdef object cont0_array(rk_state *state, rk_cont0 func, object size): # <<<<<<<<<<<<<<
- * cdef double *array_data
- * cdef ndarray array "arrayObject"
- */
-
-static PyObject *__pyx_f_6mtrand_cont0_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont0 __pyx_v_func, PyObject *__pyx_v_size) {
- double *__pyx_v_array_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- npy_intp __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("cont0_array", 0);
-
- /* "mtrand.pyx":135
- * cdef npy_intp i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state)
- * else:
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":136
- *
- * if size is None:
- * return func(state) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":138
- * return func(state)
- * else:
- * array = <ndarray>np.empty(size, np.float64) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_4;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":139
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":140
- * array = <ndarray>np.empty(size, np.float64)
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state)
- */
- __pyx_v_array_data = ((double *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":141
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state)
- * return array
- */
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
-
- /* "mtrand.pyx":142
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- * array_data[i] = func(state) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);
- }
-
- /* "mtrand.pyx":143
- * for i from 0 <= i < length:
- * array_data[i] = func(state)
- * return array # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.cont0_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":146
- *
- *
- * cdef object cont1_array_sc(rk_state *state, rk_cont1 func, object size, double a): # <<<<<<<<<<<<<<
- * cdef double *array_data
- * cdef ndarray array "arrayObject"
- */
-
-static PyObject *__pyx_f_6mtrand_cont1_array_sc(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont1 __pyx_v_func, PyObject *__pyx_v_size, double __pyx_v_a) {
- double *__pyx_v_array_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- npy_intp __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("cont1_array_sc", 0);
-
- /* "mtrand.pyx":152
- * cdef npy_intp i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, a)
- * else:
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":153
- *
- * if size is None:
- * return func(state, a) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state, __pyx_v_a)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":155
- * return func(state, a)
- * else:
- * array = <ndarray>np.empty(size, np.float64) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_4;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":156
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":157
- * array = <ndarray>np.empty(size, np.float64)
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a)
- */
- __pyx_v_array_data = ((double *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":158
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, a)
- * return array
- */
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
-
- /* "mtrand.pyx":159
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a);
- }
-
- /* "mtrand.pyx":160
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object cont1_array(rk_state *state, rk_cont1 func, object size, ndarray oa):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.cont1_array_sc", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":162
- * return array
- *
- * cdef object cont1_array(rk_state *state, rk_cont1 func, object size, ndarray oa): # <<<<<<<<<<<<<<
- * cdef double *array_data
- * cdef double *oa_data
- */
-
-static PyObject *__pyx_f_6mtrand_cont1_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont1 __pyx_v_func, PyObject *__pyx_v_size, PyArrayObject *__pyx_v_oa) {
- double *__pyx_v_array_data;
- double *__pyx_v_oa_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyArrayIterObject *__pyx_v_itera = 0;
- PyArrayMultiIterObject *__pyx_v_multi = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- npy_intp __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("cont1_array", 0);
-
- /* "mtrand.pyx":171
- * cdef broadcast multi
- *
- * if size is None: # <<<<<<<<<<<<<<
- * array = <ndarray>PyArray_SimpleNew(PyArray_NDIM(oa),
- * PyArray_DIMS(oa) , NPY_DOUBLE)
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":173
- * if size is None:
- * array = <ndarray>PyArray_SimpleNew(PyArray_NDIM(oa),
- * PyArray_DIMS(oa) , NPY_DOUBLE) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array)
- */
- __pyx_t_2 = PyArray_SimpleNew(PyArray_NDIM(__pyx_v_oa), PyArray_DIMS(__pyx_v_oa), NPY_DOUBLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":174
- * array = <ndarray>PyArray_SimpleNew(PyArray_NDIM(oa),
- * PyArray_DIMS(oa) , NPY_DOUBLE)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <double *>PyArray_DATA(array)
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":175
- * PyArray_DIMS(oa) , NPY_DOUBLE)
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length:
- */
- __pyx_v_array_data = ((double *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":176
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array)
- * itera = <flatiter>PyArray_IterNew(<object>oa) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- */
- __pyx_t_3 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_itera = ((PyArrayIterObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":177
- * array_data = <double *>PyArray_DATA(array)
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- * PyArray_ITER_NEXT(itera)
- */
- __pyx_t_4 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":178
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length:
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0]) # <<<<<<<<<<<<<<
- * PyArray_ITER_NEXT(itera)
- * else:
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (((double *)__pyx_v_itera->dataptr)[0]));
-
- /* "mtrand.pyx":179
- * for i from 0 <= i < length:
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- * PyArray_ITER_NEXT(itera) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- */
- PyArray_ITER_NEXT(__pyx_v_itera);
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":181
- * PyArray_ITER_NEXT(itera)
- * else:
- * array = <ndarray>np.empty(size, np.float64) # <<<<<<<<<<<<<<
- * array_data = <double *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array,
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_5;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":182
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- * array_data = <double *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array,
- * <void *>oa)
- */
- __pyx_v_array_data = ((double *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":184
- * array_data = <double *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array,
- * <void *>oa) # <<<<<<<<<<<<<<
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- */
- __pyx_t_2 = PyArray_MultiIterNew(2, ((void *)arrayObject), ((void *)__pyx_v_oa)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "mtrand.pyx":185
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array,
- * <void *>oa)
- * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<<
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- */
- __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":186
- * <void *>oa)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":187
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0])
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":188
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":189
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXTi(multi, 1)
- * return array
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]));
-
- /* "mtrand.pyx":190
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<<
- * return array
- *
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 1);
- }
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":191
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object cont2_array_sc(rk_state *state, rk_cont2 func, object size, double a,
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.cont1_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XDECREF((PyObject *)__pyx_v_itera);
- __Pyx_XDECREF((PyObject *)__pyx_v_multi);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":193
- * return array
- *
- * cdef object cont2_array_sc(rk_state *state, rk_cont2 func, object size, double a, # <<<<<<<<<<<<<<
- * double b):
- * cdef double *array_data
- */
-
-static PyObject *__pyx_f_6mtrand_cont2_array_sc(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont2 __pyx_v_func, PyObject *__pyx_v_size, double __pyx_v_a, double __pyx_v_b) {
- double *__pyx_v_array_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- npy_intp __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("cont2_array_sc", 0);
-
- /* "mtrand.pyx":200
- * cdef npy_intp i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, a, b)
- * else:
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":201
- *
- * if size is None:
- * return func(state, a, b) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":203
- * return func(state, a, b)
- * else:
- * array = <ndarray>np.empty(size, np.float64) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_4;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":204
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":205
- * array = <ndarray>np.empty(size, np.float64)
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b)
- */
- __pyx_v_array_data = ((double *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":206
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, a, b)
- * return array
- */
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
-
- /* "mtrand.pyx":207
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b);
- }
-
- /* "mtrand.pyx":208
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b)
- * return array # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.cont2_array_sc", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":211
- *
- *
- * cdef object cont2_array(rk_state *state, rk_cont2 func, object size, # <<<<<<<<<<<<<<
- * ndarray oa, ndarray ob):
- * cdef double *array_data
- */
-
-static PyObject *__pyx_f_6mtrand_cont2_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont2 __pyx_v_func, PyObject *__pyx_v_size, PyArrayObject *__pyx_v_oa, PyArrayObject *__pyx_v_ob) {
- double *__pyx_v_array_data;
- double *__pyx_v_oa_data;
- double *__pyx_v_ob_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_i;
- PyArrayMultiIterObject *__pyx_v_multi = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- npy_intp __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("cont2_array", 0);
-
- /* "mtrand.pyx":221
- * cdef broadcast multi
- *
- * if size is None: # <<<<<<<<<<<<<<
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>oa, <void *>ob)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":222
- *
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>oa, <void *>ob) # <<<<<<<<<<<<<<
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- * array_data = <double *>PyArray_DATA(array)
- */
- __pyx_t_2 = PyArray_MultiIterNew(2, ((void *)__pyx_v_oa), ((void *)__pyx_v_ob)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":223
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>oa, <void *>ob)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) # <<<<<<<<<<<<<<
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size:
- */
- __pyx_t_3 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":224
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>oa, <void *>ob)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- * array_data = <double *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- */
- __pyx_v_array_data = ((double *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":225
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":226
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<<
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 0));
-
- /* "mtrand.pyx":227
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- * PyArray_MultiIter_NEXT(multi)
- */
- __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":228
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0], ob_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXT(multi)
- * else:
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]), (__pyx_v_ob_data[0]));
-
- /* "mtrand.pyx":229
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- */
- PyArray_MultiIter_NEXT(__pyx_v_multi);
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":231
- * PyArray_MultiIter_NEXT(multi)
- * else:
- * array = <ndarray>np.empty(size, np.float64) # <<<<<<<<<<<<<<
- * array_data = <double *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_5;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":232
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- * array_data = <double *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob)
- * if (multi.size != PyArray_SIZE(array)):
- */
- __pyx_v_array_data = ((double *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":233
- * array = <ndarray>np.empty(size, np.float64)
- * array_data = <double *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob) # <<<<<<<<<<<<<<
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- */
- __pyx_t_2 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "mtrand.pyx":234
- * array_data = <double *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob)
- * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<<
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- */
- __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":235
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":236
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":237
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":238
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- */
- __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "mtrand.pyx":239
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXTi(multi, 1)
- * PyArray_MultiIter_NEXTi(multi, 2)
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]), (__pyx_v_ob_data[0]));
-
- /* "mtrand.pyx":240
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXTi(multi, 2)
- * return array
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 1);
-
- /* "mtrand.pyx":241
- * array_data[i] = func(state, oa_data[0], ob_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- * PyArray_MultiIter_NEXTi(multi, 2) # <<<<<<<<<<<<<<
- * return array
- *
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 2);
- }
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":242
- * PyArray_MultiIter_NEXTi(multi, 1)
- * PyArray_MultiIter_NEXTi(multi, 2)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object cont3_array_sc(rk_state *state, rk_cont3 func, object size, double a,
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.cont2_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XDECREF((PyObject *)__pyx_v_multi);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":244
- * return array
- *
- * cdef object cont3_array_sc(rk_state *state, rk_cont3 func, object size, double a, # <<<<<<<<<<<<<<
- * double b, double c):
- *
- */
-
-static PyObject *__pyx_f_6mtrand_cont3_array_sc(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont3 __pyx_v_func, PyObject *__pyx_v_size, double __pyx_v_a, double __pyx_v_b, double __pyx_v_c) {
- double *__pyx_v_array_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- npy_intp __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("cont3_array_sc", 0);
-
- /* "mtrand.pyx":252
- * cdef npy_intp i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, a, b, c)
- * else:
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":253
- *
- * if size is None:
- * return func(state, a, b, c) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b, __pyx_v_c)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":255
- * return func(state, a, b, c)
- * else:
- * array = <ndarray>np.empty(size, np.float64) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_4;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":256
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":257
- * array = <ndarray>np.empty(size, np.float64)
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b, c)
- */
- __pyx_v_array_data = ((double *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":258
- * length = PyArray_SIZE(array)
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, a, b, c)
- * return array
- */
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
-
- /* "mtrand.pyx":259
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b, c) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a, __pyx_v_b, __pyx_v_c);
- }
-
- /* "mtrand.pyx":260
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a, b, c)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object cont3_array(rk_state *state, rk_cont3 func, object size, ndarray oa,
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.cont3_array_sc", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":262
- * return array
- *
- * cdef object cont3_array(rk_state *state, rk_cont3 func, object size, ndarray oa, # <<<<<<<<<<<<<<
- * ndarray ob, ndarray oc):
- *
- */
-
-static PyObject *__pyx_f_6mtrand_cont3_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_cont3 __pyx_v_func, PyObject *__pyx_v_size, PyArrayObject *__pyx_v_oa, PyArrayObject *__pyx_v_ob, PyArrayObject *__pyx_v_oc) {
- double *__pyx_v_array_data;
- double *__pyx_v_oa_data;
- double *__pyx_v_ob_data;
- double *__pyx_v_oc_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_i;
- PyArrayMultiIterObject *__pyx_v_multi = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- npy_intp __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("cont3_array", 0);
-
- /* "mtrand.pyx":274
- * cdef broadcast multi
- *
- * if size is None: # <<<<<<<<<<<<<<
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>oa, <void *>ob, <void *>oc)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":275
- *
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>oa, <void *>ob, <void *>oc) # <<<<<<<<<<<<<<
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- * array_data = <double *>PyArray_DATA(array)
- */
- __pyx_t_2 = PyArray_MultiIterNew(3, ((void *)__pyx_v_oa), ((void *)__pyx_v_ob), ((void *)__pyx_v_oc)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":276
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>oa, <void *>ob, <void *>oc)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE) # <<<<<<<<<<<<<<
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size:
- */
- __pyx_t_3 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":277
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>oa, <void *>ob, <void *>oc)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- * array_data = <double *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- */
- __pyx_v_array_data = ((double *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":278
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":279
- * array_data = <double *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<<
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 0));
-
- /* "mtrand.pyx":280
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- */
- __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":281
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- * PyArray_MultiIter_NEXT(multi)
- */
- __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "mtrand.pyx":282
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXT(multi)
- * else:
- */
- (__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]));
-
- /* "mtrand.pyx":283
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- */
- PyArray_MultiIter_NEXT(__pyx_v_multi);
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":285
- * PyArray_MultiIter_NEXT(multi)
- * else:
- * array = <ndarray>np.empty(size, np.float64) # <<<<<<<<<<<<<<
- * array_data = <double *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa,
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_5;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":286
- * else:
- * array = <ndarray>np.empty(size, np.float64)
- * array_data = <double *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa,
- * <void *>ob, <void *>oc)
- */
- __pyx_v_array_data = ((double *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":288
- * array_data = <double *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa,
- * <void *>ob, <void *>oc) # <<<<<<<<<<<<<<
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- */
- __pyx_t_2 = PyArray_MultiIterNew(4, ((void *)arrayObject), ((void *)__pyx_v_oa), ((void *)__pyx_v_ob), ((void *)__pyx_v_oc)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "mtrand.pyx":289
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>oa,
- * <void *>ob, <void *>oc)
- * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<<
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- */
- __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":290
- * <void *>ob, <void *>oc)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":291
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":292
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 3)
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":293
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<<
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- */
- __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "mtrand.pyx":294
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 3) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- * PyArray_MultiIter_NEXT(multi)
- */
- __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 3));
-
- /* "mtrand.pyx":295
- * ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXT(multi)
- * return array
- */
- (__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]));
-
- /* "mtrand.pyx":296
- * oc_data = <double *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<<
- * return array
- *
- */
- PyArray_MultiIter_NEXT(__pyx_v_multi);
- }
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":297
- * array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- * PyArray_MultiIter_NEXT(multi)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object disc0_array(rk_state *state, rk_disc0 func, object size):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.cont3_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XDECREF((PyObject *)__pyx_v_multi);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":299
- * return array
- *
- * cdef object disc0_array(rk_state *state, rk_disc0 func, object size): # <<<<<<<<<<<<<<
- * cdef long *array_data
- * cdef ndarray array "arrayObject"
- */
-
-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 = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- npy_intp __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("disc0_array", 0);
-
- /* "mtrand.pyx":305
- * cdef npy_intp i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state)
- * else:
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":306
- *
- * if size is None:
- * return func(state) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, int)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":308
- * return func(state)
- * else:
- * array = <ndarray>np.empty(size, int) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_4;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":309
- * else:
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":310
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state)
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":311
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state)
- * return array
- */
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
-
- /* "mtrand.pyx":312
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- * array_data[i] = func(state) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state);
- }
-
- /* "mtrand.pyx":313
- * for i from 0 <= i < length:
- * array_data[i] = func(state)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discnp_array_sc(rk_state *state, rk_discnp func, object size, long n, double p):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.disc0_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":315
- * return array
- *
- * cdef object discnp_array_sc(rk_state *state, rk_discnp func, object size, long n, double p): # <<<<<<<<<<<<<<
- * cdef long *array_data
- * cdef ndarray array "arrayObject"
- */
-
-static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_discnp __pyx_v_func, PyObject *__pyx_v_size, long __pyx_v_n, double __pyx_v_p) {
- long *__pyx_v_array_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- npy_intp __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("discnp_array_sc", 0);
-
- /* "mtrand.pyx":321
- * cdef npy_intp i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, n, p)
- * else:
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":322
- *
- * if size is None:
- * return func(state, n, p) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, int)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_p)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":324
- * return func(state, n, p)
- * else:
- * array = <ndarray>np.empty(size, int) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_4;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":325
- * else:
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":326
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, p)
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":327
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, n, p)
- * return array
- */
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
-
- /* "mtrand.pyx":328
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, p) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_p);
- }
-
- /* "mtrand.pyx":329
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, p)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discnp_array(rk_state *state, rk_discnp func, object size, ndarray on, ndarray op):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.discnp_array_sc", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":331
- * return array
- *
- * cdef object discnp_array(rk_state *state, rk_discnp func, object size, ndarray on, ndarray op): # <<<<<<<<<<<<<<
- * cdef long *array_data
- * cdef ndarray array "arrayObject"
- */
-
-static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_discnp __pyx_v_func, PyObject *__pyx_v_size, PyArrayObject *__pyx_v_on, PyArrayObject *__pyx_v_op) {
- long *__pyx_v_array_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_i;
- double *__pyx_v_op_data;
- long *__pyx_v_on_data;
- PyArrayMultiIterObject *__pyx_v_multi = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- npy_intp __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("discnp_array", 0);
-
- /* "mtrand.pyx":340
- * 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)
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":341
- *
- * 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 *>PyArray_DATA(array)
- */
- __pyx_t_2 = PyArray_MultiIterNew(2, ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":342
- * 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 *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size:
- */
- __pyx_t_3 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":343
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":344
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":345
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<<
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, on_data[0], op_data[0])
- */
- __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 0));
-
- /* "mtrand.pyx":346
- * for i from 0 <= i < multi.size:
- * on_data = <long *>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)
- */
- __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":347
- * on_data = <long *>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:
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_op_data[0]));
-
- /* "mtrand.pyx":348
- * 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)
- */
- PyArray_MultiIter_NEXT(__pyx_v_multi);
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":350
- * PyArray_MultiIter_NEXT(multi)
- * else:
- * array = <ndarray>np.empty(size, int) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_5;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":351
- * else:
- * array = <ndarray>np.empty(size, int)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op)
- * if (multi.size != PyArray_SIZE(array)):
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":352
- * array = <ndarray>np.empty(size, int)
- * array_data = <long *>PyArray_DATA(array)
- * 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")
- */
- __pyx_t_2 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "mtrand.pyx":353
- * array_data = <long *>PyArray_DATA(array)
- * 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:
- */
- __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":354
- * 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 = <long *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":355
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":356
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, on_data[0], op_data[0])
- */
- __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":357
- * for i from 0 <= i < multi.size:
- * on_data = <long *>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)
- */
- __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "mtrand.pyx":358
- * on_data = <long *>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)
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_op_data[0]));
-
- /* "mtrand.pyx":359
- * 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)
- *
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 1);
-
- /* "mtrand.pyx":360
- * array_data[i] = func(state, on_data[0], op_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- * PyArray_MultiIter_NEXTi(multi, 2) # <<<<<<<<<<<<<<
- *
- * return array
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 2);
- }
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":362
- * PyArray_MultiIter_NEXTi(multi, 2)
- *
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discdd_array_sc(rk_state *state, rk_discdd func, object size, double n, double p):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.discnp_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XDECREF((PyObject *)__pyx_v_multi);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":364
- * 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"
- */
-
-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 = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- npy_intp __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("discdd_array_sc", 0);
-
- /* "mtrand.pyx":370
- * cdef npy_intp i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, n, p)
- * else:
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":371
- *
- * if size is None:
- * return func(state, n, p) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, int)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_p)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":373
- * return func(state, n, p)
- * else:
- * array = <ndarray>np.empty(size, int) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_4;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":374
- * else:
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":375
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, p)
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":376
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, n, p)
- * return array
- */
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
-
- /* "mtrand.pyx":377
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, p) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_p);
- }
-
- /* "mtrand.pyx":378
- * 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):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.discdd_array_sc", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":380
- * 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"
- */
-
-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 = 0;
- npy_intp __pyx_v_i;
- double *__pyx_v_op_data;
- double *__pyx_v_on_data;
- PyArrayMultiIterObject *__pyx_v_multi = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- npy_intp __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("discdd_array", 0);
-
- /* "mtrand.pyx":389
- * 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)
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":390
- *
- * 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 *>PyArray_DATA(array)
- */
- __pyx_t_2 = PyArray_MultiIterNew(2, ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":391
- * 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 *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size:
- */
- __pyx_t_3 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":392
- * multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * on_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":393
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * on_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- * op_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":394
- * array_data = <long *>PyArray_DATA(array)
- * 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])
- */
- __pyx_v_on_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 0));
-
- /* "mtrand.pyx":395
- * 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)
- */
- __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":396
- * 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:
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_op_data[0]));
-
- /* "mtrand.pyx":397
- * 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)
- */
- PyArray_MultiIter_NEXT(__pyx_v_multi);
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":399
- * PyArray_MultiIter_NEXT(multi)
- * else:
- * array = <ndarray>np.empty(size, int) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_5;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":400
- * else:
- * array = <ndarray>np.empty(size, int)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>on, <void *>op)
- * if (multi.size != PyArray_SIZE(array)):
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":401
- * array = <ndarray>np.empty(size, int)
- * array_data = <long *>PyArray_DATA(array)
- * 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")
- */
- __pyx_t_2 = PyArray_MultiIterNew(3, ((void *)arrayObject), ((void *)__pyx_v_on), ((void *)__pyx_v_op)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "mtrand.pyx":402
- * array_data = <long *>PyArray_DATA(array)
- * 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:
- */
- __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":403
- * 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)
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":404
- * 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)
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":405
- * 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])
- */
- __pyx_v_on_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":406
- * 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)
- */
- __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "mtrand.pyx":407
- * 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)
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_on_data[0]), (__pyx_v_op_data[0]));
-
- /* "mtrand.pyx":408
- * 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)
- *
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 1);
-
- /* "mtrand.pyx":409
- * array_data[i] = func(state, on_data[0], op_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- * PyArray_MultiIter_NEXTi(multi, 2) # <<<<<<<<<<<<<<
- *
- * return array
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 2);
- }
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":411
- * PyArray_MultiIter_NEXTi(multi, 2)
- *
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discnmN_array_sc(rk_state *state, rk_discnmN func, object size,
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.discdd_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XDECREF((PyObject *)__pyx_v_multi);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":413
- * 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
- */
-
-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 = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- npy_intp __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("discnmN_array_sc", 0);
-
- /* "mtrand.pyx":420
- * cdef npy_intp i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, n, m, N)
- * else:
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":421
- *
- * if size is None:
- * return func(state, n, m, N) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, int)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_m, __pyx_v_N)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":423
- * return func(state, n, m, N)
- * else:
- * array = <ndarray>np.empty(size, int) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_4;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":424
- * else:
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":425
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, m, N)
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":426
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, n, m, N)
- * return array
- */
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
-
- /* "mtrand.pyx":427
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, m, N) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_n, __pyx_v_m, __pyx_v_N);
- }
-
- /* "mtrand.pyx":428
- * for i from 0 <= i < length:
- * array_data[i] = func(state, n, m, N)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discnmN_array(rk_state *state, rk_discnmN func, object size,
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.discnmN_array_sc", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":430
- * return array
- *
- * cdef object discnmN_array(rk_state *state, rk_discnmN func, object size, # <<<<<<<<<<<<<<
- * ndarray on, ndarray om, ndarray oN):
- * cdef long *array_data
- */
-
-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;
- long *__pyx_v_on_data;
- long *__pyx_v_om_data;
- long *__pyx_v_oN_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_i;
- PyArrayMultiIterObject *__pyx_v_multi = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- npy_intp __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("discnmN_array", 0);
-
- /* "mtrand.pyx":441
- * cdef broadcast multi
- *
- * if size is None: # <<<<<<<<<<<<<<
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>on, <void *>om, <void *>oN)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":442
- *
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>on, <void *>om, <void *>oN) # <<<<<<<<<<<<<<
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- * array_data = <long *>PyArray_DATA(array)
- */
- __pyx_t_2 = PyArray_MultiIterNew(3, ((void *)__pyx_v_on), ((void *)__pyx_v_om), ((void *)__pyx_v_oN)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":443
- * if size is None:
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>on, <void *>om, <void *>oN)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size:
- */
- __pyx_t_3 = PyArray_SimpleNew(__pyx_v_multi->nd, __pyx_v_multi->dimensions, NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":444
- * multi = <broadcast> PyArray_MultiIterNew(3, <void *>on, <void *>om, <void *>oN)
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":445
- * array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":446
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0) # <<<<<<<<<<<<<<
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- */
- __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 0));
-
- /* "mtrand.pyx":447
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- */
- __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":448
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- * PyArray_MultiIter_NEXT(multi)
- */
- __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "mtrand.pyx":449
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXT(multi)
- * else:
- */
- (__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]));
-
- /* "mtrand.pyx":450
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, int)
- */
- PyArray_MultiIter_NEXT(__pyx_v_multi);
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":452
- * PyArray_MultiIter_NEXT(multi)
- * else:
- * array = <ndarray>np.empty(size, int) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>on, <void *>om,
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_5;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":453
- * else:
- * array = <ndarray>np.empty(size, int)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>on, <void *>om,
- * <void *>oN)
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":455
- * array_data = <long *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>on, <void *>om,
- * <void *>oN) # <<<<<<<<<<<<<<
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- */
- __pyx_t_2 = PyArray_MultiIterNew(4, ((void *)arrayObject), ((void *)__pyx_v_on), ((void *)__pyx_v_om), ((void *)__pyx_v_oN)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "mtrand.pyx":456
- * multi = <broadcast>PyArray_MultiIterNew(4, <void*>array, <void *>on, <void *>om,
- * <void *>oN)
- * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<<
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- */
- __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":457
- * <void *>oN)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":458
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":459
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 3)
- */
- __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":460
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 2) # <<<<<<<<<<<<<<
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- */
- __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 2));
-
- /* "mtrand.pyx":461
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 3) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- * PyArray_MultiIter_NEXT(multi)
- */
- __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi, 3));
-
- /* "mtrand.pyx":462
- * om_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXT(multi)
- *
- */
- (__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]));
-
- /* "mtrand.pyx":463
- * oN_data = <long *>PyArray_MultiIter_DATA(multi, 3)
- * array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- * PyArray_MultiIter_NEXT(multi) # <<<<<<<<<<<<<<
- *
- * return array
- */
- PyArray_MultiIter_NEXT(__pyx_v_multi);
- }
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":465
- * PyArray_MultiIter_NEXT(multi)
- *
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discd_array_sc(rk_state *state, rk_discd func, object size, double a):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.discnmN_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XDECREF((PyObject *)__pyx_v_multi);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":467
- * return array
- *
- * cdef object discd_array_sc(rk_state *state, rk_discd func, object size, double a): # <<<<<<<<<<<<<<
- * cdef long *array_data
- * cdef ndarray array "arrayObject"
- */
-
-static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *__pyx_v_state, __pyx_t_6mtrand_rk_discd __pyx_v_func, PyObject *__pyx_v_size, double __pyx_v_a) {
- long *__pyx_v_array_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- npy_intp __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("discd_array_sc", 0);
-
- /* "mtrand.pyx":473
- * cdef npy_intp i
- *
- * if size is None: # <<<<<<<<<<<<<<
- * return func(state, a)
- * else:
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":474
- *
- * if size is None:
- * return func(state, a) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, int)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state, __pyx_v_a)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":476
- * return func(state, a)
- * else:
- * array = <ndarray>np.empty(size, int) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_4;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":477
- * else:
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":478
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a)
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":479
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, a)
- * return array
- */
- __pyx_t_5 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_5; __pyx_v_i++) {
-
- /* "mtrand.pyx":480
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a) # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, __pyx_v_a);
- }
-
- /* "mtrand.pyx":481
- * for i from 0 <= i < length:
- * array_data[i] = func(state, a)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef object discd_array(rk_state *state, rk_discd func, object size, ndarray oa):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.discd_array_sc", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":483
- * return array
- *
- * cdef object discd_array(rk_state *state, rk_discd func, object size, ndarray oa): # <<<<<<<<<<<<<<
- * cdef long *array_data
- * cdef double *oa_data
- */
-
-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;
- double *__pyx_v_oa_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyArrayMultiIterObject *__pyx_v_multi = 0;
- PyArrayIterObject *__pyx_v_itera = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- npy_intp __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("discd_array", 0);
-
- /* "mtrand.pyx":492
- * cdef flatiter itera
- *
- * if size is None: # <<<<<<<<<<<<<<
- * array = <ndarray>PyArray_SimpleNew(PyArray_NDIM(oa),
- * PyArray_DIMS(oa), NPY_LONG)
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":494
- * if size is None:
- * array = <ndarray>PyArray_SimpleNew(PyArray_NDIM(oa),
- * PyArray_DIMS(oa), NPY_LONG) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- */
- __pyx_t_2 = PyArray_SimpleNew(PyArray_NDIM(__pyx_v_oa), PyArray_DIMS(__pyx_v_oa), NPY_LONG); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":495
- * array = <ndarray>PyArray_SimpleNew(PyArray_NDIM(oa),
- * PyArray_DIMS(oa), NPY_LONG)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":496
- * PyArray_DIMS(oa), NPY_LONG)
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length:
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":497
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- * itera = <flatiter>PyArray_IterNew(<object>oa) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- */
- __pyx_t_3 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_itera = ((PyArrayIterObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":498
- * array_data = <long *>PyArray_DATA(array)
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- * PyArray_ITER_NEXT(itera)
- */
- __pyx_t_4 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":499
- * itera = <flatiter>PyArray_IterNew(<object>oa)
- * for i from 0 <= i < length:
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0]) # <<<<<<<<<<<<<<
- * PyArray_ITER_NEXT(itera)
- * else:
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (((double *)__pyx_v_itera->dataptr)[0]));
-
- /* "mtrand.pyx":500
- * for i from 0 <= i < length:
- * array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- * PyArray_ITER_NEXT(itera) # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, int)
- */
- PyArray_ITER_NEXT(__pyx_v_itera);
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":502
- * PyArray_ITER_NEXT(itera)
- * else:
- * array = <ndarray>np.empty(size, int) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = __pyx_t_5;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":503
- * else:
- * array = <ndarray>np.empty(size, int)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa)
- * if (multi.size != PyArray_SIZE(array)):
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":504
- * array = <ndarray>np.empty(size, int)
- * array_data = <long *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa) # <<<<<<<<<<<<<<
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- */
- __pyx_t_2 = PyArray_MultiIterNew(2, ((void *)arrayObject), ((void *)__pyx_v_oa)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "mtrand.pyx":505
- * array_data = <long *>PyArray_DATA(array)
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa)
- * if (multi.size != PyArray_SIZE(array)): # <<<<<<<<<<<<<<
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- */
- __pyx_t_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject));
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":506
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":507
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size: # <<<<<<<<<<<<<<
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0])
- */
- __pyx_t_4 = __pyx_v_multi->size;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_4; __pyx_v_i++) {
-
- /* "mtrand.pyx":508
- * raise ValueError("size is not compatible with inputs")
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1) # <<<<<<<<<<<<<<
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- */
- __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi, 1));
-
- /* "mtrand.pyx":509
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0]) # <<<<<<<<<<<<<<
- * PyArray_MultiIter_NEXTi(multi, 1)
- * return array
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state, (__pyx_v_oa_data[0]));
-
- /* "mtrand.pyx":510
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1) # <<<<<<<<<<<<<<
- * return array
- *
- */
- PyArray_MultiIter_NEXTi(__pyx_v_multi, 1);
- }
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":511
- * array_data[i] = func(state, oa_data[0])
- * PyArray_MultiIter_NEXTi(multi, 1)
- * return array # <<<<<<<<<<<<<<
- *
- * cdef double kahan_sum(double *darr, npy_intp n):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.discd_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XDECREF((PyObject *)__pyx_v_multi);
- __Pyx_XDECREF((PyObject *)__pyx_v_itera);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":513
- * return array
- *
- * cdef double kahan_sum(double *darr, npy_intp n): # <<<<<<<<<<<<<<
- * cdef double c, y, t, sum
- * cdef npy_intp i
- */
-
-static double __pyx_f_6mtrand_kahan_sum(double *__pyx_v_darr, npy_intp __pyx_v_n) {
- double __pyx_v_c;
- double __pyx_v_y;
- double __pyx_v_t;
- double __pyx_v_sum;
- npy_intp __pyx_v_i;
- double __pyx_r;
- __Pyx_RefNannyDeclarations
- npy_intp __pyx_t_1;
- __Pyx_RefNannySetupContext("kahan_sum", 0);
-
- /* "mtrand.pyx":516
- * cdef double c, y, t, sum
- * cdef npy_intp i
- * sum = darr[0] # <<<<<<<<<<<<<<
- * c = 0.0
- * for i from 1 <= i < n:
- */
- __pyx_v_sum = (__pyx_v_darr[0]);
-
- /* "mtrand.pyx":517
- * cdef npy_intp i
- * sum = darr[0]
- * c = 0.0 # <<<<<<<<<<<<<<
- * for i from 1 <= i < n:
- * y = darr[i] - c
- */
- __pyx_v_c = 0.0;
-
- /* "mtrand.pyx":518
- * sum = darr[0]
- * c = 0.0
- * for i from 1 <= i < n: # <<<<<<<<<<<<<<
- * y = darr[i] - c
- * t = sum + y
- */
- __pyx_t_1 = __pyx_v_n;
- for (__pyx_v_i = 1; __pyx_v_i < __pyx_t_1; __pyx_v_i++) {
-
- /* "mtrand.pyx":519
- * c = 0.0
- * for i from 1 <= i < n:
- * y = darr[i] - c # <<<<<<<<<<<<<<
- * t = sum + y
- * c = (t-sum) - y
- */
- __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c);
-
- /* "mtrand.pyx":520
- * for i from 1 <= i < n:
- * y = darr[i] - c
- * t = sum + y # <<<<<<<<<<<<<<
- * c = (t-sum) - y
- * sum = t
- */
- __pyx_v_t = (__pyx_v_sum + __pyx_v_y);
-
- /* "mtrand.pyx":521
- * y = darr[i] - c
- * t = sum + y
- * c = (t-sum) - y # <<<<<<<<<<<<<<
- * sum = t
- * return sum
- */
- __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y);
-
- /* "mtrand.pyx":522
- * t = sum + y
- * c = (t-sum) - y
- * sum = t # <<<<<<<<<<<<<<
- * return sum
- *
- */
- __pyx_v_sum = __pyx_v_t;
- }
-
- /* "mtrand.pyx":523
- * c = (t-sum) - y
- * sum = t
- * return sum # <<<<<<<<<<<<<<
- *
- * cdef class RandomState:
- */
- __pyx_r = __pyx_v_sum;
- goto __pyx_L0;
-
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_pw_6mtrand_11RandomState_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_6mtrand_11RandomState_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_seed = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seed,0};
- PyObject* values[1] = {0};
-
- /* "mtrand.pyx":561
- * poisson_lam_max = np.iinfo('l').max - np.sqrt(np.iinfo('l').max)*10
- *
- * def __init__(self, seed=None): # <<<<<<<<<<<<<<
- * self.internal_state = <rk_state*>PyMem_Malloc(sizeof(rk_state))
- *
- */
- values[0] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seed);
- if (value) { values[0] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_seed = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return -1;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState___init__(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_seed);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_pf_6mtrand_11RandomState___init__(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_seed) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "mtrand.pyx":562
- *
- * def __init__(self, seed=None):
- * self.internal_state = <rk_state*>PyMem_Malloc(sizeof(rk_state)) # <<<<<<<<<<<<<<
- *
- * self.seed(seed)
- */
- __pyx_v_self->internal_state = ((rk_state *)PyMem_Malloc((sizeof(rk_state))));
-
- /* "mtrand.pyx":564
- * self.internal_state = <rk_state*>PyMem_Malloc(sizeof(rk_state))
- *
- * self.seed(seed) # <<<<<<<<<<<<<<
- *
- * def __dealloc__(self):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__seed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_seed);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seed);
- __Pyx_GIVEREF(__pyx_v_seed);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("mtrand.RandomState.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static void __pyx_pw_6mtrand_11RandomState_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_pw_6mtrand_11RandomState_3__dealloc__(PyObject *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_pf_6mtrand_11RandomState_2__dealloc__(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
-}
-
-/* "mtrand.pyx":566
- * self.seed(seed)
- *
- * def __dealloc__(self): # <<<<<<<<<<<<<<
- * if self.internal_state != NULL:
- * PyMem_Free(self.internal_state)
- */
-
-static void __pyx_pf_6mtrand_11RandomState_2__dealloc__(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("__dealloc__", 0);
-
- /* "mtrand.pyx":567
- *
- * def __dealloc__(self):
- * if self.internal_state != NULL: # <<<<<<<<<<<<<<
- * PyMem_Free(self.internal_state)
- * self.internal_state = NULL
- */
- __pyx_t_1 = (__pyx_v_self->internal_state != NULL);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":568
- * def __dealloc__(self):
- * if self.internal_state != NULL:
- * PyMem_Free(self.internal_state) # <<<<<<<<<<<<<<
- * self.internal_state = NULL
- *
- */
- PyMem_Free(__pyx_v_self->internal_state);
-
- /* "mtrand.pyx":569
- * if self.internal_state != NULL:
- * PyMem_Free(self.internal_state)
- * self.internal_state = NULL # <<<<<<<<<<<<<<
- *
- * def seed(self, seed=None):
- */
- __pyx_v_self->internal_state = NULL;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_5seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_4seed[] = "\n seed(seed=None)\n\n Seed the generator.\n\n This method is called when `RandomState` is initialized. It can be\n called again to re-seed the generator. For details, see `RandomState`.\n\n Parameters\n ----------\n seed : int or array_like, optional\n Seed for `RandomState`.\n\n See Also\n --------\n RandomState\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_5seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_seed = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("seed (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__seed,0};
- PyObject* values[1] = {0};
-
- /* "mtrand.pyx":571
- * self.internal_state = NULL
- *
- * def seed(self, seed=None): # <<<<<<<<<<<<<<
- * """
- * seed(seed=None)
- */
- values[0] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__seed);
- if (value) { values[0] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "seed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_seed = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("seed", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.seed", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_4seed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_seed);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_4seed(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_seed) {
- CYTHON_UNUSED rk_error __pyx_v_errcode;
- PyArrayObject *arrayObject_obj = 0;
- PyObject *__pyx_v_iseed = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- unsigned long __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("seed", 0);
-
- /* "mtrand.pyx":592
- * cdef rk_error errcode
- * cdef ndarray obj "arrayObject_obj"
- * if seed is None: # <<<<<<<<<<<<<<
- * errcode = rk_randomseed(self.internal_state)
- * elif type(seed) is int:
- */
- __pyx_t_1 = (__pyx_v_seed == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":593
- * cdef ndarray obj "arrayObject_obj"
- * if seed is None:
- * errcode = rk_randomseed(self.internal_state) # <<<<<<<<<<<<<<
- * elif type(seed) is int:
- * rk_seed(seed, self.internal_state)
- */
- __pyx_v_errcode = rk_randomseed(__pyx_v_self->internal_state);
- goto __pyx_L3;
- }
-
- /* "mtrand.pyx":594
- * if seed is None:
- * errcode = rk_randomseed(self.internal_state)
- * elif type(seed) is int: # <<<<<<<<<<<<<<
- * rk_seed(seed, self.internal_state)
- * elif isinstance(seed, np.integer):
- */
- __pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_seed)) == ((PyObject *)((PyObject*)(&PyInt_Type))));
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":595
- * errcode = rk_randomseed(self.internal_state)
- * elif type(seed) is int:
- * rk_seed(seed, self.internal_state) # <<<<<<<<<<<<<<
- * elif isinstance(seed, np.integer):
- * iseed = int(seed)
- */
- __pyx_t_2 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_seed); if (unlikely((__pyx_t_2 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- rk_seed(__pyx_t_2, __pyx_v_self->internal_state);
- goto __pyx_L3;
- }
-
- /* "mtrand.pyx":596
- * elif type(seed) is int:
- * rk_seed(seed, self.internal_state)
- * elif isinstance(seed, np.integer): # <<<<<<<<<<<<<<
- * iseed = int(seed)
- * rk_seed(iseed, self.internal_state)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__integer); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_1 = PyObject_IsInstance(__pyx_v_seed, __pyx_t_4); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":597
- * rk_seed(seed, self.internal_state)
- * elif isinstance(seed, np.integer):
- * iseed = int(seed) # <<<<<<<<<<<<<<
- * rk_seed(iseed, self.internal_state)
- * else:
- */
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_seed);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_seed);
- __Pyx_GIVEREF(__pyx_v_seed);
- __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_v_iseed = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":598
- * elif isinstance(seed, np.integer):
- * iseed = int(seed)
- * rk_seed(iseed, self.internal_state) # <<<<<<<<<<<<<<
- * else:
- * obj = <ndarray>PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1)
- */
- __pyx_t_2 = __Pyx_PyInt_AsUnsignedLong(__pyx_v_iseed); if (unlikely((__pyx_t_2 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- rk_seed(__pyx_t_2, __pyx_v_self->internal_state);
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":600
- * rk_seed(iseed, self.internal_state)
- * else:
- * obj = <ndarray>PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1) # <<<<<<<<<<<<<<
- * init_by_array(self.internal_state, <unsigned long *>PyArray_DATA(obj),
- * PyArray_DIM(obj, 0))
- */
- __pyx_t_3 = PyArray_ContiguousFromObject(__pyx_v_seed, NPY_LONG, 1, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- arrayObject_obj = ((PyArrayObject *)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":602
- * obj = <ndarray>PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1)
- * init_by_array(self.internal_state, <unsigned long *>PyArray_DATA(obj),
- * PyArray_DIM(obj, 0)) # <<<<<<<<<<<<<<
- *
- * def get_state(self):
- */
- init_by_array(__pyx_v_self->internal_state, ((unsigned long *)PyArray_DATA(arrayObject_obj)), PyArray_DIM(arrayObject_obj, 0));
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.RandomState.seed", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject_obj);
- __Pyx_XDECREF(__pyx_v_iseed);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_7get_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_6get_state[] = "\n get_state()\n\n Return a tuple representing the internal state of the generator.\n\n For more details, see `set_state`.\n\n Returns\n -------\n out : tuple(str, ndarray of 624 uints, int, int, float)\n The returned tuple has the following items:\n\n 1. the string 'MT19937'.\n 2. a 1-D array of 624 unsigned integer keys.\n 3. an integer ``pos``.\n 4. an integer ``has_gauss``.\n 5. a float ``cached_gaussian``.\n\n See Also\n --------\n set_state\n\n Notes\n -----\n `set_state` and `get_state` are not needed to work with any of the\n random distributions in NumPy. If the internal state is manually altered,\n the user should know exactly what he/she is doing.\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_7get_state(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("get_state (wrapper)", 0);
- __pyx_r = __pyx_pf_6mtrand_11RandomState_6get_state(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":604
- * PyArray_DIM(obj, 0))
- *
- * def get_state(self): # <<<<<<<<<<<<<<
- * """
- * get_state()
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_6get_state(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self) {
- PyArrayObject *arrayObject_state = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_state", 0);
-
- /* "mtrand.pyx":635
- * """
- * cdef ndarray state "arrayObject_state"
- * state = <ndarray>np.empty(624, np.uint) # <<<<<<<<<<<<<<
- * memcpy(<void*>PyArray_DATA(state), <void*>(self.internal_state.key), 624*sizeof(long))
- * state = <ndarray>np.asarray(state, np.uint32)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__empty); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__uint); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_int_624);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_624);
- __Pyx_GIVEREF(__pyx_int_624);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- arrayObject_state = ((PyArrayObject *)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "mtrand.pyx":636
- * cdef ndarray state "arrayObject_state"
- * state = <ndarray>np.empty(624, np.uint)
- * memcpy(<void*>PyArray_DATA(state), <void*>(self.internal_state.key), 624*sizeof(long)) # <<<<<<<<<<<<<<
- * state = <ndarray>np.asarray(state, np.uint32)
- * return ('MT19937', state, self.internal_state.pos,
- */
- memcpy(((void *)PyArray_DATA(arrayObject_state)), ((void *)__pyx_v_self->internal_state->key), (624 * (sizeof(long))));
-
- /* "mtrand.pyx":637
- * state = <ndarray>np.empty(624, np.uint)
- * memcpy(<void*>PyArray_DATA(state), <void*>(self.internal_state.key), 624*sizeof(long))
- * state = <ndarray>np.asarray(state, np.uint32) # <<<<<<<<<<<<<<
- * return ('MT19937', state, self.internal_state.pos,
- * self.internal_state.has_gauss, self.internal_state.gauss)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__asarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__uint32); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(((PyObject *)arrayObject_state));
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)arrayObject_state));
- __Pyx_GIVEREF(((PyObject *)arrayObject_state));
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)arrayObject_state));
- arrayObject_state = ((PyArrayObject *)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "mtrand.pyx":638
- * memcpy(<void*>PyArray_DATA(state), <void*>(self.internal_state.key), 624*sizeof(long))
- * state = <ndarray>np.asarray(state, np.uint32)
- * return ('MT19937', state, self.internal_state.pos, # <<<<<<<<<<<<<<
- * self.internal_state.has_gauss, self.internal_state.gauss)
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_self->internal_state->pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "mtrand.pyx":639
- * state = <ndarray>np.asarray(state, np.uint32)
- * return ('MT19937', state, self.internal_state.pos,
- * self.internal_state.has_gauss, self.internal_state.gauss) # <<<<<<<<<<<<<<
- *
- * def set_state(self, state):
- */
- __pyx_t_2 = PyInt_FromLong(__pyx_v_self->internal_state->has_gauss); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->internal_state->gauss); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 639; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_n_s__MT19937));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_n_s__MT19937));
- __Pyx_GIVEREF(((PyObject *)__pyx_n_s__MT19937));
- __Pyx_INCREF(((PyObject *)arrayObject_state));
- PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)arrayObject_state));
- __Pyx_GIVEREF(((PyObject *)arrayObject_state));
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- __pyx_r = ((PyObject *)__pyx_t_4);
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.RandomState.get_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject_state);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_9set_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_8set_state[] = "\n set_state(state)\n\n Set the internal state of the generator from a tuple.\n\n For use if one has reason to manually (re-)set the internal state of the\n \"Mersenne Twister\"[1]_ pseudo-random number generating algorithm.\n\n Parameters\n ----------\n state : tuple(str, ndarray of 624 uints, int, int, float)\n The `state` tuple has the following items:\n\n 1. the string 'MT19937', specifying the Mersenne Twister algorithm.\n 2. a 1-D array of 624 unsigned integers ``keys``.\n 3. an integer ``pos``.\n 4. an integer ``has_gauss``.\n 5. a float ``cached_gaussian``.\n\n Returns\n -------\n out : None\n Returns 'None' on success.\n\n See Also\n --------\n get_state\n\n Notes\n -----\n `set_state` and `get_state` are not needed to work with any of the\n random distributions in NumPy. If the internal state is manually altered,\n the user should know exactly what he/she is doing.\n\n For backwards compatibility, the form (str, array of 624 uints, int) is\n also accepted although it is missing some information about the cached\n Gaussian value: ``state = ('MT19937', keys, pos)``.\n\n References\n ----------\n .. [1] M. Matsumoto and T. Nishimura, \"Mersenne Twister: A\n 623-dimensionally equidistributed uniform pseudorandom number\n generator,\" *ACM Trans. on Modeling and Computer Simulation*,\n Vol. 8, No. 1, pp. 3-30, Jan. 1998.\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_9set_state(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("set_state (wrapper)", 0);
- __pyx_r = __pyx_pf_6mtrand_11RandomState_8set_state(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), ((PyObject *)__pyx_v_state));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":641
- * self.internal_state.has_gauss, self.internal_state.gauss)
- *
- * def set_state(self, state): # <<<<<<<<<<<<<<
- * """
- * set_state(state)
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_8set_state(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_state) {
- PyArrayObject *arrayObject_obj = 0;
- int __pyx_v_pos;
- PyObject *__pyx_v_algorithm_name = NULL;
- PyObject *__pyx_v_key = NULL;
- PyObject *__pyx_v_has_gauss = NULL;
- PyObject *__pyx_v_cached_gaussian = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *(*__pyx_t_6)(PyObject *);
- int __pyx_t_7;
- Py_ssize_t __pyx_t_8;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- PyObject *__pyx_t_11 = NULL;
- PyObject *__pyx_t_12 = NULL;
- double __pyx_t_13;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("set_state", 0);
-
- /* "mtrand.pyx":690
- * cdef ndarray obj "arrayObject_obj"
- * cdef int pos
- * algorithm_name = state[0] # <<<<<<<<<<<<<<
- * if algorithm_name != 'MT19937':
- * raise ValueError("algorithm must be 'MT19937'")
- */
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_state, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_algorithm_name = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "mtrand.pyx":691
- * cdef int pos
- * algorithm_name = state[0]
- * if algorithm_name != 'MT19937': # <<<<<<<<<<<<<<
- * raise ValueError("algorithm must be 'MT19937'")
- * key, pos = state[1:3]
- */
- __pyx_t_1 = PyObject_RichCompare(__pyx_v_algorithm_name, ((PyObject *)__pyx_n_s__MT19937), Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_2) {
-
- /* "mtrand.pyx":692
- * algorithm_name = state[0]
- * if algorithm_name != 'MT19937':
- * raise ValueError("algorithm must be 'MT19937'") # <<<<<<<<<<<<<<
- * key, pos = state[1:3]
- * if len(state) == 3:
- */
- __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_Raise(__pyx_t_1, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":693
- * if algorithm_name != 'MT19937':
- * raise ValueError("algorithm must be 'MT19937'")
- * key, pos = state[1:3] # <<<<<<<<<<<<<<
- * if len(state) == 3:
- * has_gauss = 0
- */
- __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_state, 1, 3, NULL, NULL, &__pyx_k_slice_11, 1, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
- PyObject* sequence = __pyx_t_1;
- #if CYTHON_COMPILING_IN_CPYTHON
- Py_ssize_t size = Py_SIZE(sequence);
- #else
- Py_ssize_t size = PySequence_Size(sequence);
- #endif
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_4);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- {
- Py_ssize_t index = -1;
- __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = NULL;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L5_unpacking_done;
- __pyx_L4_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L5_unpacking_done:;
- }
- __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_4); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_key = __pyx_t_3;
- __pyx_t_3 = 0;
- __pyx_v_pos = __pyx_t_7;
-
- /* "mtrand.pyx":694
- * raise ValueError("algorithm must be 'MT19937'")
- * key, pos = state[1:3]
- * if len(state) == 3: # <<<<<<<<<<<<<<
- * has_gauss = 0
- * cached_gaussian = 0.0
- */
- __pyx_t_8 = PyObject_Length(__pyx_v_state); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = (__pyx_t_8 == 3);
- if (__pyx_t_2) {
-
- /* "mtrand.pyx":695
- * key, pos = state[1:3]
- * if len(state) == 3:
- * has_gauss = 0 # <<<<<<<<<<<<<<
- * cached_gaussian = 0.0
- * else:
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_v_has_gauss = __pyx_int_0;
-
- /* "mtrand.pyx":696
- * if len(state) == 3:
- * has_gauss = 0
- * cached_gaussian = 0.0 # <<<<<<<<<<<<<<
- * else:
- * has_gauss, cached_gaussian = state[3:5]
- */
- __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_cached_gaussian = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "mtrand.pyx":698
- * cached_gaussian = 0.0
- * else:
- * has_gauss, cached_gaussian = state[3:5] # <<<<<<<<<<<<<<
- * try:
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1)
- */
- __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_v_state, 3, 5, NULL, NULL, &__pyx_k_slice_12, 1, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
- PyObject* sequence = __pyx_t_1;
- #if CYTHON_COMPILING_IN_CPYTHON
- Py_ssize_t size = Py_SIZE(sequence);
- #else
- Py_ssize_t size = PySequence_Size(sequence);
- #endif
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_3);
- #else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else
- {
- Py_ssize_t index = -1;
- __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
- index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = NULL;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L8_unpacking_done;
- __pyx_L7_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L8_unpacking_done:;
- }
- __pyx_v_has_gauss = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_v_cached_gaussian = __pyx_t_3;
- __pyx_t_3 = 0;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":699
- * else:
- * has_gauss, cached_gaussian = state[3:5]
- * try: # <<<<<<<<<<<<<<
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1)
- * except TypeError:
- */
- {
- __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
- __Pyx_XGOTREF(__pyx_t_9);
- __Pyx_XGOTREF(__pyx_t_10);
- __Pyx_XGOTREF(__pyx_t_11);
- /*try:*/ {
-
- /* "mtrand.pyx":700
- * has_gauss, cached_gaussian = state[3:5]
- * try:
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1) # <<<<<<<<<<<<<<
- * except TypeError:
- * # compatibility -- could be an older pickle
- */
- __pyx_t_1 = PyArray_ContiguousFromObject(__pyx_v_key, NPY_ULONG, 1, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L9_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __pyx_t_1;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- arrayObject_obj = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
- }
- __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
- goto __pyx_L16_try_end;
- __pyx_L9_error:;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "mtrand.pyx":701
- * try:
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1)
- * except TypeError: # <<<<<<<<<<<<<<
- * # compatibility -- could be an older pickle
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1)
- */
- __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
- if (__pyx_t_7) {
- __Pyx_AddTraceback("mtrand.RandomState.set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_4);
-
- /* "mtrand.pyx":703
- * except TypeError:
- * # compatibility -- could be an older pickle
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1) # <<<<<<<<<<<<<<
- * if PyArray_DIM(obj, 0) != 624:
- * raise ValueError("state must be 624 longs")
- */
- __pyx_t_5 = PyArray_ContiguousFromObject(__pyx_v_key, NPY_LONG, 1, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L11_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_12 = __pyx_t_5;
- __Pyx_INCREF(__pyx_t_12);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_XDECREF(((PyObject *)arrayObject_obj));
- arrayObject_obj = ((PyArrayObject *)__pyx_t_12);
- __pyx_t_12 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L10_exception_handled;
- }
- __pyx_L11_except_error:;
- __Pyx_XGIVEREF(__pyx_t_9);
- __Pyx_XGIVEREF(__pyx_t_10);
- __Pyx_XGIVEREF(__pyx_t_11);
- __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
- goto __pyx_L1_error;
- __pyx_L10_exception_handled:;
- __Pyx_XGIVEREF(__pyx_t_9);
- __Pyx_XGIVEREF(__pyx_t_10);
- __Pyx_XGIVEREF(__pyx_t_11);
- __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
- __pyx_L16_try_end:;
- }
-
- /* "mtrand.pyx":704
- * # compatibility -- could be an older pickle
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1)
- * if PyArray_DIM(obj, 0) != 624: # <<<<<<<<<<<<<<
- * raise ValueError("state must be 624 longs")
- * memcpy(<void*>(self.internal_state.key), <void*>PyArray_DATA(obj), 624*sizeof(long))
- */
- __pyx_t_2 = (PyArray_DIM(arrayObject_obj, 0) != 624);
- if (__pyx_t_2) {
-
- /* "mtrand.pyx":705
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1)
- * if PyArray_DIM(obj, 0) != 624:
- * raise ValueError("state must be 624 longs") # <<<<<<<<<<<<<<
- * memcpy(<void*>(self.internal_state.key), <void*>PyArray_DATA(obj), 624*sizeof(long))
- * self.internal_state.pos = pos
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L19;
- }
- __pyx_L19:;
-
- /* "mtrand.pyx":706
- * if PyArray_DIM(obj, 0) != 624:
- * raise ValueError("state must be 624 longs")
- * memcpy(<void*>(self.internal_state.key), <void*>PyArray_DATA(obj), 624*sizeof(long)) # <<<<<<<<<<<<<<
- * self.internal_state.pos = pos
- * self.internal_state.has_gauss = has_gauss
- */
- memcpy(((void *)__pyx_v_self->internal_state->key), ((void *)PyArray_DATA(arrayObject_obj)), (624 * (sizeof(long))));
-
- /* "mtrand.pyx":707
- * raise ValueError("state must be 624 longs")
- * memcpy(<void*>(self.internal_state.key), <void*>PyArray_DATA(obj), 624*sizeof(long))
- * self.internal_state.pos = pos # <<<<<<<<<<<<<<
- * self.internal_state.has_gauss = has_gauss
- * self.internal_state.gauss = cached_gaussian
- */
- __pyx_v_self->internal_state->pos = __pyx_v_pos;
-
- /* "mtrand.pyx":708
- * memcpy(<void*>(self.internal_state.key), <void*>PyArray_DATA(obj), 624*sizeof(long))
- * self.internal_state.pos = pos
- * self.internal_state.has_gauss = has_gauss # <<<<<<<<<<<<<<
- * self.internal_state.gauss = cached_gaussian
- *
- */
- __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_has_gauss); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->internal_state->has_gauss = __pyx_t_7;
-
- /* "mtrand.pyx":709
- * self.internal_state.pos = pos
- * self.internal_state.has_gauss = has_gauss
- * self.internal_state.gauss = cached_gaussian # <<<<<<<<<<<<<<
- *
- * # Pickling support:
- */
- __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_v_cached_gaussian); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->internal_state->gauss = __pyx_t_13;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_12);
- __Pyx_AddTraceback("mtrand.RandomState.set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject_obj);
- __Pyx_XDECREF(__pyx_v_algorithm_name);
- __Pyx_XDECREF(__pyx_v_key);
- __Pyx_XDECREF(__pyx_v_has_gauss);
- __Pyx_XDECREF(__pyx_v_cached_gaussian);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_11__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_6mtrand_11RandomState_11__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
- __pyx_r = __pyx_pf_6mtrand_11RandomState_10__getstate__(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":712
- *
- * # Pickling support:
- * def __getstate__(self): # <<<<<<<<<<<<<<
- * return self.get_state()
- *
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_10__getstate__(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getstate__", 0);
-
- /* "mtrand.pyx":713
- * # Pickling support:
- * def __getstate__(self):
- * return self.get_state() # <<<<<<<<<<<<<<
- *
- * def __setstate__(self, state):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__get_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("mtrand.RandomState.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_13__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
-static PyObject *__pyx_pw_6mtrand_11RandomState_13__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
- __pyx_r = __pyx_pf_6mtrand_11RandomState_12__setstate__(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), ((PyObject *)__pyx_v_state));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":715
- * return self.get_state()
- *
- * def __setstate__(self, state): # <<<<<<<<<<<<<<
- * self.set_state(state)
- *
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_12__setstate__(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_state) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__setstate__", 0);
-
- /* "mtrand.pyx":716
- *
- * def __setstate__(self, state):
- * self.set_state(state) # <<<<<<<<<<<<<<
- *
- * def __reduce__(self):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__set_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_state);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_state);
- __Pyx_GIVEREF(__pyx_v_state);
- __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("mtrand.RandomState.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_15__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_pw_6mtrand_11RandomState_15__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
- __pyx_r = __pyx_pf_6mtrand_11RandomState_14__reduce__(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":718
- * self.set_state(state)
- *
- * def __reduce__(self): # <<<<<<<<<<<<<<
- * return (np.random.__RandomState_ctor, (), self.get_state())
- *
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_14__reduce__(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__reduce__", 0);
-
- /* "mtrand.pyx":719
- *
- * def __reduce__(self):
- * return (np.random.__RandomState_ctor, (), self.get_state()) # <<<<<<<<<<<<<<
- *
- * # Basic distributions:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__random); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____RandomState_ctor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__get_state); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __Pyx_INCREF(((PyObject *)__pyx_empty_tuple));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_empty_tuple));
- __Pyx_GIVEREF(((PyObject *)__pyx_empty_tuple));
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_1 = 0;
- __pyx_t_3 = 0;
- __pyx_r = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("mtrand.RandomState.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_17random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_16random_sample[] = "\n random_sample(size=None)\n\n Return random floats in the half-open interval [0.0, 1.0).\n\n Results are from the \"continuous uniform\" distribution over the\n stated interval. To sample :math:`Unif[a, b), b > a` multiply\n the output of `random_sample` by `(b-a)` and add `a`::\n\n (b - a) * random_sample() + a\n\n Parameters\n ----------\n size : int or tuple of ints, optional\n Defines the shape of the returned array of random floats. If None\n (the default), returns a single float.\n\n Returns\n -------\n out : float or ndarray of floats\n Array of random floats of shape `size` (unless ``size=None``, in which\n case a single float is returned).\n\n Examples\n --------\n >>> np.random.random_sample()\n 0.47108547995356098\n >>> type(np.random.random_sample())\n <type 'float'>\n >>> np.random.random_sample((5,))\n array([ 0.30220482, 0.86820401, 0.1654503 , 0.11659149, 0.54323428])\n\n Three-by-two array of random numbers from [-5, 0):\n\n >>> 5 * np.random.random_sample((3, 2)) - 5\n array([[-3.99149989, -0.52338984],\n [-2.99091858, -0.79479508],\n [-1.23204345, -1.75224494]])\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_17random_sample(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("random_sample (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0};
- PyObject* values[1] = {0};
-
- /* "mtrand.pyx":722
- *
- * # Basic distributions:
- * def random_sample(self, size=None): # <<<<<<<<<<<<<<
- * """
- * random_sample(size=None)
- */
- values[0] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[0] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "random_sample") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_size = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("random_sample", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.random_sample", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_16random_sample(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_16random_sample(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_size) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("random_sample", 0);
-
- /* "mtrand.pyx":763
- *
- * """
- * return cont0_array(self.internal_state, rk_double, size) # <<<<<<<<<<<<<<
- *
- * def tomaxint(self, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_6mtrand_cont0_array(__pyx_v_self->internal_state, rk_double, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 763; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("mtrand.RandomState.random_sample", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_19tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_18tomaxint[] = "\n tomaxint(size=None)\n\n Random integers between 0 and ``sys.maxint``, inclusive.\n\n Return a sample of uniformly distributed random integers in the interval\n [0, ``sys.maxint``].\n\n Parameters\n ----------\n size : tuple of ints, int, optional\n Shape of output. If this is, for example, (m,n,k), m*n*k samples\n are generated. If no shape is specified, a single sample is\n returned.\n\n Returns\n -------\n out : ndarray\n Drawn samples, with shape `size`.\n\n See Also\n --------\n randint : Uniform sampling over a given half-open interval of integers.\n random_integers : Uniform sampling over a given closed interval of\n integers.\n\n Examples\n --------\n >>> RS = np.random.mtrand.RandomState() # need a RandomState object\n >>> RS.tomaxint((2,2,2))\n array([[[1170048599, 1600360186],\n [ 739731006, 1947757578]],\n [[1871712945, 752307660],\n [1601631370, 1479324245]]])\n >>> import sys\n >>> sys.maxint\n 2147483647\n >>> RS.tomaxint((2,2,2)) < sys.maxint\n array([[[ True, True],\n [ True, True]],\n [[ True, True],\n [ True, True]]], dtype=bool)\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_19tomaxint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("tomaxint (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0};
- PyObject* values[1] = {0};
-
- /* "mtrand.pyx":765
- * return cont0_array(self.internal_state, rk_double, size)
- *
- * def tomaxint(self, size=None): # <<<<<<<<<<<<<<
- * """
- * tomaxint(size=None)
- */
- values[0] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[0] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tomaxint") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_size = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("tomaxint", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.tomaxint", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_18tomaxint(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_18tomaxint(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_size) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("tomaxint", 0);
-
- /* "mtrand.pyx":810
- *
- * """
- * return disc0_array(self.internal_state, rk_long, size) # <<<<<<<<<<<<<<
- *
- * def randint(self, low, high=None, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_6mtrand_disc0_array(__pyx_v_self->internal_state, rk_long, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("mtrand.RandomState.tomaxint", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_21randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_20randint[] = "\n randint(low, high=None, size=None)\n\n Return random integers from `low` (inclusive) to `high` (exclusive).\n\n Return random integers from the \"discrete uniform\" distribution in the\n \"half-open\" interval [`low`, `high`). If `high` is None (the default),\n then results are from [0, `low`).\n\n Parameters\n ----------\n low : int\n Lowest (signed) integer to be drawn from the distribution (unless\n ``high=None``, in which case this parameter is the *highest* such\n integer).\n high : int, optional\n If provided, one above the largest (signed) integer to be drawn\n from the distribution (see above for behavior if ``high=None``).\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single int is\n returned.\n\n Returns\n -------\n out : int or ndarray of ints\n `size`-shaped array of random integers from the appropriate\n distribution, or a single such random int if `size` not provided.\n\n See Also\n --------\n random.random_integers : similar to `randint`, only for the closed\n interval [`low`, `high`], and 1 is the lowest value if `high` is\n omitted. In particular, this other one is the one to use to generate\n uniformly distributed discrete non-integers.\n\n Examples\n --------\n >>> np.random.randint(2, size=10)\n array([1, 0, 0, 0, 1, 1, 0, 0, 1, 0])\n >>> np.random.randint(1, size=10)\n array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0])\n\n Generate a 2 x 4 array of ints between 0 and 4, inclusive:\n\n >>> np.random.randint(5, size=(2, 4))\n array([[4, 0, 2, 1],\n [3, 2, 2, 0]])\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_21randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_low = 0;
- PyObject *__pyx_v_high = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("randint (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__low,&__pyx_n_s__high,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
-
- /* "mtrand.pyx":812
- * return disc0_array(self.internal_state, rk_long, size)
- *
- * def randint(self, low, high=None, size=None): # <<<<<<<<<<<<<<
- * """
- * randint(low, high=None, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high);
- if (value) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "randint") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_low = values[0];
- __pyx_v_high = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("randint", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.randint", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_20randint(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_low, __pyx_v_high, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_20randint(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_low, PyObject *__pyx_v_high, PyObject *__pyx_v_size) {
- long __pyx_v_lo;
- long __pyx_v_hi;
- long __pyx_v_rv;
- unsigned long __pyx_v_diff;
- long *__pyx_v_array_data;
- PyArrayObject *arrayObject = 0;
- npy_intp __pyx_v_length;
- npy_intp __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- long __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- npy_intp __pyx_t_6;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("randint", 0);
-
- /* "mtrand.pyx":869
- * cdef npy_intp i
- *
- * if high is None: # <<<<<<<<<<<<<<
- * lo = 0
- * hi = low
- */
- __pyx_t_1 = (__pyx_v_high == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":870
- *
- * if high is None:
- * lo = 0 # <<<<<<<<<<<<<<
- * hi = low
- * else:
- */
- __pyx_v_lo = 0;
-
- /* "mtrand.pyx":871
- * if high is None:
- * lo = 0
- * hi = low # <<<<<<<<<<<<<<
- * else:
- * lo = low
- */
- __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_v_low); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_hi = __pyx_t_2;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":873
- * hi = low
- * else:
- * lo = low # <<<<<<<<<<<<<<
- * hi = high
- *
- */
- __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_v_low); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_lo = __pyx_t_2;
-
- /* "mtrand.pyx":874
- * else:
- * lo = low
- * hi = high # <<<<<<<<<<<<<<
- *
- * if lo >= hi :
- */
- __pyx_t_2 = __Pyx_PyInt_AsLong(__pyx_v_high); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_hi = __pyx_t_2;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":876
- * hi = high
- *
- * if lo >= hi : # <<<<<<<<<<<<<<
- * raise ValueError("low >= high")
- *
- */
- __pyx_t_1 = (__pyx_v_lo >= __pyx_v_hi);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":877
- *
- * if lo >= hi :
- * raise ValueError("low >= high") # <<<<<<<<<<<<<<
- *
- * diff = <unsigned long>hi - <unsigned long>lo - 1UL
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":879
- * raise ValueError("low >= high")
- *
- * diff = <unsigned long>hi - <unsigned long>lo - 1UL # <<<<<<<<<<<<<<
- * if size is None:
- * rv = lo + <long>rk_interval(diff, self. internal_state)
- */
- __pyx_v_diff = ((((unsigned long)__pyx_v_hi) - ((unsigned long)__pyx_v_lo)) - 1UL);
-
- /* "mtrand.pyx":880
- *
- * diff = <unsigned long>hi - <unsigned long>lo - 1UL
- * if size is None: # <<<<<<<<<<<<<<
- * rv = lo + <long>rk_interval(diff, self. internal_state)
- * return rv
- */
- __pyx_t_1 = (__pyx_v_size == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":881
- * diff = <unsigned long>hi - <unsigned long>lo - 1UL
- * if size is None:
- * rv = lo + <long>rk_interval(diff, self. internal_state) # <<<<<<<<<<<<<<
- * return rv
- * else:
- */
- __pyx_v_rv = (__pyx_v_lo + ((long)rk_interval(__pyx_v_diff, __pyx_v_self->internal_state)));
-
- /* "mtrand.pyx":882
- * if size is None:
- * rv = lo + <long>rk_interval(diff, self. internal_state)
- * return rv # <<<<<<<<<<<<<<
- * else:
- * array = <ndarray>np.empty(size, int)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_rv); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "mtrand.pyx":884
- * return rv
- * else:
- * array = <ndarray>np.empty(size, int) # <<<<<<<<<<<<<<
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = __pyx_t_5;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- arrayObject = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":885
- * else:
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array) # <<<<<<<<<<<<<<
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- */
- __pyx_v_length = PyArray_SIZE(arrayObject);
-
- /* "mtrand.pyx":886
- * array = <ndarray>np.empty(size, int)
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array) # <<<<<<<<<<<<<<
- * for i from 0 <= i < length:
- * rv = lo + <long>rk_interval(diff, self. internal_state)
- */
- __pyx_v_array_data = ((long *)PyArray_DATA(arrayObject));
-
- /* "mtrand.pyx":887
- * length = PyArray_SIZE(array)
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length: # <<<<<<<<<<<<<<
- * rv = lo + <long>rk_interval(diff, self. internal_state)
- * array_data[i] = rv
- */
- __pyx_t_6 = __pyx_v_length;
- for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_6; __pyx_v_i++) {
-
- /* "mtrand.pyx":888
- * array_data = <long *>PyArray_DATA(array)
- * for i from 0 <= i < length:
- * rv = lo + <long>rk_interval(diff, self. internal_state) # <<<<<<<<<<<<<<
- * array_data[i] = rv
- * return array
- */
- __pyx_v_rv = (__pyx_v_lo + ((long)rk_interval(__pyx_v_diff, __pyx_v_self->internal_state)));
-
- /* "mtrand.pyx":889
- * for i from 0 <= i < length:
- * rv = lo + <long>rk_interval(diff, self. internal_state)
- * array_data[i] = rv # <<<<<<<<<<<<<<
- * return array
- *
- */
- (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_rv;
- }
-
- /* "mtrand.pyx":890
- * rv = lo + <long>rk_interval(diff, self. internal_state)
- * array_data[i] = rv
- * return array # <<<<<<<<<<<<<<
- *
- * def bytes(self, npy_intp length):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)arrayObject));
- __pyx_r = ((PyObject *)arrayObject);
- goto __pyx_L0;
- }
- __pyx_L5:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.randint", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_23bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_length); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_22bytes[] = "\n bytes(length)\n\n Return random bytes.\n\n Parameters\n ----------\n length : int\n Number of random bytes.\n\n Returns\n -------\n out : str\n String of length `length`.\n\n Examples\n --------\n >>> np.random.bytes(10)\n ' eh\\x85\\x022SZ\\xbf\\xa4' #random\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_23bytes(PyObject *__pyx_v_self, PyObject *__pyx_arg_length) {
- npy_intp __pyx_v_length;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("bytes (wrapper)", 0);
- assert(__pyx_arg_length); {
- __pyx_v_length = __Pyx_PyInt_from_py_npy_intp(__pyx_arg_length); if (unlikely((__pyx_v_length == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_22bytes(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), ((npy_intp)__pyx_v_length));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":892
- * return array
- *
- * def bytes(self, npy_intp length): # <<<<<<<<<<<<<<
- * """
- * bytes(length)
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_22bytes(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, npy_intp __pyx_v_length) {
- void *__pyx_v_bytes;
- PyObject *__pyx_v_bytestring = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("bytes", 0);
-
- /* "mtrand.pyx":915
- * """
- * cdef void *bytes
- * bytestring = empty_py_bytes(length, &bytes) # <<<<<<<<<<<<<<
- * rk_fill(bytes, length, self.internal_state)
- * return bytestring
- */
- __pyx_t_1 = empty_py_bytes(__pyx_v_length, (&__pyx_v_bytes)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_bytestring = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "mtrand.pyx":916
- * cdef void *bytes
- * bytestring = empty_py_bytes(length, &bytes)
- * rk_fill(bytes, length, self.internal_state) # <<<<<<<<<<<<<<
- * return bytestring
- *
- */
- rk_fill(__pyx_v_bytes, __pyx_v_length, __pyx_v_self->internal_state);
-
- /* "mtrand.pyx":917
- * bytestring = empty_py_bytes(length, &bytes)
- * rk_fill(bytes, length, self.internal_state)
- * return bytestring # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_bytestring);
- __pyx_r = __pyx_v_bytestring;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("mtrand.RandomState.bytes", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_bytestring);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_25choice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_24choice[] = "\n choice(a, size=None, replace=True, p=None)\n\n Generates a random sample from a given 1-D array\n\n .. versionadded:: 1.7.0\n\n Parameters\n -----------\n a : 1-D array-like or int\n If an ndarray, a random sample is generated from its elements.\n If an int, the random sample is generated as if a was np.arange(n)\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single value is\n returned.\n replace : boolean, optional\n Whether the sample is with or without replacement\n p : 1-D array-like, optional\n The probabilities associated with each entry in a.\n If not given the sample assumes a uniform distribtion over all\n entries in a.\n\n Returns\n --------\n samples : 1-D ndarray, shape (size,)\n The generated random samples\n\n Raises\n -------\n ValueError\n If a is an int and less than zero, if a or p are not 1-dimensional,\n if a is an array-like of size 0, if p is not a vector of\n probabilities, if a and p have different lengths, or if\n replace=False and the sample size is greater than the population\n size\n\n See Also\n ---------\n randint, shuffle, permutation\n\n Examples\n ---------\n Generate a uniform random sample from np.arange(5) of size 3:\n\n >>> np.random.choice(5, 3)\n array([0, 3, 4])\n >>> #This is equivalent to np.random.randint(0,5,3)\n\n Generate a non-uniform random sample from np.arange(5) of size 3:\n\n >>> np.random.choice(5, 3, p=[0.1, 0, 0.3, 0.6, 0])\n array([3, 3, 0])\n\n Generate a uniform random sample from np.arange(5) of size 3 without\n replacement:\n\n >>> np.random.choice(5, 3, replace=False)\n array([3,1,0])\n "" >>> #This is equivalent to np.random.shuffle(np.arange(5))[:3]\n\n Generate a non-uniform random sample from np.arange(5) of size\n 3 without replacement:\n\n >>> np.random.choice(5, 3, replace=False, p=[0.1, 0, 0.3, 0.6, 0])\n array([2, 3, 0])\n\n Any of the above can be repeated with an arbitrary array-like\n instead of just integers. For instance:\n\n >>> aa_milne_arr = ['pooh', 'rabbit', 'piglet', 'Christopher']\n >>> np.random.choice(aa_milne_arr, 5, p=[0.5, 0.1, 0.1, 0.3])\n array(['pooh', 'pooh', 'pooh', 'Christopher', 'piglet'],\n dtype='|S11')\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_25choice(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_a = 0;
- PyObject *__pyx_v_size = 0;
- PyObject *__pyx_v_replace = 0;
- PyObject *__pyx_v_p = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("choice (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__size,&__pyx_n_s__replace,&__pyx_n_s__p,0};
- PyObject* values[4] = {0,0,0,0};
-
- /* "mtrand.pyx":920
- *
- *
- * def choice(self, a, size=None, replace=True, p=None): # <<<<<<<<<<<<<<
- * """
- * choice(a, size=None, replace=True, p=None)
- */
- values[1] = ((PyObject *)Py_None);
- values[2] = __pyx_k_17;
- values[3] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__replace);
- if (value) { values[2] = value; kw_args--; }
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p);
- if (value) { values[3] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "choice") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_a = values[0];
- __pyx_v_size = values[1];
- __pyx_v_replace = values[2];
- __pyx_v_p = values[3];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("choice", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.choice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_24choice(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_a, __pyx_v_size, __pyx_v_replace, __pyx_v_p);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_24choice(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_size, PyObject *__pyx_v_replace, PyObject *__pyx_v_p) {
- PyObject *__pyx_v_pop_size = NULL;
- PyObject *__pyx_v_shape = NULL;
- PyObject *__pyx_v_cdf = NULL;
- PyObject *__pyx_v_uniform_samples = NULL;
- PyObject *__pyx_v_idx = NULL;
- PyObject *__pyx_v_n_uniq = NULL;
- PyObject *__pyx_v_found = NULL;
- PyObject *__pyx_v_flat_found = NULL;
- PyObject *__pyx_v_x = NULL;
- PyObject *__pyx_v_new = NULL;
- CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
- PyObject *__pyx_v_unique_indices = NULL;
- PyObject *__pyx_v_res = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
- int __pyx_t_11;
- PyObject *(*__pyx_t_12)(PyObject *);
- int __pyx_t_13;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("choice", 0);
- __Pyx_INCREF(__pyx_v_a);
- __Pyx_INCREF(__pyx_v_size);
- __Pyx_INCREF(__pyx_v_p);
-
- /* "mtrand.pyx":998
- *
- * # Format and Verify input
- * a = np.array(a, copy=False) # <<<<<<<<<<<<<<
- * if a.ndim == 0:
- * try:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_a);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_a);
- __Pyx_GIVEREF(__pyx_v_a);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_4 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__copy), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_v_a);
- __pyx_v_a = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":999
- * # Format and Verify input
- * a = np.array(a, copy=False)
- * if a.ndim == 0: # <<<<<<<<<<<<<<
- * try:
- * # __index__ must return an integer by python rules.
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s__ndim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_5) {
-
- /* "mtrand.pyx":1000
- * a = np.array(a, copy=False)
- * if a.ndim == 0:
- * try: # <<<<<<<<<<<<<<
- * # __index__ must return an integer by python rules.
- * pop_size = operator.index(a.item())
- */
- {
- __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
- __Pyx_XGOTREF(__pyx_t_6);
- __Pyx_XGOTREF(__pyx_t_7);
- __Pyx_XGOTREF(__pyx_t_8);
- /*try:*/ {
-
- /* "mtrand.pyx":1002
- * try:
- * # __index__ must return an integer by python rules.
- * pop_size = operator.index(a.item()) # <<<<<<<<<<<<<<
- * except TypeError:
- * raise ValueError("a must be 1-dimensional or an integer")
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__operator); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s__item); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_pop_size = __pyx_t_1;
- __pyx_t_1 = 0;
- }
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- goto __pyx_L11_try_end;
- __pyx_L4_error:;
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":1003
- * # __index__ must return an integer by python rules.
- * pop_size = operator.index(a.item())
- * except TypeError: # <<<<<<<<<<<<<<
- * raise ValueError("a must be 1-dimensional or an integer")
- * if pop_size <= 0:
- */
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
- if (__pyx_t_9) {
- __Pyx_AddTraceback("mtrand.RandomState.choice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_GOTREF(__pyx_t_4);
-
- /* "mtrand.pyx":1004
- * pop_size = operator.index(a.item())
- * except TypeError:
- * raise ValueError("a must be 1-dimensional or an integer") # <<<<<<<<<<<<<<
- * if pop_size <= 0:
- * raise ValueError("a must be greater than 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L5_exception_handled;
- }
- __pyx_L6_except_error:;
- __Pyx_XGIVEREF(__pyx_t_6);
- __Pyx_XGIVEREF(__pyx_t_7);
- __Pyx_XGIVEREF(__pyx_t_8);
- __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
- goto __pyx_L1_error;
- __pyx_L5_exception_handled:;
- __Pyx_XGIVEREF(__pyx_t_6);
- __Pyx_XGIVEREF(__pyx_t_7);
- __Pyx_XGIVEREF(__pyx_t_8);
- __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
- __pyx_L11_try_end:;
- }
-
- /* "mtrand.pyx":1005
- * except TypeError:
- * raise ValueError("a must be 1-dimensional or an integer")
- * if pop_size <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("a must be greater than 0")
- * elif a.ndim != 1:
- */
- __pyx_t_4 = PyObject_RichCompare(__pyx_v_pop_size, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_5) {
-
- /* "mtrand.pyx":1006
- * raise ValueError("a must be 1-dimensional or an integer")
- * if pop_size <= 0:
- * raise ValueError("a must be greater than 0") # <<<<<<<<<<<<<<
- * elif a.ndim != 1:
- * raise ValueError("a must be 1-dimensional")
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L14;
- }
- __pyx_L14:;
- goto __pyx_L3;
- }
-
- /* "mtrand.pyx":1007
- * if pop_size <= 0:
- * raise ValueError("a must be greater than 0")
- * elif a.ndim != 1: # <<<<<<<<<<<<<<
- * raise ValueError("a must be 1-dimensional")
- * else:
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s__ndim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_5) {
-
- /* "mtrand.pyx":1008
- * raise ValueError("a must be greater than 0")
- * elif a.ndim != 1:
- * raise ValueError("a must be 1-dimensional") # <<<<<<<<<<<<<<
- * else:
- * pop_size = a.shape[0]
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":1010
- * raise ValueError("a must be 1-dimensional")
- * else:
- * pop_size = a.shape[0] # <<<<<<<<<<<<<<
- * if pop_size is 0:
- * raise ValueError("a must be non-empty")
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_pop_size = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":1011
- * else:
- * pop_size = a.shape[0]
- * if pop_size is 0: # <<<<<<<<<<<<<<
- * raise ValueError("a must be non-empty")
- *
- */
- __pyx_t_5 = (__pyx_v_pop_size == __pyx_int_0);
- if (__pyx_t_5) {
-
- /* "mtrand.pyx":1012
- * pop_size = a.shape[0]
- * if pop_size is 0:
- * raise ValueError("a must be non-empty") # <<<<<<<<<<<<<<
- *
- * if None != p:
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L15;
- }
- __pyx_L15:;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":1014
- * raise ValueError("a must be non-empty")
- *
- * if None != p: # <<<<<<<<<<<<<<
- * p = np.array(p, dtype=np.double, ndmin=1, copy=False)
- * if p.ndim != 1:
- */
- __pyx_t_4 = PyObject_RichCompare(Py_None, __pyx_v_p, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_5) {
-
- /* "mtrand.pyx":1015
- *
- * if None != p:
- * p = np.array(p, dtype=np.double, ndmin=1, copy=False) # <<<<<<<<<<<<<<
- * if p.ndim != 1:
- * raise ValueError("p must be 1-dimensional")
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_p);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p);
- __Pyx_GIVEREF(__pyx_v_p);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__double); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__ndmin), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__copy), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_v_p);
- __pyx_v_p = __pyx_t_10;
- __pyx_t_10 = 0;
-
- /* "mtrand.pyx":1016
- * if None != p:
- * p = np.array(p, dtype=np.double, ndmin=1, copy=False)
- * if p.ndim != 1: # <<<<<<<<<<<<<<
- * raise ValueError("p must be 1-dimensional")
- * if p.size != pop_size:
- */
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s__ndim); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_10, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_5) {
-
- /* "mtrand.pyx":1017
- * p = np.array(p, dtype=np.double, ndmin=1, copy=False)
- * if p.ndim != 1:
- * raise ValueError("p must be 1-dimensional") # <<<<<<<<<<<<<<
- * if p.size != pop_size:
- * raise ValueError("a and p must have same size")
- */
- __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_Raise(__pyx_t_1, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L17;
- }
- __pyx_L17:;
-
- /* "mtrand.pyx":1018
- * if p.ndim != 1:
- * raise ValueError("p must be 1-dimensional")
- * if p.size != pop_size: # <<<<<<<<<<<<<<
- * raise ValueError("a and p must have same size")
- * if np.any(p < 0):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = PyObject_RichCompare(__pyx_t_1, __pyx_v_pop_size, Py_NE); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (__pyx_t_5) {
-
- /* "mtrand.pyx":1019
- * raise ValueError("p must be 1-dimensional")
- * if p.size != pop_size:
- * raise ValueError("a and p must have same size") # <<<<<<<<<<<<<<
- * if np.any(p < 0):
- * raise ValueError("probabilities are not non-negative")
- */
- __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L18;
- }
- __pyx_L18:;
-
- /* "mtrand.pyx":1020
- * if p.size != pop_size:
- * raise ValueError("a and p must have same size")
- * if np.any(p < 0): # <<<<<<<<<<<<<<
- * raise ValueError("probabilities are not non-negative")
- * if not np.allclose(p.sum(), 1):
- */
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__any); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_RichCompare(__pyx_v_p, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_10);
- __Pyx_GIVEREF(__pyx_t_10);
- __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (__pyx_t_5) {
-
- /* "mtrand.pyx":1021
- * raise ValueError("a and p must have same size")
- * if np.any(p < 0):
- * raise ValueError("probabilities are not non-negative") # <<<<<<<<<<<<<<
- * if not np.allclose(p.sum(), 1):
- * raise ValueError("probabilities do not sum to 1")
- */
- __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L19;
- }
- __pyx_L19:;
-
- /* "mtrand.pyx":1022
- * if np.any(p < 0):
- * raise ValueError("probabilities are not non-negative")
- * if not np.allclose(p.sum(), 1): # <<<<<<<<<<<<<<
- * raise ValueError("probabilities do not sum to 1")
- *
- */
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__allclose); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s__sum); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_1 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_10), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_11 = (!__pyx_t_5);
- if (__pyx_t_11) {
-
- /* "mtrand.pyx":1023
- * raise ValueError("probabilities are not non-negative")
- * if not np.allclose(p.sum(), 1):
- * raise ValueError("probabilities do not sum to 1") # <<<<<<<<<<<<<<
- *
- * shape = size
- */
- __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_33), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_Raise(__pyx_t_1, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L20;
- }
- __pyx_L20:;
- goto __pyx_L16;
- }
- __pyx_L16:;
-
- /* "mtrand.pyx":1025
- * raise ValueError("probabilities do not sum to 1")
- *
- * shape = size # <<<<<<<<<<<<<<
- * if shape is not None:
- * size = np.prod(shape, dtype=np.intp)
- */
- __Pyx_INCREF(__pyx_v_size);
- __pyx_v_shape = __pyx_v_size;
-
- /* "mtrand.pyx":1026
- *
- * shape = size
- * if shape is not None: # <<<<<<<<<<<<<<
- * size = np.prod(shape, dtype=np.intp)
- * else:
- */
- __pyx_t_11 = (__pyx_v_shape != Py_None);
- if (__pyx_t_11) {
-
- /* "mtrand.pyx":1027
- * shape = size
- * if shape is not None:
- * size = np.prod(shape, dtype=np.intp) # <<<<<<<<<<<<<<
- * else:
- * size = 1
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__prod); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__intp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_v_size);
- __pyx_v_size = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L21;
- }
- /*else*/ {
-
- /* "mtrand.pyx":1029
- * size = np.prod(shape, dtype=np.intp)
- * else:
- * size = 1 # <<<<<<<<<<<<<<
- *
- * # Actual sampling
- */
- __Pyx_INCREF(__pyx_int_1);
- __Pyx_DECREF(__pyx_v_size);
- __pyx_v_size = __pyx_int_1;
- }
- __pyx_L21:;
-
- /* "mtrand.pyx":1032
- *
- * # Actual sampling
- * if replace: # <<<<<<<<<<<<<<
- * if None != p:
- * cdf = p.cumsum()
- */
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_v_replace); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_11) {
-
- /* "mtrand.pyx":1033
- * # Actual sampling
- * if replace:
- * if None != p: # <<<<<<<<<<<<<<
- * cdf = p.cumsum()
- * cdf /= cdf[-1]
- */
- __pyx_t_2 = PyObject_RichCompare(Py_None, __pyx_v_p, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_11) {
-
- /* "mtrand.pyx":1034
- * if replace:
- * if None != p:
- * cdf = p.cumsum() # <<<<<<<<<<<<<<
- * cdf /= cdf[-1]
- * uniform_samples = self.random_sample(shape)
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s__cumsum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_cdf = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":1035
- * if None != p:
- * cdf = p.cumsum()
- * cdf /= cdf[-1] # <<<<<<<<<<<<<<
- * uniform_samples = self.random_sample(shape)
- * idx = cdf.searchsorted(uniform_samples, side='right')
- */
- __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_cdf, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_cdf, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_v_cdf);
- __pyx_v_cdf = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":1036
- * cdf = p.cumsum()
- * cdf /= cdf[-1]
- * uniform_samples = self.random_sample(shape) # <<<<<<<<<<<<<<
- * idx = cdf.searchsorted(uniform_samples, side='right')
- * idx = np.array(idx, copy=False) # searchsorted returns a scalar
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__random_sample); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_v_uniform_samples = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "mtrand.pyx":1037
- * cdf /= cdf[-1]
- * uniform_samples = self.random_sample(shape)
- * idx = cdf.searchsorted(uniform_samples, side='right') # <<<<<<<<<<<<<<
- * idx = np.array(idx, copy=False) # searchsorted returns a scalar
- * else:
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cdf, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_uniform_samples);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_uniform_samples);
- __Pyx_GIVEREF(__pyx_v_uniform_samples);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__side), ((PyObject *)__pyx_n_s__right)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_v_idx = __pyx_t_10;
- __pyx_t_10 = 0;
-
- /* "mtrand.pyx":1038
- * uniform_samples = self.random_sample(shape)
- * idx = cdf.searchsorted(uniform_samples, side='right')
- * idx = np.array(idx, copy=False) # searchsorted returns a scalar # <<<<<<<<<<<<<<
- * else:
- * idx = self.randint(0, pop_size, size=shape)
- */
- __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_INCREF(__pyx_v_idx);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_idx);
- __Pyx_GIVEREF(__pyx_v_idx);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_1 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__copy), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_v_idx);
- __pyx_v_idx = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L23;
- }
- /*else*/ {
-
- /* "mtrand.pyx":1040
- * idx = np.array(idx, copy=False) # searchsorted returns a scalar
- * else:
- * idx = self.randint(0, pop_size, size=shape) # <<<<<<<<<<<<<<
- * else:
- * if size > pop_size:
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__randint); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- __Pyx_INCREF(__pyx_v_pop_size);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_pop_size);
- __Pyx_GIVEREF(__pyx_v_pop_size);
- __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_10));
- if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__size), __pyx_v_shape) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
- __pyx_v_idx = __pyx_t_2;
- __pyx_t_2 = 0;
- }
- __pyx_L23:;
- goto __pyx_L22;
- }
- /*else*/ {
-
- /* "mtrand.pyx":1042
- * idx = self.randint(0, pop_size, size=shape)
- * else:
- * if size > pop_size: # <<<<<<<<<<<<<<
- * raise ValueError("Cannot take a larger sample than "
- * "population when 'replace=False'")
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_size, __pyx_v_pop_size, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_11) {
-
- /* "mtrand.pyx":1043
- * else:
- * if size > pop_size:
- * raise ValueError("Cannot take a larger sample than " # <<<<<<<<<<<<<<
- * "population when 'replace=False'")
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L24;
- }
- __pyx_L24:;
-
- /* "mtrand.pyx":1046
- * "population when 'replace=False'")
- *
- * if None != p: # <<<<<<<<<<<<<<
- * if np.sum(p > 0) < size:
- * raise ValueError("Fewer non-zero entries in p than size")
- */
- __pyx_t_2 = PyObject_RichCompare(Py_None, __pyx_v_p, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_11) {
-
- /* "mtrand.pyx":1047
- *
- * if None != p:
- * if np.sum(p > 0) < size: # <<<<<<<<<<<<<<
- * raise ValueError("Fewer non-zero entries in p than size")
- * n_uniq = 0
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__sum); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_p, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_v_size, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_11) {
-
- /* "mtrand.pyx":1048
- * if None != p:
- * if np.sum(p > 0) < size:
- * raise ValueError("Fewer non-zero entries in p than size") # <<<<<<<<<<<<<<
- * n_uniq = 0
- * p = p.copy()
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L26;
- }
- __pyx_L26:;
-
- /* "mtrand.pyx":1049
- * if np.sum(p > 0) < size:
- * raise ValueError("Fewer non-zero entries in p than size")
- * n_uniq = 0 # <<<<<<<<<<<<<<
- * p = p.copy()
- * found = np.zeros(shape, dtype=np.int)
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_v_n_uniq = __pyx_int_0;
-
- /* "mtrand.pyx":1050
- * raise ValueError("Fewer non-zero entries in p than size")
- * n_uniq = 0
- * p = p.copy() # <<<<<<<<<<<<<<
- * found = np.zeros(shape, dtype=np.int)
- * flat_found = found.ravel()
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s__copy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_v_p);
- __pyx_v_p = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":1051
- * n_uniq = 0
- * p = p.copy()
- * found = np.zeros(shape, dtype=np.int) # <<<<<<<<<<<<<<
- * flat_found = found.ravel()
- * while n_uniq < size:
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_10));
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1051; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
- __pyx_v_found = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1052
- * p = p.copy()
- * found = np.zeros(shape, dtype=np.int)
- * flat_found = found.ravel() # <<<<<<<<<<<<<<
- * while n_uniq < size:
- * x = self.rand(size - n_uniq)
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_found, __pyx_n_s__ravel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_flat_found = __pyx_t_10;
- __pyx_t_10 = 0;
-
- /* "mtrand.pyx":1053
- * found = np.zeros(shape, dtype=np.int)
- * flat_found = found.ravel()
- * while n_uniq < size: # <<<<<<<<<<<<<<
- * x = self.rand(size - n_uniq)
- * if n_uniq > 0:
- */
- while (1) {
- __pyx_t_10 = PyObject_RichCompare(__pyx_v_n_uniq, __pyx_v_size, Py_LT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (!__pyx_t_11) break;
-
- /* "mtrand.pyx":1054
- * flat_found = found.ravel()
- * while n_uniq < size:
- * x = self.rand(size - n_uniq) # <<<<<<<<<<<<<<
- * if n_uniq > 0:
- * p[flat_found[0:n_uniq]] = 0
- */
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__rand); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_size, __pyx_v_n_uniq); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_v_x);
- __pyx_v_x = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1055
- * while n_uniq < size:
- * x = self.rand(size - n_uniq)
- * if n_uniq > 0: # <<<<<<<<<<<<<<
- * p[flat_found[0:n_uniq]] = 0
- * cdf = np.cumsum(p)
- */
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_n_uniq, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_11) {
-
- /* "mtrand.pyx":1056
- * x = self.rand(size - n_uniq)
- * if n_uniq > 0:
- * p[flat_found[0:n_uniq]] = 0 # <<<<<<<<<<<<<<
- * cdf = np.cumsum(p)
- * cdf /= cdf[-1]
- */
- __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_flat_found, 0, 0, NULL, &__pyx_v_n_uniq, NULL, 1, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyObject_SetItem(__pyx_v_p, __pyx_t_3, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L29;
- }
- __pyx_L29:;
-
- /* "mtrand.pyx":1057
- * if n_uniq > 0:
- * p[flat_found[0:n_uniq]] = 0
- * cdf = np.cumsum(p) # <<<<<<<<<<<<<<
- * cdf /= cdf[-1]
- * new = cdf.searchsorted(x, side='right')
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__cumsum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_p);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_p);
- __Pyx_GIVEREF(__pyx_v_p);
- __pyx_t_10 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_v_cdf);
- __pyx_v_cdf = __pyx_t_10;
- __pyx_t_10 = 0;
-
- /* "mtrand.pyx":1058
- * p[flat_found[0:n_uniq]] = 0
- * cdf = np.cumsum(p)
- * cdf /= cdf[-1] # <<<<<<<<<<<<<<
- * new = cdf.searchsorted(x, side='right')
- * _, unique_indices = np.unique(new, return_index=True)
- */
- __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_cdf, -1, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_cdf, __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(__pyx_v_cdf);
- __pyx_v_cdf = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1059
- * cdf = np.cumsum(p)
- * cdf /= cdf[-1]
- * new = cdf.searchsorted(x, side='right') # <<<<<<<<<<<<<<
- * _, unique_indices = np.unique(new, return_index=True)
- * unique_indices.sort()
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cdf, __pyx_n_s__searchsorted); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__side), ((PyObject *)__pyx_n_s__right)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_10), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_v_new);
- __pyx_v_new = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":1060
- * cdf /= cdf[-1]
- * new = cdf.searchsorted(x, side='right')
- * _, unique_indices = np.unique(new, return_index=True) # <<<<<<<<<<<<<<
- * unique_indices.sort()
- * new = new.take(unique_indices)
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__unique); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_new);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_new);
- __Pyx_GIVEREF(__pyx_v_new);
- __pyx_t_10 = PyDict_New(); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_10));
- __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyDict_SetItem(__pyx_t_10, ((PyObject *)__pyx_n_s__return_index), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_10)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_10)); __pyx_t_10 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
- #if CYTHON_COMPILING_IN_CPYTHON
- Py_ssize_t size = Py_SIZE(sequence);
- #else
- Py_ssize_t size = PySequence_Size(sequence);
- #endif
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_10 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
- } else {
- __pyx_t_10 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_4 = PyList_GET_ITEM(sequence, 1);
- }
- __Pyx_INCREF(__pyx_t_10);
- __Pyx_INCREF(__pyx_t_4);
- #else
- __pyx_t_10 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- {
- Py_ssize_t index = -1;
- __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_12 = Py_TYPE(__pyx_t_2)->tp_iternext;
- index = 0; __pyx_t_10 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_10)) goto __pyx_L30_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_10);
- index = 1; __pyx_t_4 = __pyx_t_12(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L30_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_2), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_12 = NULL;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- goto __pyx_L31_unpacking_done;
- __pyx_L30_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_12 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L31_unpacking_done:;
- }
- __Pyx_XDECREF(__pyx_v__);
- __pyx_v__ = __pyx_t_10;
- __pyx_t_10 = 0;
- __Pyx_XDECREF(__pyx_v_unique_indices);
- __pyx_v_unique_indices = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":1061
- * new = cdf.searchsorted(x, side='right')
- * _, unique_indices = np.unique(new, return_index=True)
- * unique_indices.sort() # <<<<<<<<<<<<<<
- * new = new.take(unique_indices)
- * flat_found[n_uniq:n_uniq + new.size] = new
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_unique_indices, __pyx_n_s__sort); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":1062
- * _, unique_indices = np.unique(new, return_index=True)
- * unique_indices.sort()
- * new = new.take(unique_indices) # <<<<<<<<<<<<<<
- * flat_found[n_uniq:n_uniq + new.size] = new
- * n_uniq += new.size
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_new, __pyx_n_s__take); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_unique_indices);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_unique_indices);
- __Pyx_GIVEREF(__pyx_v_unique_indices);
- __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_v_new);
- __pyx_v_new = __pyx_t_10;
- __pyx_t_10 = 0;
-
- /* "mtrand.pyx":1063
- * unique_indices.sort()
- * new = new.take(unique_indices)
- * flat_found[n_uniq:n_uniq + new.size] = new # <<<<<<<<<<<<<<
- * n_uniq += new.size
- * idx = found
- */
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_new, __pyx_n_s__size); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = PyNumber_Add(__pyx_v_n_uniq, __pyx_t_10); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- if (__Pyx_PyObject_SetSlice(__pyx_v_flat_found, __pyx_v_new, 0, 0, &__pyx_v_n_uniq, &__pyx_t_3, NULL, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1064
- * new = new.take(unique_indices)
- * flat_found[n_uniq:n_uniq + new.size] = new
- * n_uniq += new.size # <<<<<<<<<<<<<<
- * idx = found
- * else:
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new, __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_n_uniq, __pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_v_n_uniq);
- __pyx_v_n_uniq = __pyx_t_10;
- __pyx_t_10 = 0;
- }
-
- /* "mtrand.pyx":1065
- * flat_found[n_uniq:n_uniq + new.size] = new
- * n_uniq += new.size
- * idx = found # <<<<<<<<<<<<<<
- * else:
- * idx = self.permutation(pop_size)[:size]
- */
- __Pyx_INCREF(__pyx_v_found);
- __pyx_v_idx = __pyx_v_found;
- goto __pyx_L25;
- }
- /*else*/ {
-
- /* "mtrand.pyx":1067
- * idx = found
- * else:
- * idx = self.permutation(pop_size)[:size] # <<<<<<<<<<<<<<
- * if shape is not None:
- * idx.shape = shape
- */
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__permutation); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_pop_size);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_pop_size);
- __Pyx_GIVEREF(__pyx_v_pop_size);
- __pyx_t_4 = PyObject_Call(__pyx_t_10, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_t_4, 0, 0, NULL, &__pyx_v_size, NULL, 0, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_idx = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1068
- * else:
- * idx = self.permutation(pop_size)[:size]
- * if shape is not None: # <<<<<<<<<<<<<<
- * idx.shape = shape
- *
- */
- __pyx_t_11 = (__pyx_v_shape != Py_None);
- if (__pyx_t_11) {
-
- /* "mtrand.pyx":1069
- * idx = self.permutation(pop_size)[:size]
- * if shape is not None:
- * idx.shape = shape # <<<<<<<<<<<<<<
- *
- * if shape is None and isinstance(idx, np.ndarray):
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_idx, __pyx_n_s__shape, __pyx_v_shape) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L32;
- }
- __pyx_L32:;
- }
- __pyx_L25:;
- }
- __pyx_L22:;
-
- /* "mtrand.pyx":1071
- * idx.shape = shape
- *
- * if shape is None and isinstance(idx, np.ndarray): # <<<<<<<<<<<<<<
- * # In most cases a scalar will have been made an array
- * idx = idx.item(0)
- */
- __pyx_t_11 = (__pyx_v_shape == Py_None);
- if (__pyx_t_11) {
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__ndarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = PyObject_IsInstance(__pyx_v_idx, __pyx_t_4); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_13 = __pyx_t_5;
- } else {
- __pyx_t_13 = __pyx_t_11;
- }
- if (__pyx_t_13) {
-
- /* "mtrand.pyx":1073
- * if shape is None and isinstance(idx, np.ndarray):
- * # In most cases a scalar will have been made an array
- * idx = idx.item(0) # <<<<<<<<<<<<<<
- *
- * #Use samples as indices for a if a is array-like
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_idx, __pyx_n_s__item); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_38), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_v_idx);
- __pyx_v_idx = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L33;
- }
- __pyx_L33:;
-
- /* "mtrand.pyx":1076
- *
- * #Use samples as indices for a if a is array-like
- * if a.ndim == 0: # <<<<<<<<<<<<<<
- * return idx
- *
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_13) {
-
- /* "mtrand.pyx":1077
- * #Use samples as indices for a if a is array-like
- * if a.ndim == 0:
- * return idx # <<<<<<<<<<<<<<
- *
- * if shape is not None and idx.ndim == 0:
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_idx);
- __pyx_r = __pyx_v_idx;
- goto __pyx_L0;
- goto __pyx_L34;
- }
- __pyx_L34:;
-
- /* "mtrand.pyx":1079
- * return idx
- *
- * if shape is not None and idx.ndim == 0: # <<<<<<<<<<<<<<
- * # If size == () then the user requested a 0-d array as opposed to
- * # a scalar object when size is None. However a[idx] is always a
- */
- __pyx_t_13 = (__pyx_v_shape != Py_None);
- if (__pyx_t_13) {
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_idx, __pyx_n_s__ndim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __pyx_t_11;
- } else {
- __pyx_t_5 = __pyx_t_13;
- }
- if (__pyx_t_5) {
-
- /* "mtrand.pyx":1085
- * # array, taking into account that np.array(item) may not work
- * # for object arrays.
- * res = np.empty((), dtype=a.dtype) # <<<<<<<<<<<<<<
- * res[()] = a[idx]
- * return res
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_a, __pyx_n_s__dtype); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_39), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_res = __pyx_t_10;
- __pyx_t_10 = 0;
-
- /* "mtrand.pyx":1086
- * # for object arrays.
- * res = np.empty((), dtype=a.dtype)
- * res[()] = a[idx] # <<<<<<<<<<<<<<
- * return res
- *
- */
- __pyx_t_10 = PyObject_GetItem(__pyx_v_a, __pyx_v_idx); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- if (PyObject_SetItem(__pyx_v_res, ((PyObject *)__pyx_empty_tuple), __pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-
- /* "mtrand.pyx":1087
- * res = np.empty((), dtype=a.dtype)
- * res[()] = a[idx]
- * return res # <<<<<<<<<<<<<<
- *
- * return a[idx]
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_res);
- __pyx_r = __pyx_v_res;
- goto __pyx_L0;
- goto __pyx_L35;
- }
- __pyx_L35:;
-
- /* "mtrand.pyx":1089
- * return res
- *
- * return a[idx] # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_10 = PyObject_GetItem(__pyx_v_a, __pyx_v_idx); if (!__pyx_t_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_r = __pyx_t_10;
- __pyx_t_10 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("mtrand.RandomState.choice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_pop_size);
- __Pyx_XDECREF(__pyx_v_shape);
- __Pyx_XDECREF(__pyx_v_cdf);
- __Pyx_XDECREF(__pyx_v_uniform_samples);
- __Pyx_XDECREF(__pyx_v_idx);
- __Pyx_XDECREF(__pyx_v_n_uniq);
- __Pyx_XDECREF(__pyx_v_found);
- __Pyx_XDECREF(__pyx_v_flat_found);
- __Pyx_XDECREF(__pyx_v_x);
- __Pyx_XDECREF(__pyx_v_new);
- __Pyx_XDECREF(__pyx_v__);
- __Pyx_XDECREF(__pyx_v_unique_indices);
- __Pyx_XDECREF(__pyx_v_res);
- __Pyx_XDECREF(__pyx_v_a);
- __Pyx_XDECREF(__pyx_v_size);
- __Pyx_XDECREF(__pyx_v_p);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_27uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_26uniform[] = "\n uniform(low=0.0, high=1.0, size=1)\n\n Draw samples from a uniform distribution.\n\n Samples are uniformly distributed over the half-open interval\n ``[low, high)`` (includes low, but excludes high). In other words,\n any value within the given interval is equally likely to be drawn\n by `uniform`.\n\n Parameters\n ----------\n low : float, optional\n Lower boundary of the output interval. All values generated will be\n greater than or equal to low. The default value is 0.\n high : float\n Upper boundary of the output interval. All values generated will be\n less than high. The default value is 1.0.\n size : int or tuple of ints, optional\n Shape of output. If the given size is, for example, (m,n,k),\n m*n*k samples are generated. If no shape is specified, a single sample\n is returned.\n\n Returns\n -------\n out : ndarray\n Drawn samples, with shape `size`.\n\n See Also\n --------\n randint : Discrete uniform distribution, yielding integers.\n random_integers : Discrete uniform distribution over the closed\n interval ``[low, high]``.\n random_sample : Floats uniformly distributed over ``[0, 1)``.\n random : Alias for `random_sample`.\n rand : Convenience function that accepts dimensions as input, e.g.,\n ``rand(2,2)`` would generate a 2-by-2 array of floats,\n uniformly distributed over ``[0, 1)``.\n\n Notes\n -----\n The probability density function of the uniform distribution is\n\n .. math:: p(x) = \\frac{1}{b - a}\n\n anywhere within the interval ``[a, b)``, and zero elsewhere.\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> s = np.random.uniform(-1,0,1000)\n\n All values are w""ithin the given interval:\n\n >>> np.all(s >= -1)\n True\n >>> np.all(s < 0)\n True\n\n Display the histogram of the samples, along with the\n probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 15, normed=True)\n >>> plt.plot(bins, np.ones_like(bins), linewidth=2, color='r')\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_27uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_low = 0;
- PyObject *__pyx_v_high = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("uniform (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__low,&__pyx_n_s__high,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
- values[0] = __pyx_k_40;
- values[1] = __pyx_k_41;
-
- /* "mtrand.pyx":1092
- *
- *
- * def uniform(self, low=0.0, high=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * uniform(low=0.0, high=1.0, size=1)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low);
- if (value) { values[0] = value; kw_args--; }
- }
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high);
- if (value) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "uniform") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_low = values[0];
- __pyx_v_high = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("uniform", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.uniform", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_26uniform(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_low, __pyx_v_high, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_26uniform(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_low, PyObject *__pyx_v_high, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_olow = 0;
- PyArrayObject *__pyx_v_ohigh = 0;
- PyArrayObject *__pyx_v_odiff = 0;
- double __pyx_v_flow;
- double __pyx_v_fhigh;
- PyObject *__pyx_v_temp = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("uniform", 0);
-
- /* "mtrand.pyx":1166
- * cdef object temp
- *
- * flow = PyFloat_AsDouble(low) # <<<<<<<<<<<<<<
- * fhigh = PyFloat_AsDouble(high)
- * if not PyErr_Occurred():
- */
- __pyx_v_flow = PyFloat_AsDouble(__pyx_v_low);
-
- /* "mtrand.pyx":1167
- *
- * flow = PyFloat_AsDouble(low)
- * fhigh = PyFloat_AsDouble(high) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow)
- */
- __pyx_v_fhigh = PyFloat_AsDouble(__pyx_v_high);
-
- /* "mtrand.pyx":1168
- * flow = PyFloat_AsDouble(low)
- * fhigh = PyFloat_AsDouble(high)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow)
- * PyErr_Clear()
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1169
- * fhigh = PyFloat_AsDouble(high)
- * if not PyErr_Occurred():
- * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow) # <<<<<<<<<<<<<<
- * PyErr_Clear()
- * olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_uniform, __pyx_v_size, __pyx_v_flow, (__pyx_v_fhigh - __pyx_v_flow)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":1170
- * if not PyErr_Occurred():
- * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow)
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":1171
- * return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow)
- * PyErr_Clear()
- * olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * temp = np.subtract(ohigh, olow)
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_low, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_olow = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1172
- * PyErr_Clear()
- * olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * temp = np.subtract(ohigh, olow)
- * Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_high, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_ohigh = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":1173
- * olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * temp = np.subtract(ohigh, olow) # <<<<<<<<<<<<<<
- * Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting
- * # rules because EnsureArray steals a reference
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__subtract); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_ohigh));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ohigh));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_ohigh));
- __Pyx_INCREF(((PyObject *)__pyx_v_olow));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_olow));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_olow));
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_v_temp = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":1174
- * ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * temp = np.subtract(ohigh, olow)
- * Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting # <<<<<<<<<<<<<<
- * # rules because EnsureArray steals a reference
- * odiff = <ndarray>PyArray_EnsureArray(temp)
- */
- Py_INCREF(__pyx_v_temp);
-
- /* "mtrand.pyx":1176
- * Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting
- * # rules because EnsureArray steals a reference
- * odiff = <ndarray>PyArray_EnsureArray(temp) # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_uniform, size, olow, odiff)
- *
- */
- __pyx_t_4 = PyArray_EnsureArray(__pyx_v_temp); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __pyx_t_4;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_odiff = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":1177
- * # rules because EnsureArray steals a reference
- * odiff = <ndarray>PyArray_EnsureArray(temp)
- * return cont2_array(self.internal_state, rk_uniform, size, olow, odiff) # <<<<<<<<<<<<<<
- *
- * def rand(self, *args):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_uniform, __pyx_v_size, __pyx_v_olow, __pyx_v_odiff); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.RandomState.uniform", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_olow);
- __Pyx_XDECREF((PyObject *)__pyx_v_ohigh);
- __Pyx_XDECREF((PyObject *)__pyx_v_odiff);
- __Pyx_XDECREF(__pyx_v_temp);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_29rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_28rand[] = "\n rand(d0, d1, ..., dn)\n\n Random values in a given shape.\n\n Create an array of the given shape and propagate it with\n random samples from a uniform distribution\n over ``[0, 1)``.\n\n Parameters\n ----------\n d0, d1, ..., dn : int, optional\n The dimensions of the returned array, should all be positive.\n If no argument is given a single Python float is returned.\n\n Returns\n -------\n out : ndarray, shape ``(d0, d1, ..., dn)``\n Random values.\n\n See Also\n --------\n random\n\n Notes\n -----\n This is a convenience function. If you want an interface that\n takes a shape-tuple as the first argument, refer to\n np.random.random_sample .\n\n Examples\n --------\n >>> np.random.rand(3,2)\n array([[ 0.14022471, 0.96360618], #random\n [ 0.37601032, 0.25528411], #random\n [ 0.49313049, 0.94909878]]) #random\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_29rand(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_args = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("rand (wrapper)", 0);
- if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "rand", 0))) return NULL;
- __Pyx_INCREF(__pyx_args);
- __pyx_v_args = __pyx_args;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_28rand(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_args);
- __Pyx_XDECREF(__pyx_v_args);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":1179
- * return cont2_array(self.internal_state, rk_uniform, size, olow, odiff)
- *
- * def rand(self, *args): # <<<<<<<<<<<<<<
- * """
- * rand(d0, d1, ..., dn)
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_28rand(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_args) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("rand", 0);
-
- /* "mtrand.pyx":1218
- *
- * """
- * if len(args) == 0: # <<<<<<<<<<<<<<
- * return self.random_sample()
- * else:
- */
- __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_args)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = (__pyx_t_1 == 0);
- if (__pyx_t_2) {
-
- /* "mtrand.pyx":1219
- * """
- * if len(args) == 0:
- * return self.random_sample() # <<<<<<<<<<<<<<
- * else:
- * return self.random_sample(size=args)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__random_sample); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":1221
- * return self.random_sample()
- * else:
- * return self.random_sample(size=args) # <<<<<<<<<<<<<<
- *
- * def randn(self, *args):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__random_sample); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__size), ((PyObject *)__pyx_v_args)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.rand", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_31randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_30randn[] = "\n randn(d0, d1, ..., dn)\n\n Return a sample (or samples) from the \"standard normal\" distribution.\n\n If positive, int_like or int-convertible arguments are provided,\n `randn` generates an array of shape ``(d0, d1, ..., dn)``, filled\n with random floats sampled from a univariate \"normal\" (Gaussian)\n distribution of mean 0 and variance 1 (if any of the :math:`d_i` are\n floats, they are first converted to integers by truncation). A single\n float randomly sampled from the distribution is returned if no\n argument is provided.\n\n This is a convenience function. If you want an interface that takes a\n tuple as the first argument, use `numpy.random.standard_normal` instead.\n\n Parameters\n ----------\n d0, d1, ..., dn : int, optional\n The dimensions of the returned array, should be all positive.\n If no argument is given a single Python float is returned.\n\n Returns\n -------\n Z : ndarray or float\n A ``(d0, d1, ..., dn)``-shaped array of floating-point samples from\n the standard normal distribution, or a single such float if\n no parameters were supplied.\n\n See Also\n --------\n random.standard_normal : Similar, but takes a tuple as its argument.\n\n Notes\n -----\n For random samples from :math:`N(\\mu, \\sigma^2)`, use:\n\n ``sigma * np.random.randn(...) + mu``\n\n Examples\n --------\n >>> np.random.randn()\n 2.1923875335537315 #random\n\n Two-by-four array of samples from N(3, 6.25):\n\n >>> 2.5 * np.random.randn(2, 4) + 3\n array([[-4.49401501, 4.00950034, -1.81814867, 7.29718677], #random\n [ 0.39924804, 4.68456316, 4.99394529, 4.84057254]]) #random\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_31randn(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_args = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("randn (wrapper)", 0);
- if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "randn", 0))) return NULL;
- __Pyx_INCREF(__pyx_args);
- __pyx_v_args = __pyx_args;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_30randn(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_args);
- __Pyx_XDECREF(__pyx_v_args);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":1223
- * return self.random_sample(size=args)
- *
- * def randn(self, *args): # <<<<<<<<<<<<<<
- * """
- * randn(d0, d1, ..., dn)
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_30randn(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_args) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("randn", 0);
-
- /* "mtrand.pyx":1275
- *
- * """
- * if len(args) == 0: # <<<<<<<<<<<<<<
- * return self.standard_normal()
- * else:
- */
- __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_args)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = (__pyx_t_1 == 0);
- if (__pyx_t_2) {
-
- /* "mtrand.pyx":1276
- * """
- * if len(args) == 0:
- * return self.standard_normal() # <<<<<<<<<<<<<<
- * else:
- * return self.standard_normal(args)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__standard_normal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":1278
- * return self.standard_normal()
- * else:
- * return self.standard_normal(args) # <<<<<<<<<<<<<<
- *
- * def random_integers(self, low, high=None, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__standard_normal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(((PyObject *)__pyx_v_args));
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_args));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.randn", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_33random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_32random_integers[] = "\n random_integers(low, high=None, size=None)\n\n Return random integers between `low` and `high`, inclusive.\n\n Return random integers from the \"discrete uniform\" distribution in the\n closed interval [`low`, `high`]. If `high` is None (the default),\n then results are from [1, `low`].\n\n Parameters\n ----------\n low : int\n Lowest (signed) integer to be drawn from the distribution (unless\n ``high=None``, in which case this parameter is the *highest* such\n integer).\n high : int, optional\n If provided, the largest (signed) integer to be drawn from the\n distribution (see above for behavior if ``high=None``).\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single int is returned.\n\n Returns\n -------\n out : int or ndarray of ints\n `size`-shaped array of random integers from the appropriate\n distribution, or a single such random int if `size` not provided.\n\n See Also\n --------\n random.randint : Similar to `random_integers`, only for the half-open\n interval [`low`, `high`), and 0 is the lowest value if `high` is\n omitted.\n\n Notes\n -----\n To sample from N evenly spaced floating-point numbers between a and b,\n use::\n\n a + (b - a) * (np.random.random_integers(N) - 1) / (N - 1.)\n\n Examples\n --------\n >>> np.random.random_integers(5)\n 4\n >>> type(np.random.random_integers(5))\n <type 'int'>\n >>> np.random.random_integers(5, size=(3.,2.))\n array([[5, 4],\n [3, 3],\n [4, 5]])\n\n Choose five random numbers from the set of five evenly-spaced\n numbers between 0 and 2.5, inclusive (*i.e.*, from the set\n :math:`{0, 5/8, 10/8, 15/8, 20/8}`):\n""\n >>> 2.5 * (np.random.random_integers(5, size=(5,)) - 1) / 4.\n array([ 0.625, 1.25 , 0.625, 0.625, 2.5 ])\n\n Roll two six sided dice 1000 times and sum the results:\n\n >>> d1 = np.random.random_integers(1, 6, 1000)\n >>> d2 = np.random.random_integers(1, 6, 1000)\n >>> dsums = d1 + d2\n\n Display results as a histogram:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(dsums, 11, normed=True)\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_33random_integers(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_low = 0;
- PyObject *__pyx_v_high = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("random_integers (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__low,&__pyx_n_s__high,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
-
- /* "mtrand.pyx":1280
- * return self.standard_normal(args)
- *
- * def random_integers(self, low, high=None, size=None): # <<<<<<<<<<<<<<
- * """
- * random_integers(low, high=None, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__low)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__high);
- if (value) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "random_integers") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_low = values[0];
- __pyx_v_high = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("random_integers", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.random_integers", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_32random_integers(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_low, __pyx_v_high, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_32random_integers(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_low, PyObject *__pyx_v_high, PyObject *__pyx_v_size) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("random_integers", 0);
- __Pyx_INCREF(__pyx_v_low);
- __Pyx_INCREF(__pyx_v_high);
-
- /* "mtrand.pyx":1352
- *
- * """
- * if high is None: # <<<<<<<<<<<<<<
- * high = low
- * low = 1
- */
- __pyx_t_1 = (__pyx_v_high == Py_None);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1353
- * """
- * if high is None:
- * high = low # <<<<<<<<<<<<<<
- * low = 1
- * return self.randint(low, high+1, size)
- */
- __Pyx_INCREF(__pyx_v_low);
- __Pyx_DECREF(__pyx_v_high);
- __pyx_v_high = __pyx_v_low;
-
- /* "mtrand.pyx":1354
- * if high is None:
- * high = low
- * low = 1 # <<<<<<<<<<<<<<
- * return self.randint(low, high+1, size)
- *
- */
- __Pyx_INCREF(__pyx_int_1);
- __Pyx_DECREF(__pyx_v_low);
- __pyx_v_low = __pyx_int_1;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":1355
- * high = low
- * low = 1
- * return self.randint(low, high+1, size) # <<<<<<<<<<<<<<
- *
- * # Complicated, continuous distributions:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__randint); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyNumber_Add(__pyx_v_high, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_low);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_low);
- __Pyx_GIVEREF(__pyx_v_low);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.RandomState.random_integers", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_low);
- __Pyx_XDECREF(__pyx_v_high);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_35standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_34standard_normal[] = "\n standard_normal(size=None)\n\n Returns samples from a Standard Normal distribution (mean=0, stdev=1).\n\n Parameters\n ----------\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single value is\n returned.\n\n Returns\n -------\n out : float or ndarray\n Drawn samples.\n\n Examples\n --------\n >>> s = np.random.standard_normal(8000)\n >>> s\n array([ 0.6888893 , 0.78096262, -0.89086505, ..., 0.49876311, #random\n -0.38672696, -0.4685006 ]) #random\n >>> s.shape\n (8000,)\n >>> s = np.random.standard_normal(size=(3, 4, 2))\n >>> s.shape\n (3, 4, 2)\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_35standard_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("standard_normal (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0};
- PyObject* values[1] = {0};
-
- /* "mtrand.pyx":1358
- *
- * # Complicated, continuous distributions:
- * def standard_normal(self, size=None): # <<<<<<<<<<<<<<
- * """
- * standard_normal(size=None)
- */
- values[0] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[0] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_normal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_size = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("standard_normal", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.standard_normal", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_34standard_normal(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_34standard_normal(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_size) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("standard_normal", 0);
-
- /* "mtrand.pyx":1388
- *
- * """
- * return cont0_array(self.internal_state, rk_gauss, size) # <<<<<<<<<<<<<<
- *
- * def normal(self, loc=0.0, scale=1.0, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_6mtrand_cont0_array(__pyx_v_self->internal_state, rk_gauss, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("mtrand.RandomState.standard_normal", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_37normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_36normal[] = "\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 ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_37normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_loc = 0;
- PyObject *__pyx_v_scale = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("normal (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__loc,&__pyx_n_s__scale,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
- values[0] = __pyx_k_42;
- values[1] = __pyx_k_43;
-
- /* "mtrand.pyx":1390
- * return cont0_array(self.internal_state, rk_gauss, size)
- *
- * def normal(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * normal(loc=0.0, scale=1.0, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loc);
- if (value) { values[0] = value; kw_args--; }
- }
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale);
- if (value) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "normal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_loc = values[0];
- __pyx_v_scale = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("normal", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.normal", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_36normal(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_loc, __pyx_v_scale, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_36normal(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_scale, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oloc = 0;
- PyArrayObject *__pyx_v_oscale = 0;
- double __pyx_v_floc;
- double __pyx_v_fscale;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("normal", 0);
-
- /* "mtrand.pyx":1475
- * cdef double floc, fscale
- *
- * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
- __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
-
- /* "mtrand.pyx":1476
- *
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fscale <= 0:
- */
- __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
-
- /* "mtrand.pyx":1477
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1478
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale)
- */
- __pyx_t_1 = (__pyx_v_fscale <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1479
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":1480
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_normal, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":1482
- * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oloc = <ndarray>PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":1484
- * PyErr_Clear()
- *
- * oloc = <ndarray>PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oloc = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1485
- *
- * oloc = <ndarray>PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oscale, 0)):
- * raise ValueError("scale <= 0")
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":1486
- * oloc = <ndarray>PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_oscale));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale));
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1487
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale)
- *
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_46), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":1488
- * if np.any(np.less_equal(oscale, 0)):
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale) # <<<<<<<<<<<<<<
- *
- * def beta(self, a, b, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_normal, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.normal", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oloc);
- __Pyx_XDECREF((PyObject *)__pyx_v_oscale);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_39beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_38beta[] = "\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 output 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 ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_39beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_a = 0;
- PyObject *__pyx_v_b = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("beta (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__b,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
-
- /* "mtrand.pyx":1490
- * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale)
- *
- * def beta(self, a, b, size=None): # <<<<<<<<<<<<<<
- * """
- * beta(a, b, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__b)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("beta", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "beta") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_a = values[0];
- __pyx_v_b = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("beta", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.beta", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_38beta(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_a, __pyx_v_b, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_38beta(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oa = 0;
- PyArrayObject *__pyx_v_ob = 0;
- double __pyx_v_fa;
- double __pyx_v_fb;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("beta", 0);
-
- /* "mtrand.pyx":1530
- * cdef double fa, fb
- *
- * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<<
- * fb = PyFloat_AsDouble(b)
- * if not PyErr_Occurred():
- */
- __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
-
- /* "mtrand.pyx":1531
- *
- * fa = PyFloat_AsDouble(a)
- * fb = PyFloat_AsDouble(b) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fa <= 0:
- */
- __pyx_v_fb = PyFloat_AsDouble(__pyx_v_b);
-
- /* "mtrand.pyx":1532
- * fa = PyFloat_AsDouble(a)
- * fb = PyFloat_AsDouble(b)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fa <= 0:
- * raise ValueError("a <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1533
- * fb = PyFloat_AsDouble(b)
- * if not PyErr_Occurred():
- * if fa <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * if fb <= 0:
- */
- __pyx_t_1 = (__pyx_v_fa <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1534
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * if fb <= 0:
- * raise ValueError("b <= 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_48), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":1535
- * if fa <= 0:
- * raise ValueError("a <= 0")
- * if fb <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("b <= 0")
- * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb)
- */
- __pyx_t_1 = (__pyx_v_fb <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1536
- * raise ValueError("a <= 0")
- * if fb <= 0:
- * raise ValueError("b <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":1537
- * if fb <= 0:
- * raise ValueError("b <= 0")
- * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_beta, __pyx_v_size, __pyx_v_fa, __pyx_v_fb); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":1539
- * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":1541
- * PyErr_Clear()
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oa = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1542
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oa, 0)):
- * raise ValueError("a <= 0")
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_b, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_ob = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":1543
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * if np.any(np.less_equal(ob, 0)):
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_oa));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oa));
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1544
- * ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(ob, 0)):
- * raise ValueError("b <= 0")
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":1545
- * if np.any(np.less_equal(oa, 0)):
- * raise ValueError("a <= 0")
- * if np.any(np.less_equal(ob, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("b <= 0")
- * return cont2_array(self.internal_state, rk_beta, size, oa, ob)
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_ob));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_ob));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_ob));
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1546
- * raise ValueError("a <= 0")
- * if np.any(np.less_equal(ob, 0)):
- * raise ValueError("b <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_beta, size, oa, ob)
- *
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_52), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":1547
- * if np.any(np.less_equal(ob, 0)):
- * raise ValueError("b <= 0")
- * return cont2_array(self.internal_state, rk_beta, size, oa, ob) # <<<<<<<<<<<<<<
- *
- * def exponential(self, scale=1.0, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_beta, __pyx_v_size, __pyx_v_oa, __pyx_v_ob); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.beta", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oa);
- __Pyx_XDECREF((PyObject *)__pyx_v_ob);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_41exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_40exponential[] = "\n exponential(scale=1.0, size=None)\n\n Exponential distribution.\n\n Its probability density function is\n\n .. math:: f(x; \\frac{1}{\\beta}) = \\frac{1}{\\beta} \\exp(-\\frac{x}{\\beta}),\n\n for ``x > 0`` and 0 elsewhere. :math:`\\beta` is the scale parameter,\n which is the inverse of the rate parameter :math:`\\lambda = 1/\\beta`.\n The rate parameter is an alternative, widely used parameterization\n of the exponential distribution [3]_.\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 scale parameter, :math:`\\beta = 1/\\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 .. [3] \"Exponential Distribution, Wikipedia,\n http://en.wikipedia.org/wiki/Exponential_distribution\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_41exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_scale = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("exponential (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__scale,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
- values[0] = __pyx_k_53;
-
- /* "mtrand.pyx":1549
- * return cont2_array(self.internal_state, rk_beta, size, oa, ob)
- *
- * def exponential(self, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * exponential(scale=1.0, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale);
- if (value) { values[0] = value; kw_args--; }
- }
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "exponential") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_scale = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("exponential", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.exponential", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_40exponential(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_scale, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_40exponential(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_scale, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oscale = 0;
- double __pyx_v_fscale;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("exponential", 0);
-
- /* "mtrand.pyx":1590
- * cdef double fscale
- *
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fscale <= 0:
- */
- __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
-
- /* "mtrand.pyx":1591
- *
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1592
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale)
- */
- __pyx_t_1 = (__pyx_v_fscale <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1593
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":1594
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_exponential, __pyx_v_size, __pyx_v_fscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":1596
- * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oscale = <ndarray> PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":1598
- * PyErr_Clear()
- *
- * oscale = <ndarray> PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1599
- *
- * oscale = <ndarray> PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont1_array(self.internal_state, rk_exponential, size, oscale)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1600
- * oscale = <ndarray> PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_exponential, size, oscale)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_55), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":1601
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- * return cont1_array(self.internal_state, rk_exponential, size, oscale) # <<<<<<<<<<<<<<
- *
- * def standard_exponential(self, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_exponential, __pyx_v_size, __pyx_v_oscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.exponential", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oscale);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_43standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_42standard_exponential[] = "\n standard_exponential(size=None)\n\n Draw samples from the standard exponential distribution.\n\n `standard_exponential` is identical to the exponential distribution\n with a scale parameter of 1.\n\n Parameters\n ----------\n size : int or tuple of ints\n Shape of the output.\n\n Returns\n -------\n out : float or ndarray\n Drawn samples.\n\n Examples\n --------\n Output a 3x8000 array:\n\n >>> n = np.random.standard_exponential((3, 8000))\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_43standard_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("standard_exponential (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0};
- PyObject* values[1] = {0};
-
- /* "mtrand.pyx":1603
- * return cont1_array(self.internal_state, rk_exponential, size, oscale)
- *
- * def standard_exponential(self, size=None): # <<<<<<<<<<<<<<
- * """
- * standard_exponential(size=None)
- */
- values[0] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[0] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_exponential") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_size = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("standard_exponential", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.standard_exponential", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_42standard_exponential(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_42standard_exponential(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_size) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("standard_exponential", 0);
-
- /* "mtrand.pyx":1629
- *
- * """
- * return cont0_array(self.internal_state, rk_standard_exponential, size) # <<<<<<<<<<<<<<
- *
- * def standard_gamma(self, shape, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_6mtrand_cont0_array(__pyx_v_self->internal_state, rk_standard_exponential, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("mtrand.RandomState.standard_exponential", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_45standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_44standard_gamma[] = "\n standard_gamma(shape, size=None)\n\n Draw samples from a Standard Gamma distribution.\n\n Samples are drawn from a Gamma distribution with specified parameters,\n shape (sometimes designated \"k\") and scale=1.\n\n Parameters\n ----------\n shape : float\n Parameter, should be > 0.\n size : int or 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 Returns\n -------\n samples : ndarray or scalar\n The drawn samples.\n\n See Also\n --------\n scipy.stats.distributions.gamma : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Gamma distribution is\n\n .. math:: p(x) = x^{k-1}\\frac{e^{-x/\\theta}}{\\theta^k\\Gamma(k)},\n\n where :math:`k` is the shape and :math:`\\theta` the scale,\n and :math:`\\Gamma` is the Gamma function.\n\n The Gamma distribution is often used to model the times to failure of\n electronic components, and arises naturally in processes for which the\n waiting times between Poisson distributed events are relevant.\n\n References\n ----------\n .. [1] Weisstein, Eric W. \"Gamma Distribution.\" From MathWorld--A\n Wolfram Web Resource.\n http://mathworld.wolfram.com/GammaDistribution.html\n .. [2] Wikipedia, \"Gamma-distribution\",\n http://en.wikipedia.org/wiki/Gamma-distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> shape, scale = 2., 1. # mean and width\n >>> s = np.random.standard_gamma(shape, 1000000)\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 >>> y = bins**(shape-1) * ((np.exp(-bins/scale))/ \\\n ... (sps.gamma(shape) * scale**shape))\n >>> plt.plot(bins, y, linewidth=2, color='r')\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_45standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_shape = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("standard_gamma (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__shape,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
-
- /* "mtrand.pyx":1631
- * return cont0_array(self.internal_state, rk_standard_exponential, size)
- *
- * def standard_gamma(self, shape, size=None): # <<<<<<<<<<<<<<
- * """
- * standard_gamma(shape, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shape)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_gamma") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_shape = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("standard_gamma", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.standard_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_44standard_gamma(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_shape, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_44standard_gamma(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oshape = 0;
- double __pyx_v_fshape;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("standard_gamma", 0);
-
- /* "mtrand.pyx":1701
- * cdef double fshape
- *
- * fshape = PyFloat_AsDouble(shape) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fshape <= 0:
- */
- __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape);
-
- /* "mtrand.pyx":1702
- *
- * fshape = PyFloat_AsDouble(shape)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fshape <= 0:
- * raise ValueError("shape <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1703
- * fshape = PyFloat_AsDouble(shape)
- * if not PyErr_Occurred():
- * if fshape <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("shape <= 0")
- * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape)
- */
- __pyx_t_1 = (__pyx_v_fshape <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1704
- * if not PyErr_Occurred():
- * if fshape <= 0:
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_57), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":1705
- * if fshape <= 0:
- * raise ValueError("shape <= 0")
- * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_standard_gamma, __pyx_v_size, __pyx_v_fshape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":1707
- * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oshape = <ndarray> PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oshape, 0.0)):
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":1708
- *
- * PyErr_Clear()
- * oshape = <ndarray> PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oshape = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1709
- * PyErr_Clear()
- * oshape = <ndarray> PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oshape, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("shape <= 0")
- * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_oshape));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oshape));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oshape));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1710
- * oshape = <ndarray> PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_58), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":1711
- * if np.any(np.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0")
- * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape) # <<<<<<<<<<<<<<
- *
- * def gamma(self, shape, scale=1.0, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_standard_gamma, __pyx_v_size, __pyx_v_oshape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.standard_gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oshape);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_47gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_46gamma[] = "\n gamma(shape, scale=1.0, size=None)\n\n Draw samples from a Gamma distribution.\n\n Samples are drawn from a Gamma distribution with specified parameters,\n `shape` (sometimes designated \"k\") and `scale` (sometimes designated\n \"theta\"), where both parameters are > 0.\n\n Parameters\n ----------\n shape : scalar > 0\n The shape of the gamma distribution.\n scale : scalar > 0, optional\n The scale of the gamma distribution. Default is equal to 1.\n size : shape_tuple, optional\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 out : ndarray, float\n Returns one sample unless `size` parameter is specified.\n\n See Also\n --------\n scipy.stats.distributions.gamma : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Gamma distribution is\n\n .. math:: p(x) = x^{k-1}\\frac{e^{-x/\\theta}}{\\theta^k\\Gamma(k)},\n\n where :math:`k` is the shape and :math:`\\theta` the scale,\n and :math:`\\Gamma` is the Gamma function.\n\n The Gamma distribution is often used to model the times to failure of\n electronic components, and arises naturally in processes for which the\n waiting times between Poisson distributed events are relevant.\n\n References\n ----------\n .. [1] Weisstein, Eric W. \"Gamma Distribution.\" From MathWorld--A\n Wolfram Web Resource.\n http://mathworld.wolfram.com/GammaDistribution.html\n .. [2] Wikipedia, \"Gamma-distribution\",\n http://en.wikipedia.org/wiki/Gamma-distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> shape, scale = 2.,"" 2. # mean and dispersion\n >>> s = np.random.gamma(shape, scale, 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 >>> y = bins**(shape-1)*(np.exp(-bins/scale) /\n ... (sps.gamma(shape)*scale**shape))\n >>> plt.plot(bins, y, linewidth=2, color='r')\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_47gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_shape = 0;
- PyObject *__pyx_v_scale = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("gamma (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__shape,&__pyx_n_s__scale,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
- values[1] = __pyx_k_59;
-
- /* "mtrand.pyx":1713
- * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape)
- *
- * def gamma(self, shape, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * gamma(shape, scale=1.0, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shape)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale);
- if (value) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gamma") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_shape = values[0];
- __pyx_v_scale = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("gamma", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_46gamma(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_shape, __pyx_v_scale, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_46gamma(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_scale, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oshape = 0;
- PyArrayObject *__pyx_v_oscale = 0;
- double __pyx_v_fshape;
- double __pyx_v_fscale;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("gamma", 0);
-
- /* "mtrand.pyx":1786
- * cdef double fshape, fscale
- *
- * fshape = PyFloat_AsDouble(shape) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
- __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape);
-
- /* "mtrand.pyx":1787
- *
- * fshape = PyFloat_AsDouble(shape)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fshape <= 0:
- */
- __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
-
- /* "mtrand.pyx":1788
- * fshape = PyFloat_AsDouble(shape)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fshape <= 0:
- * raise ValueError("shape <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1789
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fshape <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("shape <= 0")
- * if fscale <= 0:
- */
- __pyx_t_1 = (__pyx_v_fshape <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1790
- * if not PyErr_Occurred():
- * if fshape <= 0:
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_60), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":1791
- * if fshape <= 0:
- * raise ValueError("shape <= 0")
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale)
- */
- __pyx_t_1 = (__pyx_v_fscale <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1792
- * raise ValueError("shape <= 0")
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_61), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":1793
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_gamma, __pyx_v_size, __pyx_v_fshape, __pyx_v_fscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":1795
- * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":1796
- *
- * PyErr_Clear()
- * oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oshape, 0.0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oshape = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1797
- * PyErr_Clear()
- * oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0")
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":1798
- * oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oshape, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("shape <= 0")
- * if np.any(np.less_equal(oscale, 0.0)):
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_oshape));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oshape));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oshape));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1799
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_62), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":1800
- * if np.any(np.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0")
- * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oscale));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1801
- * raise ValueError("shape <= 0")
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_63), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":1802
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale) # <<<<<<<<<<<<<<
- *
- * def f(self, dfnum, dfden, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_gamma, __pyx_v_size, __pyx_v_oshape, __pyx_v_oscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1802; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.gamma", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oshape);
- __Pyx_XDECREF((PyObject *)__pyx_v_oscale);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_49f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_48f[] = "\n f(dfnum, dfden, size=None)\n\n Draw samples from a F distribution.\n\n Samples are drawn from an F distribution with specified parameters,\n `dfnum` (degrees of freedom in numerator) and `dfden` (degrees of freedom\n in denominator), where both parameters should be greater than zero.\n\n The random variate of the F distribution (also known as the\n Fisher distribution) is a continuous probability distribution\n that arises in ANOVA tests, and is the ratio of two chi-square\n variates.\n\n Parameters\n ----------\n dfnum : float\n Degrees of freedom in numerator. Should be greater than zero.\n dfden : float\n Degrees of freedom in denominator. Should be greater than zero.\n size : {tuple, int}, optional\n Output shape. If the given shape is, e.g., ``(m, n, k)``,\n then ``m * n * k`` samples are drawn. By default only one sample\n is returned.\n\n Returns\n -------\n samples : {ndarray, scalar}\n Samples from the Fisher distribution.\n\n See Also\n --------\n scipy.stats.distributions.f : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The F statistic is used to compare in-group variances to between-group\n variances. Calculating the distribution depends on the sampling, and\n so it is a function of the respective degrees of freedom in the\n problem. The variable `dfnum` is the number of samples minus one, the\n between-groups degrees of freedom, while `dfden` is the within-groups\n degrees of freedom, the sum of the number of samples in each group\n minus the number of groups.\n\n References\n ----------\n .. [1] Glantz, Stanton A. \"Primer of Biostatistics.\", McGraw-Hill,\n Fifth Edition, 2002.""\n .. [2] Wikipedia, \"F-distribution\",\n http://en.wikipedia.org/wiki/F-distribution\n\n Examples\n --------\n An example from Glantz[1], pp 47-40.\n Two groups, children of diabetics (25 people) and children from people\n without diabetes (25 controls). Fasting blood glucose was measured,\n case group had a mean value of 86.1, controls had a mean value of\n 82.2. Standard deviations were 2.09 and 2.49 respectively. Are these\n data consistent with the null hypothesis that the parents diabetic\n status does not affect their children's blood glucose levels?\n Calculating the F statistic from the data gives a value of 36.01.\n\n Draw samples from the distribution:\n\n >>> dfnum = 1. # between group degrees of freedom\n >>> dfden = 48. # within groups degrees of freedom\n >>> s = np.random.f(dfnum, dfden, 1000)\n\n The lower bound for the top 1% of the samples is :\n\n >>> sort(s)[-10]\n 7.61988120985\n\n So there is about a 1% chance that the F statistic will exceed 7.62,\n the measured value is 36, so the null hypothesis is rejected at the 1%\n level.\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_49f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_dfnum = 0;
- PyObject *__pyx_v_dfden = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("f (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dfnum,&__pyx_n_s__dfden,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
-
- /* "mtrand.pyx":1804
- * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale)
- *
- * def f(self, dfnum, dfden, size=None): # <<<<<<<<<<<<<<
- * """
- * f(dfnum, dfden, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dfnum)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dfden)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("f", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "f") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_dfnum = values[0];
- __pyx_v_dfden = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("f", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1804; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.f", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_48f(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_dfnum, __pyx_v_dfden, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_48f(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_dfnum, PyObject *__pyx_v_dfden, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_odfnum = 0;
- PyArrayObject *__pyx_v_odfden = 0;
- double __pyx_v_fdfnum;
- double __pyx_v_fdfden;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("f", 0);
-
- /* "mtrand.pyx":1887
- * cdef double fdfnum, fdfden
- *
- * fdfnum = PyFloat_AsDouble(dfnum) # <<<<<<<<<<<<<<
- * fdfden = PyFloat_AsDouble(dfden)
- * if not PyErr_Occurred():
- */
- __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum);
-
- /* "mtrand.pyx":1888
- *
- * fdfnum = PyFloat_AsDouble(dfnum)
- * fdfden = PyFloat_AsDouble(dfden) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fdfnum <= 0:
- */
- __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden);
-
- /* "mtrand.pyx":1889
- * fdfnum = PyFloat_AsDouble(dfnum)
- * fdfden = PyFloat_AsDouble(dfden)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fdfnum <= 0:
- * raise ValueError("shape <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1890
- * fdfden = PyFloat_AsDouble(dfden)
- * if not PyErr_Occurred():
- * if fdfnum <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("shape <= 0")
- * if fdfden <= 0:
- */
- __pyx_t_1 = (__pyx_v_fdfnum <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1891
- * if not PyErr_Occurred():
- * if fdfnum <= 0:
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * if fdfden <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_64), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":1892
- * if fdfnum <= 0:
- * raise ValueError("shape <= 0")
- * if fdfden <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden)
- */
- __pyx_t_1 = (__pyx_v_fdfden <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1893
- * raise ValueError("shape <= 0")
- * if fdfden <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_65), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":1894
- * if fdfden <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_f, __pyx_v_size, __pyx_v_fdfnum, __pyx_v_fdfden); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":1896
- * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":1898
- * PyErr_Clear()
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odfnum, 0.0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_odfnum = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1899
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(odfnum, 0.0)):
- * raise ValueError("dfnum <= 0")
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_odfden = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":1900
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odfnum, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("dfnum <= 0")
- * if np.any(np.less_equal(odfden, 0.0)):
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_odfnum));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odfnum));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_odfnum));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1901
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odfnum, 0.0)):
- * raise ValueError("dfnum <= 0") # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_67), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":1902
- * if np.any(np.less_equal(odfnum, 0.0)):
- * raise ValueError("dfnum <= 0")
- * if np.any(np.less_equal(odfden, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("dfden <= 0")
- * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_v_odfden));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_odfden));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_odfden));
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1902; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1903
- * raise ValueError("dfnum <= 0")
- * if np.any(np.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_69), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":1904
- * if np.any(np.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0")
- * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden) # <<<<<<<<<<<<<<
- *
- * def noncentral_f(self, dfnum, dfden, nonc, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.f", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_odfnum);
- __Pyx_XDECREF((PyObject *)__pyx_v_odfden);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_51noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_50noncentral_f[] = "\n noncentral_f(dfnum, dfden, nonc, size=None)\n\n Draw samples from the noncentral F distribution.\n\n Samples are drawn from an F distribution with specified parameters,\n `dfnum` (degrees of freedom in numerator) and `dfden` (degrees of\n freedom in denominator), where both parameters > 1.\n `nonc` is the non-centrality parameter.\n\n Parameters\n ----------\n dfnum : int\n Parameter, should be > 1.\n dfden : int\n Parameter, should be > 1.\n nonc : float\n Parameter, should be >= 0.\n size : int or 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 Returns\n -------\n samples : scalar or ndarray\n Drawn samples.\n\n Notes\n -----\n When calculating the power of an experiment (power = probability of\n rejecting the null hypothesis when a specific alternative is true) the\n non-central F statistic becomes important. When the null hypothesis is\n true, the F statistic follows a central F distribution. When the null\n hypothesis is not true, then it follows a non-central F statistic.\n\n References\n ----------\n Weisstein, Eric W. \"Noncentral F-Distribution.\" From MathWorld--A Wolfram\n Web Resource. http://mathworld.wolfram.com/NoncentralF-Distribution.html\n\n Wikipedia, \"Noncentral F distribution\",\n http://en.wikipedia.org/wiki/Noncentral_F-distribution\n\n Examples\n --------\n In a study, testing for a specific alternative to the null hypothesis\n requires use of the Noncentral F distribution. We need to calculate the\n area in the tail of the distribution that exceeds the value of the F\n distribution for the null hypothesis. We'll plot the two probability\n distributions for comp""arison.\n\n >>> dfnum = 3 # between group deg of freedom\n >>> dfden = 20 # within groups degrees of freedom\n >>> nonc = 3.0\n >>> nc_vals = np.random.noncentral_f(dfnum, dfden, nonc, 1000000)\n >>> NF = np.histogram(nc_vals, bins=50, normed=True)\n >>> c_vals = np.random.f(dfnum, dfden, 1000000)\n >>> F = np.histogram(c_vals, bins=50, normed=True)\n >>> plt.plot(F[1][1:], F[0])\n >>> plt.plot(NF[1][1:], NF[0])\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_51noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_dfnum = 0;
- PyObject *__pyx_v_dfden = 0;
- PyObject *__pyx_v_nonc = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("noncentral_f (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__dfnum,&__pyx_n_s__dfden,&__pyx_n_s__nonc,&__pyx_n_s__size,0};
- PyObject* values[4] = {0,0,0,0};
-
- /* "mtrand.pyx":1906
- * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden)
- *
- * def noncentral_f(self, dfnum, dfden, nonc, size=None): # <<<<<<<<<<<<<<
- * """
- * noncentral_f(dfnum, dfden, nonc, size=None)
- */
- values[3] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dfnum)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dfden)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nonc)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[3] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "noncentral_f") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_dfnum = values[0];
- __pyx_v_dfden = values[1];
- __pyx_v_nonc = values[2];
- __pyx_v_size = values[3];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("noncentral_f", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.noncentral_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_50noncentral_f(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_dfnum, __pyx_v_dfden, __pyx_v_nonc, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_50noncentral_f(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_dfnum, PyObject *__pyx_v_dfden, PyObject *__pyx_v_nonc, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_odfnum = 0;
- PyArrayObject *__pyx_v_odfden = 0;
- PyArrayObject *__pyx_v_ononc = 0;
- double __pyx_v_fdfnum;
- double __pyx_v_fdfden;
- double __pyx_v_fnonc;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("noncentral_f", 0);
-
- /* "mtrand.pyx":1973
- * cdef double fdfnum, fdfden, fnonc
- *
- * fdfnum = PyFloat_AsDouble(dfnum) # <<<<<<<<<<<<<<
- * fdfden = PyFloat_AsDouble(dfden)
- * fnonc = PyFloat_AsDouble(nonc)
- */
- __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum);
-
- /* "mtrand.pyx":1974
- *
- * fdfnum = PyFloat_AsDouble(dfnum)
- * fdfden = PyFloat_AsDouble(dfden) # <<<<<<<<<<<<<<
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred():
- */
- __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden);
-
- /* "mtrand.pyx":1975
- * fdfnum = PyFloat_AsDouble(dfnum)
- * fdfden = PyFloat_AsDouble(dfden)
- * fnonc = PyFloat_AsDouble(nonc) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fdfnum <= 1:
- */
- __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc);
-
- /* "mtrand.pyx":1976
- * fdfden = PyFloat_AsDouble(dfden)
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fdfnum <= 1:
- * raise ValueError("dfnum <= 1")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1977
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred():
- * if fdfnum <= 1: # <<<<<<<<<<<<<<
- * raise ValueError("dfnum <= 1")
- * if fdfden <= 0:
- */
- __pyx_t_1 = (__pyx_v_fdfnum <= 1.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1978
- * if not PyErr_Occurred():
- * if fdfnum <= 1:
- * raise ValueError("dfnum <= 1") # <<<<<<<<<<<<<<
- * if fdfden <= 0:
- * raise ValueError("dfden <= 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_71), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":1979
- * if fdfnum <= 1:
- * raise ValueError("dfnum <= 1")
- * if fdfden <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("dfden <= 0")
- * if fnonc < 0:
- */
- __pyx_t_1 = (__pyx_v_fdfden <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1980
- * raise ValueError("dfnum <= 1")
- * if fdfden <= 0:
- * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<<
- * if fnonc < 0:
- * raise ValueError("nonc < 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_72), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":1981
- * if fdfden <= 0:
- * raise ValueError("dfden <= 0")
- * if fnonc < 0: # <<<<<<<<<<<<<<
- * raise ValueError("nonc < 0")
- * return cont3_array_sc(self.internal_state, rk_noncentral_f, size,
- */
- __pyx_t_1 = (__pyx_v_fnonc < 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1982
- * raise ValueError("dfden <= 0")
- * if fnonc < 0:
- * raise ValueError("nonc < 0") # <<<<<<<<<<<<<<
- * return cont3_array_sc(self.internal_state, rk_noncentral_f, size,
- * fdfnum, fdfden, fnonc)
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_74), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":1983
- * if fnonc < 0:
- * raise ValueError("nonc < 0")
- * return cont3_array_sc(self.internal_state, rk_noncentral_f, size, # <<<<<<<<<<<<<<
- * fdfnum, fdfden, fnonc)
- *
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "mtrand.pyx":1984
- * raise ValueError("nonc < 0")
- * return cont3_array_sc(self.internal_state, rk_noncentral_f, size,
- * fdfnum, fdfden, fnonc) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __pyx_t_2 = __pyx_f_6mtrand_cont3_array_sc(__pyx_v_self->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_fdfnum, __pyx_v_fdfden, __pyx_v_fnonc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":1986
- * fdfnum, fdfden, fnonc)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":1988
- * PyErr_Clear()
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1988; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_odfnum = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1989
- *
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- *
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1989; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_odfden = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":1990
- * odfnum = <ndarray>PyArray_FROM_OTF(dfnum, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- *
- * if np.any(np.less_equal(odfnum, 1.0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_ononc = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":1992
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- *
- * if np.any(np.less_equal(odfnum, 1.0)): # <<<<<<<<<<<<<<
- * raise ValueError("dfnum <= 1")
- * if np.any(np.less_equal(odfden, 0.0)):
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_odfnum));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odfnum));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_odfnum));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1993
- *
- * if np.any(np.less_equal(odfnum, 1.0)):
- * raise ValueError("dfnum <= 1") # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0")
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_75), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":1994
- * if np.any(np.less_equal(odfnum, 1.0)):
- * raise ValueError("dfnum <= 1")
- * if np.any(np.less_equal(odfden, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("dfden <= 0")
- * if np.any(np.less(ononc, 0.0)):
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_v_odfden));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_odfden));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_odfden));
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1995
- * raise ValueError("dfnum <= 1")
- * if np.any(np.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<<
- * if np.any(np.less(ononc, 0.0)):
- * raise ValueError("nonc < 0")
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_76), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "mtrand.pyx":1996
- * if np.any(np.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0")
- * if np.any(np.less(ononc, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("nonc < 0")
- * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_ononc));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ononc));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_ononc));
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":1997
- * raise ValueError("dfden <= 0")
- * if np.any(np.less(ononc, 0.0)):
- * raise ValueError("nonc < 0") # <<<<<<<<<<<<<<
- * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,
- * odfden, ononc)
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_77), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L9;
- }
- __pyx_L9:;
-
- /* "mtrand.pyx":1998
- * if np.any(np.less(ononc, 0.0)):
- * raise ValueError("nonc < 0")
- * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum, # <<<<<<<<<<<<<<
- * odfden, ononc)
- *
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "mtrand.pyx":1999
- * raise ValueError("nonc < 0")
- * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,
- * odfden, ononc) # <<<<<<<<<<<<<<
- *
- * def chisquare(self, df, size=None):
- */
- __pyx_t_3 = __pyx_f_6mtrand_cont3_array(__pyx_v_self->internal_state, rk_noncentral_f, __pyx_v_size, __pyx_v_odfnum, __pyx_v_odfden, __pyx_v_ononc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.noncentral_f", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_odfnum);
- __Pyx_XDECREF((PyObject *)__pyx_v_odfden);
- __Pyx_XDECREF((PyObject *)__pyx_v_ononc);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_53chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_52chisquare[] = "\n chisquare(df, size=None)\n\n Draw samples from a chi-square distribution.\n\n When `df` independent random variables, each with standard normal\n distributions (mean 0, variance 1), are squared and summed, the\n resulting distribution is chi-square (see Notes). This distribution\n 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 `NIST/SEMATECH e-Handbook of Statistical Methods\n <http://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm>`_\n\n Examples\n --------\n >>> np.random.chisquare(2,4)\n array([ 1.89920014, 9.00867716, 3.13710533, 5.62318272])\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_53chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_df = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("chisquare (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__df,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
-
- /* "mtrand.pyx":2001
- * odfden, ononc)
- *
- * def chisquare(self, df, size=None): # <<<<<<<<<<<<<<
- * """
- * chisquare(df, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__df)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "chisquare") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_df = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("chisquare", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.chisquare", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_52chisquare(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_df, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_52chisquare(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_df, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_odf = 0;
- double __pyx_v_fdf;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("chisquare", 0);
-
- /* "mtrand.pyx":2066
- * cdef double fdf
- *
- * fdf = PyFloat_AsDouble(df) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fdf <= 0:
- */
- __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);
-
- /* "mtrand.pyx":2067
- *
- * fdf = PyFloat_AsDouble(df)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fdf <= 0:
- * raise ValueError("df <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2068
- * fdf = PyFloat_AsDouble(df)
- * if not PyErr_Occurred():
- * if fdf <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("df <= 0")
- * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf)
- */
- __pyx_t_1 = (__pyx_v_fdf <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2069
- * if not PyErr_Occurred():
- * if fdf <= 0:
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_79), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":2070
- * if fdf <= 0:
- * raise ValueError("df <= 0")
- * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_chisquare, __pyx_v_size, __pyx_v_fdf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":2072
- * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":2074
- * PyErr_Clear()
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_odf = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":2075
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odf, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("df <= 0")
- * return cont1_array(self.internal_state, rk_chisquare, size, odf)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_odf));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odf));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_odf));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2076
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_chisquare, size, odf)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_80), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":2077
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0")
- * return cont1_array(self.internal_state, rk_chisquare, size, odf) # <<<<<<<<<<<<<<
- *
- * def noncentral_chisquare(self, df, nonc, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_chisquare, __pyx_v_size, __pyx_v_odf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2077; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.chisquare", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_odf);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_55noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_54noncentral_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, should be >= 1.\n nonc : float\n Non-centrality, should be > 0.\n size : int or tuple of ints\n Shape of the output.\n\n Notes\n -----\n The probability density function for the noncentral Chi-square distribution\n is\n\n .. math:: P(x;df,nonc) = \\sum^{\\infty}_{i=0}\n \\frac{e^{-nonc/2}(nonc/2)^{i}}{i!}P_{Y_{df+2i}}(x),\n\n where :math:`Y_{q}` is the Chi-square with q degrees of freedom.\n\n In Delhi (2007), it is noted that the noncentral chi-square is useful in\n bombing and coverage problems, the probability of killing the point target\n given by the noncentral chi-squared distribution.\n\n References\n ----------\n .. [1] Delhi, M.S. Holla, \"On a noncentral chi-square distribution in the\n analysis of weapon systems effectiveness\", Metrika, Volume 15,\n Number 1 / December, 1970.\n .. [2] Wikipedia, \"Noncentral chi-square distribution\"\n http://en.wikipedia.org/wiki/Noncentral_chi-square_distribution\n\n Examples\n --------\n Draw values from the distribution and plot the histogram\n\n >>> import matplotlib.pyplot as plt\n >>> values = plt.hist(np.random.noncentral_chisquare(3, 20, 100000),\n ... bins=200, normed=True)\n >>> plt.show()\n\n Draw values from a noncentral chisquare with very small noncentrality,\n and compare to a chisquare.\n\n >>> plt.figure()\n >>> values = plt.hist(np.random.noncentral_chisquare(3, .0000001, 100000),\n "" ... bins=np.arange(0., 25, .1), normed=True)\n >>> values2 = plt.hist(np.random.chisquare(3, 100000),\n ... bins=np.arange(0., 25, .1), normed=True)\n >>> plt.plot(values[1][0:-1], values[0]-values2[0], 'ob')\n >>> plt.show()\n\n Demonstrate how large values of non-centrality lead to a more symmetric\n distribution.\n\n >>> plt.figure()\n >>> values = plt.hist(np.random.noncentral_chisquare(3, 20, 100000),\n ... bins=200, normed=True)\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_55noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_df = 0;
- PyObject *__pyx_v_nonc = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("noncentral_chisquare (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__df,&__pyx_n_s__nonc,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
-
- /* "mtrand.pyx":2079
- * return cont1_array(self.internal_state, rk_chisquare, size, odf)
- *
- * def noncentral_chisquare(self, df, nonc, size=None): # <<<<<<<<<<<<<<
- * """
- * noncentral_chisquare(df, nonc, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__df)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nonc)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("noncentral_chisquare", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "noncentral_chisquare") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_df = values[0];
- __pyx_v_nonc = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("noncentral_chisquare", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.noncentral_chisquare", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_df, __pyx_v_nonc, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_54noncentral_chisquare(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_df, PyObject *__pyx_v_nonc, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_odf = 0;
- PyArrayObject *__pyx_v_ononc = 0;
- double __pyx_v_fdf;
- double __pyx_v_fnonc;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("noncentral_chisquare", 0);
-
- /* "mtrand.pyx":2150
- * cdef ndarray odf, ononc
- * cdef double fdf, fnonc
- * fdf = PyFloat_AsDouble(df) # <<<<<<<<<<<<<<
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred():
- */
- __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);
-
- /* "mtrand.pyx":2151
- * cdef double fdf, fnonc
- * fdf = PyFloat_AsDouble(df)
- * fnonc = PyFloat_AsDouble(nonc) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fdf <= 1:
- */
- __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc);
-
- /* "mtrand.pyx":2152
- * fdf = PyFloat_AsDouble(df)
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fdf <= 1:
- * raise ValueError("df <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2153
- * fnonc = PyFloat_AsDouble(nonc)
- * if not PyErr_Occurred():
- * if fdf <= 1: # <<<<<<<<<<<<<<
- * raise ValueError("df <= 0")
- * if fnonc <= 0:
- */
- __pyx_t_1 = (__pyx_v_fdf <= 1.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2154
- * if not PyErr_Occurred():
- * if fdf <= 1:
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * if fnonc <= 0:
- * raise ValueError("nonc <= 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_81), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":2155
- * if fdf <= 1:
- * raise ValueError("df <= 0")
- * if fnonc <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("nonc <= 0")
- * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,
- */
- __pyx_t_1 = (__pyx_v_fnonc <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2156
- * raise ValueError("df <= 0")
- * if fnonc <= 0:
- * raise ValueError("nonc <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,
- * size, fdf, fnonc)
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_83), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":2157
- * if fnonc <= 0:
- * raise ValueError("nonc <= 0")
- * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare, # <<<<<<<<<<<<<<
- * size, fdf, fnonc)
- *
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "mtrand.pyx":2158
- * raise ValueError("nonc <= 0")
- * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,
- * size, fdf, fnonc) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_fdf, __pyx_v_fnonc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":2160
- * size, fdf, fnonc)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":2162
- * PyErr_Clear()
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odf, 0.0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_odf = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":2163
- *
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 1")
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_ononc = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":2164
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odf, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("df <= 1")
- * if np.any(np.less_equal(ononc, 0.0)):
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_odf));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odf));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_odf));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2165
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 1") # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(ononc, 0.0)):
- * raise ValueError("nonc < 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_85), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":2166
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 1")
- * if np.any(np.less_equal(ononc, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("nonc < 0")
- * return cont2_array(self.internal_state, rk_noncentral_chisquare, size,
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_v_ononc));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_ononc));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_ononc));
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2167
- * raise ValueError("df <= 1")
- * if np.any(np.less_equal(ononc, 0.0)):
- * raise ValueError("nonc < 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_noncentral_chisquare, size,
- * odf, ononc)
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_86), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":2168
- * if np.any(np.less_equal(ononc, 0.0)):
- * raise ValueError("nonc < 0")
- * return cont2_array(self.internal_state, rk_noncentral_chisquare, size, # <<<<<<<<<<<<<<
- * odf, ononc)
- *
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "mtrand.pyx":2169
- * raise ValueError("nonc < 0")
- * return cont2_array(self.internal_state, rk_noncentral_chisquare, size,
- * odf, ononc) # <<<<<<<<<<<<<<
- *
- * def standard_cauchy(self, size=None):
- */
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_noncentral_chisquare, __pyx_v_size, __pyx_v_odf, __pyx_v_ononc); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.noncentral_chisquare", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_odf);
- __Pyx_XDECREF((PyObject *)__pyx_v_ononc);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_57standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_56standard_cauchy[] = "\n standard_cauchy(size=None)\n\n Standard Cauchy distribution with mode = 0.\n\n Also known as the Lorentz distribution.\n\n Parameters\n ----------\n size : int or tuple of ints\n Shape of the output.\n\n Returns\n -------\n samples : ndarray or scalar\n The drawn samples.\n\n Notes\n -----\n The probability density function for the full Cauchy distribution is\n\n .. math:: P(x; x_0, \\gamma) = \\frac{1}{\\pi \\gamma \\bigl[ 1+\n (\\frac{x-x_0}{\\gamma})^2 \\bigr] }\n\n and the Standard Cauchy distribution just sets :math:`x_0=0` and\n :math:`\\gamma=1`\n\n The Cauchy distribution arises in the solution to the driven harmonic\n oscillator problem, and also describes spectral line broadening. It\n also describes the distribution of values at which a line tilted at\n a random angle will cut the x axis.\n\n When studying hypothesis tests that assume normality, seeing how the\n tests perform on data from a Cauchy distribution is a good indicator of\n their sensitivity to a heavy-tailed distribution, since the Cauchy looks\n very much like a Gaussian distribution, but with heavier tails.\n\n References\n ----------\n .. [1] NIST/SEMATECH e-Handbook of Statistical Methods, \"Cauchy\n Distribution\",\n http://www.itl.nist.gov/div898/handbook/eda/section3/eda3663.htm\n .. [2] Weisstein, Eric W. \"Cauchy Distribution.\" From MathWorld--A\n Wolfram Web Resource.\n http://mathworld.wolfram.com/CauchyDistribution.html\n .. [3] Wikipedia, \"Cauchy distribution\"\n http://en.wikipedia.org/wiki/Cauchy_distribution\n\n Examples\n --------\n Draw samples and plot the distribution:\n\n >>> s = np.random.standard_cauchy(1000000)\n >>> s = s[(s>-25) & (s<""25)] # truncate distribution so it plots well\n >>> plt.hist(s, bins=100)\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_57standard_cauchy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("standard_cauchy (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__size,0};
- PyObject* values[1] = {0};
-
- /* "mtrand.pyx":2171
- * odf, ononc)
- *
- * def standard_cauchy(self, size=None): # <<<<<<<<<<<<<<
- * """
- * standard_cauchy(size=None)
- */
- values[0] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[0] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_cauchy") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_size = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("standard_cauchy", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2171; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.standard_cauchy", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_56standard_cauchy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_56standard_cauchy(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_size) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("standard_cauchy", 0);
-
- /* "mtrand.pyx":2230
- *
- * """
- * return cont0_array(self.internal_state, rk_standard_cauchy, size) # <<<<<<<<<<<<<<
- *
- * def standard_t(self, df, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_f_6mtrand_cont0_array(__pyx_v_self->internal_state, rk_standard_cauchy, __pyx_v_size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("mtrand.RandomState.standard_cauchy", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_59standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_58standard_t[] = "\n standard_t(df, size=None)\n\n Standard Student's t distribution with df degrees of freedom.\n\n A special case of the hyperbolic distribution.\n As `df` gets large, the result resembles that of the standard normal\n distribution (`standard_normal`).\n\n Parameters\n ----------\n df : int\n Degrees of freedom, should be > 0.\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single value is\n returned.\n\n Returns\n -------\n samples : ndarray or scalar\n Drawn samples.\n\n Notes\n -----\n The probability density function for the t distribution is\n\n .. math:: P(x, df) = \\frac{\\Gamma(\\frac{df+1}{2})}{\\sqrt{\\pi df}\n \\Gamma(\\frac{df}{2})}\\Bigl( 1+\\frac{x^2}{df} \\Bigr)^{-(df+1)/2}\n\n The t test is based on an assumption that the data come from a Normal\n distribution. The t test provides a way to test whether the sample mean\n (that is the mean calculated from the data) is a good estimate of the true\n mean.\n\n The derivation of the t-distribution was forst published in 1908 by William\n Gisset while working for the Guinness Brewery in Dublin. Due to proprietary\n issues, he had to publish under a pseudonym, and so he used the name\n Student.\n\n References\n ----------\n .. [1] Dalgaard, Peter, \"Introductory Statistics With R\",\n Springer, 2002.\n .. [2] Wikipedia, \"Student's t-distribution\"\n http://en.wikipedia.org/wiki/Student's_t-distribution\n\n Examples\n --------\n From Dalgaard page 83 [1]_, suppose the daily energy intake for 11\n women in Kj is:\n\n >>> intake = np.array([5260., 5470, 5640, 6180, 6390, 6515, 6805, 7515, \\\n ... 7515, 8230, 8770])\n\n Doe""s their energy intake deviate systematically from the recommended\n value of 7725 kJ?\n\n We have 10 degrees of freedom, so is the sample mean within 95% of the\n recommended value?\n\n >>> s = np.random.standard_t(10, size=100000)\n >>> np.mean(intake)\n 6753.636363636364\n >>> intake.std(ddof=1)\n 1142.1232221373727\n\n Calculate the t statistic, setting the ddof parameter to the unbiased\n value so the divisor in the standard deviation will be degrees of\n freedom, N-1.\n\n >>> t = (np.mean(intake)-7725)/(intake.std(ddof=1)/np.sqrt(len(intake)))\n >>> import matplotlib.pyplot as plt\n >>> h = plt.hist(s, bins=100, normed=True)\n\n For a one-sided t-test, how far out in the distribution does the t\n statistic appear?\n\n >>> >>> np.sum(s<t) / float(len(s))\n 0.0090699999999999999 #random\n\n So the p-value is about 0.009, which says the null hypothesis has a\n probability of about 99% of being true.\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_59standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_df = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("standard_t (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__df,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
-
- /* "mtrand.pyx":2232
- * return cont0_array(self.internal_state, rk_standard_cauchy, size)
- *
- * def standard_t(self, df, size=None): # <<<<<<<<<<<<<<
- * """
- * standard_t(df, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__df)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "standard_t") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_df = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("standard_t", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2232; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.standard_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_58standard_t(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_df, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_58standard_t(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_df, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_odf = 0;
- double __pyx_v_fdf;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("standard_t", 0);
-
- /* "mtrand.pyx":2320
- * cdef double fdf
- *
- * fdf = PyFloat_AsDouble(df) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fdf <= 0:
- */
- __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df);
-
- /* "mtrand.pyx":2321
- *
- * fdf = PyFloat_AsDouble(df)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fdf <= 0:
- * raise ValueError("df <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2322
- * fdf = PyFloat_AsDouble(df)
- * if not PyErr_Occurred():
- * if fdf <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("df <= 0")
- * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf)
- */
- __pyx_t_1 = (__pyx_v_fdf <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2323
- * if not PyErr_Occurred():
- * if fdf <= 0:
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_87), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":2324
- * if fdf <= 0:
- * raise ValueError("df <= 0")
- * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_standard_t, __pyx_v_size, __pyx_v_fdf); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":2326
- * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":2328
- * PyErr_Clear()
- *
- * odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_df, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_odf = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":2329
- *
- * odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odf, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("df <= 0")
- * return cont1_array(self.internal_state, rk_standard_t, size, odf)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_odf));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_odf));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_odf));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2330
- * odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_standard_t, size, odf)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_88), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":2331
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0")
- * return cont1_array(self.internal_state, rk_standard_t, size, odf) # <<<<<<<<<<<<<<
- *
- * def vonmises(self, mu, kappa, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_standard_t, __pyx_v_size, __pyx_v_odf); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.standard_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_odf);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_61vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_60vonmises[] = "\n vonmises(mu, kappa, size=None)\n\n Draw samples from a von Mises distribution.\n\n Samples are drawn from a von Mises distribution with specified mode\n (mu) 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 unit\n circle. It may be thought of as the circular analogue of the normal\n distribution.\n\n Parameters\n ----------\n mu : float\n Mode (\"center\") of the distribution.\n kappa : float\n Dispersion of the distribution, has to be >=0.\n size : int or tuple of 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 : scalar or ndarray\n The returned samples, which are in the interval [-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 is named for Richard Edler von Mises, who was 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 Abramowitz, M. and Stegun, I. A. (ed.), *Handbook of Mathematical\n Functions*, New York: Dover, 1965.\n\n "" von Mises, R., *Mathematical Theory of Probability and Statistics*,\n New York: Academic Press, 1964.\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 = np.arange(-np.pi, np.pi, 2*np.pi/50.)\n >>> y = -np.exp(kappa*np.cos(x-mu))/(2*np.pi*sps.jn(0,kappa))\n >>> plt.plot(x, y/max(y), linewidth=2, color='r')\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_61vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_mu = 0;
- PyObject *__pyx_v_kappa = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("vonmises (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mu,&__pyx_n_s__kappa,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
-
- /* "mtrand.pyx":2333
- * return cont1_array(self.internal_state, rk_standard_t, size, odf)
- *
- * def vonmises(self, mu, kappa, size=None): # <<<<<<<<<<<<<<
- * """
- * vonmises(mu, kappa, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mu)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__kappa)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("vonmises", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "vonmises") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_mu = values[0];
- __pyx_v_kappa = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("vonmises", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.vonmises", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_60vonmises(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_mu, __pyx_v_kappa, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_60vonmises(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_mu, PyObject *__pyx_v_kappa, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_omu = 0;
- PyArrayObject *__pyx_v_okappa = 0;
- double __pyx_v_fmu;
- double __pyx_v_fkappa;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("vonmises", 0);
-
- /* "mtrand.pyx":2412
- * cdef double fmu, fkappa
- *
- * fmu = PyFloat_AsDouble(mu) # <<<<<<<<<<<<<<
- * fkappa = PyFloat_AsDouble(kappa)
- * if not PyErr_Occurred():
- */
- __pyx_v_fmu = PyFloat_AsDouble(__pyx_v_mu);
-
- /* "mtrand.pyx":2413
- *
- * fmu = PyFloat_AsDouble(mu)
- * fkappa = PyFloat_AsDouble(kappa) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fkappa < 0:
- */
- __pyx_v_fkappa = PyFloat_AsDouble(__pyx_v_kappa);
-
- /* "mtrand.pyx":2414
- * fmu = PyFloat_AsDouble(mu)
- * fkappa = PyFloat_AsDouble(kappa)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fkappa < 0:
- * raise ValueError("kappa < 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2415
- * fkappa = PyFloat_AsDouble(kappa)
- * if not PyErr_Occurred():
- * if fkappa < 0: # <<<<<<<<<<<<<<
- * raise ValueError("kappa < 0")
- * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa)
- */
- __pyx_t_1 = (__pyx_v_fkappa < 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2416
- * if not PyErr_Occurred():
- * if fkappa < 0:
- * raise ValueError("kappa < 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_90), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":2417
- * if fkappa < 0:
- * raise ValueError("kappa < 0")
- * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_vonmises, __pyx_v_size, __pyx_v_fmu, __pyx_v_fkappa); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":2419
- * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * omu = <ndarray> PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":2421
- * PyErr_Clear()
- *
- * omu = <ndarray> PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(okappa, 0.0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_mu, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_omu = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":2422
- *
- * omu = <ndarray> PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less(okappa, 0.0)):
- * raise ValueError("kappa < 0")
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2422; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_okappa = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":2423
- * omu = <ndarray> PyArray_FROM_OTF(mu, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(okappa, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("kappa < 0")
- * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_okappa));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_okappa));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_okappa));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2424
- * okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(okappa, 0.0)):
- * raise ValueError("kappa < 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_91), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":2425
- * if np.any(np.less(okappa, 0.0)):
- * raise ValueError("kappa < 0")
- * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa) # <<<<<<<<<<<<<<
- *
- * def pareto(self, a, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_vonmises, __pyx_v_size, __pyx_v_omu, __pyx_v_okappa); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.vonmises", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_omu);
- __Pyx_XDECREF((PyObject *)__pyx_v_okappa);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_63pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_62pareto[] = "\n pareto(a, size=None)\n\n Draw samples from a Pareto II or Lomax distribution with specified shape.\n\n The Lomax or Pareto II distribution is a shifted Pareto distribution. The\n classical Pareto distribution can be obtained from the Lomax distribution\n by adding the location parameter m, see below. The smallest value of the\n Lomax distribution is zero while for the classical Pareto distribution it\n is m, where the standard Pareto distribution has location m=1.\n Lomax can also be considered as a simplified version of the Generalized\n Pareto distribution (available in SciPy), with the scale set to one and\n the location set to zero.\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.lomax.pdf : probability density function,\n distribution or cumulative density function, etc.\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 probl""ems.\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 ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_63pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_a = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("pareto (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
-
- /* "mtrand.pyx":2427
- * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa)
- *
- * def pareto(self, a, size=None): # <<<<<<<<<<<<<<
- * """
- * pareto(a, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pareto") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_a = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("pareto", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2427; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.pareto", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_62pareto(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_a, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_62pareto(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oa = 0;
- double __pyx_v_fa;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("pareto", 0);
-
- /* "mtrand.pyx":2510
- * cdef double fa
- *
- * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fa <= 0:
- */
- __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
-
- /* "mtrand.pyx":2511
- *
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fa <= 0:
- * raise ValueError("a <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2512
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred():
- * if fa <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_pareto, size, fa)
- */
- __pyx_t_1 = (__pyx_v_fa <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2513
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_pareto, size, fa)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_92), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":2514
- * if fa <= 0:
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_pareto, size, fa) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_pareto, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":2516
- * return cont1_array_sc(self.internal_state, rk_pareto, size, fa)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":2518
- * PyErr_Clear()
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oa = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":2519
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_pareto, size, oa)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2520
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_pareto, size, oa)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_93), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":2521
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_pareto, size, oa) # <<<<<<<<<<<<<<
- *
- * def weibull(self, a, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_pareto, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.pareto", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oa);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_65weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_64weibull[] = "\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 `a`.\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 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_max\n scipy.stats.distributions.weibull_min\n scipy.stats.distributions.genextreme\n gumbel\n\n Notes\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 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 General""stabens 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 >>> x = np.arange(1,100.)/50.\n >>> def weib(x,n,a):\n ... return (a / n) * (x / n)**(a - 1) * np.exp(-(x / n)**a)\n\n >>> count, bins, ignored = plt.hist(np.random.weibull(5.,1000))\n >>> x = np.arange(1,100.)/50.\n >>> scale = count.max()/weib(x, 1., 5.).max()\n >>> plt.plot(x, weib(x, 1., 5.)*scale)\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_65weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_a = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("weibull (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
-
- /* "mtrand.pyx":2523
- * return cont1_array(self.internal_state, rk_pareto, size, oa)
- *
- * def weibull(self, a, size=None): # <<<<<<<<<<<<<<
- * """
- * weibull(a, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "weibull") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_a = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("weibull", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2523; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.weibull", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_64weibull(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_a, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_64weibull(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oa = 0;
- double __pyx_v_fa;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("weibull", 0);
-
- /* "mtrand.pyx":2610
- * cdef double fa
- *
- * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fa <= 0:
- */
- __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
-
- /* "mtrand.pyx":2611
- *
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fa <= 0:
- * raise ValueError("a <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2612
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred():
- * if fa <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_weibull, size, fa)
- */
- __pyx_t_1 = (__pyx_v_fa <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2613
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_weibull, size, fa)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":2614
- * if fa <= 0:
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_weibull, size, fa) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_weibull, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":2616
- * return cont1_array_sc(self.internal_state, rk_weibull, size, fa)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":2618
- * PyErr_Clear()
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oa = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":2619
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_weibull, size, oa)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2620
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_weibull, size, oa)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_95), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":2621
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_weibull, size, oa) # <<<<<<<<<<<<<<
- *
- * def power(self, a, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_weibull, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.weibull", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oa);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_67power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_66power[] = "\n power(a, size=None)\n\n Draws samples in [0, 1] from a power distribution with positive\n exponent a - 1.\n\n Also known as the power function distribution.\n\n Parameters\n ----------\n a : float\n parameter, > 0\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 Returns\n -------\n samples : {ndarray, scalar}\n The returned samples lie in [0, 1].\n\n Raises\n ------\n ValueError\n If a<1.\n\n Notes\n -----\n The probability density function is\n\n .. math:: P(x; a) = ax^{a-1}, 0 \\le x \\le 1, a>0.\n\n The power function distribution is just the inverse of the Pareto\n distribution. It may also be seen as a special case of the Beta\n distribution.\n\n It is used, for example, in modeling the over-reporting of insurance\n claims.\n\n References\n ----------\n .. [1] Christian Kleiber, Samuel Kotz, \"Statistical size distributions\n in economics and actuarial sciences\", Wiley, 2003.\n .. [2] Heckert, N. A. and Filliben, James J. (2003). NIST Handbook 148:\n Dataplot Reference Manual, Volume 2: Let Subcommands and Library\n Functions\", National Institute of Standards and Technology Handbook\n Series, June 2003.\n http://www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/powpdf.pdf\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> a = 5. # shape\n >>> samples = 1000\n >>> s = np.random.power(a, samples)\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, bins=""30)\n >>> x = np.linspace(0, 1, 100)\n >>> y = a*x**(a-1.)\n >>> normed_y = samples*np.diff(bins)[0]*y\n >>> plt.plot(x, normed_y)\n >>> plt.show()\n\n Compare the power function distribution to the inverse of the Pareto.\n\n >>> from scipy import stats\n >>> rvs = np.random.power(5, 1000000)\n >>> rvsp = np.random.pareto(5, 1000000)\n >>> xx = np.linspace(0,1,100)\n >>> powpdf = stats.powerlaw.pdf(xx,5)\n\n >>> plt.figure()\n >>> plt.hist(rvs, bins=50, normed=True)\n >>> plt.plot(xx,powpdf,'r-')\n >>> plt.title('np.random.power(5)')\n\n >>> plt.figure()\n >>> plt.hist(1./(1.+rvsp), bins=50, normed=True)\n >>> plt.plot(xx,powpdf,'r-')\n >>> plt.title('inverse of 1 + np.random.pareto(5)')\n\n >>> plt.figure()\n >>> plt.hist(1./(1.+rvsp), bins=50, normed=True)\n >>> plt.plot(xx,powpdf,'r-')\n >>> plt.title('inverse of stats.pareto(5)')\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_67power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_a = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("power (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
-
- /* "mtrand.pyx":2623
- * return cont1_array(self.internal_state, rk_weibull, size, oa)
- *
- * def power(self, a, size=None): # <<<<<<<<<<<<<<
- * """
- * power(a, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "power") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_a = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("power", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2623; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.power", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_66power(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_a, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_66power(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oa = 0;
- double __pyx_v_fa;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("power", 0);
-
- /* "mtrand.pyx":2719
- * cdef double fa
- *
- * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fa <= 0:
- */
- __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
-
- /* "mtrand.pyx":2720
- *
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fa <= 0:
- * raise ValueError("a <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2721
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred():
- * if fa <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_power, size, fa)
- */
- __pyx_t_1 = (__pyx_v_fa <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2722
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_power, size, fa)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_96), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":2723
- * if fa <= 0:
- * raise ValueError("a <= 0")
- * return cont1_array_sc(self.internal_state, rk_power, size, fa) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_power, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":2725
- * return cont1_array_sc(self.internal_state, rk_power, size, fa)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":2727
- * PyErr_Clear()
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oa = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":2728
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_power, size, oa)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2729
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_power, size, oa)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_97), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":2730
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0")
- * return cont1_array(self.internal_state, rk_power, size, oa) # <<<<<<<<<<<<<<
- *
- * def laplace(self, loc=0.0, scale=1.0, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_power, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.power", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oa);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_69laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_68laplace[] = "\n laplace(loc=0.0, scale=1.0, size=None)\n\n Draw samples from the Laplace or double exponential distribution with\n specified location (or mean) and scale (decay).\n\n The Laplace distribution is similar to the Gaussian/normal distribution,\n but is sharper at the peak and has fatter tails. It represents the\n difference between two independent, identically distributed exponential\n random variables.\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 Notes\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 first law of Laplace, from 1774, states that the frequency of an error\n can be expressed as an exponential function of the absolute magnitude of\n the error, which leads to the Laplace distribution. For many problems in\n Economics and Health sciences, this distribution seems to model the data\n better than the standard Gaussian distribution\n\n\n References\n ----------\n .. [1] Abramowitz, M. and Stegun, I. A. (Eds.). Handbook of Mathematical\n Functions with Formulas, Graphs, and Mathematical Tables, 9th\n printing. New York: Dover, 1972.\n\n .. [2] The Laplace distribution and generalizations\n By Samuel Kotz, Tomasz J. Kozubowski, Krzysztof Podgorski,\n Birkhauser, 2001.\n\n .. [3] Weisstein, Eric W. \"Laplace Distribution.\"\n From MathWorld--A Wolfram Web Resource.\n http://mathworld.wolfram.com/LaplaceDistribution.html\n\n .. [4] Wikipedia, \"Laplace distribution\",\n http://en.wikipedia.org/wik""i/Laplace_distribution\n\n Examples\n --------\n Draw samples from the distribution\n\n >>> loc, scale = 0., 1.\n >>> s = np.random.laplace(loc, scale, 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 >>> x = np.arange(-8., 8., .01)\n >>> pdf = np.exp(-abs(x-loc/scale))/(2.*scale)\n >>> plt.plot(x, pdf)\n\n Plot Gaussian for comparison:\n\n >>> g = (1/(scale * np.sqrt(2 * np.pi)) * \n ... np.exp( - (x - loc)**2 / (2 * scale**2) ))\n >>> plt.plot(x,g)\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_69laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_loc = 0;
- PyObject *__pyx_v_scale = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("laplace (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__loc,&__pyx_n_s__scale,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
- values[0] = __pyx_k_98;
- values[1] = __pyx_k_99;
-
- /* "mtrand.pyx":2732
- * return cont1_array(self.internal_state, rk_power, size, oa)
- *
- * def laplace(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * laplace(loc=0.0, scale=1.0, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loc);
- if (value) { values[0] = value; kw_args--; }
- }
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale);
- if (value) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "laplace") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2732; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_loc = values[0];
- __pyx_v_scale = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("laplace", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2732; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.laplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_68laplace(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_loc, __pyx_v_scale, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_68laplace(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_scale, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oloc = 0;
- PyArrayObject *__pyx_v_oscale = 0;
- double __pyx_v_floc;
- double __pyx_v_fscale;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("laplace", 0);
-
- /* "mtrand.pyx":2808
- * cdef double floc, fscale
- *
- * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
- __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
-
- /* "mtrand.pyx":2809
- *
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fscale <= 0:
- */
- __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
-
- /* "mtrand.pyx":2810
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2811
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale)
- */
- __pyx_t_1 = (__pyx_v_fscale <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2812
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_100), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":2813
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_laplace, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":2815
- * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":2816
- *
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_oloc = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":2817
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":2818
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2819
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_101), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":2820
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale) # <<<<<<<<<<<<<<
- *
- * def gumbel(self, loc=0.0, scale=1.0, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_laplace, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.laplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oloc);
- __Pyx_XDECREF((PyObject *)__pyx_v_oscale);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_71gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_70gumbel[] = "\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 and scale.\n For more information on the Gumbel distribution, see Notes and References\n below.\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 Returns\n -------\n out : ndarray\n The samples\n\n See Also\n --------\n scipy.stats.gumbel_l\n scipy.stats.gumbel_r\n scipy.stats.genextreme\n probability density function, distribution, or cumulative density\n function, etc. for each of the above\n weibull\n\n Notes\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.\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` is\n 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\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 Gumbel, E. J., *Statistics of Extremes*, New York: Columbia University\n Press, 1958.\n\n Reiss, R.-D. and Thomas, M., *Statistical Analysis of Extreme Values from\n Insurance, Finance, Hydrology and Other Fields*, Basel: Birkhauser Verlag,\n 2001.\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 ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_71gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_loc = 0;
- PyObject *__pyx_v_scale = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("gumbel (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__loc,&__pyx_n_s__scale,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
- values[0] = __pyx_k_102;
- values[1] = __pyx_k_103;
-
- /* "mtrand.pyx":2822
- * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale)
- *
- * def gumbel(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * gumbel(loc=0.0, scale=1.0, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loc);
- if (value) { values[0] = value; kw_args--; }
- }
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale);
- if (value) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "gumbel") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_loc = values[0];
- __pyx_v_scale = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("gumbel", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.gumbel", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_70gumbel(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_loc, __pyx_v_scale, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_70gumbel(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_scale, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oloc = 0;
- PyArrayObject *__pyx_v_oscale = 0;
- double __pyx_v_floc;
- double __pyx_v_fscale;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("gumbel", 0);
-
- /* "mtrand.pyx":2939
- * cdef double floc, fscale
- *
- * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
- __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
-
- /* "mtrand.pyx":2940
- *
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fscale <= 0:
- */
- __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
-
- /* "mtrand.pyx":2941
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2942
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale)
- */
- __pyx_t_1 = (__pyx_v_fscale <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2943
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_104), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":2944
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_gumbel, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":2946
- * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":2947
- *
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_oloc = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":2948
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":2949
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":2950
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_105), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":2951
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale) # <<<<<<<<<<<<<<
- *
- * def logistic(self, loc=0.0, scale=1.0, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_gumbel, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.gumbel", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oloc);
- __Pyx_XDECREF((PyObject *)__pyx_v_oscale);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_73logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_72logistic[] = "\n logistic(loc=0.0, scale=1.0, size=None)\n\n Draw samples from a Logistic distribution.\n\n Samples are drawn from a Logistic distribution with specified\n parameters, loc (location or mean, also median), and scale (>0).\n\n Parameters\n ----------\n loc : float\n\n scale : float > 0.\n\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 where the values are all integers in [0, n].\n\n See Also\n --------\n scipy.stats.distributions.logistic : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Logistic distribution is\n\n .. math:: P(x) = P(x) = \\frac{e^{-(x-\\mu)/s}}{s(1+e^{-(x-\\mu)/s})^2},\n\n where :math:`\\mu` = location and :math:`s` = scale.\n\n The Logistic distribution is used in Extreme Value problems where it\n can act as a mixture of Gumbel distributions, in Epidemiology, and by\n the World Chess Federation (FIDE) where it is used in the Elo ranking\n system, assuming the performance of each player is a logistically\n distributed random variable.\n\n References\n ----------\n .. [1] Reiss, R.-D. and Thomas M. (2001), Statistical Analysis of Extreme\n Values, from Insurance, Finance, Hydrology and Other Fields,\n Birkhauser Verlag, Basel, pp 132-133.\n .. [2] Weisstein, Eric W. \"Logistic Distribution.\" From\n MathWorld--A Wolfram Web Resource.\n http://mathworld.wolfram.com/LogisticDistribution.html\n .. [3] Wikipedia, \"Logistic-distribution\",\n http://en.wikipedia.org/wiki/Logistic-distribution\n\n Examples\n "" --------\n Draw samples from the distribution:\n\n >>> loc, scale = 10, 1\n >>> s = np.random.logistic(loc, scale, 10000)\n >>> count, bins, ignored = plt.hist(s, bins=50)\n\n # plot against distribution\n\n >>> def logist(x, loc, scale):\n ... return exp((loc-x)/scale)/(scale*(1+exp((loc-x)/scale))**2)\n >>> plt.plot(bins, logist(bins, loc, scale)*count.max()/\\\n ... logist(bins, loc, scale).max())\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_73logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_loc = 0;
- PyObject *__pyx_v_scale = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("logistic (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__loc,&__pyx_n_s__scale,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
- values[0] = __pyx_k_106;
- values[1] = __pyx_k_107;
-
- /* "mtrand.pyx":2953
- * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale)
- *
- * def logistic(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * logistic(loc=0.0, scale=1.0, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__loc);
- if (value) { values[0] = value; kw_args--; }
- }
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale);
- if (value) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logistic") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2953; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_loc = values[0];
- __pyx_v_scale = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("logistic", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2953; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.logistic", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_72logistic(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_loc, __pyx_v_scale, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_72logistic(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_loc, PyObject *__pyx_v_scale, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oloc = 0;
- PyArrayObject *__pyx_v_oscale = 0;
- double __pyx_v_floc;
- double __pyx_v_fscale;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("logistic", 0);
-
- /* "mtrand.pyx":3027
- * cdef double floc, fscale
- *
- * floc = PyFloat_AsDouble(loc) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
- __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc);
-
- /* "mtrand.pyx":3028
- *
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fscale <= 0:
- */
- __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
-
- /* "mtrand.pyx":3029
- * floc = PyFloat_AsDouble(loc)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3030
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale)
- */
- __pyx_t_1 = (__pyx_v_fscale <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3031
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":3032
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_logistic, __pyx_v_size, __pyx_v_floc, __pyx_v_fscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":3034
- * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":3035
- *
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_oloc = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":3036
- * PyErr_Clear()
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":3037
- * oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3038
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_109), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":3039
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale) # <<<<<<<<<<<<<<
- *
- * def lognormal(self, mean=0.0, sigma=1.0, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_logistic, __pyx_v_size, __pyx_v_oloc, __pyx_v_oscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3039; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.logistic", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oloc);
- __Pyx_XDECREF((PyObject *)__pyx_v_oscale);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_75lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_74lognormal[] = "\n lognormal(mean=0.0, sigma=1.0, size=None)\n\n Return samples drawn from a log-normal distribution.\n\n Draw samples from a log-normal distribution with specified mean,\n standard deviation, and array shape. Note that the mean and standard\n deviation are not the values for the distribution itself, but of the\n underlying normal distribution it is derived from.\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 Returns\n -------\n samples : ndarray or float\n The desired samples. An array of the same shape as `size` if given,\n if `size` is None a float is returned.\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. The probability density function for the log-normal\n 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\n deviation of the normally distributed logarithm of the variable.\n A log-normal distribution results if a random variable is the *product*\n of a large number of independent, identically-distributed variables in\n the same way that a normal distribution results if the variable is the\n *sum* of a large number of independent, identically-distributed\n variables.\n\n Reference""s\n ----------\n Limpert, E., Stahel, W. A., and Abbt, M., \"Log-normal Distributions\n across the Sciences: Keys and Clues,\" *BioScience*, Vol. 51, No. 5,\n May, 2001. http://stat.ethz.ch/~stahel/lognormal/bioscience.pdf\n\n Reiss, R.D. and Thomas, M., *Statistical Analysis of Extreme Values*,\n Basel: Birkhauser Verlag, 2001, pp. 31-32.\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='mid')\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 probability density function.\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 >>> count, bins, ignored = plt.hist(b, 100, normed=True, align='center')\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, co""lor='r', linewidth=2)\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_75lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_mean = 0;
- PyObject *__pyx_v_sigma = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("lognormal (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mean,&__pyx_n_s__sigma,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
- values[0] = __pyx_k_110;
- values[1] = __pyx_k_111;
-
- /* "mtrand.pyx":3041
- * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale)
- *
- * def lognormal(self, mean=0.0, sigma=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * lognormal(mean=0.0, sigma=1.0, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mean);
- if (value) { values[0] = value; kw_args--; }
- }
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__sigma);
- if (value) { values[1] = value; kw_args--; }
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lognormal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_mean = values[0];
- __pyx_v_sigma = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("lognormal", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.lognormal", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_74lognormal(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_mean, __pyx_v_sigma, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_74lognormal(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_mean, PyObject *__pyx_v_sigma, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_omean = 0;
- PyArrayObject *__pyx_v_osigma = 0;
- double __pyx_v_fmean;
- double __pyx_v_fsigma;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("lognormal", 0);
-
- /* "mtrand.pyx":3146
- * cdef double fmean, fsigma
- *
- * fmean = PyFloat_AsDouble(mean) # <<<<<<<<<<<<<<
- * fsigma = PyFloat_AsDouble(sigma)
- *
- */
- __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean);
-
- /* "mtrand.pyx":3147
- *
- * fmean = PyFloat_AsDouble(mean)
- * fsigma = PyFloat_AsDouble(sigma) # <<<<<<<<<<<<<<
- *
- * if not PyErr_Occurred():
- */
- __pyx_v_fsigma = PyFloat_AsDouble(__pyx_v_sigma);
-
- /* "mtrand.pyx":3149
- * fsigma = PyFloat_AsDouble(sigma)
- *
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fsigma <= 0:
- * raise ValueError("sigma <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3150
- *
- * if not PyErr_Occurred():
- * if fsigma <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("sigma <= 0")
- * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma)
- */
- __pyx_t_1 = (__pyx_v_fsigma <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3151
- * if not PyErr_Occurred():
- * if fsigma <= 0:
- * raise ValueError("sigma <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_113), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":3152
- * if fsigma <= 0:
- * raise ValueError("sigma <= 0")
- * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_lognormal, __pyx_v_size, __pyx_v_fmean, __pyx_v_fsigma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":3154
- * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":3156
- * PyErr_Clear()
- *
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(osigma, 0.0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_omean = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":3157
- *
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(osigma, 0.0)):
- * raise ValueError("sigma <= 0.0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_osigma = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":3158
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(osigma, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("sigma <= 0.0")
- * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_osigma));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_osigma));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_osigma));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3159
- * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(osigma, 0.0)):
- * raise ValueError("sigma <= 0.0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_115), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":3160
- * if np.any(np.less_equal(osigma, 0.0)):
- * raise ValueError("sigma <= 0.0")
- * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma) # <<<<<<<<<<<<<<
- *
- * def rayleigh(self, scale=1.0, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_lognormal, __pyx_v_size, __pyx_v_omean, __pyx_v_osigma); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.lognormal", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_omean);
- __Pyx_XDECREF((PyObject *)__pyx_v_osigma);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_77rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_76rayleigh[] = "\n rayleigh(scale=1.0, size=None)\n\n Draw samples from a Rayleigh distribution.\n\n The :math:`\\chi` and Weibull distributions are generalizations of the\n Rayleigh.\n\n Parameters\n ----------\n scale : scalar\n Scale, also equals the mode. Should be >= 0.\n size : int or tuple of ints, optional\n Shape of the output. Default is None, in which case a single\n value is returned.\n\n Notes\n -----\n The probability density function for the Rayleigh distribution is\n\n .. math:: P(x;scale) = \\frac{x}{scale^2}e^{\\frac{-x^2}{2 \\cdotp scale^2}}\n\n The Rayleigh distribution arises if the wind speed and wind direction are\n both gaussian variables, then the vector wind velocity forms a Rayleigh\n distribution. The Rayleigh distribution is used to model the expected\n output from wind turbines.\n\n References\n ----------\n .. [1] Brighton Webs Ltd., Rayleigh Distribution,\n http://www.brighton-webs.co.uk/distributions/rayleigh.asp\n .. [2] Wikipedia, \"Rayleigh distribution\"\n http://en.wikipedia.org/wiki/Rayleigh_distribution\n\n Examples\n --------\n Draw values from the distribution and plot the histogram\n\n >>> values = hist(np.random.rayleigh(3, 100000), bins=200, normed=True)\n\n Wave heights tend to follow a Rayleigh distribution. If the mean wave\n height is 1 meter, what fraction of waves are likely to be larger than 3\n meters?\n\n >>> meanvalue = 1\n >>> modevalue = np.sqrt(2 / np.pi) * meanvalue\n >>> s = np.random.rayleigh(modevalue, 1000000)\n\n The percentage of waves larger than 3 meters is:\n\n >>> 100.*sum(s>3)/1000000.\n 0.087300000000000003\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_77rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_scale = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("rayleigh (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__scale,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
- values[0] = __pyx_k_116;
-
- /* "mtrand.pyx":3162
- * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma)
- *
- * def rayleigh(self, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * rayleigh(scale=1.0, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale);
- if (value) { values[0] = value; kw_args--; }
- }
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rayleigh") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3162; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_scale = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("rayleigh", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3162; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.rayleigh", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_76rayleigh(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_scale, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_76rayleigh(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_scale, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oscale = 0;
- double __pyx_v_fscale;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("rayleigh", 0);
-
- /* "mtrand.pyx":3220
- * cdef double fscale
- *
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- *
- * if not PyErr_Occurred():
- */
- __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
-
- /* "mtrand.pyx":3222
- * fscale = PyFloat_AsDouble(scale)
- *
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3223
- *
- * if not PyErr_Occurred():
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale)
- */
- __pyx_t_1 = (__pyx_v_fscale <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3224
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_117), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":3225
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont1_array_sc(__pyx_v_self->internal_state, rk_rayleigh, __pyx_v_size, __pyx_v_fscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":3227
- * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":3229
- * PyErr_Clear()
- *
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0.0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oscale = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":3230
- *
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0.0")
- * return cont1_array(self.internal_state, rk_rayleigh, size, oscale)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oscale));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3231
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0.0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_rayleigh, size, oscale)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_119), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":3232
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0.0")
- * return cont1_array(self.internal_state, rk_rayleigh, size, oscale) # <<<<<<<<<<<<<<
- *
- * def wald(self, mean, scale, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_cont1_array(__pyx_v_self->internal_state, rk_rayleigh, __pyx_v_size, __pyx_v_oscale); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.rayleigh", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oscale);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_79wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_78wald[] = "\n wald(mean, scale, size=None)\n\n Draw samples from a Wald, or Inverse Gaussian, distribution.\n\n As the scale approaches infinity, the distribution becomes more like a\n Gaussian.\n\n Some references claim that the Wald is an Inverse Gaussian with mean=1, but\n this is by no means universal.\n\n The Inverse Gaussian distribution was first studied in relationship to\n Brownian motion. In 1956 M.C.K. Tweedie used the name Inverse Gaussian\n because there is an inverse relationship between the time to cover a unit\n distance and distance covered in unit time.\n\n Parameters\n ----------\n mean : scalar\n Distribution mean, should be > 0.\n scale : scalar\n Scale parameter, should be >= 0.\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single value is\n returned.\n\n Returns\n -------\n samples : ndarray or scalar\n Drawn sample, all greater than zero.\n\n Notes\n -----\n The probability density function for the Wald distribution is\n\n .. math:: P(x;mean,scale) = \\sqrt{\\frac{scale}{2\\pi x^3}}e^\n \\frac{-scale(x-mean)^2}{2\\cdotp mean^2x}\n\n As noted above the Inverse Gaussian distribution first arise from attempts\n to model Brownian Motion. It is also a competitor to the Weibull for use in\n reliability modeling and modeling stock returns and interest rate\n processes.\n\n References\n ----------\n .. [1] Brighton Webs Ltd., Wald Distribution,\n http://www.brighton-webs.co.uk/distributions/wald.asp\n .. [2] Chhikara, Raj S., and Folks, J. Leroy, \"The Inverse Gaussian\n Distribution: Theory : Methodology, and Applications\", CRC Press,\n 1988.\n .. [3] Wikipedia, \"Wald distribu""tion\"\n http://en.wikipedia.org/wiki/Wald_distribution\n\n Examples\n --------\n Draw values from the distribution and plot the histogram:\n\n >>> import matplotlib.pyplot as plt\n >>> h = plt.hist(np.random.wald(3, 2, 100000), bins=200, normed=True)\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_79wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_mean = 0;
- PyObject *__pyx_v_scale = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("wald (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mean,&__pyx_n_s__scale,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
-
- /* "mtrand.pyx":3234
- * return cont1_array(self.internal_state, rk_rayleigh, size, oscale)
- *
- * def wald(self, mean, scale, size=None): # <<<<<<<<<<<<<<
- * """
- * wald(mean, scale, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mean)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__scale)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("wald", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wald") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_mean = values[0];
- __pyx_v_scale = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("wald", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3234; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.wald", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_78wald(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_mean, __pyx_v_scale, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_78wald(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_mean, PyObject *__pyx_v_scale, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_omean = 0;
- PyArrayObject *__pyx_v_oscale = 0;
- double __pyx_v_fmean;
- double __pyx_v_fscale;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("wald", 0);
-
- /* "mtrand.pyx":3300
- * cdef double fmean, fscale
- *
- * fmean = PyFloat_AsDouble(mean) # <<<<<<<<<<<<<<
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- */
- __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean);
-
- /* "mtrand.pyx":3301
- *
- * fmean = PyFloat_AsDouble(mean)
- * fscale = PyFloat_AsDouble(scale) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fmean <= 0:
- */
- __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale);
-
- /* "mtrand.pyx":3302
- * fmean = PyFloat_AsDouble(mean)
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fmean <= 0:
- * raise ValueError("mean <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3303
- * fscale = PyFloat_AsDouble(scale)
- * if not PyErr_Occurred():
- * if fmean <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("mean <= 0")
- * if fscale <= 0:
- */
- __pyx_t_1 = (__pyx_v_fmean <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3304
- * if not PyErr_Occurred():
- * if fmean <= 0:
- * raise ValueError("mean <= 0") # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_121), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":3305
- * if fmean <= 0:
- * raise ValueError("mean <= 0")
- * if fscale <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale)
- */
- __pyx_t_1 = (__pyx_v_fscale <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3306
- * raise ValueError("mean <= 0")
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":3307
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array_sc(__pyx_v_self->internal_state, rk_wald, __pyx_v_size, __pyx_v_fmean, __pyx_v_fscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":3309
- * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":3310
- *
- * PyErr_Clear()
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(omean,0.0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_omean = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":3311
- * PyErr_Clear()
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(omean,0.0)):
- * raise ValueError("mean <= 0.0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6mtrand_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_oscale = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":3312
- * omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(omean,0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("mean <= 0.0")
- * elif np.any(np.less_equal(oscale,0.0)):
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_omean));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_omean));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_omean));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3313
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(omean,0.0)):
- * raise ValueError("mean <= 0.0") # <<<<<<<<<<<<<<
- * elif np.any(np.less_equal(oscale,0.0)):
- * raise ValueError("scale <= 0.0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
-
- /* "mtrand.pyx":3314
- * if np.any(np.less_equal(omean,0.0)):
- * raise ValueError("mean <= 0.0")
- * elif np.any(np.less_equal(oscale,0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("scale <= 0.0")
- * return cont2_array(self.internal_state, rk_wald, size, omean, oscale)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oscale));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oscale));
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3315
- * raise ValueError("mean <= 0.0")
- * elif np.any(np.less_equal(oscale,0.0)):
- * raise ValueError("scale <= 0.0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_wald, size, omean, oscale)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_125), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":3316
- * elif np.any(np.less_equal(oscale,0.0)):
- * raise ValueError("scale <= 0.0")
- * return cont2_array(self.internal_state, rk_wald, size, omean, oscale) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_cont2_array(__pyx_v_self->internal_state, rk_wald, __pyx_v_size, __pyx_v_omean, __pyx_v_oscale); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.wald", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_omean);
- __Pyx_XDECREF((PyObject *)__pyx_v_oscale);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_81triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_80triangular[] = "\n triangular(left, mode, right, size=None)\n\n Draw samples from the triangular distribution.\n\n The triangular distribution is a continuous probability distribution with\n lower limit left, peak at mode, and upper limit right. Unlike the other\n distributions, these parameters directly define the shape of the pdf.\n\n Parameters\n ----------\n left : scalar\n Lower limit.\n mode : scalar\n The value where the peak of the distribution occurs.\n The value should fulfill the condition ``left <= mode <= right``.\n right : scalar\n Upper limit, should be larger than `left`.\n size : int or tuple of ints, optional\n Output shape. Default is None, in which case a single value is\n returned.\n\n Returns\n -------\n samples : ndarray or scalar\n The returned samples all lie in the interval [left, right].\n\n Notes\n -----\n The probability density function for the Triangular distribution is\n\n .. math:: P(x;l, m, r) = \\begin{cases}\n \\frac{2(x-l)}{(r-l)(m-l)}& \\text{for $l \\leq x \\leq m$},\\\\\n \\frac{2(m-x)}{(r-l)(r-m)}& \\text{for $m \\leq x \\leq r$},\\\\\n 0& \\text{otherwise}.\n \\end{cases}\n\n The triangular distribution is often used in ill-defined problems where the\n underlying distribution is not known, but some knowledge of the limits and\n mode exists. Often it is used in simulations.\n\n References\n ----------\n .. [1] Wikipedia, \"Triangular distribution\"\n http://en.wikipedia.org/wiki/Triangular_distribution\n\n Examples\n --------\n Draw values from the distribution and plot the histogram:\n\n >>> import matplotlib.pyplot as plt\n >>> h = plt.hist(np.random.triangular(-3, 0, 8, 100000), bins=""200,\n ... normed=True)\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_81triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_left = 0;
- PyObject *__pyx_v_mode = 0;
- PyObject *__pyx_v_right = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("triangular (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__left,&__pyx_n_s__mode,&__pyx_n_s__right,&__pyx_n_s__size,0};
- PyObject* values[4] = {0,0,0,0};
-
- /* "mtrand.pyx":3320
- *
- *
- * def triangular(self, left, mode, right, size=None): # <<<<<<<<<<<<<<
- * """
- * triangular(left, mode, right, size=None)
- */
- values[3] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__left)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__right)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[3] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "triangular") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_left = values[0];
- __pyx_v_mode = values[1];
- __pyx_v_right = values[2];
- __pyx_v_size = values[3];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("triangular", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3320; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.triangular", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_80triangular(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_left, __pyx_v_mode, __pyx_v_right, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_80triangular(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_left, PyObject *__pyx_v_mode, PyObject *__pyx_v_right, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oleft = 0;
- PyArrayObject *__pyx_v_omode = 0;
- PyArrayObject *__pyx_v_oright = 0;
- double __pyx_v_fleft;
- double __pyx_v_fmode;
- double __pyx_v_fright;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("triangular", 0);
-
- /* "mtrand.pyx":3380
- * cdef double fleft, fmode, fright
- *
- * fleft = PyFloat_AsDouble(left) # <<<<<<<<<<<<<<
- * fright = PyFloat_AsDouble(right)
- * fmode = PyFloat_AsDouble(mode)
- */
- __pyx_v_fleft = PyFloat_AsDouble(__pyx_v_left);
-
- /* "mtrand.pyx":3381
- *
- * fleft = PyFloat_AsDouble(left)
- * fright = PyFloat_AsDouble(right) # <<<<<<<<<<<<<<
- * fmode = PyFloat_AsDouble(mode)
- * if not PyErr_Occurred():
- */
- __pyx_v_fright = PyFloat_AsDouble(__pyx_v_right);
-
- /* "mtrand.pyx":3382
- * fleft = PyFloat_AsDouble(left)
- * fright = PyFloat_AsDouble(right)
- * fmode = PyFloat_AsDouble(mode) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fleft > fmode:
- */
- __pyx_v_fmode = PyFloat_AsDouble(__pyx_v_mode);
-
- /* "mtrand.pyx":3383
- * fright = PyFloat_AsDouble(right)
- * fmode = PyFloat_AsDouble(mode)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fleft > fmode:
- * raise ValueError("left > mode")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3384
- * fmode = PyFloat_AsDouble(mode)
- * if not PyErr_Occurred():
- * if fleft > fmode: # <<<<<<<<<<<<<<
- * raise ValueError("left > mode")
- * if fmode > fright:
- */
- __pyx_t_1 = (__pyx_v_fleft > __pyx_v_fmode);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3385
- * if not PyErr_Occurred():
- * if fleft > fmode:
- * raise ValueError("left > mode") # <<<<<<<<<<<<<<
- * if fmode > fright:
- * raise ValueError("mode > right")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":3386
- * if fleft > fmode:
- * raise ValueError("left > mode")
- * if fmode > fright: # <<<<<<<<<<<<<<
- * raise ValueError("mode > right")
- * if fleft == fright:
- */
- __pyx_t_1 = (__pyx_v_fmode > __pyx_v_fright);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3387
- * raise ValueError("left > mode")
- * if fmode > fright:
- * raise ValueError("mode > right") # <<<<<<<<<<<<<<
- * if fleft == fright:
- * raise ValueError("left == right")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_129), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":3388
- * if fmode > fright:
- * raise ValueError("mode > right")
- * if fleft == fright: # <<<<<<<<<<<<<<
- * raise ValueError("left == right")
- * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft,
- */
- __pyx_t_1 = (__pyx_v_fleft == __pyx_v_fright);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3389
- * raise ValueError("mode > right")
- * if fleft == fright:
- * raise ValueError("left == right") # <<<<<<<<<<<<<<
- * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft,
- * fmode, fright)
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_131), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":3390
- * if fleft == fright:
- * raise ValueError("left == right")
- * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft, # <<<<<<<<<<<<<<
- * fmode, fright)
- *
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "mtrand.pyx":3391
- * raise ValueError("left == right")
- * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft,
- * fmode, fright) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __pyx_t_2 = __pyx_f_6mtrand_cont3_array_sc(__pyx_v_self->internal_state, rk_triangular, __pyx_v_size, __pyx_v_fleft, __pyx_v_fmode, __pyx_v_fright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":3393
- * fmode, fright)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- * oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * omode = <ndarray>PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":3394
- *
- * PyErr_Clear()
- * oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * omode = <ndarray>PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_left, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oleft = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":3395
- * PyErr_Clear()
- * oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * omode = <ndarray>PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- *
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_mode, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_omode = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":3396
- * oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * omode = <ndarray>PyArray_FROM_OTF(mode, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- *
- * if np.any(np.greater(oleft, omode)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_right, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oright = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":3398
- * oright = <ndarray>PyArray_FROM_OTF(right, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- *
- * if np.any(np.greater(oleft, omode)): # <<<<<<<<<<<<<<
- * raise ValueError("left > mode")
- * if np.any(np.greater(omode, oright)):
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__greater); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(((PyObject *)__pyx_v_oleft));
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_oleft));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oleft));
- __Pyx_INCREF(((PyObject *)__pyx_v_omode));
- PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_omode));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_omode));
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3399
- *
- * if np.any(np.greater(oleft, omode)):
- * raise ValueError("left > mode") # <<<<<<<<<<<<<<
- * if np.any(np.greater(omode, oright)):
- * raise ValueError("mode > right")
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_132), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":3400
- * if np.any(np.greater(oleft, omode)):
- * raise ValueError("left > mode")
- * if np.any(np.greater(omode, oright)): # <<<<<<<<<<<<<<
- * raise ValueError("mode > right")
- * if np.any(np.equal(oleft, oright)):
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__greater); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_omode));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_omode));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_omode));
- __Pyx_INCREF(((PyObject *)__pyx_v_oright));
- PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_oright));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oright));
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3401
- * raise ValueError("left > mode")
- * if np.any(np.greater(omode, oright)):
- * raise ValueError("mode > right") # <<<<<<<<<<<<<<
- * if np.any(np.equal(oleft, oright)):
- * raise ValueError("left == right")
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_133), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "mtrand.pyx":3402
- * if np.any(np.greater(omode, oright)):
- * raise ValueError("mode > right")
- * if np.any(np.equal(oleft, oright)): # <<<<<<<<<<<<<<
- * raise ValueError("left == right")
- * return cont3_array(self.internal_state, rk_triangular, size, oleft,
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__equal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_v_oleft));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_oleft));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oleft));
- __Pyx_INCREF(((PyObject *)__pyx_v_oright));
- PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_oright));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oright));
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3403
- * raise ValueError("mode > right")
- * if np.any(np.equal(oleft, oright)):
- * raise ValueError("left == right") # <<<<<<<<<<<<<<
- * return cont3_array(self.internal_state, rk_triangular, size, oleft,
- * omode, oright)
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_134), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L9;
- }
- __pyx_L9:;
-
- /* "mtrand.pyx":3404
- * if np.any(np.equal(oleft, oright)):
- * raise ValueError("left == right")
- * return cont3_array(self.internal_state, rk_triangular, size, oleft, # <<<<<<<<<<<<<<
- * omode, oright)
- *
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "mtrand.pyx":3405
- * raise ValueError("left == right")
- * return cont3_array(self.internal_state, rk_triangular, size, oleft,
- * omode, oright) # <<<<<<<<<<<<<<
- *
- * # Complicated, discrete distributions:
- */
- __pyx_t_2 = __pyx_f_6mtrand_cont3_array(__pyx_v_self->internal_state, rk_triangular, __pyx_v_size, __pyx_v_oleft, __pyx_v_omode, __pyx_v_oright); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3404; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.triangular", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oleft);
- __Pyx_XDECREF((PyObject *)__pyx_v_omode);
- __Pyx_XDECREF((PyObject *)__pyx_v_oright);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_83binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_82binomial[] = "\n binomial(n, p, size=None)\n\n Draw samples from a binomial distribution.\n\n Samples are drawn from a Binomial distribution with specified\n parameters, n trials and p probability of success where\n n an integer >= 0 and p is in the interval [0,1]. (n may be\n input as a float, but it is truncated to an integer in use)\n\n Parameters\n ----------\n n : float (but truncated to an integer)\n parameter, >= 0.\n p : float\n parameter, >= 0 and <=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 where the values are all integers in [0, n].\n\n See Also\n --------\n scipy.stats.distributions.binom : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Binomial distribution is\n\n .. math:: P(N) = \\binom{n}{N}p^N(1-p)^{n-N},\n\n where :math:`n` is the number of trials, :math:`p` is the probability\n of success, and :math:`N` is the number of successes.\n\n When estimating the standard error of a proportion in a population by\n using a random sample, the normal distribution works well unless the\n product p*n <=5, where p = population proportion estimate, and n =\n number of samples, in which case the binomial distribution is used\n instead. For example, a sample of 15 people shows 4 who are left\n handed, and 11 who are right handed. Then p = 4/15 = 27%. 0.27*15 = 4,\n so the binomial distribution should be used in this case.\n\n References\n ----------\n .. [1] Dalgaard, Peter, \"Introductory Statistics with R\",\n Springer-Verlag, 2002.""\n .. [2] Glantz, Stanton A. \"Primer of Biostatistics.\", McGraw-Hill,\n Fifth Edition, 2002.\n .. [3] Lentner, Marvin, \"Elementary Applied Statistics\", Bogden\n and Quigley, 1972.\n .. [4] Weisstein, Eric W. \"Binomial Distribution.\" From MathWorld--A\n Wolfram Web Resource.\n http://mathworld.wolfram.com/BinomialDistribution.html\n .. [5] Wikipedia, \"Binomial-distribution\",\n http://en.wikipedia.org/wiki/Binomial_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> n, p = 10, .5 # number of trials, probability of each trial\n >>> s = np.random.binomial(n, p, 1000)\n # result of flipping a coin 10 times, tested 1000 times.\n\n A real world example. A company drills 9 wild-cat oil exploration\n wells, each with an estimated probability of success of 0.1. All nine\n wells fail. What is the probability of that happening?\n\n Let's do 20,000 trials of the model, and count the number that\n generate zero positive results.\n\n >>> sum(np.random.binomial(9,0.1,20000)==0)/20000.\n answer = 0.38885, or 38%.\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_83binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_n = 0;
- PyObject *__pyx_v_p = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("binomial (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__n,&__pyx_n_s__p,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
-
- /* "mtrand.pyx":3408
- *
- * # Complicated, discrete distributions:
- * def binomial(self, n, p, size=None): # <<<<<<<<<<<<<<
- * """
- * binomial(n, p, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("binomial", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3408; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "binomial") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3408; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_n = values[0];
- __pyx_v_p = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("binomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3408; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.binomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_82binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_n, __pyx_v_p, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_82binomial(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_p, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_on = 0;
- PyArrayObject *__pyx_v_op = 0;
- long __pyx_v_ln;
- double __pyx_v_fp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("binomial", 0);
-
- /* "mtrand.pyx":3493
- * cdef double fp
- *
- * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<<
- * ln = PyInt_AsLong(n)
- * if not PyErr_Occurred():
- */
- __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
-
- /* "mtrand.pyx":3494
- *
- * fp = PyFloat_AsDouble(p)
- * ln = PyInt_AsLong(n) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if ln < 0:
- */
- __pyx_v_ln = PyInt_AsLong(__pyx_v_n);
-
- /* "mtrand.pyx":3495
- * fp = PyFloat_AsDouble(p)
- * ln = PyInt_AsLong(n)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if ln < 0:
- * raise ValueError("n < 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3496
- * ln = PyInt_AsLong(n)
- * if not PyErr_Occurred():
- * if ln < 0: # <<<<<<<<<<<<<<
- * raise ValueError("n < 0")
- * if fp < 0:
- */
- __pyx_t_1 = (__pyx_v_ln < 0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3497
- * if not PyErr_Occurred():
- * if ln < 0:
- * raise ValueError("n < 0") # <<<<<<<<<<<<<<
- * if fp < 0:
- * raise ValueError("p < 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_136), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":3498
- * if ln < 0:
- * raise ValueError("n < 0")
- * if fp < 0: # <<<<<<<<<<<<<<
- * raise ValueError("p < 0")
- * elif fp > 1:
- */
- __pyx_t_1 = (__pyx_v_fp < 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3499
- * raise ValueError("n < 0")
- * if fp < 0:
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * elif fp > 1:
- * raise ValueError("p > 1")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_138), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
-
- /* "mtrand.pyx":3500
- * if fp < 0:
- * raise ValueError("p < 0")
- * elif fp > 1: # <<<<<<<<<<<<<<
- * raise ValueError("p > 1")
- * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp)
- */
- __pyx_t_1 = (__pyx_v_fp > 1.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3501
- * raise ValueError("p < 0")
- * elif fp > 1:
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_140), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":3502
- * elif fp > 1:
- * raise ValueError("p > 1")
- * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_discnp_array_sc(__pyx_v_self->internal_state, rk_binomial, __pyx_v_size, __pyx_v_ln, __pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":3504
- * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":3506
- * PyErr_Clear()
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(n, 0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_n, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_on = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":3507
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ARRAY_ALIGNED)
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less(n, 0)):
- * raise ValueError("n < 0")
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_op = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":3508
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_LONG, NPY_ARRAY_ALIGNED)
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(n, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("n < 0")
- * if np.any(np.less(p, 0)):
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_n);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_n);
- __Pyx_GIVEREF(__pyx_v_n);
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3509
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(n, 0)):
- * raise ValueError("n < 0") # <<<<<<<<<<<<<<
- * if np.any(np.less(p, 0)):
- * raise ValueError("p < 0")
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_141), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":3510
- * if np.any(np.less(n, 0)):
- * raise ValueError("n < 0")
- * if np.any(np.less(p, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("p < 0")
- * if np.any(np.greater(p, 1)):
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__less); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_p);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_p);
- __Pyx_GIVEREF(__pyx_v_p);
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3511
- * raise ValueError("n < 0")
- * if np.any(np.less(p, 0)):
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * if np.any(np.greater(p, 1)):
- * raise ValueError("p > 1")
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_142), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":3512
- * if np.any(np.less(p, 0)):
- * raise ValueError("p < 0")
- * if np.any(np.greater(p, 1)): # <<<<<<<<<<<<<<
- * raise ValueError("p > 1")
- * return discnp_array(self.internal_state, rk_binomial, size, on, op)
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__greater); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_p);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p);
- __Pyx_GIVEREF(__pyx_v_p);
- __Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3513
- * raise ValueError("p < 0")
- * if np.any(np.greater(p, 1)):
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * return discnp_array(self.internal_state, rk_binomial, size, on, op)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_143), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "mtrand.pyx":3514
- * if np.any(np.greater(p, 1)):
- * raise ValueError("p > 1")
- * return discnp_array(self.internal_state, rk_binomial, size, on, op) # <<<<<<<<<<<<<<
- *
- * def negative_binomial(self, n, p, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_discnp_array(__pyx_v_self->internal_state, rk_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.binomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_on);
- __Pyx_XDECREF((PyObject *)__pyx_v_op);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_85negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_84negative_binomial[] = "\n negative_binomial(n, p, size=None)\n\n Draw samples from a negative_binomial distribution.\n\n Samples are drawn from a negative_Binomial distribution with specified\n parameters, `n` trials and `p` probability of success where `n` is an\n integer > 0 and `p` is in the interval [0, 1].\n\n Parameters\n ----------\n n : int\n Parameter, > 0.\n p : float\n Parameter, >= 0 and <=1.\n size : int or 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 Returns\n -------\n samples : int or ndarray of ints\n Drawn samples.\n\n Notes\n -----\n The probability density for the Negative Binomial distribution is\n\n .. math:: P(N;n,p) = \\binom{N+n-1}{n-1}p^{n}(1-p)^{N},\n\n where :math:`n-1` is the number of successes, :math:`p` is the probability\n of success, and :math:`N+n-1` is the number of trials.\n\n The negative binomial distribution gives the probability of n-1 successes\n and N failures in N+n-1 trials, and success on the (N+n)th trial.\n\n If one throws a die repeatedly until the third time a \"1\" appears, then the\n probability distribution of the number of non-\"1\"s that appear before the\n third \"1\" is a negative binomial distribution.\n\n References\n ----------\n .. [1] Weisstein, Eric W. \"Negative Binomial Distribution.\" From\n MathWorld--A Wolfram Web Resource.\n http://mathworld.wolfram.com/NegativeBinomialDistribution.html\n .. [2] Wikipedia, \"Negative binomial distribution\",\n http://en.wikipedia.org/wiki/Negative_binomial_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n A real world example. A company drills wild-cat oil exploration well""s, each\n with an estimated probability of success of 0.1. What is the probability\n of having one success for each successive well, that is what is the\n probability of a single success after drilling 5 wells, after 6 wells,\n etc.?\n\n >>> s = np.random.negative_binomial(1, 0.1, 100000)\n >>> for i in range(1, 11):\n ... probability = sum(s<i) / 100000.\n ... print i, \"wells drilled, probability of one success =\", probability\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_85negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_n = 0;
- PyObject *__pyx_v_p = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("negative_binomial (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__n,&__pyx_n_s__p,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
-
- /* "mtrand.pyx":3516
- * return discnp_array(self.internal_state, rk_binomial, size, on, op)
- *
- * def negative_binomial(self, n, p, size=None): # <<<<<<<<<<<<<<
- * """
- * negative_binomial(n, p, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("negative_binomial", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "negative_binomial") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_n = values[0];
- __pyx_v_p = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("negative_binomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.negative_binomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_84negative_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_n, __pyx_v_p, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_84negative_binomial(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_p, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_on = 0;
- PyArrayObject *__pyx_v_op = 0;
- double __pyx_v_fn;
- double __pyx_v_fp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("negative_binomial", 0);
-
- /* "mtrand.pyx":3586
- * cdef double fp
- *
- * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<<
- * fn = PyFloat_AsDouble(n)
- * if not PyErr_Occurred():
- */
- __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
-
- /* "mtrand.pyx":3587
- *
- * fp = PyFloat_AsDouble(p)
- * fn = PyFloat_AsDouble(n) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fn <= 0:
- */
- __pyx_v_fn = PyFloat_AsDouble(__pyx_v_n);
-
- /* "mtrand.pyx":3588
- * fp = PyFloat_AsDouble(p)
- * fn = PyFloat_AsDouble(n)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fn <= 0:
- * raise ValueError("n <= 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3589
- * fn = PyFloat_AsDouble(n)
- * if not PyErr_Occurred():
- * if fn <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("n <= 0")
- * if fp < 0:
- */
- __pyx_t_1 = (__pyx_v_fn <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3590
- * if not PyErr_Occurred():
- * if fn <= 0:
- * raise ValueError("n <= 0") # <<<<<<<<<<<<<<
- * if fp < 0:
- * raise ValueError("p < 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_145), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":3591
- * if fn <= 0:
- * raise ValueError("n <= 0")
- * if fp < 0: # <<<<<<<<<<<<<<
- * raise ValueError("p < 0")
- * elif fp > 1:
- */
- __pyx_t_1 = (__pyx_v_fp < 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3592
- * raise ValueError("n <= 0")
- * if fp < 0:
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * elif fp > 1:
- * raise ValueError("p > 1")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_146), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
-
- /* "mtrand.pyx":3593
- * if fp < 0:
- * raise ValueError("p < 0")
- * elif fp > 1: # <<<<<<<<<<<<<<
- * raise ValueError("p > 1")
- * return discdd_array_sc(self.internal_state, rk_negative_binomial,
- */
- __pyx_t_1 = (__pyx_v_fp > 1.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3594
- * raise ValueError("p < 0")
- * elif fp > 1:
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * return discdd_array_sc(self.internal_state, rk_negative_binomial,
- * size, fn, fp)
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":3595
- * elif fp > 1:
- * raise ValueError("p > 1")
- * return discdd_array_sc(self.internal_state, rk_negative_binomial, # <<<<<<<<<<<<<<
- * size, fn, fp)
- *
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "mtrand.pyx":3596
- * raise ValueError("p > 1")
- * return discdd_array_sc(self.internal_state, rk_negative_binomial,
- * size, fn, fp) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __pyx_t_2 = __pyx_f_6mtrand_discdd_array_sc(__pyx_v_self->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_fn, __pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":3598
- * size, fn, fp)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":3600
- * PyErr_Clear()
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(n, 0)):
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_n, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_on = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":3601
- *
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(n, 0)):
- * raise ValueError("n <= 0")
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_op = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":3602
- * on = <ndarray>PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(n, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("n <= 0")
- * if np.any(np.less(p, 0)):
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_n);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_n);
- __Pyx_GIVEREF(__pyx_v_n);
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3603
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(n, 0)):
- * raise ValueError("n <= 0") # <<<<<<<<<<<<<<
- * if np.any(np.less(p, 0)):
- * raise ValueError("p < 0")
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_148), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":3604
- * if np.any(np.less_equal(n, 0)):
- * raise ValueError("n <= 0")
- * if np.any(np.less(p, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("p < 0")
- * if np.any(np.greater(p, 1)):
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__less); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_p);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_p);
- __Pyx_GIVEREF(__pyx_v_p);
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3605
- * raise ValueError("n <= 0")
- * if np.any(np.less(p, 0)):
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * if np.any(np.greater(p, 1)):
- * raise ValueError("p > 1")
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_149), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":3606
- * if np.any(np.less(p, 0)):
- * raise ValueError("p < 0")
- * if np.any(np.greater(p, 1)): # <<<<<<<<<<<<<<
- * raise ValueError("p > 1")
- * return discdd_array(self.internal_state, rk_negative_binomial, size,
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__greater); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_p);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p);
- __Pyx_GIVEREF(__pyx_v_p);
- __Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3606; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3607
- * raise ValueError("p < 0")
- * if np.any(np.greater(p, 1)):
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * return discdd_array(self.internal_state, rk_negative_binomial, size,
- * on, op)
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_150), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "mtrand.pyx":3608
- * if np.any(np.greater(p, 1)):
- * raise ValueError("p > 1")
- * return discdd_array(self.internal_state, rk_negative_binomial, size, # <<<<<<<<<<<<<<
- * on, op)
- *
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "mtrand.pyx":3609
- * raise ValueError("p > 1")
- * return discdd_array(self.internal_state, rk_negative_binomial, size,
- * on, op) # <<<<<<<<<<<<<<
- *
- * def poisson(self, lam=1.0, size=None):
- */
- __pyx_t_3 = __pyx_f_6mtrand_discdd_array(__pyx_v_self->internal_state, rk_negative_binomial, __pyx_v_size, __pyx_v_on, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.negative_binomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_on);
- __Pyx_XDECREF((PyObject *)__pyx_v_op);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_87poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_86poisson[] = "\n poisson(lam=1.0, size=None)\n\n Draw samples from a Poisson distribution.\n\n The Poisson distribution is the limit of the Binomial\n distribution for large N.\n\n Parameters\n ----------\n lam : float\n Expectation of interval, should be >= 0.\n size : int or tuple of ints, optional\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n Notes\n -----\n The Poisson distribution\n\n .. math:: f(k; \\lambda)=\\frac{\\lambda^k e^{-\\lambda}}{k!}\n\n For events with an expected separation :math:`\\lambda` the Poisson\n distribution :math:`f(k; \\lambda)` describes the probability of\n :math:`k` events occurring within the observed interval :math:`\\lambda`.\n\n Because the output is limited to the range of the C long type, a\n ValueError is raised when `lam` is within 10 sigma of the maximum\n representable value.\n\n References\n ----------\n .. [1] Weisstein, Eric W. \"Poisson Distribution.\" From MathWorld--A Wolfram\n Web Resource. http://mathworld.wolfram.com/PoissonDistribution.html\n .. [2] Wikipedia, \"Poisson distribution\",\n http://en.wikipedia.org/wiki/Poisson_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> import numpy as np\n >>> s = np.random.poisson(5, 10000)\n\n Display histogram of the sample:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 14, normed=True)\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_87poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_lam = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("poisson (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__lam,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
- values[0] = __pyx_k_151;
-
- /* "mtrand.pyx":3611
- * on, op)
- *
- * def poisson(self, lam=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * poisson(lam=1.0, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__lam);
- if (value) { values[0] = value; kw_args--; }
- }
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "poisson") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_lam = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("poisson", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.poisson", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_86poisson(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_lam, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_86poisson(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_lam, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_olam = 0;
- double __pyx_v_flam;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("poisson", 0);
-
- /* "mtrand.pyx":3665
- * cdef ndarray olam
- * cdef double flam
- * flam = PyFloat_AsDouble(lam) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if lam < 0:
- */
- __pyx_v_flam = PyFloat_AsDouble(__pyx_v_lam);
-
- /* "mtrand.pyx":3666
- * cdef double flam
- * flam = PyFloat_AsDouble(lam)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if lam < 0:
- * raise ValueError("lam < 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3667
- * flam = PyFloat_AsDouble(lam)
- * if not PyErr_Occurred():
- * if lam < 0: # <<<<<<<<<<<<<<
- * raise ValueError("lam < 0")
- * if lam > self.poisson_lam_max:
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_lam, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3668
- * if not PyErr_Occurred():
- * if lam < 0:
- * raise ValueError("lam < 0") # <<<<<<<<<<<<<<
- * if lam > self.poisson_lam_max:
- * raise ValueError("lam value too large")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_153), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":3669
- * if lam < 0:
- * raise ValueError("lam < 0")
- * if lam > self.poisson_lam_max: # <<<<<<<<<<<<<<
- * raise ValueError("lam value too large")
- * return discd_array_sc(self.internal_state, rk_poisson, size, flam)
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__poisson_lam_max); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_lam, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3669; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3670
- * raise ValueError("lam < 0")
- * if lam > self.poisson_lam_max:
- * raise ValueError("lam value too large") # <<<<<<<<<<<<<<
- * return discd_array_sc(self.internal_state, rk_poisson, size, flam)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_155), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":3671
- * if lam > self.poisson_lam_max:
- * raise ValueError("lam value too large")
- * return discd_array_sc(self.internal_state, rk_poisson, size, flam) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_poisson, __pyx_v_size, __pyx_v_flam); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3671; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":3673
- * return discd_array_sc(self.internal_state, rk_poisson, size, flam)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":3675
- * PyErr_Clear()
- *
- * olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less(olam, 0)):
- * raise ValueError("lam < 0")
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_lam, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3675; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_olam = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":3676
- *
- * olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(olam, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("lam < 0")
- * if np.any(np.greater(olam, self.poisson_lam_max)):
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_olam));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_olam));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_olam));
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3676; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3677
- * olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(olam, 0)):
- * raise ValueError("lam < 0") # <<<<<<<<<<<<<<
- * if np.any(np.greater(olam, self.poisson_lam_max)):
- * raise ValueError("lam value too large.")
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_156), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":3678
- * if np.any(np.less(olam, 0)):
- * raise ValueError("lam < 0")
- * if np.any(np.greater(olam, self.poisson_lam_max)): # <<<<<<<<<<<<<<
- * raise ValueError("lam value too large.")
- * return discd_array(self.internal_state, rk_poisson, size, olam)
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__greater); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__poisson_lam_max); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_v_olam));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_olam));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_olam));
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3678; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3679
- * raise ValueError("lam < 0")
- * if np.any(np.greater(olam, self.poisson_lam_max)):
- * raise ValueError("lam value too large.") # <<<<<<<<<<<<<<
- * return discd_array(self.internal_state, rk_poisson, size, olam)
- *
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_158), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":3680
- * if np.any(np.greater(olam, self.poisson_lam_max)):
- * raise ValueError("lam value too large.")
- * return discd_array(self.internal_state, rk_poisson, size, olam) # <<<<<<<<<<<<<<
- *
- * def zipf(self, a, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_poisson, __pyx_v_size, __pyx_v_olam); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.poisson", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_olam);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_89zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_88zipf[] = "\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\n `a` > 1.\n\n The Zipf distribution (also known as the zeta distribution) is a\n continuous probability distribution that satisfies Zipf's law: the\n frequency of an item is inversely proportional to its rank in a\n frequency table.\n\n Parameters\n ----------\n a : float > 1\n Distribution parameter.\n size : int or tuple of int, optional\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn; a single integer is equivalent in\n its result to providing a mono-tuple, i.e., a 1-D array of length\n *size* is returned. The default is None, in which case a single\n scalar is returned.\n\n Returns\n -------\n samples : scalar or ndarray\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 It is named for the American linguist George Kingsley Zipf, who noted\n that the frequency of any word in a sample of a language is inversely\n proportional to its rank in the frequency table.\n\n References\n ----------\n Zipf, G. K., *Selected Studies of the Principle of Relative Frequency\n in Language*, Cambridge, MA: Harvard Univ. Press, 1932.\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 = np.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 ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_89zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_a = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("zipf (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__a,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
-
- /* "mtrand.pyx":3682
- * return discd_array(self.internal_state, rk_poisson, size, olam)
- *
- * def zipf(self, a, size=None): # <<<<<<<<<<<<<<
- * """
- * zipf(a, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__a)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zipf") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_a = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("zipf", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3682; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.zipf", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_88zipf(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_a, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_88zipf(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_a, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_oa = 0;
- double __pyx_v_fa;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("zipf", 0);
-
- /* "mtrand.pyx":3757
- * cdef double fa
- *
- * fa = PyFloat_AsDouble(a) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fa <= 1.0:
- */
- __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a);
-
- /* "mtrand.pyx":3758
- *
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fa <= 1.0:
- * raise ValueError("a <= 1.0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3759
- * fa = PyFloat_AsDouble(a)
- * if not PyErr_Occurred():
- * if fa <= 1.0: # <<<<<<<<<<<<<<
- * raise ValueError("a <= 1.0")
- * return discd_array_sc(self.internal_state, rk_zipf, size, fa)
- */
- __pyx_t_1 = (__pyx_v_fa <= 1.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3760
- * if not PyErr_Occurred():
- * if fa <= 1.0:
- * raise ValueError("a <= 1.0") # <<<<<<<<<<<<<<
- * return discd_array_sc(self.internal_state, rk_zipf, size, fa)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_160), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":3761
- * if fa <= 1.0:
- * raise ValueError("a <= 1.0")
- * return discd_array_sc(self.internal_state, rk_zipf, size, fa) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_zipf, __pyx_v_size, __pyx_v_fa); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":3763
- * return discd_array_sc(self.internal_state, rk_zipf, size, fa)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":3765
- * PyErr_Clear()
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oa, 1.0)):
- * raise ValueError("a <= 1.0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_a, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3765; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_oa = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":3766
- *
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 1.0)): # <<<<<<<<<<<<<<
- * raise ValueError("a <= 1.0")
- * return discd_array(self.internal_state, rk_zipf, size, oa)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_oa));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_oa));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3766; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3767
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 1.0)):
- * raise ValueError("a <= 1.0") # <<<<<<<<<<<<<<
- * return discd_array(self.internal_state, rk_zipf, size, oa)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_161), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":3768
- * if np.any(np.less_equal(oa, 1.0)):
- * raise ValueError("a <= 1.0")
- * return discd_array(self.internal_state, rk_zipf, size, oa) # <<<<<<<<<<<<<<
- *
- * def geometric(self, p, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_zipf, __pyx_v_size, __pyx_v_oa); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.zipf", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_oa);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_91geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_90geometric[] = "\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 ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_91geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_p = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("geometric (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__p,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
-
- /* "mtrand.pyx":3770
- * return discd_array(self.internal_state, rk_zipf, size, oa)
- *
- * def geometric(self, p, size=None): # <<<<<<<<<<<<<<
- * """
- * geometric(p, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "geometric") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_p = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("geometric", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3770; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.geometric", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_90geometric(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_p, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_90geometric(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_op = 0;
- double __pyx_v_fp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("geometric", 0);
-
- /* "mtrand.pyx":3818
- * cdef double fp
- *
- * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fp < 0.0:
- */
- __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
-
- /* "mtrand.pyx":3819
- *
- * fp = PyFloat_AsDouble(p)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fp < 0.0:
- * raise ValueError("p < 0.0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3820
- * fp = PyFloat_AsDouble(p)
- * if not PyErr_Occurred():
- * if fp < 0.0: # <<<<<<<<<<<<<<
- * raise ValueError("p < 0.0")
- * if fp > 1.0:
- */
- __pyx_t_1 = (__pyx_v_fp < 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3821
- * if not PyErr_Occurred():
- * if fp < 0.0:
- * raise ValueError("p < 0.0") # <<<<<<<<<<<<<<
- * if fp > 1.0:
- * raise ValueError("p > 1.0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_163), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":3822
- * 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_geometric, size, fp)
- */
- __pyx_t_1 = (__pyx_v_fp > 1.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3823
- * raise ValueError("p < 0.0")
- * if fp > 1.0:
- * raise ValueError("p > 1.0") # <<<<<<<<<<<<<<
- * return discd_array_sc(self.internal_state, rk_geometric, size, fp)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_165), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":3824
- * if fp > 1.0:
- * raise ValueError("p > 1.0")
- * return discd_array_sc(self.internal_state, rk_geometric, size, fp) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_geometric, __pyx_v_size, __pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":3826
- * return discd_array_sc(self.internal_state, rk_geometric, size, fp)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- *
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":3829
- *
- *
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less(op, 0.0)):
- * raise ValueError("p < 0.0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_op = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":3830
- *
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(op, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("p < 0.0")
- * if np.any(np.greater(op, 1.0)):
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_op));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3831
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_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")
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_166), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":3832
- * 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")
- * return discd_array(self.internal_state, rk_geometric, size, op)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__greater); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_op));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3833
- * raise ValueError("p < 0.0")
- * if np.any(np.greater(op, 1.0)):
- * raise ValueError("p > 1.0") # <<<<<<<<<<<<<<
- * return discd_array(self.internal_state, rk_geometric, size, op)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_167), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":3834
- * if np.any(np.greater(op, 1.0)):
- * raise ValueError("p > 1.0")
- * return discd_array(self.internal_state, rk_geometric, size, op) # <<<<<<<<<<<<<<
- *
- * def hypergeometric(self, ngood, nbad, nsample, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_geometric, __pyx_v_size, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.geometric", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_op);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_93hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_92hypergeometric[] = "\n hypergeometric(ngood, nbad, nsample, size=None)\n\n Draw samples from a Hypergeometric distribution.\n\n Samples are drawn from a Hypergeometric distribution with specified\n parameters, ngood (ways to make a good selection), nbad (ways to make\n a bad selection), and nsample = number of items sampled, which is less\n than or equal to the sum ngood + nbad.\n\n Parameters\n ----------\n ngood : int or array_like\n Number of ways to make a good selection. Must be nonnegative.\n nbad : int or array_like\n Number of ways to make a bad selection. Must be nonnegative.\n nsample : int or array_like\n Number of items sampled. Must be at least 1 and at most\n ``ngood + nbad``.\n size : int or tuple of 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 or scalar\n The values are all integers in [0, n].\n\n See Also\n --------\n scipy.stats.distributions.hypergeom : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Hypergeometric distribution is\n\n .. math:: P(x) = \\frac{\\binom{m}{n}\\binom{N-m}{n-x}}{\\binom{N}{n}},\n\n where :math:`0 \\le x \\le m` and :math:`n+m-N \\le x \\le n`\n\n for P(x) the probability of x successes, n = ngood, m = nbad, and\n N = number of samples.\n\n Consider an urn with black and white marbles in it, ngood of them\n black and nbad are white. If you draw nsample balls without\n replacement, then the Hypergeometric distribution describes the\n distribution of black balls in the drawn sample.\n\n Note that this distribution is very similar to the Binomial\n distrib""ution, except that in this case, samples are drawn without\n replacement, whereas in the Binomial case samples are drawn with\n replacement (or the sample space is infinite). As the sample space\n becomes large, this distribution approaches the Binomial.\n\n References\n ----------\n .. [1] Lentner, Marvin, \"Elementary Applied Statistics\", Bogden\n and Quigley, 1972.\n .. [2] Weisstein, Eric W. \"Hypergeometric Distribution.\" From\n MathWorld--A Wolfram Web Resource.\n http://mathworld.wolfram.com/HypergeometricDistribution.html\n .. [3] Wikipedia, \"Hypergeometric-distribution\",\n http://en.wikipedia.org/wiki/Hypergeometric-distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> ngood, nbad, nsamp = 100, 2, 10\n # number of good, number of bad, and number of samples\n >>> s = np.random.hypergeometric(ngood, nbad, nsamp, 1000)\n >>> hist(s)\n # note that it is very unlikely to grab both bad items\n\n Suppose you have an urn with 15 white and 15 black marbles.\n If you pull 15 marbles at random, how likely is it that\n 12 or more of them are one color?\n\n >>> s = np.random.hypergeometric(15, 15, 15, 100000)\n >>> sum(s>=12)/100000. + sum(s<=3)/100000.\n # answer = 0.003 ... pretty unlikely!\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_93hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_ngood = 0;
- PyObject *__pyx_v_nbad = 0;
- PyObject *__pyx_v_nsample = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("hypergeometric (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__ngood,&__pyx_n_s__nbad,&__pyx_n_s__nsample,&__pyx_n_s__size,0};
- PyObject* values[4] = {0,0,0,0};
-
- /* "mtrand.pyx":3836
- * return discd_array(self.internal_state, rk_geometric, size, op)
- *
- * def hypergeometric(self, ngood, nbad, nsample, size=None): # <<<<<<<<<<<<<<
- * """
- * hypergeometric(ngood, nbad, nsample, size=None)
- */
- values[3] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__ngood)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nbad)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nsample)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[3] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "hypergeometric") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_ngood = values[0];
- __pyx_v_nbad = values[1];
- __pyx_v_nsample = values[2];
- __pyx_v_size = values[3];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("hypergeometric", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3836; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.hypergeometric", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_92hypergeometric(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_ngood, __pyx_v_nbad, __pyx_v_nsample, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_92hypergeometric(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_ngood, PyObject *__pyx_v_nbad, PyObject *__pyx_v_nsample, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_ongood = 0;
- PyArrayObject *__pyx_v_onbad = 0;
- PyArrayObject *__pyx_v_onsample = 0;
- long __pyx_v_lngood;
- long __pyx_v_lnbad;
- long __pyx_v_lnsample;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("hypergeometric", 0);
-
- /* "mtrand.pyx":3924
- * cdef long lngood, lnbad, lnsample
- *
- * lngood = PyInt_AsLong(ngood) # <<<<<<<<<<<<<<
- * lnbad = PyInt_AsLong(nbad)
- * lnsample = PyInt_AsLong(nsample)
- */
- __pyx_v_lngood = PyInt_AsLong(__pyx_v_ngood);
-
- /* "mtrand.pyx":3925
- *
- * lngood = PyInt_AsLong(ngood)
- * lnbad = PyInt_AsLong(nbad) # <<<<<<<<<<<<<<
- * lnsample = PyInt_AsLong(nsample)
- * if not PyErr_Occurred():
- */
- __pyx_v_lnbad = PyInt_AsLong(__pyx_v_nbad);
-
- /* "mtrand.pyx":3926
- * lngood = PyInt_AsLong(ngood)
- * lnbad = PyInt_AsLong(nbad)
- * lnsample = PyInt_AsLong(nsample) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if lngood < 0:
- */
- __pyx_v_lnsample = PyInt_AsLong(__pyx_v_nsample);
-
- /* "mtrand.pyx":3927
- * lnbad = PyInt_AsLong(nbad)
- * lnsample = PyInt_AsLong(nsample)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if lngood < 0:
- * raise ValueError("ngood < 0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3928
- * lnsample = PyInt_AsLong(nsample)
- * if not PyErr_Occurred():
- * if lngood < 0: # <<<<<<<<<<<<<<
- * raise ValueError("ngood < 0")
- * if lnbad < 0:
- */
- __pyx_t_1 = (__pyx_v_lngood < 0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3929
- * if not PyErr_Occurred():
- * if lngood < 0:
- * raise ValueError("ngood < 0") # <<<<<<<<<<<<<<
- * if lnbad < 0:
- * raise ValueError("nbad < 0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_169), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":3930
- * if lngood < 0:
- * raise ValueError("ngood < 0")
- * if lnbad < 0: # <<<<<<<<<<<<<<
- * raise ValueError("nbad < 0")
- * if lnsample < 1:
- */
- __pyx_t_1 = (__pyx_v_lnbad < 0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3931
- * raise ValueError("ngood < 0")
- * if lnbad < 0:
- * raise ValueError("nbad < 0") # <<<<<<<<<<<<<<
- * if lnsample < 1:
- * raise ValueError("nsample < 1")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_171), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":3932
- * if lnbad < 0:
- * raise ValueError("nbad < 0")
- * if lnsample < 1: # <<<<<<<<<<<<<<
- * raise ValueError("nsample < 1")
- * if lngood + lnbad < lnsample:
- */
- __pyx_t_1 = (__pyx_v_lnsample < 1);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3933
- * raise ValueError("nbad < 0")
- * if lnsample < 1:
- * raise ValueError("nsample < 1") # <<<<<<<<<<<<<<
- * if lngood + lnbad < lnsample:
- * raise ValueError("ngood + nbad < nsample")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_173), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":3934
- * if lnsample < 1:
- * raise ValueError("nsample < 1")
- * if lngood + lnbad < lnsample: # <<<<<<<<<<<<<<
- * raise ValueError("ngood + nbad < nsample")
- * return discnmN_array_sc(self.internal_state, rk_hypergeometric, size,
- */
- __pyx_t_1 = ((__pyx_v_lngood + __pyx_v_lnbad) < __pyx_v_lnsample);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3935
- * raise ValueError("nsample < 1")
- * if lngood + lnbad < lnsample:
- * raise ValueError("ngood + nbad < nsample") # <<<<<<<<<<<<<<
- * return discnmN_array_sc(self.internal_state, rk_hypergeometric, size,
- * lngood, lnbad, lnsample)
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_175), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":3936
- * if lngood + lnbad < lnsample:
- * raise ValueError("ngood + nbad < nsample")
- * return discnmN_array_sc(self.internal_state, rk_hypergeometric, size, # <<<<<<<<<<<<<<
- * lngood, lnbad, lnsample)
- *
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "mtrand.pyx":3937
- * raise ValueError("ngood + nbad < nsample")
- * return discnmN_array_sc(self.internal_state, rk_hypergeometric, size,
- * lngood, lnbad, lnsample) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __pyx_t_2 = __pyx_f_6mtrand_discnmN_array_sc(__pyx_v_self->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_lngood, __pyx_v_lnbad, __pyx_v_lnsample); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3936; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":3939
- * lngood, lnbad, lnsample)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":3941
- * PyErr_Clear()
- *
- * ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ARRAY_ALIGNED)
- * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ARRAY_ALIGNED)
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_ngood, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3941; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_ongood = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":3942
- *
- * ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ARRAY_ALIGNED)
- * onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(ongood, 0)):
- */
- __pyx_t_3 = PyArray_FROM_OTF(__pyx_v_nbad, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __pyx_t_3;
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_onbad = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":3943
- * ongood = <ndarray>PyArray_FROM_OTF(ngood, NPY_LONG, NPY_ARRAY_ALIGNED)
- * onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ARRAY_ALIGNED)
- * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less(ongood, 0)):
- * raise ValueError("ngood < 0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_nsample, NPY_LONG, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_onsample = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":3944
- * onbad = <ndarray>PyArray_FROM_OTF(nbad, NPY_LONG, NPY_ARRAY_ALIGNED)
- * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(ongood, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("ngood < 0")
- * if np.any(np.less(onbad, 0)):
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(((PyObject *)__pyx_v_ongood));
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_ongood));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_ongood));
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3944; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3945
- * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(ongood, 0)):
- * raise ValueError("ngood < 0") # <<<<<<<<<<<<<<
- * if np.any(np.less(onbad, 0)):
- * raise ValueError("nbad < 0")
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_176), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "mtrand.pyx":3946
- * if np.any(np.less(ongood, 0)):
- * raise ValueError("ngood < 0")
- * if np.any(np.less(onbad, 0)): # <<<<<<<<<<<<<<
- * raise ValueError("nbad < 0")
- * if np.any(np.less(onsample, 1)):
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__any); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__less); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_onbad));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_onbad));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_onbad));
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3947
- * raise ValueError("ngood < 0")
- * if np.any(np.less(onbad, 0)):
- * raise ValueError("nbad < 0") # <<<<<<<<<<<<<<
- * if np.any(np.less(onsample, 1)):
- * raise ValueError("nsample < 1")
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_177), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L9;
- }
- __pyx_L9:;
-
- /* "mtrand.pyx":3948
- * if np.any(np.less(onbad, 0)):
- * raise ValueError("nbad < 0")
- * if np.any(np.less(onsample, 1)): # <<<<<<<<<<<<<<
- * raise ValueError("nsample < 1")
- * if np.any(np.less(np.add(ongood, onbad),onsample)):
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__less); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_v_onsample));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_onsample));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_onsample));
- __Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3948; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3949
- * raise ValueError("nbad < 0")
- * if np.any(np.less(onsample, 1)):
- * raise ValueError("nsample < 1") # <<<<<<<<<<<<<<
- * if np.any(np.less(np.add(ongood, onbad),onsample)):
- * raise ValueError("ngood + nbad < nsample")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_178), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L10;
- }
- __pyx_L10:;
-
- /* "mtrand.pyx":3950
- * if np.any(np.less(onsample, 1)):
- * raise ValueError("nsample < 1")
- * if np.any(np.less(np.add(ongood, onbad),onsample)): # <<<<<<<<<<<<<<
- * raise ValueError("ngood + nbad < nsample")
- * return discnmN_array(self.internal_state, rk_hypergeometric, size,
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__any); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__less); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__add); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_ongood));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_ongood));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_ongood));
- __Pyx_INCREF(((PyObject *)__pyx_v_onbad));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_onbad));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_onbad));
- __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __Pyx_INCREF(((PyObject *)__pyx_v_onsample));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_onsample));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_onsample));
- __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":3951
- * raise ValueError("nsample < 1")
- * if np.any(np.less(np.add(ongood, onbad),onsample)):
- * raise ValueError("ngood + nbad < nsample") # <<<<<<<<<<<<<<
- * return discnmN_array(self.internal_state, rk_hypergeometric, size,
- * ongood, onbad, onsample)
- */
- __pyx_t_6 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_179), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_Raise(__pyx_t_6, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L11;
- }
- __pyx_L11:;
-
- /* "mtrand.pyx":3952
- * if np.any(np.less(np.add(ongood, onbad),onsample)):
- * raise ValueError("ngood + nbad < nsample")
- * return discnmN_array(self.internal_state, rk_hypergeometric, size, # <<<<<<<<<<<<<<
- * ongood, onbad, onsample)
- *
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "mtrand.pyx":3953
- * raise ValueError("ngood + nbad < nsample")
- * return discnmN_array(self.internal_state, rk_hypergeometric, size,
- * ongood, onbad, onsample) # <<<<<<<<<<<<<<
- *
- * def logseries(self, p, size=None):
- */
- __pyx_t_6 = __pyx_f_6mtrand_discnmN_array(__pyx_v_self->internal_state, rk_hypergeometric, __pyx_v_size, __pyx_v_ongood, __pyx_v_onbad, __pyx_v_onsample); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_r = __pyx_t_6;
- __pyx_t_6 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("mtrand.RandomState.hypergeometric", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_ongood);
- __Pyx_XDECREF((PyObject *)__pyx_v_onbad);
- __Pyx_XDECREF((PyObject *)__pyx_v_onsample);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_95logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_94logseries[] = "\n logseries(p, size=None)\n\n Draw samples from a Logarithmic Series distribution.\n\n Samples are drawn from a Log Series distribution with specified\n parameter, p (probability, 0 < p < 1).\n\n Parameters\n ----------\n loc : float\n\n scale : float > 0.\n\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 where the values are all integers in [0, n].\n\n See Also\n --------\n scipy.stats.distributions.logser : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Log Series distribution is\n\n .. math:: P(k) = \\frac{-p^k}{k \\ln(1-p)},\n\n where p = probability.\n\n The Log Series distribution is frequently used to represent species\n richness and occurrence, first proposed by Fisher, Corbet, and\n Williams in 1943 [2]. It may also be used to model the numbers of\n occupants seen in cars [3].\n\n References\n ----------\n .. [1] Buzas, Martin A.; Culver, Stephen J., Understanding regional\n species diversity through the log series distribution of\n occurrences: BIODIVERSITY RESEARCH Diversity & Distributions,\n Volume 5, Number 5, September 1999 , pp. 187-195(9).\n .. [2] Fisher, R.A,, A.S. Corbet, and C.B. Williams. 1943. The\n relation between the number of species and the number of\n individuals in a random sample of an animal population.\n Journal of Animal Ecology, 12:42-58.\n .. [3] D. J. Hand, F. Daly, D. Lunn, E. Ostrowski, A Handbook of Small\n Data Sets, CRC Press, 1994.\n .. [4] Wikipedia, \"Log""arithmic-distribution\",\n http://en.wikipedia.org/wiki/Logarithmic-distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> a = .6\n >>> s = np.random.logseries(a, 10000)\n >>> count, bins, ignored = plt.hist(s)\n\n # plot against distribution\n\n >>> def logseries(k, p):\n ... return -p**k/(k*log(1-p))\n >>> plt.plot(bins, logseries(bins, a)*count.max()/\n logseries(bins, a).max(), 'r')\n >>> plt.show()\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_95logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_p = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("logseries (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__p,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
-
- /* "mtrand.pyx":3955
- * ongood, onbad, onsample)
- *
- * def logseries(self, p, size=None): # <<<<<<<<<<<<<<
- * """
- * logseries(p, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__p)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "logseries") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_p = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("logseries", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3955; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.logseries", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_94logseries(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_p, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_94logseries(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_p, PyObject *__pyx_v_size) {
- PyArrayObject *__pyx_v_op = 0;
- double __pyx_v_fp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("logseries", 0);
-
- /* "mtrand.pyx":4032
- * cdef double fp
- *
- * fp = PyFloat_AsDouble(p) # <<<<<<<<<<<<<<
- * if not PyErr_Occurred():
- * if fp <= 0.0:
- */
- __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p);
-
- /* "mtrand.pyx":4033
- *
- * fp = PyFloat_AsDouble(p)
- * if not PyErr_Occurred(): # <<<<<<<<<<<<<<
- * if fp <= 0.0:
- * raise ValueError("p <= 0.0")
- */
- __pyx_t_1 = (!PyErr_Occurred());
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":4034
- * fp = PyFloat_AsDouble(p)
- * if not PyErr_Occurred():
- * if fp <= 0.0: # <<<<<<<<<<<<<<
- * raise ValueError("p <= 0.0")
- * if fp >= 1.0:
- */
- __pyx_t_1 = (__pyx_v_fp <= 0.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":4035
- * if not PyErr_Occurred():
- * if fp <= 0.0:
- * raise ValueError("p <= 0.0") # <<<<<<<<<<<<<<
- * if fp >= 1.0:
- * raise ValueError("p >= 1.0")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_181), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":4036
- * 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)
- */
- __pyx_t_1 = (__pyx_v_fp >= 1.0);
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":4037
- * 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)
- *
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_183), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":4038
- * if fp >= 1.0:
- * raise ValueError("p >= 1.0")
- * return discd_array_sc(self.internal_state, rk_logseries, size, fp) # <<<<<<<<<<<<<<
- *
- * PyErr_Clear()
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_f_6mtrand_discd_array_sc(__pyx_v_self->internal_state, rk_logseries, __pyx_v_size, __pyx_v_fp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":4040
- * return discd_array_sc(self.internal_state, rk_logseries, size, fp)
- *
- * PyErr_Clear() # <<<<<<<<<<<<<<
- *
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- */
- PyErr_Clear();
-
- /* "mtrand.pyx":4042
- * PyErr_Clear()
- *
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED) # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(op, 0.0)):
- * raise ValueError("p <= 0.0")
- */
- __pyx_t_2 = PyArray_FROM_OTF(__pyx_v_p, NPY_DOUBLE, NPY_ARRAY_ALIGNED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_op = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":4043
- *
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(op, 0.0)): # <<<<<<<<<<<<<<
- * raise ValueError("p <= 0.0")
- * if np.any(np.greater_equal(op, 1.0)):
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__less_equal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_op));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":4044
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * 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")
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_184), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":4045
- * 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)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__any); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__greater_equal); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_op));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_op));
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_1) {
-
- /* "mtrand.pyx":4046
- * 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)
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_185), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":4047
- * 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:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __pyx_f_6mtrand_discd_array(__pyx_v_self->internal_state, rk_logseries, __pyx_v_size, __pyx_v_op); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.logseries", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_op);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_97multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_96multivariate_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 generalization of the one-dimensional normal distribution to higher\n dimensions. Such a distribution is specified by its mean and\n covariance matrix. These parameters are analogous to the mean\n (average or \"center\") and variance (standard deviation, or \"width,\"\n squared) of the one-dimensional normal distribution.\n\n Parameters\n ----------\n mean : 1-D array_like, of length N\n Mean of the N-dimensional distribution.\n cov : 2-D array_like, of shape (N, N)\n Covariance matrix of the distribution. Must be symmetric and\n positive semi-definite for \"physically meaningful\" results.\n size : int or 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\n each sample is `N`-dimensional, the output shape is ``(m,n,k,N)``.\n If no shape is specified, a single (`N`-D) sample is returned.\n\n Returns\n -------\n out : ndarray\n The drawn samples, of shape *size*, if that was provided. If not,\n the shape is ``(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, w""e 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 Papoulis, A., *Probability, Random Variables, and Stochastic Processes*,\n 3rd ed., New York: McGraw-Hill, 1991.\n\n Duda, R. O., Hart, P. E., and Stork, D. G., *Pattern Classification*,\n 2nd ed., New York: 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 ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_97multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_mean = 0;
- PyObject *__pyx_v_cov = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("multivariate_normal (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__mean,&__pyx_n_s__cov,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
-
- /* "mtrand.pyx":4050
- *
- * # Multivariate distributions:
- * def multivariate_normal(self, mean, cov, size=None): # <<<<<<<<<<<<<<
- * """
- * multivariate_normal(mean, cov[, size])
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mean)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__cov)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("multivariate_normal", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4050; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multivariate_normal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4050; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_mean = values[0];
- __pyx_v_cov = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("multivariate_normal", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4050; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.multivariate_normal", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_96multivariate_normal(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_mean, __pyx_v_cov, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_96multivariate_normal(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_mean, PyObject *__pyx_v_cov, PyObject *__pyx_v_size) {
- PyObject *__pyx_v_shape = NULL;
- PyObject *__pyx_v_final_shape = NULL;
- PyObject *__pyx_v_x = NULL;
- PyObject *__pyx_v_svd = NULL;
- CYTHON_UNUSED PyObject *__pyx_v_u = NULL;
- PyObject *__pyx_v_s = NULL;
- PyObject *__pyx_v_v = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- PyObject *__pyx_t_9 = NULL;
- PyObject *__pyx_t_10 = NULL;
- PyObject *(*__pyx_t_11)(PyObject *);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("multivariate_normal", 0);
- __Pyx_INCREF(__pyx_v_mean);
- __Pyx_INCREF(__pyx_v_cov);
-
- /* "mtrand.pyx":4142
- * """
- * # Check preconditions on arguments
- * mean = np.array(mean) # <<<<<<<<<<<<<<
- * cov = np.array(cov)
- * if size is None:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_mean);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_mean);
- __Pyx_GIVEREF(__pyx_v_mean);
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_v_mean);
- __pyx_v_mean = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":4143
- * # Check preconditions on arguments
- * mean = np.array(mean)
- * cov = np.array(cov) # <<<<<<<<<<<<<<
- * if size is None:
- * shape = []
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_cov);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cov);
- __Pyx_GIVEREF(__pyx_v_cov);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_v_cov);
- __pyx_v_cov = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":4144
- * mean = np.array(mean)
- * cov = np.array(cov)
- * if size is None: # <<<<<<<<<<<<<<
- * shape = []
- * else:
- */
- __pyx_t_4 = (__pyx_v_size == Py_None);
- if (__pyx_t_4) {
-
- /* "mtrand.pyx":4145
- * cov = np.array(cov)
- * if size is None:
- * shape = [] # <<<<<<<<<<<<<<
- * else:
- * shape = size
- */
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_v_shape = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":4147
- * shape = []
- * else:
- * shape = size # <<<<<<<<<<<<<<
- * if len(mean.shape) != 1:
- * raise ValueError("mean must be 1 dimensional")
- */
- __Pyx_INCREF(__pyx_v_size);
- __pyx_v_shape = __pyx_v_size;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":4148
- * else:
- * shape = size
- * if len(mean.shape) != 1: # <<<<<<<<<<<<<<
- * raise ValueError("mean must be 1 dimensional")
- * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = (__pyx_t_5 != 1);
- if (__pyx_t_4) {
-
- /* "mtrand.pyx":4149
- * shape = size
- * if len(mean.shape) != 1:
- * raise ValueError("mean must be 1 dimensional") # <<<<<<<<<<<<<<
- * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
- * raise ValueError("cov must be 2 dimensional and square")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_187), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":4150
- * if len(mean.shape) != 1:
- * raise ValueError("mean must be 1 dimensional")
- * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]): # <<<<<<<<<<<<<<
- * raise ValueError("cov must be 2 dimensional and square")
- * if mean.shape[0] != cov.shape[0]:
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = (__pyx_t_5 != 2);
- if (!__pyx_t_4) {
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_7 = __pyx_t_6;
- } else {
- __pyx_t_7 = __pyx_t_4;
- }
- if (__pyx_t_7) {
-
- /* "mtrand.pyx":4151
- * raise ValueError("mean must be 1 dimensional")
- * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
- * raise ValueError("cov must be 2 dimensional and square") # <<<<<<<<<<<<<<
- * if mean.shape[0] != cov.shape[0]:
- * raise ValueError("mean and cov must have same length")
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_189), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "mtrand.pyx":4152
- * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
- * raise ValueError("cov must be 2 dimensional and square")
- * if mean.shape[0] != cov.shape[0]: # <<<<<<<<<<<<<<
- * raise ValueError("mean and cov must have same length")
- * # Compute shape of output
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cov, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_7) {
-
- /* "mtrand.pyx":4153
- * raise ValueError("cov must be 2 dimensional and square")
- * if mean.shape[0] != cov.shape[0]:
- * raise ValueError("mean and cov must have same length") # <<<<<<<<<<<<<<
- * # Compute shape of output
- * if isinstance(shape, (int, long, np.integer)):
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_191), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "mtrand.pyx":4155
- * raise ValueError("mean and cov must have same length")
- * # Compute shape of output
- * if isinstance(shape, (int, long, np.integer)): # <<<<<<<<<<<<<<
- * shape = [shape]
- * final_shape = list(shape[:])
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__integer); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyLong_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)((PyObject*)(&PyLong_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyLong_Type))));
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_7 = PyObject_IsInstance(__pyx_v_shape, ((PyObject *)__pyx_t_2)); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- if (__pyx_t_7) {
-
- /* "mtrand.pyx":4156
- * # Compute shape of output
- * if isinstance(shape, (int, long, np.integer)):
- * shape = [shape] # <<<<<<<<<<<<<<
- * final_shape = list(shape[:])
- * final_shape.append(mean.shape[0])
- */
- __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_shape);
- PyList_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- __Pyx_DECREF(__pyx_v_shape);
- __pyx_v_shape = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "mtrand.pyx":4157
- * if isinstance(shape, (int, long, np.integer)):
- * shape = [shape]
- * final_shape = list(shape[:]) # <<<<<<<<<<<<<<
- * final_shape.append(mean.shape[0])
- * # Create a matrix of independent standard normally distributed random
- */
- __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_v_shape, 0, 0, NULL, NULL, &__pyx_k_slice_192, 0, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyList_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_final_shape = ((PyObject*)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":4158
- * shape = [shape]
- * final_shape = list(shape[:])
- * final_shape.append(mean.shape[0]) # <<<<<<<<<<<<<<
- * # Create a matrix of independent standard normally distributed random
- * # numbers. The matrix has rows with the same length as mean and as
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_final_shape, __pyx_t_3); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "mtrand.pyx":4162
- * # numbers. The matrix has rows with the same length as mean and as
- * # many rows are necessary to form a matrix of shape final_shape.
- * x = self.standard_normal(np.multiply.reduce(final_shape)) # <<<<<<<<<<<<<<
- * x.shape = (np.multiply.reduce(final_shape[0:len(final_shape)-1]),
- * mean.shape[0])
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__standard_normal); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__multiply); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__reduce); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(((PyObject *)__pyx_v_final_shape));
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_final_shape));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_final_shape));
- __pyx_t_9 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_9 = 0;
- __pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_v_x = __pyx_t_9;
- __pyx_t_9 = 0;
-
- /* "mtrand.pyx":4163
- * # many rows are necessary to form a matrix of shape final_shape.
- * x = self.standard_normal(np.multiply.reduce(final_shape))
- * x.shape = (np.multiply.reduce(final_shape[0:len(final_shape)-1]), # <<<<<<<<<<<<<<
- * mean.shape[0])
- * # Transform matrix of standard normals into matrix where each row
- */
- __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s__multiply); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__reduce); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_final_shape)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = __Pyx_PyList_GetSlice(((PyObject *)__pyx_v_final_shape), 0, (__pyx_t_5 - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_1));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
- __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-
- /* "mtrand.pyx":4164
- * x = self.standard_normal(np.multiply.reduce(final_shape))
- * x.shape = (np.multiply.reduce(final_shape[0:len(final_shape)-1]),
- * mean.shape[0]) # <<<<<<<<<<<<<<
- * # Transform matrix of standard normals into matrix where each row
- * # contains multivariate normals with the desired covariance.
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_mean, __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_3, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_9);
- __Pyx_GIVEREF(__pyx_t_9);
- __pyx_t_1 = 0;
- __pyx_t_9 = 0;
-
- /* "mtrand.pyx":4163
- * # many rows are necessary to form a matrix of shape final_shape.
- * x = self.standard_normal(np.multiply.reduce(final_shape))
- * x.shape = (np.multiply.reduce(final_shape[0:len(final_shape)-1]), # <<<<<<<<<<<<<<
- * mean.shape[0])
- * # Transform matrix of standard normals into matrix where each row
- */
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_x, __pyx_n_s__shape, ((PyObject *)__pyx_t_3)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
-
- /* "mtrand.pyx":4172
- * # decomposition of cov is such an A.
- *
- * from numpy.dual import svd # <<<<<<<<<<<<<<
- * # XXX: we really should be doing this by Cholesky decomposition
- * (u,s,v) = svd(cov)
- */
- __pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(((PyObject *)__pyx_n_s__svd));
- PyList_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_n_s__svd));
- __Pyx_GIVEREF(((PyObject *)__pyx_n_s__svd));
- __pyx_t_9 = __Pyx_Import(((PyObject *)__pyx_n_s_193), ((PyObject *)__pyx_t_3), -1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s__svd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_3);
- __pyx_v_svd = __pyx_t_3;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
-
- /* "mtrand.pyx":4174
- * from numpy.dual import svd
- * # XXX: we really should be doing this by Cholesky decomposition
- * (u,s,v) = svd(cov) # <<<<<<<<<<<<<<
- * x = np.dot(x*np.sqrt(s),v)
- * # The rows of x now have the correct covariance but mean 0. Add
- */
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_v_cov);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_cov);
- __Pyx_GIVEREF(__pyx_v_cov);
- __pyx_t_3 = PyObject_Call(__pyx_v_svd, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
- #if CYTHON_COMPILING_IN_CPYTHON
- Py_ssize_t size = Py_SIZE(sequence);
- #else
- Py_ssize_t size = PySequence_Size(sequence);
- #endif
- if (unlikely(size != 3)) {
- if (size > 3) __Pyx_RaiseTooManyValuesError(3);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- if (likely(PyTuple_CheckExact(sequence))) {
- __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
- __pyx_t_2 = PyTuple_GET_ITEM(sequence, 2);
- } else {
- __pyx_t_9 = PyList_GET_ITEM(sequence, 0);
- __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
- __pyx_t_2 = PyList_GET_ITEM(sequence, 2);
- }
- __Pyx_INCREF(__pyx_t_9);
- __Pyx_INCREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_t_2);
- #else
- __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- #endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else
- {
- Py_ssize_t index = -1;
- __pyx_t_10 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
- index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L8_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_9);
- index = 1; __pyx_t_1 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L8_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_1);
- index = 2; __pyx_t_2 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_2)) goto __pyx_L8_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_2);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_11 = NULL;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- goto __pyx_L9_unpacking_done;
- __pyx_L8_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- __pyx_t_11 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L9_unpacking_done:;
- }
- __pyx_v_u = __pyx_t_9;
- __pyx_t_9 = 0;
- __pyx_v_s = __pyx_t_1;
- __pyx_t_1 = 0;
- __pyx_v_v = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "mtrand.pyx":4175
- * # XXX: we really should be doing this by Cholesky decomposition
- * (u,s,v) = svd(cov)
- * x = np.dot(x*np.sqrt(s),v) # <<<<<<<<<<<<<<
- * # The rows of x now have the correct covariance but mean 0. Add
- * # mean to each row. Then each row will have mean mean.
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__dot); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__sqrt); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_s);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_s);
- __Pyx_GIVEREF(__pyx_v_s);
- __pyx_t_9 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Multiply(__pyx_v_x, __pyx_t_9); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_v);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_v);
- __Pyx_GIVEREF(__pyx_v_v);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __Pyx_DECREF(__pyx_v_x);
- __pyx_v_x = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":4178
- * # The rows of x now have the correct covariance but mean 0. Add
- * # mean to each row. Then each row will have mean mean.
- * np.add(mean,x,x) # <<<<<<<<<<<<<<
- * x.shape = tuple(final_shape)
- * return x
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__add); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_mean);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_mean);
- __Pyx_GIVEREF(__pyx_v_mean);
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_2 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "mtrand.pyx":4179
- * # mean to each row. Then each row will have mean mean.
- * np.add(mean,x,x)
- * x.shape = tuple(final_shape) # <<<<<<<<<<<<<<
- * return x
- *
- */
- __pyx_t_2 = ((PyObject *)PyList_AsTuple(__pyx_v_final_shape)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_x, __pyx_n_s__shape, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
-
- /* "mtrand.pyx":4180
- * np.add(mean,x,x)
- * x.shape = tuple(final_shape)
- * return x # <<<<<<<<<<<<<<
- *
- * def multinomial(self, npy_intp n, object pvals, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_x);
- __pyx_r = __pyx_v_x;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("mtrand.RandomState.multivariate_normal", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_shape);
- __Pyx_XDECREF(__pyx_v_final_shape);
- __Pyx_XDECREF(__pyx_v_x);
- __Pyx_XDECREF(__pyx_v_svd);
- __Pyx_XDECREF(__pyx_v_u);
- __Pyx_XDECREF(__pyx_v_s);
- __Pyx_XDECREF(__pyx_v_v);
- __Pyx_XDECREF(__pyx_v_mean);
- __Pyx_XDECREF(__pyx_v_cov);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_99multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_98multinomial[] = "\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 ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_99multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- npy_intp __pyx_v_n;
- PyObject *__pyx_v_pvals = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("multinomial (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__n,&__pyx_n_s__pvals,&__pyx_n_s__size,0};
- PyObject* values[3] = {0,0,0};
-
- /* "mtrand.pyx":4182
- * return x
- *
- * def multinomial(self, npy_intp n, object pvals, size=None): # <<<<<<<<<<<<<<
- * """
- * multinomial(n, pvals, size=None)
- */
- values[2] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__n)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__pvals)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("multinomial", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "multinomial") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_n = __Pyx_PyInt_from_py_npy_intp(values[0]); if (unlikely((__pyx_v_n == (npy_intp)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_pvals = values[1];
- __pyx_v_size = values[2];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("multinomial", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4182; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.multinomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_98multinomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_n, __pyx_v_pvals, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_98multinomial(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, npy_intp __pyx_v_n, PyObject *__pyx_v_pvals, PyObject *__pyx_v_size) {
- npy_intp __pyx_v_d;
- PyArrayObject *arrayObject_parr = 0;
- PyArrayObject *arrayObject_mnarr = 0;
- double *__pyx_v_pix;
- long *__pyx_v_mnix;
- npy_intp __pyx_v_i;
- npy_intp __pyx_v_j;
- npy_intp __pyx_v_dn;
- double __pyx_v_Sum;
- PyObject *__pyx_v_shape = NULL;
- PyObject *__pyx_v_multin = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- long __pyx_t_6;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("multinomial", 0);
-
- /* "mtrand.pyx":4241
- * cdef double Sum
- *
- * d = len(pvals) # <<<<<<<<<<<<<<
- * parr = <ndarray>PyArray_ContiguousFromObject(pvals, NPY_DOUBLE, 1, 1)
- * pix = <double*>PyArray_DATA(parr)
- */
- __pyx_t_1 = PyObject_Length(__pyx_v_pvals); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_d = __pyx_t_1;
-
- /* "mtrand.pyx":4242
- *
- * d = len(pvals)
- * parr = <ndarray>PyArray_ContiguousFromObject(pvals, NPY_DOUBLE, 1, 1) # <<<<<<<<<<<<<<
- * pix = <double*>PyArray_DATA(parr)
- *
- */
- __pyx_t_2 = PyArray_ContiguousFromObject(__pyx_v_pvals, NPY_DOUBLE, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- arrayObject_parr = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":4243
- * d = len(pvals)
- * parr = <ndarray>PyArray_ContiguousFromObject(pvals, NPY_DOUBLE, 1, 1)
- * pix = <double*>PyArray_DATA(parr) # <<<<<<<<<<<<<<
- *
- * if kahan_sum(pix, d-1) > (1.0 + 1e-12):
- */
- __pyx_v_pix = ((double *)PyArray_DATA(arrayObject_parr));
-
- /* "mtrand.pyx":4245
- * pix = <double*>PyArray_DATA(parr)
- *
- * if kahan_sum(pix, d-1) > (1.0 + 1e-12): # <<<<<<<<<<<<<<
- * raise ValueError("sum(pvals[:-1]) > 1.0")
- *
- */
- __pyx_t_4 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix, (__pyx_v_d - 1)) > (1.0 + 1e-12));
- if (__pyx_t_4) {
-
- /* "mtrand.pyx":4246
- *
- * if kahan_sum(pix, d-1) > (1.0 + 1e-12):
- * raise ValueError("sum(pvals[:-1]) > 1.0") # <<<<<<<<<<<<<<
- *
- * if size is None:
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_195), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":4248
- * raise ValueError("sum(pvals[:-1]) > 1.0")
- *
- * if size is None: # <<<<<<<<<<<<<<
- * shape = (d,)
- * elif type(size) is int:
- */
- __pyx_t_4 = (__pyx_v_size == Py_None);
- if (__pyx_t_4) {
-
- /* "mtrand.pyx":4249
- *
- * if size is None:
- * shape = (d,) # <<<<<<<<<<<<<<
- * elif type(size) is int:
- * shape = (size, d)
- */
- __pyx_t_3 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_v_shape = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
- goto __pyx_L4;
- }
-
- /* "mtrand.pyx":4250
- * if size is None:
- * shape = (d,)
- * elif type(size) is int: # <<<<<<<<<<<<<<
- * shape = (size, d)
- * else:
- */
- __pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_size)) == ((PyObject *)((PyObject*)(&PyInt_Type))));
- if (__pyx_t_4) {
-
- /* "mtrand.pyx":4251
- * shape = (d,)
- * elif type(size) is int:
- * shape = (size, d) # <<<<<<<<<<<<<<
- * else:
- * shape = size + (d,)
- */
- __pyx_t_2 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_d); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_v_shape = ((PyObject *)__pyx_t_3);
- __pyx_t_3 = 0;
- goto __pyx_L4;
- }
- /*else*/ {
-
- /* "mtrand.pyx":4253
- * shape = (size, d)
- * else:
- * shape = size + (d,) # <<<<<<<<<<<<<<
- *
- * multin = np.zeros(shape, int)
- */
- __pyx_t_3 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_d); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_v_size, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_v_shape = __pyx_t_3;
- __pyx_t_3 = 0;
- }
- __pyx_L4:;
-
- /* "mtrand.pyx":4255
- * shape = size + (d,)
- *
- * multin = np.zeros(shape, int) # <<<<<<<<<<<<<<
- * mnarr = <ndarray>multin
- * mnix = <long*>PyArray_DATA(mnarr)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_multin = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "mtrand.pyx":4256
- *
- * multin = np.zeros(shape, int)
- * mnarr = <ndarray>multin # <<<<<<<<<<<<<<
- * mnix = <long*>PyArray_DATA(mnarr)
- * i = 0
- */
- __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin)));
- arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin);
-
- /* "mtrand.pyx":4257
- * multin = np.zeros(shape, int)
- * mnarr = <ndarray>multin
- * mnix = <long*>PyArray_DATA(mnarr) # <<<<<<<<<<<<<<
- * i = 0
- * while i < PyArray_SIZE(mnarr):
- */
- __pyx_v_mnix = ((long *)PyArray_DATA(arrayObject_mnarr));
-
- /* "mtrand.pyx":4258
- * mnarr = <ndarray>multin
- * mnix = <long*>PyArray_DATA(mnarr)
- * i = 0 # <<<<<<<<<<<<<<
- * while i < PyArray_SIZE(mnarr):
- * Sum = 1.0
- */
- __pyx_v_i = 0;
-
- /* "mtrand.pyx":4259
- * mnix = <long*>PyArray_DATA(mnarr)
- * i = 0
- * while i < PyArray_SIZE(mnarr): # <<<<<<<<<<<<<<
- * Sum = 1.0
- * dn = n
- */
- while (1) {
- __pyx_t_4 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr));
- if (!__pyx_t_4) break;
-
- /* "mtrand.pyx":4260
- * i = 0
- * while i < PyArray_SIZE(mnarr):
- * Sum = 1.0 # <<<<<<<<<<<<<<
- * dn = n
- * for j from 0 <= j < d-1:
- */
- __pyx_v_Sum = 1.0;
-
- /* "mtrand.pyx":4261
- * while i < PyArray_SIZE(mnarr):
- * Sum = 1.0
- * dn = n # <<<<<<<<<<<<<<
- * for j from 0 <= j < d-1:
- * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
- */
- __pyx_v_dn = __pyx_v_n;
-
- /* "mtrand.pyx":4262
- * Sum = 1.0
- * dn = n
- * for j from 0 <= j < d-1: # <<<<<<<<<<<<<<
- * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
- * dn = dn - mnix[i+j]
- */
- __pyx_t_6 = (__pyx_v_d - 1);
- for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {
-
- /* "mtrand.pyx":4263
- * dn = n
- * for j from 0 <= j < d-1:
- * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum) # <<<<<<<<<<<<<<
- * dn = dn - mnix[i+j]
- * if dn <= 0:
- */
- if (unlikely(__pyx_v_Sum == 0)) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- PyErr_Format(PyExc_ZeroDivisionError, "float division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(__pyx_v_self->internal_state, __pyx_v_dn, ((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum));
-
- /* "mtrand.pyx":4264
- * for j from 0 <= j < d-1:
- * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
- * dn = dn - mnix[i+j] # <<<<<<<<<<<<<<
- * if dn <= 0:
- * break
- */
- __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]));
-
- /* "mtrand.pyx":4265
- * mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
- * dn = dn - mnix[i+j]
- * if dn <= 0: # <<<<<<<<<<<<<<
- * break
- * Sum = Sum - pix[j]
- */
- __pyx_t_4 = (__pyx_v_dn <= 0);
- if (__pyx_t_4) {
-
- /* "mtrand.pyx":4266
- * dn = dn - mnix[i+j]
- * if dn <= 0:
- * break # <<<<<<<<<<<<<<
- * Sum = Sum - pix[j]
- * if dn > 0:
- */
- goto __pyx_L8_break;
- goto __pyx_L9;
- }
- __pyx_L9:;
-
- /* "mtrand.pyx":4267
- * if dn <= 0:
- * break
- * Sum = Sum - pix[j] # <<<<<<<<<<<<<<
- * if dn > 0:
- * mnix[i+d-1] = dn
- */
- __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j]));
- }
- __pyx_L8_break:;
-
- /* "mtrand.pyx":4268
- * break
- * Sum = Sum - pix[j]
- * if dn > 0: # <<<<<<<<<<<<<<
- * mnix[i+d-1] = dn
- *
- */
- __pyx_t_4 = (__pyx_v_dn > 0);
- if (__pyx_t_4) {
-
- /* "mtrand.pyx":4269
- * Sum = Sum - pix[j]
- * if dn > 0:
- * mnix[i+d-1] = dn # <<<<<<<<<<<<<<
- *
- * i = i + d
- */
- (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn;
- goto __pyx_L10;
- }
- __pyx_L10:;
-
- /* "mtrand.pyx":4271
- * mnix[i+d-1] = dn
- *
- * i = i + d # <<<<<<<<<<<<<<
- *
- * return multin
- */
- __pyx_v_i = (__pyx_v_i + __pyx_v_d);
- }
-
- /* "mtrand.pyx":4273
- * i = i + d
- *
- * return multin # <<<<<<<<<<<<<<
- *
- * def dirichlet(self, object alpha, size=None):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_multin);
- __pyx_r = __pyx_v_multin;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.multinomial", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)arrayObject_parr);
- __Pyx_XDECREF((PyObject *)arrayObject_mnarr);
- __Pyx_XDECREF(__pyx_v_shape);
- __Pyx_XDECREF(__pyx_v_multin);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_101dirichlet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_100dirichlet[] = "\n dirichlet(alpha, size=None)\n\n Draw samples from the Dirichlet distribution.\n\n Draw `size` samples of dimension k from a Dirichlet distribution. A\n Dirichlet-distributed random variable can be seen as a multivariate\n generalization of a Beta distribution. Dirichlet pdf is the conjugate\n prior of a multinomial in Bayesian inference.\n\n Parameters\n ----------\n alpha : array\n Parameter of the distribution (k dimension for sample of\n dimension k).\n size : array\n Number of samples to draw.\n\n Returns\n -------\n samples : ndarray,\n The drawn samples, of shape (alpha.ndim, size).\n\n Notes\n -----\n .. math:: X \\approx \\prod_{i=1}^{k}{x^{\\alpha_i-1}_i}\n\n Uses the following property for computation: for each dimension,\n draw a random sample y_i from a standard gamma generator of shape\n `alpha_i`, then\n :math:`X = \\frac{1}{\\sum_{i=1}^k{y_i}} (y_1, \\ldots, y_n)` is\n Dirichlet distributed.\n\n References\n ----------\n .. [1] David McKay, \"Information Theory, Inference and Learning\n Algorithms,\" chapter 23,\n http://www.inference.phy.cam.ac.uk/mackay/\n .. [2] Wikipedia, \"Dirichlet distribution\",\n http://en.wikipedia.org/wiki/Dirichlet_distribution\n\n Examples\n --------\n Taking an example cited in Wikipedia, this distribution can be used if\n one wanted to cut strings (each of initial length 1.0) into K pieces\n with different lengths, where each piece had, on average, a designated\n average length, but allowing some variation in the relative sizes of the\n pieces.\n\n >>> s = np.random.dirichlet((10, 5, 3), 20).transpose()\n\n >>> plt.barh(range(20), s[0])\n >>> plt.barh(range(20), s[1], left=s[0], color='g')""\n >>> plt.barh(range(20), s[2], left=s[0]+s[1], color='r')\n >>> plt.title(\"Lengths of Strings\")\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_101dirichlet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_alpha = 0;
- PyObject *__pyx_v_size = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("dirichlet (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__alpha,&__pyx_n_s__size,0};
- PyObject* values[2] = {0,0};
-
- /* "mtrand.pyx":4275
- * return multin
- *
- * def dirichlet(self, object alpha, size=None): # <<<<<<<<<<<<<<
- * """
- * dirichlet(alpha, size=None)
- */
- values[1] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__alpha)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__size);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dirichlet") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_alpha = values[0];
- __pyx_v_size = values[1];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("dirichlet", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4275; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("mtrand.RandomState.dirichlet", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6mtrand_11RandomState_100dirichlet(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), __pyx_v_alpha, __pyx_v_size);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_100dirichlet(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_alpha, PyObject *__pyx_v_size) {
- npy_intp __pyx_v_k;
- npy_intp __pyx_v_totsize;
- PyArrayObject *__pyx_v_alpha_arr = 0;
- PyArrayObject *__pyx_v_val_arr = 0;
- double *__pyx_v_alpha_data;
- double *__pyx_v_val_data;
- npy_intp __pyx_v_i;
- npy_intp __pyx_v_j;
- double __pyx_v_acc;
- double __pyx_v_invacc;
- PyObject *__pyx_v_shape = NULL;
- PyObject *__pyx_v_diric = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- npy_intp __pyx_t_6;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("dirichlet", 0);
-
- /* "mtrand.pyx":4361
- * cdef double acc, invacc
- *
- * k = len(alpha) # <<<<<<<<<<<<<<
- * alpha_arr = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1)
- * alpha_data = <double*>PyArray_DATA(alpha_arr)
- */
- __pyx_t_1 = PyObject_Length(__pyx_v_alpha); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_k = __pyx_t_1;
-
- /* "mtrand.pyx":4362
- *
- * k = len(alpha)
- * alpha_arr = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1) # <<<<<<<<<<<<<<
- * alpha_data = <double*>PyArray_DATA(alpha_arr)
- *
- */
- __pyx_t_2 = PyArray_ContiguousFromObject(__pyx_v_alpha, NPY_DOUBLE, 1, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_t_2;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_alpha_arr = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "mtrand.pyx":4363
- * k = len(alpha)
- * alpha_arr = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1)
- * alpha_data = <double*>PyArray_DATA(alpha_arr) # <<<<<<<<<<<<<<
- *
- * if size is None:
- */
- __pyx_v_alpha_data = ((double *)PyArray_DATA(__pyx_v_alpha_arr));
-
- /* "mtrand.pyx":4365
- * alpha_data = <double*>PyArray_DATA(alpha_arr)
- *
- * if size is None: # <<<<<<<<<<<<<<
- * shape = (k,)
- * elif type(size) is int:
- */
- __pyx_t_4 = (__pyx_v_size == Py_None);
- if (__pyx_t_4) {
-
- /* "mtrand.pyx":4366
- *
- * if size is None:
- * shape = (k,) # <<<<<<<<<<<<<<
- * elif type(size) is int:
- * shape = (size, k)
- */
- __pyx_t_3 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_v_shape = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
- goto __pyx_L3;
- }
-
- /* "mtrand.pyx":4367
- * if size is None:
- * shape = (k,)
- * elif type(size) is int: # <<<<<<<<<<<<<<
- * shape = (size, k)
- * else:
- */
- __pyx_t_4 = (((PyObject *)Py_TYPE(__pyx_v_size)) == ((PyObject *)((PyObject*)(&PyInt_Type))));
- if (__pyx_t_4) {
-
- /* "mtrand.pyx":4368
- * shape = (k,)
- * elif type(size) is int:
- * shape = (size, k) # <<<<<<<<<<<<<<
- * else:
- * shape = size + (k,)
- */
- __pyx_t_2 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_size);
- __Pyx_GIVEREF(__pyx_v_size);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_v_shape = ((PyObject *)__pyx_t_3);
- __pyx_t_3 = 0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":4370
- * shape = (size, k)
- * else:
- * shape = size + (k,) # <<<<<<<<<<<<<<
- *
- * diric = np.zeros(shape, np.float64)
- */
- __pyx_t_3 = __Pyx_PyInt_to_py_npy_intp(__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_v_size, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_v_shape = __pyx_t_3;
- __pyx_t_3 = 0;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":4372
- * shape = size + (k,)
- *
- * diric = np.zeros(shape, np.float64) # <<<<<<<<<<<<<<
- * val_arr = <ndarray>diric
- * val_data= <double*>PyArray_DATA(val_arr)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_shape);
- __Pyx_GIVEREF(__pyx_v_shape);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_diric = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "mtrand.pyx":4373
- *
- * diric = np.zeros(shape, np.float64)
- * val_arr = <ndarray>diric # <<<<<<<<<<<<<<
- * val_data= <double*>PyArray_DATA(val_arr)
- *
- */
- __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_diric)));
- __pyx_v_val_arr = ((PyArrayObject *)__pyx_v_diric);
-
- /* "mtrand.pyx":4374
- * diric = np.zeros(shape, np.float64)
- * val_arr = <ndarray>diric
- * val_data= <double*>PyArray_DATA(val_arr) # <<<<<<<<<<<<<<
- *
- * i = 0
- */
- __pyx_v_val_data = ((double *)PyArray_DATA(__pyx_v_val_arr));
-
- /* "mtrand.pyx":4376
- * val_data= <double*>PyArray_DATA(val_arr)
- *
- * i = 0 # <<<<<<<<<<<<<<
- * totsize = PyArray_SIZE(val_arr)
- * while i < totsize:
- */
- __pyx_v_i = 0;
-
- /* "mtrand.pyx":4377
- *
- * i = 0
- * totsize = PyArray_SIZE(val_arr) # <<<<<<<<<<<<<<
- * while i < totsize:
- * acc = 0.0
- */
- __pyx_v_totsize = PyArray_SIZE(__pyx_v_val_arr);
-
- /* "mtrand.pyx":4378
- * i = 0
- * totsize = PyArray_SIZE(val_arr)
- * while i < totsize: # <<<<<<<<<<<<<<
- * acc = 0.0
- * for j from 0 <= j < k:
- */
- while (1) {
- __pyx_t_4 = (__pyx_v_i < __pyx_v_totsize);
- if (!__pyx_t_4) break;
-
- /* "mtrand.pyx":4379
- * totsize = PyArray_SIZE(val_arr)
- * while i < totsize:
- * acc = 0.0 # <<<<<<<<<<<<<<
- * for j from 0 <= j < k:
- * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j])
- */
- __pyx_v_acc = 0.0;
-
- /* "mtrand.pyx":4380
- * while i < totsize:
- * acc = 0.0
- * for j from 0 <= j < k: # <<<<<<<<<<<<<<
- * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j])
- * acc = acc + val_data[i+j]
- */
- __pyx_t_6 = __pyx_v_k;
- for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {
-
- /* "mtrand.pyx":4381
- * acc = 0.0
- * for j from 0 <= j < k:
- * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j]) # <<<<<<<<<<<<<<
- * acc = acc + val_data[i+j]
- * invacc = 1/acc
- */
- (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = rk_standard_gamma(__pyx_v_self->internal_state, (__pyx_v_alpha_data[__pyx_v_j]));
-
- /* "mtrand.pyx":4382
- * for j from 0 <= j < k:
- * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j])
- * acc = acc + val_data[i+j] # <<<<<<<<<<<<<<
- * invacc = 1/acc
- * for j from 0 <= j < k:
- */
- __pyx_v_acc = (__pyx_v_acc + (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]));
- }
-
- /* "mtrand.pyx":4383
- * val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j])
- * acc = acc + val_data[i+j]
- * invacc = 1/acc # <<<<<<<<<<<<<<
- * for j from 0 <= j < k:
- * val_data[i+j] = val_data[i+j] * invacc
- */
- if (unlikely(__pyx_v_acc == 0)) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- PyErr_Format(PyExc_ZeroDivisionError, "float division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_v_invacc = (1.0 / __pyx_v_acc);
-
- /* "mtrand.pyx":4384
- * acc = acc + val_data[i+j]
- * invacc = 1/acc
- * for j from 0 <= j < k: # <<<<<<<<<<<<<<
- * val_data[i+j] = val_data[i+j] * invacc
- * i = i + k
- */
- __pyx_t_6 = __pyx_v_k;
- for (__pyx_v_j = 0; __pyx_v_j < __pyx_t_6; __pyx_v_j++) {
-
- /* "mtrand.pyx":4385
- * invacc = 1/acc
- * for j from 0 <= j < k:
- * val_data[i+j] = val_data[i+j] * invacc # <<<<<<<<<<<<<<
- * i = i + k
- *
- */
- (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = ((__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) * __pyx_v_invacc);
- }
-
- /* "mtrand.pyx":4386
- * for j from 0 <= j < k:
- * val_data[i+j] = val_data[i+j] * invacc
- * i = i + k # <<<<<<<<<<<<<<
- *
- * return diric
- */
- __pyx_v_i = (__pyx_v_i + __pyx_v_k);
- }
-
- /* "mtrand.pyx":4388
- * i = i + k
- *
- * return diric # <<<<<<<<<<<<<<
- *
- * # Shuffling and permutations:
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_diric);
- __pyx_r = __pyx_v_diric;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("mtrand.RandomState.dirichlet", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_alpha_arr);
- __Pyx_XDECREF((PyObject *)__pyx_v_val_arr);
- __Pyx_XDECREF(__pyx_v_shape);
- __Pyx_XDECREF(__pyx_v_diric);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_103shuffle(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_102shuffle[] = "\n shuffle(x)\n\n Modify a sequence in-place by shuffling its contents.\n\n Parameters\n ----------\n x : array_like\n The array or list to be shuffled.\n\n Returns\n -------\n None\n\n Examples\n --------\n >>> arr = np.arange(10)\n >>> np.random.shuffle(arr)\n >>> arr\n [1 7 5 2 9 4 3 6 0 8]\n\n This function only shuffles the array along the first index of a\n multi-dimensional array:\n\n >>> arr = np.arange(9).reshape((3, 3))\n >>> np.random.shuffle(arr)\n >>> arr\n array([[3, 4, 5],\n [6, 7, 8],\n [0, 1, 2]])\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_103shuffle(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("shuffle (wrapper)", 0);
- __pyx_r = __pyx_pf_6mtrand_11RandomState_102shuffle(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), ((PyObject *)__pyx_v_x));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":4391
- *
- * # Shuffling and permutations:
- * def shuffle(self, object x): # <<<<<<<<<<<<<<
- * """
- * shuffle(x)
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_102shuffle(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_x) {
- npy_intp __pyx_v_i;
- npy_intp __pyx_v_j;
- PyObject *__pyx_v_buf = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_t_4;
- int __pyx_t_5;
- int __pyx_t_6;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("shuffle", 0);
-
- /* "mtrand.pyx":4426
- * cdef npy_intp i, j
- *
- * i = len(x) - 1 # <<<<<<<<<<<<<<
- *
- * # Logic adapted from random.shuffle()
- */
- __pyx_t_1 = PyObject_Length(__pyx_v_x); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_i = (__pyx_t_1 - 1);
-
- /* "mtrand.pyx":4429
- *
- * # Logic adapted from random.shuffle()
- * if isinstance(x, np.ndarray) and x.ndim > 1: # <<<<<<<<<<<<<<
- * # For a multi-dimensional ndarray, indexing returns a view onto
- * # each row. So we can't just use ordinary assignment to swap the
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__ndarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_4 = PyObject_IsInstance(__pyx_v_x, __pyx_t_3); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_4) {
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s__ndim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4429; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __pyx_t_5;
- } else {
- __pyx_t_6 = __pyx_t_4;
- }
- if (__pyx_t_6) {
-
- /* "mtrand.pyx":4433
- * # each row. So we can't just use ordinary assignment to swap the
- * # rows; we need a bounce buffer.
- * buf = np.empty(x.shape[1:], dtype=x.dtype) # <<<<<<<<<<<<<<
- * while i > 0:
- * j = rk_interval(i, self.internal_state)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__empty); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s__shape); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_7 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, 0, NULL, NULL, &__pyx_k_slice_196, 1, 0, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_7 = 0;
- __pyx_t_7 = PyDict_New(); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_7));
- __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s__dtype); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- if (PyDict_SetItem(__pyx_t_7, ((PyObject *)__pyx_n_s__dtype), __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_7)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
- __pyx_v_buf = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "mtrand.pyx":4434
- * # rows; we need a bounce buffer.
- * buf = np.empty(x.shape[1:], dtype=x.dtype)
- * while i > 0: # <<<<<<<<<<<<<<
- * j = rk_interval(i, self.internal_state)
- * buf[...] = x[j]
- */
- while (1) {
- __pyx_t_6 = (__pyx_v_i > 0);
- if (!__pyx_t_6) break;
-
- /* "mtrand.pyx":4435
- * buf = np.empty(x.shape[1:], dtype=x.dtype)
- * while i > 0:
- * j = rk_interval(i, self.internal_state) # <<<<<<<<<<<<<<
- * buf[...] = x[j]
- * x[j] = x[i]
- */
- __pyx_v_j = rk_interval(__pyx_v_i, __pyx_v_self->internal_state);
-
- /* "mtrand.pyx":4436
- * while i > 0:
- * j = rk_interval(i, self.internal_state)
- * buf[...] = x[j] # <<<<<<<<<<<<<<
- * x[j] = x[i]
- * x[i] = buf
- */
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, sizeof(npy_intp), __Pyx_PyInt_to_py_npy_intp, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- if (PyObject_SetItem(__pyx_v_buf, Py_Ellipsis, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "mtrand.pyx":4437
- * j = rk_interval(i, self.internal_state)
- * buf[...] = x[j]
- * x[j] = x[i] # <<<<<<<<<<<<<<
- * x[i] = buf
- * i = i - 1
- */
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(npy_intp), __Pyx_PyInt_to_py_npy_intp, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_8, sizeof(npy_intp), __Pyx_PyInt_to_py_npy_intp, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
-
- /* "mtrand.pyx":4438
- * buf[...] = x[j]
- * x[j] = x[i]
- * x[i] = buf # <<<<<<<<<<<<<<
- * i = i - 1
- * else:
- */
- if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_v_buf, sizeof(npy_intp), __Pyx_PyInt_to_py_npy_intp, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "mtrand.pyx":4439
- * x[j] = x[i]
- * x[i] = buf
- * i = i - 1 # <<<<<<<<<<<<<<
- * else:
- * # For single-dimensional arrays, lists, and any other Python
- */
- __pyx_v_i = (__pyx_v_i - 1);
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":4444
- * # sequence types, indexing returns a real object that's
- * # independent of the array contents, so we can just swap directly.
- * while i > 0: # <<<<<<<<<<<<<<
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j], x[i]
- */
- while (1) {
- __pyx_t_6 = (__pyx_v_i > 0);
- if (!__pyx_t_6) break;
-
- /* "mtrand.pyx":4445
- * # independent of the array contents, so we can just swap directly.
- * while i > 0:
- * j = rk_interval(i, self.internal_state) # <<<<<<<<<<<<<<
- * x[i], x[j] = x[j], x[i]
- * i = i - 1
- */
- __pyx_v_j = rk_interval(__pyx_v_i, __pyx_v_self->internal_state);
-
- /* "mtrand.pyx":4446
- * while i > 0:
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j], x[i] # <<<<<<<<<<<<<<
- * i = i - 1
- *
- */
- __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j, sizeof(npy_intp), __Pyx_PyInt_to_py_npy_intp, 0, 1, 1); if (!__pyx_t_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(npy_intp), __Pyx_PyInt_to_py_npy_intp, 0, 1, 1); if (!__pyx_t_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_t_8, sizeof(npy_intp), __Pyx_PyInt_to_py_npy_intp, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_t_7, sizeof(npy_intp), __Pyx_PyInt_to_py_npy_intp, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "mtrand.pyx":4447
- * j = rk_interval(i, self.internal_state)
- * x[i], x[j] = x[j], x[i]
- * i = i - 1 # <<<<<<<<<<<<<<
- *
- * def permutation(self, object x):
- */
- __pyx_v_i = (__pyx_v_i - 1);
- }
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("mtrand.RandomState.shuffle", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_buf);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6mtrand_11RandomState_105permutation(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
-static char __pyx_doc_6mtrand_11RandomState_104permutation[] = "\n permutation(x)\n\n Randomly permute a sequence, or return a permuted range.\n\n If `x` is a multi-dimensional array, it is only shuffled along its\n first index.\n\n Parameters\n ----------\n x : int or array_like\n If `x` is an integer, randomly permute ``np.arange(x)``.\n If `x` is an array, make a copy and shuffle the elements\n randomly.\n\n Returns\n -------\n out : ndarray\n Permuted sequence or array range.\n\n Examples\n --------\n >>> np.random.permutation(10)\n array([1, 7, 4, 3, 0, 9, 2, 5, 8, 6])\n\n >>> np.random.permutation([1, 4, 9, 12, 15])\n array([15, 1, 9, 4, 12])\n\n >>> arr = np.arange(9).reshape((3, 3))\n >>> np.random.permutation(arr)\n array([[6, 7, 8],\n [0, 1, 2],\n [3, 4, 5]])\n\n ";
-static PyObject *__pyx_pw_6mtrand_11RandomState_105permutation(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("permutation (wrapper)", 0);
- __pyx_r = __pyx_pf_6mtrand_11RandomState_104permutation(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self), ((PyObject *)__pyx_v_x));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "mtrand.pyx":4449
- * i = i - 1
- *
- * def permutation(self, object x): # <<<<<<<<<<<<<<
- * """
- * permutation(x)
- */
-
-static PyObject *__pyx_pf_6mtrand_11RandomState_104permutation(struct __pyx_obj_6mtrand_RandomState *__pyx_v_self, PyObject *__pyx_v_x) {
- PyObject *__pyx_v_arr = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("permutation", 0);
-
- /* "mtrand.pyx":4485
- *
- * """
- * if isinstance(x, (int, long, np.integer)): # <<<<<<<<<<<<<<
- * arr = np.arange(x)
- * else:
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__integer); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyInt_Type))));
- __Pyx_INCREF(((PyObject *)((PyObject*)(&PyLong_Type))));
- PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((PyObject*)(&PyLong_Type))));
- __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyLong_Type))));
- PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_3 = PyObject_IsInstance(__pyx_v_x, ((PyObject *)__pyx_t_1)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4485; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- if (__pyx_t_3) {
-
- /* "mtrand.pyx":4486
- * """
- * if isinstance(x, (int, long, np.integer)):
- * arr = np.arange(x) # <<<<<<<<<<<<<<
- * else:
- * arr = np.array(x)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__arange); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_v_arr = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "mtrand.pyx":4488
- * arr = np.arange(x)
- * else:
- * arr = np.array(x) # <<<<<<<<<<<<<<
- * self.shuffle(arr)
- * return arr
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__array); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_v_arr = __pyx_t_2;
- __pyx_t_2 = 0;
- }
- __pyx_L3:;
-
- /* "mtrand.pyx":4489
- * else:
- * arr = np.array(x)
- * self.shuffle(arr) # <<<<<<<<<<<<<<
- * return arr
- *
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shuffle); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_arr);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_arr);
- __Pyx_GIVEREF(__pyx_v_arr);
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4490
- * arr = np.array(x)
- * self.shuffle(arr)
- * return arr # <<<<<<<<<<<<<<
- *
- * _rand = RandomState()
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_arr);
- __pyx_r = __pyx_v_arr;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("mtrand.RandomState.permutation", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_arr);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_tp_new_6mtrand_RandomState(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- PyObject *o;
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- return o;
-}
-
-static void __pyx_tp_dealloc_6mtrand_RandomState(PyObject *o) {
- {
- PyObject *etype, *eval, *etb;
- PyErr_Fetch(&etype, &eval, &etb);
- ++Py_REFCNT(o);
- __pyx_pw_6mtrand_11RandomState_3__dealloc__(o);
- if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
- --Py_REFCNT(o);
- PyErr_Restore(etype, eval, etb);
- }
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static PyMethodDef __pyx_methods_6mtrand_RandomState[] = {
- {__Pyx_NAMESTR("seed"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_5seed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_4seed)},
- {__Pyx_NAMESTR("get_state"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_7get_state, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_6get_state)},
- {__Pyx_NAMESTR("set_state"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_9set_state, METH_O, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_8set_state)},
- {__Pyx_NAMESTR("__getstate__"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_11__getstate__, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("__setstate__"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_13__setstate__, METH_O, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_15__reduce__, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("random_sample"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_17random_sample, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_16random_sample)},
- {__Pyx_NAMESTR("tomaxint"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_19tomaxint, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_18tomaxint)},
- {__Pyx_NAMESTR("randint"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_21randint, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_20randint)},
- {__Pyx_NAMESTR("bytes"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_23bytes, METH_O, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_22bytes)},
- {__Pyx_NAMESTR("choice"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_25choice, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_24choice)},
- {__Pyx_NAMESTR("uniform"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_27uniform, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_26uniform)},
- {__Pyx_NAMESTR("rand"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_29rand, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_28rand)},
- {__Pyx_NAMESTR("randn"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_31randn, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_30randn)},
- {__Pyx_NAMESTR("random_integers"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_33random_integers, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_32random_integers)},
- {__Pyx_NAMESTR("standard_normal"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_35standard_normal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_34standard_normal)},
- {__Pyx_NAMESTR("normal"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_37normal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_36normal)},
- {__Pyx_NAMESTR("beta"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_39beta, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_38beta)},
- {__Pyx_NAMESTR("exponential"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_41exponential, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_40exponential)},
- {__Pyx_NAMESTR("standard_exponential"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_43standard_exponential, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_42standard_exponential)},
- {__Pyx_NAMESTR("standard_gamma"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_45standard_gamma, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_44standard_gamma)},
- {__Pyx_NAMESTR("gamma"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_47gamma, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_46gamma)},
- {__Pyx_NAMESTR("f"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_49f, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_48f)},
- {__Pyx_NAMESTR("noncentral_f"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_51noncentral_f, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_50noncentral_f)},
- {__Pyx_NAMESTR("chisquare"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_53chisquare, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_52chisquare)},
- {__Pyx_NAMESTR("noncentral_chisquare"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_55noncentral_chisquare, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_54noncentral_chisquare)},
- {__Pyx_NAMESTR("standard_cauchy"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_57standard_cauchy, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_56standard_cauchy)},
- {__Pyx_NAMESTR("standard_t"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_59standard_t, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_58standard_t)},
- {__Pyx_NAMESTR("vonmises"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_61vonmises, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_60vonmises)},
- {__Pyx_NAMESTR("pareto"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_63pareto, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_62pareto)},
- {__Pyx_NAMESTR("weibull"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_65weibull, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_64weibull)},
- {__Pyx_NAMESTR("power"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_67power, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_66power)},
- {__Pyx_NAMESTR("laplace"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_69laplace, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_68laplace)},
- {__Pyx_NAMESTR("gumbel"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_71gumbel, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_70gumbel)},
- {__Pyx_NAMESTR("logistic"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_73logistic, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_72logistic)},
- {__Pyx_NAMESTR("lognormal"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_75lognormal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_74lognormal)},
- {__Pyx_NAMESTR("rayleigh"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_77rayleigh, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_76rayleigh)},
- {__Pyx_NAMESTR("wald"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_79wald, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_78wald)},
- {__Pyx_NAMESTR("triangular"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_81triangular, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_80triangular)},
- {__Pyx_NAMESTR("binomial"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_83binomial, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_82binomial)},
- {__Pyx_NAMESTR("negative_binomial"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_85negative_binomial, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_84negative_binomial)},
- {__Pyx_NAMESTR("poisson"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_87poisson, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_86poisson)},
- {__Pyx_NAMESTR("zipf"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_89zipf, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_88zipf)},
- {__Pyx_NAMESTR("geometric"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_91geometric, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_90geometric)},
- {__Pyx_NAMESTR("hypergeometric"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_93hypergeometric, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_92hypergeometric)},
- {__Pyx_NAMESTR("logseries"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_95logseries, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_94logseries)},
- {__Pyx_NAMESTR("multivariate_normal"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_97multivariate_normal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_96multivariate_normal)},
- {__Pyx_NAMESTR("multinomial"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_99multinomial, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_98multinomial)},
- {__Pyx_NAMESTR("dirichlet"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_101dirichlet, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_100dirichlet)},
- {__Pyx_NAMESTR("shuffle"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_103shuffle, METH_O, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_102shuffle)},
- {__Pyx_NAMESTR("permutation"), (PyCFunction)__pyx_pw_6mtrand_11RandomState_105permutation, METH_O, __Pyx_DOCSTR(__pyx_doc_6mtrand_11RandomState_104permutation)},
- {0, 0, 0, 0}
-};
-
-static PyNumberMethods __pyx_tp_as_number_RandomState = {
- 0, /*nb_add*/
- 0, /*nb_subtract*/
- 0, /*nb_multiply*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_divide*/
- #endif
- 0, /*nb_remainder*/
- 0, /*nb_divmod*/
- 0, /*nb_power*/
- 0, /*nb_negative*/
- 0, /*nb_positive*/
- 0, /*nb_absolute*/
- 0, /*nb_nonzero*/
- 0, /*nb_invert*/
- 0, /*nb_lshift*/
- 0, /*nb_rshift*/
- 0, /*nb_and*/
- 0, /*nb_xor*/
- 0, /*nb_or*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_coerce*/
- #endif
- 0, /*nb_int*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_long*/
- #else
- 0, /*reserved*/
- #endif
- 0, /*nb_float*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_oct*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_hex*/
- #endif
- 0, /*nb_inplace_add*/
- 0, /*nb_inplace_subtract*/
- 0, /*nb_inplace_multiply*/
- #if PY_MAJOR_VERSION < 3
- 0, /*nb_inplace_divide*/
- #endif
- 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*/
- 0, /*nb_floor_divide*/
- 0, /*nb_true_divide*/
- 0, /*nb_inplace_floor_divide*/
- 0, /*nb_inplace_true_divide*/
- #if PY_VERSION_HEX >= 0x02050000
- 0, /*nb_index*/
- #endif
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_RandomState = {
- 0, /*sq_length*/
- 0, /*sq_concat*/
- 0, /*sq_repeat*/
- 0, /*sq_item*/
- 0, /*sq_slice*/
- 0, /*sq_ass_item*/
- 0, /*sq_ass_slice*/
- 0, /*sq_contains*/
- 0, /*sq_inplace_concat*/
- 0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_RandomState = {
- 0, /*mp_length*/
- 0, /*mp_subscript*/
- 0, /*mp_ass_subscript*/
-};
-
-static PyBufferProcs __pyx_tp_as_buffer_RandomState = {
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getreadbuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getwritebuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getsegcount*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getcharbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*bf_getbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*bf_releasebuffer*/
- #endif
-};
-
-static PyTypeObject __pyx_type_6mtrand_RandomState = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("mtrand.RandomState"), /*tp_name*/
- sizeof(struct __pyx_obj_6mtrand_RandomState), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_6mtrand_RandomState, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- 0, /*tp_repr*/
- &__pyx_tp_as_number_RandomState, /*tp_as_number*/
- &__pyx_tp_as_sequence_RandomState, /*tp_as_sequence*/
- &__pyx_tp_as_mapping_RandomState, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
- __Pyx_DOCSTR("\n RandomState(seed=None)\n\n Container for the Mersenne Twister pseudo-random number generator.\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 array filled with generated values is returned. If `size` is a tuple,\n then an array with that shape is filled and returned.\n\n Parameters\n ----------\n seed : int or array_like, optional\n Random seed initializing the pseudo-random number generator.\n Can be an integer, an array (or other sequence) of integers of\n any length, or ``None`` (the default).\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 Notes\n -----\n The Python stdlib module \"random\" also contains a Mersenne Twister\n pseudo-random number generator with a number of methods that are similar\n to the ones available in `RandomState`. `RandomState`, besides being\n NumPy-aware, has the advantage that it provides a much larger number\n of probability distributions to choose from.\n\n "), /*tp_doc*/
- 0, /*tp_traverse*/
- 0, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_6mtrand_RandomState, /*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*/
- __pyx_pw_6mtrand_11RandomState_1__init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_6mtrand_RandomState, /*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*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
- {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
- #if PY_VERSION_HEX < 0x03020000
- { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
- #else
- PyModuleDef_HEAD_INIT,
- #endif
- __Pyx_NAMESTR("mtrand"),
- 0, /* m_doc */
- -1, /* m_size */
- __pyx_methods /* m_methods */,
- NULL, /* m_reload */
- NULL, /* m_traverse */
- NULL, /* m_clear */
- NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_s_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
- {&__pyx_kp_s_112, __pyx_k_112, sizeof(__pyx_k_112), 0, 0, 1, 0},
- {&__pyx_kp_s_114, __pyx_k_114, sizeof(__pyx_k_114), 0, 0, 1, 0},
- {&__pyx_kp_s_118, __pyx_k_118, sizeof(__pyx_k_118), 0, 0, 1, 0},
- {&__pyx_kp_s_120, __pyx_k_120, sizeof(__pyx_k_120), 0, 0, 1, 0},
- {&__pyx_kp_s_123, __pyx_k_123, sizeof(__pyx_k_123), 0, 0, 1, 0},
- {&__pyx_kp_s_126, __pyx_k_126, sizeof(__pyx_k_126), 0, 0, 1, 0},
- {&__pyx_kp_s_128, __pyx_k_128, sizeof(__pyx_k_128), 0, 0, 1, 0},
- {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
- {&__pyx_kp_s_130, __pyx_k_130, sizeof(__pyx_k_130), 0, 0, 1, 0},
- {&__pyx_kp_s_135, __pyx_k_135, sizeof(__pyx_k_135), 0, 0, 1, 0},
- {&__pyx_kp_s_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 1, 0},
- {&__pyx_kp_s_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 1, 0},
- {&__pyx_kp_s_144, __pyx_k_144, sizeof(__pyx_k_144), 0, 0, 1, 0},
- {&__pyx_kp_s_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 0, 1, 0},
- {&__pyx_kp_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 0},
- {&__pyx_kp_s_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 0, 1, 0},
- {&__pyx_kp_s_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 0, 1, 0},
- {&__pyx_kp_s_159, __pyx_k_159, sizeof(__pyx_k_159), 0, 0, 1, 0},
- {&__pyx_kp_s_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 0, 1, 0},
- {&__pyx_kp_s_164, __pyx_k_164, sizeof(__pyx_k_164), 0, 0, 1, 0},
- {&__pyx_kp_s_168, __pyx_k_168, sizeof(__pyx_k_168), 0, 0, 1, 0},
- {&__pyx_kp_s_170, __pyx_k_170, sizeof(__pyx_k_170), 0, 0, 1, 0},
- {&__pyx_kp_s_172, __pyx_k_172, sizeof(__pyx_k_172), 0, 0, 1, 0},
- {&__pyx_kp_s_174, __pyx_k_174, sizeof(__pyx_k_174), 0, 0, 1, 0},
- {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
- {&__pyx_kp_s_180, __pyx_k_180, sizeof(__pyx_k_180), 0, 0, 1, 0},
- {&__pyx_kp_s_182, __pyx_k_182, sizeof(__pyx_k_182), 0, 0, 1, 0},
- {&__pyx_kp_s_186, __pyx_k_186, sizeof(__pyx_k_186), 0, 0, 1, 0},
- {&__pyx_kp_s_188, __pyx_k_188, sizeof(__pyx_k_188), 0, 0, 1, 0},
- {&__pyx_kp_s_190, __pyx_k_190, sizeof(__pyx_k_190), 0, 0, 1, 0},
- {&__pyx_n_s_193, __pyx_k_193, sizeof(__pyx_k_193), 0, 0, 1, 1},
- {&__pyx_kp_s_194, __pyx_k_194, sizeof(__pyx_k_194), 0, 0, 1, 0},
- {&__pyx_n_s_199, __pyx_k_199, sizeof(__pyx_k_199), 0, 0, 1, 1},
- {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
- {&__pyx_n_s_200, __pyx_k_200, sizeof(__pyx_k_200), 0, 0, 1, 1},
- {&__pyx_kp_u_201, __pyx_k_201, sizeof(__pyx_k_201), 0, 1, 0, 0},
- {&__pyx_kp_u_202, __pyx_k_202, sizeof(__pyx_k_202), 0, 1, 0, 0},
- {&__pyx_kp_u_203, __pyx_k_203, sizeof(__pyx_k_203), 0, 1, 0, 0},
- {&__pyx_kp_u_204, __pyx_k_204, sizeof(__pyx_k_204), 0, 1, 0, 0},
- {&__pyx_kp_u_205, __pyx_k_205, sizeof(__pyx_k_205), 0, 1, 0, 0},
- {&__pyx_kp_u_206, __pyx_k_206, sizeof(__pyx_k_206), 0, 1, 0, 0},
- {&__pyx_kp_u_207, __pyx_k_207, sizeof(__pyx_k_207), 0, 1, 0, 0},
- {&__pyx_kp_u_208, __pyx_k_208, sizeof(__pyx_k_208), 0, 1, 0, 0},
- {&__pyx_kp_u_209, __pyx_k_209, sizeof(__pyx_k_209), 0, 1, 0, 0},
- {&__pyx_kp_u_210, __pyx_k_210, sizeof(__pyx_k_210), 0, 1, 0, 0},
- {&__pyx_kp_u_211, __pyx_k_211, sizeof(__pyx_k_211), 0, 1, 0, 0},
- {&__pyx_kp_u_212, __pyx_k_212, sizeof(__pyx_k_212), 0, 1, 0, 0},
- {&__pyx_kp_u_213, __pyx_k_213, sizeof(__pyx_k_213), 0, 1, 0, 0},
- {&__pyx_kp_u_214, __pyx_k_214, sizeof(__pyx_k_214), 0, 1, 0, 0},
- {&__pyx_kp_u_215, __pyx_k_215, sizeof(__pyx_k_215), 0, 1, 0, 0},
- {&__pyx_kp_u_216, __pyx_k_216, sizeof(__pyx_k_216), 0, 1, 0, 0},
- {&__pyx_kp_u_217, __pyx_k_217, sizeof(__pyx_k_217), 0, 1, 0, 0},
- {&__pyx_kp_u_218, __pyx_k_218, sizeof(__pyx_k_218), 0, 1, 0, 0},
- {&__pyx_kp_u_219, __pyx_k_219, sizeof(__pyx_k_219), 0, 1, 0, 0},
- {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
- {&__pyx_kp_u_220, __pyx_k_220, sizeof(__pyx_k_220), 0, 1, 0, 0},
- {&__pyx_kp_u_221, __pyx_k_221, sizeof(__pyx_k_221), 0, 1, 0, 0},
- {&__pyx_kp_u_222, __pyx_k_222, sizeof(__pyx_k_222), 0, 1, 0, 0},
- {&__pyx_kp_u_223, __pyx_k_223, sizeof(__pyx_k_223), 0, 1, 0, 0},
- {&__pyx_kp_u_224, __pyx_k_224, sizeof(__pyx_k_224), 0, 1, 0, 0},
- {&__pyx_kp_u_225, __pyx_k_225, sizeof(__pyx_k_225), 0, 1, 0, 0},
- {&__pyx_kp_u_226, __pyx_k_226, sizeof(__pyx_k_226), 0, 1, 0, 0},
- {&__pyx_kp_u_227, __pyx_k_227, sizeof(__pyx_k_227), 0, 1, 0, 0},
- {&__pyx_kp_u_228, __pyx_k_228, sizeof(__pyx_k_228), 0, 1, 0, 0},
- {&__pyx_kp_u_229, __pyx_k_229, sizeof(__pyx_k_229), 0, 1, 0, 0},
- {&__pyx_kp_u_230, __pyx_k_230, sizeof(__pyx_k_230), 0, 1, 0, 0},
- {&__pyx_kp_u_231, __pyx_k_231, sizeof(__pyx_k_231), 0, 1, 0, 0},
- {&__pyx_kp_u_232, __pyx_k_232, sizeof(__pyx_k_232), 0, 1, 0, 0},
- {&__pyx_kp_u_233, __pyx_k_233, sizeof(__pyx_k_233), 0, 1, 0, 0},
- {&__pyx_kp_u_234, __pyx_k_234, sizeof(__pyx_k_234), 0, 1, 0, 0},
- {&__pyx_kp_u_235, __pyx_k_235, sizeof(__pyx_k_235), 0, 1, 0, 0},
- {&__pyx_kp_u_236, __pyx_k_236, sizeof(__pyx_k_236), 0, 1, 0, 0},
- {&__pyx_kp_u_237, __pyx_k_237, sizeof(__pyx_k_237), 0, 1, 0, 0},
- {&__pyx_kp_u_238, __pyx_k_238, sizeof(__pyx_k_238), 0, 1, 0, 0},
- {&__pyx_kp_u_239, __pyx_k_239, sizeof(__pyx_k_239), 0, 1, 0, 0},
- {&__pyx_kp_s_24, __pyx_k_24, sizeof(__pyx_k_24), 0, 0, 1, 0},
- {&__pyx_kp_u_240, __pyx_k_240, sizeof(__pyx_k_240), 0, 1, 0, 0},
- {&__pyx_kp_u_241, __pyx_k_241, sizeof(__pyx_k_241), 0, 1, 0, 0},
- {&__pyx_kp_u_242, __pyx_k_242, sizeof(__pyx_k_242), 0, 1, 0, 0},
- {&__pyx_kp_u_243, __pyx_k_243, sizeof(__pyx_k_243), 0, 1, 0, 0},
- {&__pyx_kp_u_244, __pyx_k_244, sizeof(__pyx_k_244), 0, 1, 0, 0},
- {&__pyx_kp_u_245, __pyx_k_245, sizeof(__pyx_k_245), 0, 1, 0, 0},
- {&__pyx_kp_u_246, __pyx_k_246, sizeof(__pyx_k_246), 0, 1, 0, 0},
- {&__pyx_kp_u_247, __pyx_k_247, sizeof(__pyx_k_247), 0, 1, 0, 0},
- {&__pyx_kp_u_248, __pyx_k_248, sizeof(__pyx_k_248), 0, 1, 0, 0},
- {&__pyx_kp_u_249, __pyx_k_249, sizeof(__pyx_k_249), 0, 1, 0, 0},
- {&__pyx_kp_u_250, __pyx_k_250, sizeof(__pyx_k_250), 0, 1, 0, 0},
- {&__pyx_kp_u_251, __pyx_k_251, sizeof(__pyx_k_251), 0, 1, 0, 0},
- {&__pyx_kp_u_252, __pyx_k_252, sizeof(__pyx_k_252), 0, 1, 0, 0},
- {&__pyx_kp_u_253, __pyx_k_253, sizeof(__pyx_k_253), 0, 1, 0, 0},
- {&__pyx_kp_u_254, __pyx_k_254, sizeof(__pyx_k_254), 0, 1, 0, 0},
- {&__pyx_kp_u_255, __pyx_k_255, sizeof(__pyx_k_255), 0, 1, 0, 0},
- {&__pyx_kp_u_256, __pyx_k_256, sizeof(__pyx_k_256), 0, 1, 0, 0},
- {&__pyx_kp_u_257, __pyx_k_257, sizeof(__pyx_k_257), 0, 1, 0, 0},
- {&__pyx_kp_u_258, __pyx_k_258, sizeof(__pyx_k_258), 0, 1, 0, 0},
- {&__pyx_kp_u_259, __pyx_k_259, sizeof(__pyx_k_259), 0, 1, 0, 0},
- {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
- {&__pyx_kp_u_260, __pyx_k_260, sizeof(__pyx_k_260), 0, 1, 0, 0},
- {&__pyx_kp_u_261, __pyx_k_261, sizeof(__pyx_k_261), 0, 1, 0, 0},
- {&__pyx_kp_u_262, __pyx_k_262, sizeof(__pyx_k_262), 0, 1, 0, 0},
- {&__pyx_kp_u_263, __pyx_k_263, sizeof(__pyx_k_263), 0, 1, 0, 0},
- {&__pyx_kp_u_264, __pyx_k_264, sizeof(__pyx_k_264), 0, 1, 0, 0},
- {&__pyx_kp_u_265, __pyx_k_265, sizeof(__pyx_k_265), 0, 1, 0, 0},
- {&__pyx_kp_u_266, __pyx_k_266, sizeof(__pyx_k_266), 0, 1, 0, 0},
- {&__pyx_kp_u_267, __pyx_k_267, sizeof(__pyx_k_267), 0, 1, 0, 0},
- {&__pyx_kp_u_268, __pyx_k_268, sizeof(__pyx_k_268), 0, 1, 0, 0},
- {&__pyx_kp_u_269, __pyx_k_269, sizeof(__pyx_k_269), 0, 1, 0, 0},
- {&__pyx_kp_u_270, __pyx_k_270, sizeof(__pyx_k_270), 0, 1, 0, 0},
- {&__pyx_kp_u_271, __pyx_k_271, sizeof(__pyx_k_271), 0, 1, 0, 0},
- {&__pyx_kp_u_272, __pyx_k_272, sizeof(__pyx_k_272), 0, 1, 0, 0},
- {&__pyx_kp_u_273, __pyx_k_273, sizeof(__pyx_k_273), 0, 1, 0, 0},
- {&__pyx_kp_u_274, __pyx_k_274, sizeof(__pyx_k_274), 0, 1, 0, 0},
- {&__pyx_kp_u_275, __pyx_k_275, sizeof(__pyx_k_275), 0, 1, 0, 0},
- {&__pyx_kp_u_276, __pyx_k_276, sizeof(__pyx_k_276), 0, 1, 0, 0},
- {&__pyx_kp_u_277, __pyx_k_277, sizeof(__pyx_k_277), 0, 1, 0, 0},
- {&__pyx_kp_u_278, __pyx_k_278, sizeof(__pyx_k_278), 0, 1, 0, 0},
- {&__pyx_kp_u_279, __pyx_k_279, sizeof(__pyx_k_279), 0, 1, 0, 0},
- {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
- {&__pyx_kp_u_280, __pyx_k_280, sizeof(__pyx_k_280), 0, 1, 0, 0},
- {&__pyx_kp_u_281, __pyx_k_281, sizeof(__pyx_k_281), 0, 1, 0, 0},
- {&__pyx_kp_u_282, __pyx_k_282, sizeof(__pyx_k_282), 0, 1, 0, 0},
- {&__pyx_kp_u_283, __pyx_k_283, sizeof(__pyx_k_283), 0, 1, 0, 0},
- {&__pyx_kp_u_284, __pyx_k_284, sizeof(__pyx_k_284), 0, 1, 0, 0},
- {&__pyx_kp_u_285, __pyx_k_285, sizeof(__pyx_k_285), 0, 1, 0, 0},
- {&__pyx_kp_u_286, __pyx_k_286, sizeof(__pyx_k_286), 0, 1, 0, 0},
- {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
- {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
- {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
- {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
- {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
- {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 0, 1, 0},
- {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
- {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
- {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0},
- {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0},
- {&__pyx_kp_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 0},
- {&__pyx_kp_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 0},
- {&__pyx_kp_s_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 1, 0},
- {&__pyx_kp_s_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 0, 1, 0},
- {&__pyx_kp_s_84, __pyx_k_84, sizeof(__pyx_k_84), 0, 0, 1, 0},
- {&__pyx_kp_s_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 1, 0},
- {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
- {&__pyx_n_s__MT19937, __pyx_k__MT19937, sizeof(__pyx_k__MT19937), 0, 0, 1, 1},
- {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
- {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
- {&__pyx_n_s____RandomState_ctor, __pyx_k____RandomState_ctor, sizeof(__pyx_k____RandomState_ctor), 0, 0, 1, 1},
- {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1},
- {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
- {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
- {&__pyx_n_s___rand, __pyx_k___rand, sizeof(__pyx_k___rand), 0, 0, 1, 1},
- {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1},
- {&__pyx_n_s__add, __pyx_k__add, sizeof(__pyx_k__add), 0, 0, 1, 1},
- {&__pyx_n_s__allclose, __pyx_k__allclose, sizeof(__pyx_k__allclose), 0, 0, 1, 1},
- {&__pyx_n_s__alpha, __pyx_k__alpha, sizeof(__pyx_k__alpha), 0, 0, 1, 1},
- {&__pyx_n_s__any, __pyx_k__any, sizeof(__pyx_k__any), 0, 0, 1, 1},
- {&__pyx_n_s__arange, __pyx_k__arange, sizeof(__pyx_k__arange), 0, 0, 1, 1},
- {&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1},
- {&__pyx_n_s__asarray, __pyx_k__asarray, sizeof(__pyx_k__asarray), 0, 0, 1, 1},
- {&__pyx_n_s__b, __pyx_k__b, sizeof(__pyx_k__b), 0, 0, 1, 1},
- {&__pyx_n_s__beta, __pyx_k__beta, sizeof(__pyx_k__beta), 0, 0, 1, 1},
- {&__pyx_n_s__binomial, __pyx_k__binomial, sizeof(__pyx_k__binomial), 0, 0, 1, 1},
- {&__pyx_n_s__bytes, __pyx_k__bytes, sizeof(__pyx_k__bytes), 0, 0, 1, 1},
- {&__pyx_n_s__chisquare, __pyx_k__chisquare, sizeof(__pyx_k__chisquare), 0, 0, 1, 1},
- {&__pyx_n_s__choice, __pyx_k__choice, sizeof(__pyx_k__choice), 0, 0, 1, 1},
- {&__pyx_n_s__copy, __pyx_k__copy, sizeof(__pyx_k__copy), 0, 0, 1, 1},
- {&__pyx_n_s__cov, __pyx_k__cov, sizeof(__pyx_k__cov), 0, 0, 1, 1},
- {&__pyx_n_s__cumsum, __pyx_k__cumsum, sizeof(__pyx_k__cumsum), 0, 0, 1, 1},
- {&__pyx_n_s__df, __pyx_k__df, sizeof(__pyx_k__df), 0, 0, 1, 1},
- {&__pyx_n_s__dfden, __pyx_k__dfden, sizeof(__pyx_k__dfden), 0, 0, 1, 1},
- {&__pyx_n_s__dfnum, __pyx_k__dfnum, sizeof(__pyx_k__dfnum), 0, 0, 1, 1},
- {&__pyx_n_s__dirichlet, __pyx_k__dirichlet, sizeof(__pyx_k__dirichlet), 0, 0, 1, 1},
- {&__pyx_n_s__dot, __pyx_k__dot, sizeof(__pyx_k__dot), 0, 0, 1, 1},
- {&__pyx_n_s__double, __pyx_k__double, sizeof(__pyx_k__double), 0, 0, 1, 1},
- {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
- {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1},
- {&__pyx_n_s__equal, __pyx_k__equal, sizeof(__pyx_k__equal), 0, 0, 1, 1},
- {&__pyx_n_s__exponential, __pyx_k__exponential, sizeof(__pyx_k__exponential), 0, 0, 1, 1},
- {&__pyx_n_s__f, __pyx_k__f, sizeof(__pyx_k__f), 0, 0, 1, 1},
- {&__pyx_n_s__float64, __pyx_k__float64, sizeof(__pyx_k__float64), 0, 0, 1, 1},
- {&__pyx_n_s__gamma, __pyx_k__gamma, sizeof(__pyx_k__gamma), 0, 0, 1, 1},
- {&__pyx_n_s__geometric, __pyx_k__geometric, sizeof(__pyx_k__geometric), 0, 0, 1, 1},
- {&__pyx_n_s__get_state, __pyx_k__get_state, sizeof(__pyx_k__get_state), 0, 0, 1, 1},
- {&__pyx_n_s__greater, __pyx_k__greater, sizeof(__pyx_k__greater), 0, 0, 1, 1},
- {&__pyx_n_s__greater_equal, __pyx_k__greater_equal, sizeof(__pyx_k__greater_equal), 0, 0, 1, 1},
- {&__pyx_n_s__gumbel, __pyx_k__gumbel, sizeof(__pyx_k__gumbel), 0, 0, 1, 1},
- {&__pyx_n_s__high, __pyx_k__high, sizeof(__pyx_k__high), 0, 0, 1, 1},
- {&__pyx_n_s__hypergeometric, __pyx_k__hypergeometric, sizeof(__pyx_k__hypergeometric), 0, 0, 1, 1},
- {&__pyx_n_s__iinfo, __pyx_k__iinfo, sizeof(__pyx_k__iinfo), 0, 0, 1, 1},
- {&__pyx_n_s__index, __pyx_k__index, sizeof(__pyx_k__index), 0, 0, 1, 1},
- {&__pyx_n_s__int, __pyx_k__int, sizeof(__pyx_k__int), 0, 0, 1, 1},
- {&__pyx_n_s__integer, __pyx_k__integer, sizeof(__pyx_k__integer), 0, 0, 1, 1},
- {&__pyx_n_s__intp, __pyx_k__intp, sizeof(__pyx_k__intp), 0, 0, 1, 1},
- {&__pyx_n_s__item, __pyx_k__item, sizeof(__pyx_k__item), 0, 0, 1, 1},
- {&__pyx_n_s__kappa, __pyx_k__kappa, sizeof(__pyx_k__kappa), 0, 0, 1, 1},
- {&__pyx_n_s__l, __pyx_k__l, sizeof(__pyx_k__l), 0, 0, 1, 1},
- {&__pyx_n_s__lam, __pyx_k__lam, sizeof(__pyx_k__lam), 0, 0, 1, 1},
- {&__pyx_n_s__laplace, __pyx_k__laplace, sizeof(__pyx_k__laplace), 0, 0, 1, 1},
- {&__pyx_n_s__left, __pyx_k__left, sizeof(__pyx_k__left), 0, 0, 1, 1},
- {&__pyx_n_s__less, __pyx_k__less, sizeof(__pyx_k__less), 0, 0, 1, 1},
- {&__pyx_n_s__less_equal, __pyx_k__less_equal, sizeof(__pyx_k__less_equal), 0, 0, 1, 1},
- {&__pyx_n_s__loc, __pyx_k__loc, sizeof(__pyx_k__loc), 0, 0, 1, 1},
- {&__pyx_n_s__logistic, __pyx_k__logistic, sizeof(__pyx_k__logistic), 0, 0, 1, 1},
- {&__pyx_n_s__lognormal, __pyx_k__lognormal, sizeof(__pyx_k__lognormal), 0, 0, 1, 1},
- {&__pyx_n_s__logseries, __pyx_k__logseries, sizeof(__pyx_k__logseries), 0, 0, 1, 1},
- {&__pyx_n_s__low, __pyx_k__low, sizeof(__pyx_k__low), 0, 0, 1, 1},
- {&__pyx_n_s__max, __pyx_k__max, sizeof(__pyx_k__max), 0, 0, 1, 1},
- {&__pyx_n_s__mean, __pyx_k__mean, sizeof(__pyx_k__mean), 0, 0, 1, 1},
- {&__pyx_n_s__mode, __pyx_k__mode, sizeof(__pyx_k__mode), 0, 0, 1, 1},
- {&__pyx_n_s__mu, __pyx_k__mu, sizeof(__pyx_k__mu), 0, 0, 1, 1},
- {&__pyx_n_s__multinomial, __pyx_k__multinomial, sizeof(__pyx_k__multinomial), 0, 0, 1, 1},
- {&__pyx_n_s__multiply, __pyx_k__multiply, sizeof(__pyx_k__multiply), 0, 0, 1, 1},
- {&__pyx_n_s__multivariate_normal, __pyx_k__multivariate_normal, sizeof(__pyx_k__multivariate_normal), 0, 0, 1, 1},
- {&__pyx_n_s__n, __pyx_k__n, sizeof(__pyx_k__n), 0, 0, 1, 1},
- {&__pyx_n_s__nbad, __pyx_k__nbad, sizeof(__pyx_k__nbad), 0, 0, 1, 1},
- {&__pyx_n_s__ndarray, __pyx_k__ndarray, sizeof(__pyx_k__ndarray), 0, 0, 1, 1},
- {&__pyx_n_s__ndim, __pyx_k__ndim, sizeof(__pyx_k__ndim), 0, 0, 1, 1},
- {&__pyx_n_s__ndmin, __pyx_k__ndmin, sizeof(__pyx_k__ndmin), 0, 0, 1, 1},
- {&__pyx_n_s__negative_binomial, __pyx_k__negative_binomial, sizeof(__pyx_k__negative_binomial), 0, 0, 1, 1},
- {&__pyx_n_s__ngood, __pyx_k__ngood, sizeof(__pyx_k__ngood), 0, 0, 1, 1},
- {&__pyx_n_s__nonc, __pyx_k__nonc, sizeof(__pyx_k__nonc), 0, 0, 1, 1},
- {&__pyx_n_s__noncentral_f, __pyx_k__noncentral_f, sizeof(__pyx_k__noncentral_f), 0, 0, 1, 1},
- {&__pyx_n_s__normal, __pyx_k__normal, sizeof(__pyx_k__normal), 0, 0, 1, 1},
- {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
- {&__pyx_n_s__nsample, __pyx_k__nsample, sizeof(__pyx_k__nsample), 0, 0, 1, 1},
- {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
- {&__pyx_n_s__operator, __pyx_k__operator, sizeof(__pyx_k__operator), 0, 0, 1, 1},
- {&__pyx_n_s__p, __pyx_k__p, sizeof(__pyx_k__p), 0, 0, 1, 1},
- {&__pyx_n_s__pareto, __pyx_k__pareto, sizeof(__pyx_k__pareto), 0, 0, 1, 1},
- {&__pyx_n_s__permutation, __pyx_k__permutation, sizeof(__pyx_k__permutation), 0, 0, 1, 1},
- {&__pyx_n_s__poisson, __pyx_k__poisson, sizeof(__pyx_k__poisson), 0, 0, 1, 1},
- {&__pyx_n_s__poisson_lam_max, __pyx_k__poisson_lam_max, sizeof(__pyx_k__poisson_lam_max), 0, 0, 1, 1},
- {&__pyx_n_s__power, __pyx_k__power, sizeof(__pyx_k__power), 0, 0, 1, 1},
- {&__pyx_n_s__prod, __pyx_k__prod, sizeof(__pyx_k__prod), 0, 0, 1, 1},
- {&__pyx_n_s__pvals, __pyx_k__pvals, sizeof(__pyx_k__pvals), 0, 0, 1, 1},
- {&__pyx_n_s__rand, __pyx_k__rand, sizeof(__pyx_k__rand), 0, 0, 1, 1},
- {&__pyx_n_s__randint, __pyx_k__randint, sizeof(__pyx_k__randint), 0, 0, 1, 1},
- {&__pyx_n_s__randn, __pyx_k__randn, sizeof(__pyx_k__randn), 0, 0, 1, 1},
- {&__pyx_n_s__random, __pyx_k__random, sizeof(__pyx_k__random), 0, 0, 1, 1},
- {&__pyx_n_s__random_integers, __pyx_k__random_integers, sizeof(__pyx_k__random_integers), 0, 0, 1, 1},
- {&__pyx_n_s__random_sample, __pyx_k__random_sample, sizeof(__pyx_k__random_sample), 0, 0, 1, 1},
- {&__pyx_n_s__ravel, __pyx_k__ravel, sizeof(__pyx_k__ravel), 0, 0, 1, 1},
- {&__pyx_n_s__rayleigh, __pyx_k__rayleigh, sizeof(__pyx_k__rayleigh), 0, 0, 1, 1},
- {&__pyx_n_s__reduce, __pyx_k__reduce, sizeof(__pyx_k__reduce), 0, 0, 1, 1},
- {&__pyx_n_s__replace, __pyx_k__replace, sizeof(__pyx_k__replace), 0, 0, 1, 1},
- {&__pyx_n_s__return_index, __pyx_k__return_index, sizeof(__pyx_k__return_index), 0, 0, 1, 1},
- {&__pyx_n_s__right, __pyx_k__right, sizeof(__pyx_k__right), 0, 0, 1, 1},
- {&__pyx_n_s__scale, __pyx_k__scale, sizeof(__pyx_k__scale), 0, 0, 1, 1},
- {&__pyx_n_s__searchsorted, __pyx_k__searchsorted, sizeof(__pyx_k__searchsorted), 0, 0, 1, 1},
- {&__pyx_n_s__seed, __pyx_k__seed, sizeof(__pyx_k__seed), 0, 0, 1, 1},
- {&__pyx_n_s__set_state, __pyx_k__set_state, sizeof(__pyx_k__set_state), 0, 0, 1, 1},
- {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1},
- {&__pyx_n_s__shuffle, __pyx_k__shuffle, sizeof(__pyx_k__shuffle), 0, 0, 1, 1},
- {&__pyx_n_s__side, __pyx_k__side, sizeof(__pyx_k__side), 0, 0, 1, 1},
- {&__pyx_n_s__sigma, __pyx_k__sigma, sizeof(__pyx_k__sigma), 0, 0, 1, 1},
- {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
- {&__pyx_n_s__sort, __pyx_k__sort, sizeof(__pyx_k__sort), 0, 0, 1, 1},
- {&__pyx_n_s__sqrt, __pyx_k__sqrt, sizeof(__pyx_k__sqrt), 0, 0, 1, 1},
- {&__pyx_n_s__standard_cauchy, __pyx_k__standard_cauchy, sizeof(__pyx_k__standard_cauchy), 0, 0, 1, 1},
- {&__pyx_n_s__standard_gamma, __pyx_k__standard_gamma, sizeof(__pyx_k__standard_gamma), 0, 0, 1, 1},
- {&__pyx_n_s__standard_normal, __pyx_k__standard_normal, sizeof(__pyx_k__standard_normal), 0, 0, 1, 1},
- {&__pyx_n_s__standard_t, __pyx_k__standard_t, sizeof(__pyx_k__standard_t), 0, 0, 1, 1},
- {&__pyx_n_s__subtract, __pyx_k__subtract, sizeof(__pyx_k__subtract), 0, 0, 1, 1},
- {&__pyx_n_s__sum, __pyx_k__sum, sizeof(__pyx_k__sum), 0, 0, 1, 1},
- {&__pyx_n_s__svd, __pyx_k__svd, sizeof(__pyx_k__svd), 0, 0, 1, 1},
- {&__pyx_n_s__take, __pyx_k__take, sizeof(__pyx_k__take), 0, 0, 1, 1},
- {&__pyx_n_s__triangular, __pyx_k__triangular, sizeof(__pyx_k__triangular), 0, 0, 1, 1},
- {&__pyx_n_s__uint, __pyx_k__uint, sizeof(__pyx_k__uint), 0, 0, 1, 1},
- {&__pyx_n_s__uint32, __pyx_k__uint32, sizeof(__pyx_k__uint32), 0, 0, 1, 1},
- {&__pyx_n_s__uniform, __pyx_k__uniform, sizeof(__pyx_k__uniform), 0, 0, 1, 1},
- {&__pyx_n_s__unique, __pyx_k__unique, sizeof(__pyx_k__unique), 0, 0, 1, 1},
- {&__pyx_n_s__vonmises, __pyx_k__vonmises, sizeof(__pyx_k__vonmises), 0, 0, 1, 1},
- {&__pyx_n_s__wald, __pyx_k__wald, sizeof(__pyx_k__wald), 0, 0, 1, 1},
- {&__pyx_n_s__weibull, __pyx_k__weibull, sizeof(__pyx_k__weibull), 0, 0, 1, 1},
- {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
- {&__pyx_n_s__zipf, __pyx_k__zipf, sizeof(__pyx_k__zipf), 0, 0, 1, 1},
- {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-static int __Pyx_InitCachedConstants(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
-
- /* "mtrand.pyx":186
- * <void *>oa)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_k_tuple_2 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_2);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
-
- /* "mtrand.pyx":235
- * multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_k_tuple_3 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_3);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
-
- /* "mtrand.pyx":290
- * <void *>ob, <void *>oc)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_4);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
-
- /* "mtrand.pyx":354
- * 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 = <long *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_k_tuple_5 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_5);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));
-
- /* "mtrand.pyx":403
- * 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)
- */
- __pyx_k_tuple_6 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_6);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
-
- /* "mtrand.pyx":457
- * <void *>oN)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_k_tuple_7 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_7);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));
-
- /* "mtrand.pyx":506
- * multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa)
- * if (multi.size != PyArray_SIZE(array)):
- * raise ValueError("size is not compatible with inputs") # <<<<<<<<<<<<<<
- * for i from 0 <= i < multi.size:
- * oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- */
- __pyx_k_tuple_8 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_1)); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_8);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));
-
- /* "mtrand.pyx":692
- * algorithm_name = state[0]
- * if algorithm_name != 'MT19937':
- * raise ValueError("algorithm must be 'MT19937'") # <<<<<<<<<<<<<<
- * key, pos = state[1:3]
- * if len(state) == 3:
- */
- __pyx_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_9)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_10);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
-
- /* "mtrand.pyx":693
- * if algorithm_name != 'MT19937':
- * raise ValueError("algorithm must be 'MT19937'")
- * key, pos = state[1:3] # <<<<<<<<<<<<<<
- * if len(state) == 3:
- * has_gauss = 0
- */
- __pyx_k_slice_11 = PySlice_New(__pyx_int_1, __pyx_int_3, Py_None); if (unlikely(!__pyx_k_slice_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_slice_11);
- __Pyx_GIVEREF(__pyx_k_slice_11);
-
- /* "mtrand.pyx":698
- * cached_gaussian = 0.0
- * else:
- * has_gauss, cached_gaussian = state[3:5] # <<<<<<<<<<<<<<
- * try:
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1)
- */
- __pyx_k_slice_12 = PySlice_New(__pyx_int_3, __pyx_int_5, Py_None); if (unlikely(!__pyx_k_slice_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_slice_12);
- __Pyx_GIVEREF(__pyx_k_slice_12);
-
- /* "mtrand.pyx":705
- * obj = <ndarray>PyArray_ContiguousFromObject(key, NPY_LONG, 1, 1)
- * if PyArray_DIM(obj, 0) != 624:
- * raise ValueError("state must be 624 longs") # <<<<<<<<<<<<<<
- * memcpy(<void*>(self.internal_state.key), <void*>PyArray_DATA(obj), 624*sizeof(long))
- * self.internal_state.pos = pos
- */
- __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_13)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_14);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));
-
- /* "mtrand.pyx":877
- *
- * if lo >= hi :
- * raise ValueError("low >= high") # <<<<<<<<<<<<<<
- *
- * diff = <unsigned long>hi - <unsigned long>lo - 1UL
- */
- __pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_15)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_16);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
-
- /* "mtrand.pyx":1004
- * pop_size = operator.index(a.item())
- * except TypeError:
- * raise ValueError("a must be 1-dimensional or an integer") # <<<<<<<<<<<<<<
- * if pop_size <= 0:
- * raise ValueError("a must be greater than 0")
- */
- __pyx_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_19);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));
-
- /* "mtrand.pyx":1006
- * raise ValueError("a must be 1-dimensional or an integer")
- * if pop_size <= 0:
- * raise ValueError("a must be greater than 0") # <<<<<<<<<<<<<<
- * elif a.ndim != 1:
- * raise ValueError("a must be 1-dimensional")
- */
- __pyx_k_tuple_21 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_21);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));
-
- /* "mtrand.pyx":1008
- * raise ValueError("a must be greater than 0")
- * elif a.ndim != 1:
- * raise ValueError("a must be 1-dimensional") # <<<<<<<<<<<<<<
- * else:
- * pop_size = a.shape[0]
- */
- __pyx_k_tuple_23 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_22)); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_23);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
-
- /* "mtrand.pyx":1012
- * pop_size = a.shape[0]
- * if pop_size is 0:
- * raise ValueError("a must be non-empty") # <<<<<<<<<<<<<<
- *
- * if None != p:
- */
- __pyx_k_tuple_25 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_24)); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_25);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
-
- /* "mtrand.pyx":1017
- * p = np.array(p, dtype=np.double, ndmin=1, copy=False)
- * if p.ndim != 1:
- * raise ValueError("p must be 1-dimensional") # <<<<<<<<<<<<<<
- * if p.size != pop_size:
- * raise ValueError("a and p must have same size")
- */
- __pyx_k_tuple_27 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_26)); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_27);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));
-
- /* "mtrand.pyx":1019
- * raise ValueError("p must be 1-dimensional")
- * if p.size != pop_size:
- * raise ValueError("a and p must have same size") # <<<<<<<<<<<<<<
- * if np.any(p < 0):
- * raise ValueError("probabilities are not non-negative")
- */
- __pyx_k_tuple_29 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_28)); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_29);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29));
-
- /* "mtrand.pyx":1021
- * raise ValueError("a and p must have same size")
- * if np.any(p < 0):
- * raise ValueError("probabilities are not non-negative") # <<<<<<<<<<<<<<
- * if not np.allclose(p.sum(), 1):
- * raise ValueError("probabilities do not sum to 1")
- */
- __pyx_k_tuple_31 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_30)); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_31);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31));
-
- /* "mtrand.pyx":1023
- * raise ValueError("probabilities are not non-negative")
- * if not np.allclose(p.sum(), 1):
- * raise ValueError("probabilities do not sum to 1") # <<<<<<<<<<<<<<
- *
- * shape = size
- */
- __pyx_k_tuple_33 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_32)); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_33);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33));
-
- /* "mtrand.pyx":1043
- * else:
- * if size > pop_size:
- * raise ValueError("Cannot take a larger sample than " # <<<<<<<<<<<<<<
- * "population when 'replace=False'")
- *
- */
- __pyx_k_tuple_35 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_34)); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_35);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));
-
- /* "mtrand.pyx":1048
- * if None != p:
- * if np.sum(p > 0) < size:
- * raise ValueError("Fewer non-zero entries in p than size") # <<<<<<<<<<<<<<
- * n_uniq = 0
- * p = p.copy()
- */
- __pyx_k_tuple_37 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_36)); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_37);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));
-
- /* "mtrand.pyx":1073
- * if shape is None and isinstance(idx, np.ndarray):
- * # In most cases a scalar will have been made an array
- * idx = idx.item(0) # <<<<<<<<<<<<<<
- *
- * #Use samples as indices for a if a is array-like
- */
- __pyx_k_tuple_38 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_38);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));
-
- /* "mtrand.pyx":1085
- * # array, taking into account that np.array(item) may not work
- * # for object arrays.
- * res = np.empty((), dtype=a.dtype) # <<<<<<<<<<<<<<
- * res[()] = a[idx]
- * return res
- */
- __pyx_k_tuple_39 = PyTuple_Pack(1, ((PyObject *)__pyx_empty_tuple)); if (unlikely(!__pyx_k_tuple_39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_39);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_39));
-
- /* "mtrand.pyx":1479
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale)
- *
- */
- __pyx_k_tuple_45 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_45);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45));
-
- /* "mtrand.pyx":1487
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_normal, size, oloc, oscale)
- *
- */
- __pyx_k_tuple_46 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_46);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));
-
- /* "mtrand.pyx":1534
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * if fb <= 0:
- * raise ValueError("b <= 0")
- */
- __pyx_k_tuple_48 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_47)); if (unlikely(!__pyx_k_tuple_48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_48);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_48));
-
- /* "mtrand.pyx":1536
- * raise ValueError("a <= 0")
- * if fb <= 0:
- * raise ValueError("b <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb)
- *
- */
- __pyx_k_tuple_50 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_49)); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_50);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));
-
- /* "mtrand.pyx":1544
- * ob = <ndarray>PyArray_FROM_OTF(b, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(ob, 0)):
- * raise ValueError("b <= 0")
- */
- __pyx_k_tuple_51 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_47)); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_51);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));
-
- /* "mtrand.pyx":1546
- * raise ValueError("a <= 0")
- * if np.any(np.less_equal(ob, 0)):
- * raise ValueError("b <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_beta, size, oa, ob)
- *
- */
- __pyx_k_tuple_52 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_49)); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_52);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52));
-
- /* "mtrand.pyx":1593
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_exponential, size, fscale)
- *
- */
- __pyx_k_tuple_54 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_54);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));
-
- /* "mtrand.pyx":1600
- * oscale = <ndarray> PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_exponential, size, oscale)
- *
- */
- __pyx_k_tuple_55 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_55);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55));
-
- /* "mtrand.pyx":1704
- * if not PyErr_Occurred():
- * if fshape <= 0:
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape)
- *
- */
- __pyx_k_tuple_57 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_57);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));
-
- /* "mtrand.pyx":1710
- * oshape = <ndarray> PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape)
- *
- */
- __pyx_k_tuple_58 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_58);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));
-
- /* "mtrand.pyx":1790
- * if not PyErr_Occurred():
- * if fshape <= 0:
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_k_tuple_60 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_60);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60));
-
- /* "mtrand.pyx":1792
- * raise ValueError("shape <= 0")
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale)
- *
- */
- __pyx_k_tuple_61 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_61);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));
-
- /* "mtrand.pyx":1799
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oshape, 0.0)):
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0")
- */
- __pyx_k_tuple_62 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_62);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));
-
- /* "mtrand.pyx":1801
- * raise ValueError("shape <= 0")
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale)
- *
- */
- __pyx_k_tuple_63 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1801; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_63);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63));
-
- /* "mtrand.pyx":1891
- * if not PyErr_Occurred():
- * if fdfnum <= 0:
- * raise ValueError("shape <= 0") # <<<<<<<<<<<<<<
- * if fdfden <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_k_tuple_64 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_64);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_64));
-
- /* "mtrand.pyx":1893
- * raise ValueError("shape <= 0")
- * if fdfden <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden)
- *
- */
- __pyx_k_tuple_65 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_65);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));
-
- /* "mtrand.pyx":1901
- * odfden = <ndarray>PyArray_FROM_OTF(dfden, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odfnum, 0.0)):
- * raise ValueError("dfnum <= 0") # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0")
- */
- __pyx_k_tuple_67 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_66)); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_67);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));
-
- /* "mtrand.pyx":1903
- * raise ValueError("dfnum <= 0")
- * if np.any(np.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_f, size, odfnum, odfden)
- *
- */
- __pyx_k_tuple_69 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_69);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_69));
-
- /* "mtrand.pyx":1978
- * if not PyErr_Occurred():
- * if fdfnum <= 1:
- * raise ValueError("dfnum <= 1") # <<<<<<<<<<<<<<
- * if fdfden <= 0:
- * raise ValueError("dfden <= 0")
- */
- __pyx_k_tuple_71 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_71);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_71));
-
- /* "mtrand.pyx":1980
- * raise ValueError("dfnum <= 1")
- * if fdfden <= 0:
- * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<<
- * if fnonc < 0:
- * raise ValueError("nonc < 0")
- */
- __pyx_k_tuple_72 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_72);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_72));
-
- /* "mtrand.pyx":1982
- * raise ValueError("dfden <= 0")
- * if fnonc < 0:
- * raise ValueError("nonc < 0") # <<<<<<<<<<<<<<
- * return cont3_array_sc(self.internal_state, rk_noncentral_f, size,
- * fdfnum, fdfden, fnonc)
- */
- __pyx_k_tuple_74 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_73)); if (unlikely(!__pyx_k_tuple_74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_74);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_74));
-
- /* "mtrand.pyx":1993
- *
- * if np.any(np.less_equal(odfnum, 1.0)):
- * raise ValueError("dfnum <= 1") # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0")
- */
- __pyx_k_tuple_75 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1993; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_75);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75));
-
- /* "mtrand.pyx":1995
- * raise ValueError("dfnum <= 1")
- * if np.any(np.less_equal(odfden, 0.0)):
- * raise ValueError("dfden <= 0") # <<<<<<<<<<<<<<
- * if np.any(np.less(ononc, 0.0)):
- * raise ValueError("nonc < 0")
- */
- __pyx_k_tuple_76 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_76);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));
-
- /* "mtrand.pyx":1997
- * raise ValueError("dfden <= 0")
- * if np.any(np.less(ononc, 0.0)):
- * raise ValueError("nonc < 0") # <<<<<<<<<<<<<<
- * return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,
- * odfden, ononc)
- */
- __pyx_k_tuple_77 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_73)); if (unlikely(!__pyx_k_tuple_77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_77);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_77));
-
- /* "mtrand.pyx":2069
- * if not PyErr_Occurred():
- * if fdf <= 0:
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf)
- *
- */
- __pyx_k_tuple_79 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_78)); if (unlikely(!__pyx_k_tuple_79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_79);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_79));
-
- /* "mtrand.pyx":2076
- * odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_chisquare, size, odf)
- *
- */
- __pyx_k_tuple_80 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_78)); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_80);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80));
-
- /* "mtrand.pyx":2154
- * if not PyErr_Occurred():
- * if fdf <= 1:
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * if fnonc <= 0:
- * raise ValueError("nonc <= 0")
- */
- __pyx_k_tuple_81 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_78)); if (unlikely(!__pyx_k_tuple_81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_81);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_81));
-
- /* "mtrand.pyx":2156
- * raise ValueError("df <= 0")
- * if fnonc <= 0:
- * raise ValueError("nonc <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,
- * size, fdf, fnonc)
- */
- __pyx_k_tuple_83 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_82)); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_83);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_83));
-
- /* "mtrand.pyx":2165
- * ononc = <ndarray>PyArray_FROM_OTF(nonc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 1") # <<<<<<<<<<<<<<
- * if np.any(np.less_equal(ononc, 0.0)):
- * raise ValueError("nonc < 0")
- */
- __pyx_k_tuple_85 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_84)); if (unlikely(!__pyx_k_tuple_85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_85);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_85));
-
- /* "mtrand.pyx":2167
- * raise ValueError("df <= 1")
- * if np.any(np.less_equal(ononc, 0.0)):
- * raise ValueError("nonc < 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_noncentral_chisquare, size,
- * odf, ononc)
- */
- __pyx_k_tuple_86 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_73)); if (unlikely(!__pyx_k_tuple_86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_86);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_86));
-
- /* "mtrand.pyx":2323
- * if not PyErr_Occurred():
- * if fdf <= 0:
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf)
- *
- */
- __pyx_k_tuple_87 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_78)); if (unlikely(!__pyx_k_tuple_87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_87);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_87));
-
- /* "mtrand.pyx":2330
- * odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(odf, 0.0)):
- * raise ValueError("df <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_standard_t, size, odf)
- *
- */
- __pyx_k_tuple_88 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_78)); if (unlikely(!__pyx_k_tuple_88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_88);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_88));
-
- /* "mtrand.pyx":2416
- * if not PyErr_Occurred():
- * if fkappa < 0:
- * raise ValueError("kappa < 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa)
- *
- */
- __pyx_k_tuple_90 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_89)); if (unlikely(!__pyx_k_tuple_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_90);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_90));
-
- /* "mtrand.pyx":2424
- * okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(okappa, 0.0)):
- * raise ValueError("kappa < 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa)
- *
- */
- __pyx_k_tuple_91 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_89)); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_91);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_91));
-
- /* "mtrand.pyx":2513
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_pareto, size, fa)
- *
- */
- __pyx_k_tuple_92 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_47)); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_92);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_92));
-
- /* "mtrand.pyx":2520
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_pareto, size, oa)
- *
- */
- __pyx_k_tuple_93 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_47)); if (unlikely(!__pyx_k_tuple_93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_93);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_93));
-
- /* "mtrand.pyx":2613
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_weibull, size, fa)
- *
- */
- __pyx_k_tuple_94 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_47)); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2613; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_94);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_94));
-
- /* "mtrand.pyx":2620
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_weibull, size, oa)
- *
- */
- __pyx_k_tuple_95 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_47)); if (unlikely(!__pyx_k_tuple_95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2620; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_95);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_95));
-
- /* "mtrand.pyx":2722
- * if not PyErr_Occurred():
- * if fa <= 0:
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_power, size, fa)
- *
- */
- __pyx_k_tuple_96 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_47)); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_96);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_96));
-
- /* "mtrand.pyx":2729
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 0.0)):
- * raise ValueError("a <= 0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_power, size, oa)
- *
- */
- __pyx_k_tuple_97 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_47)); if (unlikely(!__pyx_k_tuple_97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2729; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_97);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_97));
-
- /* "mtrand.pyx":2812
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale)
- *
- */
- __pyx_k_tuple_100 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_100);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_100));
-
- /* "mtrand.pyx":2819
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale)
- *
- */
- __pyx_k_tuple_101 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_101);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_101));
-
- /* "mtrand.pyx":2943
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale)
- *
- */
- __pyx_k_tuple_104 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_104);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_104));
-
- /* "mtrand.pyx":2950
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale)
- *
- */
- __pyx_k_tuple_105 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2950; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_105);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_105));
-
- /* "mtrand.pyx":3031
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale)
- *
- */
- __pyx_k_tuple_108 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_108);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_108));
-
- /* "mtrand.pyx":3038
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale)
- *
- */
- __pyx_k_tuple_109 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3038; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_109);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_109));
-
- /* "mtrand.pyx":3151
- * if not PyErr_Occurred():
- * if fsigma <= 0:
- * raise ValueError("sigma <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma)
- *
- */
- __pyx_k_tuple_113 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_112)); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_113);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_113));
-
- /* "mtrand.pyx":3159
- * osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(osigma, 0.0)):
- * raise ValueError("sigma <= 0.0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma)
- *
- */
- __pyx_k_tuple_115 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_114)); if (unlikely(!__pyx_k_tuple_115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_115);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_115));
-
- /* "mtrand.pyx":3224
- * if not PyErr_Occurred():
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale)
- *
- */
- __pyx_k_tuple_117 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_117);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_117));
-
- /* "mtrand.pyx":3231
- * oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oscale, 0.0)):
- * raise ValueError("scale <= 0.0") # <<<<<<<<<<<<<<
- * return cont1_array(self.internal_state, rk_rayleigh, size, oscale)
- *
- */
- __pyx_k_tuple_119 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_118)); if (unlikely(!__pyx_k_tuple_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_119);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_119));
-
- /* "mtrand.pyx":3304
- * if not PyErr_Occurred():
- * if fmean <= 0:
- * raise ValueError("mean <= 0") # <<<<<<<<<<<<<<
- * if fscale <= 0:
- * raise ValueError("scale <= 0")
- */
- __pyx_k_tuple_121 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_120)); if (unlikely(!__pyx_k_tuple_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_121);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_121));
-
- /* "mtrand.pyx":3306
- * raise ValueError("mean <= 0")
- * if fscale <= 0:
- * raise ValueError("scale <= 0") # <<<<<<<<<<<<<<
- * return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale)
- *
- */
- __pyx_k_tuple_122 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_122);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_122));
-
- /* "mtrand.pyx":3313
- * oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(omean,0.0)):
- * raise ValueError("mean <= 0.0") # <<<<<<<<<<<<<<
- * elif np.any(np.less_equal(oscale,0.0)):
- * raise ValueError("scale <= 0.0")
- */
- __pyx_k_tuple_124 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_123)); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_124);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_124));
-
- /* "mtrand.pyx":3315
- * raise ValueError("mean <= 0.0")
- * elif np.any(np.less_equal(oscale,0.0)):
- * raise ValueError("scale <= 0.0") # <<<<<<<<<<<<<<
- * return cont2_array(self.internal_state, rk_wald, size, omean, oscale)
- *
- */
- __pyx_k_tuple_125 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_118)); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_125);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_125));
-
- /* "mtrand.pyx":3385
- * if not PyErr_Occurred():
- * if fleft > fmode:
- * raise ValueError("left > mode") # <<<<<<<<<<<<<<
- * if fmode > fright:
- * raise ValueError("mode > right")
- */
- __pyx_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_126)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_127);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_127));
-
- /* "mtrand.pyx":3387
- * raise ValueError("left > mode")
- * if fmode > fright:
- * raise ValueError("mode > right") # <<<<<<<<<<<<<<
- * if fleft == fright:
- * raise ValueError("left == right")
- */
- __pyx_k_tuple_129 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_128)); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_129);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_129));
-
- /* "mtrand.pyx":3389
- * raise ValueError("mode > right")
- * if fleft == fright:
- * raise ValueError("left == right") # <<<<<<<<<<<<<<
- * return cont3_array_sc(self.internal_state, rk_triangular, size, fleft,
- * fmode, fright)
- */
- __pyx_k_tuple_131 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_130)); if (unlikely(!__pyx_k_tuple_131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_131);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_131));
-
- /* "mtrand.pyx":3399
- *
- * if np.any(np.greater(oleft, omode)):
- * raise ValueError("left > mode") # <<<<<<<<<<<<<<
- * if np.any(np.greater(omode, oright)):
- * raise ValueError("mode > right")
- */
- __pyx_k_tuple_132 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_126)); if (unlikely(!__pyx_k_tuple_132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_132);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_132));
-
- /* "mtrand.pyx":3401
- * raise ValueError("left > mode")
- * if np.any(np.greater(omode, oright)):
- * raise ValueError("mode > right") # <<<<<<<<<<<<<<
- * if np.any(np.equal(oleft, oright)):
- * raise ValueError("left == right")
- */
- __pyx_k_tuple_133 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_128)); if (unlikely(!__pyx_k_tuple_133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_133);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_133));
-
- /* "mtrand.pyx":3403
- * raise ValueError("mode > right")
- * if np.any(np.equal(oleft, oright)):
- * raise ValueError("left == right") # <<<<<<<<<<<<<<
- * return cont3_array(self.internal_state, rk_triangular, size, oleft,
- * omode, oright)
- */
- __pyx_k_tuple_134 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_130)); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_134);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_134));
-
- /* "mtrand.pyx":3497
- * if not PyErr_Occurred():
- * if ln < 0:
- * raise ValueError("n < 0") # <<<<<<<<<<<<<<
- * if fp < 0:
- * raise ValueError("p < 0")
- */
- __pyx_k_tuple_136 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_135)); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_136);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_136));
-
- /* "mtrand.pyx":3499
- * raise ValueError("n < 0")
- * if fp < 0:
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * elif fp > 1:
- * raise ValueError("p > 1")
- */
- __pyx_k_tuple_138 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_137)); if (unlikely(!__pyx_k_tuple_138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_138);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_138));
-
- /* "mtrand.pyx":3501
- * raise ValueError("p < 0")
- * elif fp > 1:
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp)
- *
- */
- __pyx_k_tuple_140 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_139)); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_140);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_140));
-
- /* "mtrand.pyx":3509
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(n, 0)):
- * raise ValueError("n < 0") # <<<<<<<<<<<<<<
- * if np.any(np.less(p, 0)):
- * raise ValueError("p < 0")
- */
- __pyx_k_tuple_141 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_135)); if (unlikely(!__pyx_k_tuple_141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_141);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_141));
-
- /* "mtrand.pyx":3511
- * raise ValueError("n < 0")
- * if np.any(np.less(p, 0)):
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * if np.any(np.greater(p, 1)):
- * raise ValueError("p > 1")
- */
- __pyx_k_tuple_142 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_137)); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_142);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142));
-
- /* "mtrand.pyx":3513
- * raise ValueError("p < 0")
- * if np.any(np.greater(p, 1)):
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * return discnp_array(self.internal_state, rk_binomial, size, on, op)
- *
- */
- __pyx_k_tuple_143 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_139)); if (unlikely(!__pyx_k_tuple_143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_143);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_143));
-
- /* "mtrand.pyx":3590
- * if not PyErr_Occurred():
- * if fn <= 0:
- * raise ValueError("n <= 0") # <<<<<<<<<<<<<<
- * if fp < 0:
- * raise ValueError("p < 0")
- */
- __pyx_k_tuple_145 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_144)); if (unlikely(!__pyx_k_tuple_145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_145);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_145));
-
- /* "mtrand.pyx":3592
- * raise ValueError("n <= 0")
- * if fp < 0:
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * elif fp > 1:
- * raise ValueError("p > 1")
- */
- __pyx_k_tuple_146 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_137)); if (unlikely(!__pyx_k_tuple_146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_146);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_146));
-
- /* "mtrand.pyx":3594
- * raise ValueError("p < 0")
- * elif fp > 1:
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * return discdd_array_sc(self.internal_state, rk_negative_binomial,
- * size, fn, fp)
- */
- __pyx_k_tuple_147 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_139)); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_147);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_147));
-
- /* "mtrand.pyx":3603
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(n, 0)):
- * raise ValueError("n <= 0") # <<<<<<<<<<<<<<
- * if np.any(np.less(p, 0)):
- * raise ValueError("p < 0")
- */
- __pyx_k_tuple_148 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_144)); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_148);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_148));
-
- /* "mtrand.pyx":3605
- * raise ValueError("n <= 0")
- * if np.any(np.less(p, 0)):
- * raise ValueError("p < 0") # <<<<<<<<<<<<<<
- * if np.any(np.greater(p, 1)):
- * raise ValueError("p > 1")
- */
- __pyx_k_tuple_149 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_137)); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_149);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_149));
-
- /* "mtrand.pyx":3607
- * raise ValueError("p < 0")
- * if np.any(np.greater(p, 1)):
- * raise ValueError("p > 1") # <<<<<<<<<<<<<<
- * return discdd_array(self.internal_state, rk_negative_binomial, size,
- * on, op)
- */
- __pyx_k_tuple_150 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_139)); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_150);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150));
-
- /* "mtrand.pyx":3668
- * if not PyErr_Occurred():
- * if lam < 0:
- * raise ValueError("lam < 0") # <<<<<<<<<<<<<<
- * if lam > self.poisson_lam_max:
- * raise ValueError("lam value too large")
- */
- __pyx_k_tuple_153 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_152)); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_153);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_153));
-
- /* "mtrand.pyx":3670
- * raise ValueError("lam < 0")
- * if lam > self.poisson_lam_max:
- * raise ValueError("lam value too large") # <<<<<<<<<<<<<<
- * return discd_array_sc(self.internal_state, rk_poisson, size, flam)
- *
- */
- __pyx_k_tuple_155 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_154)); if (unlikely(!__pyx_k_tuple_155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3670; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_155);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_155));
-
- /* "mtrand.pyx":3677
- * olam = <ndarray>PyArray_FROM_OTF(lam, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(olam, 0)):
- * raise ValueError("lam < 0") # <<<<<<<<<<<<<<
- * if np.any(np.greater(olam, self.poisson_lam_max)):
- * raise ValueError("lam value too large.")
- */
- __pyx_k_tuple_156 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_152)); if (unlikely(!__pyx_k_tuple_156)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3677; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_156);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_156));
-
- /* "mtrand.pyx":3679
- * raise ValueError("lam < 0")
- * if np.any(np.greater(olam, self.poisson_lam_max)):
- * raise ValueError("lam value too large.") # <<<<<<<<<<<<<<
- * return discd_array(self.internal_state, rk_poisson, size, olam)
- *
- */
- __pyx_k_tuple_158 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_157)); if (unlikely(!__pyx_k_tuple_158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3679; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_158);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_158));
-
- /* "mtrand.pyx":3760
- * if not PyErr_Occurred():
- * if fa <= 1.0:
- * raise ValueError("a <= 1.0") # <<<<<<<<<<<<<<
- * return discd_array_sc(self.internal_state, rk_zipf, size, fa)
- *
- */
- __pyx_k_tuple_160 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_159)); if (unlikely(!__pyx_k_tuple_160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_160);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_160));
-
- /* "mtrand.pyx":3767
- * oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * if np.any(np.less_equal(oa, 1.0)):
- * raise ValueError("a <= 1.0") # <<<<<<<<<<<<<<
- * return discd_array(self.internal_state, rk_zipf, size, oa)
- *
- */
- __pyx_k_tuple_161 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_159)); if (unlikely(!__pyx_k_tuple_161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_161);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_161));
-
- /* "mtrand.pyx":3821
- * if not PyErr_Occurred():
- * if fp < 0.0:
- * raise ValueError("p < 0.0") # <<<<<<<<<<<<<<
- * if fp > 1.0:
- * raise ValueError("p > 1.0")
- */
- __pyx_k_tuple_163 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_162)); if (unlikely(!__pyx_k_tuple_163)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_163);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_163));
-
- /* "mtrand.pyx":3823
- * raise ValueError("p < 0.0")
- * if fp > 1.0:
- * raise ValueError("p > 1.0") # <<<<<<<<<<<<<<
- * return discd_array_sc(self.internal_state, rk_geometric, size, fp)
- *
- */
- __pyx_k_tuple_165 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_164)); if (unlikely(!__pyx_k_tuple_165)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_165);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_165));
-
- /* "mtrand.pyx":3831
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_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")
- */
- __pyx_k_tuple_166 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_162)); if (unlikely(!__pyx_k_tuple_166)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_166);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_166));
-
- /* "mtrand.pyx":3833
- * raise ValueError("p < 0.0")
- * if np.any(np.greater(op, 1.0)):
- * raise ValueError("p > 1.0") # <<<<<<<<<<<<<<
- * return discd_array(self.internal_state, rk_geometric, size, op)
- *
- */
- __pyx_k_tuple_167 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_164)); if (unlikely(!__pyx_k_tuple_167)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_167);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_167));
-
- /* "mtrand.pyx":3929
- * if not PyErr_Occurred():
- * if lngood < 0:
- * raise ValueError("ngood < 0") # <<<<<<<<<<<<<<
- * if lnbad < 0:
- * raise ValueError("nbad < 0")
- */
- __pyx_k_tuple_169 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_168)); if (unlikely(!__pyx_k_tuple_169)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_169);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_169));
-
- /* "mtrand.pyx":3931
- * raise ValueError("ngood < 0")
- * if lnbad < 0:
- * raise ValueError("nbad < 0") # <<<<<<<<<<<<<<
- * if lnsample < 1:
- * raise ValueError("nsample < 1")
- */
- __pyx_k_tuple_171 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_170)); if (unlikely(!__pyx_k_tuple_171)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_171);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_171));
-
- /* "mtrand.pyx":3933
- * raise ValueError("nbad < 0")
- * if lnsample < 1:
- * raise ValueError("nsample < 1") # <<<<<<<<<<<<<<
- * if lngood + lnbad < lnsample:
- * raise ValueError("ngood + nbad < nsample")
- */
- __pyx_k_tuple_173 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_172)); if (unlikely(!__pyx_k_tuple_173)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_173);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_173));
-
- /* "mtrand.pyx":3935
- * raise ValueError("nsample < 1")
- * if lngood + lnbad < lnsample:
- * raise ValueError("ngood + nbad < nsample") # <<<<<<<<<<<<<<
- * return discnmN_array_sc(self.internal_state, rk_hypergeometric, size,
- * lngood, lnbad, lnsample)
- */
- __pyx_k_tuple_175 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_174)); if (unlikely(!__pyx_k_tuple_175)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_175);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_175));
-
- /* "mtrand.pyx":3945
- * onsample = <ndarray>PyArray_FROM_OTF(nsample, NPY_LONG, NPY_ARRAY_ALIGNED)
- * if np.any(np.less(ongood, 0)):
- * raise ValueError("ngood < 0") # <<<<<<<<<<<<<<
- * if np.any(np.less(onbad, 0)):
- * raise ValueError("nbad < 0")
- */
- __pyx_k_tuple_176 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_168)); if (unlikely(!__pyx_k_tuple_176)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_176);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_176));
-
- /* "mtrand.pyx":3947
- * raise ValueError("ngood < 0")
- * if np.any(np.less(onbad, 0)):
- * raise ValueError("nbad < 0") # <<<<<<<<<<<<<<
- * if np.any(np.less(onsample, 1)):
- * raise ValueError("nsample < 1")
- */
- __pyx_k_tuple_177 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_170)); if (unlikely(!__pyx_k_tuple_177)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3947; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_177);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_177));
-
- /* "mtrand.pyx":3949
- * raise ValueError("nbad < 0")
- * if np.any(np.less(onsample, 1)):
- * raise ValueError("nsample < 1") # <<<<<<<<<<<<<<
- * if np.any(np.less(np.add(ongood, onbad),onsample)):
- * raise ValueError("ngood + nbad < nsample")
- */
- __pyx_k_tuple_178 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_172)); if (unlikely(!__pyx_k_tuple_178)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_178);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_178));
-
- /* "mtrand.pyx":3951
- * raise ValueError("nsample < 1")
- * if np.any(np.less(np.add(ongood, onbad),onsample)):
- * raise ValueError("ngood + nbad < nsample") # <<<<<<<<<<<<<<
- * return discnmN_array(self.internal_state, rk_hypergeometric, size,
- * ongood, onbad, onsample)
- */
- __pyx_k_tuple_179 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_174)); if (unlikely(!__pyx_k_tuple_179)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_179);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_179));
-
- /* "mtrand.pyx":4035
- * if not PyErr_Occurred():
- * if fp <= 0.0:
- * raise ValueError("p <= 0.0") # <<<<<<<<<<<<<<
- * if fp >= 1.0:
- * raise ValueError("p >= 1.0")
- */
- __pyx_k_tuple_181 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_180)); if (unlikely(!__pyx_k_tuple_181)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_181);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_181));
-
- /* "mtrand.pyx":4037
- * 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)
- *
- */
- __pyx_k_tuple_183 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_182)); if (unlikely(!__pyx_k_tuple_183)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4037; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_183);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_183));
-
- /* "mtrand.pyx":4044
- * op = <ndarray>PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
- * 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")
- */
- __pyx_k_tuple_184 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_180)); if (unlikely(!__pyx_k_tuple_184)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4044; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_184);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_184));
-
- /* "mtrand.pyx":4046
- * 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)
- *
- */
- __pyx_k_tuple_185 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_182)); if (unlikely(!__pyx_k_tuple_185)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_185);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_185));
-
- /* "mtrand.pyx":4149
- * shape = size
- * if len(mean.shape) != 1:
- * raise ValueError("mean must be 1 dimensional") # <<<<<<<<<<<<<<
- * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
- * raise ValueError("cov must be 2 dimensional and square")
- */
- __pyx_k_tuple_187 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_186)); if (unlikely(!__pyx_k_tuple_187)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_187);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_187));
-
- /* "mtrand.pyx":4151
- * raise ValueError("mean must be 1 dimensional")
- * if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
- * raise ValueError("cov must be 2 dimensional and square") # <<<<<<<<<<<<<<
- * if mean.shape[0] != cov.shape[0]:
- * raise ValueError("mean and cov must have same length")
- */
- __pyx_k_tuple_189 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_188)); if (unlikely(!__pyx_k_tuple_189)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_189);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_189));
-
- /* "mtrand.pyx":4153
- * raise ValueError("cov must be 2 dimensional and square")
- * if mean.shape[0] != cov.shape[0]:
- * raise ValueError("mean and cov must have same length") # <<<<<<<<<<<<<<
- * # Compute shape of output
- * if isinstance(shape, (int, long, np.integer)):
- */
- __pyx_k_tuple_191 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_190)); if (unlikely(!__pyx_k_tuple_191)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_191);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_191));
-
- /* "mtrand.pyx":4157
- * if isinstance(shape, (int, long, np.integer)):
- * shape = [shape]
- * final_shape = list(shape[:]) # <<<<<<<<<<<<<<
- * final_shape.append(mean.shape[0])
- * # Create a matrix of independent standard normally distributed random
- */
- __pyx_k_slice_192 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_192)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_slice_192);
- __Pyx_GIVEREF(__pyx_k_slice_192);
-
- /* "mtrand.pyx":4246
- *
- * if kahan_sum(pix, d-1) > (1.0 + 1e-12):
- * raise ValueError("sum(pvals[:-1]) > 1.0") # <<<<<<<<<<<<<<
- *
- * if size is None:
- */
- __pyx_k_tuple_195 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_194)); if (unlikely(!__pyx_k_tuple_195)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4246; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_195);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_195));
-
- /* "mtrand.pyx":4433
- * # each row. So we can't just use ordinary assignment to swap the
- * # rows; we need a bounce buffer.
- * buf = np.empty(x.shape[1:], dtype=x.dtype) # <<<<<<<<<<<<<<
- * while i > 0:
- * j = rk_interval(i, self.internal_state)
- */
- __pyx_k_slice_196 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_k_slice_196)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_slice_196);
- __Pyx_GIVEREF(__pyx_k_slice_196);
-
- /* "mtrand.pyx":559
- * """
- * cdef rk_state *internal_state
- * poisson_lam_max = np.iinfo('l').max - np.sqrt(np.iinfo('l').max)*10 # <<<<<<<<<<<<<<
- *
- * def __init__(self, seed=None):
- */
- __pyx_k_tuple_197 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__l)); if (unlikely(!__pyx_k_tuple_197)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_197);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_197));
- __pyx_k_tuple_198 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__l)); if (unlikely(!__pyx_k_tuple_198)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_198);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_198));
- __Pyx_RefNannyFinishContext();
- return 0;
- __pyx_L1_error:;
- __Pyx_RefNannyFinishContext();
- return -1;
-}
-
-static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_624 = PyInt_FromLong(624); if (unlikely(!__pyx_int_624)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC initmtrand(void); /*proto*/
-PyMODINIT_FUNC initmtrand(void)
-#else
-PyMODINIT_FUNC PyInit_mtrand(void); /*proto*/
-PyMODINIT_FUNC PyInit_mtrand(void)
-#endif
-{
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannyDeclarations
- #if CYTHON_REFNANNY
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
- if (!__Pyx_RefNanny) {
- PyErr_Clear();
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
- if (!__Pyx_RefNanny)
- Py_FatalError("failed to import 'refnanny' module");
- }
- #endif
- __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_mtrand(void)", 0);
- if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- #ifdef __Pyx_FusedFunction_USED
- if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- #ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- /*--- Library function declarations ---*/
- /*--- Threads initialization code ---*/
- #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
- #ifdef WITH_THREAD /* Python build with threading support? */
- PyEval_InitThreads();
- #endif
- #endif
- /*--- Module creation code ---*/
- #if PY_MAJOR_VERSION < 3
- __pyx_m = Py_InitModule4(__Pyx_NAMESTR("mtrand"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
- #else
- __pyx_m = PyModule_Create(&__pyx_moduledef);
- #endif
- if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_d);
- #if PY_MAJOR_VERSION >= 3
- {
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!PyDict_GetItemString(modules, "mtrand")) {
- if (unlikely(PyDict_SetItemString(modules, "mtrand", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- }
- #endif
- __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #if CYTHON_COMPILING_IN_PYPY
- Py_INCREF(__pyx_b);
- #endif
- if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- /*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- if (__pyx_module_is_main_mtrand) {
- if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- }
- /*--- Builtin init code ---*/
- if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Constants init code ---*/
- if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Global init code ---*/
- /*--- Variable export code ---*/
- /*--- Function export code ---*/
- /*--- Type init code ---*/
- __pyx_ptype_6mtrand_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_6mtrand_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_6mtrand_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_6mtrand_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_6mtrand_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_6mtrand_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState;
- /*--- Type import code ---*/
- /*--- Variable import code ---*/
- /*--- Function import code ---*/
- /*--- Execution code ---*/
-
- /* "mtrand.pyx":124
- *
- * # Initialize numpy
- * import_array() # <<<<<<<<<<<<<<
- *
- * import numpy as np
- */
- import_array();
-
- /* "mtrand.pyx":126
- * import_array()
- *
- * import numpy as np # <<<<<<<<<<<<<<
- * import operator
- *
- */
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":127
- *
- * import numpy as np
- * import operator # <<<<<<<<<<<<<<
- *
- * cdef object cont0_array(rk_state *state, rk_cont0 func, object size):
- */
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__operator), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__operator, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":559
- * """
- * cdef rk_state *internal_state
- * poisson_lam_max = np.iinfo('l').max - np.sqrt(np.iinfo('l').max)*10 # <<<<<<<<<<<<<<
- *
- * def __init__(self, seed=None):
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__iinfo); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_197), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__max); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__sqrt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__iinfo); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_198), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__max); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_int_10); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem((PyObject *)__pyx_ptype_6mtrand_RandomState->tp_dict, __pyx_n_s__poisson_lam_max, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- PyType_Modified(__pyx_ptype_6mtrand_RandomState);
-
- /* "mtrand.pyx":920
- *
- *
- * def choice(self, a, size=None, replace=True, p=None): # <<<<<<<<<<<<<<
- * """
- * choice(a, size=None, replace=True, p=None)
- */
- __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_17 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":1092
- *
- *
- * def uniform(self, low=0.0, high=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * uniform(low=0.0, high=1.0, size=1)
- */
- __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_40 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_41 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":1390
- * return cont0_array(self.internal_state, rk_gauss, size)
- *
- * def normal(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * normal(loc=0.0, scale=1.0, size=None)
- */
- __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_42 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_43 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":1549
- * return cont2_array(self.internal_state, rk_beta, size, oa, ob)
- *
- * def exponential(self, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * exponential(scale=1.0, size=None)
- */
- __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_53 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":1713
- * return cont1_array(self.internal_state, rk_standard_gamma, size, oshape)
- *
- * def gamma(self, shape, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * gamma(shape, scale=1.0, size=None)
- */
- __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_59 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":2732
- * return cont1_array(self.internal_state, rk_power, size, oa)
- *
- * def laplace(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * laplace(loc=0.0, scale=1.0, size=None)
- */
- __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_98 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2732; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_99 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":2822
- * return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale)
- *
- * def gumbel(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * gumbel(loc=0.0, scale=1.0, size=None)
- */
- __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_102 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_103 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":2953
- * return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale)
- *
- * def logistic(self, loc=0.0, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * logistic(loc=0.0, scale=1.0, size=None)
- */
- __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_106 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_107 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":3041
- * return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale)
- *
- * def lognormal(self, mean=0.0, sigma=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * lognormal(mean=0.0, sigma=1.0, size=None)
- */
- __pyx_t_4 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_110 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3041; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_111 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":3162
- * return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma)
- *
- * def rayleigh(self, scale=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * rayleigh(scale=1.0, size=None)
- */
- __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_116 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":3611
- * on, op)
- *
- * def poisson(self, lam=1.0, size=None): # <<<<<<<<<<<<<<
- * """
- * poisson(lam=1.0, size=None)
- */
- __pyx_t_4 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 3611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_k_151 = __pyx_t_4;
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4492
- * return arr
- *
- * _rand = RandomState() # <<<<<<<<<<<<<<
- * seed = _rand.seed
- * get_state = _rand.get_state
- */
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6mtrand_RandomState)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s___rand, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4493
- *
- * _rand = RandomState()
- * seed = _rand.seed # <<<<<<<<<<<<<<
- * get_state = _rand.get_state
- * set_state = _rand.set_state
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__seed); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__seed, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4494
- * _rand = RandomState()
- * seed = _rand.seed
- * get_state = _rand.get_state # <<<<<<<<<<<<<<
- * set_state = _rand.set_state
- * random_sample = _rand.random_sample
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__get_state); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__get_state, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4494; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4495
- * seed = _rand.seed
- * get_state = _rand.get_state
- * set_state = _rand.set_state # <<<<<<<<<<<<<<
- * random_sample = _rand.random_sample
- * choice = _rand.choice
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__set_state); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__set_state, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4496
- * get_state = _rand.get_state
- * set_state = _rand.set_state
- * random_sample = _rand.random_sample # <<<<<<<<<<<<<<
- * choice = _rand.choice
- * randint = _rand.randint
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__random_sample); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__random_sample, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4497
- * set_state = _rand.set_state
- * random_sample = _rand.random_sample
- * choice = _rand.choice # <<<<<<<<<<<<<<
- * randint = _rand.randint
- * bytes = _rand.bytes
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__choice); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__choice, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4498
- * random_sample = _rand.random_sample
- * choice = _rand.choice
- * randint = _rand.randint # <<<<<<<<<<<<<<
- * bytes = _rand.bytes
- * uniform = _rand.uniform
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__randint); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__randint, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4499
- * choice = _rand.choice
- * randint = _rand.randint
- * bytes = _rand.bytes # <<<<<<<<<<<<<<
- * uniform = _rand.uniform
- * rand = _rand.rand
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__bytes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__bytes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4500
- * randint = _rand.randint
- * bytes = _rand.bytes
- * uniform = _rand.uniform # <<<<<<<<<<<<<<
- * rand = _rand.rand
- * randn = _rand.randn
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__uniform); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__uniform, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4500; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4501
- * bytes = _rand.bytes
- * uniform = _rand.uniform
- * rand = _rand.rand # <<<<<<<<<<<<<<
- * randn = _rand.randn
- * random_integers = _rand.random_integers
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__rand, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4502
- * uniform = _rand.uniform
- * rand = _rand.rand
- * randn = _rand.randn # <<<<<<<<<<<<<<
- * random_integers = _rand.random_integers
- * standard_normal = _rand.standard_normal
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__randn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__randn, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4503
- * rand = _rand.rand
- * randn = _rand.randn
- * random_integers = _rand.random_integers # <<<<<<<<<<<<<<
- * standard_normal = _rand.standard_normal
- * normal = _rand.normal
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__random_integers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__random_integers, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4504
- * randn = _rand.randn
- * random_integers = _rand.random_integers
- * standard_normal = _rand.standard_normal # <<<<<<<<<<<<<<
- * normal = _rand.normal
- * beta = _rand.beta
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__standard_normal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__standard_normal, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4505
- * random_integers = _rand.random_integers
- * standard_normal = _rand.standard_normal
- * normal = _rand.normal # <<<<<<<<<<<<<<
- * beta = _rand.beta
- * exponential = _rand.exponential
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4506
- * standard_normal = _rand.standard_normal
- * normal = _rand.normal
- * beta = _rand.beta # <<<<<<<<<<<<<<
- * exponential = _rand.exponential
- * standard_exponential = _rand.standard_exponential
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__beta); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__beta, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4507
- * normal = _rand.normal
- * beta = _rand.beta
- * exponential = _rand.exponential # <<<<<<<<<<<<<<
- * standard_exponential = _rand.standard_exponential
- * standard_gamma = _rand.standard_gamma
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__exponential); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__exponential, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4508
- * beta = _rand.beta
- * exponential = _rand.exponential
- * standard_exponential = _rand.standard_exponential # <<<<<<<<<<<<<<
- * standard_gamma = _rand.standard_gamma
- * gamma = _rand.gamma
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_199); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_199, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4509
- * exponential = _rand.exponential
- * standard_exponential = _rand.standard_exponential
- * standard_gamma = _rand.standard_gamma # <<<<<<<<<<<<<<
- * gamma = _rand.gamma
- * f = _rand.f
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__standard_gamma); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__standard_gamma, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4510
- * standard_exponential = _rand.standard_exponential
- * standard_gamma = _rand.standard_gamma
- * gamma = _rand.gamma # <<<<<<<<<<<<<<
- * f = _rand.f
- * noncentral_f = _rand.noncentral_f
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__gamma); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__gamma, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4511
- * standard_gamma = _rand.standard_gamma
- * gamma = _rand.gamma
- * f = _rand.f # <<<<<<<<<<<<<<
- * noncentral_f = _rand.noncentral_f
- * chisquare = _rand.chisquare
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__f); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__f, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4512
- * gamma = _rand.gamma
- * f = _rand.f
- * noncentral_f = _rand.noncentral_f # <<<<<<<<<<<<<<
- * chisquare = _rand.chisquare
- * noncentral_chisquare = _rand.noncentral_chisquare
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__noncentral_f); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__noncentral_f, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4513
- * f = _rand.f
- * noncentral_f = _rand.noncentral_f
- * chisquare = _rand.chisquare # <<<<<<<<<<<<<<
- * noncentral_chisquare = _rand.noncentral_chisquare
- * standard_cauchy = _rand.standard_cauchy
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__chisquare); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__chisquare, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4514
- * noncentral_f = _rand.noncentral_f
- * chisquare = _rand.chisquare
- * noncentral_chisquare = _rand.noncentral_chisquare # <<<<<<<<<<<<<<
- * standard_cauchy = _rand.standard_cauchy
- * standard_t = _rand.standard_t
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_200); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_200, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4515
- * chisquare = _rand.chisquare
- * noncentral_chisquare = _rand.noncentral_chisquare
- * standard_cauchy = _rand.standard_cauchy # <<<<<<<<<<<<<<
- * standard_t = _rand.standard_t
- * vonmises = _rand.vonmises
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__standard_cauchy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__standard_cauchy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4516
- * noncentral_chisquare = _rand.noncentral_chisquare
- * standard_cauchy = _rand.standard_cauchy
- * standard_t = _rand.standard_t # <<<<<<<<<<<<<<
- * vonmises = _rand.vonmises
- * pareto = _rand.pareto
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__standard_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__standard_t, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4517
- * standard_cauchy = _rand.standard_cauchy
- * standard_t = _rand.standard_t
- * vonmises = _rand.vonmises # <<<<<<<<<<<<<<
- * pareto = _rand.pareto
- * weibull = _rand.weibull
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__vonmises); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__vonmises, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4518
- * standard_t = _rand.standard_t
- * vonmises = _rand.vonmises
- * pareto = _rand.pareto # <<<<<<<<<<<<<<
- * weibull = _rand.weibull
- * power = _rand.power
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__pareto); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__pareto, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4519
- * vonmises = _rand.vonmises
- * pareto = _rand.pareto
- * weibull = _rand.weibull # <<<<<<<<<<<<<<
- * power = _rand.power
- * laplace = _rand.laplace
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__weibull); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__weibull, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4520
- * pareto = _rand.pareto
- * weibull = _rand.weibull
- * power = _rand.power # <<<<<<<<<<<<<<
- * laplace = _rand.laplace
- * gumbel = _rand.gumbel
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__power); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__power, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4521
- * weibull = _rand.weibull
- * power = _rand.power
- * laplace = _rand.laplace # <<<<<<<<<<<<<<
- * gumbel = _rand.gumbel
- * logistic = _rand.logistic
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__laplace); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__laplace, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4522
- * power = _rand.power
- * laplace = _rand.laplace
- * gumbel = _rand.gumbel # <<<<<<<<<<<<<<
- * logistic = _rand.logistic
- * lognormal = _rand.lognormal
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__gumbel); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__gumbel, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4523
- * laplace = _rand.laplace
- * gumbel = _rand.gumbel
- * logistic = _rand.logistic # <<<<<<<<<<<<<<
- * lognormal = _rand.lognormal
- * rayleigh = _rand.rayleigh
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__logistic); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__logistic, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4524
- * gumbel = _rand.gumbel
- * logistic = _rand.logistic
- * lognormal = _rand.lognormal # <<<<<<<<<<<<<<
- * rayleigh = _rand.rayleigh
- * wald = _rand.wald
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__lognormal); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__lognormal, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4525
- * logistic = _rand.logistic
- * lognormal = _rand.lognormal
- * rayleigh = _rand.rayleigh # <<<<<<<<<<<<<<
- * wald = _rand.wald
- * triangular = _rand.triangular
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__rayleigh); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__rayleigh, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4526
- * lognormal = _rand.lognormal
- * rayleigh = _rand.rayleigh
- * wald = _rand.wald # <<<<<<<<<<<<<<
- * triangular = _rand.triangular
- *
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__wald); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__wald, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4527
- * rayleigh = _rand.rayleigh
- * wald = _rand.wald
- * triangular = _rand.triangular # <<<<<<<<<<<<<<
- *
- * binomial = _rand.binomial
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__triangular); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__triangular, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4529
- * triangular = _rand.triangular
- *
- * binomial = _rand.binomial # <<<<<<<<<<<<<<
- * negative_binomial = _rand.negative_binomial
- * poisson = _rand.poisson
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__binomial); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__binomial, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4530
- *
- * binomial = _rand.binomial
- * negative_binomial = _rand.negative_binomial # <<<<<<<<<<<<<<
- * poisson = _rand.poisson
- * zipf = _rand.zipf
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__negative_binomial); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__negative_binomial, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4531
- * binomial = _rand.binomial
- * negative_binomial = _rand.negative_binomial
- * poisson = _rand.poisson # <<<<<<<<<<<<<<
- * zipf = _rand.zipf
- * geometric = _rand.geometric
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__poisson); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__poisson, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4531; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4532
- * negative_binomial = _rand.negative_binomial
- * poisson = _rand.poisson
- * zipf = _rand.zipf # <<<<<<<<<<<<<<
- * geometric = _rand.geometric
- * hypergeometric = _rand.hypergeometric
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__zipf); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__zipf, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4532; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4533
- * poisson = _rand.poisson
- * zipf = _rand.zipf
- * geometric = _rand.geometric # <<<<<<<<<<<<<<
- * hypergeometric = _rand.hypergeometric
- * logseries = _rand.logseries
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__geometric); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__geometric, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4534
- * zipf = _rand.zipf
- * geometric = _rand.geometric
- * hypergeometric = _rand.hypergeometric # <<<<<<<<<<<<<<
- * logseries = _rand.logseries
- *
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__hypergeometric); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__hypergeometric, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4535
- * geometric = _rand.geometric
- * hypergeometric = _rand.hypergeometric
- * logseries = _rand.logseries # <<<<<<<<<<<<<<
- *
- * multivariate_normal = _rand.multivariate_normal
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__logseries); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__logseries, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4537
- * logseries = _rand.logseries
- *
- * multivariate_normal = _rand.multivariate_normal # <<<<<<<<<<<<<<
- * multinomial = _rand.multinomial
- * dirichlet = _rand.dirichlet
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__multivariate_normal); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__multivariate_normal, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4537; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4538
- *
- * multivariate_normal = _rand.multivariate_normal
- * multinomial = _rand.multinomial # <<<<<<<<<<<<<<
- * dirichlet = _rand.dirichlet
- *
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__multinomial); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__multinomial, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4539
- * multivariate_normal = _rand.multivariate_normal
- * multinomial = _rand.multinomial
- * dirichlet = _rand.dirichlet # <<<<<<<<<<<<<<
- *
- * shuffle = _rand.shuffle
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__dirichlet); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__dirichlet, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":4541
- * dirichlet = _rand.dirichlet
- *
- * shuffle = _rand.shuffle # <<<<<<<<<<<<<<
- * permutation = _rand.permutation
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__shuffle); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__shuffle, __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4541; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "mtrand.pyx":4542
- *
- * shuffle = _rand.shuffle
- * permutation = _rand.permutation # <<<<<<<<<<<<<<
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___rand); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__permutation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__permutation, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "mtrand.pyx":1
- * # mtrand.pyx -- A Pyrex wrapper of Jean-Sebastien Roy's RandomKit # <<<<<<<<<<<<<<
- * #
- * # Copyright 2005 Robert Kern (robert.kern@gmail.com)
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_201), ((PyObject *)__pyx_kp_u_202)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_203), ((PyObject *)__pyx_kp_u_204)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_205), ((PyObject *)__pyx_kp_u_206)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_207), ((PyObject *)__pyx_kp_u_208)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_209), ((PyObject *)__pyx_kp_u_210)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_211), ((PyObject *)__pyx_kp_u_212)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_213), ((PyObject *)__pyx_kp_u_214)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_215), ((PyObject *)__pyx_kp_u_216)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_217), ((PyObject *)__pyx_kp_u_218)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_219), ((PyObject *)__pyx_kp_u_220)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_221), ((PyObject *)__pyx_kp_u_222)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_223), ((PyObject *)__pyx_kp_u_224)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_225), ((PyObject *)__pyx_kp_u_226)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_227), ((PyObject *)__pyx_kp_u_228)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_229), ((PyObject *)__pyx_kp_u_230)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_231), ((PyObject *)__pyx_kp_u_232)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_233), ((PyObject *)__pyx_kp_u_234)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_235), ((PyObject *)__pyx_kp_u_236)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_237), ((PyObject *)__pyx_kp_u_238)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_239), ((PyObject *)__pyx_kp_u_240)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_241), ((PyObject *)__pyx_kp_u_242)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_243), ((PyObject *)__pyx_kp_u_244)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_245), ((PyObject *)__pyx_kp_u_246)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_247), ((PyObject *)__pyx_kp_u_248)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_249), ((PyObject *)__pyx_kp_u_250)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_251), ((PyObject *)__pyx_kp_u_252)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_253), ((PyObject *)__pyx_kp_u_254)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_255), ((PyObject *)__pyx_kp_u_256)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_257), ((PyObject *)__pyx_kp_u_258)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_259), ((PyObject *)__pyx_kp_u_260)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_261), ((PyObject *)__pyx_kp_u_262)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_263), ((PyObject *)__pyx_kp_u_264)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_265), ((PyObject *)__pyx_kp_u_266)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_267), ((PyObject *)__pyx_kp_u_268)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_269), ((PyObject *)__pyx_kp_u_270)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_271), ((PyObject *)__pyx_kp_u_272)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_273), ((PyObject *)__pyx_kp_u_274)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_275), ((PyObject *)__pyx_kp_u_276)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_277), ((PyObject *)__pyx_kp_u_278)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_279), ((PyObject *)__pyx_kp_u_280)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_281), ((PyObject *)__pyx_kp_u_282)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_283), ((PyObject *)__pyx_kp_u_284)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_kp_u_285), ((PyObject *)__pyx_kp_u_286)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- if (__pyx_m) {
- __Pyx_AddTraceback("init mtrand", __pyx_clineno, __pyx_lineno, __pyx_filename);
- Py_DECREF(__pyx_m); __pyx_m = 0;
- } else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init mtrand");
- }
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- #if PY_MAJOR_VERSION < 3
- return;
- #else
- return __pyx_m;
- #endif
-}
-
-/* Runtime support code */
-#if CYTHON_REFNANNY
-static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
- PyObject *m = NULL, *p = NULL;
- void *r = NULL;
- m = PyImport_ImportModule((char *)modname);
- if (!m) goto end;
- p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
- if (!p) goto end;
- r = PyLong_AsVoidPtr(p);
-end:
- Py_XDECREF(p);
- Py_XDECREF(m);
- return (__Pyx_RefNannyAPIStruct *)r;
-}
-#endif /* CYTHON_REFNANNY */
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
- PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
- if (unlikely(!result)) {
- PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
- "name '%U' is not defined", name);
-#else
- "name '%s' is not defined", PyString_AS_STRING(name));
-#endif
- }
- return result;
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
- PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
- result = PyDict_GetItem(__pyx_d, name);
- if (result) {
- Py_INCREF(result);
- } else {
-#else
- result = PyObject_GetItem(__pyx_d, name);
- if (!result) {
- PyErr_Clear();
-#endif
- result = __Pyx_GetBuiltinName(name);
- }
- return result;
-}
-
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
- tmp_type = tstate->curexc_type;
- tmp_value = tstate->curexc_value;
- tmp_tb = tstate->curexc_traceback;
- tstate->curexc_type = type;
- tstate->curexc_value = value;
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_Restore(type, value, tb);
-#endif
-}
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
- *type = tstate->curexc_type;
- *value = tstate->curexc_value;
- *tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
-}
-
-#if PY_MAJOR_VERSION < 3
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
- CYTHON_UNUSED PyObject *cause) {
- Py_XINCREF(type);
- if (!value || value == Py_None)
- value = NULL;
- else
- Py_INCREF(value);
- if (!tb || tb == Py_None)
- tb = NULL;
- else {
- Py_INCREF(tb);
- if (!PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto raise_error;
- }
- }
- #if PY_VERSION_HEX < 0x02050000
- if (PyClass_Check(type)) {
- #else
- if (PyType_Check(type)) {
- #endif
-#if CYTHON_COMPILING_IN_PYPY
- if (!value) {
- Py_INCREF(Py_None);
- value = Py_None;
- }
-#endif
- PyErr_NormalizeException(&type, &value, &tb);
- } else {
- if (value) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto raise_error;
- }
- value = type;
- #if PY_VERSION_HEX < 0x02050000
- if (PyInstance_Check(type)) {
- type = (PyObject*) ((PyInstanceObject*)type)->in_class;
- Py_INCREF(type);
- } else {
- type = 0;
- PyErr_SetString(PyExc_TypeError,
- "raise: exception must be an old-style class or instance");
- goto raise_error;
- }
- #else
- type = (PyObject*) Py_TYPE(type);
- Py_INCREF(type);
- if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto raise_error;
- }
- #endif
- }
- __Pyx_ErrRestore(type, value, tb);
- return;
-raise_error:
- Py_XDECREF(value);
- Py_XDECREF(type);
- Py_XDECREF(tb);
- return;
-}
-#else /* Python 3+ */
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
- PyObject* owned_instance = NULL;
- if (tb == Py_None) {
- tb = 0;
- } else if (tb && !PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto bad;
- }
- if (value == Py_None)
- value = 0;
- if (PyExceptionInstance_Check(type)) {
- if (value) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto bad;
- }
- value = type;
- type = (PyObject*) Py_TYPE(value);
- } else if (PyExceptionClass_Check(type)) {
- PyObject *args;
- if (!value)
- args = PyTuple_New(0);
- else if (PyTuple_Check(value)) {
- Py_INCREF(value);
- args = value;
- } else
- args = PyTuple_Pack(1, value);
- if (!args)
- goto bad;
- owned_instance = PyEval_CallObject(type, args);
- Py_DECREF(args);
- if (!owned_instance)
- goto bad;
- value = owned_instance;
- if (!PyExceptionInstance_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "calling %R should have returned an instance of "
- "BaseException, not %R",
- type, Py_TYPE(value));
- goto bad;
- }
- } else {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto bad;
- }
-#if PY_VERSION_HEX >= 0x03030000
- if (cause) {
-#else
- if (cause && cause != Py_None) {
-#endif
- PyObject *fixed_cause;
- if (cause == Py_None) {
- fixed_cause = NULL;
- } else if (PyExceptionClass_Check(cause)) {
- fixed_cause = PyObject_CallObject(cause, NULL);
- if (fixed_cause == NULL)
- goto bad;
- } else if (PyExceptionInstance_Check(cause)) {
- fixed_cause = cause;
- Py_INCREF(fixed_cause);
- } else {
- PyErr_SetString(PyExc_TypeError,
- "exception causes must derive from "
- "BaseException");
- goto bad;
- }
- PyException_SetCause(value, fixed_cause);
- }
- PyErr_SetObject(type, value);
- if (tb) {
- PyThreadState *tstate = PyThreadState_GET();
- PyObject* tmp_tb = tstate->curexc_traceback;
- if (tb != tmp_tb) {
- Py_INCREF(tb);
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_tb);
- }
- }
-bad:
- Py_XDECREF(owned_instance);
- return;
-}
-#endif
-
-static void __Pyx_RaiseDoubleKeywordsError(
- const char* func_name,
- PyObject* kw_name)
-{
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION >= 3
- "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
- #else
- "%s() got multiple values for keyword argument '%s'", func_name,
- PyString_AsString(kw_name));
- #endif
-}
-
-static int __Pyx_ParseOptionalKeywords(
- PyObject *kwds,
- PyObject **argnames[],
- PyObject *kwds2,
- PyObject *values[],
- Py_ssize_t num_pos_args,
- const char* function_name)
-{
- PyObject *key = 0, *value = 0;
- Py_ssize_t pos = 0;
- PyObject*** name;
- PyObject*** first_kw_arg = argnames + num_pos_args;
- while (PyDict_Next(kwds, &pos, &key, &value)) {
- name = first_kw_arg;
- while (*name && (**name != key)) name++;
- if (*name) {
- values[name-argnames] = value;
- continue;
- }
- name = first_kw_arg;
- #if PY_MAJOR_VERSION < 3
- if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
- while (*name) {
- if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
- && _PyString_Eq(**name, key)) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- if ((**argname == key) || (
- (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
- && _PyString_Eq(**argname, key))) {
- goto arg_passed_twice;
- }
- argname++;
- }
- }
- } else
- #endif
- if (likely(PyUnicode_Check(key))) {
- while (*name) {
- int cmp = (**name == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
- #endif
- PyUnicode_Compare(**name, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- int cmp = (**argname == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
- #endif
- PyUnicode_Compare(**argname, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) goto arg_passed_twice;
- argname++;
- }
- }
- } else
- goto invalid_keyword_type;
- if (kwds2) {
- if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
- } else {
- goto invalid_keyword;
- }
- }
- return 0;
-arg_passed_twice:
- __Pyx_RaiseDoubleKeywordsError(function_name, key);
- goto bad;
-invalid_keyword_type:
- PyErr_Format(PyExc_TypeError,
- "%s() keywords must be strings", function_name);
- goto bad;
-invalid_keyword:
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION < 3
- "%s() got an unexpected keyword argument '%s'",
- function_name, PyString_AsString(key));
- #else
- "%s() got an unexpected keyword argument '%U'",
- function_name, key);
- #endif
-bad:
- return -1;
-}
-
-static void __Pyx_RaiseArgtupleInvalid(
- const char* func_name,
- int exact,
- Py_ssize_t num_min,
- Py_ssize_t num_max,
- Py_ssize_t num_found)
-{
- Py_ssize_t num_expected;
- const char *more_or_less;
- if (num_found < num_min) {
- num_expected = num_min;
- more_or_less = "at least";
- } else {
- num_expected = num_max;
- more_or_less = "at most";
- }
- if (exact) {
- more_or_less = "exactly";
- }
- PyErr_Format(PyExc_TypeError,
- "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
- func_name, more_or_less, num_expected,
- (num_expected == 1) ? "" : "s", num_found);
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
- PyObject *r;
- if (!j) return NULL;
- r = PyObject_GetItem(o, j);
- Py_DECREF(j);
- return r;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
- PyObject *r = PyList_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
- int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (is_list || PyList_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
- if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
- PyObject *r = PyList_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- }
- else if (PyTuple_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- } else {
- PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
- if (likely(m && m->sq_item)) {
- if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
- Py_ssize_t l = m->sq_length(o);
- if (likely(l >= 0)) {
- i += l;
- } else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
- return NULL;
- }
- }
- return m->sq_item(o, i);
- }
- }
-#else
- if (is_list || PySequence_Check(o)) {
- return PySequence_GetItem(o, i);
- }
-#endif
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
- PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
- PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
- int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyMappingMethods* mp;
-#if PY_MAJOR_VERSION < 3
- PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
- if (likely(ms && ms->sq_slice)) {
- if (!has_cstart) {
- if (_py_start && (*_py_start != Py_None)) {
- cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
- if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstart = 0;
- }
- if (!has_cstop) {
- if (_py_stop && (*_py_stop != Py_None)) {
- cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
- if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstop = PY_SSIZE_T_MAX;
- }
- if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
- Py_ssize_t l = ms->sq_length(obj);
- if (likely(l >= 0)) {
- if (cstop < 0) {
- cstop += l;
- if (cstop < 0) cstop = 0;
- }
- if (cstart < 0) {
- cstart += l;
- if (cstart < 0) cstart = 0;
- }
- } else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
- goto bad;
- }
- }
- return ms->sq_slice(obj, cstart, cstop);
- }
-#endif
- mp = Py_TYPE(obj)->tp_as_mapping;
- if (likely(mp && mp->mp_subscript))
-#endif
- {
- PyObject* result;
- PyObject *py_slice, *py_start, *py_stop;
- if (_py_slice) {
- py_slice = *_py_slice;
- } else {
- PyObject* owned_start = NULL;
- PyObject* owned_stop = NULL;
- if (_py_start) {
- py_start = *_py_start;
- } else {
- if (has_cstart) {
- owned_start = py_start = PyInt_FromSsize_t(cstart);
- if (unlikely(!py_start)) goto bad;
- } else
- py_start = Py_None;
- }
- if (_py_stop) {
- py_stop = *_py_stop;
- } else {
- if (has_cstop) {
- owned_stop = py_stop = PyInt_FromSsize_t(cstop);
- if (unlikely(!py_stop)) {
- Py_XDECREF(owned_start);
- goto bad;
- }
- } else
- py_stop = Py_None;
- }
- py_slice = PySlice_New(py_start, py_stop, Py_None);
- Py_XDECREF(owned_start);
- Py_XDECREF(owned_stop);
- if (unlikely(!py_slice)) goto bad;
- }
-#if CYTHON_COMPILING_IN_CPYTHON
- result = mp->mp_subscript(obj, py_slice);
-#else
- result = PyObject_GetItem(obj, py_slice);
-#endif
- if (!_py_slice) {
- Py_DECREF(py_slice);
- }
- return result;
- }
- PyErr_Format(PyExc_TypeError,
- "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
-bad:
- return NULL;
-}
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
- PyErr_Format(PyExc_ValueError,
- "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
- PyErr_Format(PyExc_ValueError,
- "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
- index, (index == 1) ? "" : "s");
-}
-
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
- PyObject* exc_type = tstate->curexc_type;
- if (unlikely(exc_type)) {
- if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
- PyObject *exc_value, *exc_tb;
- exc_value = tstate->curexc_value;
- exc_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
- Py_DECREF(exc_type);
- Py_XDECREF(exc_value);
- Py_XDECREF(exc_tb);
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#else
- if (unlikely(PyErr_Occurred())) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
- PyErr_Clear();
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#endif
-}
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
- if (unlikely(retval)) {
- Py_DECREF(retval);
- __Pyx_RaiseTooManyValuesError(expected);
- return -1;
- } else {
- return __Pyx_IterFinish();
- }
- return 0;
-}
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
- PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
- local_type = tstate->curexc_type;
- local_value = tstate->curexc_value;
- local_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(&local_type, &local_value, &local_tb);
-#endif
- PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(tstate->curexc_type))
-#else
- if (unlikely(PyErr_Occurred()))
-#endif
- goto bad;
- #if PY_MAJOR_VERSION >= 3
- if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
- goto bad;
- #endif
- Py_INCREF(local_type);
- Py_INCREF(local_value);
- Py_INCREF(local_tb);
- *type = local_type;
- *value = local_value;
- *tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = local_type;
- tstate->exc_value = local_value;
- tstate->exc_traceback = local_tb;
- /* Make sure tstate is in a consistent state when we XDECREF
- these objects (DECREF may run arbitrary code). */
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(local_type, local_value, local_tb);
-#endif
- return 0;
-bad:
- *type = 0;
- *value = 0;
- *tb = 0;
- Py_XDECREF(local_type);
- Py_XDECREF(local_value);
- Py_XDECREF(local_tb);
- return -1;
-}
-
-static CYTHON_INLINE int __Pyx_PyObject_SetSlice(
- PyObject* obj, PyObject* value, Py_ssize_t cstart, Py_ssize_t cstop,
- PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
- int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyMappingMethods* mp;
-#if PY_MAJOR_VERSION < 3
- PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
- if (likely(ms && ms->sq_ass_slice)) {
- if (!has_cstart) {
- if (_py_start && (*_py_start != Py_None)) {
- cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
- if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstart = 0;
- }
- if (!has_cstop) {
- if (_py_stop && (*_py_stop != Py_None)) {
- cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
- if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstop = PY_SSIZE_T_MAX;
- }
- if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
- Py_ssize_t l = ms->sq_length(obj);
- if (likely(l >= 0)) {
- if (cstop < 0) {
- cstop += l;
- if (cstop < 0) cstop = 0;
- }
- if (cstart < 0) {
- cstart += l;
- if (cstart < 0) cstart = 0;
- }
- } else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
- goto bad;
- }
- }
- return ms->sq_ass_slice(obj, cstart, cstop, value);
- }
-#endif
- mp = Py_TYPE(obj)->tp_as_mapping;
- if (likely(mp && mp->mp_ass_subscript))
-#endif
- {
- int result;
- PyObject *py_slice, *py_start, *py_stop;
- if (_py_slice) {
- py_slice = *_py_slice;
- } else {
- PyObject* owned_start = NULL;
- PyObject* owned_stop = NULL;
- if (_py_start) {
- py_start = *_py_start;
- } else {
- if (has_cstart) {
- owned_start = py_start = PyInt_FromSsize_t(cstart);
- if (unlikely(!py_start)) goto bad;
- } else
- py_start = Py_None;
- }
- if (_py_stop) {
- py_stop = *_py_stop;
- } else {
- if (has_cstop) {
- owned_stop = py_stop = PyInt_FromSsize_t(cstop);
- if (unlikely(!py_stop)) {
- Py_XDECREF(owned_start);
- goto bad;
- }
- } else
- py_stop = Py_None;
- }
- py_slice = PySlice_New(py_start, py_stop, Py_None);
- Py_XDECREF(owned_start);
- Py_XDECREF(owned_stop);
- if (unlikely(!py_slice)) goto bad;
- }
-#if CYTHON_COMPILING_IN_CPYTHON
- result = mp->mp_ass_subscript(obj, py_slice, value);
-#else
- result = value ? PyObject_SetItem(obj, py_slice, value) : PyObject_DelItem(obj, py_slice);
-#endif
- if (!_py_slice) {
- Py_DECREF(py_slice);
- }
- return result;
- }
- PyErr_Format(PyExc_TypeError,
- "'%.200s' object does not support slice %s",
- Py_TYPE(obj)->tp_name, value ? "assignment" : "deletion");
-bad:
- return -1;
-}
-
-static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
- PyObject *kwdict,
- const char* function_name,
- int kw_allowed)
-{
- PyObject* key = 0;
- Py_ssize_t pos = 0;
-#if CPYTHON_COMPILING_IN_PYPY
- if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
- goto invalid_keyword;
- return 1;
-#else
- while (PyDict_Next(kwdict, &pos, &key, 0)) {
- #if PY_MAJOR_VERSION < 3
- if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
- #endif
- if (unlikely(!PyUnicode_Check(key)))
- goto invalid_keyword_type;
- }
- if ((!kw_allowed) && unlikely(key))
- goto invalid_keyword;
- return 1;
-invalid_keyword_type:
- PyErr_Format(PyExc_TypeError,
- "%s() keywords must be strings", function_name);
- return 0;
-#endif
-invalid_keyword:
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION < 3
- "%s() got an unexpected keyword argument '%s'",
- function_name, PyString_AsString(key));
- #else
- "%s() got an unexpected keyword argument '%U'",
- function_name, key);
- #endif
- return 0;
-}
-
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
- if (unlikely(!type)) {
- PyErr_Format(PyExc_SystemError, "Missing type object");
- return 0;
- }
- if (likely(PyObject_TypeCheck(obj, type)))
- return 1;
- PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
- Py_TYPE(obj)->tp_name, type->tp_name);
- return 0;
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
- Py_ssize_t start = *_start, stop = *_stop, length = *_length;
- if (start < 0) {
- start += length;
- if (start < 0)
- start = 0;
- }
- if (stop < 0)
- stop += length;
- else if (stop > length)
- stop = length;
- *_length = stop - start;
- *_start = start;
- *_stop = stop;
-}
-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** restrict src, PyObject** restrict dest, Py_ssize_t length) {
-#else
-static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** src, PyObject** dest, Py_ssize_t length) {
-#endif
- PyObject *v;
- Py_ssize_t i;
- for (i = 0; i < length; i++) {
- v = dest[i] = src[i];
- Py_INCREF(v);
- }
-}
-static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
- PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
- PyObject* dest;
- Py_ssize_t length = PyList_GET_SIZE(src);
- __Pyx_crop_slice(&start, &stop, &length);
- if (unlikely(length <= 0))
- return PyList_New(0);
- dest = PyList_New(length);
- if (unlikely(!dest))
- return NULL;
- __Pyx_copy_object_array(
- ((PyListObject*)src)->ob_item + start,
- ((PyListObject*)dest)->ob_item,
- length);
- return dest;
-}
-static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
- PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
- PyObject* dest;
- Py_ssize_t length = PyTuple_GET_SIZE(src);
- __Pyx_crop_slice(&start, &stop, &length);
- if (unlikely(length <= 0))
- return PyTuple_New(0);
- dest = PyTuple_New(length);
- if (unlikely(!dest))
- return NULL;
- __Pyx_copy_object_array(
- ((PyTupleObject*)src)->ob_item + start,
- ((PyTupleObject*)dest)->ob_item,
- length);
- return dest;
-}
-#endif
-
-static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
- PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
- if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Format(PyExc_ImportError,
- #if PY_MAJOR_VERSION < 3
- "cannot import name %.230s", PyString_AS_STRING(name));
- #else
- "cannot import name %S", name);
- #endif
- }
- return value;
-}
-
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
- int r;
- if (!j) return -1;
- r = PyObject_SetItem(o, j, v);
- Py_DECREF(j);
- return r;
-}
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
- int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (is_list || PyList_CheckExact(o)) {
- Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
- if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
- PyObject* old = PyList_GET_ITEM(o, n);
- Py_INCREF(v);
- PyList_SET_ITEM(o, n, v);
- Py_DECREF(old);
- return 1;
- }
- } else {
- PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
- if (likely(m && m->sq_ass_item)) {
- if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
- Py_ssize_t l = m->sq_length(o);
- if (likely(l >= 0)) {
- i += l;
- } else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
- return -1;
- }
- }
- return m->sq_ass_item(o, i, v);
- }
- }
-#else
-#if CYTHON_COMPILING_IN_PYPY
- if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
-#else
- if (is_list || PySequence_Check(o)) {
-#endif
- return PySequence_SetItem(o, i, v);
- }
-#endif
- return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
-}
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
- *type = tstate->exc_type;
- *value = tstate->exc_value;
- *tb = tstate->exc_traceback;
- Py_XINCREF(*type);
- Py_XINCREF(*value);
- Py_XINCREF(*tb);
-#else
- PyErr_GetExcInfo(type, value, tb);
-#endif
-}
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = type;
- tstate->exc_value = value;
- tstate->exc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(type, value, tb);
-#endif
-}
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
- PyObject *empty_list = 0;
- PyObject *module = 0;
- PyObject *global_dict = 0;
- PyObject *empty_dict = 0;
- PyObject *list;
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_import;
- py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s____import__);
- if (!py_import)
- goto bad;
- #endif
- 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;
- #if PY_VERSION_HEX >= 0x02050000
- {
- #if PY_MAJOR_VERSION >= 3
- if (level == -1) {
- if (strchr(__Pyx_MODULE_NAME, '.')) {
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_level = PyInt_FromLong(1);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, 1);
- #endif
- if (!module) {
- if (!PyErr_ExceptionMatches(PyExc_ImportError))
- goto bad;
- PyErr_Clear();
- }
- }
- level = 0; /* try absolute import on failure */
- }
- #endif
- if (!module) {
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_level = PyInt_FromLong(level);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, level);
- #endif
- }
- }
- #else
- if (level>0) {
- PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
- goto bad;
- }
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, NULL);
- #endif
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
-}
-
-static CYTHON_INLINE npy_intp __Pyx_PyInt_from_py_npy_intp(PyObject* x) {
- const npy_intp neg_one = (npy_intp)-1, const_zero = (npy_intp)0;
- const int is_unsigned = const_zero < neg_one;
- if (sizeof(npy_intp) == sizeof(char)) {
- if (is_unsigned)
- return (npy_intp)__Pyx_PyInt_AsUnsignedChar(x);
- else
- return (npy_intp)__Pyx_PyInt_AsSignedChar(x);
- } else if (sizeof(npy_intp) == sizeof(short)) {
- if (is_unsigned)
- return (npy_intp)__Pyx_PyInt_AsUnsignedShort(x);
- else
- return (npy_intp)__Pyx_PyInt_AsSignedShort(x);
- } else if (sizeof(npy_intp) == sizeof(int)) {
- if (is_unsigned)
- return (npy_intp)__Pyx_PyInt_AsUnsignedInt(x);
- else
- return (npy_intp)__Pyx_PyInt_AsSignedInt(x);
- } else if (sizeof(npy_intp) == sizeof(long)) {
- if (is_unsigned)
- return (npy_intp)__Pyx_PyInt_AsUnsignedLong(x);
- else
- return (npy_intp)__Pyx_PyInt_AsSignedLong(x);
- } else if (sizeof(npy_intp) == sizeof(PY_LONG_LONG)) {
- if (is_unsigned)
- return (npy_intp)__Pyx_PyInt_AsUnsignedLongLong(x);
- else
- return (npy_intp)__Pyx_PyInt_AsSignedLongLong(x);
- } else {
- #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
- PyErr_SetString(PyExc_RuntimeError,
- "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
- #else
- npy_intp val;
- PyObject *v = __Pyx_PyNumber_Int(x);
- #if PY_MAJOR_VERSION < 3
- if (likely(v) && !PyLong_Check(v)) {
- PyObject *tmp = v;
- v = PyNumber_Long(tmp);
- Py_DECREF(tmp);
- }
- #endif
- if (likely(v)) {
- int one = 1; int is_little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- int ret = _PyLong_AsByteArray((PyLongObject *)v,
- bytes, sizeof(val),
- is_little, !is_unsigned);
- Py_DECREF(v);
- if (likely(!ret))
- return val;
- }
- #endif
- return (npy_intp)-1;
- }
-}
-
-static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) {
- const npy_intp neg_one = (npy_intp)-1, const_zero = (npy_intp)0;
- const int is_unsigned = const_zero < neg_one;
- if ((sizeof(npy_intp) == sizeof(char)) ||
- (sizeof(npy_intp) == sizeof(short))) {
- return PyInt_FromLong((long)val);
- } else if ((sizeof(npy_intp) == sizeof(int)) ||
- (sizeof(npy_intp) == sizeof(long))) {
- if (is_unsigned)
- return PyLong_FromUnsignedLong((unsigned long)val);
- else
- return PyInt_FromLong((long)val);
- } else if (sizeof(npy_intp) == sizeof(PY_LONG_LONG)) {
- if (is_unsigned)
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
- else
- return PyLong_FromLongLong((PY_LONG_LONG)val);
- } else {
- int one = 1; int little = (int)*(unsigned char *)&one;
- unsigned char *bytes = (unsigned char *)&val;
- return _PyLong_FromByteArray(bytes, sizeof(npy_intp),
- little, !is_unsigned);
- }
-}
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
- const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned char" :
- "value too large to convert to unsigned char");
- }
- return (unsigned char)-1;
- }
- return (unsigned char)val;
- }
- return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
- const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned short" :
- "value too large to convert to unsigned short");
- }
- return (unsigned short)-1;
- }
- return (unsigned short)val;
- }
- return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
- const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned int" :
- "value too large to convert to unsigned int");
- }
- return (unsigned int)-1;
- }
- return (unsigned int)val;
- }
- return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
- const char neg_one = (char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to char" :
- "value too large to convert to char");
- }
- return (char)-1;
- }
- return (char)val;
- }
- return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
- const short neg_one = (short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to short" :
- "value too large to convert to short");
- }
- return (short)-1;
- }
- return (short)val;
- }
- return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
- const int neg_one = (int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to int" :
- "value too large to convert to int");
- }
- return (int)-1;
- }
- return (int)val;
- }
- return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
- const signed char neg_one = (signed char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed char" :
- "value too large to convert to signed char");
- }
- return (signed char)-1;
- }
- return (signed char)val;
- }
- return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
- const signed short neg_one = (signed short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed short" :
- "value too large to convert to signed short");
- }
- return (signed short)-1;
- }
- return (signed short)val;
- }
- return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
- const signed int neg_one = (signed int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed int" :
- "value too large to convert to signed int");
- }
- return (signed int)-1;
- }
- return (signed int)val;
- }
- return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
- const int neg_one = (int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to int" :
- "value too large to convert to int");
- }
- return (int)-1;
- }
- return (int)val;
- }
- return (int)__Pyx_PyInt_AsLong(x);
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
- const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned long");
- return (unsigned long)-1;
- }
- return (unsigned long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned long");
- return (unsigned long)-1;
- }
- return (unsigned long)PyLong_AsUnsignedLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (unsigned long)PyLong_AsLong(x);
- }
- } else {
- unsigned long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (unsigned long)-1;
- val = __Pyx_PyInt_AsUnsignedLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
- const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned PY_LONG_LONG");
- return (unsigned PY_LONG_LONG)-1;
- }
- return (unsigned PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned PY_LONG_LONG");
- return (unsigned PY_LONG_LONG)-1;
- }
- return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
- }
- } else {
- unsigned PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (unsigned PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
- const long neg_one = (long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long)-1;
- }
- return (long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long)-1;
- }
- return (long)PyLong_AsUnsignedLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (long)PyLong_AsLong(x);
- }
- } else {
- long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (long)-1;
- val = __Pyx_PyInt_AsLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
- const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to PY_LONG_LONG");
- return (PY_LONG_LONG)-1;
- }
- return (PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to PY_LONG_LONG");
- return (PY_LONG_LONG)-1;
- }
- return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (PY_LONG_LONG)PyLong_AsLongLong(x);
- }
- } else {
- PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
- const signed long neg_one = (signed long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed long");
- return (signed long)-1;
- }
- return (signed long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed long");
- return (signed long)-1;
- }
- return (signed long)PyLong_AsUnsignedLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (signed long)PyLong_AsLong(x);
- }
- } else {
- signed long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (signed long)-1;
- val = __Pyx_PyInt_AsSignedLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
- const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed PY_LONG_LONG");
- return (signed PY_LONG_LONG)-1;
- }
- return (signed PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed PY_LONG_LONG");
- return (signed PY_LONG_LONG)-1;
- }
- return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
- }
- } else {
- signed PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (signed PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsSignedLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-static int __Pyx_check_binary_version(void) {
- char ctversion[4], rtversion[4];
- PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
- PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
- if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
- char message[200];
- PyOS_snprintf(message, sizeof(message),
- "compiletime version %s of module '%.100s' "
- "does not match runtime version %s",
- ctversion, __Pyx_MODULE_NAME, rtversion);
- #if PY_VERSION_HEX < 0x02050000
- return PyErr_Warn(NULL, message);
- #else
- return PyErr_WarnEx(NULL, message, 1);
- #endif
- }
- return 0;
-}
-
-#ifndef __PYX_HAVE_RT_ImportModule
-#define __PYX_HAVE_RT_ImportModule
-static PyObject *__Pyx_ImportModule(const char *name) {
- PyObject *py_name = 0;
- PyObject *py_module = 0;
- py_name = __Pyx_PyIdentifier_FromString(name);
- if (!py_name)
- goto bad;
- py_module = PyImport_Import(py_name);
- Py_DECREF(py_name);
- return py_module;
-bad:
- Py_XDECREF(py_name);
- return 0;
-}
-#endif
-
-#ifndef __PYX_HAVE_RT_ImportType
-#define __PYX_HAVE_RT_ImportType
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
- size_t size, int strict)
-{
- PyObject *py_module = 0;
- PyObject *result = 0;
- PyObject *py_name = 0;
- char warning[200];
- Py_ssize_t basicsize;
-#ifdef Py_LIMITED_API
- PyObject *py_basicsize;
-#endif
- py_module = __Pyx_ImportModule(module_name);
- if (!py_module)
- goto bad;
- py_name = __Pyx_PyIdentifier_FromString(class_name);
- if (!py_name)
- goto bad;
- result = PyObject_GetAttr(py_module, py_name);
- Py_DECREF(py_name);
- py_name = 0;
- Py_DECREF(py_module);
- py_module = 0;
- 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;
- }
-#ifndef Py_LIMITED_API
- basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
- py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
- if (!py_basicsize)
- goto bad;
- basicsize = PyLong_AsSsize_t(py_basicsize);
- Py_DECREF(py_basicsize);
- py_basicsize = 0;
- if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
- goto bad;
-#endif
- if (!strict && (size_t)basicsize > size) {
- PyOS_snprintf(warning, sizeof(warning),
- "%s.%s size changed, may indicate binary incompatibility",
- module_name, class_name);
- #if PY_VERSION_HEX < 0x02050000
- if (PyErr_Warn(NULL, warning) < 0) goto bad;
- #else
- if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
- #endif
- }
- else if ((size_t)basicsize != size) {
- PyErr_Format(PyExc_ValueError,
- "%s.%s has the wrong size, try recompiling",
- module_name, class_name);
- goto bad;
- }
- return (PyTypeObject *)result;
-bad:
- Py_XDECREF(py_module);
- Py_XDECREF(result);
- return NULL;
-}
-#endif
-
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
- int start = 0, mid = 0, end = count - 1;
- if (end >= 0 && code_line > entries[end].code_line) {
- return count;
- }
- while (start < end) {
- mid = (start + end) / 2;
- if (code_line < entries[mid].code_line) {
- end = mid;
- } else if (code_line > entries[mid].code_line) {
- start = mid + 1;
- } else {
- return mid;
- }
- }
- if (code_line <= entries[mid].code_line) {
- return mid;
- } else {
- return mid + 1;
- }
-}
-static PyCodeObject *__pyx_find_code_object(int code_line) {
- PyCodeObject* code_object;
- int pos;
- if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
- return NULL;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
- return NULL;
- }
- code_object = __pyx_code_cache.entries[pos].code_object;
- Py_INCREF(code_object);
- return code_object;
-}
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
- int pos, i;
- __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
- if (unlikely(!code_line)) {
- return;
- }
- if (unlikely(!entries)) {
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
- if (likely(entries)) {
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = 64;
- __pyx_code_cache.count = 1;
- entries[0].code_line = code_line;
- entries[0].code_object = code_object;
- Py_INCREF(code_object);
- }
- return;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
- PyCodeObject* tmp = entries[pos].code_object;
- entries[pos].code_object = code_object;
- Py_DECREF(tmp);
- return;
- }
- if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
- int new_max = __pyx_code_cache.max_count + 64;
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
- __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
- if (unlikely(!entries)) {
- return;
- }
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = new_max;
- }
- for (i=__pyx_code_cache.count; i>pos; i--) {
- entries[i] = entries[i-1];
- }
- entries[pos].code_line = code_line;
- entries[pos].code_object = code_object;
- __pyx_code_cache.count++;
- Py_INCREF(code_object);
-}
-
-#include "compile.h"
-#include "frameobject.h"
-#include "traceback.h"
-static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
- const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = 0;
- PyObject *py_srcfile = 0;
- PyObject *py_funcname = 0;
- #if PY_MAJOR_VERSION < 3
- py_srcfile = PyString_FromString(filename);
- #else
- py_srcfile = PyUnicode_FromString(filename);
- #endif
- if (!py_srcfile) goto bad;
- if (c_line) {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- #else
- py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- #endif
- }
- else {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromString(funcname);
- #else
- py_funcname = PyUnicode_FromString(funcname);
- #endif
- }
- if (!py_funcname) goto bad;
- py_code = __Pyx_PyCode_New(
- 0, /*int argcount,*/
- 0, /*int kwonlyargcount,*/
- 0, /*int nlocals,*/
- 0, /*int stacksize,*/
- 0, /*int flags,*/
- __pyx_empty_bytes, /*PyObject *code,*/
- __pyx_empty_tuple, /*PyObject *consts,*/
- __pyx_empty_tuple, /*PyObject *names,*/
- __pyx_empty_tuple, /*PyObject *varnames,*/
- __pyx_empty_tuple, /*PyObject *freevars,*/
- __pyx_empty_tuple, /*PyObject *cellvars,*/
- py_srcfile, /*PyObject *filename,*/
- py_funcname, /*PyObject *name,*/
- py_line, /*int firstlineno,*/
- __pyx_empty_bytes /*PyObject *lnotab*/
- );
- Py_DECREF(py_srcfile);
- Py_DECREF(py_funcname);
- return py_code;
-bad:
- Py_XDECREF(py_srcfile);
- Py_XDECREF(py_funcname);
- return NULL;
-}
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = 0;
- PyObject *py_globals = 0;
- PyFrameObject *py_frame = 0;
- py_code = __pyx_find_code_object(c_line ? c_line : py_line);
- if (!py_code) {
- py_code = __Pyx_CreateCodeObjectForTraceback(
- funcname, c_line, py_line, filename);
- if (!py_code) goto bad;
- __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
- }
- py_globals = PyModule_GetDict(__pyx_m);
- if (!py_globals) 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 = py_line;
- PyTraceBack_Here(py_frame);
-bad:
- Py_XDECREF(py_code);
- Py_XDECREF(py_frame);
-}
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
- while (t->p) {
- #if PY_MAJOR_VERSION < 3
- if (t->is_unicode) {
- *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
- } else if (t->intern) {
- *t->p = PyString_InternFromString(t->s);
- } else {
- *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
- }
- #else /* Python 3+ has unicode identifiers */
- if (t->is_unicode | t->is_str) {
- if (t->intern) {
- *t->p = PyUnicode_InternFromString(t->s);
- } else if (t->encoding) {
- *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
- } else {
- *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
- }
- } else {
- *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
- }
- #endif
- if (!*t->p)
- return -1;
- ++t;
- }
- return 0;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
- return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
- Py_ssize_t ignore;
- return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
- if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
- PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
- char* defenc_c;
- PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
- if (!defenc) return NULL;
- defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- {
- char* end = defenc_c + PyBytes_GET_SIZE(defenc);
- char* c;
- for (c = defenc_c; c < end; c++) {
- if ((unsigned char) (*c) >= 128) {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
- }
- }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
- *length = PyBytes_GET_SIZE(defenc);
- return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
- if (PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- if (PyUnicode_IS_ASCII(o)) {
- *length = PyUnicode_GET_DATA_SIZE(o);
- return PyUnicode_AsUTF8(o);
- } else {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
- return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
- } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
- {
- char* result;
- int r = PyBytes_AsStringAndSize(o, &result, length);
- if (r < 0) {
- return NULL;
- } else {
- return result;
- }
- }
-}
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
- int is_true = x == Py_True;
- if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
- else return PyObject_IsTrue(x);
-}
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
- PyNumberMethods *m;
- const char *name = NULL;
- PyObject *res = NULL;
-#if PY_MAJOR_VERSION < 3
- if (PyInt_Check(x) || PyLong_Check(x))
-#else
- if (PyLong_Check(x))
-#endif
- return Py_INCREF(x), x;
- m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Int(x);
- }
- else if (m && m->nb_long) {
- name = "long";
- res = PyNumber_Long(x);
- }
-#else
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Long(x);
- }
-#endif
- if (res) {
-#if PY_MAJOR_VERSION < 3
- if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
- if (!PyLong_Check(res)) {
-#endif
- PyErr_Format(PyExc_TypeError,
- "__%s__ returned non-%s (type %.200s)",
- name, name, Py_TYPE(res)->tp_name);
- Py_DECREF(res);
- return NULL;
- }
- }
- else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError,
- "an integer is required");
- }
- return res;
-}
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
- Py_ssize_t ival;
- PyObject* x = PyNumber_Index(b);
- if (!x) return -1;
- ival = PyInt_AsSsize_t(x);
- Py_DECREF(x);
- return ival;
-}
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
-#if PY_VERSION_HEX < 0x02050000
- if (ival <= LONG_MAX)
- return PyInt_FromLong((long)ival);
- else {
- unsigned char *bytes = (unsigned char *) &ival;
- int one = 1; int little = (int)*(unsigned char*)&one;
- return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
- }
-#else
- return PyInt_FromSize_t(ival);
-#endif
-}
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
- unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
- if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
- if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred())
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to size_t");
- return (size_t)-1;
- }
- return (size_t)val;
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx
index 84b52079d..55138cba7 100644
--- a/numpy/random/mtrand/mtrand.pyx
+++ b/numpy/random/mtrand/mtrand.pyx
@@ -55,65 +55,66 @@ cdef extern from "randomkit.h":
void rk_seed(unsigned long seed, rk_state *state)
rk_error rk_randomseed(rk_state *state)
unsigned long rk_random(rk_state *state)
- long rk_long(rk_state *state)
- unsigned long rk_ulong(rk_state *state)
- unsigned long rk_interval(unsigned long max, rk_state *state)
- double rk_double(rk_state *state)
- void rk_fill(void *buffer, size_t size, rk_state *state)
+ long rk_long(rk_state *state) nogil
+ unsigned long rk_ulong(rk_state *state) nogil
+ unsigned long rk_interval(unsigned long max, rk_state *state) nogil
+ double rk_double(rk_state *state) nogil
+ void rk_fill(void *buffer, size_t size, rk_state *state) nogil
rk_error rk_devfill(void *buffer, size_t size, int strong)
rk_error rk_altfill(void *buffer, size_t size, int strong,
- rk_state *state)
- double rk_gauss(rk_state *state)
+ rk_state *state) nogil
+ double rk_gauss(rk_state *state) nogil
cdef extern from "distributions.h":
-
- double rk_normal(rk_state *state, double loc, double scale)
- double rk_standard_exponential(rk_state *state)
- double rk_exponential(rk_state *state, double scale)
- double rk_uniform(rk_state *state, double loc, double scale)
- double rk_standard_gamma(rk_state *state, double shape)
- double rk_gamma(rk_state *state, double shape, double scale)
- double rk_beta(rk_state *state, double a, double b)
- double rk_chisquare(rk_state *state, double df)
- double rk_noncentral_chisquare(rk_state *state, double df, double nonc)
- double rk_f(rk_state *state, double dfnum, double dfden)
- double rk_noncentral_f(rk_state *state, double dfnum, double dfden, double nonc)
- double rk_standard_cauchy(rk_state *state)
- double rk_standard_t(rk_state *state, double df)
- double rk_vonmises(rk_state *state, double mu, double kappa)
- double rk_pareto(rk_state *state, double a)
- double rk_weibull(rk_state *state, double a)
- double rk_power(rk_state *state, double a)
- double rk_laplace(rk_state *state, double loc, double scale)
- double rk_gumbel(rk_state *state, double loc, double scale)
- double rk_logistic(rk_state *state, double loc, double scale)
- double rk_lognormal(rk_state *state, double mode, double sigma)
- double rk_rayleigh(rk_state *state, double mode)
- double rk_wald(rk_state *state, double mean, double scale)
- double rk_triangular(rk_state *state, double left, double mode, double right)
-
- 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, 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)
- long rk_zipf(rk_state *state, double a)
- long rk_geometric(rk_state *state, double p)
- long rk_hypergeometric(rk_state *state, long good, long bad, long sample)
- long rk_logseries(rk_state *state, double p)
-
-ctypedef double (* rk_cont0)(rk_state *state)
-ctypedef double (* rk_cont1)(rk_state *state, double a)
-ctypedef double (* rk_cont2)(rk_state *state, double a, double b)
-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)
+ # do not need the GIL, but they do need a lock on the state !! */
+
+ double rk_normal(rk_state *state, double loc, double scale) nogil
+ double rk_standard_exponential(rk_state *state) nogil
+ double rk_exponential(rk_state *state, double scale) nogil
+ double rk_uniform(rk_state *state, double loc, double scale) nogil
+ double rk_standard_gamma(rk_state *state, double shape) nogil
+ double rk_gamma(rk_state *state, double shape, double scale) nogil
+ double rk_beta(rk_state *state, double a, double b) nogil
+ double rk_chisquare(rk_state *state, double df) nogil
+ double rk_noncentral_chisquare(rk_state *state, double df, double nonc) nogil
+ double rk_f(rk_state *state, double dfnum, double dfden) nogil
+ double rk_noncentral_f(rk_state *state, double dfnum, double dfden, double nonc) nogil
+ double rk_standard_cauchy(rk_state *state) nogil
+ double rk_standard_t(rk_state *state, double df) nogil
+ double rk_vonmises(rk_state *state, double mu, double kappa) nogil
+ double rk_pareto(rk_state *state, double a) nogil
+ double rk_weibull(rk_state *state, double a) nogil
+ double rk_power(rk_state *state, double a) nogil
+ double rk_laplace(rk_state *state, double loc, double scale) nogil
+ double rk_gumbel(rk_state *state, double loc, double scale) nogil
+ double rk_logistic(rk_state *state, double loc, double scale) nogil
+ double rk_lognormal(rk_state *state, double mode, double sigma) nogil
+ double rk_rayleigh(rk_state *state, double mode) nogil
+ double rk_wald(rk_state *state, double mean, double scale) nogil
+ double rk_triangular(rk_state *state, double left, double mode, double right) nogil
+
+ long rk_binomial(rk_state *state, long n, double p) nogil
+ long rk_binomial_btpe(rk_state *state, long n, double p) nogil
+ long rk_binomial_inversion(rk_state *state, long n, double p) nogil
+ long rk_negative_binomial(rk_state *state, double n, double p) nogil
+ long rk_poisson(rk_state *state, double lam) nogil
+ long rk_poisson_mult(rk_state *state, double lam) nogil
+ long rk_poisson_ptrs(rk_state *state, double lam) nogil
+ long rk_zipf(rk_state *state, double a) nogil
+ long rk_geometric(rk_state *state, double p) nogil
+ long rk_hypergeometric(rk_state *state, long good, long bad, long sample) nogil
+ long rk_logseries(rk_state *state, double p) nogil
+
+ctypedef double (* rk_cont0)(rk_state *state) nogil
+ctypedef double (* rk_cont1)(rk_state *state, double a) nogil
+ctypedef double (* rk_cont2)(rk_state *state, double a, double b) nogil
+ctypedef double (* rk_cont3)(rk_state *state, double a, double b, double c) nogil
+
+ctypedef long (* rk_disc0)(rk_state *state) nogil
+ctypedef long (* rk_discnp)(rk_state *state, long n, double p) nogil
+ctypedef long (* rk_discdd)(rk_state *state, double n, double p) nogil
+ctypedef long (* rk_discnmN)(rk_state *state, long n, long m, long N) nogil
+ctypedef long (* rk_discd)(rk_state *state, double a) nogil
cdef extern from "initarray.h":
@@ -125,8 +126,11 @@ import_array()
import numpy as np
import operator
+import warnings
+from threading import Lock
-cdef object cont0_array(rk_state *state, rk_cont0 func, object size):
+cdef object cont0_array(rk_state *state, rk_cont0 func, object size,
+ object lock):
cdef double *array_data
cdef ndarray array "arrayObject"
cdef npy_intp length
@@ -138,12 +142,14 @@ cdef object cont0_array(rk_state *state, rk_cont0 func, object size):
array = <ndarray>np.empty(size, np.float64)
length = PyArray_SIZE(array)
array_data = <double *>PyArray_DATA(array)
- for i from 0 <= i < length:
- array_data[i] = func(state)
+ with lock, nogil:
+ for i from 0 <= i < length:
+ array_data[i] = func(state)
return array
-cdef object cont1_array_sc(rk_state *state, rk_cont1 func, object size, double a):
+cdef object cont1_array_sc(rk_state *state, rk_cont1 func, object size, double a,
+ object lock):
cdef double *array_data
cdef ndarray array "arrayObject"
cdef npy_intp length
@@ -155,11 +161,13 @@ cdef object cont1_array_sc(rk_state *state, rk_cont1 func, object size, double a
array = <ndarray>np.empty(size, np.float64)
length = PyArray_SIZE(array)
array_data = <double *>PyArray_DATA(array)
- for i from 0 <= i < length:
- array_data[i] = func(state, a)
+ with lock, nogil:
+ for i from 0 <= i < length:
+ array_data[i] = func(state, a)
return array
-cdef object cont1_array(rk_state *state, rk_cont1 func, object size, ndarray oa):
+cdef object cont1_array(rk_state *state, rk_cont1 func, object size,
+ ndarray oa, object lock):
cdef double *array_data
cdef double *oa_data
cdef ndarray array "arrayObject"
@@ -174,9 +182,10 @@ cdef object cont1_array(rk_state *state, rk_cont1 func, object size, ndarray oa)
length = PyArray_SIZE(array)
array_data = <double *>PyArray_DATA(array)
itera = <flatiter>PyArray_IterNew(<object>oa)
- for i from 0 <= i < length:
- array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- PyArray_ITER_NEXT(itera)
+ with lock, nogil:
+ for i from 0 <= i < length:
+ array_data[i] = func(state, (<double *>(itera.dataptr))[0])
+ PyArray_ITER_NEXT(itera)
else:
array = <ndarray>np.empty(size, np.float64)
array_data = <double *>PyArray_DATA(array)
@@ -184,14 +193,15 @@ cdef object cont1_array(rk_state *state, rk_cont1 func, object size, ndarray oa)
<void *>oa)
if (multi.size != PyArray_SIZE(array)):
raise ValueError("size is not compatible with inputs")
- for i from 0 <= i < multi.size:
- oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- array_data[i] = func(state, oa_data[0])
- PyArray_MultiIter_NEXTi(multi, 1)
+ with lock, nogil:
+ for i from 0 <= i < multi.size:
+ oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
+ array_data[i] = func(state, oa_data[0])
+ PyArray_MultiIter_NEXTi(multi, 1)
return array
cdef object cont2_array_sc(rk_state *state, rk_cont2 func, object size, double a,
- double b):
+ double b, object lock):
cdef double *array_data
cdef ndarray array "arrayObject"
cdef npy_intp length
@@ -203,13 +213,14 @@ cdef object cont2_array_sc(rk_state *state, rk_cont2 func, object size, double a
array = <ndarray>np.empty(size, np.float64)
length = PyArray_SIZE(array)
array_data = <double *>PyArray_DATA(array)
- for i from 0 <= i < length:
- array_data[i] = func(state, a, b)
+ with lock, nogil:
+ for i from 0 <= i < length:
+ array_data[i] = func(state, a, b)
return array
cdef object cont2_array(rk_state *state, rk_cont2 func, object size,
- ndarray oa, ndarray ob):
+ ndarray oa, ndarray ob, object lock):
cdef double *array_data
cdef double *oa_data
cdef double *ob_data
@@ -222,27 +233,29 @@ cdef object cont2_array(rk_state *state, rk_cont2 func, object size,
multi = <broadcast> PyArray_MultiIterNew(2, <void *>oa, <void *>ob)
array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
array_data = <double *>PyArray_DATA(array)
- for i from 0 <= i < multi.size:
- oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- array_data[i] = func(state, oa_data[0], ob_data[0])
- PyArray_MultiIter_NEXT(multi)
+ with lock, nogil:
+ for i from 0 <= i < multi.size:
+ oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
+ ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
+ array_data[i] = func(state, oa_data[0], ob_data[0])
+ PyArray_MultiIter_NEXT(multi)
else:
array = <ndarray>np.empty(size, np.float64)
array_data = <double *>PyArray_DATA(array)
multi = <broadcast>PyArray_MultiIterNew(3, <void*>array, <void *>oa, <void *>ob)
if (multi.size != PyArray_SIZE(array)):
raise ValueError("size is not compatible with inputs")
- for i from 0 <= i < multi.size:
- oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- array_data[i] = func(state, oa_data[0], ob_data[0])
- PyArray_MultiIter_NEXTi(multi, 1)
- PyArray_MultiIter_NEXTi(multi, 2)
+ with lock, nogil:
+ for i from 0 <= i < multi.size:
+ oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
+ ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
+ array_data[i] = func(state, oa_data[0], ob_data[0])
+ PyArray_MultiIter_NEXTi(multi, 1)
+ PyArray_MultiIter_NEXTi(multi, 2)
return array
cdef object cont3_array_sc(rk_state *state, rk_cont3 func, object size, double a,
- double b, double c):
+ double b, double c, object lock):
cdef double *array_data
cdef ndarray array "arrayObject"
@@ -255,12 +268,13 @@ cdef object cont3_array_sc(rk_state *state, rk_cont3 func, object size, double a
array = <ndarray>np.empty(size, np.float64)
length = PyArray_SIZE(array)
array_data = <double *>PyArray_DATA(array)
- for i from 0 <= i < length:
- array_data[i] = func(state, a, b, c)
+ with lock, nogil:
+ for i from 0 <= i < length:
+ array_data[i] = func(state, a, b, c)
return array
-cdef object cont3_array(rk_state *state, rk_cont3 func, object size, ndarray oa,
- ndarray ob, ndarray oc):
+cdef object cont3_array(rk_state *state, rk_cont3 func, object size,
+ ndarray oa, ndarray ob, ndarray oc, object lock):
cdef double *array_data
cdef double *oa_data
@@ -275,12 +289,13 @@ cdef object cont3_array(rk_state *state, rk_cont3 func, object size, ndarray oa,
multi = <broadcast> PyArray_MultiIterNew(3, <void *>oa, <void *>ob, <void *>oc)
array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_DOUBLE)
array_data = <double *>PyArray_DATA(array)
- for i from 0 <= i < multi.size:
- oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
- ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- oc_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- PyArray_MultiIter_NEXT(multi)
+ with lock, nogil:
+ for i from 0 <= i < multi.size:
+ oa_data = <double *>PyArray_MultiIter_DATA(multi, 0)
+ ob_data = <double *>PyArray_MultiIter_DATA(multi, 1)
+ oc_data = <double *>PyArray_MultiIter_DATA(multi, 2)
+ array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
+ PyArray_MultiIter_NEXT(multi)
else:
array = <ndarray>np.empty(size, np.float64)
array_data = <double *>PyArray_DATA(array)
@@ -288,15 +303,16 @@ cdef object cont3_array(rk_state *state, rk_cont3 func, object size, ndarray oa,
<void *>ob, <void *>oc)
if (multi.size != PyArray_SIZE(array)):
raise ValueError("size is not compatible with inputs")
- for i from 0 <= i < multi.size:
- oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
- oc_data = <double *>PyArray_MultiIter_DATA(multi, 3)
- array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
- PyArray_MultiIter_NEXT(multi)
+ with lock, nogil:
+ for i from 0 <= i < multi.size:
+ oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
+ ob_data = <double *>PyArray_MultiIter_DATA(multi, 2)
+ oc_data = <double *>PyArray_MultiIter_DATA(multi, 3)
+ array_data[i] = func(state, oa_data[0], ob_data[0], oc_data[0])
+ PyArray_MultiIter_NEXT(multi)
return array
-cdef object disc0_array(rk_state *state, rk_disc0 func, object size):
+cdef object disc0_array(rk_state *state, rk_disc0 func, object size, object lock):
cdef long *array_data
cdef ndarray array "arrayObject"
cdef npy_intp length
@@ -308,11 +324,13 @@ cdef object disc0_array(rk_state *state, rk_disc0 func, object size):
array = <ndarray>np.empty(size, int)
length = PyArray_SIZE(array)
array_data = <long *>PyArray_DATA(array)
- for i from 0 <= i < length:
- array_data[i] = func(state)
+ with lock, nogil:
+ for i from 0 <= i < length:
+ array_data[i] = func(state)
return array
-cdef object discnp_array_sc(rk_state *state, rk_discnp func, object size, long n, double p):
+cdef object discnp_array_sc(rk_state *state, rk_discnp func, object size,
+ long n, double p, object lock):
cdef long *array_data
cdef ndarray array "arrayObject"
cdef npy_intp length
@@ -324,11 +342,13 @@ cdef object discnp_array_sc(rk_state *state, rk_discnp func, object size, long n
array = <ndarray>np.empty(size, int)
length = PyArray_SIZE(array)
array_data = <long *>PyArray_DATA(array)
- for i from 0 <= i < length:
- array_data[i] = func(state, n, p)
+ with lock, nogil:
+ for i from 0 <= i < length:
+ array_data[i] = func(state, n, p)
return array
-cdef object discnp_array(rk_state *state, rk_discnp func, object size, ndarray on, ndarray op):
+cdef object discnp_array(rk_state *state, rk_discnp func, object size,
+ ndarray on, ndarray op, object lock):
cdef long *array_data
cdef ndarray array "arrayObject"
cdef npy_intp length
@@ -341,27 +361,30 @@ cdef object discnp_array(rk_state *state, rk_discnp func, object size, ndarray o
multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op)
array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
array_data = <long *>PyArray_DATA(array)
- for i from 0 <= i < multi.size:
- on_data = <long *>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)
+ with lock, nogil:
+ for i from 0 <= i < multi.size:
+ on_data = <long *>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 *>PyArray_DATA(array)
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 = <long *>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)
+ with lock, nogil:
+ for i from 0 <= i < multi.size:
+ on_data = <long *>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 discdd_array_sc(rk_state *state, rk_discdd func, object size, double n, double p):
+cdef object discdd_array_sc(rk_state *state, rk_discdd func, object size,
+ double n, double p, object lock):
cdef long *array_data
cdef ndarray array "arrayObject"
cdef npy_intp length
@@ -373,11 +396,13 @@ cdef object discdd_array_sc(rk_state *state, rk_discdd func, object size, double
array = <ndarray>np.empty(size, int)
length = PyArray_SIZE(array)
array_data = <long *>PyArray_DATA(array)
- for i from 0 <= i < length:
- array_data[i] = func(state, n, p)
+ with lock, nogil:
+ 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 object discdd_array(rk_state *state, rk_discdd func, object size,
+ ndarray on, ndarray op, object lock):
cdef long *array_data
cdef ndarray array "arrayObject"
cdef npy_intp length
@@ -390,28 +415,30 @@ cdef object discdd_array(rk_state *state, rk_discdd func, object size, ndarray o
multi = <broadcast> PyArray_MultiIterNew(2, <void *>on, <void *>op)
array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
array_data = <long *>PyArray_DATA(array)
- 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)
+ with lock, nogil:
+ 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 *>PyArray_DATA(array)
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)
+ with lock, nogil:
+ 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):
+ long n, long m, long N, object lock):
cdef long *array_data
cdef ndarray array "arrayObject"
cdef npy_intp length
@@ -423,12 +450,13 @@ cdef object discnmN_array_sc(rk_state *state, rk_discnmN func, object size,
array = <ndarray>np.empty(size, int)
length = PyArray_SIZE(array)
array_data = <long *>PyArray_DATA(array)
- for i from 0 <= i < length:
- array_data[i] = func(state, n, m, N)
+ with lock, nogil:
+ for i from 0 <= i < length:
+ array_data[i] = func(state, n, m, N)
return array
cdef object discnmN_array(rk_state *state, rk_discnmN func, object size,
- ndarray on, ndarray om, ndarray oN):
+ ndarray on, ndarray om, ndarray oN, object lock):
cdef long *array_data
cdef long *on_data
cdef long *om_data
@@ -442,12 +470,13 @@ cdef object discnmN_array(rk_state *state, rk_discnmN func, object size,
multi = <broadcast> PyArray_MultiIterNew(3, <void *>on, <void *>om, <void *>oN)
array = <ndarray> PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG)
array_data = <long *>PyArray_DATA(array)
- for i from 0 <= i < multi.size:
- on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
- om_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- oN_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- PyArray_MultiIter_NEXT(multi)
+ with lock, nogil:
+ for i from 0 <= i < multi.size:
+ on_data = <long *>PyArray_MultiIter_DATA(multi, 0)
+ om_data = <long *>PyArray_MultiIter_DATA(multi, 1)
+ oN_data = <long *>PyArray_MultiIter_DATA(multi, 2)
+ array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
+ PyArray_MultiIter_NEXT(multi)
else:
array = <ndarray>np.empty(size, int)
array_data = <long *>PyArray_DATA(array)
@@ -455,16 +484,18 @@ cdef object discnmN_array(rk_state *state, rk_discnmN func, object size,
<void *>oN)
if (multi.size != PyArray_SIZE(array)):
raise ValueError("size is not compatible with inputs")
- for i from 0 <= i < multi.size:
- on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
- om_data = <long *>PyArray_MultiIter_DATA(multi, 2)
- oN_data = <long *>PyArray_MultiIter_DATA(multi, 3)
- array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
- PyArray_MultiIter_NEXT(multi)
+ with lock, nogil:
+ for i from 0 <= i < multi.size:
+ on_data = <long *>PyArray_MultiIter_DATA(multi, 1)
+ om_data = <long *>PyArray_MultiIter_DATA(multi, 2)
+ oN_data = <long *>PyArray_MultiIter_DATA(multi, 3)
+ array_data[i] = func(state, on_data[0], om_data[0], oN_data[0])
+ PyArray_MultiIter_NEXT(multi)
return array
-cdef object discd_array_sc(rk_state *state, rk_discd func, object size, double a):
+cdef object discd_array_sc(rk_state *state, rk_discd func, object size,
+ double a, object lock):
cdef long *array_data
cdef ndarray array "arrayObject"
cdef npy_intp length
@@ -476,11 +507,13 @@ cdef object discd_array_sc(rk_state *state, rk_discd func, object size, double a
array = <ndarray>np.empty(size, int)
length = PyArray_SIZE(array)
array_data = <long *>PyArray_DATA(array)
- for i from 0 <= i < length:
- array_data[i] = func(state, a)
+ with lock, nogil:
+ for i from 0 <= i < length:
+ array_data[i] = func(state, a)
return array
-cdef object discd_array(rk_state *state, rk_discd func, object size, ndarray oa):
+cdef object discd_array(rk_state *state, rk_discd func, object size, ndarray oa,
+ object lock):
cdef long *array_data
cdef double *oa_data
cdef ndarray array "arrayObject"
@@ -495,19 +528,21 @@ cdef object discd_array(rk_state *state, rk_discd func, object size, ndarray oa)
length = PyArray_SIZE(array)
array_data = <long *>PyArray_DATA(array)
itera = <flatiter>PyArray_IterNew(<object>oa)
- for i from 0 <= i < length:
- array_data[i] = func(state, (<double *>(itera.dataptr))[0])
- PyArray_ITER_NEXT(itera)
+ with lock, nogil:
+ for i from 0 <= i < length:
+ array_data[i] = func(state, (<double *>(itera.dataptr))[0])
+ PyArray_ITER_NEXT(itera)
else:
array = <ndarray>np.empty(size, int)
array_data = <long *>PyArray_DATA(array)
multi = <broadcast>PyArray_MultiIterNew(2, <void *>array, <void *>oa)
if (multi.size != PyArray_SIZE(array)):
raise ValueError("size is not compatible with inputs")
- for i from 0 <= i < multi.size:
- oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
- array_data[i] = func(state, oa_data[0])
- PyArray_MultiIter_NEXTi(multi, 1)
+ with lock, nogil:
+ for i from 0 <= i < multi.size:
+ oa_data = <double *>PyArray_MultiIter_DATA(multi, 1)
+ array_data[i] = func(state, oa_data[0])
+ PyArray_MultiIter_NEXTi(multi, 1)
return array
cdef double kahan_sum(double *darr, npy_intp n):
@@ -522,6 +557,16 @@ cdef double kahan_sum(double *darr, npy_intp n):
sum = t
return sum
+def _shape_from_size(size, d):
+ if size is None:
+ shape = (d,)
+ else:
+ try:
+ shape = (operator.index(size), d)
+ except TypeError:
+ shape = tuple(size) + (d,)
+ return shape
+
cdef class RandomState:
"""
RandomState(seed=None)
@@ -556,12 +601,14 @@ cdef class RandomState:
"""
cdef rk_state *internal_state
+ cdef object lock
poisson_lam_max = np.iinfo('l').max - np.sqrt(np.iinfo('l').max)*10
def __init__(self, seed=None):
self.internal_state = <rk_state*>PyMem_Malloc(sizeof(rk_state))
self.seed(seed)
+ self.lock = Lock()
def __dealloc__(self):
if self.internal_state != NULL:
@@ -581,6 +628,7 @@ cdef class RandomState:
----------
seed : int or array_like, optional
Seed for `RandomState`.
+ Must be convertable to 32 bit unsigned integers.
See Also
--------
@@ -589,15 +637,19 @@ cdef class RandomState:
"""
cdef rk_error errcode
cdef ndarray obj "arrayObject_obj"
- if seed is None:
- errcode = rk_randomseed(self.internal_state)
- elif type(seed) is int:
- rk_seed(seed, self.internal_state)
- elif isinstance(seed, np.integer):
- iseed = int(seed)
- rk_seed(iseed, self.internal_state)
- else:
- obj = <ndarray>PyArray_ContiguousFromObject(seed, NPY_LONG, 1, 1)
+ try:
+ if seed is None:
+ errcode = rk_randomseed(self.internal_state)
+ else:
+ idx = operator.index(seed)
+ if idx > int(2**32 - 1) or idx < 0:
+ raise ValueError("Seed must be between 0 and 4294967295")
+ rk_seed(idx, self.internal_state)
+ except TypeError:
+ obj = np.asarray(seed).astype(np.int64, casting='safe')
+ if ((obj > int(2**32 - 1)) | (obj < 0)).any():
+ raise ValueError("Seed must be between 0 and 4294967295")
+ obj = obj.astype('L', casting='unsafe')
init_by_array(self.internal_state, <unsigned long *>PyArray_DATA(obj),
PyArray_DIM(obj, 0))
@@ -734,8 +786,9 @@ cdef class RandomState:
Parameters
----------
size : int or tuple of ints, optional
- Defines the shape of the returned array of random floats. If None
- (the default), returns a single float.
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -760,7 +813,7 @@ cdef class RandomState:
[-1.23204345, -1.75224494]])
"""
- return cont0_array(self.internal_state, rk_double, size)
+ return cont0_array(self.internal_state, rk_double, size, self.lock)
def tomaxint(self, size=None):
"""
@@ -773,10 +826,10 @@ cdef class RandomState:
Parameters
----------
- size : tuple of ints, int, optional
- Shape of output. If this is, for example, (m,n,k), m*n*k samples
- are generated. If no shape is specified, a single sample is
- returned.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -807,7 +860,7 @@ cdef class RandomState:
[ True, True]]], dtype=bool)
"""
- return disc0_array(self.internal_state, rk_long, size)
+ return disc0_array(self.internal_state, rk_long, size, self.lock)
def randint(self, low, high=None, size=None):
"""
@@ -829,8 +882,9 @@ cdef class RandomState:
If provided, one above the largest (signed) integer to be drawn
from the distribution (see above for behavior if ``high=None``).
size : int or tuple of ints, optional
- Output shape. Default is None, in which case a single int is
- returned.
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -884,9 +938,10 @@ cdef class RandomState:
array = <ndarray>np.empty(size, int)
length = PyArray_SIZE(array)
array_data = <long *>PyArray_DATA(array)
- for i from 0 <= i < length:
- rv = lo + <long>rk_interval(diff, self. internal_state)
- array_data[i] = rv
+ with self.lock, nogil:
+ for i from 0 <= i < length:
+ rv = lo + <long>rk_interval(diff, self. internal_state)
+ array_data[i] = rv
return array
def bytes(self, npy_intp length):
@@ -913,7 +968,8 @@ cdef class RandomState:
"""
cdef void *bytes
bytestring = empty_py_bytes(length, &bytes)
- rk_fill(bytes, length, self.internal_state)
+ with self.lock, nogil:
+ rk_fill(bytes, length, self.internal_state)
return bytestring
@@ -931,13 +987,14 @@ cdef class RandomState:
If an ndarray, a random sample is generated from its elements.
If an int, the random sample is generated as if a was np.arange(n)
size : int or tuple of ints, optional
- Output shape. Default is None, in which case a single value is
- returned.
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
replace : boolean, optional
Whether the sample is with or without replacement
p : 1-D array-like, optional
The probabilities associated with each entry in a.
- If not given the sample assumes a uniform distribtion over all
+ If not given the sample assumes a uniform distribution over all
entries in a.
Returns
@@ -976,7 +1033,7 @@ cdef class RandomState:
>>> np.random.choice(5, 3, replace=False)
array([3,1,0])
- >>> #This is equivalent to np.random.shuffle(np.arange(5))[:3]
+ >>> #This is equivalent to np.random.permutation(np.arange(5))[:3]
Generate a non-uniform random sample from np.arange(5) of size
3 without replacement:
@@ -1012,14 +1069,17 @@ cdef class RandomState:
raise ValueError("a must be non-empty")
if None != p:
- p = np.array(p, dtype=np.double, ndmin=1, copy=False)
+ d = len(p)
+ p = <ndarray>PyArray_ContiguousFromObject(p, NPY_DOUBLE, 1, 1)
+ pix = <double*>PyArray_DATA(p)
+
if p.ndim != 1:
raise ValueError("p must be 1-dimensional")
if p.size != pop_size:
raise ValueError("a and p must have same size")
- if np.any(p < 0):
+ if np.logical_or.reduce(p < 0):
raise ValueError("probabilities are not non-negative")
- if not np.allclose(p.sum(), 1):
+ if abs(kahan_sum(pix, d) - 1.) > 1e-8:
raise ValueError("probabilities do not sum to 1")
shape = size
@@ -1044,7 +1104,7 @@ cdef class RandomState:
"population when 'replace=False'")
if None != p:
- if np.sum(p > 0) < size:
+ if np.count_nonzero(p > 0) < size:
raise ValueError("Fewer non-zero entries in p than size")
n_uniq = 0
p = p.copy()
@@ -1091,7 +1151,7 @@ cdef class RandomState:
def uniform(self, low=0.0, high=1.0, size=None):
"""
- uniform(low=0.0, high=1.0, size=1)
+ uniform(low=0.0, high=1.0, size=None)
Draw samples from a uniform distribution.
@@ -1109,9 +1169,9 @@ cdef class RandomState:
Upper boundary of the output interval. All values generated will be
less than high. The default value is 1.0.
size : int or tuple of ints, optional
- Shape of output. If the given size is, for example, (m,n,k),
- m*n*k samples are generated. If no shape is specified, a single sample
- is returned.
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -1166,7 +1226,9 @@ cdef class RandomState:
flow = PyFloat_AsDouble(low)
fhigh = PyFloat_AsDouble(high)
if not PyErr_Occurred():
- return cont2_array_sc(self.internal_state, rk_uniform, size, flow, fhigh-flow)
+ return cont2_array_sc(self.internal_state, rk_uniform, size, flow,
+ fhigh-flow, self.lock)
+
PyErr_Clear()
olow = <ndarray>PyArray_FROM_OTF(low, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
ohigh = <ndarray>PyArray_FROM_OTF(high, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
@@ -1174,7 +1236,8 @@ cdef class RandomState:
Py_INCREF(temp) # needed to get around Pyrex's automatic reference-counting
# rules because EnsureArray steals a reference
odiff = <ndarray>PyArray_EnsureArray(temp)
- return cont2_array(self.internal_state, rk_uniform, size, olow, odiff)
+ return cont2_array(self.internal_state, rk_uniform, size, olow, odiff,
+ self.lock)
def rand(self, *args):
"""
@@ -1297,7 +1360,9 @@ cdef class RandomState:
If provided, the largest (signed) integer to be drawn from the
distribution (see above for behavior if ``high=None``).
size : int or tuple of ints, optional
- Output shape. Default is None, in which case a single int is returned.
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -1364,8 +1429,9 @@ cdef class RandomState:
Parameters
----------
size : int or tuple of ints, optional
- Output shape. Default is None, in which case a single value is
- returned.
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -1385,7 +1451,7 @@ cdef class RandomState:
(3, 4, 2)
"""
- return cont0_array(self.internal_state, rk_gauss, size)
+ return cont0_array(self.internal_state, rk_gauss, size, self.lock)
def normal(self, loc=0.0, scale=1.0, size=None):
"""
@@ -1409,9 +1475,10 @@ cdef class RandomState:
Mean ("centre") of the distribution.
scale : float
Standard deviation (spread or "width") of the distribution.
- size : tuple of ints
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
See Also
--------
@@ -1477,7 +1544,8 @@ cdef class RandomState:
if not PyErr_Occurred():
if fscale <= 0:
raise ValueError("scale <= 0")
- return cont2_array_sc(self.internal_state, rk_normal, size, floc, fscale)
+ return cont2_array_sc(self.internal_state, rk_normal, size, floc,
+ fscale, self.lock)
PyErr_Clear()
@@ -1485,7 +1553,8 @@ cdef class RandomState:
oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(oscale, 0)):
raise ValueError("scale <= 0")
- return cont2_array(self.internal_state, rk_normal, size, oloc, oscale)
+ return cont2_array(self.internal_state, rk_normal, size, oloc, oscale,
+ self.lock)
def beta(self, a, b, size=None):
"""
@@ -1513,9 +1582,10 @@ cdef class RandomState:
Alpha, non-negative.
b : float
Beta, non-negative.
- size : tuple of ints, optional
- The number of samples to draw. The output is packed according to
- the size given.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -1534,7 +1604,8 @@ cdef class RandomState:
raise ValueError("a <= 0")
if fb <= 0:
raise ValueError("b <= 0")
- return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb)
+ return cont2_array_sc(self.internal_state, rk_beta, size, fa, fb,
+ self.lock)
PyErr_Clear()
@@ -1544,7 +1615,8 @@ cdef class RandomState:
raise ValueError("a <= 0")
if np.any(np.less_equal(ob, 0)):
raise ValueError("b <= 0")
- return cont2_array(self.internal_state, rk_beta, size, oa, ob)
+ return cont2_array(self.internal_state, rk_beta, size, oa, ob,
+ self.lock)
def exponential(self, scale=1.0, size=None):
"""
@@ -1570,9 +1642,10 @@ cdef class RandomState:
----------
scale : float
The scale parameter, :math:`\\beta = 1/\\lambda`.
- size : tuple of ints
- Number of samples to draw. The output is shaped
- according to `size`.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
References
----------
@@ -1591,14 +1664,16 @@ cdef class RandomState:
if not PyErr_Occurred():
if fscale <= 0:
raise ValueError("scale <= 0")
- return cont1_array_sc(self.internal_state, rk_exponential, size, fscale)
+ return cont1_array_sc(self.internal_state, rk_exponential, size,
+ fscale, self.lock)
PyErr_Clear()
oscale = <ndarray> PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(oscale, 0.0)):
raise ValueError("scale <= 0")
- return cont1_array(self.internal_state, rk_exponential, size, oscale)
+ return cont1_array(self.internal_state, rk_exponential, size, oscale,
+ self.lock)
def standard_exponential(self, size=None):
"""
@@ -1611,8 +1686,10 @@ cdef class RandomState:
Parameters
----------
- size : int or tuple of ints
- Shape of the output.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -1626,7 +1703,8 @@ cdef class RandomState:
>>> n = np.random.standard_exponential((3, 8000))
"""
- return cont0_array(self.internal_state, rk_standard_exponential, size)
+ return cont0_array(self.internal_state, rk_standard_exponential, size,
+ self.lock)
def standard_gamma(self, shape, size=None):
"""
@@ -1641,9 +1719,10 @@ cdef class RandomState:
----------
shape : float
Parameter, should be > 0.
- size : int or tuple of ints
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -1702,13 +1781,14 @@ cdef class RandomState:
if not PyErr_Occurred():
if fshape <= 0:
raise ValueError("shape <= 0")
- return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape)
+ return cont1_array_sc(self.internal_state, rk_standard_gamma, size, fshape, self.lock)
PyErr_Clear()
oshape = <ndarray> PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(oshape, 0.0)):
raise ValueError("shape <= 0")
- return cont1_array(self.internal_state, rk_standard_gamma, size, oshape)
+ return cont1_array(self.internal_state, rk_standard_gamma, size,
+ oshape, self.lock)
def gamma(self, shape, scale=1.0, size=None):
"""
@@ -1726,9 +1806,10 @@ cdef class RandomState:
The shape of the gamma distribution.
scale : scalar > 0, optional
The scale of the gamma distribution. Default is equal to 1.
- size : shape_tuple, optional
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -1790,7 +1871,8 @@ cdef class RandomState:
raise ValueError("shape <= 0")
if fscale <= 0:
raise ValueError("scale <= 0")
- return cont2_array_sc(self.internal_state, rk_gamma, size, fshape, fscale)
+ return cont2_array_sc(self.internal_state, rk_gamma, size, fshape,
+ fscale, self.lock)
PyErr_Clear()
oshape = <ndarray>PyArray_FROM_OTF(shape, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
@@ -1799,7 +1881,8 @@ cdef class RandomState:
raise ValueError("shape <= 0")
if np.any(np.less_equal(oscale, 0.0)):
raise ValueError("scale <= 0")
- return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale)
+ return cont2_array(self.internal_state, rk_gamma, size, oshape, oscale,
+ self.lock)
def f(self, dfnum, dfden, size=None):
"""
@@ -1822,10 +1905,10 @@ cdef class RandomState:
Degrees of freedom in numerator. Should be greater than zero.
dfden : float
Degrees of freedom in denominator. Should be greater than zero.
- size : {tuple, int}, optional
- Output shape. If the given shape is, e.g., ``(m, n, k)``,
- then ``m * n * k`` samples are drawn. By default only one sample
- is returned.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -1891,7 +1974,8 @@ cdef class RandomState:
raise ValueError("shape <= 0")
if fdfden <= 0:
raise ValueError("scale <= 0")
- return cont2_array_sc(self.internal_state, rk_f, size, fdfnum, fdfden)
+ return cont2_array_sc(self.internal_state, rk_f, size, fdfnum,
+ fdfden, self.lock)
PyErr_Clear()
@@ -1901,7 +1985,8 @@ cdef class RandomState:
raise ValueError("dfnum <= 0")
if np.any(np.less_equal(odfden, 0.0)):
raise ValueError("dfden <= 0")
- return cont2_array(self.internal_state, rk_f, size, odfnum, odfden)
+ return cont2_array(self.internal_state, rk_f, size, odfnum, odfden,
+ self.lock)
def noncentral_f(self, dfnum, dfden, nonc, size=None):
"""
@@ -1922,9 +2007,10 @@ cdef class RandomState:
Parameter, should be > 1.
nonc : float
Parameter, should be >= 0.
- size : int or tuple of ints
- Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -1981,7 +2067,7 @@ cdef class RandomState:
if fnonc < 0:
raise ValueError("nonc < 0")
return cont3_array_sc(self.internal_state, rk_noncentral_f, size,
- fdfnum, fdfden, fnonc)
+ fdfnum, fdfden, fnonc, self.lock)
PyErr_Clear()
@@ -1996,7 +2082,7 @@ cdef class RandomState:
if np.any(np.less(ononc, 0.0)):
raise ValueError("nonc < 0")
return cont3_array(self.internal_state, rk_noncentral_f, size, odfnum,
- odfden, ononc)
+ odfden, ononc, self.lock)
def chisquare(self, df, size=None):
"""
@@ -2013,9 +2099,10 @@ cdef class RandomState:
----------
df : int
Number of degrees of freedom.
- size : tuple of ints, int, optional
- Size of the returned array. By default, a scalar is
- returned.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -2067,14 +2154,16 @@ cdef class RandomState:
if not PyErr_Occurred():
if fdf <= 0:
raise ValueError("df <= 0")
- return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf)
+ return cont1_array_sc(self.internal_state, rk_chisquare, size, fdf,
+ self.lock)
PyErr_Clear()
odf = <ndarray>PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(odf, 0.0)):
raise ValueError("df <= 0")
- return cont1_array(self.internal_state, rk_chisquare, size, odf)
+ return cont1_array(self.internal_state, rk_chisquare, size, odf,
+ self.lock)
def noncentral_chisquare(self, df, nonc, size=None):
"""
@@ -2091,8 +2180,10 @@ cdef class RandomState:
Degrees of freedom, should be >= 1.
nonc : float
Non-centrality, should be > 0.
- size : int or tuple of ints
- Shape of the output.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Notes
-----
@@ -2155,7 +2246,7 @@ cdef class RandomState:
if fnonc <= 0:
raise ValueError("nonc <= 0")
return cont2_array_sc(self.internal_state, rk_noncentral_chisquare,
- size, fdf, fnonc)
+ size, fdf, fnonc, self.lock)
PyErr_Clear()
@@ -2166,7 +2257,7 @@ cdef class RandomState:
if np.any(np.less_equal(ononc, 0.0)):
raise ValueError("nonc < 0")
return cont2_array(self.internal_state, rk_noncentral_chisquare, size,
- odf, ononc)
+ odf, ononc, self.lock)
def standard_cauchy(self, size=None):
"""
@@ -2178,8 +2269,10 @@ cdef class RandomState:
Parameters
----------
- size : int or tuple of ints
- Shape of the output.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -2227,7 +2320,8 @@ cdef class RandomState:
>>> plt.show()
"""
- return cont0_array(self.internal_state, rk_standard_cauchy, size)
+ return cont0_array(self.internal_state, rk_standard_cauchy, size,
+ self.lock)
def standard_t(self, df, size=None):
"""
@@ -2244,8 +2338,9 @@ cdef class RandomState:
df : int
Degrees of freedom, should be > 0.
size : int or tuple of ints, optional
- Output shape. Default is None, in which case a single value is
- returned.
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -2321,14 +2416,16 @@ cdef class RandomState:
if not PyErr_Occurred():
if fdf <= 0:
raise ValueError("df <= 0")
- return cont1_array_sc(self.internal_state, rk_standard_t, size, fdf)
+ return cont1_array_sc(self.internal_state, rk_standard_t, size,
+ fdf, self.lock)
PyErr_Clear()
odf = <ndarray> PyArray_FROM_OTF(df, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(odf, 0.0)):
raise ValueError("df <= 0")
- return cont1_array(self.internal_state, rk_standard_t, size, odf)
+ return cont1_array(self.internal_state, rk_standard_t, size, odf,
+ self.lock)
def vonmises(self, mu, kappa, size=None):
"""
@@ -2350,9 +2447,10 @@ cdef class RandomState:
Mode ("center") of the distribution.
kappa : float
Dispersion of the distribution, has to be >=0.
- size : int or tuple of int
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -2414,7 +2512,8 @@ cdef class RandomState:
if not PyErr_Occurred():
if fkappa < 0:
raise ValueError("kappa < 0")
- return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu, fkappa)
+ return cont2_array_sc(self.internal_state, rk_vonmises, size, fmu,
+ fkappa, self.lock)
PyErr_Clear()
@@ -2422,7 +2521,8 @@ cdef class RandomState:
okappa = <ndarray> PyArray_FROM_OTF(kappa, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less(okappa, 0.0)):
raise ValueError("kappa < 0")
- return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa)
+ return cont2_array(self.internal_state, rk_vonmises, size, omu, okappa,
+ self.lock)
def pareto(self, a, size=None):
"""
@@ -2448,9 +2548,10 @@ cdef class RandomState:
----------
shape : float, > 0.
Shape of the distribution.
- size : tuple of ints
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
See Also
--------
@@ -2511,14 +2612,15 @@ cdef class RandomState:
if not PyErr_Occurred():
if fa <= 0:
raise ValueError("a <= 0")
- return cont1_array_sc(self.internal_state, rk_pareto, size, fa)
+ return cont1_array_sc(self.internal_state, rk_pareto, size, fa,
+ self.lock)
PyErr_Clear()
oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(oa, 0.0)):
raise ValueError("a <= 0")
- return cont1_array(self.internal_state, rk_pareto, size, oa)
+ return cont1_array(self.internal_state, rk_pareto, size, oa, self.lock)
def weibull(self, a, size=None):
"""
@@ -2540,9 +2642,10 @@ cdef class RandomState:
----------
a : float
Shape of the distribution.
- size : tuple of ints
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
See Also
--------
@@ -2611,14 +2714,16 @@ cdef class RandomState:
if not PyErr_Occurred():
if fa <= 0:
raise ValueError("a <= 0")
- return cont1_array_sc(self.internal_state, rk_weibull, size, fa)
+ return cont1_array_sc(self.internal_state, rk_weibull, size, fa,
+ self.lock)
PyErr_Clear()
oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(oa, 0.0)):
raise ValueError("a <= 0")
- return cont1_array(self.internal_state, rk_weibull, size, oa)
+ return cont1_array(self.internal_state, rk_weibull, size, oa,
+ self.lock)
def power(self, a, size=None):
"""
@@ -2633,9 +2738,10 @@ cdef class RandomState:
----------
a : float
parameter, > 0
- size : tuple of ints
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -2720,14 +2826,15 @@ cdef class RandomState:
if not PyErr_Occurred():
if fa <= 0:
raise ValueError("a <= 0")
- return cont1_array_sc(self.internal_state, rk_power, size, fa)
+ return cont1_array_sc(self.internal_state, rk_power, size, fa,
+ self.lock)
PyErr_Clear()
oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(oa, 0.0)):
raise ValueError("a <= 0")
- return cont1_array(self.internal_state, rk_power, size, oa)
+ return cont1_array(self.internal_state, rk_power, size, oa, self.lock)
def laplace(self, loc=0.0, scale=1.0, size=None):
"""
@@ -2747,6 +2854,10 @@ cdef class RandomState:
The position, :math:`\\mu`, of the distribution peak.
scale : float
:math:`\\lambda`, the exponential decay.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Notes
-----
@@ -2810,14 +2921,16 @@ cdef class RandomState:
if not PyErr_Occurred():
if fscale <= 0:
raise ValueError("scale <= 0")
- return cont2_array_sc(self.internal_state, rk_laplace, size, floc, fscale)
+ return cont2_array_sc(self.internal_state, rk_laplace, size, floc,
+ fscale, self.lock)
PyErr_Clear()
oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(oscale, 0.0)):
raise ValueError("scale <= 0")
- return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale)
+ return cont2_array(self.internal_state, rk_laplace, size, oloc, oscale,
+ self.lock)
def gumbel(self, loc=0.0, scale=1.0, size=None):
"""
@@ -2835,9 +2948,10 @@ cdef class RandomState:
The location of the mode of the distribution.
scale : float
The scale parameter of the distribution.
- size : tuple of ints
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -2941,14 +3055,16 @@ cdef class RandomState:
if not PyErr_Occurred():
if fscale <= 0:
raise ValueError("scale <= 0")
- return cont2_array_sc(self.internal_state, rk_gumbel, size, floc, fscale)
+ return cont2_array_sc(self.internal_state, rk_gumbel, size, floc,
+ fscale, self.lock)
PyErr_Clear()
oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(oscale, 0.0)):
raise ValueError("scale <= 0")
- return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale)
+ return cont2_array(self.internal_state, rk_gumbel, size, oloc, oscale,
+ self.lock)
def logistic(self, loc=0.0, scale=1.0, size=None):
"""
@@ -2965,9 +3081,10 @@ cdef class RandomState:
scale : float > 0.
- size : {tuple, int}
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -3029,14 +3146,16 @@ cdef class RandomState:
if not PyErr_Occurred():
if fscale <= 0:
raise ValueError("scale <= 0")
- return cont2_array_sc(self.internal_state, rk_logistic, size, floc, fscale)
+ return cont2_array_sc(self.internal_state, rk_logistic, size, floc,
+ fscale, self.lock)
PyErr_Clear()
oloc = PyArray_FROM_OTF(loc, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
oscale = PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(oscale, 0.0)):
raise ValueError("scale <= 0")
- return cont2_array(self.internal_state, rk_logistic, size, oloc, oscale)
+ return cont2_array(self.internal_state, rk_logistic, size, oloc,
+ oscale, self.lock)
def lognormal(self, mean=0.0, sigma=1.0, size=None):
"""
@@ -3055,9 +3174,10 @@ cdef class RandomState:
Mean value of the underlying normal distribution
sigma : float, > 0.
Standard deviation of the underlying normal distribution
- size : tuple of ints
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -3149,7 +3269,8 @@ cdef class RandomState:
if not PyErr_Occurred():
if fsigma <= 0:
raise ValueError("sigma <= 0")
- return cont2_array_sc(self.internal_state, rk_lognormal, size, fmean, fsigma)
+ return cont2_array_sc(self.internal_state, rk_lognormal, size,
+ fmean, fsigma, self.lock)
PyErr_Clear()
@@ -3157,7 +3278,8 @@ cdef class RandomState:
osigma = PyArray_FROM_OTF(sigma, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(osigma, 0.0)):
raise ValueError("sigma <= 0.0")
- return cont2_array(self.internal_state, rk_lognormal, size, omean, osigma)
+ return cont2_array(self.internal_state, rk_lognormal, size, omean,
+ osigma, self.lock)
def rayleigh(self, scale=1.0, size=None):
"""
@@ -3173,8 +3295,9 @@ cdef class RandomState:
scale : scalar
Scale, also equals the mode. Should be >= 0.
size : int or tuple of ints, optional
- Shape of the output. Default is None, in which case a single
- value is returned.
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Notes
-----
@@ -3222,14 +3345,16 @@ cdef class RandomState:
if not PyErr_Occurred():
if fscale <= 0:
raise ValueError("scale <= 0")
- return cont1_array_sc(self.internal_state, rk_rayleigh, size, fscale)
+ return cont1_array_sc(self.internal_state, rk_rayleigh, size,
+ fscale, self.lock)
PyErr_Clear()
oscale = <ndarray>PyArray_FROM_OTF(scale, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(oscale, 0.0)):
raise ValueError("scale <= 0.0")
- return cont1_array(self.internal_state, rk_rayleigh, size, oscale)
+ return cont1_array(self.internal_state, rk_rayleigh, size, oscale,
+ self.lock)
def wald(self, mean, scale, size=None):
"""
@@ -3255,8 +3380,9 @@ cdef class RandomState:
scale : scalar
Scale parameter, should be >= 0.
size : int or tuple of ints, optional
- Output shape. Default is None, in which case a single value is
- returned.
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -3304,7 +3430,8 @@ cdef class RandomState:
raise ValueError("mean <= 0")
if fscale <= 0:
raise ValueError("scale <= 0")
- return cont2_array_sc(self.internal_state, rk_wald, size, fmean, fscale)
+ return cont2_array_sc(self.internal_state, rk_wald, size, fmean,
+ fscale, self.lock)
PyErr_Clear()
omean = PyArray_FROM_OTF(mean, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
@@ -3313,9 +3440,8 @@ cdef class RandomState:
raise ValueError("mean <= 0.0")
elif np.any(np.less_equal(oscale,0.0)):
raise ValueError("scale <= 0.0")
- return cont2_array(self.internal_state, rk_wald, size, omean, oscale)
-
-
+ return cont2_array(self.internal_state, rk_wald, size, omean, oscale,
+ self.lock)
def triangular(self, left, mode, right, size=None):
"""
@@ -3337,8 +3463,9 @@ cdef class RandomState:
right : scalar
Upper limit, should be larger than `left`.
size : int or tuple of ints, optional
- Output shape. Default is None, in which case a single value is
- returned.
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -3388,7 +3515,7 @@ cdef class RandomState:
if fleft == fright:
raise ValueError("left == right")
return cont3_array_sc(self.internal_state, rk_triangular, size, fleft,
- fmode, fright)
+ fmode, fright, self.lock)
PyErr_Clear()
oleft = <ndarray>PyArray_FROM_OTF(left, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
@@ -3402,7 +3529,7 @@ cdef class RandomState:
if np.any(np.equal(oleft, oright)):
raise ValueError("left == right")
return cont3_array(self.internal_state, rk_triangular, size, oleft,
- omode, oright)
+ omode, oright, self.lock)
# Complicated, discrete distributions:
def binomial(self, n, p, size=None):
@@ -3422,9 +3549,10 @@ cdef class RandomState:
parameter, >= 0.
p : float
parameter, >= 0 and <=1.
- size : {tuple, int}
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -3499,7 +3627,10 @@ cdef class RandomState:
raise ValueError("p < 0")
elif fp > 1:
raise ValueError("p > 1")
- return discnp_array_sc(self.internal_state, rk_binomial, size, ln, fp)
+ elif np.isnan(fp):
+ raise ValueError("p is nan")
+ return discnp_array_sc(self.internal_state, rk_binomial, size, ln,
+ fp, self.lock)
PyErr_Clear()
@@ -3511,7 +3642,8 @@ 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_binomial, size, on, op)
+ return discnp_array(self.internal_state, rk_binomial, size, on, op,
+ self.lock)
def negative_binomial(self, n, p, size=None):
"""
@@ -3529,9 +3661,10 @@ cdef class RandomState:
Parameter, > 0.
p : float
Parameter, >= 0 and <=1.
- size : int or tuple of ints
- Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -3593,7 +3726,7 @@ cdef class RandomState:
elif fp > 1:
raise ValueError("p > 1")
return discdd_array_sc(self.internal_state, rk_negative_binomial,
- size, fn, fp)
+ size, fn, fp, self.lock)
PyErr_Clear()
@@ -3606,7 +3739,7 @@ cdef class RandomState:
if np.any(np.greater(p, 1)):
raise ValueError("p > 1")
return discdd_array(self.internal_state, rk_negative_binomial, size,
- on, op)
+ on, op, self.lock)
def poisson(self, lam=1.0, size=None):
"""
@@ -3619,11 +3752,13 @@ cdef class RandomState:
Parameters
----------
- lam : float
- Expectation of interval, should be >= 0.
+ lam : float or sequence of float
+ Expectation of interval, should be >= 0. A sequence of expectation
+ intervals must be broadcastable over the requested size.
size : int or tuple of ints, optional
- Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Notes
-----
@@ -3659,6 +3794,10 @@ cdef class RandomState:
>>> count, bins, ignored = plt.hist(s, 14, normed=True)
>>> plt.show()
+ Draw each 100 values for lambda 100 and 500:
+
+ >>> s = np.random.poisson(lam=(100., 500.), size=(100, 2))
+
"""
cdef ndarray olam
cdef double flam
@@ -3668,7 +3807,8 @@ cdef class RandomState:
raise ValueError("lam < 0")
if lam > self.poisson_lam_max:
raise ValueError("lam value too large")
- return discd_array_sc(self.internal_state, rk_poisson, size, flam)
+ return discd_array_sc(self.internal_state, rk_poisson, size, flam,
+ self.lock)
PyErr_Clear()
@@ -3677,7 +3817,7 @@ cdef class RandomState:
raise ValueError("lam < 0")
if np.any(np.greater(olam, self.poisson_lam_max)):
raise ValueError("lam value too large.")
- return discd_array(self.internal_state, rk_poisson, size, olam)
+ return discd_array(self.internal_state, rk_poisson, size, olam, self.lock)
def zipf(self, a, size=None):
"""
@@ -3697,12 +3837,10 @@ cdef class RandomState:
----------
a : float > 1
Distribution parameter.
- size : int or tuple of int, optional
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn; a single integer is equivalent in
- its result to providing a mono-tuple, i.e., a 1-D array of length
- *size* is returned. The default is None, in which case a single
- scalar is returned.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -3758,14 +3896,15 @@ cdef class RandomState:
if not PyErr_Occurred():
if fa <= 1.0:
raise ValueError("a <= 1.0")
- return discd_array_sc(self.internal_state, rk_zipf, size, fa)
+ return discd_array_sc(self.internal_state, rk_zipf, size, fa,
+ self.lock)
PyErr_Clear()
oa = <ndarray>PyArray_FROM_OTF(a, NPY_DOUBLE, NPY_ARRAY_ALIGNED)
if np.any(np.less_equal(oa, 1.0)):
raise ValueError("a <= 1.0")
- return discd_array(self.internal_state, rk_zipf, size, oa)
+ return discd_array(self.internal_state, rk_zipf, size, oa, self.lock)
def geometric(self, p, size=None):
"""
@@ -3789,9 +3928,10 @@ cdef class RandomState:
----------
p : float
The probability of success of an individual trial.
- size : tuple of ints
- Number of values to draw from the distribution. The output
- is shaped according to `size`.
+ size : int or tuple of ints, optional
+ Output shape. If the given shape is, e.g., ``(m, n, k)``, then
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -3821,7 +3961,8 @@ cdef class RandomState:
raise ValueError("p < 0.0")
if fp > 1.0:
raise ValueError("p > 1.0")
- return discd_array_sc(self.internal_state, rk_geometric, size, fp)
+ return discd_array_sc(self.internal_state, rk_geometric, size, fp,
+ self.lock)
PyErr_Clear()
@@ -3831,7 +3972,7 @@ cdef class RandomState:
raise ValueError("p < 0.0")
if np.any(np.greater(op, 1.0)):
raise ValueError("p > 1.0")
- return discd_array(self.internal_state, rk_geometric, size, op)
+ return discd_array(self.internal_state, rk_geometric, size, op, self.lock)
def hypergeometric(self, ngood, nbad, nsample, size=None):
"""
@@ -3853,9 +3994,10 @@ cdef class RandomState:
nsample : int or array_like
Number of items sampled. Must be at least 1 and at most
``ngood + nbad``.
- size : int or tuple of int
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -3933,8 +4075,8 @@ cdef class RandomState:
raise ValueError("nsample < 1")
if lngood + lnbad < lnsample:
raise ValueError("ngood + nbad < nsample")
- return discnmN_array_sc(self.internal_state, rk_hypergeometric, size,
- lngood, lnbad, lnsample)
+ return discnmN_array_sc(self.internal_state, rk_hypergeometric,
+ size, lngood, lnbad, lnsample, self.lock)
PyErr_Clear()
@@ -3950,7 +4092,7 @@ cdef class RandomState:
if np.any(np.less(np.add(ongood, onbad),onsample)):
raise ValueError("ngood + nbad < nsample")
return discnmN_array(self.internal_state, rk_hypergeometric, size,
- ongood, onbad, onsample)
+ ongood, onbad, onsample, self.lock)
def logseries(self, p, size=None):
"""
@@ -3967,9 +4109,10 @@ cdef class RandomState:
scale : float > 0.
- size : {tuple, int}
+ size : int or tuple of ints, optional
Output shape. If the given shape is, e.g., ``(m, n, k)``, then
- ``m * n * k`` samples are drawn.
+ ``m * n * k`` samples are drawn. Default is None, in which case a
+ single value is returned.
Returns
-------
@@ -4035,7 +4178,8 @@ cdef class RandomState:
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)
+ return discd_array_sc(self.internal_state, rk_logseries, size, fp,
+ self.lock)
PyErr_Clear()
@@ -4044,7 +4188,7 @@ cdef class RandomState:
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)
+ return discd_array(self.internal_state, rk_logseries, size, op, self.lock)
# Multivariate distributions:
def multivariate_normal(self, mean, cov, size=None):
@@ -4066,7 +4210,7 @@ cdef class RandomState:
Mean of the N-dimensional distribution.
cov : 2-D array_like, of shape (N, N)
Covariance matrix of the distribution. Must be symmetric and
- positive semi-definite for "physically meaningful" results.
+ positive-semidefinite for "physically meaningful" results.
size : int or 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
@@ -4138,44 +4282,55 @@ cdef class RandomState:
[True, True]
"""
+ from numpy.dual import svd
+
# Check preconditions on arguments
mean = np.array(mean)
cov = np.array(cov)
if size is None:
shape = []
+ elif isinstance(size, (int, long, np.integer)):
+ shape = [size]
else:
shape = size
+
if len(mean.shape) != 1:
raise ValueError("mean must be 1 dimensional")
if (len(cov.shape) != 2) or (cov.shape[0] != cov.shape[1]):
raise ValueError("cov must be 2 dimensional and square")
if mean.shape[0] != cov.shape[0]:
raise ValueError("mean and cov must have same length")
- # Compute shape of output
- if isinstance(shape, (int, long, np.integer)):
- shape = [shape]
+
+ # Compute shape of output and create a matrix of independent
+ # standard normally distributed random numbers. The matrix has rows
+ # with the same length as mean and as many rows are necessary to
+ # form a matrix of shape final_shape.
final_shape = list(shape[:])
final_shape.append(mean.shape[0])
- # Create a matrix of independent standard normally distributed random
- # numbers. The matrix has rows with the same length as mean and as
- # many rows are necessary to form a matrix of shape final_shape.
- x = self.standard_normal(np.multiply.reduce(final_shape))
- x.shape = (np.multiply.reduce(final_shape[0:len(final_shape)-1]),
- mean.shape[0])
+ x = self.standard_normal(final_shape).reshape(-1, mean.shape[0])
+
# Transform matrix of standard normals into matrix where each row
# contains multivariate normals with the desired covariance.
# Compute A such that dot(transpose(A),A) == cov.
# Then the matrix products of the rows of x and A has the desired
# covariance. Note that sqrt(s)*v where (u,s,v) is the singular value
# decomposition of cov is such an A.
-
- from numpy.dual import svd
- # XXX: we really should be doing this by Cholesky decomposition
- (u,s,v) = svd(cov)
- x = np.dot(x*np.sqrt(s),v)
- # The rows of x now have the correct covariance but mean 0. Add
- # mean to each row. Then each row will have mean mean.
- np.add(mean,x,x)
+ #
+ # Also check that cov is positive-semidefinite. If so, the u.T and v
+ # matrices should be equal up to roundoff error if cov is
+ # symmetrical and the singular value of the corresponding row is
+ # not zero. We continue to use the SVD rather than Cholesky in
+ # order to preserve current outputs. Note that symmetry has not
+ # been checked.
+ (u, s, v) = svd(cov)
+ neg = (np.sum(u.T * v, axis=1) < 0) & (s > 0)
+ if np.any(neg):
+ s[neg] = 0.
+ warnings.warn("covariance is not positive-semidefinite.",
+ RuntimeWarning)
+
+ x = np.dot(x, np.sqrt(s)[:, None] * v)
+ x += mean
x.shape = tuple(final_shape)
return x
@@ -4235,7 +4390,7 @@ cdef class RandomState:
cdef ndarray parr "arrayObject_parr", mnarr "arrayObject_mnarr"
cdef double *pix
cdef long *mnix
- cdef npy_intp i, j, dn
+ cdef npy_intp i, j, dn, sz
cdef double Sum
d = len(pvals)
@@ -4245,30 +4400,27 @@ cdef class RandomState:
if kahan_sum(pix, d-1) > (1.0 + 1e-12):
raise ValueError("sum(pvals[:-1]) > 1.0")
- if size is None:
- shape = (d,)
- elif type(size) is int:
- shape = (size, d)
- else:
- shape = size + (d,)
+ shape = _shape_from_size(size, d)
multin = np.zeros(shape, int)
mnarr = <ndarray>multin
mnix = <long*>PyArray_DATA(mnarr)
- i = 0
- while i < PyArray_SIZE(mnarr):
- Sum = 1.0
- dn = n
- for j from 0 <= j < d-1:
- mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
- dn = dn - mnix[i+j]
- if dn <= 0:
- break
- Sum = Sum - pix[j]
- if dn > 0:
- mnix[i+d-1] = dn
-
- i = i + d
+ sz = PyArray_SIZE(mnarr)
+ with self.lock, nogil:
+ i = 0
+ while i < sz:
+ Sum = 1.0
+ dn = n
+ for j from 0 <= j < d-1:
+ mnix[i+j] = rk_binomial(self.internal_state, dn, pix[j]/Sum)
+ dn = dn - mnix[i+j]
+ if dn <= 0:
+ break
+ Sum = Sum - pix[j]
+ if dn > 0:
+ mnix[i+d-1] = dn
+
+ i = i + d
return multin
@@ -4354,7 +4506,8 @@ cdef class RandomState:
cdef npy_intp k
cdef npy_intp totsize
cdef ndarray alpha_arr, val_arr
- cdef double *alpha_data, *val_data
+ cdef double *alpha_data
+ cdef double *val_data
cdef npy_intp i, j
cdef double acc, invacc
@@ -4362,12 +4515,7 @@ cdef class RandomState:
alpha_arr = <ndarray>PyArray_ContiguousFromObject(alpha, NPY_DOUBLE, 1, 1)
alpha_data = <double*>PyArray_DATA(alpha_arr)
- if size is None:
- shape = (k,)
- elif type(size) is int:
- shape = (size, k)
- else:
- shape = size + (k,)
+ shape = _shape_from_size(size, k)
diric = np.zeros(shape, np.float64)
val_arr = <ndarray>diric
@@ -4375,15 +4523,17 @@ cdef class RandomState:
i = 0
totsize = PyArray_SIZE(val_arr)
- while i < totsize:
- acc = 0.0
- for j from 0 <= j < k:
- val_data[i+j] = rk_standard_gamma(self.internal_state, alpha_data[j])
- acc = acc + val_data[i+j]
- invacc = 1/acc
- for j from 0 <= j < k:
- val_data[i+j] = val_data[i+j] * invacc
- i = i + k
+ with self.lock, nogil:
+ while i < totsize:
+ acc = 0.0
+ for j from 0 <= j < k:
+ val_data[i+j] = rk_standard_gamma(self.internal_state,
+ alpha_data[j])
+ acc = acc + val_data[i+j]
+ invacc = 1/acc
+ for j from 0 <= j < k:
+ val_data[i+j] = val_data[i+j] * invacc
+ i = i + k
return diric
@@ -4426,11 +4576,12 @@ cdef class RandomState:
i = len(x) - 1
# Logic adapted from random.shuffle()
- if isinstance(x, np.ndarray) and x.ndim > 1:
+ if isinstance(x, np.ndarray) and \
+ (x.ndim > 1 or x.dtype.fields is not None):
# For a multi-dimensional ndarray, indexing returns a view onto
# each row. So we can't just use ordinary assignment to swap the
# rows; we need a bounce buffer.
- buf = np.empty(x.shape[1:], dtype=x.dtype)
+ buf = np.empty_like(x[0])
while i > 0:
j = rk_interval(i, self.internal_state)
buf[...] = x[j]
diff --git a/numpy/random/mtrand/numpy.pxd b/numpy/random/mtrand/numpy.pxd
index 572b51fdd..c54f79c0a 100644
--- a/numpy/random/mtrand/numpy.pxd
+++ b/numpy/random/mtrand/numpy.pxd
@@ -114,12 +114,14 @@ cdef extern from "numpy/arrayobject.h":
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)
+ char *PyArray_MultiIter_DATA(broadcast multi, int i) nogil
+ void PyArray_MultiIter_NEXTi(broadcast multi, int i) nogil
+ void PyArray_MultiIter_NEXT(broadcast multi) nogil
object PyArray_IterNew(object arr)
- void PyArray_ITER_NEXT(flatiter it)
+ void PyArray_ITER_NEXT(flatiter it) nogil
+
+ dtype PyArray_DescrFromType(int)
void import_array()
diff --git a/numpy/random/tests/test_random.py b/numpy/random/tests/test_random.py
index 4ae7cfeb1..b64c9d6cd 100644
--- a/numpy/random/tests/test_random.py
+++ b/numpy/random/tests/test_random.py
@@ -1,11 +1,41 @@
from __future__ import division, absolute_import, print_function
-from numpy.testing import TestCase, run_module_suite, assert_,\
- assert_raises
+import numpy as np
+from numpy.testing import (
+ TestCase, run_module_suite, assert_, assert_raises, assert_equal,
+ assert_warns)
from numpy import random
from numpy.compat import asbytes
-import numpy as np
+class TestSeed(TestCase):
+ def test_scalar(self):
+ s = np.random.RandomState(0)
+ assert_equal(s.randint(1000), 684)
+ s = np.random.RandomState(4294967295)
+ assert_equal(s.randint(1000), 419)
+
+ def test_array(self):
+ s = np.random.RandomState(range(10))
+ assert_equal(s.randint(1000), 468)
+ s = np.random.RandomState(np.arange(10))
+ assert_equal(s.randint(1000), 468)
+ s = np.random.RandomState([0])
+ assert_equal(s.randint(1000), 973)
+ s = np.random.RandomState([4294967295])
+ assert_equal(s.randint(1000), 265)
+
+ def test_invalid_scalar(self):
+ # seed must be a unsigned 32 bit integers
+ assert_raises(TypeError, np.random.RandomState, -0.5)
+ assert_raises(ValueError, np.random.RandomState, -1)
+
+ def test_invalid_array(self):
+ # seed must be a unsigned 32 bit integers
+ assert_raises(TypeError, np.random.RandomState, [-0.5])
+ assert_raises(ValueError, np.random.RandomState, [-1])
+ assert_raises(ValueError, np.random.RandomState, [4294967296])
+ assert_raises(ValueError, np.random.RandomState, [1, 2, 4294967296])
+ assert_raises(ValueError, np.random.RandomState, [1, -2, 4294967296])
class TestBinomial(TestCase):
def test_n_zero(self):
@@ -17,6 +47,10 @@ class TestBinomial(TestCase):
assert_(random.binomial(0, p) == 0)
np.testing.assert_array_equal(random.binomial(zeros, p), zeros)
+ def test_p_is_nan(self):
+ # Issue #4571.
+ assert_raises(ValueError, random.binomial, 1, np.nan)
+
class TestMultinomial(TestCase):
def test_basic(self):
@@ -31,6 +65,20 @@ class TestMultinomial(TestCase):
assert_(np.all(-5 <= x))
assert_(np.all(x < -1))
+ def test_size(self):
+ # gh-3173
+ p = [0.5, 0.5]
+ assert_equal(np.random.multinomial(1 ,p, np.uint32(1)).shape, (1, 2))
+ assert_equal(np.random.multinomial(1 ,p, np.uint32(1)).shape, (1, 2))
+ assert_equal(np.random.multinomial(1 ,p, np.uint32(1)).shape, (1, 2))
+ assert_equal(np.random.multinomial(1 ,p, [2, 2]).shape, (2, 2, 2))
+ assert_equal(np.random.multinomial(1 ,p, (2, 2)).shape, (2, 2, 2))
+ assert_equal(np.random.multinomial(1 ,p, np.array((2, 2))).shape,
+ (2, 2, 2))
+
+ assert_raises(TypeError, np.random.multinomial, 1 , p,
+ np.float(1))
+
class TestSetState(TestCase):
def setUp(self):
@@ -230,6 +278,29 @@ class TestRandomDist(TestCase):
desired = conv([0, 1, 9, 6, 2, 4, 5, 8, 7, 3])
np.testing.assert_array_equal(actual, desired)
+ def test_shuffle_flexible(self):
+ # gh-4270
+ arr = [(0, 1), (2, 3)]
+ dt = np.dtype([('a', np.int32, 1), ('b', np.int32, 1)])
+ nparr = np.array(arr, dtype=dt)
+ a, b = nparr[0].copy(), nparr[1].copy()
+ for i in range(50):
+ np.random.shuffle(nparr)
+ assert_(a in nparr)
+ assert_(b in nparr)
+
+ def test_shuffle_masked(self):
+ # gh-3263
+ a = np.ma.masked_values(np.reshape(range(20), (5,4)) % 3 - 1, -1)
+ b = np.ma.masked_values(np.arange(20) % 3 - 1, -1)
+ ma = np.ma.count_masked(a)
+ mb = np.ma.count_masked(b)
+ for i in range(50):
+ np.random.shuffle(a)
+ self.assertEqual(ma, np.ma.count_masked(a))
+ np.random.shuffle(b)
+ self.assertEqual(mb, np.ma.count_masked(b))
+
def test_beta(self):
np.random.seed(self.seed)
actual = np.random.beta(.1, .9, size=(3, 2))
@@ -266,6 +337,18 @@ class TestRandomDist(TestCase):
[ 0.56974431743975207, 0.43025568256024799]]])
np.testing.assert_array_almost_equal(actual, desired, decimal=15)
+ def test_dirichlet_size(self):
+ # gh-3173
+ p = np.array([51.72840233779265162, 39.74494232180943953])
+ assert_equal(np.random.dirichlet(p, np.uint32(1)).shape, (1, 2))
+ assert_equal(np.random.dirichlet(p, np.uint32(1)).shape, (1, 2))
+ assert_equal(np.random.dirichlet(p, np.uint32(1)).shape, (1, 2))
+ assert_equal(np.random.dirichlet(p, [2, 2]).shape, (2, 2, 2))
+ assert_equal(np.random.dirichlet(p, (2, 2)).shape, (2, 2, 2))
+ assert_equal(np.random.dirichlet(p, np.array((2, 2))).shape, (2, 2, 2))
+
+ assert_raises(TypeError, np.random.dirichlet, p, np.float(1))
+
def test_exponential(self):
np.random.seed(self.seed)
actual = np.random.exponential(1.1234, size=(3, 2))
@@ -378,20 +461,32 @@ class TestRandomDist(TestCase):
def test_multivariate_normal(self):
np.random.seed(self.seed)
mean= (.123456789, 10)
+ # Hmm... not even symmetric.
cov = [[1, 0], [1, 0]]
size = (3, 2)
actual = np.random.multivariate_normal(mean, cov, size)
- desired = np.array([[[ -1.47027513018564449, 10. ],
- [ -1.65915081534845532, 10. ]],
- [[ -2.29186329304599745, 10. ],
- [ -1.77505606019580053, 10. ]],
- [[ -0.54970369430044119, 10. ],
- [ 0.29768848031692957, 10. ]]])
+ desired = np.array([[[-1.47027513018564449, 10.],
+ [-1.65915081534845532, 10.]],
+ [[-2.29186329304599745, 10.],
+ [-1.77505606019580053, 10.]],
+ [[-0.54970369430044119, 10.],
+ [ 0.29768848031692957, 10.]]])
+ np.testing.assert_array_almost_equal(actual, desired, decimal=15)
+
+ # Check for default size, was raising deprecation warning
+ actual = np.random.multivariate_normal(mean, cov)
+ desired = np.array([-0.79441224511977482, 10.])
np.testing.assert_array_almost_equal(actual, desired, decimal=15)
+ # Check that non positive-semidefinite covariance raises warning
+ mean= [0, 0]
+ cov = [[1, 1 + 1e-10], [1 + 1e-10, 1]]
+ rng = np.random.multivariate_normal
+ assert_warns(RuntimeWarning, np.random.multivariate_normal, mean, cov)
+
def test_negative_binomial(self):
np.random.seed(self.seed)
- actual = np.random.negative_binomial(n = 100, p = .12345, size = (3, 2))
+ actual = np.random.negative_binomial(n=100, p=.12345, size=(3, 2))
desired = np.array([[848, 841],
[892, 611],
[779, 647]])
@@ -534,6 +629,12 @@ class TestRandomDist(TestCase):
[ 1.19153771588353052, 1.83509849681825354]])
np.testing.assert_array_almost_equal(actual, desired, decimal=15)
+ def test_vonmises_small(self):
+ # check infinite loop, gh-4720
+ np.random.seed(self.seed)
+ r = np.random.vonmises(mu=0., kappa=1.1e-8, size=10**6)
+ np.testing.assert_(np.isfinite(r).all())
+
def test_wald(self):
np.random.seed(self.seed)
actual = np.random.wald(mean = 1.23, scale = 1.54, size = (3, 2))
@@ -558,5 +659,45 @@ class TestRandomDist(TestCase):
[ 3, 13]])
np.testing.assert_array_equal(actual, desired)
+
+class TestThread:
+ """ make sure each state produces the same sequence even in threads """
+ def setUp(self):
+ self.seeds = range(4)
+
+ def check_function(self, function, sz):
+ from threading import Thread
+
+ out1 = np.empty((len(self.seeds),) + sz)
+ out2 = np.empty((len(self.seeds),) + sz)
+
+ # threaded generation
+ t = [Thread(target=function, args=(np.random.RandomState(s), o))
+ for s, o in zip(self.seeds, out1)]
+ [x.start() for x in t]
+ [x.join() for x in t]
+
+ # the same serial
+ for s, o in zip(self.seeds, out2):
+ function(np.random.RandomState(s), o)
+
+ np.testing.assert_array_equal(out1, out2)
+
+ def test_normal(self):
+ def gen_random(state, out):
+ out[...] = state.normal(size=10000)
+ self.check_function(gen_random, sz=(10000,))
+
+ def test_exp(self):
+ def gen_random(state, out):
+ out[...] = state.exponential(scale=np.ones((100, 1000)))
+ self.check_function(gen_random, sz=(100, 1000))
+
+ def test_multinomial(self):
+ def gen_random(state, out):
+ out[...] = state.multinomial(10, [1/6.]*6, size=10000)
+ self.check_function(gen_random, sz=(10000,6))
+
+
if __name__ == "__main__":
run_module_suite()
diff --git a/numpy/testing/__init__.py b/numpy/testing/__init__.py
index aad448c96..258cbe928 100644
--- a/numpy/testing/__init__.py
+++ b/numpy/testing/__init__.py
@@ -11,7 +11,6 @@ from unittest import TestCase
from . import decorators as dec
from .utils import *
-from .numpytest import importall # remove for numpy 1.9.0
from .nosetester import NoseTester as Tester
from .nosetester import run_module_suite
test = Tester().test
diff --git a/numpy/testing/nosetester.py b/numpy/testing/nosetester.py
index 77ac61074..a06d559e7 100644
--- a/numpy/testing/nosetester.py
+++ b/numpy/testing/nosetester.py
@@ -75,14 +75,55 @@ def import_nose():
return nose
-def run_module_suite(file_to_run = None):
+def run_module_suite(file_to_run=None, argv=None):
+ """
+ Run a test module.
+
+ Equivalent to calling ``$ nosetests <argv> <file_to_run>`` from
+ the command line
+
+ Parameters
+ ----------
+ file_to_run: str, optional
+ Path to test module, or None.
+ By default, run the module from which this function is called.
+ argv: list of strings
+ Arguments to be passed to the nose test runner. ``argv[0]`` is
+ ignored. All command line arguments accepted by ``nosetests``
+ will work.
+
+ .. versionadded:: 1.9.0
+
+ Examples
+ --------
+ Adding the following::
+
+ if __name__ == "__main__" :
+ run_module_suite(argv=sys.argv)
+
+ at the end of a test module will run the tests when that module is
+ called in the python interpreter.
+
+ Alternatively, calling::
+
+ >>> run_module_suite(file_to_run="numpy/tests/test_matlib.py")
+
+ from an interpreter will run all the test routine in 'test_matlib.py'.
+ """
if file_to_run is None:
f = sys._getframe(1)
file_to_run = f.f_locals.get('__file__', None)
if file_to_run is None:
raise AssertionError
- import_nose().run(argv=['', file_to_run])
+ if argv is None:
+ argv = ['', file_to_run]
+ else:
+ argv = argv + [file_to_run]
+
+ nose = import_nose()
+ from .noseclasses import KnownFailure
+ nose.run(argv=argv, addplugins=[KnownFailure()])
class NoseTester(object):
@@ -378,6 +419,10 @@ class NoseTester(object):
warnings.filterwarnings("ignore", message="numpy.ufunc size changed")
warnings.filterwarnings("ignore", category=ModuleDeprecationWarning)
warnings.filterwarnings("ignore", category=FutureWarning)
+ # Filter out boolean '-' deprecation messages. This allows
+ # older versions of scipy to test without a flood of messages.
+ warnings.filterwarnings("ignore", message=".*boolean negative.*")
+ warnings.filterwarnings("ignore", message=".*boolean subtract.*")
from .noseclasses import NumpyTestProgram
diff --git a/numpy/testing/numpytest.py b/numpy/testing/numpytest.py
deleted file mode 100644
index d83a21d83..000000000
--- a/numpy/testing/numpytest.py
+++ /dev/null
@@ -1,36 +0,0 @@
-from __future__ import division, absolute_import, print_function
-
-import os
-import warnings
-
-__all__ = ['importall']
-
-
-def importall(package):
- """
- `importall` is DEPRECATED and will be removed in numpy 1.9.0
-
- Try recursively to import all subpackages under package.
- """
- warnings.warn("`importall is deprecated, and will be remobed in numpy 1.9.0",
- DeprecationWarning)
-
- if isinstance(package, str):
- package = __import__(package)
-
- package_name = package.__name__
- package_dir = os.path.dirname(package.__file__)
- for subpackage_name in os.listdir(package_dir):
- subdir = os.path.join(package_dir, subpackage_name)
- if not os.path.isdir(subdir):
- continue
- if not os.path.isfile(os.path.join(subdir, '__init__.py')):
- continue
- name = package_name+'.'+subpackage_name
- try:
- exec('import %s as m' % (name))
- except Exception as msg:
- print('Failed importing %s: %s' %(name, msg))
- continue
- importall(m)
- return
diff --git a/numpy/testing/tests/test_utils.py b/numpy/testing/tests/test_utils.py
index 94fc4d655..aa0a2669f 100644
--- a/numpy/testing/tests/test_utils.py
+++ b/numpy/testing/tests/test_utils.py
@@ -53,6 +53,9 @@ class _GenericTest(object):
a = np.array([1, 1], dtype=np.object)
self._test_equal(a, 1)
+ def test_array_likes(self):
+ self._test_equal([1, 2, 3], (1, 2, 3))
+
class TestArrayEqual(_GenericTest, unittest.TestCase):
def setUp(self):
self._assert_func = assert_array_equal
@@ -131,6 +134,49 @@ class TestArrayEqual(_GenericTest, unittest.TestCase):
self._test_not_equal(c, b)
+class TestBuildErrorMessage(unittest.TestCase):
+ def test_build_err_msg_defaults(self):
+ x = np.array([1.00001, 2.00002, 3.00003])
+ y = np.array([1.00002, 2.00003, 3.00004])
+ err_msg = 'There is a mismatch'
+
+ a = build_err_msg([x, y], err_msg)
+ b = ('\nItems are not equal: There is a mismatch\n ACTUAL: array([ '
+ '1.00001, 2.00002, 3.00003])\n DESIRED: array([ 1.00002, '
+ '2.00003, 3.00004])')
+ self.assertEqual(a, b)
+
+ def test_build_err_msg_no_verbose(self):
+ x = np.array([1.00001, 2.00002, 3.00003])
+ y = np.array([1.00002, 2.00003, 3.00004])
+ err_msg = 'There is a mismatch'
+
+ a = build_err_msg([x, y], err_msg, verbose=False)
+ b = '\nItems are not equal: There is a mismatch'
+ self.assertEqual(a, b)
+
+ def test_build_err_msg_custom_names(self):
+ x = np.array([1.00001, 2.00002, 3.00003])
+ y = np.array([1.00002, 2.00003, 3.00004])
+ err_msg = 'There is a mismatch'
+
+ a = build_err_msg([x, y], err_msg, names=('FOO', 'BAR'))
+ b = ('\nItems are not equal: There is a mismatch\n FOO: array([ '
+ '1.00001, 2.00002, 3.00003])\n BAR: array([ 1.00002, 2.00003, '
+ '3.00004])')
+ self.assertEqual(a, b)
+
+ def test_build_err_msg_custom_precision(self):
+ x = np.array([1.000000001, 2.00002, 3.00003])
+ y = np.array([1.000000002, 2.00003, 3.00004])
+ err_msg = 'There is a mismatch'
+
+ a = build_err_msg([x, y], err_msg, precision=10)
+ b = ('\nItems are not equal: There is a mismatch\n ACTUAL: array([ '
+ '1.000000001, 2.00002 , 3.00003 ])\n DESIRED: array([ '
+ '1.000000002, 2.00003 , 3.00004 ])')
+ self.assertEqual(a, b)
+
class TestEqual(TestArrayEqual):
def setUp(self):
self._assert_func = assert_equal
@@ -236,6 +282,31 @@ class TestAlmostEqual(_GenericTest, unittest.TestCase):
self._test_not_equal(x, y)
self._test_not_equal(x, z)
+ def test_error_message(self):
+ """Check the message is formatted correctly for the decimal value"""
+ x = np.array([1.00000000001, 2.00000000002, 3.00003])
+ y = np.array([1.00000000002, 2.00000000003, 3.00004])
+
+ # test with a different amount of decimal digits
+ # note that we only check for the formatting of the arrays themselves
+ b = ('x: array([ 1.00000000001, 2.00000000002, 3.00003 '
+ ' ])\n y: array([ 1.00000000002, 2.00000000003, 3.00004 ])')
+ try:
+ self._assert_func(x, y, decimal=12)
+ except AssertionError as e:
+ # remove anything that's not the array string
+ self.assertEqual(str(e).split('%)\n ')[1], b)
+
+ # with the default value of decimal digits, only the 3rd element differs
+ # note that we only check for the formatting of the arrays themselves
+ b = ('x: array([ 1. , 2. , 3.00003])\n y: array([ 1. , '
+ '2. , 3.00004])')
+ try:
+ self._assert_func(x, y)
+ except AssertionError as e:
+ # remove anything that's not the array string
+ self.assertEqual(str(e).split('%)\n ')[1], b)
+
class TestApproxEqual(unittest.TestCase):
def setUp(self):
self._assert_func = assert_approx_equal
@@ -373,6 +444,11 @@ class TestAssertAllclose(unittest.TestCase):
assert_allclose(6, 10, rtol=0.5)
self.assertRaises(AssertionError, assert_allclose, 10, 6, rtol=0.5)
+ def test_min_int(self):
+ a = np.array([np.iinfo(np.int_).min], dtype=np.int_)
+ # Should not raise:
+ assert_allclose(a, a)
+
class TestArrayAlmostEqualNulp(unittest.TestCase):
@dec.knownfailureif(True, "Github issue #347")
diff --git a/numpy/testing/utils.py b/numpy/testing/utils.py
index 2a99fe5cb..13c3e4610 100644
--- a/numpy/testing/utils.py
+++ b/numpy/testing/utils.py
@@ -9,8 +9,12 @@ import sys
import re
import operator
import warnings
+from functools import partial
+import shutil
+import contextlib
+from tempfile import mkdtemp
from .nosetester import import_nose
-from numpy.core import float32, empty, arange
+from numpy.core import float32, empty, arange, array_repr, ndarray
if sys.version_info[0] >= 3:
from io import StringIO
@@ -22,7 +26,7 @@ __all__ = ['assert_equal', 'assert_almost_equal', 'assert_approx_equal',
'assert_array_almost_equal', 'assert_raises', 'build_err_msg',
'decorate_methods', 'jiffies', 'memusage', 'print_assert_equal',
'raises', 'rand', 'rundocs', 'runstring', 'verbose', 'measure',
- 'assert_', 'assert_array_almost_equal_nulp',
+ 'assert_', 'assert_array_almost_equal_nulp', 'assert_raises_regex',
'assert_array_max_ulp', 'assert_warns', 'assert_no_warnings',
'assert_allclose', 'IgnoreException']
@@ -190,8 +194,7 @@ if os.name=='nt' and sys.version[:3] > '2.3':
win32pdh.PDH_FMT_LONG, None)
def build_err_msg(arrays, err_msg, header='Items are not equal:',
- verbose=True,
- names=('ACTUAL', 'DESIRED')):
+ verbose=True, names=('ACTUAL', 'DESIRED'), precision=8):
msg = ['\n' + header]
if err_msg:
if err_msg.find('\n') == -1 and len(err_msg) < 79-len(header):
@@ -200,8 +203,15 @@ def build_err_msg(arrays, err_msg, header='Items are not equal:',
msg.append(err_msg)
if verbose:
for i, a in enumerate(arrays):
+
+ if isinstance(a, ndarray):
+ # precision argument is only needed if the objects are ndarrays
+ r_func = partial(array_repr, precision=precision)
+ else:
+ r_func = repr
+
try:
- r = repr(a)
+ r = r_func(a)
except:
r = '[repr failed]'
if r.count('\n') > 3:
@@ -318,7 +328,9 @@ def assert_equal(actual,desired,err_msg='',verbose=True):
# as before
except (TypeError, ValueError, NotImplementedError):
pass
- if desired != actual :
+
+ # Explicitly use __eq__ for comparison, ticket #2552
+ if not (desired == actual):
raise AssertionError(msg)
def print_assert_equal(test_string, actual, desired):
@@ -573,7 +585,7 @@ def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True):
raise AssertionError(msg)
def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
- header=''):
+ header='', precision=6):
from numpy.core import array, isnan, isinf, any, all, inf
x = array(x, copy=False, subok=True)
y = array(y, copy=False, subok=True)
@@ -590,7 +602,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
msg = build_err_msg([x, y],
err_msg + '\nx and y %s location mismatch:' \
% (hasval), verbose=verbose, header=header,
- names=('x', 'y'))
+ names=('x', 'y'), precision=precision)
raise AssertionError(msg)
try:
@@ -601,7 +613,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
+ '\n(shapes %s, %s mismatch)' % (x.shape,
y.shape),
verbose=verbose, header=header,
- names=('x', 'y'))
+ names=('x', 'y'), precision=precision)
if not cond :
raise AssertionError(msg)
@@ -646,7 +658,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
err_msg
+ '\n(mismatch %s%%)' % (match,),
verbose=verbose, header=header,
- names=('x', 'y'))
+ names=('x', 'y'), precision=precision)
if not cond :
raise AssertionError(msg)
except ValueError as e:
@@ -655,7 +667,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True,
header = 'error during assertion:\n\n%s\n\n%s' % (efmt, header)
msg = build_err_msg([x, y], err_msg, verbose=verbose, header=header,
- names=('x', 'y'))
+ names=('x', 'y'), precision=precision)
raise ValueError(msg)
def assert_array_equal(x, y, err_msg='', verbose=True):
@@ -793,7 +805,7 @@ def assert_array_almost_equal(x, y, decimal=6, err_msg='', verbose=True):
y: array([ 1. , 2.33333, 5. ])
"""
- from numpy.core import around, number, float_
+ from numpy.core import around, number, float_, result_type, array
from numpy.core.numerictypes import issubdtype
from numpy.core.fromnumeric import any as npany
def compare(x, y):
@@ -810,12 +822,22 @@ def assert_array_almost_equal(x, y, decimal=6, err_msg='', verbose=True):
y = y[~yinfid]
except (TypeError, NotImplementedError):
pass
+
+ # make sure y is an inexact type to avoid abs(MIN_INT); will cause
+ # casting of x later.
+ dtype = result_type(y, 1.)
+ y = array(y, dtype=dtype, copy=False)
z = abs(x-y)
+
if not issubdtype(z.dtype, number):
z = z.astype(float_) # handle object arrays
+
return around(z, decimal) <= 10.0**(-decimal)
+
assert_array_compare(compare, x, y, err_msg=err_msg, verbose=verbose,
- header=('Arrays are not almost equal to %d decimals' % decimal))
+ header=('Arrays are not almost equal to %d decimals' % decimal),
+ precision=decimal)
+
def assert_array_less(x, y, err_msg='', verbose=True):
"""
@@ -1011,6 +1033,7 @@ def raises(*args,**kwargs):
nose = import_nose()
return nose.tools.raises(*args,**kwargs)
+
def assert_raises(*args,**kwargs):
"""
assert_raises(exception_class, callable, *args, **kwargs)
@@ -1026,6 +1049,85 @@ def assert_raises(*args,**kwargs):
nose = import_nose()
return nose.tools.assert_raises(*args,**kwargs)
+
+assert_raises_regex_impl = None
+
+
+def assert_raises_regex(exception_class, expected_regexp,
+ callable_obj=None, *args, **kwargs):
+ """
+ Fail unless an exception of class exception_class and with message that
+ matches expected_regexp is thrown by callable when invoked with arguments
+ args and keyword arguments kwargs.
+
+ Name of this function adheres to Python 3.2+ reference, but should work in
+ all versions down to 2.6.
+
+ """
+ nose = import_nose()
+
+ global assert_raises_regex_impl
+ if assert_raises_regex_impl is None:
+ try:
+ # Python 3.2+
+ assert_raises_regex_impl = nose.tools.assert_raises_regex
+ except AttributeError:
+ try:
+ # 2.7+
+ assert_raises_regex_impl = nose.tools.assert_raises_regexp
+ except AttributeError:
+ # 2.6
+
+ # This class is copied from Python2.7 stdlib almost verbatim
+ class _AssertRaisesContext(object):
+ """A context manager used to implement TestCase.assertRaises* methods."""
+
+ def __init__(self, expected, expected_regexp=None):
+ self.expected = expected
+ self.expected_regexp = expected_regexp
+
+ def failureException(self, msg):
+ return AssertionError(msg)
+
+ def __enter__(self):
+ return self
+
+ def __exit__(self, exc_type, exc_value, tb):
+ if exc_type is None:
+ try:
+ exc_name = self.expected.__name__
+ except AttributeError:
+ exc_name = str(self.expected)
+ raise self.failureException(
+ "{0} not raised".format(exc_name))
+ if not issubclass(exc_type, self.expected):
+ # let unexpected exceptions pass through
+ return False
+ self.exception = exc_value # store for later retrieval
+ if self.expected_regexp is None:
+ return True
+
+ expected_regexp = self.expected_regexp
+ if isinstance(expected_regexp, basestring):
+ expected_regexp = re.compile(expected_regexp)
+ if not expected_regexp.search(str(exc_value)):
+ raise self.failureException(
+ '"%s" does not match "%s"' %
+ (expected_regexp.pattern, str(exc_value)))
+ return True
+
+ def impl(cls, regex, callable_obj, *a, **kw):
+ mgr = _AssertRaisesContext(cls, regex)
+ if callable_obj is None:
+ return mgr
+ with mgr:
+ callable_obj(*a, **kw)
+ assert_raises_regex_impl = impl
+
+ return assert_raises_regex_impl(exception_class, expected_regexp,
+ callable_obj, *args, **kwargs)
+
+
def decorate_methods(cls, decorator, testmatch=None):
"""
Apply a decorator to all methods in a class matching a regular expression.
@@ -1147,6 +1249,8 @@ def assert_allclose(actual, desired, rtol=1e-7, atol=0,
It compares the difference between `actual` and `desired` to
``atol + rtol * abs(desired)``.
+ .. versionadded:: 1.5.0
+
Parameters
----------
actual : array_like
@@ -1231,7 +1335,6 @@ def assert_array_almost_equal_nulp(x, y, nulp=1):
>>> np.testing.assert_array_almost_equal_nulp(x, x*eps/2 + x)
>>> np.testing.assert_array_almost_equal_nulp(x, x*eps + x)
- ------------------------------------------------------------
Traceback (most recent call last):
...
AssertionError: X and Y are not equal to 1 ULP (max is 2)
@@ -1456,6 +1559,7 @@ class WarningManager(object):
self._module.filters = self._filters
self._module.showwarning = self._showwarning
+
def assert_warns(warning_class, func, *args, **kw):
"""
Fail unless the given callable throws the specified warning.
@@ -1465,6 +1569,8 @@ def assert_warns(warning_class, func, *args, **kw):
If a different type of warning is thrown, it will not be caught, and the
test case will be deemed to have suffered an error.
+ .. versionadded:: 1.4.0
+
Parameters
----------
warning_class : class
@@ -1496,6 +1602,8 @@ def assert_no_warnings(func, *args, **kw):
"""
Fail if the given callable produces any warnings.
+ .. versionadded:: 1.7.0
+
Parameters
----------
func : callable
@@ -1587,3 +1695,16 @@ def _gen_alignment_data(dtype=float32, type='binary', max_size=24):
class IgnoreException(Exception):
"Ignoring this exception due to disabled feature"
+
+
+@contextlib.contextmanager
+def tempdir(*args, **kwargs):
+ """Context manager to provide a temporary test folder.
+
+ All arguments are passed as this to the underlying tempfile.mkdtemp
+ function.
+
+ """
+ tmpdir = mkdtemp(*args, **kwargs)
+ yield tmpdir
+ shutil.rmtree(tmpdir)
diff --git a/pavement.py b/pavement.py
index b1a4d7318..c0b5cb2d4 100644
--- a/pavement.py
+++ b/pavement.py
@@ -67,6 +67,7 @@ import subprocess
import re
try:
from hashlib import md5
+ from hashlib import sha256
except ImportError:
from md5 import md5
@@ -137,6 +138,7 @@ MPKG_PYTHON = {
"2.7": ["/Library/Frameworks/Python.framework/Versions/2.7/bin/python"],
"3.2": ["/Library/Frameworks/Python.framework/Versions/3.2/bin/python3"],
"3.3": ["/Library/Frameworks/Python.framework/Versions/3.3/bin/python3"],
+ "3.4": ["/Library/Frameworks/Python.framework/Versions/3.4/bin/python3"],
}
SSE3_CFG = {'ATLAS': r'C:\local\lib\atlas\sse3'}
@@ -147,6 +149,7 @@ SITECFG = {"sse2" : SSE2_CFG, "sse3" : SSE3_CFG, "nosse" : NOSSE_CFG}
if sys.platform =="darwin":
WINDOWS_PYTHON = {
+ "3.4": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python34/python.exe"],
"3.3": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python33/python.exe"],
"3.2": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python32/python.exe"],
"2.7": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python27/python.exe"],
@@ -157,6 +160,7 @@ if sys.platform =="darwin":
MAKENSIS = ["wine", "makensis"]
elif sys.platform == "win32":
WINDOWS_PYTHON = {
+ "3.4": ["C:\Python34\python.exe"],
"3.3": ["C:\Python33\python.exe"],
"3.2": ["C:\Python32\python.exe"],
"2.7": ["C:\Python27\python.exe"],
@@ -168,6 +172,7 @@ elif sys.platform == "win32":
MAKENSIS = ["makensis"]
else:
WINDOWS_PYTHON = {
+ "3.4": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python34/python.exe"],
"3.3": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python33/python.exe"],
"3.2": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python32/python.exe"],
"2.7": ["wine", os.environ['HOME'] + "/.wine/drive_c/Python27/python.exe"],
@@ -561,9 +566,20 @@ def sdist(options):
def compute_md5(idirs):
released = paver.path.path(idirs).listdir()
checksums = []
- for f in released:
+ for f in sorted(released):
m = md5(open(f, 'r').read())
- checksums.append('%s %s' % (m.hexdigest(), f))
+ checksums.append('%s %s' % (m.hexdigest(), os.path.basename(f)))
+
+ return checksums
+
+def compute_sha256(idirs):
+ # better checksum so gpg signed README.txt containing the sums can be used
+ # to verify the binaries instead of signing all binaries
+ released = paver.path.path(idirs).listdir()
+ checksums = []
+ for f in sorted(released):
+ m = sha256(open(f, 'r').read())
+ checksums.append('%s %s' % (m.hexdigest(), os.path.basename(f)))
return checksums
@@ -579,8 +595,17 @@ def write_release_task(options, filename='NOTES.txt'):
Checksums
=========
+MD5
+~~~
+
""")
ftarget.writelines(['%s\n' % c for c in compute_md5(idirs)])
+ ftarget.writelines("""
+SHA256
+~~~~~~
+
+""")
+ ftarget.writelines(['%s\n' % c for c in compute_sha256(idirs)])
def write_log_task(options, filename='Changelog'):
st = subprocess.Popen(
diff --git a/setup.py b/setup.py
index 2fb0a5eae..12eb29093 100755
--- a/setup.py
+++ b/setup.py
@@ -151,6 +151,44 @@ def configuration(parent_package='',top_path=None):
return config
+def check_submodules():
+ """ verify that the submodules are checked out and clean
+ use `git submodule update --init`; on failure
+ """
+ if not os.path.exists('.git'):
+ return
+ with open('.gitmodules') as f:
+ for l in f:
+ if 'path' in l:
+ p = l.split('=')[-1].strip()
+ if not os.path.exists(p):
+ raise ValueError('Submodule %s missing' % p)
+
+
+ proc = subprocess.Popen(['git', 'submodule', 'status'],
+ stdout=subprocess.PIPE)
+ status, _ = proc.communicate()
+ status = status.decode("ascii", "replace")
+ for line in status.splitlines():
+ if line.startswith('-') or line.startswith('+'):
+ raise ValueError('Submodule not clean: %s' % line)
+
+from distutils.command.sdist import sdist
+class sdist_checked(sdist):
+ """ check submodules on sdist to prevent incomplete tarballs """
+ def run(self):
+ check_submodules()
+ sdist.run(self)
+
+def generate_cython():
+ cwd = os.path.abspath(os.path.dirname(__file__))
+ print("Cythonizing sources")
+ p = subprocess.call([sys.executable,
+ os.path.join(cwd, 'tools', 'cythonize.py'),
+ 'numpy/random'],
+ cwd=cwd)
+ if p != 0:
+ raise RuntimeError("Running cythonize failed!")
def setup_package():
src_path = os.path.dirname(os.path.abspath(sys.argv[0]))
@@ -174,6 +212,7 @@ def setup_package():
classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"],
test_suite='nose.collector',
+ cmdclass={"sdist": sdist_checked},
)
# Run build
@@ -189,13 +228,15 @@ def setup_package():
FULLVERSION, GIT_REVISION = get_version_info()
metadata['version'] = FULLVERSION
- elif len(sys.argv) >= 2 and sys.argv[1] == 'bdist_wheel':
- # bdist_wheel needs setuptools
- import setuptools
- from numpy.distutils.core import setup
- metadata['configuration'] = configuration
else:
+ if len(sys.argv) >= 2 and sys.argv[1] == 'bdist_wheel':
+ # bdist_wheel needs setuptools
+ import setuptools
from numpy.distutils.core import setup
+ cwd = os.path.abspath(os.path.dirname(__file__))
+ if not os.path.exists(os.path.join(cwd, 'PKG-INFO')):
+ # Generate Cython sources, unless building from source release
+ generate_cython()
metadata['configuration'] = configuration
try:
diff --git a/site.cfg.example b/site.cfg.example
index 4cf4a33a4..714ab6311 100644
--- a/site.cfg.example
+++ b/site.cfg.example
@@ -83,6 +83,21 @@
# for your configuration (in the following example we installed OpenBLAS with
# ``make install PREFIX=/opt/OpenBLAS``.
#
+# **Warning**: OpenBLAS, by default, is built in multithreaded mode. Due to the
+# way Python's multiprocessing is implemented, a multithreaded OpenBLAS can
+# cause programs using both to hang as soon as a worker process is forked on
+# POSIX systems (Linux, Mac).
+# This is fixed in Openblas 0.2.9 for the pthread build, the OpenMP build using
+# GNU openmp is as of gcc-4.9 not fixed yet.
+# Python 3.4 will introduce a new feature in multiprocessing, called the
+# "forkserver", which solves this problem. For older versions, make sure
+# OpenBLAS is built using pthreads or use Python threads instead of
+# multiprocessing.
+# (This problem does not exist with multithreaded ATLAS.)
+#
+# http://docs.python.org/3.4/library/multiprocessing.html#contexts-and-start-methods
+# https://github.com/xianyi/OpenBLAS/issues/294
+#
# [openblas]
# libraries = openblas
# library_dirs = /opt/OpenBLAS/lib
diff --git a/tools/allocation_tracking/track_allocations.py b/tools/allocation_tracking/track_allocations.py
index 2006217c2..dfc354eb5 100644
--- a/tools/allocation_tracking/track_allocations.py
+++ b/tools/allocation_tracking/track_allocations.py
@@ -1,6 +1,7 @@
from __future__ import division, absolute_import, print_function
import numpy as np
+import gc
import inspect
from alloc_hook import NumpyAllocHook
@@ -35,12 +36,21 @@ class AllocationTracker(object):
self.numpy_hook.__exit__()
def hook(self, inptr, outptr, size):
+ # minimize the chances that the garbage collector kicks in during a
+ # cython __dealloc__ call and causes a double delete of the current
+ # object. To avoid this fully the hook would have to avoid all python
+ # api calls, e.g. by being implemented in C like python 3.4's
+ # tracemalloc module
+ gc_on = gc.isenabled()
+ gc.disable()
if outptr == 0: # it's a free
self.free_cb(inptr)
elif inptr != 0: # realloc
self.realloc_cb(inptr, outptr, size)
else: # malloc
self.alloc_cb(outptr, size)
+ if gc_on:
+ gc.enable()
def alloc_cb(self, ptr, size):
if size >= self.threshold:
diff --git a/tools/cythonize.py b/tools/cythonize.py
new file mode 100755
index 000000000..4ab10a058
--- /dev/null
+++ b/tools/cythonize.py
@@ -0,0 +1,199 @@
+#!/usr/bin/env python
+""" cythonize
+
+Cythonize pyx files into C files as needed.
+
+Usage: cythonize [root_dir]
+
+Default [root_dir] is 'numpy'.
+
+Checks pyx files to see if they have been changed relative to their
+corresponding C files. If they have, then runs cython on these files to
+recreate the C files.
+
+The script thinks that the pyx files have changed relative to the C files
+by comparing hashes stored in a database file.
+
+Simple script to invoke Cython (and Tempita) on all .pyx (.pyx.in)
+files; while waiting for a proper build system. Uses file hashes to
+figure out if rebuild is needed.
+
+For now, this script should be run by developers when changing Cython files
+only, and the resulting C files checked in, so that end-users (and Python-only
+developers) do not get the Cython/Tempita dependencies.
+
+Originally written by Dag Sverre Seljebotn, and copied here from:
+
+https://raw.github.com/dagss/private-scipy-refactor/cythonize/cythonize.py
+
+Note: this script does not check any of the dependent C libraries; it only
+operates on the Cython .pyx files.
+"""
+
+from __future__ import division, print_function, absolute_import
+
+import os
+import re
+import sys
+import hashlib
+import subprocess
+
+HASH_FILE = 'cythonize.dat'
+DEFAULT_ROOT = 'numpy'
+VENDOR = 'NumPy'
+
+# WindowsError is not defined on unix systems
+try:
+ WindowsError
+except NameError:
+ WindowsError = None
+
+#
+# Rules
+#
+def process_pyx(fromfile, tofile):
+ try:
+ from Cython.Compiler.Version import version as cython_version
+ from distutils.version import LooseVersion
+ if LooseVersion(cython_version) < LooseVersion('0.19'):
+ raise Exception('Building %s requires Cython >= 0.19' % VENDOR)
+
+ except ImportError:
+ pass
+
+ flags = ['--fast-fail']
+ if tofile.endswith('.cxx'):
+ flags += ['--cplus']
+
+ try:
+ try:
+ r = subprocess.call(['cython'] + flags + ["-o", tofile, fromfile])
+ if r != 0:
+ raise Exception('Cython failed')
+ except OSError:
+ # There are ways of installing Cython that don't result in a cython
+ # executable on the path, see gh-2397.
+ r = subprocess.call([sys.executable, '-c',
+ 'import sys; from Cython.Compiler.Main import '
+ 'setuptools_main as main; sys.exit(main())'] + flags +
+ ["-o", tofile, fromfile])
+ if r != 0:
+ raise Exception('Cython failed')
+ except OSError:
+ raise OSError('Cython needs to be installed')
+
+def process_tempita_pyx(fromfile, tofile):
+ try:
+ try:
+ from Cython import Tempita as tempita
+ except ImportError:
+ import tempita
+ except ImportError:
+ raise Exception('Building %s requires Tempita: '
+ 'pip install --user Tempita' % VENDOR)
+ with open(fromfile, "r") as f:
+ tmpl = f.read()
+ pyxcontent = tempita.sub(tmpl)
+ assert fromfile.endswith('.pyx.in')
+ pyxfile = fromfile[:-len('.pyx.in')] + '.pyx'
+ with open(pyxfile, "w") as f:
+ f.write(pyxcontent)
+ process_pyx(pyxfile, tofile)
+
+rules = {
+ # fromext : function
+ '.pyx' : process_pyx,
+ '.pyx.in' : process_tempita_pyx
+ }
+#
+# Hash db
+#
+def load_hashes(filename):
+ # Return { filename : (sha1 of input, sha1 of output) }
+ if os.path.isfile(filename):
+ hashes = {}
+ with open(filename, 'r') as f:
+ for line in f:
+ filename, inhash, outhash = line.split()
+ hashes[filename] = (inhash, outhash)
+ else:
+ hashes = {}
+ return hashes
+
+def save_hashes(hash_db, filename):
+ with open(filename, 'w') as f:
+ for key, value in sorted(hash_db.items()):
+ f.write("%s %s %s\n" % (key, value[0], value[1]))
+
+def sha1_of_file(filename):
+ h = hashlib.sha1()
+ with open(filename, "rb") as f:
+ h.update(f.read())
+ return h.hexdigest()
+
+#
+# Main program
+#
+
+def normpath(path):
+ path = path.replace(os.sep, '/')
+ if path.startswith('./'):
+ path = path[2:]
+ return path
+
+def get_hash(frompath, topath):
+ from_hash = sha1_of_file(frompath)
+ to_hash = sha1_of_file(topath) if os.path.exists(topath) else None
+ return (from_hash, to_hash)
+
+def process(path, fromfile, tofile, processor_function, hash_db):
+ fullfrompath = os.path.join(path, fromfile)
+ fulltopath = os.path.join(path, tofile)
+ current_hash = get_hash(fullfrompath, fulltopath)
+ if current_hash == hash_db.get(normpath(fullfrompath), None):
+ print('%s has not changed' % fullfrompath)
+ return
+
+ orig_cwd = os.getcwd()
+ try:
+ os.chdir(path)
+ print('Processing %s' % fullfrompath)
+ processor_function(fromfile, tofile)
+ finally:
+ os.chdir(orig_cwd)
+ # changed target file, recompute hash
+ current_hash = get_hash(fullfrompath, fulltopath)
+ # store hash in db
+ hash_db[normpath(fullfrompath)] = current_hash
+
+
+def find_process_files(root_dir):
+ hash_db = load_hashes(HASH_FILE)
+ for cur_dir, dirs, files in os.walk(root_dir):
+ for filename in files:
+ in_file = os.path.join(cur_dir, filename + ".in")
+ if filename.endswith('.pyx') and os.path.isfile(in_file):
+ continue
+ for fromext, function in rules.items():
+ if filename.endswith(fromext):
+ toext = ".c"
+ with open(os.path.join(cur_dir, filename), 'rb') as f:
+ data = f.read()
+ m = re.search(br"^\s*#\s*distutils:\s*language\s*=\s*c\+\+\s*$", data, re.I|re.M)
+ if m:
+ toext = ".cxx"
+ fromfile = filename
+ tofile = filename[:-len(fromext)] + toext
+ process(cur_dir, fromfile, tofile, function, hash_db)
+ save_hashes(hash_db, HASH_FILE)
+
+def main():
+ try:
+ root_dir = sys.argv[1]
+ except IndexError:
+ root_dir = DEFAULT_ROOT
+ find_process_files(root_dir)
+
+
+if __name__ == '__main__':
+ main()
diff --git a/doc/swig/Makefile b/tools/swig/Makefile
index 0478ac76f..0478ac76f 100644
--- a/doc/swig/Makefile
+++ b/tools/swig/Makefile
diff --git a/doc/swig/README b/tools/swig/README
index df5dbfc47..1f05b106c 100644
--- a/doc/swig/README
+++ b/tools/swig/README
@@ -1,5 +1,5 @@
-Notes for the numpy/doc/swig directory
-======================================
+Notes for the numpy/tools/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
@@ -10,7 +10,7 @@ distribution.
Documentation
-------------
Documentation for how to use numpy.i, as well as for the testing
-system used here, can be found in the NumPy reference guide.
+system used here, can be found in the NumPy reference guide.
Testing
-------
diff --git a/doc/swig/numpy.i b/tools/swig/numpy.i
index f2714cc34..217acd5bf 100644
--- a/doc/swig/numpy.i
+++ b/tools/swig/numpy.i
@@ -872,7 +872,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[2] = { -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input,
+ array = obj_to_array_fortran_allow_conversion($input,
DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 2) ||
@@ -996,7 +996,7 @@
size[0] = array_size(temp_array,0);
size[1] = array_size(temp_array,1);
}
-
+
if (!require_size(temp_array, size, 2)) SWIG_fail;
array[i] = (DATA_TYPE*) array_data(temp_array);
@@ -1106,7 +1106,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[3] = { -1, -1, -1 };
- array = obj_to_array_contiguous_allow_conversion($input,
+ array = obj_to_array_fortran_allow_conversion($input,
DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 3) ||
@@ -1232,7 +1232,7 @@
size[1] = array_size(temp_array,1);
size[2] = array_size(temp_array,2);
}
-
+
if (!require_size(temp_array, size, 3)) SWIG_fail;
array[i] = (DATA_TYPE*) array_data(temp_array);
@@ -1345,7 +1345,7 @@
(PyArrayObject* array=NULL, int is_new_object=0)
{
npy_intp size[4] = { -1, -1, -1 , -1 };
- array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE,
+ array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE,
&is_new_object);
if (!array || !require_dimensions(array, 4) ||
!require_size(array, size, 4) || !require_fortran(array)) SWIG_fail;
@@ -1634,7 +1634,7 @@
size[0] = array_size(temp_array,0);
size[1] = array_size(temp_array,1);
}
-
+
if (!require_size(temp_array, size, 2)) SWIG_fail;
array[i] = (DATA_TYPE*) array_data(temp_array);
@@ -1819,7 +1819,7 @@
size[1] = array_size(temp_array,1);
size[2] = array_size(temp_array,2);
}
-
+
if (!require_size(temp_array, size, 3)) SWIG_fail;
array[i] = (DATA_TYPE*) array_data(temp_array);
@@ -2246,7 +2246,7 @@
PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$1));
PyArrayObject* array = (PyArrayObject*) obj;
- if (!array || require_fortran(array)) SWIG_fail;
+ if (!array || !require_fortran(array)) SWIG_fail;
$result = SWIG_Python_AppendOutput($result,obj);
}
@@ -2270,7 +2270,7 @@
PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$4));
PyArrayObject* array = (PyArrayObject*) obj;
- if (!array || require_fortran(array)) SWIG_fail;
+ if (!array || !require_fortran(array)) SWIG_fail;
$result = SWIG_Python_AppendOutput($result,obj);
}
@@ -2345,7 +2345,7 @@
PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1));
PyArrayObject* array = (PyArrayObject*) obj;
- if (!array || require_fortran(array)) SWIG_fail;
+ if (!array || !require_fortran(array)) SWIG_fail;
$result = SWIG_Python_AppendOutput($result,obj);
}
@@ -2370,7 +2370,7 @@
PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5));
PyArrayObject* array = (PyArrayObject*) obj;
- if (!array || require_fortran(array)) SWIG_fail;
+ if (!array || !require_fortran(array)) SWIG_fail;
$result = SWIG_Python_AppendOutput($result,obj);
}
@@ -2388,7 +2388,7 @@
$2 = &dim_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
+ fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
(DATA_TYPE** ARGOUTVIEWM_ARRAY1, DIM_TYPE* DIM1)
{
npy_intp dims[1] = { *$2 };
@@ -2402,7 +2402,7 @@
%#else
PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
%#endif
-
+
%#if NPY_API_VERSION < 0x00000007
PyArray_BASE(array) = cap;
%#else
@@ -2422,7 +2422,7 @@
$2 = &data_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
+ fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
(DIM_TYPE* DIM1, DATA_TYPE** ARGOUTVIEWM_ARRAY1)
{
npy_intp dims[1] = { *$1 };
@@ -2436,7 +2436,7 @@
%#else
PyObject* cap = PyCObject_FromVoidPtr((void*)(*$1), free);
%#endif
-
+
%#if NPY_API_VERSION < 0x00000007
PyArray_BASE(array) = cap;
%#else
@@ -2457,7 +2457,7 @@
$3 = &dim2_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
+ fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
(DATA_TYPE** ARGOUTVIEWM_ARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
{
npy_intp dims[2] = { *$2, *$3 };
@@ -2492,7 +2492,7 @@
$3 = &data_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
+ fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
(DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_ARRAY2)
{
npy_intp dims[2] = { *$1, *$2 };
@@ -2527,7 +2527,7 @@
$3 = &dim2_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
+ fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
(DATA_TYPE** ARGOUTVIEWM_FARRAY2, DIM_TYPE* DIM1, DIM_TYPE* DIM2)
{
npy_intp dims[2] = { *$2, *$3 };
@@ -2562,7 +2562,7 @@
$3 = &data_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
+ fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
(DIM_TYPE* DIM1, DIM_TYPE* DIM2, DATA_TYPE** ARGOUTVIEWM_FARRAY2)
{
npy_intp dims[2] = { *$1, *$2 };
@@ -2599,7 +2599,7 @@
$4 = &dim3_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
+ fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
(DATA_TYPE** ARGOUTVIEWM_ARRAY3, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
{
npy_intp dims[3] = { *$2, *$3, *$4 };
@@ -2636,7 +2636,7 @@
$4 = &data_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
+ fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
(DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_ARRAY3)
{
npy_intp dims[3] = { *$1, *$2, *$3 };
@@ -2673,14 +2673,14 @@
$4 = &dim3_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
+ fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
(DATA_TYPE** ARGOUTVIEWM_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;
+ if (!array || !require_fortran(array)) SWIG_fail;
%#ifdef SWIGPY_USE_CAPSULE
PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
@@ -2710,14 +2710,14 @@
$4 = &data_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
+ fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
(DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DATA_TYPE** ARGOUTVIEWM_FARRAY3)
{
npy_intp dims[3] = { *$1, *$2, *$3 };
PyObject* obj = PyArray_SimpleNewFromData(3, dims, DATA_TYPECODE, (void*)(*$4));
PyArrayObject* array = (PyArrayObject*) obj;
- if (!array || require_fortran(array)) SWIG_fail;
+ if (!array || !require_fortran(array)) SWIG_fail;
%#ifdef SWIGPY_USE_CAPSULE
PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
@@ -2748,7 +2748,7 @@
$5 = &dim4_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
+ fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
(DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
{
npy_intp dims[4] = { *$2, *$3, *$4 , *$5 };
@@ -2786,7 +2786,7 @@
$5 = &data_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
+ fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
(DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_ARRAY4)
{
npy_intp dims[4] = { *$1, *$2, *$3 , *$4 };
@@ -2824,14 +2824,14 @@
$5 = &dim4_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
+ fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
(DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3)
{
npy_intp dims[4] = { *$2, *$3, *$4 , *$5 };
PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1));
PyArrayObject* array = (PyArrayObject*) obj;
- if (!array || require_fortran(array)) SWIG_fail;
+ if (!array || !require_fortran(array)) SWIG_fail;
%#ifdef SWIGPY_USE_CAPSULE
PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
@@ -2862,14 +2862,14 @@
$5 = &data_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
+ fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
(DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_FARRAY4)
{
npy_intp dims[4] = { *$1, *$2, *$3 , *$4 };
PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5));
PyArrayObject* array = (PyArrayObject*) obj;
- if (!array || require_fortran(array)) SWIG_fail;
+ if (!array || !require_fortran(array)) SWIG_fail;
%#ifdef SWIGPY_USE_CAPSULE
PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
@@ -2900,7 +2900,7 @@
$5 = &dim4_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
+ fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
(DATA_TYPE** ARGOUTVIEWM_ARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
{
npy_intp dims[4] = { *$2, *$3, *$4 , *$5 };
@@ -2938,7 +2938,7 @@
$5 = &data_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility")
+ fragment="NumPy_Backward_Compatibility,NumPy_Utilities")
(DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_ARRAY4)
{
npy_intp dims[4] = { *$1, *$2, *$3 , *$4 };
@@ -2976,14 +2976,14 @@
$5 = &dim4_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
+ fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
(DATA_TYPE** ARGOUTVIEWM_FARRAY4, DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4)
{
npy_intp dims[4] = { *$2, *$3, *$4 , *$5 };
PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$1));
PyArrayObject* array = (PyArrayObject*) obj;
- if (!array || require_fortran(array)) SWIG_fail;
+ if (!array || !require_fortran(array)) SWIG_fail;
%#ifdef SWIGPY_USE_CAPSULE
PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
@@ -3014,14 +3014,14 @@
$5 = &data_temp;
}
%typemap(argout,
- fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements")
+ fragment="NumPy_Backward_Compatibility,NumPy_Array_Requirements,NumPy_Utilities")
(DIM_TYPE* DIM1, DIM_TYPE* DIM2, DIM_TYPE* DIM3, DIM_TYPE* DIM4, DATA_TYPE** ARGOUTVIEWM_FARRAY4)
{
npy_intp dims[4] = { *$1, *$2, *$3 , *$4 };
PyObject* obj = PyArray_SimpleNewFromData(4, dims, DATA_TYPECODE, (void*)(*$5));
PyArrayObject* array = (PyArrayObject*) obj;
- if (!array || require_fortran(array)) SWIG_fail;
+ if (!array || !require_fortran(array)) SWIG_fail;
%#ifdef SWIGPY_USE_CAPSULE
PyObject* cap = PyCapsule_New((void*)(*$1), SWIGPY_CAPSULE_NAME, free_cap);
diff --git a/doc/swig/pyfragments.swg b/tools/swig/pyfragments.swg
index b5decf12c..b5decf12c 100644
--- a/doc/swig/pyfragments.swg
+++ b/tools/swig/pyfragments.swg
diff --git a/doc/swig/test/Array.i b/tools/swig/test/Array.i
index 6a8605eb6..6a8605eb6 100644
--- a/doc/swig/test/Array.i
+++ b/tools/swig/test/Array.i
diff --git a/doc/swig/test/Array1.cxx b/tools/swig/test/Array1.cxx
index 0c09e02f9..0c09e02f9 100644
--- a/doc/swig/test/Array1.cxx
+++ b/tools/swig/test/Array1.cxx
diff --git a/doc/swig/test/Array1.h b/tools/swig/test/Array1.h
index 754c248fc..754c248fc 100644
--- a/doc/swig/test/Array1.h
+++ b/tools/swig/test/Array1.h
diff --git a/doc/swig/test/Array2.cxx b/tools/swig/test/Array2.cxx
index e3558f786..e3558f786 100644
--- a/doc/swig/test/Array2.cxx
+++ b/tools/swig/test/Array2.cxx
diff --git a/doc/swig/test/Array2.h b/tools/swig/test/Array2.h
index 7f8d4ca65..7f8d4ca65 100644
--- a/doc/swig/test/Array2.h
+++ b/tools/swig/test/Array2.h
diff --git a/doc/swig/test/Farray.cxx b/tools/swig/test/Farray.cxx
index 3983c333b..3983c333b 100644
--- a/doc/swig/test/Farray.cxx
+++ b/tools/swig/test/Farray.cxx
diff --git a/doc/swig/test/Farray.h b/tools/swig/test/Farray.h
index 4199a287c..4199a287c 100644
--- a/doc/swig/test/Farray.h
+++ b/tools/swig/test/Farray.h
diff --git a/doc/swig/test/Farray.i b/tools/swig/test/Farray.i
index 25f6cd025..25f6cd025 100644
--- a/doc/swig/test/Farray.i
+++ b/tools/swig/test/Farray.i
diff --git a/doc/swig/test/Fortran.cxx b/tools/swig/test/Fortran.cxx
index 475d21ddc..475d21ddc 100644
--- a/doc/swig/test/Fortran.cxx
+++ b/tools/swig/test/Fortran.cxx
diff --git a/doc/swig/test/Fortran.h b/tools/swig/test/Fortran.h
index c243bb50f..c243bb50f 100644
--- a/doc/swig/test/Fortran.h
+++ b/tools/swig/test/Fortran.h
diff --git a/doc/swig/test/Fortran.i b/tools/swig/test/Fortran.i
index 131790dd6..131790dd6 100644
--- a/doc/swig/test/Fortran.i
+++ b/tools/swig/test/Fortran.i
diff --git a/doc/swig/test/Makefile b/tools/swig/test/Makefile
index 5360b1ced..5360b1ced 100644
--- a/doc/swig/test/Makefile
+++ b/tools/swig/test/Makefile
diff --git a/doc/swig/test/Matrix.cxx b/tools/swig/test/Matrix.cxx
index b953d7017..b953d7017 100644
--- a/doc/swig/test/Matrix.cxx
+++ b/tools/swig/test/Matrix.cxx
diff --git a/doc/swig/test/Matrix.h b/tools/swig/test/Matrix.h
index f37836cc4..f37836cc4 100644
--- a/doc/swig/test/Matrix.h
+++ b/tools/swig/test/Matrix.h
diff --git a/doc/swig/test/Matrix.i b/tools/swig/test/Matrix.i
index e721397a0..e721397a0 100644
--- a/doc/swig/test/Matrix.i
+++ b/tools/swig/test/Matrix.i
diff --git a/doc/swig/test/SuperTensor.cxx b/tools/swig/test/SuperTensor.cxx
index 82e8a4bd5..82e8a4bd5 100644
--- a/doc/swig/test/SuperTensor.cxx
+++ b/tools/swig/test/SuperTensor.cxx
diff --git a/doc/swig/test/SuperTensor.h b/tools/swig/test/SuperTensor.h
index 29cc3bbbb..29cc3bbbb 100644
--- a/doc/swig/test/SuperTensor.h
+++ b/tools/swig/test/SuperTensor.h
diff --git a/doc/swig/test/SuperTensor.i b/tools/swig/test/SuperTensor.i
index 7521b8ec4..7521b8ec4 100644
--- a/doc/swig/test/SuperTensor.i
+++ b/tools/swig/test/SuperTensor.i
diff --git a/doc/swig/test/Tensor.cxx b/tools/swig/test/Tensor.cxx
index 4ccefa144..4ccefa144 100644
--- a/doc/swig/test/Tensor.cxx
+++ b/tools/swig/test/Tensor.cxx
diff --git a/doc/swig/test/Tensor.h b/tools/swig/test/Tensor.h
index 1f483b328..1f483b328 100644
--- a/doc/swig/test/Tensor.h
+++ b/tools/swig/test/Tensor.h
diff --git a/doc/swig/test/Tensor.i b/tools/swig/test/Tensor.i
index 5bf9da7e2..5bf9da7e2 100644
--- a/doc/swig/test/Tensor.i
+++ b/tools/swig/test/Tensor.i
diff --git a/doc/swig/test/Vector.cxx b/tools/swig/test/Vector.cxx
index 2c90404da..2c90404da 100644
--- a/doc/swig/test/Vector.cxx
+++ b/tools/swig/test/Vector.cxx
diff --git a/doc/swig/test/Vector.h b/tools/swig/test/Vector.h
index 01da361c6..01da361c6 100644
--- a/doc/swig/test/Vector.h
+++ b/tools/swig/test/Vector.h
diff --git a/doc/swig/test/Vector.i b/tools/swig/test/Vector.i
index e86f21c37..e86f21c37 100644
--- a/doc/swig/test/Vector.i
+++ b/tools/swig/test/Vector.i
diff --git a/doc/swig/test/setup.py b/tools/swig/test/setup.py
index e39114f91..e39114f91 100755
--- a/doc/swig/test/setup.py
+++ b/tools/swig/test/setup.py
diff --git a/doc/swig/test/testArray.py b/tools/swig/test/testArray.py
index d986de3b3..d986de3b3 100755
--- a/doc/swig/test/testArray.py
+++ b/tools/swig/test/testArray.py
diff --git a/doc/swig/test/testFarray.py b/tools/swig/test/testFarray.py
index 15683b70b..15683b70b 100755
--- a/doc/swig/test/testFarray.py
+++ b/tools/swig/test/testFarray.py
diff --git a/doc/swig/test/testFortran.py b/tools/swig/test/testFortran.py
index a42af950e..a42af950e 100644
--- a/doc/swig/test/testFortran.py
+++ b/tools/swig/test/testFortran.py
diff --git a/doc/swig/test/testMatrix.py b/tools/swig/test/testMatrix.py
index af234e0e9..af234e0e9 100755
--- a/doc/swig/test/testMatrix.py
+++ b/tools/swig/test/testMatrix.py
diff --git a/doc/swig/test/testSuperTensor.py b/tools/swig/test/testSuperTensor.py
index ff1f86df2..ff1f86df2 100644
--- a/doc/swig/test/testSuperTensor.py
+++ b/tools/swig/test/testSuperTensor.py
diff --git a/doc/swig/test/testTensor.py b/tools/swig/test/testTensor.py
index a9390ebb1..a9390ebb1 100755
--- a/doc/swig/test/testTensor.py
+++ b/tools/swig/test/testTensor.py
diff --git a/doc/swig/test/testVector.py b/tools/swig/test/testVector.py
index e7d019cf7..e7d019cf7 100755
--- a/doc/swig/test/testVector.py
+++ b/tools/swig/test/testVector.py
diff --git a/tools/travis-test.sh b/tools/travis-test.sh
index db5d010da..d970daab3 100755
--- a/tools/travis-test.sh
+++ b/tools/travis-test.sh
@@ -19,7 +19,13 @@ setup_base()
# have been removed from master. (See gh-2765, gh-2768.) Using 'pip
# install' also has the advantage that it tests that numpy is 'pip
# install' compatible, see e.g. gh-2766...
- pip install .
+if [ -z "$USE_DEBUG" ]; then
+ $PIP install .
+else
+ sysflags="$($PYTHON -c "from distutils import sysconfig; print (sysconfig.get_config_var('CFLAGS'))")"
+ # windows compilers have this requirement
+ CFLAGS="$sysflags -Werror=declaration-after-statement -Werror=nonnull" $PYTHON setup.py build_ext --inplace
+fi
}
setup_chroot()
@@ -29,18 +35,22 @@ setup_chroot()
# CC="gcc -m32" LDSHARED="gcc -m32 -shared" LDFLAGS="-m32 -shared" linux32 python setup.py build
# when travis updates to ubuntu 14.04
DIR=$1
+ # speeds up setup as we don't have eatmydata during bootstrap
+ sudo mkdir -p $DIR
+ sudo mount -t tmpfs -o size=4G tmpfs $DIR
set -u
+ sudo apt-get update
sudo apt-get -qq -y --force-yes install debootstrap eatmydata
sudo debootstrap --variant=buildd --include=fakeroot,build-essential --arch=$ARCH --foreign $DIST $DIR
sudo chroot $DIR ./debootstrap/debootstrap --second-stage
sudo rsync -a $TRAVIS_BUILD_DIR $DIR/
- echo deb http://archive.ubuntu.com/ubuntu/ saucy main restricted universe multiverse | sudo tee -a $DIR/etc/apt/sources.list
- echo deb http://archive.ubuntu.com/ubuntu/ saucy-updates main restricted universe multiverse | sudo tee -a $DIR/etc/apt/sources.list
- echo deb http://security.ubuntu.com/ubuntu saucy-security main restricted universe multiverse | sudo tee -a $DIR/etc/apt/sources.list
+ echo deb http://archive.ubuntu.com/ubuntu/ $DIST main restricted universe multiverse | sudo tee -a $DIR/etc/apt/sources.list
+ echo deb http://archive.ubuntu.com/ubuntu/ $DIST-updates main restricted universe multiverse | sudo tee -a $DIR/etc/apt/sources.list
+ echo deb http://security.ubuntu.com/ubuntu $DIST-security main restricted universe multiverse | sudo tee -a $DIR/etc/apt/sources.list
sudo chroot $DIR bash -c "apt-get update"
sudo chroot $DIR bash -c "apt-get install -qq -y --force-yes eatmydata"
echo /usr/lib/libeatmydata/libeatmydata.so | sudo tee -a $DIR/etc/ld.so.preload
- sudo chroot $DIR bash -c "apt-get install -qq -y --force-yes libatlas-dev libatlas-base-dev gfortran python-dev python-nose python-pip"
+ sudo chroot $DIR bash -c "apt-get install -qq -y --force-yes libatlas-dev libatlas-base-dev gfortran python3-dev python3-nose python3-pip cython3 cython"
}
setup_bento()
@@ -75,25 +85,46 @@ setup_bento()
run_test()
{
+ if [ -n "$USE_DEBUG" ]; then
+ export PYTHONPATH=$PWD
+ fi
# We change directories to make sure that python won't find the copy
# of numpy in the source directory.
mkdir -p empty
cd empty
- INSTALLDIR=$(python -c "import os; import numpy; print(os.path.dirname(numpy.__file__))")
+ INSTALLDIR=$($PYTHON -c "import os; import numpy; print(os.path.dirname(numpy.__file__))")
export PYTHONWARNINGS=default
- python ../tools/test-installed-numpy.py # --mode=full
- # - coverage run --source=$INSTALLDIR --rcfile=../.coveragerc $(which python) ../tools/test-installed-numpy.py
+ $PYTHON ../tools/test-installed-numpy.py # --mode=full
+ # - coverage run --source=$INSTALLDIR --rcfile=../.coveragerc $(which $PYTHON) ../tools/test-installed-numpy.py
# - coverage report --rcfile=../.coveragerc --show-missing
}
-if [ "$USE_CHROOT" != "1" ] && [ "$USE_BENTO" != "1" ]; then
+# travis venv tests override python
+PYTHON=${PYTHON:-python}
+PIP=${PIP:-pip}
+
+if [ -n "$USE_DEBUG" ]; then
+ sudo apt-get update
+ sudo apt-get install -qq -y --force-yes python3-dbg python3-dev python3-nose
+ PYTHON=python3-dbg
+fi
+
+export PYTHON
+export PIP
+if [ -n "$USE_WHEEL" ] && [ $# -eq 0 ]; then
+ $PIP install --upgrade pip
+ $PIP install wheel
+ $PYTHON setup.py bdist_wheel
+ $PIP install --pre --upgrade --find-links dist numpy
+ run_test
+elif [ "$USE_CHROOT" != "1" ] && [ "$USE_BENTO" != "1" ]; then
setup_base
run_test
elif [ -n "$USE_CHROOT" ] && [ $# -eq 0 ]; then
DIR=/chroot
setup_chroot $DIR
# run again in chroot with this time testing
- sudo linux32 chroot $DIR bash -c "cd numpy && $0 test"
+ sudo linux32 chroot $DIR bash -c "cd numpy && PYTHON=python3 PIP=pip3 $0 test"
elif [ -n "$USE_BENTO" ] && [ $# -eq 0 ]; then
setup_bento
# run again this time testing
diff --git a/tools/win32build/README.txt b/tools/win32build/README.txt
index fe8522c19..0aba2045e 100644
--- a/tools/win32build/README.txt
+++ b/tools/win32build/README.txt
@@ -48,6 +48,8 @@ cpuid. To build it, you have two options:
- with scons: if you have scons, just do scons install. It will build
and put the CpuCaps.dll in the plugins directory of nsis (if you
install nsis in the default path).
+ - run build-cpucaps.py with a windows python, e.g.
+ wine "C:\Python27\python" build-cpucaps.py
build.py:
---------
diff --git a/tools/win32build/build-cpucaps.py b/tools/win32build/build-cpucaps.py
new file mode 100644
index 000000000..d6a9dabc2
--- /dev/null
+++ b/tools/win32build/build-cpucaps.py
@@ -0,0 +1,15 @@
+import os
+import subprocess
+# build cpucaps.dll
+# needs to be run in tools/win32build folder under wine
+# e.g. wine "C:\Python27\python" build-cpucaps.py
+cc = os.environ.get('CC', 'gcc')
+fmt = (cc, os.getcwd())
+cmd = '"{0}" -o cpucaps_main.o -c -W -Wall "-I{1}/cpuid" "-I{1}/cpucaps" cpucaps/cpucaps_main.c'.format(*fmt)
+subprocess.check_call(cmd, shell=True)
+cmd = '"{0}" -o cpuid.o -c -W -Wall "-I{1}/cpuid" cpuid/cpuid.c'.format(*fmt)
+subprocess.check_call(cmd, shell=True)
+cmd = '"{0}" -shared -Wl,--out-implib,libcpucaps.a -o cpucaps.dll cpuid.o cpucaps_main.o'.format(*fmt)
+subprocess.check_call(cmd, shell=True)
+os.remove('cpuid.o')
+os.remove('cpucaps_main.o')