From numpy-svn at scipy.org Fri Aug 1 02:04:28 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 1 Aug 2008 01:04:28 -0500 (CDT) Subject: [Numpy-svn] r5591 - trunk/tools/win32build Message-ID: <20080801060428.0E42639C23D@scipy.org> Author: cdavid Date: 2008-08-01 01:04:24 -0500 (Fri, 01 Aug 2008) New Revision: 5591 Modified: trunk/tools/win32build/doall.py Log: Handle python version in prepare_bootstrap script. Modified: trunk/tools/win32build/doall.py =================================================================== --- trunk/tools/win32build/doall.py 2008-07-31 23:25:28 UTC (rev 5590) +++ trunk/tools/win32build/doall.py 2008-08-01 06:04:24 UTC (rev 5591) @@ -4,7 +4,7 @@ PYVER = "2.5" # Bootstrap -subprocess.check_call(['python', 'prepare_bootstrap.py']) +subprocess.check_call(['python', 'prepare_bootstrap.py', '-p', PYVER]) # Build binaries subprocess.check_call(['python', 'build.py', '-p', PYVER], cwd = 'bootstrap-%s' % PYVER) From numpy-svn at scipy.org Fri Aug 1 16:35:14 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 1 Aug 2008 15:35:14 -0500 (CDT) Subject: [Numpy-svn] r5592 - branches/1.1.x Message-ID: <20080801203514.345A439C5DC@scipy.org> Author: rkern Date: 2008-08-01 15:35:13 -0500 (Fri, 01 Aug 2008) New Revision: 5592 Modified: branches/1.1.x/setup.py Log: BUG: Fix email addresses. Modified: branches/1.1.x/setup.py =================================================================== --- branches/1.1.x/setup.py 2008-08-01 06:04:24 UTC (rev 5591) +++ branches/1.1.x/setup.py 2008-08-01 20:35:13 UTC (rev 5592) @@ -76,7 +76,7 @@ setup( name = 'numpy', maintainer = "NumPy Developers", - maintainer_email = "numpy-discussion at lists.sourceforge.net", + maintainer_email = "numpy-discussion at scipy.org", description = DOCLINES[0], long_description = "\n".join(DOCLINES[2:]), url = "http://numpy.scipy.org", @@ -84,7 +84,7 @@ license = 'BSD', classifiers=filter(None, CLASSIFIERS.split('\n')), author = "Travis E. Oliphant, et.al.", - author_email = "oliphant at ee.byu.edu", + author_email = "oliphant at enthought.com", platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"], configuration=configuration ) finally: From numpy-svn at scipy.org Fri Aug 1 16:38:16 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 1 Aug 2008 15:38:16 -0500 (CDT) Subject: [Numpy-svn] r5593 - in trunk: . numpy/core/tests Message-ID: <20080801203816.A68DD39C071@scipy.org> Author: rkern Date: 2008-08-01 15:38:16 -0500 (Fri, 01 Aug 2008) New Revision: 5593 Modified: trunk/numpy/core/tests/test_umath.py trunk/setup.py Log: BUG: Fix email addresses. Modified: trunk/numpy/core/tests/test_umath.py =================================================================== --- trunk/numpy/core/tests/test_umath.py 2008-08-01 20:35:13 UTC (rev 5592) +++ trunk/numpy/core/tests/test_umath.py 2008-08-01 20:38:16 UTC (rev 5593) @@ -4,6 +4,11 @@ import nose from numpy import inf, nan, pi +# Because of the way Python handles literals (e.g. (-0.0, 0.0) can give +# (-0.0, -0.0)). Use this for -0.0 instead. +negzero = -0.0 + + class TestDivision(TestCase): def test_division_int(self): # int division should return the floor of the result, a la Python @@ -277,8 +282,8 @@ def test_clog(self): for p, v, e in [ - ((-0., 0.), (-inf, pi), 'divide'), - ((+0., 0.), (-inf, 0.), 'XXX divide'), # fails on OSX? + ((negzero, 0.0), (-inf, pi), 'divide'), + ((0.0, 0.0), (-inf, 0.0), 'divide'), # fails on OSX? ((1., inf), (inf, pi/2), ''), ((1., nan), (nan, nan), 'invalid-optional'), ((-inf, 1.), (inf, pi), ''), @@ -289,13 +294,13 @@ ((-inf, nan), (inf, nan), ''), ((nan, 1.), (nan, nan), 'invalid-optional'), ((nan, inf), (inf, nan), ''), - ((+nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on some platfs + ((+nan, nan), (nan, nan), ''), # raises 'invalid' on some platfs ]: yield self._check, np.log, p, v, e def test_csqrt(self): for p, v, e in [ - ((-0., 0.), (0.,0.), 'XXX'), # now (-0., 0.) + ((negzero, 0.0), (0.0, 0.0), ''), # now (-0., 0.) ((0., 0.), (0.,0.), ''), ((1., inf), (inf,inf), 'XXX invalid'), # now (inf, nan) ((nan, inf), (inf,inf), 'XXX'), # now (nan, nan) @@ -310,10 +315,10 @@ def test_cacos(self): for p, v, e in [ - ((0., 0.), (pi/2, -0.), 'XXX'), # now (-0., 0.) - ((-0., 0.), (pi/2, -0.), ''), + ((0., 0.), (pi/2, negzero), 'XXX'), # now (-0., 0.) + ((negzero, 0.0), (pi/2, negzero), ''), ((0., nan), (pi/2, nan), 'XXX'), # now (nan, nan) - ((-0., nan), (pi/2, nan), 'XXX'), # now (nan, nan) + ((negzero, nan), (pi/2, nan), ''), # now (nan, nan) ((1., inf), (pi/2, -inf), 'XXX'), # now (nan, -inf) ((1., nan), (nan, nan), 'invalid-optional'), ((-inf, 1.), (pi, -inf), 'XXX'), # now (nan, -inf) @@ -331,7 +336,7 @@ def test_cacosh(self): for p, v, e in [ ((0., 0), (0, pi/2), ''), - ((-0., 0), (0, pi/2), ''), + ((negzero, 0), (0, pi/2), ''), ((1., inf), (inf, pi/2), 'XXX'), # now: (nan, nan) ((1., nan), (nan, nan), 'invalid-optional'), ((-inf, 1.), (inf, pi), 'XXX'), # now: (inf, nan) Modified: trunk/setup.py =================================================================== --- trunk/setup.py 2008-08-01 20:35:13 UTC (rev 5592) +++ trunk/setup.py 2008-08-01 20:38:16 UTC (rev 5593) @@ -76,7 +76,7 @@ setup( name = 'numpy', maintainer = "NumPy Developers", - maintainer_email = "numpy-discussion at lists.sourceforge.net", + maintainer_email = "numpy-discussion at scipy.org", description = DOCLINES[0], long_description = "\n".join(DOCLINES[2:]), url = "http://numpy.scipy.org", @@ -84,7 +84,7 @@ license = 'BSD', classifiers=filter(None, CLASSIFIERS.split('\n')), author = "Travis E. Oliphant, et.al.", - author_email = "oliphant at ee.byu.edu", + author_email = "oliphant at enthought.com", platforms = ["Windows", "Linux", "Solaris", "Mac OS-X", "Unix"], configuration=configuration ) finally: From numpy-svn at scipy.org Fri Aug 1 16:40:02 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 1 Aug 2008 15:40:02 -0500 (CDT) Subject: [Numpy-svn] r5594 - trunk/numpy/core/tests Message-ID: <20080801204002.B7B2A39C071@scipy.org> Author: rkern Date: 2008-08-01 15:40:01 -0500 (Fri, 01 Aug 2008) New Revision: 5594 Modified: trunk/numpy/core/tests/test_umath.py Log: BUG: reverting mistaken checking. Modified: trunk/numpy/core/tests/test_umath.py =================================================================== --- trunk/numpy/core/tests/test_umath.py 2008-08-01 20:38:16 UTC (rev 5593) +++ trunk/numpy/core/tests/test_umath.py 2008-08-01 20:40:01 UTC (rev 5594) @@ -4,11 +4,6 @@ import nose from numpy import inf, nan, pi -# Because of the way Python handles literals (e.g. (-0.0, 0.0) can give -# (-0.0, -0.0)). Use this for -0.0 instead. -negzero = -0.0 - - class TestDivision(TestCase): def test_division_int(self): # int division should return the floor of the result, a la Python @@ -282,8 +277,8 @@ def test_clog(self): for p, v, e in [ - ((negzero, 0.0), (-inf, pi), 'divide'), - ((0.0, 0.0), (-inf, 0.0), 'divide'), # fails on OSX? + ((-0., 0.), (-inf, pi), 'divide'), + ((+0., 0.), (-inf, 0.), 'XXX divide'), # fails on OSX? ((1., inf), (inf, pi/2), ''), ((1., nan), (nan, nan), 'invalid-optional'), ((-inf, 1.), (inf, pi), ''), @@ -294,13 +289,13 @@ ((-inf, nan), (inf, nan), ''), ((nan, 1.), (nan, nan), 'invalid-optional'), ((nan, inf), (inf, nan), ''), - ((+nan, nan), (nan, nan), ''), # raises 'invalid' on some platfs + ((+nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on some platfs ]: yield self._check, np.log, p, v, e def test_csqrt(self): for p, v, e in [ - ((negzero, 0.0), (0.0, 0.0), ''), # now (-0., 0.) + ((-0., 0.), (0.,0.), 'XXX'), # now (-0., 0.) ((0., 0.), (0.,0.), ''), ((1., inf), (inf,inf), 'XXX invalid'), # now (inf, nan) ((nan, inf), (inf,inf), 'XXX'), # now (nan, nan) @@ -315,10 +310,10 @@ def test_cacos(self): for p, v, e in [ - ((0., 0.), (pi/2, negzero), 'XXX'), # now (-0., 0.) - ((negzero, 0.0), (pi/2, negzero), ''), + ((0., 0.), (pi/2, -0.), 'XXX'), # now (-0., 0.) + ((-0., 0.), (pi/2, -0.), ''), ((0., nan), (pi/2, nan), 'XXX'), # now (nan, nan) - ((negzero, nan), (pi/2, nan), ''), # now (nan, nan) + ((-0., nan), (pi/2, nan), 'XXX'), # now (nan, nan) ((1., inf), (pi/2, -inf), 'XXX'), # now (nan, -inf) ((1., nan), (nan, nan), 'invalid-optional'), ((-inf, 1.), (pi, -inf), 'XXX'), # now (nan, -inf) @@ -336,7 +331,7 @@ def test_cacosh(self): for p, v, e in [ ((0., 0), (0, pi/2), ''), - ((negzero, 0), (0, pi/2), ''), + ((-0., 0), (0, pi/2), ''), ((1., inf), (inf, pi/2), 'XXX'), # now: (nan, nan) ((1., nan), (nan, nan), 'invalid-optional'), ((-inf, 1.), (inf, pi), 'XXX'), # now: (inf, nan) From numpy-svn at scipy.org Sat Aug 2 04:29:27 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 2 Aug 2008 03:29:27 -0500 (CDT) Subject: [Numpy-svn] r5595 - trunk/tools/win32build Message-ID: <20080802082927.62718C7C004@scipy.org> Author: cdavid Date: 2008-08-02 03:29:20 -0500 (Sat, 02 Aug 2008) New Revision: 5595 Modified: trunk/tools/win32build/build.py Log: Handle MSI builds + python 2.3 for win32 build script. Modified: trunk/tools/win32build/build.py =================================================================== --- trunk/tools/win32build/build.py 2008-08-01 20:40:01 UTC (rev 5594) +++ trunk/tools/win32build/build.py 2008-08-02 08:29:20 UTC (rev 5595) @@ -13,7 +13,8 @@ from os.path import join as pjoin, split as psplit, dirname PYEXECS = {"2.5" : "C:\python25\python.exe", - "2.4" : "C:\python24\python2.4.exe"} + "2.4" : "C:\python24\python2.4.exe", + "2.3" : "C:\python23\python23.exe"} _SSE3_CFG = r"""[atlas] library_dirs = C:\local\lib\yop\sse3""" @@ -50,7 +51,10 @@ get_clean() write_site_cfg(arch) - cmd = "%s setup.py build -c mingw32 bdist_wininst" % get_python_exec(pyver) + if BUILD_MSI: + cmd = "%s setup.py build -c mingw32 bdist_msi" % get_python_exec(pyver) + else: + cmd = "%s setup.py build -c mingw32 bdist_wininst" % get_python_exec(pyver) build_log = "build-%s-%s.log" % (arch, pyver) f = open(build_log, 'w') @@ -86,13 +90,21 @@ return version def get_binary_name(arch): - return "numpy-%s-%s.exe" % (get_numpy_version(), arch) + if BUILD_MSI: + ext = '.msi' + else: + ext = '.exe' + return "numpy-%s-%s%s" % (get_numpy_version(), arch, ext) def get_windist_exec(pyver): """Return the name of the installer built by wininst command.""" # Yeah, the name logic is harcoded in distutils. We have to reproduce it # here - name = "numpy-%s.win32-py%s.exe" % (get_numpy_version(), pyver) + if BUILD_MSI: + ext = '.msi' + else: + ext = '.exe' + name = "numpy-%s.win32-py%s%s" % (get_numpy_version(), pyver, ext) return name if __name__ == '__main__': @@ -102,13 +114,20 @@ help = "Architecture to build (sse2, sse3, nosse, etc...)") parser.add_option("-p", "--pyver", dest="pyver", help = "Python version (2.4, 2.5, etc...)") + parser.add_option("-m", "--build-msi", dest="msi", + help = "0 or 1. If 1, build a msi instead of an exe.") opts, args = parser.parse_args() arch = opts.arch pyver = opts.pyver + msi = opts.msi if not pyver: pyver = "2.5" + if not msi: + BUILD_MSI = False + else: + BUILD_MSI = True if not arch: for arch in SITECFG.keys(): From numpy-svn at scipy.org Sun Aug 3 05:35:25 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 3 Aug 2008 04:35:25 -0500 (CDT) Subject: [Numpy-svn] r5596 - trunk/numpy/core/include/numpy Message-ID: <20080803093525.CB8C139C529@scipy.org> Author: cdavid Date: 2008-08-03 04:35:15 -0500 (Sun, 03 Aug 2008) New Revision: 5596 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h Log: Use inttypes format if available for NPY_INTP. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-02 08:29:20 UTC (rev 5595) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-03 09:35:15 UTC (rev 5596) @@ -971,6 +971,22 @@ #define NPY_INTP_FMT "Ld" #endif +/* If available, use formats in inttypes for (u)intp types. */ +#ifdef HAVE_UINTPTR_T /* set in pyconfig.h */ + #ifdef HAVE_INTTYPES_H /* set in pyconfig.h */ + #include + + #undef NPY_MAX_INTP + #undef NPY_MIN_INTP + #undef NPY_MAX_UINTP + #undef NPY_INTP_FMT + #define NPY_MAX_INTP INTPTR_MAX + #define NPY_MIN_INTP INTPTR_MIN + #define NPY_MAX_UINTP UINTPTR_MAX + #define NPY_INTP_FMT PRIdPTR + #endif +#endif + #define NPY_ERR(str) fprintf(stderr, #str); fflush(stderr); #define NPY_ERR2(str) fprintf(stderr, str); fflush(stderr); From numpy-svn at scipy.org Sun Aug 3 05:39:51 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 3 Aug 2008 04:39:51 -0500 (CDT) Subject: [Numpy-svn] r5597 - trunk/numpy/core/include/numpy Message-ID: <20080803093951.1027D39C529@scipy.org> Author: cdavid Date: 2008-08-03 04:39:42 -0500 (Sun, 03 Aug 2008) New Revision: 5597 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h Log: Revert revision, 5596 commited by error. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-03 09:35:15 UTC (rev 5596) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-03 09:39:42 UTC (rev 5597) @@ -971,22 +971,6 @@ #define NPY_INTP_FMT "Ld" #endif -/* If available, use formats in inttypes for (u)intp types. */ -#ifdef HAVE_UINTPTR_T /* set in pyconfig.h */ - #ifdef HAVE_INTTYPES_H /* set in pyconfig.h */ - #include - - #undef NPY_MAX_INTP - #undef NPY_MIN_INTP - #undef NPY_MAX_UINTP - #undef NPY_INTP_FMT - #define NPY_MAX_INTP INTPTR_MAX - #define NPY_MIN_INTP INTPTR_MIN - #define NPY_MAX_UINTP UINTPTR_MAX - #define NPY_INTP_FMT PRIdPTR - #endif -#endif - #define NPY_ERR(str) fprintf(stderr, #str); fflush(stderr); #define NPY_ERR2(str) fprintf(stderr, str); fflush(stderr); From numpy-svn at scipy.org Sun Aug 3 05:48:46 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 3 Aug 2008 04:48:46 -0500 (CDT) Subject: [Numpy-svn] r5598 - trunk/numpy/distutils/command Message-ID: <20080803094846.9683339C529@scipy.org> Author: cdavid Date: 2008-08-03 04:48:36 -0500 (Sun, 03 Aug 2008) New Revision: 5598 Modified: trunk/numpy/distutils/command/scons.py Log: Add function to get per package build directory when building with scons in distutils. Modified: trunk/numpy/distutils/command/scons.py =================================================================== --- trunk/numpy/distutils/command/scons.py 2008-08-03 09:39:42 UTC (rev 5597) +++ trunk/numpy/distutils/command/scons.py 2008-08-03 09:48:36 UTC (rev 5598) @@ -18,6 +18,13 @@ from numscons import get_scons_build_dir return get_scons_build_dir() +def get_scons_pkg_build_dir(pkg): + """Return the build directory for the given package (foo.bar). + + The path is relative to the top setup.py""" + from numscons.core.utils import pkg_to_path + return pjoin(get_scons_build_dir(), pkg_to_path(pkg)) + def get_scons_configres_dir(): """Return the top path where everything produced by scons will be put. From numpy-svn at scipy.org Sun Aug 3 05:49:01 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 3 Aug 2008 04:49:01 -0500 (CDT) Subject: [Numpy-svn] r5599 - trunk/numpy/core Message-ID: <20080803094901.1162D39C529@scipy.org> Author: cdavid Date: 2008-08-03 04:48:55 -0500 (Sun, 03 Aug 2008) New Revision: 5599 Modified: trunk/numpy/core/setupscons.py Log: Fix generated file location for inclusion in sdist target when building with scons. Modified: trunk/numpy/core/setupscons.py =================================================================== --- trunk/numpy/core/setupscons.py 2008-08-03 09:48:36 UTC (rev 5598) +++ trunk/numpy/core/setupscons.py 2008-08-03 09:48:55 UTC (rev 5599) @@ -9,6 +9,7 @@ def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration,dot_join + from numpy.distutils.command.scons import get_scons_pkg_build_dir from numpy.distutils.system_info import get_info, default_lib_dirs config = Configuration('core',parent_package,top_path) @@ -40,7 +41,7 @@ # XXX: I really have to think about how to communicate path info # between scons and distutils, and set the options at one single # location. - target = join(scons_build_dir, local_dir, 'config.h') + target = join(get_scons_pkg_build_dir(config.name), 'config.h') incl_dir = os.path.dirname(target) if incl_dir not in config.numpy_include_dirs: config.numpy_include_dirs.append(incl_dir) @@ -50,7 +51,8 @@ # XXX: I really have to think about how to communicate path info # between scons and distutils, and set the options at one single # location. - target = join(scons_build_dir, local_dir, 'include/numpy/numpyconfig.h') + target = join(get_scons_pkg_build_dir(config.name), + 'include/numpy/numpyconfig.h') incl_dir = os.path.dirname(target) if incl_dir not in config.numpy_include_dirs: config.numpy_include_dirs.append(incl_dir) @@ -61,8 +63,8 @@ # XXX: I really have to think about how to communicate path info # between scons and distutils, and set the options at one single # location. - h_file = join(scons_build_dir, local_dir, '__multiarray_api.h') - t_file = join(scons_build_dir, local_dir, 'multiarray_api.txt') + h_file = join(get_scons_pkg_build_dir(config.name), '__multiarray_api.h') + t_file = join(get_scons_pkg_build_dir(config.name), 'multiarray_api.txt') config.add_data_files((header_dir, h_file), (header_dir, t_file)) @@ -71,8 +73,8 @@ # XXX: I really have to think about how to communicate path info # between scons and distutils, and set the options at one single # location. - h_file = join(scons_build_dir, local_dir, '__ufunc_api.h') - t_file = join(scons_build_dir, local_dir, 'ufunc_api.txt') + h_file = join(get_scons_pkg_build_dir(config.name), '__ufunc_api.h') + t_file = join(get_scons_pkg_build_dir(config.name), 'ufunc_api.txt') config.add_data_files((header_dir, h_file), (header_dir, t_file)) From numpy-svn at scipy.org Sun Aug 3 06:47:39 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 3 Aug 2008 05:47:39 -0500 (CDT) Subject: [Numpy-svn] r5600 - trunk/numpy/core/blasdot Message-ID: <20080803104739.18A5839C2C6@scipy.org> Author: cdavid Date: 2008-08-03 05:47:35 -0500 (Sun, 03 Aug 2008) New Revision: 5600 Modified: trunk/numpy/core/blasdot/_dotblas.c Log: Fix buggy sentinel for blasdot docstring. Modified: trunk/numpy/core/blasdot/_dotblas.c =================================================================== --- trunk/numpy/core/blasdot/_dotblas.c 2008-08-03 09:48:55 UTC (rev 5599) +++ trunk/numpy/core/blasdot/_dotblas.c 2008-08-03 10:47:35 UTC (rev 5600) @@ -1151,7 +1151,7 @@ {"vdot", (PyCFunction)dotblas_vdot, 1, doc_vdot}, {"alterdot", (PyCFunction)dotblas_alterdot, 1, doc_alterdot}, {"restoredot", (PyCFunction)dotblas_restoredot, 1, doc_restoredot}, - {NULL, NULL, 0} /* sentinel */ + {NULL, NULL, 0, NULL} /* sentinel */ }; /* Initialization function for the module */ From numpy-svn at scipy.org Sun Aug 3 07:11:29 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 3 Aug 2008 06:11:29 -0500 (CDT) Subject: [Numpy-svn] r5601 - trunk/numpy/core/src Message-ID: <20080803111129.44C9839C2C6@scipy.org> Author: cdavid Date: 2008-08-03 06:11:24 -0500 (Sun, 03 Aug 2008) New Revision: 5601 Modified: trunk/numpy/core/src/_sortmodule.c.src Log: Fix method list sentinel in sortmodule. Modified: trunk/numpy/core/src/_sortmodule.c.src =================================================================== --- trunk/numpy/core/src/_sortmodule.c.src 2008-08-03 10:47:35 UTC (rev 5600) +++ trunk/numpy/core/src/_sortmodule.c.src 2008-08-03 11:11:24 UTC (rev 5601) @@ -846,7 +846,7 @@ } static struct PyMethodDef methods[] = { - {NULL, NULL, 0} + {NULL, NULL, 0, NULL} }; PyMODINIT_FUNC From numpy-svn at scipy.org Sun Aug 3 19:45:52 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 3 Aug 2008 18:45:52 -0500 (CDT) Subject: [Numpy-svn] r5602 - in trunk/numpy/ma: . tests Message-ID: <20080803234552.91D9D39C192@scipy.org> Author: pierregm Date: 2008-08-03 18:45:49 -0500 (Sun, 03 Aug 2008) New Revision: 5602 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/tests/test_core.py Log: core: * renamed _basedict to _optinfo * prevented the back propagation of _optinfo in _update_from : the __dict__ is copied only if the underlying object is not a MaskedArray * fixed getmaskarray for flexible dtype * fixed __setitem__ when filling fields (the mask might still be nomask) * _arraymethod now stores the name of the method in both self._name and self.__name__ Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-08-03 11:11:24 UTC (rev 5601) +++ trunk/numpy/ma/core.py 2008-08-03 23:45:49 UTC (rev 5602) @@ -79,6 +79,8 @@ np.seterr(all='ignore') + + def doc_note(note): return "\nNotes\n-----\n%s" % note @@ -765,7 +767,7 @@ """ mask = getmask(arr) if mask is nomask: - mask = make_mask_none(np.shape(arr), getdata(arr).dtype.names) + mask = make_mask_none(np.shape(arr), getdata(arr).dtype) return mask def is_mask(m): @@ -1102,7 +1104,7 @@ """ def __init__(self, funcname, onmask=True): - self._name = funcname + self._name = self.__name__ = funcname self._onmask = onmask self.obj = None self.__doc__ = self.getdoc() @@ -1226,7 +1228,7 @@ # Process data............ _data = np.array(data, dtype=dtype, copy=copy, subok=True, ndmin=ndmin) _baseclass = getattr(data, '_baseclass', type(_data)) - _basedict = getattr(data, '_basedict', getattr(data, '__dict__', {})) + _optinfo = {} # Careful, cls might not always be MaskedArray... if not isinstance(data, cls) or not subok: _data = _data.view(cls) @@ -1312,7 +1314,7 @@ # Process extra options .. _data._hardmask = hard_mask _data._baseclass = _baseclass - _data._basedict = _basedict + _data._optinfo = _data._basedict = _optinfo return _data # def _update_from(self, obj): @@ -1323,16 +1325,20 @@ else: _baseclass = ndarray # We need to copy the _basedict to avoid backward propagation - _basedict = {} - _basedict.update(getattr(obj, '_basedict', getattr(obj, '__dict__',{}))) + _optinfo = {} + _optinfo.update(getattr(obj, '_optinfo', {})) + _optinfo.update(getattr(obj, '_basedict',{})) + if not isinstance(obj, MaskedArray): + _optinfo.update(getattr(obj, '__dict__', {})) _dict = dict(_fill_value=getattr(obj, '_fill_value', None), _hardmask=getattr(obj, '_hardmask', False), _sharedmask=getattr(obj, '_sharedmask', False), _isfield=getattr(obj, '_isfield', False), _baseclass=getattr(obj,'_baseclass', _baseclass), - _basedict=_basedict,) + _optinfo=_optinfo, + _basedict=_optinfo) self.__dict__.update(_dict) - self.__dict__.update(_basedict) + self.__dict__.update(_optinfo) return #........................ def __array_finalize__(self,obj): @@ -1461,6 +1467,8 @@ # raise IndexError, msg if isinstance(indx, basestring): ndarray.__setitem__(self._data, indx, value) + if self._mask is nomask: + self._mask = make_mask_none(self.shape, self.dtype) ndarray.__setitem__(self._mask, indx, getmask(value)) return #........................................ Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-08-03 11:11:24 UTC (rev 5601) +++ trunk/numpy/ma/tests/test_core.py 2008-08-03 23:45:49 UTC (rev 5602) @@ -437,14 +437,14 @@ np.array([(1, '1', 1.)], dtype=flexi.dtype)) - def test_basedict_propagation(self): - "Checks that basedict isn't back-propagated" + def test_optinfo_propagation(self): + "Checks that _optinfo dictionary isn't back-propagated" x = array([1,2,3,], dtype=float) - x._basedict['info'] = '???' + x._optinfo['info'] = '???' y = x.copy() - assert_equal(y._basedict['info'],'???') - y._basedict['info'] = '!!!' - assert_equal(x._basedict['info'], '???') + assert_equal(y._optinfo['info'],'???') + y._optinfo['info'] = '!!!' + assert_equal(x._optinfo['info'], '???') #------------------------------------------------------------------------------ @@ -918,7 +918,7 @@ # We had a tailored comment to make sure special attributes are properly # dealt with a = array(['3', '4', '5']) - a._basedict.update({'comment':"updated!"}) + a._optinfo.update({'comment':"updated!"}) # b = array(a, dtype=int) assert_equal(b._data, [3,4,5]) @@ -931,7 +931,7 @@ b = a.astype(int) assert_equal(b._data, [3,4,5]) assert_equal(b.fill_value, default_fill_value(0)) - assert_equal(b._basedict['comment'], "updated!") + assert_equal(b._optinfo['comment'], "updated!") # b = a.astype([('a','|S3')]) assert_equal(b['a']._data, a._data) @@ -2268,7 +2268,20 @@ for n in ('a','b','c'): assert_equal(base[n].mask, [1,1,0,0,1]) assert_equal(base[n]._data, base._data[n]) + # + def test_getmaskarray(self): + "Test getmaskarray on flexible dtype" + ndtype = [('a', int), ('b', float)] + test = empty(3, dtype=ndtype) + assert_equal(getmaskarray(test), + np.array([(0, 0) , (0, 0), (0, 0)], + dtype=[('a', '|b1'), ('b', '|b1')])) + test[:] = masked + assert_equal(getmaskarray(test), + np.array([(1, 1) , (1, 1), (1, 1)], + dtype=[('a', '|b1'), ('b', '|b1')])) + ############################################################################### #------------------------------------------------------------------------------ if __name__ == "__main__": From numpy-svn at scipy.org Mon Aug 4 08:00:39 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Aug 2008 07:00:39 -0500 (CDT) Subject: [Numpy-svn] r5603 - trunk/numpy/core/tests Message-ID: <20080804120039.D53A939C65D@scipy.org> Author: cdavid Date: 2008-08-04 07:00:34 -0500 (Mon, 04 Aug 2008) New Revision: 5603 Added: trunk/numpy/core/tests/test_blasdot.py Log: Add test for #844 (inner product pb with atlas). Added: trunk/numpy/core/tests/test_blasdot.py =================================================================== --- trunk/numpy/core/tests/test_blasdot.py 2008-08-03 23:45:49 UTC (rev 5602) +++ trunk/numpy/core/tests/test_blasdot.py 2008-08-04 12:00:34 UTC (rev 5603) @@ -0,0 +1,14 @@ +from numpy.core import zeros, float64 +from numpy.testing import TestCase, assert_almost_equal +from numpy.core.multiarray import inner as inner_ + +DECPREC = 14 + +class TestInner(TestCase): + def test_vecself(self): + """Ticket 844.""" + # Inner product of a vector with itself segfaults or give meaningless + # result + a = zeros(shape = (1, 80), dtype = float64) + p = inner_(a, a) + assert_almost_equal(p, 0, decimal = DECPREC) From numpy-svn at scipy.org Mon Aug 4 08:09:59 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Aug 2008 07:09:59 -0500 (CDT) Subject: [Numpy-svn] r5604 - branches/1.1.x/numpy/core/tests Message-ID: <20080804120959.2840339C192@scipy.org> Author: cdavid Date: 2008-08-04 07:09:54 -0500 (Mon, 04 Aug 2008) New Revision: 5604 Added: branches/1.1.x/numpy/core/tests/test_blasdot.py Log: Add regression test for #844. Added: branches/1.1.x/numpy/core/tests/test_blasdot.py =================================================================== --- branches/1.1.x/numpy/core/tests/test_blasdot.py 2008-08-04 12:00:34 UTC (rev 5603) +++ branches/1.1.x/numpy/core/tests/test_blasdot.py 2008-08-04 12:09:54 UTC (rev 5604) @@ -0,0 +1,17 @@ +from numpy.core import zeros, float64 +from numpy.testing import NumpyTestCase, assert_almost_equal, NumpyTest +from numpy.core.multiarray import inner as inner_ + +DECPREC = 14 + +class TestDot(NumpyTestCase): + def test_vecself(self): + """Ticket 844: dotblas pb """ + # Inner product of a vector with itself segfaults or give meaningless + # result + a = zeros(shape = (1, 80), dtype = float64) + p = inner_(a, a) + assert_almost_equal(p, 0, decimal = DECPREC) + +if __name__ == "__main__": + NumpyTest().run() From numpy-svn at scipy.org Mon Aug 4 14:05:23 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Aug 2008 13:05:23 -0500 (CDT) Subject: [Numpy-svn] r5605 - in trunk/numpy/ma: . tests Message-ID: <20080804180523.4FAFD39C192@scipy.org> Author: pierregm Date: 2008-08-04 13:05:11 -0500 (Mon, 04 Aug 2008) New Revision: 5605 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/tests/test_core.py Log: core MaskedArray.__new__: prevents data.mask to change shape and force a copy of _data.mask Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-08-04 12:09:54 UTC (rev 5604) +++ trunk/numpy/ma/core.py 2008-08-04 18:05:11 UTC (rev 5605) @@ -1229,6 +1229,9 @@ _data = np.array(data, dtype=dtype, copy=copy, subok=True, ndmin=ndmin) _baseclass = getattr(data, '_baseclass', type(_data)) _optinfo = {} + # Check that we'ew not erasing the mask.......... + if isinstance(data,MaskedArray) and (data.shape != _data.shape): + copy = True # Careful, cls might not always be MaskedArray... if not isinstance(data, cls) or not subok: _data = _data.view(cls) @@ -1267,6 +1270,9 @@ if copy: _data._mask = _data._mask.copy() _data._sharedmask = False + # Reset the shape of the original mask + if getmask(data) is not nomask: + data._mask.shape = data.shape else: _data._sharedmask = True # Case 2. : With a mask in input ........ Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-08-04 12:09:54 UTC (rev 5604) +++ trunk/numpy/ma/tests/test_core.py 2008-08-04 18:05:11 UTC (rev 5605) @@ -139,6 +139,14 @@ assert_equal(x._data,[[1,2,3]]) assert_equal(x._mask,[[1,0,0]]) + def test_creation_ndmin_from_maskedarray(self): + "Make sure we're not losing the original mask w/ ndmin" + x = array([1,2,3]) + x[-1] = masked + xx = array(x, ndmin=2, dtype=float) + assert_equal(x.shape, x._mask.shape) + assert_equal(xx.shape, xx._mask.shape) + def test_creation_maskcreation(self): "Tests how masks are initialized at the creation of Maskedarrays." data = arange(24, dtype=float) From numpy-svn at scipy.org Mon Aug 4 14:06:18 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Aug 2008 13:06:18 -0500 (CDT) Subject: [Numpy-svn] r5606 - in branches/1.1.x/numpy/ma: . tests Message-ID: <20080804180618.0AAEA39C192@scipy.org> Author: pierregm Date: 2008-08-04 13:06:12 -0500 (Mon, 04 Aug 2008) New Revision: 5606 Modified: branches/1.1.x/numpy/ma/core.py branches/1.1.x/numpy/ma/tests/test_core.py Log: core MaskedArray.__new__: prevents data.mask to change shape and force a copy of _data.mask (cf r5605 on 1.2) Modified: branches/1.1.x/numpy/ma/core.py =================================================================== --- branches/1.1.x/numpy/ma/core.py 2008-08-04 18:05:11 UTC (rev 5605) +++ branches/1.1.x/numpy/ma/core.py 2008-08-04 18:06:12 UTC (rev 5606) @@ -1197,6 +1197,10 @@ _data = np.array(data, dtype=dtype, copy=copy, subok=True, ndmin=ndmin) _baseclass = getattr(data, '_baseclass', type(_data)) _basedict = getattr(data, '_basedict', getattr(data, '__dict__', {})) + # Check that we'ew not erasing the mask.......... + if isinstance(data,MaskedArray) and (data.shape != _data.shape): + copy = True + # Careful, cls might not always be MaskedArray... if not isinstance(data, MaskedArray) or not subok: _data = _data.view(cls) else: @@ -1215,6 +1219,9 @@ if copy: _data._mask = _data._mask.copy() _data._sharedmask = False + # Reset the shape of the original mask + if getmask(data) is not nomask: + data._mask.shape = data.shape else: _data._sharedmask = True else: Modified: branches/1.1.x/numpy/ma/tests/test_core.py =================================================================== --- branches/1.1.x/numpy/ma/tests/test_core.py 2008-08-04 18:05:11 UTC (rev 5605) +++ branches/1.1.x/numpy/ma/tests/test_core.py 2008-08-04 18:06:12 UTC (rev 5606) @@ -839,6 +839,14 @@ assert_equal(x._data,[[1,2,3]]) assert_equal(x._mask,[[1,0,0]]) # + def test_creation_ndmin_from_maskedarray(self): + "Make sure we're not losing the original mask w/ ndmin" + x = array([1,2,3]) + x[-1] = masked + xx = array(x, ndmin=2, dtype=float) + assert_equal(x.shape, x._mask.shape) + assert_equal(xx.shape, xx._mask.shape) + # def test_record(self): "Check record access" mtype = [('f',float_),('s','|S3')] From numpy-svn at scipy.org Mon Aug 4 16:16:56 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Aug 2008 15:16:56 -0500 (CDT) Subject: [Numpy-svn] r5607 - trunk/numpy/ma Message-ID: <20080804201656.0AC8E39C113@scipy.org> Author: pierregm Date: 2008-08-04 15:16:48 -0500 (Mon, 04 Aug 2008) New Revision: 5607 Modified: trunk/numpy/ma/extras.py Log: * extras: fixed the definition of median Modified: trunk/numpy/ma/extras.py =================================================================== --- trunk/numpy/ma/extras.py 2008-08-04 18:06:12 UTC (rev 5606) +++ trunk/numpy/ma/extras.py 2008-08-04 20:16:48 UTC (rev 5607) @@ -360,21 +360,18 @@ -def median(a, axis=0, out=None, overwrite_input=False): +def median(a, axis=None, out=None, overwrite_input=False): """Compute the median along the specified axis. - Returns the median of the array elements. The median is taken - over the first axis of the array by default, otherwise over - the specified axis. + Returns the median of the array elements. Parameters ---------- a : array-like Input array or object that can be converted to an array - axis : {int, None}, optional - Axis along which the medians are computed. The default is to - compute the median along the first dimension. axis=None - returns the median of the flattened array + axis : {None, 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. out : {None, ndarray}, optional Alternative output array in which to place the result. It must have the same shape and buffer length as the expected output @@ -402,9 +399,9 @@ Notes ----- - Given a vector V length N, the median of V is the middle value of - a sorted copy of V (Vs) - i.e. Vs[(N-1)/2], when N is odd. It is - the mean of the two middle values of Vs, when N is even. + Given a vector V with N non masked values, the median of V is the middle + value of a sorted copy of V (Vs) - i.e. Vs[(N-1)/2], when N is odd, or + {Vs[N/2 - 1] + Vs[N/2]}/2. when N is even. """ def _median1D(data): From numpy-svn at scipy.org Tue Aug 5 00:11:17 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 4 Aug 2008 23:11:17 -0500 (CDT) Subject: [Numpy-svn] r5608 - in trunk/numpy/core: . include/numpy Message-ID: <20080805041117.E219239C113@scipy.org> Author: cdavid Date: 2008-08-04 23:11:11 -0500 (Mon, 04 Aug 2008) New Revision: 5608 Modified: trunk/numpy/core/SConscript trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/include/numpy/numpyconfig.h.in trunk/numpy/core/setup.py Log: Use C99 print formatting if available for NPY_INTP. Modified: trunk/numpy/core/SConscript =================================================================== --- trunk/numpy/core/SConscript 2008-08-04 20:16:48 UTC (rev 5607) +++ trunk/numpy/core/SConscript 2008-08-05 04:11:11 UTC (rev 5608) @@ -1,4 +1,4 @@ -# Last Change: Mon Jul 28 03:00 PM 2008 J +# Last Change: Tue Aug 05 12:00 PM 2008 J # vim:syntax=python import os import sys @@ -98,6 +98,15 @@ nosmp = 0 numpyconfig_sym.append(('NPY_NO_SMP', nosmp)) +#---------------------------------------------- +# Check whether we can use C99 printing formats +#---------------------------------------------- +if config.CheckDeclaration(('PRIdPTR'), includes = '#include '): + usec99 = 1 +else: + usec99 = 0 +numpyconfig_sym.append(('USE_C99_FORMATS', usec99)) + #---------------------- # Checking the mathlib #---------------------- Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-04 20:16:48 UTC (rev 5607) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-05 04:11:11 UTC (rev 5608) @@ -971,6 +971,13 @@ #define NPY_INTP_FMT "Ld" #endif +/* We can only use C99 formats for npy_int_p if it is the same as intp_t, hence + * the condition on HAVE_UNITPTR_T */ +#if NPY_USE_C99_FORMATS == 1 && HAVE_UINTPRT_T + #undef NPY_INTP_FMT + #define NPY_INTP_FMT PRIdPTR +#endif + #define NPY_ERR(str) fprintf(stderr, #str); fflush(stderr); #define NPY_ERR2(str) fprintf(stderr, str); fflush(stderr); Modified: trunk/numpy/core/include/numpy/numpyconfig.h.in =================================================================== --- trunk/numpy/core/include/numpy/numpyconfig.h.in 2008-08-04 20:16:48 UTC (rev 5607) +++ trunk/numpy/core/include/numpy/numpyconfig.h.in 2008-08-05 04:11:11 UTC (rev 5608) @@ -14,3 +14,5 @@ @DEFINE_NPY_SIZEOF_LONGLONG@ @DEFINE_NPY_SIZEOF_PY_LONG_LONG@ + +#define NPY_USE_C99_FORMATS @USE_C99_FORMATS@ Modified: trunk/numpy/core/setup.py =================================================================== --- trunk/numpy/core/setup.py 2008-08-04 20:16:48 UTC (rev 5607) +++ trunk/numpy/core/setup.py 2008-08-05 04:11:11 UTC (rev 5608) @@ -189,6 +189,24 @@ raise SystemError,"Failed to generate numpy configuration. "\ "See previous error messages for more information." + moredefs = [] + + # Check wether we can use inttypes (C99) formats + if config_cmd.check_decl('PRIdPTR', headers = ['inttypes.h']): + moredefs.append(('NPY_USE_C99_FORMATS', 1)) + else: + moredefs.append(('NPY_USE_C99_FORMATS', 0)) + + # Add moredefs to header + target_f = open(target,'a') + for d in moredefs: + if isinstance(d,str): + target_f.write('#define %s\n' % (d)) + else: + target_f.write('#define %s %s\n' % (d[0],d[1])) + target_f.close() + + # Dump the numpyconfig.h header to stdout print 'File: %s' % target target_f = open(target) print target_f.read() From numpy-svn at scipy.org Tue Aug 5 04:25:08 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 5 Aug 2008 03:25:08 -0500 (CDT) Subject: [Numpy-svn] r5609 - trunk/numpy/core/include/numpy Message-ID: <20080805082508.90DC439C192@scipy.org> Author: cdavid Date: 2008-08-05 03:25:04 -0500 (Tue, 05 Aug 2008) New Revision: 5609 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h Log: Fix NPY_INTP_FMT when C99 format available (typo + forgot to include inttypes.h), Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-05 04:11:11 UTC (rev 5608) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-05 08:25:04 UTC (rev 5609) @@ -973,7 +973,10 @@ /* We can only use C99 formats for npy_int_p if it is the same as intp_t, hence * the condition on HAVE_UNITPTR_T */ -#if NPY_USE_C99_FORMATS == 1 && HAVE_UINTPRT_T +#if (NPY_USE_C99_FORMATS) == 1 \ + && (defined HAVE_UINTPTR_T) \ + && (defined HAVE_INTTYPES_H) + #include #undef NPY_INTP_FMT #define NPY_INTP_FMT PRIdPTR #endif From numpy-svn at scipy.org Tue Aug 5 11:44:04 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 5 Aug 2008 10:44:04 -0500 (CDT) Subject: [Numpy-svn] r5611 - in trunk/numpy: core/tests lib lib/tests Message-ID: <20080805154404.5DC6939C1B5@scipy.org> Author: dhuard Date: 2008-08-05 10:43:45 -0500 (Tue, 05 Aug 2008) New Revision: 5611 Modified: trunk/numpy/core/tests/test_regression.py trunk/numpy/lib/function_base.py trunk/numpy/lib/tests/test_function_base.py Log: Follow-up on changes to histogram semantics. `new` is now set to None by default, which triggers the new behaviour and prints a warning. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-08-05 09:20:07 UTC (rev 5610) +++ trunk/numpy/core/tests/test_regression.py 2008-08-05 15:43:45 UTC (rev 5611) @@ -809,9 +809,9 @@ def test_hist_bins_as_list(self, level=rlevel): """Ticket #632""" import warnings - warnings.simplefilter('ignore', FutureWarning) + warnings.simplefilter('ignore', Warning) try: - hist,edges = np.histogram([1,2,3,4],[1,2]) + hist,edges = np.histogram([1,2,3,4],[1,2], new=False) assert_array_equal(hist,[1,3]) assert_array_equal(edges,[1,2]) finally: Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2008-08-05 09:20:07 UTC (rev 5610) +++ trunk/numpy/lib/function_base.py 2008-08-05 15:43:45 UTC (rev 5611) @@ -191,7 +191,7 @@ except: return 0 return 1 -def histogram(a, bins=10, range=None, normed=False, weights=None, new=False): +def histogram(a, bins=10, range=None, normed=False, weights=None, new=None): """ Compute the histogram of a set of data. @@ -200,14 +200,15 @@ a : array_like Input data. bins : int or sequence of scalars, optional - If `bins` is an int, it gives the number of equal-width bins in the - given range (10, by default). If `new` is True, bins can also be - the bin edges, allowing for non-uniform bin widths. + If `bins` is an int, it defines the number of equal-width + bins in the given range (10, by default). If `bins` is a sequence, + it defines the bin edges, including the rightmost edge, allowing + for non-uniform bin widths. range : (float, float), optional The lower and upper range of the bins. If not provided, range - is simply ``(a.min(), a.max())``. With `new` set to True, values - outside the range are ignored. With `new` set to False, values - below the range are ignored, and those above the range are tallied + is simply ``(a.min(), a.max())``. Values outside the range are + ignored. Note that with `new` set to False, values below + the range are ignored, while those above the range are tallied in the rightmost bin. normed : bool, optional If False, the result will contain the number of samples @@ -222,21 +223,23 @@ (instead of 1). If `normed` is True, the weights are normalized, so that the integral of the density over the range remains 1. The `weights` keyword is only available with `new` set to True. - new : bool, optional - Compatibility argument to aid in the transition between the old - (v1.1) and the new (v1.2) implementations. In version 1.2, - `new` will be True by default. + new : {None, True, False}, optional + Whether to use the new semantics for histogram: + * None : the new behaviour is used, and a warning is printed, + * True : the new behaviour is used and no warning is printed, + * False : the old behaviour is used and a message is printed + warning about future deprecation. Returns ------- hist : array The values of the histogram. See `normed` and `weights` for a description of the possible semantics. - bin_edges : array of dtype float - With ``new = False``, return the left bin edges (``length(hist)``). - With ``new = True``, return the bin edges ``(length(hist)+1)``. + Return the bin edges ``(length(hist)+1)``. + With ``new=False``, return the left bin edges (``length(hist)``). + See Also -------- histogramdd @@ -259,13 +262,20 @@ """ # Old behavior - if new is False: + if new == False: warnings.warn(""" - The semantics of histogram will be modified in - release 1.2 to improve outlier handling. The new behavior can be - obtained using new=True. Note that the new version accepts/returns - the bin edges instead of the left bin edges. - Please read the docstring for more information.""", FutureWarning) + The original semantics of histogram is scheduled to be + deprecated in NumPy 1.3. The new semantics fixes + long-standing issues with outliers handling. The main + changes concern + 1. the definition of the bin edges, + now including the rightmost edge, and + 2. the handling of upper outliers, + now ignored rather than tallied in the rightmost bin. + + Please read the docstring for more information. + """, Warning) + a = asarray(a).ravel() if (range is not None): @@ -277,10 +287,6 @@ if not iterable(bins): if range is None: range = (a.min(), a.max()) - else: - warnings.warn(""" - Outliers handling will change in version 1.2. - Please read the docstring for details.""", FutureWarning) mn, mx = [mi+0.0 for mi in range] if mn == mx: mn -= 0.5 @@ -289,10 +295,7 @@ else: if normed: raise ValueError, 'Use new=True to pass bin edges explicitly.' - warnings.warn(""" - The semantic for bins will change in version 1.2. - The bins will become the bin edges, instead of the left bin edges. - """, FutureWarning) + raise ValueError, 'Use new=True to pass bin edges explicitly.' bins = asarray(bins) if (np.diff(bins) < 0).any(): raise AttributeError, 'bins must increase monotonically.' @@ -318,7 +321,24 @@ # New behavior - elif new is True: + elif new in [True, None]: + if new is None: + warnings.warn(""" + The semantics of histogram has been modified in + the current release to fix long-standing issues with + outliers handling. The main changes concern + 1. the definition of the bin edges, + now including the rightmost edge, and + 2. the handling of upper outliers, now ignored rather + than tallied in the rightmost bin. + The previous behaviour is still accessible using + `new=False`, but is scheduled to be deprecated in the + next release (1.3). + + *This warning will not printed in the 1.3 release.* + + Please read the docstring for more information. + """, Warning) a = asarray(a) if weights is not None: weights = asarray(weights) Modified: trunk/numpy/lib/tests/test_function_base.py =================================================================== --- trunk/numpy/lib/tests/test_function_base.py 2008-08-05 09:20:07 UTC (rev 5610) +++ trunk/numpy/lib/tests/test_function_base.py 2008-08-05 15:43:45 UTC (rev 5611) @@ -440,110 +440,116 @@ class TestHistogram(TestCase): def setUp(self): - warnings.simplefilter('ignore', FutureWarning) - + warnings.simplefilter('ignore', Warning) + def tearDown(self): warnings.resetwarnings() - def test_simple(self): + def test_simple_old(self): n=100 v=rand(n) - (a,b)=histogram(v) + (a,b)=histogram(v, new=False) #check if the sum of the bins equals the number of samples assert_equal(sum(a,axis=0), n) #check that the bin counts are evenly spaced when the data is from a # linear function - (a,b)=histogram(linspace(0,10,100)) + (a,b)=histogram(linspace(0,10,100), new=False) assert_array_equal(a, 10) - def test_simple_new(self): + def test_simple(self): n=100 v=rand(n) - (a,b)=histogram(v, new=True) + (a,b)=histogram(v) #check if the sum of the bins equals the number of samples assert_equal(sum(a,axis=0), n) #check that the bin counts are evenly spaced when the data is from a # linear function - (a,b)=histogram(linspace(0,10,100), new=True) + (a,b)=histogram(linspace(0,10,100)) assert_array_equal(a, 10) - def test_normed_new(self): + def test_one_bin(self): + # Ticket 632 + hist,edges = histogram([1,2,3,4],[1,2]) + assert_array_equal(hist,[2, ]) + assert_array_equal(edges,[1,2]) + + def test_normed(self): # Check that the integral of the density equals 1. n = 100 v = rand(n) - a,b = histogram(v, normed=True, new=True) + a,b = histogram(v, normed=True) area = sum(a*diff(b)) assert_almost_equal(area, 1) # Check with non constant bin width v = rand(n)*10 bins = [0,1,5, 9, 10] - a,b = histogram(v, bins, normed=True, new=True) + a,b = histogram(v, bins, normed=True) area = sum(a*diff(b)) assert_almost_equal(area, 1) - def test_outliers_new(self): + def test_outliers(self): # Check that outliers are not tallied a = arange(10)+.5 # Lower outliers - h,b = histogram(a, range=[0,9], new=True) + h,b = histogram(a, range=[0,9]) assert_equal(h.sum(),9) # Upper outliers - h,b = histogram(a, range=[1,10], new=True) + h,b = histogram(a, range=[1,10]) assert_equal(h.sum(),9) # Normalization - h,b = histogram(a, range=[1,9], normed=True, new=True) + h,b = histogram(a, range=[1,9], normed=True) assert_equal((h*diff(b)).sum(),1) # Weights w = arange(10)+.5 - h,b = histogram(a, range=[1,9], weights=w, normed=True, new=True) + h,b = histogram(a, range=[1,9], weights=w, normed=True) assert_equal((h*diff(b)).sum(),1) - h,b = histogram(a, bins=8, range=[1,9], weights=w, new=True) + h,b = histogram(a, bins=8, range=[1,9], weights=w) assert_equal(h, w[1:-1]) - def test_type_new(self): + def test_type(self): # Check the type of the returned histogram a = arange(10)+.5 - h,b = histogram(a, new=True) + h,b = histogram(a) assert(issubdtype(h.dtype, int)) - h,b = histogram(a, normed=True, new=True) + h,b = histogram(a, normed=True) assert(issubdtype(h.dtype, float)) - h,b = histogram(a, weights=ones(10, int), new=True) + h,b = histogram(a, weights=ones(10, int)) assert(issubdtype(h.dtype, int)) - h,b = histogram(a, weights=ones(10, float), new=True) + h,b = histogram(a, weights=ones(10, float)) assert(issubdtype(h.dtype, float)) - def test_weights_new(self): + def test_weights(self): v = rand(100) w = ones(100)*5 - a,b = histogram(v,new=True) - na,nb = histogram(v, normed=True, new=True) - wa,wb = histogram(v, weights=w, new=True) - nwa,nwb = histogram(v, weights=w, normed=True, new=True) + a,b = histogram(v) + na,nb = histogram(v, normed=True) + wa,wb = histogram(v, weights=w) + nwa,nwb = histogram(v, weights=w, normed=True) assert_array_almost_equal(a*5, wa) assert_array_almost_equal(na, nwa) # Check weights are properly applied. v = linspace(0,10,10) w = concatenate((zeros(5), ones(5))) - wa,wb = histogram(v, bins=arange(11),weights=w, new=True) + wa,wb = histogram(v, bins=arange(11),weights=w) assert_array_almost_equal(wa, w) # Check with integer weights - wa, wb = histogram([1,2,2,4], bins=4, weights=[4,3,2,1], new=True) + wa, wb = histogram([1,2,2,4], bins=4, weights=[4,3,2,1]) assert_array_equal(wa, [4,5,0,1]) - wa, wb = histogram([1,2,2,4], bins=4, weights=[4,3,2,1], normed=True, new=True) + wa, wb = histogram([1,2,2,4], bins=4, weights=[4,3,2,1], normed=True) assert_array_equal(wa, array([4,5,0,1])/10./3.*4) class TestHistogramdd(TestCase): From numpy-svn at scipy.org Tue Aug 5 14:01:21 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 5 Aug 2008 13:01:21 -0500 (CDT) Subject: [Numpy-svn] r5612 - trunk/numpy/lib Message-ID: <20080805180121.7771539C502@scipy.org> Author: dhuard Date: 2008-08-05 13:01:14 -0500 (Tue, 05 Aug 2008) New Revision: 5612 Modified: trunk/numpy/lib/function_base.py Log: added comment in histogram warning. Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2008-08-05 15:43:45 UTC (rev 5611) +++ trunk/numpy/lib/function_base.py 2008-08-05 18:01:14 UTC (rev 5612) @@ -337,6 +337,8 @@ *This warning will not printed in the 1.3 release.* + Use `new=True` to bypass this warning. + Please read the docstring for more information. """, Warning) a = asarray(a) From numpy-svn at scipy.org Tue Aug 5 19:21:33 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 5 Aug 2008 18:21:33 -0500 (CDT) Subject: [Numpy-svn] r5613 - in trunk/numpy/ma: . tests Message-ID: <20080805232133.ED54E39C0AE@scipy.org> Author: pierregm Date: 2008-08-05 18:21:31 -0500 (Tue, 05 Aug 2008) New Revision: 5613 Modified: trunk/numpy/ma/extras.py trunk/numpy/ma/tests/test_extras.py Log: * added cov and corrcoef to ma.extras for compatibility Modified: trunk/numpy/ma/extras.py =================================================================== --- trunk/numpy/ma/extras.py 2008-08-05 18:01:14 UTC (rev 5612) +++ trunk/numpy/ma/extras.py 2008-08-05 23:21:31 UTC (rev 5613) @@ -14,7 +14,7 @@ __all__ = ['apply_along_axis', 'atleast_1d', 'atleast_2d', 'atleast_3d', 'average', 'column_stack','compress_cols','compress_rowcols', 'compress_rows', - 'count_masked', + 'count_masked', 'corrcoef', 'cov', 'dot','dstack', 'ediff1d','expand_dims', 'flatnotmasked_contiguous','flatnotmasked_edges', @@ -30,7 +30,7 @@ from itertools import groupby import warnings -import core +import core as ma from core import MaskedArray, MAError, add, array, asarray, concatenate, count,\ filled, getmask, getmaskarray, masked, masked_array, mask_or, nomask, ones,\ sort, zeros @@ -166,7 +166,7 @@ arr is an N-d array. i varies so as to apply the function along the given axis for each 1-d subarray in arr. """ - arr = core.array(arr, copy=False, subok=True) + arr = array(arr, copy=False, subok=True) nd = arr.ndim if axis < 0: axis += nd @@ -213,7 +213,7 @@ dtypes.append(asarray(res).dtype) k += 1 else: - res = core.array(res, copy=False, subok=True) + res = array(res, copy=False, subok=True) j = i.copy() j[axis] = ([slice(None, None)] * res.ndim) j.put(indlist, ind) @@ -244,8 +244,8 @@ if not hasattr(arr, '_mask'): result = np.asarray(outarr, dtype=max_dtypes) else: - result = core.asarray(outarr, dtype=max_dtypes) - result.fill_value = core.default_fill_value(result) + result = asarray(outarr, dtype=max_dtypes) + result.fill_value = ma.default_fill_value(result) return result def average(a, axis=None, weights=None, returned=False): @@ -548,21 +548,19 @@ def dot(a,b, strict=False): """Return the dot product of two 2D masked arrays a and b. - Like the generic numpy equivalent, the product sum is over the - last dimension of a and the second-to-last dimension of b. If - strict is True, masked values are propagated: if a masked value - appears in a row or column, the whole row or column is considered - masked. + Like the generic numpy equivalent, the product sum is over the last + dimension of a and the second-to-last dimension of b. If strict is True, + masked values are propagated: if a masked value appears in a row or column, + the whole row or column is considered masked. Parameters ---------- - strict : {boolean} - Whether masked data are propagated (True) or set to 0 for - the computation. + strict : {boolean} + Whether masked data are propagated (True) or set to 0 for the computation. Notes ----- - The first argument is not conjugated. + The first argument is not conjugated. """ #!!!: Works only with 2D arrays. There should be a way to get it to run with higher dimension @@ -646,7 +644,132 @@ +def cov(x, y=None, rowvar=True, bias=False, allow_masked=True): + """Estimates the covariance matrix. + Normalization is by (N-1) where N is the number of observations (unbiased + estimate). If bias is True then normalization is by N. + + By default, masked values are recognized as such. If x and y have the same + shape, a common mask is allocated: if x[i,j] is masked, then y[i,j] will also + be masked. + Setting `allow_masked` to False will raise an exception if values are missing + in either of the input arrays. + + Parameters + ---------- + x : array-like + Input data. + If x is a 1D array, returns the variance. + If x is a 2D array, returns the covariance matrix. + y : {None, array-like}, optional + Optional set of variables. + rowvar : {False, True} optional + If rowvar is true, then each row is a variable with observations in columns. + If rowvar is False, each column is a variable and the observations are in + the rows. + bias : {False, True} optional + Whether to use a biased (True) or unbiased (False) estimate of the covariance. + If bias is True, then the normalization is by N, the number of observations. + Otherwise, the normalization is by (N-1). + allow_masked : {True, False} optional + If True, masked values are propagated pair-wise: if a value is masked in x, + the corresponding value is masked in y. + If False, raises a ValueError exception when some values are missing. + + Raises + ------ + ValueError: + Raised if some values are missing and allow_masked is False. + + """ + x = array(x, ndmin=2, copy=True, dtype=float) + xmask = getmaskarray(x) + # Quick exit if we can't process masked data + if not allow_masked and xmask.any(): + raise ValueError("Cannot process masked data...") + # + if x.shape[0] == 1: + rowvar = True + # Make sure that rowvar is either 0 or 1 + rowvar = int(bool(rowvar)) + axis = 1-rowvar + if rowvar: + tup = (slice(None), None) + else: + tup = (None, slice(None)) + # + if y is None: + xnotmask = np.logical_not(xmask).astype(int) + else: + y = array(y, copy=False, ndmin=2, dtype=float) + ymask = getmaskarray(y) + if not allow_masked and ymask.any(): + raise ValueError("Cannot process masked data...") + if xmask.any() or ymask.any(): + if y.shape == x.shape: + # Define some common mask + common_mask = np.logical_or(xmask, ymask) + if common_mask is not nomask: + x.unshare_mask() + y.unshare_mask() + xmask = x._mask = y._mask = ymask = common_mask + x = concatenate((x,y),axis) + xnotmask = np.logical_not(np.concatenate((xmask, ymask), axis)).astype(int) + + x -= x.mean(axis=rowvar)[tup] + + if not rowvar: + fact = dot(xnotmask.T, xnotmask)*1. - (1 - bool(bias)) + result = (dot(x.T, x.conj(), strict=False) / fact).squeeze() + else: + fact = dot(xnotmask, xnotmask.T)*1. - (1 - bool(bias)) + result = (dot(x, x.T.conj(), strict=False) / fact).squeeze() + return result + + +def corrcoef(x, y=None, rowvar=True, bias=False, allow_masked=True): + """The correlation coefficients formed from the array x, where the + rows are the observations, and the columns are variables. + + corrcoef(x,y) where x and y are 1d arrays is the same as + corrcoef(transpose([x,y])) + + Parameters + ---------- + x : ndarray + Input data. If x is a 1D array, returns the variance. + If x is a 2D array, returns the covariance matrix. + y : {None, ndarray} optional + Optional set of variables. + rowvar : {False, True} optional + If True, then each row is a variable with observations in columns. + If False, each column is a variable and the observations are in the rows. + bias : {False, True} optional + Whether to use a biased (True) or unbiased (False) estimate of the + covariance. + If True, then the normalization is by N, the number of non-missing + observations. + Otherwise, the normalization is by (N-1). + allow_masked : {True, False} optional + If True, masked values are propagated pair-wise: if a value is masked + in x, the corresponding value is masked in y. + If False, raises an exception. + + See Also + -------- + cov + + """ + + c = cov(x, y, rowvar, bias, allow_masked) + try: + d = ma.diag(c) + except ValueError: # scalar covariance + return 1 + return c/ma.sqrt(ma.multiply.outer(d,d)) + + #####-------------------------------------------------------------------------- #---- --- Concatenation helpers --- #####-------------------------------------------------------------------------- Modified: trunk/numpy/ma/tests/test_extras.py =================================================================== --- trunk/numpy/ma/tests/test_extras.py 2008-08-05 18:01:14 UTC (rev 5612) +++ trunk/numpy/ma/tests/test_extras.py 2008-08-05 23:21:31 UTC (rev 5613) @@ -12,7 +12,7 @@ __date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $' import numpy -from numpy.testing import * +from numpy.testing import TestCase, run_module_suite from numpy.ma.testutils import * from numpy.ma.core import * from numpy.ma.extras import * @@ -317,6 +317,7 @@ assert_equal(dx._mask, np.r_[1,0,0,0,0,1]) class TestApplyAlongAxis(TestCase): + # "Tests 2D functions" def test_3d(self): a = arange(12.).reshape(2,2,3) @@ -325,7 +326,9 @@ xa = apply_along_axis(myfunc,2,a) assert_equal(xa,[[1,4],[7,10]]) + class TestMedian(TestCase): + # def test_2d(self): "Tests median w/ 2D" (n,p) = (101,30) @@ -352,6 +355,71 @@ assert_equal(median(x,0), [[12,10],[8,9],[16,17]]) +class TestCov(TestCase): + # + def setUp(self): + self.data = array(np.random.rand(12)) + # + def test_1d_wo_missing(self): + "Test cov on 1D variable w/o missing values" + x = self.data + assert_equal(np.cov(x), cov(x)) + assert_equal(np.cov(x, rowvar=False), cov(x, rowvar=False)) + assert_equal(np.cov(x, rowvar=False, bias=True), + cov(x, rowvar=False, bias=True)) + # + def test_2d_wo_missing(self): + "Test cov on 1 2D variable w/o missing values" + x = self.data.reshape(3,4) + assert_equal(np.cov(x), cov(x)) + assert_equal(np.cov(x, rowvar=False), cov(x, rowvar=False)) + assert_equal(np.cov(x, rowvar=False, bias=True), + cov(x, rowvar=False, bias=True)) + # + def test_1d_w_missing(self): + "Test cov 1 1D variable w/missing values" + x = self.data + x[-1] = masked + x -= x.mean() + nx = x.compressed() + assert_almost_equal(np.cov(nx), cov(x)) + assert_almost_equal(np.cov(nx, rowvar=False), cov(x, rowvar=False)) + assert_almost_equal(np.cov(nx, rowvar=False, bias=True), + cov(x, rowvar=False, bias=True)) + # + try: + cov(x, allow_masked=False) + except ValueError: + pass + # + # 2 1D variables w/ missing values + nx = x[1:-1] + assert_almost_equal(np.cov(nx, nx[::-1]), cov(x, x[::-1])) + assert_equal(np.cov(nx, nx[::-1], rowvar=False), + cov(x, x[::-1], rowvar=False)) + assert_equal(np.cov(nx, nx[::-1], rowvar=False, bias=True), + cov(x, x[::-1], rowvar=False, bias=True)) + # + def test_2d_w_missing(self): + "Test cov on 2D variable w/ missing value" + x = self.data + x[-1] = masked + x = x.reshape(3,4) + valid = np.logical_not(getmaskarray(x)).astype(int) + frac = np.dot(valid, valid.T) + xf = (x - x.mean(1)[:,None]).filled(0) + assert_almost_equal(cov(x), np.cov(xf) * (x.shape[1]-1) / (frac - 1.)) + assert_almost_equal(cov(x, bias=True), + np.cov(xf, bias=True) * x.shape[1] / frac) + frac = np.dot(valid.T, valid) + xf = (x - x.mean(0)).filled(0) + assert_almost_equal(cov(x, rowvar=False), + np.cov(xf, rowvar=False) * (x.shape[0]-1)/(frac - 1.)) + assert_almost_equal(cov(x, rowvar=False, bias=True), + np.cov(xf, rowvar=False, bias=True) * x.shape[0]/frac) + + + class TestPolynomial(TestCase): # def test_polyfit(self): From numpy-svn at scipy.org Tue Aug 5 20:11:28 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 5 Aug 2008 19:11:28 -0500 (CDT) Subject: [Numpy-svn] r5614 - in trunk/numpy/core: . include/numpy Message-ID: <20080806001128.CDC6F39C0AE@scipy.org> Author: cdavid Date: 2008-08-05 19:11:22 -0500 (Tue, 05 Aug 2008) New Revision: 5614 Modified: trunk/numpy/core/include/numpy/numpyconfig.h.in trunk/numpy/core/setup.py Log: Always define __STDC_FORMAT_MACROS for C++ support of PRIdPTR. Modified: trunk/numpy/core/include/numpy/numpyconfig.h.in =================================================================== --- trunk/numpy/core/include/numpy/numpyconfig.h.in 2008-08-05 23:21:31 UTC (rev 5613) +++ trunk/numpy/core/include/numpy/numpyconfig.h.in 2008-08-06 00:11:22 UTC (rev 5614) @@ -16,3 +16,9 @@ @DEFINE_NPY_SIZEOF_PY_LONG_LONG@ #define NPY_USE_C99_FORMATS @USE_C99_FORMATS@ + +/* Ugly, but we can't test this in a proper manner without requiring a C++ + * compiler at the configuration stage of numpy ? */ +#ifndef __STDC_FORMAT_MACROS + #define __STDC_FORMAT_MACROS 1 +#endif Modified: trunk/numpy/core/setup.py =================================================================== --- trunk/numpy/core/setup.py 2008-08-05 23:21:31 UTC (rev 5613) +++ trunk/numpy/core/setup.py 2008-08-06 00:11:22 UTC (rev 5614) @@ -204,6 +204,13 @@ target_f.write('#define %s\n' % (d)) else: target_f.write('#define %s %s\n' % (d[0],d[1])) + + # Define __STDC_FORMAT_MACROS + target_f.write(""" +#ifndef __STDC_FORMAT_MACROS +#define __STDC_FORMAT_MACROS 1 +#endif +""") target_f.close() # Dump the numpyconfig.h header to stdout From numpy-svn at scipy.org Tue Aug 5 20:12:02 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 5 Aug 2008 19:12:02 -0500 (CDT) Subject: [Numpy-svn] r5615 - trunk/numpy/ma Message-ID: <20080806001202.EDE1739C0AE@scipy.org> Author: pierregm Date: 2008-08-05 19:12:01 -0500 (Tue, 05 Aug 2008) New Revision: 5615 Modified: trunk/numpy/ma/core.py Log: * MaskedArray.__new__: prevents self._optinfo to be overwritten (it's defined w/ the call to .view) Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-08-06 00:11:22 UTC (rev 5614) +++ trunk/numpy/ma/core.py 2008-08-06 00:12:01 UTC (rev 5615) @@ -1228,7 +1228,6 @@ # Process data............ _data = np.array(data, dtype=dtype, copy=copy, subok=True, ndmin=ndmin) _baseclass = getattr(data, '_baseclass', type(_data)) - _optinfo = {} # Check that we'ew not erasing the mask.......... if isinstance(data,MaskedArray) and (data.shape != _data.shape): copy = True @@ -1320,7 +1319,6 @@ # Process extra options .. _data._hardmask = hard_mask _data._baseclass = _baseclass - _data._optinfo = _data._basedict = _optinfo return _data # def _update_from(self, obj): From numpy-svn at scipy.org Wed Aug 6 13:34:57 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 6 Aug 2008 12:34:57 -0500 (CDT) Subject: [Numpy-svn] r5616 - in trunk/numpy/core: include/numpy src Message-ID: <20080806173457.0847A39C55E@scipy.org> Author: oliphant Date: 2008-08-06 12:34:56 -0500 (Wed, 06 Aug 2008) New Revision: 5616 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/arraymethods.c trunk/numpy/core/src/arrayobject.c trunk/numpy/core/src/arraytypes.inc.src Log: Fix ticket #877 along with other bugs not yet reported for data-types with titles. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-06 00:12:01 UTC (rev 5615) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-06 17:34:56 UTC (rev 5616) @@ -2014,10 +2014,16 @@ #include "old_defines.h" -#ifdef __cplusplus -} -#endif +/* + Check to see if this key in the dictionary is the "title" + entry of the tuple (i.e. a duplicate dictionary entry in the fields + dict. +*/ +#define NPY_TITLE_KEY(key, value) ((PyTuple_GET_SIZE((value))==3) && \ + (PyTuple_GET_ITEM((value), 2) == (key))) + + /* Define python version independent deprecation macro */ #if PY_VERSION_HEX >= 0x02050000 @@ -2026,4 +2032,10 @@ #define DEPRECATE(msg) PyErr_Warn(PyExc_DeprecationWarning,msg) #endif + +#ifdef __cplusplus +} +#endif + + #endif /* NPY_NDARRAYOBJECT_H */ Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2008-08-06 00:12:01 UTC (rev 5615) +++ trunk/numpy/core/src/arraymethods.c 2008-08-06 17:34:56 UTC (rev 5616) @@ -1006,6 +1006,7 @@ int offset; Py_ssize_t pos=0; while (PyDict_Next(dtype->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return; _deepcopy_call(iptr + offset, optr + offset, new, Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-08-06 00:12:01 UTC (rev 5615) +++ trunk/numpy/core/src/arrayobject.c 2008-08-06 17:34:56 UTC (rev 5616) @@ -13,7 +13,7 @@ Travis Oliphant, oliphant at ee.byu.edu Brigham Young Univeristy -:8613 + maintainer email: oliphant.travis at ieee.org Numarray design (which provided guidance) by @@ -171,6 +171,7 @@ Py_ssize_t pos=0; while (PyDict_Next(descr->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { return; @@ -202,8 +203,10 @@ PyArray_Descr *new; int offset; Py_ssize_t pos=0; + while (PyDict_Next(descr->fields, &pos, &key, &value)) { - if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, + if NPY_TITLE_KEY(key, value) continue; + if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { return; } @@ -4814,6 +4817,7 @@ op = (cmp_op == Py_EQ ? n_ops.logical_and : n_ops.logical_or); while (PyDict_Next(self->descr->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; a = PyArray_EnsureAnyArray(array_subscript(self, key)); if (a==NULL) { Py_XDECREF(res); @@ -5706,6 +5710,7 @@ int offset; Py_ssize_t pos=0; while (PyDict_Next(dtype->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return; _putzero(optr + offset, zero, new); @@ -5876,6 +5881,7 @@ int offset; Py_ssize_t pos=0; while (PyDict_Next(dtype->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return; _fillobject(optr + offset, obj, new); @@ -11296,6 +11302,7 @@ int offset; Py_ssize_t pos=0; while(PyDict_Next(self->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return -1; if (!_arraydescr_isnative(new)) return 0; @@ -11567,6 +11574,7 @@ int offset; Py_ssize_t pos=0; while (PyDict_Next(self->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { PyErr_Clear(); @@ -11760,6 +11768,7 @@ /* make new dictionary with replaced */ /* PyArray_Descr Objects */ while(PyDict_Next(self->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyString_Check(key) || \ !PyTuple_Check(value) || \ ((len=PyTuple_GET_SIZE(value)) < 2)) Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2008-08-06 00:12:01 UTC (rev 5615) +++ trunk/numpy/core/src/arraytypes.inc.src 2008-08-06 17:34:56 UTC (rev 5616) @@ -1306,6 +1306,7 @@ Py_ssize_t pos=0; descr = arr->descr; while (PyDict_Next(descr->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { arr->descr=descr;return; @@ -1357,6 +1358,7 @@ Py_ssize_t pos=0; descr = arr->descr; /* Save it */ while (PyDict_Next(descr->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { arr->descr=descr;return; @@ -1596,6 +1598,7 @@ descr = ap->descr; savedflags = ap->flags; while (PyDict_Next(descr->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) {PyErr_Clear(); continue;} ap->descr = new; From numpy-svn at scipy.org Wed Aug 6 16:55:10 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 6 Aug 2008 15:55:10 -0500 (CDT) Subject: [Numpy-svn] r5617 - in branches/1.1.x/numpy/core: include/numpy src Message-ID: <20080806205510.7BB4939C2C6@scipy.org> Author: oliphant Date: 2008-08-06 15:55:08 -0500 (Wed, 06 Aug 2008) New Revision: 5617 Modified: branches/1.1.x/numpy/core/include/numpy/ndarrayobject.h branches/1.1.x/numpy/core/src/arraymethods.c branches/1.1.x/numpy/core/src/arrayobject.c branches/1.1.x/numpy/core/src/arraytypes.inc.src Log: Backport fields with titles iteration fix from ticket #877 which is in r5616 back to NumPy 1.1.1 branch. Modified: branches/1.1.x/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- branches/1.1.x/numpy/core/include/numpy/ndarrayobject.h 2008-08-06 17:34:56 UTC (rev 5616) +++ branches/1.1.x/numpy/core/include/numpy/ndarrayobject.h 2008-08-06 20:55:08 UTC (rev 5617) @@ -2003,8 +2003,28 @@ #include "old_defines.h" +/* + Check to see if this key in the dictionary is the "title" + entry of the tuple (i.e. a duplicate dictionary entry in the fields + dict. +*/ + +#define NPY_TITLE_KEY(key, value) ((PyTuple_GET_SIZE((value))==3) && \ + (PyTuple_GET_ITEM((value), 2) == (key))) + + +/* Define python version independent deprecation macro */ + +#if PY_VERSION_HEX >= 0x02050000 +#define DEPRECATE(msg) PyErr_WarnEx(PyExc_DeprecationWarning,msg,1) +#else +#define DEPRECATE(msg) PyErr_Warn(PyExc_DeprecationWarning,msg) +#endif + + #ifdef __cplusplus } #endif + #endif /* NPY_NDARRAYOBJECT_H */ Modified: branches/1.1.x/numpy/core/src/arraymethods.c =================================================================== --- branches/1.1.x/numpy/core/src/arraymethods.c 2008-08-06 17:34:56 UTC (rev 5616) +++ branches/1.1.x/numpy/core/src/arraymethods.c 2008-08-06 20:55:08 UTC (rev 5617) @@ -1006,6 +1006,7 @@ int offset; Py_ssize_t pos=0; while (PyDict_Next(dtype->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return; _deepcopy_call(iptr + offset, optr + offset, new, Modified: branches/1.1.x/numpy/core/src/arrayobject.c =================================================================== --- branches/1.1.x/numpy/core/src/arrayobject.c 2008-08-06 17:34:56 UTC (rev 5616) +++ branches/1.1.x/numpy/core/src/arrayobject.c 2008-08-06 20:55:08 UTC (rev 5617) @@ -15,6 +15,7 @@ maintainer email: oliphant.travis at ieee.org + Numarray design (which provided guidance) by Space Science Telescope Institute (J. Todd Miller, Perry Greenfield, Rick White) @@ -170,6 +171,7 @@ Py_ssize_t pos=0; while (PyDict_Next(descr->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { return; @@ -201,8 +203,10 @@ PyArray_Descr *new; int offset; Py_ssize_t pos=0; + while (PyDict_Next(descr->fields, &pos, &key, &value)) { - if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, + if NPY_TITLE_KEY(key, value) continue; + if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { return; } @@ -4811,6 +4815,7 @@ op = (cmp_op == Py_EQ ? n_ops.logical_and : n_ops.logical_or); while (PyDict_Next(self->descr->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; a = PyArray_EnsureAnyArray(array_subscript(self, key)); if (a==NULL) { Py_XDECREF(res); @@ -5703,6 +5708,7 @@ int offset; Py_ssize_t pos=0; while (PyDict_Next(dtype->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return; _putzero(optr + offset, zero, new); @@ -5873,6 +5879,7 @@ int offset; Py_ssize_t pos=0; while (PyDict_Next(dtype->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return; _fillobject(optr + offset, obj, new); @@ -11290,6 +11297,7 @@ int offset; Py_ssize_t pos=0; while(PyDict_Next(self->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) return -1; if (!_arraydescr_isnative(new)) return 0; @@ -11561,6 +11569,7 @@ int offset; Py_ssize_t pos=0; while (PyDict_Next(self->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { PyErr_Clear(); @@ -11754,6 +11763,7 @@ /* make new dictionary with replaced */ /* PyArray_Descr Objects */ while(PyDict_Next(self->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyString_Check(key) || \ !PyTuple_Check(value) || \ ((len=PyTuple_GET_SIZE(value)) < 2)) Modified: branches/1.1.x/numpy/core/src/arraytypes.inc.src =================================================================== --- branches/1.1.x/numpy/core/src/arraytypes.inc.src 2008-08-06 17:34:56 UTC (rev 5616) +++ branches/1.1.x/numpy/core/src/arraytypes.inc.src 2008-08-06 20:55:08 UTC (rev 5617) @@ -1307,6 +1307,7 @@ Py_ssize_t pos=0; descr = arr->descr; while (PyDict_Next(descr->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { arr->descr=descr;return; @@ -1358,6 +1359,7 @@ Py_ssize_t pos=0; descr = arr->descr; /* Save it */ while (PyDict_Next(descr->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) { arr->descr=descr;return; @@ -1597,6 +1599,7 @@ descr = ap->descr; savedflags = ap->flags; while (PyDict_Next(descr->fields, &pos, &key, &value)) { + if NPY_TITLE_KEY(key, value) continue; if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, &title)) {PyErr_Clear(); continue;} ap->descr = new; From numpy-svn at scipy.org Wed Aug 6 22:25:21 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 6 Aug 2008 21:25:21 -0500 (CDT) Subject: [Numpy-svn] r5618 - in trunk/numpy/ma: . tests Message-ID: <20080807022521.EA1A439C502@scipy.org> Author: pierregm Date: 2008-08-06 21:25:19 -0500 (Wed, 06 Aug 2008) New Revision: 5618 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/extras.py trunk/numpy/ma/tests/test_extras.py Log: core * use self.__name__ for private method instances extras * fixed corrcoef * introduced diagflat Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-08-06 20:55:08 UTC (rev 5617) +++ trunk/numpy/ma/core.py 2008-08-07 02:25:19 UTC (rev 5618) @@ -63,7 +63,7 @@ import operator import numpy as np -from numpy import ndarray, dtype, typecodes, amax, amin, iscomplexobj,\ +from numpy import ndarray, typecodes, amax, amin, iscomplexobj,\ bool_, complex_, float_, int_, object_, str_ from numpy import array as narray @@ -540,7 +540,7 @@ return masked return result # - def reduce (self, target, axis=0, dtype=None): + def reduce(self, target, axis=0, dtype=None): """Reduce `target` along the given `axis`.""" if isinstance(target, MaskedArray): tclass = type(target) @@ -1104,15 +1104,15 @@ """ def __init__(self, funcname, onmask=True): - self._name = self.__name__ = funcname + self.__name__ = funcname self._onmask = onmask self.obj = None self.__doc__ = self.getdoc() # def getdoc(self): "Return the doc of the function (from the doc of the method)." - methdoc = getattr(ndarray, self._name, None) - methdoc = getattr(np, self._name, methdoc) + methdoc = getattr(ndarray, self.__name__, None) + methdoc = getattr(np, self.__name__, methdoc) if methdoc is not None: return methdoc.__doc__ # @@ -1121,7 +1121,7 @@ return self # def __call__(self, *args, **params): - methodname = self._name + methodname = self.__name__ data = self.obj._data mask = self.obj._mask cls = type(self.obj) @@ -3180,7 +3180,7 @@ """ (ver, shp, typ, isf, raw, msk, flv) = state ndarray.__setstate__(self, (shp, typ, isf, raw)) - self._mask.__setstate__((shp, dtype(bool), isf, msk)) + self._mask.__setstate__((shp, np.dtype(bool), isf, msk)) self.fill_value = flv # def __reduce__(self): @@ -3360,28 +3360,28 @@ """ def __init__(self, methodname): - self._methodname = methodname + self.__name__ = methodname self.__doc__ = self.getdoc() def getdoc(self): "Return the doc of the function (from the doc of the method)." try: - return getattr(MaskedArray, self._methodname).__doc__ + return getattr(MaskedArray, self.__name__).__doc__ except: - return getattr(np, self._methodname).__doc__ + return getattr(np, self.__name__).__doc__ def __call__(self, a, *args, **params): if isinstance(a, MaskedArray): - return getattr(a, self._methodname).__call__(*args, **params) + return getattr(a, self.__name__).__call__(*args, **params) #FIXME ---- #As x is not a MaskedArray, we transform it to a ndarray with asarray #... and call the corresponding method. #Except that sometimes it doesn't work (try reshape([1,2,3,4],(2,2))) #we end up with a "SystemError: NULL result without error in PyObject_Call" #A dirty trick is then to call the initial numpy function... - method = getattr(narray(a, copy=False), self._methodname) + method = getattr(narray(a, copy=False), self.__name__) try: return method(*args, **params) except SystemError: - return getattr(np,self._methodname).__call__(a, *args, **params) + return getattr(np,self.__name__).__call__(a, *args, **params) all = _frommethod('all') anomalies = anom = _frommethod('anom') Modified: trunk/numpy/ma/extras.py =================================================================== --- trunk/numpy/ma/extras.py 2008-08-06 20:55:08 UTC (rev 5617) +++ trunk/numpy/ma/extras.py 2008-08-07 02:25:19 UTC (rev 5618) @@ -15,7 +15,7 @@ 'average', 'column_stack','compress_cols','compress_rowcols', 'compress_rows', 'count_masked', 'corrcoef', 'cov', - 'dot','dstack', + 'diagflat', 'dot','dstack', 'ediff1d','expand_dims', 'flatnotmasked_contiguous','flatnotmasked_edges', 'hsplit','hstack', @@ -96,14 +96,14 @@ class _fromnxfunction: """Defines a wrapper to adapt numpy functions to masked arrays.""" def __init__(self, funcname): - self._function = funcname + self.__name__ = funcname self.__doc__ = self.getdoc() def getdoc(self): "Retrieves the __doc__ string from the function." - return getattr(np, self._function).__doc__ +\ + return getattr(np, self.__name__).__doc__ +\ "*Notes*:\n (The function is applied to both the _data and the _mask, if any.)" def __call__(self, *args, **params): - func = getattr(np, self._function) + func = getattr(np, self.__name__) if len(args)==1: x = args[0] if isinstance(x, ndarray): @@ -137,6 +137,8 @@ hsplit = _fromnxfunction('hsplit') +diagflat = _fromnxfunction('diagflat') + def expand_dims(a, axis): """Expands the shape of a by including newaxis before axis. """ @@ -643,7 +645,49 @@ return masked_array(r_data, mask=r_mask) +def _covhelper(x, y=None, rowvar=True, allow_masked=True): + """ + Private function for the computation of covariance and correlation + coefficients. + + """ + x = ma.array(x, ndmin=2, copy=True, dtype=float) + xmask = ma.getmaskarray(x) + # Quick exit if we can't process masked data + if not allow_masked and xmask.any(): + raise ValueError("Cannot process masked data...") + # + if x.shape[0] == 1: + rowvar = True + # Make sure that rowvar is either 0 or 1 + rowvar = int(bool(rowvar)) + axis = 1-rowvar + if rowvar: + tup = (slice(None), None) + else: + tup = (None, slice(None)) + # + if y is None: + xnotmask = np.logical_not(xmask).astype(int) + else: + y = array(y, copy=False, ndmin=2, dtype=float) + ymask = ma.getmaskarray(y) + if not allow_masked and ymask.any(): + raise ValueError("Cannot process masked data...") + if xmask.any() or ymask.any(): + if y.shape == x.shape: + # Define some common mask + common_mask = np.logical_or(xmask, ymask) + if common_mask is not nomask: + x.unshare_mask() + y.unshare_mask() + xmask = x._mask = y._mask = ymask = common_mask + x = ma.concatenate((x,y),axis) + xnotmask = np.logical_not(np.concatenate((xmask, ymask), axis)).astype(int) + x -= x.mean(axis=rowvar)[tup] + return (x, xnotmask, rowvar) + def cov(x, y=None, rowvar=True, bias=False, allow_masked=True): """Estimates the covariance matrix. @@ -683,47 +727,12 @@ Raised if some values are missing and allow_masked is False. """ - x = array(x, ndmin=2, copy=True, dtype=float) - xmask = getmaskarray(x) - # Quick exit if we can't process masked data - if not allow_masked and xmask.any(): - raise ValueError("Cannot process masked data...") - # - if x.shape[0] == 1: - rowvar = True - # Make sure that rowvar is either 0 or 1 - rowvar = int(bool(rowvar)) - axis = 1-rowvar - if rowvar: - tup = (slice(None), None) - else: - tup = (None, slice(None)) - # - if y is None: - xnotmask = np.logical_not(xmask).astype(int) - else: - y = array(y, copy=False, ndmin=2, dtype=float) - ymask = getmaskarray(y) - if not allow_masked and ymask.any(): - raise ValueError("Cannot process masked data...") - if xmask.any() or ymask.any(): - if y.shape == x.shape: - # Define some common mask - common_mask = np.logical_or(xmask, ymask) - if common_mask is not nomask: - x.unshare_mask() - y.unshare_mask() - xmask = x._mask = y._mask = ymask = common_mask - x = concatenate((x,y),axis) - xnotmask = np.logical_not(np.concatenate((xmask, ymask), axis)).astype(int) - - x -= x.mean(axis=rowvar)[tup] - + (x, xnotmask, rowvar) = _covhelper(x, y, rowvar, allow_masked) if not rowvar: - fact = dot(xnotmask.T, xnotmask)*1. - (1 - bool(bias)) + fact = np.dot(xnotmask.T, xnotmask)*1. - (1 - bool(bias)) result = (dot(x.T, x.conj(), strict=False) / fact).squeeze() else: - fact = dot(xnotmask, xnotmask.T)*1. - (1 - bool(bias)) + fact = np.dot(xnotmask, xnotmask.T)*1. - (1 - bool(bias)) result = (dot(x, x.T.conj(), strict=False) / fact).squeeze() return result @@ -761,15 +770,40 @@ cov """ - - c = cov(x, y, rowvar, bias, allow_masked) + # Get the data + (x, xnotmask, rowvar) = _covhelper(x, y, rowvar, allow_masked) + # Compute the covariance matrix + if not rowvar: + fact = np.dot(xnotmask.T, xnotmask)*1. - (1 - bool(bias)) + c = (dot(x.T, x.conj(), strict=False) / fact).squeeze() + else: + fact = np.dot(xnotmask, xnotmask.T)*1. - (1 - bool(bias)) + c = (dot(x, x.T.conj(), strict=False) / fact).squeeze() + # Check whether we have a scalar try: - d = ma.diag(c) - except ValueError: # scalar covariance + diag = ma.diagonal(c) + except ValueError: return 1 - return c/ma.sqrt(ma.multiply.outer(d,d)) + # + if xnotmask.all(): + _denom = ma.sqrt(ma.multiply.outer(diag, diag)) + else: + _denom = diagflat(diag) + n = x.shape[1-rowvar] + if rowvar: + for i in range(n-1): + for j in range(i+1,n): + _x = mask_cols(vstack((x[i], x[j]))).var(axis=1, + ddof=1-bias) + _denom[i,j] = _denom[j,i] = ma.sqrt(ma.multiply.reduce(_x)) + else: + for i in range(n-1): + for j in range(i+1,n): + _x = mask_cols(vstack((x[:,i], x[:,j]))).var(axis=1, + ddof=1-bias) + _denom[i,j] = _denom[j,i] = ma.sqrt(ma.multiply.reduce(_x)) + return c/_denom - #####-------------------------------------------------------------------------- #---- --- Concatenation helpers --- #####-------------------------------------------------------------------------- Modified: trunk/numpy/ma/tests/test_extras.py =================================================================== --- trunk/numpy/ma/tests/test_extras.py 2008-08-06 20:55:08 UTC (rev 5617) +++ trunk/numpy/ma/tests/test_extras.py 2008-08-07 02:25:19 UTC (rev 5618) @@ -419,7 +419,63 @@ np.cov(xf, rowvar=False, bias=True) * x.shape[0]/frac) +class TestCorrcoef(TestCase): + # + def setUp(self): + self.data = array(np.random.rand(12)) + # + def test_1d_wo_missing(self): + "Test cov on 1D variable w/o missing values" + x = self.data + assert_equal(np.corrcoef(x), corrcoef(x)) + assert_equal(np.corrcoef(x, rowvar=False), corrcoef(x, rowvar=False)) + assert_equal(np.corrcoef(x, rowvar=False, bias=True), + corrcoef(x, rowvar=False, bias=True)) + # + def test_2d_wo_missing(self): + "Test corrcoef on 1 2D variable w/o missing values" + x = self.data.reshape(3,4) + assert_equal(np.corrcoef(x), corrcoef(x)) + assert_equal(np.corrcoef(x, rowvar=False), corrcoef(x, rowvar=False)) + assert_equal(np.corrcoef(x, rowvar=False, bias=True), + corrcoef(x, rowvar=False, bias=True)) + # + def test_1d_w_missing(self): + "Test corrcoef 1 1D variable w/missing values" + x = self.data + x[-1] = masked + x -= x.mean() + nx = x.compressed() + assert_almost_equal(np.corrcoef(nx), corrcoef(x)) + assert_almost_equal(np.corrcoef(nx, rowvar=False), corrcoef(x, rowvar=False)) + assert_almost_equal(np.corrcoef(nx, rowvar=False, bias=True), + corrcoef(x, rowvar=False, bias=True)) + # + try: + corrcoef(x, allow_masked=False) + except ValueError: + pass + # + # 2 1D variables w/ missing values + nx = x[1:-1] + assert_almost_equal(np.corrcoef(nx, nx[::-1]), corrcoef(x, x[::-1])) + assert_equal(np.corrcoef(nx, nx[::-1], rowvar=False), + corrcoef(x, x[::-1], rowvar=False)) + assert_equal(np.corrcoef(nx, nx[::-1], rowvar=False, bias=True), + corrcoef(x, x[::-1], rowvar=False, bias=True)) + # + def test_2d_w_missing(self): + "Test corrcoef on 2D variable w/ missing value" + x = self.data + x[-1] = masked + x = x.reshape(3,4) + + test = corrcoef(x) + control = np.corrcoef(x) + assert_almost_equal(test[:-1,:-1], control[:-1,:-1]) + + class TestPolynomial(TestCase): # def test_polyfit(self): From numpy-svn at scipy.org Thu Aug 7 10:50:55 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 7 Aug 2008 09:50:55 -0500 (CDT) Subject: [Numpy-svn] r5619 - in trunk/numpy/ma: . tests Message-ID: <20080807145055.450F639C671@scipy.org> Author: pierregm Date: 2008-08-07 09:50:52 -0500 (Thu, 07 Aug 2008) New Revision: 5619 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/tests/test_extras.py Log: * core : minor doc formatting * test_extras: switched to assert_almost_equal in TestCov and TestCorrcoef Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-08-07 02:25:19 UTC (rev 5618) +++ trunk/numpy/ma/core.py 2008-08-07 14:50:52 UTC (rev 5619) @@ -2384,7 +2384,7 @@ Parameters ---------- - axis : {None, -1, int}, optional + axis : {None, int}, optional Axis over which the product is taken. If None is used, then the product is over all the array elements. dtype : {None, dtype}, optional @@ -2422,10 +2422,10 @@ Notes ----- - Arithmetic is modular when using integer types, and no error is - raised on overflow. + Arithmetic is modular when using integer types, and no error is raised + on overflow. - """ + """ _mask = ndarray.__getattribute__(self, '_mask') newmask = _mask.all(axis=axis) # No explicit output @@ -2835,53 +2835,52 @@ def sort(self, axis=-1, kind='quicksort', order=None, endwith=True, fill_value=None): - """Sort along the given axis. + """ + Sort along the given axis. - Parameters - ---------- - axis : int - Axis to be indirectly sorted. - kind : {string} - Sorting algorithm (default 'quicksort') - Possible values: 'quicksort', 'mergesort', or 'heapsort'. - order : {var} - If a has fields defined, then the order keyword can be - the field name to sort on or a list (or tuple) of - field names to indicate the order that fields should - be used to define the sort. - fill_value : {var} - Value used to fill in the masked values. If None, use - the the output of minimum_fill_value(). - endwith : bool - Whether missing values (if any) should be forced in - the upper indices (at the end of the array) (True) or - lower indices (at the beginning). + Parameters + ---------- + axis : {int}, optional + Axis to be indirectly sorted. + kind : {'quicksort', 'mergesort', or 'heapsort'}, optional + Sorting algorithm (default 'quicksort') + Possible values: 'quicksort', 'mergesort', or 'heapsort'. + order : {None, var} + If a has fields defined, then the order keyword can be the field name + to sort on or a list (or tuple) of field names to indicate the order + that fields should be used to define the sort. + endwith : {True, False}, optional + Whether missing values (if any) should be forced in the upper indices + (at the end of the array) (True) or lower indices (at the beginning). + fill_value : {var} + Value used to fill in the masked values. If None, use + the the output of minimum_fill_value(). - Returns - ------- - When used as method, returns None. - When used as a function, returns an array. + Returns + ------- + - When used as method, returns None. + - When used as a function, returns an array. - Notes - ----- - This method sorts 'a' in place along the given axis using - the algorithm specified by the kind keyword. + Notes + ----- + This method sorts 'a' in place along the given axis using + the algorithm specified by the kind keyword. - The various sorts may characterized by average speed, - worst case performance need for work space, and whether - they are stable. A stable sort keeps items with the same - key in the same relative order and is most useful when - used w/ argsort where the key might differ from the items - being sorted. The three available algorithms have the - following properties: + The various sorts may characterized by average speed, + worst case performance need for work space, and whether + they are stable. A stable sort keeps items with the same + key in the same relative order and is most useful when + used w/ argsort where the key might differ from the items + being sorted. The three available algorithms have the + following properties: - |------------------------------------------------------| - | kind | speed | worst case | work space | stable| - |------------------------------------------------------| - |'quicksort'| 1 | O(n^2) | 0 | no | - |'mergesort'| 2 | O(n*log(n)) | ~n/2 | yes | - |'heapsort' | 3 | O(n*log(n)) | 0 | no | - |------------------------------------------------------| + |------------------------------------------------------| + | kind | speed | worst case | work space | stable| + |------------------------------------------------------| + |'quicksort'| 1 | O(n^2) | 0 | no | + |'mergesort'| 2 | O(n*log(n)) | ~n/2 | yes | + |'heapsort' | 3 | O(n*log(n)) | 0 | no | + |------------------------------------------------------| """ if self._mask is nomask: @@ -3024,7 +3023,7 @@ axis : {None, int}, optional Axis along which to find the peaks. If None (default) the flattened array is used. - out : array_like + out : {None, array_like}, optional Alternative output array in which to place the result. It must have the same shape and buffer length as the expected output but the type will be cast if necessary. @@ -3060,13 +3059,14 @@ squeeze = _arraymethod('squeeze') #-------------------------------------------- def tolist(self, fill_value=None): - """Copy the data portion of the array to a hierarchical python - list and returns that list. + """ + Copy the data portion of the array to a hierarchical python + list and returns that list. - Data items are converted to the nearest compatible Python - type. Masked values are converted to fill_value. If - fill_value is None, the corresponding entries in the output - list will be ``None``. + Data items are converted to the nearest compatible Python + type. Masked values are converted to fill_value. If + fill_value is None, the corresponding entries in the output + list will be ``None``. """ if fill_value is not None: Modified: trunk/numpy/ma/tests/test_extras.py =================================================================== --- trunk/numpy/ma/tests/test_extras.py 2008-08-07 02:25:19 UTC (rev 5618) +++ trunk/numpy/ma/tests/test_extras.py 2008-08-07 14:50:52 UTC (rev 5619) @@ -363,18 +363,18 @@ def test_1d_wo_missing(self): "Test cov on 1D variable w/o missing values" x = self.data - assert_equal(np.cov(x), cov(x)) - assert_equal(np.cov(x, rowvar=False), cov(x, rowvar=False)) - assert_equal(np.cov(x, rowvar=False, bias=True), - cov(x, rowvar=False, bias=True)) + assert_almost_equal(np.cov(x), cov(x)) + assert_almost_equal(np.cov(x, rowvar=False), cov(x, rowvar=False)) + assert_almost_equal(np.cov(x, rowvar=False, bias=True), + cov(x, rowvar=False, bias=True)) # def test_2d_wo_missing(self): "Test cov on 1 2D variable w/o missing values" x = self.data.reshape(3,4) - assert_equal(np.cov(x), cov(x)) - assert_equal(np.cov(x, rowvar=False), cov(x, rowvar=False)) - assert_equal(np.cov(x, rowvar=False, bias=True), - cov(x, rowvar=False, bias=True)) + assert_almost_equal(np.cov(x), cov(x)) + assert_almost_equal(np.cov(x, rowvar=False), cov(x, rowvar=False)) + assert_almost_equal(np.cov(x, rowvar=False, bias=True), + cov(x, rowvar=False, bias=True)) # def test_1d_w_missing(self): "Test cov 1 1D variable w/missing values" @@ -395,10 +395,10 @@ # 2 1D variables w/ missing values nx = x[1:-1] assert_almost_equal(np.cov(nx, nx[::-1]), cov(x, x[::-1])) - assert_equal(np.cov(nx, nx[::-1], rowvar=False), - cov(x, x[::-1], rowvar=False)) - assert_equal(np.cov(nx, nx[::-1], rowvar=False, bias=True), - cov(x, x[::-1], rowvar=False, bias=True)) + assert_almost_equal(np.cov(nx, nx[::-1], rowvar=False), + cov(x, x[::-1], rowvar=False)) + assert_almost_equal(np.cov(nx, nx[::-1], rowvar=False, bias=True), + cov(x, x[::-1], rowvar=False, bias=True)) # def test_2d_w_missing(self): "Test cov on 2D variable w/ missing value" @@ -427,18 +427,20 @@ def test_1d_wo_missing(self): "Test cov on 1D variable w/o missing values" x = self.data - assert_equal(np.corrcoef(x), corrcoef(x)) - assert_equal(np.corrcoef(x, rowvar=False), corrcoef(x, rowvar=False)) - assert_equal(np.corrcoef(x, rowvar=False, bias=True), - corrcoef(x, rowvar=False, bias=True)) + assert_almost_equal(np.corrcoef(x), corrcoef(x)) + assert_almost_equal(np.corrcoef(x, rowvar=False), + corrcoef(x, rowvar=False)) + assert_almost_equal(np.corrcoef(x, rowvar=False, bias=True), + corrcoef(x, rowvar=False, bias=True)) # def test_2d_wo_missing(self): "Test corrcoef on 1 2D variable w/o missing values" x = self.data.reshape(3,4) - assert_equal(np.corrcoef(x), corrcoef(x)) - assert_equal(np.corrcoef(x, rowvar=False), corrcoef(x, rowvar=False)) - assert_equal(np.corrcoef(x, rowvar=False, bias=True), - corrcoef(x, rowvar=False, bias=True)) + assert_almost_equal(np.corrcoef(x), corrcoef(x)) + assert_almost_equal(np.corrcoef(x, rowvar=False), + corrcoef(x, rowvar=False)) + assert_almost_equal(np.corrcoef(x, rowvar=False, bias=True), + corrcoef(x, rowvar=False, bias=True)) # def test_1d_w_missing(self): "Test corrcoef 1 1D variable w/missing values" @@ -459,10 +461,10 @@ # 2 1D variables w/ missing values nx = x[1:-1] assert_almost_equal(np.corrcoef(nx, nx[::-1]), corrcoef(x, x[::-1])) - assert_equal(np.corrcoef(nx, nx[::-1], rowvar=False), - corrcoef(x, x[::-1], rowvar=False)) - assert_equal(np.corrcoef(nx, nx[::-1], rowvar=False, bias=True), - corrcoef(x, x[::-1], rowvar=False, bias=True)) + assert_almost_equal(np.corrcoef(nx, nx[::-1], rowvar=False), + corrcoef(x, x[::-1], rowvar=False)) + assert_almost_equal(np.corrcoef(nx, nx[::-1], rowvar=False, bias=True), + corrcoef(x, x[::-1], rowvar=False, bias=True)) # def test_2d_w_missing(self): "Test corrcoef on 2D variable w/ missing value" From numpy-svn at scipy.org Thu Aug 7 19:41:20 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 7 Aug 2008 18:41:20 -0500 (CDT) Subject: [Numpy-svn] r5620 - trunk/numpy/random/mtrand Message-ID: <20080807234120.0D4D239C502@scipy.org> Author: ptvirtan Date: 2008-08-07 18:41:02 -0500 (Thu, 07 Aug 2008) New Revision: 5620 Modified: trunk/numpy/random/mtrand/mtrand.c trunk/numpy/random/mtrand/mtrand.pyx Log: Fix bad string escaping in mtrand.pyx docstrings (+ regenerate mtrand.c) Modified: trunk/numpy/random/mtrand/mtrand.c =================================================================== --- trunk/numpy/random/mtrand/mtrand.c 2008-08-07 14:50:52 UTC (rev 5619) +++ trunk/numpy/random/mtrand/mtrand.c 2008-08-07 23:41:02 UTC (rev 5620) @@ -1,4 +1,4 @@ -/* Generated by Pyrex 0.9.8.2 on Tue Aug 5 11:02:12 2008 */ +/* 0.9.7 on Fri Aug 8 02:36:33 2008 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -52,8 +52,6 @@ static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ -static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i); /*proto*/ - static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/ static int __Pyx_EndUnpack(PyObject *); /*proto*/ @@ -61,8 +59,6 @@ static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ -static int __Pyx_SetItemInt(PyObject *o, Py_ssize_t i, PyObject *v); /*proto*/ - static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ @@ -247,7 +243,7 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":130 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":130 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;} @@ -258,7 +254,7 @@ } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":133 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":133 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -278,18 +274,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":134 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":134 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":135 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":135 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":136 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":136 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":138 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":138 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -323,7 +319,7 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":147 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":147 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;} @@ -334,7 +330,7 @@ } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":150 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":150 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -354,18 +350,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":151 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":151 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":152 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":152 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":153 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":153 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":155 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":155 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -410,44 +406,44 @@ __pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":166 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":166 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":167 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":167 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":168 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":168 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":169 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":169 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":170 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":170 */ __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_itera)); __pyx_v_itera = ((PyArrayIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":171 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":171 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":172 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":172 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":173 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":173 */ PyArray_ITER_NEXT(__pyx_v_itera); } goto __pyx_L2; } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":175 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":175 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -467,17 +463,17 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":176 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":176 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":177 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":177 */ __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":179 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":179 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} @@ -492,23 +488,23 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":181 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":181 */ __pyx_5 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":182 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":182 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":183 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":183 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":184 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":184 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); } } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":185 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":185 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -543,7 +539,7 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":194 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":194 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;} @@ -554,7 +550,7 @@ } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":197 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":197 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -574,18 +570,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":198 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":198 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":199 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":199 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":200 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":200 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":202 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":202 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -629,48 +625,48 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":215 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":215 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":216 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":216 */ __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":217 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":217 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":218 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":218 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":219 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":219 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":220 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":220 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":221 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":221 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":222 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":222 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":223 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":223 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":225 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":225 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -690,17 +686,17 @@ arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":226 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":226 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":227 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":227 */ __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":228 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":228 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} @@ -715,29 +711,29 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":230 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":230 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":231 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":231 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":232 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":232 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":233 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":233 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":234 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":234 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":235 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":235 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,2); } } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":236 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":236 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -772,7 +768,7 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":246 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":246 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;} @@ -783,7 +779,7 @@ } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":249 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":249 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -803,18 +799,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":250 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":250 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":251 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":251 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":252 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":252 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":254 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":254 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -860,51 +856,51 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":268 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":268 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":269 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":269 */ __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":270 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":270 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":271 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":271 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":272 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":272 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":273 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":273 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":274 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":274 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":275 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":275 */ __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":276 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":276 */ (__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])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":277 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":277 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":279 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":279 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -924,17 +920,17 @@ arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":280 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":280 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":281 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":281 */ __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":283 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":283 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} @@ -949,29 +945,29 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":285 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":285 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":286 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":286 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":287 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":287 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":288 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":288 */ __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,3)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":289 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":289 */ (__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])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":290 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":290 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":291 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":291 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1007,7 +1003,7 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":299 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":299 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; goto __pyx_L1;} @@ -1018,7 +1014,7 @@ } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":302 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":302 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1035,18 +1031,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":303 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":303 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":304 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":304 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":305 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":305 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":307 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":307 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1080,7 +1076,7 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":315 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":315 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} @@ -1091,7 +1087,7 @@ } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":318 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":318 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1108,18 +1104,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":319 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":319 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":320 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":320 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":321 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":321 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":323 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":323 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1163,48 +1159,48 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":334 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":334 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":335 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":335 */ __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":336 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":336 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":337 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":337 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":338 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":338 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":339 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":339 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":340 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":340 */ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":341 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":341 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":342 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":342 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":344 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":344 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1221,17 +1217,17 @@ arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":345 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":345 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":346 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":346 */ __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":347 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":347 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} @@ -1246,29 +1242,29 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":349 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":349 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":350 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":350 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":351 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":351 */ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":352 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":352 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":353 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":353 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":354 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":354 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,2); } } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":356 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":356 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1303,7 +1299,7 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":365 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":365 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;} @@ -1314,7 +1310,7 @@ } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":368 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":368 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1331,18 +1327,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":369 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":369 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":370 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":370 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":371 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":371 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":373 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":373 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1388,51 +1384,51 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":386 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":386 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":387 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":387 */ __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":388 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":388 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":389 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":389 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":390 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":390 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":391 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":391 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":392 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":392 */ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":393 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":393 */ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":394 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":394 */ (__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])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":395 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":395 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":397 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":397 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1449,17 +1445,17 @@ arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":398 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":398 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":399 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":399 */ __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":401 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":401 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;} @@ -1474,29 +1470,29 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":403 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":403 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":404 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":404 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":405 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":405 */ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":406 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":406 */ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,3)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":407 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":407 */ (__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])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":408 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":408 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":410 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":410 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1532,7 +1528,7 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":418 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":418 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;} @@ -1543,7 +1539,7 @@ } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":421 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":421 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1560,18 +1556,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":422 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":422 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":423 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":423 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":424 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":424 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":426 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":426 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1616,44 +1612,44 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); __pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":437 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":437 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":438 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":438 */ __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":439 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":439 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":440 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":440 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":441 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":441 */ __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_itera)); __pyx_v_itera = ((PyArrayIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":442 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":442 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":443 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":443 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":444 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":444 */ PyArray_ITER_NEXT(__pyx_v_itera); } goto __pyx_L2; } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":446 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":446 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -1670,17 +1666,17 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":447 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":447 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":448 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":448 */ __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":449 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":449 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;} @@ -1695,23 +1691,23 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":451 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":451 */ __pyx_5 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":452 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":452 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":453 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":453 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":454 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":454 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); } } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":455 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":455 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1741,29 +1737,29 @@ long __pyx_v_i; double __pyx_r; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":460 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":460 */ __pyx_v_sum = (__pyx_v_darr[0]); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":461 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":461 */ __pyx_v_c = 0.0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":462 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":462 */ for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":463 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":463 */ __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":464 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":464 */ __pyx_v_t = (__pyx_v_sum + __pyx_v_y); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":465 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":465 */ __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":466 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":466 */ __pyx_v_sum = __pyx_v_t; } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":467 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":467 */ __pyx_r = __pyx_v_sum; goto __pyx_L0; @@ -1785,10 +1781,10 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_seed); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":497 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":497 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state *)PyMem_Malloc((sizeof(rk_state)))); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":499 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":499 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;} __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;} Py_INCREF(__pyx_v_seed); @@ -1819,10 +1815,10 @@ __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != NULL); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":503 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":503 */ PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":504 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":504 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = NULL; goto __pyx_L2; } @@ -1853,7 +1849,7 @@ arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_iseed = Py_None; Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":520 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":520 */ __pyx_1 = __pyx_v_seed == Py_None; if (__pyx_1) { __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); @@ -1878,7 +1874,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":525 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":525 */ __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} Py_INCREF(__pyx_v_seed); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed); @@ -1888,21 +1884,21 @@ __pyx_v_iseed = __pyx_3; __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":526 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":526 */ __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;} rk_seed(__pyx_4,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L2; } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":528 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":528 */ __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject_obj)); arrayObject_obj = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":529 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":529 */ init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long *)arrayObject_obj->data),(arrayObject_obj->dimensions[0])); } __pyx_L2:; @@ -1942,7 +1938,7 @@ Py_INCREF(__pyx_v_self); arrayObject_state = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":542 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":542 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -1963,10 +1959,10 @@ arrayObject_state = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":543 */ - memcpy(arrayObject_state->data,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,(624 * (sizeof(long)))); + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":543 */ + memcpy(((void *)arrayObject_state->data),((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),(624 * (sizeof(long)))); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":544 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":544 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_asarray); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -1986,7 +1982,7 @@ arrayObject_state = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":545 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":545 */ __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} __pyx_2 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} @@ -2054,13 +2050,13 @@ __pyx_v_has_gauss = Py_None; Py_INCREF(Py_None); __pyx_v_cached_gaussian = Py_None; Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":564 */ - __pyx_1 = __Pyx_GetItemInt(__pyx_v_state, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;} + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":564 */ + __pyx_1 = PySequence_GetItem(__pyx_v_state, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;} Py_DECREF(__pyx_v_algorithm_name); __pyx_v_algorithm_name = __pyx_1; __pyx_1 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":565 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":565 */ if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;} __pyx_2 = __pyx_2 != 0; if (__pyx_2) { @@ -2076,7 +2072,7 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":567 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":567 */ __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;} __pyx_3 = PyObject_GetIter(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -2091,18 +2087,18 @@ if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":568 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":568 */ __pyx_4 = PyObject_Length(__pyx_v_state); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; goto __pyx_L1;} __pyx_2 = (__pyx_4 == 3); if (__pyx_2) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":569 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":569 */ __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; goto __pyx_L1;} Py_DECREF(__pyx_v_has_gauss); __pyx_v_has_gauss = __pyx_1; __pyx_1 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":570 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":570 */ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; goto __pyx_L1;} Py_DECREF(__pyx_v_cached_gaussian); __pyx_v_cached_gaussian = __pyx_3; @@ -2126,7 +2122,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":573 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":573 */ /*try:*/ { __pyx_1 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_ULONG,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L4;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); @@ -2139,7 +2135,7 @@ Py_XDECREF(__pyx_3); __pyx_3 = 0; Py_XDECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":575 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":575 */ __pyx_2 = PyErr_ExceptionMatches(PyExc_TypeError); if (__pyx_2) { __Pyx_AddTraceback("mtrand.set_state"); @@ -2157,7 +2153,7 @@ goto __pyx_L1; __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":578 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":578 */ __pyx_2 = ((arrayObject_obj->dimensions[0]) != 624); if (__pyx_2) { __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} @@ -2172,17 +2168,17 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":580 */ - memcpy(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key,arrayObject_obj->data,(624 * (sizeof(long)))); + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":580 */ + memcpy(((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),((void *)arrayObject_obj->data),(624 * (sizeof(long)))); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":581 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":581 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":582 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":582 */ __pyx_2 = PyInt_AsLong(__pyx_v_has_gauss); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;} ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_2; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":583 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":583 */ __pyx_7 = PyFloat_AsDouble(__pyx_v_cached_gaussian); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L1;} ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss = __pyx_7; @@ -2403,34 +2399,34 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":648 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":648 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":649 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":649 */ __pyx_v_lo = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":650 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":650 */ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; goto __pyx_L1;} __pyx_v_hi = __pyx_2; goto __pyx_L2; } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":652 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":652 */ __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; goto __pyx_L1;} __pyx_v_lo = __pyx_2; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":653 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":653 */ __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; goto __pyx_L1;} __pyx_v_hi = __pyx_2; } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":655 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":655 */ __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":656 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":656 */ __pyx_1 = (__pyx_v_diff < 0); if (__pyx_1) { __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; goto __pyx_L1;} @@ -2445,7 +2441,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":659 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":659 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { __pyx_3 = PyInt_FromLong((((long)rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)) + __pyx_v_lo)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;} @@ -2456,7 +2452,7 @@ } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":662 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":662 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -2473,18 +2469,18 @@ arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":663 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":663 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":664 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":664 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":665 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":665 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long)rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state))); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":667 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":667 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -2509,7 +2505,7 @@ } static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6mtrand_11RandomState_bytes[] = "\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 `N`.\n\n Examples\n --------\n >>> np.random.bytes(10)\n \' eh\x085\x0022SZ\x0bf\x0a4\' #random\n\n "; +static char __pyx_doc_6mtrand_11RandomState_bytes[] = "\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 `N`.\n\n Examples\n --------\n >>> np.random.bytes(10)\n \' eh\\x85\\x022SZ\\xbf\\xa4\' #random\n\n "; static PyObject *__pyx_f_6mtrand_11RandomState_bytes(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { unsigned int __pyx_v_length; void *__pyx_v_bytes; @@ -2521,19 +2517,19 @@ Py_INCREF(__pyx_v_self); __pyx_v_bytestring = Py_None; Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":692 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":692 */ __pyx_1 = PyString_FromStringAndSize(NULL,__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; goto __pyx_L1;} Py_DECREF(__pyx_v_bytestring); __pyx_v_bytestring = __pyx_1; __pyx_1 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":693 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":693 */ __pyx_v_bytes = PyString_AS_STRING(__pyx_v_bytestring); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":694 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":694 */ rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":695 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":695 */ Py_INCREF(__pyx_v_bytestring); __pyx_r = __pyx_v_bytestring; goto __pyx_L0; @@ -2583,13 +2579,13 @@ __pyx_v_odiff = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_temp = Py_None; Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":772 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":772 */ __pyx_v_flow = PyFloat_AsDouble(__pyx_v_low); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":773 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":773 */ __pyx_v_fhigh = PyFloat_AsDouble(__pyx_v_high); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":774 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":774 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_flow,(__pyx_v_fhigh - __pyx_v_flow)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} @@ -2600,24 +2596,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":776 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":776 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":777 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":777 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_olow)); __pyx_v_olow = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":778 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":778 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_ohigh)); __pyx_v_ohigh = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":779 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":779 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -2633,17 +2629,17 @@ __pyx_v_temp = __pyx_4; __pyx_4 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":780 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":780 */ Py_INCREF(__pyx_v_temp); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":782 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":782 */ __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odiff)); __pyx_v_odiff = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":783 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":783 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_olow,__pyx_v_odiff); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -2815,16 +2811,16 @@ Py_INCREF(__pyx_v_high); Py_INCREF(__pyx_v_size); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":854 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":854 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":855 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":855 */ Py_INCREF(__pyx_v_low); Py_DECREF(__pyx_v_high); __pyx_v_high = __pyx_v_low; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":856 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":856 */ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; goto __pyx_L1;} Py_DECREF(__pyx_v_low); __pyx_v_low = __pyx_2; @@ -2833,7 +2829,7 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":857 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":857 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;} __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;} __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;} @@ -2906,7 +2902,7 @@ static char __pyx_k74[] = "scale <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6mtrand_11RandomState_normal[] = "\n normal(loc=0.0, scale=1.0, size=None)\n\n Draw random samples from a normal (Gaussian) distribution.\n\n The probability density function of the normal distribution, first\n derived by De Moivre and 200 years later by both Gauss and Laplace\n independently [2]_, is often called the bell curve because of\n its characteristic shape (see the example below).\n\n The normal distributions occurs often in nature. For example, it\n describes the commonly occurring distribution of samples influenced\n by a large number of tiny, random disturbances, each with its own\n unique distribution [2]_.\n\n Parameters\n ----------\n loc : float\n Mean (\"centre\") of the distribution.\n scale : float\n Standard deviation (spread or \"width\") of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.distributions.norm : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Gaussian distribution is\n\n .. math:: p(x) = \\frac{1}{\\sqrt{ 2 \\pi \\sigma^2 }}\n e^{ - \\frac{ (x - \\mu)^2 } {2 \\sigma^2} },\n\n where :math:`\\mu` is the mean and :math:`\\sigma` the standard deviation.\n The square of the standard deviation, :math:`\\sigma^2`, is called the\n variance.\n\n The function has its peak at the mean, and its \"spread\" increases with\n the standard deviation (the function reaches 0.607 times its maximum at\n :math:`x + \\sigma` and :math:`x - \\sigma` [2]_). This implies that\n `numpy.random.normal` is more likely to return samples lying close to the\n mean, rather than those far away.\n\n References\n ----------\n .. [1] Wikipedia, \"Normal distribution\",\n http://en.wikipedia.org/wiki/Normal_distribution\n .. [2] P. R. Peebles Jr., \"Central Limit Theorem\" in \"Probability, Random\n Variables and Random Signal Principles\", 4th ed., 2001,\n pp. 51, 51, 125.\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, sigma = 0, 0.1 # mean and standard deviation\n >>> s = np.random.normal(mu, sigma, 1000)\n\n Verify the mean and the variance:\n\n >>> abs(mu - np.mean(s)) < 0.01\n True\n\n >>> abs(sigma - np.std(s, ddof=1)) < 0.01\n True\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 30, normed=True)\n >>> plt.plot(bins, 1/(sigma * np.sqrt(2 * np.pi)) * ... np.exp( - (bins - mu)**2 / (2 * sigma**2) ),\n ... linewidth=2, color=\'r\')\n >>> plt.show()\n\n "; +static char __pyx_doc_6mtrand_11RandomState_normal[] = "\n normal(loc=0.0, scale=1.0, size=None)\n\n Draw random samples from a normal (Gaussian) distribution.\n\n The probability density function of the normal distribution, first\n derived by De Moivre and 200 years later by both Gauss and Laplace\n independently [2]_, is often called the bell curve because of\n its characteristic shape (see the example below).\n\n The normal distributions occurs often in nature. For example, it\n describes the commonly occurring distribution of samples influenced\n by a large number of tiny, random disturbances, each with its own\n unique distribution [2]_.\n\n Parameters\n ----------\n loc : float\n Mean (\"centre\") of the distribution.\n scale : float\n Standard deviation (spread or \"width\") of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.distributions.norm : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Gaussian distribution is\n\n .. math:: p(x) = \\frac{1}{\\sqrt{ 2 \\pi \\sigma^2 }}\n e^{ - \\frac{ (x - \\mu)^2 } {2 \\sigma^2} },\n\n where :math:`\\mu` is the mean and :math:`\\sigma` the standard deviation.\n The square of the standard deviation, :math:`\\sigma^2`, is called the\n variance.\n\n The function has its peak at the mean, and its \"spread\" increases with\n the standard deviation (the function reaches 0.607 times its maximum at\n :math:`x + \\sigma` and :math:`x - \\sigma` [2]_). This implies that\n `numpy.random.normal` is more likely to return samples lying close to the\n mean, rather than those far away.\n\n References\n ----------\n .. [1] Wikipedia, \"Normal distribution\",\n http://en.wikipedia.org/wiki/Normal_distribution\n .. [2] P. R. Peebles Jr., \"Central Limit Theorem\" in \"Probability, Random\n Variables and Random Signal Principles\", 4th ed., 2001,\n pp. 51, 51, 125.\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, sigma = 0, 0.1 # mean and standard deviation\n >>> s = np.random.normal(mu, sigma, 1000)\n\n Verify the mean and the variance:\n\n >>> abs(mu - np.mean(s)) < 0.01\n True\n\n >>> abs(sigma - np.std(s, ddof=1)) < 0.01\n True\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 30, normed=True)\n >>> plt.plot(bins, 1/(sigma * np.sqrt(2 * np.pi)) *\n ... np.exp( - (bins - mu)**2 / (2 * sigma**2) ),\n ... linewidth=2, color=\'r\')\n >>> plt.show()\n\n "; static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_loc = 0; PyObject *__pyx_v_scale = 0; @@ -2933,17 +2929,17 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":954 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":954 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":955 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":955 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":956 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":956 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":957 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":957 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} @@ -2958,7 +2954,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":959 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":959 */ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -2967,24 +2963,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":961 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":961 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":963 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":963 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":964 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":964 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":965 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":965 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -3021,7 +3017,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":967 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":967 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -3082,17 +3078,17 @@ __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ob = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1009 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1009 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1010 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1010 */ __pyx_v_fb = PyFloat_AsDouble(__pyx_v_b); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1011 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1011 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1012 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1012 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;} @@ -3107,7 +3103,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1014 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1014 */ __pyx_1 = (__pyx_v_fb <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} @@ -3122,7 +3118,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1016 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1016 */ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_fa,__pyx_v_fb); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -3131,24 +3127,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1018 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1018 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1020 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1020 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oa)); __pyx_v_oa = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1021 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1021 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_ob)); __pyx_v_ob = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1022 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1022 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -3185,7 +3181,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1024 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1024 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -3222,7 +3218,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1026 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1026 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_oa,__pyx_v_ob); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -3275,14 +3271,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1065 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1065 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1066 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1066 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1067 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1067 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} @@ -3297,7 +3293,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1069 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1069 */ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -3306,17 +3302,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1071 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1071 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1073 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1073 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1074 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1074 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -3353,7 +3349,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1076 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1076 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -3431,14 +3427,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1097 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1097 */ __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1098 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1098 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1099 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1099 */ __pyx_1 = (__pyx_v_fshape <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; goto __pyx_L1;} @@ -3453,7 +3449,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1101 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1101 */ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_fshape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -3462,17 +3458,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1103 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1103 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1104 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1104 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oshape)); __pyx_v_oshape = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1105 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1105 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -3509,7 +3505,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1107 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1107 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_oshape); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -3569,17 +3565,17 @@ __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1119 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1119 */ __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1120 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1120 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1121 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1121 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1122 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1122 */ __pyx_1 = (__pyx_v_fshape <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;} @@ -3594,7 +3590,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1124 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1124 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} @@ -3609,7 +3605,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1126 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1126 */ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_fshape,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -3618,24 +3614,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1128 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1128 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1129 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1129 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oshape)); __pyx_v_oshape = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1130 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1130 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1131 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1131 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -3672,7 +3668,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1133 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1133 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -3709,7 +3705,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1135 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1135 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_oshape,__pyx_v_oscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -3770,17 +3766,17 @@ __pyx_v_odfnum = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1147 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1147 */ __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1148 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1148 */ __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1149 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1149 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1150 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1150 */ __pyx_1 = (__pyx_v_fdfnum <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; goto __pyx_L1;} @@ -3795,7 +3791,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1152 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1152 */ __pyx_1 = (__pyx_v_fdfden <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;} @@ -3810,7 +3806,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1154 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1154 */ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_fdfnum,__pyx_v_fdfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -3819,24 +3815,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1156 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1156 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1158 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1158 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odfnum)); __pyx_v_odfnum = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1159 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1159 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_odfden)); __pyx_v_odfden = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1160 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1160 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -3873,7 +3869,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1162 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1162 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -3910,7 +3906,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1164 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1164 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -3982,20 +3978,20 @@ __pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1176 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1176 */ __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1177 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1177 */ __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1178 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1178 */ __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1179 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1179 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1180 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1180 */ __pyx_1 = (__pyx_v_fdfnum <= 1); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} @@ -4010,7 +4006,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1182 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1182 */ __pyx_1 = (__pyx_v_fdfden <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} @@ -4025,7 +4021,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1184 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1184 */ __pyx_1 = (__pyx_v_fnonc < 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;} @@ -4040,7 +4036,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1186 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1186 */ __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_fdfnum,__pyx_v_fdfden,__pyx_v_fnonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -4049,31 +4045,31 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1189 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1189 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1191 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1191 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odfnum)); __pyx_v_odfnum = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1192 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1192 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_odfden)); __pyx_v_odfden = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1193 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1193 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_ononc)); __pyx_v_ononc = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1195 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1195 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -4110,7 +4106,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1197 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1197 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -4147,7 +4143,7 @@ } __pyx_L7:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1199 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1199 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -4184,7 +4180,7 @@ } __pyx_L8:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1201 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1201 */ __pyx_5 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden,__pyx_v_ononc); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; @@ -4238,14 +4234,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1271 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1271 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1272 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1272 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1273 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1273 */ __pyx_1 = (__pyx_v_fdf <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;} @@ -4260,7 +4256,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1275 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1275 */ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_fdf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -4269,17 +4265,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1277 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1277 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1279 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1279 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odf)); __pyx_v_odf = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1280 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1280 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -4316,7 +4312,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1282 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1282 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_odf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -4375,17 +4371,17 @@ __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1305 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1305 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1306 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1306 */ __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1307 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1307 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1308 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1308 */ __pyx_1 = (__pyx_v_fdf <= 1); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} @@ -4400,7 +4396,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1310 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1310 */ __pyx_1 = (__pyx_v_fnonc <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} @@ -4415,7 +4411,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1312 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1312 */ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_fdf,__pyx_v_fnonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -4424,24 +4420,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1315 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1315 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1317 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1317 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odf)); __pyx_v_odf = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1318 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1318 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_ononc)); __pyx_v_ononc = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1319 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1319 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -4478,7 +4474,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1321 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1321 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -4515,7 +4511,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1323 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1323 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_odf,__pyx_v_ononc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -4595,14 +4591,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1345 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1345 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1346 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1346 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1347 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1347 */ __pyx_1 = (__pyx_v_fdf <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; goto __pyx_L1;} @@ -4617,7 +4613,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1349 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1349 */ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_fdf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -4626,17 +4622,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1351 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1351 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1353 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1353 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odf)); __pyx_v_odf = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1354 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1354 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -4673,7 +4669,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1356 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1356 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_odf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -4728,17 +4724,17 @@ __pyx_v_omu = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_okappa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1438 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1438 */ __pyx_v_fmu = PyFloat_AsDouble(__pyx_v_mu); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1439 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1439 */ __pyx_v_fkappa = PyFloat_AsDouble(__pyx_v_kappa); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1440 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1440 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1441 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1441 */ __pyx_1 = (__pyx_v_fkappa < 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; goto __pyx_L1;} @@ -4753,7 +4749,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1443 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1443 */ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_fmu,__pyx_v_fkappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -4762,24 +4758,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1445 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1445 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1447 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1447 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_omu)); __pyx_v_omu = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1448 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1448 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_okappa)); __pyx_v_okappa = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1449 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1449 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -4816,7 +4812,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1451 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1451 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_omu,__pyx_v_okappa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -4868,14 +4864,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1529 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1529 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1530 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1530 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1531 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1531 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;} @@ -4890,7 +4886,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1533 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1533 */ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -4899,17 +4895,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1535 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1535 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1537 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1537 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oa)); __pyx_v_oa = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1538 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1538 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -4946,7 +4942,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1540 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1540 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -4996,14 +4992,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1628 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1628 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1629 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1629 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1630 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1630 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; goto __pyx_L1;} @@ -5018,7 +5014,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1632 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1632 */ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -5027,17 +5023,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1634 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1634 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1636 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1636 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oa)); __pyx_v_oa = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1637 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1637 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -5074,7 +5070,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1639 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1639 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -5124,14 +5120,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1651 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1651 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1652 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1652 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1653 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1653 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; goto __pyx_L1;} @@ -5146,7 +5142,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1655 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1655 */ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -5155,17 +5151,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1657 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1657 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1659 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1659 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oa)); __pyx_v_oa = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1660 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1660 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -5202,7 +5198,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1662 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1662 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -5259,17 +5255,17 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1689 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1689 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1690 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1690 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1691 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1691 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1692 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1692 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;} @@ -5284,7 +5280,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1694 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1694 */ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -5293,24 +5289,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1696 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1696 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1697 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1697 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1698 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1698 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1699 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1699 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -5347,7 +5343,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1701 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1701 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -5379,7 +5375,7 @@ static char __pyx_k116[] = "scale <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6mtrand_11RandomState_gumbel[] = "\n gumbel(loc=0.0, scale=1.0, size=None)\n\n Gumbel distribution.\n\n Draw samples from a Gumbel distribution with specified location (or mean)\n and scale (or standard deviation).\n\n The Gumbel (or Smallest Extreme Value (SEV) or the Smallest Extreme Value\n Type I) distribution is one of a class of Generalized Extreme Value (GEV)\n distributions used in modeling extreme value problems. The Gumbel is a\n special case of the Extreme Value Type I distribution for maximums from\n distributions with \"exponential-like\" tails, it may be derived by\n considering a Gaussian process of measurements, and generating the pdf for\n the maximum values from that set of measurements (see examples).\n\n Parameters\n ----------\n loc : float\n The location of the mode of the distribution.\n scale : float\n The scale parameter of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.gumbel : probability density function,\n distribution or cumulative density function, etc.\n weibull, scipy.stats.genextreme\n\n Notes\n -----\n The probability density for the Gumbel distribution is\n\n .. math:: p(x) = \\frac{e^{-(x - \\mu)/ \\beta}}{\\beta} e^{ -e^{-(x - \\mu)/\n \\beta}},\n\n where :math:`\\mu` is the mode, a location parameter, and :math:`\\beta`\n is the scale parameter.\n\n The Gumbel (named for German mathematician Emil Julius Gumbel) was used\n very early in the hydrology literature, for modeling the occurrence of\n flood events. It is also used for modeling maximum wind speed and rainfall\n rates. It is a \"fat-tailed\" distribution - the probability of an event in\n the tail of the distribution is larger than if one used a Gaussian, hence\n the surprisingly frequent occurrence of 100-year floods. Floods were\n initially modeled as a Gaussian process, which underestimated the frequency\n of extreme events.\n\n It is one of a class of extreme value distributions, the Generalized\n Extreme Value (GEV) distributions, which also includes the Weibull and\n Frechet.\n\n The function has a mean of :math:`\\mu + 0.57721\\beta` and a variance of\n :math:`\\frac{\\pi^2}{6}\\beta^2`.\n\n References\n ----------\n .. [1] Gumbel, E.J. (1958). Statistics of Extremes. Columbia University\n Press.\n .. [2] Reiss, R.-D. and Thomas M. (2001), Statistical Analysis of Extreme\n Values, from Insurance, Finance, Hydrology and Other Fields,\n Birkhauser Verlag, Basel: Boston : Berlin.\n .. [3] Wikipedia, \"Gumbel distribution\",\n http://en.wikipedia.org/wiki/Gumbel_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, beta = 0, 0.1 # location and scale\n >>> s = np.random.gumbel(mu, beta, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 30, normed=True)\n >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)* ... 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)* ... np.exp( -np.exp( -(bins - mu) /beta) ),\n ... linewidth=2, color=\'r\')\n >>> plt.plot(bins, 1/(beta * np.sqrt(2 * np.pi)) * ... np.exp( - (bins - mu)**2 / (2 * beta**2) ),\n ... linewidth=2, color=\'g\')\n >>> plt.show()\n\n "; +static char __pyx_doc_6mtrand_11RandomState_gumbel[] = "\n gumbel(loc=0.0, scale=1.0, size=None)\n\n Gumbel distribution.\n\n Draw samples from a Gumbel distribution with specified location (or mean)\n and scale (or standard deviation).\n\n The Gumbel (or Smallest Extreme Value (SEV) or the Smallest Extreme Value\n Type I) distribution is one of a class of Generalized Extreme Value (GEV)\n distributions used in modeling extreme value problems. The Gumbel is a\n special case of the Extreme Value Type I distribution for maximums from\n distributions with \"exponential-like\" tails, it may be derived by\n considering a Gaussian process of measurements, and generating the pdf for\n the maximum values from that set of measurements (see examples).\n\n Parameters\n ----------\n loc : float\n The location of the mode of the distribution.\n scale : float\n The scale parameter of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.gumbel : probability density function,\n distribution or cumulative density function, etc.\n weibull, scipy.stats.genextreme\n\n Notes\n -----\n The probability density for the Gumbel distribution is\n\n .. math:: p(x) = \\frac{e^{-(x - \\mu)/ \\beta}}{\\beta} e^{ -e^{-(x - \\mu)/\n \\beta}},\n\n where :math:`\\mu` is the mode, a location parameter, and :math:`\\beta`\n is the scale parameter.\n\n The Gumbel (named for German mathematician Emil Julius Gumbel) was used\n very early in the hydrology literature, for modeling the occurrence of\n flood events. It is also used for modeling maximum wind speed and rainfall\n rates. It is a \"fat-tailed\" distribution - the probability of an event in\n the tail of the distribution is larger than if one used a Gaussian, hence\n the surprisingly frequent occurrence of 100-year floods. Floods were\n initially modeled as a Gaussian process, which underestimated the frequency\n of extreme events.\n\n It is one of a class of extreme value distributions, the Generalized\n Extreme Value (GEV) distributions, which also includes the Weibull and\n Frechet.\n\n The function has a mean of :math:`\\mu + 0.57721\\beta` and a variance of\n :math:`\\frac{\\pi^2}{6}\\beta^2`.\n\n References\n ----------\n .. [1] Gumbel, E.J. (1958). Statistics of Extremes. Columbia University\n Press.\n .. [2] Reiss, R.-D. and Thomas M. (2001), Statistical Analysis of Extreme\n Values, from Insurance, Finance, Hydrology and Other Fields,\n Birkhauser Verlag, Basel: Boston : Berlin.\n .. [3] Wikipedia, \"Gumbel distribution\",\n http://en.wikipedia.org/wiki/Gumbel_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, beta = 0, 0.1 # location and scale\n >>> s = np.random.gumbel(mu, beta, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 30, normed=True)\n >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)*\n ... np.exp( -np.exp( -(bins - mu) /beta) ),\n ... linewidth=2, color=\'r\')\n >>> plt.show()\n\n Show how an extreme value distribution can arise from a Gaussian process\n and compare to a Gaussian:\n\n >>> means = []\n >>> maxima = []\n >>> for i in range(0,1000) :\n ... a = np.random.normal(mu, beta, 1000)\n ... means.append(a.mean())\n ... maxima.append(a.max())\n >>> count, bins, ignored = plt.hist(maxima, 30, normed=True)\n >>> beta = np.std(maxima)*np.pi/np.sqrt(6)\n >>> mu = np.mean(maxima) - 0.57721*beta\n >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)*\n ... np.exp( -np.exp( -(bins - mu) /beta) ),\n ... linewidth=2, color=\'r\')\n >>> plt.plot(bins, 1/(beta * np.sqrt(2 * np.pi)) *\n ... np.exp( - (bins - mu)**2 / (2 * beta**2) ),\n ... linewidth=2, color=\'g\')\n >>> plt.show()\n\n "; static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_loc = 0; PyObject *__pyx_v_scale = 0; @@ -5406,17 +5402,17 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1813 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1813 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1814 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1814 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1815 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1815 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1816 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1816 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; goto __pyx_L1;} @@ -5431,7 +5427,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1818 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1818 */ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -5440,24 +5436,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1820 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1820 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1821 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1821 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1822 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1822 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1823 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1823 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -5494,7 +5490,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1825 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1825 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -5553,17 +5549,17 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1837 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1837 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1838 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1838 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1839 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1839 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1840 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1840 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; goto __pyx_L1;} @@ -5578,7 +5574,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1842 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1842 */ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -5587,24 +5583,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1844 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1844 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1845 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1845 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1845; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1845; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1846 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1846 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1847 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1847 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -5641,7 +5637,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1849 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1849 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -5673,7 +5669,7 @@ static char __pyx_k120[] = "sigma <= 0.0"; static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6mtrand_11RandomState_lognormal[] = "\n lognormal(mean=0.0, sigma=1.0, size=None)\n\n Log-normal distribution.\n\n Draw samples from a log-normal distribution with specified mean, standard\n deviation, and shape. Note that the mean and standard deviation are not the\n values for the distribution itself, but of the underlying normal\n distribution it is derived from.\n\n\n Parameters\n ----------\n mean : float\n Mean value of the underlying normal distribution\n sigma : float, >0.\n Standard deviation of the underlying normal distribution\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.lognorm : probability density function, distribution,\n cumulative density function, etc.\n\n Notes\n -----\n A variable `x` has a log-normal distribution if `log(x)` is normally\n distributed.\n\n The probability density function for the log-normal distribution is\n\n .. math:: p(x) = \\frac{1}{\\sigma x \\sqrt{2\\pi}}\n e^{(-\\frac{(ln(x)-\\mu)^2}{2\\sigma^2})}\n\n where :math:`\\mu` is the mean and :math:`\\sigma` is the standard deviation\n of the normally distributed logarithm of the variable.\n\n A log normal distribution results if a random variable is the *product* of\n a large number of independent, identically-distributed variables in the\n same way that a normal distribution results if the variable is the *sum*\n of a large number of independent, identically-distributed variables\n (see the last example). It is one of the so-called \"fat-tailed\"\n distributions.\n\n The log-normal distribution is commonly used to model the lifespan of units\n with fatigue-stress failure modes. Since this includes\n most mechanical systems, the lognormal distribution has widespread\n application.\n\n It is also commonly used to model oil field sizes, species abundance, and\n latent periods of infectious diseases.\n\n References\n ----------\n .. [1] Eckhard Limpert, Werner A. Stahel, and Markus Abbt, \"Log-normal\n Distributions across the Sciences: Keys and Clues\", May 2001\n Vol. 51 No. 5 BioScience\n http://stat.ethz.ch/~stahel/lognormal/bioscience.pdf\n .. [2] Reiss, R.D., Thomas, M.(2001), Statistical Analysis of Extreme\n Values, Birkhauser Verlag, Basel, pp 31-32.\n .. [3] Wikipedia, \"Lognormal distribution\",\n http://en.wikipedia.org/wiki/Lognormal_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, sigma = 3., 1. # mean and standard deviation\n >>> s = np.random.lognormal(mu, sigma, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 100, normed=True, align=\'center\')\n\n >>> x = np.linspace(min(bins), max(bins), 10000)\n >>> pdf = np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2)) ... / (x * sigma * np.sqrt(2 * np.pi))\n\n >>> plt.plot(x, pdf, linewidth=2, color=\'r\')\n >>> plt.axis(\'tight\')\n >>> plt.show()\n\n Demonstrate that taking the products of random samples from a uniform\n distribution can be fit well by a log-normal pdf.\n\n >>> # Generate a thousand samples: each is the product of 100 random\n >>> # values, drawn from a normal distribution.\n >>> b = []\n >>> for i in range(1000):\n ... a = 10. + np.random.random(100)\n ... b.append(np.product(a))\n\n >>> b = np.array(b) / np.min(b) # scale values to be positive\n\n >>> count, bins, ignored = plt.hist(b, 100, normed=True, align=\'center\')\n\n >>> sigma = np.std(np.log(b))\n >>> mu = np.mean(np.log(b))\n\n >>> x = np.linspace(min(bins), max(bins), 10000)\n >>> pdf = np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2)) ... / (x * sigma * np.sqrt(2 * np.pi))\n\n >>> plt.plot(x, pdf, color=\'r\', linewidth=2)\n >>> plt.show()\n\n "; +static char __pyx_doc_6mtrand_11RandomState_lognormal[] = "\n lognormal(mean=0.0, sigma=1.0, size=None)\n\n Log-normal distribution.\n\n Draw samples from a log-normal distribution with specified mean, standard\n deviation, and shape. Note that the mean and standard deviation are not the\n values for the distribution itself, but of the underlying normal\n distribution it is derived from.\n\n\n Parameters\n ----------\n mean : float\n Mean value of the underlying normal distribution\n sigma : float, >0.\n Standard deviation of the underlying normal distribution\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.lognorm : probability density function, distribution,\n cumulative density function, etc.\n\n Notes\n -----\n A variable `x` has a log-normal distribution if `log(x)` is normally\n distributed.\n\n The probability density function for the log-normal distribution is\n\n .. math:: p(x) = \\frac{1}{\\sigma x \\sqrt{2\\pi}}\n e^{(-\\frac{(ln(x)-\\mu)^2}{2\\sigma^2})}\n\n where :math:`\\mu` is the mean and :math:`\\sigma` is the standard deviation\n of the normally distributed logarithm of the variable.\n\n A log normal distribution results if a random variable is the *product* of\n a large number of independent, identically-distributed variables in the\n same way that a normal distribution results if the variable is the *sum*\n of a large number of independent, identically-distributed variables\n (see the last example). It is one of the so-called \"fat-tailed\"\n distributions.\n\n The log-normal distribution is commonly used to model the lifespan of units\n with fatigue-stress failure modes. Since this includes\n most mechanical systems, the lognormal distribution has widespread\n application.\n\n It is also commonly used to model oil field sizes, species abundance, and\n latent periods of infectious diseases.\n\n References\n ----------\n .. [1] Eckhard Limpert, Werner A. Stahel, and Markus Abbt, \"Log-normal\n Distributions across the Sciences: Keys and Clues\", May 2001\n Vol. 51 No. 5 BioScience\n http://stat.ethz.ch/~stahel/lognormal/bioscience.pdf\n .. [2] Reiss, R.D., Thomas, M.(2001), Statistical Analysis of Extreme\n Values, Birkhauser Verlag, Basel, pp 31-32.\n .. [3] Wikipedia, \"Lognormal distribution\",\n http://en.wikipedia.org/wiki/Lognormal_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, sigma = 3., 1. # mean and standard deviation\n >>> s = np.random.lognormal(mu, sigma, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 100, normed=True, align=\'center\')\n\n >>> x = np.linspace(min(bins), max(bins), 10000)\n >>> pdf = (np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2))\n ... / (x * sigma * np.sqrt(2 * np.pi)))\n\n >>> plt.plot(x, pdf, linewidth=2, color=\'r\')\n >>> plt.axis(\'tight\')\n >>> plt.show()\n\n Demonstrate that taking the products of random samples from a uniform\n distribution can be fit well by a log-normal pdf.\n\n >>> # Generate a thousand samples: each is the product of 100 random\n >>> # values, drawn from a normal distribution.\n >>> b = []\n >>> for i in range(1000):\n ... a = 10. + np.random.random(100)\n ... b.append(np.product(a))\n\n >>> b = np.array(b) / np.min(b) # scale values to be positive\n\n >>> count, bins, ignored = plt.hist(b, 100, normed=True, align=\'center\')\n\n >>> sigma = np.std(np.log(b))\n >>> mu = np.mean(np.log(b))\n\n >>> x = np.linspace(min(bins), max(bins), 10000)\n >>> pdf = (np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2))\n ... / (x * sigma * np.sqrt(2 * np.pi)))\n\n >>> plt.plot(x, pdf, color=\'r\', linewidth=2)\n >>> plt.show()\n\n "; static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_mean = 0; PyObject *__pyx_v_sigma = 0; @@ -5700,17 +5696,17 @@ __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_osigma = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1966 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1966 */ __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1967 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1967 */ __pyx_v_fsigma = PyFloat_AsDouble(__pyx_v_sigma); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1969 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1969 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1970 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1970 */ __pyx_1 = (__pyx_v_fsigma <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; goto __pyx_L1;} @@ -5725,7 +5721,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1972 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1972 */ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_fmean,__pyx_v_fsigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -5734,24 +5730,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1974 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1974 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1976 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1976 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); __pyx_v_omean = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1977 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1977 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_osigma)); __pyx_v_osigma = ((PyArrayObject *)__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1978 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1978 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -5788,7 +5784,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1980 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1980 */ __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_omean,__pyx_v_osigma); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -5841,14 +5837,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1992 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1992 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1994 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1994 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1995 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1995 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; goto __pyx_L1;} @@ -5863,7 +5859,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1997 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1997 */ __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -5872,17 +5868,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1999 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1999 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2001 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2001 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2002 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2002 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -5919,7 +5915,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2004 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2004 */ __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2004; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -5978,17 +5974,17 @@ __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2016 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2016 */ __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2017 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2017 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2018 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2018 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2019 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2019 */ __pyx_1 = (__pyx_v_fmean <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;} @@ -6003,7 +5999,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2021 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2021 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; goto __pyx_L1;} @@ -6018,7 +6014,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2023 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2023 */ __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_fmean,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2023; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -6027,24 +6023,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2025 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2025 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2026 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2026 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); __pyx_v_omean = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2027 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2027 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; goto __pyx_L1;} if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2028 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2028 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -6115,7 +6111,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2032 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2032 */ __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_omean,__pyx_v_oscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2032; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -6188,20 +6184,20 @@ __pyx_v_omode = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oright = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2047 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2047 */ __pyx_v_fleft = PyFloat_AsDouble(__pyx_v_left); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2048 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2048 */ __pyx_v_fright = PyFloat_AsDouble(__pyx_v_right); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2049 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2049 */ __pyx_v_fmode = PyFloat_AsDouble(__pyx_v_mode); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2050 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2050 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2051 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2051 */ __pyx_1 = (__pyx_v_fleft > __pyx_v_fmode); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} @@ -6216,7 +6212,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2053 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2053 */ __pyx_1 = (__pyx_v_fmode > __pyx_v_fright); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; goto __pyx_L1;} @@ -6231,7 +6227,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2055 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2055 */ __pyx_1 = (__pyx_v_fleft == __pyx_v_fright); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; goto __pyx_L1;} @@ -6246,7 +6242,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2057 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2057 */ __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_fleft,__pyx_v_fmode,__pyx_v_fright); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -6255,31 +6251,31 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2060 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2060 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2061 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2061 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oleft)); __pyx_v_oleft = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2062 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2062 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_omode)); __pyx_v_omode = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2063 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2063 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oright)); __pyx_v_oright = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2065 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2065 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -6315,7 +6311,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2067 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2067 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -6351,7 +6347,7 @@ } __pyx_L7:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2069 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2069 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -6387,7 +6383,7 @@ } __pyx_L8:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2071 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2071 */ __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_oleft,__pyx_v_omode,__pyx_v_oright); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -6454,17 +6450,17 @@ __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2086 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2086 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2087 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2087 */ __pyx_v_ln = PyInt_AsLong(__pyx_v_n); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2088 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2088 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2089 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2089 */ __pyx_1 = (__pyx_v_ln <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; goto __pyx_L1;} @@ -6479,7 +6475,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2091 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2091 */ __pyx_1 = (__pyx_v_fp < 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; goto __pyx_L1;} @@ -6506,7 +6502,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2095 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2095 */ __pyx_2 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_ln,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -6515,24 +6511,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2097 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2097 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2099 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2099 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_on)); __pyx_v_on = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2100 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2100 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_op)); __pyx_v_op = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2101 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2101 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -6569,7 +6565,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2103 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2103 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -6606,7 +6602,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2105 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2105 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -6643,7 +6639,7 @@ } __pyx_L7:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2107 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2107 */ __pyx_5 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2107; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; @@ -6708,17 +6704,17 @@ __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2121 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2121 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2122 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2122 */ __pyx_v_ln = PyInt_AsLong(__pyx_v_n); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2123 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2123 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2124 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2124 */ __pyx_1 = (__pyx_v_ln <= 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; goto __pyx_L1;} @@ -6733,7 +6729,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2126 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2126 */ __pyx_1 = (__pyx_v_fp < 0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; goto __pyx_L1;} @@ -6760,7 +6756,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2130 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2130 */ __pyx_2 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_ln,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -6769,24 +6765,24 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2133 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2133 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2135 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2135 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2135; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_on)); __pyx_v_on = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2136 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2136 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2136; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_op)); __pyx_v_op = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2137 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2137 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -6823,7 +6819,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2139 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2139 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -6860,7 +6856,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2141 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2141 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -6897,7 +6893,7 @@ } __pyx_L7:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2143 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2143 */ __pyx_5 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; @@ -6950,14 +6946,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_olam = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2155 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2155 */ __pyx_v_flam = PyFloat_AsDouble(__pyx_v_lam); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2156 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2156 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2157 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2157 */ __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; goto __pyx_L1;} if (PyObject_Cmp(__pyx_v_lam, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; @@ -6975,7 +6971,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2159 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2159 */ __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_flam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -6984,17 +6980,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2161 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2161 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2163 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2163 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_olam)); __pyx_v_olam = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2164 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2164 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -7031,7 +7027,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2166 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2166 */ __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_olam); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -7081,14 +7077,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2247 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2247 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2248 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2248 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2249 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2249 */ __pyx_1 = (__pyx_v_fa <= 1.0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; goto __pyx_L1;} @@ -7103,7 +7099,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2251 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2251 */ __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -7112,17 +7108,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2253 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2253 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2255 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2255 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oa)); __pyx_v_oa = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2256 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2256 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -7159,7 +7155,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2258 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2258 */ __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2258; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -7213,14 +7209,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2308 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2308 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2309 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2309 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2310 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2310 */ __pyx_1 = (__pyx_v_fp < 0.0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2311; goto __pyx_L1;} @@ -7235,7 +7231,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2312 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2312 */ __pyx_1 = (__pyx_v_fp > 1.0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; goto __pyx_L1;} @@ -7250,7 +7246,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2314 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2314 */ __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -7259,17 +7255,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2316 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2316 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2319 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2319 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2319; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_op)); __pyx_v_op = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2320 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2320 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -7306,7 +7302,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2322 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2322 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -7343,7 +7339,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2324 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2324 */ __pyx_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_op); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; @@ -7418,20 +7414,20 @@ __pyx_v_onbad = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_onsample = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2341 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2341 */ __pyx_v_lngood = PyInt_AsLong(__pyx_v_ngood); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2342 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2342 */ __pyx_v_lnbad = PyInt_AsLong(__pyx_v_nbad); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2343 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2343 */ __pyx_v_lnsample = PyInt_AsLong(__pyx_v_nsample); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2344 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2344 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2345 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2345 */ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2345; goto __pyx_L1;} if (PyObject_Cmp(__pyx_v_ngood, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2345; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; @@ -7449,7 +7445,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2347 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2347 */ __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; goto __pyx_L1;} if (PyObject_Cmp(__pyx_v_nbad, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; @@ -7467,7 +7463,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2349 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2349 */ __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2349; goto __pyx_L1;} if (PyObject_Cmp(__pyx_v_nsample, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2349; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; @@ -7485,7 +7481,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2351 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2351 */ __pyx_2 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; goto __pyx_L1;} if (PyObject_Cmp(__pyx_2, __pyx_v_nsample, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; @@ -7503,7 +7499,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2353 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2353 */ __pyx_3 = __pyx_f_6mtrand_discnmN_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_lngood,__pyx_v_lnbad,__pyx_v_lnsample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2353; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; @@ -7512,31 +7508,31 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2357 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2357 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2359 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2359 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2359; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_ongood)); __pyx_v_ongood = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2360 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2360 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2360; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_onbad)); __pyx_v_onbad = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2361 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2361 */ __pyx_2 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_onsample)); __pyx_v_onsample = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2362 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2362 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -7573,7 +7569,7 @@ } __pyx_L7:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2364 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2364 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -7610,7 +7606,7 @@ } __pyx_L8:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2366 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2366 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -7647,7 +7643,7 @@ } __pyx_L9:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2368 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2368 */ __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; @@ -7694,7 +7690,7 @@ } __pyx_L10:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2370 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2370 */ __pyx_4 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ongood,__pyx_v_onbad,__pyx_v_onsample); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; @@ -7753,14 +7749,14 @@ Py_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2383 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2383 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2384 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2384 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2385 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2385 */ __pyx_1 = (__pyx_v_fp < 0.0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; goto __pyx_L1;} @@ -7775,7 +7771,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2387 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2387 */ __pyx_1 = (__pyx_v_fp > 1.0); if (__pyx_1) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; goto __pyx_L1;} @@ -7790,7 +7786,7 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2389 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2389 */ __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2389; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; @@ -7799,17 +7795,17 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2391 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2391 */ PyErr_Clear(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2393 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2393 */ __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_op)); __pyx_v_op = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2394 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2394 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -7846,7 +7842,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2396 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2396 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -7883,7 +7879,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2398 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2398 */ __pyx_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_op); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; @@ -7960,7 +7956,7 @@ __pyx_v_s = Py_None; Py_INCREF(Py_None); __pyx_v_v = Py_None; Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2494 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2494 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -7974,7 +7970,7 @@ __pyx_v_mean = __pyx_3; __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2495 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2495 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; @@ -7988,7 +7984,7 @@ __pyx_v_cov = __pyx_2; __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2496 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2496 */ __pyx_4 = __pyx_v_size == Py_None; if (__pyx_4) { __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2497; goto __pyx_L1;} @@ -8004,7 +8000,7 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2500 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2500 */ __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2500; goto __pyx_L1;} __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2500; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -8022,17 +8018,17 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2502 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2502 */ __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_4 = (__pyx_5 != 2); if (!__pyx_4) { __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} - __pyx_1 = __Pyx_GetItemInt(__pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} + __pyx_1 = PySequence_GetItem(__pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} - __pyx_2 = __Pyx_GetItemInt(__pyx_3, 1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} + __pyx_2 = PySequence_GetItem(__pyx_3, 1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} __pyx_4 = __pyx_4 != 0; @@ -8052,12 +8048,12 @@ } __pyx_L4:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2504 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2504 */ __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} - __pyx_3 = __Pyx_GetItemInt(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} + __pyx_3 = PySequence_GetItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} - __pyx_2 = __Pyx_GetItemInt(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} + __pyx_2 = PySequence_GetItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; if (PyObject_Cmp(__pyx_3, __pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} __pyx_4 = __pyx_4 != 0; @@ -8076,7 +8072,7 @@ } __pyx_L5:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2507 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2507 */ __pyx_4 = PyObject_IsInstance(__pyx_v_shape,((PyObject *)(&PyInt_Type))); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; goto __pyx_L1;} if (__pyx_4) { __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2508; goto __pyx_L1;} @@ -8089,7 +8085,7 @@ } __pyx_L6:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2509 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2509 */ __pyx_1 = PySequence_GetSlice(__pyx_v_shape, 0, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); @@ -8100,10 +8096,10 @@ __pyx_v_final_shape = __pyx_2; __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2510 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2510 */ __pyx_1 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;} - __pyx_2 = __Pyx_GetItemInt(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;} + __pyx_2 = PySequence_GetItem(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); @@ -8113,7 +8109,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2514 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2514 */ __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;} __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;} @@ -8136,7 +8132,7 @@ __pyx_v_x = __pyx_2; __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2515 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2515 */ __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; @@ -8151,7 +8147,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; goto __pyx_L1;} - __pyx_3 = __Pyx_GetItemInt(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; goto __pyx_L1;} + __pyx_3 = PySequence_GetItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_6, 0, __pyx_1); @@ -8161,7 +8157,7 @@ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2524 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2524 */ __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; goto __pyx_L1;} Py_INCREF(__pyx_n_svd); PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd); @@ -8173,7 +8169,7 @@ __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2526 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2526 */ __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;} Py_INCREF(__pyx_v_cov); PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_cov); @@ -8196,7 +8192,7 @@ if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2527 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2527 */ __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;} __pyx_6 = PyObject_GetAttr(__pyx_3, __pyx_n_dot); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -8223,7 +8219,7 @@ __pyx_v_x = __pyx_2; __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2530 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2530 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; goto __pyx_L1;} __pyx_6 = PyObject_GetAttr(__pyx_1, __pyx_n_add); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -8239,7 +8235,7 @@ Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2531 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2531 */ __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; goto __pyx_L1;} Py_INCREF(__pyx_v_final_shape); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_final_shape); @@ -8248,7 +8244,7 @@ if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2532 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2532 */ Py_INCREF(__pyx_v_x); __pyx_r = __pyx_v_x; goto __pyx_L0; @@ -8318,21 +8314,21 @@ __pyx_v_shape = Py_None; Py_INCREF(Py_None); __pyx_v_multin = Py_None; Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2593 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2593 */ __pyx_1 = PyObject_Length(__pyx_v_pvals); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; goto __pyx_L1;} __pyx_v_d = __pyx_1; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2594 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2594 */ __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject_parr)); arrayObject_parr = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2595 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2595 */ __pyx_v_pix = ((double *)arrayObject_parr->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2597 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2597 */ __pyx_3 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > (1.0 + 1e-12)); if (__pyx_3) { __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; goto __pyx_L1;} @@ -8347,7 +8343,7 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2600 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2600 */ __pyx_3 = __pyx_v_size == Py_None; if (__pyx_3) { __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; goto __pyx_L1;} @@ -8391,7 +8387,7 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2607 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2607 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -8407,39 +8403,39 @@ __pyx_v_multin = __pyx_5; __pyx_5 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2608 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2608 */ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin))); Py_DECREF(((PyObject *)arrayObject_mnarr)); arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2609 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2609 */ __pyx_v_mnix = ((long *)arrayObject_mnarr->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2610 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2610 */ __pyx_v_i = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2611 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2611 */ while (1) { __pyx_3 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr)); if (!__pyx_3) break; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2612 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2612 */ __pyx_v_Sum = 1.0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2613 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2613 */ __pyx_v_dn = __pyx_v_n; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2614 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2614 */ __pyx_6 = (__pyx_v_d - 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_6; ++__pyx_v_j) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2615 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2615 */ (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum)); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2616 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2616 */ __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2617 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2617 */ __pyx_3 = (__pyx_v_dn <= 0); if (__pyx_3) { goto __pyx_L7; @@ -8447,12 +8443,12 @@ } __pyx_L8:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2619 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2619 */ __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j])); } __pyx_L7:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2620 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2620 */ __pyx_3 = (__pyx_v_dn > 0); if (__pyx_3) { (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn; @@ -8460,11 +8456,11 @@ } __pyx_L9:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2623 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2623 */ __pyx_v_i = (__pyx_v_i + __pyx_v_d); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2625 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2625 */ Py_INCREF(__pyx_v_multin); __pyx_r = __pyx_v_multin; goto __pyx_L0; @@ -8489,7 +8485,7 @@ } static PyObject *__pyx_f_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6mtrand_11RandomState_dirichlet[] = "\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 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\n "; +static char __pyx_doc_6mtrand_11RandomState_dirichlet[] = "\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 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\n "; static PyObject *__pyx_f_6mtrand_11RandomState_dirichlet(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_alpha = 0; PyObject *__pyx_v_size = 0; @@ -8522,21 +8518,21 @@ __pyx_v_shape = Py_None; Py_INCREF(Py_None); __pyx_v_diric = Py_None; Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2691 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2691 */ __pyx_1 = PyObject_Length(__pyx_v_alpha); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2691; goto __pyx_L1;} __pyx_v_k = __pyx_1; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2692 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2692 */ __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2692; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_alpha_arr)); __pyx_v_alpha_arr = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2693 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2693 */ __pyx_v_alpha_data = ((double *)__pyx_v_alpha_arr->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2695 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2695 */ __pyx_3 = __pyx_v_size == Py_None; if (__pyx_3) { __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2696; goto __pyx_L1;} @@ -8580,7 +8576,7 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2702 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2702 */ __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; @@ -8599,51 +8595,51 @@ __pyx_v_diric = __pyx_5; __pyx_5 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2703 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2703 */ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_diric))); Py_DECREF(((PyObject *)__pyx_v_val_arr)); __pyx_v_val_arr = ((PyArrayObject *)__pyx_v_diric); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2704 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2704 */ __pyx_v_val_data = ((double *)__pyx_v_val_arr->data); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2706 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2706 */ __pyx_v_i = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2707 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2707 */ __pyx_v_totsize = PyArray_SIZE(__pyx_v_val_arr); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2708 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2708 */ while (1) { __pyx_3 = (__pyx_v_i < __pyx_v_totsize); if (!__pyx_3) break; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2709 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2709 */ __pyx_v_acc = 0.0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2710 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2710 */ for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; ++__pyx_v_j) { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2711 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2711 */ (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = rk_standard_gamma(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,(__pyx_v_alpha_data[__pyx_v_j])); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2712 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2712 */ __pyx_v_acc = (__pyx_v_acc + (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)])); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2713 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2713 */ __pyx_v_invacc = (1 / __pyx_v_acc); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2714 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2714 */ for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; ++__pyx_v_j) { (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = ((__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) * __pyx_v_invacc); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2716 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2716 */ __pyx_v_i = (__pyx_v_i + __pyx_v_k); } - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2718 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2718 */ Py_INCREF(__pyx_v_diric); __pyx_r = __pyx_v_diric; goto __pyx_L0; @@ -8688,13 +8684,13 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_x); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2731 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2731 */ __pyx_1 = PyObject_Length(__pyx_v_x); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2731; goto __pyx_L1;} __pyx_v_i = (__pyx_1 - 1); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2732 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2732 */ /*try:*/ { - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; goto __pyx_L2;} + __pyx_2 = PySequence_GetItem(__pyx_v_x, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; goto __pyx_L2;} __pyx_1 = PyObject_Length(__pyx_2); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; goto __pyx_L2;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_v_j = __pyx_1; @@ -8703,7 +8699,7 @@ __pyx_L2:; Py_XDECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2734 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2734 */ /*except:*/ { __Pyx_AddTraceback("mtrand.shuffle"); if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; goto __pyx_L1;} @@ -8715,64 +8711,64 @@ } __pyx_L3:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2737 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2737 */ __pyx_5 = (__pyx_v_j == 0); if (__pyx_5) { while (1) { __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2740 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2740 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2741 */ - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} - __pyx_3 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2741 */ + __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} + __pyx_3 = PySequence_GetItem(__pyx_v_x, __pyx_v_i); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} + if (PySequence_SetItem(__pyx_v_x, __pyx_v_i, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} + if (PySequence_SetItem(__pyx_v_x, __pyx_v_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2742 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2742 */ __pyx_v_i = (__pyx_v_i - 1); } goto __pyx_L4; } /*else*/ { - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2745 */ - __pyx_4 = __Pyx_GetItemInt(__pyx_v_x, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2745; goto __pyx_L1;} + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2745 */ + __pyx_4 = PySequence_GetItem(__pyx_v_x, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2745; goto __pyx_L1;} __pyx_5 = PyObject_HasAttr(__pyx_4,__pyx_n_copy); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2745; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_v_copy = __pyx_5; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2746 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2746 */ __pyx_5 = __pyx_v_copy; if (__pyx_5) { while (1) { __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2748 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2748 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2749 */ - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2749 */ + __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} + __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_2 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} + if (PySequence_SetItem(__pyx_v_x, __pyx_v_i, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} + if (PySequence_SetItem(__pyx_v_x, __pyx_v_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2750 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2750 */ __pyx_v_i = (__pyx_v_i - 1); } goto __pyx_L7; @@ -8782,22 +8778,22 @@ __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2753 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2753 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2754 */ - __pyx_3 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2754 */ + __pyx_3 = PySequence_GetItem(__pyx_v_x, __pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} __pyx_4 = PySequence_GetSlice(__pyx_3, 0, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} + __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_i, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} + if (PySequence_SetItem(__pyx_v_x, __pyx_v_i, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - if (__Pyx_SetItemInt(__pyx_v_x, __pyx_v_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} + if (PySequence_SetItem(__pyx_v_x, __pyx_v_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2755 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2755 */ __pyx_v_i = (__pyx_v_i - 1); } } @@ -8837,7 +8833,7 @@ Py_INCREF(__pyx_v_x); __pyx_v_arr = Py_None; Py_INCREF(Py_None); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2784 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2784 */ __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;} __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_integer); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; @@ -8879,7 +8875,7 @@ } __pyx_L2:; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2788 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2788 */ __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2788; goto __pyx_L1;} __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2788; goto __pyx_L1;} Py_INCREF(__pyx_v_arr); @@ -8889,7 +8885,7 @@ Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2789 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2789 */ Py_INCREF(__pyx_v_arr); __pyx_r = __pyx_v_arr; goto __pyx_L0; @@ -9335,37 +9331,37 @@ if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; goto __pyx_L1;} __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":120 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":120 */ import_array(); - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":122 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":122 */ __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":496 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":496 */ Py_INCREF(Py_None); __pyx_k2 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":506 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":506 */ Py_INCREF(Py_None); __pyx_k3 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":596 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":596 */ Py_INCREF(Py_None); __pyx_k4 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":605 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":605 */ Py_INCREF(Py_None); __pyx_k5 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":633 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":633 */ Py_INCREF(Py_None); __pyx_k6 = Py_None; Py_INCREF(Py_None); __pyx_k7 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":697 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":697 */ __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; goto __pyx_L1;} __pyx_k8 = __pyx_1; __pyx_1 = 0; @@ -9375,17 +9371,17 @@ Py_INCREF(Py_None); __pyx_k10 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":845 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":845 */ Py_INCREF(Py_None); __pyx_k11 = Py_None; Py_INCREF(Py_None); __pyx_k12 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":860 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":860 */ Py_INCREF(Py_None); __pyx_k13 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":869 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":869 */ __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;} __pyx_k14 = __pyx_3; __pyx_3 = 0; @@ -9395,73 +9391,73 @@ Py_INCREF(Py_None); __pyx_k16 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":969 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":969 */ Py_INCREF(Py_None); __pyx_k17 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1028 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1028 */ __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;} __pyx_k18 = __pyx_5; __pyx_5 = 0; Py_INCREF(Py_None); __pyx_k19 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1078 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1078 */ Py_INCREF(Py_None); __pyx_k20 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1087 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1087 */ Py_INCREF(Py_None); __pyx_k21 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1109 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1109 */ __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; goto __pyx_L1;} __pyx_k22 = __pyx_6; __pyx_6 = 0; Py_INCREF(Py_None); __pyx_k23 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1137 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1137 */ Py_INCREF(Py_None); __pyx_k24 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1166 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1166 */ Py_INCREF(Py_None); __pyx_k25 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1204 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1204 */ Py_INCREF(Py_None); __pyx_k26 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1284 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1284 */ Py_INCREF(Py_None); __pyx_k27 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1326 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1326 */ Py_INCREF(Py_None); __pyx_k28 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1335 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1335 */ Py_INCREF(Py_None); __pyx_k29 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1358 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1358 */ Py_INCREF(Py_None); __pyx_k30 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1453 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1453 */ Py_INCREF(Py_None); __pyx_k31 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1542 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1542 */ Py_INCREF(Py_None); __pyx_k32 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1641 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1641 */ Py_INCREF(Py_None); __pyx_k33 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1664 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1664 */ __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} __pyx_k34 = __pyx_7; __pyx_7 = 0; @@ -9471,7 +9467,7 @@ Py_INCREF(Py_None); __pyx_k36 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1703 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1703 */ __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;} __pyx_k37 = __pyx_9; __pyx_9 = 0; @@ -9481,7 +9477,7 @@ Py_INCREF(Py_None); __pyx_k39 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1827 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1827 */ __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; goto __pyx_L1;} __pyx_k40 = __pyx_11; __pyx_11 = 0; @@ -9491,7 +9487,7 @@ Py_INCREF(Py_None); __pyx_k42 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1851 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1851 */ __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; goto __pyx_L1;} __pyx_k43 = __pyx_13; __pyx_13 = 0; @@ -9501,385 +9497,385 @@ Py_INCREF(Py_None); __pyx_k45 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":1982 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1982 */ __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; goto __pyx_L1;} __pyx_k46 = __pyx_15; __pyx_15 = 0; Py_INCREF(Py_None); __pyx_k47 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2006 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2006 */ Py_INCREF(Py_None); __pyx_k48 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2036 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2036 */ Py_INCREF(Py_None); __pyx_k49 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2075 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2075 */ Py_INCREF(Py_None); __pyx_k50 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2109 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2109 */ Py_INCREF(Py_None); __pyx_k51 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2146 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2146 */ __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; goto __pyx_L1;} __pyx_k52 = __pyx_16; __pyx_16 = 0; Py_INCREF(Py_None); __pyx_k53 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2168 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2168 */ Py_INCREF(Py_None); __pyx_k54 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2260 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2260 */ Py_INCREF(Py_None); __pyx_k55 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2326 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2326 */ Py_INCREF(Py_None); __pyx_k56 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2373 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2373 */ Py_INCREF(Py_None); __pyx_k57 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2401 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2401 */ Py_INCREF(Py_None); __pyx_k58 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2534 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2534 */ Py_INCREF(Py_None); __pyx_k59 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2627 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2627 */ Py_INCREF(Py_None); __pyx_k60 = Py_None; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2791 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2791 */ __pyx_17 = PyObject_CallObject(((PyObject *)__pyx_ptype_6mtrand_RandomState), 0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2792 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2792 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2792; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2792; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2792; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2793 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2793 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2794 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2794 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2794; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2794; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2794; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2795 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2795 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2796 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2796 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2797 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2797 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2797; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2797; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2797; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2798 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2798 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2799 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2799 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2800 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2800 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2801 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2801 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2802 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2802 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2803 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2803 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2804 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2804 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2805 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2805 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2806 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2806 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2807 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2807 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2808 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2808 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2809 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2809 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2810 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2810 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2811 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2811 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2811; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2811; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2811; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2812 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2812 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2813 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2813 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2813; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2813; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2813; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2814 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2814 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2814; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2814; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2814; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2815 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2815 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2816 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2816 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2817 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2817 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2818 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2818 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2819 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2819 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2820 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2820 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2821 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2821 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2822 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2822 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2823 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2823 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2824 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2824 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2825 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2825 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2827 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2827 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2828 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2828 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2829 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2829 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2830 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2830 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2831 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2831 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2832 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2832 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2832; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2832; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2832; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2833 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2833 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2833; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2833; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2833; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2835 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2835 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2836 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2836 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2836; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2836; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2836; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2837 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2837 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_dirichlet); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_dirichlet, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2839 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2839 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/stefan/src/numpy/numpy/random/mtrand/mtrand.pyx":2840 */ + /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2840 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; goto __pyx_L1;} __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; @@ -10120,21 +10116,6 @@ return; } -static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i) { - PyTypeObject *t = o->ob_type; - PyObject *r; - if (t->tp_as_sequence && t->tp_as_sequence->sq_item) - r = PySequence_GetItem(o, i); - else { - PyObject *j = PyInt_FromLong(i); - if (!j) - return 0; - r = PyObject_GetItem(o, j); - Py_DECREF(j); - } - return r; -} - static void __Pyx_UnpackError(void) { PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size"); } @@ -10196,21 +10177,6 @@ return 0; } -static int __Pyx_SetItemInt(PyObject *o, Py_ssize_t i, PyObject *v) { - PyTypeObject *t = o->ob_type; - int r; - if (t->tp_as_sequence && t->tp_as_sequence->sq_item) - r = PySequence_SetItem(o, i, v); - else { - PyObject *j = PyInt_FromLong(i); - if (!j) - return -1; - r = PyObject_SetItem(o, j, v); - Py_DECREF(j); - } - return r; -} - static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) { while (t->p) { *t->p = PyString_InternFromString(t->s); Modified: trunk/numpy/random/mtrand/mtrand.pyx =================================================================== --- trunk/numpy/random/mtrand/mtrand.pyx 2008-08-07 14:50:52 UTC (rev 5619) +++ trunk/numpy/random/mtrand/mtrand.pyx 2008-08-07 23:41:02 UTC (rev 5620) @@ -685,7 +685,7 @@ Examples -------- >>> np.random.bytes(10) - ' eh\x85\x022SZ\xbf\xa4' #random + ' eh\\x85\\x022SZ\\xbf\\xa4' #random """ cdef void *bytes @@ -942,7 +942,7 @@ >>> import matplotlib.pyplot as plt >>> count, bins, ignored = plt.hist(s, 30, normed=True) - >>> plt.plot(bins, 1/(sigma * np.sqrt(2 * np.pi)) * \ + >>> plt.plot(bins, 1/(sigma * np.sqrt(2 * np.pi)) * ... np.exp( - (bins - mu)**2 / (2 * sigma**2) ), ... linewidth=2, color='r') >>> plt.show() @@ -1781,7 +1781,7 @@ >>> import matplotlib.pyplot as plt >>> count, bins, ignored = plt.hist(s, 30, normed=True) - >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)* \ + >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)* ... np.exp( -np.exp( -(bins - mu) /beta) ), ... linewidth=2, color='r') >>> plt.show() @@ -1798,10 +1798,10 @@ >>> count, bins, ignored = plt.hist(maxima, 30, normed=True) >>> beta = np.std(maxima)*np.pi/np.sqrt(6) >>> mu = np.mean(maxima) - 0.57721*beta - >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)* \ + >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)* ... np.exp( -np.exp( -(bins - mu) /beta) ), ... linewidth=2, color='r') - >>> plt.plot(bins, 1/(beta * np.sqrt(2 * np.pi)) * \ + >>> plt.plot(bins, 1/(beta * np.sqrt(2 * np.pi)) * ... np.exp( - (bins - mu)**2 / (2 * beta**2) ), ... linewidth=2, color='g') >>> plt.show() @@ -1928,8 +1928,8 @@ >>> count, bins, ignored = plt.hist(s, 100, normed=True, align='center') >>> x = np.linspace(min(bins), max(bins), 10000) - >>> pdf = np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2)) \ - ... / (x * sigma * np.sqrt(2 * np.pi)) + >>> pdf = (np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2)) + ... / (x * sigma * np.sqrt(2 * np.pi))) >>> plt.plot(x, pdf, linewidth=2, color='r') >>> plt.axis('tight') @@ -1953,8 +1953,8 @@ >>> mu = np.mean(np.log(b)) >>> x = np.linspace(min(bins), max(bins), 10000) - >>> pdf = np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2)) \ - ... / (x * sigma * np.sqrt(2 * np.pi)) + >>> pdf = (np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2)) + ... / (x * sigma * np.sqrt(2 * np.pi))) >>> plt.plot(x, pdf, color='r', linewidth=2) >>> plt.show() @@ -2645,12 +2645,12 @@ Notes ----- - .. math:: X \approx \prod_{i=1}^{k}{x^{\alpha_i-1}_i} + .. math:: X \\approx \\prod_{i=1}^{k}{x^{\\alpha_i-1}_i} Uses the following property for computation: for each dimension, draw a random sample y_i from a standard gamma generator of shape `alpha_i`, then - :math:`X = \frac{1}{\sum_{i=1}^k{y_i}} (y_1, \ldots, y_n)` is + :math:`X = \\frac{1}{\\sum_{i=1}^k{y_i}} (y_1, \\ldots, y_n)` is Dirichlet distributed. References From numpy-svn at scipy.org Thu Aug 7 20:08:14 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 7 Aug 2008 19:08:14 -0500 (CDT) Subject: [Numpy-svn] r5621 - trunk/numpy/lib Message-ID: <20080808000814.0D53939C502@scipy.org> Author: ptvirtan Date: 2008-08-07 19:08:07 -0500 (Thu, 07 Aug 2008) New Revision: 5621 Modified: trunk/numpy/lib/financial.py Log: Remove piece-by-piece docstring assembly; the full texts were inserted in the docstrings in r5610 Modified: trunk/numpy/lib/financial.py =================================================================== --- trunk/numpy/lib/financial.py 2008-08-07 23:41:02 UTC (rev 5620) +++ trunk/numpy/lib/financial.py 2008-08-08 00:08:07 UTC (rev 5621) @@ -17,33 +17,6 @@ 'start':1, 'finish':0} -eqstr = """ - - nper / (1 + rate*when) \ / nper \ - fv + pv*(1+rate) + pmt*|-------------------|*| (1+rate) - 1 | = 0 - \ rate / \ / - - fv + pv + pmt * nper = 0 (when rate == 0) - -where (all can be scalars or sequences) - - Parameters - ---------- - rate : - Rate of interest (per period) - nper : - Number of compounding periods - pmt : - Payment - pv : - Present value - fv : - Future value - when : - When payments are due ('begin' (1) or 'end' (0)) - -""" - def _convert_when(when): try: return _when_to_num[when] @@ -99,22 +72,7 @@ zer = np.zeros(miter.shape) fact = np.where(rate==zer, nper+zer, (1+rate*when)*(temp-1)/rate+zer) return -(pv*temp + pmt*fact) -fv.__doc__ += eqstr + """ -Example --------- -What is the future value after 10 years of saving $100 now, with - an additional monthly savings of $100. Assume the interest rate is - 5% (annually) compounded monthly? - ->>> np.fv(0.05/12, 10*12, -100, -100) -15692.928894335748 - -By convention, the negative sign represents cash flow out (i.e. money not - available today). Thus, saving $100 a month at 5% annual interest leads - to $15,692.93 available to spend in 10 years. -""" - def pmt(rate, nper, pv, fv=0, when='end'): """ Compute the payment. @@ -161,20 +119,7 @@ zer = np.zeros(miter.shape) fact = np.where(rate==zer, nper+zer, (1+rate*when)*(temp-1)/rate+zer) return -(fv + pv*temp) / fact -pmt.__doc__ += eqstr + """ -Examples --------- -What would the monthly payment need to be to pay off a $200,000 loan in 15 - years at an annual interest rate of 7.5%? - ->>> np.pmt(0.075/12, 12*15, 200000) --1854.0247200054619 - -In order to pay-off (i.e. have a future-value of 0) the $200,000 obtained - today, a monthly payment of $1,854.02 would be required. -""" - def nper(rate, pmt, pv, fv=0, when='end'): """ Compute the number of periods. @@ -234,29 +179,7 @@ miter = np.broadcast(rate, pmt, pv, fv, when) zer = np.zeros(miter.shape) return np.where(rate==zer, A+zer, B+zer) + 0.0 -nper.__doc__ += eqstr + """ -Examples --------- -If you only had $150 to spend as payment, how long would it take to pay-off - a loan of $8,000 at 7% annual interest? - ->>> np.nper(0.07/12, -150, 8000) -64.073348770661852 - -So, over 64 months would be required to pay off the loan. - -The same analysis could be done with several different interest rates and/or - payments and/or total amounts to produce an entire table. - ->>> np.nper(*(np.ogrid[0.06/12:0.071/12:0.01/12, -200:-99:100, 6000:7001:1000])) -array([[[ 32.58497782, 38.57048452], - [ 71.51317802, 86.37179563]], - - [[ 33.07413144, 39.26244268], - [ 74.06368256, 90.22989997]]]) -""" - def ipmt(rate, per, nper, pv, fv=0.0, when='end'): """ Not implemented. @@ -305,7 +228,6 @@ zer = np.zeros(miter.shape) fact = np.where(rate == zer, nper+zer, (1+rate*when)*(temp-1)/rate+zer) return -(fv + pmt*fact)/temp -pv.__doc__ += eqstr # Computed with Sage # (y + (r + 1)^n*x + p*((r + 1)^n - 1)*(r*w + 1)/r)/(n*(r + 1)^(n - 1)*x - p*((r + 1)^n - 1)*(r*w + 1)/r^2 + n*p*(r + 1)^(n - 1)*(r*w + 1)/r + p*((r + 1)^n - 1)*w/r) @@ -372,7 +294,6 @@ return np.nan + rn else: return rn -rate.__doc__ += eqstr def irr(values): """Internal Rate of Return From numpy-svn at scipy.org Fri Aug 8 00:34:07 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 7 Aug 2008 23:34:07 -0500 (CDT) Subject: [Numpy-svn] r5622 - in trunk/numpy: . core core/code_generators core/tests distutils distutils/command lib lib/tests ma ma/tests testing Message-ID: <20080808043407.E8F6F39C018@scipy.org> Author: jarrod.millman Date: 2008-08-07 23:33:45 -0500 (Thu, 07 Aug 2008) New Revision: 5622 Modified: trunk/numpy/__init__.py trunk/numpy/core/code_generators/docstrings.py trunk/numpy/core/numeric.py trunk/numpy/core/records.py trunk/numpy/core/scons_support.py trunk/numpy/core/setup.py trunk/numpy/core/setupscons.py trunk/numpy/core/tests/test_defchararray.py trunk/numpy/core/tests/test_defmatrix.py trunk/numpy/core/tests/test_memmap.py trunk/numpy/core/tests/test_numeric.py trunk/numpy/core/tests/test_numerictypes.py trunk/numpy/core/tests/test_records.py trunk/numpy/core/tests/test_regression.py trunk/numpy/core/tests/test_scalarmath.py trunk/numpy/core/tests/test_umath.py trunk/numpy/core/tests/test_unicode.py trunk/numpy/distutils/command/scons.py trunk/numpy/distutils/misc_util.py trunk/numpy/lib/__init__.py trunk/numpy/lib/arraysetops.py trunk/numpy/lib/function_base.py trunk/numpy/lib/stride_tricks.py trunk/numpy/lib/tests/test__datasource.py trunk/numpy/lib/tests/test_arraysetops.py trunk/numpy/lib/tests/test_financial.py trunk/numpy/lib/tests/test_function_base.py trunk/numpy/lib/tests/test_index_tricks.py trunk/numpy/lib/tests/test_io.py trunk/numpy/lib/tests/test_polynomial.py trunk/numpy/lib/tests/test_regression.py trunk/numpy/lib/tests/test_shape_base.py trunk/numpy/lib/tests/test_twodim_base.py trunk/numpy/lib/tests/test_ufunclike.py trunk/numpy/ma/core.py trunk/numpy/ma/extras.py trunk/numpy/ma/mrecords.py trunk/numpy/ma/tests/test_core.py trunk/numpy/ma/tests/test_extras.py trunk/numpy/ma/tests/test_mrecords.py trunk/numpy/ma/tests/test_old_ma.py trunk/numpy/ma/testutils.py trunk/numpy/setupscons.py trunk/numpy/testing/__init__.py trunk/numpy/testing/decorators.py trunk/numpy/testing/noseclasses.py trunk/numpy/testing/nosetester.py trunk/numpy/testing/numpytest.py trunk/numpy/testing/parametric.py trunk/numpy/testing/utils.py Log: ran reindent Modified: trunk/numpy/__init__.py =================================================================== --- trunk/numpy/__init__.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/__init__.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -160,4 +160,3 @@ __all__.extend(core.__all__) __all__.extend(lib.__all__) __all__.extend(['linalg', 'fft', 'random', 'ctypeslib', 'ma', 'doc']) - Modified: trunk/numpy/core/code_generators/docstrings.py =================================================================== --- trunk/numpy/core/code_generators/docstrings.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/code_generators/docstrings.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -2234,4 +2234,3 @@ equivalent to true division in Python. """) - Modified: trunk/numpy/core/numeric.py =================================================================== --- trunk/numpy/core/numeric.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/numeric.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -1778,7 +1778,7 @@ """with errstate(**state): --> operations in following block use given state. # Set error handling to known state. - >>> _ = np.seterr(invalid='raise', divide='raise', over='raise', + >>> _ = np.seterr(invalid='raise', divide='raise', over='raise', ... under='ignore') >>> a = -np.arange(3) Modified: trunk/numpy/core/records.py =================================================================== --- trunk/numpy/core/records.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/records.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -551,7 +551,7 @@ >>> r.col1 array([456, 2]) >>> r.col2 - chararray(['dbe', 'de'], + chararray(['dbe', 'de'], dtype='|S3') >>> import cPickle >>> print cPickle.loads(cPickle.dumps(r)) @@ -639,7 +639,7 @@ >>> a.tofile(fd) >>> >>> fd.seek(0) - >>> r=np.core.records.fromfile(fd, formats='f8,i4,a5', shape=10, + >>> r=np.core.records.fromfile(fd, formats='f8,i4,a5', shape=10, ... byteorder='<') >>> print r[5] (0.5, 10, 'abcde') Modified: trunk/numpy/core/scons_support.py =================================================================== --- trunk/numpy/core/scons_support.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/scons_support.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -185,8 +185,8 @@ array_api_gen_bld = Builder(action = Action(do_generate_numpy_api, '$ARRAPIGENCOMSTR'), emitter = generate_api_emitter) - + ufunc_api_gen_bld = Builder(action = Action(do_generate_ufunc_api, '$UFUNCAPIGENCOMSTR'), emitter = generate_api_emitter) Modified: trunk/numpy/core/setup.py =================================================================== --- trunk/numpy/core/setup.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/setup.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -190,7 +190,7 @@ "See previous error messages for more information." moredefs = [] - + # Check wether we can use inttypes (C99) formats if config_cmd.check_decl('PRIdPTR', headers = ['inttypes.h']): moredefs.append(('NPY_USE_C99_FORMATS', 1)) Modified: trunk/numpy/core/setupscons.py =================================================================== --- trunk/numpy/core/setupscons.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/setupscons.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -51,7 +51,7 @@ # XXX: I really have to think about how to communicate path info # between scons and distutils, and set the options at one single # location. - target = join(get_scons_pkg_build_dir(config.name), + target = join(get_scons_pkg_build_dir(config.name), 'include/numpy/numpyconfig.h') incl_dir = os.path.dirname(target) if incl_dir not in config.numpy_include_dirs: Modified: trunk/numpy/core/tests/test_defchararray.py =================================================================== --- trunk/numpy/core/tests/test_defchararray.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/tests/test_defchararray.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -47,7 +47,7 @@ # [A[1,0]*r, A[1,1]*r]]).view(np.chararray) # # assert all(Ar == (self.A * r)) - + for ob in [object(), 'qrs']: try: A * ob @@ -63,7 +63,7 @@ # [A[1,0]*r, A[1,1]*r]]).view(np.chararray) # # assert all(Ar == (r * self.A)) - + for ob in [object(), 'qrs']: try: ob * A @@ -78,7 +78,7 @@ def test_rmod(self): assert ("%s" % self.A) == str(self.A) assert ("%r" % self.A) == repr(self.A) - + for ob in [42, object()]: try: ob % self.A Modified: trunk/numpy/core/tests/test_defmatrix.py =================================================================== --- trunk/numpy/core/tests/test_defmatrix.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/tests/test_defmatrix.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -200,7 +200,7 @@ mA2 = matrix(A) mA2 *= 3 assert allclose(mA2.A, 3*A) - + def test_notimplemented(self): '''Check that 'not implemented' operations produce a failure.''' A = matrix([[1., 2.], Modified: trunk/numpy/core/tests/test_memmap.py =================================================================== --- trunk/numpy/core/tests/test_memmap.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/tests/test_memmap.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -48,4 +48,3 @@ if __name__ == "__main__": run_module_suite() - Modified: trunk/numpy/core/tests/test_numeric.py =================================================================== --- trunk/numpy/core/tests/test_numeric.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/tests/test_numeric.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -887,4 +887,3 @@ if __name__ == "__main__": run_module_suite() - Modified: trunk/numpy/core/tests/test_numerictypes.py =================================================================== --- trunk/numpy/core/tests/test_numerictypes.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/tests/test_numerictypes.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -252,8 +252,8 @@ self._buffer[1][4]], dtype='f8')) assert_equal(h['z'], np.array([self._buffer[0][5], self._buffer[1][5]], dtype='u1')) - + def test_nested1_acessors(self): """Check reading the nested fields of a nested array (1st level)""" h = np.array(self._buffer, dtype=self._descr) @@ -356,4 +356,3 @@ if __name__ == "__main__": run_module_suite() - Modified: trunk/numpy/core/tests/test_records.py =================================================================== --- trunk/numpy/core/tests/test_records.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/tests/test_records.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -57,7 +57,7 @@ y = eval("np." + repr(x)) assert isinstance(y, np.recarray) assert_equal(y, x) - + def test_recarray_from_names(self): ra = np.rec.array([ (1, 'abc', 3.7000002861022949, 0), @@ -130,4 +130,3 @@ if __name__ == "__main__": run_module_suite() - Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/tests/test_regression.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -1070,9 +1070,9 @@ dat = TestArray([[1,2,3,4],[5,6,7,8]],'jubba') assert dat.info == 'jubba' dat.resize((4,2)) - assert dat.info == 'jubba' + assert dat.info == 'jubba' dat.sort() - assert dat.info == 'jubba' + assert dat.info == 'jubba' dat.fill(2) assert dat.info == 'jubba' dat.put([2,3,4],[6,3,4]) Modified: trunk/numpy/core/tests/test_scalarmath.py =================================================================== --- trunk/numpy/core/tests/test_scalarmath.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/tests/test_scalarmath.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -86,7 +86,7 @@ last_exponent_bit_idx = finfo.nexp storage_bytes = np.dtype(t).itemsize*8 # could add some more types to the list below - for which in ['small denorm','small norm']: + for which in ['small denorm','small norm']: # Values from http://en.wikipedia.org/wiki/IEEE_754 constr = np.array([0x00]*storage_bytes,dtype=np.uint8) if which == 'small denorm': Modified: trunk/numpy/core/tests/test_umath.py =================================================================== --- trunk/numpy/core/tests/test_umath.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/tests/test_umath.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -211,11 +211,11 @@ yield _check_branch_cut, np.log10, -0.5, 1j, 1, -1, True yield _check_branch_cut, np.log1p, -1.5, 1j, 1, -1, True yield _check_branch_cut, np.sqrt, -0.5, 1j, 1, -1 - + yield _check_branch_cut, np.arcsin, [ -2, 2], [1j, -1j], 1, -1 yield _check_branch_cut, np.arccos, [ -2, 2], [1j, -1j], 1, -1 yield _check_branch_cut, np.arctan, [-2j, 2j], [1, -1 ], -1, 1 - + yield _check_branch_cut, np.arcsinh, [-2j, 2j], [-1, 1], -1, 1 yield _check_branch_cut, np.arccosh, [ -1, 0.5], [1j, 1j], 1, -1 yield _check_branch_cut, np.arctanh, [ -2, 2], [1j, -1j], 1, -1 @@ -239,7 +239,7 @@ yield _check_branch_cut, np.arccosh, [ -1, 0.5], [1j, 1j], 1, -1, True yield _check_branch_cut, np.arctanh, [ -2, 2], [1j, -1j], 1, -1, True test_branch_cuts_failing = dec.skipknownfailure(test_branch_cuts_failing) - + def test_against_cmath(self): import cmath, sys @@ -248,7 +248,7 @@ broken_cmath_asinh = False if sys.version_info < (2,5,3): broken_cmath_asinh = True - + points = [-2, 2j, 2, -2j, -1-1j, -1+1j, +1-1j, +1+1j] name_map = {'arcsin': 'asin', 'arccos': 'acos', 'arctan': 'atan', 'arcsinh': 'asinh', 'arccosh': 'acosh', 'arctanh': 'atanh'} @@ -261,20 +261,20 @@ for p in points: a = complex(func(np.complex_(p))) b = cfunc(p) - + if cname == 'asinh' and broken_cmath_asinh: - continue + continue assert abs(a - b) < atol, "%s %s: %s; cmath: %s"%(fname,p,a,b) class TestC99(object): """Check special functions at special points against the C99 standard""" # NB: inherits from object instead of TestCase since using test generators - + # # Non-conforming results are with XXX added to the exception field. # - + def test_clog(self): for p, v, e in [ ((-0., 0.), (-inf, pi), 'divide'), @@ -292,7 +292,7 @@ ((+nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on some platfs ]: yield self._check, np.log, p, v, e - + def test_csqrt(self): for p, v, e in [ ((-0., 0.), (0.,0.), 'XXX'), # now (-0., 0.) @@ -391,7 +391,7 @@ got = "(%s, %s)" % (repr(got.real), repr(got.imag)) expected = "(%s, %s)" % (repr(value.real), repr(value.imag)) assert got == expected, (got, expected) - + # check exceptions if exc in ('divide', 'invalid', 'over', 'under'): v[exc] = 'raise' @@ -442,24 +442,24 @@ """ x0 = np.atleast_1d(x0).astype(dtype) dx = np.atleast_1d(dx).astype(dtype) - + scale = np.finfo(dtype).eps * 1e3 atol = 1e-4 - + y0 = f(x0) yp = f(x0 + dx*scale*np.absolute(x0)/np.absolute(dx)) ym = f(x0 - dx*scale*np.absolute(x0)/np.absolute(dx)) - + assert np.all(np.absolute(y0.real - yp.real) < atol), (y0, yp) assert np.all(np.absolute(y0.imag - yp.imag) < atol), (y0, yp) assert np.all(np.absolute(y0.real - ym.real*re_sign) < atol), (y0, ym) assert np.all(np.absolute(y0.imag - ym.imag*im_sign) < atol), (y0, ym) - + if sig_zero_ok: # check that signed zeros also work as a displacement jr = (x0.real == 0) & (dx.real != 0) ji = (x0.imag == 0) & (dx.imag != 0) - + x = -x0 x.real[jr] = 0.*dx.real x.imag[ji] = 0.*dx.imag Modified: trunk/numpy/core/tests/test_unicode.py =================================================================== --- trunk/numpy/core/tests/test_unicode.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/core/tests/test_unicode.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -214,33 +214,33 @@ """Check the assignment of valued arrays (size 1, UCS4 values)""" ulen = 1 ucs_value = ucs4_value - + class test_assign_values_2_ucs2(assign_values, TestCase): """Check the assignment of valued arrays (size 2, UCS2 values)""" ulen = 2 ucs_value = ucs2_value - + class test_assign_values_2_ucs4(assign_values, TestCase): """Check the assignment of valued arrays (size 2, UCS4 values)""" ulen = 2 ucs_value = ucs4_value - + class test_assign_values_1009_ucs2(assign_values, TestCase): """Check the assignment of valued arrays (size 1009, UCS2 values)""" ulen = 1009 ucs_value = ucs2_value - + class test_assign_values_1009_ucs4(assign_values, TestCase): """Check the assignment of valued arrays (size 1009, UCS4 values)""" ulen = 1009 ucs_value = ucs4_value - + ############################################################ # Byteorder tests ############################################################ @@ -286,32 +286,32 @@ """Check the byteorder in unicode (size 1, UCS2 values)""" ulen = 1 ucs_value = ucs2_value - + class test_byteorder_1_ucs4(byteorder_values, TestCase): """Check the byteorder in unicode (size 1, UCS4 values)""" ulen = 1 ucs_value = ucs4_value - + class test_byteorder_2_ucs2(byteorder_values, TestCase): """Check the byteorder in unicode (size 2, UCS2 values)""" ulen = 2 ucs_value = ucs2_value - + class test_byteorder_2_ucs4(byteorder_values, TestCase): """Check the byteorder in unicode (size 2, UCS4 values)""" ulen = 2 ucs_value = ucs4_value - + class test_byteorder_1009_ucs2(byteorder_values, TestCase): """Check the byteorder in unicode (size 1009, UCS2 values)""" ulen = 1009 ucs_value = ucs2_value - + class test_byteorder_1009_ucs4(byteorder_values, TestCase): """Check the byteorder in unicode (size 1009, UCS4 values)""" ulen = 1009 @@ -320,4 +320,3 @@ if __name__ == "__main__": run_module_suite() - Modified: trunk/numpy/distutils/command/scons.py =================================================================== --- trunk/numpy/distutils/command/scons.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/distutils/command/scons.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -125,7 +125,7 @@ (C++ compiler). The argument should be a Compiler instance.""" if compiler.compiler_type == 'msvc': return compiler.compiler_type - + return compiler.compiler_cxx[0] def get_compiler_executable(compiler): @@ -368,7 +368,7 @@ raise RuntimeError("You need numscons >= %s to build numpy "\ "with numscons (detected %s )" \ % (minver, get_version())) - + else: # nothing to do, just leave it here. return Modified: trunk/numpy/distutils/misc_util.py =================================================================== --- trunk/numpy/distutils/misc_util.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/distutils/misc_util.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -1190,7 +1190,7 @@ pre_hook and post hook should be sequences of callable, which will be use before and after executing scons. The callable should be defined as callable(*args, **kw). It is ugly, but well, hooks are ugly anyway... - + sconscript can be None, which can be useful to add only post/pre hooks.""" if standalone: Modified: trunk/numpy/lib/__init__.py =================================================================== --- trunk/numpy/lib/__init__.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/__init__.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -39,4 +39,3 @@ from numpy.testing import Tester test = Tester().test bench = Tester().bench - Modified: trunk/numpy/lib/arraysetops.py =================================================================== --- trunk/numpy/lib/arraysetops.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/arraysetops.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -330,4 +330,3 @@ return aux else: return np.asarray(ar1)[aux == 0] - Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/function_base.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -200,14 +200,14 @@ a : array_like Input data. bins : int or sequence of scalars, optional - If `bins` is an int, it defines the number of equal-width + If `bins` is an int, it defines the number of equal-width bins in the given range (10, by default). If `bins` is a sequence, - it defines the bin edges, including the rightmost edge, allowing + it defines the bin edges, including the rightmost edge, allowing for non-uniform bin widths. range : (float, float), optional The lower and upper range of the bins. If not provided, range is simply ``(a.min(), a.max())``. Values outside the range are - ignored. Note that with `new` set to False, values below + ignored. Note that with `new` set to False, values below the range are ignored, while those above the range are tallied in the rightmost bin. normed : bool, optional @@ -224,10 +224,10 @@ so that the integral of the density over the range remains 1. The `weights` keyword is only available with `new` set to True. new : {None, True, False}, optional - Whether to use the new semantics for histogram: + Whether to use the new semantics for histogram: * None : the new behaviour is used, and a warning is printed, * True : the new behaviour is used and no warning is printed, - * False : the old behaviour is used and a message is printed + * False : the old behaviour is used and a message is printed warning about future deprecation. Returns @@ -264,18 +264,18 @@ # Old behavior if new == False: warnings.warn(""" - The original semantics of histogram is scheduled to be - deprecated in NumPy 1.3. The new semantics fixes + The original semantics of histogram is scheduled to be + deprecated in NumPy 1.3. The new semantics fixes long-standing issues with outliers handling. The main - changes concern - 1. the definition of the bin edges, - now including the rightmost edge, and - 2. the handling of upper outliers, - now ignored rather than tallied in the rightmost bin. - + changes concern + 1. the definition of the bin edges, + now including the rightmost edge, and + 2. the handling of upper outliers, + now ignored rather than tallied in the rightmost bin. + Please read the docstring for more information. """, Warning) - + a = asarray(a).ravel() if (range is not None): @@ -326,19 +326,19 @@ warnings.warn(""" The semantics of histogram has been modified in the current release to fix long-standing issues with - outliers handling. The main changes concern - 1. the definition of the bin edges, - now including the rightmost edge, and + outliers handling. The main changes concern + 1. the definition of the bin edges, + now including the rightmost edge, and 2. the handling of upper outliers, now ignored rather - than tallied in the rightmost bin. - The previous behaviour is still accessible using - `new=False`, but is scheduled to be deprecated in the - next release (1.3). - + than tallied in the rightmost bin. + The previous behaviour is still accessible using + `new=False`, but is scheduled to be deprecated in the + next release (1.3). + *This warning will not printed in the 1.3 release.* - - Use `new=True` to bypass this warning. - + + Use `new=True` to bypass this warning. + Please read the docstring for more information. """, Warning) a = asarray(a) Modified: trunk/numpy/lib/stride_tricks.py =================================================================== --- trunk/numpy/lib/stride_tricks.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/stride_tricks.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -105,7 +105,6 @@ common_shape.append(1) # Construct the new arrays. - broadcasted = [as_strided(x, shape=sh, strides=st) for (x,sh,st) in + broadcasted = [as_strided(x, shape=sh, strides=st) for (x,sh,st) in zip(args, shapes, strides)] return broadcasted - Modified: trunk/numpy/lib/tests/test__datasource.py =================================================================== --- trunk/numpy/lib/tests/test__datasource.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/tests/test__datasource.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -318,4 +318,3 @@ if __name__ == "__main__": run_module_suite() - Modified: trunk/numpy/lib/tests/test_arraysetops.py =================================================================== --- trunk/numpy/lib/tests/test_arraysetops.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/tests/test_arraysetops.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -16,7 +16,7 @@ d, c = unique1d( a, True ) ed = np.array( [2, 3, 0, 1] ) - + assert_array_equal( d,ed ) assert_array_equal( c, ec ) Modified: trunk/numpy/lib/tests/test_financial.py =================================================================== --- trunk/numpy/lib/tests/test_financial.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/tests/test_financial.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -3,7 +3,7 @@ class TestFinancial(TestCase): def test_rate(self): - assert_almost_equal(np.rate(10,0,-3500,10000), + assert_almost_equal(np.rate(10,0,-3500,10000), 0.1107, 4) def test_irr(self): @@ -12,7 +12,7 @@ 0.0524, 2) def test_pv(self): - assert_almost_equal(np.pv(0.07,20,12000,0), + assert_almost_equal(np.pv(0.07,20,12000,0), -127128.17, 2) def test_fv(self): Modified: trunk/numpy/lib/tests/test_function_base.py =================================================================== --- trunk/numpy/lib/tests/test_function_base.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/tests/test_function_base.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -297,7 +297,7 @@ def test_badargs(self): # for 2D array, gradient can take 0,1, or 2 extra args x = array([[1,1],[3,4]]) - assert_raises(SyntaxError, gradient, x, array([1.,1.]), + assert_raises(SyntaxError, gradient, x, array([1.,1.]), array([1.,1.]), array([1.,1.])) class TestAngle(TestCase): @@ -441,7 +441,7 @@ class TestHistogram(TestCase): def setUp(self): warnings.simplefilter('ignore', Warning) - + def tearDown(self): warnings.resetwarnings() @@ -658,60 +658,60 @@ def test_nansum(self): assert_almost_equal(nansum(self.A), 8.0664079100000006) - assert_almost_equal(nansum(self.A,0), + assert_almost_equal(nansum(self.A,0), array([[ 1.32229056, 0.92403798, 0.39531816], [ 0.96090861, 1.26908897, 0.99071783], [ 0.98877405, 0.53370154, 0.68157021]])) - assert_almost_equal(nansum(self.A,1), + assert_almost_equal(nansum(self.A,1), array([[ 0.40037675, 0.17621204, 0.76778851], [ 1.30085304, 0.87964135, 0.72217448], [ 1.57074343, 1.6709751 , 0.57764321]])) - assert_almost_equal(nansum(self.A,2), + assert_almost_equal(nansum(self.A,2), array([[ 0.02940178, 0.86861904, 0.44635648], [ 0.97452409, 0.87964135, 1.04850343], [ 1.63772083, 1.47245502, 0.70918589]])) - + def test_nanmin(self): assert_almost_equal(nanmin(self.A), 0.01319214) - assert_almost_equal(nanmin(self.A,0), + assert_almost_equal(nanmin(self.A,0), array([[ 0.59541557, 0.01319214, 0.01620964], [ 0.11704017, 0.38944762, 0.23913896], [ 0.28333658, 0.1630199 , 0.33850425]])) - assert_almost_equal(nanmin(self.A,1), + assert_almost_equal(nanmin(self.A,1), array([[ 0.11704017, 0.01319214, 0.01620964], [ 0.59541557, 0.87964135, 0.34306596], [ 0.72687499, 0.37068164, 0.23913896]])) - assert_almost_equal(nanmin(self.A,2), + assert_almost_equal(nanmin(self.A,2), array([[ 0.01319214, 0.11704017, 0.1630199 ], [ 0.37910852, 0.87964135, 0.34306596], [ 0.72687499, 0.23913896, 0.33850425]])) def test_nanargmin(self): assert_almost_equal(nanargmin(self.A), 1) - assert_almost_equal(nanargmin(self.A,0), + assert_almost_equal(nanargmin(self.A,0), array([[1, 0, 0], [0, 2, 2], [0, 0, 2]])) - assert_almost_equal(nanargmin(self.A,1), + assert_almost_equal(nanargmin(self.A,1), array([[1, 0, 0], [0, 1, 2], [0, 2, 1]])) - assert_almost_equal(nanargmin(self.A,2), + assert_almost_equal(nanargmin(self.A,2), array([[1, 0, 1], [2, 1, 2], [0, 2, 2]])) def test_nanmax(self): assert_almost_equal(nanmax(self.A), 0.91084584000000002) - assert_almost_equal(nanmax(self.A,0), + assert_almost_equal(nanmax(self.A,0), array([[ 0.72687499, 0.91084584, 0.37910852], [ 0.84386844, 0.87964135, 0.75157887], [ 0.70543747, 0.37068164, 0.34306596]])) - assert_almost_equal(nanmax(self.A,1), + assert_almost_equal(nanmax(self.A,1), array([[ 0.28333658, 0.1630199 , 0.75157887], [ 0.70543747, 0.87964135, 0.37910852], [ 0.84386844, 0.91084584, 0.33850425]])) - assert_almost_equal(nanmax(self.A,2), + assert_almost_equal(nanmax(self.A,2), array([[ 0.01620964, 0.75157887, 0.28333658], [ 0.59541557, 0.87964135, 0.70543747], [ 0.91084584, 0.84386844, 0.37068164]])) @@ -725,22 +725,22 @@ B = array([[ 0.10377691, 0.5417086 , 0.49807457], [ 0.82872117, 0.77801674, 0.39226705], [ 0.9314666 , 0.66800209, 0.03538394]]) - assert_almost_equal(corrcoef(A), + assert_almost_equal(corrcoef(A), array([[ 1. , 0.9379533 , -0.04931983], [ 0.9379533 , 1. , 0.30007991], [-0.04931983, 0.30007991, 1. ]])) - assert_almost_equal(corrcoef(A,B), - array([[ 1. , 0.9379533 , -0.04931983, + assert_almost_equal(corrcoef(A,B), + array([[ 1. , 0.9379533 , -0.04931983, 0.30151751, 0.66318558, 0.51532523], - [ 0.9379533 , 1. , 0.30007991, + [ 0.9379533 , 1. , 0.30007991, -0.04781421, 0.88157256, 0.78052386], [-0.04931983, 0.30007991, 1. , -0.96717111, 0.71483595, 0.83053601], - [ 0.30151751, -0.04781421, -0.96717111, + [ 0.30151751, -0.04781421, -0.96717111, 1. , -0.51366032, -0.66173113], - [ 0.66318558, 0.88157256, 0.71483595, + [ 0.66318558, 0.88157256, 0.71483595, -0.51366032, 1. , 0.98317823], - [ 0.51532523, 0.78052386, 0.83053601, + [ 0.51532523, 0.78052386, 0.83053601, -0.66173113, 0.98317823, 1. ]])) @@ -749,7 +749,7 @@ def test_simple(self): assert_almost_equal(i0(0.5), array(1.0634833707413234)) A = array([ 0.49842636, 0.6969809 , 0.22011976, 0.0155549]) - assert_almost_equal(i0(A), + assert_almost_equal(i0(A), array([ 1.06307822, 1.12518299, 1.01214991, 1.00006049])) B = array([[ 0.827002 , 0.99959078], [ 0.89694769, 0.39298162], @@ -768,11 +768,11 @@ assert_almost_equal(kaiser(0,1.0), array([])) assert isnan(kaiser(1,1.0)) assert_almost_equal(kaiser(2,1.0), array([ 0.78984831, 0.78984831])) - assert_almost_equal(kaiser(5,1.0), - array([ 0.78984831, 0.94503323, 1. , + assert_almost_equal(kaiser(5,1.0), + array([ 0.78984831, 0.94503323, 1. , 0.94503323, 0.78984831])) - assert_almost_equal(kaiser(5,1.56789), - array([ 0.58285404, 0.88409679, 1. , + assert_almost_equal(kaiser(5,1.56789), + array([ 0.58285404, 0.88409679, 1. , 0.88409679, 0.58285404])) class TestMsort(TestCase): Modified: trunk/numpy/lib/tests/test_index_tricks.py =================================================================== --- trunk/numpy/lib/tests/test_index_tricks.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/tests/test_index_tricks.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -64,4 +64,3 @@ if __name__ == "__main__": run_module_suite() - Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/tests/test_io.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -57,8 +57,8 @@ l = np.load(c) assert_equal(a, l['file_a']) assert_equal(b, l['file_b']) - + class TestSaveTxt(TestCase): def test_array(self): a =np.array( [[1,2],[3,4]], float) @@ -220,8 +220,8 @@ c.seek(0) x = np.loadtxt(c, dtype=float, usecols=(1,2)) assert_array_equal(x, a[:,1:]) - - # Checking with dtypes defined converters. + + # Checking with dtypes defined converters. data = '''JOE 70.1 25.3 BOB 60.5 27.9 ''' Modified: trunk/numpy/lib/tests/test_polynomial.py =================================================================== --- trunk/numpy/lib/tests/test_polynomial.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/tests/test_polynomial.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -77,7 +77,7 @@ import numpy as np class TestDocs(TestCase): - def test_doctests(self): + def test_doctests(self): return rundocs() def test_roots(self): @@ -113,4 +113,3 @@ if __name__ == "__main__": run_module_suite() - Modified: trunk/numpy/lib/tests/test_regression.py =================================================================== --- trunk/numpy/lib/tests/test_regression.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/tests/test_regression.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -28,4 +28,3 @@ if __name__ == "__main__": run_module_suite() - Modified: trunk/numpy/lib/tests/test_shape_base.py =================================================================== --- trunk/numpy/lib/tests/test_shape_base.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/tests/test_shape_base.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -13,7 +13,7 @@ def test_3d(self): a = arange(27).reshape((3,3,3)) - assert_array_equal(apply_along_axis(sum,0,a), + assert_array_equal(apply_along_axis(sum,0,a), [[27,30,33],[36,39,42],[45,48,51]]) Modified: trunk/numpy/lib/tests/test_twodim_base.py =================================================================== --- trunk/numpy/lib/tests/test_twodim_base.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/tests/test_twodim_base.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -195,4 +195,3 @@ if __name__ == "__main__": run_module_suite() - Modified: trunk/numpy/lib/tests/test_ufunclike.py =================================================================== --- trunk/numpy/lib/tests/test_ufunclike.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/lib/tests/test_ufunclike.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -65,4 +65,3 @@ if __name__ == "__main__": run_module_suite() - Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/ma/core.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -44,7 +44,7 @@ 'masked_less','masked_less_equal', 'masked_not_equal', 'masked_object','masked_outside', 'masked_print_option', 'masked_singleton','masked_values', 'masked_where', 'max', 'maximum', - 'maximum_fill_value', 'mean', 'min', 'minimum', 'minimum_fill_value', + 'maximum_fill_value', 'mean', 'min', 'minimum', 'minimum_fill_value', 'multiply', 'negative', 'nomask', 'nonzero', 'not_equal', 'ones', 'outer', 'outerproduct', @@ -740,7 +740,7 @@ def make_mask_descr(ndtype): """Constructs a dtype description list from a given dtype. Each field is set to a bool. - + """ if ndtype.names: mdescr = [list(_) for _ in ndtype.descr] @@ -2155,13 +2155,13 @@ #............................................ def all(self, axis=None, out=None): """a.all(axis=None, out=None) - + Check if all of the elements of `a` are true. Performs a logical_and over the given axis and returns the result. Masked values are considered as True during computation. For convenience, the output array is masked where ALL the values along the - current axis are masked: if the output would have been a scalar and that + current axis are masked: if the output would have been a scalar and that all the values are masked, then the output is `masked`. Parameters @@ -2176,7 +2176,7 @@ See Also -------- all : equivalent function - + Example ------- >>> np.ma.array([1,2,3]).all() @@ -2327,8 +2327,8 @@ The cumulative sum is calculated over the flattened array by default, otherwise over the specified axis. - Masked values are set to 0 internally during the computation. - However, their position is saved, and the result will be masked at + Masked values are set to 0 internally during the computation. + However, their position is saved, and the result will be masked at the same locations. Parameters @@ -2456,8 +2456,8 @@ The cumulative product is taken over the flattened array by default, otherwise over the specified axis. - Masked values are set to 1 internally during the computation. - However, their position is saved, and the result will be masked at + Masked values are set to 1 internally during the computation. + However, their position is saved, and the result will be masked at the same locations. Parameters @@ -2695,7 +2695,7 @@ elements, N-ddof. The option ddof defaults to zero, that is, a biased estimate. Note that for complex numbers std takes the absolute value before squaring, so that the result is always real and nonnegative. - + """ dvar = self.var(axis=axis,dtype=dtype,out=out, ddof=ddof) if dvar is not masked: @@ -2781,11 +2781,11 @@ If None, the index is into the flattened array, otherwise along the specified axis fill_value : {var}, optional - Value used to fill in the masked values. If None, the output of + Value used to fill in the masked values. If None, the output of minimum_fill_value(self._data) is used instead. out : {None, array}, optional Array into which the result can be placed. Its type is preserved - and it must be of the right shape to hold the output. + and it must be of the right shape to hold the output. """ if fill_value is None: @@ -2846,11 +2846,11 @@ Sorting algorithm (default 'quicksort') Possible values: 'quicksort', 'mergesort', or 'heapsort'. order : {None, var} - If a has fields defined, then the order keyword can be the field name - to sort on or a list (or tuple) of field names to indicate the order + If a has fields defined, then the order keyword can be the field name + to sort on or a list (or tuple) of field names to indicate the order that fields should be used to define the sort. endwith : {True, False}, optional - Whether missing values (if any) should be forced in the upper indices + Whether missing values (if any) should be forced in the upper indices (at the end of the array) (True) or lower indices (at the beginning). fill_value : {var} Value used to fill in the masked values. If None, use @@ -3115,7 +3115,7 @@ Warnings -------- - As for :meth:`ndarray.tostring`, information about the shape, dtype..., + As for :meth:`ndarray.tostring`, information about the shape, dtype..., but also fill_value will be lost. """ @@ -3128,12 +3128,12 @@ """Transforms a masked array into a flexible-type array with two fields: * the ``_data`` field stores the ``_data`` part of the array; * the ``_mask`` field stores the ``_mask`` part of the array; - + Warnings -------- - A side-effect of transforming a masked array into a flexible ndarray is + A side-effect of transforming a masked array into a flexible ndarray is that metainformation (``fill_value``, ...) will be lost. - + """ # Get the basic dtype .... ddtype = self.dtype @@ -3322,7 +3322,7 @@ try: return obj.min(axis=axis, fill_value=fill_value, out=out) except (AttributeError, TypeError): - # If obj doesn't have a max method, + # If obj doesn't have a max method, # ...or if the method doesn't accept a fill_value argument return asanyarray(obj).min(axis=axis, fill_value=fill_value, out=out) min.__doc__ = MaskedArray.min.__doc__ @@ -3331,7 +3331,7 @@ try: return obj.max(axis=axis, fill_value=fill_value, out=out) except (AttributeError, TypeError): - # If obj doesn't have a max method, + # If obj doesn't have a max method, # ...or if the method doesn't accept a fill_value argument return asanyarray(obj).max(axis=axis, fill_value=fill_value, out=out) max.__doc__ = MaskedArray.max.__doc__ @@ -3341,7 +3341,7 @@ try: return obj.ptp(axis, out=out, fill_value=fill_value) except (AttributeError, TypeError): - # If obj doesn't have a max method, + # If obj doesn't have a max method, # ...or if the method doesn't accept a fill_value argument return asanyarray(obj).ptp(axis=axis, fill_value=fill_value, out=out) ptp.__doc__ = MaskedArray.ptp.__doc__ @@ -3770,7 +3770,7 @@ See Also -------- choose : equivalent function - + """ def fmask (x): "Returns the filled array, or True if masked." @@ -3789,7 +3789,7 @@ data = [fmask(x) for x in choices] # Construct the mask outputmask = np.choose(c, masks, mode=mode) - outputmask = make_mask(mask_or(outputmask, getmask(indices)), + outputmask = make_mask(mask_or(outputmask, getmask(indices)), copy=0, shrink=True) # Get the choices...... d = np.choose(c, data, mode=mode, out=out).view(MaskedArray) @@ -3995,5 +3995,3 @@ zeros = _convert2ma('zeros') ############################################################################### - - Modified: trunk/numpy/ma/extras.py =================================================================== --- trunk/numpy/ma/extras.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/ma/extras.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -401,7 +401,7 @@ Notes ----- - Given a vector V with N non masked values, the median of V is the middle + Given a vector V with N non masked values, the median of V is the middle value of a sorted copy of V (Vs) - i.e. Vs[(N-1)/2], when N is odd, or {Vs[N/2 - 1] + Vs[N/2]}/2. when N is even. @@ -550,9 +550,9 @@ def dot(a,b, strict=False): """Return the dot product of two 2D masked arrays a and b. - Like the generic numpy equivalent, the product sum is over the last - dimension of a and the second-to-last dimension of b. If strict is True, - masked values are propagated: if a masked value appears in a row or column, + Like the generic numpy equivalent, the product sum is over the last + dimension of a and the second-to-last dimension of b. If strict is True, + masked values are propagated: if a masked value appears in a row or column, the whole row or column is considered masked. Parameters @@ -649,7 +649,7 @@ """ Private function for the computation of covariance and correlation coefficients. - + """ x = ma.array(x, ndmin=2, copy=True, dtype=float) xmask = ma.getmaskarray(x) @@ -694,9 +694,9 @@ Normalization is by (N-1) where N is the number of observations (unbiased estimate). If bias is True then normalization is by N. - By default, masked values are recognized as such. If x and y have the same + By default, masked values are recognized as such. If x and y have the same shape, a common mask is allocated: if x[i,j] is masked, then y[i,j] will also - be masked. + be masked. Setting `allow_masked` to False will raise an exception if values are missing in either of the input arrays. Modified: trunk/numpy/ma/mrecords.py =================================================================== --- trunk/numpy/ma/mrecords.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/ma/mrecords.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -231,7 +231,7 @@ if attr in ['_mask','mask','_fieldmask','fieldmask']: self.__setmask__(val) return - # Create a shortcut (so that we don't have to call getattr all the time) + # Create a shortcut (so that we don't have to call getattr all the time) _localdict = self.__dict__ # Check whether we're creating a new field newattr = attr not in _localdict @@ -262,7 +262,7 @@ res = fielddict[attr][:2] except (TypeError,KeyError): raise AttributeError, "record array has no attribute %s" % attr - # + # if val is masked: _fill_value = _localdict['_fill_value'] if _fill_value is not None: @@ -680,4 +680,3 @@ *newmask.dtype.fields[newfieldname]) newdata._fieldmask = newmask return newdata - Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/ma/tests/test_core.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -199,7 +199,7 @@ #self.failUnlessRaises(Exception, lambda x,y: x+y, xx, masked) def test_set_element_as_object(self): - """Tests setting elements with object""" + """Tests setting elements with object""" a = empty(1,dtype=object) x = (1,2,3,4,5) a[0] = x @@ -649,7 +649,7 @@ npfunc = getattr(np, funcname) mafunc = getattr(numpy.ma.core, funcname) # Use the np version - nout = np.empty((4,), dtype=int) + nout = np.empty((4,), dtype=int) result = npfunc(xm,axis=0,out=nout) assert(result is nout) # Use the ma version @@ -745,7 +745,7 @@ for funcname in funclist: npfunc = getattr(np, funcname) xmmeth = getattr(xm, funcname) - + # A ndarray as explicit input output = np.empty(4, dtype=float) output.fill(-9999) @@ -986,7 +986,7 @@ assert_equal(_check_fill_value(None, ndtype), control) control = np.array((0,), dtype=[('f0',float)]) assert_equal(_check_fill_value(0, ndtype), control) - # + # ndtype = np.dtype("int, (2,3)float, float") control = np.array((default_fill_value(0), default_fill_value(0.), @@ -1063,7 +1063,7 @@ class TestMaskedArrayInPlaceArithmetics(TestCase): "Test MaskedArray Arithmetics" - + def setUp(self): x = arange(10) y = arange(10) @@ -1643,7 +1643,7 @@ # mXswapped = mX.swapaxes(0,1) assert_equal(mXswapped[-1],mX[:,-1]) - + mXXswapped = mXX.swapaxes(0,2) assert_equal(mXXswapped.shape,(2,2,3,3)) @@ -1778,7 +1778,7 @@ for funcname in ('cumsum','cumprod'): npfunc = getattr(np, funcname) xmmeth = getattr(xm, funcname) - + # A ndarray as explicit input output = np.empty((3,4), dtype=float) output.fill(-9999) @@ -1941,7 +1941,7 @@ xf = np.where(m1, 1.e+20, x) xm.set_fill_value(1.e+20) self.info = (xm, ym) - + # def test_masked_where_bool(self): x = [1,2] @@ -1988,7 +1988,7 @@ b = empty_like(a) a.round(out=b) assert_equal(b, [1., 2., 3., 5., 6.]) - + x = array([1.,2.,3.,4.,5.]) c = array([1,1,1,0,0]) x[2] = masked @@ -2004,10 +2004,10 @@ def test_round_with_output(self): "Testing round with an explicit output" - + xm = array(np.random.uniform(0,10,12)).reshape(3,4) xm[:,0] = xm[0] = xm[-1,-1] = masked - + # A ndarray as explicit input output = np.empty((3,4), dtype=float) output.fill(-9999) @@ -2062,7 +2062,7 @@ zm = masked_array(z, mask=[0,1,0,0]) xf = np.where(m1, 1.e+20, x) xm.set_fill_value(1.e+20) - + d = where(xm>2,xm,-9) assert_equal(d, [-9.,-9.,-9.,-9., -9., 4., -9., -9., 10., -9., -9., 3.]) assert_equal(d._mask, xm._mask) @@ -2114,7 +2114,7 @@ assert z[0] is masked assert z[1] is not masked assert z[2] is masked - # + # x = arange(1,6) x[-1] = masked y = arange(1,6)*10 @@ -2234,8 +2234,8 @@ assert_equal_records(base._mask, np.ones(base.shape, dtype=mdtype)) # Set w/ list base.mask = [0,0,0,1,1] - assert_equal_records(base._mask, - np.array([(x,x,x) for x in [0,0,0,1,1]], + assert_equal_records(base._mask, + np.array([(x,x,x) for x in [0,0,0,1,1]], dtype=mdtype)) def test_set_record_element(self): @@ -2243,13 +2243,13 @@ base = self.data['base'] (base_a, base_b, base_c) = (base['a'], base['b'], base['c']) base[0] = (pi, pi, 'pi') - + assert_equal(base_a.dtype, int) assert_equal(base_a._data, [3,2,3,4,5]) - + assert_equal(base_b.dtype, float) assert_equal(base_b._data, [pi, 2.2, 3.3, 4.4, 5.5]) - + assert_equal(base_c.dtype, '|S8') assert_equal(base_c._data, ['pi','two','three','four','five']) @@ -2257,13 +2257,13 @@ base = self.data['base'] (base_a, base_b, base_c) = (base['a'], base['b'], base['c']) base[:3] = (pi, pi, 'pi') - + assert_equal(base_a.dtype, int) assert_equal(base_a._data, [3,3,3,4,5]) - + assert_equal(base_b.dtype, float) assert_equal(base_b._data, [pi, pi, pi, 4.4, 5.5]) - + assert_equal(base_c.dtype, '|S8') assert_equal(base_c._data, ['pi','pi','pi','four','five']) Modified: trunk/numpy/ma/tests/test_extras.py =================================================================== --- trunk/numpy/ma/tests/test_extras.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/ma/tests/test_extras.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -48,7 +48,7 @@ y = array([arange(6, dtype=float_), 2.0*arange(6)]) assert_equal(average(y, None), np.add.reduce(np.arange(6))*3./12.) assert_equal(average(y, axis=0), np.arange(6) * 3./2.) - assert_equal(average(y, axis=1), + assert_equal(average(y, axis=1), [average(x,axis=0), average(x,axis=0) * 2.0]) assert_equal(average(y, None, weights=w2), 20./6.) assert_equal(average(y, axis=0, weights=w2), @@ -395,7 +395,7 @@ # 2 1D variables w/ missing values nx = x[1:-1] assert_almost_equal(np.cov(nx, nx[::-1]), cov(x, x[::-1])) - assert_almost_equal(np.cov(nx, nx[::-1], rowvar=False), + assert_almost_equal(np.cov(nx, nx[::-1], rowvar=False), cov(x, x[::-1], rowvar=False)) assert_almost_equal(np.cov(nx, nx[::-1], rowvar=False, bias=True), cov(x, x[::-1], rowvar=False, bias=True)) @@ -409,13 +409,13 @@ frac = np.dot(valid, valid.T) xf = (x - x.mean(1)[:,None]).filled(0) assert_almost_equal(cov(x), np.cov(xf) * (x.shape[1]-1) / (frac - 1.)) - assert_almost_equal(cov(x, bias=True), + assert_almost_equal(cov(x, bias=True), np.cov(xf, bias=True) * x.shape[1] / frac) frac = np.dot(valid.T, valid) xf = (x - x.mean(0)).filled(0) - assert_almost_equal(cov(x, rowvar=False), + assert_almost_equal(cov(x, rowvar=False), np.cov(xf, rowvar=False) * (x.shape[0]-1)/(frac - 1.)) - assert_almost_equal(cov(x, rowvar=False, bias=True), + assert_almost_equal(cov(x, rowvar=False, bias=True), np.cov(xf, rowvar=False, bias=True) * x.shape[0]/frac) @@ -461,7 +461,7 @@ # 2 1D variables w/ missing values nx = x[1:-1] assert_almost_equal(np.corrcoef(nx, nx[::-1]), corrcoef(x, x[::-1])) - assert_almost_equal(np.corrcoef(nx, nx[::-1], rowvar=False), + assert_almost_equal(np.corrcoef(nx, nx[::-1], rowvar=False), corrcoef(x, x[::-1], rowvar=False)) assert_almost_equal(np.corrcoef(nx, nx[::-1], rowvar=False, bias=True), corrcoef(x, x[::-1], rowvar=False, bias=True)) @@ -471,7 +471,7 @@ x = self.data x[-1] = masked x = x.reshape(3,4) - + test = corrcoef(x) control = np.corrcoef(x) assert_almost_equal(test[:-1,:-1], control[:-1,:-1]) Modified: trunk/numpy/ma/tests/test_mrecords.py =================================================================== --- trunk/numpy/ma/tests/test_mrecords.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/ma/tests/test_mrecords.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -261,8 +261,8 @@ pass else: raise TypeError("Should have expected a readable buffer object!") - + def test_hardmask(self): "Test hardmask" base = self.base.copy() @@ -275,7 +275,7 @@ assert(not mbase._hardmask) mbase._mask = nomask # So, the mask of a field is no longer set to nomask... - assert_equal_records(mbase._mask, + assert_equal_records(mbase._mask, ma.make_mask_none(base.shape,base.dtype)) assert(ma.make_mask(mbase['b']._mask) is nomask) assert_equal(mbase['a']._mask,mbase['b']._mask) @@ -333,7 +333,7 @@ # solo = mrecarray(1, dtype=[('f0', ' 1: - self.failUnless (eq(numpy.concatenate((x,y),1), + self.failUnless (eq(numpy.concatenate((x,y),1), concatenate((xm,ym),1))) self.failUnless (eq(numpy.add.reduce(x,1), add.reduce(x,1))) self.failUnless (eq(numpy.sum(x,1), sum(x,1))) @@ -361,7 +361,7 @@ assert z[1] is not masked assert z[2] is masked assert eq(masked_where(greater(x, 2), x), masked_greater(x,2)) - assert eq(masked_where(greater_equal(x, 2), x), + assert eq(masked_where(greater_equal(x, 2), x), masked_greater_equal(x,2)) assert eq(masked_where(less(x, 2), x), masked_less(x,2)) assert eq(masked_where(less_equal(x, 2), x), masked_less_equal(x,2)) @@ -370,13 +370,13 @@ assert eq(masked_where(not_equal(x,2), x), masked_not_equal(x,2)) assert eq(masked_inside(range(5), 1, 3), [0, 199, 199, 199, 4]) assert eq(masked_outside(range(5), 1, 3),[199,1,2,3,199]) - assert eq(masked_inside(array(range(5), mask=[1,0,0,0,0]), 1, 3).mask, + assert eq(masked_inside(array(range(5), mask=[1,0,0,0,0]), 1, 3).mask, [1,1,1,1,0]) assert eq(masked_outside(array(range(5), mask=[0,1,0,0,0]), 1, 3).mask, [1,1,0,0,1]) - assert eq(masked_equal(array(range(5), mask=[1,0,0,0,0]), 2).mask, + assert eq(masked_equal(array(range(5), mask=[1,0,0,0,0]), 2).mask, [1,0,1,0,0]) - assert eq(masked_not_equal(array([2,2,1,2,1], mask=[1,0,0,0,0]), 2).mask, + assert eq(masked_not_equal(array([2,2,1,2,1], mask=[1,0,0,0,0]), 2).mask, [1,0,1,0,1]) assert eq(masked_where([1,1,0,0,0], [1,2,3,4,5]), [99,99,3,4,5]) atest = ones((10,10,10), dtype=float32) @@ -537,15 +537,15 @@ self.failUnless(allclose(average(x, axis=0), 2.5)) self.failUnless(allclose(average(x, axis=0, weights=w1), 2.5)) y=array([arange(6), 2.0*arange(6)]) - self.failUnless(allclose(average(y, None), + self.failUnless(allclose(average(y, None), numpy.add.reduce(numpy.arange(6))*3./12.)) self.failUnless(allclose(average(y, axis=0), numpy.arange(6) * 3./2.)) - self.failUnless(allclose(average(y, axis=1), + self.failUnless(allclose(average(y, axis=1), [average(x,axis=0), average(x,axis=0) * 2.0])) self.failUnless(allclose(average(y, None, weights=w2), 20./6.)) - self.failUnless(allclose(average(y, axis=0, weights=w2), + self.failUnless(allclose(average(y, axis=0, weights=w2), [0.,1.,2.,3.,4.,10.])) - self.failUnless(allclose(average(y, axis=1), + self.failUnless(allclose(average(y, axis=1), [average(x,axis=0), average(x,axis=0) * 2.0])) m1 = zeros(6) m2 = [0,0,1,1,0,0] @@ -561,7 +561,7 @@ self.failUnless(allclose(average(z, None), 20./6.)) self.failUnless(allclose(average(z, axis=0), [0.,1.,99.,99.,4.0, 7.5])) self.failUnless(allclose(average(z, axis=1), [2.5, 5.0])) - self.failUnless(allclose( average(z,axis=0, weights=w2), + self.failUnless(allclose( average(z,axis=0, weights=w2), [0.,1., 99., 99., 4.0, 10.0])) a = arange(6) @@ -674,9 +674,9 @@ mf = getattr(numpy.ma, f) args = self.d[:uf.nin] olderr = numpy.geterr() - f_invalid_ignore = ['sqrt', 'arctanh', 'arcsin', 'arccos', + f_invalid_ignore = ['sqrt', 'arctanh', 'arcsin', 'arccos', 'arccosh', 'arctanh', 'log', 'log10','divide', - 'true_divide', 'floor_divide', 'remainder', + 'true_divide', 'floor_divide', 'remainder', 'fmod'] if f in f_invalid_ignore: numpy.seterr(invalid='ignore') Modified: trunk/numpy/ma/testutils.py =================================================================== --- trunk/numpy/ma/testutils.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/ma/testutils.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -147,9 +147,9 @@ The test is equivalent to abs(desired-actual) < 0.5 * 10**(-decimal) """ if isinstance(actual, np.ndarray) or isinstance(desired, np.ndarray): - return assert_array_almost_equal(actual, desired, decimal=decimal, + return assert_array_almost_equal(actual, desired, decimal=decimal, err_msg=err_msg, verbose=verbose) - msg = build_err_msg([actual, desired], + msg = build_err_msg([actual, desired], err_msg=err_msg, verbose=verbose) assert round(abs(desired - actual),decimal) == 0, msg @@ -170,13 +170,13 @@ y = masked_array(yf, copy=False, mask=m) if ((x is masked) and not (y is masked)) or \ ((y is masked) and not (x is masked)): - msg = build_err_msg([x, y], err_msg=err_msg, verbose=verbose, + msg = build_err_msg([x, y], err_msg=err_msg, verbose=verbose, header=header, names=('x', 'y')) raise ValueError(msg) # OK, now run the basic tests on filled versions - return utils.assert_array_compare(comparison, - x.filled(fill_value), y.filled(fill_value), - err_msg=err_msg, + return utils.assert_array_compare(comparison, + x.filled(fill_value), y.filled(fill_value), + err_msg=err_msg, verbose=verbose, header=header) Modified: trunk/numpy/setupscons.py =================================================================== --- trunk/numpy/setupscons.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/setupscons.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -6,7 +6,7 @@ from numpy.distutils.misc_util import scons_generate_config_py pkgname = 'numpy' - config = Configuration(pkgname, parent_package, top_path, + config = Configuration(pkgname, parent_package, top_path, setup_name = 'setupscons.py') config.add_subpackage('distutils') config.add_subpackage('testing') @@ -27,7 +27,7 @@ if kw['scons_cmd'].inplace: target = pjoin(kw['pkg_name'], '__config__.py') else: - target = pjoin(kw['scons_cmd'].build_lib, kw['pkg_name'], + target = pjoin(kw['scons_cmd'].build_lib, kw['pkg_name'], '__config__.py') scons_generate_config_py(target) config.add_sconscript(None, post_hook = add_config) Modified: trunk/numpy/testing/__init__.py =================================================================== --- trunk/numpy/testing/__init__.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/testing/__init__.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -10,7 +10,7 @@ import decorators as dec from utils import * -from parametric import ParametricTestCase +from parametric import ParametricTestCase from numpytest import * from nosetester import NoseTester as Tester from nosetester import run_module_suite Modified: trunk/numpy/testing/decorators.py =================================================================== --- trunk/numpy/testing/decorators.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/testing/decorators.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -72,8 +72,8 @@ if msg is None: msg = 'Test skipped due to test condition' def skip_decorator(f): - # Local import to avoid a hard nose dependency and only incur the - # import time overhead at actual test-time. + # Local import to avoid a hard nose dependency and only incur the + # import time overhead at actual test-time. import nose def skipper(*args, **kwargs): if skip_condition: @@ -86,8 +86,8 @@ def skipknownfailure(f): ''' Decorator to raise SkipTest for test known to fail ''' - # Local import to avoid a hard nose dependency and only incur the - # import time overhead at actual test-time. + # Local import to avoid a hard nose dependency and only incur the + # import time overhead at actual test-time. import nose def skipper(*args, **kwargs): raise nose.SkipTest, 'This test is known to fail' Modified: trunk/numpy/testing/noseclasses.py =================================================================== --- trunk/numpy/testing/noseclasses.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/testing/noseclasses.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -134,12 +134,12 @@ return name -# second-chance checker; if the default comparison doesn't +# second-chance checker; if the default comparison doesn't # pass, then see if the expected output string contains flags that # tell us to ignore the output class numpyOutputChecker(doctest.OutputChecker): def check_output(self, want, got, optionflags): - ret = doctest.OutputChecker.check_output(self, want, got, + ret = doctest.OutputChecker.check_output(self, want, got, optionflags) if not ret: if "#random" in want: @@ -148,7 +148,7 @@ return ret -# Subclass nose.plugins.doctests.DocTestCase to work around a bug in +# Subclass nose.plugins.doctests.DocTestCase to work around a bug in # its constructor that blocks non-default arguments from being passed # down into doctest.DocTestCase class numpyDocTestCase(npd.DocTestCase): @@ -156,13 +156,13 @@ checker=None, obj=None, result_var='_'): self._result_var = result_var self._nose_obj = obj - doctest.DocTestCase.__init__(self, test, + doctest.DocTestCase.__init__(self, test, optionflags=optionflags, - setUp=setUp, tearDown=tearDown, + setUp=setUp, tearDown=tearDown, checker=checker) -print_state = numpy.get_printoptions() +print_state = numpy.get_printoptions() class numpyDoctest(npd.Doctest): name = 'numpydoctest' # call nosetests with --with-numpydoctest @@ -188,7 +188,7 @@ try: tests = self.finder.find(module) except AttributeError: - # nose allows module.__test__ = False; doctest does not and + # nose allows module.__test__ = False; doctest does not and # throws AttributeError return if not tests: @@ -205,31 +205,31 @@ # Each doctest should execute in an environment equivalent to # starting Python and executing "import numpy as np", and, - # for SciPy packages, an additional import of the local + # for SciPy packages, an additional import of the local # package (so that scipy.linalg.basic.py's doctests have an # implicit "from scipy import linalg" as well. # # Note: __file__ allows the doctest in NoseTester to run # without producing an error test.globs = {'__builtins__':__builtins__, - '__file__':'__main__', - '__name__':'__main__', + '__file__':'__main__', + '__name__':'__main__', 'np':numpy} - + # add appropriate scipy import for SciPy tests if 'scipy' in pkg_name: p = pkg_name.split('.') p1 = '.'.join(p[:-1]) p2 = p[-1] test.globs[p2] = __import__(pkg_name, test.globs, {}, [p2]) - + print 'additional import for %s: from %s import %s' % (test.filename, p1, p2) print ' (%s): %r' % (pkg_name, test.globs[p2]) # always use whitespace and ellipsis options optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS - yield numpyDocTestCase(test, + yield numpyDocTestCase(test, optionflags=optionflags, checker=numpyOutputChecker()) Modified: trunk/numpy/testing/nosetester.py =================================================================== --- trunk/numpy/testing/nosetester.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/testing/nosetester.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -81,7 +81,7 @@ extra_argv : list List with any extra args to pass to nosetests''' \ % {'testtype': testtype} - + meth.__doc__ = meth.__doc__ % {'test_header':test_header} @@ -123,7 +123,7 @@ package = os.path.dirname(package.__file__) self.package_path = package - # find the package name under test; this name is used to limit coverage + # find the package name under test; this name is used to limit coverage # reporting (if enabled) self.package_name = get_package_name(package) @@ -144,8 +144,8 @@ argv += extra_argv return argv - - def test(self, label='fast', verbose=1, extra_argv=None, doctests=False, + + def test(self, label='fast', verbose=1, extra_argv=None, doctests=False, coverage=False, **kwargs): ''' Run tests for module using nose @@ -154,7 +154,7 @@ If True, run doctests in module, default False coverage : boolean If True, report coverage of NumPy code, default False - (Requires the coverage module: + (Requires the coverage module: http://nedbatchelder.com/code/modules/coverage.html) ''' @@ -165,15 +165,15 @@ ua = ', '.join(unexpected_args) raise TypeError("test() got unexpected arguments: %s" % ua) - # issue a deprecation warning if any of the pre-1.2 arguments to + # issue a deprecation warning if any of the pre-1.2 arguments to # test are given if old_args.intersection(kwargs.keys()): warnings.warn("This method's signature will change in the next " \ "release; the level, verbosity, all, sys_argv, " \ "and testcase_pattern keyword arguments will be " \ - "removed. Please update your code.", + "removed. Please update your code.", DeprecationWarning, stacklevel=2) - + # Use old arguments if given (where it makes sense) # For the moment, level and sys_argv are ignored @@ -191,7 +191,7 @@ label = '' doctests = True - # if doctests is in the extra args, remove it and set the doctest + # if doctests is in the extra args, remove it and set the doctest # flag so the NumPy doctester is used instead if extra_argv and '--with-doctest' in extra_argv: extra_argv.remove('--with-doctest') @@ -222,23 +222,23 @@ print "NumPy version %s" % numpy.__version__ npdir = os.path.dirname(numpy.__file__) print "NumPy is installed in %s" % npdir - + if 'scipy' in self.package_name: import scipy print "SciPy version %s" % scipy.__version__ spdir = os.path.dirname(scipy.__file__) print "SciPy is installed in %s" % spdir - + pyversion = sys.version.replace('\n','') print "Python version %s" % pyversion print "nose version %d.%d.%d" % nose.__versioninfo__ - # Because nose currently discards the test result object, but we need - # to return it to the user, override TestProgram.runTests to retain + # Because nose currently discards the test result object, but we need + # to return it to the user, override TestProgram.runTests to retain # the result class NumpyTestProgram(nose.core.TestProgram): def runTests(self): - """Run Tests. Returns true on success, false on failure, and + """Run Tests. Returns true on success, false on failure, and sets self.success to the same value. """ if self.testRunner is None: @@ -257,7 +257,7 @@ doctest.master = None # construct list of plugins, omitting the existing doctest plugin - import nose.plugins.builtin + import nose.plugins.builtin from noseclasses import numpyDoctest plugins = [numpyDoctest()] for p in nose.plugins.builtin.plugins: @@ -307,10 +307,9 @@ ''' # whitespace after the 3 >>> 1+2 - 3 + 3 # whitespace before the 7 >>> 3+4 7 ''' - Modified: trunk/numpy/testing/numpytest.py =================================================================== --- trunk/numpy/testing/numpytest.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/testing/numpytest.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -623,7 +623,7 @@ """ Run Numpy module test suite with level and verbosity taken from sys.argv. Requires optparse module. """ - + # delayed import of shlex to reduce startup time import shlex Modified: trunk/numpy/testing/parametric.py =================================================================== --- trunk/numpy/testing/parametric.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/testing/parametric.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -189,7 +189,7 @@ else: unittest.TestCase.run(self,result) -# The underscore was added to the class name to keep nose from trying +# The underscore was added to the class name to keep nose from trying # to run the test class (nose ignores class names that begin with an # underscore by default). ParametricTestCase = _ParametricTestCase Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2008-08-08 00:08:07 UTC (rev 5621) +++ trunk/numpy/testing/utils.py 2008-08-08 04:33:45 UTC (rev 5622) @@ -10,7 +10,7 @@ __all__ = ['assert_equal', 'assert_almost_equal','assert_approx_equal', 'assert_array_equal', 'assert_array_less', 'assert_string_equal', - 'assert_array_almost_equal', 'assert_raises', 'build_err_msg', + 'assert_array_almost_equal', 'assert_raises', 'build_err_msg', 'decorate_methods', 'jiffies', 'memusage', 'print_assert_equal', 'raises', 'rand', 'rundocs', 'runstring', 'verbose'] From numpy-svn at scipy.org Fri Aug 8 00:58:34 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 7 Aug 2008 23:58:34 -0500 (CDT) Subject: [Numpy-svn] r5623 - trunk/numpy/lib Message-ID: <20080808045834.C00F539C021@scipy.org> Author: jarrod.millman Date: 2008-08-07 23:58:32 -0500 (Thu, 07 Aug 2008) New Revision: 5623 Modified: trunk/numpy/lib/function_base.py Log: breaking API for median Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2008-08-08 04:33:45 UTC (rev 5622) +++ trunk/numpy/lib/function_base.py 2008-08-08 04:58:32 UTC (rev 5623) @@ -2459,22 +2459,19 @@ b.sort(0) return b -def median(a, axis=0, out=None, overwrite_input=False): +def median(a, axis=None, out=None, overwrite_input=False): """ Compute the median along the specified axis. - Returns the median of the array elements. The median is taken - over the first axis of the array by default, otherwise over - the specified axis. + Returns the median of the array elements. Parameters ---------- a : array_like Input array or object that can be converted to an array. - axis : {int, None}, optional - Axis along which the medians are computed. The default is to - compute the median along the first dimension. If `axis` is - set to None, return the median of the flattened array. + axis : {None, 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. 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, @@ -2515,14 +2512,14 @@ array([[10, 7, 4], [ 3, 2, 1]]) >>> np.median(a) - array([ 6.5, 4.5, 2.5]) - >>> np.median(a, axis=None) 3.5 + >>> np.median(a, axis=0) + array([ 6.5, 4.5, 2.5]) >>> np.median(a, axis=1) array([ 7., 2.]) - >>> m = np.median(a) + >>> m = np.median(a, axis=0) >>> out = np.zeros_like(m) - >>> np.median(a, out=m) + >>> np.median(a, axis=0, out=m) array([ 6.5, 4.5, 2.5]) >>> m array([ 6.5, 4.5, 2.5]) From numpy-svn at scipy.org Sat Aug 9 19:55:01 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 9 Aug 2008 18:55:01 -0500 (CDT) Subject: [Numpy-svn] r5624 - trunk/numpy/distutils/command Message-ID: <20080809235501.994C039C080@scipy.org> Author: cdavid Date: 2008-08-09 18:55:01 -0500 (Sat, 09 Aug 2008) New Revision: 5624 Modified: trunk/numpy/distutils/command/scons.py Log: Improve error message when scons command fails. Modified: trunk/numpy/distutils/command/scons.py =================================================================== --- trunk/numpy/distutils/command/scons.py 2008-08-08 04:58:32 UTC (rev 5623) +++ trunk/numpy/distutils/command/scons.py 2008-08-09 23:55:01 UTC (rev 5624) @@ -453,12 +453,14 @@ log.info("======== Executing scons command for pkg %s =========", pkg_name) st = os.system(cmdstr) if st: - print "status is %d" % st - msg = "Error while executing scons command %s (see above)" \ - % cmdstr - msg += """ - Try executing the scons command with --log-level option for more detailed - output, for example --log-level=0; the lowest, the more detailed""" + #print "status is %d" % st + msg = "Error while executing scons command." + msg += " See above for more information.\n" + msg += """\ +If you think it is a problem in numscons, you can also try executing the scons +command with --log-level option for more detailed output of what numscons is +doing, for example --log-level=0; the lowest the level is, the more detailed +the output it.""" raise DistutilsExecError(msg) if post_hook: post_hook(**{'pkg_name': pkg_name, 'scons_cmd' : self}) From numpy-svn at scipy.org Sat Aug 9 19:55:21 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 9 Aug 2008 18:55:21 -0500 (CDT) Subject: [Numpy-svn] r5625 - trunk/numpy/core Message-ID: <20080809235521.894EE39C080@scipy.org> Author: cdavid Date: 2008-08-09 18:55:21 -0500 (Sat, 09 Aug 2008) New Revision: 5625 Modified: trunk/numpy/core/SConscript Log: Give better error message when testing python.h fails. Modified: trunk/numpy/core/SConscript =================================================================== --- trunk/numpy/core/SConscript 2008-08-09 23:55:01 UTC (rev 5624) +++ trunk/numpy/core/SConscript 2008-08-09 23:55:21 UTC (rev 5625) @@ -5,7 +5,7 @@ from os.path import join as pjoin, basename as pbasename, dirname as pdirname from copy import deepcopy -from numscons import get_python_inc, get_pythonlib_dir +from numscons import get_pythonlib_dir from numscons import GetNumpyEnvironment from numscons import CheckCBLAS from numscons import write_info @@ -17,7 +17,7 @@ env = GetNumpyEnvironment(ARGUMENTS) -env.Append(CPPPATH = [get_python_inc()]) +env.Append(CPPPATH = env["PYEXTCPPPATH"]) if os.name == 'nt': # NT needs the pythonlib to run any code importing Python.h, including # simple code using only typedef and so on, so we need it for configuration @@ -43,9 +43,13 @@ # Checking Types #--------------- if not config.CheckHeader("Python.h"): - raise RuntimeError("Error: Python.h header is not found (or cannot be " -"compiled). On linux, check that you have python-dev/python-devel packages. On" -" windows, check \ that you have the platform SDK.") + errmsg = [] + for line in config.GetLastError(): + errmsg.append("\t>> %s " % line) + print """\ Error: Python.h header cannot be compiled (or cannot be found). +On linux, check that you have python-dev/python-devel packages. On windows, +check that you have he platform SDK. You may also use unsupported cflags. Configuration error log says: \n%s""" % ''.join(errmsg) + Exit(-1) def check_type(type, include = None): st = config.CheckTypeSize(type, includes = include) From numpy-svn at scipy.org Sun Aug 10 16:05:51 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 10 Aug 2008 15:05:51 -0500 (CDT) Subject: [Numpy-svn] r5626 - in trunk/numpy/core: include/numpy src Message-ID: <20080810200551.2316339C153@scipy.org> Author: oliphant Date: 2008-08-10 15:05:49 -0500 (Sun, 10 Aug 2008) New Revision: 5626 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/arrayobject.c trunk/numpy/core/src/multiarraymodule.c Log: *Full recompile needed*: changed the name of hasobject structure member to flags in the PyArray_Descr structure and increased it's size to int Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-09 23:55:21 UTC (rev 5625) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-10 20:05:49 UTC (rev 5626) @@ -39,7 +39,7 @@ #define NPY_SUCCEED 1 /* Helpful to distinguish what is installed */ -#define NPY_VERSION 0x01000009 +#define NPY_VERSION 0x0100000A /* Some platforms don't define bool, long long, or long double. Handle that here. @@ -1176,7 +1176,7 @@ NPY_NEEDS_INIT | NPY_NEEDS_PYAPI) #define PyDataType_FLAGCHK(dtype, flag) \ - (((dtype)->hasobject & (flag)) == (flag)) + (((dtype)->flags & (flag)) == (flag)) #define PyDataType_REFCHK(dtype) \ PyDataType_FLAGCHK(dtype, NPY_ITEM_REFCOUNT) @@ -1192,7 +1192,7 @@ char type; /* unique-character representing this type */ char byteorder; /* '>' (big), '<' (little), '|' (not-applicable), or '=' (native). */ - char hasobject; /* non-zero if it has object arrays + int flags; /* non-zero if it has object arrays in fields */ int type_num; /* number representing this type */ int elsize; /* element size for this type */ Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-08-09 23:55:21 UTC (rev 5625) +++ trunk/numpy/core/src/arrayobject.c 2008-08-10 20:05:49 UTC (rev 5626) @@ -11155,7 +11155,7 @@ {"byteorder", T_CHAR, offsetof(PyArray_Descr, byteorder), RO, NULL}, {"itemsize", T_INT, offsetof(PyArray_Descr, elsize), RO, NULL}, {"alignment", T_INT, offsetof(PyArray_Descr, alignment), RO, NULL}, - {"flags", T_UBYTE, offsetof(PyArray_Descr, hasobject), RO, NULL}, + {"flags", T_UBYTE, offsetof(PyArray_Descr, flags), RO, NULL}, {NULL}, }; @@ -11553,7 +11553,7 @@ PyTuple_SET_ITEM(state, 5, PyInt_FromLong(elsize)); PyTuple_SET_ITEM(state, 6, PyInt_FromLong(alignment)); - PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->hasobject)); + PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->flags)); PyTuple_SET_ITEM(ret, 2, state); return ret; @@ -11565,7 +11565,8 @@ static int _descr_find_object(PyArray_Descr *self) { - if (self->hasobject || self->type_num == PyArray_OBJECT || + if (PyDataType_FLAGCHK(self, NPY_ITEM_HASOBJECT) || + self->type_num == PyArray_OBJECT || self->kind == 'O') return NPY_OBJECT_DTYPE_FLAGS; if (PyDescr_HASFIELDS(self)) { @@ -11581,7 +11582,7 @@ return 0; } if (_descr_find_object(new)) { - new->hasobject = NPY_OBJECT_DTYPE_FLAGS; + new->flags = NPY_OBJECT_DTYPE_FLAGS; return NPY_OBJECT_DTYPE_FLAGS; } } @@ -11712,9 +11713,9 @@ self->alignment = alignment; } - self->hasobject = dtypeflags; + self->flags = dtypeflags; if (version < 3) { - self->hasobject = _descr_find_object(self); + self->flags = _descr_find_object(self); } Py_INCREF(Py_None); return Py_None; Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2008-08-09 23:55:21 UTC (rev 5625) +++ trunk/numpy/core/src/multiarraymodule.c 2008-08-10 20:05:49 UTC (rev 5626) @@ -4704,7 +4704,7 @@ new->names = conv->names; Py_XINCREF(new->names); } - new->hasobject = conv->hasobject; + new->flags = conv->flags; Py_DECREF(conv); *errflag = 0; return new; @@ -4783,7 +4783,7 @@ PyDimMem_FREE(shape.ptr); newdescr->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr)); newdescr->subarray->base = type; - newdescr->hasobject = type->hasobject; + newdescr->flags = type->flags; Py_INCREF(val); newdescr->subarray->shape = val; Py_XDECREF(newdescr->fields); @@ -4873,7 +4873,7 @@ "two fields with the same name"); goto fail; } - dtypeflags |= (conv->hasobject & NPY_FROM_FIELDS); + dtypeflags |= (conv->flags & NPY_FROM_FIELDS); tup = PyTuple_New((title == NULL ? 2 : 3)); PyTuple_SET_ITEM(tup, 0, (PyObject *)conv); if (align) { @@ -4902,7 +4902,7 @@ new->fields = fields; new->names = nameslist; new->elsize = totalsize; - new->hasobject=dtypeflags; + new->flags=dtypeflags; if (maxalign > 1) { totalsize = ((totalsize+maxalign-1)/maxalign)*maxalign; } @@ -4955,7 +4955,7 @@ Py_DECREF(key); goto fail; } - dtypeflags |= (conv->hasobject & NPY_FROM_FIELDS); + dtypeflags |= (conv->flags & NPY_FROM_FIELDS); PyTuple_SET_ITEM(tup, 0, (PyObject *)conv); if (align) { int _align; @@ -4973,7 +4973,7 @@ new = PyArray_DescrNewFromType(PyArray_VOID); new->fields = fields; new->names = nameslist; - new->hasobject=dtypeflags; + new->flags=dtypeflags; if (maxalign > 1) { totalsize = ((totalsize+maxalign-1)/maxalign)*maxalign; } @@ -5199,7 +5199,7 @@ } Py_DECREF(tup); if ((ret == PY_FAIL) || (newdescr->elsize == 0)) goto fail; - dtypeflags |= (newdescr->hasobject & NPY_FROM_FIELDS); + dtypeflags |= (newdescr->flags & NPY_FROM_FIELDS); totalsize += newdescr->elsize; } @@ -5217,7 +5217,7 @@ } new->names = names; new->fields = fields; - new->hasobject = dtypeflags; + new->flags = dtypeflags; return new; fail: From numpy-svn at scipy.org Sun Aug 10 16:19:59 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 10 Aug 2008 15:19:59 -0500 (CDT) Subject: [Numpy-svn] r5627 - in trunk/numpy/core: src tests Message-ID: <20080810201959.A437239C113@scipy.org> Author: oliphant Date: 2008-08-10 15:19:58 -0500 (Sun, 10 Aug 2008) New Revision: 5627 Modified: trunk/numpy/core/src/arrayobject.c trunk/numpy/core/tests/test_regression.py Log: Fix ticket #674. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-08-10 20:05:49 UTC (rev 5626) +++ trunk/numpy/core/src/arrayobject.c 2008-08-10 20:19:58 UTC (rev 5627) @@ -11145,7 +11145,8 @@ /* we need to be careful about setting attributes because these objects are pointed to by arrays that depend on them for interpreting - data. Currently no attributes of dtype objects can be set. + data. Currently no attributes of data-type objects can be set + directly except names. */ static PyMemberDef arraydescr_members[] = { {"type", T_OBJECT, offsetof(PyArray_Descr, typeobj), RO, NULL}, @@ -11403,9 +11404,11 @@ key = PyTuple_GET_ITEM(self->names, i); /* Borrowed reference to item */ item = PyDict_GetItem(self->fields, key); + Py_INCREF(item); /* Hold on to it even through DelItem */ new_key = PyTuple_GET_ITEM(new_names, i); + PyDict_DelItem(self->fields, key); PyDict_SetItem(self->fields, new_key, item); - PyDict_DelItem(self->fields, key); + Py_DECREF(item); /* self->fields now holds reference */ } /* Replace names */ Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-08-10 20:05:49 UTC (rev 5626) +++ trunk/numpy/core/tests/test_regression.py 2008-08-10 20:19:58 UTC (rev 5627) @@ -1174,6 +1174,15 @@ want = np.array([-1+0j, -1+0j, 0+0j, 1+0j, 1+0j, 0+0j]) assert_equal(have, want) + def test_for_equal_names(self, level=rlevel): + """Ticket #674""" + dt = np.dtype([('foo', float), ('bar', float)]) + a = np.zeros(10, dt) + b = list(a.dtype.names) + b[0] = "notfoo" + a.dtype.names = b + assert a.dtype.names[0] == "notfoo" + assert a.dtype.names[1] == "bar" if __name__ == "__main__": run_module_suite() From numpy-svn at scipy.org Sun Aug 10 17:07:37 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 10 Aug 2008 16:07:37 -0500 (CDT) Subject: [Numpy-svn] r5628 - trunk/numpy/distutils/command Message-ID: <20080810210737.E3B7439C0CA@scipy.org> Author: cdavid Date: 2008-08-10 16:07:36 -0500 (Sun, 10 Aug 2008) New Revision: 5628 Modified: trunk/numpy/distutils/command/scons.py Log: Depends on numscons >= 0.9.1. Modified: trunk/numpy/distutils/command/scons.py =================================================================== --- trunk/numpy/distutils/command/scons.py 2008-08-10 20:19:58 UTC (rev 5627) +++ trunk/numpy/distutils/command/scons.py 2008-08-10 21:07:36 UTC (rev 5628) @@ -356,7 +356,7 @@ "this package " % str(e)) try: - minver = "0.9.0" + minver = "0.9.1" from numscons import get_version if get_version() < minver: raise ValueError() From numpy-svn at scipy.org Sun Aug 10 18:21:50 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 10 Aug 2008 17:21:50 -0500 (CDT) Subject: [Numpy-svn] r5629 - trunk/numpy/core Message-ID: <20080810222150.EAED239C0CA@scipy.org> Author: cdavid Date: 2008-08-10 17:21:49 -0500 (Sun, 10 Aug 2008) New Revision: 5629 Modified: trunk/numpy/core/SConscript Log: Tweak error msg when python.h not compilable with scons. Modified: trunk/numpy/core/SConscript =================================================================== --- trunk/numpy/core/SConscript 2008-08-10 21:07:36 UTC (rev 5628) +++ trunk/numpy/core/SConscript 2008-08-10 22:21:49 UTC (rev 5629) @@ -45,10 +45,12 @@ if not config.CheckHeader("Python.h"): errmsg = [] for line in config.GetLastError(): - errmsg.append("\t>> %s " % line) - print """\ Error: Python.h header cannot be compiled (or cannot be found). + errmsg.append("%s " % line) + print """ +Error: Python.h header cannot be compiled (or cannot be found). On linux, check that you have python-dev/python-devel packages. On windows, -check that you have he platform SDK. You may also use unsupported cflags. Configuration error log says: \n%s""" % ''.join(errmsg) +check that you have he platform SDK. You may also use unsupported cflags. +Configuration error log says: \n\n%s""" % ''.join(errmsg) Exit(-1) def check_type(type, include = None): From numpy-svn at scipy.org Tue Aug 12 02:56:13 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 12 Aug 2008 01:56:13 -0500 (CDT) Subject: [Numpy-svn] r5630 - in trunk/numpy/lib: . tests Message-ID: <20080812065613.69E3C39C192@scipy.org> Author: stefan Date: 2008-08-12 01:56:11 -0500 (Tue, 12 Aug 2008) New Revision: 5630 Modified: trunk/numpy/lib/function_base.py trunk/numpy/lib/tests/test_function_base.py Log: More consistent nan-operations. Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2008-08-10 22:21:49 UTC (rev 5629) +++ trunk/numpy/lib/function_base.py 2008-08-12 06:56:11 UTC (rev 5630) @@ -1356,6 +1356,38 @@ """ return _insert(arr, mask, vals) +def _nanop(op, fill, a, axis=None): + """ + General operation on arrays with not-a-number values. + + Parameters + ---------- + op : callable + Operation to perform. + fill : float + NaN values are set to fill before doing the operation. + a : array-like + Input array. + axis : {int, None}, optional + Axis along which the operation is computed. + By default the input is flattened. + + Returns + ------- + y : {ndarray, scalar} + Processed data. + + """ + y = array(a,subok=True) + mask = isnan(a) + if mask.all(): + return np.nan + + if not issubclass(y.dtype.type, np.integer): + y[mask] = fill + + return op(y, axis=axis) + def nansum(a, axis=None): """ Sum the array along the given axis, treating NaNs as zero. @@ -1381,10 +1413,7 @@ array([ 2., 1.]) """ - y = array(a,subok=True) - if not issubclass(y.dtype.type, _nx.integer): - y[isnan(a)] = 0 - return y.sum(axis) + return _nanop(np.sum, 0, a, axis) def nanmin(a, axis=None): """ @@ -1413,10 +1442,7 @@ array([ 1., 3.]) """ - y = array(a,subok=True) - if not issubclass(y.dtype.type, _nx.integer): - y[isnan(a)] = _nx.inf - return y.min(axis) + return _nanop(np.min, np.inf, a, axis) def nanargmin(a, axis=None): """ @@ -1426,10 +1452,7 @@ Refer to `numpy.nanargmax` for detailed documentation. """ - y = array(a, subok=True) - if not issubclass(y.dtype.type, _nx.integer): - y[isnan(a)] = _nx.inf - return y.argmin(axis) + return _nanop(np.argmin, np.inf, a, axis) def nanmax(a, axis=None): """ @@ -1458,10 +1481,7 @@ array([ 2., 3.]) """ - y = array(a, subok=True) - if not issubclass(y.dtype.type, _nx.integer): - y[isnan(a)] = -_nx.inf - return y.max(axis) + return _nanop(np.max, -np.inf, a, axis) def nanargmax(a, axis=None): """ @@ -1497,10 +1517,7 @@ array([1, 0]) """ - y = array(a,subok=True) - if not issubclass(y.dtype.type, _nx.integer): - y[isnan(a)] = -_nx.inf - return y.argmax(axis) + return _nanop(np.argmax, -np.inf, a, axis) def disp(mesg, device=None, linefeed=True): """Display a message to the given device (default is sys.stdout) Modified: trunk/numpy/lib/tests/test_function_base.py =================================================================== --- trunk/numpy/lib/tests/test_function_base.py 2008-08-10 22:21:49 UTC (rev 5629) +++ trunk/numpy/lib/tests/test_function_base.py 2008-08-12 06:56:11 UTC (rev 5630) @@ -685,6 +685,7 @@ array([[ 0.01319214, 0.11704017, 0.1630199 ], [ 0.37910852, 0.87964135, 0.34306596], [ 0.72687499, 0.23913896, 0.33850425]])) + assert nanmin([nan, nan]) is nan def test_nanargmin(self): assert_almost_equal(nanargmin(self.A), 1) From numpy-svn at scipy.org Tue Aug 12 14:46:32 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 12 Aug 2008 13:46:32 -0500 (CDT) Subject: [Numpy-svn] r5631 - in trunk/numpy/doc/swig: . test Message-ID: <20080812184632.5DC0639C05F@scipy.org> Author: stefan Date: 2008-08-12 13:46:31 -0500 (Tue, 12 Aug 2008) New Revision: 5631 Added: trunk/numpy/doc/swig/test/Fortran.cxx trunk/numpy/doc/swig/test/Fortran.h trunk/numpy/doc/swig/test/Fortran.i trunk/numpy/doc/swig/test/testFortran.py Modified: trunk/numpy/doc/swig/numpy.i trunk/numpy/doc/swig/test/Makefile trunk/numpy/doc/swig/test/setup.py trunk/numpy/doc/swig/test/testArray.py trunk/numpy/doc/swig/test/testMatrix.py trunk/numpy/doc/swig/test/testTensor.py trunk/numpy/doc/swig/test/testVector.py Log: Correctly handle Fortran-contiguous arrays in SWIG wrappers. Modified: trunk/numpy/doc/swig/numpy.i =================================================================== --- trunk/numpy/doc/swig/numpy.i 2008-08-12 06:56:11 UTC (rev 5630) +++ trunk/numpy/doc/swig/numpy.i 2008-08-12 18:46:31 UTC (rev 5631) @@ -196,7 +196,7 @@ } else { - py_obj = PyArray_FromObject(input, typecode, 0, 0); + py_obj = PyArray_FROMANY(input, typecode, 0, 0, NPY_DEFAULT); /* If NULL, PyArray_FromObject will have set python error value.*/ ary = (PyArrayObject*) py_obj; *is_new_object = 1; @@ -229,6 +229,30 @@ return result; } + /* Given a PyArrayObject, check to see if it is Fortran-contiguous. + * If so, return the input pointer, but do not flag it as not a new + * object. If it is not Fortran-contiguous, create a new + * PyArrayObject using the original data, flag it as a new object + * and return the pointer. + */ + PyArrayObject* make_fortran(PyArrayObject* ary, int* is_new_object, + int min_dims, int max_dims) + { + PyArrayObject* result; + if (array_is_fortran(ary)) + { + result = ary; + *is_new_object = 0; + } + else + { + Py_INCREF(ary->descr); + result = (PyArrayObject*) PyArray_FromArray(ary, ary->descr, NPY_FORTRAN); + *is_new_object = 1; + } + return result; + } + /* Convert a given PyObject to a contiguous PyArrayObject of the * specified type. If the input object is not a contiguous * PyArrayObject, a new one will be created and the new object flag @@ -255,8 +279,37 @@ *is_new_object = is_new1 || is_new2; return ary1; } -} + /* Convert a given PyObject to a Fortran-ordered PyArrayObject of the + * specified type. If the input object is not a Fortran-ordered + * PyArrayObject, a new one will be created and the new object flag + * will be set. + */ + PyArrayObject* obj_to_array_fortran_allow_conversion(PyObject* input, + int typecode, + int* is_new_object) + { + int is_new1 = 0; + int is_new2 = 0; + PyArrayObject* ary2; + PyArrayObject* ary1 = obj_to_array_allow_conversion(input, typecode, + &is_new1); + if (ary1) + { + ary2 = make_fortran(ary1, &is_new2, 0, 0); + if (is_new1 && is_new2) + { + Py_DECREF(ary1); + } + ary1 = ary2; + } + *is_new_object = is_new1 || is_new2; + return ary1; + } + +} /* end fragment */ + + /**********************************************************************/ %fragment("NumPy_Array_Requirements", "header", @@ -716,8 +769,8 @@ (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[2] = { -1, -1 }; - array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, - &is_new_object); + array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE, + &is_new_object); if (!array || !require_dimensions(array, 2) || !require_size(array, size, 2) || !require_fortran(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); @@ -864,8 +917,8 @@ (PyArrayObject* array=NULL, int is_new_object=0) { npy_intp size[3] = { -1, -1, -1 }; - array = obj_to_array_contiguous_allow_conversion($input, DATA_TYPECODE, - &is_new_object); + array = obj_to_array_fortran_allow_conversion($input, DATA_TYPECODE, + &is_new_object); if (!array || !require_dimensions(array, 3) || !require_size(array, size, 3) | !require_fortran(array)) SWIG_fail; $1 = (DATA_TYPE*) array_data(array); Added: trunk/numpy/doc/swig/test/Fortran.cxx =================================================================== --- trunk/numpy/doc/swig/test/Fortran.cxx 2008-08-12 06:56:11 UTC (rev 5630) +++ trunk/numpy/doc/swig/test/Fortran.cxx 2008-08-12 18:46:31 UTC (rev 5631) @@ -0,0 +1,24 @@ +#include +#include +#include +#include "Fortran.h" + +#define TEST_FUNCS(TYPE, SNAME) \ +\ +TYPE SNAME ## SecondElement(TYPE * matrix, int rows, int cols) { \ + TYPE result = matrix[1]; \ + return result; \ +} \ + +TEST_FUNCS(signed char , schar ) +TEST_FUNCS(unsigned char , uchar ) +TEST_FUNCS(short , short ) +TEST_FUNCS(unsigned short , ushort ) +TEST_FUNCS(int , int ) +TEST_FUNCS(unsigned int , uint ) +TEST_FUNCS(long , long ) +TEST_FUNCS(unsigned long , ulong ) +TEST_FUNCS(long long , longLong ) +TEST_FUNCS(unsigned long long, ulongLong) +TEST_FUNCS(float , float ) +TEST_FUNCS(double , double ) Added: trunk/numpy/doc/swig/test/Fortran.h =================================================================== --- trunk/numpy/doc/swig/test/Fortran.h 2008-08-12 06:56:11 UTC (rev 5630) +++ trunk/numpy/doc/swig/test/Fortran.h 2008-08-12 18:46:31 UTC (rev 5631) @@ -0,0 +1,21 @@ +#ifndef FORTRAN_H +#define FORTRAN_H + +#define TEST_FUNC_PROTOS(TYPE, SNAME) \ +\ +TYPE SNAME ## SecondElement( TYPE * matrix, int rows, int cols); \ + +TEST_FUNC_PROTOS(signed char , schar ) +TEST_FUNC_PROTOS(unsigned char , uchar ) +TEST_FUNC_PROTOS(short , short ) +TEST_FUNC_PROTOS(unsigned short , ushort ) +TEST_FUNC_PROTOS(int , int ) +TEST_FUNC_PROTOS(unsigned int , uint ) +TEST_FUNC_PROTOS(long , long ) +TEST_FUNC_PROTOS(unsigned long , ulong ) +TEST_FUNC_PROTOS(long long , longLong ) +TEST_FUNC_PROTOS(unsigned long long, ulongLong) +TEST_FUNC_PROTOS(float , float ) +TEST_FUNC_PROTOS(double , double ) + +#endif Added: trunk/numpy/doc/swig/test/Fortran.i =================================================================== --- trunk/numpy/doc/swig/test/Fortran.i 2008-08-12 06:56:11 UTC (rev 5630) +++ trunk/numpy/doc/swig/test/Fortran.i 2008-08-12 18:46:31 UTC (rev 5631) @@ -0,0 +1,36 @@ +// -*- c++ -*- +%module Fortran + +%{ +#define SWIG_FILE_WITH_INIT +#include "Fortran.h" +%} + +// Get the NumPy typemaps +%include "../numpy.i" + +%init %{ + import_array(); +%} + +%define %apply_numpy_typemaps(TYPE) + +%apply (TYPE* IN_FARRAY2, int DIM1, int DIM2) {(TYPE* matrix, int rows, int cols)}; + +%enddef /* %apply_numpy_typemaps() macro */ + +%apply_numpy_typemaps(signed char ) +%apply_numpy_typemaps(unsigned char ) +%apply_numpy_typemaps(short ) +%apply_numpy_typemaps(unsigned short ) +%apply_numpy_typemaps(int ) +%apply_numpy_typemaps(unsigned int ) +%apply_numpy_typemaps(long ) +%apply_numpy_typemaps(unsigned long ) +%apply_numpy_typemaps(long long ) +%apply_numpy_typemaps(unsigned long long) +%apply_numpy_typemaps(float ) +%apply_numpy_typemaps(double ) + +// Include the header file to be wrapped +%include "Fortran.h" Modified: trunk/numpy/doc/swig/test/Makefile =================================================================== --- trunk/numpy/doc/swig/test/Makefile 2008-08-12 06:56:11 UTC (rev 5630) +++ trunk/numpy/doc/swig/test/Makefile 2008-08-12 18:46:31 UTC (rev 5631) @@ -1,13 +1,13 @@ # SWIG -INTERFACES = Array.i Farray.i Vector.i Matrix.i Tensor.i +INTERFACES = Array.i Farray.i Vector.i Matrix.i Tensor.i Fortran.i WRAPPERS = $(INTERFACES:.i=_wrap.cxx) PROXIES = $(INTERFACES:.i=.py ) # Default target: build the tests .PHONY : all all: $(WRAPPERS) Array1.cxx Array1.h Farray.cxx Farray.h Vector.cxx Vector.h \ - Matrix.cxx Matrix.h Tensor.cxx Tensor.h - ./setup.py build + Matrix.cxx Matrix.h Tensor.cxx Tensor.h Fortran.h Fortran.cxx + ./setup.py build_ext -i # Test target: run the tests .PHONY : test @@ -17,6 +17,7 @@ python testTensor.py python testArray.py python testFarray.py + python testFortran.py # Rule: %.i -> %_wrap.cxx %_wrap.cxx: %.i %.h ../numpy.i @@ -28,5 +29,6 @@ .PHONY : clean clean: $(RM) -r build + $(RM) *.so $(RM) $(WRAPPERS) $(RM) $(PROXIES) Modified: trunk/numpy/doc/swig/test/setup.py =================================================================== --- trunk/numpy/doc/swig/test/setup.py 2008-08-12 06:56:11 UTC (rev 5630) +++ trunk/numpy/doc/swig/test/setup.py 2008-08-12 18:46:31 UTC (rev 5631) @@ -49,10 +49,18 @@ include_dirs = [numpy_include], ) +_Fortran = Extension("_Fortran", + ["Fortran_wrap.cxx", + "Fortran.cxx"], + include_dirs = [numpy_include], + ) + # NumyTypemapTests setup setup(name = "NumpyTypemapTests", description = "Functions that work on arrays", author = "Bill Spotz", - py_modules = ["Array", "Farray", "Vector", "Matrix", "Tensor"], - ext_modules = [_Array , _Farray , _Vector , _Matrix , _Tensor ] + py_modules = ["Array", "Farray", "Vector", "Matrix", "Tensor", + "Fortran"], + ext_modules = [_Array , _Farray , _Vector , _Matrix , _Tensor, + _Fortran] ) Modified: trunk/numpy/doc/swig/test/testArray.py =================================================================== --- trunk/numpy/doc/swig/test/testArray.py 2008-08-12 06:56:11 UTC (rev 5630) +++ trunk/numpy/doc/swig/test/testArray.py 2008-08-12 18:46:31 UTC (rev 5631) @@ -14,10 +14,6 @@ else: BadListError = ValueError -# Add the distutils-generated build directory to the python search path and then -# import the extension module -libDir = "lib.%s-%s" % (get_platform(), sys.version[:3]) -sys.path.insert(0,os.path.join("build", libDir)) import Array ###################################################################### Added: trunk/numpy/doc/swig/test/testFortran.py =================================================================== --- trunk/numpy/doc/swig/test/testFortran.py 2008-08-12 06:56:11 UTC (rev 5630) +++ trunk/numpy/doc/swig/test/testFortran.py 2008-08-12 18:46:31 UTC (rev 5631) @@ -0,0 +1,169 @@ +#! /usr/bin/env python + +# System imports +from distutils.util import get_platform +import os +import sys +import unittest + +# Import NumPy +import numpy as np +major, minor = [ int(d) for d in np.__version__.split(".")[:2] ] +if major == 0: BadListError = TypeError +else: BadListError = ValueError + +import Fortran + +###################################################################### + +class FortranTestCase(unittest.TestCase): + + def __init__(self, methodName="runTests"): + unittest.TestCase.__init__(self, methodName) + self.typeStr = "double" + self.typeCode = "d" + + # Test (type* IN_FARRAY2, int DIM1, int DIM2) typemap + def testSecondElementContiguous(self): + "Test luSplit function with a Fortran-array" + print >>sys.stderr, self.typeStr, "... ", + second = Fortran.__dict__[self.typeStr + "SecondElement"] + matrix = np.arange(9).reshape(3, 3).astype(self.typeCode) + self.assertEquals(second(matrix), 3) + + def testSecondElementFortran(self): + "Test luSplit function with a Fortran-array" + print >>sys.stderr, self.typeStr, "... ", + second = Fortran.__dict__[self.typeStr + "SecondElement"] + matrix = np.asfortranarray(np.arange(9).reshape(3, 3), + self.typeCode) + self.assertEquals(second(matrix), 3) + + def testSecondElementObject(self): + "Test luSplit function with a Fortran-array" + print >>sys.stderr, self.typeStr, "... ", + second = Fortran.__dict__[self.typeStr + "SecondElement"] + matrix = np.asfortranarray([[0,1,2],[3,4,5],[6,7,8]], self.typeCode) + self.assertEquals(second(matrix), 3) + +###################################################################### + +class scharTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "schar" + self.typeCode = "b" + +###################################################################### + +class ucharTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "uchar" + self.typeCode = "B" + +###################################################################### + +class shortTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "short" + self.typeCode = "h" + +###################################################################### + +class ushortTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "ushort" + self.typeCode = "H" + +###################################################################### + +class intTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "int" + self.typeCode = "i" + +###################################################################### + +class uintTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "uint" + self.typeCode = "I" + +###################################################################### + +class longTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "long" + self.typeCode = "l" + +###################################################################### + +class ulongTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "ulong" + self.typeCode = "L" + +###################################################################### + +class longLongTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "longLong" + self.typeCode = "q" + +###################################################################### + +class ulongLongTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "ulongLong" + self.typeCode = "Q" + +###################################################################### + +class floatTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "float" + self.typeCode = "f" + +###################################################################### + +class doubleTestCase(FortranTestCase): + def __init__(self, methodName="runTest"): + FortranTestCase.__init__(self, methodName) + self.typeStr = "double" + self.typeCode = "d" + +###################################################################### + +if __name__ == "__main__": + + # Build the test suite + suite = unittest.TestSuite() + suite.addTest(unittest.makeSuite( scharTestCase)) + suite.addTest(unittest.makeSuite( ucharTestCase)) + suite.addTest(unittest.makeSuite( shortTestCase)) + suite.addTest(unittest.makeSuite( ushortTestCase)) + suite.addTest(unittest.makeSuite( intTestCase)) + suite.addTest(unittest.makeSuite( uintTestCase)) + suite.addTest(unittest.makeSuite( longTestCase)) + suite.addTest(unittest.makeSuite( ulongTestCase)) + suite.addTest(unittest.makeSuite( longLongTestCase)) + suite.addTest(unittest.makeSuite(ulongLongTestCase)) + suite.addTest(unittest.makeSuite( floatTestCase)) + suite.addTest(unittest.makeSuite( doubleTestCase)) + + # Execute the test suite + print "Testing 2D Functions of Module Matrix" + print "NumPy version", np.__version__ + print + result = unittest.TextTestRunner(verbosity=2).run(suite) + sys.exit(len(result.errors) + len(result.failures)) Modified: trunk/numpy/doc/swig/test/testMatrix.py =================================================================== --- trunk/numpy/doc/swig/test/testMatrix.py 2008-08-12 06:56:11 UTC (rev 5630) +++ trunk/numpy/doc/swig/test/testMatrix.py 2008-08-12 18:46:31 UTC (rev 5631) @@ -12,10 +12,6 @@ if major == 0: BadListError = TypeError else: BadListError = ValueError -# Add the distutils-generated build directory to the python search path and then -# import the extension module -libDir = "lib.%s-%s" % (get_platform(), sys.version[:3]) -sys.path.insert(0,os.path.join("build", libDir)) import Matrix ###################################################################### Modified: trunk/numpy/doc/swig/test/testTensor.py =================================================================== --- trunk/numpy/doc/swig/test/testTensor.py 2008-08-12 06:56:11 UTC (rev 5630) +++ trunk/numpy/doc/swig/test/testTensor.py 2008-08-12 18:46:31 UTC (rev 5631) @@ -13,10 +13,6 @@ if major == 0: BadListError = TypeError else: BadListError = ValueError -# Add the distutils-generated build directory to the python search path and then -# import the extension module -libDir = "lib.%s-%s" % (get_platform(), sys.version[:3]) -sys.path.insert(0,os.path.join("build", libDir)) import Tensor ###################################################################### Modified: trunk/numpy/doc/swig/test/testVector.py =================================================================== --- trunk/numpy/doc/swig/test/testVector.py 2008-08-12 06:56:11 UTC (rev 5630) +++ trunk/numpy/doc/swig/test/testVector.py 2008-08-12 18:46:31 UTC (rev 5631) @@ -12,10 +12,6 @@ if major == 0: BadListError = TypeError else: BadListError = ValueError -# Add the distutils-generated build directory to the python search path and then -# import the extension module -libDir = "lib.%s-%s" % (get_platform(), sys.version[:3]) -sys.path.insert(0,os.path.join("build", libDir)) import Vector ###################################################################### From numpy-svn at scipy.org Tue Aug 12 17:12:17 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 12 Aug 2008 16:12:17 -0500 (CDT) Subject: [Numpy-svn] r5632 - in trunk/numpy/ma: . tests Message-ID: <20080812211217.15CA139C05F@scipy.org> Author: pierregm Date: 2008-08-12 16:12:14 -0500 (Tue, 12 Aug 2008) New Revision: 5632 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/tests/test_core.py Log: * masked_where : force a consistency check on the shapes of the inputs Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-08-12 18:46:31 UTC (rev 5631) +++ trunk/numpy/ma/core.py 2008-08-12 21:12:14 UTC (rev 5632) @@ -884,6 +884,11 @@ """ cond = make_mask(condition) a = np.array(a, copy=copy, subok=True) + + (cshape, ashape) = (cond.shape, a.shape) + if cshape and cshape != ashape: + raise IndexError("Inconsistant shape between the condition and the input"\ + " (got %s and %s)" % (cshape, ashape)) if hasattr(a, '_mask'): cond = mask_or(cond, a._mask) cls = type(a) Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-08-12 18:46:31 UTC (rev 5631) +++ trunk/numpy/ma/tests/test_core.py 2008-08-12 21:12:14 UTC (rev 5632) @@ -1969,7 +1969,18 @@ ctest = masked_where(btest,atest) assert_equal(atest,ctest) + def test_masked_where_shape_constraint(self): + a = arange(10) + try: + test = masked_equal(1, a) + except IndexError: + pass + else: + raise AssertionError("Should have failed...") + test = masked_equal(a,1) + assert(test.mask, [0,1,0,0,0,0,0,0,0,0]) + def test_masked_otherfunctions(self): assert_equal(masked_inside(range(5), 1, 3), [0, 199, 199, 199, 4]) assert_equal(masked_outside(range(5), 1, 3),[199,1,2,3,199]) From numpy-svn at scipy.org Tue Aug 12 18:01:42 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 12 Aug 2008 17:01:42 -0500 (CDT) Subject: [Numpy-svn] r5633 - trunk/numpy/random/mtrand Message-ID: <20080812220142.C9A9939C05F@scipy.org> Author: rkern Date: 2008-08-12 17:01:42 -0500 (Tue, 12 Aug 2008) New Revision: 5633 Modified: trunk/numpy/random/mtrand/distributions.c Log: BUG: F distributions need the appropriate scale factor. Modified: trunk/numpy/random/mtrand/distributions.c =================================================================== --- trunk/numpy/random/mtrand/distributions.c 2008-08-12 21:12:14 UTC (rev 5632) +++ trunk/numpy/random/mtrand/distributions.c 2008-08-12 22:01:42 UTC (rev 5633) @@ -225,7 +225,8 @@ double rk_f(rk_state *state, double dfnum, double dfden) { - return rk_chisquare(state, dfnum) / rk_chisquare(state, dfden); + return ((rk_chisquare(state, dfnum) * dfden) / + (rk_chisquare(state, dfden) * dfnum)); } double rk_noncentral_f(rk_state *state, double dfnum, double dfden, double nonc) From numpy-svn at scipy.org Tue Aug 12 18:02:39 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 12 Aug 2008 17:02:39 -0500 (CDT) Subject: [Numpy-svn] r5634 - branches/1.1.x/numpy/random/mtrand Message-ID: <20080812220239.0097E39C05F@scipy.org> Author: rkern Date: 2008-08-12 17:02:39 -0500 (Tue, 12 Aug 2008) New Revision: 5634 Modified: branches/1.1.x/numpy/random/mtrand/distributions.c Log: BUG: F distributions need the appropriate scale factor. Modified: branches/1.1.x/numpy/random/mtrand/distributions.c =================================================================== --- branches/1.1.x/numpy/random/mtrand/distributions.c 2008-08-12 22:01:42 UTC (rev 5633) +++ branches/1.1.x/numpy/random/mtrand/distributions.c 2008-08-12 22:02:39 UTC (rev 5634) @@ -225,7 +225,8 @@ double rk_f(rk_state *state, double dfnum, double dfden) { - return rk_chisquare(state, dfnum) / rk_chisquare(state, dfden); + return ((rk_chisquare(state, dfnum) * dfden) / + (rk_chisquare(state, dfden) * dfnum)); } double rk_noncentral_f(rk_state *state, double dfnum, double dfden, double nonc) From numpy-svn at scipy.org Tue Aug 12 20:04:09 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 12 Aug 2008 19:04:09 -0500 (CDT) Subject: [Numpy-svn] r5635 - in trunk: . numpy/lib numpy/lib/tests Message-ID: <20080813000409.35AEC39C021@scipy.org> Author: stefan Date: 2008-08-12 19:04:08 -0500 (Tue, 12 Aug 2008) New Revision: 5635 Added: trunk/numpy/lib/arrayterator.py trunk/numpy/lib/tests/test_arrayterator.py Modified: trunk/THANKS.txt trunk/numpy/lib/__init__.py Log: Add Roberto de Almeida's Arrayterator. Modified: trunk/THANKS.txt =================================================================== --- trunk/THANKS.txt 2008-08-12 22:02:39 UTC (rev 5634) +++ trunk/THANKS.txt 2008-08-13 00:04:08 UTC (rev 5635) @@ -1,38 +1,39 @@ Travis Oliphant for the majority of code adaptation -Jim Hugunin, Paul Dubois, Konrad Hinsen, David Ascher, and many others for +Jim Hugunin, Paul Dubois, Konrad Hinsen, David Ascher, and many others for Numeric on which the code is based. Perry Greenfield, J Todd Miller, Rick White, Paul Barrett for Numarray which gave much inspiration and showed the way forward. Paul Dubois for original Masked Arrays Pearu Peterson for f2py and numpy.distutils and help with code organization -Robert Kern for mtrand, bug fixes, help with distutils, code organization, - and much more. +Robert Kern for mtrand, bug fixes, help with distutils, code organization, + and much more. Eric Jones for sundry subroutines Fernando Perez for code snippets, ideas, bugfixes, and testing. Ed Schofield for matrix.py patches, bugfixes, testing, and docstrings. Robert Cimrman for array set operations and numpy.distutils help John Hunter for code snippets (from matplotlib) Chris Hanley for help with records.py, testing, and bug fixes. -Travis Vaught, Joe Cooper, Jeff Strunk for administration of - numpy.org web site and SVN +Travis Vaught, Joe Cooper, Jeff Strunk for administration of + numpy.org web site and SVN Eric Firing for bugfixes. Arnd Baecker for 64-bit testing David Cooke for many code improvements including the auto-generated C-API, and optimizations. -Alexander Belopolsky (Sasha) for Masked array bug-fixes and tests, +Alexander Belopolsky (Sasha) for Masked array bug-fixes and tests, rank-0 array improvements, scalar math help and other code additions -Francesc Altet for unicode and nested record tests - and much help with rooting out nested record array bugs. -Tim Hochberg for getting the build working on MSVC, optimization +Francesc Altet for unicode and nested record tests + and much help with rooting out nested record array bugs. +Tim Hochberg for getting the build working on MSVC, optimization improvements, and code review -Charles Harris for the sorting code originally written for Numarray and +Charles Harris for the sorting code originally written for Numarray and for improvements to polyfit, many bug fixes, and documentation strings. -A.M. Archibald for no-copy-reshape code. -David Huard for histogram improvements including 2-d and d-d code and - other bug-fixes. -Albert Strasheim for documentation, bug-fixes, regression tests and +A.M. Archibald for no-copy-reshape code. +David Huard for histogram improvements including 2-d and d-d code and + other bug-fixes. +Albert Strasheim for documentation, bug-fixes, regression tests and Valgrind expertise. Stefan van der Walt for documentation, bug-fixes and regression-tests. -Andrew Straw for help with http://www.scipy.org, documentation, and testing. +Andrew Straw for help with http://www.scipy.org, documentation, and testing. David Cournapeau for scons build support, doc-and-bug fixes, and code contributions including fast_clipping. Pierre Gerard-Marchant for his rewrite of the masked array functionality. +Roberto de Almeida for the buffered array iterator. Modified: trunk/numpy/lib/__init__.py =================================================================== --- trunk/numpy/lib/__init__.py 2008-08-12 22:02:39 UTC (rev 5634) +++ trunk/numpy/lib/__init__.py 2008-08-13 00:04:08 UTC (rev 5635) @@ -19,6 +19,7 @@ from io import * from financial import * import math +from arrayterator import * __all__ = ['emath','math'] __all__ += type_check.__all__ Added: trunk/numpy/lib/arrayterator.py =================================================================== --- trunk/numpy/lib/arrayterator.py 2008-08-12 22:02:39 UTC (rev 5634) +++ trunk/numpy/lib/arrayterator.py 2008-08-13 00:04:08 UTC (rev 5635) @@ -0,0 +1,146 @@ +""" +A buffered iterator for big arrays. + +This module solves the problem of iterating over a big file-based array +without having to read it into memory. The ``Arrayterator`` class wraps +an array object, and when iterated it will return subarrays with at most +``buf_size`` elements. + +The algorithm works by first finding a "running dimension", along which +the blocks will be extracted. Given an array of dimensions (d1, d2, ..., +dn), eg, if ``buf_size`` is smaller than ``d1`` the first dimension will +be used. If, on the other hand, + + d1 < buf_size < d1*d2 + +the second dimension will be used, and so on. Blocks are extracted along +this dimension, and when the last block is returned the process continues +from the next dimension, until all elements have been read. + +""" + +from __future__ import division + +from operator import mul + +__all__ = ['Arrayterator'] + +class Arrayterator(object): + """ + Buffered iterator for big arrays. + + This class creates a buffered iterator for reading big arrays in small + contiguous blocks. The class is useful for objects stored in the + filesystem. It allows iteration over the object *without* reading + everything in memory; instead, small blocks are read and iterated over. + + The class can be used with any object that supports multidimensional + slices, like variables from Scientific.IO.NetCDF, pynetcdf and ndarrays. + + """ + + def __init__(self, var, buf_size=None): + self.var = var + self.buf_size = buf_size + + self.start = [0 for dim in var.shape] + self.stop = [dim for dim in var.shape] + self.step = [1 for dim in var.shape] + + def __getattr__(self, attr): + return getattr(self.var, attr) + + def __getitem__(self, index): + """ + Return a new arrayterator. + + """ + # Fix index, handling ellipsis and incomplete slices. + if not isinstance(index, tuple): index = (index,) + fixed = [] + length, dims = len(index), len(self.shape) + for slice_ in index: + if slice_ is Ellipsis: + fixed.extend([slice(None)] * (dims-length+1)) + length = len(fixed) + elif isinstance(slice_, (int, long)): + fixed.append(slice(slice_, slice_+1, 1)) + else: + fixed.append(slice_) + index = tuple(fixed) + if len(index) < dims: + index += (slice(None),) * (dims-len(index)) + + # Return a new arrayterator object. + out = self.__class__(self.var, self.buf_size) + for i, (start, stop, step, slice_) in enumerate( + zip(self.start, self.stop, self.step, index)): + out.start[i] = start + (slice_.start or 0) + out.step[i] = step * (slice_.step or 1) + out.stop[i] = start + (slice_.stop or stop-start) + out.stop[i] = min(stop, out.stop[i]) + return out + + def __array__(self): + """ + Return corresponding data. + + """ + slice_ = tuple(slice(*t) for t in zip( + self.start, self.stop, self.step)) + return self.var[slice_] + + @property + def flat(self): + for block in self: + for value in block.flat: + yield value + + @property + def shape(self): + return tuple(((stop-start-1)//step+1) for start, stop, step in + zip(self.start, self.stop, self.step)) + + def __iter__(self): + # Skip arrays with degenerate dimensions + if [dim for dim in self.shape if dim <= 0]: raise StopIteration + + start = self.start[:] + stop = self.stop[:] + step = self.step[:] + ndims = len(self.var.shape) + + while 1: + count = self.buf_size or reduce(mul, self.shape) + + # iterate over each dimension, looking for the + # running dimension (ie, the dimension along which + # the blocks will be built from) + rundim = 0 + for i in range(ndims-1, -1, -1): + # if count is zero we ran out of elements to read + # along higher dimensions, so we read only a single position + if count == 0: + stop[i] = start[i]+1 + elif count <= self.shape[i]: # limit along this dimension + stop[i] = start[i] + count*step[i] + rundim = i + else: + stop[i] = self.stop[i] # read everything along this + # dimension + stop[i] = min(self.stop[i], stop[i]) + count = count//self.shape[i] + + # yield a block + slice_ = tuple(slice(*t) for t in zip(start, stop, step)) + yield self.var[slice_] + + # Update start position, taking care of overflow to + # other dimensions + start[rundim] = stop[rundim] # start where we stopped + for i in range(ndims-1, 0, -1): + if start[i] >= self.stop[i]: + start[i] = self.start[i] + start[i-1] += self.step[i-1] + if start[0] >= self.stop[0]: + raise StopIteration Added: trunk/numpy/lib/tests/test_arrayterator.py =================================================================== --- trunk/numpy/lib/tests/test_arrayterator.py 2008-08-12 22:02:39 UTC (rev 5634) +++ trunk/numpy/lib/tests/test_arrayterator.py 2008-08-13 00:04:08 UTC (rev 5635) @@ -0,0 +1,43 @@ +from operator import mul + +import numpy as np +from numpy.random import randint +from numpy.lib import Arrayterator + +def test(): + np.random.seed(np.arange(10)) + + # Create a random array + ndims = randint(5)+1 + shape = tuple(randint(10)+1 for dim in range(ndims)) + els = reduce(mul, shape) + a = np.arange(els) + a.shape = shape + + buf_size = randint(2*els) + b = Arrayterator(a, buf_size) + + # Check that each block has at most ``buf_size`` elements + for block in b: + assert len(block.flat) <= (buf_size or els) + + # Check that all elements are iterated correctly + assert list(b.flat) == list(a.flat) + + # Slice arrayterator + start = [randint(dim) for dim in shape] + stop = [randint(dim)+1 for dim in shape] + step = [randint(dim)+1 for dim in shape] + slice_ = tuple(slice(*t) for t in zip(start, stop, step)) + c = b[slice_] + d = a[slice_] + + # Check that each block has at most ``buf_size`` elements + for block in c: + assert len(block.flat) <= (buf_size or els) + + # Check that the arrayterator is sliced correctly + assert np.all(c.__array__() == d) + + # Check that all elements are iterated correctly + assert list(c.flat) == list(d.flat) From numpy-svn at scipy.org Wed Aug 13 02:16:22 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Aug 2008 01:16:22 -0500 (CDT) Subject: [Numpy-svn] r5636 - tags Message-ID: <20080813061622.BEDB739C09F@scipy.org> Author: jarrod.millman Date: 2008-08-13 01:16:19 -0500 (Wed, 13 Aug 2008) New Revision: 5636 Added: tags/1.2.0b1/ Log: tagging 1.2.0 beta 1 Copied: tags/1.2.0b1 (from rev 5635, trunk) From numpy-svn at scipy.org Wed Aug 13 02:17:49 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Aug 2008 01:17:49 -0500 (CDT) Subject: [Numpy-svn] r5637 - tags/1.2.0b1/numpy Message-ID: <20080813061749.7858039C09F@scipy.org> Author: jarrod.millman Date: 2008-08-13 01:17:47 -0500 (Wed, 13 Aug 2008) New Revision: 5637 Modified: tags/1.2.0b1/numpy/version.py Log: updating version info Modified: tags/1.2.0b1/numpy/version.py =================================================================== --- tags/1.2.0b1/numpy/version.py 2008-08-13 06:16:19 UTC (rev 5636) +++ tags/1.2.0b1/numpy/version.py 2008-08-13 06:17:47 UTC (rev 5637) @@ -1,5 +1,5 @@ -version='1.2.0' -release=False +version='1.2.0b1' +release=True if not release: version += '.dev' From numpy-svn at scipy.org Wed Aug 13 12:44:41 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Aug 2008 11:44:41 -0500 (CDT) Subject: [Numpy-svn] r5638 - trunk/numpy/lib/tests Message-ID: <20080813164441.9995739C15C@scipy.org> Author: cdavid Date: 2008-08-13 11:44:35 -0500 (Wed, 13 Aug 2008) New Revision: 5638 Modified: trunk/numpy/lib/tests/test_format.py Log: Disable memmap test on windows because it crashes the testsuite. This has to be fixed before a rc of numpy 1.2.0, though (see#827). Modified: trunk/numpy/lib/tests/test_format.py =================================================================== --- trunk/numpy/lib/tests/test_format.py 2008-08-13 06:17:47 UTC (rev 5637) +++ trunk/numpy/lib/tests/test_format.py 2008-08-13 16:44:35 UTC (rev 5638) @@ -274,6 +274,7 @@ ''' +import sys from cStringIO import StringIO import os import shutil @@ -419,40 +420,42 @@ yield assert_array_equal, arr, arr2 def test_memmap_roundtrip(): - for arr in basic_arrays + record_arrays: - if arr.dtype.hasobject: - # Skip these since they can't be mmap'ed. - continue - # Write it out normally and through mmap. - nfn = os.path.join(tempdir, 'normal.npy') - mfn = os.path.join(tempdir, 'memmap.npy') - fp = open(nfn, 'wb') - try: - format.write_array(fp, arr) - finally: + # XXX: test crashes nose on windows. Fix this + if not sys.platform == 'win32': + for arr in basic_arrays + record_arrays: + if arr.dtype.hasobject: + # Skip these since they can't be mmap'ed. + continue + # Write it out normally and through mmap. + nfn = os.path.join(tempdir, 'normal.npy') + mfn = os.path.join(tempdir, 'memmap.npy') + fp = open(nfn, 'wb') + try: + format.write_array(fp, arr) + finally: + fp.close() + + fortran_order = (arr.flags.f_contiguous and not arr.flags.c_contiguous) + ma = format.open_memmap(mfn, mode='w+', dtype=arr.dtype, + shape=arr.shape, fortran_order=fortran_order) + ma[...] = arr + del ma + + # Check that both of these files' contents are the same. + fp = open(nfn, 'rb') + normal_bytes = fp.read() fp.close() + fp = open(mfn, 'rb') + memmap_bytes = fp.read() + fp.close() + yield assert_equal, normal_bytes, memmap_bytes + + # Check that reading the file using memmap works. + ma = format.open_memmap(nfn, mode='r') + #yield assert_array_equal, ma, arr + #del ma - fortran_order = (arr.flags.f_contiguous and not arr.flags.c_contiguous) - ma = format.open_memmap(mfn, mode='w+', dtype=arr.dtype, - shape=arr.shape, fortran_order=fortran_order) - ma[...] = arr - del ma - # Check that both of these files' contents are the same. - fp = open(nfn, 'rb') - normal_bytes = fp.read() - fp.close() - fp = open(mfn, 'rb') - memmap_bytes = fp.read() - fp.close() - yield assert_equal, normal_bytes, memmap_bytes - - # Check that reading the file using memmap works. - ma = format.open_memmap(nfn, mode='r') - yield assert_array_equal, ma, arr - del ma - - def test_write_version_1_0(): f = StringIO() arr = np.arange(1) From numpy-svn at scipy.org Wed Aug 13 13:23:25 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Aug 2008 12:23:25 -0500 (CDT) Subject: [Numpy-svn] r5639 - in trunk/numpy/lib: . tests Message-ID: <20080813172325.CBD2839C09F@scipy.org> Author: stefan Date: 2008-08-13 12:23:25 -0500 (Wed, 13 Aug 2008) New Revision: 5639 Modified: trunk/numpy/lib/arraysetops.py trunk/numpy/lib/tests/test_arraysetops.py Log: Unique1d will now return unique as well as reverse indices. Fix order of returns [patch by Robert Cimrman]. Modified: trunk/numpy/lib/arraysetops.py =================================================================== --- trunk/numpy/lib/arraysetops.py 2008-08-13 16:44:35 UTC (rev 5638) +++ trunk/numpy/lib/arraysetops.py 2008-08-13 17:23:25 UTC (rev 5639) @@ -74,7 +74,7 @@ return ed -def unique1d(ar1, return_index=False): +def unique1d(ar1, return_index=False, return_inverse=False): """ Find the unique elements of an array. @@ -85,6 +85,9 @@ return_index : bool, optional If True, also return the indices against `ar1` that result in the unique array. + return_inverse : bool, optional + If True, also return the indices against the unique array that + result in `ar1`. Returns ------- @@ -93,6 +96,9 @@ unique_indices : ndarray, optional The indices of the unique values. Only provided if `return_index` is True. + unique_inverse : ndarray, optional + The indices to reconstruct the original array. Only provided if + `return_inverse` is True. See Also -------- @@ -107,21 +113,52 @@ >>> np.unique1d(a) array([1, 2, 3]) + Reconstruct the input from unique values: + + >>> np.unique1d([1,2,6,4,2,3,2], return_index=True) + >>> x = [1,2,6,4,2,3,2] + >>> u, i = np.unique1d(x, return_inverse=True) + >>> u + array([1, 2, 3, 4, 6]) + >>> i + array([0, 1, 4, 3, 1, 2, 1]) + >>> [u[p] for p in i] + [1, 2, 6, 4, 2, 3, 2] + """ + if return_index: + import warnings + warnings.warn("The order of the output arguments for " + "`return_index` has changed. Before, " + "the output was (indices, unique_arr), but " + "has now been reversed to be more consistent.") + ar = np.asarray(ar1).flatten() if ar.size == 0: - if return_index: return np.empty(0, np.bool), ar - else: return ar + 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) + else: + return ar - if return_index: + if return_inverse or return_index: perm = ar.argsort() aux = ar[perm] - flag = np.concatenate( ([True], aux[1:] != aux[:-1]) ) - return perm[flag], aux[flag] + flag = np.concatenate(([True], aux[1:] != aux[:-1])) + 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]) ) + flag = np.concatenate(([True], ar[1:] != ar[:-1])) return ar[flag] def intersect1d(ar1, ar2): Modified: trunk/numpy/lib/tests/test_arraysetops.py =================================================================== --- trunk/numpy/lib/tests/test_arraysetops.py 2008-08-13 16:44:35 UTC (rev 5638) +++ trunk/numpy/lib/tests/test_arraysetops.py 2008-08-13 17:23:25 UTC (rev 5639) @@ -6,6 +6,8 @@ import numpy as np from numpy.lib.arraysetops import * +import warnings + class TestAso(TestCase): def test_unique1d( self ): a = np.array( [5, 7, 1, 2, 1, 5, 7] ) @@ -14,12 +16,14 @@ c = unique1d( a ) assert_array_equal( c, ec ) - d, c = unique1d( a, True ) + warnings.simplefilter('ignore', Warning) + unique, indices = unique1d( a, return_index=True ) + warnings.resetwarnings() + ed = np.array( [2, 3, 0, 1] ) + assert_array_equal(unique, ec) + assert_array_equal(indices, ed) - assert_array_equal( d,ed ) - assert_array_equal( c, ec ) - assert_array_equal([], unique1d([])) def test_intersect1d( self ): From numpy-svn at scipy.org Wed Aug 13 15:33:59 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Aug 2008 14:33:59 -0500 (CDT) Subject: [Numpy-svn] r5640 - tags Message-ID: <20080813193359.DD8B439C09F@scipy.org> Author: chris.burns Date: 2008-08-13 14:33:52 -0500 (Wed, 13 Aug 2008) New Revision: 5640 Added: tags/1.2.0b2/ Log: Create 1.2.0b2 tag. Copied: tags/1.2.0b2 (from rev 5639, trunk) From numpy-svn at scipy.org Wed Aug 13 15:39:23 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Aug 2008 14:39:23 -0500 (CDT) Subject: [Numpy-svn] r5641 - tags/1.2.0b2/numpy Message-ID: <20080813193923.23FD439C15A@scipy.org> Author: chris.burns Date: 2008-08-13 14:39:13 -0500 (Wed, 13 Aug 2008) New Revision: 5641 Modified: tags/1.2.0b2/numpy/version.py Log: Update version number for 1.2.0b2 Modified: tags/1.2.0b2/numpy/version.py =================================================================== --- tags/1.2.0b2/numpy/version.py 2008-08-13 19:33:52 UTC (rev 5640) +++ tags/1.2.0b2/numpy/version.py 2008-08-13 19:39:13 UTC (rev 5641) @@ -1,5 +1,5 @@ -version='1.2.0' -release=False +version='1.2.0b2' +release=True if not release: version += '.dev' From numpy-svn at scipy.org Wed Aug 13 15:55:11 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Aug 2008 14:55:11 -0500 (CDT) Subject: [Numpy-svn] r5642 - trunk/tools/win32build Message-ID: <20080813195511.7D4C439C089@scipy.org> Author: cdavid Date: 2008-08-13 14:55:09 -0500 (Wed, 13 Aug 2008) New Revision: 5642 Modified: trunk/tools/win32build/build.py Log: Fix typo in build script for win32. Modified: trunk/tools/win32build/build.py =================================================================== --- trunk/tools/win32build/build.py 2008-08-13 19:39:13 UTC (rev 5641) +++ trunk/tools/win32build/build.py 2008-08-13 19:55:09 UTC (rev 5642) @@ -13,7 +13,7 @@ from os.path import join as pjoin, split as psplit, dirname PYEXECS = {"2.5" : "C:\python25\python.exe", - "2.4" : "C:\python24\python2.4.exe", + "2.4" : "C:\python24\python24.exe", "2.3" : "C:\python23\python23.exe"} _SSE3_CFG = r"""[atlas] From numpy-svn at scipy.org Wed Aug 13 15:59:21 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Aug 2008 14:59:21 -0500 (CDT) Subject: [Numpy-svn] r5643 - trunk/numpy/distutils/command Message-ID: <20080813195921.F099D39C089@scipy.org> Author: cdavid Date: 2008-08-13 14:59:21 -0500 (Wed, 13 Aug 2008) New Revision: 5643 Modified: trunk/numpy/distutils/command/scons.py Log: Do not special-case for mingw32: compiler detection takes care of that now. Modified: trunk/numpy/distutils/command/scons.py =================================================================== --- trunk/numpy/distutils/command/scons.py 2008-08-13 19:55:09 UTC (rev 5642) +++ trunk/numpy/distutils/command/scons.py 2008-08-13 19:59:21 UTC (rev 5643) @@ -96,8 +96,6 @@ return 'msvc' elif compiler_type == 'intel': return 'intelc' - elif compiler_type == 'mingw32': - return 'mingw' else: return compiler.compiler[0] From numpy-svn at scipy.org Wed Aug 13 16:51:08 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Aug 2008 15:51:08 -0500 (CDT) Subject: [Numpy-svn] r5644 - trunk/numpy/core/tests Message-ID: <20080813205108.724CA39C15A@scipy.org> Author: ptvirtan Date: 2008-08-13 15:51:02 -0500 (Wed, 13 Aug 2008) New Revision: 5644 Modified: trunk/numpy/core/tests/test_umath.py Log: Remove C99 test cases; they are not guaranteed to succeed on all plaftorms, so it's better to reintroduce them only after the inf/nan handling has been addressed. Modified: trunk/numpy/core/tests/test_umath.py =================================================================== --- trunk/numpy/core/tests/test_umath.py 2008-08-13 19:59:21 UTC (rev 5643) +++ trunk/numpy/core/tests/test_umath.py 2008-08-13 20:51:02 UTC (rev 5644) @@ -267,144 +267,6 @@ assert abs(a - b) < atol, "%s %s: %s; cmath: %s"%(fname,p,a,b) -class TestC99(object): - """Check special functions at special points against the C99 standard""" - # NB: inherits from object instead of TestCase since using test generators - - # - # Non-conforming results are with XXX added to the exception field. - # - - def test_clog(self): - for p, v, e in [ - ((-0., 0.), (-inf, pi), 'divide'), - ((+0., 0.), (-inf, 0.), 'XXX divide'), # fails on OSX? - ((1., inf), (inf, pi/2), ''), - ((1., nan), (nan, nan), 'invalid-optional'), - ((-inf, 1.), (inf, pi), ''), - ((inf, 1.), (inf, 0.), ''), - ((-inf, inf), (inf, 3*pi/4), ''), - ((inf, inf), (inf, pi/4), ''), - ((inf, nan), (inf, nan), ''), - ((-inf, nan), (inf, nan), ''), - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, inf), (inf, nan), ''), - ((+nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on some platfs - ]: - yield self._check, np.log, p, v, e - - def test_csqrt(self): - for p, v, e in [ - ((-0., 0.), (0.,0.), 'XXX'), # now (-0., 0.) - ((0., 0.), (0.,0.), ''), - ((1., inf), (inf,inf), 'XXX invalid'), # now (inf, nan) - ((nan, inf), (inf,inf), 'XXX'), # now (nan, nan) - ((-inf, 1.), (0.,inf), 'XXX'), # (-0., inf) on Mac OSX - ((inf, 1.), (inf,0.), ''), - ((-inf,nan), (nan, -inf), 'XXX'), # could also be +inf. raises 'invalid' on Sparc64 - ((inf, nan), (inf, nan), ''), - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on Sparc64 - ]: - yield self._check, np.sqrt, p, v, e - - def test_cacos(self): - for p, v, e in [ - ((0., 0.), (pi/2, -0.), 'XXX'), # now (-0., 0.) - ((-0., 0.), (pi/2, -0.), ''), - ((0., nan), (pi/2, nan), 'XXX'), # now (nan, nan) - ((-0., nan), (pi/2, nan), 'XXX'), # now (nan, nan) - ((1., inf), (pi/2, -inf), 'XXX'), # now (nan, -inf) - ((1., nan), (nan, nan), 'invalid-optional'), - ((-inf, 1.), (pi, -inf), 'XXX'), # now (nan, -inf) - ((inf, 1.), (0., -inf), 'XXX'), # now (nan, -inf) - ((-inf, inf), (3*pi/4, -inf), 'XXX'), # now (nan, nan) - ((inf, inf), (pi/4, -inf), 'XXX'), # now (nan, nan) - ((inf, nan), (nan, +-inf), 'XXX'), # now (nan, nan) - ((-inf, nan), (nan, +-inf), 'XXX'), # now: (nan, nan) - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, inf), (nan, -inf), 'XXX'), # now: (nan, nan) - ((nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on Sparc64 - ]: - yield self._check, np.arccos, p, v, e - - def test_cacosh(self): - for p, v, e in [ - ((0., 0), (0, pi/2), ''), - ((-0., 0), (0, pi/2), ''), - ((1., inf), (inf, pi/2), 'XXX'), # now: (nan, nan) - ((1., nan), (nan, nan), 'invalid-optional'), - ((-inf, 1.), (inf, pi), 'XXX'), # now: (inf, nan) - ((inf, 1.), (inf, 0.), 'XXX'), # now: (inf, nan) - ((-inf, inf), (inf, 3*pi/4), 'XXX'), # now: (nan, nan) - ((inf, inf), (inf, pi/4), 'XXX'), # now: (nan, nan) - ((inf, nan), (inf, nan), 'XXX'), # now: (nan, nan) - ((-inf, nan), (inf, nan), 'XXX'), # now: (nan, nan) - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, inf), (inf, nan), 'XXX'), # now: (nan, nan) - ((nan, nan), (nan, nan), 'XXX') # raises 'invalid' on Sparc64 - ]: - yield self._check, np.arccosh, p, v, e - - def test_casinh(self): - for p, v, e in [ - ((0., 0), (0, 0), ''), - ((1., inf), (inf, pi/2), 'XXX'), # now: (inf, nan) - ((1., nan), (nan, nan), 'invalid-optional'), - ((inf, 1.), (inf, 0.), 'XXX'), # now: (inf, nan) - ((inf, inf), (inf, pi/4), 'XXX'), # now: (nan, nan) - ((inf, nan), (nan, nan), 'XXX'), # now: (nan, nan) - ((nan, 0.), (nan, 0.), 'XXX'), # now: (nan, nan) - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, inf), (+-inf, nan), 'XXX'), # now: (nan, nan) - ((nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on Sparc64 - ]: - yield self._check, np.arcsinh, p, v, e - - def test_catanh(self): - for p, v, e in [ - ((0., 0), (0, 0), ''), - ((0., nan), (0., nan), 'XXX'), # now: (nan, nan) - ((1., 0.), (inf, 0.), 'XXX divide'), # now: (nan, nan) - ((1., inf), (inf, 0.), 'XXX'), # now: (nan, nan) - ((1., nan), (nan, nan), 'invalid-optional'), - ((inf, 1.), (0., pi/2), 'XXX'), # now: (nan, nan) - ((inf, inf), (0, pi/2), 'XXX'), # now: (nan, nan) - ((inf, nan), (0, nan), 'XXX'), # now: (nan, nan) - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, inf), (+0, pi/2), 'XXX'), # now: (nan, nan) - ((nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on some platfs - ]: - yield self._check, np.arctanh, p, v, e - - def _check(self, func, point, value, exc=''): - if 'XXX' in exc: - raise nose.SkipTest - if isinstance(point, tuple): point = complex(*point) - if isinstance(value, tuple): value = complex(*value) - v = dict(divide='ignore', invalid='ignore', - over='ignore', under='ignore') - old_err = np.seterr(**v) - try: - # check sign of zero, nan, etc. - got = complex(func(point)) - got = "(%s, %s)" % (repr(got.real), repr(got.imag)) - expected = "(%s, %s)" % (repr(value.real), repr(value.imag)) - assert got == expected, (got, expected) - - # check exceptions - if exc in ('divide', 'invalid', 'over', 'under'): - v[exc] = 'raise' - np.seterr(**v) - assert_raises(FloatingPointError, func, point) - else: - for k in v.keys(): v[k] = 'raise' - if exc == 'invalid-optional': v['invalid'] = 'ignore' - np.seterr(**v) - func(point) - finally: - np.seterr(**old_err) - class TestAttributes(TestCase): def test_attributes(self): add = ncu.add From numpy-svn at scipy.org Wed Aug 13 18:24:51 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 13 Aug 2008 17:24:51 -0500 (CDT) Subject: [Numpy-svn] r5645 - tags/1.2.0b2/numpy/core/tests Message-ID: <20080813222451.C397139C018@scipy.org> Author: stefan Date: 2008-08-13 17:24:50 -0500 (Wed, 13 Aug 2008) New Revision: 5645 Modified: tags/1.2.0b2/numpy/core/tests/test_umath.py Log: Remove C99 test cases (merged from trunk). Modified: tags/1.2.0b2/numpy/core/tests/test_umath.py =================================================================== --- tags/1.2.0b2/numpy/core/tests/test_umath.py 2008-08-13 20:51:02 UTC (rev 5644) +++ tags/1.2.0b2/numpy/core/tests/test_umath.py 2008-08-13 22:24:50 UTC (rev 5645) @@ -267,144 +267,6 @@ assert abs(a - b) < atol, "%s %s: %s; cmath: %s"%(fname,p,a,b) -class TestC99(object): - """Check special functions at special points against the C99 standard""" - # NB: inherits from object instead of TestCase since using test generators - - # - # Non-conforming results are with XXX added to the exception field. - # - - def test_clog(self): - for p, v, e in [ - ((-0., 0.), (-inf, pi), 'divide'), - ((+0., 0.), (-inf, 0.), 'XXX divide'), # fails on OSX? - ((1., inf), (inf, pi/2), ''), - ((1., nan), (nan, nan), 'invalid-optional'), - ((-inf, 1.), (inf, pi), ''), - ((inf, 1.), (inf, 0.), ''), - ((-inf, inf), (inf, 3*pi/4), ''), - ((inf, inf), (inf, pi/4), ''), - ((inf, nan), (inf, nan), ''), - ((-inf, nan), (inf, nan), ''), - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, inf), (inf, nan), ''), - ((+nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on some platfs - ]: - yield self._check, np.log, p, v, e - - def test_csqrt(self): - for p, v, e in [ - ((-0., 0.), (0.,0.), 'XXX'), # now (-0., 0.) - ((0., 0.), (0.,0.), ''), - ((1., inf), (inf,inf), 'XXX invalid'), # now (inf, nan) - ((nan, inf), (inf,inf), 'XXX'), # now (nan, nan) - ((-inf, 1.), (0.,inf), 'XXX'), # (-0., inf) on Mac OSX - ((inf, 1.), (inf,0.), ''), - ((-inf,nan), (nan, -inf), 'XXX'), # could also be +inf. raises 'invalid' on Sparc64 - ((inf, nan), (inf, nan), ''), - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on Sparc64 - ]: - yield self._check, np.sqrt, p, v, e - - def test_cacos(self): - for p, v, e in [ - ((0., 0.), (pi/2, -0.), 'XXX'), # now (-0., 0.) - ((-0., 0.), (pi/2, -0.), ''), - ((0., nan), (pi/2, nan), 'XXX'), # now (nan, nan) - ((-0., nan), (pi/2, nan), 'XXX'), # now (nan, nan) - ((1., inf), (pi/2, -inf), 'XXX'), # now (nan, -inf) - ((1., nan), (nan, nan), 'invalid-optional'), - ((-inf, 1.), (pi, -inf), 'XXX'), # now (nan, -inf) - ((inf, 1.), (0., -inf), 'XXX'), # now (nan, -inf) - ((-inf, inf), (3*pi/4, -inf), 'XXX'), # now (nan, nan) - ((inf, inf), (pi/4, -inf), 'XXX'), # now (nan, nan) - ((inf, nan), (nan, +-inf), 'XXX'), # now (nan, nan) - ((-inf, nan), (nan, +-inf), 'XXX'), # now: (nan, nan) - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, inf), (nan, -inf), 'XXX'), # now: (nan, nan) - ((nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on Sparc64 - ]: - yield self._check, np.arccos, p, v, e - - def test_cacosh(self): - for p, v, e in [ - ((0., 0), (0, pi/2), ''), - ((-0., 0), (0, pi/2), ''), - ((1., inf), (inf, pi/2), 'XXX'), # now: (nan, nan) - ((1., nan), (nan, nan), 'invalid-optional'), - ((-inf, 1.), (inf, pi), 'XXX'), # now: (inf, nan) - ((inf, 1.), (inf, 0.), 'XXX'), # now: (inf, nan) - ((-inf, inf), (inf, 3*pi/4), 'XXX'), # now: (nan, nan) - ((inf, inf), (inf, pi/4), 'XXX'), # now: (nan, nan) - ((inf, nan), (inf, nan), 'XXX'), # now: (nan, nan) - ((-inf, nan), (inf, nan), 'XXX'), # now: (nan, nan) - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, inf), (inf, nan), 'XXX'), # now: (nan, nan) - ((nan, nan), (nan, nan), 'XXX') # raises 'invalid' on Sparc64 - ]: - yield self._check, np.arccosh, p, v, e - - def test_casinh(self): - for p, v, e in [ - ((0., 0), (0, 0), ''), - ((1., inf), (inf, pi/2), 'XXX'), # now: (inf, nan) - ((1., nan), (nan, nan), 'invalid-optional'), - ((inf, 1.), (inf, 0.), 'XXX'), # now: (inf, nan) - ((inf, inf), (inf, pi/4), 'XXX'), # now: (nan, nan) - ((inf, nan), (nan, nan), 'XXX'), # now: (nan, nan) - ((nan, 0.), (nan, 0.), 'XXX'), # now: (nan, nan) - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, inf), (+-inf, nan), 'XXX'), # now: (nan, nan) - ((nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on Sparc64 - ]: - yield self._check, np.arcsinh, p, v, e - - def test_catanh(self): - for p, v, e in [ - ((0., 0), (0, 0), ''), - ((0., nan), (0., nan), 'XXX'), # now: (nan, nan) - ((1., 0.), (inf, 0.), 'XXX divide'), # now: (nan, nan) - ((1., inf), (inf, 0.), 'XXX'), # now: (nan, nan) - ((1., nan), (nan, nan), 'invalid-optional'), - ((inf, 1.), (0., pi/2), 'XXX'), # now: (nan, nan) - ((inf, inf), (0, pi/2), 'XXX'), # now: (nan, nan) - ((inf, nan), (0, nan), 'XXX'), # now: (nan, nan) - ((nan, 1.), (nan, nan), 'invalid-optional'), - ((nan, inf), (+0, pi/2), 'XXX'), # now: (nan, nan) - ((nan, nan), (nan, nan), 'XXX'), # raises 'invalid' on some platfs - ]: - yield self._check, np.arctanh, p, v, e - - def _check(self, func, point, value, exc=''): - if 'XXX' in exc: - raise nose.SkipTest - if isinstance(point, tuple): point = complex(*point) - if isinstance(value, tuple): value = complex(*value) - v = dict(divide='ignore', invalid='ignore', - over='ignore', under='ignore') - old_err = np.seterr(**v) - try: - # check sign of zero, nan, etc. - got = complex(func(point)) - got = "(%s, %s)" % (repr(got.real), repr(got.imag)) - expected = "(%s, %s)" % (repr(value.real), repr(value.imag)) - assert got == expected, (got, expected) - - # check exceptions - if exc in ('divide', 'invalid', 'over', 'under'): - v[exc] = 'raise' - np.seterr(**v) - assert_raises(FloatingPointError, func, point) - else: - for k in v.keys(): v[k] = 'raise' - if exc == 'invalid-optional': v['invalid'] = 'ignore' - np.seterr(**v) - func(point) - finally: - np.seterr(**old_err) - class TestAttributes(TestCase): def test_attributes(self): add = ncu.add From numpy-svn at scipy.org Thu Aug 14 01:22:24 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Aug 2008 00:22:24 -0500 (CDT) Subject: [Numpy-svn] r5646 - trunk/tools/osxbuild Message-ID: <20080814052224.35C2E39C09F@scipy.org> Author: chris.burns Date: 2008-08-14 00:22:21 -0500 (Thu, 14 Aug 2008) New Revision: 5646 Added: trunk/tools/osxbuild/install_and_test.py Modified: trunk/tools/osxbuild/README.txt Log: Add install_and_test script for osxbuild. Update README. Modified: trunk/tools/osxbuild/README.txt =================================================================== --- trunk/tools/osxbuild/README.txt 2008-08-13 22:24:50 UTC (rev 5645) +++ trunk/tools/osxbuild/README.txt 2008-08-14 05:22:21 UTC (rev 5646) @@ -1,6 +1,32 @@ -This directory contains the script to build a universal binary for +================================== + Building an OSX binary for numpy +================================== + +This directory contains the scripts to build a universal binary for OSX. The binaries work on OSX 10.4 and 10.5. - - bdist_mpkg v0.4.3 is required +The docstring in build.py may contain more current details. -See the docstring in build.py for more details. +Requirements +============ + +* bdist_mpkg v0.4.3 + +Build +===== + +The build script will build a numpy distribution using bdist_mpkg and +create the mac package (mpkg) bundled in a disk image (dmg). To run +the build script:: + + python build.py + +Install and test +---------------- + +The *install_and_test.py* script will find the numpy*.mpkg, install it +using the Mac installer and then run the numpy test suite. To run the +install and test:: + + python install_and_test.py + Added: trunk/tools/osxbuild/install_and_test.py =================================================================== --- trunk/tools/osxbuild/install_and_test.py 2008-08-13 22:24:50 UTC (rev 5645) +++ trunk/tools/osxbuild/install_and_test.py 2008-08-14 05:22:21 UTC (rev 5646) @@ -0,0 +1,49 @@ +#!/usr/bin/env python +"""Install the built package and run the tests.""" + +import os + +# FIXME: Should handle relative import better! +#from .build import DIST_DIR +from build import SRC_DIR, DIST_DIR, shellcmd + +clrgreen = '\033[0;32m' +clrnull = '\033[0m' +# print '\033[0;32m foobar \033[0m' +def color_print(msg): + """Add color to this print output.""" + clrmsg = clrgreen + msg + clrnull + print clrmsg + +distdir = os.path.join(SRC_DIR, DIST_DIR) + +# Find the package and build abspath to it +pkg = None +filelist = os.listdir(distdir) +for fn in filelist: + if fn.endswith('mpkg'): + pkg = fn + break +if pkg is None: + raise IOError, 'Package is not found in directory %s' % distdir + +pkgpath = os.path.abspath(os.path.join(SRC_DIR, DIST_DIR, pkg)) +color_print('Installing package: %s' % pkgpath) + +# Run the installer +print +color_print('Installer requires admin rights, you will be prompted for sudo') +print +cmd = 'sudo installer -verbose -package %s -target /' % pkgpath +#color_print(cmd) +shellcmd(cmd) + +# Null out the PYTHONPATH so we're sure to test the Installed version of numpy +os.environ['PYTHONPATH'] = '0' + +print +color_print('Install successful!') +color_print('Running numpy test suite!') +print +import numpy +numpy.test() From numpy-svn at scipy.org Thu Aug 14 13:24:38 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Aug 2008 12:24:38 -0500 (CDT) Subject: [Numpy-svn] r5647 - in trunk/numpy/core: code_generators include/numpy src Message-ID: <20080814172438.4EC1B39C036@scipy.org> Author: stefan Date: 2008-08-14 12:24:32 -0500 (Thu, 14 Aug 2008) New Revision: 5647 Modified: trunk/numpy/core/code_generators/ufunc_api_order.txt trunk/numpy/core/include/numpy/ufuncobject.h trunk/numpy/core/src/ufuncobject.c Log: Framework for generalised ufuncs [patch by Wenjie Fu and Hans-Andreas Engel]. Modified: trunk/numpy/core/code_generators/ufunc_api_order.txt =================================================================== --- trunk/numpy/core/code_generators/ufunc_api_order.txt 2008-08-14 05:22:21 UTC (rev 5646) +++ trunk/numpy/core/code_generators/ufunc_api_order.txt 2008-08-14 17:24:32 UTC (rev 5647) @@ -1,4 +1,5 @@ PyUFunc_FromFuncAndData +PyUFunc_FromFuncAndDataAndSignature PyUFunc_RegisterLoopForType PyUFunc_GenericFunction PyUFunc_f_f_As_d_d Modified: trunk/numpy/core/include/numpy/ufuncobject.h =================================================================== --- trunk/numpy/core/include/numpy/ufuncobject.h 2008-08-14 05:22:21 UTC (rev 5646) +++ trunk/numpy/core/include/numpy/ufuncobject.h 2008-08-14 17:24:32 UTC (rev 5647) @@ -19,6 +19,20 @@ void *ptr; PyObject *obj; PyObject *userloops; + + /* generalized ufunc */ + int core_enabled; /* 0 for scalar ufunc; 1 for generalized ufunc */ + int core_num_dim_ix; /* number of distinct dimension names in + signature */ + + /* dimension indices of input/output argument k are stored in + core_dim_ixs[core_offsets[k]..core_offsets[k]+core_num_dims[k]-1] */ + int *core_num_dims; /* numbers of core dimensions of each argument */ + int *core_dim_ixs; /* dimension indices in a flatted form; indices + are in the range of [0,core_num_dim_ix) */ + int *core_offsets; /* positions of 1st core dimensions of each + argument in core_dim_ixs */ + char *core_signature; /* signature string for printing purpose */ } PyUFuncObject; #include "arrayobject.h" @@ -122,6 +136,11 @@ int notimplemented; /* The loop caused notimplemented */ int objfunc; /* This loop calls object functions (an inner-loop function with argument types */ + + /* generalized ufunc */ + npy_intp *core_dim_sizes; /* stores sizes of core dimensions; + contains 1 + core_num_dim_ix elements */ + npy_intp *core_strides; /* strides of loop and core dimensions */ } PyUFuncLoopObject; /* Could make this more clever someday */ Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2008-08-14 05:22:21 UTC (rev 5646) +++ trunk/numpy/core/src/ufuncobject.c 2008-08-14 17:24:32 UTC (rev 5647) @@ -795,6 +795,7 @@ #define NOBUFFER_REDUCELOOP 2 #define BUFFER_UFUNCLOOP 3 #define BUFFER_REDUCELOOP 3 +#define SIGNATURE_NOBUFFER_UFUNCLOOP 4 static char @@ -1259,7 +1260,7 @@ } /* Create copies for any arrays that are less than loop->bufsize - in total size and are mis-behaved or in need + in total size (or core_enabled) and are mis-behaved or in need of casting. */ @@ -1287,7 +1288,7 @@ } Py_DECREF(atype); } - if (size < loop->bufsize) { + if (size < loop->bufsize || loop->ufunc->core_enabled) { if (!(PyArray_ISBEHAVED_RO(mps[i])) || \ PyArray_TYPE(mps[i]) != arg_types[i]) { ntype = PyArray_DescrFromType(arg_types[i]); @@ -1328,6 +1329,275 @@ #undef _GETATTR_ + +/* Return the position of next non-white-space char in the string +*/ +inline int +_next_non_white_space(const char* str, int offset) +{ + int ret = offset; + while (str[ret] == ' ' || str[ret] == '\t') ret++; + return ret; +} + +inline int +_is_alpha_underscore(char ch) +{ + return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || ch == '_'; +} + +inline int +_is_alnum_underscore(char ch) +{ + return _is_alpha_underscore(ch) || (ch >= '0' && ch <= '9'); +} + +/* Return the ending position of a variable name +*/ +inline int +_get_end_of_name(const char* str, int offset) +{ + int ret = offset; + while (_is_alnum_underscore(str[ret])) ret++; + return ret; +} + +/* Returns 1 if the dimension names pointed by s1 and s2 are the same, + otherwise returns 0. +*/ +inline int +_is_same_name(const char* s1, const char* s2) +{ + while (_is_alnum_underscore(*s1) && _is_alnum_underscore(*s2)) { + if (*s1 != *s2) return 0; + s1++; + s2++; + } + return !_is_alnum_underscore(*s1) && !_is_alnum_underscore(*s2); +} + +/* Sets core_num_dim_ix, core_num_dims, core_dim_ixs, core_offsets, + and core_signature in PyUFuncObject "self". Returns 0 unless an + error occured. +*/ +static int +_parse_signature(PyUFuncObject *self, const char *signature) +{ + if (signature == NULL) { + PyErr_SetString(PyExc_RuntimeError, + "_parse_signature with NULL signature"); + return -1; + } + + int len = strlen(signature); + self->core_signature = _pya_malloc(sizeof(char) * (len+1)); + if (self->core_signature) + strcpy(self->core_signature, signature); + + /* Allocate sufficient memory to store pointers to all dimension names */ + char const **var_names = _pya_malloc(sizeof(char const*) * len); + if (var_names == NULL) { + PyErr_NoMemory(); + return -1; + } + + self->core_enabled = 1; + self->core_num_dim_ix = 0; + self->core_num_dims = _pya_malloc(sizeof(int) * self->nargs); + self->core_dim_ixs = _pya_malloc(sizeof(int) * len); /* shrink this later */ + self->core_offsets = _pya_malloc(sizeof(int) * self->nargs); + if (self->core_num_dims == NULL || self->core_dim_ixs == NULL || + self->core_offsets == NULL) { + PyErr_NoMemory(); + goto fail; + } + + int nd = 0; /* number of dimension of the current argument */ + int cur_arg = 0; /* index into core_num_dims&core_offsets */ + int cur_core_dim = 0; /* index into core_dim_ixs */ + int i = _next_non_white_space(signature, 0); + char *parse_error = NULL; + + while (signature[i] != '\0') { /* loop over input/output arguments */ + if (cur_arg == self->nin) { + /* expect "->" */ + if (signature[i] != '-' || signature[i+1] != '>') { + parse_error = "expect '->'"; + goto fail; + } + i = _next_non_white_space(signature, i+2); + } + + /* parse core dimensions of one argument, e.g. "()", "(i)", or + "(i,j)" */ + if (signature[i] != '(') { + parse_error = "expect '('"; + goto fail; + } + i = _next_non_white_space(signature, i+1); + while (signature[i] != ')') { /* loop over core dimensions */ + if (!_is_alpha_underscore(signature[i])) { + parse_error = "expect dimension name"; + goto fail; + } + int j = 0; + while (j < self->core_num_dim_ix) { + if (_is_same_name(signature+i, var_names[j])) break; + j++; + } + if (j >= self->core_num_dim_ix) { + var_names[j] = signature+i; + self->core_num_dim_ix++; + } + self->core_dim_ixs[cur_core_dim] = j; + cur_core_dim++; + nd++; + i = _get_end_of_name(signature, i); + i = _next_non_white_space(signature, i); + if (signature[i] != ',' && signature[i] != ')') { + parse_error = "expect ',' or ')'"; + goto fail; + } + if (signature[i] == ',') + { + i = _next_non_white_space(signature, i+1); + if (signature[i] == ')') { + parse_error = "',' must not be followed by ')'"; + goto fail; + } + } + } + self->core_num_dims[cur_arg] = nd; + self->core_offsets[cur_arg] = cur_core_dim-nd; + cur_arg++; + nd = 0; + i = _next_non_white_space(signature, i+1); + + if (cur_arg != self->nin && cur_arg != self->nargs) { + /* The list of input arguments (or output arguments) was + only read partially */ + if (signature[i] != ',') { + parse_error = "expect ','"; + goto fail; + } + i = _next_non_white_space(signature, i+1); + } + } + if (cur_arg != self->nargs) { + parse_error = "incomplete signature: not all arguments found"; + goto fail; + } + self->core_dim_ixs = _pya_realloc(self->core_dim_ixs, + sizeof(int) * cur_core_dim); + /* check for trivial core-signature, e.g. "(),()->()" */ + if (cur_core_dim == 0) + self->core_enabled = 0; + _pya_free(var_names); + return 0; +fail: + _pya_free(var_names); + if (parse_error) { + char *buf = _pya_malloc(sizeof(char) * (len + 200)); + if (buf) { + sprintf(buf, "%s at position %d in \"%s\"", + parse_error, i, signature); + PyErr_SetString(PyExc_ValueError, signature); + _pya_free(buf); + } + else { + PyErr_NoMemory(); + } + } + return -1; +} + +/* Concatenate the loop and core dimensions of + PyArrayMultiIterObject's iarg-th argument, to recover a full + dimension array (used for output arguments). +*/ +static npy_intp* +_compute_output_dims(PyUFuncLoopObject *loop, int iarg, + int *out_nd, npy_intp *tmp_dims) +{ + PyUFuncObject *ufunc = loop->ufunc; + if (ufunc->core_enabled == 0) { + /* case of ufunc with trivial core-signature */ + *out_nd = loop->nd; + return loop->dimensions; + } + + *out_nd = loop->nd + ufunc->core_num_dims[iarg]; + if (*out_nd > NPY_MAXARGS) { + PyErr_SetString(PyExc_ValueError, + "dimension of output variable exceeds limit"); + return NULL; + } + + /* copy loop dimensions */ + memcpy(tmp_dims, loop->dimensions, sizeof(npy_intp) * loop->nd); + + /* copy core dimension */ + int i; + for (i = 0; i < ufunc->core_num_dims[iarg]; i++) + tmp_dims[loop->nd + i] = loop->core_dim_sizes[1 + + ufunc->core_dim_ixs[ufunc->core_offsets[iarg]+i]]; + return tmp_dims; +} + +/* Check and set core_dim_sizes and core_strides for the i-th argument. +*/ +static int +_compute_dimension_size(PyUFuncLoopObject *loop, PyArrayObject **mps, int i) +{ + PyUFuncObject *ufunc = loop->ufunc; + int j = ufunc->core_offsets[i]; + int k = PyArray_NDIM(mps[i]) - ufunc->core_num_dims[i]; + int ind; + for (ind = 0; ind < ufunc->core_num_dims[i]; ind++, j++, k++) { + npy_intp dim = k<0 ? 1 : PyArray_DIM(mps[i], k); + /* First element of core_dim_sizes will be used for looping */ + int dim_ix = ufunc->core_dim_ixs[j] + 1; + if (loop->core_dim_sizes[dim_ix] == 1) { + /* broadcast core dimension */ + loop->core_dim_sizes[dim_ix] = dim; + } + else if (dim != 1 && dim != loop->core_dim_sizes[dim_ix]) { + PyErr_SetString(PyExc_ValueError, + "core dimensions mismatch"); + return -1; + } + /* First ufunc->nargs elements will be used for looping */ + loop->core_strides[ufunc->nargs + j] = + dim == 1 ? 0 : PyArray_STRIDE(mps[i], k); + } + return 0; +} + +/* Return a view of array "ap" with "core_nd" dimensions cut from tail. */ +static PyArrayObject * +_trunc_coredim(PyArrayObject *ap, int core_nd) +{ + int nd = ap->nd - core_nd; + if (nd < 0) nd = 0; + + /* The following code is basically taken from PyArray_Transpose */ + Py_INCREF(ap->descr); /* NewFromDescr will steal this reference */ + PyArrayObject *ret = (PyArrayObject *) + PyArray_NewFromDescr(ap->ob_type, ap->descr, + nd, ap->dimensions, + ap->strides, ap->data, ap->flags, + (PyObject *)ap); + if (ret == NULL) return NULL; + + /* point at true owner of memory: */ + ret->base = (PyObject *)ap; + Py_INCREF(ap); + + PyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN); + + return ret; +} + static Py_ssize_t construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps, PyObject *typetup) @@ -1448,6 +1718,22 @@ return -1; } + /* Only use loop dimensions when constructing Iterator: + * temporarily replace mps[i] (will be recovered below). + */ + if (self->core_enabled) { + for (i = 0; i < self->nin; i++) { + if (_compute_dimension_size(loop, mps, i) < 0) + return -1; + + PyArrayObject *ao; + ao = _trunc_coredim(mps[i], self->core_num_dims[i]); + if (ao == NULL) + return -1; + mps[i] = ao; + } + } + /* Create Iterators for the Inputs */ for(i = 0; i < self->nin; i++) { loop->iters[i] = (PyArrayIterObject *) \ @@ -1457,12 +1743,26 @@ } } + + /* Recover mps[i]. */ + if (self->core_enabled) { + for (i = 0; i < self->nin; i++) { + PyArrayObject *ao = mps[i]; + mps[i] = (PyArrayObject *)mps[i]->base; + Py_DECREF(ao); + } + } + /* Broadcast the result */ loop->numiter = self->nin; if (PyArray_Broadcast((PyArrayMultiIterObject *)loop) < 0) { return -1; } + npy_intp temp_dims[NPY_MAXDIMS]; + npy_intp *out_dims; + int out_nd; + /* Get any return arguments */ for(i = self->nin; i < nargs; i++) { mps[i] = (PyArrayObject *)PyTuple_GET_ITEM(args, i); @@ -1488,9 +1788,18 @@ return -1; } } - if (mps[i]->nd != loop->nd || + + + if (self->core_enabled) { + if (_compute_dimension_size(loop, mps, i) < 0) + return -1; + } + out_dims = _compute_output_dims(loop, i, &out_nd, temp_dims); + if (!out_dims) return -1; + + if (mps[i]->nd != out_nd || !PyArray_CompareLists(mps[i]->dimensions, - loop->dimensions, loop->nd)) { + out_dims, out_nd)) { PyErr_SetString(PyExc_ValueError, "invalid return array shape"); Py_DECREF(mps[i]); @@ -1511,9 +1820,12 @@ PyArray_Descr *ntype; if (mps[i] == NULL) { + out_dims = _compute_output_dims(loop, i, &out_nd, temp_dims); + if (!out_dims) return -1; + mps[i] = (PyArrayObject *)PyArray_New(subtype, - loop->nd, - loop->dimensions, + out_nd, + out_dims, arg_types[i], NULL, NULL, 0, 0, NULL); @@ -1540,7 +1852,7 @@ /* still not the same -- or will we have to use buffers?*/ if (mps[i]->descr->type_num != arg_types[i] || !PyArray_ISBEHAVED_RO(mps[i])) { - if (loop->size < loop->bufsize) { + if (loop->size < loop->bufsize || self->core_enabled) { PyObject *new; /* * Copy the array to a temporary copy @@ -1560,14 +1872,34 @@ } } + if (self->core_enabled) { + /* computer for all output arguments, and set strides in "loop" */ + if (_compute_dimension_size(loop, mps, i) < 0) + return -1; + + PyArrayObject *ao; + ao = _trunc_coredim(mps[i], self->core_num_dims[i]); + if (ao == NULL) + return -1; + /* Temporarily modify mps[i] for constructing iterator. */ + mps[i] = ao; + } + loop->iters[i] = (PyArrayIterObject *) \ PyArray_IterNew((PyObject *)mps[i]); if (loop->iters[i] == NULL) { return -1; } + + /* Recover mps[i]. */ + if (self->core_enabled) { + PyArrayObject *ao = mps[i]; + mps[i] = (PyArrayObject *)mps[i]->base; + Py_DECREF(ao); + } + } - /* * If any of different type, or misaligned or swapped * then must use buffers @@ -1582,10 +1914,19 @@ return nargs; } + if (self->core_enabled) { + loop->meth = SIGNATURE_NOBUFFER_UFUNCLOOP; + } + for(i = 0; i < self->nargs; i++) { loop->needbuffer[i] = 0; if (arg_types[i] != mps[i]->descr->type_num || !PyArray_ISBEHAVED_RO(mps[i])) { + if (self->core_enabled) { + PyErr_SetString(PyExc_RuntimeError, + "never reached; copy should have been made"); + return -1; + } loop->meth = BUFFER_UFUNCLOOP; loop->needbuffer[i] = 1; } @@ -1595,6 +1936,13 @@ } } + + if (self->core_enabled && loop->obj) { + PyErr_SetString(PyExc_TypeError, + "Object type not allowed in ufunc with signature"); + return -1; + } + if (loop->meth == NO_UFUNCLOOP) { loop->meth = ONE_UFUNCLOOP; @@ -1622,8 +1970,11 @@ loop->numiter = self->nargs; - /* Fill in steps */ - if (loop->meth != ONE_UFUNCLOOP) { + /* Fill in steps */ + if (loop->meth == SIGNATURE_NOBUFFER_UFUNCLOOP && loop->nd == 0) { + /* Use default core_strides */ + } + else if (loop->meth != ONE_UFUNCLOOP) { int ldim; intp minsum; intp maxdim; @@ -1692,6 +2043,16 @@ } /* + * Set looping part of core_dim_sizes and core_strides. + */ + if (loop->meth == SIGNATURE_NOBUFFER_UFUNCLOOP) { + loop->core_dim_sizes[0] = maxdim; + for (i = 0; i < self->nargs; i++) { + loop->core_strides[i] = loop->steps[i]; + } + } + + /* * fix up steps where we will be copying data to * buffers and calculate the ninnerloops and leftover * values -- if step size is already zero that is not changed... @@ -1707,8 +2068,8 @@ } } } - else { - /* uniformly-strided case ONE_UFUNCLOOP */ + else if (loop->meth == ONE_UFUNCLOOP) { + /* uniformly-strided case */ for(i = 0; i < self->nargs; i++) { if (PyArray_SIZE(mps[i]) == 1) loop->steps[i] = 0; @@ -1847,6 +2208,10 @@ int i; if (self->ufunc != NULL) { + if (self->core_dim_sizes) + _pya_free(self->core_dim_sizes); + if (self->core_strides) + _pya_free(self->core_strides); for(i = 0; i < self->ufunc->nargs; i++) Py_XDECREF(self->iters[i]); if (self->buffer[0]) { @@ -1887,7 +2252,24 @@ loop->errobj = NULL; loop->notimplemented = 0; loop->first = 1; + loop->core_dim_sizes = NULL; + loop->core_strides = NULL; + if (self->core_enabled) { + int num_dim_ix = 1 + self->core_num_dim_ix; + int nstrides = self->nargs + self->core_offsets[self->nargs-1] + + self->core_num_dims[self->nargs-1]; + loop->core_dim_sizes = _pya_malloc(sizeof(npy_intp) * num_dim_ix); + loop->core_strides = _pya_malloc(sizeof(npy_intp) * nstrides); + if (loop->core_dim_sizes == NULL || loop->core_strides == NULL) { + PyErr_NoMemory(); + goto fail; + } + memset(loop->core_strides, 0, sizeof(npy_intp) * nstrides); + for (i = 0; i < num_dim_ix; i++) + loop->core_dim_sizes[i] = 1; + } + name = self->name ? self->name : ""; /* @@ -2033,6 +2415,11 @@ ufuncloop_dealloc(loop); return -2; } + if (self->core_enabled && loop->meth != SIGNATURE_NOBUFFER_UFUNCLOOP) { + PyErr_SetString(PyExc_RuntimeError, + "illegal loop method for ufunc with signature"); + goto fail; + } NPY_LOOP_BEGIN_THREADS; switch(loop->meth) { @@ -2055,7 +2442,8 @@ * right type but not contiguous. -- Almost as fast. */ /*fprintf(stderr, "NOBUFFER...%d\n", loop->size);*/ - while (loop->index < loop->size) { + + while (loop->index < loop->size) { for(i = 0; i < self->nargs; i++) { loop->bufptr[i] = loop->iters[i]->dataptr; } @@ -2071,6 +2459,23 @@ } break; + case SIGNATURE_NOBUFFER_UFUNCLOOP: + while (loop->index < loop->size) { + for(i = 0; i < self->nargs; i++) { + loop->bufptr[i] = loop->iters[i]->dataptr; + } + loop->function((char **)loop->bufptr, loop->core_dim_sizes, + loop->core_strides, loop->funcdata); + UFUNC_CHECK_ERROR(loop); + + /* Adjust loop pointers */ + for(i = 0; i < self->nargs; i++) { + PyArray_ITER_NEXT(loop->iters[i]); + } + loop->index++; + } + break; + case BUFFER_UFUNCLOOP: { PyArray_CopySwapNFunc *copyswapn[NPY_MAXARGS]; PyArrayIterObject **iters=loop->iters; @@ -2397,6 +2802,12 @@ /* Reduce type is the type requested of the input during reduction */ + if (self->core_enabled) { + PyErr_Format(PyExc_RuntimeError, + "construct_reduce not allowed on ufunc with signature"); + return NULL; + } + nd = (*arr)->nd; arg_types[0] = otype; arg_types[1] = otype; @@ -3099,6 +3510,12 @@ PyUFunc_GenericReduction(PyUFuncObject *self, PyObject *args, PyObject *kwds, int operation) { + if (self->core_enabled) { + PyErr_Format(PyExc_RuntimeError, + "Reduction not defined on ufunc with signature"); + return NULL; + } + int axis=0; PyArrayObject *mp, *ret = NULL; PyObject *op, *res=NULL; @@ -3628,6 +4045,14 @@ self->ntypes = 1; self->check_return = 0; + + /* generalized ufunc */ + self->core_enabled = 0; + self->core_num_dim_ix = 0; + self->core_num_dims = NULL; + self->core_dim_ixs = NULL; + self->core_offsets = NULL; + self->core_signature = NULL; pyname = PyObject_GetAttrString(function, "__name__"); if (pyname) @@ -3722,6 +4147,18 @@ int nin, int nout, int identity, char *name, char *doc, int check_return) { + return PyUFunc_FromFuncAndDataAndSignature(func, data, types, ntypes, + nin, nout, identity, name, doc, check_return, NULL); +} + +/*UFUNC_API*/ +static PyObject * +PyUFunc_FromFuncAndDataAndSignature(PyUFuncGenericFunction *func, void **data, + char *types, int ntypes, + int nin, int nout, int identity, + char *name, char *doc, + int check_return, const char *signature) +{ PyUFuncObject *self; self = _pya_malloc(sizeof(PyUFuncObject)); @@ -3747,6 +4184,18 @@ if (doc == NULL) self->doc = "NULL"; else self->doc = doc; + + /* generalized ufunc */ + self->core_enabled = 0; + self->core_num_dim_ix = 0; + self->core_num_dims = NULL; + self->core_dim_ixs = NULL; + self->core_offsets = NULL; + self->core_signature = NULL; + if (signature != NULL) { + if (_parse_signature(self, signature) != 0) + return NULL; + } return (PyObject *)self; } @@ -3912,6 +4361,10 @@ static void ufunc_dealloc(PyUFuncObject *self) { + if (self->core_num_dims) _pya_free(self->core_num_dims); + if (self->core_dim_ixs) _pya_free(self->core_dim_ixs); + if (self->core_offsets) _pya_free(self->core_offsets); + if (self->core_signature) _pya_free(self->core_signature); if (self->ptr) _pya_free(self->ptr); Py_XDECREF(self->userloops); Py_XDECREF(self->obj); @@ -3940,6 +4393,13 @@ static PyObject * ufunc_outer(PyUFuncObject *self, PyObject *args, PyObject *kwds) { + if (self->core_enabled) { + PyErr_Format(PyExc_TypeError, + "method outer is not allowed in ufunc with non-trivial"\ + " signature"); + return NULL; + } + int i; PyObject *ret; PyArrayObject *ap1=NULL, *ap2=NULL, *ap_new=NULL; @@ -4173,6 +4633,13 @@ return Py_None; } +static PyObject * +ufunc_get_signature(PyUFuncObject *self) +{ + if (!self->core_enabled) + Py_RETURN_NONE; + return PyString_FromString(self->core_signature); +} #undef _typecharfromnum @@ -4188,6 +4655,7 @@ {"types", (getter)ufunc_get_types, NULL, "return a list with types grouped input->output"}, {"__name__", (getter)ufunc_get_name, NULL, "function name"}, {"identity", (getter)ufunc_get_identity, NULL, "identity value"}, + {"signature",(getter)ufunc_get_signature,NULL, "signature"}, {NULL, NULL, NULL, NULL}, /* Sentinel */ }; From numpy-svn at scipy.org Thu Aug 14 16:17:21 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Aug 2008 15:17:21 -0500 (CDT) Subject: [Numpy-svn] r5648 - trunk/numpy/core/include/numpy Message-ID: <20080814201721.902BF39C15C@scipy.org> Author: stefan Date: 2008-08-14 15:17:21 -0500 (Thu, 14 Aug 2008) New Revision: 5648 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h Log: Bump NPY_VERSION for ufunc patch. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-14 17:24:32 UTC (rev 5647) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-14 20:17:21 UTC (rev 5648) @@ -39,7 +39,7 @@ #define NPY_SUCCEED 1 /* Helpful to distinguish what is installed */ -#define NPY_VERSION 0x0100000A +#define NPY_VERSION 0x0100000B /* Some platforms don't define bool, long long, or long double. Handle that here. From numpy-svn at scipy.org Thu Aug 14 16:25:50 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Aug 2008 15:25:50 -0500 (CDT) Subject: [Numpy-svn] r5649 - trunk/numpy/distutils/command Message-ID: <20080814202550.E2C2839C089@scipy.org> Author: cdavid Date: 2008-08-14 15:25:50 -0500 (Thu, 14 Aug 2008) New Revision: 5649 Modified: trunk/numpy/distutils/command/scons.py Log: Do not setup any compiler in scons command if noscons scripts are used. Modified: trunk/numpy/distutils/command/scons.py =================================================================== --- trunk/numpy/distutils/command/scons.py 2008-08-14 20:17:21 UTC (rev 5648) +++ trunk/numpy/distutils/command/scons.py 2008-08-14 20:25:50 UTC (rev 5649) @@ -287,63 +287,68 @@ self.post_hooks = [] self.pkg_names = [] - # Try to get the same compiler than the ones used by distutils: this is - # non trivial because distutils and scons have totally different - # conventions on this one (distutils uses PATH from user's environment, - # whereas scons uses standard locations). The way we do it is once we - # got the c compiler used, we use numpy.distutils function to get the - # full path, and add the path to the env['PATH'] variable in env - # instance (this is done in numpy.distutils.scons module). + # To avoid trouble, just don't do anything if no sconscripts are used. + # This is useful when for example f2py uses numpy.distutils, because + # f2py does not pass compiler information to scons command, and the + # compilation setup below can crash in some situation. + if len(self.sconscripts) > 0: + # Try to get the same compiler than the ones used by distutils: this is + # non trivial because distutils and scons have totally different + # conventions on this one (distutils uses PATH from user's environment, + # whereas scons uses standard locations). The way we do it is once we + # got the c compiler used, we use numpy.distutils function to get the + # full path, and add the path to the env['PATH'] variable in env + # instance (this is done in numpy.distutils.scons module). - # XXX: The logic to bypass distutils is ... not so logic. - compiler_type = self.compiler - if compiler_type == 'msvc': - self._bypass_distutils_cc = True - from numpy.distutils.ccompiler import new_compiler - try: - distutils_compiler = new_compiler(compiler=compiler_type, - verbose=self.verbose, - dry_run=self.dry_run, - force=self.force) - distutils_compiler.customize(self.distribution) - # This initialization seems necessary, sometimes, for find_executable to work... - if hasattr(distutils_compiler, 'initialize'): - distutils_compiler.initialize() - self.scons_compiler = dist2sconscc(distutils_compiler) - self.scons_compiler_path = protect_path(get_tool_path(distutils_compiler)) - except DistutilsPlatformError, e: - if not self._bypass_distutils_cc: - raise e - else: - self.scons_compiler = compiler_type + # XXX: The logic to bypass distutils is ... not so logic. + compiler_type = self.compiler + if compiler_type == 'msvc': + self._bypass_distutils_cc = True + from numpy.distutils.ccompiler import new_compiler + try: + distutils_compiler = new_compiler(compiler=compiler_type, + verbose=self.verbose, + dry_run=self.dry_run, + force=self.force) + distutils_compiler.customize(self.distribution) + # This initialization seems necessary, sometimes, for find_executable to work... + if hasattr(distutils_compiler, 'initialize'): + distutils_compiler.initialize() + self.scons_compiler = dist2sconscc(distutils_compiler) + self.scons_compiler_path = protect_path(get_tool_path(distutils_compiler)) + except DistutilsPlatformError, e: + if not self._bypass_distutils_cc: + raise e + else: + self.scons_compiler = compiler_type - # We do the same for the fortran compiler ... - fcompiler_type = self.fcompiler - from numpy.distutils.fcompiler import new_fcompiler - self.fcompiler = new_fcompiler(compiler = fcompiler_type, + # We do the same for the fortran compiler ... + fcompiler_type = self.fcompiler + from numpy.distutils.fcompiler import new_fcompiler + self.fcompiler = new_fcompiler(compiler = fcompiler_type, + verbose = self.verbose, + dry_run = self.dry_run, + force = self.force) + if self.fcompiler is not None: + self.fcompiler.customize(self.distribution) + + # And the C++ compiler + cxxcompiler = new_compiler(compiler = compiler_type, verbose = self.verbose, dry_run = self.dry_run, force = self.force) - if self.fcompiler is not None: - self.fcompiler.customize(self.distribution) + if cxxcompiler is not None: + cxxcompiler.customize(self.distribution, need_cxx = 1) + cxxcompiler.customize_cmd(self) + self.cxxcompiler = cxxcompiler.cxx_compiler() + try: + get_cxx_tool_path(self.cxxcompiler) + except DistutilsSetupError: + self.cxxcompiler = None - # And the C++ compiler - cxxcompiler = new_compiler(compiler = compiler_type, - verbose = self.verbose, - dry_run = self.dry_run, - force = self.force) - if cxxcompiler is not None: - cxxcompiler.customize(self.distribution, need_cxx = 1) - cxxcompiler.customize_cmd(self) - self.cxxcompiler = cxxcompiler.cxx_compiler() - try: - get_cxx_tool_path(self.cxxcompiler) - except DistutilsSetupError: - self.cxxcompiler = None + if self.package_list: + self.package_list = parse_package_list(self.package_list) - if self.package_list: - self.package_list = parse_package_list(self.package_list) - def run(self): if len(self.sconscripts) > 0: try: From numpy-svn at scipy.org Thu Aug 14 16:27:28 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Aug 2008 15:27:28 -0500 (CDT) Subject: [Numpy-svn] r5650 - branches/1.1.x/numpy/distutils/command Message-ID: <20080814202728.0DBF539C089@scipy.org> Author: cdavid Date: 2008-08-14 15:27:28 -0500 (Thu, 14 Aug 2008) New Revision: 5650 Modified: branches/1.1.x/numpy/distutils/command/scons.py Log: Backport scons command fix. Modified: branches/1.1.x/numpy/distutils/command/scons.py =================================================================== --- branches/1.1.x/numpy/distutils/command/scons.py 2008-08-14 20:25:50 UTC (rev 5649) +++ branches/1.1.x/numpy/distutils/command/scons.py 2008-08-14 20:27:28 UTC (rev 5650) @@ -271,63 +271,68 @@ self.post_hooks = [] self.pkg_names = [] - # Try to get the same compiler than the ones used by distutils: this is - # non trivial because distutils and scons have totally different - # conventions on this one (distutils uses PATH from user's environment, - # whereas scons uses standard locations). The way we do it is once we - # got the c compiler used, we use numpy.distutils function to get the - # full path, and add the path to the env['PATH'] variable in env - # instance (this is done in numpy.distutils.scons module). + # To avoid trouble, just don't do anything if no sconscripts are used. + # This is useful when for example f2py uses numpy.distutils, because + # f2py does not pass compiler information to scons command, and the + # compilation setup below can crash in some situation. + if len(self.sconscripts) > 0: + # Try to get the same compiler than the ones used by distutils: this is + # non trivial because distutils and scons have totally different + # conventions on this one (distutils uses PATH from user's environment, + # whereas scons uses standard locations). The way we do it is once we + # got the c compiler used, we use numpy.distutils function to get the + # full path, and add the path to the env['PATH'] variable in env + # instance (this is done in numpy.distutils.scons module). - # XXX: The logic to bypass distutils is ... not so logic. - compiler_type = self.compiler - if compiler_type == 'msvc': - self._bypass_distutils_cc = True - from numpy.distutils.ccompiler import new_compiler - try: - distutils_compiler = new_compiler(compiler=compiler_type, - verbose=self.verbose, - dry_run=self.dry_run, - force=self.force) - distutils_compiler.customize(self.distribution) - # This initialization seems necessary, sometimes, for find_executable to work... - if hasattr(distutils_compiler, 'initialize'): - distutils_compiler.initialize() - self.scons_compiler = dist2sconscc(distutils_compiler) - self.scons_compiler_path = protect_path(get_tool_path(distutils_compiler)) - except DistutilsPlatformError, e: - if not self._bypass_distutils_cc: - raise e - else: - self.scons_compiler = compiler_type + # XXX: The logic to bypass distutils is ... not so logic. + compiler_type = self.compiler + if compiler_type == 'msvc': + self._bypass_distutils_cc = True + from numpy.distutils.ccompiler import new_compiler + try: + distutils_compiler = new_compiler(compiler=compiler_type, + verbose=self.verbose, + dry_run=self.dry_run, + force=self.force) + distutils_compiler.customize(self.distribution) + # This initialization seems necessary, sometimes, for find_executable to work... + if hasattr(distutils_compiler, 'initialize'): + distutils_compiler.initialize() + self.scons_compiler = dist2sconscc(distutils_compiler) + self.scons_compiler_path = protect_path(get_tool_path(distutils_compiler)) + except DistutilsPlatformError, e: + if not self._bypass_distutils_cc: + raise e + else: + self.scons_compiler = compiler_type - # We do the same for the fortran compiler ... - fcompiler_type = self.fcompiler - from numpy.distutils.fcompiler import new_fcompiler - self.fcompiler = new_fcompiler(compiler = fcompiler_type, + # We do the same for the fortran compiler ... + fcompiler_type = self.fcompiler + from numpy.distutils.fcompiler import new_fcompiler + self.fcompiler = new_fcompiler(compiler = fcompiler_type, + verbose = self.verbose, + dry_run = self.dry_run, + force = self.force) + if self.fcompiler is not None: + self.fcompiler.customize(self.distribution) + + # And the C++ compiler + cxxcompiler = new_compiler(compiler = compiler_type, verbose = self.verbose, dry_run = self.dry_run, force = self.force) - if self.fcompiler is not None: - self.fcompiler.customize(self.distribution) + if cxxcompiler is not None: + cxxcompiler.customize(self.distribution, need_cxx = 1) + cxxcompiler.customize_cmd(self) + self.cxxcompiler = cxxcompiler.cxx_compiler() + try: + get_cxx_tool_path(self.cxxcompiler) + except DistutilsSetupError: + self.cxxcompiler = None - # And the C++ compiler - cxxcompiler = new_compiler(compiler = compiler_type, - verbose = self.verbose, - dry_run = self.dry_run, - force = self.force) - if cxxcompiler is not None: - cxxcompiler.customize(self.distribution, need_cxx = 1) - cxxcompiler.customize_cmd(self) - self.cxxcompiler = cxxcompiler.cxx_compiler() - try: - get_cxx_tool_path(self.cxxcompiler) - except DistutilsSetupError: - self.cxxcompiler = None + if self.package_list: + self.package_list = parse_package_list(self.package_list) - if self.package_list: - self.package_list = parse_package_list(self.package_list) - def run(self): if len(self.sconscripts) > 0: try: From numpy-svn at scipy.org Thu Aug 14 17:26:45 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Aug 2008 16:26:45 -0500 (CDT) Subject: [Numpy-svn] r5651 - trunk/numpy/core/src Message-ID: <20080814212645.93C9939C02D@scipy.org> Author: stefan Date: 2008-08-14 16:26:45 -0500 (Thu, 14 Aug 2008) New Revision: 5651 Modified: trunk/numpy/core/src/ufuncobject.c Log: Move declaration to appease some compilers [patch by Hans-Andreas Engel]. Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2008-08-14 20:27:28 UTC (rev 5650) +++ trunk/numpy/core/src/ufuncobject.c 2008-08-14 21:26:45 UTC (rev 5651) @@ -1332,7 +1332,7 @@ /* Return the position of next non-white-space char in the string */ -inline int +static int _next_non_white_space(const char* str, int offset) { int ret = offset; @@ -1340,13 +1340,13 @@ return ret; } -inline int +static int _is_alpha_underscore(char ch) { return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || ch == '_'; } -inline int +static int _is_alnum_underscore(char ch) { return _is_alpha_underscore(ch) || (ch >= '0' && ch <= '9'); @@ -1354,7 +1354,7 @@ /* Return the ending position of a variable name */ -inline int +static int _get_end_of_name(const char* str, int offset) { int ret = offset; @@ -1365,7 +1365,7 @@ /* Returns 1 if the dimension names pointed by s1 and s2 are the same, otherwise returns 0. */ -inline int +static int _is_same_name(const char* s1, const char* s2) { while (_is_alnum_underscore(*s1) && _is_alnum_underscore(*s2)) { @@ -1383,19 +1383,27 @@ static int _parse_signature(PyUFuncObject *self, const char *signature) { + int len; + char const **var_names; + int nd = 0; /* number of dimension of the current argument */ + int cur_arg = 0; /* index into core_num_dims&core_offsets */ + int cur_core_dim = 0; /* index into core_dim_ixs */ + int i = 0; + char *parse_error = NULL; + if (signature == NULL) { PyErr_SetString(PyExc_RuntimeError, "_parse_signature with NULL signature"); return -1; } - int len = strlen(signature); + len = strlen(signature); self->core_signature = _pya_malloc(sizeof(char) * (len+1)); if (self->core_signature) strcpy(self->core_signature, signature); /* Allocate sufficient memory to store pointers to all dimension names */ - char const **var_names = _pya_malloc(sizeof(char const*) * len); + var_names = _pya_malloc(sizeof(char const*) * len); if (var_names == NULL) { PyErr_NoMemory(); return -1; @@ -1412,11 +1420,7 @@ goto fail; } - int nd = 0; /* number of dimension of the current argument */ - int cur_arg = 0; /* index into core_num_dims&core_offsets */ - int cur_core_dim = 0; /* index into core_dim_ixs */ - int i = _next_non_white_space(signature, 0); - char *parse_error = NULL; + i = _next_non_white_space(signature, 0); while (signature[i] != '\0') { /* loop over input/output arguments */ if (cur_arg == self->nin) { @@ -1436,11 +1440,11 @@ } i = _next_non_white_space(signature, i+1); while (signature[i] != ')') { /* loop over core dimensions */ + int j = 0; if (!_is_alpha_underscore(signature[i])) { parse_error = "expect dimension name"; goto fail; } - int j = 0; while (j < self->core_num_dim_ix) { if (_is_same_name(signature+i, var_names[j])) break; j++; @@ -1519,6 +1523,7 @@ _compute_output_dims(PyUFuncLoopObject *loop, int iarg, int *out_nd, npy_intp *tmp_dims) { + int i; PyUFuncObject *ufunc = loop->ufunc; if (ufunc->core_enabled == 0) { /* case of ufunc with trivial core-signature */ @@ -1537,7 +1542,6 @@ memcpy(tmp_dims, loop->dimensions, sizeof(npy_intp) * loop->nd); /* copy core dimension */ - int i; for (i = 0; i < ufunc->core_num_dims[iarg]; i++) tmp_dims[loop->nd + i] = loop->core_dim_sizes[1 + ufunc->core_dim_ixs[ufunc->core_offsets[iarg]+i]]; @@ -1615,6 +1619,10 @@ int flexible = 0; int object = 0; + npy_intp temp_dims[NPY_MAXDIMS]; + npy_intp *out_dims; + int out_nd; + /* Check number of arguments */ nargs = PyTuple_Size(args); if ((nargs < self->nin) || (nargs > self->nargs)) { @@ -1723,10 +1731,11 @@ */ if (self->core_enabled) { for (i = 0; i < self->nin; i++) { + PyArrayObject *ao; + if (_compute_dimension_size(loop, mps, i) < 0) return -1; - PyArrayObject *ao; ao = _trunc_coredim(mps[i], self->core_num_dims[i]); if (ao == NULL) return -1; @@ -1759,10 +1768,6 @@ return -1; } - npy_intp temp_dims[NPY_MAXDIMS]; - npy_intp *out_dims; - int out_nd; - /* Get any return arguments */ for(i = self->nin; i < nargs; i++) { mps[i] = (PyArrayObject *)PyTuple_GET_ITEM(args, i); @@ -1873,11 +1878,12 @@ } if (self->core_enabled) { + PyArrayObject *ao; + /* computer for all output arguments, and set strides in "loop" */ if (_compute_dimension_size(loop, mps, i) < 0) return -1; - PyArrayObject *ao; ao = _trunc_coredim(mps[i], self->core_num_dims[i]); if (ao == NULL) return -1; @@ -3510,12 +3516,6 @@ PyUFunc_GenericReduction(PyUFuncObject *self, PyObject *args, PyObject *kwds, int operation) { - if (self->core_enabled) { - PyErr_Format(PyExc_RuntimeError, - "Reduction not defined on ufunc with signature"); - return NULL; - } - int axis=0; PyArrayObject *mp, *ret = NULL; PyObject *op, *res=NULL; @@ -3532,6 +3532,12 @@ return NULL; } + if (self->core_enabled) { + PyErr_Format(PyExc_RuntimeError, + "Reduction not defined on ufunc with signature"); + return NULL; + } + if (self->nin != 2) { PyErr_Format(PyExc_ValueError, "%s only supported for binary functions", @@ -4393,6 +4399,12 @@ static PyObject * ufunc_outer(PyUFuncObject *self, PyObject *args, PyObject *kwds) { + int i; + PyObject *ret; + PyArrayObject *ap1=NULL, *ap2=NULL, *ap_new=NULL; + PyObject *new_args, *tmp; + PyObject *shape1, *shape2, *newshape; + if (self->core_enabled) { PyErr_Format(PyExc_TypeError, "method outer is not allowed in ufunc with non-trivial"\ @@ -4400,12 +4412,6 @@ return NULL; } - int i; - PyObject *ret; - PyArrayObject *ap1=NULL, *ap2=NULL, *ap_new=NULL; - PyObject *new_args, *tmp; - PyObject *shape1, *shape2, *newshape; - if(self->nin != 2) { PyErr_SetString(PyExc_ValueError, "outer product only supported "\ From numpy-svn at scipy.org Thu Aug 14 17:28:02 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Aug 2008 16:28:02 -0500 (CDT) Subject: [Numpy-svn] r5652 - trunk Message-ID: <20080814212802.3B50439C02D@scipy.org> Author: stefan Date: 2008-08-14 16:28:01 -0500 (Thu, 14 Aug 2008) New Revision: 5652 Modified: trunk/THANKS.txt Log: Give credit for the generalised ufunc infrastructure. Modified: trunk/THANKS.txt =================================================================== --- trunk/THANKS.txt 2008-08-14 21:26:45 UTC (rev 5651) +++ trunk/THANKS.txt 2008-08-14 21:28:01 UTC (rev 5652) @@ -37,3 +37,4 @@ David Cournapeau for scons build support, doc-and-bug fixes, and code contributions including fast_clipping. Pierre Gerard-Marchant for his rewrite of the masked array functionality. Roberto de Almeida for the buffered array iterator. +Wenjie Fu and Hans-Andreas Engel for the generalised ufunc infrastructure. From numpy-svn at scipy.org Thu Aug 14 17:58:14 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Aug 2008 16:58:14 -0500 (CDT) Subject: [Numpy-svn] r5653 - trunk/numpy/core/src Message-ID: <20080814215814.20A9E39C02D@scipy.org> Author: stefan Date: 2008-08-14 16:58:13 -0500 (Thu, 14 Aug 2008) New Revision: 5653 Modified: trunk/numpy/core/src/ufuncobject.c Log: Whitespace cleanup. Move definition of variable to beginning of function. Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2008-08-14 21:28:01 UTC (rev 5652) +++ trunk/numpy/core/src/ufuncobject.c 2008-08-14 21:58:13 UTC (rev 5653) @@ -1408,7 +1408,7 @@ PyErr_NoMemory(); return -1; } - + self->core_enabled = 1; self->core_num_dim_ix = 0; self->core_num_dims = _pya_malloc(sizeof(int) * self->nargs); @@ -1581,12 +1581,13 @@ static PyArrayObject * _trunc_coredim(PyArrayObject *ap, int core_nd) { + PyArrayObject *ret; int nd = ap->nd - core_nd; if (nd < 0) nd = 0; /* The following code is basically taken from PyArray_Transpose */ Py_INCREF(ap->descr); /* NewFromDescr will steal this reference */ - PyArrayObject *ret = (PyArrayObject *) + ret = (PyArrayObject *) PyArray_NewFromDescr(ap->ob_type, ap->descr, nd, ap->dimensions, ap->strides, ap->data, ap->flags, @@ -1598,7 +1599,7 @@ Py_INCREF(ap); PyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN); - + return ret; } @@ -1793,8 +1794,8 @@ return -1; } } - + if (self->core_enabled) { if (_compute_dimension_size(loop, mps, i) < 0) return -1; @@ -2448,7 +2449,7 @@ * right type but not contiguous. -- Almost as fast. */ /*fprintf(stderr, "NOBUFFER...%d\n", loop->size);*/ - + while (loop->index < loop->size) { for(i = 0; i < self->nargs; i++) { loop->bufptr[i] = loop->iters[i]->dataptr; @@ -3537,7 +3538,7 @@ "Reduction not defined on ufunc with signature"); return NULL; } - + if (self->nin != 2) { PyErr_Format(PyExc_ValueError, "%s only supported for binary functions", @@ -4051,7 +4052,7 @@ self->ntypes = 1; self->check_return = 0; - + /* generalized ufunc */ self->core_enabled = 0; self->core_num_dim_ix = 0; @@ -4156,7 +4157,7 @@ return PyUFunc_FromFuncAndDataAndSignature(func, data, types, ntypes, nin, nout, identity, name, doc, check_return, NULL); } - + /*UFUNC_API*/ static PyObject * PyUFunc_FromFuncAndDataAndSignature(PyUFuncGenericFunction *func, void **data, @@ -4190,7 +4191,7 @@ if (doc == NULL) self->doc = "NULL"; else self->doc = doc; - + /* generalized ufunc */ self->core_enabled = 0; self->core_num_dim_ix = 0; @@ -4411,7 +4412,7 @@ " signature"); return NULL; } - + if(self->nin != 2) { PyErr_SetString(PyExc_ValueError, "outer product only supported "\ From numpy-svn at scipy.org Thu Aug 14 18:30:18 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 14 Aug 2008 17:30:18 -0500 (CDT) Subject: [Numpy-svn] r5654 - trunk/numpy/core/src Message-ID: <20080814223018.BA69839C02D@scipy.org> Author: stefan Date: 2008-08-14 17:30:17 -0500 (Thu, 14 Aug 2008) New Revision: 5654 Modified: trunk/numpy/core/src/ufuncobject.c Log: Fix warnings in ufunc code [patch by Wenjie Fu]. Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2008-08-14 21:58:13 UTC (rev 5653) +++ trunk/numpy/core/src/ufuncobject.c 2008-08-14 22:30:17 UTC (rev 5654) @@ -1383,7 +1383,7 @@ static int _parse_signature(PyUFuncObject *self, const char *signature) { - int len; + size_t len; char const **var_names; int nd = 0; /* number of dimension of the current argument */ int cur_arg = 0; /* index into core_num_dims&core_offsets */ @@ -1496,10 +1496,10 @@ /* check for trivial core-signature, e.g. "(),()->()" */ if (cur_core_dim == 0) self->core_enabled = 0; - _pya_free(var_names); + _pya_free((void*)var_names); return 0; fail: - _pya_free(var_names); + _pya_free((void*)var_names); if (parse_error) { char *buf = _pya_malloc(sizeof(char) * (len + 200)); if (buf) { From numpy-svn at scipy.org Fri Aug 15 08:30:39 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Aug 2008 07:30:39 -0500 (CDT) Subject: [Numpy-svn] r5655 - trunk/numpy/core/code_generators Message-ID: <20080815123039.E5AB639C02A@scipy.org> Author: cdavid Date: 2008-08-15 07:30:37 -0500 (Fri, 15 Aug 2008) New Revision: 5655 Modified: trunk/numpy/core/code_generators/generate_umath.py Log: Split generated docstring literals for compilers which cannot handle long strings.z Modified: trunk/numpy/core/code_generators/generate_umath.py =================================================================== --- trunk/numpy/core/code_generators/generate_umath.py 2008-08-14 22:30:17 UTC (rev 5654) +++ trunk/numpy/core/code_generators/generate_umath.py 2008-08-15 12:30:37 UTC (rev 5655) @@ -673,6 +673,10 @@ mlist = [] docstring = textwrap.dedent(uf.docstring).strip() docstring = docstring.encode('string-escape').replace(r'"', r'\"') + # Split the docstring because some compilers (like MS) do not like big + # string literal in C code. We split at endlines because textwrap.wrap + # do not play well with \n + docstring = '\\n\"\"'.join(docstring.split(r"\n")) mlist.append(\ r"""f = PyUFunc_FromFuncAndData(%s_functions, %s_data, %s_signatures, %d, %d, %d, %s, "%s", From numpy-svn at scipy.org Fri Aug 15 10:40:49 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Aug 2008 09:40:49 -0500 (CDT) Subject: [Numpy-svn] r5656 - branches Message-ID: <20080815144049.155AE39C02D@scipy.org> Author: cdavid Date: 2008-08-15 09:40:47 -0500 (Fri, 15 Aug 2008) New Revision: 5656 Added: branches/vs_longstring/ Log: Create branch to handle too long string literals for VS 2003. Copied: branches/vs_longstring (from rev 5655, trunk) From numpy-svn at scipy.org Fri Aug 15 10:41:32 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Aug 2008 09:41:32 -0500 (CDT) Subject: [Numpy-svn] r5657 - trunk Message-ID: <20080815144132.C0F7939C02D@scipy.org> Author: cdavid Date: 2008-08-15 09:41:31 -0500 (Fri, 15 Aug 2008) New Revision: 5657 Modified: trunk/ Log: Initialized merge tracking via "svnmerge" with revisions "1-5656" from http://svn.scipy.org/svn/numpy/branches/vs_longstring Property changes on: trunk ___________________________________________________________________ Name: svnmerge-integrated - /branches/aligned_alloca:1-5127 /branches/build_with_scons:1-4676 /branches/cdavid:1-5257 /branches/cleanconfig_rtm:1-4677 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /trunk:1-2871 + /branches/aligned_alloca:1-5127 /branches/build_with_scons:1-4676 /branches/cdavid:1-5257 /branches/cleanconfig_rtm:1-4677 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /branches/vs_longstring:1-5656 /trunk:1-2871 From numpy-svn at scipy.org Fri Aug 15 10:48:11 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Aug 2008 09:48:11 -0500 (CDT) Subject: [Numpy-svn] r5658 - branches/vs_longstring Message-ID: <20080815144811.7730139C02D@scipy.org> Author: cdavid Date: 2008-08-15 09:48:10 -0500 (Fri, 15 Aug 2008) New Revision: 5658 Modified: branches/vs_longstring/ Log: Initialized merge tracking via "svnmerge" with revisions "1-5655" from http://svn.scipy.org/svn/numpy/trunk Property changes on: branches/vs_longstring ___________________________________________________________________ Name: svnmerge-integrated - /branches/aligned_alloca:1-5127 /branches/build_with_scons:1-4676 /branches/cdavid:1-5257 /branches/cleanconfig_rtm:1-4677 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /trunk:1-2871 + /branches/aligned_alloca:1-5127 /branches/build_with_scons:1-4676 /branches/cdavid:1-5257 /branches/cleanconfig_rtm:1-4677 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /trunk:1-5655 From numpy-svn at scipy.org Fri Aug 15 17:15:59 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Aug 2008 16:15:59 -0500 (CDT) Subject: [Numpy-svn] r5660 - in trunk/numpy: core lib Message-ID: <20080815211559.E883339C15A@scipy.org> Author: oliphant Date: 2008-08-15 16:15:58 -0500 (Fri, 15 Aug 2008) New Revision: 5660 Modified: trunk/numpy/core/defmatrix.py trunk/numpy/core/numerictypes.py trunk/numpy/lib/utils.py Log: Re-factor code to remove dependency of numpy.core on numpy.lib by moving issubclass_, issubsctype, and issubdtype to numpy.core.numerictypes Modified: trunk/numpy/core/defmatrix.py =================================================================== --- trunk/numpy/core/defmatrix.py 2008-08-15 15:00:43 UTC (rev 5659) +++ trunk/numpy/core/defmatrix.py 2008-08-15 21:15:58 UTC (rev 5660) @@ -3,7 +3,7 @@ import sys import numeric as N from numeric import concatenate, isscalar, binary_repr, identity -from numpy.lib.utils import issubdtype +from numerictypes import issubdtype # make translation table _table = [None]*256 Modified: trunk/numpy/core/numerictypes.py =================================================================== --- trunk/numpy/core/numerictypes.py 2008-08-15 15:00:43 UTC (rev 5659) +++ trunk/numpy/core/numerictypes.py 2008-08-15 21:15:58 UTC (rev 5660) @@ -484,6 +484,49 @@ return res.type +def issubclass_(arg1, arg2): + try: + return issubclass(arg1, arg2) + except TypeError: + return False + +def issubsctype(arg1, arg2): + return issubclass(obj2sctype(arg1), obj2sctype(arg2)) + +def issubdtype(arg1, arg2): + """ + Returns True if first argument is a typecode lower/equal in type hierarchy. + + Parameters + ---------- + arg1 : dtype_like + dtype or string representing a typecode. + arg2 : dtype_like + dtype or string representing a typecode. + + + See Also + -------- + numpy.core.numerictypes : Overview of numpy type hierarchy. + + Examples + -------- + >>> np.issubdtype('S1', str) + True + >>> np.issubdtype(np.float64, np.float32) + False + + """ + if issubclass_(arg2, generic): + return issubclass(dtype(arg1).type, arg2) + mro = dtype(arg2).type.mro() + if len(mro) > 1: + val = mro[1] + else: + val = mro[0] + return issubclass(dtype(arg1).type, val) + + # This dictionary allows look up based on any alias for an array data-type class _typedict(dict): def __getitem__(self, obj): Modified: trunk/numpy/lib/utils.py =================================================================== --- trunk/numpy/lib/utils.py 2008-08-15 15:00:43 UTC (rev 5659) +++ trunk/numpy/lib/utils.py 2008-08-15 21:15:58 UTC (rev 5660) @@ -4,7 +4,8 @@ import types import re -from numpy.core.numerictypes import obj2sctype, generic +from numpy.core.numerictypes import obj2sctype, generic, issubclass_, \ + issubsctype, issubdtype from numpy.core.multiarray import dtype as _dtype from numpy.core import product, ndarray @@ -14,48 +15,6 @@ 'get_include', 'info', 'source', 'who', 'lookfor', 'byte_bounds', 'may_share_memory', 'safe_eval'] -def issubclass_(arg1, arg2): - try: - return issubclass(arg1, arg2) - except TypeError: - return False - -def issubsctype(arg1, arg2): - return issubclass(obj2sctype(arg1), obj2sctype(arg2)) - -def issubdtype(arg1, arg2): - """ - Returns True if first argument is a typecode lower/equal in type hierarchy. - - Parameters - ---------- - arg1 : dtype_like - dtype or string representing a typecode. - arg2 : dtype_like - dtype or string representing a typecode. - - - See Also - -------- - numpy.core.numerictypes : Overview of numpy type hierarchy. - - Examples - -------- - >>> np.issubdtype('S1', str) - True - >>> np.issubdtype(np.float64, np.float32) - False - - """ - if issubclass_(arg2, generic): - return issubclass(_dtype(arg1).type, arg2) - mro = _dtype(arg2).type.mro() - if len(mro) > 1: - val = mro[1] - else: - val = mro[0] - return issubclass(_dtype(arg1).type, val) - def get_include(): """ Return the directory that contains the numpy \\*.h header files. From numpy-svn at scipy.org Fri Aug 15 19:15:07 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Aug 2008 18:15:07 -0500 (CDT) Subject: [Numpy-svn] r5661 - branches Message-ID: <20080815231507.4C97539C10E@scipy.org> Author: stefan Date: 2008-08-15 18:15:06 -0500 (Fri, 15 Aug 2008) New Revision: 5661 Added: branches/gen_ufuncs/ Log: Generalised ufuncs branch. Copied: branches/gen_ufuncs (from rev 5660, trunk) From numpy-svn at scipy.org Fri Aug 15 19:39:05 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 15 Aug 2008 18:39:05 -0500 (CDT) Subject: [Numpy-svn] r5662 - in trunk: . numpy/core/code_generators numpy/core/include/numpy numpy/core/src Message-ID: <20080815233905.5C09239C02D@scipy.org> Author: stefan Date: 2008-08-15 18:39:04 -0500 (Fri, 15 Aug 2008) New Revision: 5662 Modified: trunk/THANKS.txt trunk/numpy/core/code_generators/ufunc_api_order.txt trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/include/numpy/ufuncobject.h trunk/numpy/core/src/ufuncobject.c Log: Move generalised ufunc functionality to the gen_ufuncs branch. Modified: trunk/THANKS.txt =================================================================== --- trunk/THANKS.txt 2008-08-15 23:15:06 UTC (rev 5661) +++ trunk/THANKS.txt 2008-08-15 23:39:04 UTC (rev 5662) @@ -37,4 +37,3 @@ David Cournapeau for scons build support, doc-and-bug fixes, and code contributions including fast_clipping. Pierre Gerard-Marchant for his rewrite of the masked array functionality. Roberto de Almeida for the buffered array iterator. -Wenjie Fu and Hans-Andreas Engel for the generalised ufunc infrastructure. Modified: trunk/numpy/core/code_generators/ufunc_api_order.txt =================================================================== --- trunk/numpy/core/code_generators/ufunc_api_order.txt 2008-08-15 23:15:06 UTC (rev 5661) +++ trunk/numpy/core/code_generators/ufunc_api_order.txt 2008-08-15 23:39:04 UTC (rev 5662) @@ -1,5 +1,4 @@ PyUFunc_FromFuncAndData -PyUFunc_FromFuncAndDataAndSignature PyUFunc_RegisterLoopForType PyUFunc_GenericFunction PyUFunc_f_f_As_d_d Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-15 23:15:06 UTC (rev 5661) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-15 23:39:04 UTC (rev 5662) @@ -39,7 +39,7 @@ #define NPY_SUCCEED 1 /* Helpful to distinguish what is installed */ -#define NPY_VERSION 0x0100000B +#define NPY_VERSION 0x0100000A /* Some platforms don't define bool, long long, or long double. Handle that here. Modified: trunk/numpy/core/include/numpy/ufuncobject.h =================================================================== --- trunk/numpy/core/include/numpy/ufuncobject.h 2008-08-15 23:15:06 UTC (rev 5661) +++ trunk/numpy/core/include/numpy/ufuncobject.h 2008-08-15 23:39:04 UTC (rev 5662) @@ -19,20 +19,6 @@ void *ptr; PyObject *obj; PyObject *userloops; - - /* generalized ufunc */ - int core_enabled; /* 0 for scalar ufunc; 1 for generalized ufunc */ - int core_num_dim_ix; /* number of distinct dimension names in - signature */ - - /* dimension indices of input/output argument k are stored in - core_dim_ixs[core_offsets[k]..core_offsets[k]+core_num_dims[k]-1] */ - int *core_num_dims; /* numbers of core dimensions of each argument */ - int *core_dim_ixs; /* dimension indices in a flatted form; indices - are in the range of [0,core_num_dim_ix) */ - int *core_offsets; /* positions of 1st core dimensions of each - argument in core_dim_ixs */ - char *core_signature; /* signature string for printing purpose */ } PyUFuncObject; #include "arrayobject.h" @@ -136,11 +122,6 @@ int notimplemented; /* The loop caused notimplemented */ int objfunc; /* This loop calls object functions (an inner-loop function with argument types */ - - /* generalized ufunc */ - npy_intp *core_dim_sizes; /* stores sizes of core dimensions; - contains 1 + core_num_dim_ix elements */ - npy_intp *core_strides; /* strides of loop and core dimensions */ } PyUFuncLoopObject; /* Could make this more clever someday */ Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2008-08-15 23:15:06 UTC (rev 5661) +++ trunk/numpy/core/src/ufuncobject.c 2008-08-15 23:39:04 UTC (rev 5662) @@ -795,7 +795,6 @@ #define NOBUFFER_REDUCELOOP 2 #define BUFFER_UFUNCLOOP 3 #define BUFFER_REDUCELOOP 3 -#define SIGNATURE_NOBUFFER_UFUNCLOOP 4 static char @@ -1260,7 +1259,7 @@ } /* Create copies for any arrays that are less than loop->bufsize - in total size (or core_enabled) and are mis-behaved or in need + in total size and are mis-behaved or in need of casting. */ @@ -1288,7 +1287,7 @@ } Py_DECREF(atype); } - if (size < loop->bufsize || loop->ufunc->core_enabled) { + if (size < loop->bufsize) { if (!(PyArray_ISBEHAVED_RO(mps[i])) || \ PyArray_TYPE(mps[i]) != arg_types[i]) { ntype = PyArray_DescrFromType(arg_types[i]); @@ -1329,280 +1328,6 @@ #undef _GETATTR_ - -/* Return the position of next non-white-space char in the string -*/ -static int -_next_non_white_space(const char* str, int offset) -{ - int ret = offset; - while (str[ret] == ' ' || str[ret] == '\t') ret++; - return ret; -} - -static int -_is_alpha_underscore(char ch) -{ - return (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z') || ch == '_'; -} - -static int -_is_alnum_underscore(char ch) -{ - return _is_alpha_underscore(ch) || (ch >= '0' && ch <= '9'); -} - -/* Return the ending position of a variable name -*/ -static int -_get_end_of_name(const char* str, int offset) -{ - int ret = offset; - while (_is_alnum_underscore(str[ret])) ret++; - return ret; -} - -/* Returns 1 if the dimension names pointed by s1 and s2 are the same, - otherwise returns 0. -*/ -static int -_is_same_name(const char* s1, const char* s2) -{ - while (_is_alnum_underscore(*s1) && _is_alnum_underscore(*s2)) { - if (*s1 != *s2) return 0; - s1++; - s2++; - } - return !_is_alnum_underscore(*s1) && !_is_alnum_underscore(*s2); -} - -/* Sets core_num_dim_ix, core_num_dims, core_dim_ixs, core_offsets, - and core_signature in PyUFuncObject "self". Returns 0 unless an - error occured. -*/ -static int -_parse_signature(PyUFuncObject *self, const char *signature) -{ - size_t len; - char const **var_names; - int nd = 0; /* number of dimension of the current argument */ - int cur_arg = 0; /* index into core_num_dims&core_offsets */ - int cur_core_dim = 0; /* index into core_dim_ixs */ - int i = 0; - char *parse_error = NULL; - - if (signature == NULL) { - PyErr_SetString(PyExc_RuntimeError, - "_parse_signature with NULL signature"); - return -1; - } - - len = strlen(signature); - self->core_signature = _pya_malloc(sizeof(char) * (len+1)); - if (self->core_signature) - strcpy(self->core_signature, signature); - - /* Allocate sufficient memory to store pointers to all dimension names */ - var_names = _pya_malloc(sizeof(char const*) * len); - if (var_names == NULL) { - PyErr_NoMemory(); - return -1; - } - - self->core_enabled = 1; - self->core_num_dim_ix = 0; - self->core_num_dims = _pya_malloc(sizeof(int) * self->nargs); - self->core_dim_ixs = _pya_malloc(sizeof(int) * len); /* shrink this later */ - self->core_offsets = _pya_malloc(sizeof(int) * self->nargs); - if (self->core_num_dims == NULL || self->core_dim_ixs == NULL || - self->core_offsets == NULL) { - PyErr_NoMemory(); - goto fail; - } - - i = _next_non_white_space(signature, 0); - - while (signature[i] != '\0') { /* loop over input/output arguments */ - if (cur_arg == self->nin) { - /* expect "->" */ - if (signature[i] != '-' || signature[i+1] != '>') { - parse_error = "expect '->'"; - goto fail; - } - i = _next_non_white_space(signature, i+2); - } - - /* parse core dimensions of one argument, e.g. "()", "(i)", or - "(i,j)" */ - if (signature[i] != '(') { - parse_error = "expect '('"; - goto fail; - } - i = _next_non_white_space(signature, i+1); - while (signature[i] != ')') { /* loop over core dimensions */ - int j = 0; - if (!_is_alpha_underscore(signature[i])) { - parse_error = "expect dimension name"; - goto fail; - } - while (j < self->core_num_dim_ix) { - if (_is_same_name(signature+i, var_names[j])) break; - j++; - } - if (j >= self->core_num_dim_ix) { - var_names[j] = signature+i; - self->core_num_dim_ix++; - } - self->core_dim_ixs[cur_core_dim] = j; - cur_core_dim++; - nd++; - i = _get_end_of_name(signature, i); - i = _next_non_white_space(signature, i); - if (signature[i] != ',' && signature[i] != ')') { - parse_error = "expect ',' or ')'"; - goto fail; - } - if (signature[i] == ',') - { - i = _next_non_white_space(signature, i+1); - if (signature[i] == ')') { - parse_error = "',' must not be followed by ')'"; - goto fail; - } - } - } - self->core_num_dims[cur_arg] = nd; - self->core_offsets[cur_arg] = cur_core_dim-nd; - cur_arg++; - nd = 0; - i = _next_non_white_space(signature, i+1); - - if (cur_arg != self->nin && cur_arg != self->nargs) { - /* The list of input arguments (or output arguments) was - only read partially */ - if (signature[i] != ',') { - parse_error = "expect ','"; - goto fail; - } - i = _next_non_white_space(signature, i+1); - } - } - if (cur_arg != self->nargs) { - parse_error = "incomplete signature: not all arguments found"; - goto fail; - } - self->core_dim_ixs = _pya_realloc(self->core_dim_ixs, - sizeof(int) * cur_core_dim); - /* check for trivial core-signature, e.g. "(),()->()" */ - if (cur_core_dim == 0) - self->core_enabled = 0; - _pya_free((void*)var_names); - return 0; -fail: - _pya_free((void*)var_names); - if (parse_error) { - char *buf = _pya_malloc(sizeof(char) * (len + 200)); - if (buf) { - sprintf(buf, "%s at position %d in \"%s\"", - parse_error, i, signature); - PyErr_SetString(PyExc_ValueError, signature); - _pya_free(buf); - } - else { - PyErr_NoMemory(); - } - } - return -1; -} - -/* Concatenate the loop and core dimensions of - PyArrayMultiIterObject's iarg-th argument, to recover a full - dimension array (used for output arguments). -*/ -static npy_intp* -_compute_output_dims(PyUFuncLoopObject *loop, int iarg, - int *out_nd, npy_intp *tmp_dims) -{ - int i; - PyUFuncObject *ufunc = loop->ufunc; - if (ufunc->core_enabled == 0) { - /* case of ufunc with trivial core-signature */ - *out_nd = loop->nd; - return loop->dimensions; - } - - *out_nd = loop->nd + ufunc->core_num_dims[iarg]; - if (*out_nd > NPY_MAXARGS) { - PyErr_SetString(PyExc_ValueError, - "dimension of output variable exceeds limit"); - return NULL; - } - - /* copy loop dimensions */ - memcpy(tmp_dims, loop->dimensions, sizeof(npy_intp) * loop->nd); - - /* copy core dimension */ - for (i = 0; i < ufunc->core_num_dims[iarg]; i++) - tmp_dims[loop->nd + i] = loop->core_dim_sizes[1 + - ufunc->core_dim_ixs[ufunc->core_offsets[iarg]+i]]; - return tmp_dims; -} - -/* Check and set core_dim_sizes and core_strides for the i-th argument. -*/ -static int -_compute_dimension_size(PyUFuncLoopObject *loop, PyArrayObject **mps, int i) -{ - PyUFuncObject *ufunc = loop->ufunc; - int j = ufunc->core_offsets[i]; - int k = PyArray_NDIM(mps[i]) - ufunc->core_num_dims[i]; - int ind; - for (ind = 0; ind < ufunc->core_num_dims[i]; ind++, j++, k++) { - npy_intp dim = k<0 ? 1 : PyArray_DIM(mps[i], k); - /* First element of core_dim_sizes will be used for looping */ - int dim_ix = ufunc->core_dim_ixs[j] + 1; - if (loop->core_dim_sizes[dim_ix] == 1) { - /* broadcast core dimension */ - loop->core_dim_sizes[dim_ix] = dim; - } - else if (dim != 1 && dim != loop->core_dim_sizes[dim_ix]) { - PyErr_SetString(PyExc_ValueError, - "core dimensions mismatch"); - return -1; - } - /* First ufunc->nargs elements will be used for looping */ - loop->core_strides[ufunc->nargs + j] = - dim == 1 ? 0 : PyArray_STRIDE(mps[i], k); - } - return 0; -} - -/* Return a view of array "ap" with "core_nd" dimensions cut from tail. */ -static PyArrayObject * -_trunc_coredim(PyArrayObject *ap, int core_nd) -{ - PyArrayObject *ret; - int nd = ap->nd - core_nd; - if (nd < 0) nd = 0; - - /* The following code is basically taken from PyArray_Transpose */ - Py_INCREF(ap->descr); /* NewFromDescr will steal this reference */ - ret = (PyArrayObject *) - PyArray_NewFromDescr(ap->ob_type, ap->descr, - nd, ap->dimensions, - ap->strides, ap->data, ap->flags, - (PyObject *)ap); - if (ret == NULL) return NULL; - - /* point at true owner of memory: */ - ret->base = (PyObject *)ap; - Py_INCREF(ap); - - PyArray_UpdateFlags(ret, CONTIGUOUS | FORTRAN); - - return ret; -} - static Py_ssize_t construct_arrays(PyUFuncLoopObject *loop, PyObject *args, PyArrayObject **mps, PyObject *typetup) @@ -1620,10 +1345,6 @@ int flexible = 0; int object = 0; - npy_intp temp_dims[NPY_MAXDIMS]; - npy_intp *out_dims; - int out_nd; - /* Check number of arguments */ nargs = PyTuple_Size(args); if ((nargs < self->nin) || (nargs > self->nargs)) { @@ -1727,23 +1448,6 @@ return -1; } - /* Only use loop dimensions when constructing Iterator: - * temporarily replace mps[i] (will be recovered below). - */ - if (self->core_enabled) { - for (i = 0; i < self->nin; i++) { - PyArrayObject *ao; - - if (_compute_dimension_size(loop, mps, i) < 0) - return -1; - - ao = _trunc_coredim(mps[i], self->core_num_dims[i]); - if (ao == NULL) - return -1; - mps[i] = ao; - } - } - /* Create Iterators for the Inputs */ for(i = 0; i < self->nin; i++) { loop->iters[i] = (PyArrayIterObject *) \ @@ -1753,16 +1457,6 @@ } } - - /* Recover mps[i]. */ - if (self->core_enabled) { - for (i = 0; i < self->nin; i++) { - PyArrayObject *ao = mps[i]; - mps[i] = (PyArrayObject *)mps[i]->base; - Py_DECREF(ao); - } - } - /* Broadcast the result */ loop->numiter = self->nin; if (PyArray_Broadcast((PyArrayMultiIterObject *)loop) < 0) { @@ -1794,18 +1488,9 @@ return -1; } } - - - if (self->core_enabled) { - if (_compute_dimension_size(loop, mps, i) < 0) - return -1; - } - out_dims = _compute_output_dims(loop, i, &out_nd, temp_dims); - if (!out_dims) return -1; - - if (mps[i]->nd != out_nd || + if (mps[i]->nd != loop->nd || !PyArray_CompareLists(mps[i]->dimensions, - out_dims, out_nd)) { + loop->dimensions, loop->nd)) { PyErr_SetString(PyExc_ValueError, "invalid return array shape"); Py_DECREF(mps[i]); @@ -1826,12 +1511,9 @@ PyArray_Descr *ntype; if (mps[i] == NULL) { - out_dims = _compute_output_dims(loop, i, &out_nd, temp_dims); - if (!out_dims) return -1; - mps[i] = (PyArrayObject *)PyArray_New(subtype, - out_nd, - out_dims, + loop->nd, + loop->dimensions, arg_types[i], NULL, NULL, 0, 0, NULL); @@ -1858,7 +1540,7 @@ /* still not the same -- or will we have to use buffers?*/ if (mps[i]->descr->type_num != arg_types[i] || !PyArray_ISBEHAVED_RO(mps[i])) { - if (loop->size < loop->bufsize || self->core_enabled) { + if (loop->size < loop->bufsize) { PyObject *new; /* * Copy the array to a temporary copy @@ -1878,35 +1560,14 @@ } } - if (self->core_enabled) { - PyArrayObject *ao; - - /* computer for all output arguments, and set strides in "loop" */ - if (_compute_dimension_size(loop, mps, i) < 0) - return -1; - - ao = _trunc_coredim(mps[i], self->core_num_dims[i]); - if (ao == NULL) - return -1; - /* Temporarily modify mps[i] for constructing iterator. */ - mps[i] = ao; - } - loop->iters[i] = (PyArrayIterObject *) \ PyArray_IterNew((PyObject *)mps[i]); if (loop->iters[i] == NULL) { return -1; } - - /* Recover mps[i]. */ - if (self->core_enabled) { - PyArrayObject *ao = mps[i]; - mps[i] = (PyArrayObject *)mps[i]->base; - Py_DECREF(ao); - } - } + /* * If any of different type, or misaligned or swapped * then must use buffers @@ -1921,19 +1582,10 @@ return nargs; } - if (self->core_enabled) { - loop->meth = SIGNATURE_NOBUFFER_UFUNCLOOP; - } - for(i = 0; i < self->nargs; i++) { loop->needbuffer[i] = 0; if (arg_types[i] != mps[i]->descr->type_num || !PyArray_ISBEHAVED_RO(mps[i])) { - if (self->core_enabled) { - PyErr_SetString(PyExc_RuntimeError, - "never reached; copy should have been made"); - return -1; - } loop->meth = BUFFER_UFUNCLOOP; loop->needbuffer[i] = 1; } @@ -1943,13 +1595,6 @@ } } - - if (self->core_enabled && loop->obj) { - PyErr_SetString(PyExc_TypeError, - "Object type not allowed in ufunc with signature"); - return -1; - } - if (loop->meth == NO_UFUNCLOOP) { loop->meth = ONE_UFUNCLOOP; @@ -1977,11 +1622,8 @@ loop->numiter = self->nargs; - /* Fill in steps */ - if (loop->meth == SIGNATURE_NOBUFFER_UFUNCLOOP && loop->nd == 0) { - /* Use default core_strides */ - } - else if (loop->meth != ONE_UFUNCLOOP) { + /* Fill in steps */ + if (loop->meth != ONE_UFUNCLOOP) { int ldim; intp minsum; intp maxdim; @@ -2050,16 +1692,6 @@ } /* - * Set looping part of core_dim_sizes and core_strides. - */ - if (loop->meth == SIGNATURE_NOBUFFER_UFUNCLOOP) { - loop->core_dim_sizes[0] = maxdim; - for (i = 0; i < self->nargs; i++) { - loop->core_strides[i] = loop->steps[i]; - } - } - - /* * fix up steps where we will be copying data to * buffers and calculate the ninnerloops and leftover * values -- if step size is already zero that is not changed... @@ -2075,8 +1707,8 @@ } } } - else if (loop->meth == ONE_UFUNCLOOP) { - /* uniformly-strided case */ + else { + /* uniformly-strided case ONE_UFUNCLOOP */ for(i = 0; i < self->nargs; i++) { if (PyArray_SIZE(mps[i]) == 1) loop->steps[i] = 0; @@ -2215,10 +1847,6 @@ int i; if (self->ufunc != NULL) { - if (self->core_dim_sizes) - _pya_free(self->core_dim_sizes); - if (self->core_strides) - _pya_free(self->core_strides); for(i = 0; i < self->ufunc->nargs; i++) Py_XDECREF(self->iters[i]); if (self->buffer[0]) { @@ -2259,24 +1887,7 @@ loop->errobj = NULL; loop->notimplemented = 0; loop->first = 1; - loop->core_dim_sizes = NULL; - loop->core_strides = NULL; - if (self->core_enabled) { - int num_dim_ix = 1 + self->core_num_dim_ix; - int nstrides = self->nargs + self->core_offsets[self->nargs-1] - + self->core_num_dims[self->nargs-1]; - loop->core_dim_sizes = _pya_malloc(sizeof(npy_intp) * num_dim_ix); - loop->core_strides = _pya_malloc(sizeof(npy_intp) * nstrides); - if (loop->core_dim_sizes == NULL || loop->core_strides == NULL) { - PyErr_NoMemory(); - goto fail; - } - memset(loop->core_strides, 0, sizeof(npy_intp) * nstrides); - for (i = 0; i < num_dim_ix; i++) - loop->core_dim_sizes[i] = 1; - } - name = self->name ? self->name : ""; /* @@ -2422,11 +2033,6 @@ ufuncloop_dealloc(loop); return -2; } - if (self->core_enabled && loop->meth != SIGNATURE_NOBUFFER_UFUNCLOOP) { - PyErr_SetString(PyExc_RuntimeError, - "illegal loop method for ufunc with signature"); - goto fail; - } NPY_LOOP_BEGIN_THREADS; switch(loop->meth) { @@ -2449,8 +2055,7 @@ * right type but not contiguous. -- Almost as fast. */ /*fprintf(stderr, "NOBUFFER...%d\n", loop->size);*/ - - while (loop->index < loop->size) { + while (loop->index < loop->size) { for(i = 0; i < self->nargs; i++) { loop->bufptr[i] = loop->iters[i]->dataptr; } @@ -2466,23 +2071,6 @@ } break; - case SIGNATURE_NOBUFFER_UFUNCLOOP: - while (loop->index < loop->size) { - for(i = 0; i < self->nargs; i++) { - loop->bufptr[i] = loop->iters[i]->dataptr; - } - loop->function((char **)loop->bufptr, loop->core_dim_sizes, - loop->core_strides, loop->funcdata); - UFUNC_CHECK_ERROR(loop); - - /* Adjust loop pointers */ - for(i = 0; i < self->nargs; i++) { - PyArray_ITER_NEXT(loop->iters[i]); - } - loop->index++; - } - break; - case BUFFER_UFUNCLOOP: { PyArray_CopySwapNFunc *copyswapn[NPY_MAXARGS]; PyArrayIterObject **iters=loop->iters; @@ -2809,12 +2397,6 @@ /* Reduce type is the type requested of the input during reduction */ - if (self->core_enabled) { - PyErr_Format(PyExc_RuntimeError, - "construct_reduce not allowed on ufunc with signature"); - return NULL; - } - nd = (*arr)->nd; arg_types[0] = otype; arg_types[1] = otype; @@ -3533,12 +3115,6 @@ return NULL; } - if (self->core_enabled) { - PyErr_Format(PyExc_RuntimeError, - "Reduction not defined on ufunc with signature"); - return NULL; - } - if (self->nin != 2) { PyErr_Format(PyExc_ValueError, "%s only supported for binary functions", @@ -4053,14 +3629,6 @@ self->ntypes = 1; self->check_return = 0; - /* generalized ufunc */ - self->core_enabled = 0; - self->core_num_dim_ix = 0; - self->core_num_dims = NULL; - self->core_dim_ixs = NULL; - self->core_offsets = NULL; - self->core_signature = NULL; - pyname = PyObject_GetAttrString(function, "__name__"); if (pyname) (void) PyString_AsStringAndSize(pyname, &fname, &fname_len); @@ -4154,18 +3722,6 @@ int nin, int nout, int identity, char *name, char *doc, int check_return) { - return PyUFunc_FromFuncAndDataAndSignature(func, data, types, ntypes, - nin, nout, identity, name, doc, check_return, NULL); -} - -/*UFUNC_API*/ -static PyObject * -PyUFunc_FromFuncAndDataAndSignature(PyUFuncGenericFunction *func, void **data, - char *types, int ntypes, - int nin, int nout, int identity, - char *name, char *doc, - int check_return, const char *signature) -{ PyUFuncObject *self; self = _pya_malloc(sizeof(PyUFuncObject)); @@ -4192,18 +3748,6 @@ if (doc == NULL) self->doc = "NULL"; else self->doc = doc; - /* generalized ufunc */ - self->core_enabled = 0; - self->core_num_dim_ix = 0; - self->core_num_dims = NULL; - self->core_dim_ixs = NULL; - self->core_offsets = NULL; - self->core_signature = NULL; - if (signature != NULL) { - if (_parse_signature(self, signature) != 0) - return NULL; - } - return (PyObject *)self; } @@ -4368,10 +3912,6 @@ static void ufunc_dealloc(PyUFuncObject *self) { - if (self->core_num_dims) _pya_free(self->core_num_dims); - if (self->core_dim_ixs) _pya_free(self->core_dim_ixs); - if (self->core_offsets) _pya_free(self->core_offsets); - if (self->core_signature) _pya_free(self->core_signature); if (self->ptr) _pya_free(self->ptr); Py_XDECREF(self->userloops); Py_XDECREF(self->obj); @@ -4406,13 +3946,6 @@ PyObject *new_args, *tmp; PyObject *shape1, *shape2, *newshape; - if (self->core_enabled) { - PyErr_Format(PyExc_TypeError, - "method outer is not allowed in ufunc with non-trivial"\ - " signature"); - return NULL; - } - if(self->nin != 2) { PyErr_SetString(PyExc_ValueError, "outer product only supported "\ @@ -4640,13 +4173,6 @@ return Py_None; } -static PyObject * -ufunc_get_signature(PyUFuncObject *self) -{ - if (!self->core_enabled) - Py_RETURN_NONE; - return PyString_FromString(self->core_signature); -} #undef _typecharfromnum @@ -4662,7 +4188,6 @@ {"types", (getter)ufunc_get_types, NULL, "return a list with types grouped input->output"}, {"__name__", (getter)ufunc_get_name, NULL, "function name"}, {"identity", (getter)ufunc_get_identity, NULL, "identity value"}, - {"signature",(getter)ufunc_get_signature,NULL, "signature"}, {NULL, NULL, NULL, NULL}, /* Sentinel */ }; From numpy-svn at scipy.org Mon Aug 18 19:30:48 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 18 Aug 2008 18:30:48 -0500 (CDT) Subject: [Numpy-svn] r5663 - branches/gen_ufuncs/numpy/core/code_generators Message-ID: <20080818233048.9AEFB39C100@scipy.org> Author: stefan Date: 2008-08-18 18:30:34 -0500 (Mon, 18 Aug 2008) New Revision: 5663 Modified: branches/gen_ufuncs/numpy/core/code_generators/ufunc_api_order.txt Log: Move PyUFunc_FromFuncAndDataAndSignature to bottom of ufunc_api_order.txt [for Hans-Andreas Engel]. Modified: branches/gen_ufuncs/numpy/core/code_generators/ufunc_api_order.txt =================================================================== --- branches/gen_ufuncs/numpy/core/code_generators/ufunc_api_order.txt 2008-08-15 23:39:04 UTC (rev 5662) +++ branches/gen_ufuncs/numpy/core/code_generators/ufunc_api_order.txt 2008-08-18 23:30:34 UTC (rev 5663) @@ -1,5 +1,4 @@ PyUFunc_FromFuncAndData -PyUFunc_FromFuncAndDataAndSignature PyUFunc_RegisterLoopForType PyUFunc_GenericFunction PyUFunc_f_f_As_d_d @@ -28,4 +27,5 @@ PyUFunc_clearfperr PyUFunc_getfperr PyUFunc_handlefperr -PyUFunc_ReplaceLoopBySignature \ No newline at end of file +PyUFunc_ReplaceLoopBySignature +PyUFunc_FromFuncAndDataAndSignature From numpy-svn at scipy.org Tue Aug 19 02:33:11 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 19 Aug 2008 01:33:11 -0500 (CDT) Subject: [Numpy-svn] r5664 - trunk/numpy/core/code_generators Message-ID: <20080819063311.5169939C100@scipy.org> Author: charris Date: 2008-08-19 01:33:09 -0500 (Tue, 19 Aug 2008) New Revision: 5664 Modified: trunk/numpy/core/code_generators/ufunc_api_order.txt Log: Add note telling users to add new functions to the end of the list. Modified: trunk/numpy/core/code_generators/ufunc_api_order.txt =================================================================== --- trunk/numpy/core/code_generators/ufunc_api_order.txt 2008-08-18 23:30:34 UTC (rev 5663) +++ trunk/numpy/core/code_generators/ufunc_api_order.txt 2008-08-19 06:33:09 UTC (rev 5664) @@ -1,3 +1,6 @@ +# The functions in the ufunc C API. They are defined +# here so that the order is set. Append new functions +# to the end of the list. PyUFunc_FromFuncAndData PyUFunc_RegisterLoopForType PyUFunc_GenericFunction @@ -27,4 +30,4 @@ PyUFunc_clearfperr PyUFunc_getfperr PyUFunc_handlefperr -PyUFunc_ReplaceLoopBySignature \ No newline at end of file +PyUFunc_ReplaceLoopBySignature From numpy-svn at scipy.org Wed Aug 20 11:48:29 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Aug 2008 10:48:29 -0500 (CDT) Subject: [Numpy-svn] r5665 - trunk/numpy/lib Message-ID: <20080820154829.4D4EC39C07C@scipy.org> Author: cdavid Date: 2008-08-20 10:48:17 -0500 (Wed, 20 Aug 2008) New Revision: 5665 Modified: trunk/numpy/lib/scimath.py Log: Add a note on scimath.sqrt for the definition of square root as the principal square root. Modified: trunk/numpy/lib/scimath.py =================================================================== --- trunk/numpy/lib/scimath.py 2008-08-19 06:33:09 UTC (rev 5664) +++ trunk/numpy/lib/scimath.py 2008-08-20 15:48:17 UTC (rev 5665) @@ -192,6 +192,22 @@ >>> np.lib.scimath.sqrt([-1,4]) array([ 0.+1.j, 2.+0.j]) + + Notes + ----- + + As the numpy.sqrt, this returns the principal square root of x, which is + what most people mean when they use square root; the principal square root + of x is not any number z such as z^2 = x. + + For positive numbers, the principal square root is defined as the positive + number z such as z^2 = x. + + The principal square root of -1 is i, the principal square root of any + negative number -x is defined a i * sqrt(x). For any non zero complex + number, it is defined by using the following branch cut: x = r e^(i t) with + r > 0 and -pi < t <= pi. The principal square root is then + sqrt(r) e^(i t/2). """ x = _fix_real_lt_zero(x) return nx.sqrt(x) From numpy-svn at scipy.org Wed Aug 20 18:03:34 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Aug 2008 17:03:34 -0500 (CDT) Subject: [Numpy-svn] r5666 - trunk/numpy/core/include/numpy/fenv Message-ID: <20080820220334.0208739C07C@scipy.org> Author: cdavid Date: 2008-08-20 17:03:19 -0500 (Wed, 20 Aug 2008) New Revision: 5666 Modified: trunk/numpy/core/include/numpy/fenv/fenv.h Log: Update fenv.h for cygwin: all asm calls should be tagged as volatile. Modified: trunk/numpy/core/include/numpy/fenv/fenv.h =================================================================== --- trunk/numpy/core/include/numpy/fenv/fenv.h 2008-08-20 15:48:17 UTC (rev 5665) +++ trunk/numpy/core/include/numpy/fenv/fenv.h 2008-08-20 22:03:19 UTC (rev 5666) @@ -68,9 +68,9 @@ #define __fldcw(__cw) __asm __volatile("fldcw %0" : : "m" (__cw)) #define __fldenv(__env) __asm __volatile("fldenv %0" : : "m" (__env)) #define __fnclex() __asm __volatile("fnclex") -#define __fnstenv(__env) __asm("fnstenv %0" : "=m" (*(__env))) -#define __fnstcw(__cw) __asm("fnstcw %0" : "=m" (*(__cw))) -#define __fnstsw(__sw) __asm("fnstsw %0" : "=am" (*(__sw))) +#define __fnstenv(__env) __asm __volatile("fnstenv %0" : "=m" (*(__env))) +#define __fnstcw(__cw) __asm __volatile("fnstcw %0" : "=m" (*(__cw))) +#define __fnstsw(__sw) __asm __volatile("fnstsw %0" : "=am" (*(__sw))) #define __fwait() __asm __volatile("fwait") static __inline int From numpy-svn at scipy.org Wed Aug 20 19:03:22 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Aug 2008 18:03:22 -0500 (CDT) Subject: [Numpy-svn] r5667 - trunk Message-ID: <20080820230322.878E139C036@scipy.org> Author: cdavid Date: 2008-08-20 18:02:44 -0500 (Wed, 20 Aug 2008) New Revision: 5667 Added: trunk/setupsconsegg.py Log: Add a setupsconsegg.py file to build with scons and setuptools. Added: trunk/setupsconsegg.py =================================================================== --- trunk/setupsconsegg.py 2008-08-20 22:03:19 UTC (rev 5666) +++ trunk/setupsconsegg.py 2008-08-20 23:02:44 UTC (rev 5667) @@ -0,0 +1,7 @@ +#!/usr/bin/env python +""" +A setup.py script to use setuptools, which gives egg goodness, etc. +""" + +from setuptools import setup +execfile('setupscons.py') Property changes on: trunk/setupsconsegg.py ___________________________________________________________________ Name: svn:executable + * From numpy-svn at scipy.org Wed Aug 20 19:24:41 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Aug 2008 18:24:41 -0500 (CDT) Subject: [Numpy-svn] r5668 - trunk/numpy/distutils/command Message-ID: <20080820232441.A3D7939C036@scipy.org> Author: cdavid Date: 2008-08-20 18:24:24 -0500 (Wed, 20 Aug 2008) New Revision: 5668 Modified: trunk/numpy/distutils/command/build.py trunk/numpy/distutils/command/build_ext.py Log: Run scons command in build_ext instead of build. setuptools develop run build_ext inplace, not build, so develop command in setuptools would not call the scons command. Now, the develop mode should work with numscons. Modified: trunk/numpy/distutils/command/build.py =================================================================== --- trunk/numpy/distutils/command/build.py 2008-08-20 23:02:44 UTC (rev 5667) +++ trunk/numpy/distutils/command/build.py 2008-08-20 23:24:24 UTC (rev 5668) @@ -34,7 +34,4 @@ 'scripts' + plat_specifier) def run(self): - # Make sure that scons based extensions are complete. - self.run_command('scons') - old_build.run(self) Modified: trunk/numpy/distutils/command/build_ext.py =================================================================== --- trunk/numpy/distutils/command/build_ext.py 2008-08-20 23:02:44 UTC (rev 5667) +++ trunk/numpy/distutils/command/build_ext.py 2008-08-20 23:24:24 UTC (rev 5668) @@ -217,6 +217,11 @@ # Build extensions self.build_extensions() + # Make sure that scons based extensions are complete. + if self.inplace: + self.reinitialize_command('scons', inplace=1) + self.run_command('scons') + def swig_sources(self, sources): # Do nothing. Swig sources have beed handled in build_src command. return sources From numpy-svn at scipy.org Wed Aug 20 19:44:45 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 20 Aug 2008 18:44:45 -0500 (CDT) Subject: [Numpy-svn] r5669 - in branches/1.1.x: . numpy/distutils/command Message-ID: <20080820234445.BFE3139C036@scipy.org> Author: cdavid Date: 2008-08-20 18:44:20 -0500 (Wed, 20 Aug 2008) New Revision: 5669 Added: branches/1.1.x/setupsconsegg.py Modified: branches/1.1.x/numpy/distutils/command/build.py branches/1.1.x/numpy/distutils/command/build_ext.py Log: Backport develop mode support for scons build. Modified: branches/1.1.x/numpy/distutils/command/build.py =================================================================== --- branches/1.1.x/numpy/distutils/command/build.py 2008-08-20 23:24:24 UTC (rev 5668) +++ branches/1.1.x/numpy/distutils/command/build.py 2008-08-20 23:44:20 UTC (rev 5669) @@ -34,7 +34,4 @@ 'scripts' + plat_specifier) def run(self): - # Make sure that scons based extensions are complete. - self.run_command('scons') - old_build.run(self) Modified: branches/1.1.x/numpy/distutils/command/build_ext.py =================================================================== --- branches/1.1.x/numpy/distutils/command/build_ext.py 2008-08-20 23:24:24 UTC (rev 5668) +++ branches/1.1.x/numpy/distutils/command/build_ext.py 2008-08-20 23:44:20 UTC (rev 5669) @@ -217,6 +217,11 @@ # Build extensions self.build_extensions() + # Make sure that scons based extensions are complete. + if self.inplace: + self.reinitialize_command('scons', inplace=1) + self.run_command('scons') + def swig_sources(self, sources): # Do nothing. Swig sources have beed handled in build_src command. return sources Copied: branches/1.1.x/setupsconsegg.py (from rev 5668, trunk/setupsconsegg.py) From numpy-svn at scipy.org Thu Aug 21 12:42:19 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 21 Aug 2008 11:42:19 -0500 (CDT) Subject: [Numpy-svn] r5670 - trunk/numpy/random Message-ID: <20080821164219.0D5AE39C036@scipy.org> Author: stefan Date: 2008-08-21 11:41:34 -0500 (Thu, 21 Aug 2008) New Revision: 5670 Modified: trunk/numpy/random/info.py Log: Update `random` docstring. Modified: trunk/numpy/random/info.py =================================================================== --- trunk/numpy/random/info.py 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/numpy/random/info.py 2008-08-21 16:41:34 UTC (rev 5670) @@ -1,7 +1,86 @@ -"""\ -Core Random Tools -================= +""" +======================== +Random Number Generation +======================== +==================== ========================================================= +Utility functions +============================================================================== +random Uniformly distributed values of a given shape. +bytes Uniformly distributed random bytes. +random_integers Uniformly distributed integers in a given range. +random_sample Uniformly distributed floats in a given range. +permutation Randomly permute a sequence / generate a random sequence. +shuffle Randomly permute a sequence in place. +seed Seed the random number generator. +==================== ========================================================= + +==================== ========================================================= +Compatibility functions +============================================================================== +rand Uniformly distributed values. +randn Normally distributed values. +ranf Uniformly distributed floating point numbers. +randint Uniformly distributed integers in a given range. +==================== ========================================================= + +==================== ========================================================= +Univariate distributions +============================================================================== +beta Beta distribution over ``[0, 1]``. +binomial Binomial distribution. +chisquare :math:`\\chi^2` distribution. +exponential Exponential distribution. +f F (Fisher-Snedecor) distribution. +gamma Gamma distribution. +geometric Geometric distribution. +gumbel Gumbel distribution. +hypergeometric Hypergeometric distribution. +laplace Laplace distribution. +logistic Logistic distribution. +lognormal Log-normal distribution. +logseries Logarithmic series distribution. +negative_binomial Negative binomial distribution. +noncentral_chisquare Non-central chi-square distribution. +noncentral_f Non-central F distribution. +normal Normal / Gaussian distribution. +pareto Pareto distribution. +poisson Poisson distribution. +power Power distribution. +rayleigh Rayleigh distribution. +triangular Triangular distribution. +uniform Uniform distribution. +vonmises Von Mises circular distribution. +wald Wald (inverse Gaussian) distribution. +weibull Weibull distribution. +zipf Zipf's distribution over ranked data. +==================== ========================================================= + +==================== ========================================================= +Multivariate distributions +============================================================================== +dirichlet Multivariate generalization of Beta distribution. +multinomial Multivariate generalization of the binomial distribution. +multivariate_normal Multivariate generalization of the normal distribution. +==================== ========================================================= + +==================== ========================================================= +Standard distributions +============================================================================== +standard_cauchy Standard Cauchy-Lorentz distribution. +standard_exponential Standard exponential distribution. +standard_gamma Standard Gamma distribution. +standard_normal Standard normal distribution. +standard_t Standard Student's t-distribution. +==================== ========================================================= + +==================== ========================================================= +Internal functions +============================================================================== +get_state Get tuple representing internal state of generator. +set_state Set state of generator. +==================== ========================================================= + """ depends = ['core'] From numpy-svn at scipy.org Thu Aug 21 15:46:05 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 21 Aug 2008 14:46:05 -0500 (CDT) Subject: [Numpy-svn] r5672 - in branches/gen_ufuncs/numpy/core: . tests Message-ID: <20080821194605.1110539C185@scipy.org> Author: stefan Date: 2008-08-21 14:45:02 -0500 (Thu, 21 Aug 2008) New Revision: 5672 Modified: branches/gen_ufuncs/numpy/core/setup.py branches/gen_ufuncs/numpy/core/tests/test_ufunc.py Log: Add tests [patch by Wenjie Fu and Hans-Andreas Engel]. Modified: branches/gen_ufuncs/numpy/core/setup.py =================================================================== --- branches/gen_ufuncs/numpy/core/setup.py 2008-08-21 18:05:00 UTC (rev 5671) +++ branches/gen_ufuncs/numpy/core/setup.py 2008-08-21 19:45:02 UTC (rev 5672) @@ -339,7 +339,15 @@ extra_info = blas_info ) + config.add_extension('umath_tests', + sources = [join('src','umath_tests.c.src'), + ], + depends = [join('blasdot','cblas.h'),] + deps, + include_dirs = ['blasdot'], + extra_info = blas_info + ) + config.add_data_dir('tests') config.add_data_dir('tests/data') Modified: branches/gen_ufuncs/numpy/core/tests/test_ufunc.py =================================================================== --- branches/gen_ufuncs/numpy/core/tests/test_ufunc.py 2008-08-21 18:05:00 UTC (rev 5671) +++ branches/gen_ufuncs/numpy/core/tests/test_ufunc.py 2008-08-21 19:45:02 UTC (rev 5672) @@ -1,5 +1,7 @@ import numpy as np from numpy.testing import * +from numpy.random import rand +import numpy.core.umath_tests as umt class TestUfunc(TestCase): def test_reduceat_shifting_sum(self) : @@ -229,6 +231,68 @@ """ pass + def test_innerwt(self): + a = np.arange(6).reshape((2,3)) + b = np.arange(10,16).reshape((2,3)) + w = np.arange(20,26).reshape((2,3)) + assert_array_equal(umt.innerwt(a,b,w), np.sum(a*b*w,axis=-1)) + a = np.arange(100,124).reshape((2,3,4)) + b = np.arange(200,224).reshape((2,3,4)) + w = np.arange(300,324).reshape((2,3,4)) + assert_array_equal(umt.innerwt(a,b,w), np.sum(a*b*w,axis=-1)) + def test_matrix_multiply(self): + self.compare_matrix_multiply_results(np.long) + self.compare_matrix_multiply_results(np.double) + + def compare_matrix_multiply_results(self, tp): + d1 = np.array(rand(2,3,4), dtype=tp) + d2 = np.array(rand(2,3,4), dtype=tp) + msg = "matrix multiply on type %s" % d1.dtype.name + + def permute_n(n): + if n == 1: + return ([0],) + ret = () + base = permute_n(n-1) + for perm in base: + for i in xrange(n): + new = perm + [n-1] + new[n-1] = new[i] + new[i] = n-1 + ret += (new,) + return ret + def slice_n(n): + if n == 0: + return ((),) + ret = () + base = slice_n(n-1) + for sl in base: + ret += (sl+(slice(None),),) + ret += (sl+(slice(0,1),),) + return ret + def broadcastable(s1,s2): + return s1 == s2 or s1 == 1 or s2 == 1 + permute_3 = permute_n(3) + slice_3 = slice_n(3) + ((slice(None,None,-1),)*3,) + + ref = True + for p1 in permute_3: + for p2 in permute_3: + for s1 in slice_3: + for s2 in slice_3: + a1 = d1.transpose(p1)[s1] + a2 = d2.transpose(p2)[s2] + ref = ref and a1.base != None and a1.base.base != None + ref = ref and a2.base != None and a2.base.base != None + if broadcastable(a1.shape[-1], a2.shape[-2]) and \ + broadcastable(a1.shape[0], a2.shape[0]): + assert_array_almost_equal(umt.matrix_multiply(a1,a2), \ + np.sum(a2[...,np.newaxis].swapaxes(-3,-1) * \ + a1[...,np.newaxis,:], axis=-1), \ + err_msg = msg+' %s %s' % (str(a1.shape),str(a2.shape))) + + assert_equal(ref, True, err_msg="reference check") + if __name__ == "__main__": run_module_suite() From numpy-svn at scipy.org Fri Aug 22 02:11:05 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 22 Aug 2008 01:11:05 -0500 (CDT) Subject: [Numpy-svn] r5673 - in trunk/numpy/core: include/numpy src Message-ID: <20080822061105.29FB739C02A@scipy.org> Author: jarrod.millman Date: 2008-08-22 01:11:00 -0500 (Fri, 22 Aug 2008) New Revision: 5673 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/arrayobject.c trunk/numpy/core/src/multiarraymodule.c Log: reverting C-API change from r5626 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-21 19:45:02 UTC (rev 5672) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-22 06:11:00 UTC (rev 5673) @@ -39,7 +39,7 @@ #define NPY_SUCCEED 1 /* Helpful to distinguish what is installed */ -#define NPY_VERSION 0x0100000A +#define NPY_VERSION 0x01000009 /* Some platforms don't define bool, long long, or long double. Handle that here. @@ -1176,7 +1176,7 @@ NPY_NEEDS_INIT | NPY_NEEDS_PYAPI) #define PyDataType_FLAGCHK(dtype, flag) \ - (((dtype)->flags & (flag)) == (flag)) + (((dtype)->hasobject & (flag)) == (flag)) #define PyDataType_REFCHK(dtype) \ PyDataType_FLAGCHK(dtype, NPY_ITEM_REFCOUNT) @@ -1192,7 +1192,7 @@ char type; /* unique-character representing this type */ char byteorder; /* '>' (big), '<' (little), '|' (not-applicable), or '=' (native). */ - int flags; /* non-zero if it has object arrays + char hasobject; /* non-zero if it has object arrays in fields */ int type_num; /* number representing this type */ int elsize; /* element size for this type */ Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-08-21 19:45:02 UTC (rev 5672) +++ trunk/numpy/core/src/arrayobject.c 2008-08-22 06:11:00 UTC (rev 5673) @@ -11156,7 +11156,7 @@ {"byteorder", T_CHAR, offsetof(PyArray_Descr, byteorder), RO, NULL}, {"itemsize", T_INT, offsetof(PyArray_Descr, elsize), RO, NULL}, {"alignment", T_INT, offsetof(PyArray_Descr, alignment), RO, NULL}, - {"flags", T_UBYTE, offsetof(PyArray_Descr, flags), RO, NULL}, + {"flags", T_UBYTE, offsetof(PyArray_Descr, hasobject), RO, NULL}, {NULL}, }; @@ -11556,7 +11556,7 @@ PyTuple_SET_ITEM(state, 5, PyInt_FromLong(elsize)); PyTuple_SET_ITEM(state, 6, PyInt_FromLong(alignment)); - PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->flags)); + PyTuple_SET_ITEM(state, 7, PyInt_FromLong(self->hasobject)); PyTuple_SET_ITEM(ret, 2, state); return ret; @@ -11568,8 +11568,7 @@ static int _descr_find_object(PyArray_Descr *self) { - if (PyDataType_FLAGCHK(self, NPY_ITEM_HASOBJECT) || - self->type_num == PyArray_OBJECT || + if (self->hasobject || self->type_num == PyArray_OBJECT || self->kind == 'O') return NPY_OBJECT_DTYPE_FLAGS; if (PyDescr_HASFIELDS(self)) { @@ -11585,7 +11584,7 @@ return 0; } if (_descr_find_object(new)) { - new->flags = NPY_OBJECT_DTYPE_FLAGS; + new->hasobject = NPY_OBJECT_DTYPE_FLAGS; return NPY_OBJECT_DTYPE_FLAGS; } } @@ -11716,9 +11715,9 @@ self->alignment = alignment; } - self->flags = dtypeflags; + self->hasobject = dtypeflags; if (version < 3) { - self->flags = _descr_find_object(self); + self->hasobject = _descr_find_object(self); } Py_INCREF(Py_None); return Py_None; Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2008-08-21 19:45:02 UTC (rev 5672) +++ trunk/numpy/core/src/multiarraymodule.c 2008-08-22 06:11:00 UTC (rev 5673) @@ -4704,7 +4704,7 @@ new->names = conv->names; Py_XINCREF(new->names); } - new->flags = conv->flags; + new->hasobject = conv->hasobject; Py_DECREF(conv); *errflag = 0; return new; @@ -4783,7 +4783,7 @@ PyDimMem_FREE(shape.ptr); newdescr->subarray = _pya_malloc(sizeof(PyArray_ArrayDescr)); newdescr->subarray->base = type; - newdescr->flags = type->flags; + newdescr->hasobject = type->hasobject; Py_INCREF(val); newdescr->subarray->shape = val; Py_XDECREF(newdescr->fields); @@ -4873,7 +4873,7 @@ "two fields with the same name"); goto fail; } - dtypeflags |= (conv->flags & NPY_FROM_FIELDS); + dtypeflags |= (conv->hasobject & NPY_FROM_FIELDS); tup = PyTuple_New((title == NULL ? 2 : 3)); PyTuple_SET_ITEM(tup, 0, (PyObject *)conv); if (align) { @@ -4902,7 +4902,7 @@ new->fields = fields; new->names = nameslist; new->elsize = totalsize; - new->flags=dtypeflags; + new->hasobject=dtypeflags; if (maxalign > 1) { totalsize = ((totalsize+maxalign-1)/maxalign)*maxalign; } @@ -4955,7 +4955,7 @@ Py_DECREF(key); goto fail; } - dtypeflags |= (conv->flags & NPY_FROM_FIELDS); + dtypeflags |= (conv->hasobject & NPY_FROM_FIELDS); PyTuple_SET_ITEM(tup, 0, (PyObject *)conv); if (align) { int _align; @@ -4973,7 +4973,7 @@ new = PyArray_DescrNewFromType(PyArray_VOID); new->fields = fields; new->names = nameslist; - new->flags=dtypeflags; + new->hasobject=dtypeflags; if (maxalign > 1) { totalsize = ((totalsize+maxalign-1)/maxalign)*maxalign; } @@ -5199,7 +5199,7 @@ } Py_DECREF(tup); if ((ret == PY_FAIL) || (newdescr->elsize == 0)) goto fail; - dtypeflags |= (newdescr->flags & NPY_FROM_FIELDS); + dtypeflags |= (newdescr->hasobject & NPY_FROM_FIELDS); totalsize += newdescr->elsize; } @@ -5217,7 +5217,7 @@ } new->names = names; new->fields = fields; - new->flags = dtypeflags; + new->hasobject = dtypeflags; return new; fail: From numpy-svn at scipy.org Fri Aug 22 15:59:41 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 22 Aug 2008 14:59:41 -0500 (CDT) Subject: [Numpy-svn] r5674 - trunk/numpy/core Message-ID: <20080822195941.C01D539C10E@scipy.org> Author: stefan Date: 2008-08-22 14:59:27 -0500 (Fri, 22 Aug 2008) New Revision: 5674 Modified: trunk/numpy/core/numerictypes.py Log: Remove unused variable. Modified: trunk/numpy/core/numerictypes.py =================================================================== --- trunk/numpy/core/numerictypes.py 2008-08-22 06:11:00 UTC (rev 5673) +++ trunk/numpy/core/numerictypes.py 2008-08-22 19:59:27 UTC (rev 5674) @@ -571,9 +571,6 @@ for key in _sctype2char_dict.keys(): cast[key] = lambda x, k=key : array(x, copy=False).astype(k) - -_unicodesize = array('u','U1').itemsize - # Create the typestring lookup dictionary _typestr = _typedict() for key in _sctype2char_dict.keys(): From numpy-svn at scipy.org Fri Aug 22 17:42:40 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 22 Aug 2008 16:42:40 -0500 (CDT) Subject: [Numpy-svn] r5675 - branches/gen_ufuncs/numpy/core/src Message-ID: <20080822214240.6422B39C10E@scipy.org> Author: stefan Date: 2008-08-22 16:41:19 -0500 (Fri, 22 Aug 2008) New Revision: 5675 Added: branches/gen_ufuncs/numpy/core/src/umath_tests.c.src Log: Add missing file. Added: branches/gen_ufuncs/numpy/core/src/umath_tests.c.src =================================================================== --- branches/gen_ufuncs/numpy/core/src/umath_tests.c.src 2008-08-22 19:59:27 UTC (rev 5674) +++ branches/gen_ufuncs/numpy/core/src/umath_tests.c.src 2008-08-22 21:41:19 UTC (rev 5675) @@ -0,0 +1,417 @@ +/* -*- c -*- */ + +/* + ***************************************************************************** + ** INCLUDES ** + ***************************************************************************** + */ +#include +#include +#include + +#ifndef CBLAS_HEADER +#define CBLAS_HEADER "cblas.h" +#endif +#include CBLAS_HEADER + +/* + ***************************************************************************** + ** BASICS ** + ***************************************************************************** + */ + +typedef npy_intp intp; + +#define INIT_OUTER_LOOP_1 \ + intp dN = *dimensions++; \ + intp N_; \ + intp s0 = *steps++; + +#define INIT_OUTER_LOOP_2 \ + INIT_OUTER_LOOP_1 \ + intp s1 = *steps++; + +#define INIT_OUTER_LOOP_3 \ + INIT_OUTER_LOOP_2 \ + intp s2 = *steps++; + +#define INIT_OUTER_LOOP_4 \ + INIT_OUTER_LOOP_3 \ + intp s3 = *steps++; + +#define BEGIN_OUTER_LOOP_3 \ + for (N_ = 0; N_ < dN; N_++, args[0] += s0, args[1] += s1, args[2] += s2) { + +#define BEGIN_OUTER_LOOP_4 \ + for (N_ = 0; N_ < dN; N_++, args[0] += s0, args[1] += s1, args[2] += s2, args[3] += s3) { + +#define END_OUTER_LOOP } + + +/* + ***************************************************************************** + ** UFUNC LOOPS ** + ***************************************************************************** + */ + +char *inner1d_signature = "(i),(i)->()"; + +/**begin repeat + + #TYPE=LONG,DOUBLE# + #typ=npy_long, npy_double# +*/ + +/* + * This implements the function + * out[n] = sum_i { in1[n, i] * in2[n, i] }. + */ +static void + at TYPE@_inner1d(char **args, intp *dimensions, intp *steps, void *func) +{ + INIT_OUTER_LOOP_3 + intp di = dimensions[0]; + intp i; + intp is1=steps[0], is2=steps[1]; + BEGIN_OUTER_LOOP_3 + char *ip1=args[0], *ip2=args[1], *op=args[2]; + @typ@ sum = 0; + for (i = 0; i < di; i++) { + sum += (*(@typ@ *)ip1) * (*(@typ@ *)ip2); + ip1 += is1; + ip2 += is2; + } + *(@typ@ *)op = sum; + END_OUTER_LOOP +} + +/**end repeat**/ + +char *innerwt_signature = "(i),(i),(i)->()"; + +/**begin repeat + + #TYPE=LONG,DOUBLE# + #typ=npy_long, npy_double# +*/ + + +/* + * This implements the function + * out[n] = sum_i { in1[n, i] * in2[n, i] * in3[n, i] }. + */ + +static void + at TYPE@_innerwt(char **args, intp *dimensions, intp *steps, void *func) +{ + INIT_OUTER_LOOP_4 + intp di = dimensions[0]; + intp i; + intp is1=steps[0], is2=steps[1], is3=steps[2]; + BEGIN_OUTER_LOOP_4 + char *ip1=args[0], *ip2=args[1], *ip3=args[2], *op=args[3]; + @typ@ sum = 0; + for (i = 0; i < di; i++) { + sum += (*(@typ@ *)ip1) * (*(@typ@ *)ip2) * (*(@typ@ *)ip3); + ip1 += is1; + ip2 += is2; + ip3 += is3; + } + *(@typ@ *)op = sum; + END_OUTER_LOOP +} + +/**end repeat**/ + +char *matrix_multiply_signature = "(m,n),(n,p)->(m,p)"; + +/**begin repeat + + #TYPE=LONG# + #typ=npy_long# +*/ + +/* + * This implements the function + * out[k, m, p] = sum_n { in1[k, m, n] * in2[k, n, p] }. + */ + + +static void + at TYPE@_matrix_multiply(char **args, intp *dimensions, intp *steps, void *func) +{ + /* no BLAS is available */ + INIT_OUTER_LOOP_3 + intp dm = dimensions[0]; + intp dn = dimensions[1]; + intp dp = dimensions[2]; + intp m,n,p; + intp is1_m=steps[0], is1_n=steps[1], is2_n=steps[2], is2_p=steps[3], + os_m=steps[4], os_p=steps[5]; + intp ib1_n = is1_n*dn; + intp ib2_n = is2_n*dn; + intp ib2_p = is2_p*dp; + intp ob_p = os_p *dp; + BEGIN_OUTER_LOOP_3 + char *ip1=args[0], *ip2=args[1], *op=args[2]; + for (m = 0; m < dm; m++) { + for (n = 0; n < dn; n++) { + register @typ@ val1 = (*(@typ@ *)ip1); + for (p = 0; p < dp; p++) { + if (n == 0) *(@typ@ *)op = 0; + *(@typ@ *)op += val1 * (*(@typ@ *)ip2); + ip2 += is2_p; + op += os_p; + } + ip2 -= ib2_p; + op -= ob_p; + ip1 += is1_n; + ip2 += is2_n; + } + ip1 -= ib1_n; + ip2 -= ib2_n; + ip1 += is1_m; + op += os_m; + } + END_OUTER_LOOP +} + +/**end repeat**/ + +/**begin repeat + + #TYPE=FLOAT,DOUBLE# + #B_TYPE=s, d# + #typ=npy_float, npy_double# +*/ + +static void + at TYPE@_matrix_multiply(char **args, intp *dimensions, intp *steps, void *func) +{ + INIT_OUTER_LOOP_3 + intp dm = dimensions[0]; + intp dn = dimensions[1]; + intp dp = dimensions[2]; + intp m,n,p; + intp is1_m=steps[0], is1_n=steps[1], is2_n=steps[2], is2_p=steps[3], + os_m=steps[4], os_p=steps[5]; + intp ib1_n = is1_n*dn; + intp ib2_n = is2_n*dn; + intp ib2_p = is2_p*dp; + intp ob_p = os_p *dp; + + enum CBLAS_ORDER Order = CblasRowMajor; + enum CBLAS_TRANSPOSE Trans1, Trans2; + int M, N, L; + int lda, ldb, ldc; + int typeSize = sizeof(@typ@); + + /* + * BLAS requires each array to have contiguous memory layout on one + * dimension and a positive stride for the other dimension. + */ + if (is1_m <= 0 || is1_n <= 0 || is2_n <= 0 || is2_p <= 0) + goto no_blas; + + if (is1_n == typeSize && is1_m % typeSize == 0) { + Trans1 = CblasNoTrans; + lda = is1_m / typeSize; + } + else if (is1_m == typeSize && is1_n % typeSize == 0) { + Trans1 = CblasTrans; + lda = is1_n / typeSize; + } + else { + goto no_blas; + } + + if (is2_p == typeSize && is2_n % typeSize == 0) { + Trans2 = CblasNoTrans; + ldb = is2_n / typeSize; + } + else if (is2_n == typeSize && is2_p % typeSize == 0) { + Trans2 = CblasTrans; + ldb = is2_p / typeSize; + } + else { + goto no_blas; + } + + M = dm; + N = dp; + L = dn; + if (os_p == typeSize && os_m % typeSize == 0) { + ldc = os_m / typeSize; + BEGIN_OUTER_LOOP_3 + cblas_ at B_TYPE@gemm(Order, Trans1, Trans2, + M, N, L, + 1.0, (@typ@*)args[0], lda, + (@typ@*)args[1], ldb, + 0.0, (@typ@*)args[2], ldc); + END_OUTER_LOOP + return; + } + else if (os_m == typeSize && os_p % typeSize == 0) { + enum CBLAS_TRANSPOSE Trans1r, Trans2r; + ldc = os_p / typeSize; + Trans1r = (Trans1 == CblasTrans) ? CblasNoTrans : CblasTrans; + Trans2r = (Trans2 == CblasTrans) ? CblasNoTrans : CblasTrans; + BEGIN_OUTER_LOOP_3 + /* compute C^T = B^T * A^T */ + cblas_ at B_TYPE@gemm(Order, Trans2r, Trans1r, + N, M, L, + 1.0, (@typ@*)args[1], ldb, + (@typ@*)args[0], lda, + 0.0, (@typ@*)args[2], ldc); + END_OUTER_LOOP + return; + } + + +no_blas: + BEGIN_OUTER_LOOP_3 + char *ip1=args[0], *ip2=args[1], *op=args[2]; + for (m = 0; m < dm; m++) { + for (n = 0; n < dn; n++) { + register @typ@ val1 = (*(@typ@ *)ip1); + for (p = 0; p < dp; p++) { + if (n == 0) *(@typ@ *)op = 0; + *(@typ@ *)op += val1 * (*(@typ@ *)ip2); + ip2 += is2_p; + op += os_p; + } + ip2 -= ib2_p; + op -= ob_p; + ip1 += is1_n; + ip2 += is2_n; + } + ip1 -= ib1_n; + ip2 -= ib2_n; + ip1 += is1_m; + op += os_m; + } + END_OUTER_LOOP +} + +/**end repeat**/ + +/* The following lines were generated using a slightly modified + version of code_generators/generate_umath.py and adding these + lines to defdict: + +defdict = { +'inner1d' : + Ufunc(2, 1, None_, + r'''inner on the last dimension and broadcast on the rest \n" + " \"(i),(i)->()\" \n''', + TD('ld'), + ), +'innerwt' : + Ufunc(3, 1, None_, + r'''inner1d with a weight argument \n" + " \"(i),(i),(i)->()\" \n''', + TD('ld'), + ), +} + +*/ + +static PyUFuncGenericFunction inner1d_functions[] = { LONG_inner1d, DOUBLE_inner1d }; +static void * inner1d_data[] = { (void *)NULL, (void *)NULL }; +static char inner1d_signatures[] = { PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE }; +static PyUFuncGenericFunction innerwt_functions[] = { LONG_innerwt, DOUBLE_innerwt }; +static void * innerwt_data[] = { (void *)NULL, (void *)NULL }; +static char innerwt_signatures[] = { PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE }; +static PyUFuncGenericFunction matrix_multiply_functions[] = { LONG_matrix_multiply, FLOAT_matrix_multiply, DOUBLE_matrix_multiply }; +static void *matrix_multiply_data[] = { (void *)NULL, (void *)NULL, (void *)NULL }; +static char matrix_multiply_signatures[] = { PyArray_LONG, PyArray_LONG, PyArray_LONG, PyArray_FLOAT, PyArray_FLOAT, PyArray_FLOAT, PyArray_DOUBLE, PyArray_DOUBLE, PyArray_DOUBLE }; + +static void +addUfuncs(PyObject *dictionary) { + PyObject *f; + + f = PyUFunc_FromFuncAndDataAndSignature(inner1d_functions, inner1d_data, inner1d_signatures, 2, + 2, 1, PyUFunc_None, "inner1d", + "inner on the last dimension and broadcast on the rest \n"\ + " \"(i),(i)->()\" \n", + 0, inner1d_signature); + PyDict_SetItemString(dictionary, "inner1d", f); + Py_DECREF(f); + f = PyUFunc_FromFuncAndDataAndSignature(innerwt_functions, innerwt_data, innerwt_signatures, 2, + 3, 1, PyUFunc_None, "innerwt", + "inner1d with a weight argument \n"\ + " \"(i),(i),(i)->()\" \n", + 0, innerwt_signature); + PyDict_SetItemString(dictionary, "innerwt", f); + Py_DECREF(f); + f = PyUFunc_FromFuncAndDataAndSignature(matrix_multiply_functions, + matrix_multiply_data, matrix_multiply_signatures, + 3, 2, 1, PyUFunc_None, "matrix_multiply", + "matrix multiplication on last two dimensions \n"\ + " \"(m,n),(n,p)->(m,p)\" \n", + 0, matrix_multiply_signature); + PyDict_SetItemString(dictionary, "matrix_multiply", f); + Py_DECREF(f); +} + +/* + End of auto-generated code. +*/ + + + +static PyObject * +UMath_Tests_test_signature(PyObject *dummy, PyObject *args) +{ + int nin, nout; + PyObject *signature; + PyObject *f; + int core_enabled; + + if (!PyArg_ParseTuple(args, "iiO", &nin, &nout, &signature)) return NULL; + f = PyUFunc_FromFuncAndDataAndSignature(NULL, NULL, NULL, + 0, nin, nout, PyUFunc_None, "no name", + "doc:none", + 1, PyString_AS_STRING(signature)); + if (f == NULL) return NULL; + core_enabled = ((PyUFuncObject*)f)->core_enabled; + return Py_BuildValue("i", core_enabled); +} + +static PyMethodDef UMath_TestsMethods[] = { + {"test_signature", UMath_Tests_test_signature, METH_VARARGS, + "Test signature parsing of ufunc. \n" + "Arguments: nin nout signature \n" + "If fails, it returns NULL. Otherwise it will returns 0 for scalar ufunc " + "and 1 for generalized ufunc. \n", + }, + {NULL, NULL, 0, NULL} /* Sentinel */ +}; + +PyMODINIT_FUNC +initumath_tests(void) +{ + PyObject *m; + PyObject *d; + PyObject *version; + + m = Py_InitModule("umath_tests", UMath_TestsMethods); + if (m == NULL) return; + + import_array(); + import_ufunc(); + + d = PyModule_GetDict(m); + + version = PyString_FromString("0.1"); + PyDict_SetItemString(d, "__version__", version); + Py_DECREF(version); + + /* Load the ufunc operators into the module's namespace */ + addUfuncs(d); + + if (PyErr_Occurred()) { + PyErr_SetString(PyExc_RuntimeError, + "cannot load umath_tests module."); + } +} From numpy-svn at scipy.org Sat Aug 23 02:12:16 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 01:12:16 -0500 (CDT) Subject: [Numpy-svn] r5676 - in trunk/numpy/random: mtrand tests Message-ID: <20080823061216.79FEE39C072@scipy.org> Author: rkern Date: 2008-08-23 01:12:01 -0500 (Sat, 23 Aug 2008) New Revision: 5676 Modified: trunk/numpy/random/mtrand/distributions.c trunk/numpy/random/mtrand/distributions.h trunk/numpy/random/mtrand/mtrand.c trunk/numpy/random/mtrand/mtrand.pyx trunk/numpy/random/tests/test_random.py Log: BUG: Allow floating point argument n to negative binomial distribution. Modified: trunk/numpy/random/mtrand/distributions.c =================================================================== --- trunk/numpy/random/mtrand/distributions.c 2008-08-22 21:41:19 UTC (rev 5675) +++ trunk/numpy/random/mtrand/distributions.c 2008-08-23 06:12:01 UTC (rev 5676) @@ -448,7 +448,7 @@ } -long rk_negative_binomial(rk_state *state, long n, double p) +long rk_negative_binomial(rk_state *state, double n, double p) { double Y; Modified: trunk/numpy/random/mtrand/distributions.h =================================================================== --- trunk/numpy/random/mtrand/distributions.h 2008-08-22 21:41:19 UTC (rev 5675) +++ trunk/numpy/random/mtrand/distributions.h 2008-08-23 06:12:01 UTC (rev 5676) @@ -103,7 +103,7 @@ /* Negative binomial distribution computed by generating a Gamma(n, (1-p)/p) * variate Y and returning a Poisson(Y) variate (Devroye p. 543). */ -extern long rk_negative_binomial(rk_state *state, long n, double p); +extern long rk_negative_binomial(rk_state *state, double n, double p); /* Poisson distribution with mean=lam. * When lam < 10, a basic algorithm using repeated multiplications of uniform Modified: trunk/numpy/random/mtrand/mtrand.c =================================================================== --- trunk/numpy/random/mtrand/mtrand.c 2008-08-22 21:41:19 UTC (rev 5675) +++ trunk/numpy/random/mtrand/mtrand.c 2008-08-23 06:12:01 UTC (rev 5676) @@ -1,4 +1,4 @@ -/* 0.9.7 on Fri Aug 8 02:36:33 2008 */ +/* Generated by Pyrex 0.9.6.4 on Fri Aug 22 22:54:35 2008 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -83,6 +83,8 @@ typedef long (*__pyx_t_6mtrand_rk_discnp)(rk_state *,long,double); +typedef long (*__pyx_t_6mtrand_rk_discdd)(rk_state *,double,double); + typedef long (*__pyx_t_6mtrand_rk_discnmN)(rk_state *,long,long,long); typedef long (*__pyx_t_6mtrand_rk_discd)(rk_state *,double); @@ -167,6 +169,8 @@ static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *,__pyx_t_6mtrand_rk_disc0,PyObject *); /*proto*/ static PyObject *__pyx_f_6mtrand_discnp_array_sc(rk_state *,__pyx_t_6mtrand_rk_discnp,PyObject *,long,double); /*proto*/ static PyObject *__pyx_f_6mtrand_discnp_array(rk_state *,__pyx_t_6mtrand_rk_discnp,PyObject *,PyArrayObject *,PyArrayObject *); /*proto*/ +static PyObject *__pyx_f_6mtrand_discdd_array_sc(rk_state *,__pyx_t_6mtrand_rk_discdd,PyObject *,double,double); /*proto*/ +static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *,__pyx_t_6mtrand_rk_discdd,PyObject *,PyArrayObject *,PyArrayObject *); /*proto*/ static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *,__pyx_t_6mtrand_rk_discnmN,PyObject *,long,long,long); /*proto*/ static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *,__pyx_t_6mtrand_rk_discnmN,PyObject *,PyArrayObject *,PyArrayObject *,PyArrayObject *); /*proto*/ static PyObject *__pyx_f_6mtrand_discd_array_sc(rk_state *,__pyx_t_6mtrand_rk_discd,PyObject *,double); /*proto*/ @@ -243,10 +247,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":130 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":131 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;} + __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -254,19 +258,19 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":133 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":134 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); @@ -274,18 +278,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":134 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":135 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":135 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":136 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":136 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":137 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":138 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":139 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -319,10 +323,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":147 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":148 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;} + __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -330,19 +334,19 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":150 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":151 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); @@ -350,18 +354,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":151 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":152 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":152 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":153 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":153 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":154 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":155 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":156 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -382,6 +386,8 @@ return __pyx_r; } +static PyObject *__pyx_n_ValueError; + static PyObject *__pyx_k61p; static char __pyx_k61[] = "size is not compatible with inputs"; @@ -406,56 +412,56 @@ __pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":166 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":167 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":167 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":168 */ + __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":168 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":169 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":169 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":170 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":170 */ - __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":171 */ + __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_itera)); __pyx_v_itera = ((PyArrayIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":171 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":172 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":172 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":173 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":173 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":174 */ PyArray_ITER_NEXT(__pyx_v_itera); } goto __pyx_L2; } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":175 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":176 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); @@ -463,48 +469,50 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":176 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":177 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":177 */ - __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":178 */ + __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":179 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":180 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} Py_INCREF(__pyx_k61p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k61p); - __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k61p); + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":181 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":182 */ __pyx_5 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":182 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":183 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":183 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":184 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":184 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":185 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); } } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":185 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":186 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -539,10 +547,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":194 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":195 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; goto __pyx_L1;} + __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -550,19 +558,19 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":197 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":198 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); @@ -570,18 +578,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":198 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":199 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":199 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":200 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":200 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":201 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":202 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":203 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -625,60 +633,60 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":215 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":216 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":216 */ - __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":217 */ + __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":217 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":218 */ + __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":218 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":219 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":219 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":220 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":220 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":221 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":221 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":222 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":222 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":223 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":223 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":224 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":225 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":226 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); @@ -686,54 +694,56 @@ arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":226 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":227 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":227 */ - __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":228 */ + __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":228 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":229 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} Py_INCREF(__pyx_k62p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k62p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k62p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_5, 0, 0); Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":230 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":231 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":231 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":232 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":232 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":233 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":233 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":234 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":234 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":235 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":235 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":236 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,2); } } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":236 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":237 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -768,10 +778,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":246 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":247 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;} + __pyx_2 = PyFloat_FromDouble(__pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -779,19 +789,19 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":249 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":250 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); @@ -799,18 +809,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":250 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":251 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":251 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":252 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":252 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":253 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a,__pyx_v_b,__pyx_v_c); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":254 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":255 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -856,63 +866,63 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":268 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":269 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":269 */ - __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":270 */ + __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":270 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":271 */ + __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":271 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":272 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":272 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":273 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":273 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":274 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":274 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":275 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":275 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":276 */ __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":276 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":277 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]),(__pyx_v_oc_data[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":277 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":278 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":279 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":280 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); @@ -920,54 +930,56 @@ arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":280 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":281 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":281 */ - __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":282 */ + __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_oa),((void *)__pyx_v_ob),((void *)__pyx_v_oc)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":283 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":284 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} Py_INCREF(__pyx_k63p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k63p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k63p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_5, 0, 0); Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":285 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":286 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":286 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":287 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":287 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":288 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":288 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":289 */ __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,3)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":289 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":290 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0]),(__pyx_v_ob_data[0]),(__pyx_v_oc_data[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":290 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":291 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":291 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":292 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -990,6 +1002,8 @@ return __pyx_r; } +static PyObject *__pyx_n_int; + static PyObject *__pyx_f_6mtrand_disc0_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_disc0 __pyx_v_func,PyObject *__pyx_v_size) { long *__pyx_v_array_data; PyArrayObject *arrayObject; @@ -1003,10 +1017,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":299 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":300 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -1014,35 +1028,36 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":302 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":303 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;} Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type))); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":303 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":304 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":304 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":305 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":305 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":306 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":307 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":308 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1076,10 +1091,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":315 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":316 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -1087,35 +1102,36 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":318 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":319 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type))); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":319 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":320 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":320 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":321 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":321 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":322 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":323 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":324 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1159,112 +1175,115 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":334 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":335 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":335 */ - __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":336 */ + __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":336 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":337 */ + __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":337 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":338 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":338 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":339 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":339 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":340 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":340 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":341 */ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":341 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":342 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":342 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":343 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":344 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":345 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;} Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type))); - __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_5); - Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":345 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":346 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":346 */ - __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":347 */ + __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":347 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":348 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;} Py_INCREF(__pyx_k64p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k64p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":349 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":350 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":350 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":351 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":351 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":352 */ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":352 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":353 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":353 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":354 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":354 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":355 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,2); } } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":356 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":357 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1286,7 +1305,7 @@ return __pyx_r; } -static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discnmN __pyx_v_func,PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) { +static PyObject *__pyx_f_6mtrand_discdd_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discdd __pyx_v_func,PyObject *__pyx_v_size,double __pyx_v_n,double __pyx_v_p) { long *__pyx_v_array_data; PyArrayObject *arrayObject; long __pyx_v_length; @@ -1299,10 +1318,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":365 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":365 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -1310,35 +1329,263 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":368 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":368 */ __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type))); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":369 */ + __pyx_v_length = PyArray_SIZE(arrayObject); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":370 */ + __pyx_v_array_data = ((long *)arrayObject->data); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":371 */ + for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { + (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_p); + } + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":373 */ + Py_INCREF(((PyObject *)arrayObject)); + __pyx_r = ((PyObject *)arrayObject); + goto __pyx_L0; + } + __pyx_L2:; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); + __Pyx_AddTraceback("mtrand.discdd_array_sc"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(arrayObject); + Py_DECREF(__pyx_v_size); + return __pyx_r; +} + +static PyObject *__pyx_k65p; + +static char __pyx_k65[] = "size is not compatible with inputs"; + +static PyObject *__pyx_f_6mtrand_discdd_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discdd __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_on,PyArrayObject *__pyx_v_op) { + long *__pyx_v_array_data; + PyArrayObject *arrayObject; + npy_intp __pyx_v_i; + double *__pyx_v_op_data; + double *__pyx_v_on_data; + PyArrayMultiIterObject *__pyx_v_multi; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + npy_intp __pyx_3; + PyObject *__pyx_4 = 0; + PyObject *__pyx_5 = 0; + Py_INCREF(__pyx_v_size); + Py_INCREF(__pyx_v_on); + Py_INCREF(__pyx_v_op); + arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":384 */ + __pyx_1 = __pyx_v_size == Py_None; + if (__pyx_1) { + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":385 */ + __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); + Py_DECREF(((PyObject *)__pyx_v_multi)); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":386 */ + __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); + arrayObject = ((PyArrayObject *)__pyx_2); + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":387 */ + __pyx_v_array_data = ((long *)arrayObject->data); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":388 */ + __pyx_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":389 */ + __pyx_v_on_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":390 */ + __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":391 */ + (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0])); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":392 */ + PyArray_MultiIter_NEXT(__pyx_v_multi); + } + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":394 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;} + Py_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_2); + Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":369 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":395 */ + __pyx_v_array_data = ((long *)arrayObject->data); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":396 */ + __pyx_4 = PyArray_MultiIterNew(3,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); + Py_DECREF(((PyObject *)__pyx_v_multi)); + __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":397 */ + __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); + if (__pyx_1) { + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;} + Py_INCREF(__pyx_k65p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k65p); + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;} + goto __pyx_L5; + } + __pyx_L5:; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":399 */ + __pyx_3 = __pyx_v_multi->size; + for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":400 */ + __pyx_v_on_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":401 */ + __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":402 */ + (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_op_data[0])); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":403 */ + PyArray_MultiIter_NEXTi(__pyx_v_multi,1); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":404 */ + PyArray_MultiIter_NEXTi(__pyx_v_multi,2); + } + } + __pyx_L2:; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":406 */ + Py_INCREF(((PyObject *)arrayObject)); + __pyx_r = ((PyObject *)arrayObject); + goto __pyx_L0; + + __pyx_r = Py_None; Py_INCREF(Py_None); + goto __pyx_L0; + __pyx_L1:; + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_5); + __Pyx_AddTraceback("mtrand.discdd_array"); + __pyx_r = 0; + __pyx_L0:; + Py_DECREF(arrayObject); + Py_DECREF(__pyx_v_multi); + Py_DECREF(__pyx_v_size); + Py_DECREF(__pyx_v_on); + Py_DECREF(__pyx_v_op); + return __pyx_r; +} + +static PyObject *__pyx_f_6mtrand_discnmN_array_sc(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discnmN __pyx_v_func,PyObject *__pyx_v_size,long __pyx_v_n,long __pyx_v_m,long __pyx_v_N) { + long *__pyx_v_array_data; + PyArrayObject *arrayObject; + long __pyx_v_length; + long __pyx_v_i; + PyObject *__pyx_r; + int __pyx_1; + PyObject *__pyx_2 = 0; + PyObject *__pyx_3 = 0; + PyObject *__pyx_4 = 0; + Py_INCREF(__pyx_v_size); + arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":415 */ + __pyx_1 = __pyx_v_size == Py_None; + if (__pyx_1) { + __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; goto __pyx_L1;} + __pyx_r = __pyx_2; + __pyx_2 = 0; + goto __pyx_L0; + goto __pyx_L2; + } + /*else*/ { + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":418 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;} + Py_INCREF(__pyx_v_size); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_2); + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":419 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":370 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":420 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":371 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":421 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_n,__pyx_v_m,__pyx_v_N); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":373 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":423 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1359,9 +1606,9 @@ return __pyx_r; } -static PyObject *__pyx_k65p; +static PyObject *__pyx_k66p; -static char __pyx_k65[] = "size is not compatible with inputs"; +static char __pyx_k66[] = "size is not compatible with inputs"; static PyObject *__pyx_f_6mtrand_discnmN_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discnmN __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_on,PyArrayObject *__pyx_v_om,PyArrayObject *__pyx_v_oN) { long *__pyx_v_array_data; @@ -1384,115 +1631,118 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":386 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":436 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":387 */ - __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":437 */ + __pyx_2 = PyArray_MultiIterNew(3,((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":388 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":438 */ + __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":389 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":439 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":390 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":440 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":391 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":441 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":392 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":442 */ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":393 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":443 */ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":394 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":444 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_om_data[0]),(__pyx_v_oN_data[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":395 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":445 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":397 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":447 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type))); - __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_5); - Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":398 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":448 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":399 */ - __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":449 */ + __pyx_4 = PyArray_MultiIterNew(4,((void *)arrayObject),((void *)__pyx_v_on),((void *)__pyx_v_om),((void *)__pyx_v_oN)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":401 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":451 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;} - Py_INCREF(__pyx_k65p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k65p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;} + Py_INCREF(__pyx_k66p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k66p); + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":403 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":453 */ __pyx_3 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":404 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":454 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":405 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":455 */ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":406 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":456 */ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,3)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":407 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":457 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_on_data[0]),(__pyx_v_om_data[0]),(__pyx_v_oN_data[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":408 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":458 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":410 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":460 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1528,10 +1778,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":418 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":468 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_func(__pyx_v_state,__pyx_v_a)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -1539,35 +1789,36 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":421 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":471 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;} Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type))); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":422 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":472 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":423 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":473 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":424 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":474 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,__pyx_v_a); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":426 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":476 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1588,9 +1839,9 @@ return __pyx_r; } -static PyObject *__pyx_k66p; +static PyObject *__pyx_k67p; -static char __pyx_k66[] = "size is not compatible with inputs"; +static char __pyx_k67[] = "size is not compatible with inputs"; static PyObject *__pyx_f_6mtrand_discd_array(rk_state *__pyx_v_state,__pyx_t_6mtrand_rk_discd __pyx_v_func,PyObject *__pyx_v_size,PyArrayObject *__pyx_v_oa) { long *__pyx_v_array_data; @@ -1612,102 +1863,105 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); __pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":437 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":487 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":438 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":488 */ + __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject)); arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":439 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":489 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":440 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":490 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":441 */ - __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":491 */ + __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayIterObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_itera)); __pyx_v_itera = ((PyArrayIterObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":442 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":492 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":443 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":493 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":444 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":494 */ PyArray_ITER_NEXT(__pyx_v_itera); } goto __pyx_L2; } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":446 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":496 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;} Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - Py_INCREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)(&PyInt_Type))); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + Py_DECREF(((PyObject *)arrayObject)); + arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); - Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":447 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":497 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":448 */ - __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":498 */ + __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayMultiIterObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_multi)); __pyx_v_multi = ((PyArrayMultiIterObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":449 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":499 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;} - Py_INCREF(__pyx_k66p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k66p); - __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;} + Py_INCREF(__pyx_k67p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k67p); + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_4, 0, 0); - Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;} + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 500; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":451 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":501 */ __pyx_5 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":452 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":502 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":453 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":503 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":454 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":504 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); } } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":455 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":505 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1737,29 +1991,29 @@ long __pyx_v_i; double __pyx_r; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":460 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":510 */ __pyx_v_sum = (__pyx_v_darr[0]); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":461 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":511 */ __pyx_v_c = 0.0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":462 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":512 */ for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":463 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":513 */ __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":464 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":514 */ __pyx_v_t = (__pyx_v_sum + __pyx_v_y); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":465 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":515 */ __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":466 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":516 */ __pyx_v_sum = __pyx_v_t; } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":467 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":517 */ __pyx_r = __pyx_v_sum; goto __pyx_L0; @@ -1781,15 +2035,15 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_seed); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":497 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":547 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state *)PyMem_Malloc((sizeof(rk_state)))); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":499 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":549 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} Py_INCREF(__pyx_v_seed); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed); - __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -1815,10 +2069,10 @@ __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != NULL); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":503 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":553 */ PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":504 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":554 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = NULL; goto __pyx_L2; } @@ -1827,6 +2081,7 @@ Py_DECREF(__pyx_v_self); } +static PyObject *__pyx_n_type; static PyObject *__pyx_n_integer; static PyObject *__pyx_f_6mtrand_11RandomState_seed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ @@ -1840,7 +2095,8 @@ int __pyx_1; PyObject *__pyx_2 = 0; PyObject *__pyx_3 = 0; - unsigned long __pyx_4; + PyObject *__pyx_4 = 0; + unsigned long __pyx_5; static char *__pyx_argnames[] = {"seed",0}; __pyx_v_seed = __pyx_k3; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_seed)) return 0; @@ -1849,56 +2105,62 @@ arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_iseed = Py_None; Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":520 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":570 */ __pyx_1 = __pyx_v_seed == Py_None; if (__pyx_1) { __pyx_v_errcode = rk_randomseed(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L2; } - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;} Py_INCREF(__pyx_v_seed); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed); - __pyx_3 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 522; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = __pyx_3 == ((PyObject *)(&PyInt_Type)); Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;} + __pyx_1 = __pyx_4 == __pyx_2; + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;} - rk_seed(__pyx_4,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); + __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;} + rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L2; } - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_integer); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsInstance(__pyx_v_seed,__pyx_3); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_integer); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_1 = PyObject_IsInstance(__pyx_v_seed,__pyx_4); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":525 */ - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":575 */ + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;} Py_INCREF(__pyx_v_seed); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_seed); - __pyx_3 = PyObject_CallObject(((PyObject *)(&PyInt_Type)), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_seed); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_iseed); - __pyx_v_iseed = __pyx_3; - __pyx_3 = 0; + __pyx_v_iseed = __pyx_4; + __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":526 */ - __pyx_4 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;} - rk_seed(__pyx_4,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":576 */ + __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; goto __pyx_L1;} + rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L2; } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":528 */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":578 */ + __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject_obj)); arrayObject_obj = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":529 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":579 */ init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long *)arrayObject_obj->data),(arrayObject_obj->dimensions[0])); } __pyx_L2:; @@ -1908,6 +2170,7 @@ __pyx_L1:; Py_XDECREF(__pyx_2); Py_XDECREF(__pyx_3); + Py_XDECREF(__pyx_4); __Pyx_AddTraceback("mtrand.RandomState.seed"); __pyx_r = 0; __pyx_L0:; @@ -1938,20 +2201,20 @@ Py_INCREF(__pyx_v_self); arrayObject_state = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":542 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":592 */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;} - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_uint); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_uint); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); __pyx_1 = 0; __pyx_4 = 0; - __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); @@ -1959,22 +2222,22 @@ arrayObject_state = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":543 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":593 */ memcpy(((void *)arrayObject_state->data),((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),(624 * (sizeof(long)))); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":544 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_asarray); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":594 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_asarray); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;} - __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_uint32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_uint32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} Py_INCREF(((PyObject *)arrayObject_state)); PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)arrayObject_state)); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_1); __pyx_1 = 0; - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); @@ -1982,11 +2245,11 @@ arrayObject_state = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":545 */ - __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} - __pyx_2 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} - __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} - __pyx_3 = PyTuple_New(5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":595 */ + __pyx_1 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;} + __pyx_3 = PyTuple_New(5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; goto __pyx_L1;} Py_INCREF(__pyx_n_MT19937); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_MT19937); Py_INCREF(((PyObject *)arrayObject_state)); @@ -2016,11 +2279,13 @@ return __pyx_r; } -static PyObject *__pyx_k69p; +static PyObject *__pyx_n_TypeError; + static PyObject *__pyx_k70p; +static PyObject *__pyx_k71p; -static char __pyx_k69[] = "algorithm must be 'MT19937'"; -static char __pyx_k70[] = "state must be 624 longs"; +static char __pyx_k70[] = "algorithm must be 'MT19937'"; +static char __pyx_k71[] = "state must be 624 longs"; static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_set_state[] = "\n set_state(state)\n\n Set the state from a tuple.\n\n state = (\'MT19937\', int key[624], int pos, int has_gauss, float cached_gaussian)\n\n For backwards compatibility, the following form is also accepted\n although it is missing some information about the cached Gaussian value.\n\n state = (\'MT19937\', int key[624], int pos)\n\n "; @@ -2034,10 +2299,10 @@ PyObject *__pyx_v_cached_gaussian; PyObject *__pyx_r; PyObject *__pyx_1 = 0; - int __pyx_2; - PyObject *__pyx_3 = 0; - Py_ssize_t __pyx_4; - PyObject *__pyx_5 = 0; + PyObject *__pyx_2 = 0; + int __pyx_3; + PyObject *__pyx_4 = 0; + Py_ssize_t __pyx_5; PyObject *__pyx_6 = 0; double __pyx_7; static char *__pyx_argnames[] = {"state",0}; @@ -2050,81 +2315,85 @@ __pyx_v_has_gauss = Py_None; Py_INCREF(Py_None); __pyx_v_cached_gaussian = Py_None; Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":564 */ - __pyx_1 = PySequence_GetItem(__pyx_v_state, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":614 */ + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_algorithm_name); - __pyx_v_algorithm_name = __pyx_1; - __pyx_1 = 0; + __pyx_v_algorithm_name = __pyx_2; + __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":565 */ - if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;} - __pyx_2 = __pyx_2 != 0; - if (__pyx_2) { - __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;} - Py_INCREF(__pyx_k69p); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k69p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":615 */ + if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 615; goto __pyx_L1;} + __pyx_3 = __pyx_3 != 0; + if (__pyx_3) { + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;} + Py_INCREF(__pyx_k70p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k70p); + __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 616; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":567 */ - __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;} - __pyx_3 = PyObject_GetIter(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":617 */ + __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;} + __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;} + __pyx_4 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;} Py_DECREF(__pyx_v_key); - __pyx_v_key = __pyx_1; - __pyx_1 = 0; - __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;} - __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;} + __pyx_v_key = __pyx_4; + __pyx_4 = 0; + __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;} + __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_v_pos = __pyx_2; - if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_pos = __pyx_3; + if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":568 */ - __pyx_4 = PyObject_Length(__pyx_v_state); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; goto __pyx_L1;} - __pyx_2 = (__pyx_4 == 3); - if (__pyx_2) { + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":618 */ + __pyx_5 = PyObject_Length(__pyx_v_state); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;} + __pyx_3 = (__pyx_5 == 3); + if (__pyx_3) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":569 */ - __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":619 */ + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;} Py_DECREF(__pyx_v_has_gauss); - __pyx_v_has_gauss = __pyx_1; - __pyx_1 = 0; + __pyx_v_has_gauss = __pyx_4; + __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":570 */ - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":620 */ + __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 620; goto __pyx_L1;} Py_DECREF(__pyx_v_cached_gaussian); - __pyx_v_cached_gaussian = __pyx_3; - __pyx_3 = 0; + __pyx_v_cached_gaussian = __pyx_1; + __pyx_1 = 0; goto __pyx_L3; } /*else*/ { - __pyx_1 = PySequence_GetSlice(__pyx_v_state, 3, 5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;} - __pyx_3 = PyObject_GetIter(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;} + __pyx_2 = PySequence_GetSlice(__pyx_v_state, 3, 5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;} + __pyx_4 = PyObject_GetIter(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;} Py_DECREF(__pyx_v_has_gauss); __pyx_v_has_gauss = __pyx_1; __pyx_1 = 0; - __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;} + __pyx_2 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;} Py_DECREF(__pyx_v_cached_gaussian); - __pyx_v_cached_gaussian = __pyx_1; - __pyx_1 = 0; - if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 572; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_cached_gaussian = __pyx_2; + __pyx_2 = 0; + if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":573 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":623 */ /*try:*/ { - __pyx_1 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_ULONG,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; goto __pyx_L4;} + __pyx_1 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_ULONG,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; goto __pyx_L4;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)arrayObject_obj)); arrayObject_obj = ((PyArrayObject *)__pyx_1); @@ -2132,62 +2401,67 @@ } goto __pyx_L5; __pyx_L4:; - Py_XDECREF(__pyx_3); __pyx_3 = 0; + Py_XDECREF(__pyx_2); __pyx_2 = 0; + Py_XDECREF(__pyx_4); __pyx_4 = 0; Py_XDECREF(__pyx_1); __pyx_1 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":575 */ - __pyx_2 = PyErr_ExceptionMatches(PyExc_TypeError); - if (__pyx_2) { + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":625 */ + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; goto __pyx_L1;} + __pyx_3 = PyErr_ExceptionMatches(__pyx_2); + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (__pyx_3) { __Pyx_AddTraceback("mtrand.set_state"); - if (__Pyx_GetException(&__pyx_3, &__pyx_1, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; goto __pyx_L1;} - __pyx_6 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_4, &__pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; goto __pyx_L1;} + __pyx_6 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_6))); Py_DECREF(((PyObject *)arrayObject_obj)); arrayObject_obj = ((PyArrayObject *)__pyx_6); Py_DECREF(__pyx_6); __pyx_6 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; goto __pyx_L5; } goto __pyx_L1; __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":578 */ - __pyx_2 = ((arrayObject_obj->dimensions[0]) != 624); - if (__pyx_2) { - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} - Py_INCREF(__pyx_k70p); - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_k70p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":628 */ + __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624); + if (__pyx_3) { + __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;} + Py_INCREF(__pyx_k71p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k71p); + __pyx_1 = PyObject_CallObject(__pyx_6, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_1, 0, 0); + Py_DECREF(__pyx_1); __pyx_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":580 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":630 */ memcpy(((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),((void *)arrayObject_obj->data),(624 * (sizeof(long)))); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":581 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":631 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":582 */ - __pyx_2 = PyInt_AsLong(__pyx_v_has_gauss); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; goto __pyx_L1;} - ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_2; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":632 */ + __pyx_3 = PyInt_AsLong(__pyx_v_has_gauss); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; goto __pyx_L1;} + ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_3; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":583 */ - __pyx_7 = PyFloat_AsDouble(__pyx_v_cached_gaussian); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":633 */ + __pyx_7 = PyFloat_AsDouble(__pyx_v_cached_gaussian); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; goto __pyx_L1;} ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->gauss = __pyx_7; __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; Py_XDECREF(__pyx_1); - Py_XDECREF(__pyx_3); - Py_XDECREF(__pyx_5); + Py_XDECREF(__pyx_2); + Py_XDECREF(__pyx_4); Py_XDECREF(__pyx_6); __Pyx_AddTraceback("mtrand.RandomState.set_state"); __pyx_r = 0; @@ -2210,8 +2484,8 @@ static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;} - __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 637; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; @@ -2240,11 +2514,11 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_state)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_state); - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L1;} Py_INCREF(__pyx_v_state); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_state); - __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 590; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -2276,16 +2550,16 @@ static char *__pyx_argnames[] = {0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0; Py_INCREF(__pyx_v_self); - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;} - __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;} + __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;} + __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2); PyTuple_SET_ITEM(__pyx_3, 2, __pyx_4); @@ -2321,7 +2595,7 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;} + __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_double,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -2349,7 +2623,7 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; goto __pyx_L1;} + __pyx_1 = __pyx_f_6mtrand_disc0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_long,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -2366,9 +2640,9 @@ return __pyx_r; } -static PyObject *__pyx_k71p; +static PyObject *__pyx_k72p; -static char __pyx_k71[] = "low >= high"; +static char __pyx_k72[] = "low >= high"; static PyObject *__pyx_f_6mtrand_11RandomState_randint(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_randint[] = "\n randint(low, high=None, size=None)\n\n Return random integers x such that low <= x < high.\n\n If high is None, then 0 <= x < low.\n\n "; @@ -2399,52 +2673,54 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":648 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":698 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":649 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":699 */ __pyx_v_lo = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":650 */ - __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":700 */ + __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; goto __pyx_L1;} __pyx_v_hi = __pyx_2; goto __pyx_L2; } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":652 */ - __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":702 */ + __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; goto __pyx_L1;} __pyx_v_lo = __pyx_2; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":653 */ - __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 653; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":703 */ + __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;} __pyx_v_hi = __pyx_2; } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":655 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":705 */ __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":656 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":706 */ __pyx_1 = (__pyx_v_diff < 0); if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; goto __pyx_L1;} - Py_INCREF(__pyx_k71p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k71p); - __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;} + Py_INCREF(__pyx_k72p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k72p); + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; goto __pyx_L1;} + __Pyx_Raise(__pyx_5, 0, 0); + Py_DECREF(__pyx_5); __pyx_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":659 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":709 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - __pyx_3 = PyInt_FromLong((((long)rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)) + __pyx_v_lo)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong((((long)rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state)) + __pyx_v_lo)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -2452,35 +2728,36 @@ } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":662 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":712 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); - Py_INCREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject *)(&PyInt_Type))); - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)arrayObject)); - arrayObject = ((PyArrayObject *)__pyx_5); - Py_DECREF(__pyx_5); __pyx_5 = 0; + arrayObject = ((PyArrayObject *)__pyx_3); + Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":663 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":713 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":664 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":714 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":665 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":715 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { (__pyx_v_array_data[__pyx_v_i]) = (__pyx_v_lo + ((long)rk_interval(__pyx_v_diff,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state))); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":667 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":717 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -2517,19 +2794,19 @@ Py_INCREF(__pyx_v_self); __pyx_v_bytestring = Py_None; Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":692 */ - __pyx_1 = PyString_FromStringAndSize(NULL,__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":742 */ + __pyx_1 = PyString_FromStringAndSize(NULL,__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; goto __pyx_L1;} Py_DECREF(__pyx_v_bytestring); __pyx_v_bytestring = __pyx_1; __pyx_1 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":693 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":743 */ __pyx_v_bytes = PyString_AS_STRING(__pyx_v_bytestring); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":694 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":744 */ rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":695 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":745 */ Py_INCREF(__pyx_v_bytestring); __pyx_r = __pyx_v_bytestring; goto __pyx_L0; @@ -2579,16 +2856,16 @@ __pyx_v_odiff = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_temp = Py_None; Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":772 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":822 */ __pyx_v_flow = PyFloat_AsDouble(__pyx_v_low); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":773 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":823 */ __pyx_v_fhigh = PyFloat_AsDouble(__pyx_v_high); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":774 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":824 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_flow,(__pyx_v_fhigh - __pyx_v_flow)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_flow,(__pyx_v_fhigh - __pyx_v_flow)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -2596,51 +2873,51 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":776 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":826 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":777 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":827 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_olow)); __pyx_v_olow = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":778 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":828 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_ohigh)); __pyx_v_ohigh = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":779 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":829 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_ohigh)); PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ohigh)); Py_INCREF(((PyObject *)__pyx_v_olow)); PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_olow)); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_temp); __pyx_v_temp = __pyx_4; __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":780 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":830 */ Py_INCREF(__pyx_v_temp); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":782 */ - __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":832 */ + __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odiff)); __pyx_v_odiff = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":783 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_olow,__pyx_v_odiff); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":833 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_uniform,__pyx_v_size,__pyx_v_olow,__pyx_v_odiff); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -2688,11 +2965,11 @@ return 0; } Py_INCREF(__pyx_v_self); - __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;} + __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; goto __pyx_L1;} __pyx_2 = (__pyx_1 == 0); if (__pyx_2) { - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} - __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_4; __pyx_4 = 0; @@ -2700,11 +2977,11 @@ goto __pyx_L2; } /*else*/ { - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} - __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} - __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} - if (PyDict_SetItem(__pyx_5, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} - __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;} + __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;} + __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_5, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;} + __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; @@ -2750,11 +3027,11 @@ return 0; } Py_INCREF(__pyx_v_self); - __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; goto __pyx_L1;} + __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; goto __pyx_L1;} __pyx_2 = (__pyx_1 == 0); if (__pyx_2) { - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; goto __pyx_L1;} - __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_4; __pyx_4 = 0; @@ -2762,11 +3039,11 @@ goto __pyx_L2; } /*else*/ { - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;} Py_INCREF(__pyx_v_args); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_args); - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_r = __pyx_5; @@ -2811,17 +3088,17 @@ Py_INCREF(__pyx_v_high); Py_INCREF(__pyx_v_size); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":854 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":904 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":855 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":905 */ Py_INCREF(__pyx_v_low); Py_DECREF(__pyx_v_high); __pyx_v_high = __pyx_v_low; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":856 */ - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":906 */ + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; goto __pyx_L1;} Py_DECREF(__pyx_v_low); __pyx_v_low = __pyx_2; __pyx_2 = 0; @@ -2829,19 +3106,19 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":857 */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;} - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;} - __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":907 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; goto __pyx_L1;} + __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;} + __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; goto __pyx_L1;} Py_INCREF(__pyx_v_low); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_low); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_size); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_4; @@ -2875,7 +3152,7 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;} + __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gauss,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -2895,11 +3172,11 @@ static PyObject *__pyx_n_any; static PyObject *__pyx_n_less_equal; -static PyObject *__pyx_k73p; static PyObject *__pyx_k74p; +static PyObject *__pyx_k75p; -static char __pyx_k73[] = "scale <= 0"; static char __pyx_k74[] = "scale <= 0"; +static char __pyx_k75[] = "scale <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_normal[] = "\n normal(loc=0.0, scale=1.0, size=None)\n\n Draw random samples from a normal (Gaussian) distribution.\n\n The probability density function of the normal distribution, first\n derived by De Moivre and 200 years later by both Gauss and Laplace\n independently [2]_, is often called the bell curve because of\n its characteristic shape (see the example below).\n\n The normal distributions occurs often in nature. For example, it\n describes the commonly occurring distribution of samples influenced\n by a large number of tiny, random disturbances, each with its own\n unique distribution [2]_.\n\n Parameters\n ----------\n loc : float\n Mean (\"centre\") of the distribution.\n scale : float\n Standard deviation (spread or \"width\") of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.distributions.norm : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Gaussian distribution is\n\n .. math:: p(x) = \\frac{1}{\\sqrt{ 2 \\pi \\sigma^2 }}\n e^{ - \\frac{ (x - \\mu)^2 } {2 \\sigma^2} },\n\n where :math:`\\mu` is the mean and :math:`\\sigma` the standard deviation.\n The square of the standard deviation, :math:`\\sigma^2`, is called the\n variance.\n\n The function has its peak at the mean, and its \"spread\" increases with\n the standard deviation (the function reaches 0.607 times its maximum at\n :math:`x + \\sigma` and :math:`x - \\sigma` [2]_). This implies that\n `numpy.random.normal` is more likely to return samples lying close to the\n mean, rather than those far away.\n\n References\n ----------\n .. [1] Wikipedia, \"Normal distribution\",\n http://en.wikipedia.org/wiki/Normal_distribution\n .. [2] P. R. Peebles Jr., \"Central Limit Theorem\" in \"Probability, Random\n Variables and Random Signal Principles\", 4th ed., 2001,\n pp. 51, 51, 125.\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, sigma = 0, 0.1 # mean and standard deviation\n >>> s = np.random.normal(mu, sigma, 1000)\n\n Verify the mean and the variance:\n\n >>> abs(mu - np.mean(s)) < 0.01\n True\n\n >>> abs(sigma - np.std(s, ddof=1)) < 0.01\n True\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 30, normed=True)\n >>> plt.plot(bins, 1/(sigma * np.sqrt(2 * np.pi)) *\n ... np.exp( - (bins - mu)**2 / (2 * sigma**2) ),\n ... linewidth=2, color=\'r\')\n >>> plt.show()\n\n "; @@ -2929,33 +3206,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":954 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1004 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":955 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1005 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":956 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1006 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":957 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1007 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} - Py_INCREF(__pyx_k73p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k73p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;} + Py_INCREF(__pyx_k74p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1008; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":959 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1009 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -2963,64 +3242,66 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":961 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1011 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":963 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1013 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":964 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1014 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); + __pyx_v_oscale = ((PyArrayObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1015 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":965 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;} - Py_INCREF(__pyx_k74p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;} + Py_INCREF(__pyx_k75p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":967 */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1017 */ + __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_normal,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1017; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -3042,15 +3323,15 @@ return __pyx_r; } -static PyObject *__pyx_k75p; static PyObject *__pyx_k76p; static PyObject *__pyx_k77p; static PyObject *__pyx_k78p; +static PyObject *__pyx_k79p; -static char __pyx_k75[] = "a <= 0"; -static char __pyx_k76[] = "b <= 0"; -static char __pyx_k77[] = "a <= 0"; -static char __pyx_k78[] = "b <= 0"; +static char __pyx_k76[] = "a <= 0"; +static char __pyx_k77[] = "b <= 0"; +static char __pyx_k78[] = "a <= 0"; +static char __pyx_k79[] = "b <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_beta(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_beta[] = "\n beta(a, b, size=None)\n\n The Beta distribution over ``[0, 1]``.\n\n The Beta distribution is a special case of the Dirichlet distribution,\n and is related to the Gamma distribution. It has the probability\n distribution function\n\n .. math:: f(x; a,b) = \\frac{1}{B(\\alpha, \\beta)} x^{\\alpha - 1}\n (1 - x)^{\\beta - 1},\n\n where the normalisation, B, is the beta function,\n\n .. math:: B(\\alpha, \\beta) = \\int_0^1 t^{\\alpha - 1}\n (1 - t)^{\\beta - 1} dt.\n\n It is often seen in Bayesian inference and order statistics.\n\n Parameters\n ----------\n a : float\n Alpha, non-negative.\n b : float\n Beta, non-negative.\n size : tuple of ints, optional\n The number of samples to draw. The ouput is packed according to\n the size given.\n\n Returns\n -------\n out : ndarray\n Array of the given shape, containing values drawn from a\n Beta distribution.\n\n "; @@ -3078,48 +3359,52 @@ __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ob = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1009 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1059 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1010 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1060 */ __pyx_v_fb = PyFloat_AsDouble(__pyx_v_b); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1011 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1061 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1012 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1062 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;} - Py_INCREF(__pyx_k75p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k75p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; goto __pyx_L1;} + Py_INCREF(__pyx_k76p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k76p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1063; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1014 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1064 */ __pyx_1 = (__pyx_v_fb <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} - Py_INCREF(__pyx_k76p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k76p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; goto __pyx_L1;} + Py_INCREF(__pyx_k77p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1015; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1016 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_fa,__pyx_v_fb); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1066 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_fa,__pyx_v_fb); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3127,101 +3412,105 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1018 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1068 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1020 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1070 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oa)); __pyx_v_oa = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1021 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1071 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_ob)); - __pyx_v_ob = ((PyArrayObject *)__pyx_2); + __pyx_v_ob = ((PyArrayObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1072 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1022 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oa)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} - Py_INCREF(__pyx_k77p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;} + Py_INCREF(__pyx_k78p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k78p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1024 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1074 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_ob)); PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_ob)); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5); + __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); + __pyx_5 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;} - Py_INCREF(__pyx_k78p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k78p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;} + Py_INCREF(__pyx_k79p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k79p); + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1026 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_oa,__pyx_v_ob); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; goto __pyx_L1;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1076 */ + __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_beta,__pyx_v_size,__pyx_v_oa,__pyx_v_ob); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;} + __pyx_r = __pyx_3; + __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -3243,11 +3532,11 @@ return __pyx_r; } -static PyObject *__pyx_k79p; static PyObject *__pyx_k80p; +static PyObject *__pyx_k81p; -static char __pyx_k79[] = "scale <= 0"; static char __pyx_k80[] = "scale <= 0"; +static char __pyx_k81[] = "scale <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_exponential(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_exponential[] = "\n exponential(scale=1.0, size=None)\n\n Exponential distribution.\n\n Its probability density function is\n\n .. math:: f(x; \\lambda) = \\lambda \\exp(-\\lambda x),\n\n for ``x > 0`` and 0 elsewhere. :math:`lambda` is\n known as the rate parameter.\n\n The exponential distribution is a continuous analogue of the\n geometric distribution. It describes many common situations, such as\n the size of raindrops measured over many rainstorms [1]_, or the time\n between page requests to Wikipedia [2]_.\n\n Parameters\n ----------\n scale : float\n The rate parameter, :math:`\\lambda`.\n size : tuple of ints\n Number of samples to draw. The output is shaped\n according to `size`.\n\n References\n ----------\n .. [1] Peyton Z. Peebles Jr., \"Probability, Random Variables and\n Random Signal Principles\", 4th ed, 2001, p. 57.\n .. [2] \"Poisson Process\", Wikipedia,\n http://en.wikipedia.org/wiki/Poisson_process\n\n "; @@ -3271,30 +3560,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1065 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1115 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1066 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1116 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1067 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1117 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} - Py_INCREF(__pyx_k79p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k79p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} + Py_INCREF(__pyx_k80p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k80p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1069 */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1119 */ + __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3302,57 +3593,59 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1071 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1121 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1073 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1123 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1074 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1124 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1124; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;} - Py_INCREF(__pyx_k80p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k80p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} + Py_INCREF(__pyx_k81p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k81p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1076 */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1126 */ + __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_exponential,__pyx_v_size,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -3383,7 +3676,7 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; goto __pyx_L1;} + __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_exponential,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -3400,11 +3693,11 @@ return __pyx_r; } -static PyObject *__pyx_k81p; static PyObject *__pyx_k82p; +static PyObject *__pyx_k83p; -static char __pyx_k81[] = "shape <= 0"; static char __pyx_k82[] = "shape <= 0"; +static char __pyx_k83[] = "shape <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_standard_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_standard_gamma[] = "\n standard_gamma(shape, size=None)\n\n Standard Gamma distribution.\n\n "; @@ -3427,30 +3720,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1097 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1147 */ __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1098 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1148 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1099 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1149 */ __pyx_1 = (__pyx_v_fshape <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; goto __pyx_L1;} - Py_INCREF(__pyx_k81p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k81p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; goto __pyx_L1;} + Py_INCREF(__pyx_k82p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k82p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1100; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1101 */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_fshape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1151 */ + __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_fshape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3458,57 +3753,59 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1103 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1153 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1104 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1154 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oshape)); __pyx_v_oshape = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1105 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1155 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oshape)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oshape)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;} - Py_INCREF(__pyx_k82p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k82p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;} + Py_INCREF(__pyx_k83p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k83p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1107 */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_oshape); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1107; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1157 */ + __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_gamma,__pyx_v_size,__pyx_v_oshape); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -3528,15 +3825,15 @@ return __pyx_r; } -static PyObject *__pyx_k83p; static PyObject *__pyx_k84p; static PyObject *__pyx_k85p; static PyObject *__pyx_k86p; +static PyObject *__pyx_k87p; -static char __pyx_k83[] = "shape <= 0"; -static char __pyx_k84[] = "scale <= 0"; -static char __pyx_k85[] = "shape <= 0"; -static char __pyx_k86[] = "scale <= 0"; +static char __pyx_k84[] = "shape <= 0"; +static char __pyx_k85[] = "scale <= 0"; +static char __pyx_k86[] = "shape <= 0"; +static char __pyx_k87[] = "scale <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_gamma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_gamma[] = "\n gamma(shape, scale=1.0, size=None)\n\n Gamma distribution.\n\n "; @@ -3565,48 +3862,52 @@ __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1119 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1169 */ __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1120 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1170 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1121 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1171 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1122 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1172 */ __pyx_1 = (__pyx_v_fshape <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;} - Py_INCREF(__pyx_k83p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k83p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;} + Py_INCREF(__pyx_k84p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k84p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1124 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1174 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} - Py_INCREF(__pyx_k84p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k84p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; goto __pyx_L1;} + Py_INCREF(__pyx_k85p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1126 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_fshape,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1176 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_fshape,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1176; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3614,101 +3915,105 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1128 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1178 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1129 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1129; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1179 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oshape)); __pyx_v_oshape = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1130 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1180 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); + __pyx_v_oscale = ((PyArrayObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1181 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1131 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oshape)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oshape)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;} - Py_INCREF(__pyx_k85p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;} + Py_INCREF(__pyx_k86p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k86p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1133 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1183 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5); + __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); + __pyx_5 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} - Py_INCREF(__pyx_k86p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k86p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;} + Py_INCREF(__pyx_k87p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k87p); + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1184; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1135 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_oshape,__pyx_v_oscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; goto __pyx_L1;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1185 */ + __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gamma,__pyx_v_size,__pyx_v_oshape,__pyx_v_oscale); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;} + __pyx_r = __pyx_3; + __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -3730,15 +4035,15 @@ return __pyx_r; } -static PyObject *__pyx_k87p; static PyObject *__pyx_k88p; static PyObject *__pyx_k89p; static PyObject *__pyx_k90p; +static PyObject *__pyx_k91p; -static char __pyx_k87[] = "shape <= 0"; -static char __pyx_k88[] = "scale <= 0"; -static char __pyx_k89[] = "dfnum <= 0"; -static char __pyx_k90[] = "dfden <= 0"; +static char __pyx_k88[] = "shape <= 0"; +static char __pyx_k89[] = "scale <= 0"; +static char __pyx_k90[] = "dfnum <= 0"; +static char __pyx_k91[] = "dfden <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_f[] = "\n f(dfnum, dfden, size=None)\n\n F distribution.\n\n "; @@ -3766,48 +4071,52 @@ __pyx_v_odfnum = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1147 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1197 */ __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1148 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1198 */ __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1149 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1199 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1150 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1200 */ __pyx_1 = (__pyx_v_fdfnum <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; goto __pyx_L1;} - Py_INCREF(__pyx_k87p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k87p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} + Py_INCREF(__pyx_k88p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k88p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1151; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1152 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1202 */ __pyx_1 = (__pyx_v_fdfden <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;} - Py_INCREF(__pyx_k88p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k88p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} + Py_INCREF(__pyx_k89p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1154 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_fdfnum,__pyx_v_fdfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1204 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_fdfnum,__pyx_v_fdfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3815,101 +4124,105 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1156 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1206 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1158 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1208 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odfnum)); __pyx_v_odfnum = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1159 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1209 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_odfden)); - __pyx_v_odfden = ((PyArrayObject *)__pyx_2); + __pyx_v_odfden = ((PyArrayObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1210 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1160 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_odfnum)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odfnum)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; goto __pyx_L1;} - Py_INCREF(__pyx_k89p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} + Py_INCREF(__pyx_k90p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k90p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1161; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1162 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1212 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_odfden)); PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_odfden)); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5); + __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); + __pyx_5 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;} - Py_INCREF(__pyx_k90p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k90p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} + Py_INCREF(__pyx_k91p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k91p); + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1164 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; goto __pyx_L1;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1214 */ + __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; goto __pyx_L1;} + __pyx_r = __pyx_3; + __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -3933,19 +4246,19 @@ static PyObject *__pyx_n_less; -static PyObject *__pyx_k91p; static PyObject *__pyx_k92p; static PyObject *__pyx_k93p; static PyObject *__pyx_k94p; static PyObject *__pyx_k95p; static PyObject *__pyx_k96p; +static PyObject *__pyx_k97p; -static char __pyx_k91[] = "dfnum <= 1"; -static char __pyx_k92[] = "dfden <= 0"; -static char __pyx_k93[] = "nonc < 0"; -static char __pyx_k94[] = "dfnum <= 1"; -static char __pyx_k95[] = "dfden <= 0"; -static char __pyx_k96[] = "nonc < 0"; +static char __pyx_k92[] = "dfnum <= 1"; +static char __pyx_k93[] = "dfden <= 0"; +static char __pyx_k94[] = "nonc < 0"; +static char __pyx_k95[] = "dfnum <= 1"; +static char __pyx_k96[] = "dfden <= 0"; +static char __pyx_k97[] = "nonc < 0"; static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_f(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_noncentral_f[] = "\n noncentral_f(dfnum, dfden, nonc, size=None)\n\n Noncentral F distribution.\n\n "; @@ -3978,66 +4291,72 @@ __pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1176 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1226 */ __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1177 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1227 */ __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1178 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1228 */ __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1179 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1229 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1180 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1230 */ __pyx_1 = (__pyx_v_fdfnum <= 1); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} - Py_INCREF(__pyx_k91p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k91p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;} + Py_INCREF(__pyx_k92p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k92p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1182 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1232 */ __pyx_1 = (__pyx_v_fdfden <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} - Py_INCREF(__pyx_k92p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k92p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;} + Py_INCREF(__pyx_k93p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k93p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1184 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1234 */ __pyx_1 = (__pyx_v_fnonc < 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;} - Py_INCREF(__pyx_k93p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k93p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;} + Py_INCREF(__pyx_k94p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k94p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1186 */ - __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_fdfnum,__pyx_v_fdfden,__pyx_v_fnonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1236 */ + __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_fdfnum,__pyx_v_fdfden,__pyx_v_fnonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4045,145 +4364,151 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1189 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1239 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1191 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1241 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odfnum)); __pyx_v_odfnum = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1192 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1242 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); + Py_DECREF(((PyObject *)__pyx_v_odfden)); + __pyx_v_odfden = ((PyArrayObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1243 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1243; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_odfden)); - __pyx_v_odfden = ((PyArrayObject *)__pyx_2); + Py_DECREF(((PyObject *)__pyx_v_ononc)); + __pyx_v_ononc = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1193 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1193; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_ononc)); - __pyx_v_ononc = ((PyArrayObject *)__pyx_3); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1245 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1195 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} + __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_odfnum)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odfnum)); PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1195; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;} - Py_INCREF(__pyx_k94p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k94p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; goto __pyx_L1;} + Py_INCREF(__pyx_k95p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k95p); + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1197 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1247 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_odfden)); - PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_odfden)); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_odfden)); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_5); + __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); + __pyx_5 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); - __pyx_4 = 0; - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;} - Py_INCREF(__pyx_k95p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k95p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; goto __pyx_L1;} + Py_INCREF(__pyx_k96p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k96p); + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1199 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1249 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_ononc)); - PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_ononc)); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ononc)); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); + __pyx_4 = 0; + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_3); - __pyx_3 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1199; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; goto __pyx_L1;} - Py_INCREF(__pyx_k96p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k96p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; goto __pyx_L1;} + Py_INCREF(__pyx_k97p); + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k97p); + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1201 */ - __pyx_5 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden,__pyx_v_ononc); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} - __pyx_r = __pyx_5; - __pyx_5 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1251 */ + __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_f,__pyx_v_size,__pyx_v_odfnum,__pyx_v_odfden,__pyx_v_ononc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;} + __pyx_r = __pyx_2; + __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -4207,11 +4532,11 @@ return __pyx_r; } -static PyObject *__pyx_k97p; static PyObject *__pyx_k98p; +static PyObject *__pyx_k99p; -static char __pyx_k97[] = "df <= 0"; static char __pyx_k98[] = "df <= 0"; +static char __pyx_k99[] = "df <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_chisquare[] = "\n chisquare(df, size=None)\n\n Draw samples from a chi-square distribution.\n\n When `df` independent random variables, each with standard\n normal distributions (mean 0, variance 1), are squared and summed,\n the resulting distribution is chi-square (see Notes). This\n distribution is often used in hypothesis testing.\n\n Parameters\n ----------\n df : int\n Number of degrees of freedom.\n size : tuple of ints, int, optional\n Size of the returned array. By default, a scalar is\n returned.\n\n Returns\n -------\n output : ndarray\n Samples drawn from the distribution, packed in a `size`-shaped\n array.\n\n Raises\n ------\n ValueError\n When `df` <= 0 or when an inappropriate `size` (e.g. ``size=-1``)\n is given.\n\n Notes\n -----\n The variable obtained by summing the squares of `df` independent,\n standard normally distributed random variables:\n\n .. math:: Q = \\sum_{i=0}^{\\mathtt{df}} X^2_i\n\n is chi-square distributed, denoted\n\n .. math:: Q \\sim \\chi^2_k.\n\n The probability density function of the chi-squared distribution is\n\n .. math:: p(x) = \\frac{(1/2)^{k/2}}{\\Gamma(k/2)}\n x^{k/2 - 1} e^{-x/2},\n\n where :math:`\\Gamma` is the gamma function,\n\n .. math:: \\Gamma(x) = \\int_0^{-\\infty} t^{x - 1} e^{-t} dt.\n\n References\n ----------\n .. [1] NIST/SEMATECH e-Handbook of Statistical Methods,\n http://www.itl.nist.gov/div898/handbook/eda/section3/eda3666.htm\n .. [2] Wikipedia, \"Chi-square distribution\",\n http://en.wikipedia.org/wiki/Chi-square_distribution\n\n Examples\n --------\n >>> np.random.chisquare(2,4)\n array([ 1.89920014, 9.00867716, 3.13710533, 5.62318272])\n\n "; @@ -4234,30 +4559,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1271 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1321 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1272 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1322 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1273 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1323 */ __pyx_1 = (__pyx_v_fdf <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;} - Py_INCREF(__pyx_k97p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k97p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;} + Py_INCREF(__pyx_k98p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k98p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1275 */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_fdf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1325 */ + __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_fdf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4265,57 +4592,59 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1277 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1327 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1279 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1279; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1329 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odf)); __pyx_v_odf = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1280 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1330 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_odf)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; goto __pyx_L1;} - Py_INCREF(__pyx_k98p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k98p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; goto __pyx_L1;} + Py_INCREF(__pyx_k99p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k99p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1282 */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_odf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1332 */ + __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_chisquare,__pyx_v_size,__pyx_v_odf); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -4335,15 +4664,15 @@ return __pyx_r; } -static PyObject *__pyx_k99p; static PyObject *__pyx_k100p; static PyObject *__pyx_k101p; static PyObject *__pyx_k102p; +static PyObject *__pyx_k103p; -static char __pyx_k99[] = "df <= 0"; -static char __pyx_k100[] = "nonc <= 0"; -static char __pyx_k101[] = "df <= 1"; -static char __pyx_k102[] = "nonc < 0"; +static char __pyx_k100[] = "df <= 0"; +static char __pyx_k101[] = "nonc <= 0"; +static char __pyx_k102[] = "df <= 1"; +static char __pyx_k103[] = "nonc < 0"; static PyObject *__pyx_f_6mtrand_11RandomState_noncentral_chisquare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_noncentral_chisquare[] = "\n noncentral_chisquare(df, nonc, size=None)\n\n Draw samples from a noncentral chi-square distribution.\n\n The noncentral :math:`\\chi^2` distribution is a generalisation of\n the :math:`\\chi^2` distribution.\n\n Parameters\n ----------\n df : int\n Degrees of freedom.\n nonc : float\n Non-centrality.\n size : tuple of ints\n Shape of the output.\n\n "; @@ -4371,48 +4700,52 @@ __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1305 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1355 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1306 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1356 */ __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1307 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1357 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1308 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1358 */ __pyx_1 = (__pyx_v_fdf <= 1); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} - Py_INCREF(__pyx_k99p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k99p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; goto __pyx_L1;} + Py_INCREF(__pyx_k100p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k100p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1359; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1310 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1360 */ __pyx_1 = (__pyx_v_fnonc <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} - Py_INCREF(__pyx_k100p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k100p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} + Py_INCREF(__pyx_k101p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1312 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_fdf,__pyx_v_fnonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1312; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1362 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_fdf,__pyx_v_fnonc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4420,101 +4753,105 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1315 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1365 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1317 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1367 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odf)); __pyx_v_odf = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1318 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1368 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_ononc)); - __pyx_v_ononc = ((PyArrayObject *)__pyx_2); + __pyx_v_ononc = ((PyArrayObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1369 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1319 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_odf)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; goto __pyx_L1;} - Py_INCREF(__pyx_k101p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; goto __pyx_L1;} + Py_INCREF(__pyx_k102p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k102p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1321 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1371 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_ononc)); PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_ononc)); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5); + __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); + __pyx_5 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1321; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; goto __pyx_L1;} - Py_INCREF(__pyx_k102p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k102p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; goto __pyx_L1;} + Py_INCREF(__pyx_k103p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k103p); + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1372; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1323 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_odf,__pyx_v_ononc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; goto __pyx_L1;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1373 */ + __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_noncentral_chisquare,__pyx_v_size,__pyx_v_odf,__pyx_v_ononc); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1373; goto __pyx_L1;} + __pyx_r = __pyx_3; + __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -4547,7 +4884,7 @@ if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_size)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_size); - __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; goto __pyx_L1;} + __pyx_1 = __pyx_f_6mtrand_cont0_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_cauchy,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -4564,11 +4901,11 @@ return __pyx_r; } -static PyObject *__pyx_k103p; static PyObject *__pyx_k104p; +static PyObject *__pyx_k105p; -static char __pyx_k103[] = "df <= 0"; static char __pyx_k104[] = "df <= 0"; +static char __pyx_k105[] = "df <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_standard_t(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_standard_t[] = "\n standard_t(df, size=None)\n\n Standard Student\'s t distribution with df degrees of freedom.\n\n "; @@ -4591,30 +4928,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1345 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1395 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1346 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1396 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1347 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1397 */ __pyx_1 = (__pyx_v_fdf <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; goto __pyx_L1;} - Py_INCREF(__pyx_k103p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k103p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; goto __pyx_L1;} + Py_INCREF(__pyx_k104p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k104p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1348; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1349 */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_fdf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1399 */ + __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_fdf); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4622,57 +4961,59 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1351 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1401 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1353 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1403 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_odf)); __pyx_v_odf = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1354 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1404 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_odf)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_odf)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; goto __pyx_L1;} - Py_INCREF(__pyx_k104p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k104p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + Py_INCREF(__pyx_k105p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k105p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1356 */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_odf); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1406 */ + __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_standard_t,__pyx_v_size,__pyx_v_odf); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -4692,11 +5033,11 @@ return __pyx_r; } -static PyObject *__pyx_k105p; static PyObject *__pyx_k106p; +static PyObject *__pyx_k107p; -static char __pyx_k105[] = "kappa < 0"; static char __pyx_k106[] = "kappa < 0"; +static char __pyx_k107[] = "kappa < 0"; static PyObject *__pyx_f_6mtrand_11RandomState_vonmises(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_vonmises[] = "\n vonmises(mu=0.0, kappa=1.0, size=None)\n\n Draw samples from a von Mises distribution.\n\n Samples are drawn from a von Mises distribution with specified mode (mu)\n and dispersion (kappa), on the interval [-pi, pi].\n\n The von Mises distribution (also known as the circular normal\n distribution) is a continuous probability distribution on the circle. It\n may be thought of as the circular analogue of the normal distribution.\n\n Parameters\n ----------\n mu : float\n Mode (\"center\") of the distribution.\n kappa : float, >= 0.\n Dispersion of the distribution.\n size : {tuple, int}\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n Returns\n -------\n samples : {ndarray, scalar}\n The returned samples live on the unit circle [-\\pi, \\pi].\n\n See Also\n --------\n scipy.stats.distributions.vonmises : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the von Mises distribution is\n\n .. math:: p(x) = \\frac{e^{\\kappa cos(x-\\mu)}}{2\\pi I_0(\\kappa)},\n\n where :math:`\\mu` is the mode and :math:`\\kappa` the dispersion,\n and :math:`I_0(\\kappa)` is the modified Bessel function of order 0.\n\n The von Mises, named for Richard Edler von Mises, born in\n Austria-Hungary, in what is now the Ukraine. He fled to the United\n States in 1939 and became a professor at Harvard. He worked in\n probability theory, aerodynamics, fluid mechanics, and philosophy of\n science.\n\n References\n ----------\n .. [1] Abramowitz, M. and Stegun, I. A. (ed.), Handbook of Mathematical\n Functions, National Bureau of Standards, 1964; reprinted Dover\n Publications, 1965.\n .. [2] von Mises, Richard, 1964, Mathematical Theory of Probability\n and Statistics (New York: Academic Press).\n .. [3] Wikipedia, \"Von Mises distribution\",\n http://en.wikipedia.org/wiki/Von_Mises_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, kappa = 0.0, 4.0 # mean and dispersion\n >>> s = np.random.vonmises(mu, kappa, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> import scipy.special as sps\n >>> count, bins, ignored = plt.hist(s, 50, normed=True)\n >>> x = arange(-pi, pi, 2*pi/50.)\n >>> y = -np.exp(kappa*np.cos(x-mu))/(2*pi*sps.jn(0,kappa))\n >>> plt.plot(x, y/max(y), linewidth=2, color=\'r\')\n >>> plt.show()\n\n "; @@ -4724,33 +5065,35 @@ __pyx_v_omu = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_okappa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1438 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1488 */ __pyx_v_fmu = PyFloat_AsDouble(__pyx_v_mu); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1439 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1489 */ __pyx_v_fkappa = PyFloat_AsDouble(__pyx_v_kappa); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1440 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1490 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1441 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1491 */ __pyx_1 = (__pyx_v_fkappa < 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; goto __pyx_L1;} - Py_INCREF(__pyx_k105p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k105p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} + Py_INCREF(__pyx_k106p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1443 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_fmu,__pyx_v_fkappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1443; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1493 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_fmu,__pyx_v_fkappa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4758,64 +5101,66 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1445 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1495 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1447 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1497 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_omu)); __pyx_v_omu = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1448 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1498 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_okappa)); - __pyx_v_okappa = ((PyArrayObject *)__pyx_2); + __pyx_v_okappa = ((PyArrayObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1499 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1449 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_okappa)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_okappa)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; goto __pyx_L1;} - Py_INCREF(__pyx_k106p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;} + Py_INCREF(__pyx_k107p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1500; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1451 */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_omu,__pyx_v_okappa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1451; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1501 */ + __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_vonmises,__pyx_v_size,__pyx_v_omu,__pyx_v_okappa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -4837,11 +5182,11 @@ return __pyx_r; } -static PyObject *__pyx_k107p; static PyObject *__pyx_k108p; +static PyObject *__pyx_k109p; -static char __pyx_k107[] = "a <= 0"; static char __pyx_k108[] = "a <= 0"; +static char __pyx_k109[] = "a <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_pareto(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_pareto[] = "\n pareto(a, size=None)\n\n Draw samples from a Pareto distribution with specified shape.\n\n This is a simplified version of the Generalized Pareto distribution\n (available in SciPy), with the scale set to one and the location set to\n zero. Most authors default the location to one.\n\n The Pareto distribution must be greater than zero, and is unbounded above.\n It is also known as the \"80-20 rule\". In this distribution, 80 percent of\n the weights are in the lowest 20 percent of the range, while the other 20\n percent fill the remaining 80 percent of the range.\n\n Parameters\n ----------\n shape : float, > 0.\n Shape of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.distributions.genpareto.pdf : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Pareto distribution is\n\n .. math:: p(x) = \\frac{am^a}{x^{a+1}}\n\n where :math:`a` is the shape and :math:`m` the location\n\n The Pareto distribution, named after the Italian economist Vilfredo Pareto,\n is a power law probability distribution useful in many real world problems.\n Outside the field of economics it is generally referred to as the Bradford\n distribution. Pareto developed the distribution to describe the\n distribution of wealth in an economy. It has also found use in insurance,\n web page access statistics, oil field sizes, and many other problems,\n including the download frequency for projects in Sourceforge [1]. It is\n one of the so-called \"fat-tailed\" distributions.\n\n\n References\n ----------\n .. [1] Francis Hunt and Paul Johnson, On the Pareto Distribution of\n Sourceforge projects.\n .. [2] Pareto, V. (1896). Course of Political Economy. Lausanne.\n .. [3] Reiss, R.D., Thomas, M.(2001), Statistical Analysis of Extreme\n Values, Birkhauser Verlag, Basel, pp 23-30.\n .. [4] Wikipedia, \"Pareto distribution\",\n http://en.wikipedia.org/wiki/Pareto_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> a, m = 3., 1. # shape and mode\n >>> s = np.random.pareto(a, 1000) + m\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 100, normed=True, align=\'center\')\n >>> fit = a*m**a/bins**(a+1)\n >>> plt.plot(bins, max(count)*fit/max(fit),linewidth=2, color=\'r\')\n >>> plt.show()\n\n "; @@ -4864,30 +5209,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1529 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1579 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1530 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1580 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1531 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1581 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;} - Py_INCREF(__pyx_k107p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k107p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; goto __pyx_L1;} + Py_INCREF(__pyx_k108p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k108p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1533 */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1583 */ + __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4895,57 +5242,59 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1535 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1585 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1537 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1587 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1587; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oa)); __pyx_v_oa = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1538 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1588 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oa)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; goto __pyx_L1;} - Py_INCREF(__pyx_k108p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k108p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; goto __pyx_L1;} + Py_INCREF(__pyx_k109p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k109p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1589; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1540 */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1590 */ + __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_pareto,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1590; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -4965,11 +5314,11 @@ return __pyx_r; } -static PyObject *__pyx_k109p; static PyObject *__pyx_k110p; +static PyObject *__pyx_k111p; -static char __pyx_k109[] = "a <= 0"; static char __pyx_k110[] = "a <= 0"; +static char __pyx_k111[] = "a <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_weibull(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_weibull[] = "\n weibull(a, size=None)\n\n Weibull distribution.\n\n Draw samples from a 1-parameter Weibull distribution with the given\n shape parameter.\n\n .. math:: X = (-ln(U))^{1/a}\n\n Here, U is drawn from the uniform distribution over (0,1].\n\n The more common 2-parameter Weibull, including a scale parameter\n :math:`\\lambda` is just :math:`X = \\lambda(-ln(U))^{1/a}`.\n\n The Weibull (or Type III asymptotic extreme value distribution for smallest\n values, SEV Type III, or Rosin-Rammler distribution) is one of a class of\n Generalized Extreme Value (GEV) distributions used in modeling extreme\n value problems. This class includes the Gumbel and Frechet distributions.\n\n Parameters\n ----------\n a : float\n Shape of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.distributions.weibull : probability density function,\n distribution or cumulative density function, etc.\n\n gumbel, scipy.stats.distributions.genextreme\n\n Notes\n -----\n The probability density for the Weibull distribution is\n\n .. math:: p(x) = \\frac{a}\n {\\lambda}(\\frac{x}{\\lambda})^{a-1}e^{-(x/\\lambda)^a},\n\n where :math:`a` is the shape and :math:`\\lambda` the scale.\n\n The function has its peak (the mode) at\n :math:`\\lambda(\\frac{a-1}{a})^{1/a}`.\n\n When ``a = 1``, the Weibull distribution reduces to the exponential\n distribution.\n\n References\n ----------\n .. [1] Waloddi Weibull, Professor, Royal Technical University, Stockholm,\n 1939 \"A Statistical Theory Of The Strength Of Materials\",\n Ingeniorsvetenskapsakademiens Handlingar Nr 151, 1939,\n Generalstabens Litografiska Anstalts Forlag, Stockholm.\n .. [2] Waloddi Weibull, 1951 \"A Statistical Distribution Function of Wide\n Applicability\", Journal Of Applied Mechanics ASME Paper.\n .. [3] Wikipedia, \"Weibull distribution\",\n http://en.wikipedia.org/wiki/Weibull_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> a = 5. # shape\n >>> s = np.random.weibull(a, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> def weib(x,n,a):\n ... return (a/n)*(x/n)**(a-1)*exp(-(x/n)**a)\n\n >>> count, bins, ignored = plt.hist(numpy.random.weibull(5.,1000))\n >>> scale = count.max()/weib(x, 1., 5.).max()\n >>> x = arange(1,100.)/50.\n >>> plt.plot(x, weib(x, 1., 5.)*scale)\n >>> plt.show()\n\n "; @@ -4992,30 +5341,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1628 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1678 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1629 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1679 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1630 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1680 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; goto __pyx_L1;} - Py_INCREF(__pyx_k109p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k109p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;} + Py_INCREF(__pyx_k110p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k110p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1631; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1632 */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1682 */ + __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5023,57 +5374,59 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1634 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1684 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1636 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1636; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1686 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oa)); __pyx_v_oa = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1637 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1687 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oa)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1637; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; goto __pyx_L1;} - Py_INCREF(__pyx_k110p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k110p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;} + Py_INCREF(__pyx_k111p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k111p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1639 */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1689 */ + __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_weibull,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -5093,11 +5446,11 @@ return __pyx_r; } -static PyObject *__pyx_k111p; static PyObject *__pyx_k112p; +static PyObject *__pyx_k113p; -static char __pyx_k111[] = "a <= 0"; static char __pyx_k112[] = "a <= 0"; +static char __pyx_k113[] = "a <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_power(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_power[] = "\n power(a, size=None)\n\n Power distribution.\n\n "; @@ -5120,30 +5473,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1651 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1701 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1652 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1702 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1653 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1703 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; goto __pyx_L1;} - Py_INCREF(__pyx_k111p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k111p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;} + Py_INCREF(__pyx_k112p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k112p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1655 */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1705 */ + __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5151,57 +5506,59 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1657 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1707 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1659 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1709 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oa)); __pyx_v_oa = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1660 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1710 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oa)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1660; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; goto __pyx_L1;} - Py_INCREF(__pyx_k112p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;} + Py_INCREF(__pyx_k113p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1662 */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1712 */ + __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_power,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -5221,11 +5578,11 @@ return __pyx_r; } -static PyObject *__pyx_k113p; static PyObject *__pyx_k114p; +static PyObject *__pyx_k115p; -static char __pyx_k113[] = "scale <= 0"; static char __pyx_k114[] = "scale <= 0"; +static char __pyx_k115[] = "scale <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_laplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_laplace[] = "\n laplace(loc=0.0, scale=1.0, size=None)\n\n Laplace or double exponential distribution.\n\n It has the probability density function\n\n .. math:: f(x; \\mu, \\lambda) = \\frac{1}{2\\lambda}\n \\exp\\left(-\\frac{|x - \\mu|}{\\lambda}\\right).\n\n The Laplace distribution is similar to the Gaussian/normal distribution,\n but is sharper at the peak and has fatter tails.\n\n Parameters\n ----------\n loc : float\n The position, :math:`\\mu`, of the distribution peak.\n scale : float\n :math:`\\lambda`, the exponential decay.\n\n "; @@ -5255,33 +5612,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1689 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1739 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1690 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1740 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1691 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1741 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1692 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1742 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;} - Py_INCREF(__pyx_k113p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k113p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; goto __pyx_L1;} + Py_INCREF(__pyx_k114p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k114p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1743; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1694 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1744 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5289,64 +5648,66 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1696 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1746 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1697 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1747 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1698 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1748 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); - __pyx_2 = 0; + __pyx_v_oscale = ((PyArrayObject *)__pyx_4); + __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1699 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1749 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;} - Py_INCREF(__pyx_k114p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k114p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; goto __pyx_L1;} + Py_INCREF(__pyx_k115p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1701 */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1751 */ + __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_laplace,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -5368,11 +5729,11 @@ return __pyx_r; } -static PyObject *__pyx_k115p; static PyObject *__pyx_k116p; +static PyObject *__pyx_k117p; -static char __pyx_k115[] = "scale <= 0"; static char __pyx_k116[] = "scale <= 0"; +static char __pyx_k117[] = "scale <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_gumbel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_gumbel[] = "\n gumbel(loc=0.0, scale=1.0, size=None)\n\n Gumbel distribution.\n\n Draw samples from a Gumbel distribution with specified location (or mean)\n and scale (or standard deviation).\n\n The Gumbel (or Smallest Extreme Value (SEV) or the Smallest Extreme Value\n Type I) distribution is one of a class of Generalized Extreme Value (GEV)\n distributions used in modeling extreme value problems. The Gumbel is a\n special case of the Extreme Value Type I distribution for maximums from\n distributions with \"exponential-like\" tails, it may be derived by\n considering a Gaussian process of measurements, and generating the pdf for\n the maximum values from that set of measurements (see examples).\n\n Parameters\n ----------\n loc : float\n The location of the mode of the distribution.\n scale : float\n The scale parameter of the distribution.\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.gumbel : probability density function,\n distribution or cumulative density function, etc.\n weibull, scipy.stats.genextreme\n\n Notes\n -----\n The probability density for the Gumbel distribution is\n\n .. math:: p(x) = \\frac{e^{-(x - \\mu)/ \\beta}}{\\beta} e^{ -e^{-(x - \\mu)/\n \\beta}},\n\n where :math:`\\mu` is the mode, a location parameter, and :math:`\\beta`\n is the scale parameter.\n\n The Gumbel (named for German mathematician Emil Julius Gumbel) was used\n very early in the hydrology literature, for modeling the occurrence of\n flood events. It is also used for modeling maximum wind speed and rainfall\n rates. It is a \"fat-tailed\" distribution - the probability of an event in\n the tail of the distribution is larger than if one used a Gaussian, hence\n the surprisingly frequent occurrence of 100-year floods. Floods were\n initially modeled as a Gaussian process, which underestimated the frequency\n of extreme events.\n\n It is one of a class of extreme value distributions, the Generalized\n Extreme Value (GEV) distributions, which also includes the Weibull and\n Frechet.\n\n The function has a mean of :math:`\\mu + 0.57721\\beta` and a variance of\n :math:`\\frac{\\pi^2}{6}\\beta^2`.\n\n References\n ----------\n .. [1] Gumbel, E.J. (1958). Statistics of Extremes. Columbia University\n Press.\n .. [2] Reiss, R.-D. and Thomas M. (2001), Statistical Analysis of Extreme\n Values, from Insurance, Finance, Hydrology and Other Fields,\n Birkhauser Verlag, Basel: Boston : Berlin.\n .. [3] Wikipedia, \"Gumbel distribution\",\n http://en.wikipedia.org/wiki/Gumbel_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, beta = 0, 0.1 # location and scale\n >>> s = np.random.gumbel(mu, beta, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 30, normed=True)\n >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)*\n ... np.exp( -np.exp( -(bins - mu) /beta) ),\n ... linewidth=2, color=\'r\')\n >>> plt.show()\n\n Show how an extreme value distribution can arise from a Gaussian process\n and compare to a Gaussian:\n\n >>> means = []\n >>> maxima = []\n >>> for i in range(0,1000) :\n ... a = np.random.normal(mu, beta, 1000)\n ... means.append(a.mean())\n ... maxima.append(a.max())\n >>> count, bins, ignored = plt.hist(maxima, 30, normed=True)\n >>> beta = np.std(maxima)*np.pi/np.sqrt(6)\n >>> mu = np.mean(maxima) - 0.57721*beta\n >>> plt.plot(bins, (1/beta)*np.exp(-(bins - mu)/beta)*\n ... np.exp( -np.exp( -(bins - mu) /beta) ),\n ... linewidth=2, color=\'r\')\n >>> plt.plot(bins, 1/(beta * np.sqrt(2 * np.pi)) *\n ... np.exp( - (bins - mu)**2 / (2 * beta**2) ),\n ... linewidth=2, color=\'g\')\n >>> plt.show()\n\n "; @@ -5402,33 +5763,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1813 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1863 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1814 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1864 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1815 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1865 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1816 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1866 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; goto __pyx_L1;} - Py_INCREF(__pyx_k115p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k115p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; goto __pyx_L1;} + Py_INCREF(__pyx_k116p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k116p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1867; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1818 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1868 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1868; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5436,64 +5799,66 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1820 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1870 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1821 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1871 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1871; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1822 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1872 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1872; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); - __pyx_2 = 0; + __pyx_v_oscale = ((PyArrayObject *)__pyx_4); + __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1823 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1873 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1823; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1873; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; goto __pyx_L1;} - Py_INCREF(__pyx_k116p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k116p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; goto __pyx_L1;} + Py_INCREF(__pyx_k117p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1825 */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1875 */ + __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_gumbel,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -5515,11 +5880,11 @@ return __pyx_r; } -static PyObject *__pyx_k117p; static PyObject *__pyx_k118p; +static PyObject *__pyx_k119p; -static char __pyx_k117[] = "scale <= 0"; static char __pyx_k118[] = "scale <= 0"; +static char __pyx_k119[] = "scale <= 0"; static PyObject *__pyx_f_6mtrand_11RandomState_logistic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_logistic[] = "\n logistic(loc=0.0, scale=1.0, size=None)\n\n Logistic distribution.\n\n "; @@ -5549,33 +5914,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1837 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1887 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1838 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1888 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1839 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1889 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1840 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1890 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; goto __pyx_L1;} - Py_INCREF(__pyx_k117p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k117p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; goto __pyx_L1;} + Py_INCREF(__pyx_k118p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k118p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1841; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1842 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1842; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1892 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_floc,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5583,64 +5950,66 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1844 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1894 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1845 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1845; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1845; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1895 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1846 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1896 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); - __pyx_2 = 0; + __pyx_v_oscale = ((PyArrayObject *)__pyx_4); + __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1847 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1897 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; goto __pyx_L1;} - Py_INCREF(__pyx_k118p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k118p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; goto __pyx_L1;} + Py_INCREF(__pyx_k119p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k119p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1849 */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1849; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1899 */ + __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logistic,__pyx_v_size,__pyx_v_oloc,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -5662,11 +6031,11 @@ return __pyx_r; } -static PyObject *__pyx_k119p; static PyObject *__pyx_k120p; +static PyObject *__pyx_k121p; -static char __pyx_k119[] = "sigma <= 0"; -static char __pyx_k120[] = "sigma <= 0.0"; +static char __pyx_k120[] = "sigma <= 0"; +static char __pyx_k121[] = "sigma <= 0.0"; static PyObject *__pyx_f_6mtrand_11RandomState_lognormal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_lognormal[] = "\n lognormal(mean=0.0, sigma=1.0, size=None)\n\n Log-normal distribution.\n\n Draw samples from a log-normal distribution with specified mean, standard\n deviation, and shape. Note that the mean and standard deviation are not the\n values for the distribution itself, but of the underlying normal\n distribution it is derived from.\n\n\n Parameters\n ----------\n mean : float\n Mean value of the underlying normal distribution\n sigma : float, >0.\n Standard deviation of the underlying normal distribution\n size : tuple of ints\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n See Also\n --------\n scipy.stats.lognorm : probability density function, distribution,\n cumulative density function, etc.\n\n Notes\n -----\n A variable `x` has a log-normal distribution if `log(x)` is normally\n distributed.\n\n The probability density function for the log-normal distribution is\n\n .. math:: p(x) = \\frac{1}{\\sigma x \\sqrt{2\\pi}}\n e^{(-\\frac{(ln(x)-\\mu)^2}{2\\sigma^2})}\n\n where :math:`\\mu` is the mean and :math:`\\sigma` is the standard deviation\n of the normally distributed logarithm of the variable.\n\n A log normal distribution results if a random variable is the *product* of\n a large number of independent, identically-distributed variables in the\n same way that a normal distribution results if the variable is the *sum*\n of a large number of independent, identically-distributed variables\n (see the last example). It is one of the so-called \"fat-tailed\"\n distributions.\n\n The log-normal distribution is commonly used to model the lifespan of units\n with fatigue-stress failure modes. Since this includes\n most mechanical systems, the lognormal distribution has widespread\n application.\n\n It is also commonly used to model oil field sizes, species abundance, and\n latent periods of infectious diseases.\n\n References\n ----------\n .. [1] Eckhard Limpert, Werner A. Stahel, and Markus Abbt, \"Log-normal\n Distributions across the Sciences: Keys and Clues\", May 2001\n Vol. 51 No. 5 BioScience\n http://stat.ethz.ch/~stahel/lognormal/bioscience.pdf\n .. [2] Reiss, R.D., Thomas, M.(2001), Statistical Analysis of Extreme\n Values, Birkhauser Verlag, Basel, pp 31-32.\n .. [3] Wikipedia, \"Lognormal distribution\",\n http://en.wikipedia.org/wiki/Lognormal_distribution\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> mu, sigma = 3., 1. # mean and standard deviation\n >>> s = np.random.lognormal(mu, sigma, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> count, bins, ignored = plt.hist(s, 100, normed=True, align=\'center\')\n\n >>> x = np.linspace(min(bins), max(bins), 10000)\n >>> pdf = (np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2))\n ... / (x * sigma * np.sqrt(2 * np.pi)))\n\n >>> plt.plot(x, pdf, linewidth=2, color=\'r\')\n >>> plt.axis(\'tight\')\n >>> plt.show()\n\n Demonstrate that taking the products of random samples from a uniform\n distribution can be fit well by a log-normal pdf.\n\n >>> # Generate a thousand samples: each is the product of 100 random\n >>> # values, drawn from a normal distribution.\n >>> b = []\n >>> for i in range(1000):\n ... a = 10. + np.random.random(100)\n ... b.append(np.product(a))\n\n >>> b = np.array(b) / np.min(b) # scale values to be positive\n\n >>> count, bins, ignored = plt.hist(b, 100, normed=True, align=\'center\')\n\n >>> sigma = np.std(np.log(b))\n >>> mu = np.mean(np.log(b))\n\n >>> x = np.linspace(min(bins), max(bins), 10000)\n >>> pdf = (np.exp(-(np.log(x) - mu)**2 / (2 * sigma**2))\n ... / (x * sigma * np.sqrt(2 * np.pi)))\n\n >>> plt.plot(x, pdf, color=\'r\', linewidth=2)\n >>> plt.show()\n\n "; @@ -5696,33 +6065,35 @@ __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_osigma = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1966 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2016 */ __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1967 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2017 */ __pyx_v_fsigma = PyFloat_AsDouble(__pyx_v_sigma); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1969 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2019 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1970 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2020 */ __pyx_1 = (__pyx_v_fsigma <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; goto __pyx_L1;} - Py_INCREF(__pyx_k119p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k119p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; goto __pyx_L1;} + Py_INCREF(__pyx_k120p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k120p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1972 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_fmean,__pyx_v_fsigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1972; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2022 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_fmean,__pyx_v_fsigma); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5730,64 +6101,66 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1974 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2024 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1976 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2026 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); __pyx_v_omean = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1977 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1977; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2027 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_osigma)); - __pyx_v_osigma = ((PyArrayObject *)__pyx_2); - __pyx_2 = 0; + __pyx_v_osigma = ((PyArrayObject *)__pyx_4); + __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1978 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2028 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_osigma)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_osigma)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; goto __pyx_L1;} - Py_INCREF(__pyx_k120p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k120p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;} + Py_INCREF(__pyx_k121p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k121p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1979; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1980 */ - __pyx_4 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_omean,__pyx_v_osigma); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1980; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2030 */ + __pyx_5 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_lognormal,__pyx_v_size,__pyx_v_omean,__pyx_v_osigma); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -5809,11 +6182,11 @@ return __pyx_r; } -static PyObject *__pyx_k121p; static PyObject *__pyx_k122p; +static PyObject *__pyx_k123p; -static char __pyx_k121[] = "scale <= 0"; -static char __pyx_k122[] = "scale <= 0.0"; +static char __pyx_k122[] = "scale <= 0"; +static char __pyx_k123[] = "scale <= 0.0"; static PyObject *__pyx_f_6mtrand_11RandomState_rayleigh(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_rayleigh[] = "\n rayleigh(scale=1.0, size=None)\n\n Rayleigh distribution.\n\n "; @@ -5837,30 +6210,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1992 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2042 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1994 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2044 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1995 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2045 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; goto __pyx_L1;} - Py_INCREF(__pyx_k121p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k121p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; goto __pyx_L1;} + Py_INCREF(__pyx_k122p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k122p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1996; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1997 */ - __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2047 */ + __pyx_2 = __pyx_f_6mtrand_cont1_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5868,57 +6243,59 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1999 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2049 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2001 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2001; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2051 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2051; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2002 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2052 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2002; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; goto __pyx_L1;} - Py_INCREF(__pyx_k122p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k122p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; goto __pyx_L1;} + Py_INCREF(__pyx_k123p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k123p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2053; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2004 */ - __pyx_4 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_oscale); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2004; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2054 */ + __pyx_5 = __pyx_f_6mtrand_cont1_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_rayleigh,__pyx_v_size,__pyx_v_oscale); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -5938,15 +6315,15 @@ return __pyx_r; } -static PyObject *__pyx_k123p; static PyObject *__pyx_k124p; static PyObject *__pyx_k125p; static PyObject *__pyx_k126p; +static PyObject *__pyx_k127p; -static char __pyx_k123[] = "mean <= 0"; -static char __pyx_k124[] = "scale <= 0"; -static char __pyx_k125[] = "mean <= 0.0"; -static char __pyx_k126[] = "scale <= 0.0"; +static char __pyx_k124[] = "mean <= 0"; +static char __pyx_k125[] = "scale <= 0"; +static char __pyx_k126[] = "mean <= 0.0"; +static char __pyx_k127[] = "scale <= 0.0"; static PyObject *__pyx_f_6mtrand_11RandomState_wald(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_wald[] = "\n wald(mean, scale, size=None)\n\n Wald (inverse Gaussian) distribution.\n\n "; @@ -5974,48 +6351,52 @@ __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2016 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2066 */ __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2017 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2067 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2018 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2068 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2019 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2069 */ __pyx_1 = (__pyx_v_fmean <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;} - Py_INCREF(__pyx_k123p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k123p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;} + Py_INCREF(__pyx_k124p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k124p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2021 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2071 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; goto __pyx_L1;} - Py_INCREF(__pyx_k124p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k124p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; goto __pyx_L1;} + Py_INCREF(__pyx_k125p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k125p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2022; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2023 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_fmean,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2023; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2073 */ + __pyx_2 = __pyx_f_6mtrand_cont2_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_fmean,__pyx_v_fscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6023,98 +6404,102 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2025 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2075 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2026 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2026; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2076 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); __pyx_v_omean = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2027 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2027; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2077 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2077; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2077; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); - __pyx_v_oscale = ((PyArrayObject *)__pyx_2); - __pyx_2 = 0; + __pyx_v_oscale = ((PyArrayObject *)__pyx_4); + __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2028 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2078 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_omean)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_omean)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2078; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;} - Py_INCREF(__pyx_k125p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k125p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; goto __pyx_L1;} + Py_INCREF(__pyx_k126p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k126p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; goto __pyx_L1;} goto __pyx_L5; } - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_oscale)); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5); + __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); + __pyx_5 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; goto __pyx_L1;} - Py_INCREF(__pyx_k126p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k126p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; goto __pyx_L1;} + Py_INCREF(__pyx_k127p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k127p); + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2031; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2081; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2032 */ - __pyx_2 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_omean,__pyx_v_oscale); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2032; goto __pyx_L1;} - __pyx_r = __pyx_2; - __pyx_2 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2082 */ + __pyx_3 = __pyx_f_6mtrand_cont2_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_wald,__pyx_v_size,__pyx_v_omean,__pyx_v_oscale); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; goto __pyx_L1;} + __pyx_r = __pyx_3; + __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -6139,19 +6524,19 @@ static PyObject *__pyx_n_greater; static PyObject *__pyx_n_equal; -static PyObject *__pyx_k127p; static PyObject *__pyx_k128p; static PyObject *__pyx_k129p; static PyObject *__pyx_k130p; static PyObject *__pyx_k131p; static PyObject *__pyx_k132p; +static PyObject *__pyx_k133p; -static char __pyx_k127[] = "left > mode"; -static char __pyx_k128[] = "mode > right"; -static char __pyx_k129[] = "left == right"; -static char __pyx_k130[] = "left > mode"; -static char __pyx_k131[] = "mode > right"; -static char __pyx_k132[] = "left == right"; +static char __pyx_k128[] = "left > mode"; +static char __pyx_k129[] = "mode > right"; +static char __pyx_k130[] = "left == right"; +static char __pyx_k131[] = "left > mode"; +static char __pyx_k132[] = "mode > right"; +static char __pyx_k133[] = "left == right"; static PyObject *__pyx_f_6mtrand_11RandomState_triangular(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_triangular[] = "\n triangular(left, mode, right, size=None)\n\n Triangular distribution starting at left, peaking at mode, and\n ending at right (left <= mode <= right).\n\n "; @@ -6184,66 +6569,72 @@ __pyx_v_omode = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oright = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2047 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2097 */ __pyx_v_fleft = PyFloat_AsDouble(__pyx_v_left); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2048 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2098 */ __pyx_v_fright = PyFloat_AsDouble(__pyx_v_right); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2049 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2099 */ __pyx_v_fmode = PyFloat_AsDouble(__pyx_v_mode); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2050 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2100 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2051 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2101 */ __pyx_1 = (__pyx_v_fleft > __pyx_v_fmode); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} - Py_INCREF(__pyx_k127p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k127p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;} + Py_INCREF(__pyx_k128p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k128p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2053 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2103 */ __pyx_1 = (__pyx_v_fmode > __pyx_v_fright); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; goto __pyx_L1;} - Py_INCREF(__pyx_k128p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k128p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;} + Py_INCREF(__pyx_k129p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k129p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2055 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2105 */ __pyx_1 = (__pyx_v_fleft == __pyx_v_fright); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; goto __pyx_L1;} - Py_INCREF(__pyx_k129p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k129p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;} + Py_INCREF(__pyx_k130p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k130p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2056; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2057 */ - __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_fleft,__pyx_v_fmode,__pyx_v_fright); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2057; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2107 */ + __pyx_2 = __pyx_f_6mtrand_cont3_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_fleft,__pyx_v_fmode,__pyx_v_fright); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2107; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6251,140 +6642,146 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2060 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2110 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2061 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2111 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oleft)); __pyx_v_oleft = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2062 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2112 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); + Py_DECREF(((PyObject *)__pyx_v_omode)); + __pyx_v_omode = ((PyArrayObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2113 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2113; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); - Py_DECREF(((PyObject *)__pyx_v_omode)); - __pyx_v_omode = ((PyArrayObject *)__pyx_2); + Py_DECREF(((PyObject *)__pyx_v_oright)); + __pyx_v_oright = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2063 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2063; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); - Py_DECREF(((PyObject *)__pyx_v_oright)); - __pyx_v_oright = ((PyArrayObject *)__pyx_3); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2115 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2065 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oleft)); PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_oleft)); Py_INCREF(((PyObject *)__pyx_v_omode)); PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_omode)); - __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5); + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); __pyx_5 = 0; - __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2115; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; goto __pyx_L1;} - Py_INCREF(__pyx_k130p); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k130p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; goto __pyx_L1;} + Py_INCREF(__pyx_k131p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k131p); + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2067 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2117 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_omode)); - PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_omode)); + PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_omode)); Py_INCREF(((PyObject *)__pyx_v_oright)); - PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject *)__pyx_v_oright)); - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_oright)); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); - __pyx_5 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); + __pyx_4 = 0; + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2117; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; goto __pyx_L1;} - Py_INCREF(__pyx_k131p); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k131p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; goto __pyx_L1;} + Py_INCREF(__pyx_k132p); + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k132p); + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; goto __pyx_L1;} + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2069 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2119 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oleft)); - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_oleft)); + PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_oleft)); Py_INCREF(((PyObject *)__pyx_v_oright)); - PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_v_oright)); - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_oright)); + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); __pyx_5 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2119; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;} - Py_INCREF(__pyx_k132p); - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k132p); - __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; goto __pyx_L1;} + Py_INCREF(__pyx_k133p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k133p); + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __Pyx_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; goto __pyx_L1;} + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2120; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2071 */ - __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_oleft,__pyx_v_omode,__pyx_v_oright); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2121 */ + __pyx_2 = __pyx_f_6mtrand_cont3_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_triangular,__pyx_v_size,__pyx_v_oleft,__pyx_v_omode,__pyx_v_oright); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2121; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6410,19 +6807,19 @@ return __pyx_r; } -static PyObject *__pyx_k133p; static PyObject *__pyx_k134p; static PyObject *__pyx_k135p; static PyObject *__pyx_k136p; static PyObject *__pyx_k137p; static PyObject *__pyx_k138p; +static PyObject *__pyx_k139p; -static char __pyx_k133[] = "n <= 0"; -static char __pyx_k134[] = "p < 0"; -static char __pyx_k135[] = "p > 1"; -static char __pyx_k136[] = "n <= 0"; -static char __pyx_k137[] = "p < 0"; -static char __pyx_k138[] = "p > 1"; +static char __pyx_k134[] = "n <= 0"; +static char __pyx_k135[] = "p < 0"; +static char __pyx_k136[] = "p > 1"; +static char __pyx_k137[] = "n <= 0"; +static char __pyx_k138[] = "p < 0"; +static char __pyx_k139[] = "p > 1"; static PyObject *__pyx_f_6mtrand_11RandomState_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_binomial[] = "\n binomial(n, p, size=None)\n\n Binomial distribution of n trials and p probability of success.\n\n "; @@ -6450,60 +6847,66 @@ __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2086 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2136 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2087 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2137 */ __pyx_v_ln = PyInt_AsLong(__pyx_v_n); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2088 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2138 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2089 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2139 */ __pyx_1 = (__pyx_v_ln <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; goto __pyx_L1;} - Py_INCREF(__pyx_k133p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k133p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;} + Py_INCREF(__pyx_k134p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k134p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2091 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2141 */ __pyx_1 = (__pyx_v_fp < 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; goto __pyx_L1;} - Py_INCREF(__pyx_k134p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k134p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;} + Py_INCREF(__pyx_k135p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k135p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;} goto __pyx_L4; } __pyx_1 = (__pyx_v_fp > 1); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; goto __pyx_L1;} - Py_INCREF(__pyx_k135p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k135p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; goto __pyx_L1;} + Py_INCREF(__pyx_k136p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k136p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2095 */ - __pyx_2 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_ln,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2145 */ + __pyx_2 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_ln,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2145; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6511,138 +6914,144 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2097 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2147 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2099 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2149 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2149; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_on)); __pyx_v_on = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2100 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2150 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2150; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyArrayObject *)__pyx_2); + __pyx_v_op = ((PyArrayObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2151 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2101 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;} Py_INCREF(__pyx_v_n); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2101; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2151; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;} - Py_INCREF(__pyx_k136p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k136p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; goto __pyx_L1;} + Py_INCREF(__pyx_k137p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k137p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2102; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2152; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2103 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2153 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5); + __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); + __pyx_5 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2103; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2153; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;} - Py_INCREF(__pyx_k137p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k137p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; goto __pyx_L1;} + Py_INCREF(__pyx_k138p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k138p); + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2104; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2154; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2105 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2155 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2); - __pyx_2 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2105; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2155; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;} - Py_INCREF(__pyx_k138p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k138p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; goto __pyx_L1;} + Py_INCREF(__pyx_k139p); + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k139p); + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2106; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2156; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2107 */ - __pyx_5 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2107; goto __pyx_L1;} - __pyx_r = __pyx_5; - __pyx_5 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2157 */ + __pyx_4 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; goto __pyx_L1;} + __pyx_r = __pyx_4; + __pyx_4 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -6664,19 +7073,19 @@ return __pyx_r; } -static PyObject *__pyx_k139p; static PyObject *__pyx_k140p; static PyObject *__pyx_k141p; static PyObject *__pyx_k142p; static PyObject *__pyx_k143p; static PyObject *__pyx_k144p; +static PyObject *__pyx_k145p; -static char __pyx_k139[] = "n <= 0"; -static char __pyx_k140[] = "p < 0"; -static char __pyx_k141[] = "p > 1"; -static char __pyx_k142[] = "n <= 0"; -static char __pyx_k143[] = "p < 0"; -static char __pyx_k144[] = "p > 1"; +static char __pyx_k140[] = "n <= 0"; +static char __pyx_k141[] = "p < 0"; +static char __pyx_k142[] = "p > 1"; +static char __pyx_k143[] = "n <= 0"; +static char __pyx_k144[] = "p < 0"; +static char __pyx_k145[] = "p > 1"; static PyObject *__pyx_f_6mtrand_11RandomState_negative_binomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_negative_binomial[] = "\n negative_binomial(n, p, size=None)\n\n Negative Binomial distribution.\n\n "; @@ -6686,7 +7095,7 @@ PyObject *__pyx_v_size = 0; PyArrayObject *__pyx_v_on; PyArrayObject *__pyx_v_op; - long __pyx_v_ln; + double __pyx_v_fn; double __pyx_v_fp; PyObject *__pyx_r; int __pyx_1; @@ -6704,60 +7113,66 @@ __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2121 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2171 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2122 */ - __pyx_v_ln = PyInt_AsLong(__pyx_v_n); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2172 */ + __pyx_v_fn = PyFloat_AsDouble(__pyx_v_n); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2123 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2173 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2124 */ - __pyx_1 = (__pyx_v_ln <= 0); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2174 */ + __pyx_1 = (__pyx_v_fn <= 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; goto __pyx_L1;} - Py_INCREF(__pyx_k139p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k139p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; goto __pyx_L1;} + Py_INCREF(__pyx_k140p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k140p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2175; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2126 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2176 */ __pyx_1 = (__pyx_v_fp < 0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; goto __pyx_L1;} - Py_INCREF(__pyx_k140p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k140p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; goto __pyx_L1;} + Py_INCREF(__pyx_k141p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k141p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2127; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2177; goto __pyx_L1;} goto __pyx_L4; } __pyx_1 = (__pyx_v_fp > 1); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; goto __pyx_L1;} - Py_INCREF(__pyx_k141p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k141p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; goto __pyx_L1;} + Py_INCREF(__pyx_k142p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k142p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2129; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2179; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2130 */ - __pyx_2 = __pyx_f_6mtrand_discnp_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_ln,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2130; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2180 */ + __pyx_2 = __pyx_f_6mtrand_discdd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_fn,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2180; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6765,138 +7180,144 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2133 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2183 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2135 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2135; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2185 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2185; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_on)); __pyx_v_on = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2136 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2136; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2186 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2186; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_op)); - __pyx_v_op = ((PyArrayObject *)__pyx_2); + __pyx_v_op = ((PyArrayObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2187 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2137 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;} Py_INCREF(__pyx_v_n); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); + __pyx_4 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2137; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2187; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; goto __pyx_L1;} - Py_INCREF(__pyx_k142p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k142p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; goto __pyx_L1;} + Py_INCREF(__pyx_k143p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k143p); + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2138; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2188; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2139 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2189 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_5); + __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); + __pyx_5 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;} - Py_INCREF(__pyx_k143p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k143p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; goto __pyx_L1;} + Py_INCREF(__pyx_k144p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k144p); + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2141 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2191 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2); - __pyx_2 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3); + __pyx_3 = 0; + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;} - Py_INCREF(__pyx_k144p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k144p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; goto __pyx_L1;} + Py_INCREF(__pyx_k145p); + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k145p); + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; + __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2142; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2143 */ - __pyx_5 = __pyx_f_6mtrand_discnp_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; goto __pyx_L1;} - __pyx_r = __pyx_5; - __pyx_5 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2193 */ + __pyx_4 = __pyx_f_6mtrand_discdd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_negative_binomial,__pyx_v_size,__pyx_v_on,__pyx_v_op); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2193; goto __pyx_L1;} + __pyx_r = __pyx_4; + __pyx_4 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -6918,11 +7339,11 @@ return __pyx_r; } -static PyObject *__pyx_k145p; static PyObject *__pyx_k146p; +static PyObject *__pyx_k147p; -static char __pyx_k145[] = "lam < 0"; static char __pyx_k146[] = "lam < 0"; +static char __pyx_k147[] = "lam < 0"; static PyObject *__pyx_f_6mtrand_11RandomState_poisson(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_poisson[] = "\n poisson(lam=1.0, size=None)\n\n Poisson distribution.\n\n "; @@ -6946,33 +7367,35 @@ Py_INCREF(__pyx_v_size); __pyx_v_olam = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2155 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2205 */ __pyx_v_flam = PyFloat_AsDouble(__pyx_v_lam); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2156 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2206 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2157 */ - __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_lam, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2157; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2207 */ + __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_lam, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; goto __pyx_L1;} - Py_INCREF(__pyx_k145p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k145p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; goto __pyx_L1;} + Py_INCREF(__pyx_k146p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k146p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2158; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2159 */ - __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_flam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2159; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2209 */ + __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_flam); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6980,57 +7403,59 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2161 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2211 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2163 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2163; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2213 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2213; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_olam)); __pyx_v_olam = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2164 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2214 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_olam)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_olam)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2164; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2214; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; goto __pyx_L1;} - Py_INCREF(__pyx_k146p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k146p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; goto __pyx_L1;} + Py_INCREF(__pyx_k147p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k147p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2215; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2166 */ - __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_olam); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2216 */ + __pyx_5 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_poisson,__pyx_v_size,__pyx_v_olam); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2216; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -7050,11 +7475,11 @@ return __pyx_r; } -static PyObject *__pyx_k147p; static PyObject *__pyx_k148p; +static PyObject *__pyx_k149p; -static char __pyx_k147[] = "a <= 1.0"; static char __pyx_k148[] = "a <= 1.0"; +static char __pyx_k149[] = "a <= 1.0"; static PyObject *__pyx_f_6mtrand_11RandomState_zipf(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_zipf[] = "\n zipf(a, size=None)\n\n Draw samples from a Zipf distribution.\n\n Samples are drawn from a Zipf distribution with specified parameter (a),\n where a > 1.\n\n The zipf distribution (also known as the zeta\n distribution) is a continuous probability distribution that satisfies\n Zipf\'s law, where the frequency of an item is inversely proportional to\n its rank in a frequency table.\n\n Parameters\n ----------\n a : float\n parameter, > 1.\n size : {tuple, int}\n Output shape. If the given shape is, e.g., ``(m, n, k)``, then\n ``m * n * k`` samples are drawn.\n\n Returns\n -------\n samples : {ndarray, scalar}\n The returned samples are greater than or equal to one.\n\n See Also\n --------\n scipy.stats.distributions.zipf : probability density function,\n distribution or cumulative density function, etc.\n\n Notes\n -----\n The probability density for the Zipf distribution is\n\n .. math:: p(x) = \\frac{x^{-a}}{\\zeta(a)},\n\n where :math:`\\zeta` is the Riemann Zeta function.\n\n Named after the American linguist George Kingsley Zipf, who noted that\n the frequency of any word in a sample of a language is inversely\n proportional to its rank in the frequency table.\n\n\n References\n ----------\n .. [1] Weisstein, Eric W. \"Zipf Distribution.\" From MathWorld--A Wolfram\n Web Resource. http://mathworld.wolfram.com/ZipfDistribution.html\n .. [2] Wikipedia, \"Zeta distribution\",\n http://en.wikipedia.org/wiki/Zeta_distribution\n .. [3] Wikipedia, \"Zipf\'s Law\",\n http://en.wikipedia.org/wiki/Zipf%27s_law\n .. [4] Zipf, George Kingsley (1932): Selected Studies of the Principle\n of Relative Frequency in Language. Cambridge (Mass.).\n\n Examples\n --------\n Draw samples from the distribution:\n\n >>> a = 2. # parameter\n >>> s = np.random.zipf(a, 1000)\n\n Display the histogram of the samples, along with\n the probability density function:\n\n >>> import matplotlib.pyplot as plt\n >>> import scipy.special as sps\n Truncate s values at 50 so plot is interesting\n >>> count, bins, ignored = plt.hist(s[s<50], 50, normed=True)\n >>> x = arange(1., 50.)\n >>> y = x**(-a)/sps.zetac(a)\n >>> plt.plot(x, y/max(y), linewidth=2, color=\'r\')\n >>> plt.show()\n\n "; @@ -7077,30 +7502,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2247 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2297 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2248 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2298 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2249 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2299 */ __pyx_1 = (__pyx_v_fa <= 1.0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; goto __pyx_L1;} - Py_INCREF(__pyx_k147p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k147p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; goto __pyx_L1;} + Py_INCREF(__pyx_k148p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k148p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2250; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2251 */ - __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2251; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2301 */ + __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_fa); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2301; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7108,57 +7535,59 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2253 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2303 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2255 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2305 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2305; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_oa)); __pyx_v_oa = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2256 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2306 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyFloat_FromDouble(1.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oa)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oa)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2256; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; goto __pyx_L1;} - Py_INCREF(__pyx_k148p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k148p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; goto __pyx_L1;} + Py_INCREF(__pyx_k149p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k149p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2258 */ - __pyx_4 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_oa); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2258; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2308 */ + __pyx_5 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_zipf,__pyx_v_size,__pyx_v_oa); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2308; goto __pyx_L1;} + __pyx_r = __pyx_5; + __pyx_5 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -7178,15 +7607,15 @@ return __pyx_r; } -static PyObject *__pyx_k149p; static PyObject *__pyx_k150p; static PyObject *__pyx_k151p; static PyObject *__pyx_k152p; +static PyObject *__pyx_k153p; -static char __pyx_k149[] = "p < 0.0"; -static char __pyx_k150[] = "p > 1.0"; -static char __pyx_k151[] = "p < 0.0"; -static char __pyx_k152[] = "p > 1.0"; +static char __pyx_k150[] = "p < 0.0"; +static char __pyx_k151[] = "p > 1.0"; +static char __pyx_k152[] = "p < 0.0"; +static char __pyx_k153[] = "p > 1.0"; static PyObject *__pyx_f_6mtrand_11RandomState_geometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_geometric[] = "\n geometric(p, size=None)\n\n Draw samples from the geometric distribution.\n\n Bernoulli trials are experiments with one of two outcomes:\n success or failure (an example of such an experiment is flipping\n a coin). The geometric distribution models the number of trials\n that must be run in order to achieve success. It is therefore\n supported on the positive integers, ``k = 1, 2, ...``.\n\n The probability mass function of the geometric distribution is\n\n .. math:: f(k) = (1 - p)^{k - 1} p\n\n where `p` is the probability of success of an individual trial.\n\n Parameters\n ----------\n p : float\n The probability of success of an individual trial.\n size : tuple of ints\n Number of values to draw from the distribution. The output\n is shaped according to `size`.\n\n Returns\n -------\n out : ndarray\n Samples from the geometric distribution, shaped according to\n `size`.\n\n Examples\n --------\n Draw ten thousand values from the geometric distribution,\n with the probability of an individual success equal to 0.35:\n\n >>> z = np.random.geometric(p=0.35, size=10000)\n\n How many trials succeeded after a single run?\n\n >>> (z == 1).sum() / 10000.\n 0.34889999999999999 #random\n\n "; @@ -7209,45 +7638,49 @@ Py_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2308 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2358 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2309 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2359 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2310 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2360 */ __pyx_1 = (__pyx_v_fp < 0.0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2311; goto __pyx_L1;} - Py_INCREF(__pyx_k149p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k149p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2311; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;} + Py_INCREF(__pyx_k150p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k150p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2311; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2312 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2362 */ __pyx_1 = (__pyx_v_fp > 1.0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; goto __pyx_L1;} - Py_INCREF(__pyx_k150p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k150p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;} + Py_INCREF(__pyx_k151p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k151p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2313; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2314 */ - __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2314; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2364 */ + __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7255,94 +7688,98 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2316 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2366 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2319 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2319; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2369 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2369; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_op)); __pyx_v_op = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2320 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2370 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_op)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2320; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; goto __pyx_L1;} - Py_INCREF(__pyx_k151p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k151p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; goto __pyx_L1;} + Py_INCREF(__pyx_k152p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k152p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2321; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2371; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2322 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2372 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_op)); PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5); + __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); - __pyx_4 = 0; - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5); + __pyx_5 = 0; + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2322; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2372; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; goto __pyx_L1;} - Py_INCREF(__pyx_k152p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k152p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; goto __pyx_L1;} + Py_INCREF(__pyx_k153p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k153p); + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2323; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2373; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2324 */ - __pyx_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_op); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2324; goto __pyx_L1;} - __pyx_r = __pyx_3; - __pyx_3 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2374 */ + __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_geometric,__pyx_v_size,__pyx_v_op); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2374; goto __pyx_L1;} + __pyx_r = __pyx_2; + __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -7364,7 +7801,6 @@ static PyObject *__pyx_n_add; -static PyObject *__pyx_k153p; static PyObject *__pyx_k154p; static PyObject *__pyx_k155p; static PyObject *__pyx_k156p; @@ -7372,15 +7808,16 @@ static PyObject *__pyx_k158p; static PyObject *__pyx_k159p; static PyObject *__pyx_k160p; +static PyObject *__pyx_k161p; -static char __pyx_k153[] = "ngood < 1"; -static char __pyx_k154[] = "nbad < 1"; -static char __pyx_k155[] = "nsample < 1"; -static char __pyx_k156[] = "ngood + nbad < nsample"; -static char __pyx_k157[] = "ngood < 1"; -static char __pyx_k158[] = "nbad < 1"; -static char __pyx_k159[] = "nsample < 1"; -static char __pyx_k160[] = "ngood + nbad < nsample"; +static char __pyx_k154[] = "ngood < 1"; +static char __pyx_k155[] = "nbad < 1"; +static char __pyx_k156[] = "nsample < 1"; +static char __pyx_k157[] = "ngood + nbad < nsample"; +static char __pyx_k158[] = "ngood < 1"; +static char __pyx_k159[] = "nbad < 1"; +static char __pyx_k160[] = "nsample < 1"; +static char __pyx_k161[] = "ngood + nbad < nsample"; static PyObject *__pyx_f_6mtrand_11RandomState_hypergeometric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_hypergeometric[] = "\n hypergeometric(ngood, nbad, nsample, size=None)\n\n Hypergeometric distribution.\n\n Consider an urn with ngood \"good\" balls and nbad \"bad\" balls. If one\n were to draw nsample balls from the urn without replacement, then\n the hypergeometric distribution describes the distribution of \"good\"\n balls in the sample.\n\n "; @@ -7414,286 +7851,302 @@ __pyx_v_onbad = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_onsample = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2341 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2391 */ __pyx_v_lngood = PyInt_AsLong(__pyx_v_ngood); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2342 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2392 */ __pyx_v_lnbad = PyInt_AsLong(__pyx_v_nbad); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2343 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2393 */ __pyx_v_lnsample = PyInt_AsLong(__pyx_v_nsample); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2344 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2394 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2345 */ - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2345; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_ngood, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2345; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2395 */ + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_ngood, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; goto __pyx_L1;} - Py_INCREF(__pyx_k153p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k153p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} + Py_INCREF(__pyx_k154p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k154p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2346; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2347 */ - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_nbad, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2347; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2397 */ + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2397; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_nbad, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2397; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; goto __pyx_L1;} - Py_INCREF(__pyx_k154p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k154p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; goto __pyx_L1;} + Py_INCREF(__pyx_k155p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k155p); + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; __Pyx_Raise(__pyx_2, 0, 0); Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2348; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2349 */ - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2349; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_nsample, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2349; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2399 */ + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_nsample, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2399; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; goto __pyx_L1;} - Py_INCREF(__pyx_k155p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k155p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2400; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2400; goto __pyx_L1;} + Py_INCREF(__pyx_k156p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k156p); + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2400; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2400; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2351 */ - __pyx_2 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_2, __pyx_v_nsample, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2351; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2401 */ + __pyx_4 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2401; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_4, __pyx_v_nsample, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2401; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2352; goto __pyx_L1;} - Py_INCREF(__pyx_k156p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k156p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2352; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2402; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2402; goto __pyx_L1;} + Py_INCREF(__pyx_k157p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k157p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2402; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2352; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2402; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2353 */ - __pyx_3 = __pyx_f_6mtrand_discnmN_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_lngood,__pyx_v_lnbad,__pyx_v_lnsample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2353; goto __pyx_L1;} - __pyx_r = __pyx_3; - __pyx_3 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2403 */ + __pyx_2 = __pyx_f_6mtrand_discnmN_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_lngood,__pyx_v_lnbad,__pyx_v_lnsample); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2403; goto __pyx_L1;} + __pyx_r = __pyx_2; + __pyx_2 = 0; goto __pyx_L0; goto __pyx_L2; } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2357 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2407 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2359 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2359; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2409 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2409; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_ongood)); - __pyx_v_ongood = ((PyArrayObject *)__pyx_2); - Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_v_ongood = ((PyArrayObject *)__pyx_3); + Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2360 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2360; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2410 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2410; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_onbad)); - __pyx_v_onbad = ((PyArrayObject *)__pyx_3); - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_v_onbad = ((PyArrayObject *)__pyx_4); + Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2361 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2411 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2411; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_onsample)); __pyx_v_onsample = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2362 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2412 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_ongood)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_ongood)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); - __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); - __pyx_3 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + __pyx_2 = 0; + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2362; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2412; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;} - Py_INCREF(__pyx_k157p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k157p); - __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; goto __pyx_L1;} + Py_INCREF(__pyx_k158p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k158p); + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_2, 0, 0); - Py_DECREF(__pyx_2); __pyx_2 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2363; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2413; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2364 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2414 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_onbad)); - PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_onbad)); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; + PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_onbad)); + PyTuple_SET_ITEM(__pyx_4, 1, __pyx_5); + __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4); - __pyx_4 = 0; - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); + __pyx_5 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2364; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2414; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2365; goto __pyx_L1;} - Py_INCREF(__pyx_k158p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k158p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2365; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2415; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2415; goto __pyx_L1;} + Py_INCREF(__pyx_k159p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k159p); + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2415; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2365; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2415; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2366 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2416 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_onsample)); - PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_onsample)); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_onsample)); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); + __pyx_4 = 0; + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2); - __pyx_2 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2416; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; goto __pyx_L1;} - Py_INCREF(__pyx_k159p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k159p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; goto __pyx_L1;} + Py_INCREF(__pyx_k160p); + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k160p); + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2367; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2417; goto __pyx_L1;} goto __pyx_L9; } __pyx_L9:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2368 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2418 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_add); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_ongood)); - PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_ongood)); + PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ongood)); Py_INCREF(((PyObject *)__pyx_v_onbad)); - PyTuple_SET_ITEM(__pyx_5, 1, ((PyObject *)__pyx_v_onbad)); - __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_onbad)); + __pyx_6 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_6); + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_6); Py_INCREF(((PyObject *)__pyx_v_onsample)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_onsample)); + PyTuple_SET_ITEM(__pyx_5, 1, ((PyObject *)__pyx_v_onsample)); __pyx_6 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5); - __pyx_5 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2); + __pyx_2 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2368; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2418; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2369; goto __pyx_L1;} - Py_INCREF(__pyx_k160p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k160p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2369; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; goto __pyx_L1;} + Py_INCREF(__pyx_k161p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k161p); + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2369; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2419; goto __pyx_L1;} goto __pyx_L10; } __pyx_L10:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2370 */ - __pyx_4 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ongood,__pyx_v_onbad,__pyx_v_onsample); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2370; goto __pyx_L1;} - __pyx_r = __pyx_4; - __pyx_4 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2420 */ + __pyx_6 = __pyx_f_6mtrand_discnmN_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_hypergeometric,__pyx_v_size,__pyx_v_ongood,__pyx_v_onbad,__pyx_v_onsample); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2420; goto __pyx_L1;} + __pyx_r = __pyx_6; + __pyx_6 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -7718,15 +8171,15 @@ return __pyx_r; } -static PyObject *__pyx_k161p; static PyObject *__pyx_k162p; static PyObject *__pyx_k163p; static PyObject *__pyx_k164p; +static PyObject *__pyx_k165p; -static char __pyx_k161[] = "p < 0.0"; -static char __pyx_k162[] = "p > 1.0"; -static char __pyx_k163[] = "p < 0.0"; -static char __pyx_k164[] = "p > 1.0"; +static char __pyx_k162[] = "p < 0.0"; +static char __pyx_k163[] = "p > 1.0"; +static char __pyx_k164[] = "p < 0.0"; +static char __pyx_k165[] = "p > 1.0"; static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_logseries[] = "\n logseries(p, size=None)\n\n Logarithmic series distribution.\n\n "; @@ -7749,45 +8202,49 @@ Py_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2383 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2433 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2384 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2434 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2385 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2435 */ __pyx_1 = (__pyx_v_fp < 0.0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; goto __pyx_L1;} - Py_INCREF(__pyx_k161p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k161p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; goto __pyx_L1;} + Py_INCREF(__pyx_k162p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k162p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2386; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2387 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2437 */ __pyx_1 = (__pyx_v_fp > 1.0); if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; goto __pyx_L1;} - Py_INCREF(__pyx_k162p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k162p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; goto __pyx_L1;} + Py_INCREF(__pyx_k163p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k163p); + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2388; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2389 */ - __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2389; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2439 */ + __pyx_2 = __pyx_f_6mtrand_discd_array_sc(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_fp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2439; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7795,94 +8252,98 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2391 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2441 */ PyErr_Clear(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2393 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2393; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2443 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2443; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_op)); __pyx_v_op = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2394 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyFloat_FromDouble(0.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2444 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_op)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3); + __pyx_3 = 0; + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3); + __pyx_3 = 0; + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2394; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; goto __pyx_L1;} - Py_INCREF(__pyx_k163p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k163p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2445; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2445; goto __pyx_L1;} + Py_INCREF(__pyx_k164p); + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k164p); + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2445; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_3, 0, 0); - Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2395; goto __pyx_L1;} + __Pyx_Raise(__pyx_4, 0, 0); + Py_DECREF(__pyx_4); __pyx_4 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2445; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2396 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2446 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_op)); PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_op)); - PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4); - __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_5); + __pyx_5 = 0; + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4); - __pyx_4 = 0; - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5); + __pyx_5 = 0; + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2396; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2397; goto __pyx_L1;} - Py_INCREF(__pyx_k164p); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k164p); - __pyx_5 = PyObject_CallObject(PyExc_ValueError, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2397; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; goto __pyx_L1;} + Py_INCREF(__pyx_k165p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k165p); + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + __Pyx_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - __Pyx_Raise(__pyx_5, 0, 0); - Py_DECREF(__pyx_5); __pyx_5 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2397; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2447; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2398 */ - __pyx_3 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_op); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2398; goto __pyx_L1;} - __pyx_r = __pyx_3; - __pyx_3 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2448 */ + __pyx_2 = __pyx_f_6mtrand_discd_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,rk_logseries,__pyx_v_size,__pyx_v_op); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2448; goto __pyx_L1;} + __pyx_r = __pyx_2; + __pyx_2 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -7904,22 +8365,24 @@ static PyObject *__pyx_n_array; static PyObject *__pyx_n_shape; +static PyObject *__pyx_n_list; static PyObject *__pyx_n_append; static PyObject *__pyx_n_multiply; static PyObject *__pyx_n_reduce; static PyObject *__pyx_n_svd; static PyObject *__pyx_n_dot; static PyObject *__pyx_n_sqrt; +static PyObject *__pyx_n_tuple; -static PyObject *__pyx_k165p; static PyObject *__pyx_k166p; static PyObject *__pyx_k167p; static PyObject *__pyx_k168p; +static PyObject *__pyx_k169p; -static char __pyx_k165[] = "mean must be 1 dimensional"; -static char __pyx_k166[] = "cov must be 2 dimensional and square"; -static char __pyx_k167[] = "mean and cov must have same length"; -static char __pyx_k168[] = "numpy.dual"; +static char __pyx_k166[] = "mean must be 1 dimensional"; +static char __pyx_k167[] = "cov must be 2 dimensional and square"; +static char __pyx_k168[] = "mean and cov must have same length"; +static char __pyx_k169[] = "numpy.dual"; static PyObject *__pyx_f_6mtrand_11RandomState_multivariate_normal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_multivariate_normal[] = "\n multivariate_normal(mean, cov[, size])\n\n Draw random samples from a multivariate normal distribution.\n\n The multivariate normal, multinormal or Gaussian distribution is a\n generalisation of the one-dimensional normal distribution to higher\n dimensions.\n\n Such a distribution is specified by its mean and covariance matrix,\n which are analogous to the mean (average or \"centre\") and variance\n (standard deviation squared or \"width\") of the one-dimensional normal\n distribution.\n\n Parameters\n ----------\n mean : (N,) ndarray\n Mean of the N-dimensional distribution.\n cov : (N,N) ndarray\n Covariance matrix of the distribution.\n size : tuple of ints, optional\n Given a shape of, for example, (m,n,k), m*n*k samples are\n generated, and packed in an m-by-n-by-k arrangement. Because each\n sample is N-dimensional, the output shape is (m,n,k,N). If no\n shape is specified, a single sample is returned.\n\n Returns\n -------\n out : ndarray\n The drawn samples, arranged according to `size`. If the\n shape given is (m,n,...), then the shape of `out` is is\n (m,n,...,N).\n\n In other words, each entry ``out[i,j,...,:]`` is an N-dimensional\n value drawn from the distribution.\n\n Notes\n -----\n The mean is a coordinate in N-dimensional space, which represents the\n location where samples are most likely to be generated. This is\n analogous to the peak of the bell curve for the one-dimensional or\n univariate normal distribution.\n\n Covariance indicates the level to which two variables vary together.\n From the multivariate normal distribution, we draw N-dimensional\n samples, :math:`X = [x_1, x_2, ... x_N]`. The covariance matrix\n element :math:`C_{ij}` is the covariance of :math:`x_i` and :math:`x_j`.\n The element :math:`C_{ii}` is the variance of :math:`x_i` (i.e. its\n \"spread\").\n\n Instead of specifying the full covariance matrix, popular\n approximations include:\n\n - Spherical covariance (`cov` is a multiple of the identity matrix)\n - Diagonal covariance (`cov` has non-negative elements, and only on\n the diagonal)\n\n This geometrical property can be seen in two dimensions by plotting\n generated data-points:\n\n >>> mean = [0,0]\n >>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis\n\n >>> import matplotlib.pyplot as plt\n >>> x,y = np.random.multivariate_normal(mean,cov,5000).T\n >>> plt.plot(x,y,\'x\'); plt.axis(\'equal\'); plt.show()\n\n Note that the covariance matrix must be non-negative definite.\n\n References\n ----------\n .. [1] A. Papoulis, \"Probability, Random Variables, and Stochastic\n Processes,\" 3rd ed., McGraw-Hill Companies, 1991\n .. [2] R.O. Duda, P.E. Hart, and D.G. Stork, \"Pattern Classification,\"\n 2nd ed., Wiley, 2001.\n\n Examples\n --------\n >>> mean = (1,2)\n >>> cov = [[1,0],[1,0]]\n >>> x = np.random.multivariate_normal(mean,cov,(3,3))\n >>> x.shape\n (3, 3, 2)\n\n The following is probably true, given that 0.6 is roughly twice the\n standard deviation:\n\n >>> print list( (x[0,0,:] - mean) < 0.6 )\n [True, True]\n\n "; @@ -7956,38 +8419,38 @@ __pyx_v_s = Py_None; Py_INCREF(Py_None); __pyx_v_v = Py_None; Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2494 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2544 */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; goto __pyx_L1;} Py_INCREF(__pyx_v_mean); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_mean); - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2494; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2544; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_mean); __pyx_v_mean = __pyx_3; __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2495 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; goto __pyx_L1;} - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2545 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; goto __pyx_L1;} Py_INCREF(__pyx_v_cov); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov); - __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2495; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2545; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_cov); __pyx_v_cov = __pyx_2; __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2496 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2546 */ __pyx_4 = __pyx_v_size == Py_None; if (__pyx_4) { - __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2497; goto __pyx_L1;} + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2547; goto __pyx_L1;} Py_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_1; __pyx_1 = 0; @@ -8000,82 +8463,98 @@ } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2500 */ - __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2500; goto __pyx_L1;} - __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2500; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2550 */ + __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; goto __pyx_L1;} + __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2550; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_4 = (__pyx_5 != 1); if (__pyx_4) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; goto __pyx_L1;} - Py_INCREF(__pyx_k165p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k165p); - __pyx_1 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; goto __pyx_L1;} + Py_INCREF(__pyx_k166p); + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k166p); + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_1, 0, 0); Py_DECREF(__pyx_1); __pyx_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2501; goto __pyx_L1;} + __Pyx_Raise(__pyx_3, 0, 0); + Py_DECREF(__pyx_3); __pyx_3 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2551; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2502 */ - __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} - __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2552 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;} + __pyx_5 = PyObject_Length(__pyx_2); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_4 = (__pyx_5 != 2); if (!__pyx_4) { - __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} - __pyx_1 = PySequence_GetItem(__pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} - __pyx_2 = PySequence_GetItem(__pyx_3, 1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - if (PyObject_Cmp(__pyx_1, __pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2502; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;} + __pyx_6 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + if (PyObject_Cmp(__pyx_2, __pyx_6, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2552; goto __pyx_L1;} __pyx_4 = __pyx_4 != 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_6); __pyx_6 = 0; } if (__pyx_4) { - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2503; goto __pyx_L1;} - Py_INCREF(__pyx_k166p); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k166p); - __pyx_1 = PyObject_CallObject(PyExc_ValueError, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2503; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; goto __pyx_L1;} + Py_INCREF(__pyx_k167p); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k167p); + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __Pyx_Raise(__pyx_1, 0, 0); - Py_DECREF(__pyx_1); __pyx_1 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2503; goto __pyx_L1;} + __Pyx_Raise(__pyx_2, 0, 0); + Py_DECREF(__pyx_2); __pyx_2 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2553; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2504 */ - __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} - __pyx_3 = PySequence_GetItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2554 */ + __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;} + __pyx_3 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;} + __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;} + __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} - __pyx_2 = PySequence_GetItem(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_Cmp(__pyx_3, __pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2504; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2554; goto __pyx_L1;} __pyx_4 = __pyx_4 != 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_4) { - __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; goto __pyx_L1;} - Py_INCREF(__pyx_k167p); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k167p); - __pyx_3 = PyObject_CallObject(PyExc_ValueError, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; goto __pyx_L1;} + Py_INCREF(__pyx_k168p); + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_k168p); + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_6); __pyx_6 = 0; __Pyx_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2505; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2555; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2507 */ - __pyx_4 = PyObject_IsInstance(__pyx_v_shape,((PyObject *)(&PyInt_Type))); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2507; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2557 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; goto __pyx_L1;} + __pyx_4 = PyObject_IsInstance(__pyx_v_shape,__pyx_1); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2557; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_4) { - __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2508; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2558; goto __pyx_L1;} Py_INCREF(__pyx_v_shape); PyList_SET_ITEM(__pyx_2, 0, __pyx_v_shape); Py_DECREF(__pyx_v_shape); @@ -8085,166 +8564,174 @@ } __pyx_L6:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2509 */ - __pyx_1 = PySequence_GetSlice(__pyx_v_shape, 0, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); - __pyx_1 = 0; - __pyx_2 = PyObject_CallObject(((PyObject *)(&PyList_Type)), __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2509; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2559 */ + __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; goto __pyx_L1;} + __pyx_3 = PySequence_GetSlice(__pyx_v_shape, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3); + __pyx_3 = 0; + __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2559; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_final_shape); __pyx_v_final_shape = __pyx_2; __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2510 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;} - __pyx_2 = PySequence_GetItem(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2560 */ + __pyx_3 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;} + __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2); + __pyx_2 = 0; + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2560; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2510; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2514 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;} - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2564 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;} + __pyx_6 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_reduce); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;} Py_INCREF(__pyx_v_final_shape); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_final_shape); - __pyx_6 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape); + __pyx_6 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_6); + __pyx_6 = 0; + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2564; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_6); - __pyx_6 = 0; - __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2514; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_x); - __pyx_v_x = __pyx_2; - __pyx_2 = 0; + __pyx_v_x = __pyx_3; + __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2515 */ - __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} - __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_multiply); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2565 */ + __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_6, __pyx_n_multiply); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_reduce); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_5 = PyObject_Length(__pyx_v_final_shape); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;} + __pyx_3 = PySequence_GetSlice(__pyx_v_final_shape, 0, (__pyx_5 - 1)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_3); + __pyx_3 = 0; + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_5 = PyObject_Length(__pyx_v_final_shape); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} - __pyx_2 = PySequence_GetSlice(__pyx_v_final_shape, 0, (__pyx_5 - 1)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2); + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; goto __pyx_L1;} + __pyx_6 = PyObject_GetItem(__pyx_3, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2566; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); + PyTuple_SET_ITEM(__pyx_3, 1, __pyx_6); __pyx_2 = 0; - __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} + __pyx_6 = 0; + if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2565; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_2 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; goto __pyx_L1;} - __pyx_3 = PySequence_GetItem(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2516; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_1); - PyTuple_SET_ITEM(__pyx_6, 1, __pyx_3); - __pyx_1 = 0; - __pyx_3 = 0; - if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2515; goto __pyx_L1;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2524 */ - __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2574 */ + __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2574; goto __pyx_L1;} Py_INCREF(__pyx_n_svd); - PyList_SET_ITEM(__pyx_2, 0, __pyx_n_svd); - __pyx_1 = __Pyx_Import(__pyx_k168p, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; goto __pyx_L1;} + PyList_SET_ITEM(__pyx_1, 0, __pyx_n_svd); + __pyx_2 = __Pyx_Import(__pyx_k169p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2574; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_6 = PyObject_GetAttr(__pyx_2, __pyx_n_svd); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2574; goto __pyx_L1;} + Py_DECREF(__pyx_v_svd); + __pyx_v_svd = __pyx_6; + __pyx_6 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_svd); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2524; goto __pyx_L1;} - Py_DECREF(__pyx_v_svd); - __pyx_v_svd = __pyx_3; - __pyx_3 = 0; - Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2526 */ - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2576 */ + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;} Py_INCREF(__pyx_v_cov); - PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_cov); - __pyx_2 = PyObject_CallObject(__pyx_v_svd, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;} - Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_cov); + __pyx_1 = PyObject_CallObject(__pyx_v_svd, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_6 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;} Py_DECREF(__pyx_v_u); - __pyx_v_u = __pyx_3; + __pyx_v_u = __pyx_6; + __pyx_6 = 0; + __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;} + Py_DECREF(__pyx_v_s); + __pyx_v_s = __pyx_3; __pyx_3 = 0; - __pyx_6 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;} - Py_DECREF(__pyx_v_s); - __pyx_v_s = __pyx_6; - __pyx_6 = 0; - __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;} + __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;} Py_DECREF(__pyx_v_v); - __pyx_v_v = __pyx_2; - __pyx_2 = 0; - if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2526; goto __pyx_L1;} + __pyx_v_v = __pyx_1; + __pyx_1 = 0; + if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2576; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2577 */ + __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_6, __pyx_n_dot); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2527 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;} - __pyx_6 = PyObject_GetAttr(__pyx_3, __pyx_n_dot); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;} - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_sqrt); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;} + Py_INCREF(__pyx_v_s); + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_s); + __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;} - Py_INCREF(__pyx_v_s); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s); - __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; + __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2); + Py_INCREF(__pyx_v_v); + PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_v); + __pyx_2 = 0; + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2577; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyNumber_Multiply(__pyx_v_x, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1); - Py_INCREF(__pyx_v_v); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_v); - __pyx_1 = 0; - __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2527; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_v_x); - __pyx_v_x = __pyx_2; - __pyx_2 = 0; + __pyx_v_x = __pyx_1; + __pyx_1 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2530 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; goto __pyx_L1;} - __pyx_6 = PyObject_GetAttr(__pyx_1, __pyx_n_add); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2580 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; goto __pyx_L1;} Py_INCREF(__pyx_v_mean); - PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_mean); + PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_mean); Py_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_x); + PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_x); Py_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_x); - __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2530; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_6, 2, __pyx_v_x); + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2580; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; - Py_DECREF(__pyx_3); __pyx_3 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2531 */ - __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2581 */ + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; goto __pyx_L1;} Py_INCREF(__pyx_v_final_shape); - PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_final_shape); - __pyx_6 = PyObject_CallObject(((PyObject *)(&PyTuple_Type)), __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2531; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_final_shape); + __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2581; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2532 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2582 */ Py_INCREF(__pyx_v_x); __pyx_r = __pyx_v_x; goto __pyx_L0; @@ -8275,9 +8762,9 @@ static PyObject *__pyx_n_zeros; -static PyObject *__pyx_k170p; +static PyObject *__pyx_k171p; -static char __pyx_k170[] = "sum(pvals[:-1]) > 1.0"; +static char __pyx_k171[] = "sum(pvals[:-1]) > 1.0"; static PyObject *__pyx_f_6mtrand_11RandomState_multinomial(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_multinomial[] = "\n multinomial(n, pvals, size=None)\n\n Draw samples from a multinomial distribution.\n\n The multinomial distribution is a multivariate generalisation of the\n binomial distribution. Take an experiment with one of ``p``\n possible outcomes. An example of such an experiment is throwing a dice,\n where the outcome can be 1 through 6. Each sample drawn from the\n distribution represents `n` such experiments. Its values,\n ``X_i = [X_0, X_1, ..., X_p]``, represent the number of times the outcome\n was ``i``.\n\n Parameters\n ----------\n n : int\n Number of experiments.\n pvals : sequence of floats, length p\n Probabilities of each of the ``p`` different outcomes. These\n should sum to 1 (however, the last element is always assumed to\n account for the remaining probability, as long as\n ``sum(pvals[:-1]) <= 1)``.\n size : tuple of ints\n Given a `size` of ``(M, N, K)``, then ``M*N*K`` samples are drawn,\n and the output shape becomes ``(M, N, K, p)``, since each sample\n has shape ``(p,)``.\n\n Examples\n --------\n Throw a dice 20 times:\n\n >>> np.random.multinomial(20, [1/6.]*6, size=1)\n array([[4, 1, 7, 5, 2, 1]])\n\n It landed 4 times on 1, once on 2, etc.\n\n Now, throw the dice 20 times, and 20 times again:\n\n >>> np.random.multinomial(20, [1/6.]*6, size=2)\n array([[3, 4, 3, 3, 4, 3],\n [2, 4, 3, 4, 0, 7]])\n\n For the first run, we threw 3 times 1, 4 times 2, etc. For the second,\n we threw 2 times 1, 4 times 2, etc.\n\n A loaded dice is more likely to land on number 6:\n\n >>> np.random.multinomial(100, [1/7.]*5)\n array([13, 16, 13, 16, 42])\n\n "; @@ -8314,40 +8801,42 @@ __pyx_v_shape = Py_None; Py_INCREF(Py_None); __pyx_v_multin = Py_None; Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2593 */ - __pyx_1 = PyObject_Length(__pyx_v_pvals); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2593; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2643 */ + __pyx_1 = PyObject_Length(__pyx_v_pvals); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2643; goto __pyx_L1;} __pyx_v_d = __pyx_1; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2594 */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2594; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2644 */ + __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2644; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)arrayObject_parr)); arrayObject_parr = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2595 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2645 */ __pyx_v_pix = ((double *)arrayObject_parr->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2597 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2647 */ __pyx_3 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > (1.0 + 1e-12)); if (__pyx_3) { - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; goto __pyx_L1;} - Py_INCREF(__pyx_k170p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k170p); - __pyx_4 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; goto __pyx_L1;} + Py_INCREF(__pyx_k171p); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k171p); + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2598; goto __pyx_L1;} + __Pyx_Raise(__pyx_5, 0, 0); + Py_DECREF(__pyx_5); __pyx_5 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2648; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2600 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2650 */ __pyx_3 = __pyx_v_size == Py_None; if (__pyx_3) { - __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2601; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2651; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_shape); @@ -8355,16 +8844,20 @@ __pyx_4 = 0; goto __pyx_L3; } - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2602; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - __pyx_4 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2602; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = __pyx_4 == ((PyObject *)(&PyInt_Type)); + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2652; goto __pyx_L1;} + __pyx_3 = __pyx_4 == __pyx_5; Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_3) { - __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2603; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2603; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2653; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); @@ -8375,67 +8868,68 @@ goto __pyx_L3; } /*else*/ { - __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; goto __pyx_L1;} - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); - __pyx_2 = 0; - __pyx_2 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2605; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_5 = PyInt_FromLong(__pyx_v_d); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2655; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2655; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_5); + __pyx_5 = 0; + __pyx_4 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2655; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_shape); - __pyx_v_shape = __pyx_2; - __pyx_2 = 0; + __pyx_v_shape = __pyx_4; + __pyx_4 = 0; } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2607 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2657 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; goto __pyx_L1;} Py_INCREF(__pyx_v_shape); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_shape); - Py_INCREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_4, 1, ((PyObject *)(&PyInt_Type))); - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2607; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape); + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2657; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_v_multin); - __pyx_v_multin = __pyx_5; - __pyx_5 = 0; + __pyx_v_multin = __pyx_4; + __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2608 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2658 */ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin))); Py_DECREF(((PyObject *)arrayObject_mnarr)); arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2609 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2659 */ __pyx_v_mnix = ((long *)arrayObject_mnarr->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2610 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2660 */ __pyx_v_i = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2611 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2661 */ while (1) { __pyx_3 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr)); if (!__pyx_3) break; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2612 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2662 */ __pyx_v_Sum = 1.0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2613 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2663 */ __pyx_v_dn = __pyx_v_n; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2614 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2664 */ __pyx_6 = (__pyx_v_d - 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_6; ++__pyx_v_j) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2615 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2665 */ (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)]) = rk_binomial(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,__pyx_v_dn,((__pyx_v_pix[__pyx_v_j]) / __pyx_v_Sum)); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2616 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2666 */ __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2617 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2667 */ __pyx_3 = (__pyx_v_dn <= 0); if (__pyx_3) { goto __pyx_L7; @@ -8443,12 +8937,12 @@ } __pyx_L8:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2619 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2669 */ __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j])); } __pyx_L7:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2620 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2670 */ __pyx_3 = (__pyx_v_dn > 0); if (__pyx_3) { (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn; @@ -8456,11 +8950,11 @@ } __pyx_L9:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2623 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2673 */ __pyx_v_i = (__pyx_v_i + __pyx_v_d); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2625 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2675 */ Py_INCREF(__pyx_v_multin); __pyx_r = __pyx_v_multin; goto __pyx_L0; @@ -8518,25 +9012,25 @@ __pyx_v_shape = Py_None; Py_INCREF(Py_None); __pyx_v_diric = Py_None; Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2691 */ - __pyx_1 = PyObject_Length(__pyx_v_alpha); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2691; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2741 */ + __pyx_1 = PyObject_Length(__pyx_v_alpha); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} __pyx_v_k = __pyx_1; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2692 */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2692; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2742 */ + __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2742; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_alpha_arr)); __pyx_v_alpha_arr = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2693 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2743 */ __pyx_v_alpha_data = ((double *)__pyx_v_alpha_arr->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2695 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2745 */ __pyx_3 = __pyx_v_size == Py_None; if (__pyx_3) { - __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2696; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2696; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2746; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_shape); @@ -8544,102 +9038,106 @@ __pyx_4 = 0; goto __pyx_L2; } - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2747; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2747; goto __pyx_L1;} Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - __pyx_4 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2697; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2747; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_3 = __pyx_4 == ((PyObject *)(&PyInt_Type)); Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2747; goto __pyx_L1;} + __pyx_3 = __pyx_5 == __pyx_2; + Py_DECREF(__pyx_5); __pyx_5 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_3) { - __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2698; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_k); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2748; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2748; goto __pyx_L1;} Py_INCREF(__pyx_v_size); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2); - __pyx_2 = 0; + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size); + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); + __pyx_4 = 0; Py_DECREF(__pyx_v_shape); - __pyx_v_shape = __pyx_4; - __pyx_4 = 0; + __pyx_v_shape = __pyx_5; + __pyx_5 = 0; goto __pyx_L2; } /*else*/ { - __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2750; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2750; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); __pyx_2 = 0; - __pyx_2 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2700; goto __pyx_L1;} + __pyx_5 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2750; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_v_shape); - __pyx_v_shape = __pyx_2; - __pyx_2 = 0; + __pyx_v_shape = __pyx_5; + __pyx_5 = 0; } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2702 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;} - Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2752 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_zeros); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_float64); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;} + Py_DECREF(__pyx_5); __pyx_5 = 0; + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;} Py_INCREF(__pyx_v_shape); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_shape); - PyTuple_SET_ITEM(__pyx_4, 1, __pyx_5); - __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2702; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; + PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape); + PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); + __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2752; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_v_diric); - __pyx_v_diric = __pyx_5; - __pyx_5 = 0; + __pyx_v_diric = __pyx_2; + __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2703 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2753 */ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_diric))); Py_DECREF(((PyObject *)__pyx_v_val_arr)); __pyx_v_val_arr = ((PyArrayObject *)__pyx_v_diric); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2704 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2754 */ __pyx_v_val_data = ((double *)__pyx_v_val_arr->data); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2706 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2756 */ __pyx_v_i = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2707 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2757 */ __pyx_v_totsize = PyArray_SIZE(__pyx_v_val_arr); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2708 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2758 */ while (1) { __pyx_3 = (__pyx_v_i < __pyx_v_totsize); if (!__pyx_3) break; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2709 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2759 */ __pyx_v_acc = 0.0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2710 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2760 */ for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; ++__pyx_v_j) { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2711 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2761 */ (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = rk_standard_gamma(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,(__pyx_v_alpha_data[__pyx_v_j])); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2712 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2762 */ __pyx_v_acc = (__pyx_v_acc + (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)])); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2713 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2763 */ __pyx_v_invacc = (1 / __pyx_v_acc); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2714 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2764 */ for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; ++__pyx_v_j) { (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) = ((__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)]) * __pyx_v_invacc); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2716 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2766 */ __pyx_v_i = (__pyx_v_i + __pyx_v_k); } - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2718 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2768 */ Py_INCREF(__pyx_v_diric); __pyx_r = __pyx_v_diric; goto __pyx_L0; @@ -8684,25 +9182,28 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_x); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2731 */ - __pyx_1 = PyObject_Length(__pyx_v_x); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2731; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2781 */ + __pyx_1 = PyObject_Length(__pyx_v_x); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2781; goto __pyx_L1;} __pyx_v_i = (__pyx_1 - 1); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2732 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2782 */ /*try:*/ { - __pyx_2 = PySequence_GetItem(__pyx_v_x, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; goto __pyx_L2;} - __pyx_1 = PyObject_Length(__pyx_2); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2733; goto __pyx_L2;} + __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; goto __pyx_L2;} + __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; goto __pyx_L2;} Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_1 = PyObject_Length(__pyx_3); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2783; goto __pyx_L2;} + Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_v_j = __pyx_1; } goto __pyx_L3; __pyx_L2:; Py_XDECREF(__pyx_2); __pyx_2 = 0; + Py_XDECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2734 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2784 */ /*except:*/ { __Pyx_AddTraceback("mtrand.shuffle"); - if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2734; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;} __pyx_v_j = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -8711,64 +9212,82 @@ } __pyx_L3:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2737 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2787 */ __pyx_5 = (__pyx_v_j == 0); if (__pyx_5) { while (1) { __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2740 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2790 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2741 */ - __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} - __pyx_3 = PySequence_GetItem(__pyx_v_x, __pyx_v_i); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} - if (PySequence_SetItem(__pyx_v_x, __pyx_v_i, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2791 */ + __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} + __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - if (PySequence_SetItem(__pyx_v_x, __pyx_v_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2741; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2742 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2792 */ __pyx_v_i = (__pyx_v_i - 1); } goto __pyx_L4; } /*else*/ { - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2745 */ - __pyx_4 = PySequence_GetItem(__pyx_v_x, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2745; goto __pyx_L1;} - __pyx_5 = PyObject_HasAttr(__pyx_4,__pyx_n_copy); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2745; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2795 */ + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_5 = PyObject_HasAttr(__pyx_2,__pyx_n_copy); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_v_copy = __pyx_5; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2746 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2796 */ __pyx_5 = __pyx_v_copy; if (__pyx_5) { while (1) { __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2748 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2798 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2749 */ - __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2799 */ + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_copy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - if (PySequence_SetItem(__pyx_v_x, __pyx_v_i, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - if (PySequence_SetItem(__pyx_v_x, __pyx_v_j, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2749; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyObject_CallObject(__pyx_4, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2750 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2800 */ __pyx_v_i = (__pyx_v_i - 1); } goto __pyx_L7; @@ -8778,22 +9297,30 @@ __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2753 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2803 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2754 */ - __pyx_3 = PySequence_GetItem(__pyx_v_x, __pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} - __pyx_4 = PySequence_GetSlice(__pyx_3, 0, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} - Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PySequence_GetItem(__pyx_v_x, __pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} - __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2804 */ + __pyx_4 = PyInt_FromLong(__pyx_v_j); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - if (PySequence_SetItem(__pyx_v_x, __pyx_v_i, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - if (PySequence_SetItem(__pyx_v_x, __pyx_v_j, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2754; goto __pyx_L1;} + __pyx_4 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2755 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2805 */ __pyx_v_i = (__pyx_v_i - 1); } } @@ -8825,67 +9352,68 @@ PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; - int __pyx_3; - PyObject *__pyx_4 = 0; + PyObject *__pyx_3 = 0; + int __pyx_4; static char *__pyx_argnames[] = {"x",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0; Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_x); __pyx_v_arr = Py_None; Py_INCREF(Py_None); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2784 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_integer); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;} - Py_INCREF(((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)(&PyInt_Type))); - PyTuple_SET_ITEM(__pyx_1, 1, __pyx_2); - __pyx_2 = 0; - __pyx_3 = PyObject_IsInstance(__pyx_v_x,__pyx_1); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2784; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - if (__pyx_3) { - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; goto __pyx_L1;} - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_arange); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; goto __pyx_L1;} - Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2834 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_integer); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1); + PyTuple_SET_ITEM(__pyx_2, 1, __pyx_3); + __pyx_1 = 0; + __pyx_3 = 0; + __pyx_4 = PyObject_IsInstance(__pyx_v_x,__pyx_2); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2834; goto __pyx_L1;} + Py_DECREF(__pyx_2); __pyx_2 = 0; + if (__pyx_4) { + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;} + Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;} Py_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x); - __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2785; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_4; - __pyx_4 = 0; + __pyx_v_arr = __pyx_1; + __pyx_1 = 0; goto __pyx_L2; } /*else*/ { - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; goto __pyx_L1;} - Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;} + Py_DECREF(__pyx_3); __pyx_3 = 0; + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;} Py_INCREF(__pyx_v_x); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_x); - __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2787; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_x); + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; + Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_arr); - __pyx_v_arr = __pyx_1; - __pyx_1 = 0; + __pyx_v_arr = __pyx_3; + __pyx_3 = 0; } __pyx_L2:; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2788 */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2788; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2788; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2838 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2838; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2838; goto __pyx_L1;} Py_INCREF(__pyx_v_arr); - PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_arr); - __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2788; goto __pyx_L1;} + PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_arr); + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2838; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; + Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2789 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2839 */ Py_INCREF(__pyx_v_arr); __pyx_r = __pyx_v_arr; goto __pyx_L0; @@ -8895,7 +9423,7 @@ __pyx_L1:; Py_XDECREF(__pyx_1); Py_XDECREF(__pyx_2); - Py_XDECREF(__pyx_4); + Py_XDECREF(__pyx_3); __Pyx_AddTraceback("mtrand.RandomState.permutation"); __pyx_r = 0; __pyx_L0:; @@ -8907,6 +9435,8 @@ static __Pyx_InternTabEntry __pyx_intern_tab[] = { {&__pyx_n_MT19937, "MT19937"}, + {&__pyx_n_TypeError, "TypeError"}, + {&__pyx_n_ValueError, "ValueError"}, {&__pyx_n___RandomState_ctor, "__RandomState_ctor"}, {&__pyx_n__rand, "_rand"}, {&__pyx_n_add, "add"}, @@ -8933,10 +9463,12 @@ {&__pyx_n_greater, "greater"}, {&__pyx_n_gumbel, "gumbel"}, {&__pyx_n_hypergeometric, "hypergeometric"}, + {&__pyx_n_int, "int"}, {&__pyx_n_integer, "integer"}, {&__pyx_n_laplace, "laplace"}, {&__pyx_n_less, "less"}, {&__pyx_n_less_equal, "less_equal"}, + {&__pyx_n_list, "list"}, {&__pyx_n_logistic, "logistic"}, {&__pyx_n_lognormal, "lognormal"}, {&__pyx_n_logseries, "logseries"}, @@ -8975,6 +9507,8 @@ {&__pyx_n_subtract, "subtract"}, {&__pyx_n_svd, "svd"}, {&__pyx_n_triangular, "triangular"}, + {&__pyx_n_tuple, "tuple"}, + {&__pyx_n_type, "type"}, {&__pyx_n_uint, "uint"}, {&__pyx_n_uint32, "uint32"}, {&__pyx_n_uniform, "uniform"}, @@ -8993,10 +9527,10 @@ {&__pyx_k64p, __pyx_k64, sizeof(__pyx_k64)}, {&__pyx_k65p, __pyx_k65, sizeof(__pyx_k65)}, {&__pyx_k66p, __pyx_k66, sizeof(__pyx_k66)}, - {&__pyx_k69p, __pyx_k69, sizeof(__pyx_k69)}, + {&__pyx_k67p, __pyx_k67, sizeof(__pyx_k67)}, {&__pyx_k70p, __pyx_k70, sizeof(__pyx_k70)}, {&__pyx_k71p, __pyx_k71, sizeof(__pyx_k71)}, - {&__pyx_k73p, __pyx_k73, sizeof(__pyx_k73)}, + {&__pyx_k72p, __pyx_k72, sizeof(__pyx_k72)}, {&__pyx_k74p, __pyx_k74, sizeof(__pyx_k74)}, {&__pyx_k75p, __pyx_k75, sizeof(__pyx_k75)}, {&__pyx_k76p, __pyx_k76, sizeof(__pyx_k76)}, @@ -9092,7 +9626,8 @@ {&__pyx_k166p, __pyx_k166, sizeof(__pyx_k166)}, {&__pyx_k167p, __pyx_k167, sizeof(__pyx_k167)}, {&__pyx_k168p, __pyx_k168, sizeof(__pyx_k168)}, - {&__pyx_k170p, __pyx_k170, sizeof(__pyx_k170)}, + {&__pyx_k169p, __pyx_k169, sizeof(__pyx_k169)}, + {&__pyx_k171p, __pyx_k171, sizeof(__pyx_k171)}, {0, 0, 0} }; @@ -9115,6 +9650,14 @@ (*o->ob_type->tp_free)(o); } +static int __pyx_tp_traverse_6mtrand_RandomState(PyObject *o, visitproc v, void *a) { + return 0; +} + +static int __pyx_tp_clear_6mtrand_RandomState(PyObject *o) { + return 0; +} + static struct PyMethodDef __pyx_methods_6mtrand_RandomState[] = { {"seed", (PyCFunction)__pyx_f_6mtrand_11RandomState_seed, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_seed}, {"get_state", (PyCFunction)__pyx_f_6mtrand_11RandomState_get_state, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6mtrand_11RandomState_get_state}, @@ -9260,10 +9803,10 @@ 0, /*tp_getattro*/ 0, /*tp_setattro*/ &__pyx_tp_as_buffer_RandomState, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE, /*tp_flags*/ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/ "\n RandomState(seed=None)\n\n Container for the Mersenne Twister PRNG.\n\n `RandomState` exposes a number of methods for generating random numbers\n drawn from a variety of probability distributions. In addition to the\n distribution-specific arguments, each method takes a keyword argument\n `size` that defaults to ``None``. If `size` is ``None``, then a single\n value is generated and returned. If `size` is an integer, then a 1-D\n numpy array filled with generated values is returned. If size is a tuple,\n then a numpy array with that shape is filled and returned.\n\n Parameters\n ----------\n seed : {None, int, array-like}\n Random seed initializing the PRNG.\n Can be an integer, an array (or other sequence) of integers of\n any length, or ``None``.\n If `seed` is ``None``, then `RandomState` will try to read data from\n ``/dev/urandom`` (or the Windows analogue) if available or seed from\n the clock otherwise.\n\n ", /*tp_doc*/ - 0, /*tp_traverse*/ - 0, /*tp_clear*/ + __pyx_tp_traverse_6mtrand_RandomState, /*tp_traverse*/ + __pyx_tp_clear_6mtrand_RandomState, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ @@ -9327,559 +9870,559 @@ __pyx_ptype_6mtrand_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (!__pyx_ptype_6mtrand_ndarray) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 79; goto __pyx_L1;} __pyx_ptype_6mtrand_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (!__pyx_ptype_6mtrand_flatiter) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; goto __pyx_L1;} __pyx_ptype_6mtrand_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (!__pyx_ptype_6mtrand_broadcast) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 94; goto __pyx_L1;} - if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; goto __pyx_L1;} - if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 469; goto __pyx_L1;} + if (PyType_Ready(&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;} __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":120 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":121 */ import_array(); - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":122 */ - __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} - if (PyObject_SetAttr(__pyx_m, __pyx_n_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":123 */ + __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_np, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":496 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":546 */ Py_INCREF(Py_None); __pyx_k2 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":506 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":556 */ Py_INCREF(Py_None); __pyx_k3 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":596 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":646 */ Py_INCREF(Py_None); __pyx_k4 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":605 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":655 */ Py_INCREF(Py_None); __pyx_k5 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":633 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":683 */ Py_INCREF(Py_None); __pyx_k6 = Py_None; Py_INCREF(Py_None); __pyx_k7 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":697 */ - __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":747 */ + __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} __pyx_k8 = __pyx_1; __pyx_1 = 0; - __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; goto __pyx_L1;} + __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} __pyx_k9 = __pyx_2; __pyx_2 = 0; Py_INCREF(Py_None); __pyx_k10 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":845 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":895 */ Py_INCREF(Py_None); __pyx_k11 = Py_None; Py_INCREF(Py_None); __pyx_k12 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":860 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":910 */ Py_INCREF(Py_None); __pyx_k13 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":869 */ - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":919 */ + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;} __pyx_k14 = __pyx_3; __pyx_3 = 0; - __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;} __pyx_k15 = __pyx_4; __pyx_4 = 0; Py_INCREF(Py_None); __pyx_k16 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":969 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1019 */ Py_INCREF(Py_None); __pyx_k17 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1028 */ - __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1078 */ + __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; goto __pyx_L1;} __pyx_k18 = __pyx_5; __pyx_5 = 0; Py_INCREF(Py_None); __pyx_k19 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1078 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1128 */ Py_INCREF(Py_None); __pyx_k20 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1087 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1137 */ Py_INCREF(Py_None); __pyx_k21 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1109 */ - __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1159 */ + __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;} __pyx_k22 = __pyx_6; __pyx_6 = 0; Py_INCREF(Py_None); __pyx_k23 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1137 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1187 */ Py_INCREF(Py_None); __pyx_k24 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1166 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1216 */ Py_INCREF(Py_None); __pyx_k25 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1204 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1254 */ Py_INCREF(Py_None); __pyx_k26 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1284 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1334 */ Py_INCREF(Py_None); __pyx_k27 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1326 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1376 */ Py_INCREF(Py_None); __pyx_k28 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1335 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1385 */ Py_INCREF(Py_None); __pyx_k29 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1358 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1408 */ Py_INCREF(Py_None); __pyx_k30 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1453 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1503 */ Py_INCREF(Py_None); __pyx_k31 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1542 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1592 */ Py_INCREF(Py_None); __pyx_k32 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1641 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1691 */ Py_INCREF(Py_None); __pyx_k33 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1664 */ - __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1714 */ + __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;} __pyx_k34 = __pyx_7; __pyx_7 = 0; - __pyx_8 = PyFloat_FromDouble(1.0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + __pyx_8 = PyFloat_FromDouble(1.0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;} __pyx_k35 = __pyx_8; __pyx_8 = 0; Py_INCREF(Py_None); __pyx_k36 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1703 */ - __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1753 */ + __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; goto __pyx_L1;} __pyx_k37 = __pyx_9; __pyx_9 = 0; - __pyx_10 = PyFloat_FromDouble(1.0); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;} + __pyx_10 = PyFloat_FromDouble(1.0); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; goto __pyx_L1;} __pyx_k38 = __pyx_10; __pyx_10 = 0; Py_INCREF(Py_None); __pyx_k39 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1827 */ - __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1877 */ + __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; goto __pyx_L1;} __pyx_k40 = __pyx_11; __pyx_11 = 0; - __pyx_12 = PyFloat_FromDouble(1.0); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1827; goto __pyx_L1;} + __pyx_12 = PyFloat_FromDouble(1.0); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1877; goto __pyx_L1;} __pyx_k41 = __pyx_12; __pyx_12 = 0; Py_INCREF(Py_None); __pyx_k42 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1851 */ - __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1901 */ + __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; goto __pyx_L1;} __pyx_k43 = __pyx_13; __pyx_13 = 0; - __pyx_14 = PyFloat_FromDouble(1.0); if (!__pyx_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1851; goto __pyx_L1;} + __pyx_14 = PyFloat_FromDouble(1.0); if (!__pyx_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1901; goto __pyx_L1;} __pyx_k44 = __pyx_14; __pyx_14 = 0; Py_INCREF(Py_None); __pyx_k45 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":1982 */ - __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2032 */ + __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2032; goto __pyx_L1;} __pyx_k46 = __pyx_15; __pyx_15 = 0; Py_INCREF(Py_None); __pyx_k47 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2006 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2056 */ Py_INCREF(Py_None); __pyx_k48 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2036 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2086 */ Py_INCREF(Py_None); __pyx_k49 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2075 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2125 */ Py_INCREF(Py_None); __pyx_k50 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2109 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2159 */ Py_INCREF(Py_None); __pyx_k51 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2146 */ - __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2196 */ + __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2196; goto __pyx_L1;} __pyx_k52 = __pyx_16; __pyx_16 = 0; Py_INCREF(Py_None); __pyx_k53 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2168 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2218 */ Py_INCREF(Py_None); __pyx_k54 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2260 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2310 */ Py_INCREF(Py_None); __pyx_k55 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2326 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2376 */ Py_INCREF(Py_None); __pyx_k56 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2373 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2423 */ Py_INCREF(Py_None); __pyx_k57 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2401 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2451 */ Py_INCREF(Py_None); __pyx_k58 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2534 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2584 */ Py_INCREF(Py_None); __pyx_k59 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2627 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2677 */ Py_INCREF(Py_None); __pyx_k60 = Py_None; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2791 */ - __pyx_17 = PyObject_CallObject(((PyObject *)__pyx_ptype_6mtrand_RandomState), 0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} - if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2791; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2841 */ + __pyx_17 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), 0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2841; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2792 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2792; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2792; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2842 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2792; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2842; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2793 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2843 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2843; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2843; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2793; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2843; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2794 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2794; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2794; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2844 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2844; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2844; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2794; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2844; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2795 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2845 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2845; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2845; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2795; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2845; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2796 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2846 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2846; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2846; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2796; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2846; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2797 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2797; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2797; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2847 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2797; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2847; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2798 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2848 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2848; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2848; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2798; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2848; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2799 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2849 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2799; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2849; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2800 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2850 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2850; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2850; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2800; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2850; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2801 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2851 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2801; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2851; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2802 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2852 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2802; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2852; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2803 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2853 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2853; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2853; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2803; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2853; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2804 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2854 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2854; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2854; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2804; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2854; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2805 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2855 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2855; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2855; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2805; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2855; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2806 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2856 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2856; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2856; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2806; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2856; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2807 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2857 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2857; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2857; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2807; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2857; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2808 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2858 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2858; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2858; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2808; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2858; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2809 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2859 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2859; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2859; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2809; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2859; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2810 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2860 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2860; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2860; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2810; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2860; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2811 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2811; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2811; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2861 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2861; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2861; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2811; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2861; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2812 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2862 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2812; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2862; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2813 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2813; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2813; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2863 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2863; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2863; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2813; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2863; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2814 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2814; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2814; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2864 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2864; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2864; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2814; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2864; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2815 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2865 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2815; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2865; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2816 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2866 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2866; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2866; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2816; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2866; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2817 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2867 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2867; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2867; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2817; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2867; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2818 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2868 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2818; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2868; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2819 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2869 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2869; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2869; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2819; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2869; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2820 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2870 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2870; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2870; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2820; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2870; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2821 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2871 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2821; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2871; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2822 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2872 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2872; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2872; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2822; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2872; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2823 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2873 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2873; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2873; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2823; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2873; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2824 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2874 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2874; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2874; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2824; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2874; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2825 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2875 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2825; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2875; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2827 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2877 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2827; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2877; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2828 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2878 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2878; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2878; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2828; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2878; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2829 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2879 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2879; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2879; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2829; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2879; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2830 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2880 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2880; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2880; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2830; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2880; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2831 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2881 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2831; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2881; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2832 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2832; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2832; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2882 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2882; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2882; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2832; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2882; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2833 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2833; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2833; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2883 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2883; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2883; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2833; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2883; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2835 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2885 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2835; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2885; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2836 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2836; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2836; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2886 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2886; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2886; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2836; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_multinomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2886; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2837 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_dirichlet); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2887 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2887; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_dirichlet); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2887; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_dirichlet, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2837; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_dirichlet, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2887; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2839 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2889 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2889; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2889; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2839; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2889; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/pauli/koodi/proj/numpy/one-shot/numpy/random/mtrand/mtrand.pyx":2840 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2890 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2890; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2890; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2840; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_permutation, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2890; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; return; __pyx_L1:; Modified: trunk/numpy/random/mtrand/mtrand.pyx =================================================================== --- trunk/numpy/random/mtrand/mtrand.pyx 2008-08-22 21:41:19 UTC (rev 5675) +++ trunk/numpy/random/mtrand/mtrand.pyx 2008-08-23 06:12:01 UTC (rev 5676) @@ -92,7 +92,7 @@ long rk_binomial(rk_state *state, long n, double p) long rk_binomial_btpe(rk_state *state, long n, double p) long rk_binomial_inversion(rk_state *state, long n, double p) - long rk_negative_binomial(rk_state *state, long n, double p) + long rk_negative_binomial(rk_state *state, double n, double p) long rk_poisson(rk_state *state, double lam) long rk_poisson_mult(rk_state *state, double lam) long rk_poisson_ptrs(rk_state *state, double lam) @@ -108,6 +108,7 @@ ctypedef long (* rk_disc0)(rk_state *state) ctypedef long (* rk_discnp)(rk_state *state, long n, double p) +ctypedef long (* rk_discdd)(rk_state *state, double n, double p) ctypedef long (* rk_discnmN)(rk_state *state, long n, long m, long N) ctypedef long (* rk_discd)(rk_state *state, double a) @@ -355,6 +356,55 @@ return array +cdef object discdd_array_sc(rk_state *state, rk_discdd func, object size, double n, double p): + cdef long *array_data + cdef ndarray array "arrayObject" + cdef long length + cdef long i + + if size is None: + return func(state, n, p) + else: + array = np.empty(size, int) + length = PyArray_SIZE(array) + array_data = array.data + for i from 0 <= i < length: + array_data[i] = func(state, n, p) + return array + +cdef object discdd_array(rk_state *state, rk_discdd func, object size, ndarray on, ndarray op): + cdef long *array_data + cdef ndarray array "arrayObject" + cdef npy_intp length + cdef npy_intp i + cdef double *op_data + cdef double *on_data + cdef broadcast multi + + if size is None: + multi = PyArray_MultiIterNew(2, on, op) + array = PyArray_SimpleNew(multi.nd, multi.dimensions, NPY_LONG) + array_data = array.data + for i from 0 <= i < multi.size: + on_data = PyArray_MultiIter_DATA(multi, 0) + op_data = PyArray_MultiIter_DATA(multi, 1) + array_data[i] = func(state, on_data[0], op_data[0]) + PyArray_MultiIter_NEXT(multi) + else: + array = np.empty(size, int) + array_data = array.data + multi = PyArray_MultiIterNew(3, array, on, op) + if (multi.size != PyArray_SIZE(array)): + raise ValueError("size is not compatible with inputs") + for i from 0 <= i < multi.size: + on_data = PyArray_MultiIter_DATA(multi, 1) + op_data = PyArray_MultiIter_DATA(multi, 2) + array_data[i] = func(state, on_data[0], op_data[0]) + PyArray_MultiIter_NEXTi(multi, 1) + PyArray_MultiIter_NEXTi(multi, 2) + + return array + cdef object discnmN_array_sc(rk_state *state, rk_discnmN func, object size, long n, long m, long N): cdef long *array_data @@ -2115,24 +2165,24 @@ """ cdef ndarray on cdef ndarray op - cdef long ln + cdef double fn cdef double fp fp = PyFloat_AsDouble(p) - ln = PyInt_AsLong(n) + fn = PyFloat_AsDouble(n) if not PyErr_Occurred(): - if ln <= 0: + if fn <= 0: raise ValueError("n <= 0") if fp < 0: raise ValueError("p < 0") elif fp > 1: raise ValueError("p > 1") - return discnp_array_sc(self.internal_state, rk_negative_binomial, - size, ln, fp) + return discdd_array_sc(self.internal_state, rk_negative_binomial, + size, fn, fp) PyErr_Clear() - on = PyArray_FROM_OTF(n, NPY_LONG, NPY_ALIGNED) + on = PyArray_FROM_OTF(n, NPY_DOUBLE, NPY_ALIGNED) op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) if np.any(np.less_equal(n, 0)): raise ValueError("n <= 0") @@ -2140,7 +2190,7 @@ raise ValueError("p < 0") if np.any(np.greater(p, 1)): raise ValueError("p > 1") - return discnp_array(self.internal_state, rk_negative_binomial, size, + return discdd_array(self.internal_state, rk_negative_binomial, size, on, op) def poisson(self, lam=1.0, size=None): Modified: trunk/numpy/random/tests/test_random.py =================================================================== --- trunk/numpy/random/tests/test_random.py 2008-08-22 21:41:19 UTC (rev 5675) +++ trunk/numpy/random/tests/test_random.py 2008-08-23 06:12:01 UTC (rev 5676) @@ -60,6 +60,12 @@ assert np.all(x1 == x2) assert np.all(x1 == x3) + def test_negative_binomial(self): + """ Ensure that the negative binomial results take floating point + arguments without truncation. + """ + self.prng.negative_binomial(0.5, 0.5) + if __name__ == "__main__": run_module_suite() From numpy-svn at scipy.org Sat Aug 23 02:14:11 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 01:14:11 -0500 (CDT) Subject: [Numpy-svn] r5677 - trunk/numpy/distutils/command Message-ID: <20080823061411.2DE6439C072@scipy.org> Author: rkern Date: 2008-08-23 01:14:08 -0500 (Sat, 23 Aug 2008) New Revision: 5677 Modified: trunk/numpy/distutils/command/build_ext.py Log: BUG: reinitialize_command(**kwds) is a setuptools override of the distutils API. Set the attribute directly, instead. Modified: trunk/numpy/distutils/command/build_ext.py =================================================================== --- trunk/numpy/distutils/command/build_ext.py 2008-08-23 06:12:01 UTC (rev 5676) +++ trunk/numpy/distutils/command/build_ext.py 2008-08-23 06:14:08 UTC (rev 5677) @@ -219,7 +219,8 @@ # Make sure that scons based extensions are complete. if self.inplace: - self.reinitialize_command('scons', inplace=1) + cmd = self.reinitialize_command('scons') + cmd.inplace = 1 self.run_command('scons') def swig_sources(self, sources): From numpy-svn at scipy.org Sat Aug 23 16:35:16 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 15:35:16 -0500 (CDT) Subject: [Numpy-svn] r5678 - branches Message-ID: <20080823203516.ED4F439C021@scipy.org> Author: chris.burns Date: 2008-08-23 15:35:13 -0500 (Sat, 23 Aug 2008) New Revision: 5678 Added: branches/memmaps/ Log: Create a branch for debugging memmaps at scipy 2008 sprint. Copied: branches/memmaps (from rev 5677, trunk/numpy/core) From numpy-svn at scipy.org Sat Aug 23 17:18:48 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 16:18:48 -0500 (CDT) Subject: [Numpy-svn] r5679 - branches/1.1.x/numpy/f2py/lib/extgen Message-ID: <20080823211848.CF2A539C021@scipy.org> Author: oliphant Date: 2008-08-23 16:18:47 -0500 (Sat, 23 Aug 2008) New Revision: 5679 Modified: branches/1.1.x/numpy/f2py/lib/extgen/py_support.py Log: Fix .update() problem for 2.3. Fixes #821 Modified: branches/1.1.x/numpy/f2py/lib/extgen/py_support.py =================================================================== --- branches/1.1.x/numpy/f2py/lib/extgen/py_support.py 2008-08-23 20:35:13 UTC (rev 5678) +++ branches/1.1.x/numpy/f2py/lib/extgen/py_support.py 2008-08-23 21:18:47 UTC (rev 5679) @@ -59,10 +59,11 @@ ''' container_options = CSource.container_options.copy() - container_options.update(CAPIDefinition=container_options['CDefinition'], - PyCModuleCDeclaration=dict(default='', - ignore_empty_content=True), - ) + container_options.update(dict(CAPIDefinition=container_options['CDefinition'], + PyCModuleCDeclaration=dict(default='', + ignore_empty_content=True)\ + )\ + ) component_container_map = dict( PyCModuleInitFunction = 'CMainProgram', @@ -281,17 +282,17 @@ use_firstline_indent=True, replace_map={'\n':'\\n'}) class ReqArgDoc(ArgDocBase): parent_container_options = ArgDocBase.parent_container_options.copy() - parent_container_options.update(prefix='"\\n\\n:Parameters:\\n"\n" ') + parent_container_options.update(dict(prefix='"\\n\\n:Parameters:\\n"\n" ')) class OptArgDoc(ArgDocBase): parent_container_options = ArgDocBase.parent_container_options.copy() - parent_container_options.update(prefix='"\\n\\n:Optional parameters:\\n"\n" ') + parent_container_options.update(dict(prefix='"\\n\\n:Optional parameters:\\n"\n" ')) class ExtArgDoc(ArgDocBase): parent_container_options = ArgDocBase.parent_container_options.copy() - parent_container_options.update(prefix='"\\n\\n:Extra parameters:\\n"\n" ') + parent_container_options.update(dict(prefix='"\\n\\n:Extra parameters:\\n"\n" ')) class RetArgDoc(ArgDocBase): parent_container_options = ArgDocBase.parent_container_options.copy() - parent_container_options.update(prefix='"\\n\\n:Returns:\\n"\n" ', - default='"\\n\\n:Returns:\\n None"') + parent_container_options.update(dict(prefix='"\\n\\n:Returns:\\n"\n" ', + default='"\\n\\n:Returns:\\n None"')) class ArgFmtBase(Word): parent_container_options = dict(separator='') class ReqArgFmt(ArgFmtBase): pass class OptArgFmt(ArgFmtBase): pass @@ -400,8 +401,8 @@ container_options = CFunction.container_options.copy() - container_options.update(\ - + container_options.update(dict(\ + TMP = dict(), ReqArg = ReqArg.parent_container_options, @@ -446,18 +447,15 @@ CleanPyObjFrom = dict(default='', reverse=True, use_indent=True, ignore_empty_content=True), CleanCBody = dict(default='', reverse=True, use_indent=True, ignore_empty_content=True), - CleanFromPyObj = dict(default='', reverse=True, use_indent=True, ignore_empty_content=True), + CleanFromPyObj = dict(default='', reverse=True, use_indent=True, ignore_empty_content=True))) - ) - default_component_class_name = 'CCode' component_container_map = CFunction.component_container_map.copy() - component_container_map.update( - PyCArgument = 'TMP', - CCode = 'CBody', - ) - + component_container_map.update(dict( + PyCArgument = 'TMP', + CCode = 'CBody')) + def initialize(self, pyname, *components, **options): self.pyname = pyname self.title = options.pop('title', None) From numpy-svn at scipy.org Sat Aug 23 18:52:57 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 17:52:57 -0500 (CDT) Subject: [Numpy-svn] r5680 - in trunk/numpy/core: . src Message-ID: <20080823225257.2C84C39C0AE@scipy.org> Author: oliphant Date: 2008-08-23 17:52:55 -0500 (Sat, 23 Aug 2008) New Revision: 5680 Modified: trunk/numpy/core/memmap.py trunk/numpy/core/src/scalarmathmodule.c.src Log: Trial fix to ticket #698 Modified: trunk/numpy/core/memmap.py =================================================================== --- trunk/numpy/core/memmap.py 2008-08-23 21:18:47 UTC (rev 5679) +++ trunk/numpy/core/memmap.py 2008-08-23 22:52:55 UTC (rev 5680) @@ -219,6 +219,7 @@ self = ndarray.__new__(subtype, shape, dtype=descr, buffer=mm, offset=offset, order=order) self._mmap = mm +# Should get rid of these... Are they used? self._offset = offset self._mode = mode self._size = size Modified: trunk/numpy/core/src/scalarmathmodule.c.src =================================================================== --- trunk/numpy/core/src/scalarmathmodule.c.src 2008-08-23 21:18:47 UTC (rev 5679) +++ trunk/numpy/core/src/scalarmathmodule.c.src 2008-08-23 22:52:55 UTC (rev 5680) @@ -524,6 +524,13 @@ return -2; } +/**end repeat**/ + + +/**begin repeat + #name=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,cfloat,cdouble# +**/ + static int _ at name@_convert2_to_ctypes(PyObject *a, @name@ *arg1, PyObject *b, @name@ *arg2) @@ -539,6 +546,27 @@ /**end repeat**/ /**begin repeat + #name=longdouble, clongdouble# +**/ + +static int +_ at name@_convert2_to_ctypes(PyObject *a, @name@ *arg1, + PyObject *b, @name@ *arg2) +{ + int ret; + ret = _ at name@_convert_to_ctype(a, arg1); + if (ret < 0) return ret; + ret = _ at name@_convert_to_ctype(b, arg2); + if (ret == -2) ret = -3; + if (ret < 0) return ret; + return 0; +} + +/**end repeat**/ + + + +/**begin repeat #name=(byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong)*13, (float, double, longdouble, cfloat, cdouble, clongdouble)*6, (float, double, longdouble)*2# #Name=(Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong)*13, (Float, Double, LongDouble, CFloat, CDouble, CLongDouble)*6, (Float, Double, LongDouble)*2# #oper=add*10, subtract*10, multiply*10, divide*10, remainder*10, divmod*10, floor_divide*10, lshift*10, rshift*10, and*10, or*10, xor*10, true_divide*10, add*6, subtract*6, multiply*6, divide*6, floor_divide*6, true_divide*6, divmod*3, remainder*3# @@ -569,10 +597,14 @@ break; case -1: /* one of them can't be cast safely must be mixed-types*/ - return PyArray_Type.tp_as_number->nb_ at oper@(a,b); + return PyArray_Type.tp_as_number->nb_ at oper@(a,b); case -2: /* use default handling */ if (PyErr_Occurred()) return NULL; return PyGenericArrType_Type.tp_as_number->nb_ at oper@(a,b); + case -3: /* special case for longdouble and clongdouble + because they have a recursive getitem in their dtype */ + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } #if @fperr@ @@ -658,6 +690,10 @@ case -2: /* use default handling */ if (PyErr_Occurred()) return NULL; return PyGenericArrType_Type.tp_as_number->nb_power(a,b,NULL); + case -3: /* special case for longdouble and clongdouble + because they have a recursive getitem in their dtype */ + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } PyUFunc_clearfperr(); @@ -887,6 +923,10 @@ case -2: /* use ufunc */ if (PyErr_Occurred()) return NULL; return PyGenericArrType_Type.tp_richcompare(self, other, cmp_op); + case -3: /* special case for longdouble and clongdouble + because they have a recursive getitem in their dtype */ + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } /* here we do the actual calculation with arg1 and arg2 */ From numpy-svn at scipy.org Sat Aug 23 19:20:13 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 18:20:13 -0500 (CDT) Subject: [Numpy-svn] r5681 - in trunk: . doc doc/floatint doc/test numpy numpy/doc numpy/doc/reference Message-ID: <20080823232013.6E16639C0AE@scipy.org> Author: stefan Date: 2008-08-23 18:17:23 -0500 (Sat, 23 Aug 2008) New Revision: 5681 Added: trunk/doc/ trunk/doc/CAPI.txt trunk/doc/DISTUTILS.txt trunk/doc/EXAMPLE_DOCSTRING.txt trunk/doc/HOWTO_BUILD_DOCS.txt trunk/doc/HOWTO_DOCUMENT.txt trunk/doc/README.txt trunk/doc/cython/ trunk/doc/example.py trunk/doc/floatint/ trunk/doc/html/ trunk/doc/newdtype_example/ trunk/doc/npy-format.txt trunk/doc/pep_buffer.txt trunk/doc/pyrex/ trunk/doc/records.txt trunk/doc/swig/ trunk/doc/test/ trunk/doc/ufuncs.txt trunk/numpy/doc/basics.py trunk/numpy/doc/broadcasting.py trunk/numpy/doc/creation.py trunk/numpy/doc/glossary.py trunk/numpy/doc/howtofind.py trunk/numpy/doc/indexing.py trunk/numpy/doc/internals.py trunk/numpy/doc/io.py trunk/numpy/doc/jargon.py trunk/numpy/doc/methods_vs_functions.py trunk/numpy/doc/misc.py trunk/numpy/doc/performance.py trunk/numpy/doc/structured_arrays.py trunk/numpy/doc/ufuncs.py Removed: trunk/doc/floatint/__init__.py trunk/doc/test/Array.i trunk/doc/test/Array1.cxx trunk/doc/test/Array1.h trunk/doc/test/Array2.cxx trunk/doc/test/Array2.h trunk/doc/test/Farray.cxx trunk/doc/test/Farray.h trunk/doc/test/Farray.i trunk/doc/test/Fortran.cxx trunk/doc/test/Fortran.h trunk/doc/test/Fortran.i trunk/doc/test/Makefile trunk/doc/test/Matrix.cxx trunk/doc/test/Matrix.h trunk/doc/test/Matrix.i trunk/doc/test/Tensor.cxx trunk/doc/test/Tensor.h trunk/doc/test/Tensor.i trunk/doc/test/Vector.cxx trunk/doc/test/Vector.h trunk/doc/test/Vector.i trunk/doc/test/setup.py trunk/doc/test/testArray.py trunk/doc/test/testFarray.py trunk/doc/test/testFortran.py trunk/doc/test/testMatrix.py trunk/doc/test/testTensor.py trunk/doc/test/testVector.py trunk/numpy/doc/CAPI.txt trunk/numpy/doc/DISTUTILS.txt trunk/numpy/doc/EXAMPLE_DOCSTRING.txt trunk/numpy/doc/HOWTO_BUILD_DOCS.txt trunk/numpy/doc/HOWTO_DOCUMENT.txt trunk/numpy/doc/README.txt trunk/numpy/doc/cython/ trunk/numpy/doc/example.py trunk/numpy/doc/html/ trunk/numpy/doc/newdtype_example/ trunk/numpy/doc/npy-format.txt trunk/numpy/doc/pep_buffer.txt trunk/numpy/doc/pyrex/ trunk/numpy/doc/records.txt trunk/numpy/doc/reference/basics.py trunk/numpy/doc/reference/broadcasting.py trunk/numpy/doc/reference/creation.py trunk/numpy/doc/reference/glossary.py trunk/numpy/doc/reference/howtofind.py trunk/numpy/doc/reference/indexing.py trunk/numpy/doc/reference/internals.py trunk/numpy/doc/reference/io.py trunk/numpy/doc/reference/jargon.py trunk/numpy/doc/reference/methods_vs_functions.py trunk/numpy/doc/reference/misc.py trunk/numpy/doc/reference/performance.py trunk/numpy/doc/reference/structured_arrays.py trunk/numpy/doc/reference/ufuncs.py trunk/numpy/doc/swig/ trunk/numpy/doc/ufuncs.txt Modified: trunk/numpy/__init__.py trunk/numpy/doc/__init__.py Log: Move documentation outside of source tree. Remove `doc` import from __init__. Copied: trunk/doc/CAPI.txt (from rev 5669, trunk/numpy/doc/CAPI.txt) Copied: trunk/doc/DISTUTILS.txt (from rev 5669, trunk/numpy/doc/DISTUTILS.txt) Copied: trunk/doc/EXAMPLE_DOCSTRING.txt (from rev 5669, trunk/numpy/doc/EXAMPLE_DOCSTRING.txt) Copied: trunk/doc/HOWTO_BUILD_DOCS.txt (from rev 5669, trunk/numpy/doc/HOWTO_BUILD_DOCS.txt) Copied: trunk/doc/HOWTO_DOCUMENT.txt (from rev 5669, trunk/numpy/doc/HOWTO_DOCUMENT.txt) Copied: trunk/doc/README.txt (from rev 5669, trunk/numpy/doc/README.txt) Copied: trunk/doc/cython (from rev 5669, trunk/numpy/doc/cython) Copied: trunk/doc/example.py (from rev 5669, trunk/numpy/doc/example.py) Copied: trunk/doc/floatint (from rev 5669, trunk/numpy/doc/newdtype_example/floatint) Deleted: trunk/doc/floatint/__init__.py =================================================================== Copied: trunk/doc/html (from rev 5669, trunk/numpy/doc/html) Copied: trunk/doc/newdtype_example (from rev 5669, trunk/numpy/doc/newdtype_example) Copied: trunk/doc/npy-format.txt (from rev 5669, trunk/numpy/doc/npy-format.txt) Copied: trunk/doc/pep_buffer.txt (from rev 5669, trunk/numpy/doc/pep_buffer.txt) Copied: trunk/doc/pyrex (from rev 5669, trunk/numpy/doc/pyrex) Copied: trunk/doc/records.txt (from rev 5669, trunk/numpy/doc/records.txt) Copied: trunk/doc/swig (from rev 5669, trunk/numpy/doc/swig) Copied: trunk/doc/test (from rev 5669, trunk/numpy/doc/swig/test) Deleted: trunk/doc/test/Array.i =================================================================== --- trunk/numpy/doc/swig/test/Array.i 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Array.i 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,107 +0,0 @@ -// -*- c++ -*- - -%module Array - -%{ -#define SWIG_FILE_WITH_INIT -#include "Array1.h" -#include "Array2.h" -%} - -// Get the NumPy typemaps -%include "../numpy.i" - - // Get the STL typemaps -%include "stl.i" - -// Handle standard exceptions -%include "exception.i" -%exception -{ - try - { - $action - } - catch (const std::invalid_argument& e) - { - SWIG_exception(SWIG_ValueError, e.what()); - } - catch (const std::out_of_range& e) - { - SWIG_exception(SWIG_IndexError, e.what()); - } -} -%init %{ - import_array(); -%} - -// Global ignores -%ignore *::operator=; -%ignore *::operator[]; - -// Apply the 1D NumPy typemaps -%apply (int DIM1 , long* INPLACE_ARRAY1) - {(int length, long* data )}; -%apply (long** ARGOUTVIEW_ARRAY1, int* DIM1 ) - {(long** data , int* length)}; - -// Apply the 2D NumPy typemaps -%apply (int DIM1 , int DIM2 , long* INPLACE_ARRAY2) - {(int nrows, int ncols, long* data )}; -%apply (int* DIM1 , int* DIM2 , long** ARGOUTVIEW_ARRAY2) - {(int* nrows, int* ncols, long** data )}; -// Note: the %apply for INPLACE_ARRAY2 above gets successfully applied -// to the constructor Array2(int nrows, int ncols, long* data), but -// does not get applied to the method Array2::resize(int nrows, int -// ncols, long* data). I have no idea why. For this reason the test -// for Apply2.resize(numpy.ndarray) in testArray.py is commented out. - -// Array1 support -%include "Array1.h" -%extend Array1 -{ - void __setitem__(int i, long v) - { - self->operator[](i) = v; - } - - long __getitem__(int i) - { - return self->operator[](i); - } - - int __len__() - { - return self->length(); - } - - std::string __str__() - { - return self->asString(); - } -} - -// Array2 support -%include "Array2.h" -%extend Array2 -{ - void __setitem__(int i, Array1 & v) - { - self->operator[](i) = v; - } - - Array1 & __getitem__(int i) - { - return self->operator[](i); - } - - int __len__() - { - return self->nrows() * self->ncols(); - } - - std::string __str__() - { - return self->asString(); - } -} Deleted: trunk/doc/test/Array1.cxx =================================================================== --- trunk/numpy/doc/swig/test/Array1.cxx 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Array1.cxx 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,131 +0,0 @@ -#include "Array1.h" -#include -#include - -// Default/length/array constructor -Array1::Array1(int length, long* data) : - _ownData(false), _length(0), _buffer(0) -{ - resize(length, data); -} - -// Copy constructor -Array1::Array1(const Array1 & source) : - _length(source._length) -{ - allocateMemory(); - *this = source; -} - -// Destructor -Array1::~Array1() -{ - deallocateMemory(); -} - -// Assignment operator -Array1 & Array1::operator=(const Array1 & source) -{ - int len = _length < source._length ? _length : source._length; - for (int i=0; i < len; ++i) - { - (*this)[i] = source[i]; - } - return *this; -} - -// Equals operator -bool Array1::operator==(const Array1 & other) const -{ - if (_length != other._length) return false; - for (int i=0; i < _length; ++i) - { - if ((*this)[i] != other[i]) return false; - } - return true; -} - -// Length accessor -int Array1::length() const -{ - return _length; -} - -// Resize array -void Array1::resize(int length, long* data) -{ - if (length < 0) throw std::invalid_argument("Array1 length less than 0"); - if (length == _length) return; - deallocateMemory(); - _length = length; - if (!data) - { - allocateMemory(); - } - else - { - _ownData = false; - _buffer = data; - } -} - -// Set item accessor -long & Array1::operator[](int i) -{ - if (i < 0 || i >= _length) throw std::out_of_range("Array1 index out of range"); - return _buffer[i]; -} - -// Get item accessor -const long & Array1::operator[](int i) const -{ - if (i < 0 || i >= _length) throw std::out_of_range("Array1 index out of range"); - return _buffer[i]; -} - -// String output -std::string Array1::asString() const -{ - std::stringstream result; - result << "["; - for (int i=0; i < _length; ++i) - { - result << " " << _buffer[i]; - if (i < _length-1) result << ","; - } - result << " ]"; - return result.str(); -} - -// Get view -void Array1::view(long** data, int* length) const -{ - *data = _buffer; - *length = _length; -} - -// Private methods - void Array1::allocateMemory() - { - if (_length == 0) - { - _ownData = false; - _buffer = 0; - } - else - { - _ownData = true; - _buffer = new long[_length]; - } - } - - void Array1::deallocateMemory() - { - if (_ownData && _length && _buffer) - { - delete [] _buffer; - } - _ownData = false; - _length = 0; - _buffer = 0; - } Deleted: trunk/doc/test/Array1.h =================================================================== --- trunk/numpy/doc/swig/test/Array1.h 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Array1.h 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,55 +0,0 @@ -#ifndef ARRAY1_H -#define ARRAY1_H - -#include -#include - -class Array1 -{ -public: - - // Default/length/array constructor - Array1(int length = 0, long* data = 0); - - // Copy constructor - Array1(const Array1 & source); - - // Destructor - ~Array1(); - - // Assignment operator - Array1 & operator=(const Array1 & source); - - // Equals operator - bool operator==(const Array1 & other) const; - - // Length accessor - int length() const; - - // Resize array - void resize(int length, long* data = 0); - - // Set item accessor - long & operator[](int i); - - // Get item accessor - const long & operator[](int i) const; - - // String output - std::string asString() const; - - // Get view - void view(long** data, int* length) const; - -private: - // Members - bool _ownData; - int _length; - long * _buffer; - - // Methods - void allocateMemory(); - void deallocateMemory(); -}; - -#endif Deleted: trunk/doc/test/Array2.cxx =================================================================== --- trunk/numpy/doc/swig/test/Array2.cxx 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Array2.cxx 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,168 +0,0 @@ -#include "Array2.h" -#include - -// Default constructor -Array2::Array2() : - _ownData(false), _nrows(0), _ncols(), _buffer(0), _rows(0) -{ } - -// Size/array constructor -Array2::Array2(int nrows, int ncols, long* data) : - _ownData(false), _nrows(0), _ncols(), _buffer(0), _rows(0) -{ - resize(nrows, ncols, data); -} - -// Copy constructor -Array2::Array2(const Array2 & source) : - _nrows(source._nrows), _ncols(source._ncols) -{ - _ownData = true; - allocateMemory(); - *this = source; -} - -// Destructor -Array2::~Array2() -{ - deallocateMemory(); -} - -// Assignment operator -Array2 & Array2::operator=(const Array2 & source) -{ - int nrows = _nrows < source._nrows ? _nrows : source._nrows; - int ncols = _ncols < source._ncols ? _ncols : source._ncols; - for (int i=0; i < nrows; ++i) - { - for (int j=0; j < ncols; ++j) - { - (*this)[i][j] = source[i][j]; - } - } - return *this; -} - -// Equals operator -bool Array2::operator==(const Array2 & other) const -{ - if (_nrows != other._nrows) return false; - if (_ncols != other._ncols) return false; - for (int i=0; i < _nrows; ++i) - { - for (int j=0; j < _ncols; ++j) - { - if ((*this)[i][j] != other[i][j]) return false; - } - } - return true; -} - -// Length accessors -int Array2::nrows() const -{ - return _nrows; -} - -int Array2::ncols() const -{ - return _ncols; -} - -// Resize array -void Array2::resize(int nrows, int ncols, long* data) -{ - if (nrows < 0) throw std::invalid_argument("Array2 nrows less than 0"); - if (ncols < 0) throw std::invalid_argument("Array2 ncols less than 0"); - if (nrows == _nrows && ncols == _ncols) return; - deallocateMemory(); - _nrows = nrows; - _ncols = ncols; - if (!data) - { - allocateMemory(); - } - else - { - _ownData = false; - _buffer = data; - allocateRows(); - } -} - -// Set item accessor -Array1 & Array2::operator[](int i) -{ - if (i < 0 || i > _nrows) throw std::out_of_range("Array2 row index out of range"); - return _rows[i]; -} - -// Get item accessor -const Array1 & Array2::operator[](int i) const -{ - if (i < 0 || i > _nrows) throw std::out_of_range("Array2 row index out of range"); - return _rows[i]; -} - -// String output -std::string Array2::asString() const -{ - std::stringstream result; - result << "[ "; - for (int i=0; i < _nrows; ++i) - { - if (i > 0) result << " "; - result << (*this)[i].asString(); - if (i < _nrows-1) result << "," << std::endl; - } - result << " ]" << std::endl; - return result.str(); -} - -// Get view -void Array2::view(int* nrows, int* ncols, long** data) const -{ - *nrows = _nrows; - *ncols = _ncols; - *data = _buffer; -} - -// Private methods -void Array2::allocateMemory() -{ - if (_nrows * _ncols == 0) - { - _ownData = false; - _buffer = 0; - _rows = 0; - } - else - { - _ownData = true; - _buffer = new long[_nrows*_ncols]; - allocateRows(); - } -} - -void Array2::allocateRows() -{ - _rows = new Array1[_nrows]; - for (int i=0; i < _nrows; ++i) - { - _rows[i].resize(_ncols, &_buffer[i*_ncols]); - } -} - -void Array2::deallocateMemory() -{ - if (_ownData && _nrows*_ncols && _buffer) - { - delete [] _rows; - delete [] _buffer; - } - _ownData = false; - _nrows = 0; - _ncols = 0; - _buffer = 0; - _rows = 0; -} Deleted: trunk/doc/test/Array2.h =================================================================== --- trunk/numpy/doc/swig/test/Array2.h 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Array2.h 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,63 +0,0 @@ -#ifndef ARRAY2_H -#define ARRAY2_H - -#include "Array1.h" -#include -#include - -class Array2 -{ -public: - - // Default constructor - Array2(); - - // Size/array constructor - Array2(int nrows, int ncols, long* data=0); - - // Copy constructor - Array2(const Array2 & source); - - // Destructor - ~Array2(); - - // Assignment operator - Array2 & operator=(const Array2 & source); - - // Equals operator - bool operator==(const Array2 & other) const; - - // Length accessors - int nrows() const; - int ncols() const; - - // Resize array - void resize(int ncols, int nrows, long* data=0); - - // Set item accessor - Array1 & operator[](int i); - - // Get item accessor - const Array1 & operator[](int i) const; - - // String output - std::string asString() const; - - // Get view - void view(int* nrows, int* ncols, long** data) const; - -private: - // Members - bool _ownData; - int _nrows; - int _ncols; - long * _buffer; - Array1 * _rows; - - // Methods - void allocateMemory(); - void allocateRows(); - void deallocateMemory(); -}; - -#endif Deleted: trunk/doc/test/Farray.cxx =================================================================== --- trunk/numpy/doc/swig/test/Farray.cxx 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Farray.cxx 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,122 +0,0 @@ -#include "Farray.h" -#include - -// Size constructor -Farray::Farray(int nrows, int ncols) : - _nrows(nrows), _ncols(ncols), _buffer(0) -{ - allocateMemory(); -} - -// Copy constructor -Farray::Farray(const Farray & source) : - _nrows(source._nrows), _ncols(source._ncols) -{ - allocateMemory(); - *this = source; -} - -// Destructor -Farray::~Farray() -{ - delete [] _buffer; -} - -// Assignment operator -Farray & Farray::operator=(const Farray & source) -{ - int nrows = _nrows < source._nrows ? _nrows : source._nrows; - int ncols = _ncols < source._ncols ? _ncols : source._ncols; - for (int i=0; i < nrows; ++i) - { - for (int j=0; j < ncols; ++j) - { - (*this)(i,j) = source(i,j); - } - } - return *this; -} - -// Equals operator -bool Farray::operator==(const Farray & other) const -{ - if (_nrows != other._nrows) return false; - if (_ncols != other._ncols) return false; - for (int i=0; i < _nrows; ++i) - { - for (int j=0; j < _ncols; ++j) - { - if ((*this)(i,j) != other(i,j)) return false; - } - } - return true; -} - -// Length accessors -int Farray::nrows() const -{ - return _nrows; -} - -int Farray::ncols() const -{ - return _ncols; -} - -// Set item accessor -long & Farray::operator()(int i, int j) -{ - if (i < 0 || i > _nrows) throw std::out_of_range("Farray row index out of range"); - if (j < 0 || j > _ncols) throw std::out_of_range("Farray col index out of range"); - return _buffer[offset(i,j)]; -} - -// Get item accessor -const long & Farray::operator()(int i, int j) const -{ - if (i < 0 || i > _nrows) throw std::out_of_range("Farray row index out of range"); - if (j < 0 || j > _ncols) throw std::out_of_range("Farray col index out of range"); - return _buffer[offset(i,j)]; -} - -// String output -std::string Farray::asString() const -{ - std::stringstream result; - result << "[ "; - for (int i=0; i < _nrows; ++i) - { - if (i > 0) result << " "; - result << "["; - for (int j=0; j < _ncols; ++j) - { - result << " " << (*this)(i,j); - if (j < _ncols-1) result << ","; - } - result << " ]"; - if (i < _nrows-1) result << "," << std::endl; - } - result << " ]" << std::endl; - return result.str(); -} - -// Get view -void Farray::view(int* nrows, int* ncols, long** data) const -{ - *nrows = _nrows; - *ncols = _ncols; - *data = _buffer; -} - -// Private methods -void Farray::allocateMemory() -{ - if (_nrows <= 0) throw std::invalid_argument("Farray nrows <= 0"); - if (_ncols <= 0) throw std::invalid_argument("Farray ncols <= 0"); - _buffer = new long[_nrows*_ncols]; -} - -inline int Farray::offset(int i, int j) const -{ - return i + j * _nrows; -} Deleted: trunk/doc/test/Farray.h =================================================================== --- trunk/numpy/doc/swig/test/Farray.h 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Farray.h 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,56 +0,0 @@ -#ifndef FARRAY_H -#define FARRAY_H - -#include -#include - -class Farray -{ -public: - - // Size constructor - Farray(int nrows, int ncols); - - // Copy constructor - Farray(const Farray & source); - - // Destructor - ~Farray(); - - // Assignment operator - Farray & operator=(const Farray & source); - - // Equals operator - bool operator==(const Farray & other) const; - - // Length accessors - int nrows() const; - int ncols() const; - - // Set item accessor - long & operator()(int i, int j); - - // Get item accessor - const long & operator()(int i, int j) const; - - // String output - std::string asString() const; - - // Get view - void view(int* nrows, int* ncols, long** data) const; - -private: - // Members - int _nrows; - int _ncols; - long * _buffer; - - // Default constructor: not implemented - Farray(); - - // Methods - void allocateMemory(); - int offset(int i, int j) const; -}; - -#endif Deleted: trunk/doc/test/Farray.i =================================================================== --- trunk/numpy/doc/swig/test/Farray.i 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Farray.i 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,73 +0,0 @@ -// -*- c++ -*- - -%module Farray - -%{ -#define SWIG_FILE_WITH_INIT -#include "Farray.h" -%} - -// Get the NumPy typemaps -%include "../numpy.i" - - // Get the STL typemaps -%include "stl.i" - -// Handle standard exceptions -%include "exception.i" -%exception -{ - try - { - $action - } - catch (const std::invalid_argument& e) - { - SWIG_exception(SWIG_ValueError, e.what()); - } - catch (const std::out_of_range& e) - { - SWIG_exception(SWIG_IndexError, e.what()); - } -} -%init %{ - import_array(); -%} - -// Global ignores -%ignore *::operator=; -%ignore *::operator(); - -// Apply the 2D NumPy typemaps -%apply (int* DIM1 , int* DIM2 , long** ARGOUTVIEW_FARRAY2) - {(int* nrows, int* ncols, long** data )}; - -// Farray support -%include "Farray.h" -%extend Farray -{ - PyObject * __setitem__(PyObject* index, long v) - { - int i, j; - if (!PyArg_ParseTuple(index, "ii:Farray___setitem__",&i,&j)) return NULL; - self->operator()(i,j) = v; - return Py_BuildValue(""); - } - - PyObject * __getitem__(PyObject * index) - { - int i, j; - if (!PyArg_ParseTuple(index, "ii:Farray___getitem__",&i,&j)) return NULL; - return SWIG_From_long(self->operator()(i,j)); - } - - int __len__() - { - return self->nrows() * self->ncols(); - } - - std::string __str__() - { - return self->asString(); - } -} Deleted: trunk/doc/test/Fortran.cxx =================================================================== --- trunk/numpy/doc/swig/test/Fortran.cxx 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Fortran.cxx 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,24 +0,0 @@ -#include -#include -#include -#include "Fortran.h" - -#define TEST_FUNCS(TYPE, SNAME) \ -\ -TYPE SNAME ## SecondElement(TYPE * matrix, int rows, int cols) { \ - TYPE result = matrix[1]; \ - return result; \ -} \ - -TEST_FUNCS(signed char , schar ) -TEST_FUNCS(unsigned char , uchar ) -TEST_FUNCS(short , short ) -TEST_FUNCS(unsigned short , ushort ) -TEST_FUNCS(int , int ) -TEST_FUNCS(unsigned int , uint ) -TEST_FUNCS(long , long ) -TEST_FUNCS(unsigned long , ulong ) -TEST_FUNCS(long long , longLong ) -TEST_FUNCS(unsigned long long, ulongLong) -TEST_FUNCS(float , float ) -TEST_FUNCS(double , double ) Deleted: trunk/doc/test/Fortran.h =================================================================== --- trunk/numpy/doc/swig/test/Fortran.h 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Fortran.h 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,21 +0,0 @@ -#ifndef FORTRAN_H -#define FORTRAN_H - -#define TEST_FUNC_PROTOS(TYPE, SNAME) \ -\ -TYPE SNAME ## SecondElement( TYPE * matrix, int rows, int cols); \ - -TEST_FUNC_PROTOS(signed char , schar ) -TEST_FUNC_PROTOS(unsigned char , uchar ) -TEST_FUNC_PROTOS(short , short ) -TEST_FUNC_PROTOS(unsigned short , ushort ) -TEST_FUNC_PROTOS(int , int ) -TEST_FUNC_PROTOS(unsigned int , uint ) -TEST_FUNC_PROTOS(long , long ) -TEST_FUNC_PROTOS(unsigned long , ulong ) -TEST_FUNC_PROTOS(long long , longLong ) -TEST_FUNC_PROTOS(unsigned long long, ulongLong) -TEST_FUNC_PROTOS(float , float ) -TEST_FUNC_PROTOS(double , double ) - -#endif Deleted: trunk/doc/test/Fortran.i =================================================================== --- trunk/numpy/doc/swig/test/Fortran.i 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Fortran.i 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,36 +0,0 @@ -// -*- c++ -*- -%module Fortran - -%{ -#define SWIG_FILE_WITH_INIT -#include "Fortran.h" -%} - -// Get the NumPy typemaps -%include "../numpy.i" - -%init %{ - import_array(); -%} - -%define %apply_numpy_typemaps(TYPE) - -%apply (TYPE* IN_FARRAY2, int DIM1, int DIM2) {(TYPE* matrix, int rows, int cols)}; - -%enddef /* %apply_numpy_typemaps() macro */ - -%apply_numpy_typemaps(signed char ) -%apply_numpy_typemaps(unsigned char ) -%apply_numpy_typemaps(short ) -%apply_numpy_typemaps(unsigned short ) -%apply_numpy_typemaps(int ) -%apply_numpy_typemaps(unsigned int ) -%apply_numpy_typemaps(long ) -%apply_numpy_typemaps(unsigned long ) -%apply_numpy_typemaps(long long ) -%apply_numpy_typemaps(unsigned long long) -%apply_numpy_typemaps(float ) -%apply_numpy_typemaps(double ) - -// Include the header file to be wrapped -%include "Fortran.h" Deleted: trunk/doc/test/Makefile =================================================================== --- trunk/numpy/doc/swig/test/Makefile 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Makefile 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,34 +0,0 @@ -# SWIG -INTERFACES = Array.i Farray.i Vector.i Matrix.i Tensor.i Fortran.i -WRAPPERS = $(INTERFACES:.i=_wrap.cxx) -PROXIES = $(INTERFACES:.i=.py ) - -# Default target: build the tests -.PHONY : all -all: $(WRAPPERS) Array1.cxx Array1.h Farray.cxx Farray.h Vector.cxx Vector.h \ - Matrix.cxx Matrix.h Tensor.cxx Tensor.h Fortran.h Fortran.cxx - ./setup.py build_ext -i - -# Test target: run the tests -.PHONY : test -test: all - python testVector.py - python testMatrix.py - python testTensor.py - python testArray.py - python testFarray.py - python testFortran.py - -# Rule: %.i -> %_wrap.cxx -%_wrap.cxx: %.i %.h ../numpy.i - swig -c++ -python $< -%_wrap.cxx: %.i %1.h %2.h ../numpy.i - swig -c++ -python $< - -# Clean target -.PHONY : clean -clean: - $(RM) -r build - $(RM) *.so - $(RM) $(WRAPPERS) - $(RM) $(PROXIES) Deleted: trunk/doc/test/Matrix.cxx =================================================================== --- trunk/numpy/doc/swig/test/Matrix.cxx 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Matrix.cxx 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,112 +0,0 @@ -#include -#include -#include -#include "Matrix.h" - -// The following macro defines a family of functions that work with 2D -// arrays with the forms -// -// TYPE SNAMEDet( TYPE matrix[2][2]); -// TYPE SNAMEMax( TYPE * matrix, int rows, int cols); -// TYPE SNAMEMin( int rows, int cols, TYPE * matrix); -// void SNAMEScale( TYPE matrix[3][3]); -// void SNAMEFloor( TYPE * array, int rows, int cols, TYPE floor); -// void SNAMECeil( int rows, int cols, TYPE * array, TYPE ceil); -// void SNAMELUSplit(TYPE in[3][3], TYPE lower[3][3], TYPE upper[3][3]); -// -// for any specified type TYPE (for example: short, unsigned int, long -// long, etc.) with given short name SNAME (for example: short, uint, -// longLong, etc.). The macro is then expanded for the given -// TYPE/SNAME pairs. The resulting functions are for testing numpy -// interfaces, respectively, for: -// -// * 2D input arrays, hard-coded length -// * 2D input arrays -// * 2D input arrays, data last -// * 2D in-place arrays, hard-coded lengths -// * 2D in-place arrays -// * 2D in-place arrays, data last -// * 2D argout arrays, hard-coded length -// -#define TEST_FUNCS(TYPE, SNAME) \ -\ -TYPE SNAME ## Det(TYPE matrix[2][2]) { \ - return matrix[0][0]*matrix[1][1] - matrix[0][1]*matrix[1][0]; \ -} \ -\ -TYPE SNAME ## Max(TYPE * matrix, int rows, int cols) { \ - int i, j, index; \ - TYPE result = matrix[0]; \ - for (j=0; j result) result = matrix[index]; \ - } \ - } \ - return result; \ -} \ -\ -TYPE SNAME ## Min(int rows, int cols, TYPE * matrix) { \ - int i, j, index; \ - TYPE result = matrix[0]; \ - for (j=0; j ceil) array[index] = ceil; \ - } \ - } \ -} \ -\ -void SNAME ## LUSplit(TYPE matrix[3][3], TYPE lower[3][3], TYPE upper[3][3]) { \ - for (int i=0; i<3; ++i) { \ - for (int j=0; j<3; ++j) { \ - if (i >= j) { \ - lower[i][j] = matrix[i][j]; \ - upper[i][j] = 0; \ - } else { \ - lower[i][j] = 0; \ - upper[i][j] = matrix[i][j]; \ - } \ - } \ - } \ -} - -TEST_FUNCS(signed char , schar ) -TEST_FUNCS(unsigned char , uchar ) -TEST_FUNCS(short , short ) -TEST_FUNCS(unsigned short , ushort ) -TEST_FUNCS(int , int ) -TEST_FUNCS(unsigned int , uint ) -TEST_FUNCS(long , long ) -TEST_FUNCS(unsigned long , ulong ) -TEST_FUNCS(long long , longLong ) -TEST_FUNCS(unsigned long long, ulongLong) -TEST_FUNCS(float , float ) -TEST_FUNCS(double , double ) Deleted: trunk/doc/test/Matrix.h =================================================================== --- trunk/numpy/doc/swig/test/Matrix.h 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Matrix.h 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,52 +0,0 @@ -#ifndef MATRIX_H -#define MATRIX_H - -// The following macro defines the prototypes for a family of -// functions that work with 2D arrays with the forms -// -// TYPE SNAMEDet( TYPE matrix[2][2]); -// TYPE SNAMEMax( TYPE * matrix, int rows, int cols); -// TYPE SNAMEMin( int rows, int cols, TYPE * matrix); -// void SNAMEScale( TYPE array[3][3]); -// void SNAMEFloor( TYPE * array, int rows, int cols, TYPE floor); -// void SNAMECeil( int rows, int cols, TYPE * array, TYPE ceil ); -// void SNAMELUSplit(TYPE in[3][3], TYPE lower[3][3], TYPE upper[3][3]); -// -// for any specified type TYPE (for example: short, unsigned int, long -// long, etc.) with given short name SNAME (for example: short, uint, -// longLong, etc.). The macro is then expanded for the given -// TYPE/SNAME pairs. The resulting functions are for testing numpy -// interfaces, respectively, for: -// -// * 2D input arrays, hard-coded lengths -// * 2D input arrays -// * 2D input arrays, data last -// * 2D in-place arrays, hard-coded lengths -// * 2D in-place arrays -// * 2D in-place arrays, data last -// * 2D argout arrays, hard-coded length -// -#define TEST_FUNC_PROTOS(TYPE, SNAME) \ -\ -TYPE SNAME ## Det( TYPE matrix[2][2]); \ -TYPE SNAME ## Max( TYPE * matrix, int rows, int cols); \ -TYPE SNAME ## Min( int rows, int cols, TYPE * matrix); \ -void SNAME ## Scale( TYPE array[3][3], TYPE val); \ -void SNAME ## Floor( TYPE * array, int rows, int cols, TYPE floor); \ -void SNAME ## Ceil( int rows, int cols, TYPE * array, TYPE ceil ); \ -void SNAME ## LUSplit(TYPE matrix[3][3], TYPE lower[3][3], TYPE upper[3][3]); - -TEST_FUNC_PROTOS(signed char , schar ) -TEST_FUNC_PROTOS(unsigned char , uchar ) -TEST_FUNC_PROTOS(short , short ) -TEST_FUNC_PROTOS(unsigned short , ushort ) -TEST_FUNC_PROTOS(int , int ) -TEST_FUNC_PROTOS(unsigned int , uint ) -TEST_FUNC_PROTOS(long , long ) -TEST_FUNC_PROTOS(unsigned long , ulong ) -TEST_FUNC_PROTOS(long long , longLong ) -TEST_FUNC_PROTOS(unsigned long long, ulongLong) -TEST_FUNC_PROTOS(float , float ) -TEST_FUNC_PROTOS(double , double ) - -#endif Deleted: trunk/doc/test/Matrix.i =================================================================== --- trunk/numpy/doc/swig/test/Matrix.i 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Matrix.i 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,45 +0,0 @@ -// -*- c++ -*- -%module Matrix - -%{ -#define SWIG_FILE_WITH_INIT -#include "Matrix.h" -%} - -// Get the NumPy typemaps -%include "../numpy.i" - -%init %{ - import_array(); -%} - -%define %apply_numpy_typemaps(TYPE) - -%apply (TYPE IN_ARRAY2[ANY][ANY]) {(TYPE matrix[ANY][ANY])}; -%apply (TYPE* IN_ARRAY2, int DIM1, int DIM2) {(TYPE* matrix, int rows, int cols)}; -%apply (int DIM1, int DIM2, TYPE* IN_ARRAY2) {(int rows, int cols, TYPE* matrix)}; - -%apply (TYPE INPLACE_ARRAY2[ANY][ANY]) {(TYPE array[3][3])}; -%apply (TYPE* INPLACE_ARRAY2, int DIM1, int DIM2) {(TYPE* array, int rows, int cols)}; -%apply (int DIM1, int DIM2, TYPE* INPLACE_ARRAY2) {(int rows, int cols, TYPE* array)}; - -%apply (TYPE ARGOUT_ARRAY2[ANY][ANY]) {(TYPE lower[3][3])}; -%apply (TYPE ARGOUT_ARRAY2[ANY][ANY]) {(TYPE upper[3][3])}; - -%enddef /* %apply_numpy_typemaps() macro */ - -%apply_numpy_typemaps(signed char ) -%apply_numpy_typemaps(unsigned char ) -%apply_numpy_typemaps(short ) -%apply_numpy_typemaps(unsigned short ) -%apply_numpy_typemaps(int ) -%apply_numpy_typemaps(unsigned int ) -%apply_numpy_typemaps(long ) -%apply_numpy_typemaps(unsigned long ) -%apply_numpy_typemaps(long long ) -%apply_numpy_typemaps(unsigned long long) -%apply_numpy_typemaps(float ) -%apply_numpy_typemaps(double ) - -// Include the header file to be wrapped -%include "Matrix.h" Deleted: trunk/doc/test/Tensor.cxx =================================================================== --- trunk/numpy/doc/swig/test/Tensor.cxx 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Tensor.cxx 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,131 +0,0 @@ -#include -#include -#include -#include "Tensor.h" - -// The following macro defines a family of functions that work with 3D -// arrays with the forms -// -// TYPE SNAMENorm( TYPE tensor[2][2][2]); -// TYPE SNAMEMax( TYPE * tensor, int rows, int cols, int num); -// TYPE SNAMEMin( int rows, int cols, int num, TYPE * tensor); -// void SNAMEScale( TYPE tensor[3][3][3]); -// void SNAMEFloor( TYPE * array, int rows, int cols, int num, TYPE floor); -// void SNAMECeil( int rows, int cols, int num, TYPE * array, TYPE ceil); -// void SNAMELUSplit(TYPE in[2][2][2], TYPE lower[2][2][2], TYPE upper[2][2][2]); -// -// for any specified type TYPE (for example: short, unsigned int, long -// long, etc.) with given short name SNAME (for example: short, uint, -// longLong, etc.). The macro is then expanded for the given -// TYPE/SNAME pairs. The resulting functions are for testing numpy -// interfaces, respectively, for: -// -// * 3D input arrays, hard-coded length -// * 3D input arrays -// * 3D input arrays, data last -// * 3D in-place arrays, hard-coded lengths -// * 3D in-place arrays -// * 3D in-place arrays, data last -// * 3D argout arrays, hard-coded length -// -#define TEST_FUNCS(TYPE, SNAME) \ -\ -TYPE SNAME ## Norm(TYPE tensor[2][2][2]) { \ - double result = 0; \ - for (int k=0; k<2; ++k) \ - for (int j=0; j<2; ++j) \ - for (int i=0; i<2; ++i) \ - result += tensor[i][j][k] * tensor[i][j][k]; \ - return (TYPE)sqrt(result/8); \ -} \ -\ -TYPE SNAME ## Max(TYPE * tensor, int rows, int cols, int num) { \ - int i, j, k, index; \ - TYPE result = tensor[0]; \ - for (k=0; k result) result = tensor[index]; \ - } \ - } \ - } \ - return result; \ -} \ -\ -TYPE SNAME ## Min(int rows, int cols, int num, TYPE * tensor) { \ - int i, j, k, index; \ - TYPE result = tensor[0]; \ - for (k=0; k ceil) array[index] = ceil; \ - } \ - } \ - } \ -} \ -\ -void SNAME ## LUSplit(TYPE tensor[2][2][2], TYPE lower[2][2][2], \ - TYPE upper[2][2][2]) { \ - int sum; \ - for (int k=0; k<2; ++k) { \ - for (int j=0; j<2; ++j) { \ - for (int i=0; i<2; ++i) { \ - sum = i + j + k; \ - if (sum < 2) { \ - lower[i][j][k] = tensor[i][j][k]; \ - upper[i][j][k] = 0; \ - } else { \ - upper[i][j][k] = tensor[i][j][k]; \ - lower[i][j][k] = 0; \ - } \ - } \ - } \ - } \ -} - -TEST_FUNCS(signed char , schar ) -TEST_FUNCS(unsigned char , uchar ) -TEST_FUNCS(short , short ) -TEST_FUNCS(unsigned short , ushort ) -TEST_FUNCS(int , int ) -TEST_FUNCS(unsigned int , uint ) -TEST_FUNCS(long , long ) -TEST_FUNCS(unsigned long , ulong ) -TEST_FUNCS(long long , longLong ) -TEST_FUNCS(unsigned long long, ulongLong) -TEST_FUNCS(float , float ) -TEST_FUNCS(double , double ) Deleted: trunk/doc/test/Tensor.h =================================================================== --- trunk/numpy/doc/swig/test/Tensor.h 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Tensor.h 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,52 +0,0 @@ -#ifndef TENSOR_H -#define TENSOR_H - -// The following macro defines the prototypes for a family of -// functions that work with 3D arrays with the forms -// -// TYPE SNAMENorm( TYPE tensor[2][2][2]); -// TYPE SNAMEMax( TYPE * tensor, int rows, int cols, int num); -// TYPE SNAMEMin( int rows, int cols, int num, TYPE * tensor); -// void SNAMEScale( TYPE array[3][3][3]); -// void SNAMEFloor( TYPE * array, int rows, int cols, int num, TYPE floor); -// void SNAMECeil( int rows, int cols, int num, TYPE * array, TYPE ceil ); -// void SNAMELUSplit(TYPE in[3][3][3], TYPE lower[3][3][3], TYPE upper[3][3][3]); -// -// for any specified type TYPE (for example: short, unsigned int, long -// long, etc.) with given short name SNAME (for example: short, uint, -// longLong, etc.). The macro is then expanded for the given -// TYPE/SNAME pairs. The resulting functions are for testing numpy -// interfaces, respectively, for: -// -// * 3D input arrays, hard-coded lengths -// * 3D input arrays -// * 3D input arrays, data last -// * 3D in-place arrays, hard-coded lengths -// * 3D in-place arrays -// * 3D in-place arrays, data last -// * 3D argout arrays, hard-coded length -// -#define TEST_FUNC_PROTOS(TYPE, SNAME) \ -\ -TYPE SNAME ## Norm( TYPE tensor[2][2][2]); \ -TYPE SNAME ## Max( TYPE * tensor, int rows, int cols, int num); \ -TYPE SNAME ## Min( int rows, int cols, int num, TYPE * tensor); \ -void SNAME ## Scale( TYPE array[3][3][3], TYPE val); \ -void SNAME ## Floor( TYPE * array, int rows, int cols, int num, TYPE floor); \ -void SNAME ## Ceil( int rows, int cols, int num, TYPE * array, TYPE ceil ); \ -void SNAME ## LUSplit(TYPE tensor[2][2][2], TYPE lower[2][2][2], TYPE upper[2][2][2]); - -TEST_FUNC_PROTOS(signed char , schar ) -TEST_FUNC_PROTOS(unsigned char , uchar ) -TEST_FUNC_PROTOS(short , short ) -TEST_FUNC_PROTOS(unsigned short , ushort ) -TEST_FUNC_PROTOS(int , int ) -TEST_FUNC_PROTOS(unsigned int , uint ) -TEST_FUNC_PROTOS(long , long ) -TEST_FUNC_PROTOS(unsigned long , ulong ) -TEST_FUNC_PROTOS(long long , longLong ) -TEST_FUNC_PROTOS(unsigned long long, ulongLong) -TEST_FUNC_PROTOS(float , float ) -TEST_FUNC_PROTOS(double , double ) - -#endif Deleted: trunk/doc/test/Tensor.i =================================================================== --- trunk/numpy/doc/swig/test/Tensor.i 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Tensor.i 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,49 +0,0 @@ -// -*- c++ -*- -%module Tensor - -%{ -#define SWIG_FILE_WITH_INIT -#include "Tensor.h" -%} - -// Get the NumPy typemaps -%include "../numpy.i" - -%init %{ - import_array(); -%} - -%define %apply_numpy_typemaps(TYPE) - -%apply (TYPE IN_ARRAY3[ANY][ANY][ANY]) {(TYPE tensor[ANY][ANY][ANY])}; -%apply (TYPE* IN_ARRAY3, int DIM1, int DIM2, int DIM3) - {(TYPE* tensor, int rows, int cols, int num)}; -%apply (int DIM1, int DIM2, int DIM3, TYPE* IN_ARRAY3) - {(int rows, int cols, int num, TYPE* tensor)}; - -%apply (TYPE INPLACE_ARRAY3[ANY][ANY][ANY]) {(TYPE array[3][3][3])}; -%apply (TYPE* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) - {(TYPE* array, int rows, int cols, int num)}; -%apply (int DIM1, int DIM2, int DIM3, TYPE* INPLACE_ARRAY3) - {(int rows, int cols, int num, TYPE* array)}; - -%apply (TYPE ARGOUT_ARRAY3[ANY][ANY][ANY]) {(TYPE lower[2][2][2])}; -%apply (TYPE ARGOUT_ARRAY3[ANY][ANY][ANY]) {(TYPE upper[2][2][2])}; - -%enddef /* %apply_numpy_typemaps() macro */ - -%apply_numpy_typemaps(signed char ) -%apply_numpy_typemaps(unsigned char ) -%apply_numpy_typemaps(short ) -%apply_numpy_typemaps(unsigned short ) -%apply_numpy_typemaps(int ) -%apply_numpy_typemaps(unsigned int ) -%apply_numpy_typemaps(long ) -%apply_numpy_typemaps(unsigned long ) -%apply_numpy_typemaps(long long ) -%apply_numpy_typemaps(unsigned long long) -%apply_numpy_typemaps(float ) -%apply_numpy_typemaps(double ) - -// Include the header file to be wrapped -%include "Tensor.h" Deleted: trunk/doc/test/Vector.cxx =================================================================== --- trunk/numpy/doc/swig/test/Vector.cxx 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/Vector.cxx 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,100 +0,0 @@ -#include -#include -#include -#include "Vector.h" - -// The following macro defines a family of functions that work with 1D -// arrays with the forms -// -// TYPE SNAMELength( TYPE vector[3]); -// TYPE SNAMEProd( TYPE * series, int size); -// TYPE SNAMESum( int size, TYPE * series); -// void SNAMEReverse(TYPE array[3]); -// void SNAMEOnes( TYPE * array, int size); -// void SNAMEZeros( int size, TYPE * array); -// void SNAMEEOSplit(TYPE vector[3], TYPE even[3], odd[3]); -// void SNAMETwos( TYPE * twoVec, int size); -// void SNAMEThrees( int size, TYPE * threeVec); -// -// for any specified type TYPE (for example: short, unsigned int, long -// long, etc.) with given short name SNAME (for example: short, uint, -// longLong, etc.). The macro is then expanded for the given -// TYPE/SNAME pairs. The resulting functions are for testing numpy -// interfaces, respectively, for: -// -// * 1D input arrays, hard-coded length -// * 1D input arrays -// * 1D input arrays, data last -// * 1D in-place arrays, hard-coded length -// * 1D in-place arrays -// * 1D in-place arrays, data last -// * 1D argout arrays, hard-coded length -// * 1D argout arrays -// * 1D argout arrays, data last -// -#define TEST_FUNCS(TYPE, SNAME) \ -\ -TYPE SNAME ## Length(TYPE vector[3]) { \ - double result = 0; \ - for (int i=0; i<3; ++i) result += vector[i]*vector[i]; \ - return (TYPE)sqrt(result); \ -} \ -\ -TYPE SNAME ## Prod(TYPE * series, int size) { \ - TYPE result = 1; \ - for (int i=0; i>sys.stderr, self.typeStr, "... ", - second = Fortran.__dict__[self.typeStr + "SecondElement"] - matrix = np.arange(9).reshape(3, 3).astype(self.typeCode) - self.assertEquals(second(matrix), 3) - - def testSecondElementFortran(self): - "Test luSplit function with a Fortran-array" - print >>sys.stderr, self.typeStr, "... ", - second = Fortran.__dict__[self.typeStr + "SecondElement"] - matrix = np.asfortranarray(np.arange(9).reshape(3, 3), - self.typeCode) - self.assertEquals(second(matrix), 3) - - def testSecondElementObject(self): - "Test luSplit function with a Fortran-array" - print >>sys.stderr, self.typeStr, "... ", - second = Fortran.__dict__[self.typeStr + "SecondElement"] - matrix = np.asfortranarray([[0,1,2],[3,4,5],[6,7,8]], self.typeCode) - self.assertEquals(second(matrix), 3) - -###################################################################### - -class scharTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "schar" - self.typeCode = "b" - -###################################################################### - -class ucharTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "uchar" - self.typeCode = "B" - -###################################################################### - -class shortTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "short" - self.typeCode = "h" - -###################################################################### - -class ushortTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "ushort" - self.typeCode = "H" - -###################################################################### - -class intTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "int" - self.typeCode = "i" - -###################################################################### - -class uintTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "uint" - self.typeCode = "I" - -###################################################################### - -class longTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "long" - self.typeCode = "l" - -###################################################################### - -class ulongTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "ulong" - self.typeCode = "L" - -###################################################################### - -class longLongTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "longLong" - self.typeCode = "q" - -###################################################################### - -class ulongLongTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "ulongLong" - self.typeCode = "Q" - -###################################################################### - -class floatTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "float" - self.typeCode = "f" - -###################################################################### - -class doubleTestCase(FortranTestCase): - def __init__(self, methodName="runTest"): - FortranTestCase.__init__(self, methodName) - self.typeStr = "double" - self.typeCode = "d" - -###################################################################### - -if __name__ == "__main__": - - # Build the test suite - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite( scharTestCase)) - suite.addTest(unittest.makeSuite( ucharTestCase)) - suite.addTest(unittest.makeSuite( shortTestCase)) - suite.addTest(unittest.makeSuite( ushortTestCase)) - suite.addTest(unittest.makeSuite( intTestCase)) - suite.addTest(unittest.makeSuite( uintTestCase)) - suite.addTest(unittest.makeSuite( longTestCase)) - suite.addTest(unittest.makeSuite( ulongTestCase)) - suite.addTest(unittest.makeSuite( longLongTestCase)) - suite.addTest(unittest.makeSuite(ulongLongTestCase)) - suite.addTest(unittest.makeSuite( floatTestCase)) - suite.addTest(unittest.makeSuite( doubleTestCase)) - - # Execute the test suite - print "Testing 2D Functions of Module Matrix" - print "NumPy version", np.__version__ - print - result = unittest.TextTestRunner(verbosity=2).run(suite) - sys.exit(len(result.errors) + len(result.failures)) Deleted: trunk/doc/test/testMatrix.py =================================================================== --- trunk/numpy/doc/swig/test/testMatrix.py 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/testMatrix.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,361 +0,0 @@ -#! /usr/bin/env python - -# System imports -from distutils.util import get_platform -import os -import sys -import unittest - -# Import NumPy -import numpy as np -major, minor = [ int(d) for d in np.__version__.split(".")[:2] ] -if major == 0: BadListError = TypeError -else: BadListError = ValueError - -import Matrix - -###################################################################### - -class MatrixTestCase(unittest.TestCase): - - def __init__(self, methodName="runTests"): - unittest.TestCase.__init__(self, methodName) - self.typeStr = "double" - self.typeCode = "d" - - # Test (type IN_ARRAY2[ANY][ANY]) typemap - def testDet(self): - "Test det function" - print >>sys.stderr, self.typeStr, "... ", - det = Matrix.__dict__[self.typeStr + "Det"] - matrix = [[8,7],[6,9]] - self.assertEquals(det(matrix), 30) - - # Test (type IN_ARRAY2[ANY][ANY]) typemap - def testDetBadList(self): - "Test det function with bad list" - print >>sys.stderr, self.typeStr, "... ", - det = Matrix.__dict__[self.typeStr + "Det"] - matrix = [[8,7], ["e", "pi"]] - self.assertRaises(BadListError, det, matrix) - - # Test (type IN_ARRAY2[ANY][ANY]) typemap - def testDetWrongDim(self): - "Test det function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - det = Matrix.__dict__[self.typeStr + "Det"] - matrix = [8,7] - self.assertRaises(TypeError, det, matrix) - - # Test (type IN_ARRAY2[ANY][ANY]) typemap - def testDetWrongSize(self): - "Test det function with wrong size" - print >>sys.stderr, self.typeStr, "... ", - det = Matrix.__dict__[self.typeStr + "Det"] - matrix = [[8,7,6], [5,4,3], [2,1,0]] - self.assertRaises(TypeError, det, matrix) - - # Test (type IN_ARRAY2[ANY][ANY]) typemap - def testDetNonContainer(self): - "Test det function with non-container" - print >>sys.stderr, self.typeStr, "... ", - det = Matrix.__dict__[self.typeStr + "Det"] - self.assertRaises(TypeError, det, None) - - # Test (type* IN_ARRAY2, int DIM1, int DIM2) typemap - def testMax(self): - "Test max function" - print >>sys.stderr, self.typeStr, "... ", - max = Matrix.__dict__[self.typeStr + "Max"] - matrix = [[6,5,4],[3,2,1]] - self.assertEquals(max(matrix), 6) - - # Test (type* IN_ARRAY2, int DIM1, int DIM2) typemap - def testMaxBadList(self): - "Test max function with bad list" - print >>sys.stderr, self.typeStr, "... ", - max = Matrix.__dict__[self.typeStr + "Max"] - matrix = [[6,"five",4], ["three", 2, "one"]] - self.assertRaises(BadListError, max, matrix) - - # Test (type* IN_ARRAY2, int DIM1, int DIM2) typemap - def testMaxNonContainer(self): - "Test max function with non-container" - print >>sys.stderr, self.typeStr, "... ", - max = Matrix.__dict__[self.typeStr + "Max"] - self.assertRaises(TypeError, max, None) - - # Test (type* IN_ARRAY2, int DIM1, int DIM2) typemap - def testMaxWrongDim(self): - "Test max function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - max = Matrix.__dict__[self.typeStr + "Max"] - self.assertRaises(TypeError, max, [0, 1, 2, 3]) - - # Test (int DIM1, int DIM2, type* IN_ARRAY2) typemap - def testMin(self): - "Test min function" - print >>sys.stderr, self.typeStr, "... ", - min = Matrix.__dict__[self.typeStr + "Min"] - matrix = [[9,8],[7,6],[5,4]] - self.assertEquals(min(matrix), 4) - - # Test (int DIM1, int DIM2, type* IN_ARRAY2) typemap - def testMinBadList(self): - "Test min function with bad list" - print >>sys.stderr, self.typeStr, "... ", - min = Matrix.__dict__[self.typeStr + "Min"] - matrix = [["nine","eight"], ["seven","six"]] - self.assertRaises(BadListError, min, matrix) - - # Test (int DIM1, int DIM2, type* IN_ARRAY2) typemap - def testMinWrongDim(self): - "Test min function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - min = Matrix.__dict__[self.typeStr + "Min"] - self.assertRaises(TypeError, min, [1,3,5,7,9]) - - # Test (int DIM1, int DIM2, type* IN_ARRAY2) typemap - def testMinNonContainer(self): - "Test min function with non-container" - print >>sys.stderr, self.typeStr, "... ", - min = Matrix.__dict__[self.typeStr + "Min"] - self.assertRaises(TypeError, min, False) - - # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap - def testScale(self): - "Test scale function" - print >>sys.stderr, self.typeStr, "... ", - scale = Matrix.__dict__[self.typeStr + "Scale"] - matrix = np.array([[1,2,3],[2,1,2],[3,2,1]],self.typeCode) - scale(matrix,4) - self.assertEquals((matrix == [[4,8,12],[8,4,8],[12,8,4]]).all(), True) - - # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap - def testScaleWrongDim(self): - "Test scale function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - scale = Matrix.__dict__[self.typeStr + "Scale"] - matrix = np.array([1,2,2,1],self.typeCode) - self.assertRaises(TypeError, scale, matrix) - - # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap - def testScaleWrongSize(self): - "Test scale function with wrong size" - print >>sys.stderr, self.typeStr, "... ", - scale = Matrix.__dict__[self.typeStr + "Scale"] - matrix = np.array([[1,2],[2,1]],self.typeCode) - self.assertRaises(TypeError, scale, matrix) - - # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap - def testScaleWrongType(self): - "Test scale function with wrong type" - print >>sys.stderr, self.typeStr, "... ", - scale = Matrix.__dict__[self.typeStr + "Scale"] - matrix = np.array([[1,2,3],[2,1,2],[3,2,1]],'c') - self.assertRaises(TypeError, scale, matrix) - - # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap - def testScaleNonArray(self): - "Test scale function with non-array" - print >>sys.stderr, self.typeStr, "... ", - scale = Matrix.__dict__[self.typeStr + "Scale"] - matrix = [[1,2,3],[2,1,2],[3,2,1]] - self.assertRaises(TypeError, scale, matrix) - - # Test (type* INPLACE_ARRAY2, int DIM1, int DIM2) typemap - def testFloor(self): - "Test floor function" - print >>sys.stderr, self.typeStr, "... ", - floor = Matrix.__dict__[self.typeStr + "Floor"] - matrix = np.array([[6,7],[8,9]],self.typeCode) - floor(matrix,7) - np.testing.assert_array_equal(matrix, np.array([[7,7],[8,9]])) - - # Test (type* INPLACE_ARRAY2, int DIM1, int DIM2) typemap - def testFloorWrongDim(self): - "Test floor function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - floor = Matrix.__dict__[self.typeStr + "Floor"] - matrix = np.array([6,7,8,9],self.typeCode) - self.assertRaises(TypeError, floor, matrix) - - # Test (type* INPLACE_ARRAY2, int DIM1, int DIM2) typemap - def testFloorWrongType(self): - "Test floor function with wrong type" - print >>sys.stderr, self.typeStr, "... ", - floor = Matrix.__dict__[self.typeStr + "Floor"] - matrix = np.array([[6,7], [8,9]],'c') - self.assertRaises(TypeError, floor, matrix) - - # Test (type* INPLACE_ARRAY2, int DIM1, int DIM2) typemap - def testFloorNonArray(self): - "Test floor function with non-array" - print >>sys.stderr, self.typeStr, "... ", - floor = Matrix.__dict__[self.typeStr + "Floor"] - matrix = [[6,7], [8,9]] - self.assertRaises(TypeError, floor, matrix) - - # Test (int DIM1, int DIM2, type* INPLACE_ARRAY2) typemap - def testCeil(self): - "Test ceil function" - print >>sys.stderr, self.typeStr, "... ", - ceil = Matrix.__dict__[self.typeStr + "Ceil"] - matrix = np.array([[1,2],[3,4]],self.typeCode) - ceil(matrix,3) - np.testing.assert_array_equal(matrix, np.array([[1,2],[3,3]])) - - # Test (int DIM1, int DIM2, type* INPLACE_ARRAY2) typemap - def testCeilWrongDim(self): - "Test ceil function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - ceil = Matrix.__dict__[self.typeStr + "Ceil"] - matrix = np.array([1,2,3,4],self.typeCode) - self.assertRaises(TypeError, ceil, matrix) - - # Test (int DIM1, int DIM2, type* INPLACE_ARRAY2) typemap - def testCeilWrongType(self): - "Test ceil function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - ceil = Matrix.__dict__[self.typeStr + "Ceil"] - matrix = np.array([[1,2], [3,4]],'c') - self.assertRaises(TypeError, ceil, matrix) - - # Test (int DIM1, int DIM2, type* INPLACE_ARRAY2) typemap - def testCeilNonArray(self): - "Test ceil function with non-array" - print >>sys.stderr, self.typeStr, "... ", - ceil = Matrix.__dict__[self.typeStr + "Ceil"] - matrix = [[1,2], [3,4]] - self.assertRaises(TypeError, ceil, matrix) - - # Test (type ARGOUT_ARRAY2[ANY][ANY]) typemap - def testLUSplit(self): - "Test luSplit function" - print >>sys.stderr, self.typeStr, "... ", - luSplit = Matrix.__dict__[self.typeStr + "LUSplit"] - lower, upper = luSplit([[1,2,3],[4,5,6],[7,8,9]]) - self.assertEquals((lower == [[1,0,0],[4,5,0],[7,8,9]]).all(), True) - self.assertEquals((upper == [[0,2,3],[0,0,6],[0,0,0]]).all(), True) - -###################################################################### - -class scharTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "schar" - self.typeCode = "b" - -###################################################################### - -class ucharTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "uchar" - self.typeCode = "B" - -###################################################################### - -class shortTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "short" - self.typeCode = "h" - -###################################################################### - -class ushortTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "ushort" - self.typeCode = "H" - -###################################################################### - -class intTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "int" - self.typeCode = "i" - -###################################################################### - -class uintTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "uint" - self.typeCode = "I" - -###################################################################### - -class longTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "long" - self.typeCode = "l" - -###################################################################### - -class ulongTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "ulong" - self.typeCode = "L" - -###################################################################### - -class longLongTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "longLong" - self.typeCode = "q" - -###################################################################### - -class ulongLongTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "ulongLong" - self.typeCode = "Q" - -###################################################################### - -class floatTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "float" - self.typeCode = "f" - -###################################################################### - -class doubleTestCase(MatrixTestCase): - def __init__(self, methodName="runTest"): - MatrixTestCase.__init__(self, methodName) - self.typeStr = "double" - self.typeCode = "d" - -###################################################################### - -if __name__ == "__main__": - - # Build the test suite - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite( scharTestCase)) - suite.addTest(unittest.makeSuite( ucharTestCase)) - suite.addTest(unittest.makeSuite( shortTestCase)) - suite.addTest(unittest.makeSuite( ushortTestCase)) - suite.addTest(unittest.makeSuite( intTestCase)) - suite.addTest(unittest.makeSuite( uintTestCase)) - suite.addTest(unittest.makeSuite( longTestCase)) - suite.addTest(unittest.makeSuite( ulongTestCase)) - suite.addTest(unittest.makeSuite( longLongTestCase)) - suite.addTest(unittest.makeSuite(ulongLongTestCase)) - suite.addTest(unittest.makeSuite( floatTestCase)) - suite.addTest(unittest.makeSuite( doubleTestCase)) - - # Execute the test suite - print "Testing 2D Functions of Module Matrix" - print "NumPy version", np.__version__ - print - result = unittest.TextTestRunner(verbosity=2).run(suite) - sys.exit(len(result.errors) + len(result.failures)) Deleted: trunk/doc/test/testTensor.py =================================================================== --- trunk/numpy/doc/swig/test/testTensor.py 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/testTensor.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,401 +0,0 @@ -#! /usr/bin/env python - -# System imports -from distutils.util import get_platform -from math import sqrt -import os -import sys -import unittest - -# Import NumPy -import numpy as np -major, minor = [ int(d) for d in np.__version__.split(".")[:2] ] -if major == 0: BadListError = TypeError -else: BadListError = ValueError - -import Tensor - -###################################################################### - -class TensorTestCase(unittest.TestCase): - - def __init__(self, methodName="runTests"): - unittest.TestCase.__init__(self, methodName) - self.typeStr = "double" - self.typeCode = "d" - self.result = sqrt(28.0/8) - - # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap - def testNorm(self): - "Test norm function" - print >>sys.stderr, self.typeStr, "... ", - norm = Tensor.__dict__[self.typeStr + "Norm"] - tensor = [[[0,1], [2,3]], - [[3,2], [1,0]]] - if isinstance(self.result, int): - self.assertEquals(norm(tensor), self.result) - else: - self.assertAlmostEqual(norm(tensor), self.result, 6) - - # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap - def testNormBadList(self): - "Test norm function with bad list" - print >>sys.stderr, self.typeStr, "... ", - norm = Tensor.__dict__[self.typeStr + "Norm"] - tensor = [[[0,"one"],[2,3]], - [[3,"two"],[1,0]]] - self.assertRaises(BadListError, norm, tensor) - - # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap - def testNormWrongDim(self): - "Test norm function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - norm = Tensor.__dict__[self.typeStr + "Norm"] - tensor = [[0,1,2,3], - [3,2,1,0]] - self.assertRaises(TypeError, norm, tensor) - - # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap - def testNormWrongSize(self): - "Test norm function with wrong size" - print >>sys.stderr, self.typeStr, "... ", - norm = Tensor.__dict__[self.typeStr + "Norm"] - tensor = [[[0,1,0], [2,3,2]], - [[3,2,3], [1,0,1]]] - self.assertRaises(TypeError, norm, tensor) - - # Test (type IN_ARRAY3[ANY][ANY][ANY]) typemap - def testNormNonContainer(self): - "Test norm function with non-container" - print >>sys.stderr, self.typeStr, "... ", - norm = Tensor.__dict__[self.typeStr + "Norm"] - self.assertRaises(TypeError, norm, None) - - # Test (type* IN_ARRAY3, int DIM1, int DIM2, int DIM3) typemap - def testMax(self): - "Test max function" - print >>sys.stderr, self.typeStr, "... ", - max = Tensor.__dict__[self.typeStr + "Max"] - tensor = [[[1,2], [3,4]], - [[5,6], [7,8]]] - self.assertEquals(max(tensor), 8) - - # Test (type* IN_ARRAY3, int DIM1, int DIM2, int DIM3) typemap - def testMaxBadList(self): - "Test max function with bad list" - print >>sys.stderr, self.typeStr, "... ", - max = Tensor.__dict__[self.typeStr + "Max"] - tensor = [[[1,"two"], [3,4]], - [[5,"six"], [7,8]]] - self.assertRaises(BadListError, max, tensor) - - # Test (type* IN_ARRAY3, int DIM1, int DIM2, int DIM3) typemap - def testMaxNonContainer(self): - "Test max function with non-container" - print >>sys.stderr, self.typeStr, "... ", - max = Tensor.__dict__[self.typeStr + "Max"] - self.assertRaises(TypeError, max, None) - - # Test (type* IN_ARRAY3, int DIM1, int DIM2, int DIM3) typemap - def testMaxWrongDim(self): - "Test max function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - max = Tensor.__dict__[self.typeStr + "Max"] - self.assertRaises(TypeError, max, [0, -1, 2, -3]) - - # Test (int DIM1, int DIM2, int DIM3, type* IN_ARRAY3) typemap - def testMin(self): - "Test min function" - print >>sys.stderr, self.typeStr, "... ", - min = Tensor.__dict__[self.typeStr + "Min"] - tensor = [[[9,8], [7,6]], - [[5,4], [3,2]]] - self.assertEquals(min(tensor), 2) - - # Test (int DIM1, int DIM2, int DIM3, type* IN_ARRAY3) typemap - def testMinBadList(self): - "Test min function with bad list" - print >>sys.stderr, self.typeStr, "... ", - min = Tensor.__dict__[self.typeStr + "Min"] - tensor = [[["nine",8], [7,6]], - [["five",4], [3,2]]] - self.assertRaises(BadListError, min, tensor) - - # Test (int DIM1, int DIM2, int DIM3, type* IN_ARRAY3) typemap - def testMinNonContainer(self): - "Test min function with non-container" - print >>sys.stderr, self.typeStr, "... ", - min = Tensor.__dict__[self.typeStr + "Min"] - self.assertRaises(TypeError, min, True) - - # Test (int DIM1, int DIM2, int DIM3, type* IN_ARRAY3) typemap - def testMinWrongDim(self): - "Test min function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - min = Tensor.__dict__[self.typeStr + "Min"] - self.assertRaises(TypeError, min, [[1,3],[5,7]]) - - # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap - def testScale(self): - "Test scale function" - print >>sys.stderr, self.typeStr, "... ", - scale = Tensor.__dict__[self.typeStr + "Scale"] - tensor = np.array([[[1,0,1], [0,1,0], [1,0,1]], - [[0,1,0], [1,0,1], [0,1,0]], - [[1,0,1], [0,1,0], [1,0,1]]],self.typeCode) - scale(tensor,4) - self.assertEquals((tensor == [[[4,0,4], [0,4,0], [4,0,4]], - [[0,4,0], [4,0,4], [0,4,0]], - [[4,0,4], [0,4,0], [4,0,4]]]).all(), True) - - # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap - def testScaleWrongType(self): - "Test scale function with wrong type" - print >>sys.stderr, self.typeStr, "... ", - scale = Tensor.__dict__[self.typeStr + "Scale"] - tensor = np.array([[[1,0,1], [0,1,0], [1,0,1]], - [[0,1,0], [1,0,1], [0,1,0]], - [[1,0,1], [0,1,0], [1,0,1]]],'c') - self.assertRaises(TypeError, scale, tensor) - - # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap - def testScaleWrongDim(self): - "Test scale function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - scale = Tensor.__dict__[self.typeStr + "Scale"] - tensor = np.array([[1,0,1], [0,1,0], [1,0,1], - [0,1,0], [1,0,1], [0,1,0]],self.typeCode) - self.assertRaises(TypeError, scale, tensor) - - # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap - def testScaleWrongSize(self): - "Test scale function with wrong size" - print >>sys.stderr, self.typeStr, "... ", - scale = Tensor.__dict__[self.typeStr + "Scale"] - tensor = np.array([[[1,0], [0,1], [1,0]], - [[0,1], [1,0], [0,1]], - [[1,0], [0,1], [1,0]]],self.typeCode) - self.assertRaises(TypeError, scale, tensor) - - # Test (type INPLACE_ARRAY3[ANY][ANY][ANY]) typemap - def testScaleNonArray(self): - "Test scale function with non-array" - print >>sys.stderr, self.typeStr, "... ", - scale = Tensor.__dict__[self.typeStr + "Scale"] - self.assertRaises(TypeError, scale, True) - - # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap - def testFloor(self): - "Test floor function" - print >>sys.stderr, self.typeStr, "... ", - floor = Tensor.__dict__[self.typeStr + "Floor"] - tensor = np.array([[[1,2], [3,4]], - [[5,6], [7,8]]],self.typeCode) - floor(tensor,4) - np.testing.assert_array_equal(tensor, np.array([[[4,4], [4,4]], - [[5,6], [7,8]]])) - - # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap - def testFloorWrongType(self): - "Test floor function with wrong type" - print >>sys.stderr, self.typeStr, "... ", - floor = Tensor.__dict__[self.typeStr + "Floor"] - tensor = np.array([[[1,2], [3,4]], - [[5,6], [7,8]]],'c') - self.assertRaises(TypeError, floor, tensor) - - # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap - def testFloorWrongDim(self): - "Test floor function with wrong type" - print >>sys.stderr, self.typeStr, "... ", - floor = Tensor.__dict__[self.typeStr + "Floor"] - tensor = np.array([[1,2], [3,4], [5,6], [7,8]],self.typeCode) - self.assertRaises(TypeError, floor, tensor) - - # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap - def testFloorNonArray(self): - "Test floor function with non-array" - print >>sys.stderr, self.typeStr, "... ", - floor = Tensor.__dict__[self.typeStr + "Floor"] - self.assertRaises(TypeError, floor, object) - - # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap - def testCeil(self): - "Test ceil function" - print >>sys.stderr, self.typeStr, "... ", - ceil = Tensor.__dict__[self.typeStr + "Ceil"] - tensor = np.array([[[9,8], [7,6]], - [[5,4], [3,2]]],self.typeCode) - ceil(tensor,5) - np.testing.assert_array_equal(tensor, np.array([[[5,5], [5,5]], - [[5,4], [3,2]]])) - - # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap - def testCeilWrongType(self): - "Test ceil function with wrong type" - print >>sys.stderr, self.typeStr, "... ", - ceil = Tensor.__dict__[self.typeStr + "Ceil"] - tensor = np.array([[[9,8], [7,6]], - [[5,4], [3,2]]],'c') - self.assertRaises(TypeError, ceil, tensor) - - # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap - def testCeilWrongDim(self): - "Test ceil function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - ceil = Tensor.__dict__[self.typeStr + "Ceil"] - tensor = np.array([[9,8], [7,6], [5,4], [3,2]], self.typeCode) - self.assertRaises(TypeError, ceil, tensor) - - # Test (int DIM1, int DIM2, int DIM3, type* INPLACE_ARRAY3) typemap - def testCeilNonArray(self): - "Test ceil function with non-array" - print >>sys.stderr, self.typeStr, "... ", - ceil = Tensor.__dict__[self.typeStr + "Ceil"] - tensor = [[[9,8], [7,6]], - [[5,4], [3,2]]] - self.assertRaises(TypeError, ceil, tensor) - - # Test (type ARGOUT_ARRAY3[ANY][ANY][ANY]) typemap - def testLUSplit(self): - "Test luSplit function" - print >>sys.stderr, self.typeStr, "... ", - luSplit = Tensor.__dict__[self.typeStr + "LUSplit"] - lower, upper = luSplit([[[1,1], [1,1]], - [[1,1], [1,1]]]) - self.assertEquals((lower == [[[1,1], [1,0]], - [[1,0], [0,0]]]).all(), True) - self.assertEquals((upper == [[[0,0], [0,1]], - [[0,1], [1,1]]]).all(), True) - -###################################################################### - -class scharTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "schar" - self.typeCode = "b" - self.result = int(self.result) - -###################################################################### - -class ucharTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "uchar" - self.typeCode = "B" - self.result = int(self.result) - -###################################################################### - -class shortTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "short" - self.typeCode = "h" - self.result = int(self.result) - -###################################################################### - -class ushortTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "ushort" - self.typeCode = "H" - self.result = int(self.result) - -###################################################################### - -class intTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "int" - self.typeCode = "i" - self.result = int(self.result) - -###################################################################### - -class uintTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "uint" - self.typeCode = "I" - self.result = int(self.result) - -###################################################################### - -class longTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "long" - self.typeCode = "l" - self.result = int(self.result) - -###################################################################### - -class ulongTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "ulong" - self.typeCode = "L" - self.result = int(self.result) - -###################################################################### - -class longLongTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "longLong" - self.typeCode = "q" - self.result = int(self.result) - -###################################################################### - -class ulongLongTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "ulongLong" - self.typeCode = "Q" - self.result = int(self.result) - -###################################################################### - -class floatTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "float" - self.typeCode = "f" - -###################################################################### - -class doubleTestCase(TensorTestCase): - def __init__(self, methodName="runTest"): - TensorTestCase.__init__(self, methodName) - self.typeStr = "double" - self.typeCode = "d" - -###################################################################### - -if __name__ == "__main__": - - # Build the test suite - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite( scharTestCase)) - suite.addTest(unittest.makeSuite( ucharTestCase)) - suite.addTest(unittest.makeSuite( shortTestCase)) - suite.addTest(unittest.makeSuite( ushortTestCase)) - suite.addTest(unittest.makeSuite( intTestCase)) - suite.addTest(unittest.makeSuite( uintTestCase)) - suite.addTest(unittest.makeSuite( longTestCase)) - suite.addTest(unittest.makeSuite( ulongTestCase)) - suite.addTest(unittest.makeSuite( longLongTestCase)) - suite.addTest(unittest.makeSuite(ulongLongTestCase)) - suite.addTest(unittest.makeSuite( floatTestCase)) - suite.addTest(unittest.makeSuite( doubleTestCase)) - - # Execute the test suite - print "Testing 3D Functions of Module Tensor" - print "NumPy version", np.__version__ - print - result = unittest.TextTestRunner(verbosity=2).run(suite) - sys.exit(len(result.errors) + len(result.failures)) Deleted: trunk/doc/test/testVector.py =================================================================== --- trunk/numpy/doc/swig/test/testVector.py 2008-08-20 23:44:20 UTC (rev 5669) +++ trunk/doc/test/testVector.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,380 +0,0 @@ -#! /usr/bin/env python - -# System imports -from distutils.util import get_platform -import os -import sys -import unittest - -# Import NumPy -import numpy as np -major, minor = [ int(d) for d in np.__version__.split(".")[:2] ] -if major == 0: BadListError = TypeError -else: BadListError = ValueError - -import Vector - -###################################################################### - -class VectorTestCase(unittest.TestCase): - - def __init__(self, methodName="runTest"): - unittest.TestCase.__init__(self, methodName) - self.typeStr = "double" - self.typeCode = "d" - - # Test the (type IN_ARRAY1[ANY]) typemap - def testLength(self): - "Test length function" - print >>sys.stderr, self.typeStr, "... ", - length = Vector.__dict__[self.typeStr + "Length"] - self.assertEquals(length([5, 12, 0]), 13) - - # Test the (type IN_ARRAY1[ANY]) typemap - def testLengthBadList(self): - "Test length function with bad list" - print >>sys.stderr, self.typeStr, "... ", - length = Vector.__dict__[self.typeStr + "Length"] - self.assertRaises(BadListError, length, [5, "twelve", 0]) - - # Test the (type IN_ARRAY1[ANY]) typemap - def testLengthWrongSize(self): - "Test length function with wrong size" - print >>sys.stderr, self.typeStr, "... ", - length = Vector.__dict__[self.typeStr + "Length"] - self.assertRaises(TypeError, length, [5, 12]) - - # Test the (type IN_ARRAY1[ANY]) typemap - def testLengthWrongDim(self): - "Test length function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - length = Vector.__dict__[self.typeStr + "Length"] - self.assertRaises(TypeError, length, [[1,2], [3,4]]) - - # Test the (type IN_ARRAY1[ANY]) typemap - def testLengthNonContainer(self): - "Test length function with non-container" - print >>sys.stderr, self.typeStr, "... ", - length = Vector.__dict__[self.typeStr + "Length"] - self.assertRaises(TypeError, length, None) - - # Test the (type* IN_ARRAY1, int DIM1) typemap - def testProd(self): - "Test prod function" - print >>sys.stderr, self.typeStr, "... ", - prod = Vector.__dict__[self.typeStr + "Prod"] - self.assertEquals(prod([1,2,3,4]), 24) - - # Test the (type* IN_ARRAY1, int DIM1) typemap - def testProdBadList(self): - "Test prod function with bad list" - print >>sys.stderr, self.typeStr, "... ", - prod = Vector.__dict__[self.typeStr + "Prod"] - self.assertRaises(BadListError, prod, [[1,"two"], ["e","pi"]]) - - # Test the (type* IN_ARRAY1, int DIM1) typemap - def testProdWrongDim(self): - "Test prod function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - prod = Vector.__dict__[self.typeStr + "Prod"] - self.assertRaises(TypeError, prod, [[1,2], [8,9]]) - - # Test the (type* IN_ARRAY1, int DIM1) typemap - def testProdNonContainer(self): - "Test prod function with non-container" - print >>sys.stderr, self.typeStr, "... ", - prod = Vector.__dict__[self.typeStr + "Prod"] - self.assertRaises(TypeError, prod, None) - - # Test the (int DIM1, type* IN_ARRAY1) typemap - def testSum(self): - "Test sum function" - print >>sys.stderr, self.typeStr, "... ", - sum = Vector.__dict__[self.typeStr + "Sum"] - self.assertEquals(sum([5,6,7,8]), 26) - - # Test the (int DIM1, type* IN_ARRAY1) typemap - def testSumBadList(self): - "Test sum function with bad list" - print >>sys.stderr, self.typeStr, "... ", - sum = Vector.__dict__[self.typeStr + "Sum"] - self.assertRaises(BadListError, sum, [3,4, 5, "pi"]) - - # Test the (int DIM1, type* IN_ARRAY1) typemap - def testSumWrongDim(self): - "Test sum function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - sum = Vector.__dict__[self.typeStr + "Sum"] - self.assertRaises(TypeError, sum, [[3,4], [5,6]]) - - # Test the (int DIM1, type* IN_ARRAY1) typemap - def testSumNonContainer(self): - "Test sum function with non-container" - print >>sys.stderr, self.typeStr, "... ", - sum = Vector.__dict__[self.typeStr + "Sum"] - self.assertRaises(TypeError, sum, True) - - # Test the (type INPLACE_ARRAY1[ANY]) typemap - def testReverse(self): - "Test reverse function" - print >>sys.stderr, self.typeStr, "... ", - reverse = Vector.__dict__[self.typeStr + "Reverse"] - vector = np.array([1,2,4],self.typeCode) - reverse(vector) - self.assertEquals((vector == [4,2,1]).all(), True) - - # Test the (type INPLACE_ARRAY1[ANY]) typemap - def testReverseWrongDim(self): - "Test reverse function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - reverse = Vector.__dict__[self.typeStr + "Reverse"] - vector = np.array([[1,2], [3,4]],self.typeCode) - self.assertRaises(TypeError, reverse, vector) - - # Test the (type INPLACE_ARRAY1[ANY]) typemap - def testReverseWrongSize(self): - "Test reverse function with wrong size" - print >>sys.stderr, self.typeStr, "... ", - reverse = Vector.__dict__[self.typeStr + "Reverse"] - vector = np.array([9,8,7,6,5,4],self.typeCode) - self.assertRaises(TypeError, reverse, vector) - - # Test the (type INPLACE_ARRAY1[ANY]) typemap - def testReverseWrongType(self): - "Test reverse function with wrong type" - print >>sys.stderr, self.typeStr, "... ", - reverse = Vector.__dict__[self.typeStr + "Reverse"] - vector = np.array([1,2,4],'c') - self.assertRaises(TypeError, reverse, vector) - - # Test the (type INPLACE_ARRAY1[ANY]) typemap - def testReverseNonArray(self): - "Test reverse function with non-array" - print >>sys.stderr, self.typeStr, "... ", - reverse = Vector.__dict__[self.typeStr + "Reverse"] - self.assertRaises(TypeError, reverse, [2,4,6]) - - # Test the (type* INPLACE_ARRAY1, int DIM1) typemap - def testOnes(self): - "Test ones function" - print >>sys.stderr, self.typeStr, "... ", - ones = Vector.__dict__[self.typeStr + "Ones"] - vector = np.zeros(5,self.typeCode) - ones(vector) - np.testing.assert_array_equal(vector, np.array([1,1,1,1,1])) - - # Test the (type* INPLACE_ARRAY1, int DIM1) typemap - def testOnesWrongDim(self): - "Test ones function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - ones = Vector.__dict__[self.typeStr + "Ones"] - vector = np.zeros((5,5),self.typeCode) - self.assertRaises(TypeError, ones, vector) - - # Test the (type* INPLACE_ARRAY1, int DIM1) typemap - def testOnesWrongType(self): - "Test ones function with wrong type" - print >>sys.stderr, self.typeStr, "... ", - ones = Vector.__dict__[self.typeStr + "Ones"] - vector = np.zeros((5,5),'c') - self.assertRaises(TypeError, ones, vector) - - # Test the (type* INPLACE_ARRAY1, int DIM1) typemap - def testOnesNonArray(self): - "Test ones function with non-array" - print >>sys.stderr, self.typeStr, "... ", - ones = Vector.__dict__[self.typeStr + "Ones"] - self.assertRaises(TypeError, ones, [2,4,6,8]) - - # Test the (int DIM1, type* INPLACE_ARRAY1) typemap - def testZeros(self): - "Test zeros function" - print >>sys.stderr, self.typeStr, "... ", - zeros = Vector.__dict__[self.typeStr + "Zeros"] - vector = np.ones(5,self.typeCode) - zeros(vector) - np.testing.assert_array_equal(vector, np.array([0,0,0,0,0])) - - # Test the (int DIM1, type* INPLACE_ARRAY1) typemap - def testZerosWrongDim(self): - "Test zeros function with wrong dimensions" - print >>sys.stderr, self.typeStr, "... ", - zeros = Vector.__dict__[self.typeStr + "Zeros"] - vector = np.ones((5,5),self.typeCode) - self.assertRaises(TypeError, zeros, vector) - - # Test the (int DIM1, type* INPLACE_ARRAY1) typemap - def testZerosWrongType(self): - "Test zeros function with wrong type" - print >>sys.stderr, self.typeStr, "... ", - zeros = Vector.__dict__[self.typeStr + "Zeros"] - vector = np.ones(6,'c') - self.assertRaises(TypeError, zeros, vector) - - # Test the (int DIM1, type* INPLACE_ARRAY1) typemap - def testZerosNonArray(self): - "Test zeros function with non-array" - print >>sys.stderr, self.typeStr, "... ", - zeros = Vector.__dict__[self.typeStr + "Zeros"] - self.assertRaises(TypeError, zeros, [1,3,5,7,9]) - - # Test the (type ARGOUT_ARRAY1[ANY]) typemap - def testEOSplit(self): - "Test eoSplit function" - print >>sys.stderr, self.typeStr, "... ", - eoSplit = Vector.__dict__[self.typeStr + "EOSplit"] - even, odd = eoSplit([1,2,3]) - self.assertEquals((even == [1,0,3]).all(), True) - self.assertEquals((odd == [0,2,0]).all(), True) - - # Test the (type* ARGOUT_ARRAY1, int DIM1) typemap - def testTwos(self): - "Test twos function" - print >>sys.stderr, self.typeStr, "... ", - twos = Vector.__dict__[self.typeStr + "Twos"] - vector = twos(5) - self.assertEquals((vector == [2,2,2,2,2]).all(), True) - - # Test the (type* ARGOUT_ARRAY1, int DIM1) typemap - def testTwosNonInt(self): - "Test twos function with non-integer dimension" - print >>sys.stderr, self.typeStr, "... ", - twos = Vector.__dict__[self.typeStr + "Twos"] - self.assertRaises(TypeError, twos, 5.0) - - # Test the (int DIM1, type* ARGOUT_ARRAY1) typemap - def testThrees(self): - "Test threes function" - print >>sys.stderr, self.typeStr, "... ", - threes = Vector.__dict__[self.typeStr + "Threes"] - vector = threes(6) - self.assertEquals((vector == [3,3,3,3,3,3]).all(), True) - - # Test the (type* ARGOUT_ARRAY1, int DIM1) typemap - def testThreesNonInt(self): - "Test threes function with non-integer dimension" - print >>sys.stderr, self.typeStr, "... ", - threes = Vector.__dict__[self.typeStr + "Threes"] - self.assertRaises(TypeError, threes, "threes") - -###################################################################### - -class scharTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "schar" - self.typeCode = "b" - -###################################################################### - -class ucharTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "uchar" - self.typeCode = "B" - -###################################################################### - -class shortTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "short" - self.typeCode = "h" - -###################################################################### - -class ushortTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "ushort" - self.typeCode = "H" - -###################################################################### - -class intTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "int" - self.typeCode = "i" - -###################################################################### - -class uintTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "uint" - self.typeCode = "I" - -###################################################################### - -class longTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "long" - self.typeCode = "l" - -###################################################################### - -class ulongTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "ulong" - self.typeCode = "L" - -###################################################################### - -class longLongTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "longLong" - self.typeCode = "q" - -###################################################################### - -class ulongLongTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "ulongLong" - self.typeCode = "Q" - -###################################################################### - -class floatTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "float" - self.typeCode = "f" - -###################################################################### - -class doubleTestCase(VectorTestCase): - def __init__(self, methodName="runTest"): - VectorTestCase.__init__(self, methodName) - self.typeStr = "double" - self.typeCode = "d" - -###################################################################### - -if __name__ == "__main__": - - # Build the test suite - suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite( scharTestCase)) - suite.addTest(unittest.makeSuite( ucharTestCase)) - suite.addTest(unittest.makeSuite( shortTestCase)) - suite.addTest(unittest.makeSuite( ushortTestCase)) - suite.addTest(unittest.makeSuite( intTestCase)) - suite.addTest(unittest.makeSuite( uintTestCase)) - suite.addTest(unittest.makeSuite( longTestCase)) - suite.addTest(unittest.makeSuite( ulongTestCase)) - suite.addTest(unittest.makeSuite( longLongTestCase)) - suite.addTest(unittest.makeSuite(ulongLongTestCase)) - suite.addTest(unittest.makeSuite( floatTestCase)) - suite.addTest(unittest.makeSuite( doubleTestCase)) - - # Execute the test suite - print "Testing 1D Functions of Module Vector" - print "NumPy version", np.__version__ - print - result = unittest.TextTestRunner(verbosity=2).run(suite) - sys.exit(len(result.errors) + len(result.failures)) Copied: trunk/doc/ufuncs.txt (from rev 5669, trunk/numpy/doc/ufuncs.txt) Modified: trunk/numpy/__init__.py =================================================================== --- trunk/numpy/__init__.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/__init__.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -36,14 +36,17 @@ >>> np.lookfor('keyword') +Topical documentation is available under the ``doc`` sub-module:: + + >>> from numpy import doc + >>> help(doc) + Available subpackages --------------------- -core - Defines a multi-dimensional array and useful procedures - for Numerical computation. +doc + Topical documentation on broadcasting, indexing, etc. lib - Basic functions used by several sub-packages and useful - to have in the main name-space. + Basic functions used by several sub-packages. random Core Random Tools linalg @@ -52,26 +55,16 @@ Core FFT routines testing Numpy testing tools - -The following sub-packages must be explicitly imported: - f2py Fortran to Python Interface Generator. distutils Enhancements to distutils with support for Fortran compilers support and more. -Global symbols from subpackages -------------------------------- -Do not import directly from `core` and `lib`: those functions -have been imported into the `numpy` namespace. - -Utility tools -------------- +Utilities +--------- test Run numpy unittests -pkgload - Load numpy packages show_config Show numpy build configuration dual @@ -147,7 +140,6 @@ import random import ctypeslib import ma - import doc # Make these accessible from numpy name-space # but not imported in from numpy import * @@ -159,4 +151,4 @@ 'show_config']) __all__.extend(core.__all__) __all__.extend(lib.__all__) - __all__.extend(['linalg', 'fft', 'random', 'ctypeslib', 'ma', 'doc']) + __all__.extend(['linalg', 'fft', 'random', 'ctypeslib', 'ma']) Deleted: trunk/numpy/doc/CAPI.txt =================================================================== --- trunk/numpy/doc/CAPI.txt 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/CAPI.txt 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,313 +0,0 @@ -=============== -C-API for NumPy -=============== - -:Author: Travis Oliphant -:Discussions to: `numpy-discussion at scipy.org`__ -:Created: October 2005 - -__ http://www.scipy.org/Mailing_Lists - -The C API of NumPy is (mostly) backward compatible with Numeric. - -There are a few non-standard Numeric usages (that were not really part -of the API) that will need to be changed: - -* If you used any of the function pointers in the ``PyArray_Descr`` - structure you will have to modify your usage of those. First, - the pointers are all under the member named ``f``. So ``descr->cast`` - is now ``descr->f->cast``. In addition, the - casting functions have eliminated the strides argument (use - ``PyArray_CastTo`` if you need strided casting). All functions have - one or two ``PyArrayObject *`` arguments at the end. This allows the - flexible arrays and mis-behaved arrays to be handled. - -* The ``descr->zero`` and ``descr->one`` constants have been replaced with - function calls, ``PyArray_Zero``, and ``PyArray_One`` (be sure to read the - code and free the resulting memory if you use these calls). - -* If you passed ``array->dimensions`` and ``array->strides`` around - to functions, you will need to fix some code. These are now - ``npy_intp*`` pointers. On 32-bit systems there won't be a problem. - However, on 64-bit systems, you will need to make changes to avoid - errors and segfaults. - - -The header files ``arrayobject.h`` and ``ufuncobject.h`` contain many defines -that you may find useful. The files ``__ufunc_api.h`` and -``__multiarray_api.h`` contain the available C-API function calls with -their function signatures. - -All of these headers are installed to -``/site-packages/numpy/core/include`` - - -Getting arrays in C-code -========================= - -All new arrays can be created using ``PyArray_NewFromDescr``. A simple interface -equivalent to ``PyArray_FromDims`` is ``PyArray_SimpleNew(nd, dims, typenum)`` -and to ``PyArray_FromDimsAndData`` is -``PyArray_SimpleNewFromData(nd, dims, typenum, data)``. - -This is a very flexible function. - -:: - - PyObject * PyArray_NewFromDescr(PyTypeObject *subtype, PyArray_Descr *descr, - int nd, npy_intp *dims, - npy_intp *strides, char *data, - int flags, PyObject *obj); - -``subtype`` : ``PyTypeObject *`` - The subtype that should be created (either pass in - ``&PyArray_Type``, ``&PyBigArray_Type``, or ``obj->ob_type``, - where ``obj`` is a an instance of a subtype (or subclass) of - ``PyArray_Type`` or ``PyBigArray_Type``). - -``descr`` : ``PyArray_Descr *`` - The type descriptor for the array. This is a Python object (this - function steals a reference to it). The easiest way to get one is - using ``PyArray_DescrFromType()``. If you want to use a - flexible size array, then you need to use - ``PyArray_DescrNewFromType()`` and set its ``elsize`` - paramter to the desired size. The typenum in both of these cases - is one of the ``PyArray_XXXX`` enumerated types. - -``nd`` : ``int`` - The number of dimensions (<``MAX_DIMS``) - -``*dims`` : ``npy_intp *`` - A pointer to the size in each dimension. Information will be - copied from here. - -``*strides`` : ``npy_intp *`` - The strides this array should have. For new arrays created by this - routine, this should be ``NULL``. If you pass in memory for this array - to use, then you can pass in the strides information as well - (otherwise it will be created for you and default to C-contiguous - or Fortran contiguous). Any strides will be copied into the array - structure. Do not pass in bad strides information!!!! - - ``PyArray_CheckStrides(...)`` can help but you must call it if you are - unsure. You cannot pass in strides information when data is ``NULL`` - and this routine is creating its own memory. - -``*data`` : ``char *`` - ``NULL`` for creating brand-new memory. If you want this array to wrap - another memory area, then pass the pointer here. You are - responsible for deleting the memory in that case, but do not do so - until the new array object has been deleted. The best way to - handle that is to get the memory from another Python object, - ``INCREF`` that Python object after passing it's data pointer to this - routine, and set the ``->base`` member of the returned array to the - Python object. *You are responsible for* setting ``PyArray_BASE(ret)`` - to the base object. Failure to do so will create a memory leak. - - If you pass in a data buffer, the ``flags`` argument will be the flags - of the new array. If you create a new array, a non-zero flags - argument indicates that you want the array to be in Fortran order. - -``flags`` : ``int`` - Either the flags showing how to interpret the data buffer passed - in, or if a new array is created, nonzero to indicate a Fortran - order array. See below for an explanation of the flags. - -``obj`` : ``PyObject *`` - If subtypes is ``&PyArray_Type`` or ``&PyBigArray_Type``, this argument is - ignored. Otherwise, the ``__array_finalize__`` method of the subtype - is called (if present) and passed this object. This is usually an - array of the type to be created (so the ``__array_finalize__`` method - must handle an array argument. But, it can be anything...) - -Note: The returned array object will be unitialized unless the type is -``PyArray_OBJECT`` in which case the memory will be set to ``NULL``. - -``PyArray_SimpleNew(nd, dims, typenum)`` is a drop-in replacement for -``PyArray_FromDims`` (except it takes ``npy_intp*`` dims instead of ``int*`` dims -which matters on 64-bit systems) and it does not initialize the memory -to zero. - -``PyArray_SimpleNew`` is just a macro for ``PyArray_New`` with default arguments. -Use ``PyArray_FILLWBYTE(arr, 0)`` to fill with zeros. - -The ``PyArray_FromDims`` and family of functions are still available and -are loose wrappers around this function. These functions still take -``int *`` arguments. This should be fine on 32-bit systems, but on 64-bit -systems you may run into trouble if you frequently passed -``PyArray_FromDims`` the dimensions member of the old ``PyArrayObject`` structure -because ``sizeof(npy_intp) != sizeof(int)``. - - -Getting an arrayobject from an arbitrary Python object -====================================================== - -``PyArray_FromAny(...)`` - -This function replaces ``PyArray_ContiguousFromObject`` and friends (those -function calls still remain but they are loose wrappers around the -``PyArray_FromAny`` call). - -:: - - static PyObject * - PyArray_FromAny(PyObject *op, PyArray_Descr *dtype, int min_depth, - int max_depth, int requires, PyObject *context) - - -``op`` : ``PyObject *`` - The Python object to "convert" to an array object - -``dtype`` : ``PyArray_Descr *`` - The desired data-type descriptor. This can be ``NULL``, if the - descriptor should be determined by the object. Unless ``FORCECAST`` is - present in ``flags``, this call will generate an error if the data - type cannot be safely obtained from the object. - -``min_depth`` : ``int`` - The minimum depth of array needed or 0 if doesn't matter - -``max_depth`` : ``int`` - The maximum depth of array allowed or 0 if doesn't matter - -``requires`` : ``int`` - A flag indicating the "requirements" of the returned array. These - are the usual ndarray flags (see `NDArray flags`_ below). In - addition, there are three flags used only for the ``FromAny`` - family of functions: - - - ``ENSURECOPY``: always copy the array. Returned arrays always - have ``CONTIGUOUS``, ``ALIGNED``, and ``WRITEABLE`` set. - - ``ENSUREARRAY``: ensure the returned array is an ndarray (or a - bigndarray if ``op`` is one). - - ``FORCECAST``: cause a cast to occur regardless of whether or - not it is safe. - -``context`` : ``PyObject *`` - If the Python object ``op`` is not an numpy array, but has an - ``__array__`` method, context is passed as the second argument to - that method (the first is the typecode). Almost always this - parameter is ``NULL``. - - -``PyArray_ContiguousFromAny(op, typenum, min_depth, max_depth)`` is -equivalent to ``PyArray_ContiguousFromObject(...)`` (which is still -available), except it will return the subclass if op is already a -subclass of the ndarray. The ``ContiguousFromObject`` version will -always return an ndarray (or a bigndarray). - -Passing Data Type information to C-code -======================================= - -All datatypes are handled using the ``PyArray_Descr *`` structure. -This structure can be obtained from a Python object using -``PyArray_DescrConverter`` and ``PyArray_DescrConverter2``. The former -returns the default ``PyArray_LONG`` descriptor when the input object -is None, while the latter returns ``NULL`` when the input object is ``None``. - -See the ``arraymethods.c`` and ``multiarraymodule.c`` files for many -examples of usage. - -Getting at the structure of the array. --------------------------------------- - -You should use the ``#defines`` provided to access array structure portions: - -- ``PyArray_DATA(obj)`` : returns a ``void *`` to the array data -- ``PyArray_BYTES(obj)`` : return a ``char *`` to the array data -- ``PyArray_ITEMSIZE(obj)`` -- ``PyArray_NDIM(obj)`` -- ``PyArray_DIMS(obj)`` -- ``PyArray_DIM(obj, n)`` -- ``PyArray_STRIDES(obj)`` -- ``PyArray_STRIDE(obj,n)`` -- ``PyArray_DESCR(obj)`` -- ``PyArray_BASE(obj)`` - -see more in ``arrayobject.h`` - - -NDArray Flags -============= - -The ``flags`` attribute of the ``PyArrayObject`` structure contains important -information about the memory used by the array (pointed to by the data member) -This flags information must be kept accurate or strange results and even -segfaults may result. - -There are 6 (binary) flags that describe the memory area used by the -data buffer. These constants are defined in ``arrayobject.h`` and -determine the bit-position of the flag. Python exposes a nice attribute- -based interface as well as a dictionary-like interface for getting -(and, if appropriate, setting) these flags. - -Memory areas of all kinds can be pointed to by an ndarray, necessitating -these flags. If you get an arbitrary ``PyArrayObject`` in C-code, -you need to be aware of the flags that are set. -If you need to guarantee a certain kind of array -(like ``NPY_CONTIGUOUS`` and ``NPY_BEHAVED``), then pass these requirements into the -PyArray_FromAny function. - - -``NPY_CONTIGUOUS`` - True if the array is (C-style) contiguous in memory. -``NPY_FORTRAN`` - True if the array is (Fortran-style) contiguous in memory. - -Notice that contiguous 1-d arrays are always both ``NPY_FORTRAN`` contiguous -and C contiguous. Both of these flags can be checked and are convenience -flags only as whether or not an array is ``NPY_CONTIGUOUS`` or ``NPY_FORTRAN`` -can be determined by the ``strides``, ``dimensions``, and ``itemsize`` -attributes. - -``NPY_OWNDATA`` - True if the array owns the memory (it will try and free it using - ``PyDataMem_FREE()`` on deallocation --- so it better really own it). - -These three flags facilitate using a data pointer that is a memory-mapped -array, or part of some larger record array. But, they may have other uses... - -``NPY_ALIGNED`` - True if the data buffer is aligned for the type and the strides - are multiples of the alignment factor as well. This can be - checked. - -``NPY_WRITEABLE`` - True only if the data buffer can be "written" to. - -``NPY_UPDATEIFCOPY`` - This is a special flag that is set if this array represents a copy - made because a user required certain flags in ``PyArray_FromAny`` and - a copy had to be made of some other array (and the user asked for - this flag to be set in such a situation). The base attribute then - points to the "misbehaved" array (which is set read_only). When - the array with this flag set is deallocated, it will copy its - contents back to the "misbehaved" array (casting if necessary) and - will reset the "misbehaved" array to ``WRITEABLE``. If the - "misbehaved" array was not ``WRITEABLE`` to begin with then - ``PyArray_FromAny`` would have returned an error because ``UPDATEIFCOPY`` - would not have been possible. - - -``PyArray_UpdateFlags(obj, flags)`` will update the ``obj->flags`` for -``flags`` which can be any of ``NPY_CONTIGUOUS``, ``NPY_FORTRAN``, ``NPY_ALIGNED``, or -``NPY_WRITEABLE``. - -Some useful combinations of these flags: - -- ``NPY_BEHAVED = NPY_ALIGNED | NPY_WRITEABLE`` -- ``NPY_CARRAY = NPY_DEFAULT = NPY_CONTIGUOUS | NPY_BEHAVED`` -- ``NPY_CARRAY_RO = NPY_CONTIGUOUS | NPY_ALIGNED`` -- ``NPY_FARRAY = NPY_FORTRAN | NPY_BEHAVED`` -- ``NPY_FARRAY_RO = NPY_FORTRAN | NPY_ALIGNED`` - -The macro ``PyArray_CHECKFLAGS(obj, flags)`` can test any combination of flags. -There are several default combinations defined as macros already -(see ``arrayobject.h``) - -In particular, there are ``ISBEHAVED``, ``ISBEHAVED_RO``, ``ISCARRAY`` -and ``ISFARRAY`` macros that also check to make sure the array is in -native byte order (as determined) by the data-type descriptor. - -There are more C-API enhancements which you can discover in the code, -or buy the book (http://www.trelgol.com) Deleted: trunk/numpy/doc/DISTUTILS.txt =================================================================== --- trunk/numpy/doc/DISTUTILS.txt 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/DISTUTILS.txt 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,546 +0,0 @@ -.. -*- rest -*- - -NumPy Distutils - Users Guide -============================= - -:Author: Pearu Peterson -:Discussions to: scipy-dev at scipy.org -:Created: October 2005 -:Revision: $LastChangedRevision$ -:SVN source: $HeadURL$ - -.. contents:: - -SciPy structure -''''''''''''''' - -Currently SciPy project consists of two packages: - -- NumPy (previously called SciPy core) --- it provides packages like: - - + numpy.distutils - extension to Python distutils - + numpy.f2py - a tool to bind Fortran/C codes to Python - + numpy.core - future replacement of Numeric and numarray packages - + numpy.lib - extra utility functions - + numpy.testing - numpy-style tools for unit testing - + etc - -- SciPy --- a collection of scientific tools for Python. - -The aim of this document is to describe how to add new tools to SciPy. - - -Requirements for SciPy packages -''''''''''''''''''''''''''''''' - -SciPy consists of Python packages, called SciPy packages, that are -available to Python users via the ``scipy`` namespace. Each SciPy package -may contain other SciPy packages. And so on. Therefore, the SciPy -directory tree is a tree of packages with arbitrary depth and width. -Any SciPy package may depend on NumPy packages but the dependence on other -SciPy packages should be kept minimal or zero. - -A SciPy package contains, in addition to its sources, the following -files and directories: - - + ``setup.py`` --- building script - + ``info.py`` --- contains documentation and import flags - + ``__init__.py`` --- package initializer - + ``tests/`` --- directory of unittests - -Their contents are described below. - -The ``setup.py`` file -''''''''''''''''''''' - -In order to add a Python package to SciPy, its build script (``setup.py``) -must meet certain requirements. The most important requirement is that the -package define a ``configuration(parent_package='',top_path=None)`` function -which returns a dictionary suitable for passing to -``numpy.distutils.core.setup(..)``. To simplify the construction of -this dictionary, ``numpy.distutils.misc_util`` provides the -``Configuration`` class, described below. - -SciPy pure Python package example ---------------------------------- - -Below is an example of a minimal ``setup.py`` file for a pure Scipy package:: - - #!/usr/bin/env python - def configuration(parent_package='',top_path=None): - from numpy.distutils.misc_util import Configuration - config = Configuration('mypackage',parent_package,top_path) - return config - - if __name__ == "__main__": - from numpy.distutils.core import setup - #setup(**configuration(top_path='').todict()) - setup(configuration=configuration) - -The arguments of the ``configuration`` function specifiy the name of -parent SciPy package (``parent_package``) and the directory location -of the main ``setup.py`` script (``top_path``). These arguments, -along with the name of the current package, should be passed to the -``Configuration`` constructor. - -The ``Configuration`` constructor has a fourth optional argument, -``package_path``, that can be used when package files are located in -a different location than the directory of the ``setup.py`` file. - -Remaining ``Configuration`` arguments are all keyword arguments that will -be used to initialize attributes of ``Configuration`` -instance. Usually, these keywords are the same as the ones that -``setup(..)`` function would expect, for example, ``packages``, -``ext_modules``, ``data_files``, ``include_dirs``, ``libraries``, -``headers``, ``scripts``, ``package_dir``, etc. However, the direct -specification of these keywords is not recommended as the content of -these keyword arguments will not be processed or checked for the -consistency of SciPy building system. - -Finally, ``Configuration`` has ``.todict()`` method that returns all -the configuration data as a dictionary suitable for passing on to the -``setup(..)`` function. - -``Configuration`` instance attributes -------------------------------------- - -In addition to attributes that can be specified via keyword arguments -to ``Configuration`` constructor, ``Configuration`` instance (let us -denote as ``config``) has the following attributes that can be useful -in writing setup scripts: - -+ ``config.name`` - full name of the current package. The names of parent - packages can be extracted as ``config.name.split('.')``. - -+ ``config.local_path`` - path to the location of current ``setup.py`` file. - -+ ``config.top_path`` - path to the location of main ``setup.py`` file. - -``Configuration`` instance methods ----------------------------------- - -+ ``config.todict()`` --- returns configuration dictionary suitable for - passing to ``numpy.distutils.core.setup(..)`` function. - -+ ``config.paths(*paths) --- applies ``glob.glob(..)`` to items of - ``paths`` if necessary. Fixes ``paths`` item that is relative to - ``config.local_path``. - -+ ``config.get_subpackage(subpackage_name,subpackage_path=None)`` --- - returns a list of subpackage configurations. Subpackage is looked in the - current directory under the name ``subpackage_name`` but the path - can be specified also via optional ``subpackage_path`` argument. - If ``subpackage_name`` is specified as ``None`` then the subpackage - name will be taken the basename of ``subpackage_path``. - Any ``*`` used for subpackage names are expanded as wildcards. - -+ ``config.add_subpackage(subpackage_name,subpackage_path=None)`` --- - add SciPy subpackage configuration to the current one. The meaning - and usage of arguments is explained above, see - ``config.get_subpackage()`` method. - -+ ``config.add_data_files(*files)`` --- prepend ``files`` to ``data_files`` - list. If ``files`` item is a tuple then its first element defines - the suffix of where data files are copied relative to package installation - directory and the second element specifies the path to data - files. By default data files are copied under package installation - directory. For example, - - :: - - config.add_data_files('foo.dat', - ('fun',['gun.dat','nun/pun.dat','/tmp/sun.dat']), - 'bar/car.dat'. - '/full/path/to/can.dat', - ) - - will install data files to the following locations - - :: - - / - foo.dat - fun/ - gun.dat - pun.dat - sun.dat - bar/ - car.dat - can.dat - - Path to data files can be a function taking no arguments and - returning path(s) to data files -- this is a useful when data files - are generated while building the package. (XXX: explain the step - when this function are called exactly) - -+ ``config.add_data_dir(data_path)`` --- add directory ``data_path`` - recursively to ``data_files``. The whole directory tree starting at - ``data_path`` will be copied under package installation directory. - If ``data_path`` is a tuple then its first element defines - the suffix of where data files are copied relative to package installation - directory and the second element specifies the path to data directory. - By default, data directory are copied under package installation - directory under the basename of ``data_path``. For example, - - :: - - config.add_data_dir('fun') # fun/ contains foo.dat bar/car.dat - config.add_data_dir(('sun','fun')) - config.add_data_dir(('gun','/full/path/to/fun')) - - will install data files to the following locations - - :: - - / - fun/ - foo.dat - bar/ - car.dat - sun/ - foo.dat - bar/ - car.dat - gun/ - foo.dat - bar/ - car.dat - -+ ``config.add_include_dirs(*paths)`` --- prepend ``paths`` to - ``include_dirs`` list. This list will be visible to all extension - modules of the current package. - -+ ``config.add_headers(*files)`` --- prepend ``files`` to ``headers`` - list. By default, headers will be installed under - ``/include/pythonX.X//`` - directory. If ``files`` item is a tuple then it's first argument - specifies the installation suffix relative to - ``/include/pythonX.X/`` path. This is a Python distutils - method; its use is discouraged for NumPy and SciPy in favour of - ``config.add_data_files(*files)``. - -+ ``config.add_scripts(*files)`` --- prepend ``files`` to ``scripts`` - list. Scripts will be installed under ``/bin/`` directory. - -+ ``config.add_extension(name,sources,*kw)`` --- create and add an - ``Extension`` instance to ``ext_modules`` list. The first argument - ``name`` defines the name of the extension module that will be - installed under ``config.name`` package. The second argument is - a list of sources. ``add_extension`` method takes also keyword - arguments that are passed on to the ``Extension`` constructor. - The list of allowed keywords is the following: ``include_dirs``, - ``define_macros``, ``undef_macros``, ``library_dirs``, ``libraries``, - ``runtime_library_dirs``, ``extra_objects``, ``extra_compile_args``, - ``extra_link_args``, ``export_symbols``, ``swig_opts``, ``depends``, - ``language``, ``f2py_options``, ``module_dirs``, ``extra_info``. - - Note that ``config.paths`` method is applied to all lists that - may contain paths. ``extra_info`` is a dictionary or a list - of dictionaries that content will be appended to keyword arguments. - The list ``depends`` contains paths to files or directories - that the sources of the extension module depend on. If any path - in the ``depends`` list is newer than the extension module, then - the module will be rebuilt. - - The list of sources may contain functions ('source generators') - with a pattern ``def (ext, build_dir): return - ``. If ``funcname`` returns ``None``, no sources - are generated. And if the ``Extension`` instance has no sources - after processing all source generators, no extension module will - be built. This is the recommended way to conditionally define - extension modules. Source generator functions are called by the - ``build_src`` command of ``numpy.distutils``. - - For example, here is a typical source generator function:: - - def generate_source(ext,build_dir): - import os - from distutils.dep_util import newer - target = os.path.join(build_dir,'somesource.c') - if newer(target,__file__): - # create target file - return target - - The first argument contains the Extension instance that can be - useful to access its attributes like ``depends``, ``sources``, - etc. lists and modify them during the building process. - The second argument gives a path to a build directory that must - be used when creating files to a disk. - -+ ``config.add_library(name, sources, **build_info)`` --- add - a library to ``libraries`` list. Allowed keywords arguments - are ``depends``, ``macros``, ``include_dirs``, - ``extra_compiler_args``, ``f2py_options``. See ``.add_extension()`` - method for more information on arguments. - -+ ``config.have_f77c()`` --- return True if Fortran 77 compiler is - available (read: a simple Fortran 77 code compiled succesfully). - -+ ``config.have_f90c()`` --- return True if Fortran 90 compiler is - available (read: a simple Fortran 90 code compiled succesfully). - -+ ``config.get_version()`` --- return version string of the current package, - ``None`` if version information could not be detected. This methods - scans files ``__version__.py``, ``_version.py``, - ``version.py``, ``__svn_version__.py`` for string variables - ``version``, ``__version__``, ``_version``. - -+ ``config.make_svn_version_py()`` --- appends a data function to - ``data_files`` list that will generate ``__svn_version__.py`` file - to the current package directory. The file will be removed from - the source directory when Python exits. - -+ ``config.get_build_temp_dir()`` --- return a path to a temporary - directory. This is the place where one should build temporary - files. - -+ ``config.get_distribution()`` --- return distutils ``Distribution`` - instance. - -+ ``config.get_config_cmd()`` --- returns ``numpy.distutils`` config - command instance. - -+ ``config.get_info(*names)`` --- - -Template files --------------- - -XXX: Describe how files with extensions ``.f.src``, ``.pyf.src``, -``.c.src``, etc. are pre-processed by the ``build_src`` command. - -Useful functions in ``numpy.distutils.misc_util`` -------------------------------------------------- - -+ ``get_numpy_include_dirs()`` --- return a list of NumPy base - include directories. NumPy base include directories contain - header files such as ``numpy/arrayobject.h``, ``numpy/funcobject.h`` - etc. For installed NumPy the returned list has length 1 - but when building NumPy the list may contain more directories, - for example, a path to ``config.h`` file that - ``numpy/base/setup.py`` file generates and is used by ``numpy`` - header files. - -+ ``append_path(prefix,path)`` --- smart append ``path`` to ``prefix``. - -+ ``gpaths(paths, local_path='')`` --- apply glob to paths and prepend - ``local_path`` if needed. - -+ ``njoin(*path)`` --- join pathname components + convert ``/``-separated path - to ``os.sep``-separated path and resolve ``..``, ``.`` from paths. - Ex. ``njoin('a',['b','./c'],'..','g') -> os.path.join('a','b','g')``. - -+ ``minrelpath(path)`` --- resolves dots in ``path``. - -+ ``rel_path(path, parent_path)`` --- return ``path`` relative to ``parent_path``. - -+ ``def get_cmd(cmdname,_cache={})`` --- returns ``numpy.distutils`` - command instance. - -+ ``all_strings(lst)`` - -+ ``has_f_sources(sources)`` - -+ ``has_cxx_sources(sources)`` - -+ ``filter_sources(sources)`` --- return ``c_sources, cxx_sources, - f_sources, fmodule_sources`` - -+ ``get_dependencies(sources)`` - -+ ``is_local_src_dir(directory)`` - -+ ``get_ext_source_files(ext)`` - -+ ``get_script_files(scripts)`` - -+ ``get_lib_source_files(lib)`` - -+ ``get_data_files(data)`` - -+ ``dot_join(*args)`` --- join non-zero arguments with a dot. - -+ ``get_frame(level=0)`` --- return frame object from call stack with given level. - -+ ``cyg2win32(path)`` - -+ ``mingw32()`` --- return ``True`` when using mingw32 environment. - -+ ``terminal_has_colors()``, ``red_text(s)``, ``green_text(s)``, - ``yellow_text(s)``, ``blue_text(s)``, ``cyan_text(s)`` - -+ ``get_path(mod_name,parent_path=None)`` --- return path of a module - relative to parent_path when given. Handles also ``__main__`` and - ``__builtin__`` modules. - -+ ``allpath(name)`` --- replaces ``/`` with ``os.sep`` in ``name``. - -+ ``cxx_ext_match``, ``fortran_ext_match``, ``f90_ext_match``, - ``f90_module_name_match`` - -``numpy.distutils.system_info`` module --------------------------------------- - -+ ``get_info(name,notfound_action=0)`` -+ ``combine_paths(*args,**kws)`` -+ ``show_all()`` - -``numpy.distutils.cpuinfo`` module ----------------------------------- - -+ ``cpuinfo`` - -``numpy.distutils.log`` module ------------------------------- - -+ ``set_verbosity(v)`` - - -``numpy.distutils.exec_command`` module ---------------------------------------- - -+ ``get_pythonexe()`` -+ ``find_executable(exe, path=None)`` -+ ``exec_command( command, execute_in='', use_shell=None, use_tee=None, **env )`` - -The ``info.py`` file -'''''''''''''''''''' - -Scipy package import hooks assume that each package contains a -``info.py`` file. This file contains overall documentation about the package -and variables defining the order of package imports, dependency -relations between packages, etc. - -On import, the following information will be looked for in ``info.py``: - -__doc__ - The documentation string of the package. - -__doc_title__ - The title of the package. If not defined then the first non-empty - line of ``__doc__`` will be used. - -__all__ - List of symbols that package exports. Optional. - -global_symbols - List of names that should be imported to numpy name space. To import - all symbols to ``numpy`` namespace, define ``global_symbols=['*']``. - -depends - List of names that the package depends on. Prefix ``numpy.`` - will be automatically added to package names. For example, - use ``testing`` to indicate dependence on ``numpy.testing`` - package. Default value is ``[]``. - -postpone_import - Boolean variable indicating that importing the package should be - postponed until the first attempt of its usage. Default value is ``False``. - Depreciated. - -The ``__init__.py`` file -'''''''''''''''''''''''' - -To speed up the import time and minimize memory usage, numpy -uses ``ppimport`` hooks to transparently postpone importing large modules, -which might not be used during the Scipy session. In order to -have access to the documentation of all Scipy packages, including -postponed packages, the docstring from ``info.py`` is imported -into ``__init__.py``. - -The header of a typical ``__init__.py`` is:: - - # - # Package ... - ... - # - - from info import __doc__ - ... - - from numpy.testing import NumpyTest - test = NumpyTest().test - -The ``tests/`` directory -'''''''''''''''''''''''' - -Ideally, every Python code, extension module, or subpackage in Scipy -package directory should have the corresponding ``test_.py`` -file in ``tests/`` directory. This file should define classes -derived from the ``numpy.testing.TestCase`` class (or from -``unittest.TestCase``) and have names starting with ``test``. The methods -of these classes whose names contain ``test`` or start with ``bench`` are -automatically picked up by the test machinery. - -A minimal example of a ``test_yyy.py`` file that implements tests for -a NumPy package module ``numpy.xxx.yyy`` containing a function -``zzz()``, is shown below:: - - import sys - from numpy.testing import * - - # import xxx symbols - from numpy.xxx.yyy import zzz - - - class test_zzz(TestCase): - def test_simple(self, level=1): - assert zzz()=='Hello from zzz' - #... - - if __name__ == "__main__": - run_module_tests(file) - -Note that all classes that are inherited from ``TestCase`` class, are -automatically picked up by the test runner. - -``numpy.testing`` module provides also the following convenience -functions:: - - assert_equal(actual,desired,err_msg='',verbose=1) - assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=1) - assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=1) - assert_array_equal(x,y,err_msg='') - assert_array_almost_equal(x,y,decimal=6,err_msg='') - rand(*shape) # returns random array with a given shape - -To run all test scripts of the module ``xxx``, execute in Python: - - >>> import numpy - >>> numpy.xxx.test() - -To run only tests for ``xxx.yyy`` module, execute: - - >>> NumpyTest('xxx.yyy').test(level=1,verbosity=1) - -Extra features in NumPy Distutils -''''''''''''''''''''''''''''''''' - -Specifing config_fc options for libraries in setup.py script ------------------------------------------------------------- - -It is possible to specify config_fc options in setup.py scripts. -For example, using - - config.add_library('library', - sources=[...], - config_fc={'noopt':(__file__,1)}) - -will compile the ``library`` sources without optimization flags. - -It's recommended to specify only those config_fc options in such a way -that are compiler independent. - -Getting extra Fortran 77 compiler options from source ------------------------------------------------------ - -Some old Fortran codes need special compiler options in order to -work correctly. In order to specify compiler options per source -file, ``numpy.distutils`` Fortran compiler looks for the following -pattern:: - - CF77FLAGS() = - -in the first 20 lines of the source and use the ``f77flags`` for -specified type of the fcompiler (the first character ``C`` is optional). - -TODO: This feature can be easily extended for Fortran 90 codes as -well. Let us know if you would need such a feature. Deleted: trunk/numpy/doc/EXAMPLE_DOCSTRING.txt =================================================================== --- trunk/numpy/doc/EXAMPLE_DOCSTRING.txt 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/EXAMPLE_DOCSTRING.txt 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,104 +0,0 @@ -.. Here follows an example docstring for a C-function. Note that the - signature is given. This is done only for functions written is C, - since Python cannot find their signature by inspection. For all - other functions, start with the one line description. - - -multivariate_normal(mean, cov[, shape]) - -Draw samples from a multivariate normal distribution. - -The multivariate normal, multinormal or Gaussian distribution is a -generalisation of the one-dimensional normal distribution to higher -dimensions. - -Such a distribution is specified by its mean and covariance matrix, -which are analogous to the mean (average or "centre") and variance -(standard deviation squared or "width") of the one-dimensional normal -distribution. - -Parameters ----------- -mean : (N,) ndarray - Mean of the N-dimensional distribution. -cov : (N,N) ndarray - Covariance matrix of the distribution. -shape : tuple of ints, optional - Given a shape of, for example, (m,n,k), m*n*k samples are - generated, and packed in an m-by-n-by-k arrangement. Because each - sample is N-dimensional, the output shape is (m,n,k,N). If no - shape is specified, a single sample is returned. - -Returns -------- -out : ndarray - The drawn samples, arranged according to `shape`. If the - shape given is (m,n,...), then the shape of `out` is is - (m,n,...,N). - - In other words, each entry ``out[i,j,...,:]`` is an N-dimensional - value drawn from the distribution. - -See Also --------- -normal -scipy.stats.distributions.norm : Provides random variates, as well as - probability density function, cumulative - density function, etc. - -Notes ------ -The mean is a coordinate in N-dimensional space, which represents the -location where samples are most likely to be generated. This is -analogous to the peak of the bell curve for the one-dimensional or -univariate normal distribution. - -Covariance indicates the level to which two variables vary together. -From the multivariate normal distribution, we draw N-dimensional -samples, :math:`X = [x_1, x_2, ... x_N]`. The covariance matrix -element :math:`C_ij` is the covariance of :math:`x_i` and :math:`x_j`. -The element :math:`C_ii` is the variance of :math:`x_i` (i.e. its -"spread"). - -Instead of specifying the full covariance matrix, popular -approximations include: - - - Spherical covariance (`cov` is a multiple of the identity matrix) - - Diagonal covariance (`cov` has non-negative elements, and only on - the diagonal) - -This geometrical property can be seen in two dimensions by plotting -generated data-points: - ->>> mean = [0,0] ->>> cov = [[1,0],[0,100]] # diagonal covariance, points lie on x or y-axis ->>> x,y = np.random.multivariate_normal(mean,cov,5000).T - ->>> import matplotlib.pyplot as plt ->>> plt.plot(x,y,'x'); plt.axis('equal'); pyplot.show() - -Note that the covariance matrix must be non-negative definite. - -References ----------- -.. [1] A. Papoulis, "Probability, Random Variables, and Stochastic - Processes," 3rd ed., McGraw-Hill Companies, 1991 -.. [2] R.O. Duda, P.E. Hart, and D.G. Stork, "Pattern Classification," - 2nd ed., Wiley, 2001. - -Examples --------- ->>> mean = (1,2) ->>> cov = [[1,0],[1,0]] ->>> x = np.random.multivariate_normal(mean,cov,(3,3)) ->>> x.shape -(3, 3, 2) - -The following is probably true, given that 0.6 is roughly twice the -standard deviation: - ->>> print list( (x[0,0,:] - mean) < 0.6 ) -[True, True] - -.. index: - :refguide: random:distributions Deleted: trunk/numpy/doc/HOWTO_BUILD_DOCS.txt =================================================================== --- trunk/numpy/doc/HOWTO_BUILD_DOCS.txt 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/HOWTO_BUILD_DOCS.txt 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,71 +0,0 @@ -========================================= -Building the NumPy API and reference docs -========================================= - -Using Sphinx_ -------------- -`Download `_ -the builder. Follow the instructions in ``README.txt``. - - -Using Epydoc_ -------------- - -Currently, we recommend that you build epydoc from the trunk:: - - svn co https://epydoc.svn.sf.net/svnroot/epydoc/trunk/epydoc epydoc - cd epydoc/src - sudo python setup.py install - -The appearance of some elements can be changed in the epydoc.css -style sheet. - -Emphasized text appearance can be controlled by the definition of the -tag. For instance, to make them bold, insert:: - - em {font-weight: bold;} - -The variables' types are in a span of class rst-classifier, hence can be -changed by inserting something like:: - - span.rst-classifier {font-weight: normal;} - -The first line of the signature should **not** copy the signature unless -the function is written in C, in which case it is mandatory. If the function -signature is generic (uses ``*args`` or ``**kwds``), then a function signature -may be included. - -Use optional in the "type" field for parameters that are non-keyword -optional for C-functions. - -Epydoc depends on Docutils for reStructuredText parsing. You can -download Docutils from the `Docutils sourceforge -page. `_. The version in SVN is -broken, so use 0.4 or the patched version from Debian. You may also -be able to use a package manager like yum to install it:: - - $ sudo yum install python-docutils - - -Example -------- -Here is a short example module, -`plain text `_ -or -`rendered `_ in HTML. - -To try this yourself, simply download the example.py:: - - svn co http://svn.scipy.org/svn/numpy/trunk/numpy/doc/example.py . - -Then, run epydoc:: - - $ epydoc --docformat=restructuredtext example.py - -The output is placed in ``./html``, and may be viewed by loading the -``index.html`` file into your browser. - - - -.. _epydoc: http://epydoc.sourceforge.net/ -.. _sphinx: http://sphinx.pocoo.org Deleted: trunk/numpy/doc/HOWTO_DOCUMENT.txt =================================================================== --- trunk/numpy/doc/HOWTO_DOCUMENT.txt 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/HOWTO_DOCUMENT.txt 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,430 +0,0 @@ -==================================== -A Guide to NumPy/SciPy Documentation -==================================== - -.. Contents:: - -.. Note:: - - For an accompanying example, see `example.py - `_. - -Overview --------- -In general, we follow the standard Python style conventions as described here: - * `Style Guide for C Code `_ - * `Style Guide for Python Code `_ - * `Docstring Conventions `_ - -Additional PEPs of interest regarding documentation of code: - * `Docstring Processing Framework `_ - * `Docutils Design Specification `_ - -Use a code checker: - * `pylint `_ - * `pyflakes` easy_install pyflakes - * `pep8.py `_ - -The following import conventions are used throughout the NumPy source -and documentation:: - - import numpy as np - import scipy as sp - import matplotlib as mpl - import matplotlib.pyplot as plt - -It is not necessary to do ``import numpy as np`` at the beginning of -an example. However, some sub-modules, such as ``fft``, are not -imported by default, and you have to include them explicitly:: - - import numpy.fft - -after which you may use it:: - - np.fft.fft2(...) - -Docstring Standard ------------------- -A documentation string (docstring) is a string that describes a module, -function, class, or method definition. The docstring is a special attribute -of the object (``object.__doc__``) and, for consistency, is surrounded by -triple double quotes, i.e.:: - - """This is the form of a docstring. - - It can be spread over several lines. - - """ - -NumPy, SciPy_, and the scikits follow a common convention for -docstrings that provides for consistency, while also allowing our -toolchain to produce well-formatted reference guides. This document -describes the current community consensus for such a standard. If you -have suggestions for improvements, post them on the `numpy-discussion -list`_, together with the epydoc output. - -Our docstring standard uses `re-structured text (reST) -`_ syntax and is rendered -using tools like epydoc_ or sphinx_ (pre-processors that understand -the particular documentation style we are using). While a rich set of -markup is available, we limit ourselves to a very basic subset, in -order to provide docstrings that are easy to read on text-only -terminals. - -A guiding principle is that human readers of the text are given -precedence over contorting docstrings so our tools produce nice -output. Rather than sacrificing the readability of the docstrings, we -have written pre-processors to assist tools like epydoc_ and sphinx_ in -their task. - -Status ------- -We are busy converting existing docstrings to the new format, -expanding them where they are lacking, as well as writing new ones for -undocumented functions. Volunteers are welcome to join the effort on -our new documentation system (see the `Developer Zone -`_). - -Sections --------- -The sections of the docstring are: - -1. **Short summary** - - A one-line summary that does not use variable names or the function - name, e.g. - - :: - - def add(a,b): - """The sum of two numbers. - - """ - - The function signature is normally found by introspection and - displayed by the help function. For some functions (notably those - written in C) the signature is not available, so we have to specify - it as the first line of the docstring:: - - """ - add(a,b) - - The sum of two numbers. - - """ - -2. **Extended summary** - - A few sentences giving an extended description. This section - should be used to clarify *functionality*, not to discuss - implementation detail or background theory, which should rather be - explored in the **notes** section below. You may refer to the - parameters and the function name, but parameter descriptions still - belong in the **parameters** section. - -3. **Parameters** - - Description of the function arguments, keywords and their - respective types. - - :: - - Parameters - ---------- - x : type - Description of parameter `x`. - - Enclose variables in single back-tics. If it is not necessary to - specify a keyword argument, use ``optional``:: - - x : int, optional - - Optional keyword parameters have default values, which are - displayed as part of the function signature. They can also be - detailed in the description:: - - Description of parameter `x` (the default is -1, which implies summation - over all axes). - - When a parameter can only assume one of a fixed set of values, - those values can be listed in braces :: - - x : {True, False} - Description of `x`. - -4. **Returns** - - Explanation of the returned values and their types, of the same - format as **parameters**. - -5. **Other parameters** - - An optional section used to describe infrequently used parameters. - It should only be used if a function has a large number of keyword - prameters, to prevent cluttering the **parameters** section. - -6. **Raises** - - An optional section detailing which errors get raised and under - what conditions:: - - Raises - ------ - LinAlgException - If the matrix is not numerically invertible. - -7. **See Also** - - An optional section used to refer to related code. This section - can be very useful, but should be used judiciously. The goal is to - direct users to other functions they may not be aware of, or have - easy means of discovering (by looking at the module docstring, for - example). Routines whose docstrings further explain parameters - used by this function are good candidates. - - As an example, for ``numpy.mean`` we would have:: - - See Also - -------- - average : Weighted average - - When referring to functions in the same sub-module, no prefix is - needed, and the tree is searched upwards for a match. - - Prefix functions from other sub-modules appropriately. E.g., - whilst documenting the ``random`` module, refer to a function in - ``fft`` by - - :: - - fft.fft2 : 2-D fast discrete Fourier transform - - When referring to an entirely different module:: - - scipy.random.norm : Random variates, PDFs, etc. - - Functions may be listed without descriptions:: - - See Also - -------- - func_a : Function a with its description. - func_b, func_c_, func_d - func_e - -8. **Notes** - - An optional section that provides additional information about the - code, possibly including a discussion of the algorithm. This - section may include mathematical equations, written in - `LaTeX `_ format:: - - The FFT is a fast implementation of the discrete Fourier transform: - - .. math:: X(e^{j\omega } ) = x(n)e^{ - j\omega n} - - Equations can also be typeset underneath the math directive:: - - The discrete-time Fourier time-convolution property states that - - .. math:: - - x(n) * y(n) \Leftrightarrow X(e^{j\omega } )Y(e^{j\omega } )\\ - another equation here - - Math can furthermore be used inline, i.e. - - :: - - The value of :math:`\omega` is larger than 5. - - Variable names are displayed in typewriter font, obtained by using - ``\mathtt{var}``:: - - We square the input parameter `alpha` to obtain - :math:`\mathtt{alpha}^2`. - - Note that LaTeX is not particularly easy to read, so use equations - sparingly. - - Images are allowed, but should not be central to the explanation; - users viewing the docstring as text must be able to comprehend its - meaning without resorting to an image viewer. These additional - illustrations are included using:: - - .. image:: filename - - where filename is a path relative to the reference guide source - directory. - -9. **References** - - References cited in the **notes** section may be listed here, - e.g. if you cited the article below using the text ``[1]_``, - include it as in the list as follows:: - - .. [1] O. McNoleg, "The integration of GIS, remote sensing, - expert systems and adaptive co-kriging for environmental habitat - modelling of the Highland Haggis using object-oriented, fuzzy-logic - and neural-network techniques," Computers & Geosciences, vol. 22, - pp. 585-588, 1996. - - which renders as - - .. [1] O. McNoleg, "The integration of GIS, remote sensing, - expert systems and adaptive co-kriging for environmental habitat - modelling of the Highland Haggis using object-oriented, fuzzy-logic - and neural-network techniques," Computers & Geosciences, vol. 22, - pp. 585-588, 1996. - - Referencing sources of a temporary nature, like web pages, is - discouraged. References are meant to augment the docstring, but - should not be required to understand it. Follow the `citation - format of the IEEE - `_, which - states that references are numbered, starting from one, in the - order in which they are cited. - -10. **Examples** - - An optional section for examples, using the `doctest - `_ format. - This section is meant to illustrate usage, not to provide a - testing framework -- for that, use the ``tests/`` directory. - While optional, this section is very strongly encouraged. You can - run these examples by doing:: - - >>> import doctest - >>> doctest.testfile('example.py') - - or, using nose, - - :: - - $ nosetests --with-doctest example.py - - Blank lines are used to seperate doctests. When they occur in the - expected output, they should be replaced by ```` (see - `doctest options - `_ for other such - special strings), e.g. - - :: - - >>> print "a\n\nb" - a - - b - - The examples may assume that ``import numpy as np`` is executed before - the example code in *numpy*, and ``import scipy as sp`` in *scipy*. - Additional examples may make use of *matplotlib* for plotting, but should - import it explicitly, e.g., ``import matplotlib.pyplot as plt``. - -11. **Indexing tags*** - - Each function needs to be categorised for indexing purposes. Use - the ``index`` directive:: - - .. index:: - :refguide: ufunc, trigonometry - - To index a function as a sub-category of a class, separate index - entries by a colon, e.g. - - :: - - :refguide: ufunc, numpy:reshape, other - - A `list of available categories - `_ is - available. - -Documenting classes -------------------- - -Class docstring -``````````````` -Use the same sections as outlined above (all except ``Returns`` are -applicable). The constructor (``__init__``) should also be documented -here. - -An ``Attributes`` section may be used to describe class variables:: - - Attributes - ---------- - x : float - The X coordinate. - y : float - The Y coordinate. - -In general, it is not necessary to list class methods. Those that are -not part of the public API have names that start with an underscore. -In some cases, however, a class may have a great many methods, of -which only a few are relevant (e.g., subclasses of ndarray). Then, it -becomes useful to have an additional ``Methods`` section:: - - class Photo(ndarray): - """ - Array with associated photographic information. - - ... - - Attributes - ---------- - exposure : float - Exposure in seconds. - - Methods - ------- - colorspace(c='rgb') - Represent the photo in the given colorspace. - gamma(n=1.0) - Change the photo's gamma exposure. - - """ - -Note that `self` is *not* listed as the first parameter of methods. - -Method docstrings -````````````````` -Document these as you would any other function. Do not include -``self`` in the list of parameters. - -Common reST concepts --------------------- -For paragraphs, indentation is significant and indicates indentation in the -output. New paragraphs are marked with a blank line. - -Use *italics*, **bold**, and ``courier`` if needed in any explanations -(but not for variable names and doctest code or multi-line code). -Variable, module and class names should be written between single -backticks (```numpy```). - -A more extensive example of reST markup can be found in `this example -document `_; -the `quick reference -`_ is -useful while editing. - -Line spacing and indentation are significant and should be carefully -followed. - -Conclusion ----------- - -`An example -`_ of the -format shown here is available. Refer to `How to Build API/Reference -Documentation -`_ -on how to use epydoc_ or sphinx_ to construct a manual and web page. - -This document itself was written in ReStructuredText, and may be converted to -HTML using:: - - $ rst2html HOWTO_DOCUMENT.txt HOWTO_DOCUMENT.html - -.. _SciPy: http://www.scipy.org -.. _numpy-discussion list: http://www.scipy.org/Mailing_Lists -.. _epydoc: http://epydoc.sourceforge.net/ -.. _sphinx: http://sphinx.pocoo.org Deleted: trunk/numpy/doc/README.txt =================================================================== --- trunk/numpy/doc/README.txt 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/README.txt 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,15 +0,0 @@ -Very complete documentation is available from the primary developer of -NumPy for a small fee. After a brief period, that documentation -will become freely available. See http://www.trelgol.com for -details. The fee and restriction period is intended to allow people -and to encourage companies to easily contribute to the development of -NumPy. - -This directory will contain all public documentation that becomes available. - -Very good documentation is also available using Python's (and -especially IPython's) own help system. Most of the functions have -docstrings that provide usage assistance. - - - Modified: trunk/numpy/doc/__init__.py =================================================================== --- trunk/numpy/doc/__init__.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/__init__.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,2 +1,12 @@ -from numpy.doc.reference import * -del reference +import os + +ref_dir = os.path.join(os.path.dirname(__file__)) + +__all__ = [f[:-3] for f in os.listdir(ref_dir) if f.endswith('.py') and + not f.startswith('__')] +__all__.sort() + +__doc__ = 'The following topics are available:\n' + \ + '\n - '.join([''] + __all__) + +__all__.extend(['__doc__']) Copied: trunk/numpy/doc/basics.py (from rev 5669, trunk/numpy/doc/reference/basics.py) Copied: trunk/numpy/doc/broadcasting.py (from rev 5669, trunk/numpy/doc/reference/broadcasting.py) Copied: trunk/numpy/doc/creation.py (from rev 5669, trunk/numpy/doc/reference/creation.py) Deleted: trunk/numpy/doc/example.py =================================================================== --- trunk/numpy/doc/example.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/example.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,125 +0,0 @@ -"""This is the docstring for the example.py module. Modules names should -have short, all-lowercase names. The module name may have underscores if -this improves readability. - -Every module should have a docstring at the very top of the file. The -module's docstring may extend over multiple lines. If your docstring does -extend over multiple lines, the closing three quotation marks must be on -a line by itself, preferably preceeded by a blank line. - -""" -import os # standard library imports first - -# Do NOT import using *, e.g. from numpy import * -# -# Import the module using -# -# import numpy -# -# instead or import individual functions as needed, e.g -# -# from numpy import array, zeros -# -# If you prefer the use of abbreviated module names, we suggest the -# convention used by NumPy itself:: - -import numpy as np -import scipy as sp -import matplotlib as mpl -import matplotlib.pyplot as plt - -# These abbreviated names are not to be used in docstrings; users must -# be able to paste and execute docstrings after importing only the -# numpy module itself, unabbreviated. - -from my_module import my_func, other_func - -def foo(var1, var2, long_var_name='hi') : - """A one-line summary that does not use variable names or the - function name. - - Several sentences providing an extended description. Refer to - variables using back-ticks, e.g. `var`. - - Parameters - ---------- - var1 : array_like - Array_like means all those objects -- lists, nested lists, etc. -- - that can be converted to an array. We can also refer to - variables like `var1`. - var2 : int - The type above can either refer to an actual Python type - (e.g. ``int``), or describe the type of the variable in more - detail, e.g. ``(N,) ndarray`` or ``array_like``. - Long_variable_name : {'hi', 'ho'}, optional - Choices in brackets, default first when optional. - - Returns - ------- - describe : type - Explanation - output - Explanation - tuple - Explanation - items - even more explaining - - Other Parameters - ---------------- - only_seldom_used_keywords : type - Explanation - common_parameters_listed_above : type - Explanation - - Raises - ------ - BadException - Because you shouldn't have done that. - - See Also - -------- - otherfunc : relationship (optional) - newfunc : Relationship (optional), which could be fairly long, in which - case the line wraps here. - thirdfunc, fourthfunc, fifthfunc - - Notes - ----- - Notes about the implementation algorithm (if needed). - - This can have multiple paragraphs. - - You may include some math: - - .. math:: X(e^{j\omega } ) = x(n)e^{ - j\omega n} - - And even use a greek symbol like :math:`omega` inline. - - References - ---------- - Cite the relevant literature, e.g. [1]_. You may also cite these - references in the notes section above. - - .. [1] O. McNoleg, "The integration of GIS, remote sensing, - expert systems and adaptive co-kriging for environmental habitat - modelling of the Highland Haggis using object-oriented, fuzzy-logic - and neural-network techniques," Computers & Geosciences, vol. 22, - pp. 585-588, 1996. - - Examples - -------- - These are written in doctest format, and should illustrate how to - use the function. - - >>> a=[1,2,3] - >>> print [x + 3 for x in a] - [4, 5, 6] - >>> print "a\n\nb" - a - - b - - """ - - pass Copied: trunk/numpy/doc/glossary.py (from rev 5669, trunk/numpy/doc/reference/glossary.py) Copied: trunk/numpy/doc/howtofind.py (from rev 5669, trunk/numpy/doc/reference/howtofind.py) Copied: trunk/numpy/doc/indexing.py (from rev 5669, trunk/numpy/doc/reference/indexing.py) Copied: trunk/numpy/doc/internals.py (from rev 5669, trunk/numpy/doc/reference/internals.py) Copied: trunk/numpy/doc/io.py (from rev 5669, trunk/numpy/doc/reference/io.py) Copied: trunk/numpy/doc/jargon.py (from rev 5669, trunk/numpy/doc/reference/jargon.py) Copied: trunk/numpy/doc/methods_vs_functions.py (from rev 5669, trunk/numpy/doc/reference/methods_vs_functions.py) Copied: trunk/numpy/doc/misc.py (from rev 5669, trunk/numpy/doc/reference/misc.py) Deleted: trunk/numpy/doc/npy-format.txt =================================================================== --- trunk/numpy/doc/npy-format.txt 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/npy-format.txt 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,294 +0,0 @@ -Title: A Simple File Format for NumPy Arrays -Discussions-To: numpy-discussion at mail.scipy.org -Version: $Revision$ -Last-Modified: $Date$ -Author: Robert Kern -Status: Draft -Type: Standards Track -Content-Type: text/plain -Created: 20-Dec-2007 - - -Abstract - - We propose a standard binary file format (NPY) for persisting - a single arbitrary NumPy array on disk. The format stores all of - the shape and dtype information necessary to reconstruct the array - correctly even on another machine with a different architecture. - The format is designed to be as simple as possible while achieving - its limited goals. The implementation is intended to be pure - Python and distributed as part of the main numpy package. - - -Rationale - - A lightweight, omnipresent system for saving NumPy arrays to disk - is a frequent need. Python in general has pickle [1] for saving - most Python objects to disk. This often works well enough with - NumPy arrays for many purposes, but it has a few drawbacks: - - - Dumping or loading a pickle file require the duplication of the - data in memory. For large arrays, this can be a showstopper. - - - The array data is not directly accessible through - memory-mapping. Now that numpy has that capability, it has - proved very useful for loading large amounts of data (or more to - the point: avoiding loading large amounts of data when you only - need a small part). - - Both of these problems can be addressed by dumping the raw bytes - to disk using ndarray.tofile() and numpy.fromfile(). However, - these have their own problems: - - - The data which is written has no information about the shape or - dtype of the array. - - - It is incapable of handling object arrays. - - The NPY file format is an evolutionary advance over these two - approaches. Its design is mostly limited to solving the problems - with pickles and tofile()/fromfile(). It does not intend to solve - more complicated problems for which more complicated formats like - HDF5 [2] are a better solution. - - -Use Cases - - - Neville Newbie has just started to pick up Python and NumPy. He - has not installed many packages, yet, nor learned the standard - library, but he has been playing with NumPy at the interactive - prompt to do small tasks. He gets a result that he wants to - save. - - - Annie Analyst has been using large nested record arrays to - represent her statistical data. She wants to convince her - R-using colleague, David Doubter, that Python and NumPy are - awesome by sending him her analysis code and data. She needs - the data to load at interactive speeds. Since David does not - use Python usually, needing to install large packages would turn - him off. - - - Simon Seismologist is developing new seismic processing tools. - One of his algorithms requires large amounts of intermediate - data to be written to disk. The data does not really fit into - the industry-standard SEG-Y schema, but he already has a nice - record-array dtype for using it internally. - - - Polly Parallel wants to split up a computation on her multicore - machine as simply as possible. Parts of the computation can be - split up among different processes without any communication - between processes; they just need to fill in the appropriate - portion of a large array with their results. Having several - child processes memory-mapping a common array is a good way to - achieve this. - - -Requirements - - The format MUST be able to: - - - Represent all NumPy arrays including nested record - arrays and object arrays. - - - Represent the data in its native binary form. - - - Be contained in a single file. - - - Support Fortran-contiguous arrays directly. - - - Store all of the necessary information to reconstruct the array - including shape and dtype on a machine of a different - architecture. Both little-endian and big-endian arrays must be - supported and a file with little-endian numbers will yield - a little-endian array on any machine reading the file. The - types must be described in terms of their actual sizes. For - example, if a machine with a 64-bit C "long int" writes out an - array with "long ints", a reading machine with 32-bit C "long - ints" will yield an array with 64-bit integers. - - - Be reverse engineered. Datasets often live longer than the - programs that created them. A competent developer should be - able create a solution in his preferred programming language to - read most NPY files that he has been given without much - documentation. - - - Allow memory-mapping of the data. - - - Be read from a filelike stream object instead of an actual file. - This allows the implementation to be tested easily and makes the - system more flexible. NPY files can be stored in ZIP files and - easily read from a ZipFile object. - - - Store object arrays. Since general Python objects are - complicated and can only be reliably serialized by pickle (if at - all), many of the other requirements are waived for files - containing object arrays. Files with object arrays do not have - to be mmapable since that would be technically impossible. We - cannot expect the pickle format to be reverse engineered without - knowledge of pickle. However, one should at least be able to - read and write object arrays with the same generic interface as - other arrays. - - - Be read and written using APIs provided in the numpy package - itself without any other libraries. The implementation inside - numpy may be in C if necessary. - - The format explicitly *does not* need to: - - - Support multiple arrays in a file. Since we require filelike - objects to be supported, one could use the API to build an ad - hoc format that supported multiple arrays. However, solving the - general problem and use cases is beyond the scope of the format - and the API for numpy. - - - Fully handle arbitrary subclasses of numpy.ndarray. Subclasses - will be accepted for writing, but only the array data will be - written out. A regular numpy.ndarray object will be created - upon reading the file. The API can be used to build a format - for a particular subclass, but that is out of scope for the - general NPY format. - - -Format Specification: Version 1.0 - - The first 6 bytes are a magic string: exactly "\x93NUMPY". - - The next 1 byte is an unsigned byte: the major version number of - the file format, e.g. \x01. - - The next 1 byte is an unsigned byte: the minor version number of - the file format, e.g. \x00. Note: the version of the file format - is not tied to the version of the numpy package. - - The next 2 bytes form a little-endian unsigned short int: the - length of the header data HEADER_LEN. - - The next HEADER_LEN bytes form the header data describing the - array's format. It is an ASCII string which contains a Python - literal expression of a dictionary. It is terminated by a newline - ('\n') and padded with spaces ('\x20') to make the total length of - the magic string + 4 + HEADER_LEN be evenly divisible by 16 for - alignment purposes. - - The dictionary contains three keys: - - "descr" : dtype.descr - An object that can be passed as an argument to the - numpy.dtype() constructor to create the array's dtype. - - "fortran_order" : bool - Whether the array data is Fortran-contiguous or not. - Since Fortran-contiguous arrays are a common form of - non-C-contiguity, we allow them to be written directly to - disk for efficiency. - - "shape" : tuple of int - The shape of the array. - - For repeatability and readability, this dictionary is formatted - using pprint.pformat() so the keys are in alphabetic order. - - Following the header comes the array data. If the dtype contains - Python objects (i.e. dtype.hasobject is True), then the data is - a Python pickle of the array. Otherwise the data is the - contiguous (either C- or Fortran-, depending on fortran_order) - bytes of the array. Consumers can figure out the number of bytes - by multiplying the number of elements given by the shape (noting - that shape=() means there is 1 element) by dtype.itemsize. - - -Conventions - - We recommend using the ".npy" extension for files following this - format. This is by no means a requirement; applications may wish - to use this file format but use an extension specific to the - application. In the absence of an obvious alternative, however, - we suggest using ".npy". - - For a simple way to combine multiple arrays into a single file, - one can use ZipFile to contain multiple ".npy" files. We - recommend using the file extension ".npz" for these archives. - - -Alternatives - - The author believes that this system (or one along these lines) is - about the simplest system that satisfies all of the requirements. - However, one must always be wary of introducing a new binary - format to the world. - - HDF5 [2] is a very flexible format that should be able to - represent all of NumPy's arrays in some fashion. It is probably - the only widely-used format that can faithfully represent all of - NumPy's array features. It has seen substantial adoption by the - scientific community in general and the NumPy community in - particular. It is an excellent solution for a wide variety of - array storage problems with or without NumPy. - - HDF5 is a complicated format that more or less implements - a hierarchical filesystem-in-a-file. This fact makes satisfying - some of the Requirements difficult. To the author's knowledge, as - of this writing, there is no application or library that reads or - writes even a subset of HDF5 files that does not use the canonical - libhdf5 implementation. This implementation is a large library - that is not always easy to build. It would be infeasible to - include it in numpy. - - It might be feasible to target an extremely limited subset of - HDF5. Namely, there would be only one object in it: the array. - Using contiguous storage for the data, one should be able to - implement just enough of the format to provide the same metadata - that the proposed format does. One could still meet all of the - technical requirements like mmapability. - - We would accrue a substantial benefit by being able to generate - files that could be read by other HDF5 software. Furthermore, by - providing the first non-libhdf5 implementation of HDF5, we would - be able to encourage more adoption of simple HDF5 in applications - where it was previously infeasible because of the size of the - library. The basic work may encourage similar dead-simple - implementations in other languages and further expand the - community. - - The remaining concern is about reverse engineerability of the - format. Even the simple subset of HDF5 would be very difficult to - reverse engineer given just a file by itself. However, given the - prominence of HDF5, this might not be a substantial concern. - - In conclusion, we are going forward with the design laid out in - this document. If someone writes code to handle the simple subset - of HDF5 that would be useful to us, we may consider a revision of - the file format. - - -Implementation - - The current implementation is in the trunk of the numpy SVN - repository and will be part of the 1.0.5 release. - - http://svn.scipy.org/svn/numpy/trunk - - Specifically, the file format.py in this directory implements the - format as described here. - - -References - - [1] http://docs.python.org/lib/module-pickle.html - - [2] http://hdf.ncsa.uiuc.edu/products/hdf5/index.html - - -Copyright - - This document has been placed in the public domain. - - - -Local Variables: -mode: indented-text -indent-tabs-mode: nil -sentence-end-double-space: t -fill-column: 70 -coding: utf-8 -End: Deleted: trunk/numpy/doc/pep_buffer.txt =================================================================== --- trunk/numpy/doc/pep_buffer.txt 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/pep_buffer.txt 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,869 +0,0 @@ -:PEP: 3118 -:Title: Revising the buffer protocol -:Version: $Revision$ -:Last-Modified: $Date$ -:Authors: Travis Oliphant , Carl Banks -: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. - - 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:' <--> ((int, int, int), ('r','g','b')) - -Mixed endian (weird but possible) - '>i:big: ((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 Copied: trunk/numpy/doc/performance.py (from rev 5669, trunk/numpy/doc/reference/performance.py) Deleted: trunk/numpy/doc/records.txt =================================================================== --- trunk/numpy/doc/records.txt 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/records.txt 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,87 +0,0 @@ - -The ndarray supports records intrinsically. None of the default -descriptors have fields defined, but you can create new descriptors -easily. The ndarray even supports nested arrays of records inside of -a record. Any record that the array protocol can describe can be -represented. The ndarray also supports partial field descriptors. -Not every byte has to be accounted for. - -This was done by adding to the established ``PyArray_Descr *`` structure: - -1. A PyObject ``*fields`` member which contains a dictionary of "field - name" : (``PyArray_Descr`` ``*field-type``, ``offset``, [optional field - title]). If a title is given, then it is also inserted into the - dictionary and used to key the same entry. - -2. A byteorder member. By default this is '=' (native), or '|' - (not-applicable). - -3. An additional ``PyArray_ArrDescr`` ``*member`` of the structure which - contains a simple representation of an array of another base-type. - types. The ``PyArray_ArrayDescr`` structure has members - ``PyArray_Descr *``, ``PyObject *``, for holding a reference to - the base-type and the shape of the sub-array. - -4. The ``PyArray_Descr *`` as official Python object that fully describes - a region of memory for the data - - -Data type conversions ---------------------- - -We can support additional data-type -conversions. The data-type passed in is converted to a -``PyArray_Descr *`` object. - -New possibilities for the "data-type" -````````````````````````````````````` - -**List [data-type 1, data-type 2, ..., data-type n]** - Equivalent to {'names':['f1','f2',...,'fn'], - 'formats': [data-type 1, data-type 2, ..., data-type n]} - - This is a quick way to specify a record format with default field names. - - -**Tuple (flexible type, itemsize) (fixed type, shape)** - Get converted to a new ``PyArray_Descr *`` object with a flexible - type. The latter structure also sets the ``PyArray_ArrayDescr`` field of the - returned ``PyArray_Descr *``. - - -**Dictionary (keys "names", "titles", and "formats")** - This will be converted to a ``PyArray_VOID`` type with corresponding - fields parameter (the formats list will be converted to actual - ``PyArray_Descr *`` objects). - - -**Objects (anything with an .itemsize and .fields attribute)** - If its an instance of (a sub-class of) void type, then a new - ``PyArray_Descr*`` structure is created corresponding to its - typeobject (and ``PyArray_VOID``) typenumber. If the type is - registered, then the registered type-number is used. - - Otherwise a new ``PyArray_VOID PyArray_Descr*`` structure is created - and filled ->elsize and ->fields filled in appropriately. - - The itemsize attribute must return a number > 0. The fields - attribute must return a dictionary with at least "names" and - "formats" entries. The "formats" entry will be converted to a - "proper" descr->fields entry (all generic data-types converted to - ``PyArray_Descr *`` structure). - - -Reference counting for ``PyArray_Descr *`` objects. -``````````````````````````````````````````````````` - -Most functions that take ``PyArary_Descr *`` as arguments and return a -``PyObject *`` steal the reference unless otherwise noted in the code: - -Functions that return ``PyArray_Descr *`` objects return a new -reference. - -.. tip:: - - There is a new function and a new method of array objects both labelled - dtypescr which can be used to try out the ``PyArray_DescrConverter``. - Deleted: trunk/numpy/doc/reference/basics.py =================================================================== --- trunk/numpy/doc/reference/basics.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/basics.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,137 +0,0 @@ -""" -============ -Array basics -============ - -Array types and conversions between types -========================================= - -Numpy supports a much greater variety of numerical types than Python does. -This section shows which are available, and how to modify an array's data-type. - -========== ========================================================= -Data type Description -========== ========================================================= -bool Boolean (True or False) stored as a byte -int Platform integer (normally either ``int32`` or ``int64``) -int8 Byte (-128 to 127) -int16 Integer (-32768 to 32767) -int32 Integer (-2147483648 to 2147483647) -int64 Integer (9223372036854775808 to 9223372036854775807) -uint8 Unsigned integer (0 to 255) -uint16 Unsigned integer (0 to 65535) -uint32 Unsigned integer (0 to 4294967295) -uint64 Unsigned integer (0 to 18446744073709551615) -float Shorthand for ``float64``. -float32 Single precision float: sign bit, 8 bits exponent, - 23 bits mantissa -float64 Double precision float: sign bit, 11 bits exponent, - 52 bits mantissa -complex Shorthand for ``complex128``. -complex64 Complex number, represented by two 32-bit floats (real - and imaginary components) -complex128 Complex number, represented by two 64-bit floats (real - and imaginary components) -========== ========================================================= - -Numpy numerical types are instances of ``dtype`` (data-type) objects, each -having unique characteristics. Once you have imported NumPy using - - :: - - >>> import numpy as np - -the dtypes are available as ``np.bool``, ``np.float32``, etc. - -Advanced types, not listed in the table above, are explored in -section `link_here`. - -There are 5 basic numerical types representing booleans (bool), integers (int), -unsigned integers (uint) floating point (float) and complex. Those with numbers -in their name indicate the bitsize of the type (i.e. how many bits are needed -to represent a single value in memory). Some types, such as ``int`` and -``intp``, have differing bitsizes, dependent on the platforms (e.g. 32-bit -vs. 64-bit machines). This should be taken into account when interfacing -with low-level code (such as C or Fortran) where the raw memory is addressed. - -Data-types can be used as functions to convert python numbers to array scalars -(see the array scalar section for an explanation), python sequences of numbers -to arrays of that type, or as arguments to the dtype keyword that many numpy -functions or methods accept. Some examples:: - - >>> import numpy as np - >>> x = np.float32(1.0) - >>> x - 1.0 - >>> y = np.int_([1,2,4]) - >>> y - array([1, 2, 4]) - >>> z = np.arange(3, dtype=np.uint8) - array([0, 1, 2], dtype=uint8) - -Array types can also be referred to by character codes, mostly to retain -backward compatibility with older packages such as Numeric. Some -documentation may still refer to these, for example:: - - >>> np.array([1, 2, 3], dtype='f') - array([ 1., 2., 3.], dtype=float32) - -We recommend using dtype objects instead. - -To convert the type of an array, use the .astype() method (preferred) or -the type itself as a function. For example: :: - - >>> z.astype(float) - array([0., 1., 2.]) - >>> np.int8(z) - array([0, 1, 2], dtype=int8) - -Note that, above, we use the *Python* float object as a dtype. NumPy knows -that ``int`` refers to ``np.int``, ``bool`` means ``np.bool`` and -that ``float`` is ``np.float``. The other data-types do not have Python -equivalents. - -To determine the type of an array, look at the dtype attribute:: - - >>> z.dtype - dtype('uint8') - -dtype objects also contain information about the type, such as its bit-width -and its byte-order. See xxx for details. The data type can also be used -indirectly to query properties of the type, such as whether it is an integer:: - - >>> d = np.dtype(int) - >>> d - dtype('int32') - - >>> np.issubdtype(d, int) - True - - >>> np.issubdtype(d, float) - False - - -Array Scalars -============= - -Numpy generally returns elements of arrays as array scalars (a scalar -with an associated dtype). Array scalars differ from Python scalars, but -for the most part they can be used interchangeably (the primary -exception is for versions of Python older than v2.x, where integer array -scalars cannot act as indices for lists and tuples). There are some -exceptions, such as when code requires very specific attributes of a scalar -or when it checks specifically whether a value is a Python scalar. Generally, -problems are easily fixed by explicitly converting array scalars -to Python scalars, using the corresponding Python type function -(e.g., ``int``, ``float``, ``complex``, ``str``, ``unicode``). - -The primary advantage of using array scalars is that -they preserve the array type (Python may not have a matching scalar type -available, e.g. ``int16``). Therefore, the use of array scalars ensures -identical behaviour between arrays and scalars, irrespective of whether the -value is inside an array or not. NumPy scalars also have many of the same -methods arrays do. - -See xxx for details. - -""" Deleted: trunk/numpy/doc/reference/broadcasting.py =================================================================== --- trunk/numpy/doc/reference/broadcasting.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/broadcasting.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,176 +0,0 @@ -""" -======================== -Broadcasting over arrays -======================== - -The term broadcasting describes how numpy treats arrays with different -shapes during arithmetic operations. Subject to certain constraints, -the smaller array is "broadcast" across the larger array so that they -have compatible shapes. Broadcasting provides a means of vectorizing -array operations so that looping occurs in C instead of Python. It does -this without making needless copies of data and usually leads to -efficient algorithm implementations. There are, however, cases where -broadcasting is a bad idea because it leads to inefficient use of memory -that slows computation. - -NumPy operations are usually done element-by-element, which requires two -arrays to have exactly the same shape:: - - >>> a = np.array([1.0, 2.0, 3.0]) - >>> b = np.array([2.0, 2.0, 2.0]) - >>> a * b - array([ 2., 4., 6.]) - -NumPy's broadcasting rule relaxes this constraint when the arrays' -shapes meet certain constraints. The simplest broadcasting example occurs -when an array and a scalar value are combined in an operation: - ->>> a = np.array([1.0, 2.0, 3.0]) ->>> b = 2.0 ->>> a * b -array([ 2., 4., 6.]) - -The result is equivalent to the previous example where ``b`` was an array. -We can think of the scalar ``b`` being *stretched* during the arithmetic -operation into an array with the same shape as ``a``. The new elements in -``b`` are simply copies of the original scalar. The stretching analogy is -only conceptual. NumPy is smart enough to use the original scalar value -without actually making copies, so that broadcasting operations are as -memory and computationally efficient as possible. - -The second example is more effective than the first, since here broadcasting -moves less memory around during the multiplication (``b`` is a scalar, -not an array). - -General Broadcasting Rules -========================== -When operating on two arrays, NumPy compares their shapes element-wise. -It starts with the trailing dimensions, and works its way forward. Two -dimensions are compatible when - -1) they are equal, or -2) one of them is 1 - -If these conditions are not met, a -``ValueError: frames are not aligned`` exception is thrown, indicating that -the arrays have incompatible shapes. The size of the resulting array -is the maximum size along each dimension of the input arrays. - -Arrays do not need to have the same *number* of dimensions. For example, -if you have a ``256x256x3`` array of RGB values, and you want to scale -each color in the image by a different value, you can multiply the image -by a one-dimensional array with 3 values. Lining up the sizes of the -trailing axes of these arrays according to the broadcast rules, shows that -they are compatible:: - - Image (3d array): 256 x 256 x 3 - 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" -to match the other. - -In the following example, both the ``A`` and ``B`` arrays have axes with -length one that are expanded to a larger size during the broadcast -operation:: - - A (4d array): 8 x 1 x 6 x 1 - B (3d array): 7 x 1 x 5 - Result (4d array): 8 x 7 x 6 x 5 - -Here are some more examples:: - - A (2d array): 5 x 4 - B (1d array): 1 - Result (2d array): 5 x 4 - - A (2d array): 5 x 4 - B (1d array): 4 - Result (2d array): 5 x 4 - - A (3d array): 15 x 3 x 5 - B (3d array): 15 x 1 x 5 - Result (3d array): 15 x 3 x 5 - - A (3d array): 15 x 3 x 5 - B (2d array): 3 x 5 - Result (3d array): 15 x 3 x 5 - - A (3d array): 15 x 3 x 5 - B (2d array): 3 x 1 - Result (3d array): 15 x 3 x 5 - -Here are examples of shapes that do not broadcast:: - - A (1d array): 3 - B (1d array): 4 # trailing dimensions do not match - - A (2d array): 2 x 1 - B (3d array): 8 x 4 x 3 # second from last dimensions mismatch - -An example of broadcasting in practice:: - - >>> x = np.arange(4) - >>> xx = x.reshape(4,1) - >>> y = np.ones(5) - >>> z = np.ones((3,4)) - - >>> x.shape - (4,) - - >>> y.shape - (5,) - - >>> x + y - : shape mismatch: objects cannot be broadcast to a single shape - - >>> xx.shape - (4, 1) - - >>> y.shape - (5,) - - >>> (xx + y).shape - (4, 5) - - >>> xx + y - array([[ 1., 1., 1., 1., 1.], - [ 2., 2., 2., 2., 2.], - [ 3., 3., 3., 3., 3.], - [ 4., 4., 4., 4., 4.]]) - - >>> x.shape - (4,) - - >>> z.shape - (3, 4) - - >>> (x + z).shape - (3, 4) - - >>> x + z - array([[ 1., 2., 3., 4.], - [ 1., 2., 3., 4.], - [ 1., 2., 3., 4.]]) - -Broadcasting provides a convenient way of taking the outer product (or -any other outer operation) of two arrays. The following example shows an -outer addition operation of two 1-d arrays:: - - >>> a = np.array([0.0, 10.0, 20.0, 30.0]) - >>> b = np.array([1.0, 2.0, 3.0]) - >>> a[:, np.newaxis] + b - array([[ 1., 2., 3.], - [ 11., 12., 13.], - [ 21., 22., 23.], - [ 31., 32., 33.]]) - -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 `_ -for illustrations of broadcasting concepts. - -""" Deleted: trunk/numpy/doc/reference/creation.py =================================================================== --- trunk/numpy/doc/reference/creation.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/creation.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,132 +0,0 @@ -""" -============== -Array creation -============== - -Introduction -============ - -There are 5 general mechanisms for creating arrays: - -1) Conversion from other Python structures (e.g., lists, tuples) -2) Intrinsic numpy array array creation objects (e.g., arange, ones, zeros, etc.) -3) Reading arrays from disk, either from standard or custom formats -4) Creating arrays from raw bytes through the use of strings or buffers -5) Use of special library functions (e.g., random) - -This section will not cover means of replicating, joining, or otherwise -expanding or mutating existing arrays. Nor will it cover creating object -arrays or record arrays. Both of those are covered in their own sections. - -Converting Python array-like objects to numpy arrays -==================================================== - -In general, numerical data arranged in an array-like structure in Python can -be converted to arrays through the use of the array() function. The most obvious -examples are lists and tuples. See the documentation for array() for details for -its use. Some -objects may support the array-protocol and allow conversion to arrays this -way. A simple way to find out if the object can be converted to a numpy array -using array() is simply to try it interactively and see if it works! (The -Python Way). - -Examples: :: - - >>> x = np.array([2,3,1,0]) - >>> x = np.array([2, 3, 1, 0]) - >>> x = np.array([[1,2.0],[0,0],(1+1j,3.)]) # note mix of tuple and lists, and types - >>> x = np.array([[ 1.+0.j, 2.+0.j], [ 0.+0.j, 0.+0.j], [ 1.+1.j, 3.+0.j]]) - -Intrinsic numpy array creation -============================== - -Numpy has built-in functions for creating arrays from scratch: - -zeros(shape) will create an array filled with 0 values with the specified -shape. The default dtype is float64. - -``>>> np.zeros((2, 3)) -array([[ 0., 0., 0.], [ 0., 0., 0.]])`` - -ones(shape) will create an array filled with 1 values. It is identical to -zeros in all other respects. - -arange() will create arrays with regularly incrementing values. Check the -docstring for complete information on the various ways it can be used. A few -examples will be given here: :: - - >>> np.arange(10) - array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) - >>> np.arange(2, 10, dtype=np.float) - array([ 2., 3., 4., 5., 6., 7., 8., 9.]) - >>> np.arange(2, 3, 0.1) - array([ 2. , 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9]) - -Note that there are some subtleties regarding the last usage that the user -should be aware of that are described in the arange docstring. - -indices() will create a set of arrays (stacked as a one-higher dimensioned -array), one per dimension with each representing variation in that dimension. -An examples illustrates much better than a verbal description: :: - - >>> np.indices((3,3)) - array([[[0, 0, 0], [1, 1, 1], [2, 2, 2]], [[0, 1, 2], [0, 1, 2], [0, 1, 2]]]) - -This is particularly useful for evaluating functions of multiple dimensions on -a regular grid. - -Reading arrays from disk -======================== - -This is presumably the most common case of large array creation. The details, -of course, depend greatly on the format of data on disk and so this section -can only give general pointers on how to handle various formats. - -Standard binary formats ------------------------ - -Various fields have standard formats for array data. The following lists the -ones with known python libraries to read them and return numpy arrays (there -may be others for which it is possible to read and convert to numpy arrays so -check the last section as well) - -HDF5: PyTables -FITS: PyFITS -Others? xxx - -Examples of formats that cannot be read directly but for which it is not hard -to convert are libraries like PIL (able to read and write many image formats -such as jpg, png, etc). - -Common ascii formats --------------------- - -Comma Separated Value files (CSV) are widely used (and an export and import -option for programs like Excel). There are a number of ways of reading these -files in Python. The most convenient ways of reading these are found in pylab -(part of matplotlib) in the xxx function. (list alternatives xxx) - -More generic ascii files can be read using the io package in scipy. xxx a few -more details needed... - -Custom binary formats ---------------------- - -There are a variety of approaches one can use. If the file has a relatively -simple format then one can write a simple I/O library and use the numpy -fromfile() function and .tofile() method to read and write numpy arrays -directly (mind your byteorder though!) If a good C or C++ library exists that -read the data, one can wrap that library with a variety of techniques (see -xxx) though that certainly is much more work and requires significantly more -advanced knowledge to interface with C or C++. - -Use of special libraries ------------------------- - -There are libraries that can be used to generate arrays for special purposes -and it isn't possible to enumerate all of them. The most common uses are use -of the many array generation functions in random that can generate arrays of -random values, and some utility functions to generate special matrices (e.g. -diagonal, see xxx) - -""" Deleted: trunk/numpy/doc/reference/glossary.py =================================================================== --- trunk/numpy/doc/reference/glossary.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/glossary.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,367 +0,0 @@ -""" -================= -Glossary -================= - -along an axis - Axes are defined for arrays with more than one dimension. A - 2-dimensional array has two corresponding axes: the first running - vertically downwards across rows (axis 0), and the second running - horizontally across columns (axis 1). - - Many operation can take place along one of these axes. For example, - we can sum each row of an array, in which case we operate along - columns, or axis 1:: - - >>> x = np.arange(12).reshape((3,4)) - - >>> x - array([[ 0, 1, 2, 3], - [ 4, 5, 6, 7], - [ 8, 9, 10, 11]]) - - >>> x.sum(axis=1) - array([ 6, 22, 38]) - -array or ndarray - A homogeneous container of numerical elements. Each element in the - array occupies a fixed amount of memory (hence homogeneous), and - can be a numerical element of a single type (such as float, int - or complex) or a combination (such as ``(float, int, float)``). Each - array has an associated data-type (or ``dtype``), which describes - the numerical type of its elements:: - - >>> x = np.array([1, 2, 3], float) - - >>> x - array([ 1., 2., 3.]) - - >>> x.dtype # floating point number, 64 bits of memory per element - dtype('float64') - - - # More complicated data type: each array element is a combination of - # and integer and a floating point number - >>> np.array([(1, 2.0), (3, 4.0)], dtype=[('x', int), ('y', float)]) - array([(1, 2.0), (3, 4.0)], - dtype=[('x', '>> x = np.array([1, 2, 3]) - >>> x.shape - (3,) - -broadcast - NumPy can do operations on arrays whose shapes are mismatched:: - - >>> x = np.array([1, 2]) - >>> y = np.array([[3], [4]]) - - >>> x - array([1, 2]) - - >>> y - array([[3], - [4]]) - - >>> x + y - array([[4, 5], - [5, 6]]) - - See `doc.broadcasting`_ for more information. - -decorator - An operator that transforms a function. For example, a ``log`` - decorator may be defined to print debugging information upon - function execution:: - - >>> def log(f): - ... def new_logging_func(*args, **kwargs): - ... print "Logging call with parameters:", args, kwargs - ... return f(*args, **kwargs) - ... - ... return new_logging_func - - Now, when we define a function, we can "decorate" it using ``log``:: - - >>> @log - ... def add(a, b): - ... return a + b - - Calling ``add`` then yields: - - >>> add(1, 2) - Logging call with parameters: (1, 2) {} - 3 - -dictionary - Resembling a language dictionary, which provides a mapping between - words and descriptions thereof, a Python dictionary is a mapping - between two objects:: - - >>> x = {1: 'one', 'two': [1, 2]} - - Here, `x` is a dictionary mapping keys to values, in this case - the integer 1 to the string "one", and the string "two" to - the list ``[1, 2]``. The values may be accessed using their - corresponding keys:: - - >>> x[1] - 'one' - - >>> x['two'] - [1, 2] - - Note that dictionaries are not stored in any specific order. Also, - most mutable (see *immutable* below) objects, such as lists, may not - be used as keys. - - For more information on dictionaries, read the - `Python tutorial `_. - -immutable - An object that cannot be modified after execution is called - immutable. Two common examples are strings and tuples. - -instance - A class definition gives the blueprint for constructing an object:: - - >>> class House(object): - ... wall_colour = 'white' - - Yet, we have to *build* a house before it exists:: - - >>> h = House() # build a house - - Now, ``h`` is called a ``House`` instance. An instance is therefore - a specific realisation of a class. - -iterable - A sequence that allows "walking" (iterating) over items, typically - using a loop such as:: - - >>> x = [1, 2, 3] - >>> [item**2 for item in x] - [1, 4, 9] - - It is often used in combintion with ``enumerate``:: - - >>> for n, k in enumerate(keys): - ... print "Key %d: %s" % (n, k) - ... - Key 0: a - Key 1: b - Key 2: c - -list - A Python container that can hold any number of objects or items. - The items do not have to be of the same type, and can even be - lists themselves:: - - >>> x = [2, 2.0, "two", [2, 2.0]] - - The list `x` contains 4 items, each which can be accessed individually:: - - >>> x[2] # the string 'two' - 'two' - - >>> x[3] # a list, containing an integer 2 and a float 2.0 - [2, 2.0] - - It is also possible to select more than one item at a time, - using *slicing*:: - - >>> x[0:2] # or, equivalently, x[:2] - [2, 2.0] - - In code, arrays are often conveniently expressed as nested lists:: - - - >>> np.array([[1, 2], [3, 4]]) - array([[1, 2], - [3, 4]]) - - For more information, read the section on lists in the `Python - tutorial `_. For a mapping - type (key-value), see *dictionary*. - -mask - A boolean array, used to select only certain elements for an operation:: - - >>> x = np.arange(5) - >>> x - array([0, 1, 2, 3, 4]) - - >>> mask = (x > 2) - >>> mask - array([False, False, False, True, True], dtype=bool) - - >>> x[mask] = -1 - >>> x - array([ 0, 1, 2, -1, -1]) - -masked array - Array that suppressed values indicated by a mask:: - - >>> x = np.ma.masked_array([np.nan, 2, np.nan], [True, False, True]) - >>> x - masked_array(data = [-- 2.0 --], - mask = [ True False True], - fill_value=1e+20) - - >>> x + [1, 2, 3] - masked_array(data = [-- 4.0 --], - mask = [ True False True], - fill_value=1e+20) - - Masked arrays are often used when operating on arrays containing - missing or invalid entries. - -matrix - A 2-dimensional ndarray that preserves its two-dimensional nature - throughout operations. It has certain special operations, such as ``*`` - (matrix multiplication) and ``**`` (matrix power), defined:: - - >>> x = np.mat([[1, 2], [3, 4]]) - - >>> x - matrix([[1, 2], - [3, 4]]) - - >>> x**2 - matrix([[ 7, 10], - [15, 22]]) - -method - A function associated with an object. For example, each ndarray has a - method called ``repeat``:: - - >>> x = np.array([1, 2, 3]) - - >>> x.repeat(2) - array([1, 1, 2, 2, 3, 3]) - -reference - If ``a`` is a reference to ``b``, then ``(a is b) == True``. Therefore, - ``a`` and ``b`` are different names for the same Python object. - -self - Often seen in method signatures, ``self`` refers to the instance - of the associated class. For example: - - >>> class Paintbrush(object): - ... color = 'blue' - ... - ... def paint(self): - ... print "Painting the city %s!" % self.color - ... - >>> p = Paintbrush() - >>> p.color = 'red' - >>> p.paint() # self refers to 'p' - Painting the city red! - -slice - Used to select only certain elements from a sequence:: - - >>> x = range(5) - >>> x - [0, 1, 2, 3, 4] - - >>> x[1:3] # slice from 1 to 3 (excluding 3 itself) - [1, 2] - - >>> x[1:5:2] # slice from 1 to 5, but skipping every second element - [1, 3] - - >>> x[::-1] # slice a sequence in reverse - [4, 3, 2, 1, 0] - - Arrays may have more than one dimension, each which can be sliced - individually:: - - >>> x = np.array([[1, 2], [3, 4]]) - >>> x - array([[1, 2], - [3, 4]]) - - >>> x[:, 1] - array([2, 4]) - -tuple - A sequence that may contain a variable number of types of any - kind. A tuple is immutable, i.e., once constructed it cannot be - changed. Similar to a list, it can be indexed and sliced:: - - >>> x = (1, 'one', [1, 2]) - - >>> x - (1, 'one', [1, 2]) - - >>> x[0] - 1 - - >>> x[:2] - (1, 'one') - - A useful concept is "tuple unpacking", which allows variables to - be assigned to the contents of a tuple:: - - >>> x, y = (1, 2) - >>> x, y = 1, 2 - - This is often used when a function returns multiple values: - - >>> def return_many(): - ... return 1, 'alpha' - - >>> a, b, c = return_many() - >>> a, b, c - (1, 'alpha', None) - - >>> a - 1 - >>> b - 'alpha' - -ufunc - Universal function. A fast element-wise array operation. Examples include - ``add``, ``sin`` and ``logical_or``. - -view - An array that does not own its data, but refers to another array's - data instead. For example, we may create a view that only shows - every second element of another array:: - - >>> x = np.arange(5) - >>> x - array([0, 1, 2, 3, 4]) - - >>> y = x[::2] - >>> y - array([0, 2, 4]) - - >>> x[0] = 3 # changing x changes y as well, since y is a view on x - >>> y - array([3, 2, 4]) - -wrapper - Python is a high-level (highly abstracted, or English-like) language. - This abstraction comes at a price in execution speed, and sometimes - it becomes necessary to use lower level languages to do fast - computations. A wrapper is code that provides a bridge between - high and the low level languages, allowing, e.g., Python to execute - code written in C or Fortran. - - Examples include ctypes, SWIG and Cython (which wraps C and C++) - and f2py (which wraps Fortran). - -""" Deleted: trunk/numpy/doc/reference/howtofind.py =================================================================== --- trunk/numpy/doc/reference/howtofind.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/howtofind.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,9 +0,0 @@ -""" - -================= -How to Find Stuff -================= - -How to find things in NumPy. - -""" Deleted: trunk/numpy/doc/reference/indexing.py =================================================================== --- trunk/numpy/doc/reference/indexing.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/indexing.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,384 +0,0 @@ -""" -============== -Array indexing -============== - -Array indexing refers to any use of the square brackets ([]) to index -array values. There are many options to indexing, which give numpy -indexing great power, but with power comes some complexity and the -potential for confusion. This section is just an overview of the -various options and issues related to indexing. Aside from single -element indexing, the details on most of these options are to be -found in related sections. - -Assignment vs referencing -========================= - -Most of the following examples show the use of indexing when referencing -data in an array. The examples work just as well when assigning to an -array. See the section at the end for specific examples and explanations -on how assignments work. - -Single element indexing -======================= - -Single element indexing for a 1-D array is what one expects. It work -exactly like that for other standard Python sequences. It is 0-based, -and accepts negative indices for indexing from the end of the array. :: - - >>> x = np.arange(10) - >>> x[2] - 2 - >>> x[-2] - 8 - -Unlike lists and tuples, numpy arrays support multidimensional indexing -for multidimensional arrays. That means that it is not necessary to -separate each dimension's index into its own set of square brackets. :: - - >>> x.shape = (2,5) # now x is 2-dimensional - >>> x[1,3] - 8 - >>> x[1,-1] - 9 - -Note that if one indexes a multidimensional array with fewer indices -than dimensions, one gets a subdimensional array. For example: :: - - >>> x[0] - array([0, 1, 2, 3, 4]) - -That is, each index specified selects the array corresponding to the rest -of the dimensions selected. In the above example, choosing 0 means that -remaining dimension of lenth 5 is being left unspecified, and that what -is returned is an array of that dimensionality and size. It must be noted -that the returned array is not a copy of the original, but points to the -same values in memory as does the original array (a new view of the same -data in other words, see xxx for details). In this case, -the 1-D array at the first position (0) is returned. So using a single -index on the returned array, results in a single element being returned. -That is: :: - - >>> x[0][2] - 2 - -So note that ``x[0,2] = x[0][2]`` though the second case is more inefficient -a new temporary array is created after the first index that is subsequently -indexed by 2. - -Note to those used to IDL or Fortran memory order as it relates to indexing. -Numpy uses C-order indexing. That means that the last index usually (see -xxx for exceptions) represents the most rapidly changing memory location, -unlike Fortran or IDL, where the first index represents the most rapidly -changing location in memory. This difference represents a great potential -for confusion. - -Other indexing options -====================== - -It is possible to slice and stride arrays to extract arrays of the same -number of dimensions, but of different sizes than the original. The slicing -and striding works exactly the same way it does for lists and tuples except -that they can be applied to multiple dimensions as well. A few -examples illustrates best: :: - - >>> x = np.arange(10) - >>> x[2:5] - array([2, 3, 4]) - >>> x[:-7] - array([0, 1, 2]) - >>> x[1:7:2] - array([1,3,5]) - >>> y = np.arange(35).reshape(5,7) - >>> y[1:5:2,::3] - array([[ 7, 10, 13], - [21, 24, 27]]) - -Note that slices of arrays do not copy the internal array data but -also produce new views of the original data (see xxx for more -explanation of this issue). - -It is possible to index arrays with other arrays for the purposes of -selecting lists of values out of arrays into new arrays. There are two -different ways of accomplishing this. One uses one or more arrays of -index values (see xxx for details). The other involves giving a boolean -array of the proper shape to indicate the values to be selected. -Index arrays are a very powerful tool that allow one to avoid looping -over individual elements in arrays and thus greatly improve performance -(see xxx for examples) - -It is possible to use special features to effectively increase the -number of dimensions in an array through indexing so the resulting -array aquires the shape needed for use in an expression or with a -specific function. See xxx. - -Index arrays -============ - -Numpy arrays may be indexed with other arrays (or any other sequence-like -object that can be converted to an array, such as lists, with the exception -of tuples; see the end of this document for why this is). The use of index -arrays ranges from simple, straightforward cases to complex, hard-to-understand -cases. For all cases of index arrays, what is returned is a copy of the -original data, not a view as one gets for slices. - -Index arrays must be of integer type. Each value in the array indicates which -value in the array to use in place of the index. To illustrate: :: - - >>> x = np.arange(10,1,-1) - >>> x - array([10, 9, 8, 7, 6, 5, 4, 3, 2]) - >>> x[np.array([3, 3, 1, 8])] - array([7, 7, 9, 2]) - - -The index array consisting of the values 3, 3, 1 and 8 correspondingly create -an array of length 4 (same as the index array) where each index is replaced by -the value the index array has in the array being indexed. - -Negative values are permitted and work as they do with single indices or slices: :: - - >>> x[np.array([3,3,-3,8])] - array([7, 7, 4, 2]) - -It is an error to have index values out of bounds: :: - - >>> x[np.array([3, 3, 20, 8])] - : index 20 out of bounds 0<=index<9 - -Generally speaking, what is returned when index arrays are used is an array with -the same shape as the index array, but with the type and values of the array being -indexed. As an example, we can use a multidimensional index array instead: :: - - >>> x[np.array([[1,1],[2,3]])] - array([[9, 9], - [8, 7]]) - -Indexing Multi-dimensional arrays -================================= - -Things become more complex when multidimensional arrays are indexed, particularly -with multidimensional index arrays. These tend to be more unusal uses, but they -are permitted, and they are useful for some problems. We'll start with the -simplest multidimensional case (using the array y from the previous examples): :: - - >>> y[np.array([0,2,4]), np.array([0,1,2])] - array([ 0, 15, 30]) - -In this case, if the index arrays have a matching shape, and there is an index -array for each dimension of the array being indexed, the resultant array has the -same shape as the index arrays, and the values correspond to the index set for each -position in the index arrays. In this example, the first index value is 0 for both -index arrays, and thus the first value of the resultant array is y[0,0]. The next -value is y[2,1], and the last is y[4,2]. - -If the index arrays do not have the same shape, there is an attempt to broadcast -them to the same shape. Broadcasting won't be discussed here but is discussed in -detail in xxx. If they cannot be broadcast to the same shape, an exception is -raised: :: - - >>> y[np.array([0,2,4]), np.array([0,1])] - : shape mismatch: objects cannot be broadcast to a single shape - -The broadcasting mechanism permits index arrays to be combined with scalars for -other indices. The effect is that the scalar value is used for all the corresponding -values of the index arrays: :: - - >>> y[np.array([0,2,4]), 1] - array([ 1, 15, 29]) - -Jumping to the next level of complexity, it is possible to only partially index an array -with index arrays. It takes a bit of thought to understand what happens in such cases. -For example if we just use one index array with y: :: - - >>> y[np.array([0,2,4])] - array([[ 0, 1, 2, 3, 4, 5, 6], - [14, 15, 16, 17, 18, 19, 20], - [28, 29, 30, 31, 32, 33, 34]]) - -What results is the construction of a new array where each value of the index array -selects one row from the array being indexed and the resultant array has the resulting -shape (size of row, number index elements). - -An example of where this may be useful is for a color lookup table where we want to map -the values of an image into RGB triples for display. The lookup table could have a shape -(nlookup, 3). Indexing such an array with an image with shape (ny, nx) with dtype=np.uint8 -(or any integer type so long as values are with the bounds of the lookup table) will -result in an array of shape (ny, nx, 3) where a triple of RGB values is associated with -each pixel location. - -In general, the shape of the resulant array will be the concatenation of the shape of -the index array (or the shape that all the index arrays were broadcast to) with the -shape of any unused dimensions (those not indexed) in the array being indexed. - -Boolean or "mask" index arrays -============================== - -Boolean arrays used as indices are treated in a different manner entirely than index -arrays. Boolean arrays must be of the same shape as the array being indexed, or -broadcastable to the same shape. In the most straightforward case, the boolean array -has the same shape: :: - - >>> b = y>20 - >>> y[b] - array([21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]) - -The result is a 1-D array containing all the elements in the indexed array corresponding -to all the true elements in the boolean array. As with index arrays, what is returned -is a copy of the data, not a view as one gets with slices. - -With broadcasting, multidimesional arrays may be the result. For example: :: - - >>> b[:,5] # use a 1-D boolean that broadcasts with y - array([False, False, False, True, True], dtype=bool) - >>> y[b[:,5]] - array([[21, 22, 23, 24, 25, 26, 27], - [28, 29, 30, 31, 32, 33, 34]]) - -Here the 4th and 5th rows are selected from the indexed array and combined to make a -2-D array. - -Combining index arrays with slices -================================== - -Index arrays may be combined with slices. For example: :: - - >>> y[np.array([0,2,4]),1:3] - array([[ 1, 2], - [15, 16], - [29, 30]]) - -In effect, the slice is converted to an index array np.array([[1,2]]) (shape (1,2)) that is -broadcast with the index array to produce a resultant array of shape (3,2). - -Likewise, slicing can be combined with broadcasted boolean indices: :: - - >>> y[b[:,5],1:3] - array([[22, 23], - [29, 30]]) - -Structural indexing tools -========================= - -To facilitate easy matching of array shapes with expressions and in -assignments, the np.newaxis object can be used within array indices -to add new dimensions with a size of 1. For example: :: - - >>> y.shape - (5, 7) - >>> y[:,np.newaxis,:].shape - (5, 1, 7) - -Note that there are no new elements in the array, just that the -dimensionality is increased. This can be handy to combine two -arrays in a way that otherwise would require explicitly reshaping -operations. For example: :: - - >>> x = np.arange(5) - >>> x[:,np.newaxis] + x[np.newaxis,:] - array([[0, 1, 2, 3, 4], - [1, 2, 3, 4, 5], - [2, 3, 4, 5, 6], - [3, 4, 5, 6, 7], - [4, 5, 6, 7, 8]]) - -The ellipsis syntax maybe used to indicate selecting in full any -remaining unspecified dimensions. For example: :: - - >>> z = np.arange(81).reshape(3,3,3,3) - >>> z[1,...,2] - array([[29, 32, 35], - [38, 41, 44], - [47, 50, 53]]) - -This is equivalent to: :: - - >>> z[1,:,:,2] - -Assigning values to indexed arrays -================================== - -As mentioned, one can select a subset of an array to assign to using -a single index, slices, and index and mask arrays. The value being -assigned to the indexed array must be shape consistent (the same shape -or broadcastable to the shape the index produces). For example, it is -permitted to assign a constant to a slice: :: - - >>> x[2:7] = 1 - -or an array of the right size: :: - - >>> x[2:7] = np.arange(5) - -Note that assignments may result in changes if assigning -higher types to lower types (like floats to ints) or even -exceptions (assigning complex to floats or ints): :: - - >>> x[1] = 1.2 - >>> x[1] - 1 - >>> x[1] = 1.2j - : can't convert complex to long; use long(abs(z)) - - -Unlike some of the references (such as array and mask indices) -assignments are always made to the original data in the array -(indeed, nothing else would make sense!). Note though, that some -actions may not work as one may naively expect. This particular -example is often surprising to people: :: - - >>> x[np.array([1, 1, 3, 1]) += 1 - -Where people expect that the 1st location will be incremented by 3. -In fact, it will only be incremented by 1. The reason is because -a new array is extracted from the original (as a temporary) containing -the values at 1, 1, 3, 1, then the value 1 is added to the temporary, -and then the temporary is assigned back to the original array. Thus -the value of the array at x[1]+1 is assigned to x[1] three times, -rather than being incremented 3 times. - -Dealing with variable numbers of indices within programs -======================================================== - -The index syntax is very powerful but limiting when dealing with -a variable number of indices. For example, if you want to write -a function that can handle arguments with various numbers of -dimensions without having to write special case code for each -number of possible dimensions, how can that be done? If one -supplies to the index a tuple, the tuple will be interpreted -as a list of indices. For example (using the previous definition -for the array z): :: - - >>> indices = (1,1,1,1) - >>> z[indices] - 40 - -So one can use code to construct tuples of any number of indices -and then use these within an index. - -Slices can be specified within programs by using the slice() function -in Python. For example: :: - - >>> indices = (1,1,1,slice(0,2)) # same as [1,1,1,0:2] - array([39, 40]) - -Likewise, ellipsis can be specified by code by using the Ellipsis object: :: - - >>> indices = (1, Ellipsis, 1) # same as [1,...,1] - >>> z[indices] - array([[28, 31, 34], - [37, 40, 43], - [46, 49, 52]]) - -For this reason it is possible to use the output from the np.where() -function directly as an index since it always returns a tuple of index arrays. - -Because the special treatment of tuples, they are not automatically converted -to an array as a list would be. As an example: :: - - >>> z[[1,1,1,1]] - ... # produces a large array - >>> z[(1,1,1,1)] - 40 # returns a single value - -""" Deleted: trunk/numpy/doc/reference/internals.py =================================================================== --- trunk/numpy/doc/reference/internals.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/internals.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,162 +0,0 @@ -""" -=============== -Array Internals -=============== - -Internal organization of numpy arrays -===================================== - -It helps to understand a bit about how numpy arrays are handled under the covers to help understand numpy better. This section will not go into great detail. Those wishing to understand the full details are referred to Travis Oliphant's book "Guide to Numpy". - -Numpy arrays consist of two major components, the raw array data (from now on, -referred to as the data buffer), and the information about the raw array data. -The data buffer is typically what people think of as arrays in C or Fortran, -a contiguous (and fixed) block of memory containing fixed sized data items. -Numpy also contains a significant set of data that describes how to interpret -the data in the data buffer. This extra information contains (among other things): - - 1) The basic data element's size in bytes - 2) The start of the data within the data buffer (an offset relative to the - beginning of the data buffer). - 3) The number of dimensions and the size of each dimension - 4) The separation between elements for each dimension (the 'stride'). This - does not have to be a multiple of the element size - 5) The byte order of the data (which may not be the native byte order) - 6) Whether the buffer is read-only - 7) Information (via the dtype object) about the interpretation of the basic - data element. The basic data element may be as simple as a int or a float, - or it may be a compound object (e.g., struct-like), a fixed character field, - or Python object pointers. - 8) Whether the array is to interpreted as C-order or Fortran-order. - -This arrangement allow for very flexible use of arrays. One thing that it allows -is simple changes of the metadata to change the interpretation of the array buffer. -Changing the byteorder of the array is a simple change involving no rearrangement -of the data. The shape of the array can be changed very easily without changing -anything in the data buffer or any data copying at all - -Among other things that are made possible is one can create a new array metadata -object that uses the same data buffer -to create a new view of that data buffer that has a different interpretation -of the buffer (e.g., different shape, offset, byte order, strides, etc) but -shares the same data bytes. Many operations in numpy do just this such as -slices. Other operations, such as transpose, don't move data elements -around in the array, but rather change the information about the shape and strides so that the indexing of the array changes, but the data in the doesn't move. - -Typically these new versions of the array metadata but the same data buffer are -new 'views' into the data buffer. There is a different ndarray object, but it -uses the same data buffer. This is why it is necessary to force copies through -use of the .copy() method if one really wants to make a new and independent -copy of the data buffer. - -New views into arrays mean the the object reference counts for the data buffer -increase. Simply doing away with the original array object will not remove the -data buffer if other views of it still exist. - -Multidimensional Array Indexing Order Issues -============================================ - -What is the right way to index -multi-dimensional arrays? Before you jump to conclusions about the one and -true way to index multi-dimensional arrays, it pays to understand why this is -a confusing issue. This section will try to explain in detail how numpy -indexing works and why we adopt the convention we do for images, and when it -may be appropriate to adopt other conventions. - -The first thing to understand is -that there are two conflicting conventions for indexing 2-dimensional arrays. -Matrix notation uses the first index to indicate which row is being selected and -the second index to indicate which column is selected. This is opposite the -geometrically oriented-convention for images where people generally think the -first index represents x position (i.e., column) and the second represents y -position (i.e., row). This alone is the source of much confusion; -matrix-oriented users and image-oriented users expect two different things with -regard to indexing. - -The second issue to understand is how indices correspond -to the order the array is stored in memory. In Fortran the first index is the -most rapidly varying index when moving through the elements of a two -dimensional array as it is stored in memory. If you adopt the matrix -convention for indexing, then this means the matrix is stored one column at a -time (since the first index moves to the next row as it changes). Thus Fortran -is considered a Column-major language. C has just the opposite convention. In -C, the last index changes most rapidly as one moves through the array as -stored in memory. Thus C is a Row-major language. The matrix is stored by -rows. Note that in both cases it presumes that the matrix convention for -indexing is being used, i.e., for both Fortran and C, the first index is the -row. Note this convention implies that the indexing convention is invariant -and that the data order changes to keep that so. - -But that's not the only way -to look at it. Suppose one has large two-dimensional arrays (images or -matrices) stored in data files. Suppose the data are stored by rows rather than -by columns. If we are to preserve our index convention (whether matrix or -image) that means that depending on the language we use, we may be forced to -reorder the data if it is read into memory to preserve our indexing -convention. For example if we read row-ordered data into memory without -reordering, it will match the matrix indexing convention for C, but not for -Fortran. Conversely, it will match the image indexing convention for Fortran, -but not for C. For C, if one is using data stored in row order, and one wants -to preserve the image index convention, the data must be reordered when -reading into memory. - -In the end, which you do for Fortran or C depends on -which is more important, not reordering data or preserving the indexing -convention. For large images, reordering data is potentially expensive, and -often the indexing convention is inverted to avoid that. - -The situation with -numpy makes this issue yet more complicated. The internal machinery of numpy -arrays is flexible enough to accept any ordering of indices. One can simply -reorder indices by manipulating the internal stride information for arrays -without reordering the data at all. Numpy will know how to map the new index -order to the data without moving the data. - -So if this is true, why not choose -the index order that matches what you most expect? In particular, why not define -row-ordered images to use the image convention? (This is sometimes referred -to as the Fortran convention vs the C convention, thus the 'C' and 'FORTRAN' -order options for array ordering in numpy.) The drawback of doing this is -potential performance penalties. It's common to access the data sequentially, -either implicitly in array operations or explicitly by looping over rows of an -image. When that is done, then the data will be accessed in non-optimal order. -As the first index is incremented, what is actually happening is that elements -spaced far apart in memory are being sequentially accessed, with usually poor -memory access speeds. For example, for a two dimensional image 'im' defined so -that im[0, 10] represents the value at x=0, y=10. To be consistent with usual -Python behavior then im[0] would represent a column at x=0. Yet that data -would be spread over the whole array since the data are stored in row order. -Despite the flexibility of numpy's indexing, it can't really paper over the fact -basic operations are rendered inefficient because of data order or that getting -contiguous subarrays is still awkward (e.g., im[:,0] for the first row, vs -im[0]), thus one can't use an idiom such as for row in im; for col in im does -work, but doesn't yield contiguous column data. - -As it turns out, numpy is -smart enough when dealing with ufuncs to determine which index is the most -rapidly varying one in memory and uses that for the innermost loop. Thus for -ufuncs there is no large intrinsic advantage to either approach in most cases. -On the other hand, use of .flat with an FORTRAN ordered array will lead to -non-optimal memory access as adjacent elements in the flattened array (iterator, -actually) are not contiguous in memory. - -Indeed, the fact is that Python -indexing on lists and other sequences naturally leads to an outside-to inside -ordering (the first index gets the largest grouping, the next the next largest, -and the last gets the smallest element). Since image data are normally stored -by rows, this corresponds to position within rows being the last item indexed. - -If you do want to use Fortran ordering realize that -there are two approaches to consider: 1) accept that the first index is just not -the most rapidly changing in memory and have all your I/O routines reorder -your data when going from memory to disk or visa versa, or use numpy's -mechanism for mapping the first index to the most rapidly varying data. We -recommend the former if possible. The disadvantage of the latter is that many -of numpy's functions will yield arrays without Fortran ordering unless you are -careful to use the 'order' keyword. Doing this would be highly inconvenient. - -Otherwise we recommend simply learning to reverse the usual order of indices -when accessing elements of an array. Granted, it goes against the grain, but -it is more in line with Python semantics and the natural order of the data. - -""" Deleted: trunk/numpy/doc/reference/io.py =================================================================== --- trunk/numpy/doc/reference/io.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/io.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,9 +0,0 @@ -""" - -========= -Array I/O -========= - -Placeholder for array I/O documentation. - -""" Deleted: trunk/numpy/doc/reference/jargon.py =================================================================== --- trunk/numpy/doc/reference/jargon.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/jargon.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,9 +0,0 @@ -""" - -====== -Jargon -====== - -Placeholder for computer science, engineering and other jargon. - -""" Deleted: trunk/numpy/doc/reference/methods_vs_functions.py =================================================================== --- trunk/numpy/doc/reference/methods_vs_functions.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/methods_vs_functions.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,9 +0,0 @@ -""" - -===================== -Methods vs. Functions -===================== - -Placeholder for Methods vs. Functions documentation. - -""" Deleted: trunk/numpy/doc/reference/misc.py =================================================================== --- trunk/numpy/doc/reference/misc.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/misc.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,9 +0,0 @@ -""" - -============= -Miscellaneous -============= - -Placeholder for other tips. - -""" Deleted: trunk/numpy/doc/reference/performance.py =================================================================== --- trunk/numpy/doc/reference/performance.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/performance.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,9 +0,0 @@ -""" - -=========== -Performance -=========== - -Placeholder for Improving Performance documentation. - -""" Deleted: trunk/numpy/doc/reference/structured_arrays.py =================================================================== --- trunk/numpy/doc/reference/structured_arrays.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/structured_arrays.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,176 +0,0 @@ -""" -===================================== -Structured Arrays (aka Record Arrays) -===================================== - -Introduction -============ - -Numpy provides powerful capabilities to create arrays of structs or records. -These arrays permit one to manipulate the data by the structs or by fields of -the struct. A simple example will show what is meant.: :: - - >>> x = np.zeros((2,),dtype=('i4,f4,a10')) - >>> x[:] = [(1,2.,'Hello'),(2,3.,"World")] - >>> x - array([(1, 2.0, 'Hello'), (2, 3.0, 'World')], - dtype=[('f0', '>i4'), ('f1', '>f4'), ('f2', '|S10')]) - -Here we have created a one-dimensional array of length 2. Each element of -this array is a record that contains three items, a 32-bit integer, a 32-bit -float, and a string of length 10 or less. If we index this array at the second -position we get the second record: :: - - >>> x[1] - (2,3.,"World") - -The interesting aspect is that we can reference the different fields of the -array simply by indexing the array with the string representing the name of -the field. In this case the fields have received the default names of 'f0', 'f1' -and 'f2'. - - >>> y = x['f1'] - >>> y - array([ 2., 3.], dtype=float32) - >>> y[:] = 2*y - >>> y - array([ 4., 6.], dtype=float32) - >>> x - array([(1, 4.0, 'Hello'), (2, 6.0, 'World')], - dtype=[('f0', '>i4'), ('f1', '>f4'), ('f2', '|S10')]) - -In these examples, y is a simple float array consisting of the 2nd field -in the record. But it is not a copy of the data in the structured array, -instead it is a view. It shares exactly the same data. Thus when we updated -this array by doubling its values, the structured array shows the -corresponding values as doubled as well. Likewise, if one changes the record, -the field view changes: :: - - >>> x[1] = (-1,-1.,"Master") - >>> x - array([(1, 4.0, 'Hello'), (-1, -1.0, 'Master')], - dtype=[('f0', '>i4'), ('f1', '>f4'), ('f2', '|S10')]) - >>> y - array([ 4., -1.], dtype=float32) - -Defining Structured Arrays -========================== - -The definition of a structured array is all done through the dtype object. -There are a **lot** of different ways one can define the fields of a -record. Some of variants are there to provide backward compatibility with -Numeric or numarray, or another module, and should not be used except for -such purposes. These will be so noted. One defines records by specifying -the structure by 4 general ways, using an argument (as supplied to a dtype -function keyword or a dtype object constructor itself) in the form of a: -1) string, 2) tuple, 3) list, or 4) dictionary. Each of these will be briefly -described. - -1) String argument (as used in the above examples). -In this case, the constructor is expecting a comma -separated list of type specifiers, optionally with extra shape information. -The type specifiers can take 4 different forms: :: - - a) b1, i1, i2, i4, i8, u1, u2, u4, u8, f4, f8, c8, c16, a - (representing bytes, ints, unsigned ints, floats, complex and - fixed length strings of specified byte lengths) - b) int8,...,uint8,...,float32, float64, complex64, complex128 - (this time with bit sizes) - c) older Numeric/numarray type specifications (e.g. Float32). - Don't use these in new code! - d) Single character type specifiers (e.g H for unsigned short ints). - Avoid using these unless you must. Details can be found in the - Numpy book - -These different styles can be mixed within the same string (but why would you -want to do that?). Furthermore, each type specifier can be prefixed -with a repetition number, or a shape. In these cases an array -element is created, i.e., an array within a record. That array -is still referred to as a single field. An example: :: - - >>> x = np.zeros(3, dtype='3int8, float32, (2,3)float64') - >>> x - array([([0, 0, 0], 0.0, [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]), - ([0, 0, 0], 0.0, [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]), - ([0, 0, 0], 0.0, [[0.0, 0.0, 0.0], [0.0, 0.0, 0.0]])], - dtype=[('f0', '|i1', 3), ('f1', '>f4'), ('f2', '>f8', (2, 3))]) - -By using strings to define the record structure, it precludes being -able to name the fields in the original definition. The names can -be changed as shown later, however. - -2) Tuple argument: The only relevant tuple case that applies to record -structures is when a structure is mapped to an existing data type. This -is done by pairing in a tuple, the existing data type with a matching -dtype definition (using any of the variants being described here). As -an example (using a definition using a list, so see 3) for further -details): :: - - >>> x = zeros(3, dtype=('i4',[('r','u1'), ('g','u1'), ('b','u1'), ('a','u1')])) - >>> x - array([0, 0, 0]) - >>> x['r'] - array([0, 0, 0], dtype=uint8) - -In this case, an array is produced that looks and acts like a simple int32 array, -but also has definitions for fields that use only one byte of the int32 (a bit -like Fortran equivalencing). - -3) List argument: In this case the record structure is defined with a list of -tuples. Each tuple has 2 or 3 elements specifying: 1) The name of the field -('' is permitted), 2) the type of the field, and 3) the shape (optional). -For example: - - >>> x = np.zeros(3, dtype=[('x','f4'),('y',np.float32),('value','f4',(2,2))]) - >>> x - array([(0.0, 0.0, [[0.0, 0.0], [0.0, 0.0]]), - (0.0, 0.0, [[0.0, 0.0], [0.0, 0.0]]), - (0.0, 0.0, [[0.0, 0.0], [0.0, 0.0]])], - dtype=[('x', '>f4'), ('y', '>f4'), ('value', '>f4', (2, 2))]) - -4) Dictionary argument: two different forms are permitted. The first consists -of a dictionary with two required keys ('names' and 'formats'), each having an -equal sized list of values. The format list contains any type/shape specifier -allowed in other contexts. The names must be strings. There are two optional -keys: 'offsets' and 'titles'. Each must be a correspondingly matching list to -the required two where offsets contain integer offsets for each field, and -titles are objects containing metadata for each field (these do not have -to be strings), where the value of None is permitted. As an example: :: - - >>> x = np.zeros(3, dtype={'names':['col1', 'col2'], 'formats':['i4','f4']}) - >>> x - array([(0, 0.0), (0, 0.0), (0, 0.0)], - dtype=[('col1', '>i4'), ('col2', '>f4')]) - -The other dictionary form permitted is a dictionary of name keys with tuple -values specifying type, offset, and an optional title. - - >>> x = np.zeros(3, dtype={'col1':('i1',0,'title 1'), 'col2':('f4',1,'title 2')}) - array([(0, 0.0), (0, 0.0), (0, 0.0)], - dtype=[(('title 1', 'col1'), '|i1'), (('title 2', 'col2'), '>f4')]) - -Accessing and modifying field names -=================================== - -The field names are an attribute of the dtype object defining the record structure. -For the last example: :: - - >>> x.dtype.names - ('col1', 'col2') - >>> x.dtype.names = ('x', 'y') - >>> x - array([(0, 0.0), (0, 0.0), (0, 0.0)], - dtype=[(('title 1', 'x'), '|i1'), (('title 2', 'y'), '>f4')]) - >>> x.dtype.names = ('x', 'y', 'z') # wrong number of names - : must replace all names at once with a sequence of length 2 - -Accessing field titles -==================================== - -The field titles provide a standard place to put associated info for fields. -They do not have to be strings. - - >>> x.dtype.fields['x'][2] - 'title 1' - -""" Deleted: trunk/numpy/doc/reference/ufuncs.py =================================================================== --- trunk/numpy/doc/reference/ufuncs.py 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/reference/ufuncs.py 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,135 +0,0 @@ -""" -=================== -Universal Functions -=================== - -Ufuncs are, generally speaking, mathematical functions or operations that are -applied element-by-element to the contents of an array. That is, the result -in each output array element only depends on the value in the corresponding -input array (or arrays) and on no other array elements. Numpy comes with a -large suite of ufuncs, and scipy extends that suite substantially. The simplest -example is the addition operator: :: - - >>> np.array([0,2,3,4]) + np.array([1,1,-1,2]) - array([1, 3, 2, 6]) - -The unfunc module lists all the available ufuncs in numpy. Additional ufuncts -available in xxx in scipy. Documentation on the specific ufuncs may be found -in those modules. This documentation is intended to address the more general -aspects of unfuncs common to most of them. All of the ufuncs that make use of -Python operators (e.g., +, -, etc.) have equivalent functions defined -(e.g. add() for +) - -Type coercion -============= - -What happens when a binary operator (e.g., +,-,\\*,/, etc) deals with arrays of -two different types? What is the type of the result? Typically, the result is -the higher of the two types. For example: :: - - float32 + float64 -> float64 - int8 + int32 -> int32 - int16 + float32 -> float32 - float32 + complex64 -> complex64 - -There are some less obvious cases generally involving mixes of types -(e.g. uints, ints and floats) where equal bit sizes for each are not -capable of saving all the information in a different type of equivalent -bit size. Some examples are int32 vs float32 or uint32 vs int32. -Generally, the result is the higher type of larger size than both -(if available). So: :: - - int32 + float32 -> float64 - uint32 + int32 -> int64 - -Finally, the type coercion behavior when expressions involve Python -scalars is different than that seen for arrays. Since Python has a -limited number of types, combining a Python int with a dtype=np.int8 -array does not coerce to the higher type but instead, the type of the -array prevails. So the rules for Python scalars combined with arrays is -that the result will be that of the array equivalent the Python scalar -if the Python scalar is of a higher 'kind' than the array (e.g., float -vs. int), otherwise the resultant type will be that of the array. -For example: :: - - Python int + int8 -> int8 - Python float + int8 -> float64 - -ufunc methods -============= - -Binary ufuncs support 4 methods. These methods are explained in detail in xxx -(or are they, I don't see anything in the ufunc docstring that is useful?). - -**.reduce(arr)** applies the binary operator to elements of the array in sequence. For example: :: - - >>> np.add.reduce(np.arange(10)) # adds all elements of array - 45 - -For multidimensional arrays, the first dimension is reduced by default: :: - - >>> np.add.reduce(np.arange(10).reshape(2,5)) - array([ 5, 7, 9, 11, 13]) - -The axis keyword can be used to specify different axes to reduce: :: - - >>> np.add.reduce(np.arange(10).reshape(2,5),axis=1) - array([10, 35]) - -**.accumulate(arr)** applies the binary operator and generates an an equivalently -shaped array that includes the accumulated amount for each element of the -array. A couple examples: :: - - >>> np.add.accumulate(np.arange(10)) - array([ 0, 1, 3, 6, 10, 15, 21, 28, 36, 45]) - >>> np.multiply.accumulate(np.arange(1,9)) - array([ 1, 2, 6, 24, 120, 720, 5040, 40320]) - -The behavior for multidimensional arrays is the same as for .reduce(), as is the use of the axis keyword). - -**.reduceat(arr,indices)** allows one to apply reduce to selected parts of an array. -It is a difficult method to understand. See the documentation at: - -**.outer(arr1,arr2)** generates an outer operation on the two arrays arr1 and arr2. It will work on multidimensional arrays (the shape of the result is the -concatenation of the two input shapes.: :: - - >>> np.multiply.outer(np.arange(3),np.arange(4)) - array([[0, 0, 0, 0], - [0, 1, 2, 3], - [0, 2, 4, 6]]) - -Output arguments -================ - -All ufuncs accept an optional output array. The array must be of the expected output shape. Beware that if the type of the output array is of a -different (and lower) type than the output result, the results may be silently -truncated or otherwise corrupted in the downcast to the lower type. This usage -is useful when one wants to avoid creating large temporary arrays and instead -allows one to reuse the same array memory repeatedly (at the expense of not -being able to use more convenient operator notation in expressions). Note that -when the output argument is used, the ufunc still returns a reference to the -result. - - >>> x = np.arange(2) - >>> np.add(np.arange(2),np.arange(2.),x) - array([0, 2]) - >>> x - array([0, 2]) - -and & or as ufuncs -================== - -Invariably people try to use the python 'and' and 'or' as logical operators -(and quite understandably). But these operators do not behave as normal -operators since Python treats these quite differently. They cannot be -overloaded with array equivalents. Thus using 'and' or 'or' with an array -results in an error. There are two alternatives: - - 1) use the ufunc functions logical_and() and logical_or(). - 2) use the bitwise operators & and \\|. The drawback of these is that if - the arguments to these operators are not boolean arrays, the result is - likely incorrect. On the other hand, most usages of logical_and and - logical_or are with boolean arrays. As long as one is careful, this is - a convenient way to apply these operators. - -""" Copied: trunk/numpy/doc/structured_arrays.py (from rev 5669, trunk/numpy/doc/reference/structured_arrays.py) Copied: trunk/numpy/doc/ufuncs.py (from rev 5669, trunk/numpy/doc/reference/ufuncs.py) Deleted: trunk/numpy/doc/ufuncs.txt =================================================================== --- trunk/numpy/doc/ufuncs.txt 2008-08-23 22:52:55 UTC (rev 5680) +++ trunk/numpy/doc/ufuncs.txt 2008-08-23 23:17:23 UTC (rev 5681) @@ -1,103 +0,0 @@ -BUFFERED General Ufunc explanation -================================== - -.. note:: - - This was implemented already, but the notes are kept here for historical - and explanatory purposes. - -We need to optimize the section of ufunc code that handles mixed-type -and misbehaved arrays. In particular, we need to fix it so that items -are not copied into the buffer if they don't have to be. - -Right now, all data is copied into the buffers (even scalars are copied -multiple times into the buffers even if they are not going to be cast). - -Some benchmarks show that this results in a significant slow-down -(factor of 4) over similar numarray code. - -The approach is therefore, to loop over the largest-dimension (just like -the NO_BUFFER) portion of the code. All arrays will either have N or -1 in this last dimension (or their would be a mis-match error). The -buffer size is B. - -If N <= B (and only if needed), we copy the entire last-dimension into -the buffer as fast as possible using the single-stride information. - -Also we only copy into output arrays if needed as well (other-wise the -output arrays are used directly in the ufunc code). - -Call the function using the appropriate strides information from all the input -arrays. Only set the strides to the element-size for arrays that will be copied. - -If N > B, then we have to do the above operation in a loop (with an extra loop -at the end with a different buffer size). - -Both of these cases are handled with the following code:: - - Compute N = quotient * B + remainder. - quotient = N / B # integer math - (store quotient + 1) as the number of innerloops - remainder = N % B # integer remainder - -On the inner-dimension we will have (quotient + 1) loops where -the size of the inner function is B for all but the last when the niter size is -remainder. - -So, the code looks very similar to NOBUFFER_LOOP except the inner loop is -replaced with:: - - for(k=0; iobj gets set to 1. Then there are two cases: - -1) The loop function is an object loop: - - Inputs: - - castbuf starts as NULL and then gets filled with new references. - - function gets called and doesn't alter the reference count in castbuf - - on the next iteration (next value of k), the casting function will - DECREF what is present in castbuf already and place a new object. - - - At the end of the inner loop (for loop over k), the final new-references - in castbuf must be DECREF'd. If its a scalar then a single DECREF suffices - Otherwise, "bufsize" DECREF's are needed (unless there was only one - loop, then "remainder" DECREF's are needed). - - Outputs: - - castbuf contains a new reference as the result of the function call. This - gets converted to the type of interest and. This new reference in castbuf - will be DECREF'd by later calls to the function. Thus, only after the - inner most loop do we need to DECREF the remaining references in castbuf. - -2) The loop function is of a different type: - - Inputs: - - - The PyObject input is copied over to buffer which receives a "borrowed" - reference. This reference is then used but not altered by the cast - call. Nothing needs to be done. - - Outputs: - - - The buffer[i] memory receives the PyObject input after the cast. This is - a new reference which will be "stolen" as it is copied over into memory. - The only problem is that what is presently in memory must be DECREF'd first. - - - - - From numpy-svn at scipy.org Sat Aug 23 19:21:41 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 18:21:41 -0500 (CDT) Subject: [Numpy-svn] r5682 - in branches/1.1.x/numpy/core: . src Message-ID: <20080823232141.0FFC939C0AE@scipy.org> Author: cdavid Date: 2008-08-23 18:21:40 -0500 (Sat, 23 Aug 2008) New Revision: 5682 Modified: branches/1.1.x/numpy/core/memmap.py branches/1.1.x/numpy/core/src/scalarmathmodule.c.src Log: Backport fix to #698. Modified: branches/1.1.x/numpy/core/memmap.py =================================================================== --- branches/1.1.x/numpy/core/memmap.py 2008-08-23 23:17:23 UTC (rev 5681) +++ branches/1.1.x/numpy/core/memmap.py 2008-08-23 23:21:40 UTC (rev 5682) @@ -195,6 +195,7 @@ self = ndarray.__new__(subtype, shape, dtype=descr, buffer=mm, offset=offset, order=order) self._mmap = mm +# Should get rid of these... Are they used? self._offset = offset self._mode = mode self._size = size Modified: branches/1.1.x/numpy/core/src/scalarmathmodule.c.src =================================================================== --- branches/1.1.x/numpy/core/src/scalarmathmodule.c.src 2008-08-23 23:17:23 UTC (rev 5681) +++ branches/1.1.x/numpy/core/src/scalarmathmodule.c.src 2008-08-23 23:21:40 UTC (rev 5682) @@ -524,6 +524,13 @@ return -2; } +/**end repeat**/ + + +/**begin repeat + #name=byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong,float,double,cfloat,cdouble# +**/ + static int _ at name@_convert2_to_ctypes(PyObject *a, @name@ *arg1, PyObject *b, @name@ *arg2) @@ -539,6 +546,27 @@ /**end repeat**/ /**begin repeat + #name=longdouble, clongdouble# +**/ + +static int +_ at name@_convert2_to_ctypes(PyObject *a, @name@ *arg1, + PyObject *b, @name@ *arg2) +{ + int ret; + ret = _ at name@_convert_to_ctype(a, arg1); + if (ret < 0) return ret; + ret = _ at name@_convert_to_ctype(b, arg2); + if (ret == -2) ret = -3; + if (ret < 0) return ret; + return 0; +} + +/**end repeat**/ + + + +/**begin repeat #name=(byte,ubyte,short,ushort,int,uint,long,ulong,longlong,ulonglong)*13, (float, double, longdouble, cfloat, cdouble, clongdouble)*6, (float, double, longdouble)*2# #Name=(Byte, UByte, Short, UShort, Int, UInt, Long, ULong, LongLong, ULongLong)*13, (Float, Double, LongDouble, CFloat, CDouble, CLongDouble)*6, (Float, Double, LongDouble)*2# #oper=add*10, subtract*10, multiply*10, divide*10, remainder*10, divmod*10, floor_divide*10, lshift*10, rshift*10, and*10, or*10, xor*10, true_divide*10, add*6, subtract*6, multiply*6, divide*6, floor_divide*6, true_divide*6, divmod*3, remainder*3# @@ -569,10 +597,14 @@ break; case -1: /* one of them can't be cast safely must be mixed-types*/ - return PyArray_Type.tp_as_number->nb_ at oper@(a,b); + return PyArray_Type.tp_as_number->nb_ at oper@(a,b); case -2: /* use default handling */ if (PyErr_Occurred()) return NULL; return PyGenericArrType_Type.tp_as_number->nb_ at oper@(a,b); + case -3: /* special case for longdouble and clongdouble + because they have a recursive getitem in their dtype */ + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } #if @fperr@ @@ -658,6 +690,10 @@ case -2: /* use default handling */ if (PyErr_Occurred()) return NULL; return PyGenericArrType_Type.tp_as_number->nb_power(a,b,NULL); + case -3: /* special case for longdouble and clongdouble + because they have a recursive getitem in their dtype */ + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } PyUFunc_clearfperr(); @@ -887,6 +923,10 @@ case -2: /* use ufunc */ if (PyErr_Occurred()) return NULL; return PyGenericArrType_Type.tp_richcompare(self, other, cmp_op); + case -3: /* special case for longdouble and clongdouble + because they have a recursive getitem in their dtype */ + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; } /* here we do the actual calculation with arg1 and arg2 */ From numpy-svn at scipy.org Sat Aug 23 19:38:21 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 18:38:21 -0500 (CDT) Subject: [Numpy-svn] r5683 - trunk/doc Message-ID: <20080823233821.1482F39C185@scipy.org> Author: stefan Date: 2008-08-23 18:38:13 -0500 (Sat, 23 Aug 2008) New Revision: 5683 Removed: trunk/doc/floatint/ trunk/doc/test/ Log: Remove directories left over from move. From numpy-svn at scipy.org Sat Aug 23 19:55:20 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 18:55:20 -0500 (CDT) Subject: [Numpy-svn] r5684 - in trunk: doc numpy/doc Message-ID: <20080823235520.A0A0A39C080@scipy.org> Author: stefan Date: 2008-08-23 18:55:01 -0500 (Sat, 23 Aug 2008) New Revision: 5684 Added: trunk/doc/numpybook/ Removed: trunk/numpy/doc/numpybook/ trunk/numpy/doc/reference/ Modified: trunk/doc/DISTUTILS.txt Log: Move book to docs directory. Modified: trunk/doc/DISTUTILS.txt =================================================================== --- trunk/doc/DISTUTILS.txt 2008-08-23 23:38:13 UTC (rev 5683) +++ trunk/doc/DISTUTILS.txt 2008-08-23 23:55:01 UTC (rev 5684) @@ -3,12 +3,6 @@ NumPy Distutils - Users Guide ============================= -:Author: Pearu Peterson -:Discussions to: scipy-dev at scipy.org -:Created: October 2005 -:Revision: $LastChangedRevision$ -:SVN source: $HeadURL$ - .. contents:: SciPy structure Copied: trunk/doc/numpybook (from rev 5683, trunk/numpy/doc/numpybook) From numpy-svn at scipy.org Sat Aug 23 20:56:40 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 19:56:40 -0500 (CDT) Subject: [Numpy-svn] r5685 - trunk/numpy Message-ID: <20080824005640.63B4539C080@scipy.org> Author: stefan Date: 2008-08-23 19:56:32 -0500 (Sat, 23 Aug 2008) New Revision: 5685 Modified: trunk/numpy/setup.py Log: Remove doc/reference from setup. Modified: trunk/numpy/setup.py =================================================================== --- trunk/numpy/setup.py 2008-08-23 23:55:01 UTC (rev 5684) +++ trunk/numpy/setup.py 2008-08-24 00:56:32 UTC (rev 5685) @@ -15,7 +15,6 @@ config.add_subpackage('random') config.add_subpackage('ma') config.add_subpackage('doc') - config.add_subpackage('doc/reference') config.add_data_dir('doc') config.add_data_dir('tests') config.make_config_py() # installs __config__.py From numpy-svn at scipy.org Sat Aug 23 21:19:26 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 20:19:26 -0500 (CDT) Subject: [Numpy-svn] r5686 - in trunk/numpy/core: . tests Message-ID: <20080824011926.1425439C080@scipy.org> Author: matthew.brett at gmail.com Date: 2008-08-23 20:19:20 -0500 (Sat, 23 Aug 2008) New Revision: 5686 Modified: trunk/numpy/core/memmap.py trunk/numpy/core/tests/test_memmap.py Log: Cleaned up logic and annotation of __del__ method, with test Modified: trunk/numpy/core/memmap.py =================================================================== --- trunk/numpy/core/memmap.py 2008-08-24 00:56:32 UTC (rev 5685) +++ trunk/numpy/core/memmap.py 2008-08-24 01:19:20 UTC (rev 5686) @@ -219,11 +219,6 @@ self = ndarray.__new__(subtype, shape, dtype=descr, buffer=mm, offset=offset, order=order) self._mmap = mm -# Should get rid of these... Are they used? - self._offset = offset - self._mode = mode - self._size = size - self._name = filename return self def __array_finalize__(self, obj): @@ -245,33 +240,26 @@ def _close(self): """Close the memmap file. Only do this when deleting the object.""" if self.base is self._mmap: + # The python mmap probably causes flush on close, but + # we put this here for safety + self._mmap.flush() self._mmap.close() self._mmap = None - # DEV NOTE: This error is raised on the deletion of each row - # in a view of this memmap. Python traps exceptions in - # __del__ and prints them to stderr. Suppressing this for now - # until memmap code is cleaned up and and better tested for - # numpy v1.1 Objects that do not have a python mmap instance - # as their base data array, should not do anything in the - # close anyway. - #elif self._mmap is not None: - #raise ValueError, "Cannot close a memmap that is being used " \ - # "by another object." - def close(self): """Close the memmap file. Does nothing.""" warnings.warn("``close`` is deprecated on memmap arrays. Use del", DeprecationWarning) def __del__(self): - if self._mmap is not None: + # We first check if we are the owner of the mmap, rather than + # a view, so deleting a view does not call _close + # on the parent mmap + if self._mmap is self.base: try: # First run tell() to see whether file is open self._mmap.tell() except ValueError: pass else: - # flush any changes to disk, even if it's a view - self.flush() self._close() Modified: trunk/numpy/core/tests/test_memmap.py =================================================================== --- trunk/numpy/core/tests/test_memmap.py 2008-08-24 00:56:32 UTC (rev 5685) +++ trunk/numpy/core/tests/test_memmap.py 2008-08-24 01:19:20 UTC (rev 5686) @@ -2,7 +2,7 @@ import os import warnings -from numpy.core import memmap +from numpy import memmap from numpy import arange, allclose from numpy.testing import * @@ -45,6 +45,21 @@ fp.sync() warnings.simplefilter('default', DeprecationWarning) + def test_del(self): + # Make sure a view does not delete the underlying mmap + fp_base = memmap(self.tmpfp, dtype=self.dtype, mode='w+', + shape=self.shape) + fp_view = fp_base[:] + class ViewCloseError(Exception): + pass + _close = memmap._close + def replace_close(self): + raise ViewCloseError('View should not call _close on memmap') + try: + memmap._close = replace_close + del fp_view + finally: + memmap._close = _close if __name__ == "__main__": run_module_suite() From numpy-svn at scipy.org Sat Aug 23 21:31:16 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 20:31:16 -0500 (CDT) Subject: [Numpy-svn] r5687 - trunk Message-ID: <20080824013116.4DD7E39C080@scipy.org> Author: stefan Date: 2008-08-23 20:31:08 -0500 (Sat, 23 Aug 2008) New Revision: 5687 Modified: trunk/THANKS.txt Log: Update credits. Modified: trunk/THANKS.txt =================================================================== --- trunk/THANKS.txt 2008-08-24 01:19:20 UTC (rev 5686) +++ trunk/THANKS.txt 2008-08-24 01:31:08 UTC (rev 5687) @@ -1,39 +1,51 @@ -Travis Oliphant for the majority of code adaptation -Jim Hugunin, Paul Dubois, Konrad Hinsen, David Ascher, and many others for - Numeric on which the code is based. -Perry Greenfield, J Todd Miller, Rick White, Paul Barrett for Numarray - which gave much inspiration and showed the way forward. -Paul Dubois for original Masked Arrays -Pearu Peterson for f2py and numpy.distutils and help with code organization -Robert Kern for mtrand, bug fixes, help with distutils, code organization, - and much more. -Eric Jones for sundry subroutines +Travis Oliphant for the NumPy core, the NumPy guide, various + bug-fixes and code contributions. +Paul Dubois, who implemented the original Masked Arrays. +Pearu Peterson for f2py, numpy.distutils and help with code + organization. +Robert Kern for mtrand, bug fixes, help with distutils, code + organization, strided tricks and much more. +Eric Jones for planning and code contributions. Fernando Perez for code snippets, ideas, bugfixes, and testing. Ed Schofield for matrix.py patches, bugfixes, testing, and docstrings. -Robert Cimrman for array set operations and numpy.distutils help -John Hunter for code snippets (from matplotlib) +Robert Cimrman for array set operations and numpy.distutils help. +John Hunter for code snippets from matplotlib. Chris Hanley for help with records.py, testing, and bug fixes. -Travis Vaught, Joe Cooper, Jeff Strunk for administration of - numpy.org web site and SVN +Travis Vaught for administration, community coordination and + marketing. +Joe Cooper, Jeff Strunk for administration. Eric Firing for bugfixes. -Arnd Baecker for 64-bit testing +Arnd Baecker for 64-bit testing. David Cooke for many code improvements including the auto-generated C-API, and optimizations. +Andrew Straw for help with the web-page, documentation, packaging and + testing. Alexander Belopolsky (Sasha) for Masked array bug-fixes and tests, - rank-0 array improvements, scalar math help and other code additions -Francesc Altet for unicode and nested record tests - and much help with rooting out nested record array bugs. + rank-0 array improvements, scalar math help and other code additions. +Francesc Altet for unicode, work on nested record arrays, and bug-fixes. Tim Hochberg for getting the build working on MSVC, optimization - improvements, and code review -Charles Harris for the sorting code originally written for Numarray and - for improvements to polyfit, many bug fixes, and documentation strings. -A.M. Archibald for no-copy-reshape code. -David Huard for histogram improvements including 2-d and d-d code and + improvements, and code review. +Charles (Chuck) Harris for the sorting code originally written for + Numarray and for improvements to polyfit, many bug fixes, delving + into the C code, release management, and documentation. +David Huard for histogram improvements including 2-D and d-D code and other bug-fixes. +Stefan van der Walt for numerous bug-fixes, testing and documentation. Albert Strasheim for documentation, bug-fixes, regression tests and Valgrind expertise. -Stefan van der Walt for documentation, bug-fixes and regression-tests. -Andrew Straw for help with http://www.scipy.org, documentation, and testing. -David Cournapeau for scons build support, doc-and-bug fixes, and code contributions including fast_clipping. -Pierre Gerard-Marchant for his rewrite of the masked array functionality. +David Cournapeau for build support, doc-and-bug fixes, and code + contributions including fast_clipping. +Jarrod Millman for release management, community coordination, + and cheerleading. +Chris Burns for work on memory mapped arrays and bug-fixes. +Pauli Virtanen for documentation, bug-fixes, lookfor and the + documentation editor. +A.M. Archibald for no-copy-reshape code, strided array tricks, + documentation and bug-fixes. +Pierre Gerard-Marchant for rewriting masked array functionality. Roberto de Almeida for the buffered array iterator. + +NumPy is based on the Numeric (Jim Hugunin, Paul Dubois, Konrad +Hinsen, and David Ascher) and NumArray (Perry Greenfield, J Todd +Miller, Rick White and Paul Barrett) projects. We thank them for +paving the way ahead. From numpy-svn at scipy.org Sat Aug 23 22:26:46 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 23 Aug 2008 21:26:46 -0500 (CDT) Subject: [Numpy-svn] r5688 - in trunk/numpy/core: src tests Message-ID: <20080824022646.6EC6939C080@scipy.org> Author: oliphant Date: 2008-08-23 21:26:44 -0500 (Sat, 23 Aug 2008) New Revision: 5688 Modified: trunk/numpy/core/src/scalartypes.inc.src trunk/numpy/core/tests/test_regression.py Log: BUG: Fix to ticket #816: calling object_() Segfaults. Modified: trunk/numpy/core/src/scalartypes.inc.src =================================================================== --- trunk/numpy/core/src/scalartypes.inc.src 2008-08-24 01:31:08 UTC (rev 5687) +++ trunk/numpy/core/src/scalartypes.inc.src 2008-08-24 02:26:44 UTC (rev 5688) @@ -1889,7 +1889,7 @@ /**begin repeat1 #name=byte, short, int, long, longlong, ubyte, ushort, uint, ulong, ulonglong, float, double, longdouble, cfloat, cdouble, clongdouble, string, unicode, object# #TYPE=BYTE, SHORT, INT, LONG, LONGLONG, UBYTE, USHORT, UINT, ULONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE, STRING, UNICODE, OBJECT# -#work=0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,z,z,1# +#work=0,0,1,1,1,0,0,0,0,0,0,1,0,0,0,0,z,z,0# #default=0*16,1*2,2# */ static PyObject * @@ -1923,13 +1923,18 @@ #elif @default@ == 1 robj = PyArray_Scalar(NULL, typecode, NULL); #elif @default@ == 2 - obj = Py_None; - robj = PyArray_Scalar(&obj, typecode, NULL); + obj = Py_None; + robj = type->tp_alloc(type, 0); + Py_INCREF(Py_None); + ((PyObjectScalarObject *)robj)->obval = obj; #endif Py_DECREF(typecode); goto finish; } + /* It is expected at this point that robj is a PyArrayScalar + (even for Object Data Type) + */ arr = PyArray_FromAny(obj, typecode, 0, 0, FORCECAST, NULL); if ((arr == NULL) || (PyArray_NDIM(arr) > 0)) { return arr; @@ -1937,6 +1942,12 @@ /* 0-d array */ robj = PyArray_ToScalar(PyArray_DATA(arr), (NPY_AO *)arr); Py_DECREF(arr); +#if @default@ == 2 /* In OBJECT case, robj is no longer a + PyArrayScalar at this point but the + remaining code assumes it is + */ + return robj; +#endif finish: /* Normal return */ @@ -1972,7 +1983,7 @@ itemsize = ((PyUnicodeObject *)robj)->length * sizeof(Py_UNICODE); } memcpy(dest, src, itemsize); -#elif @default@ == 2 /* Object arrays */ +#elif @default@ == 2 /* Object arrays */ memcpy(dest, src, sizeof(void *)); Py_INCREF(*((PyObject **)dest)); #endif Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-08-24 01:31:08 UTC (rev 5687) +++ trunk/numpy/core/tests/test_regression.py 2008-08-24 02:26:44 UTC (rev 5688) @@ -1184,5 +1184,19 @@ assert a.dtype.names[0] == "notfoo" assert a.dtype.names[1] == "bar" + def test_for_object_scalar_creation(self, level=rlevel): + """Ticket #816""" + a = np.object_() + b = np.object_(3) + b2 = np.object_(3.0) + c = np.object_([4,5]) + d = np.object_([None, {}, []]) + assert a is None + assert type(b) is int + assert type(b2) is float + assert type(c) is np.ndarray + assert c.dtype == object + assert d.type == object + if __name__ == "__main__": run_module_suite() From numpy-svn at scipy.org Sun Aug 24 02:53:38 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 24 Aug 2008 01:53:38 -0500 (CDT) Subject: [Numpy-svn] r5689 - trunk/numpy/distutils/fcompiler Message-ID: <20080824065338.21EDA39C080@scipy.org> Author: cdavid Date: 2008-08-24 01:53:22 -0500 (Sun, 24 Aug 2008) New Revision: 5689 Modified: trunk/numpy/distutils/fcompiler/__init__.py Log: Fix debug mode with fortran compiler: the tuple for debug was too big, with an extra None (#539) Modified: trunk/numpy/distutils/fcompiler/__init__.py =================================================================== --- trunk/numpy/distutils/fcompiler/__init__.py 2008-08-24 02:26:44 UTC (rev 5688) +++ trunk/numpy/distutils/fcompiler/__init__.py 2008-08-24 06:53:22 UTC (rev 5689) @@ -129,7 +129,7 @@ arch = ('flags.arch', 'FARCH', 'arch', flaglist), arch_f77 = ('flags.arch_f77', None, None, flaglist), arch_f90 = ('flags.arch_f90', None, None, flaglist), - debug = ('flags.debug', 'FDEBUG', 'fdebug', None, flaglist), + debug = ('flags.debug', 'FDEBUG', 'fdebug', flaglist), debug_f77 = ('flags.debug_f77', None, None, flaglist), debug_f90 = ('flags.debug_f90', None, None, flaglist), flags = ('self.get_flags', 'FFLAGS', 'fflags', flaglist), From numpy-svn at scipy.org Sun Aug 24 05:01:26 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 24 Aug 2008 04:01:26 -0500 (CDT) Subject: [Numpy-svn] r5690 - in trunk/numpy/core: src tests Message-ID: <20080824090126.7B56F39C080@scipy.org> Author: oliphant Date: 2008-08-24 04:01:21 -0500 (Sun, 24 Aug 2008) New Revision: 5690 Modified: trunk/numpy/core/src/scalartypes.inc.src trunk/numpy/core/tests/test_regression.py Log: Fix the test and fix the arrtype_new code for scalars a little bit. Modified: trunk/numpy/core/src/scalartypes.inc.src =================================================================== --- trunk/numpy/core/src/scalartypes.inc.src 2008-08-24 06:53:22 UTC (rev 5689) +++ trunk/numpy/core/src/scalartypes.inc.src 2008-08-24 09:01:21 UTC (rev 5690) @@ -1923,10 +1923,8 @@ #elif @default@ == 1 robj = PyArray_Scalar(NULL, typecode, NULL); #elif @default@ == 2 - obj = Py_None; - robj = type->tp_alloc(type, 0); Py_INCREF(Py_None); - ((PyObjectScalarObject *)robj)->obval = obj; + robj = Py_None; #endif Py_DECREF(typecode); goto finish; @@ -1942,14 +1940,15 @@ /* 0-d array */ robj = PyArray_ToScalar(PyArray_DATA(arr), (NPY_AO *)arr); Py_DECREF(arr); + +finish: + #if @default@ == 2 /* In OBJECT case, robj is no longer a PyArrayScalar at this point but the remaining code assumes it is */ return robj; -#endif - -finish: +#else /* Normal return */ if ((robj == NULL) || (robj->ob_type == type)) { return robj; @@ -1983,12 +1982,11 @@ itemsize = ((PyUnicodeObject *)robj)->length * sizeof(Py_UNICODE); } memcpy(dest, src, itemsize); -#elif @default@ == 2 /* Object arrays */ - memcpy(dest, src, sizeof(void *)); - Py_INCREF(*((PyObject **)dest)); + /* @default@ == 2 won't get here */ #endif Py_DECREF(robj); return obj; +#endif } /**end repeat**/ Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-08-24 06:53:22 UTC (rev 5689) +++ trunk/numpy/core/tests/test_regression.py 2008-08-24 09:01:21 UTC (rev 5690) @@ -1196,7 +1196,7 @@ assert type(b2) is float assert type(c) is np.ndarray assert c.dtype == object - assert d.type == object + assert d.dtype == object if __name__ == "__main__": run_module_suite() From numpy-svn at scipy.org Sun Aug 24 08:17:01 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 24 Aug 2008 07:17:01 -0500 (CDT) Subject: [Numpy-svn] r5691 - trunk/numpy/core/code_generators Message-ID: <20080824121701.83A4B39C080@scipy.org> Author: ptvirtan Date: 2008-08-24 07:16:50 -0500 (Sun, 24 Aug 2008) New Revision: 5691 Modified: trunk/numpy/core/code_generators/docstrings.py Log: Fix docstring indentation Modified: trunk/numpy/core/code_generators/docstrings.py =================================================================== --- trunk/numpy/core/code_generators/docstrings.py 2008-08-24 09:01:21 UTC (rev 5690) +++ trunk/numpy/core/code_generators/docstrings.py 2008-08-24 12:16:50 UTC (rev 5691) @@ -476,7 +476,8 @@ each element is first converted to its binary representation (which works just like the decimal system, only now we're using 2 instead of 10): - .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\\n y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i, + .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\ + y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i, where ``W`` is the bit-width of the type (i.e., 8 for a byte or uint8), and each :math:`a_i` and :math:`b_j` is either 0 or 1. For example, 13 @@ -540,7 +541,8 @@ each element is first converted to its binary representation (which works just like the decimal system, only now we're using 2 instead of 10): - .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\\n y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i, + .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\ + y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i, where ``W`` is the bit-width of the type (i.e., 8 for a byte or uint8), and each :math:`a_i` and :math:`b_j` is either 0 or 1. For example, 13 @@ -591,7 +593,8 @@ >>> np.bitwise_or(np.array([2, 5, 255]), np.array([4, 4, 4])) array([ 6, 5, 255]) - >>> np.bitwise_or(np.array([2, 5, 255, 2147483647L], dtype=np.int32), \\\n... np.array([4, 4, 4, 2147483647L], dtype=np.int32)) + >>> np.bitwise_or(np.array([2, 5, 255, 2147483647L], dtype=np.int32), + ... np.array([4, 4, 4, 2147483647L], dtype=np.int32)) array([ 6, 5, 255, 2147483647]) >>> np.bitwise_or([True, True], [False, True]) array([ True, True], dtype=bool) @@ -606,7 +609,8 @@ each element is first converted to its binary representation (which works just like the decimal system, only now we're using 2 instead of 10): - .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\\n y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i, + .. math:: x = \\sum_{i=0}^{W-1} a_i \\cdot 2^i\\\\ + y = \\sum_{i=0}^{W-1} b_i \\cdot 2^i, where ``W`` is the bit-width of the type (i.e., 8 for a byte or uint8), and each :math:`a_i` and :math:`b_j` is either 0 or 1. For example, 13 From numpy-svn at scipy.org Sun Aug 24 16:56:52 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 24 Aug 2008 15:56:52 -0500 (CDT) Subject: [Numpy-svn] r5692 - trunk/numpy/core Message-ID: <20080824205652.BB29039C080@scipy.org> Author: matthew.brett at gmail.com Date: 2008-08-24 15:56:30 -0500 (Sun, 24 Aug 2008) New Revision: 5692 Modified: trunk/numpy/core/memmap.py Log: Note on mmap size on python 2.5 from numpy book Modified: trunk/numpy/core/memmap.py =================================================================== --- trunk/numpy/core/memmap.py 2008-08-24 12:16:50 UTC (rev 5691) +++ trunk/numpy/core/memmap.py 2008-08-24 20:56:30 UTC (rev 5692) @@ -75,6 +75,14 @@ Given a memmap ``fp``, ``isinstance(fp, numpy.ndarray)`` returns ``True``. + Notes + ----- + + Memory-mapped arrays use the the Python memory-map object which + (prior to Python 2.5) does not allow files to be larger than a + certain size depending on the platform. This size is always < 2GB + even on 64-bit systems. + Examples -------- >>> data = np.arange(12, dtype='float32') From numpy-svn at scipy.org Sun Aug 24 17:03:07 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 24 Aug 2008 16:03:07 -0500 (CDT) Subject: [Numpy-svn] r5693 - trunk/doc/numpybook Message-ID: <20080824210307.AD42F39C080@scipy.org> Author: matthew.brett at gmail.com Date: 2008-08-24 16:02:55 -0500 (Sun, 24 Aug 2008) New Revision: 5693 Modified: trunk/doc/numpybook/numpybook.lyx Log: Updated memmap sync to memmap flush Modified: trunk/doc/numpybook/numpybook.lyx =================================================================== --- trunk/doc/numpybook/numpybook.lyx 2008-08-24 20:56:30 UTC (rev 5692) +++ trunk/doc/numpybook/numpybook.lyx 2008-08-24 21:02:55 UTC (rev 5693) @@ -19056,10 +19056,11 @@ Memory-mapped-file arrays have one additional method (besides those they inherit from the ndarray): self. \series bold -sync +flush \series default -() which must be called manually by the user to ensure that any changes - to the array actually get written to disk. +() 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 From numpy-svn at scipy.org Sun Aug 24 19:22:13 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 24 Aug 2008 18:22:13 -0500 (CDT) Subject: [Numpy-svn] r5694 - trunk/numpy/random/mtrand Message-ID: <20080824232213.C59F439C080@scipy.org> Author: rkern Date: 2008-08-24 18:22:11 -0500 (Sun, 24 Aug 2008) New Revision: 5694 Modified: trunk/numpy/random/mtrand/distributions.c trunk/numpy/random/mtrand/mtrand.c trunk/numpy/random/mtrand/mtrand.pyx Log: BUG: Logarithmic series needs to exclude p==0 and p==1. When the conversion of the result to C longs gives a negative number (i.e. out of bounds), reject the sample and try again until we do get something in bounds. Modified: trunk/numpy/random/mtrand/distributions.c =================================================================== --- trunk/numpy/random/mtrand/distributions.c 2008-08-24 21:02:55 UTC (rev 5693) +++ trunk/numpy/random/mtrand/distributions.c 2008-08-24 23:22:11 UTC (rev 5694) @@ -848,14 +848,29 @@ long rk_logseries(rk_state *state, double p) { double q, r, U, V; + long result; r = log(1.0 - p); - - V = rk_double(state); - if (V >= p) return 1; - U = rk_double(state); - q = 1.0 - exp(r*U); - if (V <= q*q) return (long)floor(1 + log(V)/log(q)); - if (V <= q) return 1; - return 2; + + while (1) { + V = rk_double(state); + if (V >= p) { + return 1; + } + U = rk_double(state); + q = 1.0 - exp(r*U); + if (V <= q*q) { + result = (long)floor(1 + log(V)/log(q)); + if (result < 1) { + continue; + } + else { + return result; + } + } + if (V <= q) { + return 1; + } + return 2; + } } Modified: trunk/numpy/random/mtrand/mtrand.c =================================================================== --- trunk/numpy/random/mtrand/mtrand.c 2008-08-24 21:02:55 UTC (rev 5693) +++ trunk/numpy/random/mtrand/mtrand.c 2008-08-24 23:22:11 UTC (rev 5694) @@ -1,4 +1,4 @@ -/* Generated by Pyrex 0.9.6.4 on Fri Aug 22 22:54:35 2008 */ +/* Generated by Pyrex 0.9.6.4 on Sun Aug 24 16:14:30 2008 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -8171,15 +8171,17 @@ return __pyx_r; } +static PyObject *__pyx_n_greater_equal; + static PyObject *__pyx_k162p; static PyObject *__pyx_k163p; static PyObject *__pyx_k164p; static PyObject *__pyx_k165p; -static char __pyx_k162[] = "p < 0.0"; -static char __pyx_k163[] = "p > 1.0"; -static char __pyx_k164[] = "p < 0.0"; -static char __pyx_k165[] = "p > 1.0"; +static char __pyx_k162[] = "p <= 0.0"; +static char __pyx_k163[] = "p >= 1.0"; +static char __pyx_k164[] = "p <= 0.0"; +static char __pyx_k165[] = "p >= 1.0"; static PyObject *__pyx_f_6mtrand_11RandomState_logseries(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static char __pyx_doc_6mtrand_11RandomState_logseries[] = "\n logseries(p, size=None)\n\n Logarithmic series distribution.\n\n "; @@ -8210,7 +8212,7 @@ if (__pyx_1) { /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2435 */ - __pyx_1 = (__pyx_v_fp < 0.0); + __pyx_1 = (__pyx_v_fp <= 0.0); if (__pyx_1) { __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2436; goto __pyx_L1;} @@ -8227,7 +8229,7 @@ __pyx_L3:; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":2437 */ - __pyx_1 = (__pyx_v_fp > 1.0); + __pyx_1 = (__pyx_v_fp >= 1.0); if (__pyx_1) { __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; goto __pyx_L1;} __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2438; goto __pyx_L1;} @@ -8267,7 +8269,7 @@ __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2444; goto __pyx_L1;} @@ -8306,7 +8308,7 @@ __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_np); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2446; goto __pyx_L1;} @@ -9461,6 +9463,7 @@ {&__pyx_n_geometric, "geometric"}, {&__pyx_n_get_state, "get_state"}, {&__pyx_n_greater, "greater"}, + {&__pyx_n_greater_equal, "greater_equal"}, {&__pyx_n_gumbel, "gumbel"}, {&__pyx_n_hypergeometric, "hypergeometric"}, {&__pyx_n_int, "int"}, Modified: trunk/numpy/random/mtrand/mtrand.pyx =================================================================== --- trunk/numpy/random/mtrand/mtrand.pyx 2008-08-24 21:02:55 UTC (rev 5693) +++ trunk/numpy/random/mtrand/mtrand.pyx 2008-08-24 23:22:11 UTC (rev 5694) @@ -2432,19 +2432,19 @@ fp = PyFloat_AsDouble(p) if not PyErr_Occurred(): - if fp < 0.0: - raise ValueError("p < 0.0") - if fp > 1.0: - raise ValueError("p > 1.0") + if fp <= 0.0: + raise ValueError("p <= 0.0") + if fp >= 1.0: + raise ValueError("p >= 1.0") return discd_array_sc(self.internal_state, rk_logseries, size, fp) PyErr_Clear() op = PyArray_FROM_OTF(p, NPY_DOUBLE, NPY_ALIGNED) - if np.any(np.less(op, 0.0)): - raise ValueError("p < 0.0") - if np.any(np.greater(op, 1.0)): - raise ValueError("p > 1.0") + if np.any(np.less_equal(op, 0.0)): + raise ValueError("p <= 0.0") + if np.any(np.greater_equal(op, 1.0)): + raise ValueError("p >= 1.0") return discd_array(self.internal_state, rk_logseries, size, op) # Multivariate distributions: From numpy-svn at scipy.org Mon Aug 25 09:35:30 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 25 Aug 2008 08:35:30 -0500 (CDT) Subject: [Numpy-svn] r5695 - trunk/numpy/testing Message-ID: <20080825133530.AC66839C635@scipy.org> Author: alan.mcintyre Date: 2008-08-25 08:35:27 -0500 (Mon, 25 Aug 2008) New Revision: 5695 Modified: trunk/numpy/testing/parametric.py Log: Added deprecation warning for numpy.testing.ParametricTestCase Modified: trunk/numpy/testing/parametric.py =================================================================== --- trunk/numpy/testing/parametric.py 2008-08-24 23:22:11 UTC (rev 5694) +++ trunk/numpy/testing/parametric.py 2008-08-25 13:35:27 UTC (rev 5695) @@ -40,6 +40,7 @@ __docformat__ = "restructuredtext en" import unittest +import warnings class _ParametricTestCase(unittest.TestCase): """TestCase subclass with support for parametric tests. @@ -59,6 +60,11 @@ #: to mutate the state you are using, which will alter later tests). _shareParTestPrefix = 'testsp' + def __init__(self, methodName = 'runTest'): + warnings.warn("ParametricTestCase will be removed in the next NumPy " + "release", DeprecationWarning) + unittest.TestCase.__init__(self, methodName) + def exec_test(self,test,args,result): """Execute a single test. Returns a success boolean""" From numpy-svn at scipy.org Mon Aug 25 12:36:31 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 25 Aug 2008 11:36:31 -0500 (CDT) Subject: [Numpy-svn] r5696 - in trunk/numpy/ma: . tests Message-ID: <20080825163631.0C24D39C635@scipy.org> Author: pierregm Date: 2008-08-25 11:36:27 -0500 (Mon, 25 Aug 2008) New Revision: 5696 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/mrecords.py trunk/numpy/ma/tests/test_core.py Log: core : make sure that masked_equal works with a list as input mrecords: make sure that the keys of self._optinfo are recognized as valid attributes. Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-08-25 13:35:27 UTC (rev 5695) +++ trunk/numpy/ma/core.py 2008-08-25 16:36:27 UTC (rev 5696) @@ -916,9 +916,8 @@ def masked_not_equal(x, value, copy=True): "Shortcut to masked_where, with condition = (x != value)." - return masked_where((x != value), x, copy=copy) + return masked_where(not_equal(x, value), x, copy=copy) -# def masked_equal(x, value, copy=True): """Shortcut to masked_where, with condition = (x == value). For floating point, consider `masked_values(x, value)` instead. @@ -929,7 +928,7 @@ # c = umath.equal(d, value) # m = mask_or(c, getmask(x)) # return array(d, mask=m, copy=copy) - return masked_where((x == value), x, copy=copy) + return masked_where(equal(x, value), x, copy=copy) def masked_inside(x, v1, v2, copy=True): """Shortcut to masked_where, where condition is True for x inside Modified: trunk/numpy/ma/mrecords.py =================================================================== --- trunk/numpy/ma/mrecords.py 2008-08-25 13:35:27 UTC (rev 5695) +++ trunk/numpy/ma/mrecords.py 2008-08-25 16:36:27 UTC (rev 5696) @@ -158,10 +158,11 @@ _fieldmask = getattr(obj, '_fieldmask', None) if _fieldmask is None: objmask = getattr(obj, '_mask', nomask) + _dtype = ndarray.__getattribute__(self,'dtype') if objmask is nomask: - _mask = ma.make_mask_none(self.shape, dtype=self.dtype) + _mask = ma.make_mask_none(self.shape, dtype=_dtype) else: - mdescr = ma.make_mask_descr(self.dtype) + mdescr = ma.make_mask_descr(_dtype) _mask = narray([tuple([m]*len(mdescr)) for m in objmask], dtype=mdescr).view(recarray) else: @@ -232,7 +233,7 @@ self.__setmask__(val) return # Create a shortcut (so that we don't have to call getattr all the time) - _localdict = self.__dict__ + _localdict = object.__getattribute__(self, '__dict__') # Check whether we're creating a new field newattr = attr not in _localdict try: @@ -241,7 +242,8 @@ except: # Not a generic attribute: exit if it's not a valid field fielddict = ndarray.__getattribute__(self,'dtype').fields or {} - if attr not in fielddict: + optinfo = ndarray.__getattribute__(self,'_optinfo') or {} + if not (attr in fielddict or attr in optinfo): exctype, value = sys.exc_info()[:2] raise exctype, value else: Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-08-25 13:35:27 UTC (rev 5695) +++ trunk/numpy/ma/tests/test_core.py 2008-08-25 16:36:27 UTC (rev 5696) @@ -1942,13 +1942,21 @@ xm.set_fill_value(1.e+20) self.info = (xm, ym) - # def test_masked_where_bool(self): x = [1,2] y = masked_where(False,x) assert_equal(y,[1,2]) assert_equal(y[1],2) + def test_masked_equal_wlist(self): + x = [1, 2, 3] + mx = masked_equal(x, 3) + assert_equal(mx, x) + assert_equal(mx._mask, [0,0,1]) + mx = masked_not_equal(x, 3) + assert_equal(mx, x) + assert_equal(mx._mask, [1,1,0]) + def test_masked_where_condition(self): "Tests masking functions." x = array([1.,2.,3.,4.,5.]) From numpy-svn at scipy.org Mon Aug 25 18:05:10 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 25 Aug 2008 17:05:10 -0500 (CDT) Subject: [Numpy-svn] r5697 - trunk/numpy/core Message-ID: <20080825220510.11C6939C635@scipy.org> Author: cdavid Date: 2008-08-25 17:05:06 -0500 (Mon, 25 Aug 2008) New Revision: 5697 Modified: trunk/numpy/core/SConscript trunk/numpy/core/setup.py Log: Detect whether trunc is available or not. Modified: trunk/numpy/core/SConscript =================================================================== --- trunk/numpy/core/SConscript 2008-08-25 16:36:27 UTC (rev 5696) +++ trunk/numpy/core/SConscript 2008-08-25 22:05:06 UTC (rev 5697) @@ -131,7 +131,7 @@ #---------------------------------- # Function to check: mfuncs = ('expl', 'expf', 'log1p', 'expm1', 'asinh', 'atanhf', 'atanhl', - 'isnan', 'isinf', 'rint') + 'isnan', 'isinf', 'rint', 'trunc') # Set value to 1 for each defined function (in math lib) mfuncs_defined = dict([(f, 0) for f in mfuncs]) Modified: trunk/numpy/core/setup.py =================================================================== --- trunk/numpy/core/setup.py 2008-08-25 16:36:27 UTC (rev 5696) +++ trunk/numpy/core/setup.py 2008-08-25 22:05:06 UTC (rev 5697) @@ -16,6 +16,7 @@ ('isnan', 'HAVE_ISNAN'), ('isinf', 'HAVE_ISINF'), ('rint', 'HAVE_RINT'), + ('trunc', 'HAVE_TRUNC'), ] def is_npy_no_signal(): From numpy-svn at scipy.org Mon Aug 25 18:05:24 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 25 Aug 2008 17:05:24 -0500 (CDT) Subject: [Numpy-svn] r5698 - trunk/numpy/core/src Message-ID: <20080825220524.F2AD339C635@scipy.org> Author: cdavid Date: 2008-08-25 17:05:21 -0500 (Mon, 25 Aug 2008) New Revision: 5698 Modified: trunk/numpy/core/src/umathmodule.c.src Log: Add pure C trunc function implementations for platform which do not have it. Modified: trunk/numpy/core/src/umathmodule.c.src =================================================================== --- trunk/numpy/core/src/umathmodule.c.src 2008-08-25 22:05:06 UTC (rev 5697) +++ trunk/numpy/core/src/umathmodule.c.src 2008-08-25 22:05:21 UTC (rev 5698) @@ -326,10 +326,24 @@ } #endif +#ifndef HAVE_TRUNC +static double +trunc (double x) +{ + double y, r; + if (x < 0) { + return - floor(-x); + } else { + return x; + } +} +#endif + + /* Define isnan, isinf, isfinite, signbit if needed */ /* Use fpclassify if possible */ /* isnan, isinf -- @@ -461,10 +475,10 @@ /**begin repeat - #kind=(sin,cos,tan,sinh,cosh,tanh,fabs,floor,ceil,sqrt,log10,log,exp,asin,acos,atan,rint)*2# - #typ=longdouble*17, float*17# - #c=l*17,f*17# - #TYPE=LONGDOUBLE*17, FLOAT*17# + #kind=(sin,cos,tan,sinh,cosh,tanh,fabs,floor,ceil,trunc,sqrt,log10,log,exp,asin,acos,atan,rint)*2# + #typ=longdouble*18, float*18# + #c=l*18,f*18# + #TYPE=LONGDOUBLE*18, FLOAT*18# */ #ifndef HAVE_ at TYPE@_FUNCS From numpy-svn at scipy.org Mon Aug 25 18:05:46 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 25 Aug 2008 17:05:46 -0500 (CDT) Subject: [Numpy-svn] r5699 - in trunk/numpy/core: code_generators src Message-ID: <20080825220546.59FF839C635@scipy.org> Author: cdavid Date: 2008-08-25 17:05:29 -0500 (Mon, 25 Aug 2008) New Revision: 5699 Modified: trunk/numpy/core/code_generators/docstrings.py trunk/numpy/core/code_generators/generate_umath.py trunk/numpy/core/src/arrayobject.c trunk/numpy/core/src/umathmodule.c.src Log: Add a trunc function in umath module. Modified: trunk/numpy/core/code_generators/docstrings.py =================================================================== --- trunk/numpy/core/code_generators/docstrings.py 2008-08-25 22:05:21 UTC (rev 5698) +++ trunk/numpy/core/code_generators/docstrings.py 2008-08-25 22:05:29 UTC (rev 5699) @@ -689,6 +689,31 @@ """) +add_newdoc('numpy.core.umath', 'trunc', + """ + Return the truncated value of the input, element-wise. + + The truncated value of the scalar `x` is the nearest integer `i`, such + that i is not larger than x amplitude + + Parameters + ---------- + x : array_like + Input data. + + Returns + ------- + y : {ndarray, scalar} + The truncated value of each element in `x`. + + Examples + -------- + >>> a = np.array([-1.7, -1.5, -0.2, 0.2, 1.5, 1.7, 2.0]) + >>> np.ceil(a) + array([-1., -1., -0., 0., 1., 1., 2.]) + + """) + add_newdoc('numpy.core.umath', 'conjugate', """ Return the complex conjugate, element-wise. Modified: trunk/numpy/core/code_generators/generate_umath.py =================================================================== --- trunk/numpy/core/code_generators/generate_umath.py 2008-08-25 22:05:21 UTC (rev 5698) +++ trunk/numpy/core/code_generators/generate_umath.py 2008-08-25 22:05:29 UTC (rev 5699) @@ -476,6 +476,12 @@ TD(flts, f='ceil'), TD(M, f='ceil'), ), +'trunc' : + Ufunc(1, 1, None, + docstrings.get('numpy.core.umath.trunc'), + TD(flts, f='trunc'), + TD(M, f='trunc'), + ), 'fabs' : Ufunc(1, 1, None, docstrings.get('numpy.core.umath.fabs'), Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-08-25 22:05:21 UTC (rev 5698) +++ trunk/numpy/core/src/arrayobject.c 2008-08-25 22:05:29 UTC (rev 5699) @@ -3351,6 +3351,7 @@ *logical_and, *floor, *ceil, + *trunc, *maximum, *minimum, *rint, @@ -3408,6 +3409,7 @@ SET(logical_and); SET(floor); SET(ceil); + SET(trunc); SET(maximum); SET(minimum); SET(rint); @@ -3458,6 +3460,7 @@ GET(logical_and); GET(floor); GET(ceil); + GET(trunc); GET(maximum); GET(minimum); GET(rint); Modified: trunk/numpy/core/src/umathmodule.c.src =================================================================== --- trunk/numpy/core/src/umathmodule.c.src 2008-08-25 22:05:21 UTC (rev 5698) +++ trunk/numpy/core/src/umathmodule.c.src 2008-08-25 22:05:29 UTC (rev 5699) @@ -333,7 +333,7 @@ double y, r; if (x < 0) { - return - floor(-x); + return - floor(-x); } else { return x; } From numpy-svn at scipy.org Mon Aug 25 18:05:55 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 25 Aug 2008 17:05:55 -0500 (CDT) Subject: [Numpy-svn] r5700 - trunk/numpy/core/tests Message-ID: <20080825220555.70E1639C635@scipy.org> Author: cdavid Date: 2008-08-25 17:05:51 -0500 (Mon, 25 Aug 2008) New Revision: 5700 Modified: trunk/numpy/core/tests/test_ufunc.py Log: Add trunc test. Modified: trunk/numpy/core/tests/test_ufunc.py =================================================================== --- trunk/numpy/core/tests/test_ufunc.py 2008-08-25 22:05:29 UTC (rev 5699) +++ trunk/numpy/core/tests/test_ufunc.py 2008-08-25 22:05:51 UTC (rev 5700) @@ -181,6 +181,7 @@ n 1 log1p flts + M n 1 sqrt flts + M real x < 0 raises error n 1 ceil real + M + n 1 trunc real + M n 1 floor real + M n 1 fabs real + M n 1 rint flts + M From numpy-svn at scipy.org Mon Aug 25 18:06:03 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 25 Aug 2008 17:06:03 -0500 (CDT) Subject: [Numpy-svn] r5701 - trunk/numpy/lib/tests Message-ID: <20080825220603.192D639C635@scipy.org> Author: cdavid Date: 2008-08-25 17:06:00 -0500 (Mon, 25 Aug 2008) New Revision: 5701 Modified: trunk/numpy/lib/tests/test_ufunclike.py Log: Fix fix tests. Modified: trunk/numpy/lib/tests/test_ufunclike.py =================================================================== --- trunk/numpy/lib/tests/test_ufunclike.py 2008-08-25 22:05:51 UTC (rev 5700) +++ trunk/numpy/lib/tests/test_ufunclike.py 2008-08-25 22:06:00 UTC (rev 5701) @@ -6,14 +6,14 @@ >>> a = nx.array([[1.0, 1.1, 1.5, 1.8], [-1.0, -1.1, -1.5, -1.8]]) >>> U.fix(a) array([[ 1., 1., 1., 1.], - [ 0., -1., -1., -1.]]) + [-1., -1., -1., -1.]]) >>> y = nx.zeros(a.shape, float) >>> U.fix(a, y) array([[ 1., 1., 1., 1.], - [ 0., -1., -1., -1.]]) + [-1., -1., -1., -1.]]) >>> y array([[ 1., 1., 1., 1.], - [ 0., -1., -1., -1.]]) + [-1., -1., -1., -1.]]) Test isposinf, isneginf, sign >>> a = nx.array([nx.Inf, -nx.Inf, nx.NaN, 0.0, 3.0, -3.0]) From numpy-svn at scipy.org Mon Aug 25 18:06:11 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 25 Aug 2008 17:06:11 -0500 (CDT) Subject: [Numpy-svn] r5702 - trunk/numpy/lib Message-ID: <20080825220611.4D24C39C635@scipy.org> Author: cdavid Date: 2008-08-25 17:06:08 -0500 (Mon, 25 Aug 2008) New Revision: 5702 Modified: trunk/numpy/lib/ufunclike.py Log: Use trunc as fix implementation. Modified: trunk/numpy/lib/ufunclike.py =================================================================== --- trunk/numpy/lib/ufunclike.py 2008-08-25 22:06:00 UTC (rev 5701) +++ trunk/numpy/lib/ufunclike.py 2008-08-25 22:06:08 UTC (rev 5702) @@ -11,17 +11,8 @@ def fix(x, y=None): """ Round x to nearest integer towards zero. """ - x = asanyarray(x) - if y is None: - y = nx.floor(x) - else: - nx.floor(x, y) - if x.ndim == 0: - if (x<0): - y += 1 - else: - y[x<0] = y[x<0]+1 - return y + # fix is now implemented in C, using the C99 trunc function. + return umath.trunc(x, y) def isposinf(x, y=None): """ From numpy-svn at scipy.org Tue Aug 26 01:33:29 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Aug 2008 00:33:29 -0500 (CDT) Subject: [Numpy-svn] r5703 - trunk/numpy/core/include/numpy Message-ID: <20080826053329.1077839C68E@scipy.org> Author: stefan Date: 2008-08-26 00:32:57 -0500 (Tue, 26 Aug 2008) New Revision: 5703 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h Log: Add NPY_FEATURE_VERSION which can be used to mark minor API version increments. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-25 22:06:08 UTC (rev 5702) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-08-26 05:32:57 UTC (rev 5703) @@ -38,13 +38,26 @@ #define NPY_FAIL 0 #define NPY_SUCCEED 1 - /* Helpful to distinguish what is installed */ +/* Binary compatibility version number. This number is increased + whenever the C-API is changed such that binary compatibility is + broken, i.e. whenever a recompile of extension modules is + needed. */ #define NPY_VERSION 0x01000009 - /* Some platforms don't define bool, long long, or long double. - Handle that here. - */ +/* Minor API version. This number is increased whenever a change is + made to the C-API -- whether it breaks binary compatibility or not. + Some changes, such as adding a function pointer to the end of the + function table, can be made without breaking binary compatibility. + In this case, only the NPY_FEATURE_VERSION (*not* NPY_VERSION) + would be increased. Whenever binary compatibility is broken, both + NPY_VERSION and NPY_FEATURE_VERSION should be increased. + */ +#define NPY_FEATURE_VERSION 0x00000001 +/* Some platforms don't define bool, long long, or long double. + Handle that here. +*/ + #define NPY_BYTE_FMT "hhd" #define NPY_UBYTE_FMT "hhu" #define NPY_SHORT_FMT "hd" From numpy-svn at scipy.org Tue Aug 26 14:41:58 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Aug 2008 13:41:58 -0500 (CDT) Subject: [Numpy-svn] r5704 - in trunk/numpy: lib testing Message-ID: <20080826184158.45B5939C717@scipy.org> Author: alan.mcintyre Date: 2008-08-26 13:41:53 -0500 (Tue, 26 Aug 2008) New Revision: 5704 Modified: trunk/numpy/lib/setup.py trunk/numpy/testing/nosetester.py Log: Added benchmarks directory to lib/setup.py so that numpy.lib benchmarks are available in an installed NumPy. Display system configuration information when benchmarks are run. Modified: trunk/numpy/lib/setup.py =================================================================== --- trunk/numpy/lib/setup.py 2008-08-26 05:32:57 UTC (rev 5703) +++ trunk/numpy/lib/setup.py 2008-08-26 18:41:53 UTC (rev 5704) @@ -12,6 +12,7 @@ sources=[join('src','_compiled_base.c')] ) + config.add_data_dir('benchmarks') config.add_data_dir('tests') return config Modified: trunk/numpy/testing/nosetester.py =================================================================== --- trunk/numpy/testing/nosetester.py 2008-08-26 05:32:57 UTC (rev 5703) +++ trunk/numpy/testing/nosetester.py 2008-08-26 18:41:53 UTC (rev 5704) @@ -144,7 +144,25 @@ argv += extra_argv return argv + def _show_system_info(self): + nose = import_nose() + import numpy + print "NumPy version %s" % numpy.__version__ + npdir = os.path.dirname(numpy.__file__) + print "NumPy is installed in %s" % npdir + + if 'scipy' in self.package_name: + import scipy + print "SciPy version %s" % scipy.__version__ + spdir = os.path.dirname(scipy.__file__) + print "SciPy is installed in %s" % spdir + + pyversion = sys.version.replace('\n','') + print "Python version %s" % pyversion + print "nose version %d.%d.%d" % nose.__versioninfo__ + + def test(self, label='fast', verbose=1, extra_argv=None, doctests=False, coverage=False, **kwargs): ''' Run tests for module using nose @@ -216,23 +234,10 @@ argv += ['--exclude','swig_ext'] argv += ['--exclude','array_from_pyobj'] + self._show_system_info() + nose = import_nose() - import numpy - print "NumPy version %s" % numpy.__version__ - npdir = os.path.dirname(numpy.__file__) - print "NumPy is installed in %s" % npdir - - if 'scipy' in self.package_name: - import scipy - print "SciPy version %s" % scipy.__version__ - spdir = os.path.dirname(scipy.__file__) - print "SciPy is installed in %s" % spdir - - pyversion = sys.version.replace('\n','') - print "Python version %s" % pyversion - print "nose version %d.%d.%d" % nose.__versioninfo__ - # Because nose currently discards the test result object, but we need # to return it to the user, override TestProgram.runTests to retain # the result @@ -274,6 +279,10 @@ ''' Run benchmarks for module using nose %(test_header)s''' + + print "Running benchmarks for %s" % self.package_name + self._show_system_info() + nose = import_nose() argv = self._test_argv(label, verbose, extra_argv) argv += ['--match', r'(?:^|[\\b_\\.%s-])[Bb]ench' % os.sep] From numpy-svn at scipy.org Tue Aug 26 15:30:51 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Aug 2008 14:30:51 -0500 (CDT) Subject: [Numpy-svn] r5705 - trunk/numpy/ma Message-ID: <20080826193051.34C1039C19A@scipy.org> Author: charris Date: 2008-08-26 14:30:50 -0500 (Tue, 26 Aug 2008) New Revision: 5705 Modified: trunk/numpy/ma/core.py Log: BUG: fix part of ticket #893 Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-08-26 18:41:53 UTC (rev 5704) +++ trunk/numpy/ma/core.py 2008-08-26 19:30:50 UTC (rev 5705) @@ -328,6 +328,7 @@ if not subok: return data.view(ndarray) return data + getdata = get_data def fix_invalid(a, mask=nomask, copy=True, fill_value=None): @@ -522,7 +523,7 @@ self.__name__ = getattr(mbfunc, "__name__", str(mbfunc)) ufunc_domain[mbfunc] = None ufunc_fills[mbfunc] = (fillx, filly) - # + def __call__ (self, a, b, *args, **kwargs): "Execute the call behavior." m = mask_or(getmask(a), getmask(b)) @@ -539,7 +540,7 @@ elif m: return masked return result - # + def reduce(self, target, axis=0, dtype=None): """Reduce `target` along the given `axis`.""" if isinstance(target, MaskedArray): @@ -3846,9 +3847,11 @@ if len(fb.shape) == 0: fb.shape = (1,) return np.inner(fa, fb).view(MaskedArray) -inner.__doc__ = np.inner.__doc__ -inner.__doc__ += doc_note("Masked values are replaced by 0.") + innerproduct = inner +if np.inner.__doc__ is not None : + notes = doc_note("Masked values are replaced by 0.") + inner.__doc__ = np.inner.__doc__ + notes def outer(a, b): "maskedarray version of the numpy function." @@ -3863,9 +3866,11 @@ mb = getmaskarray(b) m = make_mask(1-np.outer(1-ma, 1-mb), copy=0) return masked_array(d, mask=m) -outer.__doc__ = np.outer.__doc__ -outer.__doc__ += doc_note("Masked values are replaced by 0.") + outerproduct = outer +if np.outer.__doc__ is not None : + notes = doc_note("Masked values are replaced by 0.") + outer.__doc__ = np.outer.__doc__ + notes def allequal (a, b, fill_value=True): """Return True if all entries of a and b are equal, using From numpy-svn at scipy.org Tue Aug 26 15:32:04 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Aug 2008 14:32:04 -0500 (CDT) Subject: [Numpy-svn] r5706 - trunk/numpy/ma Message-ID: <20080826193204.E2D6139C19A@scipy.org> Author: charris Date: 2008-08-26 14:32:02 -0500 (Tue, 26 Aug 2008) New Revision: 5706 Modified: trunk/numpy/ma/extras.py Log: Small style cleanup. Need work for ticket #893. Modified: trunk/numpy/ma/extras.py =================================================================== --- trunk/numpy/ma/extras.py 2008-08-26 19:30:50 UTC (rev 5705) +++ trunk/numpy/ma/extras.py 2008-08-26 19:32:02 UTC (rev 5706) @@ -98,10 +98,12 @@ def __init__(self, funcname): self.__name__ = funcname self.__doc__ = self.getdoc() + def getdoc(self): "Retrieves the __doc__ string from the function." return getattr(np, self.__name__).__doc__ +\ "*Notes*:\n (The function is applied to both the _data and the _mask, if any.)" + def __call__(self, *args, **params): func = getattr(np, self.__name__) if len(args)==1: From numpy-svn at scipy.org Tue Aug 26 18:19:46 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Aug 2008 17:19:46 -0500 (CDT) Subject: [Numpy-svn] r5707 - trunk/numpy/ma Message-ID: <20080826221946.A028439C15C@scipy.org> Author: pierregm Date: 2008-08-26 17:19:44 -0500 (Tue, 26 Aug 2008) New Revision: 5707 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/extras.py Log: Updated doc + -OO compatibility Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-08-26 19:32:02 UTC (rev 5706) +++ trunk/numpy/ma/core.py 2008-08-26 22:19:44 UTC (rev 5707) @@ -81,8 +81,17 @@ -def doc_note(note): - return "\nNotes\n-----\n%s" % note +def doc_note(initialdoc, note): + if initialdoc is None: + return + newdoc = """ + %s + + Notes + ----- + %s + """ + return newdoc % (initialdoc, note) #####-------------------------------------------------------------------------- #---- --- Exceptions --- @@ -781,7 +790,7 @@ return m.dtype.type is MaskType except AttributeError: return False -# + def make_mask(m, copy=False, shrink=True, flag=None): """Return m as a mask, creating a copy if necessary or requested. @@ -865,14 +874,16 @@ return m1 return make_mask(umath.logical_or(m1, m2), copy=copy, shrink=shrink) + #####-------------------------------------------------------------------------- #--- --- Masking functions --- #####-------------------------------------------------------------------------- + def masked_where(condition, a, copy=True): - """Return a as an array masked where condition is true. + """ + Return ``a`` as an array masked where ``condition`` is True. + Masked values of ``a`` or ``condition`` are kept. - Masked values of a or condition are kept. - Parameters ---------- condition : array_like @@ -880,7 +891,7 @@ a : array_like Array to mask. copy : bool - Whether to return a copy of a (True) or modify a in place. + Whether to return a copy of ``a`` (True) or modify ``a`` in place (False). """ cond = make_mask(condition) @@ -920,8 +931,9 @@ return masked_where(not_equal(x, value), x, copy=copy) def masked_equal(x, value, copy=True): - """Shortcut to masked_where, with condition = (x == value). For - floating point, consider `masked_values(x, value)` instead. + """ + Shortcut to masked_where, with condition = (x == value). For + floating point, consider ``masked_values(x, value)`` instead. """ # An alternative implementation relies on filling first: probably not needed. @@ -932,7 +944,8 @@ return masked_where(equal(x, value), x, copy=copy) def masked_inside(x, v1, v2, copy=True): - """Shortcut to masked_where, where condition is True for x inside + """ + Shortcut to masked_where, where ``condition`` is True for x inside the interval [v1,v2] (v1 <= x <= v2). The boundaries v1 and v2 can be given in either order. @@ -948,9 +961,10 @@ return masked_where(condition, x, copy=copy) def masked_outside(x, v1, v2, copy=True): - """Shortcut to masked_where, where condition is True for x outside - the interval [v1,v2] (x < v1)|(x > v2). The boundaries v1 and v2 - can be given in either order. + """ + Shortcut to ``masked_where``, where ``condition`` is True for x outside + the interval [v1,v2] (x < v1)|(x > v2). + The boundaries v1 and v2 can be given in either order. Notes ----- @@ -965,10 +979,11 @@ # def masked_object(x, value, copy=True, shrink=True): - """Mask the array x where the data are exactly equal to value. + """ + Mask the array ``x`` where the data are exactly equal to value. This function is suitable only for object arrays: for floating - point, please use ``masked_values`` instead. + point, please use :func:`masked_values` instead. Parameters ---------- @@ -992,13 +1007,14 @@ return masked_array(x, mask=mask, copy=copy, fill_value=value) def masked_values(x, value, rtol=1.e-5, atol=1.e-8, copy=True, shrink=True): - """Mask the array x where the data are approximately equal in + """ + Mask the array x where the data are approximately equal in value, i.e. (abs(x - value) <= atol+rtol*abs(value)) Suitable only for floating points. For integers, please use - ``masked_equal``. The mask is set to nomask if posible. + :func:`masked_equal`. The mask is set to ``nomask`` if posible. Parameters ---------- @@ -1028,8 +1044,9 @@ return masked_array(xnew, mask=mask, copy=copy, fill_value=value) def masked_invalid(a, copy=True): - """Mask the array for invalid values (nans or infs). Any - preexisting mask is conserved. + """ + Mask the array for invalid values (NaNs or infs). + Any preexisting mask is conserved. """ a = np.array(a, copy=copy, subok=True) @@ -1048,8 +1065,8 @@ #---- --- Printing options --- #####-------------------------------------------------------------------------- class _MaskedPrintOption: - """Handle the string used to represent missing data in a masked - array. + """ + Handle the string used to represent missing data in a masked array. """ def __init__ (self, display): @@ -1087,7 +1104,8 @@ #............................................................................... class _arraymethod(object): - """Define a wrapper for basic array methods. + """ + Define a wrapper for basic array methods. Upon call, returns a masked array, where the new _data array is the output of the corresponding method called on the original @@ -1170,7 +1188,8 @@ class MaskedArray(ndarray): - """Arrays with possibly masked values. Masked values of True + """ + Arrays with possibly masked values. Masked values of True exclude the corresponding element from any computation. Construction: @@ -3839,7 +3858,6 @@ def inner(a, b): - "maskedarray version of the numpy function." fa = filled(a, 0) fb = filled(b, 0) if len(fa.shape) == 0: @@ -3847,7 +3865,12 @@ if len(fb.shape) == 0: fb.shape = (1,) return np.inner(fa, fb).view(MaskedArray) +<<<<<<< .mine +inner.__doc__ = doc_note(np.inner.__doc__, + "Masked values are replaced by 0.") +======= +>>>>>>> .r5706 innerproduct = inner if np.inner.__doc__ is not None : notes = doc_note("Masked values are replaced by 0.") @@ -3866,7 +3889,12 @@ mb = getmaskarray(b) m = make_mask(1-np.outer(1-ma, 1-mb), copy=0) return masked_array(d, mask=m) +<<<<<<< .mine +outer.__doc__ = doc_note(np.outer.__doc__, + "Masked values are replaced by 0.") +======= +>>>>>>> .r5706 outerproduct = outer if np.outer.__doc__ is not None : notes = doc_note("Masked values are replaced by 0.") Modified: trunk/numpy/ma/extras.py =================================================================== --- trunk/numpy/ma/extras.py 2008-08-26 19:32:02 UTC (rev 5706) +++ trunk/numpy/ma/extras.py 2008-08-26 22:19:44 UTC (rev 5707) @@ -95,15 +95,21 @@ #####-------------------------------------------------------------------------- class _fromnxfunction: """Defines a wrapper to adapt numpy functions to masked arrays.""" + def __init__(self, funcname): self.__name__ = funcname self.__doc__ = self.getdoc() def getdoc(self): "Retrieves the __doc__ string from the function." - return getattr(np, self.__name__).__doc__ +\ - "*Notes*:\n (The function is applied to both the _data and the _mask, if any.)" + inidoc = getattr(np, self.__name__).__doc__ + if inidoc: + locdoc = "Notes\n-----\nThe function is applied to both the _data"\ + " and the _mask, if any." + return '\n'.join((inidoc, locdoc)) + return + def __call__(self, *args, **params): func = getattr(np, self.__name__) if len(args)==1: From numpy-svn at scipy.org Tue Aug 26 18:34:15 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Aug 2008 17:34:15 -0500 (CDT) Subject: [Numpy-svn] r5708 - trunk/numpy/ma Message-ID: <20080826223415.45B8A39C15C@scipy.org> Author: pierregm Date: 2008-08-26 17:34:13 -0500 (Tue, 26 Aug 2008) New Revision: 5708 Modified: trunk/numpy/ma/core.py Log: * fixing botched previous commit Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-08-26 22:19:44 UTC (rev 5707) +++ trunk/numpy/ma/core.py 2008-08-26 22:34:13 UTC (rev 5708) @@ -3865,16 +3865,9 @@ if len(fb.shape) == 0: fb.shape = (1,) return np.inner(fa, fb).view(MaskedArray) -<<<<<<< .mine inner.__doc__ = doc_note(np.inner.__doc__, "Masked values are replaced by 0.") -======= - ->>>>>>> .r5706 innerproduct = inner -if np.inner.__doc__ is not None : - notes = doc_note("Masked values are replaced by 0.") - inner.__doc__ = np.inner.__doc__ + notes def outer(a, b): "maskedarray version of the numpy function." @@ -3889,16 +3882,9 @@ mb = getmaskarray(b) m = make_mask(1-np.outer(1-ma, 1-mb), copy=0) return masked_array(d, mask=m) -<<<<<<< .mine outer.__doc__ = doc_note(np.outer.__doc__, "Masked values are replaced by 0.") -======= - ->>>>>>> .r5706 outerproduct = outer -if np.outer.__doc__ is not None : - notes = doc_note("Masked values are replaced by 0.") - outer.__doc__ = np.outer.__doc__ + notes def allequal (a, b, fill_value=True): """Return True if all entries of a and b are equal, using From numpy-svn at scipy.org Tue Aug 26 21:18:29 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Aug 2008 20:18:29 -0500 (CDT) Subject: [Numpy-svn] r5709 - trunk/numpy/testing Message-ID: <20080827011829.1B91639C09F@scipy.org> Author: alan.mcintyre Date: 2008-08-26 20:18:26 -0500 (Tue, 26 Aug 2008) New Revision: 5709 Modified: trunk/numpy/testing/nosetester.py Log: Make _docmethod work correctly when run with -OO Modified: trunk/numpy/testing/nosetester.py =================================================================== --- trunk/numpy/testing/nosetester.py 2008-08-26 22:34:13 UTC (rev 5708) +++ trunk/numpy/testing/nosetester.py 2008-08-27 01:18:26 UTC (rev 5709) @@ -82,7 +82,8 @@ List with any extra args to pass to nosetests''' \ % {'testtype': testtype} - meth.__doc__ = meth.__doc__ % {'test_header':test_header} + if meth.__doc__: + meth.__doc__ = meth.__doc__ % {'test_header':test_header} class NoseTester(object): From numpy-svn at scipy.org Tue Aug 26 21:49:06 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Aug 2008 20:49:06 -0500 (CDT) Subject: [Numpy-svn] r5710 - trunk/numpy/testing Message-ID: <20080827014906.9332939C09F@scipy.org> Author: alan.mcintyre Date: 2008-08-26 20:48:54 -0500 (Tue, 26 Aug 2008) New Revision: 5710 Modified: trunk/numpy/testing/nosetester.py Log: Bail out of _docmethod earlier if method has no docstring. Modified: trunk/numpy/testing/nosetester.py =================================================================== --- trunk/numpy/testing/nosetester.py 2008-08-27 01:18:26 UTC (rev 5709) +++ trunk/numpy/testing/nosetester.py 2008-08-27 01:48:54 UTC (rev 5710) @@ -62,6 +62,9 @@ # contructs NoseTester method docstrings def _docmethod(meth, testtype): + if not meth.__doc__: + return + test_header = \ '''Parameters ---------- @@ -82,8 +85,7 @@ List with any extra args to pass to nosetests''' \ % {'testtype': testtype} - if meth.__doc__: - meth.__doc__ = meth.__doc__ % {'test_header':test_header} + meth.__doc__ = meth.__doc__ % {'test_header':test_header} class NoseTester(object): From numpy-svn at scipy.org Tue Aug 26 23:18:00 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Aug 2008 22:18:00 -0500 (CDT) Subject: [Numpy-svn] r5711 - in trunk/numpy: core/code_generators core/src lib Message-ID: <20080827031800.6858539C09F@scipy.org> Author: charris Date: 2008-08-26 22:17:51 -0500 (Tue, 26 Aug 2008) New Revision: 5711 Modified: trunk/numpy/core/code_generators/generate_umath.py trunk/numpy/core/src/arrayobject.c trunk/numpy/core/src/umathmodule.c.src trunk/numpy/lib/ufunclike.py Log: Revert r5698, r5699, and r5702 until build problems are fixed. Fix ticket #878 differently. Modified: trunk/numpy/core/code_generators/generate_umath.py =================================================================== --- trunk/numpy/core/code_generators/generate_umath.py 2008-08-27 01:48:54 UTC (rev 5710) +++ trunk/numpy/core/code_generators/generate_umath.py 2008-08-27 03:17:51 UTC (rev 5711) @@ -476,12 +476,6 @@ TD(flts, f='ceil'), TD(M, f='ceil'), ), -'trunc' : - Ufunc(1, 1, None, - docstrings.get('numpy.core.umath.trunc'), - TD(flts, f='trunc'), - TD(M, f='trunc'), - ), 'fabs' : Ufunc(1, 1, None, docstrings.get('numpy.core.umath.fabs'), Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-08-27 01:48:54 UTC (rev 5710) +++ trunk/numpy/core/src/arrayobject.c 2008-08-27 03:17:51 UTC (rev 5711) @@ -3351,7 +3351,6 @@ *logical_and, *floor, *ceil, - *trunc, *maximum, *minimum, *rint, @@ -3409,7 +3408,6 @@ SET(logical_and); SET(floor); SET(ceil); - SET(trunc); SET(maximum); SET(minimum); SET(rint); @@ -3460,7 +3458,6 @@ GET(logical_and); GET(floor); GET(ceil); - GET(trunc); GET(maximum); GET(minimum); GET(rint); Modified: trunk/numpy/core/src/umathmodule.c.src =================================================================== --- trunk/numpy/core/src/umathmodule.c.src 2008-08-27 01:48:54 UTC (rev 5710) +++ trunk/numpy/core/src/umathmodule.c.src 2008-08-27 03:17:51 UTC (rev 5711) @@ -302,10 +302,10 @@ } #endif - #ifndef HAVE_RINT +/* needs cleanup */ static double -rint (double x) +rint(double x) { double y, r; @@ -326,20 +326,24 @@ } #endif +/* + * Comment out trunc definition until build problems are fixed. + */ +/* #ifndef HAVE_TRUNC static double -trunc (double x) +trunc(double x) { - double y, r; - if (x < 0) { - return - floor(-x); - } else { - return x; + return -floor(-x); } + else { + return floor(x); + } } #endif +*/ @@ -475,10 +479,10 @@ /**begin repeat - #kind=(sin,cos,tan,sinh,cosh,tanh,fabs,floor,ceil,trunc,sqrt,log10,log,exp,asin,acos,atan,rint)*2# - #typ=longdouble*18, float*18# - #c=l*18,f*18# - #TYPE=LONGDOUBLE*18, FLOAT*18# + #kind=(sin,cos,tan,sinh,cosh,tanh,fabs,floor,ceil,sqrt,log10,log,exp,asin,acos,atan,rint)*2# + #typ=longdouble*17, float*17# + #c=l*17,f*17# + #TYPE=LONGDOUBLE*17, FLOAT*17# */ #ifndef HAVE_ at TYPE@_FUNCS Modified: trunk/numpy/lib/ufunclike.py =================================================================== --- trunk/numpy/lib/ufunclike.py 2008-08-27 01:48:54 UTC (rev 5710) +++ trunk/numpy/lib/ufunclike.py 2008-08-27 03:17:51 UTC (rev 5711) @@ -5,14 +5,17 @@ __all__ = ['fix', 'isneginf', 'isposinf', 'log2'] import numpy.core.numeric as nx -from numpy.core.numeric import asarray, empty, isinf, signbit, asanyarray -import numpy.core.umath as umath def fix(x, y=None): """ Round x to nearest integer towards zero. """ - # fix is now implemented in C, using the C99 trunc function. - return umath.trunc(x, y) + x = nx.asanyarray(x) + if y is None: + y = nx.zeros_like(x) + y1 = nx.floor(x) + y2 = nx.ceil(x) + y[...] = nx.where(x >= 0, y1, y2) + return y def isposinf(x, y=None): """ @@ -41,9 +44,9 @@ """ if y is None: - x = asarray(x) - y = empty(x.shape, dtype=nx.bool_) - umath.logical_and(isinf(x), ~signbit(x), y) + x = nx.asarray(x) + y = nx.empty(x.shape, dtype=nx.bool_) + nx.logical_and(nx.isinf(x), ~nx.signbit(x), y) return y def isneginf(x, y=None): @@ -73,12 +76,12 @@ """ if y is None: - x = asarray(x) - y = empty(x.shape, dtype=nx.bool_) - umath.logical_and(isinf(x), signbit(x), y) + x = nx.asarray(x) + y = nx.empty(x.shape, dtype=nx.bool_) + nx.logical_and(nx.isinf(x), nx.signbit(x), y) return y -_log2 = umath.log(2) +_log2 = nx.log(2) def log2(x, y=None): """ Return the base 2 logarithm. @@ -107,10 +110,10 @@ array([ NaN, 1., 2.]) """ - x = asanyarray(x) + x = nx.asanyarray(x) if y is None: - y = umath.log(x) + y = nx.log(x) else: - umath.log(x, y) + nx.log(x, y) y /= _log2 return y From numpy-svn at scipy.org Wed Aug 27 00:46:24 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 26 Aug 2008 23:46:24 -0500 (CDT) Subject: [Numpy-svn] r5712 - trunk/numpy/core/src Message-ID: <20080827044624.0AA1539C09F@scipy.org> Author: charris Date: 2008-08-26 23:46:17 -0500 (Tue, 26 Aug 2008) New Revision: 5712 Modified: trunk/numpy/core/src/umathmodule.c.src Log: Simplify (commented out) trunc. Modified: trunk/numpy/core/src/umathmodule.c.src =================================================================== --- trunk/numpy/core/src/umathmodule.c.src 2008-08-27 03:17:51 UTC (rev 5711) +++ trunk/numpy/core/src/umathmodule.c.src 2008-08-27 04:46:17 UTC (rev 5712) @@ -335,7 +335,7 @@ trunc(double x) { if (x < 0) { - return -floor(-x); + return ceil(x); } else { return floor(x); From numpy-svn at scipy.org Wed Aug 27 06:05:43 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 27 Aug 2008 05:05:43 -0500 (CDT) Subject: [Numpy-svn] r5713 - trunk/numpy/doc Message-ID: <20080827100543.AE06C39C09F@scipy.org> Author: matthew.brett at gmail.com Date: 2008-08-27 05:05:41 -0500 (Wed, 27 Aug 2008) New Revision: 5713 Added: trunk/numpy/doc/subclassing.py Log: Document on subclassing Added: trunk/numpy/doc/subclassing.py =================================================================== --- trunk/numpy/doc/subclassing.py 2008-08-27 04:46:17 UTC (rev 5712) +++ trunk/numpy/doc/subclassing.py 2008-08-27 10:05:41 UTC (rev 5713) @@ -0,0 +1,291 @@ +""" +============================= +Subclassing ndarray in python +============================= + +Credits +------- + +This page is based with thanks on the wiki page on subclassing by Pierre +Gerard-Marchant - http://www.scipy.org/Subclasses. + +Introduction +------------ +Subclassing ndarray is relatively simple, but you will need to +understand some behavior of ndarrays to understand some minor +complications to subclassing. There are examples at the bottom of the +page, but you will probably want to read the background to understand +why subclassing works as it does. + +ndarrays and object creation +============================ +The creation of ndarrays is complicated by the need to return views of +ndarrays, that are also ndarrays. For example:: + + >>> import numpy as np + >>> arr = np.zeros((3,)) + >>> type(arr) + + >>> v = arr[1:] + >>> type(v) + + >>> v is arr + False + +So, when we take a view (here a slice) from the ndarray, we return a +new ndarray, that points to the data in the original. When we +subclass ndarray, taking a view (such as a slice) needs to return an +object of our own class. There is machinery to do this, but it is +this machinery that makes subclassing slightly non-standard. + +To allow subclassing, and views of subclasses, ndarray uses the +ndarray ``__new__`` method for the main work of object initialization, +rather then the more usual ``__init__`` method. + +``__new__`` and ``__init__`` +============================ + +``__new__`` is a standard python method, and, if present, is called +before ``__init__`` when we create a class instance. Consider the +following:: + + class C(object): + def __new__(cls, *args): + print 'Args in __new__:', args + return object.__new__(cls, *args) + def __init__(self, *args): + print 'Args in __init__:', args + + C('hello') + +The code gives the following output:: + + cls is: + Args in __new__: ('hello',) + self is : <__main__.C object at 0xb7dc720c> + Args in __init__: ('hello',) + +When we call ``C('hello')``, the ``__new__`` method gets its own class +as first argument, and the passed argument, which is the string +``'hello'``. After python calls ``__new__``, it usually (see below) +calls our ``__init__`` method, with the output of ``__new__`` as the +first argument (now a class instance), and the passed arguments +following. + +As you can see, the object can be initialized in the ``__new__`` +method or the ``__init__`` method, or both, and in fact ndarray does +not have an ``__init__`` method, because all the initialization is +done in the ``__new__`` method. + +Why use ``__new__`` rather than just the usual ``__init__``? Because +in some cases, as for ndarray, we want to be able to return an object +of some other class. Consider the following:: + + class C(object): + def __new__(cls, *args): + print 'cls is:', cls + print 'Args in __new__:', args + return object.__new__(cls, *args) + def __init__(self, *args): + print 'self is :', self + print 'Args in __init__:', args + + class D(C): + def __new__(cls, *args): + print 'D cls is:', cls + print 'D args in __new__:', args + return C.__new__(C, *args) + def __init__(self, *args): + print 'D self is :', self + print 'D args in __init__:', args + + D('hello') + +which gives:: + + D cls is: + D args in __new__: ('hello',) + cls is: + Args in __new__: ('hello',) + +The definition of ``C`` is the same as before, but for ``D``, the +``__new__`` method returns an instance of class ``C`` rather than +``D``. Note that the ``__init__`` method of ``D`` does not get +called. In general, when the ``__new__`` method returns an object of +class other than the class in which it is defined, the ``__init__`` +method of that class is not called. + +This is how subclasses of the ndarray class are able to return views +that preserve the class type. When taking a view, the standard +ndarray machinery creates the new ndarray object with something +like:: + + obj = ndarray.__new__(subtype, shape, ... + +where ``subdtype`` is the subclass. Thus the returned view is of the +same class as the subclass, rather than being of class ``ndarray``. + +That solves the problem of returning views of the same type, but now +we have a new problem. The machinery of ndarray can set the class +this way, in its standard methods for taking views, but the ndarray +``__new__`` method knows nothing of what we have done in our own +``__new__`` method in order to set attributes, and so on. (Aside - +why not call ``obj = subdtype.__new__(...`` then? Because we may not +have a ``__new__`` method with the same call signature). + +So, when creating a new view object of our subclass, we need to be +able to set any extra attributes from the original object of our +class. This is the role of the ``__array_finalize__`` method of +ndarray. ``__array_finalize__`` is called from within the +ndarray machinery, each time we create an ndarray of our own class, +and passes in the new view object, created as above, as well as the +old object from which the view has been taken. In it we can take any +attributes from the old object and put then into the new view object, +or do any other related processing. Now we are ready for a simple +example. + +Simple example - adding an extra attribute to ndarray +----------------------------------------------------- + +:: + import numpy as np + + class InfoArray(np.ndarray): + + def __new__(subtype, shape, dtype=float, buffer=None, offset=0, + strides=None, order=None, info=None): + # Create the ndarray instance of our type, given the usual + # input arguments. This will call the standard ndarray + # constructor, but return an object of our type + obj = np.ndarray.__new__(subtype, shape, dtype, buffer, offset, strides, + order) + # add the new attribute to the created instance + obj.info = info + # Finally, we must return the newly created object: + return obj + + def __array_finalize__(self,obj): + # reset the attribute from passed original object + self.info = getattr(obj, 'info', None) + # We do not need to return anything + + obj = InfoArray(shape=(3,), info='information') + print type(obj) + print obj.info + v = obj[1:] + print type(v) + print v.info + +which gives:: + + + information + + information + +This class isn't very useful, because it has the same constructor as +the bare ndarray object, including passing in buffers and shapes and +so on. We would probably prefer to be able to take an already formed +ndarray from the usual numpy calls to ``np.array`` and return an +object. + +Slightly more realistic example - attribute added to existing array +------------------------------------------------------------------- +Here is a class (with thanks to PierreGM for the original example, +that takes array that already exists, casts as our type, and adds an +extra attribute:: + + import numpy as np + + class RealisticInfoArray(np.ndarray): + + def __new__(cls, input_array, info=None): + # Input array is an already formed ndarray instance + # We first cast to be our class type + obj = np.asarray(input_array).view(cls) + # add the new attribute to the created instance + obj.info = info + # Finally, we must return the newly created object: + return obj + + def __array_finalize__(self,obj): + # reset the attribute from passed original object + self.info = getattr(obj, 'info', None) + # We do not need to return anything + + arr = np.arange(5) + obj = RealisticInfoArray(arr, info='information') + print type(obj) + print obj.info + v = obj[1:] + print type(v) + print v.info + +which gives:: + + + information + + information + +``__array_wrap__`` for ufuncs +----------------------------- + +Let's say you have an instance ``obj`` of your new subclass, +``RealisticInfoArray``, and you pass it into a ufunc with another +array:: + + arr = np.arange(5) + ret = np.multiply.outer(arr, obj) + +When a numpy ufunc is called on a subclass of ndarray, the +__array_wrap__ method is called to transform the result into a new +instance of the subclass. By default, __array_wrap__ will call +__array_finalize__, and the attributes will be inherited. + +By defining a specific __array_wrap__ method for our subclass, we can +tweak the output. The __array_wrap__ method requires one argument, the +object on which the ufunc is applied, and an optional parameter +context. This parameter is returned by some ufuncs as a 3-element +tuple: (name of the ufunc, argument of the ufunc, domain of the +ufunc). + +Extra gotchas - custom __del__ methods and ndarray.base +------------------------------------------------------- +One of the problems that ndarray solves is that of memory ownership of +ndarrays and their views. Consider the case where we have created an +ndarray, ``arr`` and then taken a view with ``v = arr[1:]``. If we +then do ``del v``, we need to make sure that the ``del`` does not +delete the memory pointed to by the view, because we still need it for +the original ``arr`` object. Numpy therefore keeps track of where the +data came from for a particular array or view, with the ``base`` attribute:: + + import numpy as np + + # A normal ndarray, that owns its own data + arr = np.zeros((4,)) + # In this case, base is None + assert arr.base is None + # We take a view + v1 = arr[1:] + # base now points to the array that it derived from + assert v1.base is arr + # Take a view of a view + v2 = v1[1:] + # base points to the view it derived from + assert v2.base is v1 + +The assertions all succeed in this case. In general, if the array +owns its own memory, as for ``arr`` in this case, then ``arr.base`` +will be None - there are some exceptions to this - see the numpy book +for more details. + +The ``base`` attribute is useful in being able to tell whether we have +a view or the original array. This in turn can be useful if we need +to know whether or not to do some specific cleanup when the subclassed +array is deleted. For example, we may only want to do the cleanup if +the original array is deleted, but not the views. For an example of +how this can work, have a look at the ``memmap`` class in +``numpy.core``. + +""" From numpy-svn at scipy.org Wed Aug 27 06:10:01 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 27 Aug 2008 05:10:01 -0500 (CDT) Subject: [Numpy-svn] r5714 - trunk/numpy/doc Message-ID: <20080827101001.9EE2D39C09F@scipy.org> Author: matthew.brett at gmail.com Date: 2008-08-27 05:09:59 -0500 (Wed, 27 Aug 2008) New Revision: 5714 Modified: trunk/numpy/doc/subclassing.py Log: Point to example Modified: trunk/numpy/doc/subclassing.py =================================================================== --- trunk/numpy/doc/subclassing.py 2008-08-27 10:05:41 UTC (rev 5713) +++ trunk/numpy/doc/subclassing.py 2008-08-27 10:09:59 UTC (rev 5714) @@ -191,7 +191,7 @@ Slightly more realistic example - attribute added to existing array ------------------------------------------------------------------- -Here is a class (with thanks to PierreGM for the original example, +Here is a class (with thanks to Pierre GM for the original example), that takes array that already exists, casts as our type, and adds an extra attribute:: @@ -246,9 +246,9 @@ By defining a specific __array_wrap__ method for our subclass, we can tweak the output. The __array_wrap__ method requires one argument, the object on which the ufunc is applied, and an optional parameter -context. This parameter is returned by some ufuncs as a 3-element +*context*. This parameter is returned by some ufuncs as a 3-element tuple: (name of the ufunc, argument of the ufunc, domain of the -ufunc). +ufunc). See the masked array subclass for an implementation. Extra gotchas - custom __del__ methods and ndarray.base ------------------------------------------------------- From numpy-svn at scipy.org Wed Aug 27 10:31:18 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 27 Aug 2008 09:31:18 -0500 (CDT) Subject: [Numpy-svn] r5715 - in trunk/numpy: . core lib Message-ID: <20080827143118.C8AA739C02A@scipy.org> Author: oliphant Date: 2008-08-27 09:31:18 -0500 (Wed, 27 Aug 2008) New Revision: 5715 Modified: trunk/numpy/_import_tools.py trunk/numpy/core/memmap.py trunk/numpy/core/numerictypes.py trunk/numpy/lib/_datasource.py trunk/numpy/lib/format.py Log: Apply modified version of Andrew Dalke's patch in #874 to create a quicker-loading numpy. Modified: trunk/numpy/_import_tools.py =================================================================== --- trunk/numpy/_import_tools.py 2008-08-27 10:09:59 UTC (rev 5714) +++ trunk/numpy/_import_tools.py 2008-08-27 14:31:18 UTC (rev 5715) @@ -2,7 +2,6 @@ import os import sys import imp -from glob import glob __all__ = ['PackageLoader'] Modified: trunk/numpy/core/memmap.py =================================================================== --- trunk/numpy/core/memmap.py 2008-08-27 10:09:59 UTC (rev 5714) +++ trunk/numpy/core/memmap.py 2008-08-27 14:31:18 UTC (rev 5715) @@ -1,6 +1,5 @@ __all__ = ['memmap'] -import mmap import warnings from numeric import uint8, ndarray, dtype @@ -173,6 +172,8 @@ __array_priority__ = -100.0 def __new__(subtype, filename, dtype=uint8, mode='r+', offset=0, shape=None, order='C'): + # Import here to minimize 'import numpy' overhead + import mmap try: mode = mode_equivalents[mode] except KeyError: Modified: trunk/numpy/core/numerictypes.py =================================================================== --- trunk/numpy/core/numerictypes.py 2008-08-27 10:09:59 UTC (rev 5714) +++ trunk/numpy/core/numerictypes.py 2008-08-27 14:31:18 UTC (rev 5715) @@ -88,10 +88,23 @@ # String-handling utilities to avoid locale-dependence. -import string -LOWER_TABLE = string.maketrans(string.ascii_uppercase, string.ascii_lowercase) -UPPER_TABLE = string.maketrans(string.ascii_lowercase, string.ascii_uppercase) +# "import string" is costly to import! +# Construct the translation tables directly +# "A" = chr(65), "a" = chr(97) +_all_chars = map(chr, range(256)) +_ascii_upper = _all_chars[65:65+26] +_ascii_lower = _all_chars[97:97+26] +LOWER_TABLE="".join(_all_chars[:65] + _ascii_lower + _all_chars[65+26:]) +UPPER_TABLE="".join(_all_chars[:97] + _ascii_upper + _all_chars[97+26:]) +#import string +# assert (string.maketrans(string.ascii_uppercase, string.ascii_lowercase) == \ +# LOWER_TABLE) +# assert (string.maketrnas(string_ascii_lowercase, string.ascii_uppercase) == \ +# UPPER_TABLE) +#LOWER_TABLE = string.maketrans(string.ascii_uppercase, string.ascii_lowercase) +#UPPER_TABLE = string.maketrans(string.ascii_lowercase, string.ascii_uppercase) + def english_lower(s): """ Apply English case rules to convert ASCII strings to all lower case. Modified: trunk/numpy/lib/_datasource.py =================================================================== --- trunk/numpy/lib/_datasource.py 2008-08-27 10:09:59 UTC (rev 5714) +++ trunk/numpy/lib/_datasource.py 2008-08-27 14:31:18 UTC (rev 5715) @@ -36,22 +36,40 @@ import os from shutil import rmtree -from urlparse import urlparse +# Using a class instead of a module-level dictionary +# to reduce the inital 'import numpy' overhead by +# deferring the import of bz2 and gzip until needed + # TODO: .zip support, .tar support? -_file_openers = {None: open} -try: - import bz2 - _file_openers[".bz2"] = bz2.BZ2File -except ImportError: - pass -try: - import gzip - _file_openers[".gz"] = gzip.open -except ImportError: - pass +class _FileOpeners(object): + def __init__(self): + self._loaded = False + self._file_openers = {None: open} + def _load(self): + if self._loaded: + return + try: + import bz2 + self._file_openers[".bz2"] = bz2.BZ2File + except ImportError: + pass + try: + import gzip + self._file_openers[".gz"] = gzip.open + except ImportError: + pass + self._loaded = True + def keys(self): + self._load() + return self._file_openers.keys() + def __getitem__(self, key): + self._load() + return self._file_openers[key] +_file_openers = _FileOpeners() + def open(path, mode='r', destpath=os.curdir): """Open ``path`` with ``mode`` and return the file object. @@ -179,6 +197,9 @@ def _isurl(self, path): """Test if path is a net location. Tests the scheme and netloc.""" + + # We do this here to reduce the 'import numpy' initial import time. + from urlparse import urlparse # BUG : URLs require a scheme string ('http://') to be used. # www.google.com will fail. @@ -276,7 +297,10 @@ `open` : Method that downloads and opens files. """ + # We do this here to reduce the 'import numpy' initial import time. + from urlparse import urlparse + # TODO: This should be more robust. Handles case where path includes # the destpath, but not other sub-paths. Failing case: # path = /home/guido/datafile.txt Modified: trunk/numpy/lib/format.py =================================================================== --- trunk/numpy/lib/format.py 2008-08-27 10:09:59 UTC (rev 5714) +++ trunk/numpy/lib/format.py 2008-08-27 14:31:18 UTC (rev 5715) @@ -57,7 +57,6 @@ """ import cPickle -import struct import numpy from numpy.lib.utils import safe_eval @@ -180,6 +179,7 @@ This has the appropriate entries for writing its string representation to the header of the file. """ + import struct header = ["{"] for key, value in sorted(d.items()): # Need to use repr here, since we eval these when reading @@ -230,6 +230,7 @@ """ # Read an unsigned, little-endian short int which has the length of the # header. + import struct hlength_str = fp.read(2) if len(hlength_str) != 2: msg = "EOF at %s before reading array header length" From numpy-svn at scipy.org Wed Aug 27 16:03:59 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 27 Aug 2008 15:03:59 -0500 (CDT) Subject: [Numpy-svn] r5716 - trunk/numpy/core/src Message-ID: <20080827200359.F12EA39C02A@scipy.org> Author: oliphant Date: 2008-08-27 15:03:59 -0500 (Wed, 27 Aug 2008) New Revision: 5716 Modified: trunk/numpy/core/src/multiarraymodule.c Log: Add missing '|' for byteorder. Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2008-08-27 14:31:18 UTC (rev 5715) +++ trunk/numpy/core/src/multiarraymodule.c 2008-08-27 20:03:59 UTC (rev 5716) @@ -5550,7 +5550,7 @@ } *endian = str[0]; if (str[0] != PyArray_BIG && str[0] != PyArray_LITTLE && \ - str[0] != PyArray_NATIVE) { + str[0] != PyArray_NATIVE && str[0] != PyArray_IGNORE) { if (str[0] == 'b' || str[0] == 'B') *endian = PyArray_BIG; else if (str[0] == 'l' || str[0] == 'L') From numpy-svn at scipy.org Wed Aug 27 17:49:46 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 27 Aug 2008 16:49:46 -0500 (CDT) Subject: [Numpy-svn] r5717 - trunk/numpy/doc Message-ID: <20080827214946.EB6B139C02A@scipy.org> Author: ptvirtan Date: 2008-08-27 16:49:40 -0500 (Wed, 27 Aug 2008) New Revision: 5717 Modified: trunk/numpy/doc/__init__.py Log: Import documentation topic modules when numpy.doc is imported, so that they are easier to use. Add instructions how to view each topic. Modified: trunk/numpy/doc/__init__.py =================================================================== --- trunk/numpy/doc/__init__.py 2008-08-27 20:03:59 UTC (rev 5716) +++ trunk/numpy/doc/__init__.py 2008-08-27 21:49:40 UTC (rev 5717) @@ -6,7 +6,22 @@ not f.startswith('__')] __all__.sort() -__doc__ = 'The following topics are available:\n' + \ - '\n - '.join([''] + __all__) +for f in __all__: + __import__(__name__ + '.' + f) +del f, ref_dir + +__doc__ = """\ +Topical documentation +===================== + +The following topics are available: +%s + +You can view them by + +>>> help(doc.TOPIC) + +""" % '\n- '.join([''] + __all__) + __all__.extend(['__doc__']) From numpy-svn at scipy.org Thu Aug 28 18:53:12 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Aug 2008 17:53:12 -0500 (CDT) Subject: [Numpy-svn] r5718 - in trunk/numpy/core: . tests Message-ID: <20080828225312.C633F39C107@scipy.org> Author: charris Date: 2008-08-28 17:53:06 -0500 (Thu, 28 Aug 2008) New Revision: 5718 Modified: trunk/numpy/core/numeric.py trunk/numpy/core/tests/test_regression.py Log: Change convolve to raise ValueError on runtime error instead of relying on assert. The latter fails when run with python -OO. Modified: trunk/numpy/core/numeric.py =================================================================== --- trunk/numpy/core/numeric.py 2008-08-27 21:49:40 UTC (rev 5717) +++ trunk/numpy/core/numeric.py 2008-08-28 22:53:06 UTC (rev 5718) @@ -571,13 +571,15 @@ array([ 2.5]) """ - a,v = array(a,ndmin=1),array(v,ndmin=1) + a,v = array(a, ndmin=1),array(v, ndmin=1) if (len(v) > len(a)): a, v = v, a - assert len(a) > 0, 'a cannot be empty' - assert len(v) > 0, 'v cannot be empty' + if len(a) == 0 : + raise ValueError('a cannot be empty') + if len(v) == 0 : + raise ValueError('v cannot be empty') mode = _mode_from_name(mode) - return multiarray.correlate(a,asarray(v)[::-1],mode) + return multiarray.correlate(a, v[::-1], mode) inner = multiarray.inner dot = multiarray.dot Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-08-27 21:49:40 UTC (rev 5717) +++ trunk/numpy/core/tests/test_regression.py 2008-08-28 22:53:06 UTC (rev 5718) @@ -623,8 +623,8 @@ def test_convolve_empty(self, level=rlevel): """Convolve should raise an error for empty input array.""" - self.failUnlessRaises(AssertionError,np.convolve,[],[1]) - self.failUnlessRaises(AssertionError,np.convolve,[1],[]) + self.failUnlessRaises(ValueError,np.convolve,[],[1]) + self.failUnlessRaises(ValueError,np.convolve,[1],[]) def test_multidim_byteswap(self, level=rlevel): """Ticket #449""" From numpy-svn at scipy.org Thu Aug 28 21:23:49 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Aug 2008 20:23:49 -0500 (CDT) Subject: [Numpy-svn] r5719 - trunk/numpy/testing/tests Message-ID: <20080829012349.5EE4439C021@scipy.org> Author: charris Date: 2008-08-28 20:23:43 -0500 (Thu, 28 Aug 2008) New Revision: 5719 Modified: trunk/numpy/testing/tests/test_utils.py Log: Small cleanup. Modified: trunk/numpy/testing/tests/test_utils.py =================================================================== --- trunk/numpy/testing/tests/test_utils.py 2008-08-28 22:53:06 UTC (rev 5718) +++ trunk/numpy/testing/tests/test_utils.py 2008-08-29 01:23:43 UTC (rev 5719) @@ -7,14 +7,12 @@ self._assert_func(a, b) def _test_not_equal(self, a, b): - passed = False try: self._assert_func(a, b) passed = True except AssertionError: pass - - if passed: + else: raise AssertionError("a and b are found equal but are not") def test_array_rank1_eq(self): From numpy-svn at scipy.org Thu Aug 28 21:29:32 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Aug 2008 20:29:32 -0500 (CDT) Subject: [Numpy-svn] r5720 - trunk/numpy/testing Message-ID: <20080829012932.6E99039C021@scipy.org> Author: charris Date: 2008-08-28 20:29:30 -0500 (Thu, 28 Aug 2008) New Revision: 5720 Modified: trunk/numpy/testing/utils.py Log: Make testing functions work when python is called with the -OO flag. Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2008-08-29 01:23:43 UTC (rev 5719) +++ trunk/numpy/testing/utils.py 2008-08-29 01:29:30 UTC (rev 5720) @@ -162,10 +162,12 @@ """ if isinstance(desired, dict): - assert isinstance(actual, dict), repr(type(actual)) + if not isinstance(actual, dict) : + raise AssertionError(repr(type(actual))) assert_equal(len(actual),len(desired),err_msg,verbose) for k,i in desired.items(): - assert k in actual, repr(k) + if k not in actual : + raise AssertionError(repr(k)) assert_equal(actual[k], desired[k], 'key=%r\n%s' % (k,err_msg), verbose) return if isinstance(desired, (list,tuple)) and isinstance(actual, (list,tuple)): @@ -177,7 +179,8 @@ if isinstance(actual, ndarray) or isinstance(desired, ndarray): return assert_array_equal(actual, desired, err_msg, verbose) msg = build_err_msg([actual, desired], err_msg, verbose=verbose) - assert desired == actual, msg + if desired != actual : + raise AssertionError(msg) def print_assert_equal(test_string,actual,desired): import pprint @@ -191,7 +194,7 @@ pprint.pprint(actual,msg) msg.write('DESIRED: \n') pprint.pprint(desired,msg) - raise AssertionError, msg.getvalue() + raise AssertionError(msg.getvalue()) def assert_almost_equal(actual,desired,decimal=7,err_msg='',verbose=True): """ Raise an assertion if two items are not equal. @@ -204,7 +207,8 @@ if isinstance(actual, ndarray) or isinstance(desired, ndarray): return assert_array_almost_equal(actual, desired, decimal, err_msg) msg = build_err_msg([actual, desired], err_msg, verbose=verbose) - assert round(abs(desired - actual),decimal) == 0, msg + if round(abs(desired - actual),decimal) != 0 : + raise AssertionError(msg) def assert_approx_equal(actual,desired,significant=7,err_msg='',verbose=True): @@ -231,7 +235,8 @@ header='Items are not equal to %d significant digits:' % significant, verbose=verbose) - assert math.fabs(sc_desired - sc_actual) < pow(10.,-(significant-1)), msg + if math.fabs(sc_desired - sc_actual) >= pow(10.,-(significant-1)) : + raise AssertionError(msg) def assert_array_compare(comparison, x, y, err_msg='', verbose=True, header=''): @@ -252,7 +257,8 @@ y.shape), verbose=verbose, header=header, names=('x', 'y')) - assert cond, msg + if not cond : + raise AssertionError(msg) if (isnumber(x) and isnumber(y)) and (any(isnan(x)) or any(isnan(y))): # Handling nan: we first check that x and y have the nan at the @@ -286,7 +292,8 @@ + '\n(mismatch %s%%)' % (match,), verbose=verbose, header=header, names=('x', 'y')) - assert cond, msg + if not cond : + raise AssertionError(msg) except ValueError: msg = build_err_msg([x, y], err_msg, verbose=verbose, header=header, names=('x', 'y')) @@ -315,8 +322,10 @@ # delay import of difflib to reduce startup time import difflib - assert isinstance(actual, str),`type(actual)` - assert isinstance(desired, str),`type(desired)` + if not isinstance(actual, str) : + raise AssertionError(`type(actual)`) + if not isinstance(desired, str): + raise AssertionError(`type(desired)`) if re.match(r'\A'+desired+r'\Z', actual, re.M): return diff = list(difflib.Differ().compare(actual.splitlines(1), desired.splitlines(1))) diff_list = [] @@ -330,7 +339,8 @@ if d2.startswith('? '): l.append(d2) d2 = diff.pop(0) - assert d2.startswith('+ '),`d2` + if not d2.startswith('+ ') : + raise AssertionError(`d2`) l.append(d2) d3 = diff.pop(0) if d3.startswith('? '): @@ -341,10 +351,12 @@ continue diff_list.extend(l) continue - assert False, `d1` - if not diff_list: return + raise AssertionError(`d1`) + if not diff_list: + return msg = 'Differences in strings:\n%s' % (''.join(diff_list)).rstrip() - assert actual==desired, msg + if actual != desired : + raise AssertionError(msg) def rundocs(filename=None): @@ -430,7 +442,7 @@ 'exec') i = 0 elapsed = jiffies() - while i Author: cdavid Date: 2008-08-28 21:28:52 -0500 (Thu, 28 Aug 2008) New Revision: 5721 Modified: trunk/numpy/core/tests/test_regression.py Log: Add a regression test to show #771 failure. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-08-29 01:29:30 UTC (rev 5720) +++ trunk/numpy/core/tests/test_regression.py 2008-08-29 02:28:52 UTC (rev 5721) @@ -843,6 +843,12 @@ """Ticket #658""" np.indices((0,3,4)).T.reshape(-1,3) + def test_copy_detection_corner_case2(self, level=rlevel): + """Ticket #771: strides are not set correctly when reshaping 0-sized + arrays""" + b = np.indices((0,3,4)).T.reshape(-1,3) + assert_equal(b.strides, (24, 4)) + def test_object_array_refcounting(self, level=rlevel): """Ticket #633""" if not hasattr(sys, 'getrefcount'): From numpy-svn at scipy.org Thu Aug 28 22:29:23 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 28 Aug 2008 21:29:23 -0500 (CDT) Subject: [Numpy-svn] r5722 - trunk/numpy/core/src Message-ID: <20080829022923.2F6A539C05F@scipy.org> Author: cdavid Date: 2008-08-28 21:29:14 -0500 (Thu, 28 Aug 2008) New Revision: 5722 Modified: trunk/numpy/core/src/multiarraymodule.c Log: Fix reshaping 0-sized arrays. The nocopy logic does not handle 0-sized arrays correctly, so just copy. It is a not really useful corner case, so doing a copy should not matter much. Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2008-08-29 02:28:52 UTC (rev 5721) +++ trunk/numpy/core/src/multiarraymodule.c 2008-08-29 02:29:14 UTC (rev 5722) @@ -515,8 +515,12 @@ for (oi=0; oi Author: cdavid Date: 2008-08-28 21:33:38 -0500 (Thu, 28 Aug 2008) New Revision: 5723 Modified: trunk/numpy/core/tests/test_regression.py Log: Fix regression test for #771. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-08-29 02:29:14 UTC (rev 5722) +++ trunk/numpy/core/tests/test_regression.py 2008-08-29 02:33:38 UTC (rev 5723) @@ -847,7 +847,7 @@ """Ticket #771: strides are not set correctly when reshaping 0-sized arrays""" b = np.indices((0,3,4)).T.reshape(-1,3) - assert_equal(b.strides, (24, 4)) + assert_equal(b.strides, (12, 4)) def test_object_array_refcounting(self, level=rlevel): """Ticket #633""" From numpy-svn at scipy.org Fri Aug 29 02:45:58 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 29 Aug 2008 01:45:58 -0500 (CDT) Subject: [Numpy-svn] r5724 - branches Message-ID: <20080829064558.42FC439C05F@scipy.org> Author: chris.burns Date: 2008-08-29 01:45:56 -0500 (Fri, 29 Aug 2008) New Revision: 5724 Removed: branches/memmaps/ Log: Remove branch created at scipy for memmap bug. From numpy-svn at scipy.org Fri Aug 29 08:47:34 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 29 Aug 2008 07:47:34 -0500 (CDT) Subject: [Numpy-svn] r5725 - trunk/numpy/core/src Message-ID: <20080829124734.D0C9639C185@scipy.org> Author: oliphant Date: 2008-08-29 07:47:34 -0500 (Fri, 29 Aug 2008) New Revision: 5725 Modified: trunk/numpy/core/src/multiarraymodule.c Log: Fix 0-length sequence error in #882. Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2008-08-29 06:45:56 UTC (rev 5724) +++ trunk/numpy/core/src/multiarraymodule.c 2008-08-29 12:47:34 UTC (rev 5725) @@ -2199,6 +2199,7 @@ } } +/* Raises error when len(op) == 0 */ /*NUMPY_API*/ static PyArrayObject ** @@ -2212,6 +2213,9 @@ NPY_SCALARKIND scalarkind=NPY_NOSCALAR, intypekind=NPY_NOSCALAR; *retn = n = PySequence_Length(op); + if (n == 0) { + PyErr_SetString(PyExc_ValueError, "0-length sequence."); + } if (PyErr_Occurred()) {*retn = 0; return NULL;} mps = (PyArrayObject **)PyDataMem_NEW(n*sizeof(PyArrayObject *)); From numpy-svn at scipy.org Fri Aug 29 08:58:44 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 29 Aug 2008 07:58:44 -0500 (CDT) Subject: [Numpy-svn] r5726 - trunk/numpy/core/tests Message-ID: <20080829125844.785EE39C185@scipy.org> Author: oliphant Date: 2008-08-29 07:58:42 -0500 (Fri, 29 Aug 2008) New Revision: 5726 Modified: trunk/numpy/core/tests/test_regression.py Log: Add test for ticket #882 fix. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-08-29 12:47:34 UTC (rev 5725) +++ trunk/numpy/core/tests/test_regression.py 2008-08-29 12:58:42 UTC (rev 5726) @@ -1204,5 +1204,10 @@ assert c.dtype == object assert d.dtype == object + def test_for_zero_length_in_choose(self, level=rlevel): + "Ticket #882" + a = np.array(1) + self.failUnlessRaises(ValueError, lambda x: x.choose([]), a) + if __name__ == "__main__": run_module_suite() From numpy-svn at scipy.org Sat Aug 30 23:15:57 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 30 Aug 2008 22:15:57 -0500 (CDT) Subject: [Numpy-svn] r5727 - trunk/doc Message-ID: <20080831031557.82AEC39C633@scipy.org> Author: jarrod.millman Date: 2008-08-30 22:15:55 -0500 (Sat, 30 Aug 2008) New Revision: 5727 Removed: trunk/doc/html/ Log: removing auto-generated epydocs From numpy-svn at scipy.org Sat Aug 30 23:18:01 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 30 Aug 2008 22:18:01 -0500 (CDT) Subject: [Numpy-svn] r5728 - trunk/doc Message-ID: <20080831031801.5932A39C633@scipy.org> Author: jarrod.millman Date: 2008-08-30 22:17:59 -0500 (Sat, 30 Aug 2008) New Revision: 5728 Removed: trunk/doc/README.txt Log: out of date Deleted: trunk/doc/README.txt =================================================================== --- trunk/doc/README.txt 2008-08-31 03:15:55 UTC (rev 5727) +++ trunk/doc/README.txt 2008-08-31 03:17:59 UTC (rev 5728) @@ -1,15 +0,0 @@ -Very complete documentation is available from the primary developer of -NumPy for a small fee. After a brief period, that documentation -will become freely available. See http://www.trelgol.com for -details. The fee and restriction period is intended to allow people -and to encourage companies to easily contribute to the development of -NumPy. - -This directory will contain all public documentation that becomes available. - -Very good documentation is also available using Python's (and -especially IPython's) own help system. Most of the functions have -docstrings that provide usage assistance. - - - From numpy-svn at scipy.org Sat Aug 30 23:21:03 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 30 Aug 2008 22:21:03 -0500 (CDT) Subject: [Numpy-svn] r5729 - trunk/doc Message-ID: <20080831032103.1164E39C633@scipy.org> Author: jarrod.millman Date: 2008-08-30 22:21:01 -0500 (Sat, 30 Aug 2008) New Revision: 5729 Added: trunk/doc/neps/ Log: starting nep infrastructure From numpy-svn at scipy.org Sat Aug 30 23:29:08 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 30 Aug 2008 22:29:08 -0500 (CDT) Subject: [Numpy-svn] r5730 - in trunk/doc: . neps Message-ID: <20080831032908.43C4F39C633@scipy.org> Author: jarrod.millman Date: 2008-08-30 22:28:56 -0500 (Sat, 30 Aug 2008) New Revision: 5730 Added: trunk/doc/neps/datetime.rst trunk/doc/neps/npy-format.txt trunk/doc/neps/pep_buffer.txt Removed: trunk/doc/npy-format.txt trunk/doc/pep_buffer.txt Log: moving and adding neps Added: trunk/doc/neps/datetime.rst =================================================================== --- trunk/doc/neps/datetime.rst 2008-08-31 03:21:01 UTC (rev 5729) +++ trunk/doc/neps/datetime.rst 2008-08-31 03:28:56 UTC (rev 5730) @@ -0,0 +1,354 @@ +==================================================================== + A (second) proposal for implementing some date/time types in NumPy +==================================================================== + +:Author: Francesc Alted i Abad +:Contact: faltet at pytables.com +:Author: Ivan Vilata i Balaguer +:Contact: ivan at selidor.net +:Date: 2008-07-16 + + +Executive summary +================= + +A date/time mark is something very handy to have in many fields where +one has to deal with data sets. While Python has several modules that +define a date/time type (like the integrated ``datetime`` [1]_ or +``mx.DateTime`` [2]_), NumPy has a lack of them. + +In this document, we are proposing the addition of a series of date/time +types to fill this gap. The requirements for the proposed types are +two-folded: 1) they have to be fast to operate with and 2) they have to +be as compatible as possible with the existing ``datetime`` module that +comes with Python. + + +Types proposed +============== + +To start with, it is virtually impossible to come up with a single +date/time type that fills the needs of every case of use. So, after +pondering about different possibilities, we have stick with *two* +different types, namely ``datetime64`` and ``timedelta64`` (these names +are preliminary and can be changed), that can have different resolutions +so as to cover different needs. + +**Important note:** the resolution is conceived here as a metadata that + *complements* a date/time dtype, *without changing the base type*. + +Now it goes a detailed description of the proposed types. + + +``datetime64`` +-------------- + +It represents a time that is absolute (i.e. not relative). It is +implemented internally as an ``int64`` type. The internal epoch is +POSIX epoch (see [3]_). + +Resolution +~~~~~~~~~~ + +It accepts different resolutions and for each of these resolutions, it +will support different time spans. The table below describes the +resolutions supported with its corresponding time spans. + ++----------------------+----------------------------------+ +| Resolution | Time span (years) | ++----------------------+----------------------------------+ +| Code | Meaning | | ++======================+==================================+ +| Y | year | [9.2e18 BC, 9.2e18 AC] | +| Q | quarter | [3.0e18 BC, 3.0e18 AC] | +| M | month | [7.6e17 BC, 7.6e17 AC] | +| W | week | [1.7e17 BC, 1.7e17 AC] | +| d | day | [2.5e16 BC, 2.5e16 AC] | +| h | hour | [1.0e15 BC, 1.0e15 AC] | +| m | minute | [1.7e13 BC, 1.7e13 AC] | +| s | second | [ 2.9e9 BC, 2.9e9 AC] | +| ms | millisecond | [ 2.9e6 BC, 2.9e6 AC] | +| us | microsecond | [290301 BC, 294241 AC] | +| ns | nanosecond | [ 1678 AC, 2262 AC] | ++----------------------+----------------------------------+ + +Building a ``datetime64`` dtype +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The proposed way to specify the resolution in the dtype constructor +is: + +Using parameters in the constructor:: + + dtype('datetime64', res="us") # the default res. is microseconds + +Using the long string notation:: + + dtype('datetime64[us]') # equivalent to dtype('datetime64') + +Using the short string notation:: + + dtype('T8[us]') # equivalent to dtype('T8') + +Compatibility issues +~~~~~~~~~~~~~~~~~~~~ + +This will be fully compatible with the ``datetime`` class of the +``datetime`` module of Python only when using a resolution of +microseconds. For other resolutions, the conversion process will +loose precision or will overflow as needed. + + +``timedelta64`` +--------------- + +It represents a time that is relative (i.e. not absolute). It is +implemented internally as an ``int64`` type. + +Resolution +~~~~~~~~~~ + +It accepts different resolutions and for each of these resolutions, it +will support different time spans. The table below describes the +resolutions supported with its corresponding time spans. + ++----------------------+--------------------------+ +| Resolution | Time span | ++----------------------+--------------------------+ +| Code | Meaning | | ++======================+==========================+ +| W | week | +- 1.7e17 years | +| D | day | +- 2.5e16 years | +| h | hour | +- 1.0e15 years | +| m | minute | +- 1.7e13 years | +| s | second | +- 2.9e12 years | +| ms | millisecond | +- 2.9e9 years | +| us | microsecond | +- 2.9e6 years | +| ns | nanosecond | +- 292 years | +| ps | picosecond | +- 106 days | +| fs | femtosecond | +- 2.6 hours | +| as | attosecond | +- 9.2 seconds | ++----------------------+--------------------------+ + +Building a ``timedelta64`` dtype +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The proposed way to specify the resolution in the dtype constructor +is: + +Using parameters in the constructor:: + + dtype('timedelta64', res="us") # the default res. is microseconds + +Using the long string notation:: + + dtype('timedelta64[us]') # equivalent to dtype('datetime64') + +Using the short string notation:: + + dtype('t8[us]') # equivalent to dtype('t8') + +Compatibility issues +~~~~~~~~~~~~~~~~~~~~ + +This will be fully compatible with the ``timedelta`` class of the +``datetime`` module of Python only when using a resolution of +microseconds. For other resolutions, the conversion process will +loose precision or will overflow as needed. + + +Example of use +============== + +Here it is an example of use for the ``datetime64``:: + + In [10]: t = numpy.zeros(5, dtype="datetime64[ms]") + + In [11]: t[0] = datetime.datetime.now() # setter in action + + In [12]: t[0] + Out[12]: '2008-07-16T13:39:25.315' # representation in ISO 8601 format + + In [13]: print t + [2008-07-16T13:39:25.315 1970-01-01T00:00:00.0 + 1970-01-01T00:00:00.0 1970-01-01T00:00:00.0 1970-01-01T00:00:00.0] + + In [14]: t[0].item() # getter in action + Out[14]: datetime.datetime(2008, 7, 16, 13, 39, 25, 315000) + + In [15]: print t.dtype + datetime64[ms] + +And here it goes an example of use for the ``timedelta64``:: + + In [8]: t1 = numpy.zeros(5, dtype="datetime64[s]") + + In [9]: t2 = numpy.ones(5, dtype="datetime64[s]") + + In [10]: t = t2 - t1 + + In [11]: t[0] = 24 # setter in action (setting to 24 seconds) + + In [12]: t[0] + Out[12]: 24 # representation as an int64 + + In [13]: print t + [24 1 1 1 1] + + In [14]: t[0].item() # getter in action + Out[14]: datetime.timedelta(0, 24) + + In [15]: print t.dtype + timedelta64[s] + + +Operating with date/time arrays +=============================== + +``datetime64`` vs ``datetime64`` +-------------------------------- + +The only operation allowed between absolute dates is the subtraction:: + + In [10]: numpy.ones(5, "T8") - numpy.zeros(5, "T8") + Out[10]: array([1, 1, 1, 1, 1], dtype=timedelta64[us]) + +But not other operations:: + + In [11]: numpy.ones(5, "T8") + numpy.zeros(5, "T8") + TypeError: unsupported operand type(s) for +: 'numpy.ndarray' and 'numpy.ndarray' + +``datetime64`` vs ``timedelta64`` +--------------------------------- + +It will be possible to add and subtract relative times from absolute +dates:: + + In [10]: numpy.zeros(5, "T8[Y]") + numpy.ones(5, "t8[Y]") + Out[10]: array([1971, 1971, 1971, 1971, 1971], dtype=datetime64[Y]) + + In [11]: numpy.ones(5, "T8[Y]") - 2 * numpy.ones(5, "t8[Y]") + Out[11]: array([1969, 1969, 1969, 1969, 1969], dtype=datetime64[Y]) + +But not other operations:: + + In [12]: numpy.ones(5, "T8[Y]") * numpy.ones(5, "t8[Y]") + TypeError: unsupported operand type(s) for *: 'numpy.ndarray' and 'numpy.ndarray' + +``timedelta64`` vs anything +--------------------------- + +Finally, it will be possible to operate with relative times as if they +were regular int64 dtypes *as long as* the result can be converted back +into a ``timedelta64``:: + + In [10]: numpy.ones(5, 't8') + Out[10]: array([1, 1, 1, 1, 1], dtype=timedelta64[us]) + + In [11]: (numpy.ones(5, 't8[M]') + 2) ** 3 + Out[11]: array([27, 27, 27, 27, 27], dtype=timedelta64[M]) + +But:: + + In [12]: numpy.ones(5, 't8') + 1j + TypeError: The result cannot be converted into a ``timedelta64`` + + +dtype/resolution conversions +============================ + +For changing the date/time dtype of an existing array, we propose to use +the ``.astype()`` method. This will be mainly useful for changing +resolutions. + +For example, for absolute dates:: + + In[10]: t1 = numpy.zeros(5, dtype="datetime64[s]") + + In[11]: print t1 + [1970-01-01T00:00:00 1970-01-01T00:00:00 1970-01-01T00:00:00 + 1970-01-01T00:00:00 1970-01-01T00:00:00] + + In[12]: print t1.astype('datetime64[d]') + [1970-01-01 1970-01-01 1970-01-01 1970-01-01 1970-01-01] + +For relative times:: + + In[10]: t1 = numpy.ones(5, dtype="timedelta64[s]") + + In[11]: print t1 + [1 1 1 1 1] + + In[12]: print t1.astype('timedelta64[ms]') + [1000 1000 1000 1000 1000] + +Changing directly from/to relative to/from absolute dtypes will not be +supported:: + + In[13]: numpy.zeros(5, dtype="datetime64[s]").astype('timedelta64') + TypeError: data type cannot be converted to the desired type + + +Final considerations +==================== + +Why the ``origin`` metadata disappeared +--------------------------------------- + +During the discussion of the date/time dtypes in the NumPy list, the +idea of having an ``origin`` metadata that complemented the definition +of the absolute ``datetime64`` was initially found to be useful. + +However, after thinking more about this, Ivan and me find that the +combination of an absolute ``datetime64`` with a relative +``timedelta64`` does offer the same functionality while removing the +need for the additional ``origin`` metadata. This is why we have +removed it from this proposal. + + +Resolution and dtype issues +--------------------------- + +The date/time dtype's resolution metadata cannot be used in general as +part of typical dtype usage. For example, in:: + + numpy.zeros(5, dtype=numpy.datetime64) + +we have to found yet a sensible way to pass the resolution. Perhaps the +next would work:: + + numpy.zeros(5, dtype=numpy.datetime64(res='Y')) + +but we are not sure if this would collide with the spirit of the NumPy +dtypes. + +At any rate, one can always do:: + + numpy.zeros(5, dtype=numpy.dtype('datetime64', res='Y')) + +BTW, prior to all of this, one should also elucidate whether:: + + numpy.dtype('datetime64', res='Y') + +or:: + + numpy.dtype('datetime64[Y]') + numpy.dtype('T8[Y]') + +would be a consistent way to instantiate a dtype in NumPy. We do really +think that could be a good way, but we would need to hear the opinion of +the expert. Travis? + + + +.. [1] http://docs.python.org/lib/module-datetime.html +.. [2] http://www.egenix.com/products/python/mxBase/mxDateTime +.. [3] http://en.wikipedia.org/wiki/Unix_time + + +.. Local Variables: +.. mode: rst +.. coding: utf-8 +.. fill-column: 72 +.. End: + Copied: trunk/doc/neps/npy-format.txt (from rev 5726, trunk/doc/npy-format.txt) Copied: trunk/doc/neps/pep_buffer.txt (from rev 5726, trunk/doc/pep_buffer.txt) Deleted: trunk/doc/npy-format.txt =================================================================== --- trunk/doc/npy-format.txt 2008-08-31 03:21:01 UTC (rev 5729) +++ trunk/doc/npy-format.txt 2008-08-31 03:28:56 UTC (rev 5730) @@ -1,294 +0,0 @@ -Title: A Simple File Format for NumPy Arrays -Discussions-To: numpy-discussion at mail.scipy.org -Version: $Revision$ -Last-Modified: $Date$ -Author: Robert Kern -Status: Draft -Type: Standards Track -Content-Type: text/plain -Created: 20-Dec-2007 - - -Abstract - - We propose a standard binary file format (NPY) for persisting - a single arbitrary NumPy array on disk. The format stores all of - the shape and dtype information necessary to reconstruct the array - correctly even on another machine with a different architecture. - The format is designed to be as simple as possible while achieving - its limited goals. The implementation is intended to be pure - Python and distributed as part of the main numpy package. - - -Rationale - - A lightweight, omnipresent system for saving NumPy arrays to disk - is a frequent need. Python in general has pickle [1] for saving - most Python objects to disk. This often works well enough with - NumPy arrays for many purposes, but it has a few drawbacks: - - - Dumping or loading a pickle file require the duplication of the - data in memory. For large arrays, this can be a showstopper. - - - The array data is not directly accessible through - memory-mapping. Now that numpy has that capability, it has - proved very useful for loading large amounts of data (or more to - the point: avoiding loading large amounts of data when you only - need a small part). - - Both of these problems can be addressed by dumping the raw bytes - to disk using ndarray.tofile() and numpy.fromfile(). However, - these have their own problems: - - - The data which is written has no information about the shape or - dtype of the array. - - - It is incapable of handling object arrays. - - The NPY file format is an evolutionary advance over these two - approaches. Its design is mostly limited to solving the problems - with pickles and tofile()/fromfile(). It does not intend to solve - more complicated problems for which more complicated formats like - HDF5 [2] are a better solution. - - -Use Cases - - - Neville Newbie has just started to pick up Python and NumPy. He - has not installed many packages, yet, nor learned the standard - library, but he has been playing with NumPy at the interactive - prompt to do small tasks. He gets a result that he wants to - save. - - - Annie Analyst has been using large nested record arrays to - represent her statistical data. She wants to convince her - R-using colleague, David Doubter, that Python and NumPy are - awesome by sending him her analysis code and data. She needs - the data to load at interactive speeds. Since David does not - use Python usually, needing to install large packages would turn - him off. - - - Simon Seismologist is developing new seismic processing tools. - One of his algorithms requires large amounts of intermediate - data to be written to disk. The data does not really fit into - the industry-standard SEG-Y schema, but he already has a nice - record-array dtype for using it internally. - - - Polly Parallel wants to split up a computation on her multicore - machine as simply as possible. Parts of the computation can be - split up among different processes without any communication - between processes; they just need to fill in the appropriate - portion of a large array with their results. Having several - child processes memory-mapping a common array is a good way to - achieve this. - - -Requirements - - The format MUST be able to: - - - Represent all NumPy arrays including nested record - arrays and object arrays. - - - Represent the data in its native binary form. - - - Be contained in a single file. - - - Support Fortran-contiguous arrays directly. - - - Store all of the necessary information to reconstruct the array - including shape and dtype on a machine of a different - architecture. Both little-endian and big-endian arrays must be - supported and a file with little-endian numbers will yield - a little-endian array on any machine reading the file. The - types must be described in terms of their actual sizes. For - example, if a machine with a 64-bit C "long int" writes out an - array with "long ints", a reading machine with 32-bit C "long - ints" will yield an array with 64-bit integers. - - - Be reverse engineered. Datasets often live longer than the - programs that created them. A competent developer should be - able create a solution in his preferred programming language to - read most NPY files that he has been given without much - documentation. - - - Allow memory-mapping of the data. - - - Be read from a filelike stream object instead of an actual file. - This allows the implementation to be tested easily and makes the - system more flexible. NPY files can be stored in ZIP files and - easily read from a ZipFile object. - - - Store object arrays. Since general Python objects are - complicated and can only be reliably serialized by pickle (if at - all), many of the other requirements are waived for files - containing object arrays. Files with object arrays do not have - to be mmapable since that would be technically impossible. We - cannot expect the pickle format to be reverse engineered without - knowledge of pickle. However, one should at least be able to - read and write object arrays with the same generic interface as - other arrays. - - - Be read and written using APIs provided in the numpy package - itself without any other libraries. The implementation inside - numpy may be in C if necessary. - - The format explicitly *does not* need to: - - - Support multiple arrays in a file. Since we require filelike - objects to be supported, one could use the API to build an ad - hoc format that supported multiple arrays. However, solving the - general problem and use cases is beyond the scope of the format - and the API for numpy. - - - Fully handle arbitrary subclasses of numpy.ndarray. Subclasses - will be accepted for writing, but only the array data will be - written out. A regular numpy.ndarray object will be created - upon reading the file. The API can be used to build a format - for a particular subclass, but that is out of scope for the - general NPY format. - - -Format Specification: Version 1.0 - - The first 6 bytes are a magic string: exactly "\x93NUMPY". - - The next 1 byte is an unsigned byte: the major version number of - the file format, e.g. \x01. - - The next 1 byte is an unsigned byte: the minor version number of - the file format, e.g. \x00. Note: the version of the file format - is not tied to the version of the numpy package. - - The next 2 bytes form a little-endian unsigned short int: the - length of the header data HEADER_LEN. - - The next HEADER_LEN bytes form the header data describing the - array's format. It is an ASCII string which contains a Python - literal expression of a dictionary. It is terminated by a newline - ('\n') and padded with spaces ('\x20') to make the total length of - the magic string + 4 + HEADER_LEN be evenly divisible by 16 for - alignment purposes. - - The dictionary contains three keys: - - "descr" : dtype.descr - An object that can be passed as an argument to the - numpy.dtype() constructor to create the array's dtype. - - "fortran_order" : bool - Whether the array data is Fortran-contiguous or not. - Since Fortran-contiguous arrays are a common form of - non-C-contiguity, we allow them to be written directly to - disk for efficiency. - - "shape" : tuple of int - The shape of the array. - - For repeatability and readability, this dictionary is formatted - using pprint.pformat() so the keys are in alphabetic order. - - Following the header comes the array data. If the dtype contains - Python objects (i.e. dtype.hasobject is True), then the data is - a Python pickle of the array. Otherwise the data is the - contiguous (either C- or Fortran-, depending on fortran_order) - bytes of the array. Consumers can figure out the number of bytes - by multiplying the number of elements given by the shape (noting - that shape=() means there is 1 element) by dtype.itemsize. - - -Conventions - - We recommend using the ".npy" extension for files following this - format. This is by no means a requirement; applications may wish - to use this file format but use an extension specific to the - application. In the absence of an obvious alternative, however, - we suggest using ".npy". - - For a simple way to combine multiple arrays into a single file, - one can use ZipFile to contain multiple ".npy" files. We - recommend using the file extension ".npz" for these archives. - - -Alternatives - - The author believes that this system (or one along these lines) is - about the simplest system that satisfies all of the requirements. - However, one must always be wary of introducing a new binary - format to the world. - - HDF5 [2] is a very flexible format that should be able to - represent all of NumPy's arrays in some fashion. It is probably - the only widely-used format that can faithfully represent all of - NumPy's array features. It has seen substantial adoption by the - scientific community in general and the NumPy community in - particular. It is an excellent solution for a wide variety of - array storage problems with or without NumPy. - - HDF5 is a complicated format that more or less implements - a hierarchical filesystem-in-a-file. This fact makes satisfying - some of the Requirements difficult. To the author's knowledge, as - of this writing, there is no application or library that reads or - writes even a subset of HDF5 files that does not use the canonical - libhdf5 implementation. This implementation is a large library - that is not always easy to build. It would be infeasible to - include it in numpy. - - It might be feasible to target an extremely limited subset of - HDF5. Namely, there would be only one object in it: the array. - Using contiguous storage for the data, one should be able to - implement just enough of the format to provide the same metadata - that the proposed format does. One could still meet all of the - technical requirements like mmapability. - - We would accrue a substantial benefit by being able to generate - files that could be read by other HDF5 software. Furthermore, by - providing the first non-libhdf5 implementation of HDF5, we would - be able to encourage more adoption of simple HDF5 in applications - where it was previously infeasible because of the size of the - library. The basic work may encourage similar dead-simple - implementations in other languages and further expand the - community. - - The remaining concern is about reverse engineerability of the - format. Even the simple subset of HDF5 would be very difficult to - reverse engineer given just a file by itself. However, given the - prominence of HDF5, this might not be a substantial concern. - - In conclusion, we are going forward with the design laid out in - this document. If someone writes code to handle the simple subset - of HDF5 that would be useful to us, we may consider a revision of - the file format. - - -Implementation - - The current implementation is in the trunk of the numpy SVN - repository and will be part of the 1.0.5 release. - - http://svn.scipy.org/svn/numpy/trunk - - Specifically, the file format.py in this directory implements the - format as described here. - - -References - - [1] http://docs.python.org/lib/module-pickle.html - - [2] http://hdf.ncsa.uiuc.edu/products/hdf5/index.html - - -Copyright - - This document has been placed in the public domain. - - - -Local Variables: -mode: indented-text -indent-tabs-mode: nil -sentence-end-double-space: t -fill-column: 70 -coding: utf-8 -End: Deleted: trunk/doc/pep_buffer.txt =================================================================== --- trunk/doc/pep_buffer.txt 2008-08-31 03:21:01 UTC (rev 5729) +++ trunk/doc/pep_buffer.txt 2008-08-31 03:28:56 UTC (rev 5730) @@ -1,869 +0,0 @@ -:PEP: 3118 -:Title: Revising the buffer protocol -:Version: $Revision$ -:Last-Modified: $Date$ -:Authors: Travis Oliphant , Carl Banks -: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. - - 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:' <--> ((int, int, int), ('r','g','b')) - -Mixed endian (weird but possible) - '>i:big: ((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 From numpy-svn at scipy.org Sun Aug 31 08:29:06 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 31 Aug 2008 07:29:06 -0500 (CDT) Subject: [Numpy-svn] r5731 - / Message-ID: <20080831122906.1A95F39C529@scipy.org> Author: cdavid Date: 2008-08-31 07:28:54 -0500 (Sun, 31 Aug 2008) New Revision: 5731 Added: cleaned_math_config/ Log: Start a branch to clean math configuration in umath module. Copied: cleaned_math_config (from rev 5730, trunk) From numpy-svn at scipy.org Sun Aug 31 08:36:21 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 31 Aug 2008 07:36:21 -0500 (CDT) Subject: [Numpy-svn] r5732 - trunk Message-ID: <20080831123621.1972B39C529@scipy.org> Author: cdavid Date: 2008-08-31 07:36:10 -0500 (Sun, 31 Aug 2008) New Revision: 5732 Modified: trunk/ Log: Initialized merge tracking via "svnmerge" with revisions "1-5731" from http://svn.scipy.org/svn/numpy/cleaned_math_config Property changes on: trunk ___________________________________________________________________ Name: svnmerge-integrated - /branches/aligned_alloca:1-5127 /branches/build_with_scons:1-4676 /branches/cdavid:1-5257 /branches/cleanconfig_rtm:1-4677 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /branches/vs_longstring:1-5656 /trunk:1-2871 + /branches/aligned_alloca:1-5127 /branches/build_with_scons:1-4676 /branches/cdavid:1-5257 /branches/cleanconfig_rtm:1-4677 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /branches/vs_longstring:1-5656 /cleaned_math_config:1-5731 /trunk:1-2871 From numpy-svn at scipy.org Sun Aug 31 08:47:24 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 31 Aug 2008 07:47:24 -0500 (CDT) Subject: [Numpy-svn] r5733 - cleaned_math_config Message-ID: <20080831124724.1391139C529@scipy.org> Author: cdavid Date: 2008-08-31 07:47:17 -0500 (Sun, 31 Aug 2008) New Revision: 5733 Modified: cleaned_math_config/ Log: Initialized merge tracking via "svnmerge" with revisions "1-5730" from http://svn.scipy.org/svn/numpy/trunk Property changes on: cleaned_math_config ___________________________________________________________________ Name: svnmerge-integrated - /branches/aligned_alloca:1-5127 /branches/build_with_scons:1-4676 /branches/cdavid:1-5257 /branches/cleanconfig_rtm:1-4677 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /branches/vs_longstring:1-5656 /trunk:1-2871 + /branches/aligned_alloca:1-5127 /branches/build_with_scons:1-4676 /branches/cdavid:1-5257 /branches/cleanconfig_rtm:1-4677 /branches/distutils-revamp:1-2752 /branches/distutils_scons_command:1-4619 /branches/multicore:1-3687 /branches/numpy.scons:1-4484 /branches/vs_longstring:1-5656 /trunk:1-5730 From numpy-svn at scipy.org Sun Aug 31 18:47:00 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 31 Aug 2008 17:47:00 -0500 (CDT) Subject: [Numpy-svn] r5734 - cleaned_math_config/numpy/distutils/command Message-ID: <20080831224700.4F96939C192@scipy.org> Author: cdavid Date: 2008-08-31 17:46:43 -0500 (Sun, 31 Aug 2008) New Revision: 5734 Modified: cleaned_math_config/numpy/distutils/command/config.py Log: Add a configuration test like AC_CHECK_FUNCS_ONCE. Modified: cleaned_math_config/numpy/distutils/command/config.py =================================================================== --- cleaned_math_config/numpy/distutils/command/config.py 2008-08-31 12:47:17 UTC (rev 5733) +++ cleaned_math_config/numpy/distutils/command/config.py 2008-08-31 22:46:43 UTC (rev 5734) @@ -140,6 +140,36 @@ return self.try_link(body, headers, include_dirs, libraries, library_dirs) + def check_funcs_once(self, funcs, + headers=None, include_dirs=None, + libraries=None, library_dirs=None, + decl=False, call=False, call_args=None): + """Like check_func, except that it is given a list of function in + funcs, and the test is done only once. Can be useful for faster + configure to test a serie of functions.""" + # clean up distutils's config a bit: add void to main(), and + # return a value. + self._check_compiler() + body = [] + if decl: + for func in funcs: + body.append("int %s ();" % func) + body.append("int main (void) {") + if call: + for func in funcs: + if not call_args.has_key(func): + call_args = '' + body.append(" %s(%s);" % (func, call_args[func])) + else: + for func in funcs: + body.append(" %s;" % func) + body.append(" return 0;") + body.append("}") + body = '\n'.join(body) + "\n" + + return self.try_link(body, headers, include_dirs, + libraries, library_dirs) + def get_output(self, body, headers=None, include_dirs=None, libraries=None, library_dirs=None, lang="c"):