From numpy-svn at scipy.org Tue Apr 1 10:23:49 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 1 Apr 2008 09:23:49 -0500 (CDT) Subject: [Numpy-svn] r4952 - trunk/numpy/oldnumeric Message-ID: <20080401142349.E0BC839C039@new.scipy.org> Author: oliphant Date: 2008-04-01 09:23:48 -0500 (Tue, 01 Apr 2008) New Revision: 4952 Modified: trunk/numpy/oldnumeric/ma.py Log: Add old ma.py interface to oldnumeric compatibility layer so that it stays the same. Modified: trunk/numpy/oldnumeric/ma.py =================================================================== --- trunk/numpy/oldnumeric/ma.py 2008-03-30 03:04:26 UTC (rev 4951) +++ trunk/numpy/oldnumeric/ma.py 2008-04-01 14:23:48 UTC (rev 4952) @@ -1,14 +1,2269 @@ -# Incompatibility in that getmask and a.mask returns nomask -# instead of None +"""MA: a facility for dealing with missing observations +MA is generally used as a numpy.array look-alike. +by Paul F. Dubois. -from numpy.ma import * -import numpy.ma as nca +Copyright 1999, 2000, 2001 Regents of the University of California. +Released for unlimited redistribution. +Adapted for numpy_core 2005 by Travis Oliphant and +(mainly) Paul Dubois. +""" +import types, sys + +import umath +import fromnumeric +from numeric import newaxis, ndarray, inf +from fromnumeric import amax, amin +from numerictypes import bool_, typecodes +import numeric +import warnings + +# Ufunc domain lookup for __array_wrap__ +ufunc_domain = {} +# Ufunc fills lookup for __array__ +ufunc_fills = {} + +MaskType = bool_ +nomask = MaskType(0) +divide_tolerance = 1.e-35 + +class MAError (Exception): + def __init__ (self, args=None): + "Create an exception" + + # The .args attribute must be a tuple. + if not isinstance(args, tuple): + args = (args,) + self.args = args + def __str__(self): + "Calculate the string representation" + return str(self.args[0]) + __repr__ = __str__ + +class _MaskedPrintOption: + "One instance of this class, masked_print_option, is created." + def __init__ (self, display): + "Create the masked print option object." + self.set_display(display) + self._enabled = 1 + + def display (self): + "Show what prints for masked values." + return self._display + + def set_display (self, s): + "set_display(s) sets what prints for masked values." + self._display = s + + def enabled (self): + "Is the use of the display value enabled?" + return self._enabled + + def enable(self, flag=1): + "Set the enabling flag to flag." + self._enabled = flag + + def __str__ (self): + return str(self._display) + + __repr__ = __str__ + +#if you single index into a masked location you get this object. +masked_print_option = _MaskedPrintOption('--') + +# Use single element arrays or scalars. +default_real_fill_value = 1.e20 +default_complex_fill_value = 1.e20 + 0.0j +default_character_fill_value = '-' +default_integer_fill_value = 999999 +default_object_fill_value = '?' + +def default_fill_value (obj): + "Function to calculate default fill value for an object." + if isinstance(obj, types.FloatType): + return default_real_fill_value + elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType): + return default_integer_fill_value + elif isinstance(obj, types.StringType): + return default_character_fill_value + elif isinstance(obj, types.ComplexType): + return default_complex_fill_value + elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray): + x = obj.dtype.char + if x in typecodes['Float']: + return default_real_fill_value + if x in typecodes['Integer']: + return default_integer_fill_value + if x in typecodes['Complex']: + return default_complex_fill_value + if x in typecodes['Character']: + return default_character_fill_value + if x in typecodes['UnsignedInteger']: + return umath.absolute(default_integer_fill_value) + return default_object_fill_value + else: + return default_object_fill_value + +def minimum_fill_value (obj): + "Function to calculate default fill value suitable for taking minima." + if isinstance(obj, types.FloatType): + return numeric.inf + elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType): + return sys.maxint + elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray): + x = obj.dtype.char + if x in typecodes['Float']: + return numeric.inf + if x in typecodes['Integer']: + return sys.maxint + if x in typecodes['UnsignedInteger']: + return sys.maxint + else: + raise TypeError, 'Unsuitable type for calculating minimum.' + +def maximum_fill_value (obj): + "Function to calculate default fill value suitable for taking maxima." + if isinstance(obj, types.FloatType): + return -inf + elif isinstance(obj, types.IntType) or isinstance(obj, types.LongType): + return -sys.maxint + elif isinstance(obj, MaskedArray) or isinstance(obj, ndarray): + x = obj.dtype.char + if x in typecodes['Float']: + return -inf + if x in typecodes['Integer']: + return -sys.maxint + if x in typecodes['UnsignedInteger']: + return 0 + else: + raise TypeError, 'Unsuitable type for calculating maximum.' + +def set_fill_value (a, fill_value): + "Set fill value of a if it is a masked array." + if isMaskedArray(a): + a.set_fill_value (fill_value) + +def getmask (a): + """Mask of values in a; could be nomask. + Returns nomask if a is not a masked array. + To get an array for sure use getmaskarray.""" + if isinstance(a, MaskedArray): + return a.raw_mask() + else: + return nomask + +def getmaskarray (a): + """Mask of values in a; an array of zeros if mask is nomask + or not a masked array, and is a byte-sized integer. + Do not try to add up entries, for example. + """ + m = getmask(a) + if m is nomask: + return make_mask_none(shape(a)) + else: + return m + +def is_mask (m): + """Is m a legal mask? Does not check contents, only type. + """ + try: + return m.dtype.type is MaskType + except AttributeError: + return False + +def make_mask (m, copy=0, flag=0): + """make_mask(m, copy=0, flag=0) + return m as a mask, creating a copy if necessary or requested. + Can accept any sequence of integers or nomask. Does not check + that contents must be 0s and 1s. + if flag, return nomask if m contains no true elements. + """ + if m is nomask: + return nomask + elif isinstance(m, ndarray): + if m.dtype.type is MaskType: + if copy: + result = numeric.array(m, dtype=MaskType, copy=copy) + else: + result = m + else: + result = m.astype(MaskType) + else: + result = filled(m, True).astype(MaskType) + + if flag and not fromnumeric.sometrue(fromnumeric.ravel(result)): + return nomask + else: + return result + +def make_mask_none (s): + "Return a mask of all zeros of shape s." + result = numeric.zeros(s, dtype=MaskType) + result.shape = s + return result + +def mask_or (m1, m2): + """Logical or of the mask candidates m1 and m2, treating nomask as false. + Result may equal m1 or m2 if the other is nomask. + """ + if m1 is nomask: return make_mask(m2) + if m2 is nomask: return make_mask(m1) + if m1 is m2 and is_mask(m1): return m1 + return make_mask(umath.logical_or(m1, m2)) + +def filled (a, value = None): + """a as a contiguous numeric array with any masked areas replaced by value + if value is None or the special element "masked", get_fill_value(a) + is used instead. + + If a is already a contiguous numeric array, a itself is returned. + + filled(a) can be used to be sure that the result is numeric when + passing an object a to other software ignorant of MA, in particular to + numeric itself. + """ + if isinstance(a, MaskedArray): + return a.filled(value) + elif isinstance(a, ndarray) and a.flags['CONTIGUOUS']: + return a + elif isinstance(a, types.DictType): + return numeric.array(a, 'O') + else: + return numeric.array(a) + +def get_fill_value (a): + """ + The fill value of a, if it has one; otherwise, the default fill value + for that type. + """ + if isMaskedArray(a): + result = a.fill_value() + else: + result = default_fill_value(a) + return result + +def common_fill_value (a, b): + "The common fill_value of a and b, if there is one, or None" + t1 = get_fill_value(a) + t2 = get_fill_value(b) + if t1 == t2: return t1 + return None + +# Domain functions return 1 where the argument(s) are not in the domain. +class domain_check_interval: + "domain_check_interval(a,b)(x) = true where x < a or y > b" + def __init__(self, y1, y2): + "domain_check_interval(a,b)(x) = true where x < a or y > b" + self.y1 = y1 + self.y2 = y2 + + def __call__ (self, x): + "Execute the call behavior." + return umath.logical_or(umath.greater (x, self.y2), + umath.less(x, self.y1) + ) + +class domain_tan: + "domain_tan(eps) = true where abs(cos(x)) < eps)" + def __init__(self, eps): + "domain_tan(eps) = true where abs(cos(x)) < eps)" + self.eps = eps + + def __call__ (self, x): + "Execute the call behavior." + return umath.less(umath.absolute(umath.cos(x)), self.eps) + +class domain_greater: + "domain_greater(v)(x) = true where x <= v" + def __init__(self, critical_value): + "domain_greater(v)(x) = true where x <= v" + self.critical_value = critical_value + + def __call__ (self, x): + "Execute the call behavior." + return umath.less_equal (x, self.critical_value) + +class domain_greater_equal: + "domain_greater_equal(v)(x) = true where x < v" + def __init__(self, critical_value): + "domain_greater_equal(v)(x) = true where x < v" + self.critical_value = critical_value + + def __call__ (self, x): + "Execute the call behavior." + return umath.less (x, self.critical_value) + +class masked_unary_operation: + def __init__ (self, aufunc, fill=0, domain=None): + """ masked_unary_operation(aufunc, fill=0, domain=None) + aufunc(fill) must be defined + self(x) returns aufunc(x) + with masked values where domain(x) is true or getmask(x) is true. + """ + self.f = aufunc + self.fill = fill + self.domain = domain + self.__doc__ = getattr(aufunc, "__doc__", str(aufunc)) + self.__name__ = getattr(aufunc, "__name__", str(aufunc)) + ufunc_domain[aufunc] = domain + ufunc_fills[aufunc] = fill, + + def __call__ (self, a, *args, **kwargs): + "Execute the call behavior." +# numeric tries to return scalars rather than arrays when given scalars. + m = getmask(a) + d1 = filled(a, self.fill) + if self.domain is not None: + m = mask_or(m, self.domain(d1)) + result = self.f(d1, *args, **kwargs) + return masked_array(result, m) + + def __str__ (self): + return "Masked version of " + str(self.f) + + +class domain_safe_divide: + def __init__ (self, tolerance=divide_tolerance): + self.tolerance = tolerance + def __call__ (self, a, b): + return umath.absolute(a) * self.tolerance >= umath.absolute(b) + +class domained_binary_operation: + """Binary operations that have a domain, like divide. These are complicated + so they are a separate class. They have no reduce, outer or accumulate. + """ + def __init__ (self, abfunc, domain, fillx=0, filly=0): + """abfunc(fillx, filly) must be defined. + abfunc(x, filly) = x for all x to enable reduce. + """ + self.f = abfunc + self.domain = domain + self.fillx = fillx + self.filly = filly + self.__doc__ = getattr(abfunc, "__doc__", str(abfunc)) + self.__name__ = getattr(abfunc, "__name__", str(abfunc)) + ufunc_domain[abfunc] = domain + ufunc_fills[abfunc] = fillx, filly + + def __call__(self, a, b): + "Execute the call behavior." + ma = getmask(a) + mb = getmask(b) + d1 = filled(a, self.fillx) + d2 = filled(b, self.filly) + t = self.domain(d1, d2) + + if fromnumeric.sometrue(t, None): + d2 = where(t, self.filly, d2) + mb = mask_or(mb, t) + m = mask_or(ma, mb) + result = self.f(d1, d2) + return masked_array(result, m) + + def __str__ (self): + return "Masked version of " + str(self.f) + +class masked_binary_operation: + def __init__ (self, abfunc, fillx=0, filly=0): + """abfunc(fillx, filly) must be defined. + abfunc(x, filly) = x for all x to enable reduce. + """ + self.f = abfunc + self.fillx = fillx + self.filly = filly + self.__doc__ = getattr(abfunc, "__doc__", str(abfunc)) + ufunc_domain[abfunc] = None + ufunc_fills[abfunc] = fillx, filly + + def __call__ (self, a, b, *args, **kwargs): + "Execute the call behavior." + m = mask_or(getmask(a), getmask(b)) + d1 = filled(a, self.fillx) + d2 = filled(b, self.filly) + result = self.f(d1, d2, *args, **kwargs) + if isinstance(result, ndarray) \ + and m.ndim != 0 \ + and m.shape != result.shape: + m = mask_or(getmaskarray(a), getmaskarray(b)) + return masked_array(result, m) + + def reduce (self, target, axis=0, dtype=None): + """Reduce target along the given axis with this function.""" + m = getmask(target) + t = filled(target, self.filly) + if t.shape == (): + t = t.reshape(1) + if m is not nomask: + m = make_mask(m, copy=1) + m.shape = (1,) + if m is nomask: + t = self.f.reduce(t, axis) + else: + t = masked_array (t, m) + # XXX: "or t.dtype" below is a workaround for what appears + # XXX: to be a bug in reduce. + t = self.f.reduce(filled(t, self.filly), axis, + dtype=dtype or t.dtype) + m = umath.logical_and.reduce(m, axis) + if isinstance(t, ndarray): + return masked_array(t, m, get_fill_value(target)) + elif m: + return masked + else: + return t + + def outer (self, a, b): + "Return the function applied to the outer product of a and b." + ma = getmask(a) + mb = getmask(b) + if ma is nomask and mb is nomask: + m = nomask + else: + ma = getmaskarray(a) + mb = getmaskarray(b) + m = logical_or.outer(ma, mb) + d = self.f.outer(filled(a, self.fillx), filled(b, self.filly)) + return masked_array(d, m) + + def accumulate (self, target, axis=0): + """Accumulate target along axis after filling with y fill value.""" + t = filled(target, self.filly) + return masked_array (self.f.accumulate (t, axis)) + def __str__ (self): + return "Masked version of " + str(self.f) + +sqrt = masked_unary_operation(umath.sqrt, 0.0, domain_greater_equal(0.0)) +log = masked_unary_operation(umath.log, 1.0, domain_greater(0.0)) +log10 = masked_unary_operation(umath.log10, 1.0, domain_greater(0.0)) +exp = masked_unary_operation(umath.exp) +conjugate = masked_unary_operation(umath.conjugate) +sin = masked_unary_operation(umath.sin) +cos = masked_unary_operation(umath.cos) +tan = masked_unary_operation(umath.tan, 0.0, domain_tan(1.e-35)) +arcsin = masked_unary_operation(umath.arcsin, 0.0, domain_check_interval(-1.0, 1.0)) +arccos = masked_unary_operation(umath.arccos, 0.0, domain_check_interval(-1.0, 1.0)) +arctan = masked_unary_operation(umath.arctan) +# Missing from numeric +arcsinh = masked_unary_operation(umath.arcsinh) +arccosh = masked_unary_operation(umath.arccosh, 1.0, domain_greater_equal(1.0)) +arctanh = masked_unary_operation(umath.arctanh, 0.0, domain_check_interval(-1.0+1e-15, 1.0-1e-15)) +sinh = masked_unary_operation(umath.sinh) +cosh = masked_unary_operation(umath.cosh) +tanh = masked_unary_operation(umath.tanh) +absolute = masked_unary_operation(umath.absolute) +fabs = masked_unary_operation(umath.fabs) +negative = masked_unary_operation(umath.negative) + +def nonzero(a): + """returns the indices of the elements of a which are not zero + and not masked + """ + return numeric.asarray(filled(a, 0).nonzero()) + +around = masked_unary_operation(fromnumeric.round_) +floor = masked_unary_operation(umath.floor) +ceil = masked_unary_operation(umath.ceil) +logical_not = masked_unary_operation(umath.logical_not) + +add = masked_binary_operation(umath.add) +subtract = masked_binary_operation(umath.subtract) +subtract.reduce = None +multiply = masked_binary_operation(umath.multiply, 1, 1) +divide = domained_binary_operation(umath.divide, domain_safe_divide(), 0, 1) +true_divide = domained_binary_operation(umath.true_divide, domain_safe_divide(), 0, 1) +floor_divide = domained_binary_operation(umath.floor_divide, domain_safe_divide(), 0, 1) +remainder = domained_binary_operation(umath.remainder, domain_safe_divide(), 0, 1) +fmod = domained_binary_operation(umath.fmod, domain_safe_divide(), 0, 1) +hypot = masked_binary_operation(umath.hypot) +arctan2 = masked_binary_operation(umath.arctan2, 0.0, 1.0) +arctan2.reduce = None +equal = masked_binary_operation(umath.equal) +equal.reduce = None +not_equal = masked_binary_operation(umath.not_equal) +not_equal.reduce = None +less_equal = masked_binary_operation(umath.less_equal) +less_equal.reduce = None +greater_equal = masked_binary_operation(umath.greater_equal) +greater_equal.reduce = None +less = masked_binary_operation(umath.less) +less.reduce = None +greater = masked_binary_operation(umath.greater) +greater.reduce = None +logical_and = masked_binary_operation(umath.logical_and) +alltrue = masked_binary_operation(umath.logical_and, 1, 1).reduce +logical_or = masked_binary_operation(umath.logical_or) +sometrue = logical_or.reduce +logical_xor = masked_binary_operation(umath.logical_xor) +bitwise_and = masked_binary_operation(umath.bitwise_and) +bitwise_or = masked_binary_operation(umath.bitwise_or) +bitwise_xor = masked_binary_operation(umath.bitwise_xor) + +def rank (object): + return fromnumeric.rank(filled(object)) + +def shape (object): + return fromnumeric.shape(filled(object)) + +def size (object, axis=None): + return fromnumeric.size(filled(object), axis) + +class MaskedArray (object): + """Arrays with possibly masked values. + Masked values of 1 exclude the corresponding element from + any computation. + + Construction: + x = array(data, dtype=None, copy=True, order=False, + mask = nomask, fill_value=None) + + If copy=False, every effort is made not to copy the data: + If data is a MaskedArray, and argument mask=nomask, + then the candidate data is data.data and the + mask used is data.mask. If data is a numeric array, + it is used as the candidate raw data. + If dtype is not None and + is != data.dtype.char then a data copy is required. + Otherwise, the candidate is used. + + If a data copy is required, raw data stored is the result of: + numeric.array(data, dtype=dtype.char, copy=copy) + + If mask is nomask there are no masked values. Otherwise mask must + be convertible to an array of booleans with the same shape as x. + + fill_value is used to fill in masked values when necessary, + such as when printing and in method/function filled(). + The fill_value is not used for computation within this module. + """ + __array_priority__ = 10.1 + def __init__(self, data, dtype=None, copy=True, order=False, + mask=nomask, fill_value=None): + """array(data, dtype=None, copy=True, order=False, mask=nomask, fill_value=None) + If data already a numeric array, its dtype becomes the default value of dtype. + """ + if dtype is None: + tc = None + else: + tc = numeric.dtype(dtype) + need_data_copied = copy + if isinstance(data, MaskedArray): + c = data.data + if tc is None: + tc = c.dtype + elif tc != c.dtype: + need_data_copied = True + if mask is nomask: + mask = data.mask + elif mask is not nomask: #attempting to change the mask + need_data_copied = True + + elif isinstance(data, ndarray): + c = data + if tc is None: + tc = c.dtype + elif tc != c.dtype: + need_data_copied = True + else: + need_data_copied = False #because I'll do it now + c = numeric.array(data, dtype=tc, copy=True, order=order) + tc = c.dtype + + if need_data_copied: + if tc == c.dtype: + self._data = numeric.array(c, dtype=tc, copy=True, order=order) + else: + self._data = c.astype(tc) + else: + self._data = c + + if mask is nomask: + self._mask = nomask + self._shared_mask = 0 + else: + self._mask = make_mask (mask) + if self._mask is nomask: + self._shared_mask = 0 + else: + self._shared_mask = (self._mask is mask) + nm = size(self._mask) + nd = size(self._data) + if nm != nd: + if nm == 1: + self._mask = fromnumeric.resize(self._mask, self._data.shape) + self._shared_mask = 0 + elif nd == 1: + self._data = fromnumeric.resize(self._data, self._mask.shape) + self._data.shape = self._mask.shape + else: + raise MAError, "Mask and data not compatible." + elif nm == 1 and shape(self._mask) != shape(self._data): + self.unshare_mask() + self._mask.shape = self._data.shape + + self.set_fill_value(fill_value) + + def __array__ (self, t=None, context=None): + "Special hook for numeric. Converts to numeric if possible." + if self._mask is not nomask: + if fromnumeric.ravel(self._mask).any(): + if context is None: + warnings.warn("Cannot automatically convert masked array to "\ + "numeric because data\n is masked in one or "\ + "more locations."); + return self._data + #raise MAError, \ + # """Cannot automatically convert masked array to numeric because data + # is masked in one or more locations. + # """ + else: + func, args, i = context + fills = ufunc_fills.get(func) + if fills is None: + raise MAError, "%s not known to ma" % func + return self.filled(fills[i]) + else: # Mask is all false + # Optimize to avoid future invocations of this section. + self._mask = nomask + self._shared_mask = 0 + if t: + return self._data.astype(t) + else: + return self._data + + def __array_wrap__ (self, array, context=None): + """Special hook for ufuncs. + + Wraps the numpy array and sets the mask according to + context. + """ + if context is None: + return MaskedArray(array, copy=False, mask=nomask) + func, args = context[:2] + domain = ufunc_domain[func] + m = reduce(mask_or, [getmask(a) for a in args]) + if domain is not None: + m = mask_or(m, domain(*[getattr(a, '_data', a) + for a in args])) + if m is not nomask: + try: + shape = array.shape + except AttributeError: + pass + else: + if m.shape != shape: + m = reduce(mask_or, [getmaskarray(a) for a in args]) + + return MaskedArray(array, copy=False, mask=m) + + def _get_shape(self): + "Return the current shape." + return self._data.shape + + def _set_shape (self, newshape): + "Set the array's shape." + self._data.shape = newshape + if self._mask is not nomask: + self._mask = self._mask.copy() + self._mask.shape = newshape + + def _get_flat(self): + """Calculate the flat value. + """ + if self._mask is nomask: + return masked_array(self._data.ravel(), mask=nomask, + fill_value = self.fill_value()) + else: + return masked_array(self._data.ravel(), + mask=self._mask.ravel(), + fill_value = self.fill_value()) + + def _set_flat (self, value): + "x.flat = value" + y = self.ravel() + y[:] = value + + def _get_real(self): + "Get the real part of a complex array." + if self._mask is nomask: + return masked_array(self._data.real, mask=nomask, + fill_value = self.fill_value()) + else: + return masked_array(self._data.real, mask=self._mask, + fill_value = self.fill_value()) + + def _set_real (self, value): + "x.real = value" + y = self.real + y[...] = value + + def _get_imaginary(self): + "Get the imaginary part of a complex array." + if self._mask is nomask: + return masked_array(self._data.imag, mask=nomask, + fill_value = self.fill_value()) + else: + return masked_array(self._data.imag, mask=self._mask, + fill_value = self.fill_value()) + + def _set_imaginary (self, value): + "x.imaginary = value" + y = self.imaginary + y[...] = value + + def __str__(self): + """Calculate the str representation, using masked for fill if + it is enabled. Otherwise fill with fill value. + """ + if masked_print_option.enabled(): + f = masked_print_option + # XXX: Without the following special case masked + # XXX: would print as "[--]", not "--". Can we avoid + # XXX: checks for masked by choosing a different value + # XXX: for the masked singleton? 2005-01-05 -- sasha + if self is masked: + return str(f) + m = self._mask + if m is not nomask and m.shape == () and m: + return str(f) + # convert to object array to make filled work + self = self.astype(object) + else: + f = self.fill_value() + res = self.filled(f) + return str(res) + + def __repr__(self): + """Calculate the repr representation, using masked for fill if + it is enabled. Otherwise fill with fill value. + """ + with_mask = """\ +array(data = + %(data)s, + mask = + %(mask)s, + fill_value=%(fill)s) +""" + with_mask1 = """\ +array(data = %(data)s, + mask = %(mask)s, + fill_value=%(fill)s) +""" + without_mask = """array( + %(data)s)""" + without_mask1 = """array(%(data)s)""" + + n = len(self.shape) + if self._mask is nomask: + if n <= 1: + return without_mask1 % {'data':str(self.filled())} + return without_mask % {'data':str(self.filled())} + else: + if n <= 1: + return with_mask % { + 'data': str(self.filled()), + 'mask': str(self._mask), + 'fill': str(self.fill_value()) + } + return with_mask % { + 'data': str(self.filled()), + 'mask': str(self._mask), + 'fill': str(self.fill_value()) + } + without_mask1 = """array(%(data)s)""" + if self._mask is nomask: + return without_mask % {'data':str(self.filled())} + else: + return with_mask % { + 'data': str(self.filled()), + 'mask': str(self._mask), + 'fill': str(self.fill_value()) + } + + def __float__(self): + "Convert self to float." + self.unmask() + if self._mask is not nomask: + raise MAError, 'Cannot convert masked element to a Python float.' + return float(self.data.item()) + + def __int__(self): + "Convert self to int." + self.unmask() + if self._mask is not nomask: + raise MAError, 'Cannot convert masked element to a Python int.' + return int(self.data.item()) + + def __getitem__(self, i): + "Get item described by i. Not a copy as in previous versions." + self.unshare_mask() + m = self._mask + dout = self._data[i] + if m is nomask: + try: + if dout.size == 1: + return dout + else: + return masked_array(dout, fill_value=self._fill_value) + except AttributeError: + return dout + mi = m[i] + if mi.size == 1: + if mi: + return masked + else: + return dout + else: + return masked_array(dout, mi, fill_value=self._fill_value) + +# -------- +# setitem and setslice notes +# note that if value is masked, it means to mask those locations. +# setting a value changes the mask to match the value in those locations. + + def __setitem__(self, index, value): + "Set item described by index. If value is masked, mask those locations." + d = self._data + if self is masked: + raise MAError, 'Cannot alter masked elements.' + if value is masked: + if self._mask is nomask: + self._mask = make_mask_none(d.shape) + self._shared_mask = False + else: + self.unshare_mask() + self._mask[index] = True + return + m = getmask(value) + value = filled(value).astype(d.dtype) + d[index] = value + if m is nomask: + if self._mask is not nomask: + self.unshare_mask() + self._mask[index] = False + else: + if self._mask is nomask: + self._mask = make_mask_none(d.shape) + self._shared_mask = True + else: + self.unshare_mask() + self._mask[index] = m + + def __nonzero__(self): + """returns true if any element is non-zero or masked + + """ + # XXX: This changes bool conversion logic from MA. + # XXX: In MA bool(a) == len(a) != 0, but in numpy + # XXX: scalars do not have len + m = self._mask + d = self._data + return bool(m is not nomask and m.any() + or d is not nomask and d.any()) + + def __len__ (self): + """Return length of first dimension. This is weird but Python's + slicing behavior depends on it.""" + return len(self._data) + + def __and__(self, other): + "Return bitwise_and" + return bitwise_and(self, other) + + def __or__(self, other): + "Return bitwise_or" + return bitwise_or(self, other) + + def __xor__(self, other): + "Return bitwise_xor" + return bitwise_xor(self, other) + + __rand__ = __and__ + __ror__ = __or__ + __rxor__ = __xor__ + + def __abs__(self): + "Return absolute(self)" + return absolute(self) + + def __neg__(self): + "Return negative(self)" + return negative(self) + + def __pos__(self): + "Return array(self)" + return array(self) + + def __add__(self, other): + "Return add(self, other)" + return add(self, other) + + __radd__ = __add__ + + def __mod__ (self, other): + "Return remainder(self, other)" + return remainder(self, other) + + def __rmod__ (self, other): + "Return remainder(other, self)" + return remainder(other, self) + + def __lshift__ (self, n): + return left_shift(self, n) + + def __rshift__ (self, n): + return right_shift(self, n) + + def __sub__(self, other): + "Return subtract(self, other)" + return subtract(self, other) + + def __rsub__(self, other): + "Return subtract(other, self)" + return subtract(other, self) + + def __mul__(self, other): + "Return multiply(self, other)" + return multiply(self, other) + + __rmul__ = __mul__ + + def __div__(self, other): + "Return divide(self, other)" + return divide(self, other) + + def __rdiv__(self, other): + "Return divide(other, self)" + return divide(other, self) + + def __truediv__(self, other): + "Return divide(self, other)" + return true_divide(self, other) + + def __rtruediv__(self, other): + "Return divide(other, self)" + return true_divide(other, self) + + def __floordiv__(self, other): + "Return divide(self, other)" + return floor_divide(self, other) + + def __rfloordiv__(self, other): + "Return divide(other, self)" + return floor_divide(other, self) + + def __pow__(self, other, third=None): + "Return power(self, other, third)" + return power(self, other, third) + + def __sqrt__(self): + "Return sqrt(self)" + return sqrt(self) + + def __iadd__(self, other): + "Add other to self in place." + t = self._data.dtype.char + f = filled(other, 0) + t1 = f.dtype.char + if t == t1: + pass + elif t in typecodes['Integer']: + if t1 in typecodes['Integer']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + elif t in typecodes['Float']: + if t1 in typecodes['Integer']: + f = f.astype(t) + elif t1 in typecodes['Float']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + elif t in typecodes['Complex']: + if t1 in typecodes['Integer']: + f = f.astype(t) + elif t1 in typecodes['Float']: + f = f.astype(t) + elif t1 in typecodes['Complex']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + else: + raise TypeError, 'Incorrect type for in-place operation.' + + if self._mask is nomask: + self._data += f + m = getmask(other) + self._mask = m + self._shared_mask = m is not nomask + else: + result = add(self, masked_array(f, mask=getmask(other))) + self._data = result.data + self._mask = result.mask + self._shared_mask = 1 + return self + + def __imul__(self, other): + "Add other to self in place." + t = self._data.dtype.char + f = filled(other, 0) + t1 = f.dtype.char + if t == t1: + pass + elif t in typecodes['Integer']: + if t1 in typecodes['Integer']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + elif t in typecodes['Float']: + if t1 in typecodes['Integer']: + f = f.astype(t) + elif t1 in typecodes['Float']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + elif t in typecodes['Complex']: + if t1 in typecodes['Integer']: + f = f.astype(t) + elif t1 in typecodes['Float']: + f = f.astype(t) + elif t1 in typecodes['Complex']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + else: + raise TypeError, 'Incorrect type for in-place operation.' + + if self._mask is nomask: + self._data *= f + m = getmask(other) + self._mask = m + self._shared_mask = m is not nomask + else: + result = multiply(self, masked_array(f, mask=getmask(other))) + self._data = result.data + self._mask = result.mask + self._shared_mask = 1 + return self + + def __isub__(self, other): + "Subtract other from self in place." + t = self._data.dtype.char + f = filled(other, 0) + t1 = f.dtype.char + if t == t1: + pass + elif t in typecodes['Integer']: + if t1 in typecodes['Integer']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + elif t in typecodes['Float']: + if t1 in typecodes['Integer']: + f = f.astype(t) + elif t1 in typecodes['Float']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + elif t in typecodes['Complex']: + if t1 in typecodes['Integer']: + f = f.astype(t) + elif t1 in typecodes['Float']: + f = f.astype(t) + elif t1 in typecodes['Complex']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + else: + raise TypeError, 'Incorrect type for in-place operation.' + + if self._mask is nomask: + self._data -= f + m = getmask(other) + self._mask = m + self._shared_mask = m is not nomask + else: + result = subtract(self, masked_array(f, mask=getmask(other))) + self._data = result.data + self._mask = result.mask + self._shared_mask = 1 + return self + + + + def __idiv__(self, other): + "Divide self by other in place." + t = self._data.dtype.char + f = filled(other, 0) + t1 = f.dtype.char + if t == t1: + pass + elif t in typecodes['Integer']: + if t1 in typecodes['Integer']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + elif t in typecodes['Float']: + if t1 in typecodes['Integer']: + f = f.astype(t) + elif t1 in typecodes['Float']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + elif t in typecodes['Complex']: + if t1 in typecodes['Integer']: + f = f.astype(t) + elif t1 in typecodes['Float']: + f = f.astype(t) + elif t1 in typecodes['Complex']: + f = f.astype(t) + else: + raise TypeError, 'Incorrect type for in-place operation.' + else: + raise TypeError, 'Incorrect type for in-place operation.' + mo = getmask(other) + result = divide(self, masked_array(f, mask=mo)) + self._data = result.data + dm = result.raw_mask() + if dm is not self._mask: + self._mask = dm + self._shared_mask = 1 + return self + + def __eq__(self, other): + return equal(self,other) + + def __ne__(self, other): + return not_equal(self,other) + + def __lt__(self, other): + return less(self,other) + + def __le__(self, other): + return less_equal(self,other) + + def __gt__(self, other): + return greater(self,other) + + def __ge__(self, other): + return greater_equal(self,other) + + def astype (self, tc): + "return self as array of given type." + d = self._data.astype(tc) + return array(d, mask=self._mask) + + def byte_swapped(self): + """Returns the raw data field, byte_swapped. Included for consistency + with numeric but doesn't make sense in this context. + """ + return self._data.byte_swapped() + + def compressed (self): + "A 1-D array of all the non-masked data." + d = fromnumeric.ravel(self._data) + if self._mask is nomask: + return array(d) + else: + m = 1 - fromnumeric.ravel(self._mask) + c = fromnumeric.compress(m, d) + return array(c, copy=0) + + def count (self, axis = None): + "Count of the non-masked elements in a, or along a certain axis." + m = self._mask + s = self._data.shape + ls = len(s) + if m is nomask: + if ls == 0: + return 1 + if ls == 1: + return s[0] + if axis is None: + return reduce(lambda x, y:x*y, s) + else: + n = s[axis] + t = list(s) + del t[axis] + return ones(t) * n + if axis is None: + w = fromnumeric.ravel(m).astype(int) + n1 = size(w) + if n1 == 1: + n2 = w[0] + else: + n2 = umath.add.reduce(w) + return n1 - n2 + else: + n1 = size(m, axis) + n2 = sum(m.astype(int), axis) + return n1 - n2 + + def dot (self, other): + "s.dot(other) = innerproduct(s, other)" + return innerproduct(self, other) + + def fill_value(self): + "Get the current fill value." + return self._fill_value + + def filled (self, fill_value=None): + """A numeric array with masked values filled. If fill_value is None, + use self.fill_value(). + + If mask is nomask, copy data only if not contiguous. + Result is always a contiguous, numeric array. +# Is contiguous really necessary now? + """ + d = self._data + m = self._mask + if m is nomask: + if d.flags['CONTIGUOUS']: + return d + else: + return d.copy() + else: + if fill_value is None: + value = self._fill_value + else: + value = fill_value + + if self is masked: + result = numeric.array(value) + else: + try: + result = numeric.array(d, dtype=d.dtype, copy=1) + result[m] = value + except (TypeError, AttributeError): + #ok, can't put that value in here + value = numeric.array(value, dtype=object) + d = d.astype(object) + result = fromnumeric.choose(m, (d, value)) + return result + + def ids (self): + """Return the ids of the data and mask areas""" + return (id(self._data), id(self._mask)) + + def iscontiguous (self): + "Is the data contiguous?" + return self._data.flags['CONTIGUOUS'] + + def itemsize(self): + "Item size of each data item." + return self._data.itemsize + + + def outer(self, other): + "s.outer(other) = outerproduct(s, other)" + return outerproduct(self, other) + + def put (self, values): + """Set the non-masked entries of self to filled(values). + No change to mask + """ + iota = numeric.arange(self.size) + d = self._data + if self._mask is nomask: + ind = iota + else: + ind = fromnumeric.compress(1 - self._mask, iota) + d[ind] = filled(values).astype(d.dtype) + + def putmask (self, values): + """Set the masked entries of self to filled(values). + Mask changed to nomask. + """ + d = self._data + if self._mask is not nomask: + d[self._mask] = filled(values).astype(d.dtype) + self._shared_mask = 0 + self._mask = nomask + + def ravel (self): + """Return a 1-D view of self.""" + if self._mask is nomask: + return masked_array(self._data.ravel()) + else: + return masked_array(self._data.ravel(), self._mask.ravel()) + + def raw_data (self): + """ Obsolete; use data property instead. + The raw data; portions may be meaningless. + May be noncontiguous. Expert use only.""" + return self._data + data = property(fget=raw_data, + doc="The data, but values at masked locations are meaningless.") + + def raw_mask (self): + """ Obsolete; use mask property instead. + May be noncontiguous. Expert use only. + """ + return self._mask + mask = property(fget=raw_mask, + doc="The mask, may be nomask. Values where mask true are meaningless.") + + def reshape (self, *s): + """This array reshaped to shape s""" + d = self._data.reshape(*s) + if self._mask is nomask: + return masked_array(d) + else: + m = self._mask.reshape(*s) + return masked_array(d, m) + + def set_fill_value (self, v=None): + "Set the fill value to v. Omit v to restore default." + if v is None: + v = default_fill_value (self.raw_data()) + self._fill_value = v + + def _get_ndim(self): + return self._data.ndim + ndim = property(_get_ndim, doc=numeric.ndarray.ndim.__doc__) + + def _get_size (self): + return self._data.size + size = property(fget=_get_size, doc="Number of elements in the array.") +## CHECK THIS: signature of numeric.array.size? + + def _get_dtype(self): + return self._data.dtype + dtype = property(fget=_get_dtype, doc="type of the array elements.") + + def item(self, *args): + "Return Python scalar if possible" + if self._mask is not nomask: + m = self._mask.item(*args) + try: + if m[0]: + return masked + except IndexError: + return masked + return self._data.item(*args) + + def itemset(self, *args): + "Set Python scalar into array" + item = args[-1] + args = args[:-1] + self[args] = item + + def tolist(self, fill_value=None): + "Convert to list" + return self.filled(fill_value).tolist() + + def tostring(self, fill_value=None): + "Convert to string" + return self.filled(fill_value).tostring() + + def unmask (self): + "Replace the mask by nomask if possible." + if self._mask is nomask: return + m = make_mask(self._mask, flag=1) + if m is nomask: + self._mask = nomask + self._shared_mask = 0 + + def unshare_mask (self): + "If currently sharing mask, make a copy." + if self._shared_mask: + self._mask = make_mask (self._mask, copy=1, flag=0) + self._shared_mask = 0 + + def _get_ctypes(self): + return self._data.ctypes + + def _get_T(self): + if (self.ndim < 2): + return self + return self.transpose() + + shape = property(_get_shape, _set_shape, + doc = 'tuple giving the shape of the array') + + flat = property(_get_flat, _set_flat, + doc = 'Access array in flat form.') + + real = property(_get_real, _set_real, + doc = 'Access the real part of the array') + + imaginary = property(_get_imaginary, _set_imaginary, + doc = 'Access the imaginary part of the array') + + imag = imaginary + + ctypes = property(_get_ctypes, None, doc="ctypes") + + T = property(_get_T, None, doc="get transpose") + +#end class MaskedArray + +array = MaskedArray + +def isMaskedArray (x): + "Is x a masked array, that is, an instance of MaskedArray?" + return isinstance(x, MaskedArray) + +isarray = isMaskedArray +isMA = isMaskedArray #backward compatibility + +def allclose (a, b, fill_value=1, rtol=1.e-5, atol=1.e-8): + """ Returns true if all components of a and b are equal + subject to given tolerances. + If fill_value is 1, masked values considered equal. + If fill_value is 0, masked values considered unequal. + The relative error rtol should be positive and << 1.0 + The absolute error atol comes into play for those elements + of b that are very small or zero; it says how small a must be also. + """ + m = mask_or(getmask(a), getmask(b)) + d1 = filled(a) + d2 = filled(b) + x = filled(array(d1, copy=0, mask=m), fill_value).astype(float) + y = filled(array(d2, copy=0, mask=m), 1).astype(float) + d = umath.less_equal(umath.absolute(x-y), atol + rtol * umath.absolute(y)) + return fromnumeric.alltrue(fromnumeric.ravel(d)) + +def allequal (a, b, fill_value=1): + """ + True if all entries of a and b are equal, using + fill_value as a truth value where either or both are masked. + """ + m = mask_or(getmask(a), getmask(b)) + if m is nomask: + x = filled(a) + y = filled(b) + d = umath.equal(x, y) + return fromnumeric.alltrue(fromnumeric.ravel(d)) + elif fill_value: + x = filled(a) + y = filled(b) + d = umath.equal(x, y) + dm = array(d, mask=m, copy=0) + return fromnumeric.alltrue(fromnumeric.ravel(filled(dm, 1))) + else: + return 0 + +def masked_values (data, value, rtol=1.e-5, atol=1.e-8, copy=1): + """ + masked_values(data, value, rtol=1.e-5, atol=1.e-8) + Create a masked array; mask is nomask if possible. + If copy==0, and otherwise possible, result + may share data values with original array. + Let d = filled(data, value). Returns d + masked where abs(data-value)<= atol + rtol * abs(value) + if d is of a floating point type. Otherwise returns + masked_object(d, value, copy) + """ + abs = umath.absolute + d = filled(data, value) + if issubclass(d.dtype.type, numeric.floating): + m = umath.less_equal(abs(d-value), atol+rtol*abs(value)) + m = make_mask(m, flag=1) + return array(d, mask = m, copy=copy, + fill_value=value) + else: + return masked_object(d, value, copy=copy) + +def masked_object (data, value, copy=1): + "Create array masked where exactly data equal to value" + d = filled(data, value) + dm = make_mask(umath.equal(d, value), flag=1) + return array(d, mask=dm, copy=copy, fill_value=value) + +def arange(start, stop=None, step=1, dtype=None): + """Just like range() except it returns a array whose type can be specified + by the keyword argument dtype. + """ + return array(numeric.arange(start, stop, step, dtype)) + +arrayrange = arange + +def fromstring (s, t): + "Construct a masked array from a string. Result will have no mask." + return masked_array(numeric.fromstring(s, t)) + +def left_shift (a, n): + "Left shift n bits" + m = getmask(a) + if m is nomask: + d = umath.left_shift(filled(a), n) + return masked_array(d) + else: + d = umath.left_shift(filled(a, 0), n) + return masked_array(d, m) + +def right_shift (a, n): + "Right shift n bits" + m = getmask(a) + if m is nomask: + d = umath.right_shift(filled(a), n) + return masked_array(d) + else: + d = umath.right_shift(filled(a, 0), n) + return masked_array(d, m) + +def resize (a, new_shape): + """resize(a, new_shape) returns a new array with the specified shape. + The original array's total size can be any size.""" + m = getmask(a) + if m is not nomask: + m = fromnumeric.resize(m, new_shape) + result = array(fromnumeric.resize(filled(a), new_shape), mask=m) + result.set_fill_value(get_fill_value(a)) + return result + +def new_repeat(a, repeats, axis=None): + """repeat elements of a repeats times along axis + repeats is a sequence of length a.shape[axis] + telling how many times to repeat each element. + """ + af = filled(a) + if isinstance(repeats, types.IntType): + if axis is None: + num = af.size + else: + num = af.shape[axis] + repeats = tuple([repeats]*num) + + m = getmask(a) + if m is not nomask: + m = fromnumeric.repeat(m, repeats, axis) + d = fromnumeric.repeat(af, repeats, axis) + result = masked_array(d, m) + result.set_fill_value(get_fill_value(a)) + return result + + + +def identity(n): + """identity(n) returns the identity matrix of shape n x n. + """ + return array(numeric.identity(n)) + +def indices (dimensions, dtype=None): + """indices(dimensions,dtype=None) returns an array representing a grid + of indices with row-only, and column-only variation. + """ + return array(numeric.indices(dimensions, dtype)) + +def zeros (shape, dtype=float): + """zeros(n, dtype=float) = + an array of all zeros of the given length or shape.""" + return array(numeric.zeros(shape, dtype)) + +def ones (shape, dtype=float): + """ones(n, dtype=float) = + an array of all ones of the given length or shape.""" + return array(numeric.ones(shape, dtype)) + +def count (a, axis = None): + "Count of the non-masked elements in a, or along a certain axis." + a = masked_array(a) + return a.count(axis) + +def power (a, b, third=None): + "a**b" + if third is not None: + raise MAError, "3-argument power not supported." + ma = getmask(a) + mb = getmask(b) + m = mask_or(ma, mb) + fa = filled(a, 1) + fb = filled(b, 1) + if fb.dtype.char in typecodes["Integer"]: + return masked_array(umath.power(fa, fb), m) + md = make_mask(umath.less(fa, 0), flag=1) + m = mask_or(m, md) + if m is nomask: + return masked_array(umath.power(fa, fb)) + else: + fa = numeric.where(m, 1, fa) + return masked_array(umath.power(fa, fb), m) + +def masked_array (a, mask=nomask, fill_value=None): + """masked_array(a, mask=nomask) = + array(a, mask=mask, copy=0, fill_value=fill_value) + """ + return array(a, mask=mask, copy=0, fill_value=fill_value) + +def sum (target, axis=None, dtype=None): + if axis is None: + target = ravel(target) + axis = 0 + return add.reduce(target, axis, dtype) + +def product (target, axis=None, dtype=None): + if axis is None: + target = ravel(target) + axis = 0 + return multiply.reduce(target, axis, dtype) + +def new_average (a, axis=None, weights=None, returned = 0): + """average(a, axis=None, weights=None) + Computes average along indicated axis. + If axis is None, average over the entire array + Inputs can be integer or floating types; result is of type float. + + If weights are given, result is sum(a*weights,axis=0)/(sum(weights,axis=0)*1.0) + weights must have a's shape or be the 1-d with length the size + of a in the given axis. + + If returned, return a tuple: the result and the sum of the weights + or count of values. Results will have the same shape. + + masked values in the weights will be set to 0.0 + """ + a = masked_array(a) + mask = a.mask + ash = a.shape + if ash == (): + ash = (1,) + if axis is None: + if mask is nomask: + if weights is None: + n = add.reduce(a.raw_data().ravel()) + d = reduce(lambda x, y: x * y, ash, 1.0) + else: + w = filled(weights, 0.0).ravel() + n = umath.add.reduce(a.raw_data().ravel() * w) + d = umath.add.reduce(w) + del w + else: + if weights is None: + n = add.reduce(a.ravel()) + w = fromnumeric.choose(mask, (1.0, 0.0)).ravel() + d = umath.add.reduce(w) + del w + else: + w = array(filled(weights, 0.0), float, mask=mask).ravel() + n = add.reduce(a.ravel() * w) + d = add.reduce(w) + del w + else: + if mask is nomask: + if weights is None: + d = ash[axis] * 1.0 + n = umath.add.reduce(a.raw_data(), axis) + else: + w = filled(weights, 0.0) + wsh = w.shape + if wsh == (): + wsh = (1,) + if wsh == ash: + w = numeric.array(w, float, copy=0) + n = add.reduce(a*w, axis) + d = add.reduce(w, axis) + del w + elif wsh == (ash[axis],): + r = [newaxis]*len(ash) + r[axis] = slice(None, None, 1) + w = eval ("w["+ repr(tuple(r)) + "] * ones(ash, float)") + n = add.reduce(a*w, axis) + d = add.reduce(w, axis) + del w, r + else: + raise ValueError, 'average: weights wrong shape.' + else: + if weights is None: + n = add.reduce(a, axis) + w = numeric.choose(mask, (1.0, 0.0)) + d = umath.add.reduce(w, axis) + del w + else: + w = filled(weights, 0.0) + wsh = w.shape + if wsh == (): + wsh = (1,) + if wsh == ash: + w = array(w, float, mask=mask, copy=0) + n = add.reduce(a*w, axis) + d = add.reduce(w, axis) + elif wsh == (ash[axis],): + r = [newaxis]*len(ash) + r[axis] = slice(None, None, 1) + w = eval ("w["+ repr(tuple(r)) + "] * masked_array(ones(ash, float), mask)") + n = add.reduce(a*w, axis) + d = add.reduce(w, axis) + else: + raise ValueError, 'average: weights wrong shape.' + del w + #print n, d, repr(mask), repr(weights) + if n is masked or d is masked: return masked + result = divide (n, d) + del n + + if isinstance(result, MaskedArray): + result.unmask() + if returned: + if not isinstance(d, MaskedArray): + d = masked_array(d) + if not d.shape == result.shape: + d = ones(result.shape, float) * d + d.unmask() + if returned: + return result, d + else: + return result + +def where (condition, x, y): + """where(condition, x, y) is x where condition is nonzero, y otherwise. + condition must be convertible to an integer array. + Answer is always the shape of condition. + The type depends on x and y. It is integer if both x and y are + the value masked. + """ + fc = filled(not_equal(condition, 0), 0) + xv = filled(x) + xm = getmask(x) + yv = filled(y) + ym = getmask(y) + d = numeric.choose(fc, (yv, xv)) + md = numeric.choose(fc, (ym, xm)) + m = getmask(condition) + m = make_mask(mask_or(m, md), copy=0, flag=1) + return masked_array(d, m) + +def choose (indices, t, out=None, mode='raise'): + "Returns array shaped like indices with elements chosen from t" + def fmask (x): + if x is masked: return 1 + return filled(x) + def nmask (x): + if x is masked: return 1 + m = getmask(x) + if m is nomask: return 0 + return m + c = filled(indices, 0) + masks = [nmask(x) for x in t] + a = [fmask(x) for x in t] + d = numeric.choose(c, a) + m = numeric.choose(c, masks) + m = make_mask(mask_or(m, getmask(indices)), copy=0, flag=1) + return masked_array(d, m) + +def masked_where(condition, x, copy=1): + """Return x as an array masked where condition is true. + Also masked where x or condition masked. + """ + cm = filled(condition,1) + m = mask_or(getmask(x), cm) + return array(filled(x), copy=copy, mask=m) + +def masked_greater(x, value, copy=1): + "masked_greater(x, value) = x masked where x > value" + return masked_where(greater(x, value), x, copy) + +def masked_greater_equal(x, value, copy=1): + "masked_greater_equal(x, value) = x masked where x >= value" + return masked_where(greater_equal(x, value), x, copy) + +def masked_less(x, value, copy=1): + "masked_less(x, value) = x masked where x < value" + return masked_where(less(x, value), x, copy) + +def masked_less_equal(x, value, copy=1): + "masked_less_equal(x, value) = x masked where x <= value" + return masked_where(less_equal(x, value), x, copy) + +def masked_not_equal(x, value, copy=1): + "masked_not_equal(x, value) = x masked where x != value" + d = filled(x, 0) + c = umath.not_equal(d, value) + m = mask_or(c, getmask(x)) + return array(d, mask=m, copy=copy) + +def masked_equal(x, value, copy=1): + """masked_equal(x, value) = x masked where x == value + For floating point consider masked_values(x, value) instead. + """ + d = filled(x, 0) + c = umath.equal(d, value) + m = mask_or(c, getmask(x)) + return array(d, mask=m, copy=copy) + +def masked_inside(x, v1, v2, copy=1): + """x with mask of all values of x that are inside [v1,v2] + v1 and v2 can be given in either order. + """ + if v2 < v1: + t = v2 + v2 = v1 + v1 = t + d = filled(x, 0) + c = umath.logical_and(umath.less_equal(d, v2), umath.greater_equal(d, v1)) + m = mask_or(c, getmask(x)) + return array(d, mask = m, copy=copy) + +def masked_outside(x, v1, v2, copy=1): + """x with mask of all values of x that are outside [v1,v2] + v1 and v2 can be given in either order. + """ + if v2 < v1: + t = v2 + v2 = v1 + v1 = t + d = filled(x, 0) + c = umath.logical_or(umath.less(d, v1), umath.greater(d, v2)) + m = mask_or(c, getmask(x)) + return array(d, mask = m, copy=copy) + +def reshape (a, *newshape): + "Copy of a with a new shape." + m = getmask(a) + d = filled(a).reshape(*newshape) + if m is nomask: + return masked_array(d) + else: + return masked_array(d, mask=numeric.reshape(m, *newshape)) + +def ravel (a): + "a as one-dimensional, may share data and mask" + m = getmask(a) + d = fromnumeric.ravel(filled(a)) + if m is nomask: + return masked_array(d) + else: + return masked_array(d, mask=numeric.ravel(m)) + +def concatenate (arrays, axis=0): + "Concatenate the arrays along the given axis" + d = [] + for x in arrays: + d.append(filled(x)) + d = numeric.concatenate(d, axis) + for x in arrays: + if getmask(x) is not nomask: break + else: + return masked_array(d) + dm = [] + for x in arrays: + dm.append(getmaskarray(x)) + dm = numeric.concatenate(dm, axis) + return masked_array(d, mask=dm) + +def swapaxes (a, axis1, axis2): + m = getmask(a) + d = masked_array(a).data + if m is nomask: + return masked_array(data=numeric.swapaxes(d, axis1, axis2)) + else: + return masked_array(data=numeric.swapaxes(d, axis1, axis2), + mask=numeric.swapaxes(m, axis1, axis2),) + + +def new_take (a, indices, axis=None, out=None, mode='raise'): + "returns selection of items from a." + m = getmask(a) + # d = masked_array(a).raw_data() + d = masked_array(a).data + if m is nomask: + return masked_array(numeric.take(d, indices, axis)) + else: + return masked_array(numeric.take(d, indices, axis), + mask = numeric.take(m, indices, axis)) + +def transpose(a, axes=None): + "reorder dimensions per tuple axes" + m = getmask(a) + d = filled(a) + if m is nomask: + return masked_array(numeric.transpose(d, axes)) + else: + return masked_array(numeric.transpose(d, axes), + mask = numeric.transpose(m, axes)) + + +def put(a, indices, values, mode='raise'): + """sets storage-indexed locations to corresponding values. + + Values and indices are filled if necessary. + + """ + d = a.raw_data() + ind = filled(indices) + v = filled(values) + numeric.put (d, ind, v) + m = getmask(a) + if m is not nomask: + a.unshare_mask() + numeric.put(a.raw_mask(), ind, 0) + +def putmask(a, mask, values): + "putmask(a, mask, values) sets a where mask is true." + if mask is nomask: + return + numeric.putmask(a.raw_data(), mask, values) + m = getmask(a) + if m is nomask: return + a.unshare_mask() + numeric.putmask(a.raw_mask(), mask, 0) + +def inner(a, b): + """inner(a,b) returns the dot product of two arrays, which has + shape a.shape[:-1] + b.shape[:-1] with elements computed by summing the + product of the elements from the last dimensions of a and b. + Masked elements are replace by zeros. + """ + fa = filled(a, 0) + fb = filled(b, 0) + if len(fa.shape) == 0: fa.shape = (1,) + if len(fb.shape) == 0: fb.shape = (1,) + return masked_array(numeric.inner(fa, fb)) + +innerproduct = inner + +def outer(a, b): + """outer(a,b) = {a[i]*b[j]}, has shape (len(a),len(b))""" + fa = filled(a, 0).ravel() + fb = filled(b, 0).ravel() + d = numeric.outer(fa, fb) + ma = getmask(a) + mb = getmask(b) + if ma is nomask and mb is nomask: + return masked_array(d) + ma = getmaskarray(a) + mb = getmaskarray(b) + m = make_mask(1-numeric.outer(1-ma, 1-mb), copy=0) + return masked_array(d, m) + +outerproduct = outer + +def dot(a, b): + """dot(a,b) returns matrix-multiplication between a and b. The product-sum + is over the last dimension of a and the second-to-last dimension of b. + Masked values are replaced by zeros. See also innerproduct. + """ + return innerproduct(filled(a, 0), numeric.swapaxes(filled(b, 0), -1, -2)) + +def compress(condition, x, dimension=-1, out=None): + """Select those parts of x for which condition is true. + Masked values in condition are considered false. + """ + c = filled(condition, 0) + m = getmask(x) + if m is not nomask: + m = numeric.compress(c, m, dimension) + d = numeric.compress(c, filled(x), dimension) + return masked_array(d, m) + +class _minimum_operation: + "Object to calculate minima" + def __init__ (self): + """minimum(a, b) or minimum(a) + In one argument case returns the scalar minimum. + """ + pass + + def __call__ (self, a, b=None): + "Execute the call behavior." + if b is None: + m = getmask(a) + if m is nomask: + d = amin(filled(a).ravel()) + return d + ac = a.compressed() + if len(ac) == 0: + return masked + else: + return amin(ac.raw_data()) + else: + return where(less(a, b), a, b) + + def reduce (self, target, axis=0): + """Reduce target along the given axis.""" + m = getmask(target) + if m is nomask: + t = filled(target) + return masked_array (umath.minimum.reduce (t, axis)) + else: + t = umath.minimum.reduce(filled(target, minimum_fill_value(target)), axis) + m = umath.logical_and.reduce(m, axis) + return masked_array(t, m, get_fill_value(target)) + + def outer (self, a, b): + "Return the function applied to the outer product of a and b." + ma = getmask(a) + mb = getmask(b) + if ma is nomask and mb is nomask: + m = nomask + else: + ma = getmaskarray(a) + mb = getmaskarray(b) + m = logical_or.outer(ma, mb) + d = umath.minimum.outer(filled(a), filled(b)) + return masked_array(d, m) + +minimum = _minimum_operation () + +class _maximum_operation: + "Object to calculate maxima" + def __init__ (self): + """maximum(a, b) or maximum(a) + In one argument case returns the scalar maximum. + """ + pass + + def __call__ (self, a, b=None): + "Execute the call behavior." + if b is None: + m = getmask(a) + if m is nomask: + d = amax(filled(a).ravel()) + return d + ac = a.compressed() + if len(ac) == 0: + return masked + else: + return amax(ac.raw_data()) + else: + return where(greater(a, b), a, b) + + def reduce (self, target, axis=0): + """Reduce target along the given axis.""" + m = getmask(target) + if m is nomask: + t = filled(target) + return masked_array (umath.maximum.reduce (t, axis)) + else: + t = umath.maximum.reduce(filled(target, maximum_fill_value(target)), axis) + m = umath.logical_and.reduce(m, axis) + return masked_array(t, m, get_fill_value(target)) + + def outer (self, a, b): + "Return the function applied to the outer product of a and b." + ma = getmask(a) + mb = getmask(b) + if ma is nomask and mb is nomask: + m = nomask + else: + ma = getmaskarray(a) + mb = getmaskarray(b) + m = logical_or.outer(ma, mb) + d = umath.maximum.outer(filled(a), filled(b)) + return masked_array(d, m) + +maximum = _maximum_operation () + +def sort (x, axis = -1, fill_value=None): + """If x does not have a mask, return a masked array formed from the + result of numeric.sort(x, axis). + Otherwise, fill x with fill_value. Sort it. + Set a mask where the result is equal to fill_value. + Note that this may have unintended consequences if the data contains the + fill value at a non-masked site. + + If fill_value is not given the default fill value for x's type will be + used. + """ + if fill_value is None: + fill_value = default_fill_value (x) + d = filled(x, fill_value) + s = fromnumeric.sort(d, axis) + if getmask(x) is nomask: + return masked_array(s) + return masked_values(s, fill_value, copy=0) + +def diagonal(a, k = 0, axis1=0, axis2=1): + """diagonal(a,k=0,axis1=0, axis2=1) = the k'th diagonal of a""" + d = fromnumeric.diagonal(filled(a), k, axis1, axis2) + m = getmask(a) + if m is nomask: + return masked_array(d, m) + else: + return masked_array(d, fromnumeric.diagonal(m, k, axis1, axis2)) + +def trace (a, offset=0, axis1=0, axis2=1, dtype=None, out=None): + """trace(a,offset=0, axis1=0, axis2=1) returns the sum along diagonals + (defined by the last two dimenions) of the array. + """ + return diagonal(a, offset, axis1, axis2).sum(dtype=dtype) + +def argsort (x, axis = -1, out=None, fill_value=None): + """Treating masked values as if they have the value fill_value, + return sort indices for sorting along given axis. + if fill_value is None, use get_fill_value(x) + Returns a numpy array. + """ + d = filled(x, fill_value) + return fromnumeric.argsort(d, axis) + +def argmin (x, axis = -1, out=None, fill_value=None): + """Treating masked values as if they have the value fill_value, + return indices for minimum values along given axis. + if fill_value is None, use get_fill_value(x). + Returns a numpy array if x has more than one dimension. + Otherwise, returns a scalar index. + """ + d = filled(x, fill_value) + return fromnumeric.argmin(d, axis) + +def argmax (x, axis = -1, out=None, fill_value=None): + """Treating masked values as if they have the value fill_value, + return sort indices for maximum along given axis. + if fill_value is None, use -get_fill_value(x) if it exists. + Returns a numpy array if x has more than one dimension. + Otherwise, returns a scalar index. + """ + if fill_value is None: + fill_value = default_fill_value (x) + try: + fill_value = - fill_value + except: + pass + d = filled(x, fill_value) + return fromnumeric.argmax(d, axis) + +def fromfunction (f, s): + """apply f to s to create array as in umath.""" + return masked_array(numeric.fromfunction(f, s)) + +def asarray(data, dtype=None): + """asarray(data, dtype) = array(data, dtype, copy=0) + """ + if isinstance(data, MaskedArray) and \ + (dtype is None or dtype == data.dtype): + return data + return array(data, dtype=dtype, copy=0) + +# Add methods to support ndarray interface +# XXX: I is better to to change the masked_*_operation adaptors +# XXX: to wrap ndarray methods directly to create ma.array methods. +from types import MethodType +def _m(f): + return MethodType(f, None, array) +def not_implemented(*args, **kwds): + raise NotImplementedError, "not yet implemented for numpy.ma arrays" +array.all = _m(alltrue) +array.any = _m(sometrue) +array.argmax = _m(argmax) +array.argmin = _m(argmin) +array.argsort = _m(argsort) +array.base = property(_m(not_implemented)) +array.byteswap = _m(not_implemented) + +def _choose(self, *args, **kwds): + return choose(self, args) +array.choose = _m(_choose) +del _choose + +def _clip(self,a_min,a_max,out=None): + return MaskedArray(data = self.data.clip(asarray(a_min).data, + asarray(a_max).data), + mask = mask_or(self.mask, + mask_or(getmask(a_min),getmask(a_max)))) +array.clip = _m(_clip) + +def _compress(self, cond, axis=None, out=None): + return compress(cond, self, axis) +array.compress = _m(_compress) +del _compress + +array.conj = array.conjugate = _m(conjugate) +array.copy = _m(not_implemented) + +def _cumprod(self, axis=None, dtype=None, out=None): + m = self.mask + if m is not nomask: + m = umath.logical_or.accumulate(self.mask, axis) + return MaskedArray(data = self.filled(1).cumprod(axis, dtype), mask=m) +array.cumprod = _m(_cumprod) + +def _cumsum(self, axis=None, dtype=None, out=None): + m = self.mask + if m is not nomask: + m = umath.logical_or.accumulate(self.mask, axis) + return MaskedArray(data=self.filled(0).cumsum(axis, dtype), mask=m) +array.cumsum = _m(_cumsum) + +array.diagonal = _m(diagonal) +array.dump = _m(not_implemented) +array.dumps = _m(not_implemented) +array.fill = _m(not_implemented) +array.flags = property(_m(not_implemented)) +array.flatten = _m(ravel) +array.getfield = _m(not_implemented) + +def _max(a, axis=None, out=None): + if out is not None: + raise TypeError("Output arrays Unsupported for masked arrays") + if axis is None: + return maximum(a) + else: + return maximum.reduce(a, axis) +array.max = _m(_max) +del _max +def _min(a, axis=None, out=None): + if out is not None: + raise TypeError("Output arrays Unsupported for masked arrays") + if axis is None: + return minimum(a) + else: + return minimum.reduce(a, axis) +array.min = _m(_min) +del _min +array.mean = _m(average) +array.nbytes = property(_m(not_implemented)) +array.newbyteorder = _m(not_implemented) +array.nonzero = _m(nonzero) +array.prod = _m(product) + +def _ptp(a,axis=None,out=None): + return a.max(axis,out)-a.min(axis) +array.ptp = _m(_ptp) +array.repeat = _m(repeat) +array.resize = _m(resize) +array.searchsorted = _m(not_implemented) +array.setfield = _m(not_implemented) +array.setflags = _m(not_implemented) +array.sort = _m(not_implemented) # NB: ndarray.sort is inplace + +def _squeeze(self): + try: + result = MaskedArray(data = self.data.squeeze(), + mask = self.mask.squeeze()) + except AttributeError: + result = _wrapit(self, 'squeeze') + return result +array.squeeze = _m(_squeeze) + +array.strides = property(_m(not_implemented)) +array.sum = _m(sum) +def _swapaxes(self,axis1,axis2): + return MaskedArray(data = self.data.swapaxes(axis1, axis2), + mask = self.mask.swapaxes(axis1, axis2)) +array.swapaxes = _m(_swapaxes) +array.take = _m(take) +array.tofile = _m(not_implemented) +array.trace = _m(trace) +array.transpose = _m(transpose) + +def _var(self,axis=None,dtype=None, out=None): + if axis is None: + return numeric.asarray(self.compressed()).var() + a = self.swapaxes(axis,0) + a = a - a.mean(axis=0) + a *= a + a /= a.count(axis=0) + return a.swapaxes(0,axis).sum(axis) +def _std(self,axis=None, dtype=None, out=None): + return (self.var(axis,dtype))**0.5 +array.var = _m(_var) +array.std = _m(_std) + +array.view = _m(not_implemented) +array.round = _m(around) +del _m, MethodType, not_implemented + + +masked = MaskedArray(0, int, mask=1) + def repeat(a, repeats, axis=0): - return nca.repeat(a, repeats, axis) + return new_repeat(a, repeats, axis) def average(a, axis=0, weights=None, returned=0): - return nca.average(a, axis, weights, returned) + return new_average(a, axis, weights, returned) def take(a, indices, axis=0): - return nca.average(a, indices, axis=0) + return new_take(a, indices, axis=0) + + From numpy-svn at scipy.org Tue Apr 1 10:26:13 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 1 Apr 2008 09:26:13 -0500 (CDT) Subject: [Numpy-svn] r4953 - trunk/numpy/oldnumeric Message-ID: <20080401142613.0D31639C19D@new.scipy.org> Author: oliphant Date: 2008-04-01 09:26:07 -0500 (Tue, 01 Apr 2008) New Revision: 4953 Modified: trunk/numpy/oldnumeric/ma.py Log: fix-up imports in oldnumeric/ma.py Modified: trunk/numpy/oldnumeric/ma.py =================================================================== --- trunk/numpy/oldnumeric/ma.py 2008-04-01 14:23:48 UTC (rev 4952) +++ trunk/numpy/oldnumeric/ma.py 2008-04-01 14:26:07 UTC (rev 4953) @@ -10,12 +10,12 @@ """ import types, sys -import umath -import fromnumeric -from numeric import newaxis, ndarray, inf -from fromnumeric import amax, amin -from numerictypes import bool_, typecodes -import numeric +import numpy.core.umath as umath +import numpy.core.fromnumeric as fromnumeric +from numpy.core.numeric import newaxis, ndarray, inf +from numpy.core.fromnumeric import amax, amin +from numpy.core.numerictypes import bool_, typecodes +import numpy.core.numeric as numeric import warnings # Ufunc domain lookup for __array_wrap__ From numpy-svn at scipy.org Tue Apr 1 13:03:20 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 1 Apr 2008 12:03:20 -0500 (CDT) Subject: [Numpy-svn] r4954 - trunk/numpy/oldnumeric Message-ID: <20080401170320.816D339C432@new.scipy.org> Author: oliphant Date: 2008-04-01 12:03:17 -0500 (Tue, 01 Apr 2008) New Revision: 4954 Modified: trunk/numpy/oldnumeric/ma.py Log: Fix-up a few errors in oldnumeric. Modified: trunk/numpy/oldnumeric/ma.py =================================================================== --- trunk/numpy/oldnumeric/ma.py 2008-04-01 14:26:07 UTC (rev 4953) +++ trunk/numpy/oldnumeric/ma.py 2008-04-01 17:03:17 UTC (rev 4954) @@ -2201,7 +2201,7 @@ return minimum.reduce(a, axis) array.min = _m(_min) del _min -array.mean = _m(average) +array.mean = _m(new_average) array.nbytes = property(_m(not_implemented)) array.newbyteorder = _m(not_implemented) array.nonzero = _m(nonzero) @@ -2210,7 +2210,7 @@ def _ptp(a,axis=None,out=None): return a.max(axis,out)-a.min(axis) array.ptp = _m(_ptp) -array.repeat = _m(repeat) +array.repeat = _m(new_repeat) array.resize = _m(resize) array.searchsorted = _m(not_implemented) array.setfield = _m(not_implemented) @@ -2232,7 +2232,7 @@ return MaskedArray(data = self.data.swapaxes(axis1, axis2), mask = self.mask.swapaxes(axis1, axis2)) array.swapaxes = _m(_swapaxes) -array.take = _m(take) +array.take = _m(new_take) array.tofile = _m(not_implemented) array.trace = _m(trace) array.transpose = _m(transpose) From numpy-svn at scipy.org Thu Apr 3 03:06:58 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 3 Apr 2008 02:06:58 -0500 (CDT) Subject: [Numpy-svn] r4955 - trunk/numpy/core Message-ID: <20080403070658.665A439C10B@new.scipy.org> Author: stefan Date: 2008-04-03 02:06:46 -0500 (Thu, 03 Apr 2008) New Revision: 4955 Modified: trunk/numpy/core/fromnumeric.py Log: Fix mean docstring. Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2008-04-01 17:03:17 UTC (rev 4954) +++ trunk/numpy/core/fromnumeric.py 2008-04-03 07:06:46 UTC (rev 4955) @@ -1578,7 +1578,7 @@ Returns the average of the array elements. The average is taken over the flattened array by default, otherwise over the specified - axis. The dtype returned for integer type arrays is float + axis. The dtype returned for integer type arrays is float. Parameters ---------- @@ -1587,9 +1587,9 @@ array, a conversion is attempted. axis : {None, integer}, optional Axis along which the means are computed. The default is to compute - the standard deviation of the flattened array. + the mean of the flattened array. dtype : {None, dtype}, optional - Type to use in computing the means. For arrays of integer type the + Type to use in computing the mean. For arrays of integer type the default is float32, for arrays of float types it is the same as the array type. out : {None, array}, optional @@ -1605,8 +1605,7 @@ See Also -------- - var : Variance - std : Standard deviation + average : Weighted average Notes ----- From numpy-svn at scipy.org Thu Apr 3 10:06:36 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 3 Apr 2008 09:06:36 -0500 (CDT) Subject: [Numpy-svn] r4956 - in trunk/numpy/lib: . tests Message-ID: <20080403140636.1034939C0F7@new.scipy.org> Author: dhuard Date: 2008-04-03 09:06:33 -0500 (Thu, 03 Apr 2008) New Revision: 4956 Added: trunk/numpy/lib/tests/test_io.py Modified: trunk/numpy/lib/io.py Log: Fixed a bug with loadtxt and savetxt failing on record arrays. This addresses ticket #623. Added simple tests for loadtxt and savetxt. Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2008-04-03 07:06:46 UTC (rev 4955) +++ trunk/numpy/lib/io.py 2008-04-03 14:06:33 UTC (rev 4956) @@ -312,9 +312,7 @@ X.append(row) X = np.array(X, dtype) - r,c = X.shape - if r==1 or c==1: - X.shape = max([r,c]), + X = np.squeeze(X) if unpack: return X.T else: return X @@ -355,7 +353,7 @@ X = np.asarray(X) origShape = None - if len(X.shape)==1: + if len(X.shape)==1 and not hasattr(X.dtype, 'names'): origShape = X.shape X.shape = len(X), 1 for row in X: Added: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2008-04-03 07:06:46 UTC (rev 4955) +++ trunk/numpy/lib/tests/test_io.py 2008-04-03 14:06:33 UTC (rev 4956) @@ -0,0 +1,52 @@ +from numpy.testing import * +import numpy as np +import StringIO + +class Testsavetxt(NumpyTestCase): + def test_array(self): + a =np.array( [[1,2],[3,4]], float) + c = StringIO.StringIO() + np.savetxt(c, a) + c.seek(0) + assert(c.readlines(), ['1.000000000000000000e+00 2.000000000000000000e+00\n', '3.000000000000000000e+00 4.000000000000000000e+00\n']) + + a =np.array( [[1,2],[3,4]], int) + c = StringIO.StringIO() + np.savetxt(c, a) + c.seek(0) + assert(c.readlines(), ['1 2\n', '3 4\n']) + + def test_record(self): + a = np.array([(1, 2), (3, 4)], dtype=[('x', ' Author: dhuard Date: 2008-04-03 09:17:08 -0500 (Thu, 03 Apr 2008) New Revision: 4957 Modified: trunk/numpy/lib/io.py trunk/numpy/lib/tests/test_io.py Log: added 1D tests for loadtxt and savetxt. Fixed a bug Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2008-04-03 14:06:33 UTC (rev 4956) +++ trunk/numpy/lib/io.py 2008-04-03 14:17:08 UTC (rev 4957) @@ -353,7 +353,7 @@ X = np.asarray(X) origShape = None - if len(X.shape)==1 and not hasattr(X.dtype, 'names'): + if len(X.shape)==1 and X.dtype.names is None: origShape = X.shape X.shape = len(X), 1 for row in X: Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2008-04-03 14:06:33 UTC (rev 4956) +++ trunk/numpy/lib/tests/test_io.py 2008-04-03 14:17:08 UTC (rev 4957) @@ -16,6 +16,13 @@ c.seek(0) assert(c.readlines(), ['1 2\n', '3 4\n']) + def test_1D(self): + a = np.array([1,2,3,4], int) + c = StringIO.StringIO() + np.savetxt(c, a, fmt='%d') + c.seek(0) + assert(c.readlines(), ['1\n', '2\n', '3\n', '4\n']) + def test_record(self): a = np.array([(1, 2), (3, 4)], dtype=[('x', ' Author: oliphant Date: 2008-04-03 10:38:18 -0500 (Thu, 03 Apr 2008) New Revision: 4958 Modified: trunk/numpy/core/src/scalarmathmodule.c.src Log: Fix typo reported in #637. Modified: trunk/numpy/core/src/scalarmathmodule.c.src =================================================================== --- trunk/numpy/core/src/scalarmathmodule.c.src 2008-04-03 14:17:08 UTC (rev 4957) +++ trunk/numpy/core/src/scalarmathmodule.c.src 2008-04-03 15:38:18 UTC (rev 4958) @@ -379,7 +379,7 @@ /**begin repeat #name=byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble# - #uns=(1,0)*5,0*3# + #uns=(0,1)*5,0*3# **/ static void @name at _ctype_negative(@name@ a, @name@ *out) From numpy-svn at scipy.org Thu Apr 3 16:44:24 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 3 Apr 2008 15:44:24 -0500 (CDT) Subject: [Numpy-svn] r4959 - trunk/numpy/oldnumeric Message-ID: <20080403204424.2FF8039C077@new.scipy.org> Author: oliphant Date: 2008-04-03 15:44:22 -0500 (Thu, 03 Apr 2008) New Revision: 4959 Modified: trunk/numpy/oldnumeric/ma.py Log: Fix typo. Modified: trunk/numpy/oldnumeric/ma.py =================================================================== --- trunk/numpy/oldnumeric/ma.py 2008-04-03 15:38:18 UTC (rev 4958) +++ trunk/numpy/oldnumeric/ma.py 2008-04-03 20:44:22 UTC (rev 4959) @@ -2264,6 +2264,6 @@ return new_average(a, axis, weights, returned) def take(a, indices, axis=0): - return new_take(a, indices, axis=0) + return new_take(a, indices, axis) From numpy-svn at scipy.org Fri Apr 4 02:11:27 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 4 Apr 2008 01:11:27 -0500 (CDT) Subject: [Numpy-svn] r4960 - in trunk/numpy/lib: . tests Message-ID: <20080404061127.A9A7B39C07E@new.scipy.org> Author: oliphant Date: 2008-04-04 01:11:24 -0500 (Fri, 04 Apr 2008) New Revision: 4960 Added: trunk/numpy/lib/financial.py trunk/numpy/lib/tests/test_financial.py Modified: trunk/numpy/lib/io.py Log: Add fromregex function (needs more testing) and some simple spreadsheet-like financial calculations. Added: trunk/numpy/lib/financial.py =================================================================== --- trunk/numpy/lib/financial.py 2008-04-03 20:44:22 UTC (rev 4959) +++ trunk/numpy/lib/financial.py 2008-04-04 06:11:24 UTC (rev 4960) @@ -0,0 +1,151 @@ +# Some simple financial calculations +from numpy import log, where +import numpy as np + +__all__ = ['fv', 'pmt', 'nper', 'ipmt', 'ppmt', 'pv', 'rate', 'irr', 'npv'] + +_when_to_num = {'end':0, 'begin':1, + 'e':0, 'b':1, + 0:0, 1:1, + 'beginning':1, + 'start':1, + 'finish':0} + +eqstr = """ + + 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)) + + nper / (1 + rate*when) \ / nper \ + fv + pv*(1+rate) + pmt*|-------------------|*| (1+rate) - 1 | = 0 + \ rate / \ / + + fv + pv + pmt * nper = 0 (when rate == 0) +""" + +def fv(rate, nper, pmt, pv, when='end'): + """future value computed by solving the equation + + %s + """ % eqstr + when = _when_to_num[when] + temp = (1+rate)**nper + fact = where(rate==0.0, nper, (1+rate*when)*(temp-1)/rate) + return -(pv*temp + pmt*fact) + +def pmt(rate, nper, pv, fv=0, when='end'): + """Payment computed by solving the equation + + %s + """ % eqstr + when = _when_to_num[when] + temp = (1+rate)**nper + fact = where(rate==0.0, nper, (1+rate*when)*(temp-1)/rate) + return -(fv + pv*temp) / fact + +def nper(rate, pmt, pv, fv=0, when='end'): + """Number of periods found by solving the equation + + %s + """ % eqstr + when = _when_to_num[when] + try: + z = pmt*(1.0+rate*when)/rate + except ZeroDivisionError: + z = 0.0 + A = -(fv + pv)/(pmt+0.0) + B = (log(fv-z) - log(pv-z))/log(1.0+rate) + return where(rate==0.0, A, B) + 0.0 + +def ipmt(rate, per, nper, pv, fv=0.0, when='end'): + raise NotImplementedError + + +def ppmt(rate, per, nper, pv, fv=0.0, when='end'): + raise NotImplementedError + +def pv(rate, nper, pmt, fv=0.0, when='end'): + """Number of periods found by solving the equation + + %s + """ % eqstr + when = _when_to_num[when] + temp = (1+rate)**nper + fact = where(rate == 0.0, nper, (1+rate*when)*(temp-1)/rate) + return -(fv + pmt*fact)/temp + +# 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) + +def _g_div_gp(r, n, p, x, y, w): + t1 = (r+1)**n + t2 = (r+1)**(n-1) + return (y + t1*x + p*(t1 - 1)*(r*w + 1)/r)/(n*t2*x - p*(t1 - 1)*(r*w + 1)/(r**2) + n*p*t2*(r*w + 1)/r + p*(t1 - 1)*w/r) + +# Use Newton's iteration until the change is less than 1e-6 +# for all values or a maximum of 100 iterations is reached. +# Newton's rule is +# r_{n+1} = r_{n} - g(r_n)/g'(r_n) +# where +# g(r) is the formula +# g'(r) is the derivative with respect to r. +def rate(nper, pmt, pv, fv, when='end', guess=0.10, tol=1e-6, maxiter=100): + """Number of periods found by solving the equation + + %s + """ % eqstr + when = _when_to_num[when] + rn = guess + iter = 0 + close = False + while (iter < maxiter) and not close: + rnp1 = rn - _g_div_gp(rn, nper, pmt, pv, fv, when) + diff = abs(rnp1-rn) + close = np.all(diff 0) & (res.real <= 1) + res = res[mask].real + if res.size == 0: + return np.nan + rate = 1.0/res - 1 + if rate.size == 1: + rate = rate.item() + return rate + +def npv(rate, values): + """Net Present Value + + sum ( values_k / (1+rate)**k, k = 1..n) + """ + values = np.asarray(values) + return (values / (1+rate)**np.arange(1,len(values)+1)).sum(axis=0) + + Property changes on: trunk/numpy/lib/financial.py ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2008-04-03 20:44:22 UTC (rev 4959) +++ trunk/numpy/lib/io.py 2008-04-04 06:11:24 UTC (rev 4960) @@ -3,6 +3,7 @@ 'load', 'loads', 'save', 'savez', 'packbits', 'unpackbits', + 'fromregex', 'DataSource'] import numpy as np @@ -361,3 +362,24 @@ if origShape is not None: X.shape = origShape + +import re +def fromregex(file, regexp, **kwds): + """Construct a record array from a text file, using regular-expressions parsing. + + Groups in the regular exespression are converted to fields. + """ + if not hasattr(file, "read"): + file = open(file,'r') + if not hasattr(regexp, 'match'): + regexp = re.compile(regexp) + + seq = regexp.findall(file.read()) + dtypelist = [] + for key, value in kwds.values(): + dtypelist.append((key, value)) + format = np.dtype(dtypelist) + output = array(seq, dtype=format) + return output + + Added: trunk/numpy/lib/tests/test_financial.py =================================================================== --- trunk/numpy/lib/tests/test_financial.py 2008-04-03 20:44:22 UTC (rev 4959) +++ trunk/numpy/lib/tests/test_financial.py 2008-04-04 06:11:24 UTC (rev 4960) @@ -0,0 +1,34 @@ +""" +from numpy.lib.financial import * + +>>> rate(10,0,-3500,10000) +0.11069085371426901 + +>>> irr([-150000, 15000, 25000, 35000, 45000, 60000]) +0.052432888859414106 + +>>> pv(0.07,20,12000,0) +-127128.17094619398 + +>>> fv(0.075, 20, -2000,0,0) +86609.362673042924 + +>>> pmt(0.08/12,5*12,15000) +-304.14591432620773 + +>>> nper(0.075,-2000,0,100000.) +21.544944197323336 + +>>> npv(0.05,[-15000,1500,2500,3500,4500,6000]) +117.04271900089589 + +""" + +from numpy.testing import * +import numpy as np + +class TestDocs(NumpyTestCase): + def check_doctests(self): return self.rundocs() + +if __name__ == "__main__": + NumpyTest().run() Property changes on: trunk/numpy/lib/tests/test_financial.py ___________________________________________________________________ Name: svn:keywords + Id Name: svn:eol-style + native From numpy-svn at scipy.org Fri Apr 4 02:37:48 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 4 Apr 2008 01:37:48 -0500 (CDT) Subject: [Numpy-svn] r4961 - in trunk/numpy/lib: . tests Message-ID: <20080404063748.1536B39C0BA@new.scipy.org> Author: oliphant Date: 2008-04-04 01:37:45 -0500 (Fri, 04 Apr 2008) New Revision: 4961 Modified: trunk/numpy/lib/financial.py trunk/numpy/lib/tests/test_financial.py Log: Add modified internal rate of return calculation which is more conservative and takes into account re-investing profits and expense of financing losses. Modified: trunk/numpy/lib/financial.py =================================================================== --- trunk/numpy/lib/financial.py 2008-04-04 06:11:24 UTC (rev 4960) +++ trunk/numpy/lib/financial.py 2008-04-04 06:37:45 UTC (rev 4961) @@ -1,8 +1,10 @@ # Some simple financial calculations +# patterned after spreadsheet computations. from numpy import log, where import numpy as np -__all__ = ['fv', 'pmt', 'nper', 'ipmt', 'ppmt', 'pv', 'rate', 'irr', 'npv'] +__all__ = ['fv', 'pmt', 'nper', 'ipmt', 'ppmt', 'pv', 'rate', 'irr', 'npv', + 'mirr'] _when_to_num = {'end':0, 'begin':1, 'e':0, 'b':1, @@ -148,4 +150,27 @@ values = np.asarray(values) return (values / (1+rate)**np.arange(1,len(values)+1)).sum(axis=0) +def mirr(values, finance_rate, reinvest_rate): + """Modified internal rate of return + + Parameters + ---------- + values: + Cash flows (must contain at least one positive and one negative value) + or nan is returned. + finance_rate : + Interest rate paid on the cash flows + reinvest_rate : + Interest rate received on the cash flows upon reinvestment + """ + values = np.asarray(values) + pos = values > 0 + neg = values < 0 + if not (pos.size > 0 and neg.size > 0): + return np.nan + + n = pos.size + neg.size + numer = -npv(reinvest_rate, values[pos])*((1+reinvest_rate)**n) + denom = npv(finance_rate, values[neg])*(1+finance_rate) + return (numer / denom)**(1.0/(n-1)) - 1 Modified: trunk/numpy/lib/tests/test_financial.py =================================================================== --- trunk/numpy/lib/tests/test_financial.py 2008-04-04 06:11:24 UTC (rev 4960) +++ trunk/numpy/lib/tests/test_financial.py 2008-04-04 06:37:45 UTC (rev 4961) @@ -22,6 +22,11 @@ >>> npv(0.05,[-15000,1500,2500,3500,4500,6000]) 117.04271900089589 +>>> mirr([-4500,-800,800,800,600,600,800,800,700,3000],0.08,0.055) +0.066471183500200537 + +>>> mirr([-120000,39000,30000,21000,37000,46000],0.10,0.12) +0.13439316981387006 """ from numpy.testing import * From numpy-svn at scipy.org Fri Apr 4 16:13:27 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 4 Apr 2008 15:13:27 -0500 (CDT) Subject: [Numpy-svn] r4962 - in trunk/numpy/lib: . tests Message-ID: <20080404201327.3466A39C05A@new.scipy.org> Author: dhuard Date: 2008-04-04 15:13:24 -0500 (Fri, 04 Apr 2008) New Revision: 4962 Modified: trunk/numpy/lib/io.py trunk/numpy/lib/tests/test_io.py Log: Modified io._getconv to allow loading values stored as float as integers arrays. Added test to check the behavior as suggested in the comment from b. southey in ticket #623 Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2008-04-04 06:37:45 UTC (rev 4961) +++ trunk/numpy/lib/io.py 2008-04-04 20:13:24 UTC (rev 4962) @@ -203,7 +203,7 @@ if issubclass(typ, np.bool_): return lambda x: bool(int(x)) if issubclass(typ, np.integer): - return int + return lambda x: int(float(x)) elif issubclass(typ, np.floating): return float elif issubclass(typ, np.complex): Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2008-04-04 06:37:45 UTC (rev 4961) +++ trunk/numpy/lib/tests/test_io.py 2008-04-04 20:13:24 UTC (rev 4962) @@ -41,6 +41,16 @@ a = np.array([(1, 2), (3, 4)], dtype=[('x', ' Author: cdavid Date: 2008-04-05 01:38:02 -0500 (Sat, 05 Apr 2008) New Revision: 4963 Modified: trunk/numpy/core/SConstruct Log: Replace Copy by Clone call in scons script (Copy is deprecated). Modified: trunk/numpy/core/SConstruct =================================================================== --- trunk/numpy/core/SConstruct 2008-04-04 20:13:24 UTC (rev 4962) +++ trunk/numpy/core/SConstruct 2008-04-05 06:38:02 UTC (rev 4963) @@ -292,6 +292,6 @@ #---------------------- if build_blasdot: dotblas_src = [pjoin('blasdot', i) for i in ['_dotblas.c']] - blasenv = env.Copy() + blasenv = env.Clone() blasenv.Append(CPPPATH = pjoin(env['src_dir'], 'blasdot')) dotblas = blasenv.NumpyPythonExtension('_dotblas', source = dotblas_src) From numpy-svn at scipy.org Sat Apr 5 12:49:20 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 5 Apr 2008 11:49:20 -0500 (CDT) Subject: [Numpy-svn] r4964 - trunk/numpy/core Message-ID: <20080405164920.EE31D39C126@new.scipy.org> Author: cdavid Date: 2008-04-05 11:49:18 -0500 (Sat, 05 Apr 2008) New Revision: 4964 Modified: trunk/numpy/core/SConstruct Log: Use newly available emitter in numscons to handle distutils build dir issues instead of setting them manually in scons script. Modified: trunk/numpy/core/SConstruct =================================================================== --- trunk/numpy/core/SConstruct 2008-04-05 06:38:02 UTC (rev 4963) +++ trunk/numpy/core/SConstruct 2008-04-05 16:49:18 UTC (rev 4964) @@ -9,6 +9,10 @@ from numscons import GetNumpyEnvironment from numscons import CheckCBLAS from numscons import write_info +try: + from numscons import distutils_dirs_emitter +except ImportError: + raise ImportError("You need numscons >= 0.5.2") from scons_support import CheckBrokenMathlib, define_no_smp, \ check_mlib, check_mlibs, is_npy_no_signal @@ -204,16 +208,19 @@ generate_umath, generate_umath_emitter array_api_gen_bld = Builder(action = do_generate_array_api, - emitter = generate_api_emitter) + emitter = [generate_api_emitter, + distutils_dirs_emitter]) ufunc_api_gen_bld = Builder(action = do_generate_ufunc_api, - emitter = generate_api_emitter) + emitter = [generate_api_emitter, + distutils_dirs_emitter]) template_bld = Builder(action = generate_from_template, - emitter = generate_from_template_emitter) + emitter = [generate_from_template_emitter, + distutils_dirs_emitter]) umath_bld = Builder(action = generate_umath, - emitter = generate_umath_emitter) + emitter = [generate_umath_emitter, distutils_dirs_emitter]) env.Append(BUILDERS = {'GenerateMultiarrayApi' : array_api_gen_bld, 'GenerateUfuncApi' : ufunc_api_gen_bld, @@ -223,45 +230,36 @@ #------------------------ # Generate generated code #------------------------ -# XXX: the use of env['build_dir'] and env['src_dir'] are really ugly. Will -# have to think about how removing them (using hierarchical scons and dir -# option ?) from os.path import join as pjoin -scalartypes_src = env.GenerateFromTemplate( - pjoin(env['build_dir'], 'src', 'scalartypes'), - pjoin(env['src_dir'], 'src', 'scalartypes.inc.src')) +scalartypes_src = env.GenerateFromTemplate(pjoin('src', 'scalartypes'), + pjoin('src', 'scalartypes.inc.src')) arraytypes_src = env.GenerateFromTemplate( - pjoin(env['build_dir'], 'src', 'arraytypes'), - pjoin(env['src_dir'], 'src', 'arraytypes.inc.src')) + pjoin('src', 'arraytypes'), + pjoin('src', 'arraytypes.inc.src')) sortmodule_src = env.GenerateFromTemplate( - pjoin(env['build_dir'], 'src', '_sortmodule'), - pjoin(env['src_dir'], 'src', '_sortmodule.c.src')) + pjoin('src', '_sortmodule'), + pjoin('src', '_sortmodule.c.src')) umathmodule_src = env.GenerateFromTemplate( - pjoin(env['build_dir'], 'src', 'umathmodule'), - pjoin(env['src_dir'], 'src', 'umathmodule.c.src')) + pjoin('src', 'umathmodule'), + pjoin('src', 'umathmodule.c.src')) scalarmathmodule_src = env.GenerateFromTemplate( - pjoin(env['build_dir'], 'src', 'scalarmathmodule'), - pjoin(env['src_dir'], 'src', 'scalarmathmodule.c.src')) + pjoin('src', 'scalarmathmodule'), + pjoin('src', 'scalarmathmodule.c.src')) -umath = env.GenerateUmath( - pjoin(env['build_dir'], '__umath_generated'), - pjoin(env['src_dir'], 'code_generators', 'generate_umath.py')) +umath = env.GenerateUmath('__umath_generated', + pjoin('code_generators', 'generate_umath.py')) -multiarray_api = env.GenerateMultiarrayApi( - pjoin(env['build_dir'], 'multiarray_api'), - [ pjoin(env['src_dir'], 'code_generators', - 'array_api_order.txt'), - pjoin(env['src_dir'], 'code_generators', - 'multiarray_api_order.txt')]) +multiarray_api = env.GenerateMultiarrayApi('multiarray_api', + [ pjoin('code_generators', 'array_api_order.txt'), + pjoin('code_generators', 'multiarray_api_order.txt')]) -ufunc_api = env.GenerateUfuncApi( - pjoin(env['build_dir'], 'ufunc_api'), - pjoin(env['src_dir'], 'code_generators', 'ufunc_api_order.txt')) +ufunc_api = env.GenerateUfuncApi('ufunc_api', + pjoin('code_generators', 'ufunc_api_order.txt')) env.Append(CPPPATH = [pjoin(env['src_dir'], 'include'), env['build_dir']]) From numpy-svn at scipy.org Sat Apr 5 18:28:18 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 5 Apr 2008 17:28:18 -0500 (CDT) Subject: [Numpy-svn] r4965 - trunk/numpy/core/tests Message-ID: <20080405222818.BB30B39C0C0@new.scipy.org> Author: stefan Date: 2008-04-05 17:28:10 -0500 (Sat, 05 Apr 2008) New Revision: 4965 Modified: trunk/numpy/core/tests/test_scalarmath.py Log: Test effect of newaxis indexing on array scalar. Modified: trunk/numpy/core/tests/test_scalarmath.py =================================================================== --- trunk/numpy/core/tests/test_scalarmath.py 2008-04-05 16:49:18 UTC (rev 4964) +++ trunk/numpy/core/tests/test_scalarmath.py 2008-04-05 22:28:10 UTC (rev 4965) @@ -79,6 +79,7 @@ x = value assert_array_equal(x[...],value) assert_array_equal(x[()],value) + assert_equal(x[None,...].shape,(1,)) class TestRepr(NumpyTestCase): def check_float_repr(self): From numpy-svn at scipy.org Sat Apr 5 18:35:00 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 5 Apr 2008 17:35:00 -0500 (CDT) Subject: [Numpy-svn] r4966 - trunk/numpy/core/tests Message-ID: <20080405223500.EA88E39C0C0@new.scipy.org> Author: stefan Date: 2008-04-05 17:34:51 -0500 (Sat, 05 Apr 2008) New Revision: 4966 Modified: trunk/numpy/core/tests/test_multiarray.py trunk/numpy/core/tests/test_scalarmath.py Log: Add tests for changeset 4822 [patch by Anne Archibald]. Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2008-04-05 22:28:10 UTC (rev 4965) +++ trunk/numpy/core/tests/test_multiarray.py 2008-04-05 22:34:51 UTC (rev 4966) @@ -217,6 +217,50 @@ x = array(2) self.failUnlessRaises(ValueError, add, x, [1], x) +class TestScalarIndexing(NumpyTestCase): + def setUp(self): + self.d = array([0,1])[0], + + def check_ellipsis_subscript(self): + a, = self.d + self.failUnlessEqual(a[...], 0) + self.failUnlessEqual(a[...].shape,()) + + def check_empty_subscript(self): + a, = self.d + self.failUnlessEqual(a[()], 0) + self.failUnlessEqual(a[()].shape,()) + + def check_invalid_subscript(self): + a, = self.d + self.failUnlessRaises(IndexError, lambda x: x[0], a) + self.failUnlessRaises(IndexError, lambda x: x[array([], int)], a) + + def check_invalid_subscript_assignment(self): + a, = self.d + def assign(x, i, v): + x[i] = v + self.failUnlessRaises(TypeError, assign, a, 0, 42) + + def check_newaxis(self): + a, = self.d + self.failUnlessEqual(a[newaxis].shape, (1,)) + self.failUnlessEqual(a[..., newaxis].shape, (1,)) + self.failUnlessEqual(a[newaxis, ...].shape, (1,)) + self.failUnlessEqual(a[..., newaxis].shape, (1,)) + self.failUnlessEqual(a[newaxis, ..., newaxis].shape, (1,1)) + self.failUnlessEqual(a[..., newaxis, newaxis].shape, (1,1)) + self.failUnlessEqual(a[newaxis, newaxis, ...].shape, (1,1)) + self.failUnlessEqual(a[(newaxis,)*10].shape, (1,)*10) + + def check_invalid_newaxis(self): + a, = self.d + def subscript(x, i): x[i] + self.failUnlessRaises(IndexError, subscript, a, (newaxis, 0)) + self.failUnlessRaises(IndexError, subscript, a, (newaxis,)*50) + + + class TestCreation(NumpyTestCase): def check_from_attribute(self): class x(object): Modified: trunk/numpy/core/tests/test_scalarmath.py =================================================================== --- trunk/numpy/core/tests/test_scalarmath.py 2008-04-05 22:28:10 UTC (rev 4965) +++ trunk/numpy/core/tests/test_scalarmath.py 2008-04-05 22:34:51 UTC (rev 4966) @@ -72,15 +72,6 @@ # val2 = eval(val_repr) # assert_equal( val, val2 ) -class TestIndexing(NumpyTestCase): - def test_basic(self): - for t in types: - value = t(1) - x = value - assert_array_equal(x[...],value) - assert_array_equal(x[()],value) - assert_equal(x[None,...].shape,(1,)) - class TestRepr(NumpyTestCase): def check_float_repr(self): from numpy import nan, inf From numpy-svn at scipy.org Sat Apr 5 20:40:41 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 5 Apr 2008 19:40:41 -0500 (CDT) Subject: [Numpy-svn] r4967 - in trunk/numpy: core/tests ma/tests Message-ID: <20080406004041.8587439C0C0@new.scipy.org> Author: stefan Date: 2008-04-05 19:40:20 -0500 (Sat, 05 Apr 2008) New Revision: 4967 Modified: trunk/numpy/core/tests/test_numeric.py trunk/numpy/ma/tests/test_core.py Log: Add tests for ddof parameter in var/std [patch by Anne Archibald]. Modified: trunk/numpy/core/tests/test_numeric.py =================================================================== --- trunk/numpy/core/tests/test_numeric.py 2008-04-05 22:34:51 UTC (rev 4966) +++ trunk/numpy/core/tests/test_numeric.py 2008-04-06 00:40:20 UTC (rev 4967) @@ -724,6 +724,21 @@ assert_array_equal(x,array([inf,1])) assert_array_equal(y,array([0,inf])) +class TestStdVar(NumpyTestCase): + def setUp(self): + self.A = array([1,-1,1,-1]) + self.real_var = 1 + + def test_basic(self): + assert_almost_equal(var(self.A),self.real_var) + assert_almost_equal(std(self.A)**2,self.real_var) + def test_ddof1(self): + assert_almost_equal(var(self.A,ddof=1),self.real_var*len(self.A)/float(len(self.A)-1)) + assert_almost_equal(std(self.A,ddof=1)**2,self.real_var*len(self.A)/float(len(self.A)-1)) + def test_ddof2(self): + assert_almost_equal(var(self.A,ddof=2),self.real_var*len(self.A)/float(len(self.A)-2)) + assert_almost_equal(std(self.A,ddof=2)**2,self.real_var*len(self.A)/float(len(self.A)-2)) + import sys if sys.version_info[:2] >= (2, 5): set_local_path() Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-04-05 22:34:51 UTC (rev 4966) +++ trunk/numpy/ma/tests/test_core.py 2008-04-06 00:40:20 UTC (rev 4967) @@ -1009,6 +1009,8 @@ assert_equal(mXX.var(axis=3).shape,XX.var(axis=3).shape) assert_equal(mX.var().shape,X.var().shape) (mXvar0,mXvar1) = (mX.var(axis=0), mX.var(axis=1)) + assert_almost_equal(mX.var(axis=None,ddof=2),mX.compressed().var(ddof=2)) + assert_almost_equal(mX.std(axis=None,ddof=2),mX.compressed().std(ddof=2)) for k in range(6): assert_almost_equal(mXvar1[k],mX[k].compressed().var()) assert_almost_equal(mXvar0[k],mX[:,k].compressed().var()) From numpy-svn at scipy.org Sat Apr 5 22:34:35 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 5 Apr 2008 21:34:35 -0500 (CDT) Subject: [Numpy-svn] r4968 - in trunk/numpy: core linalg linalg/tests Message-ID: <20080406023435.27C0439C0C2@new.scipy.org> Author: stefan Date: 2008-04-05 21:34:19 -0500 (Sat, 05 Apr 2008) New Revision: 4968 Modified: trunk/numpy/core/defmatrix.py trunk/numpy/linalg/info.py trunk/numpy/linalg/linalg.py trunk/numpy/linalg/tests/test_linalg.py Log: Factor out matrix_multiply from defmatrix. Based on a patch by Anne Archibald. Modified: trunk/numpy/core/defmatrix.py =================================================================== --- trunk/numpy/core/defmatrix.py 2008-04-06 00:40:20 UTC (rev 4967) +++ trunk/numpy/core/defmatrix.py 2008-04-06 02:34:19 UTC (rev 4968) @@ -2,7 +2,8 @@ import sys import numeric as N -from numeric import concatenate, isscalar, binary_repr +from numeric import concatenate, isscalar, binary_repr, identity +from numpy.lib.utils import issubdtype # make translation table _table = [None]*256 @@ -46,8 +47,83 @@ """ return matrix(data, dtype=dtype, copy=False) +def matrix_power(M,n): + """Raise a square matrix to the (integer) power n. + For positive integers n, the power is computed by repeated matrix + squarings and matrix multiplications. If n=0, the identity matrix + of the same type as M is returned. If n<0, the inverse is computed + and raised to the exponent. + Parameters + ---------- + M : array-like + Must be a square array (that is, of dimension two and with + equal sizes). + n : integer + The exponent can be any integer or long integer, positive + negative or zero. + + Returns + ------- + M to the power n + The return value is a an array the same shape and size as M; + if the exponent was positive or zero then the type of the + elements is the same as those of M. If the exponent was negative + the elements are floating-point. + + Raises + ------ + LinAlgException + If the matrix is not numerically invertible, an exception is raised. + + See Also + -------- + The matrix() class provides an equivalent function as the exponentiation + operator. + + Examples + -------- + >>> matrix_power(array([[0,1],[-1,0]]),10) + array([[-1, 0], + [ 0, -1]]) + """ + if len(M.shape) != 2 or M.shape[0] != M.shape[1]: + raise ValueError("input must be a square array") + if not issubdtype(type(n),int): + raise TypeError("exponent must be an integer") + + from numpy.linalg import inv + + if n==0: + M = M.copy() + M[:] = identity(M.shape[0]) + return M + elif n<0: + M = inv(M) + n *= -1 + + result = M + if n <= 3: + for _ in range(n-1): + result=N.dot(result,M) + return result + + # binary decomposition to reduce the number of Matrix + # multiplications for n > 3. + beta = binary_repr(n) + Z,q,t = M,0,len(beta) + while beta[t-q-1] == '0': + Z = N.dot(Z,Z) + q += 1 + result = Z + for k in range(q+1,t): + Z = N.dot(Z,Z) + if beta[t-k-1] == '1': + result = N.dot(result,Z) + return result + + class matrix(N.ndarray): """mat = matrix(data, dtype=None, copy=True) @@ -195,39 +271,7 @@ return self def __pow__(self, other): - shape = self.shape - if len(shape) != 2 or shape[0] != shape[1]: - raise TypeError, "matrix is not square" - if type(other) in (type(1), type(1L)): - if other==0: - return matrix(N.identity(shape[0])) - if other<0: - x = self.I - other=-other - else: - x=self - result = x - if other <= 3: - while(other>1): - result=result*x - other=other-1 - return result - # binary decomposition to reduce the number of Matrix - # Multiplies for other > 3. - beta = binary_repr(other) - t = len(beta) - Z,q = x.copy(),0 - while beta[t-q-1] == '0': - Z *= Z - q += 1 - result = Z.copy() - for k in range(q+1,t): - Z *= Z - if beta[t-k-1] == '1': - result *= Z - return result - else: - raise TypeError, "exponent must be an integer" + return matrix_power(self, other) def __rpow__(self, other): return NotImplemented Modified: trunk/numpy/linalg/info.py =================================================================== --- trunk/numpy/linalg/info.py 2008-04-06 00:40:20 UTC (rev 4967) +++ trunk/numpy/linalg/info.py 2008-04-06 02:34:19 UTC (rev 4968) @@ -10,6 +10,7 @@ - lstsq Solve linear least-squares problem - pinv Pseudo-inverse (Moore-Penrose) calculated using a singular value decomposition +- matrix_power Integer power of a square matrix Eigenvalues and decompositions: Modified: trunk/numpy/linalg/linalg.py =================================================================== --- trunk/numpy/linalg/linalg.py 2008-04-06 00:40:20 UTC (rev 4967) +++ trunk/numpy/linalg/linalg.py 2008-04-06 02:34:19 UTC (rev 4968) @@ -9,7 +9,7 @@ zgetrf, dpotrf, zpotrf, dgeqrf, zgeqrf, zungqr, dorgqr. """ -__all__ = ['solve', 'tensorsolve', 'tensorinv', +__all__ = ['matrix_power', 'solve', 'tensorsolve', 'tensorinv', 'inv', 'cholesky', 'eigvals', 'eigvalsh', 'pinv', @@ -26,6 +26,7 @@ isfinite, size from numpy.lib import triu from numpy.linalg import lapack_lite +from numpy.core.defmatrix import matrix_power fortran_int = intc @@ -134,6 +135,7 @@ if size(a) == 0: raise LinAlgError("Arrays cannot be empty") + # Linear equations def tensorsolve(a, b, axes=None): @@ -326,6 +328,7 @@ a, wrap = _makearray(a) return wrap(solve(a, identity(a.shape[0], dtype=a.dtype))) + # Cholesky decomposition def cholesky(a): @@ -1053,6 +1056,7 @@ sign = add.reduce(pivots != arange(1, n+1)) % 2 return (1.-2.*sign)*multiply.reduce(diagonal(a), axis=-1) + # Linear Least Squares def lstsq(a, b, rcond=-1): Modified: trunk/numpy/linalg/tests/test_linalg.py =================================================================== --- trunk/numpy/linalg/tests/test_linalg.py 2008-04-06 00:40:20 UTC (rev 4967) +++ trunk/numpy/linalg/tests/test_linalg.py 2008-04-06 02:34:19 UTC (rev 4968) @@ -6,6 +6,7 @@ from numpy import array, single, double, csingle, cdouble, dot, identity, \ multiply, atleast_2d from numpy import linalg +from linalg import matrix_power restore_path() old_assert_almost_equal = assert_almost_equal @@ -46,38 +47,38 @@ except linalg.LinAlgError, e: pass -class test_solve(LinalgTestCase): +class TestSolve(LinalgTestCase): def do(self, a, b): x = linalg.solve(a, b) assert_almost_equal(b, dot(a, x)) -class test_inv(LinalgTestCase): +class TestInv(LinalgTestCase): def do(self, a, b): a_inv = linalg.inv(a) assert_almost_equal(dot(a, a_inv), identity(a.shape[0])) -class test_eigvals(LinalgTestCase): +class TestEigvals(LinalgTestCase): def do(self, a, b): ev = linalg.eigvals(a) evalues, evectors = linalg.eig(a) assert_almost_equal(ev, evalues) -class test_eig(LinalgTestCase): +class TestEig(LinalgTestCase): def do(self, a, b): evalues, evectors = linalg.eig(a) assert_almost_equal(dot(a, evectors), evectors*evalues) -class test_svd(LinalgTestCase): +class TestSVD(LinalgTestCase): def do(self, a, b): u, s, vt = linalg.svd(a, 0) assert_almost_equal(a, dot(u*s, vt)) -class test_pinv(LinalgTestCase): +class TestPinv(LinalgTestCase): def do(self, a, b): a_ginv = linalg.pinv(a) assert_almost_equal(dot(a, a_ginv), identity(a.shape[0])) -class test_det(LinalgTestCase): +class TestDet(LinalgTestCase): def do(self, a, b): d = linalg.det(a) if a.dtype.type in (single, double): @@ -87,7 +88,7 @@ ev = linalg.eigvals(ad) assert_almost_equal(d, multiply.reduce(ev)) -class test_lstsq(LinalgTestCase): +class TestLstsq(LinalgTestCase): def do(self, a, b): u, s, vt = linalg.svd(a, 0) x, residuals, rank, sv = linalg.lstsq(a, b) @@ -95,5 +96,58 @@ assert_equal(rank, a.shape[0]) assert_almost_equal(sv, s) +class TestMatrixPower(ParametricTestCase): + R90 = array([[0,1],[-1,0]]) + Arb22 = array([[4,-7],[-2,10]]) + noninv = array([[1,0],[0,0]]) + arbfloat = array([[0.1,3.2],[1.2,0.7]]) + + large = identity(10) + t = large[1,:].copy() + large[1,:] = large[0,:] + large[0,:] = t + + def test_large_power(self): + assert_equal(matrix_power(self.R90,2L**100+2**10+2**5+1),self.R90) + def test_large_power_trailing_zero(self): + assert_equal(matrix_power(self.R90,2L**100+2**10+2**5),identity(2)) + + def testip_zero(self): + def tz(M): + mz = matrix_power(M,0) + assert_equal(mz, identity(M.shape[0])) + assert_equal(mz.dtype, M.dtype) + for M in [self.Arb22, self.arbfloat, self.large]: + yield tz, M + + def testip_one(self): + def tz(M): + mz = matrix_power(M,1) + assert_equal(mz, M) + assert_equal(mz.dtype, M.dtype) + for M in [self.Arb22, self.arbfloat, self.large]: + yield tz, M + + def testip_two(self): + def tz(M): + mz = matrix_power(M,2) + assert_equal(mz, dot(M,M)) + assert_equal(mz.dtype, M.dtype) + for M in [self.Arb22, self.arbfloat, self.large]: + yield tz, M + + def testip_invert(self): + def tz(M): + mz = matrix_power(M,-1) + assert_almost_equal(identity(M.shape[0]), dot(mz,M)) + for M in [self.R90, self.Arb22, self.arbfloat, self.large]: + yield tz, M + + def test_invert_noninvertible(self): + import numpy.linalg + self.assertRaises(numpy.linalg.linalg.LinAlgError, + lambda: matrix_power(self.noninv,-1)) + + if __name__ == '__main__': NumpyTest().run() From numpy-svn at scipy.org Sun Apr 6 17:59:30 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 6 Apr 2008 16:59:30 -0500 (CDT) Subject: [Numpy-svn] r4969 - trunk/numpy/core/include/numpy Message-ID: <20080406215930.3976E39C0C6@new.scipy.org> Author: oliphant Date: 2008-04-06 16:59:28 -0500 (Sun, 06 Apr 2008) New Revision: 4969 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h Log: Remove redundant check because PyObject_TypeCheck already includes an exact check. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-06 02:34:19 UTC (rev 4968) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-06 21:59:28 UTC (rev 4969) @@ -1830,9 +1830,7 @@ #define PyArray_DescrCheck(op) ((op)->ob_type == &PyArrayDescr_Type) -#define PyArray_Check(op) ((op)->ob_type == &PyArray_Type || \ - PyObject_TypeCheck(op, &PyArray_Type)) - +#define PyArray_Check(op) PyObject_TypeCheck(op, &PyArray_Type) #define PyArray_CheckExact(op) ((op)->ob_type == &PyArray_Type) #define PyArray_HasArrayInterfaceType(op, type, context, out) \ From numpy-svn at scipy.org Sun Apr 6 22:07:14 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 6 Apr 2008 21:07:14 -0500 (CDT) Subject: [Numpy-svn] r4970 - trunk/numpy/linalg/tests Message-ID: <20080407020714.2FE6839C0F2@new.scipy.org> Author: peridot Date: 2008-04-06 21:07:04 -0500 (Sun, 06 Apr 2008) New Revision: 4970 Modified: trunk/numpy/linalg/tests/test_linalg.py Log: Test that matrix_power behaves correctly for boolean matrices. Modified: trunk/numpy/linalg/tests/test_linalg.py =================================================================== --- trunk/numpy/linalg/tests/test_linalg.py 2008-04-06 21:59:28 UTC (rev 4969) +++ trunk/numpy/linalg/tests/test_linalg.py 2008-04-07 02:07:04 UTC (rev 4970) @@ -148,6 +148,10 @@ self.assertRaises(numpy.linalg.linalg.LinAlgError, lambda: matrix_power(self.noninv,-1)) +class TestBoolPower(NumpyTestCase): + def check_square(self): + A = array([[True,False],[True,True]]) + assert_equal(matrix_power(A,2),A) if __name__ == '__main__': NumpyTest().run() From numpy-svn at scipy.org Sun Apr 6 22:59:38 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 6 Apr 2008 21:59:38 -0500 (CDT) Subject: [Numpy-svn] r4971 - in trunk/numpy: . core core/tests ma Message-ID: <20080407025938.5BDAE39C107@new.scipy.org> Author: peridot Date: 2008-04-06 21:59:18 -0500 (Sun, 06 Apr 2008) New Revision: 4971 Modified: trunk/numpy/add_newdocs.py trunk/numpy/core/defmatrix.py trunk/numpy/core/fromnumeric.py trunk/numpy/core/tests/test_numeric.py trunk/numpy/ma/core.py Log: Documented and tested new behaviour of std and var on complex numbers. Added ddof argument and its documentation to the std and var methods of matrix. Documented ddof for std and var methods of ma. Note that stdu and varu in ma still have the old, peculiar, behaviour for complex values. Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2008-04-07 02:07:04 UTC (rev 4970) +++ trunk/numpy/add_newdocs.py 2008-04-07 02:59:18 UTC (rev 4971) @@ -1024,7 +1024,7 @@ ---------- axis : integer Axis along which the means are computed. The default is - to compute the standard deviation of the flattened array. + to compute the mean of the flattened array. dtype : type Type to use in computing the means. For arrays of integer type the default is float32, for arrays of float types it @@ -1277,7 +1277,7 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('std', - """a.std(axis=None, dtype=None, out=None) -> standard deviation. + """a.std(axis=None, dtype=None, out=None, ddof=0) -> standard deviation. Returns the standard deviation of the array elements, a measure of the spread of a distribution. The standard deviation is computed for the @@ -1296,6 +1296,9 @@ Alternative output array in which to place the result. It must have the same shape as the expected output but the type will be cast if necessary. + ddof : {0, integer} + Means Delta Degrees of Freedom. The divisor used in calculations + is N-ddof. Returns ------- @@ -1311,9 +1314,11 @@ Notes ----- The standard deviation is the square root of the average of the squared - deviations from the mean, i.e. var = sqrt(mean((x - x.mean())**2)). The - computed standard deviation is biased, i.e., the mean is computed by - dividing by the number of elements, N, rather than by N-1. + deviations from the mean, i.e. var = sqrt(mean(abs(x - x.mean())**2)). + The computed standard deviation is computed by dividing by the number of + elements, N-ddof. The option ddof defaults to zero, that is, a + biased estimate. Note that for complex numbers std takes the absolute + value before squaring, so that the result is always real and nonnegative. """)) @@ -1461,7 +1466,7 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('var', - """a.var(axis=None, dtype=None, out=None) -> variance + """a.var(axis=None, dtype=None, out=None, ddof=0) -> variance Returns the variance of the array elements, a measure of the spread of a distribution. The variance is computed for the flattened array by default, @@ -1480,6 +1485,9 @@ Alternative output array in which to place the result. It must have the same shape as the expected output but the type will be cast if necessary. + ddof : {0, integer}, + Means Delta Degrees of Freedom. The divisor used in calculation is + N - ddof. Returns ------- @@ -1494,10 +1502,12 @@ Notes ----- - The variance is the average of the squared deviations from the mean, i.e. - var = mean((x - x.mean())**2). The computed variance is biased, i.e., - the mean is computed by dividing by the number of elements, N, rather - than by N-1. + The variance is the average of the squared deviations from the mean, + i.e. var = mean(abs(x - x.mean())**2). The mean is computed by + dividing by N-ddof, where N is the number of elements. The argument + ddof defaults to zero; for an unbiased estimate supply ddof=1. Note + that for complex numbers the absolute value is taken before squaring, + so that the result is always real and nonnegative. """)) Modified: trunk/numpy/core/defmatrix.py =================================================================== --- trunk/numpy/core/defmatrix.py 2008-04-07 02:07:04 UTC (rev 4970) +++ trunk/numpy/core/defmatrix.py 2008-04-07 02:59:18 UTC (rev 4971) @@ -350,7 +350,7 @@ """ return N.ndarray.mean(self, axis, dtype, out)._align(axis) - def std(self, axis=None, dtype=None, out=None): + def std(self, axis=None, dtype=None, out=None, ddof=0): """Compute the standard deviation along the specified axis. Returns the standard deviation of the array elements, a measure of the @@ -363,16 +363,17 @@ Axis along which the standard deviation is computed. The default is to compute the standard deviation of the flattened array. - dtype : type Type to use in computing the standard deviation. For arrays of integer type the default is float32, for arrays of float types it is the same as the array type. - out : ndarray Alternative output array in which to place the result. It must have the same shape as the expected output but the type will be cast if necessary. + ddof : {0, integer} + Means Delta Degrees of Freedom. The divisor used in calculations + is N-ddof. Returns ------- @@ -389,13 +390,17 @@ ----- The standard deviation is the square root of the average of the squared deviations from the mean, i.e. var = - sqrt(mean((x - x.mean())**2)). The computed standard - deviation is biased, i.e., the mean is computed by dividing by - the number of elements, N, rather than by N-1. + sqrt(mean(abs(x - x.mean())**2)). The computed standard + deviation is computed by dividing by the number of elements, + N-ddof. The option ddof defaults to zero, that is, a biased + estimate. Note that for complex numbers std takes the absolute + value before squaring, so that the result is always real + and nonnegative. + """ - return N.ndarray.std(self, axis, dtype, out)._align(axis) + return N.ndarray.std(self, axis, dtype, out, ddof)._align(axis) - def var(self, axis=None, dtype=None, out=None): + def var(self, axis=None, dtype=None, out=None, ddof=0): """Compute the variance along the specified axis. Returns the variance of the array elements, a measure of the spread of @@ -415,6 +420,9 @@ Alternative output array in which to place the result. It must have the same shape as the expected output but the type will be cast if necessary. + ddof : {0, integer} + Means Delta Degrees of Freedom. The divisor used in calculations + is N-ddof. Returns ------- @@ -431,9 +439,12 @@ ----- The variance is the average of the squared deviations from the - mean, i.e. var = mean((x - x.mean())**2). The computed - variance is biased, i.e., the mean is computed by dividing by - the number of elements, N, rather than by N-1. + mean, i.e. var = mean(abs(x - x.mean())**2). The mean is + computed by dividing by N-ddof, where N is the number of elements. + The argument ddof defaults to zero; for an unbiased estimate + supply ddof=1. Note that for complex numbers the absolute value + is taken before squaring, so that the result is always real + and nonnegative. """ return N.ndarray.var(self, axis, dtype, out)._align(axis) Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2008-04-07 02:07:04 UTC (rev 4970) +++ trunk/numpy/core/fromnumeric.py 2008-04-07 02:59:18 UTC (rev 4971) @@ -1671,9 +1671,11 @@ Notes ----- The standard deviation is the square root of the average of the squared - deviations from the mean, i.e. var = sqrt(mean((x - x.mean())**2)). The - computed standard deviation is computed by dividing by the number of - elements, N-ddof. + deviations from the mean, i.e. var = sqrt(mean(abs(x - x.mean())**2)). + The computed standard deviation is computed by dividing by the number of + elements, N-ddof. The option ddof defaults to zero, that is, a + biased estimate. Note that for complex numbers std takes the absolute + value before squaring, so that the result is always real and nonnegative. Examples -------- @@ -1734,9 +1736,10 @@ Notes ----- The variance is the average of the squared deviations from the mean, - i.e. var = mean((x - x.mean())**2). The computed variance is biased, + i.e. var = mean(abs(x - x.mean())**2). The computed variance is biased, i.e., the mean is computed by dividing by the number of elements, N, - rather than by N-1. + rather than by N-1. Note that for complex numbers the absolute value is + taken before squaring, so that the result is always real and nonnegative. Examples -------- Modified: trunk/numpy/core/tests/test_numeric.py =================================================================== --- trunk/numpy/core/tests/test_numeric.py 2008-04-07 02:07:04 UTC (rev 4970) +++ trunk/numpy/core/tests/test_numeric.py 2008-04-07 02:59:18 UTC (rev 4971) @@ -739,6 +739,13 @@ assert_almost_equal(var(self.A,ddof=2),self.real_var*len(self.A)/float(len(self.A)-2)) assert_almost_equal(std(self.A,ddof=2)**2,self.real_var*len(self.A)/float(len(self.A)-2)) +class TestStdVarComplex(NumpyTestCase): + def test_basic(self): + A = array([1,1.j,-1,-1.j]) + real_var = 1 + assert_almost_equal(var(A),real_var) + assert_almost_equal(std(A)**2,real_var) + import sys if sys.version_info[:2] >= (2, 5): set_local_path() Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-04-07 02:07:04 UTC (rev 4970) +++ trunk/numpy/ma/core.py 2008-04-07 02:59:18 UTC (rev 4971) @@ -2153,7 +2153,7 @@ """Return the variance, a measure of the spread of a distribution. The variance is the average of the squared deviations from the - mean, i.e. var = mean((x - x.mean())**2). + mean, i.e. var = mean(abs(x - x.mean())**2). Parameters ---------- @@ -2166,8 +2166,11 @@ Notes ----- - The value returned is a biased estimate of the true variance. - For the (more standard) unbiased estimate, use varu. + The value returned is by default a biased estimate of the + true variance, since the mean is computed by dividing by N-ddof. + For the (more standard) unbiased estimate, use ddof=1 or call varu. + Note that for complex numbers the absolute value is taken before + squaring, so that the result is always real and nonnegative. """ if self._mask is nomask: @@ -2191,7 +2194,7 @@ The standard deviation is the square root of the average of the squared deviations from the mean, i.e. - std = sqrt(mean((x - x.mean())**2)). + std = sqrt(mean(abs(x - x.mean())**2)). Parameters ---------- @@ -2204,10 +2207,12 @@ Notes ----- - The value returned is a biased estimate of the true - standard deviation. For the more standard unbiased - estimate, use stdu. - + The value returned is by default a biased estimate of the + true standard deviation, since the mean is computed by dividing + by N-ddof. For the more standard unbiased estimate, use ddof=1 + or call stdu. Note that for complex numbers the absolute value + is taken before squaring, so that the result is always real + and nonnegative. """ dvar = self.var(axis,dtype,ddof=ddof) if axis is not None or dvar is not masked: From numpy-svn at scipy.org Mon Apr 7 10:42:56 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 09:42:56 -0500 (CDT) Subject: [Numpy-svn] r4972 - in trunk/numpy/ma: . tests Message-ID: <20080407144256.030D339C10A@new.scipy.org> Author: pierregm Date: 2008-04-07 09:42:50 -0500 (Mon, 07 Apr 2008) New Revision: 4972 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/extras.py trunk/numpy/ma/mstats.py trunk/numpy/ma/tests/test_core.py trunk/numpy/ma/tests/test_mstats.py trunk/numpy/ma/tests/test_old_ma.py Log: core: compressed : make sure that the result is always an array. count : make sure that a regular ndarray is returned. added the get_fill_value function extras: added the expand_dims function deleted varu/stdu (redundant with the ddof=1 parameter) Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-04-07 02:59:18 UTC (rev 4971) +++ trunk/numpy/ma/core.py 2008-04-07 14:42:50 UTC (rev 4972) @@ -1796,7 +1796,7 @@ if axis is None: return (n1-n2) else: - return masked_array(n1 - n2) + return narray(n1 - n2) #............................................ flatten = _arraymethod('flatten') # @@ -2168,7 +2168,7 @@ ----- The value returned is by default a biased estimate of the true variance, since the mean is computed by dividing by N-ddof. - For the (more standard) unbiased estimate, use ddof=1 or call varu. + For the (more standard) unbiased estimate, use ddof=1 or. Note that for complex numbers the absolute value is taken before squaring, so that the result is always real and nonnegative. @@ -2209,10 +2209,9 @@ ----- The value returned is by default a biased estimate of the true standard deviation, since the mean is computed by dividing - by N-ddof. For the more standard unbiased estimate, use ddof=1 - or call stdu. Note that for complex numbers the absolute value - is taken before squaring, so that the result is always real - and nonnegative. + by N-ddof. For the more standard unbiased estimate, use ddof=1. + Note that for complex numbers the absolute value is taken before + squaring, so that the result is always real and nonnegative. """ dvar = self.var(axis,dtype,ddof=ddof) if axis is not None or dvar is not masked: @@ -2899,7 +2898,7 @@ def compressed(x): """Return a 1-D array of all the non-masked data.""" if getmask(x) is nomask: - return x + return numpy.asanyarray(x) else: return x.compressed() Modified: trunk/numpy/ma/extras.py =================================================================== --- trunk/numpy/ma/extras.py 2008-04-07 02:59:18 UTC (rev 4971) +++ trunk/numpy/ma/extras.py 2008-04-07 14:42:50 UTC (rev 4972) @@ -12,11 +12,18 @@ __date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $' __all__ = ['apply_along_axis', 'atleast_1d', 'atleast_2d', 'atleast_3d', - 'average', 'vstack', 'hstack', 'dstack', 'row_stack', 'column_stack', - 'compress_rowcols', 'compress_rows', 'compress_cols', 'count_masked', - 'dot', 'hsplit', 'mask_rowcols','mask_rows','mask_cols','masked_all', - 'masked_all_like', 'mediff1d', 'median', 'mr_', 'notmasked_edges', - 'notmasked_contiguous', 'stdu', 'varu', + 'average', + 'column_stack','compress_cols','compress_rowcols', 'compress_rows', + 'count_masked', + 'dot','dstack', + 'expand_dims', + 'flatnotmasked_contiguous','flatnotmasked_edges', + 'hsplit','hstack', + 'mask_cols','mask_rowcols','mask_rows','masked_all','masked_all_like', + 'median','mediff1d','mr_', + 'notmasked_contiguous','notmasked_edges', + 'row_stack', + 'vstack', ] from itertools import groupby @@ -82,76 +89,7 @@ mask=numeric.ones(arr.shape, bool_)) return a -#####-------------------------------------------------------------------------- -#---- --- New methods --- -#####-------------------------------------------------------------------------- -def varu(a, axis=None, dtype=None): - """Return an unbiased estimate of the variance. - i.e. var = sum((x - x.mean())**2)/(size(x,axis)-1) - Parameters - ---------- - axis : int, optional - Axis along which to perform the operation. - If None, applies to a flattened version of the array. - dtype : {dtype}, optional - Datatype for the intermediary computation. If not given, - the current dtype is used instead. - - Notes - ----- - The value returned is an unbiased estimate of the true variance. - For the (less standard) biased estimate, use var. - - """ - a = asarray(a) - cnt = a.count(axis=axis) - anom = a.anom(axis=axis, dtype=dtype) - anom *= anom - dvar = anom.sum(axis) / (cnt-1) - if axis is None: - return dvar - dvar.__setmask__(mask_or(a._mask.all(axis), (cnt==1))) - return dvar -# return a.__class__(dvar, -# mask=mask_or(a._mask.all(axis), (cnt==1)), -# fill_value=a._fill_value) - -def stdu(a, axis=None, dtype=None): - """Return an unbiased estimate of the standard deviation. The - standard deviation is the square root of the average of the - squared deviations from the mean, i.e. stdu = sqrt(varu(x)). - - Parameters - ---------- - axis : int, optional - Axis along which to perform the operation. - If None, applies to a flattened version of the array. - dtype : dtype, optional - Datatype for the intermediary computation. - If not given, the current dtype is used instead. - - Notes - ----- - The value returned is an unbiased estimate of the true - standard deviation. For the biased estimate, - use std. - - """ - a = asarray(a) - dvar = a.varu(axis,dtype) - if axis is None: - if dvar is masked: - return masked - else: - # Should we use umath.sqrt instead ? - return sqrt(dvar) - return sqrt(dvar) - - -MaskedArray.stdu = stdu -MaskedArray.varu = varu - #####-------------------------------------------------------------------------- #---- --- Standard functions --- #####-------------------------------------------------------------------------- @@ -199,6 +137,17 @@ hsplit = _fromnxfunction('hsplit') +def expand_dims(a, axis): + """Expands the shape of a by including newaxis before axis. + """ + if not isinstance(a, MaskedArray): + return numpy.expand_dims(a,axis) + elif getmask(a) is nomask: + return numpy.expand_dims(a,axis).view(MaskedArray) + m = getmaskarray(a) + return masked_array(numpy.expand_dims(a,axis), + mask=numpy.expand_dims(m,axis)) + #####-------------------------------------------------------------------------- #---- #####-------------------------------------------------------------------------- @@ -875,3 +824,6 @@ return result ################################################################################ +testmathworks = fix_invalid([1.165 , 0.6268, 0.0751, 0.3516, -0.6965, + numpy.nan]) +expand_dims(testmathworks.mean(0),0) \ No newline at end of file Modified: trunk/numpy/ma/mstats.py =================================================================== --- trunk/numpy/ma/mstats.py 2008-04-07 02:59:18 UTC (rev 4971) +++ trunk/numpy/ma/mstats.py 2008-04-07 14:42:50 UTC (rev 4972) @@ -201,7 +201,7 @@ "Returns the standard error of the trimmed mean for a 1D input data." winsorized = winsorize(data) nsize = winsorized.count() - winstd = winsorized.stdu() + winstd = winsorized.std(ddof=1) return winstd / ((1-2*trim) * numpy.sqrt(nsize)) #........................ data = masked_array(data, copy=False, subok=True) Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-04-07 02:59:18 UTC (rev 4971) +++ trunk/numpy/ma/tests/test_core.py 2008-04-07 14:42:50 UTC (rev 4972) @@ -292,7 +292,7 @@ assert_equal(1, count(1)) assert_equal(0, array(1,mask=[1])) ott = ott.reshape((2,2)) - assert isMaskedArray(count(ott,0)) + assert isinstance(count(ott,0), ndarray) assert isinstance(count(ott), types.IntType) assert_equal(3, count(ott)) assert getmask(count(ott,0)) is nomask Modified: trunk/numpy/ma/tests/test_mstats.py =================================================================== --- trunk/numpy/ma/tests/test_mstats.py 2008-04-07 02:59:18 UTC (rev 4971) +++ trunk/numpy/ma/tests/test_mstats.py 2008-04-07 14:42:50 UTC (rev 4972) @@ -148,7 +148,7 @@ "Tests the Winsorization of the data." data = masked_array([ 77, 87, 88,114,151,210,219,246,253,262, 296,299,306,376,428,515,666,1310,2611]) - assert_almost_equal(winsorize(data).varu(), 21551.4, 1) + assert_almost_equal(winsorize(data).var(ddof=1), 21551.4, 1) data[5] = masked winsorized = winsorize(data) assert_equal(winsorized.mask, data.mask) Modified: trunk/numpy/ma/tests/test_old_ma.py =================================================================== --- trunk/numpy/ma/tests/test_old_ma.py 2008-04-07 02:59:18 UTC (rev 4971) +++ trunk/numpy/ma/tests/test_old_ma.py 2008-04-07 14:42:50 UTC (rev 4972) @@ -156,7 +156,7 @@ self.assertEqual(1, count(1)) self.failUnless (eq(0, array(1,mask=[1]))) ott=ott.reshape((2,2)) - assert isMaskedArray(count(ott,0)) + assert isinstance(count(ott,0),numpy.ndarray) assert isinstance(count(ott), types.IntType) self.failUnless (eq(3, count(ott))) assert getmask(count(ott,0)) is nomask From numpy-svn at scipy.org Mon Apr 7 14:12:16 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 13:12:16 -0500 (CDT) Subject: [Numpy-svn] r4973 - in trunk/numpy/ma: . tests Message-ID: <20080407181216.1E89939C3AB@new.scipy.org> Author: peridot Date: 2008-04-07 13:12:09 -0500 (Mon, 07 Apr 2008) New Revision: 4973 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/tests/test_core.py Log: Fix maskedarray's std and var of complex arrays, with test. Add test for ddof. Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-04-07 14:42:50 UTC (rev 4972) +++ trunk/numpy/ma/core.py 2008-04-07 18:12:09 UTC (rev 4973) @@ -68,7 +68,7 @@ import numpy.core.fromnumeric as fromnumeric import numpy.core.numeric as numeric import numpy.core.numerictypes as ntypes -from numpy import bool_, dtype, typecodes, amax, amin, ndarray +from numpy import bool_, dtype, typecodes, amax, amin, ndarray, iscomplexobj from numpy import expand_dims as n_expand_dims from numpy import array as narray import warnings @@ -2180,7 +2180,10 @@ else: cnt = self.count(axis=axis)-ddof danom = self.anom(axis=axis, dtype=dtype) - danom *= danom + if iscomplexobj(self): + danom = umath.absolute(danom)**2 + else: + danom *= danom dvar = narray(danom.sum(axis) / cnt).view(type(self)) if axis is not None: dvar._mask = mask_or(self._mask.all(axis), (cnt==1)) Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-04-07 14:42:50 UTC (rev 4972) +++ trunk/numpy/ma/tests/test_core.py 2008-04-07 18:12:09 UTC (rev 4973) @@ -1006,6 +1006,10 @@ (x,X,XX,m,mx,mX,mXX,m2x,m2X,m2XX) = self.d assert_almost_equal(mX.var(axis=None),mX.compressed().var()) assert_almost_equal(mX.std(axis=None),mX.compressed().std()) + assert_almost_equal(mX.std(axis=None,ddof=1), + mX.compressed().std(ddof=1)) + assert_almost_equal(mX.var(axis=None,ddof=1), + mX.compressed().var(ddof=1)) assert_equal(mXX.var(axis=3).shape,XX.var(axis=3).shape) assert_equal(mX.var().shape,X.var().shape) (mXvar0,mXvar1) = (mX.var(axis=0), mX.var(axis=1)) @@ -1453,6 +1457,56 @@ assert_equal(b.shape, a.shape) assert_equal(b.fill_value, a.fill_value) +class TestArrayMethodsComplex(NumpyTestCase): + "Test class for miscellaneous MaskedArrays methods." + def setUp(self): + "Base data definition." + x = numpy.array([ 8.375j, 7.545j, 8.828j, 8.5j , 1.757j, 5.928, + 8.43 , 7.78 , 9.865, 5.878, 8.979, 4.732, + 3.012, 6.022, 5.095, 3.116, 5.238, 3.957, + 6.04 , 9.63 , 7.712, 3.382, 4.489, 6.479j, + 7.189j, 9.645, 5.395, 4.961, 9.894, 2.893, + 7.357, 9.828, 6.272, 3.758, 6.693, 0.993j]) + X = x.reshape(6,6) + XX = x.reshape(3,2,2,3) + + m = numpy.array([0, 1, 0, 1, 0, 0, + 1, 0, 1, 1, 0, 1, + 0, 0, 0, 1, 0, 1, + 0, 0, 0, 1, 1, 1, + 1, 0, 0, 1, 0, 0, + 0, 0, 1, 0, 1, 0]) + mx = array(data=x,mask=m) + mX = array(data=X,mask=m.reshape(X.shape)) + mXX = array(data=XX,mask=m.reshape(XX.shape)) + + m2 = numpy.array([1, 1, 0, 1, 0, 0, + 1, 1, 1, 1, 0, 1, + 0, 0, 1, 1, 0, 1, + 0, 0, 0, 1, 1, 1, + 1, 0, 0, 1, 1, 0, + 0, 0, 1, 0, 1, 1]) + m2x = array(data=x,mask=m2) + m2X = array(data=X,mask=m2.reshape(X.shape)) + m2XX = array(data=XX,mask=m2.reshape(XX.shape)) + self.d = (x,X,XX,m,mx,mX,mXX,m2x,m2X,m2XX) + + #------------------------------------------------------ + def test_varstd(self): + "Tests var & std on MaskedArrays." + (x,X,XX,m,mx,mX,mXX,m2x,m2X,m2XX) = self.d + assert_almost_equal(mX.var(axis=None),mX.compressed().var()) + assert_almost_equal(mX.std(axis=None),mX.compressed().std()) + assert_equal(mXX.var(axis=3).shape,XX.var(axis=3).shape) + assert_equal(mX.var().shape,X.var().shape) + (mXvar0,mXvar1) = (mX.var(axis=0), mX.var(axis=1)) + assert_almost_equal(mX.var(axis=None,ddof=2),mX.compressed().var(ddof=2)) + assert_almost_equal(mX.std(axis=None,ddof=2),mX.compressed().std(ddof=2)) + for k in range(6): + assert_almost_equal(mXvar1[k],mX[k].compressed().var()) + assert_almost_equal(mXvar0[k],mX[:,k].compressed().var()) + assert_almost_equal(numpy.sqrt(mXvar0[k]), mX[:,k].compressed().std()) + #.............................................................................. class TestMiscFunctions(NumpyTestCase): From numpy-svn at scipy.org Mon Apr 7 17:23:12 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 16:23:12 -0500 (CDT) Subject: [Numpy-svn] r4974 - trunk/numpy/testing Message-ID: <20080407212312.AF52739C27E@new.scipy.org> Author: cdavid Date: 2008-04-07 16:23:10 -0500 (Mon, 07 Apr 2008) New Revision: 4974 Modified: trunk/numpy/testing/utils.py Log: Handling nan values for assert_ functions. Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2008-04-07 18:12:09 UTC (rev 4973) +++ trunk/numpy/testing/utils.py 2008-04-07 21:23:10 UTC (rev 4974) @@ -186,7 +186,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True, header=''): - from numpy.core import asarray + from numpy.core import asarray, isnan x = asarray(x) y = asarray(y) try: @@ -199,7 +199,24 @@ verbose=verbose, header=header, names=('x', 'y')) assert cond, msg - val = comparison(x,y) + if isnan(x) or isnan(y): + # Handling nan: we first check that x and y have the nan at the + # same locations, and then we mask the nan and do the comparison as + # usual. + xnanid = isnan(x) + ynanid = isnan(y) + try: + assert_array_equal(xnanid, ynanid) + except AssertionError: + msg = build_err_msg([x, y], + err_msg + + '\n(x and y nan location mismatch %s, ' + + '%s mismatch)' % (xnanid, ynanid), + verbose=verbose, header=header, + names=('x', 'y')) + val = comparison(x[~xnanid], y[~ynanid]) + else: + val = comparison(x,y) if isinstance(val, bool): cond = val reduced = [0] From numpy-svn at scipy.org Mon Apr 7 17:34:10 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 16:34:10 -0500 (CDT) Subject: [Numpy-svn] r4975 - trunk/numpy/testing Message-ID: <20080407213410.34FFE39C01A@new.scipy.org> Author: cdavid Date: 2008-04-07 16:34:08 -0500 (Mon, 07 Apr 2008) New Revision: 4975 Modified: trunk/numpy/testing/utils.py Log: Fix broken detection of nan in comparison function. Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2008-04-07 21:23:10 UTC (rev 4974) +++ trunk/numpy/testing/utils.py 2008-04-07 21:34:08 UTC (rev 4975) @@ -186,7 +186,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True, header=''): - from numpy.core import asarray, isnan + from numpy.core import asarray, isnan, any x = asarray(x) y = asarray(y) try: @@ -199,7 +199,7 @@ verbose=verbose, header=header, names=('x', 'y')) assert cond, msg - if isnan(x) or isnan(y): + if any(isnan(x)) or any(isnan(y)): # Handling nan: we first check that x and y have the nan at the # same locations, and then we mask the nan and do the comparison as # usual. From numpy-svn at scipy.org Mon Apr 7 18:40:52 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 17:40:52 -0500 (CDT) Subject: [Numpy-svn] r4976 - trunk/numpy/testing Message-ID: <20080407224052.ACECB39C02E@new.scipy.org> Author: cdavid Date: 2008-04-07 17:40:42 -0500 (Mon, 07 Apr 2008) New Revision: 4976 Modified: trunk/numpy/testing/utils.py Log: Revert comparison function; nan handling broken. Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2008-04-07 21:34:08 UTC (rev 4975) +++ trunk/numpy/testing/utils.py 2008-04-07 22:40:42 UTC (rev 4976) @@ -186,7 +186,7 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True, header=''): - from numpy.core import asarray, isnan, any + from numpy.core import asarray x = asarray(x) y = asarray(y) try: @@ -199,24 +199,7 @@ verbose=verbose, header=header, names=('x', 'y')) assert cond, msg - if any(isnan(x)) or any(isnan(y)): - # Handling nan: we first check that x and y have the nan at the - # same locations, and then we mask the nan and do the comparison as - # usual. - xnanid = isnan(x) - ynanid = isnan(y) - try: - assert_array_equal(xnanid, ynanid) - except AssertionError: - msg = build_err_msg([x, y], - err_msg - + '\n(x and y nan location mismatch %s, ' - + '%s mismatch)' % (xnanid, ynanid), - verbose=verbose, header=header, - names=('x', 'y')) - val = comparison(x[~xnanid], y[~ynanid]) - else: - val = comparison(x,y) + val = comparison(x,y) if isinstance(val, bool): cond = val reduced = [0] From numpy-svn at scipy.org Mon Apr 7 19:02:07 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 18:02:07 -0500 (CDT) Subject: [Numpy-svn] r4977 - in trunk/numpy/testing: . tests Message-ID: <20080407230207.E792F39C046@new.scipy.org> Author: cdavid Date: 2008-04-07 18:02:05 -0500 (Mon, 07 Apr 2008) New Revision: 4977 Added: trunk/numpy/testing/tests/ trunk/numpy/testing/tests/test_utils.py Log: Start testing test functions. Added: trunk/numpy/testing/tests/test_utils.py =================================================================== --- trunk/numpy/testing/tests/test_utils.py 2008-04-07 22:40:42 UTC (rev 4976) +++ trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:02:05 UTC (rev 4977) @@ -0,0 +1,30 @@ +import numpy as N +from numpy.testing.utils import * + +class TestEqual: + def _test_equal(self, a, b): + assert_array_equal(a, b) + + def _test_not_equal(self, a, b): + passed = False + try: + assert_array_equal(a, b) + passed = True + except AssertionError: + pass + + if passed: + raise AssertionError("a and b are found equal but are not") + + def test_array_rank1_eq(self): + """Test two equal array are found equal.""" + a = N.array([1, 2]) + b = N.array([1, 2]) + + self._test_equal(a, b) + + def test_array_rank1_noteq(self): + a = N.array([1, 2]) + b = N.array([2, 2]) + + self._test_not_equal(a, b) From numpy-svn at scipy.org Mon Apr 7 19:18:34 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 18:18:34 -0500 (CDT) Subject: [Numpy-svn] r4978 - trunk/numpy/testing Message-ID: <20080407231834.6FCB439C064@new.scipy.org> Author: cdavid Date: 2008-04-07 18:18:32 -0500 (Mon, 07 Apr 2008) New Revision: 4978 Modified: trunk/numpy/testing/setup.py Log: Add the tests in setup file for testing package. Modified: trunk/numpy/testing/setup.py =================================================================== --- trunk/numpy/testing/setup.py 2008-04-07 23:02:05 UTC (rev 4977) +++ trunk/numpy/testing/setup.py 2008-04-07 23:18:32 UTC (rev 4978) @@ -3,6 +3,8 @@ def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('testing',parent_package,top_path) + + config.add_data_dir('tests') return config if __name__ == '__main__': From numpy-svn at scipy.org Mon Apr 7 19:18:49 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 18:18:49 -0500 (CDT) Subject: [Numpy-svn] r4979 - trunk/numpy/testing/tests Message-ID: <20080407231849.609BD39C064@new.scipy.org> Author: cdavid Date: 2008-04-07 18:18:47 -0500 (Mon, 07 Apr 2008) New Revision: 4979 Modified: trunk/numpy/testing/tests/test_utils.py Log: Some more tests for assert_* functions. Modified: trunk/numpy/testing/tests/test_utils.py =================================================================== --- trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:18:32 UTC (rev 4978) +++ trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:18:47 UTC (rev 4979) @@ -17,14 +17,41 @@ raise AssertionError("a and b are found equal but are not") def test_array_rank1_eq(self): - """Test two equal array are found equal.""" + """Test two equal array of rank 1 are found equal.""" a = N.array([1, 2]) b = N.array([1, 2]) self._test_equal(a, b) def test_array_rank1_noteq(self): + """Test two different array of rank 1 are found not equal.""" a = N.array([1, 2]) b = N.array([2, 2]) self._test_not_equal(a, b) + + def test_array_rank2_eq(self): + """Test two equal array of rank 2 are found equal.""" + a = N.array([[1, 2], [3, 4]]) + b = N.array([[1, 2], [3, 4]]) + + self._test_equal(a, b) + + def test_array_diffshape(self): + """Test two arrays with different shapes are found not equal.""" + a = N.array([1, 2]) + b = N.array([[1, 2], [1, 2]]) + + self._test_not_equal(a, b) + + def test_string_arrays(self): + """Test two arrays with different shapes are found not equal.""" + a = N.array(['floupi', 'floupa']) + b = N.array(['floupi', 'floupa']) + + self._test_equal(a, b) + + c = N.array(['floupipi', 'floupa']) + + self._test_not_equal(c, b) + From numpy-svn at scipy.org Mon Apr 7 19:53:18 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 18:53:18 -0500 (CDT) Subject: [Numpy-svn] r4980 - trunk/numpy/testing/tests Message-ID: <20080407235318.4BD5F39C02E@new.scipy.org> Author: cdavid Date: 2008-04-07 18:53:13 -0500 (Mon, 07 Apr 2008) New Revision: 4980 Modified: trunk/numpy/testing/tests/test_utils.py Log: Test assert* funcs for arrays with Nan and rec arrays. Modified: trunk/numpy/testing/tests/test_utils.py =================================================================== --- trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:18:47 UTC (rev 4979) +++ trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:53:13 UTC (rev 4980) @@ -44,6 +44,13 @@ self._test_not_equal(a, b) + def test_nan_array(self): + """Test two arrays with different shapes are found not equal.""" + a = N.array([1, 2]) + b = N.array([[1, 2], [1, 2]]) + + self._test_not_equal(a, b) + def test_string_arrays(self): """Test two arrays with different shapes are found not equal.""" a = N.array(['floupi', 'floupa']) @@ -55,3 +62,18 @@ self._test_not_equal(c, b) + def test_recarrays(self): + """Test record arrays.""" + a = N.empty(2, [('floupi', N.float), ('floupa', N.float)]) + a['floupi'] = [1, 2] + a['floupa'] = [1, 2] + b = a.copy() + + self._test_equal(a, b) + + c = N.empty(2, [('floupipi', N.float), ('floupa', N.float)]) + c['floupipi'] = a['floupi'].copy() + c['floupa'] = a['floupa'].copy() + + self._test_not_equal(c, b) + From numpy-svn at scipy.org Mon Apr 7 19:57:45 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 18:57:45 -0500 (CDT) Subject: [Numpy-svn] r4981 - trunk/numpy/testing/tests Message-ID: <20080407235745.E775539C064@new.scipy.org> Author: cdavid Date: 2008-04-07 18:57:42 -0500 (Mon, 07 Apr 2008) New Revision: 4981 Modified: trunk/numpy/testing/tests/test_utils.py Log: assert* funcs test: add generic test for rank1 arrays for all dtype. Modified: trunk/numpy/testing/tests/test_utils.py =================================================================== --- trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:53:13 UTC (rev 4980) +++ trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:57:42 UTC (rev 4981) @@ -77,3 +77,21 @@ self._test_not_equal(c, b) + def test_generic_rank1(self): + """Test rank 1 array for all dtypes.""" + def foo(t): + a = N.empty(2, t) + a.fill(1) + b = a.copy() + c = a.copy() + c.fill(0) + self._test_equal(a, b) + self._test_not_equal(c, b) + + # Test numeric types and object + for t in '?bhilqpBHILQPfdgFDG': + foo(t) + + # Test strings + for t in ['S1', 'U1']: + foo(t) From numpy-svn at scipy.org Mon Apr 7 19:59:19 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 18:59:19 -0500 (CDT) Subject: [Numpy-svn] r4982 - trunk/numpy/testing/tests Message-ID: <20080407235919.A620639C02E@new.scipy.org> Author: cdavid Date: 2008-04-07 18:59:17 -0500 (Mon, 07 Apr 2008) New Revision: 4982 Modified: trunk/numpy/testing/tests/test_utils.py Log: assert* funcs: Add generic test for rank 3 arrays. Modified: trunk/numpy/testing/tests/test_utils.py =================================================================== --- trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:57:42 UTC (rev 4981) +++ trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:59:17 UTC (rev 4982) @@ -95,3 +95,22 @@ # Test strings for t in ['S1', 'U1']: foo(t) + + def test_generic_rank3(self): + """Test rank 3 array for all dtypes.""" + def foo(t): + a = N.empty((4, 2, 3), t) + a.fill(1) + b = a.copy() + c = a.copy() + c.fill(0) + self._test_equal(a, b) + self._test_not_equal(c, b) + + # Test numeric types and object + for t in '?bhilqpBHILQPfdgFDG': + foo(t) + + # Test strings + for t in ['S1', 'U1']: + foo(t) From numpy-svn at scipy.org Mon Apr 7 20:06:59 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 19:06:59 -0500 (CDT) Subject: [Numpy-svn] r4983 - trunk/numpy/testing/tests Message-ID: <20080408000659.CB9A539C06D@new.scipy.org> Author: cdavid Date: 2008-04-07 19:06:57 -0500 (Mon, 07 Apr 2008) New Revision: 4983 Modified: trunk/numpy/testing/tests/test_utils.py Log: Add basic tests for assert_array_almost_equal. Modified: trunk/numpy/testing/tests/test_utils.py =================================================================== --- trunk/numpy/testing/tests/test_utils.py 2008-04-07 23:59:17 UTC (rev 4982) +++ trunk/numpy/testing/tests/test_utils.py 2008-04-08 00:06:57 UTC (rev 4983) @@ -1,14 +1,17 @@ import numpy as N from numpy.testing.utils import * -class TestEqual: +class _GenericTest: + def __init__(self, assert_func): + self._assert_func = assert_func + def _test_equal(self, a, b): - assert_array_equal(a, b) + self._assert_func(a, b) def _test_not_equal(self, a, b): passed = False try: - assert_array_equal(a, b) + self._assert_func(a, b) passed = True except AssertionError: pass @@ -44,39 +47,10 @@ self._test_not_equal(a, b) - def test_nan_array(self): - """Test two arrays with different shapes are found not equal.""" - a = N.array([1, 2]) - b = N.array([[1, 2], [1, 2]]) +class TestEqual(_GenericTest): + def __init__(self): + _GenericTest.__init__(self, assert_array_equal) - self._test_not_equal(a, b) - - def test_string_arrays(self): - """Test two arrays with different shapes are found not equal.""" - a = N.array(['floupi', 'floupa']) - b = N.array(['floupi', 'floupa']) - - self._test_equal(a, b) - - c = N.array(['floupipi', 'floupa']) - - self._test_not_equal(c, b) - - def test_recarrays(self): - """Test record arrays.""" - a = N.empty(2, [('floupi', N.float), ('floupa', N.float)]) - a['floupi'] = [1, 2] - a['floupa'] = [1, 2] - b = a.copy() - - self._test_equal(a, b) - - c = N.empty(2, [('floupipi', N.float), ('floupa', N.float)]) - c['floupipi'] = a['floupi'].copy() - c['floupa'] = a['floupa'].copy() - - self._test_not_equal(c, b) - def test_generic_rank1(self): """Test rank 1 array for all dtypes.""" def foo(t): @@ -114,3 +88,41 @@ # Test strings for t in ['S1', 'U1']: foo(t) + + def test_nan_array(self): + """Test two arrays with different shapes are found not equal.""" + a = N.array([1, 2]) + b = N.array([[1, 2], [1, 2]]) + + self._test_not_equal(a, b) + + def test_string_arrays(self): + """Test two arrays with different shapes are found not equal.""" + a = N.array(['floupi', 'floupa']) + b = N.array(['floupi', 'floupa']) + + self._test_equal(a, b) + + c = N.array(['floupipi', 'floupa']) + + self._test_not_equal(c, b) + + def test_recarrays(self): + """Test record arrays.""" + a = N.empty(2, [('floupi', N.float), ('floupa', N.float)]) + a['floupi'] = [1, 2] + a['floupa'] = [1, 2] + b = a.copy() + + self._test_equal(a, b) + + c = N.empty(2, [('floupipi', N.float), ('floupa', N.float)]) + c['floupipi'] = a['floupi'].copy() + c['floupa'] = a['floupa'].copy() + + self._test_not_equal(c, b) + + +class TestAlmostEqual(_GenericTest): + def __init__(self): + _GenericTest.__init__(self, assert_array_almost_equal) From numpy-svn at scipy.org Mon Apr 7 20:09:14 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 19:09:14 -0500 (CDT) Subject: [Numpy-svn] r4984 - trunk/numpy/testing Message-ID: <20080408000914.0758539C06D@new.scipy.org> Author: cdavid Date: 2008-04-07 19:09:12 -0500 (Mon, 07 Apr 2008) New Revision: 4984 Modified: trunk/numpy/testing/utils.py Log: Handle nan in assert_array* funcs correctly. All numpy tests pass Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2008-04-08 00:06:57 UTC (rev 4983) +++ trunk/numpy/testing/utils.py 2008-04-08 00:09:12 UTC (rev 4984) @@ -186,9 +186,14 @@ def assert_array_compare(comparison, x, y, err_msg='', verbose=True, header=''): - from numpy.core import asarray + from numpy.core import asarray, isnan, any + from numpy import isreal, iscomplex x = asarray(x) y = asarray(y) + + def isnumber(x): + return x.dtype.char in '?bhilqpBHILQPfdgFDG' + try: cond = (x.shape==() or y.shape==()) or x.shape == y.shape if not cond: @@ -199,7 +204,25 @@ verbose=verbose, header=header, names=('x', 'y')) assert cond, msg - val = comparison(x,y) + + 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 + # same locations, and then we mask the nan and do the comparison as + # usual. + xnanid = isnan(x) + ynanid = isnan(y) + try: + assert_array_equal(xnanid, ynanid) + except AssertionError: + msg = build_err_msg([x, y], + err_msg + + '\n(x and y nan location mismatch %s, ' + + '%s mismatch)' % (xnanid, ynanid), + verbose=verbose, header=header, + names=('x', 'y')) + val = comparison(x[~xnanid], y[~ynanid]) + else: + val = comparison(x,y) if isinstance(val, bool): cond = val reduced = [0] From numpy-svn at scipy.org Mon Apr 7 20:10:50 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 19:10:50 -0500 (CDT) Subject: [Numpy-svn] r4985 - trunk/numpy/testing/tests Message-ID: <20080408001050.C342339C088@new.scipy.org> Author: cdavid Date: 2008-04-07 19:10:47 -0500 (Mon, 07 Apr 2008) New Revision: 4985 Modified: trunk/numpy/testing/tests/ Log: Ignore vim and pyc junk in numpy.testing.tests Property changes on: trunk/numpy/testing/tests ___________________________________________________________________ Name: svn:ignore + *.pyc *.swp From numpy-svn at scipy.org Tue Apr 8 00:56:16 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 7 Apr 2008 23:56:16 -0500 (CDT) Subject: [Numpy-svn] r4986 - in trunk/numpy: . lib lib/tests ma Message-ID: <20080408045616.B218039C07D@new.scipy.org> Author: oliphant Date: 2008-04-07 23:56:12 -0500 (Mon, 07 Apr 2008) New Revision: 4986 Modified: trunk/numpy/__init__.py trunk/numpy/lib/__init__.py trunk/numpy/lib/financial.py trunk/numpy/lib/tests/test_financial.py trunk/numpy/ma/API_CHANGES.txt trunk/numpy/ma/README.txt Log: Add docs and examples for financial functions. Modified: trunk/numpy/__init__.py =================================================================== --- trunk/numpy/__init__.py 2008-04-08 00:10:47 UTC (rev 4985) +++ trunk/numpy/__init__.py 2008-04-08 04:56:12 UTC (rev 4986) @@ -40,7 +40,7 @@ return loader(*packages, **options) import add_newdocs - __all__ = ['add_newdocs',] + __all__ = ['add_newdocs'] pkgload.__doc__ = PackageLoader.__call__.__doc__ import testing Modified: trunk/numpy/lib/__init__.py =================================================================== --- trunk/numpy/lib/__init__.py 2008-04-08 00:10:47 UTC (rev 4985) +++ trunk/numpy/lib/__init__.py 2008-04-08 04:56:12 UTC (rev 4986) @@ -16,6 +16,7 @@ from utils import * from arraysetops import * from io import * +from financial import * import math __all__ = ['emath','math'] @@ -31,6 +32,7 @@ __all__ += utils.__all__ __all__ += arraysetops.__all__ __all__ += io.__all__ +__all__ += financial.__all__ def test(level=1, verbosity=1): from numpy.testing import NumpyTest Modified: trunk/numpy/lib/financial.py =================================================================== --- trunk/numpy/lib/financial.py 2008-04-08 00:10:47 UTC (rev 4985) +++ trunk/numpy/lib/financial.py 2008-04-08 04:56:12 UTC (rev 4986) @@ -1,10 +1,9 @@ # Some simple financial calculations # patterned after spreadsheet computations. -from numpy import log, where import numpy as np -__all__ = ['fv', 'pmt', 'nper', 'ipmt', 'ppmt', 'pv', 'rate', 'irr', 'npv', - 'mirr'] +__all__ = ['fv', 'pmt', 'nper', 'ipmt', 'ppmt', 'pv', 'rate', + 'irr', 'npv', 'mirr'] _when_to_num = {'end':0, 'begin':1, 'e':0, 'b':1, @@ -15,6 +14,14 @@ 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 : @@ -26,51 +33,102 @@ pv : Present value fv : - Future value + Future value when : When payments are due ('begin' (1) or 'end' (0)) - nper / (1 + rate*when) \ / nper \ - fv + pv*(1+rate) + pmt*|-------------------|*| (1+rate) - 1 | = 0 - \ rate / \ / - - fv + pv + pmt * nper = 0 (when rate == 0) """ +def _convert_when(when): + try: + return _when_to_num[when] + except KeyError: + return [_when_to_num[x] for x in when] + + def fv(rate, nper, pmt, pv, when='end'): """future value computed by solving the equation - - %s - """ % eqstr - when = _when_to_num[when] + """ + when = _convert_when(when) + rate, nper, pmt, pv, when = map(np.asarray, [rate, nper, pmt, pv, when]) temp = (1+rate)**nper - fact = where(rate==0.0, nper, (1+rate*when)*(temp-1)/rate) + miter = np.broadcast(rate, nper, pmt, pv, when) + 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? + +>>> 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'): """Payment computed by solving the equation - - %s - """ % eqstr - when = _when_to_num[when] + """ + when = _convert_when(when) + rate, nper, pv, fv, when = map(np.asarray, [rate, nper, pv, fv, when]) temp = (1+rate)**nper - fact = where(rate==0.0, nper, (1+rate*when)*(temp-1)/rate) + miter = np.broadcast(rate, nper, pv, fv, when) + 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 + """ +Example +------- +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%? + +>>> 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'): """Number of periods found by solving the equation - - %s - """ % eqstr - when = _when_to_num[when] + """ + when = _convert_when(when) + rate, pmt, pv, fv, when = map(np.asarray, [rate, pmt, pv, fv, when]) try: z = pmt*(1.0+rate*when)/rate except ZeroDivisionError: z = 0.0 A = -(fv + pv)/(pmt+0.0) - B = (log(fv-z) - log(pv-z))/log(1.0+rate) - return where(rate==0.0, A, B) + 0.0 + B = np.log((-fv+z) / (pv+z))/np.log(1.0+rate) + 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 + """ +Example +------- +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? + +>>> 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. + +>>> nper(*(ogrid[0.06/12:0.071/12:0.005/12, -100:-201:50, 6000:8000:1000])) + +""" + def ipmt(rate, per, nper, pv, fv=0.0, when='end'): raise NotImplementedError @@ -80,13 +138,15 @@ def pv(rate, nper, pmt, fv=0.0, when='end'): """Number of periods found by solving the equation - - %s - """ % eqstr - when = _when_to_num[when] + """ + when = _convert_when(when) + rate, nper, pmt, fv, when = map(np.asarray, [rate, nper, pmt, fv, when]) temp = (1+rate)**nper - fact = where(rate == 0.0, nper, (1+rate*when)*(temp-1)/rate) + miter = np.broadcast(rate, nper, pmt, fv, when) + 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) @@ -105,10 +165,9 @@ # g'(r) is the derivative with respect to r. def rate(nper, pmt, pv, fv, when='end', guess=0.10, tol=1e-6, maxiter=100): """Number of periods found by solving the equation - - %s - """ % eqstr - when = _when_to_num[when] + """ + when = _convert_when(when) + nper, pmt, pv, fv, when = map(np.asarray, [nper, pmt, pv, fv, when]) rn = guess iter = 0 close = False @@ -123,6 +182,7 @@ return np.nan + rn else: return rn +rate.__doc__ += eqstr def irr(values): """Internal Rate of Return Modified: trunk/numpy/lib/tests/test_financial.py =================================================================== --- trunk/numpy/lib/tests/test_financial.py 2008-04-08 00:10:47 UTC (rev 4985) +++ trunk/numpy/lib/tests/test_financial.py 2008-04-08 04:56:12 UTC (rev 4986) @@ -1,5 +1,5 @@ """ -from numpy.lib.financial import * +from numpy import * >>> rate(10,0,-3500,10000) 0.11069085371426901 Modified: trunk/numpy/ma/API_CHANGES.txt =================================================================== --- trunk/numpy/ma/API_CHANGES.txt 2008-04-08 00:10:47 UTC (rev 4985) +++ trunk/numpy/ma/API_CHANGES.txt 2008-04-08 04:56:12 UTC (rev 4986) @@ -127,12 +127,4 @@ The ``anom`` method returns the deviations from the average (anomalies). -``varu`` and ``stdu`` ---------------------- -These methods return unbiased estimates of the variance and standard deviation -respectively. An unbiased estimate is obtained by dividing the sum of the -squared anomalies by ``n-1`` instead of ``n`` for the biased estimates, where -``n`` is the number of unmasked elements along the given axis. - - Modified: trunk/numpy/ma/README.txt =================================================================== --- trunk/numpy/ma/README.txt 2008-04-08 00:10:47 UTC (rev 4985) +++ trunk/numpy/ma/README.txt 2008-04-08 04:56:12 UTC (rev 4986) @@ -74,7 +74,6 @@ * the *mr_* function mimics *r_* for masked arrays. * the *anom* method returns the anomalies (deviations from the average) - * the *stdu* and *varu* return unbiased estimates of the standard deviation and variance, respectively. Using the new package with numpy.core.ma ---------------------------------------- From numpy-svn at scipy.org Tue Apr 8 01:02:04 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 8 Apr 2008 00:02:04 -0500 (CDT) Subject: [Numpy-svn] r4987 - trunk/numpy/lib Message-ID: <20080408050204.A1C1B39C091@new.scipy.org> Author: oliphant Date: 2008-04-08 00:02:03 -0500 (Tue, 08 Apr 2008) New Revision: 4987 Modified: trunk/numpy/lib/financial.py Log: Improve comments. Modified: trunk/numpy/lib/financial.py =================================================================== --- trunk/numpy/lib/financial.py 2008-04-08 04:56:12 UTC (rev 4986) +++ trunk/numpy/lib/financial.py 2008-04-08 05:02:03 UTC (rev 4987) @@ -1,5 +1,10 @@ # Some simple financial calculations # patterned after spreadsheet computations. + +# There is some complexity in each function +# so that the functions behave like ufuncs with +# broadcasting and being able to be called with scalars +# or arrays (or other sequences). import numpy as np __all__ = ['fv', 'pmt', 'nper', 'ipmt', 'ppmt', 'pv', 'rate', @@ -125,8 +130,12 @@ The same analysis could be done with several different interest rates and/or payments and/or total amounts to produce an entire table. ->>> nper(*(ogrid[0.06/12:0.071/12:0.005/12, -100:-201:50, 6000:8000:1000])) +>>> nper(*(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'): From numpy-svn at scipy.org Tue Apr 8 14:04:39 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 8 Apr 2008 13:04:39 -0500 (CDT) Subject: [Numpy-svn] r4988 - in trunk/numpy/testing: . tests Message-ID: <20080408180439.86A7639C2A2@new.scipy.org> Author: cdavid Date: 2008-04-08 13:04:33 -0500 (Tue, 08 Apr 2008) New Revision: 4988 Modified: trunk/numpy/testing/tests/test_utils.py trunk/numpy/testing/utils.py Log: Fix test for assert* with nan values + string formatting issue when handling nan. Modified: trunk/numpy/testing/tests/test_utils.py =================================================================== --- trunk/numpy/testing/tests/test_utils.py 2008-04-08 05:02:03 UTC (rev 4987) +++ trunk/numpy/testing/tests/test_utils.py 2008-04-08 18:04:33 UTC (rev 4988) @@ -90,12 +90,15 @@ foo(t) def test_nan_array(self): - """Test two arrays with different shapes are found not equal.""" - a = N.array([1, 2]) - b = N.array([[1, 2], [1, 2]]) + """Test arrays with nan values in them.""" + a = N.array([1, 2, N.nan]) + b = N.array([1, 2, N.nan]) - self._test_not_equal(a, b) + self._test_equal(a, b) + c = N.array([1, 2, 3]) + self._test_not_equal(c, b) + def test_string_arrays(self): """Test two arrays with different shapes are found not equal.""" a = N.array(['floupi', 'floupa']) Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2008-04-08 05:02:03 UTC (rev 4987) +++ trunk/numpy/testing/utils.py 2008-04-08 18:04:33 UTC (rev 4988) @@ -216,8 +216,8 @@ except AssertionError: msg = build_err_msg([x, y], err_msg - + '\n(x and y nan location mismatch %s, ' - + '%s mismatch)' % (xnanid, ynanid), + + '\n(x and y nan location mismatch %s, ' \ + '%s mismatch)' % (xnanid, ynanid), verbose=verbose, header=header, names=('x', 'y')) val = comparison(x[~xnanid], y[~ynanid]) From numpy-svn at scipy.org Tue Apr 8 14:49:23 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 8 Apr 2008 13:49:23 -0500 (CDT) Subject: [Numpy-svn] r4989 - in trunk/numpy/linalg: . tests Message-ID: <20080408184923.6A45D39C0BE@new.scipy.org> Author: peridot Date: 2008-04-08 13:49:18 -0500 (Tue, 08 Apr 2008) New Revision: 4989 Modified: trunk/numpy/linalg/linalg.py trunk/numpy/linalg/tests/test_linalg.py Log: Added function for computing condition number, with tests and docs; closes #622. Modified: trunk/numpy/linalg/linalg.py =================================================================== --- trunk/numpy/linalg/linalg.py 2008-04-08 18:04:33 UTC (rev 4988) +++ trunk/numpy/linalg/linalg.py 2008-04-08 18:49:18 UTC (rev 4989) @@ -16,6 +16,7 @@ 'det', 'svd', 'eig', 'eigh','lstsq', 'norm', 'qr', + 'cond', 'LinAlgError' ] @@ -968,6 +969,43 @@ else: return s +def cond(x,p=None): + """Compute the condition number of a matrix. + + The condition number of x is the norm of x times the norm + of the inverse of x. The norm can be the usual L2 + (root-of-sum-of-squares) norm or a number of other matrix norms. + + Parameters + ---------- + x : array, shape (M, N) + The matrix whose condition number is sought. + p : {None, 1, -1, 2, -2, inf, -inf, 'fro'} + Order of the norm: + + p norm for matrices + ===== ============================ + None 2-norm, computed directly using the SVD + 'fro' Frobenius norm + inf max(sum(abs(x), axis=1)) + -inf min(sum(abs(x), axis=1)) + 1 max(sum(abs(x), axis=0)) + -1 min(sum(abs(x), axis=0)) + 2 2-norm (largest sing. value) + -2 smallest singular value + ===== ============================ + + Returns + ------- + c : float + The condition number of the matrix. May be infinite. + """ + if p is None: + s = svd(x,compute_uv=False) + return s[0]/s[-1] + else: + return norm(x,p)*norm(inv(x),p) + # Generalized inverse def pinv(a, rcond=1e-15 ): Modified: trunk/numpy/linalg/tests/test_linalg.py =================================================================== --- trunk/numpy/linalg/tests/test_linalg.py 2008-04-08 18:04:33 UTC (rev 4988) +++ trunk/numpy/linalg/tests/test_linalg.py 2008-04-08 18:49:18 UTC (rev 4989) @@ -4,7 +4,7 @@ from numpy.testing import * set_package_path() from numpy import array, single, double, csingle, cdouble, dot, identity, \ - multiply, atleast_2d + multiply, atleast_2d, inf from numpy import linalg from linalg import matrix_power restore_path() @@ -73,6 +73,21 @@ u, s, vt = linalg.svd(a, 0) assert_almost_equal(a, dot(u*s, vt)) +class TestCondSVD(LinalgTestCase): + def do(self, a, b): + s = linalg.svd(a, compute_uv=False) + old_assert_almost_equal(s[0]/s[-1], linalg.cond(a), decimal=5) + +class TestCond2(LinalgTestCase): + def do(self, a, b): + s = linalg.svd(a, compute_uv=False) + old_assert_almost_equal(s[0]/s[-1], linalg.cond(a,2), decimal=5) + +class TestCondInf(NumpyTestCase): + def test(self): + A = array([[1.,0,0],[0,-2.,0],[0,0,3.]]) + assert_almost_equal(linalg.cond(A,inf),3.) + class TestPinv(LinalgTestCase): def do(self, a, b): a_ginv = linalg.pinv(a) From numpy-svn at scipy.org Tue Apr 8 16:43:09 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 8 Apr 2008 15:43:09 -0500 (CDT) Subject: [Numpy-svn] r4990 - in trunk/numpy/lib: . tests Message-ID: <20080408204309.B9B7D39C2A9@new.scipy.org> Author: oliphant Date: 2008-04-08 15:43:07 -0500 (Tue, 08 Apr 2008) New Revision: 4990 Modified: trunk/numpy/lib/financial.py trunk/numpy/lib/tests/test_financial.py Log: Fix doc-tests for financial.py so they don't rely on floating-point exactness. Start filling in final function. Modified: trunk/numpy/lib/financial.py =================================================================== --- trunk/numpy/lib/financial.py 2008-04-08 18:49:18 UTC (rev 4989) +++ trunk/numpy/lib/financial.py 2008-04-08 20:43:07 UTC (rev 4990) @@ -139,11 +139,13 @@ """ def ipmt(rate, per, nper, pv, fv=0.0, when='end'): + total = pmt(rate, nper, pv, fv, when) + # Now, compute the nth step in the amortization raise NotImplementedError - def ppmt(rate, per, nper, pv, fv=0.0, when='end'): - raise NotImplementedError + total = pmt(rate, nper, pv, fv, when) + return total - ipmt(rate, per, nper, pv, fv, when) def pv(rate, nper, pmt, fv=0.0, when='end'): """Number of periods found by solving the equation Modified: trunk/numpy/lib/tests/test_financial.py =================================================================== --- trunk/numpy/lib/tests/test_financial.py 2008-04-08 18:49:18 UTC (rev 4989) +++ trunk/numpy/lib/tests/test_financial.py 2008-04-08 20:43:07 UTC (rev 4990) @@ -1,32 +1,32 @@ """ -from numpy import * +>>> from numpy import rate, irr, pv, fv, pmt, nper, npv, mirr, round ->>> rate(10,0,-3500,10000) -0.11069085371426901 +>>> round(rate(10,0,-3500,10000),4)==0.1107 +True ->>> irr([-150000, 15000, 25000, 35000, 45000, 60000]) -0.052432888859414106 +>>> round(irr([-150000, 15000, 25000, 35000, 45000, 60000]),4)==0.0524 +True ->>> pv(0.07,20,12000,0) --127128.17094619398 +>>> round(pv(0.07,20,12000,0),2) == -127128.17 +True ->>> fv(0.075, 20, -2000,0,0) -86609.362673042924 +>>> round(fv(0.075, 20, -2000,0,0),2) == 86609.36 +True ->>> pmt(0.08/12,5*12,15000) --304.14591432620773 +>>> round(pmt(0.08/12,5*12,15000),3) == -304.146 +True ->>> nper(0.075,-2000,0,100000.) -21.544944197323336 +>>> round(nper(0.075,-2000,0,100000.),2) == 21.54 +True ->>> npv(0.05,[-15000,1500,2500,3500,4500,6000]) -117.04271900089589 +>>> round(npv(0.05,[-15000,1500,2500,3500,4500,6000]),2) == 117.04 +True ->>> mirr([-4500,-800,800,800,600,600,800,800,700,3000],0.08,0.055) -0.066471183500200537 +>>> round(mirr([-4500,-800,800,800,600,600,800,800,700,3000],0.08,0.055),4) == 0.0665 +True ->>> mirr([-120000,39000,30000,21000,37000,46000],0.10,0.12) -0.13439316981387006 +>>> round(mirr([-120000,39000,30000,21000,37000,46000],0.10,0.12),4)==0.1344 +True """ from numpy.testing import * From numpy-svn at scipy.org Tue Apr 8 20:16:18 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 8 Apr 2008 19:16:18 -0500 (CDT) Subject: [Numpy-svn] r4991 - trunk/numpy/core Message-ID: <20080409001618.17E0C39C035@new.scipy.org> Author: oliphant Date: 2008-04-08 19:16:09 -0500 (Tue, 08 Apr 2008) New Revision: 4991 Modified: trunk/numpy/core/numeric.py Log: Improve empty_like and zeros_like to respect sub-type. Modified: trunk/numpy/core/numeric.py =================================================================== --- trunk/numpy/core/numeric.py 2008-04-08 20:43:07 UTC (rev 4990) +++ trunk/numpy/core/numeric.py 2008-04-09 00:16:09 UTC (rev 4991) @@ -37,26 +37,33 @@ ALLOW_THREADS = multiarray.ALLOW_THREADS BUFSIZE = multiarray.BUFSIZE +ndarray = multiarray.ndarray +flatiter = multiarray.flatiter +broadcast = multiarray.broadcast +dtype = multiarray.dtype +ufunc = type(sin) -# from Fernando Perez's IPython + +# originally from Fernando Perez's IPython def zeros_like(a): """Return an array of zeros of the shape and data-type of a. If you don't explicitly need the array to be zeroed, you should instead - use empty_like(), which is faster as it only allocates memory. + use empty_like(), which is a bit faster as it only allocates memory. """ + if isinstance(a, ndarray): + res = ndarray.__new__(type(a), a.shape, a.dtype, order=a.flags.fnc) + res.fill(0) + return res try: - return zeros(a.shape, a.dtype, a.flags.fnc) + wrap = a.__array_wrap__ except AttributeError: - try: - wrap = a.__array_wrap__ - except AttributeError: - wrap = None - a = asarray(a) - res = zeros(a.shape, a.dtype) - if wrap: - res = wrap(res) - return res + wrap = None + a = asarray(a) + res = zeros(a.shape, a.dtype) + if wrap: + res = wrap(res) + return res def empty_like(a): """Return an empty (uninitialized) array of the shape and data-type of a. @@ -65,18 +72,18 @@ your array to be initialized, you should use zeros_like(). """ + if isinstance(a, ndarray): + res = ndarray.__new__(type(a), a.shape, a.dtype, order=a.flags.fnc) + return res try: - return empty(a.shape, a.dtype, a.flags.fnc) + wrap = a.__array_wrap__ except AttributeError: - try: - wrap = a.__array_wrap__ - except AttributeError: - wrap = None - a = asarray(a) - res = empty(a.shape, a.dtype) - if wrap: - res = wrap(res) - return res + wrap = None + a = asarray(a) + res = empty(a.shape, a.dtype) + if wrap: + res = wrap(res) + return res # end Fernando's utilities @@ -98,11 +105,6 @@ newaxis = None -ndarray = multiarray.ndarray -flatiter = multiarray.flatiter -broadcast = multiarray.broadcast -dtype = multiarray.dtype -ufunc = type(sin) arange = multiarray.arange array = multiarray.array From numpy-svn at scipy.org Tue Apr 8 20:56:45 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 8 Apr 2008 19:56:45 -0500 (CDT) Subject: [Numpy-svn] r4992 - trunk/numpy/lib Message-ID: <20080409005645.E1D2439C06C@new.scipy.org> Author: dhuard Date: 2008-04-08 19:56:39 -0500 (Tue, 08 Apr 2008) New Revision: 4992 Modified: trunk/numpy/lib/io.py Log: Formatted the docstring. Added comment regarding the handling of missing values. Addresses ticket #717. Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2008-04-09 00:16:09 UTC (rev 4991) +++ trunk/numpy/lib/io.py 2008-04-09 00:56:39 UTC (rev 4992) @@ -224,51 +224,49 @@ The data must be regular, same number of values in every row - fname can be a filename or a file handle. Support for gzipped files is - automatic, if the filename ends in .gz + Parameters + ---------- + fname : filename or a file handle. + Support for gzipped files is automatic, if the filename ends in .gz - See scipy.io.loadmat to read and write matfiles. + dtype : data-type + Data type of the resulting array. If this is a record data-type, the + resulting array will be 1-d and each row will be interpreted as an + element of the array. The number of columns used must match the number + of fields in the data-type in this case. - Example usage: + comments : str + The character used to indicate the start of a comment in the file. - X = loadtxt('test.dat') # data in two columns - t = X[:,0] - y = X[:,1] + delimiter : str + A string-like character used to separate values in the file. If delimiter + is unspecified or none, any whitespace string is a separator. - Alternatively, you can do the same with "unpack"; see below + converters : {} + A dictionary mapping column number to a function that will convert that + column to a float. Eg, if column 0 is a date string: + converters={0:datestr2num}. Converters can also be used to provide + a default value for missing data: converters={3:lambda s: float(s or 0)}. + + skiprows : int + The number of rows from the top to skip. - X = loadtxt('test.dat') # a matrix of data - x = loadtxt('test.dat') # a single column of data + usecols : sequence + A sequence of integer column indexes to extract where 0 is the first + column, eg. usecols=(1,4,5) will extract the 2nd, 5th and 6th columns. + unpack : bool + If True, will transpose the matrix allowing you to unpack into named + arguments on the left hand side. - dtype - the data-type of the resulting array. If this is a - record data-type, the the resulting array will be 1-d and each row will - be interpreted as an element of the array. The number of columns - used must match the number of fields in the data-type in this case. - - comments - the character used to indicate the start of a comment - in the file - - delimiter is a string-like character used to seperate values in the - file. If delimiter is unspecified or none, any whitespace string is - a separator. - - converters, if not None, is a dictionary mapping column number to - a function that will convert that column to a float. Eg, if - column 0 is a date string: converters={0:datestr2num} - - skiprows is the number of rows from the top to skip - - usecols, if not None, is a sequence of integer column indexes to - extract where 0 is the first column, eg usecols=(1,4,5) to extract - just the 2nd, 5th and 6th columns - - unpack, if True, will transpose the matrix allowing you to unpack - into named arguments on the left hand side - - t,y = load('test.dat', unpack=True) # for two column data - x,y,z = load('somefile.dat', usecols=(3,5,7), unpack=True) - + Examples + -------- + >>> X = loadtxt('test.dat') # data in two columns + >>> x,y,z = load('somefile.dat', usecols=(3,5,7), unpack=True) + >>> r = np.loadtxt('record.dat', dtype={'names':('gender','age','weight'), + 'formats': ('S1','i4', 'f4')}) + + SeeAlso: scipy.io.loadmat to read and write matfiles. """ if _string_like(fname): From numpy-svn at scipy.org Tue Apr 8 20:57:27 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 8 Apr 2008 19:57:27 -0500 (CDT) Subject: [Numpy-svn] r4993 - trunk/numpy/lib/tests Message-ID: <20080409005727.3727F39C06C@new.scipy.org> Author: dhuard Date: 2008-04-08 19:57:23 -0500 (Tue, 08 Apr 2008) New Revision: 4993 Modified: trunk/numpy/lib/tests/test_io.py Log: Added test for handling missing data using loadtxt. Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2008-04-09 00:56:39 UTC (rev 4992) +++ trunk/numpy/lib/tests/test_io.py 2008-04-09 00:57:23 UTC (rev 4993) @@ -72,6 +72,24 @@ x = np.loadtxt(c, dtype=int) a = np.array([1,2,3,4], int) assert_array_equal(x, a) + + c = StringIO.StringIO() + c.write('1,2,3,4\n') + c.seek(0) + x = np.loadtxt(c, dtype=int, delimiter=',') + a = np.array([1,2,3,4], int) + assert_array_equal(x, a) + + + def test_missing(self): + c = StringIO.StringIO() + c.write('1,2,3,,5\n') + c.seek(0) + x = np.loadtxt(c, dtype=int, delimiter=',', \ + converters={3:lambda s: int(s or -999)}) + a = np.array([1,2,3,-999,5], int) + assert_array_equal(x, a) + if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Tue Apr 8 21:55:00 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 8 Apr 2008 20:55:00 -0500 (CDT) Subject: [Numpy-svn] r4994 - in trunk/numpy/doc: . cython pyrex Message-ID: <20080409015500.7E87439C254@new.scipy.org> Author: fperez Date: 2008-04-08 20:54:54 -0500 (Tue, 08 Apr 2008) New Revision: 4994 Added: trunk/numpy/doc/cython/ trunk/numpy/doc/cython/MANIFEST trunk/numpy/doc/cython/Makefile trunk/numpy/doc/cython/Python.pxi trunk/numpy/doc/cython/README.txt trunk/numpy/doc/cython/numpy.pxi trunk/numpy/doc/cython/numpyx.pyx trunk/numpy/doc/cython/run_test.py trunk/numpy/doc/cython/setup.py trunk/numpy/doc/pyrex/README.txt Modified: trunk/numpy/doc/pyrex/numpyx.pyx trunk/numpy/doc/pyrex/setup.py Log: Add up to date (and slightly cleaned up) support for Cython after porting the existing Pyrex one, put in deprecation markers in the old Pyrex dir. The pyrex dir can be removed in a subsequent commit. Added: trunk/numpy/doc/cython/MANIFEST =================================================================== --- trunk/numpy/doc/cython/MANIFEST 2008-04-09 00:57:23 UTC (rev 4993) +++ trunk/numpy/doc/cython/MANIFEST 2008-04-09 01:54:54 UTC (rev 4994) @@ -0,0 +1,2 @@ +numpyx.pyx +setup.py Added: trunk/numpy/doc/cython/Makefile =================================================================== --- trunk/numpy/doc/cython/Makefile 2008-04-09 00:57:23 UTC (rev 4993) +++ trunk/numpy/doc/cython/Makefile 2008-04-09 01:54:54 UTC (rev 4994) @@ -0,0 +1,37 @@ +# Simple makefile to quickly access handy build commands for Cython extension +# code generation. Note that the actual code to produce the extension lives in +# the setup.py file, this Makefile is just meant as a command +# convenience/reminder while doing development. + +help: + @echo "Numpy/Cython tasks. Available tasks:" + @echo "ext -> build the Cython extension module." + @echo "html -> create annotated HTML from the .pyx sources" + @echo "test -> run a simple test demo." + @echo "all -> Call ext, html and finally test." + +all: ext html test + +ext: numpyx.so + +test: ext + python run_test.py + +html: numpyx.pyx.html + +numpyx.so: numpyx.pyx numpyx.c + python setup.py build_ext --inplace + +numpyx.pyx.html: numpyx.pyx + cython -a numpyx.pyx + @echo "Annotated HTML of the C code generated in numpy.pyx.html" + +# Phony targets for cleanup and similar uses + +.PHONY: clean +clean: + rm -rf *~ *.so *.c *.o *.html build + +# Suffix rules +%.c : %.pyx + cython $< Added: trunk/numpy/doc/cython/Python.pxi =================================================================== --- trunk/numpy/doc/cython/Python.pxi 2008-04-09 00:57:23 UTC (rev 4993) +++ trunk/numpy/doc/cython/Python.pxi 2008-04-09 01:54:54 UTC (rev 4994) @@ -0,0 +1,62 @@ +# :Author: Robert Kern +# :Copyright: 2004, Enthought, Inc. +# :License: BSD Style + + +cdef extern from "Python.h": + # Not part of the Python API, but we might as well define it here. + # Note that the exact type doesn't actually matter for Pyrex. + ctypedef int size_t + + # Some type declarations we need + ctypedef int Py_intptr_t + + + # String API + char* PyString_AsString(object string) + char* PyString_AS_STRING(object string) + object PyString_FromString(char* c_string) + object PyString_FromStringAndSize(char* c_string, int length) + object PyString_InternFromString(char *v) + + # Float API + object PyFloat_FromDouble(double v) + double PyFloat_AsDouble(object ob) + long PyInt_AsLong(object ob) + + + # Memory API + void* PyMem_Malloc(size_t n) + void* PyMem_Realloc(void* buf, size_t n) + void PyMem_Free(void* buf) + + void Py_DECREF(object obj) + void Py_XDECREF(object obj) + void Py_INCREF(object obj) + void Py_XINCREF(object obj) + + # CObject API + ctypedef void (*destructor1)(void* cobj) + ctypedef void (*destructor2)(void* cobj, void* desc) + int PyCObject_Check(object p) + object PyCObject_FromVoidPtr(void* cobj, destructor1 destr) + object PyCObject_FromVoidPtrAndDesc(void* cobj, void* desc, + destructor2 destr) + void* PyCObject_AsVoidPtr(object self) + void* PyCObject_GetDesc(object self) + int PyCObject_SetVoidPtr(object self, void* cobj) + + # TypeCheck API + int PyFloat_Check(object obj) + int PyInt_Check(object obj) + + # Error API + int PyErr_Occurred() + void PyErr_Clear() + int PyErr_CheckSignals() + +cdef extern from "string.h": + void *memcpy(void *s1, void *s2, int n) + +cdef extern from "math.h": + double fabs(double x) Added: trunk/numpy/doc/cython/README.txt =================================================================== --- trunk/numpy/doc/cython/README.txt 2008-04-09 00:57:23 UTC (rev 4993) +++ trunk/numpy/doc/cython/README.txt 2008-04-09 01:54:54 UTC (rev 4994) @@ -0,0 +1,20 @@ +================== + NumPy and Cython +================== + +This directory contains a small example of how to use NumPy and Cython +together. While much work is planned for the Summer of 2008 as part of the +Google Summer of Code project to improve integration between the two, even +today Cython can be used effectively to write optimized code that accesses +NumPy arrays. + +The example provided is just a stub showing how to build an extension and +access the array objects; improvements to this to show more sophisticated tasks +are welcome. + +To run it locally, simply type:: + + make help + +which shows you the currently available targets (these are just handy +shorthands for common commands). \ No newline at end of file Added: trunk/numpy/doc/cython/numpy.pxi =================================================================== --- trunk/numpy/doc/cython/numpy.pxi 2008-04-09 00:57:23 UTC (rev 4993) +++ trunk/numpy/doc/cython/numpy.pxi 2008-04-09 01:54:54 UTC (rev 4994) @@ -0,0 +1,133 @@ +# :Author: Travis Oliphant + +cdef extern from "numpy/arrayobject.h": + + cdef enum NPY_TYPES: + NPY_BOOL + NPY_BYTE + NPY_UBYTE + NPY_SHORT + NPY_USHORT + NPY_INT + NPY_UINT + NPY_LONG + NPY_ULONG + NPY_LONGLONG + NPY_ULONGLONG + NPY_FLOAT + NPY_DOUBLE + NPY_LONGDOUBLE + NPY_CFLOAT + NPY_CDOUBLE + NPY_CLONGDOUBLE + NPY_OBJECT + NPY_STRING + NPY_UNICODE + NPY_VOID + NPY_NTYPES + NPY_NOTYPE + + cdef enum requirements: + NPY_CONTIGUOUS + NPY_FORTRAN + NPY_OWNDATA + NPY_FORCECAST + NPY_ENSURECOPY + NPY_ENSUREARRAY + NPY_ELEMENTSTRIDES + NPY_ALIGNED + NPY_NOTSWAPPED + NPY_WRITEABLE + NPY_UPDATEIFCOPY + NPY_ARR_HAS_DESCR + + NPY_BEHAVED + NPY_BEHAVED_NS + NPY_CARRAY + NPY_CARRAY_RO + NPY_FARRAY + NPY_FARRAY_RO + NPY_DEFAULT + + NPY_IN_ARRAY + NPY_OUT_ARRAY + NPY_INOUT_ARRAY + NPY_IN_FARRAY + NPY_OUT_FARRAY + NPY_INOUT_FARRAY + + NPY_UPDATE_ALL + + cdef enum defines: + NPY_MAXDIMS + + ctypedef struct npy_cdouble: + double real + double imag + + ctypedef struct npy_cfloat: + double real + double imag + + ctypedef int npy_intp + + ctypedef extern class numpy.dtype [object PyArray_Descr]: + cdef int type_num, elsize, alignment + cdef char type, kind, byteorder, hasobject + cdef object fields, typeobj + + ctypedef extern class numpy.ndarray [object PyArrayObject]: + cdef char *data + cdef int nd + cdef npy_intp *dimensions + cdef npy_intp *strides + cdef object base + cdef dtype descr + cdef int flags + + ctypedef extern class numpy.flatiter [object PyArrayIterObject]: + cdef int nd_m1 + cdef npy_intp index, size + cdef ndarray ao + cdef char *dataptr + + ctypedef extern class numpy.broadcast [object PyArrayMultiIterObject]: + cdef int numiter + cdef npy_intp size, index + cdef int nd + cdef npy_intp *dimensions + cdef void **iters + + object PyArray_ZEROS(int ndims, npy_intp* dims, NPY_TYPES type_num, int fortran) + object PyArray_EMPTY(int ndims, npy_intp* dims, NPY_TYPES type_num, int fortran) + dtype PyArray_DescrFromTypeNum(NPY_TYPES type_num) + object PyArray_SimpleNew(int ndims, npy_intp* dims, NPY_TYPES type_num) + int PyArray_Check(object obj) + object PyArray_ContiguousFromAny(object obj, NPY_TYPES type, + int mindim, int maxdim) + object PyArray_ContiguousFromObject(object obj, NPY_TYPES type, + int mindim, int maxdim) + npy_intp PyArray_SIZE(ndarray arr) + npy_intp PyArray_NBYTES(ndarray arr) + void *PyArray_DATA(ndarray arr) + object PyArray_FromAny(object obj, dtype newtype, int mindim, int maxdim, + int requirements, object context) + object PyArray_FROMANY(object obj, NPY_TYPES type_num, int min, + int max, int requirements) + object PyArray_NewFromDescr(object subtype, dtype newtype, int nd, + npy_intp* dims, npy_intp* strides, void* data, + int flags, object parent) + + object PyArray_FROM_OTF(object obj, NPY_TYPES type, int flags) + object PyArray_EnsureArray(object) + + object PyArray_MultiIterNew(int n, ...) + + char *PyArray_MultiIter_DATA(broadcast multi, int i) + void PyArray_MultiIter_NEXTi(broadcast multi, int i) + void PyArray_MultiIter_NEXT(broadcast multi) + + object PyArray_IterNew(object arr) + void PyArray_ITER_NEXT(flatiter it) + + void import_array() Added: trunk/numpy/doc/cython/numpyx.pyx =================================================================== --- trunk/numpy/doc/cython/numpyx.pyx 2008-04-09 00:57:23 UTC (rev 4993) +++ trunk/numpy/doc/cython/numpyx.pyx 2008-04-09 01:54:54 UTC (rev 4994) @@ -0,0 +1,118 @@ +# -*- Mode: Python -*- Not really, but close enough +"""Cython access to Numpy arrays - simple example. +""" + +# Includes from the python headers +include "Python.pxi" +# Include the Numpy C API for use via Cython extension code +include "numpy.pxi" + +################################################ +# Initialize numpy - this MUST be done before any other code is executed. +import_array() + +# Import the Numpy module for access to its usual Python API +import numpy as np + + +# A 'def' function is visible in the Python-imported module +def print_array_info(ndarray arr): + """Simple information printer about an array. + + Code meant to illustrate Cython/NumPy integration only.""" + + cdef int i + + print '-='*10 + # Note: the double cast here (void * first, then Py_intptr_t) is needed in + # Cython but not in Pyrex, since the casting behavior of cython is slightly + # different (and generally safer) than that of Pyrex. In this case, we + # just want the memory address of the actual Array object, so we cast it to + # void before doing the Py_intptr_t cast: + print 'Printing array info for ndarray at 0x%0lx'% \ + (arr,) + print 'number of dimensions:',arr.nd + print 'address of strides: 0x%0lx'%(arr.strides,) + print 'strides:' + for i from 0<=iarr.strides[i] + print 'memory dump:' + print_elements( arr.data, arr.strides, arr.dimensions, + arr.nd, sizeof(double), arr.dtype ) + print '-='*10 + print + +# A 'cdef' function is NOT visible to the python side, but it is accessible to +# the rest of this Cython module +cdef print_elements(char *data, + Py_intptr_t* strides, + Py_intptr_t* dimensions, + int nd, + int elsize, + object dtype): + cdef Py_intptr_t i,j + cdef void* elptr + + if dtype not in [np.dtype(np.object_), + np.dtype(np.float64)]: + print ' print_elements() not (yet) implemented for dtype %s'%dtype.name + return + + if nd ==0: + if dtype==np.dtype(np.object_): + elptr = (data)[0] #[0] dereferences pointer in Pyrex + print ' ',elptr + elif dtype==np.dtype(np.float64): + print ' ',(data)[0] + elif nd == 1: + for i from 0<=idata)[0] + print ' ',elptr + elif dtype==np.dtype(np.float64): + print ' ',(data)[0] + data = data + strides[0] + else: + for i from 0<=i Author: stefan Date: 2008-04-09 06:38:26 -0500 (Wed, 09 Apr 2008) New Revision: 4995 Modified: trunk/numpy/core/tests/test_regression.py Log: Regression test for ticket #714. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-09 01:54:54 UTC (rev 4994) +++ trunk/numpy/core/tests/test_regression.py 2008-04-09 11:38:26 UTC (rev 4995) @@ -976,5 +976,10 @@ assert not np.any(a) np.setbufsize(oldsize) + def check_mem_0d_array_index(self, level=rlevel): + """Ticket #714""" + np.zeros(10)[np.array(0)] + + if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Wed Apr 9 07:53:06 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 06:53:06 -0500 (CDT) Subject: [Numpy-svn] r4996 - trunk/numpy/f2py Message-ID: <20080409115306.8DCA039C1FE@new.scipy.org> Author: pearu Date: 2008-04-09 06:53:02 -0500 (Wed, 09 Apr 2008) New Revision: 4996 Modified: trunk/numpy/f2py/auxfuncs.py trunk/numpy/f2py/rules.py Log: Fix issue 587 Modified: trunk/numpy/f2py/auxfuncs.py =================================================================== --- trunk/numpy/f2py/auxfuncs.py 2008-04-09 11:38:26 UTC (rev 4995) +++ trunk/numpy/f2py/auxfuncs.py 2008-04-09 11:53:02 UTC (rev 4996) @@ -148,17 +148,37 @@ and get_kind(var)=='1' def isunsigned_chararray(var): - return isarray(var) and var.get('typespec')=='integer' and get_kind(var)=='-1' + return isarray(var) and var.get('typespec') in ['integer', 'logical']\ + and get_kind(var)=='-1' def isunsigned_shortarray(var): - return isarray(var) and var.get('typespec')=='integer' and get_kind(var)=='-2' + return isarray(var) and var.get('typespec') in ['integer', 'logical']\ + and get_kind(var)=='-2' def isunsignedarray(var): - return isarray(var) and var.get('typespec')=='integer' and get_kind(var)=='-4' + return isarray(var) and var.get('typespec') in ['integer', 'logical']\ + and get_kind(var)=='-4' def isunsigned_long_longarray(var): - return isarray(var) and var.get('typespec')=='integer' and get_kind(var)=='-8' + return isarray(var) and var.get('typespec') in ['integer', 'logical']\ + and get_kind(var)=='-8' +def issigned_chararray(var): + return isarray(var) and var.get('typespec') in ['integer', 'logical']\ + and get_kind(var)=='1' + +def issigned_shortarray(var): + return isarray(var) and var.get('typespec') in ['integer', 'logical']\ + and get_kind(var)=='2' + +def issigned_array(var): + return isarray(var) and var.get('typespec') in ['integer', 'logical']\ + and get_kind(var)=='4' + +def issigned_long_longarray(var): + return isarray(var) and var.get('typespec') in ['integer', 'logical']\ + and get_kind(var)=='8' + def isallocatable(var): return 'attrspec' in var and 'allocatable' in var['attrspec'] Modified: trunk/numpy/f2py/rules.py =================================================================== --- trunk/numpy/f2py/rules.py 2008-04-09 11:38:26 UTC (rev 4995) +++ trunk/numpy/f2py/rules.py 2008-04-09 11:53:02 UTC (rev 4996) @@ -517,12 +517,17 @@ ################ Rules for arguments ################## typedef_need_dict = {islong_long:'long_long', - islong_double:'long_double', - islong_complex:'complex_long_double', - isunsigned_char:'unsigned_char', - isunsigned_short:'unsigned_short', - isunsigned:'unsigned', - isunsigned_long_long:'unsigned_long_long'} + islong_double:'long_double', + islong_complex:'complex_long_double', + isunsigned_char:'unsigned_char', + isunsigned_short:'unsigned_short', + isunsigned:'unsigned', + isunsigned_long_long:'unsigned_long_long', + isunsigned_chararray:'unsigned_char', + isunsigned_shortarray:'unsigned_short', + isunsigned_long_longarray:'unsigned_long_long', + issigned_long_longarray:'long_long', + } aux_rules=[ { From numpy-svn at scipy.org Wed Apr 9 10:38:30 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 09:38:30 -0500 (CDT) Subject: [Numpy-svn] r4997 - trunk/numpy/linalg Message-ID: <20080409143830.61E9639C015@new.scipy.org> Author: pearu Date: 2008-04-09 09:38:15 -0500 (Wed, 09 Apr 2008) New Revision: 4997 Added: trunk/numpy/linalg/pythonxerbla.c Modified: trunk/numpy/linalg/blas_lite.c trunk/numpy/linalg/setup.py Log: Apply modified patch from ticket 673. The patch is effective when using unoptimized lapack shipped with numpy [tested] or if optimized lapack library does not have xerbla_ defined [not tested] Modified: trunk/numpy/linalg/blas_lite.c =================================================================== --- trunk/numpy/linalg/blas_lite.c 2008-04-09 11:53:02 UTC (rev 4996) +++ trunk/numpy/linalg/blas_lite.c 2008-04-09 14:38:15 UTC (rev 4997) @@ -4306,7 +4306,8 @@ return ret_val; } /* lsame_ */ -/* Subroutine */ int xerbla_(char *srname, integer *info) +/* Using xerbla_ from pythonxerbla.c */ +/* Subroutine */ int xerbla_DISABLE(char *srname, integer *info) { /* Format strings */ static char fmt_9999[] = "(\002 ** On entry to \002,a6,\002 parameter nu" Added: trunk/numpy/linalg/pythonxerbla.c =================================================================== --- trunk/numpy/linalg/pythonxerbla.c 2008-04-09 11:53:02 UTC (rev 4996) +++ trunk/numpy/linalg/pythonxerbla.c 2008-04-09 14:38:15 UTC (rev 4997) @@ -0,0 +1,37 @@ +#include "Python.h" +#include "f2c.h" + +/* + From the original manpage: + XERBLA is an error handler for the LAPACK routines. + It is called by an LAPACK routine if an input parameter has an invalid value. + A message is printed and execution stops. + + Instead of printing a message and stopping the execution, a + ValueError is raised with the message. + + Parameters: + srname: Subroutine name to use in error message, maximum six characters. + Spaces at the end are skipped. + info: Number of the invalid parameter. +*/ + +extern int dgesv_(int *n, int *nrhs, + double a[], int *lda, int ipiv[], + double b[], int *ldb, int *info); + +int xerbla_(char *srname, integer *info) +{ + const char* format = "On entry to %.*s" \ + " parameter number %d had an illegal value"; + char buf[strlen(format) + 6 + 4]; /* 6 for name, 4 for param. num. */ + + int len = 0; /* length of subroutine name*/ + while( len<6 && srname[len]!='\0' ) + len++; + while( len && srname[len-1]==' ' ) + len--; + snprintf(buf, sizeof(buf), format, len, srname, *info); + PyErr_SetString(PyExc_ValueError, buf); + return 0; +} Modified: trunk/numpy/linalg/setup.py =================================================================== --- trunk/numpy/linalg/setup.py 2008-04-09 11:53:02 UTC (rev 4996) +++ trunk/numpy/linalg/setup.py 2008-04-09 14:38:15 UTC (rev 4997) @@ -13,14 +13,15 @@ print "### Warning: Using unoptimized lapack ###" return ext.depends[:-1] else: - return ext.depends[:1] + return ext.depends[:2] config.add_extension('lapack_lite', sources = [get_lapack_lite_sources], depends= ['lapack_litemodule.c', - 'zlapack_lite.c', 'dlapack_lite.c', - 'blas_lite.c', 'dlamch.c', - 'f2c_lite.c','f2c.h'], + 'pythonxerbla.c', + 'zlapack_lite.c', 'dlapack_lite.c', + 'blas_lite.c', 'dlamch.c', + 'f2c_lite.c','f2c.h'], extra_info = lapack_info ) From numpy-svn at scipy.org Wed Apr 9 10:47:47 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 09:47:47 -0500 (CDT) Subject: [Numpy-svn] r4998 - trunk/numpy/linalg Message-ID: <20080409144747.BD33D39C015@new.scipy.org> Author: pearu Date: 2008-04-09 09:47:44 -0500 (Wed, 09 Apr 2008) New Revision: 4998 Modified: trunk/numpy/linalg/pythonxerbla.c Log: Cleanup. Modified: trunk/numpy/linalg/pythonxerbla.c =================================================================== --- trunk/numpy/linalg/pythonxerbla.c 2008-04-09 14:38:15 UTC (rev 4997) +++ trunk/numpy/linalg/pythonxerbla.c 2008-04-09 14:47:44 UTC (rev 4998) @@ -16,10 +16,6 @@ info: Number of the invalid parameter. */ -extern int dgesv_(int *n, int *nrhs, - double a[], int *lda, int ipiv[], - double b[], int *ldb, int *info); - int xerbla_(char *srname, integer *info) { const char* format = "On entry to %.*s" \ From numpy-svn at scipy.org Wed Apr 9 10:58:46 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 09:58:46 -0500 (CDT) Subject: [Numpy-svn] r4999 - trunk/numpy/linalg Message-ID: <20080409145846.B554839C29F@new.scipy.org> Author: pearu Date: 2008-04-09 09:58:30 -0500 (Wed, 09 Apr 2008) New Revision: 4999 Modified: trunk/numpy/linalg/pythonxerbla.c trunk/numpy/linalg/setup.py Log: Fixing compile error from MSVC. Modified: trunk/numpy/linalg/pythonxerbla.c =================================================================== --- trunk/numpy/linalg/pythonxerbla.c 2008-04-09 14:47:44 UTC (rev 4998) +++ trunk/numpy/linalg/pythonxerbla.c 2008-04-09 14:58:30 UTC (rev 4999) @@ -20,7 +20,7 @@ { const char* format = "On entry to %.*s" \ " parameter number %d had an illegal value"; - char buf[strlen(format) + 6 + 4]; /* 6 for name, 4 for param. num. */ + char buf[60 + 6 + 4]; /* 6 for name, 4 for param. num. */ int len = 0; /* length of subroutine name*/ while( len<6 && srname[len]!='\0' ) Modified: trunk/numpy/linalg/setup.py =================================================================== --- trunk/numpy/linalg/setup.py 2008-04-09 14:47:44 UTC (rev 4998) +++ trunk/numpy/linalg/setup.py 2008-04-09 14:58:30 UTC (rev 4999) @@ -7,7 +7,7 @@ config.add_data_dir('tests') # Configure lapack_lite - lapack_info = get_info('lapack_opt',0) + lapack_info = get_info('lapack_opt',0) # and {} def get_lapack_lite_sources(ext, build_dir): if not lapack_info: print "### Warning: Using unoptimized lapack ###" From numpy-svn at scipy.org Wed Apr 9 11:07:37 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 10:07:37 -0500 (CDT) Subject: [Numpy-svn] r5000 - trunk/numpy/linalg Message-ID: <20080409150737.5DC8E39C301@new.scipy.org> Author: pearu Date: 2008-04-09 10:07:33 -0500 (Wed, 09 Apr 2008) New Revision: 5000 Modified: trunk/numpy/linalg/pythonxerbla.c Log: Fixing compile error from MSVC. Try 2. Modified: trunk/numpy/linalg/pythonxerbla.c =================================================================== --- trunk/numpy/linalg/pythonxerbla.c 2008-04-09 14:58:30 UTC (rev 4999) +++ trunk/numpy/linalg/pythonxerbla.c 2008-04-09 15:07:33 UTC (rev 5000) @@ -18,7 +18,7 @@ int xerbla_(char *srname, integer *info) { - const char* format = "On entry to %.*s" \ + char* format = "On entry to %.*s" \ " parameter number %d had an illegal value"; char buf[60 + 6 + 4]; /* 6 for name, 4 for param. num. */ From numpy-svn at scipy.org Wed Apr 9 11:15:12 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 10:15:12 -0500 (CDT) Subject: [Numpy-svn] r5001 - trunk/numpy/linalg Message-ID: <20080409151512.1F26739C015@new.scipy.org> Author: pearu Date: 2008-04-09 10:15:05 -0500 (Wed, 09 Apr 2008) New Revision: 5001 Modified: trunk/numpy/linalg/pythonxerbla.c Log: Fixing compile error from MSVC. Try 3. Modified: trunk/numpy/linalg/pythonxerbla.c =================================================================== --- trunk/numpy/linalg/pythonxerbla.c 2008-04-09 15:07:33 UTC (rev 5000) +++ trunk/numpy/linalg/pythonxerbla.c 2008-04-09 15:15:05 UTC (rev 5001) @@ -18,9 +18,9 @@ int xerbla_(char *srname, integer *info) { - char* format = "On entry to %.*s" \ + char format[] = "On entry to %.*s" \ " parameter number %d had an illegal value"; - char buf[60 + 6 + 4]; /* 6 for name, 4 for param. num. */ + char buf[70]; /* 6 for name, 4 for param. num. */ int len = 0; /* length of subroutine name*/ while( len<6 && srname[len]!='\0' ) From numpy-svn at scipy.org Wed Apr 9 11:28:43 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 10:28:43 -0500 (CDT) Subject: [Numpy-svn] r5002 - trunk/numpy/linalg Message-ID: <20080409152843.E89BA39C419@new.scipy.org> Author: pearu Date: 2008-04-09 10:28:36 -0500 (Wed, 09 Apr 2008) New Revision: 5002 Modified: trunk/numpy/linalg/setup.py Log: Disable pythonxerbla.c patch for win32 (the MSVC linker failes on multiple defined symbols) when using optimized lapack. Modified: trunk/numpy/linalg/setup.py =================================================================== --- trunk/numpy/linalg/setup.py 2008-04-09 15:15:05 UTC (rev 5001) +++ trunk/numpy/linalg/setup.py 2008-04-09 15:28:36 UTC (rev 5002) @@ -13,6 +13,9 @@ print "### Warning: Using unoptimized lapack ###" return ext.depends[:-1] else: + if sys.platform=='win32': + print "### Warning: pythonxerbla.c is disabled ###" + return ext.depends[:1] return ext.depends[:2] config.add_extension('lapack_lite', From numpy-svn at scipy.org Wed Apr 9 11:31:33 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 10:31:33 -0500 (CDT) Subject: [Numpy-svn] r5003 - trunk/numpy/linalg Message-ID: <20080409153133.E698039C074@new.scipy.org> Author: pearu Date: 2008-04-09 10:31:28 -0500 (Wed, 09 Apr 2008) New Revision: 5003 Modified: trunk/numpy/linalg/setup.py Log: Fix import error. Modified: trunk/numpy/linalg/setup.py =================================================================== --- trunk/numpy/linalg/setup.py 2008-04-09 15:28:36 UTC (rev 5002) +++ trunk/numpy/linalg/setup.py 2008-04-09 15:31:28 UTC (rev 5003) @@ -1,4 +1,6 @@ +import sys + def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration from numpy.distutils.system_info import get_info From numpy-svn at scipy.org Wed Apr 9 14:05:03 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 13:05:03 -0500 (CDT) Subject: [Numpy-svn] r5004 - trunk/numpy/core/src Message-ID: <20080409180503.E790239C46D@new.scipy.org> Author: charris Date: 2008-04-09 13:04:59 -0500 (Wed, 09 Apr 2008) New Revision: 5004 Modified: trunk/numpy/core/src/arraytypes.inc.src Log: Apply patch supplied by philbinj to fix ticket 630. Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2008-04-09 15:31:28 UTC (rev 5003) +++ trunk/numpy/core/src/arraytypes.inc.src 2008-04-09 18:04:59 UTC (rev 5004) @@ -106,6 +106,19 @@ static double MyPyFloat_AsDouble(PyObject *obj) { + PyObject *tmp; + double d; + if (PyString_Check(obj)) { + tmp = PyFloat_FromString(obj, 0); + if (tmp) { + d = PyFloat_AsDouble(tmp); + Py_DECREF(tmp); + return d; + } + else { + return _getNAN(); + } + } if (obj == Py_None) return _getNAN(); return PyFloat_AsDouble(obj); } From numpy-svn at scipy.org Wed Apr 9 14:19:25 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 13:19:25 -0500 (CDT) Subject: [Numpy-svn] r5005 - trunk/numpy/core/tests Message-ID: <20080409181925.554C739C094@new.scipy.org> Author: charris Date: 2008-04-09 13:19:23 -0500 (Wed, 09 Apr 2008) New Revision: 5005 Modified: trunk/numpy/core/tests/test_regression.py Log: Add test for string to float conversions of various types. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-09 18:04:59 UTC (rev 5004) +++ trunk/numpy/core/tests/test_regression.py 2008-04-09 18:19:23 UTC (rev 5005) @@ -980,6 +980,15 @@ """Ticket #714""" np.zeros(10)[np.array(0)] + def check_floats_from_string(self, level=rlevel): + """Ticket #640, floats from string""" + fsingle = np.single('1.234') + fdouble = np.double('1.234') + flongdouble = np.longdouble('1.234') + assert_almost_equal(fsingle, 1.234) + assert_almost_equal(fdouble, 1.234) + assert_almost_equal(flongdouble, 1.234) + if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Wed Apr 9 16:06:18 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 15:06:18 -0500 (CDT) Subject: [Numpy-svn] r5006 - trunk/numpy/lib Message-ID: <20080409200618.4940239C486@new.scipy.org> Author: stefan Date: 2008-04-09 15:05:57 -0500 (Wed, 09 Apr 2008) New Revision: 5006 Modified: trunk/numpy/lib/twodim_base.py Log: Fix vander docstring. Modified: trunk/numpy/lib/twodim_base.py =================================================================== --- trunk/numpy/lib/twodim_base.py 2008-04-09 18:19:23 UTC (rev 5005) +++ trunk/numpy/lib/twodim_base.py 2008-04-09 20:05:57 UTC (rev 5006) @@ -145,11 +145,10 @@ # borrowed from John Hunter and matplotlib def vander(x, N=None): """ - X = vander(x,N=None) + Generate the Vandermonde matrix of vector x. - The Vandermonde matrix of vector x. The i-th column of X is the - the i-th power of x. N is the maximum power to compute; if N is - None it defaults to len(x). + The i-th column of X is the the (N-i)-1-th power of x. N is the + maximum power to compute; if N is None it defaults to len(x). """ x = asarray(x) From numpy-svn at scipy.org Wed Apr 9 16:13:28 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 15:13:28 -0500 (CDT) Subject: [Numpy-svn] r5007 - in trunk/numpy/random: mtrand tests Message-ID: <20080409201328.1197F39C3BB@new.scipy.org> Author: rkern Date: 2008-04-09 15:13:22 -0500 (Wed, 09 Apr 2008) New Revision: 5007 Modified: trunk/numpy/random/mtrand/mtrand.c trunk/numpy/random/mtrand/mtrand.pyx trunk/numpy/random/tests/test_random.py Log: Fix #581. Modified: trunk/numpy/random/mtrand/mtrand.c =================================================================== --- trunk/numpy/random/mtrand/mtrand.c 2008-04-09 20:05:57 UTC (rev 5006) +++ trunk/numpy/random/mtrand/mtrand.c 2008-04-09 20:13:22 UTC (rev 5007) @@ -1,4 +1,4 @@ -/* Generated by Pyrex 0.9.6.4 on Sat Mar 22 02:09:21 2008 */ +/* Generated by Pyrex 0.9.6.4 on Wed Apr 9 13:10:05 2008 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -243,10 +243,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":129 */ + /* "/Users/rkern/svn/numpy/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 = 130; goto __pyx_L1;} + __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_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -254,19 +254,19 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":132 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":133 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; 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 = 132; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; 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 +274,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":133 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":134 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":134 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":135 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":135 */ + /* "/Users/rkern/svn/numpy/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); } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":137 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":138 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -319,10 +319,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":146 */ + /* "/Users/rkern/svn/numpy/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 = 147; 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 = 148; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -330,19 +330,19 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":149 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":150 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; 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 = 149; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; 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 +350,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":150 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":151 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":151 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":152 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":152 */ + /* "/Users/rkern/svn/numpy/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); } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":154 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":155 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -408,56 +408,56 @@ __pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":165 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":166 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":166 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_DOUBLE); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":167 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":168 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":168 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":169 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":169 */ - __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":170 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":171 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":171 */ + /* "/Users/rkern/svn/numpy/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])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":172 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":173 */ PyArray_ITER_NEXT(__pyx_v_itera); } goto __pyx_L2; } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":174 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":175 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; 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 = 174; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); @@ -465,50 +465,50 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":175 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":176 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":176 */ - __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":178 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":179 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} Py_INCREF(__pyx_k61p); 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 = 179; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; 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 = 179; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":180 */ + /* "/Users/rkern/svn/numpy/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) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":181 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":182 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":182 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":183 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":183 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":184 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); } } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":184 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":185 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -543,10 +543,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":193 */ + /* "/Users/rkern/svn/numpy/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 = 194; 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 = 195; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -554,19 +554,19 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":196 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":197 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; 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 = 196; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); @@ -574,18 +574,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":197 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":198 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":198 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":199 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":199 */ + /* "/Users/rkern/svn/numpy/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); } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":201 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":202 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -629,60 +629,60 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":214 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":215 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":215 */ - __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_oa),((void *)__pyx_v_ob)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":216 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); 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_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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":217 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":218 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":218 */ + /* "/Users/rkern/svn/numpy/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) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":219 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":220 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":220 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":221 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":221 */ + /* "/Users/rkern/svn/numpy/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])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":222 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":223 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":224 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":225 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; 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 = 224; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); @@ -690,56 +690,56 @@ arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":225 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":226 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":226 */ - __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 = 226; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":227 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":228 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} Py_INCREF(__pyx_k62p); 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 = 228; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 228; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":229 */ + /* "/Users/rkern/svn/numpy/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) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":230 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":231 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":231 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":232 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":232 */ + /* "/Users/rkern/svn/numpy/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])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":233 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":234 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":234 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":235 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,2); } } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":235 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":236 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -774,10 +774,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":245 */ + /* "/Users/rkern/svn/numpy/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 = 246; 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 = 247; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -785,19 +785,19 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":248 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":249 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; 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 = 248; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); @@ -805,18 +805,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":249 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":250 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":250 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":251 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":251 */ + /* "/Users/rkern/svn/numpy/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); } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":253 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":254 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -862,63 +862,63 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":267 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":268 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":268 */ - __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 = 268; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":269 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_DOUBLE); 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_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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":270 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":271 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":271 */ + /* "/Users/rkern/svn/numpy/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) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":272 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":273 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":273 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":274 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":274 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":275 */ __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":275 */ + /* "/Users/rkern/svn/numpy/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])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":276 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":277 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":278 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":279 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_float64); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; 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 = 278; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); @@ -926,56 +926,56 @@ arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":279 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":280 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":280 */ - __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 = 280; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":282 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":283 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} Py_INCREF(__pyx_k63p); 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 = 283; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 283; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":284 */ + /* "/Users/rkern/svn/numpy/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) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":285 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":286 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":286 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":287 */ __pyx_v_ob_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":287 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":288 */ __pyx_v_oc_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,3)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":288 */ + /* "/Users/rkern/svn/numpy/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])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":289 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":290 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":290 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":291 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1013,10 +1013,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":298 */ + /* "/Users/rkern/svn/numpy/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 = 299; goto __pyx_L1;} + __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_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -1024,17 +1024,17 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":301 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":302 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; 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 = 301; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); @@ -1042,18 +1042,18 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":302 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":303 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":303 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":304 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":304 */ + /* "/Users/rkern/svn/numpy/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); } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":306 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":307 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1087,10 +1087,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":314 */ + /* "/Users/rkern/svn/numpy/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 = 315; 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 = 316; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -1098,17 +1098,17 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":317 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":318 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; 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 = 317; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); @@ -1116,18 +1116,18 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":318 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":319 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":319 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":320 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":320 */ + /* "/Users/rkern/svn/numpy/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); } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":322 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":323 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1171,58 +1171,58 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":333 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":334 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":334 */ - __pyx_2 = PyArray_MultiIterNew(2,((void *)__pyx_v_on),((void *)__pyx_v_op)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":335 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); 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_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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":336 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":337 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":337 */ + /* "/Users/rkern/svn/numpy/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) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":338 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":339 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":339 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":340 */ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":340 */ + /* "/Users/rkern/svn/numpy/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])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":341 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":342 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":343 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":344 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; 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 = 343; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); @@ -1230,56 +1230,56 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":344 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":345 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":345 */ - __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 = 345; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":346 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":347 */ __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 = 347; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} Py_INCREF(__pyx_k64p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k64p); - __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; 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 = 347; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":348 */ + /* "/Users/rkern/svn/numpy/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) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":349 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":350 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":350 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":351 */ __pyx_v_op_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":351 */ + /* "/Users/rkern/svn/numpy/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])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":352 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":353 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":353 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":354 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,2); } } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":355 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":356 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1314,10 +1314,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":364 */ + /* "/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 = 365; goto __pyx_L1;} + __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_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -1325,17 +1325,17 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":367 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":368 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; 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_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 = 367; goto __pyx_L1;} + __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))); @@ -1343,18 +1343,18 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":368 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":369 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":369 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":370 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":370 */ + /* "/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_m,__pyx_v_N); } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":372 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":373 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1400,61 +1400,61 @@ arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":385 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":386 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":386 */ - __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 = 386; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":387 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":388 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":389 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":389 */ + /* "/Users/rkern/svn/numpy/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) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":390 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":391 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":391 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":392 */ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":392 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":393 */ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":393 */ + /* "/Users/rkern/svn/numpy/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])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":394 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":395 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":396 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":397 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; 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 = 396; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); @@ -1462,56 +1462,56 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":397 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":398 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":398 */ - __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 = 398; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":400 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":401 */ __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 = 401; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;} + __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_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; 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 = 401; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":402 */ + /* "/Users/rkern/svn/numpy/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) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":403 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":404 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":404 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":405 */ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":405 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":406 */ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,3)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":406 */ + /* "/Users/rkern/svn/numpy/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])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":407 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":408 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":409 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":410 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1547,10 +1547,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":417 */ + /* "/Users/rkern/svn/numpy/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 = 418; 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 = 419; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -1558,17 +1558,17 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":420 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":421 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; 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 = 420; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); @@ -1576,18 +1576,18 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":421 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":422 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":422 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":423 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":423 */ + /* "/Users/rkern/svn/numpy/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); } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":425 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":426 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1632,54 +1632,54 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); __pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":436 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":437 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":437 */ - __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":438 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":439 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":439 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":440 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":440 */ - __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":441 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":442 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":442 */ + /* "/Users/rkern/svn/numpy/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])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":443 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":444 */ PyArray_ITER_NEXT(__pyx_v_itera); } goto __pyx_L2; } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":445 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":446 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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; - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; 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 = 445; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); @@ -1687,50 +1687,50 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":446 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":447 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":447 */ - __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":448 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":449 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;} + __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_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; 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 = 449; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":450 */ + /* "/Users/rkern/svn/numpy/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) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":451 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":452 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":452 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":453 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":453 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":454 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); } } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":454 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":455 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1760,29 +1760,29 @@ long __pyx_v_i; double __pyx_r; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":459 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":460 */ __pyx_v_sum = (__pyx_v_darr[0]); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":460 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":461 */ __pyx_v_c = 0.0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":461 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":462 */ for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":462 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":463 */ __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":463 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":464 */ __pyx_v_t = (__pyx_v_sum + __pyx_v_y); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":464 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":465 */ __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":465 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":466 */ __pyx_v_sum = __pyx_v_t; } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":466 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":467 */ __pyx_r = __pyx_v_sum; goto __pyx_L0; @@ -1804,15 +1804,15 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_seed); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":489 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":490 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state *)PyMem_Malloc((sizeof(rk_state)))); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":491 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":492 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; 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 = 491; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -1838,10 +1838,10 @@ __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != NULL); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":495 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":496 */ PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":496 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":497 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = NULL; goto __pyx_L2; } @@ -1874,62 +1874,62 @@ arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_iseed = Py_None; Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":510 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":511 */ __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 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;} Py_INCREF(__pyx_v_seed); 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 = 512; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 512; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; 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_5 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;} + __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;} rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L2; } - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_integer); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_integer); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; 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 = 514; goto __pyx_L1;} + __pyx_1 = PyObject_IsInstance(__pyx_v_seed,__pyx_4); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":515 */ - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":516 */ + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L1;} Py_INCREF(__pyx_v_seed); 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 = 515; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; 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_4; __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":516 */ - __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":517 */ + __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;} rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L2; } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":518 */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":519 */ + __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":519 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":520 */ init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long *)arrayObject_obj->data),(arrayObject_obj->dimensions[0])); } __pyx_L2:; @@ -1970,20 +1970,20 @@ Py_INCREF(__pyx_v_self); arrayObject_state = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":528 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":529 */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; 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 = 528; goto __pyx_L1;} - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_uint); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 528; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_uint); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; 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 = 528; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; 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 = 528; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); @@ -1991,22 +1991,22 @@ arrayObject_state = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":529 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":530 */ memcpy(((void *)arrayObject_state->data),((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),(624 * (sizeof(long)))); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":530 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_asarray); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":531 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_asarray); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;} - __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_uint32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_uint32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; 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 = 530; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; 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 = 530; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); @@ -2014,9 +2014,9 @@ arrayObject_state = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":531 */ - __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 = 531; goto __pyx_L1;} - __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":532 */ + __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 = 532; goto __pyx_L1;} + __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; goto __pyx_L1;} Py_INCREF(__pyx_n_MT19937); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937); Py_INCREF(((PyObject *)arrayObject_state)); @@ -2072,50 +2072,50 @@ __pyx_v_algorithm_name = Py_None; Py_INCREF(Py_None); __pyx_v_key = Py_None; Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":542 */ - __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":543 */ + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_algorithm_name); __pyx_v_algorithm_name = __pyx_2; __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":543 */ - if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":544 */ + if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; 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 = 544; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} Py_INCREF(__pyx_k69p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k69p); - __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 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 = 544; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":545 */ - __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} - __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":546 */ + __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} + __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_4 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} + __pyx_4 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} Py_DECREF(__pyx_v_key); __pyx_v_key = __pyx_4; __pyx_4 = 0; - __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} - __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} + __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} + __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_pos = __pyx_3; - if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} + if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":546 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":547 */ /*try:*/ { - __pyx_4 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_ULONG,1,1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; goto __pyx_L3;} + __pyx_4 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_ULONG,1,1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L3;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)arrayObject_obj)); arrayObject_obj = ((PyArrayObject *)__pyx_4); @@ -2127,14 +2127,14 @@ Py_XDECREF(__pyx_2); __pyx_2 = 0; Py_XDECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":548 */ - __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":549 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} __pyx_3 = PyErr_ExceptionMatches(__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_3) { __Pyx_AddTraceback("mtrand.set_state"); - if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;} - __pyx_5 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} + __pyx_5 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); Py_DECREF(((PyObject *)arrayObject_obj)); arrayObject_obj = ((PyArrayObject *)__pyx_5); @@ -2147,29 +2147,32 @@ goto __pyx_L1; __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":551 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":552 */ __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624); if (__pyx_3) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} Py_INCREF(__pyx_k70p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k70p); - __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; 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 = 552; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":553 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":554 */ memcpy(((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),((void *)arrayObject_obj->data),(624 * (sizeof(long)))); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":554 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":555 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":556 */ + ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = 0; + __pyx_r = Py_None; Py_INCREF(Py_None); goto __pyx_L0; __pyx_L1:; @@ -2196,8 +2199,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 = 558; goto __pyx_L1;} - __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; @@ -2226,11 +2229,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 = 561; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; 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 = 561; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -2262,16 +2265,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__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; 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 = 564; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; 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 = 564; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;} - __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;} + __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; 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 = 564; goto __pyx_L1;} + __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; 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); @@ -2307,7 +2310,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 = 572; 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 = 574; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -2335,7 +2338,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 = 579; 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 = 581; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -2385,54 +2388,54 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":594 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":596 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":595 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":597 */ __pyx_v_lo = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":596 */ - __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":598 */ + __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; goto __pyx_L1;} __pyx_v_hi = __pyx_2; goto __pyx_L2; } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":598 */ - __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":600 */ + __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;} __pyx_v_lo = __pyx_2; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":599 */ - __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":601 */ + __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;} __pyx_v_hi = __pyx_2; } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":601 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":603 */ __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":602 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":604 */ __pyx_1 = (__pyx_v_diff < 0); if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;} Py_INCREF(__pyx_k71p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k71p); - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 603; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":605 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":607 */ __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 = 606; 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 = 608; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -2440,17 +2443,17 @@ } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":608 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":610 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); 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 = 608; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); @@ -2458,18 +2461,18 @@ arrayObject = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":609 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":611 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":610 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":612 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":611 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":613 */ 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":613 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":615 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -2506,19 +2509,19 @@ Py_INCREF(__pyx_v_self); __pyx_v_bytestring = Py_None; Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":621 */ - __pyx_1 = PyString_FromStringAndSize(NULL,__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":623 */ + __pyx_1 = PyString_FromStringAndSize(NULL,__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;} Py_DECREF(__pyx_v_bytestring); __pyx_v_bytestring = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":622 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":624 */ __pyx_v_bytes = PyString_AS_STRING(__pyx_v_bytestring); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":623 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":625 */ rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":624 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":626 */ Py_INCREF(__pyx_v_bytestring); __pyx_r = __pyx_v_bytestring; goto __pyx_L0; @@ -2568,16 +2571,16 @@ __pyx_v_odiff = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_temp = Py_None; Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":635 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":637 */ __pyx_v_flow = PyFloat_AsDouble(__pyx_v_low); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":636 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":638 */ __pyx_v_fhigh = PyFloat_AsDouble(__pyx_v_high); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":637 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":639 */ __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 = 638; 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 = 640; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -2585,51 +2588,51 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":639 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":641 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":640 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":642 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":641 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":643 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":642 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":644 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; 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 = 642; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; 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 = 642; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":643 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":645 */ Py_INCREF(__pyx_v_temp); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":645 */ - __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":647 */ + __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":646 */ - __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 = 646; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":648 */ + __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 = 648; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -2677,11 +2680,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 = 659; goto __pyx_L1;} + __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 661; 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 = 660; goto __pyx_L1;} - __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_4; __pyx_4 = 0; @@ -2689,11 +2692,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 = 662; goto __pyx_L1;} - __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} - __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} - if (PyDict_SetItem(__pyx_5, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} - __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} + __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} + __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_5, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} + __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; @@ -2739,11 +2742,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 = 674; goto __pyx_L1;} + __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; 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 = 675; goto __pyx_L1;} - __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_4; __pyx_4 = 0; @@ -2751,11 +2754,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 = 677; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; 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 = 677; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_r = __pyx_5; @@ -2800,17 +2803,17 @@ Py_INCREF(__pyx_v_high); Py_INCREF(__pyx_v_size); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":686 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":688 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":687 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":689 */ Py_INCREF(__pyx_v_low); Py_DECREF(__pyx_v_high); __pyx_v_high = __pyx_v_low; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":688 */ - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":690 */ + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; goto __pyx_L1;} Py_DECREF(__pyx_v_low); __pyx_v_low = __pyx_2; __pyx_2 = 0; @@ -2818,19 +2821,19 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":689 */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;} - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;} - __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":691 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;} + __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; 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 = 689; goto __pyx_L1;} + __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; 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 = 689; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_4; @@ -2864,7 +2867,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 = 697; 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 = 699; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -2918,35 +2921,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":707 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":709 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":708 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":710 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":709 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":711 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":710 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":712 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;} Py_INCREF(__pyx_k73p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k73p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 711; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":712 */ - __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 = 712; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":714 */ + __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 = 714; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -2954,64 +2957,64 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":714 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":716 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":716 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":718 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":717 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":719 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":718 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":720 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; 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 = 718; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; 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 = 718; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;} Py_INCREF(__pyx_k74p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; 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 = 719; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":720 */ - __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 = 720; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":722 */ + __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 = 722; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -3071,52 +3074,52 @@ __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ob = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":730 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":732 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":731 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":733 */ __pyx_v_fb = PyFloat_AsDouble(__pyx_v_b); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":732 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":734 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":733 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":735 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;} Py_INCREF(__pyx_k75p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 734; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":735 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":737 */ __pyx_1 = (__pyx_v_fb <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; 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 = 736; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 736; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":737 */ - __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 = 737; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":739 */ + __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 = 739; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3124,103 +3127,103 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":739 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":741 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":741 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":743 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":742 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 742; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":744 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_ob)); __pyx_v_ob = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":743 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":745 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; 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 = 743; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; 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 = 743; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;} Py_INCREF(__pyx_k77p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; 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 = 744; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":745 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":747 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; 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 = 745; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; 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 = 745; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; 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 = 745; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;} Py_INCREF(__pyx_k78p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k78p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 746; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":747 */ - __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 = 747; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":749 */ + __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 = 749; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -3272,32 +3275,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":757 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":759 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":758 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":760 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":759 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":761 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} Py_INCREF(__pyx_k79p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k79p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 760; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":761 */ - __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 = 761; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":763 */ + __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 = 763; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3305,57 +3308,57 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":763 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":765 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":765 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 765; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":767 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":766 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":768 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; 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 = 766; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 766; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; 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 = 766; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; 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 = 766; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; 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 = 766; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; 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 = 766; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; goto __pyx_L1;} Py_INCREF(__pyx_k80p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k80p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 767; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":768 */ - __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 = 768; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":770 */ + __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 = 770; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -3388,7 +3391,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 = 775; 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 = 777; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -3432,32 +3435,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":785 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":787 */ __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":786 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":788 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":787 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":789 */ __pyx_1 = (__pyx_v_fshape <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;} Py_INCREF(__pyx_k81p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k81p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 788; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":789 */ - __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 = 789; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":791 */ + __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 = 791; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3465,57 +3468,57 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":791 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":793 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":792 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":794 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":793 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":795 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; 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 = 793; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; 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 = 793; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; 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 = 793; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; 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 = 793; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; 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 = 793; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} Py_INCREF(__pyx_k82p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k82p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 794; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":795 */ - __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 = 795; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":797 */ + __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 = 797; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -3574,52 +3577,52 @@ __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":805 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":807 */ __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":806 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":808 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":807 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":809 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":808 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":810 */ __pyx_1 = (__pyx_v_fshape <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} Py_INCREF(__pyx_k83p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k83p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 809; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":810 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":812 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; 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 = 811; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 811; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":812 */ - __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 = 812; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":814 */ + __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 = 814; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3627,103 +3630,103 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":814 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":816 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":815 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":817 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":816 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":818 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":817 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":819 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; 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 = 817; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; 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 = 817; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} Py_INCREF(__pyx_k85p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; 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 = 818; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":819 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":821 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; 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 = 819; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; 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 = 819; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; 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 = 819; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;} Py_INCREF(__pyx_k86p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k86p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 820; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":821 */ - __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 = 821; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":823 */ + __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 = 823; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -3783,52 +3786,52 @@ __pyx_v_odfnum = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":831 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":833 */ __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":832 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":834 */ __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":833 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":835 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":834 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":836 */ __pyx_1 = (__pyx_v_fdfnum <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} Py_INCREF(__pyx_k87p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k87p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 835; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":836 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":838 */ __pyx_1 = (__pyx_v_fdfden <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; 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 = 837; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 837; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":838 */ - __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 = 838; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":840 */ + __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 = 840; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3836,103 +3839,103 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":840 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":842 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":842 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":844 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":843 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":845 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; 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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":844 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":846 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; 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 = 844; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; 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 = 844; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;} Py_INCREF(__pyx_k89p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; 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 = 845; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":846 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":848 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; 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 = 846; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; 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 = 846; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; 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 = 846; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} Py_INCREF(__pyx_k90p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k90p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 847; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":848 */ - __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 = 848; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":850 */ + __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 = 850; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -4003,72 +4006,72 @@ __pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":858 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":860 */ __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":859 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":861 */ __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":860 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":862 */ __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":861 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":863 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":862 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":864 */ __pyx_1 = (__pyx_v_fdfnum <= 1); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;} Py_INCREF(__pyx_k91p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k91p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 863; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":864 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":866 */ __pyx_1 = (__pyx_v_fdfden <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; 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 = 865; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 865; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":866 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":868 */ __pyx_1 = (__pyx_v_fnonc < 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; 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 = 867; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 867; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":868 */ - __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 = 868; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":870 */ + __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 = 870; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4076,149 +4079,149 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":871 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":873 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":873 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":875 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":874 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":876 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; 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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":875 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":877 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; 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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":877 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":879 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; 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 = 877; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;} + __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; 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_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; 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 = 877; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} Py_INCREF(__pyx_k94p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k94p); - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; 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 = 878; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":879 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":881 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_odfden)); 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 = 879; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; 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 = 879; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; 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 = 879; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 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 = 879; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} Py_INCREF(__pyx_k95p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k95p); - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 880; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":881 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":883 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; 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 = 881; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_ononc)); 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 = 881; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; 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 = 881; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; 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 = 881; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; 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 = 881; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} Py_INCREF(__pyx_k96p); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k96p); - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; 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 = 882; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":883 */ - __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 = 883; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":885 */ + __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 = 885; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4271,32 +4274,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":894 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":896 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":895 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":897 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":896 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":898 */ __pyx_1 = (__pyx_v_fdf <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; goto __pyx_L1;} Py_INCREF(__pyx_k97p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k97p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 897; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":898 */ - __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 = 898; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":900 */ + __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 = 900; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4304,57 +4307,57 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":900 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":902 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":902 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":904 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":903 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":905 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; 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 = 903; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; 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 = 903; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; 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 = 903; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; 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 = 903; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; 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 = 903; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; goto __pyx_L1;} Py_INCREF(__pyx_k98p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k98p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 904; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":905 */ - __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 = 905; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":907 */ + __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 = 907; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -4412,52 +4415,52 @@ __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":914 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":916 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":915 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":917 */ __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":916 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":918 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":917 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":919 */ __pyx_1 = (__pyx_v_fdf <= 1); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} Py_INCREF(__pyx_k99p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k99p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 918; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":919 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":921 */ __pyx_1 = (__pyx_v_fnonc <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; 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 = 920; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 920; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":921 */ - __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 = 921; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":923 */ + __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 = 923; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4465,103 +4468,103 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":924 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":926 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":926 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":928 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":927 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 927; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":929 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_ononc)); __pyx_v_ononc = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":928 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":930 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; 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 = 928; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; 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 = 928; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} Py_INCREF(__pyx_k101p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; 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 = 929; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":930 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":932 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; 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 = 930; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; 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 = 930; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; 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 = 930; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} Py_INCREF(__pyx_k102p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k102p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 931; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":932 */ - __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 = 932; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":934 */ + __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 = 934; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -4596,7 +4599,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 = 940; 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 = 942; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -4640,32 +4643,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":950 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":952 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":951 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":953 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":952 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":954 */ __pyx_1 = (__pyx_v_fdf <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} Py_INCREF(__pyx_k103p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k103p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 953; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 953; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":954 */ - __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 = 954; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":956 */ + __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 = 956; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4673,57 +4676,57 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":956 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":958 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":958 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":960 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":959 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":961 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; 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 = 959; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 959; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; 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 = 959; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; 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 = 959; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; 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 = 959; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; 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 = 959; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;} Py_INCREF(__pyx_k104p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k104p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 960; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":961 */ - __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 = 961; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":963 */ + __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 = 963; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -4777,35 +4780,35 @@ __pyx_v_omu = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_okappa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":972 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":974 */ __pyx_v_fmu = PyFloat_AsDouble(__pyx_v_mu); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":973 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":975 */ __pyx_v_fkappa = PyFloat_AsDouble(__pyx_v_kappa); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":974 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":976 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":975 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":977 */ __pyx_1 = (__pyx_v_fkappa < 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; goto __pyx_L1;} Py_INCREF(__pyx_k105p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k105p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 976; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":977 */ - __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 = 977; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":979 */ + __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 = 979; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4813,64 +4816,64 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":979 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":981 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":981 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":983 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":982 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":984 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_okappa)); __pyx_v_okappa = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":983 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":985 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; 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 = 983; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; 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 = 983; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; goto __pyx_L1;} Py_INCREF(__pyx_k106p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; 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 = 984; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":985 */ - __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 = 985; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":987 */ + __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 = 987; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -4921,32 +4924,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":995 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":997 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":996 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":998 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":997 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":999 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; goto __pyx_L1;} Py_INCREF(__pyx_k107p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 998; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":999 */ - __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 = 999; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1001 */ + __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 = 1001; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4954,57 +4957,57 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1001 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1003 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1003 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1005 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1004 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1006 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; 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 = 1004; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; 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 = 1004; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; 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 = 1004; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; 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 = 1004; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; 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 = 1004; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;} Py_INCREF(__pyx_k108p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k108p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1005; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1006 */ - __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 = 1006; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1008 */ + __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 = 1008; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5053,32 +5056,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1016 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1018 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1017 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1019 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1018 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1020 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; goto __pyx_L1;} Py_INCREF(__pyx_k109p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k109p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1019; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1020 */ - __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 = 1020; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1022 */ + __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 = 1022; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5086,57 +5089,57 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1022 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1024 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1024 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1026 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1025 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1027 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; 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 = 1025; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; 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 = 1025; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; 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 = 1025; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; 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 = 1025; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; 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 = 1025; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;} Py_INCREF(__pyx_k110p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k110p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1026; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1027 */ - __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 = 1027; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1029 */ + __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 = 1029; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5185,32 +5188,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1037 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1039 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1038 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1040 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1039 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1041 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; goto __pyx_L1;} Py_INCREF(__pyx_k111p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k111p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1040; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1041 */ - __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 = 1041; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1043 */ + __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 = 1043; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5218,57 +5221,57 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1043 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1045 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1045 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1047 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1046 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1048 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; 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 = 1046; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; 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 = 1046; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; 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 = 1046; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; 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 = 1046; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; 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 = 1046; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} Py_INCREF(__pyx_k112p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1047; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1048 */ - __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 = 1048; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1050 */ + __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 = 1050; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5324,35 +5327,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1058 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1060 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1059 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1061 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1060 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1062 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1061 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1063 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; goto __pyx_L1;} Py_INCREF(__pyx_k113p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k113p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1062; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1063 */ - __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 = 1063; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1065 */ + __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 = 1065; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5360,64 +5363,64 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1065 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1067 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1066 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1068 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1067 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1069 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1068 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1070 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; 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 = 1068; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; 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 = 1068; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;} Py_INCREF(__pyx_k114p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k114p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; 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 = 1069; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1070 */ - __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 = 1070; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1072 */ + __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 = 1072; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5475,35 +5478,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1080 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1082 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1081 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1083 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1082 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1084 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1083 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1085 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;} Py_INCREF(__pyx_k115p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1084; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1085 */ - __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 = 1085; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1087 */ + __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 = 1087; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5511,64 +5514,64 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1087 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1089 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1088 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1090 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1089 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1091 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1090 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1092 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; 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 = 1090; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; 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 = 1090; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; goto __pyx_L1;} Py_INCREF(__pyx_k116p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k116p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; 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 = 1091; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1092 */ - __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 = 1092; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1094 */ + __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 = 1094; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5626,35 +5629,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1102 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1104 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1103 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1105 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1104 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1106 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1105 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1107 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; goto __pyx_L1;} Py_INCREF(__pyx_k117p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1106; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1107 */ - __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 = 1107; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1109 */ + __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 = 1109; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5662,64 +5665,64 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1109 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1111 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1110 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1112 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1111 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1113 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1112 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1114 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; 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 = 1112; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; 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 = 1112; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; goto __pyx_L1;} Py_INCREF(__pyx_k118p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k118p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; 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 = 1113; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1114 */ - __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 = 1114; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1116 */ + __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 = 1116; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5777,35 +5780,35 @@ __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_osigma = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1129 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1131 */ __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1130 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1132 */ __pyx_v_fsigma = PyFloat_AsDouble(__pyx_v_sigma); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1132 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1134 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1133 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1135 */ __pyx_1 = (__pyx_v_fsigma <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; goto __pyx_L1;} Py_INCREF(__pyx_k119p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k119p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1134; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1135 */ - __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 = 1135; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1137 */ + __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 = 1137; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5813,64 +5816,64 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1137 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1139 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1139 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1141 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); __pyx_v_omean = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1140 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1142 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_osigma)); __pyx_v_osigma = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1141 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1143 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; 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 = 1141; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; 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 = 1141; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;} Py_INCREF(__pyx_k120p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k120p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; 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 = 1142; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1143 */ - __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 = 1143; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1145 */ + __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 = 1145; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5922,32 +5925,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1153 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1155 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1155 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1157 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1156 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1158 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;} Py_INCREF(__pyx_k121p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k121p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1157; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1158 */ - __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 = 1158; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1160 */ + __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 = 1160; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5955,57 +5958,57 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1160 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1162 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1162 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1164 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1163 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1165 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; 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 = 1163; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1163; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; 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 = 1163; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; 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 = 1163; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; 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 = 1163; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; 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 = 1163; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; goto __pyx_L1;} Py_INCREF(__pyx_k122p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k122p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1164; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1165 */ - __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 = 1165; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1167 */ + __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 = 1167; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -6063,52 +6066,52 @@ __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1175 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1177 */ __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1176 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1178 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1177 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1179 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1178 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1180 */ __pyx_1 = (__pyx_v_fmean <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} Py_INCREF(__pyx_k123p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k123p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1179; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1180 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1182 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); 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 = 1183; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; 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 = 1181; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__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_Raise(__pyx_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1182 */ - __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 = 1182; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1184 */ + __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 = 1184; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6116,100 +6119,100 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1184 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1186 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1185 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1185; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1187 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); __pyx_v_omean = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1186 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1186; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1188 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1187 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1189 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; 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 = 1187; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; 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 = 1187; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;} Py_INCREF(__pyx_k125p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k125p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; 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 = 1188; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;} goto __pyx_L5; } - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; 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 = 1189; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; 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 = 1189; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; 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 = 1189; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} Py_INCREF(__pyx_k126p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k126p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 1190; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1191 */ - __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 = 1191; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1193 */ + __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 = 1193; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -6281,72 +6284,72 @@ __pyx_v_omode = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oright = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1204 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1206 */ __pyx_v_fleft = PyFloat_AsDouble(__pyx_v_left); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1205 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1207 */ __pyx_v_fright = PyFloat_AsDouble(__pyx_v_right); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1206 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1208 */ __pyx_v_fmode = PyFloat_AsDouble(__pyx_v_mode); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1207 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1209 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1208 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1210 */ __pyx_1 = (__pyx_v_fleft > __pyx_v_fmode); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__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_k127p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k127p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1209; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1209; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1210 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1212 */ __pyx_1 = (__pyx_v_fmode > __pyx_v_fright); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__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;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; 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 = 1211; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1211; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1212 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1214 */ __pyx_1 = (__pyx_v_fleft == __pyx_v_fright); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; 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 = 1213; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1213; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1214 */ - __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 = 1214; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1216 */ + __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 = 1216; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6354,146 +6357,146 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1217 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1219 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1218 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1218; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1220 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1219 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1221 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; 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; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1220 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1222 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_oright)); __pyx_v_oright = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1222 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1224 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; 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 = 1222; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; 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_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; 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 = 1222; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); __pyx_5 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; 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 = 1222; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} Py_INCREF(__pyx_k130p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k130p); - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; 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 = 1223; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1224 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1226 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_omode)); PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_omode)); Py_INCREF(((PyObject *)__pyx_v_oright)); 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 = 1224; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; 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 = 1224; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; 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 = 1224; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; 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 = 1224; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} Py_INCREF(__pyx_k131p); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k131p); - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; 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 = 1225; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1226 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1228 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oleft)); PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_oleft)); Py_INCREF(((PyObject *)__pyx_v_oright)); 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 = 1226; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; 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 = 1226; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); __pyx_5 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; 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 = 1226; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} Py_INCREF(__pyx_k132p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k132p); - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; 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 = 1227; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1228 */ - __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 = 1228; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1230 */ + __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 = 1230; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6559,66 +6562,66 @@ __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1241 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1243 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1242 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1244 */ __pyx_v_ln = PyInt_AsLong(__pyx_v_n); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1243 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1245 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1244 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1246 */ __pyx_1 = (__pyx_v_ln <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} Py_INCREF(__pyx_k133p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k133p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;} + __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; 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 = 1245; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1246 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1248 */ __pyx_1 = (__pyx_v_fp < 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; 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 = 1247; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1247; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} goto __pyx_L4; } __pyx_1 = (__pyx_v_fp > 1); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; 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 = 1249; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1249; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1250 */ - __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 = 1250; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1252 */ + __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 = 1252; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6626,142 +6629,142 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1252 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1254 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1254 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1256 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1255 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1257 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_op)); __pyx_v_op = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1256 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1258 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; 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 = 1256; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} Py_INCREF(__pyx_v_n); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n); 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 = 1256; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; 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 = 1256; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;} Py_INCREF(__pyx_k136p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k136p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; 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 = 1257; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1258 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1260 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); 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 = 1258; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; 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 = 1258; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; 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 = 1258; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; 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 = 1258; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} Py_INCREF(__pyx_k137p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k137p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 1259; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1260 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1262 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p); 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 = 1260; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; 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 = 1260; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} Py_INCREF(__pyx_k138p); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k138p); - __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; 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_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1262 */ - __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 = 1262; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1264 */ + __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 = 1264; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; @@ -6825,66 +6828,66 @@ __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1274 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1276 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1275 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1277 */ __pyx_v_ln = PyInt_AsLong(__pyx_v_n); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1276 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1278 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1277 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1279 */ __pyx_1 = (__pyx_v_ln <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} Py_INCREF(__pyx_k139p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k139p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1278; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1279 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1281 */ __pyx_1 = (__pyx_v_fp < 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; 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 = 1280; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1280; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;} goto __pyx_L4; } __pyx_1 = (__pyx_v_fp > 1); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; 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 = 1282; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1282; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1283 */ - __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 = 1283; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1285 */ + __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 = 1285; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6892,142 +6895,142 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1286 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1288 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1288 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1290 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1289 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1291 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_op)); __pyx_v_op = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1290 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1292 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; 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 = 1290; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} Py_INCREF(__pyx_v_n); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n); 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 = 1290; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; 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 = 1290; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} Py_INCREF(__pyx_k142p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k142p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; 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 = 1291; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1292 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1294 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); 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 = 1292; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; 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 = 1292; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; 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 = 1292; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; 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 = 1292; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} Py_INCREF(__pyx_k143p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k143p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 1293; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1294 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1296 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p); 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 = 1294; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; 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 = 1294; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; goto __pyx_L1;} Py_INCREF(__pyx_k144p); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k144p); - __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; 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_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1296 */ - __pyx_4 = __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_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1298 */ + __pyx_4 = __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_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; @@ -7079,35 +7082,35 @@ Py_INCREF(__pyx_v_size); __pyx_v_olam = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1306 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1308 */ __pyx_v_flam = PyFloat_AsDouble(__pyx_v_lam); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1307 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1309 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1308 */ - __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_lam, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1310 */ + __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_lam, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); 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 = 1311; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} Py_INCREF(__pyx_k145p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k145p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1309; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1310 */ - __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 = 1310; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1312 */ + __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 = 1312; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7115,57 +7118,57 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1312 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1314 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1314 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1316 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1315 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1317 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; 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 = 1315; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; 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_3); __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1315; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; 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 = 1315; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; 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 = 1315; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; 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 = 1315; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; goto __pyx_L1;} Py_INCREF(__pyx_k146p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k146p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1316; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1317 */ - __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 = 1317; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1319 */ + __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 = 1319; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -7214,32 +7217,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1327 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1329 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1328 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1330 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1329 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1331 */ __pyx_1 = (__pyx_v_fa <= 1.0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; goto __pyx_L1;} Py_INCREF(__pyx_k147p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k147p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1330; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1331 */ - __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 = 1331; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1333 */ + __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 = 1333; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7247,57 +7250,57 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1333 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1335 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1335 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1337 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1336 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1338 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; 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 = 1336; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(1.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; 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 = 1336; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; 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 = 1336; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; 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 = 1336; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; 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 = 1336; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;} Py_INCREF(__pyx_k148p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k148p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1337; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1338 */ - __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 = 1338; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1340 */ + __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 = 1340; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -7350,49 +7353,49 @@ Py_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1349 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1351 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1350 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1352 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1351 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1353 */ __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 = 1352; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} Py_INCREF(__pyx_k149p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k149p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1352; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1353 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1355 */ __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 = 1354; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; 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 = 1354; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1354; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1355 */ - __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 = 1355; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1357 */ + __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 = 1357; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7400,96 +7403,96 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1357 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1359 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1360 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1362 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1361 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1363 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; 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 = 1361; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; 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_3); __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; 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 = 1361; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; 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 = 1361; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; 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 = 1361; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;} Py_INCREF(__pyx_k151p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k151p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1362; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1363 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1365 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; 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 = 1363; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; 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 = 1363; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} 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 = 1363; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; goto __pyx_L1;} Py_INCREF(__pyx_k152p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k152p); - __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; 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_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1365 */ - __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 = 1365; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1367 */ + __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 = 1367; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7563,101 +7566,101 @@ __pyx_v_onbad = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_onsample = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1380 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1382 */ __pyx_v_lngood = PyInt_AsLong(__pyx_v_ngood); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1381 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1383 */ __pyx_v_lnbad = PyInt_AsLong(__pyx_v_nbad); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1382 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1384 */ __pyx_v_lnsample = PyInt_AsLong(__pyx_v_nsample); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1383 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1385 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1384 */ - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_ngood, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1384; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1386 */ + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_ngood, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;} Py_INCREF(__pyx_k153p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k153p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1385; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1385; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1386 */ - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_nbad, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1388 */ + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_nbad, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;} Py_INCREF(__pyx_k154p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k154p); - __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; 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 = 1387; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1388 */ - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_nsample, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1390 */ + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_nsample, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;} Py_INCREF(__pyx_k155p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k155p); - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; 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 = 1389; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1390 */ - __pyx_4 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_4, __pyx_v_nsample, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1392 */ + __pyx_4 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_4, __pyx_v_nsample, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; goto __pyx_L1;} Py_INCREF(__pyx_k156p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k156p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1391; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1392 */ - __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 = 1392; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1394 */ + __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 = 1394; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7665,198 +7668,198 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1396 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1398 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1398 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1400 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_ongood)); __pyx_v_ongood = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1399 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1401 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_onbad)); __pyx_v_onbad = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1400 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1402 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1401 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1403 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; 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 = 1401; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; 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_2); __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; 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 = 1401; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} Py_INCREF(__pyx_k157p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k157p); - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__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_Raise(__pyx_3, 0, 0); Py_DECREF(__pyx_3); __pyx_3 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1403 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1405 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_onbad)); 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 = 1403; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; 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 = 1403; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; 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 = 1403; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 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 = 1403; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} Py_INCREF(__pyx_k158p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k158p); - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 1404; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1405 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1407 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_onsample)); 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 = 1405; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; 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 = 1405; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; 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 = 1405; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; 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 = 1405; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} Py_INCREF(__pyx_k159p); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k159p); - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; 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 = 1406; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} goto __pyx_L9; } __pyx_L9:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1407 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1409 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; 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 = 1407; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_ongood)); PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ongood)); Py_INCREF(((PyObject *)__pyx_v_onbad)); 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 = 1407; goto __pyx_L1;} + __pyx_6 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_5, 0, __pyx_6); Py_INCREF(((PyObject *)__pyx_v_onsample)); PyTuple_SET_ITEM(__pyx_5, 1, ((PyObject *)__pyx_v_onsample)); __pyx_6 = 0; - __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; 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 = 1407; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; 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 = 1407; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; goto __pyx_L1;} Py_INCREF(__pyx_k160p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k160p); - __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; 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 = 1408; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; goto __pyx_L1;} goto __pyx_L10; } __pyx_L10:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1409 */ - __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 = 1409; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1411 */ + __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 = 1411; goto __pyx_L1;} __pyx_r = __pyx_6; __pyx_6 = 0; goto __pyx_L0; @@ -7914,49 +7917,49 @@ Py_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1420 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1422 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1421 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1423 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1422 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1424 */ __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 = 1423; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; goto __pyx_L1;} Py_INCREF(__pyx_k161p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k161p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1423; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1424 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1426 */ __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 = 1425; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; 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 = 1425; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1425; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1426 */ - __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 = 1426; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1428 */ + __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 = 1428; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7964,96 +7967,96 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1428 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1430 */ PyErr_Clear(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1430 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1432 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1431 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1433 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; 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 = 1431; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; 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_3); __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; 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 = 1431; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; 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 = 1431; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; 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 = 1431; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;} Py_INCREF(__pyx_k163p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k163p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1432; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1433 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1435 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; 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 = 1433; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; 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 = 1433; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} 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 = 1433; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; goto __pyx_L1;} Py_INCREF(__pyx_k164p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k164p); - __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; 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_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1435 */ - __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 = 1435; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1437 */ + __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 = 1437; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -8131,38 +8134,38 @@ __pyx_v_s = Py_None; Py_INCREF(Py_None); __pyx_v_v = Py_None; Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1456 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1458 */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; 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 = 1456; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; 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 = 1456; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1457 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; goto __pyx_L1;} - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1459 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; 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 = 1457; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; 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 = 1457; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1458 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1460 */ __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 = 1459; goto __pyx_L1;} + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1461; goto __pyx_L1;} Py_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_1; __pyx_1 = 0; @@ -8175,98 +8178,98 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1462 */ - __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; goto __pyx_L1;} - __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1464 */ + __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} + __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_4 = (__pyx_5 != 1); if (__pyx_4) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; goto __pyx_L1;} - __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;} Py_INCREF(__pyx_k165p); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k165p); - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1463; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1464 */ - __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} - __pyx_5 = PyObject_Length(__pyx_2); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1466 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} + __pyx_5 = PyObject_Length(__pyx_2); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_4 = (__pyx_5 != 2); if (!__pyx_4) { - __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} - __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} - __pyx_6 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} + __pyx_6 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; 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 = 1464; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_2, __pyx_6, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} __pyx_4 = __pyx_4 != 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; } if (__pyx_4) { - __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;} Py_INCREF(__pyx_k166p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k166p); - __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 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 = 1465; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1466 */ - __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} - __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} - __pyx_3 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1468 */ + __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} + __pyx_3 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; 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 = 1466; goto __pyx_L1;} - __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} - __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} + __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} + __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; - if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} __pyx_4 = __pyx_4 != 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_4) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;} - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; goto __pyx_L1;} Py_INCREF(__pyx_k167p); PyTuple_SET_ITEM(__pyx_6, 0, __pyx_k167p); - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; 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 = 1467; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1469 */ - __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; goto __pyx_L1;} - __pyx_4 = PyObject_IsInstance(__pyx_v_shape,__pyx_1); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1471 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;} + __pyx_4 = PyObject_IsInstance(__pyx_v_shape,__pyx_1); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; 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 = 1470; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;} Py_INCREF(__pyx_v_shape); PyList_SET_ITEM(__pyx_2, 0, __pyx_v_shape); Py_DECREF(__pyx_v_shape); @@ -8276,174 +8279,174 @@ } __pyx_L6:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1471 */ - __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; 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 = 1471; goto __pyx_L1;} - __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1473 */ + __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; 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 = 1473; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; 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 = 1471; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1472 */ - __pyx_3 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;} - __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;} - __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1474 */ + __pyx_3 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; goto __pyx_L1;} + __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; 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 = 1472; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; 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 = 1472; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1476 */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;} - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;} - __pyx_6 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1478 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} + __pyx_6 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; 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 = 1476; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} Py_INCREF(__pyx_v_final_shape); 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 = 1476; goto __pyx_L1;} + __pyx_6 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; 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 = 1476; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; 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 = 1476; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_x); __pyx_v_x = __pyx_3; __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1477 */ - __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_6, __pyx_n_multiply); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1479 */ + __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_6, __pyx_n_multiply); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; 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 = 1477; 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 = 1477; goto __pyx_L1;} - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;} + __pyx_5 = PyObject_Length(__pyx_v_final_shape); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; 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 = 1479; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; 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 = 1477; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} - __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} - __pyx_6 = PyObject_GetItem(__pyx_3, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;} + __pyx_6 = PyObject_GetItem(__pyx_3, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; 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 = 1477; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_6); __pyx_2 = 0; __pyx_6 = 0; - if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1486 */ - __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1488 */ + __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;} Py_INCREF(__pyx_n_svd); PyList_SET_ITEM(__pyx_1, 0, __pyx_n_svd); - __pyx_2 = __Pyx_Import(__pyx_k168p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; goto __pyx_L1;} + __pyx_2 = __Pyx_Import(__pyx_k168p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; 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 = 1486; goto __pyx_L1;} + __pyx_6 = PyObject_GetAttr(__pyx_2, __pyx_n_svd); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;} Py_DECREF(__pyx_v_svd); __pyx_v_svd = __pyx_6; __pyx_6 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1488 */ - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1490 */ + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} Py_INCREF(__pyx_v_cov); 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 = 1488; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_v_svd, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; 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 = 1488; goto __pyx_L1;} + __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; 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 = 1488; goto __pyx_L1;} + __pyx_6 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} Py_DECREF(__pyx_v_u); __pyx_v_u = __pyx_6; __pyx_6 = 0; - __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;} + __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} Py_DECREF(__pyx_v_s); __pyx_v_s = __pyx_3; __pyx_3 = 0; - __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;} + __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} Py_DECREF(__pyx_v_v); __pyx_v_v = __pyx_1; __pyx_1 = 0; - if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;} + if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1489 */ - __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_6, __pyx_n_dot); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1491 */ + __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_6, __pyx_n_dot); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; 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 = 1489; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1489; goto __pyx_L1;} + __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; 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 = 1489; goto __pyx_L1;} + __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; 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 = 1489; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_v_x); __pyx_v_x = __pyx_1; __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1492 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1494 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; 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 = 1492; goto __pyx_L1;} + __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; goto __pyx_L1;} Py_INCREF(__pyx_v_mean); PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_mean); Py_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_x); Py_INCREF(__pyx_v_x); 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 = 1492; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1493 */ - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1495 */ + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; goto __pyx_L1;} Py_INCREF(__pyx_v_final_shape); 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 = 1493; goto __pyx_L1;} + __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; 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 = 1493; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1494 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1496 */ Py_INCREF(__pyx_v_x); __pyx_r = __pyx_v_x; goto __pyx_L0; @@ -8513,42 +8516,42 @@ __pyx_v_shape = Py_None; Py_INCREF(Py_None); __pyx_v_multin = Py_None; Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1512 */ - __pyx_1 = PyObject_Length(__pyx_v_pvals); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1512; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1514 */ + __pyx_1 = PyObject_Length(__pyx_v_pvals); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; goto __pyx_L1;} __pyx_v_d = __pyx_1; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1513 */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1515 */ + __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1514 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1516 */ __pyx_v_pix = ((double *)arrayObject_parr->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1516 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1518 */ __pyx_3 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > (1.0 + 1e-12)); if (__pyx_3) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; goto __pyx_L1;} Py_INCREF(__pyx_k170p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k170p); - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 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 = 1517; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1519 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1521 */ __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 = 1520; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1520; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_shape); @@ -8556,20 +8559,20 @@ __pyx_4 = 0; goto __pyx_L3; } - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; 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 = 1522; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; 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); @@ -8580,11 +8583,11 @@ goto __pyx_L3; } /*else*/ { - __pyx_5 = PyInt_FromLong(__pyx_v_d); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(__pyx_v_d); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; 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 = 1524; goto __pyx_L1;} + __pyx_4 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_4; @@ -8592,56 +8595,56 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1526 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1528 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; 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 = 1526; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; goto __pyx_L1;} Py_INCREF(__pyx_v_shape); 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 = 1526; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_v_multin); __pyx_v_multin = __pyx_4; __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1527 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1529 */ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin))); Py_DECREF(((PyObject *)arrayObject_mnarr)); arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1528 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1530 */ __pyx_v_mnix = ((long *)arrayObject_mnarr->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1529 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1531 */ __pyx_v_i = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1530 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1532 */ while (1) { __pyx_3 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr)); if (!__pyx_3) break; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1531 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1533 */ __pyx_v_Sum = 1.0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1532 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1534 */ __pyx_v_dn = __pyx_v_n; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1533 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1535 */ __pyx_6 = (__pyx_v_d - 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_6; ++__pyx_v_j) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1534 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1536 */ (__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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1535 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1537 */ __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)])); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1536 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1538 */ __pyx_3 = (__pyx_v_dn <= 0); if (__pyx_3) { goto __pyx_L7; @@ -8649,12 +8652,12 @@ } __pyx_L8:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1538 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1540 */ __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j])); } __pyx_L7:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1539 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1541 */ __pyx_3 = (__pyx_v_dn > 0); if (__pyx_3) { (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn; @@ -8662,11 +8665,11 @@ } __pyx_L9:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1542 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1544 */ __pyx_v_i = (__pyx_v_i + __pyx_v_d); } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1544 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1546 */ Py_INCREF(__pyx_v_multin); __pyx_r = __pyx_v_multin; goto __pyx_L0; @@ -8724,25 +8727,25 @@ __pyx_v_shape = Py_None; Py_INCREF(Py_None); __pyx_v_diric = Py_None; Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1601 */ - __pyx_1 = PyObject_Length(__pyx_v_alpha); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1603 */ + __pyx_1 = PyObject_Length(__pyx_v_alpha); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; goto __pyx_L1;} __pyx_v_k = __pyx_1; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1602 */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1604 */ + __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1603 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1605 */ __pyx_v_alpha_data = ((double *)__pyx_v_alpha_arr->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1605 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1607 */ __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 = 1606; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1606; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_shape); @@ -8750,20 +8753,20 @@ __pyx_4 = 0; goto __pyx_L2; } - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; goto __pyx_L1;} Py_INCREF(__pyx_v_size); 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 = 1607; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1607; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; 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_4 = PyInt_FromLong(__pyx_v_k); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_k); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size); PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); @@ -8774,11 +8777,11 @@ goto __pyx_L2; } /*else*/ { - __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); __pyx_2 = 0; - __pyx_5 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; goto __pyx_L1;} + __pyx_5 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_5; @@ -8786,70 +8789,70 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1612 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_zeros); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1614 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_zeros); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_float64); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_float64); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; 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 = 1612; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; goto __pyx_L1;} Py_INCREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape); PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; 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_2; __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1613 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1615 */ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_diric))); Py_DECREF(((PyObject *)__pyx_v_val_arr)); __pyx_v_val_arr = ((PyArrayObject *)__pyx_v_diric); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1614 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1616 */ __pyx_v_val_data = ((double *)__pyx_v_val_arr->data); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1616 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1618 */ __pyx_v_i = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1617 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1619 */ __pyx_v_totsize = PyArray_SIZE(__pyx_v_val_arr); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1618 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1620 */ while (1) { __pyx_3 = (__pyx_v_i < __pyx_v_totsize); if (!__pyx_3) break; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1619 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1621 */ __pyx_v_acc = 0.0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1620 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1622 */ for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; ++__pyx_v_j) { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1621 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1623 */ (__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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1622 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1624 */ __pyx_v_acc = (__pyx_v_acc + (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)])); } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1623 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1625 */ __pyx_v_invacc = (1 / __pyx_v_acc); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1624 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1626 */ 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/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1626 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1628 */ __pyx_v_i = (__pyx_v_i + __pyx_v_k); } - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1628 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1630 */ Py_INCREF(__pyx_v_diric); __pyx_r = __pyx_v_diric; goto __pyx_L0; @@ -8894,16 +8897,16 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_x); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1639 */ - __pyx_1 = PyObject_Length(__pyx_v_x); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1639; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1641 */ + __pyx_1 = PyObject_Length(__pyx_v_x); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; goto __pyx_L1;} __pyx_v_i = (__pyx_1 - 1); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1640 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1642 */ /*try:*/ { - __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; goto __pyx_L2;} - __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; goto __pyx_L2;} + __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; goto __pyx_L2;} + __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; 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 = 1641; goto __pyx_L2;} + __pyx_1 = PyObject_Length(__pyx_3); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; goto __pyx_L2;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_v_j = __pyx_1; } @@ -8912,10 +8915,10 @@ Py_XDECREF(__pyx_2); __pyx_2 = 0; Py_XDECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1642 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1644 */ /*except:*/ { __Pyx_AddTraceback("mtrand.shuffle"); - if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1642; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; goto __pyx_L1;} __pyx_v_j = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -8924,82 +8927,82 @@ } __pyx_L3:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1645 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1647 */ __pyx_5 = (__pyx_v_j == 0); if (__pyx_5) { while (1) { __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1648 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1650 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1649 */ - __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;} - __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1651 */ + __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} + __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; 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 = 1649; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; 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 = 1649; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1649; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1650 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1652 */ __pyx_v_i = (__pyx_v_i - 1); } goto __pyx_L4; } /*else*/ { - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1653 */ - __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1653; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1653; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1655 */ + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; 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 = 1653; goto __pyx_L1;} + __pyx_5 = PyObject_HasAttr(__pyx_2,__pyx_n_copy); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_v_copy = __pyx_5; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1654 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1656 */ __pyx_5 = __pyx_v_copy; if (__pyx_5) { while (1) { __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1656 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1658 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1657 */ - __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;} - __pyx_4 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1659 */ + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_copy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_copy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; 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 = 1657; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; 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 = 1657; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; 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 = 1657; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; 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 = 1657; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1658 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1660 */ __pyx_v_i = (__pyx_v_i - 1); } goto __pyx_L7; @@ -9009,30 +9012,30 @@ __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1661 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1663 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1662 */ - __pyx_4 = PyInt_FromLong(__pyx_v_j); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1664 */ + __pyx_4 = PyInt_FromLong(__pyx_v_j); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; 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 = 1662; goto __pyx_L1;} + __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;} + __pyx_4 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; 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 = 1662; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; 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 = 1662; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1662; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1663 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1665 */ __pyx_v_i = (__pyx_v_i - 1); } } @@ -9072,26 +9075,26 @@ Py_INCREF(__pyx_v_x); __pyx_v_arr = Py_None; Py_INCREF(Py_None); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1671 */ - __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; goto __pyx_L1;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_integer); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1671; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1673 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_integer); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; 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 = 1671; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; 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 = 1671; goto __pyx_L1;} + __pyx_4 = PyObject_IsInstance(__pyx_v_x,__pyx_2); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_4) { - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; 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 = 1672; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;} Py_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x); - __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_arr); @@ -9100,13 +9103,13 @@ goto __pyx_L2; } /*else*/ { - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; 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 = 1674; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; goto __pyx_L1;} Py_INCREF(__pyx_v_x); 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 = 1674; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_arr); @@ -9115,17 +9118,17 @@ } __pyx_L2:; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1675 */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; goto __pyx_L1;} - __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1675; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1677 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} Py_INCREF(__pyx_v_arr); 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 = 1675; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1676 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1678 */ Py_INCREF(__pyx_v_arr); __pyx_r = __pyx_v_arr; goto __pyx_L0; @@ -9581,560 +9584,560 @@ __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 = 468; goto __pyx_L1;} - if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; 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;} __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":119 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":120 */ import_array(); - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":121 */ - __pyx_1 = __Pyx_Import(__pyx_n_numpy, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;} - if (PyObject_SetAttr(__pyx_m, __pyx_n__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/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__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":488 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":489 */ Py_INCREF(Py_None); __pyx_k2 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":498 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":499 */ Py_INCREF(Py_None); __pyx_k3 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":567 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":569 */ Py_INCREF(Py_None); __pyx_k4 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":574 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":576 */ Py_INCREF(Py_None); __pyx_k5 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":581 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":583 */ Py_INCREF(Py_None); __pyx_k6 = Py_None; Py_INCREF(Py_None); __pyx_k7 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":626 */ - __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":628 */ + __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; 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 = 626; goto __pyx_L1;} + __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; goto __pyx_L1;} __pyx_k9 = __pyx_2; __pyx_2 = 0; Py_INCREF(Py_None); __pyx_k10 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":679 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":681 */ Py_INCREF(Py_None); __pyx_k11 = Py_None; Py_INCREF(Py_None); __pyx_k12 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":692 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":694 */ Py_INCREF(Py_None); __pyx_k13 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":699 */ - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":701 */ + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; 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 = 699; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;} __pyx_k15 = __pyx_4; __pyx_4 = 0; Py_INCREF(Py_None); __pyx_k16 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":722 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":724 */ Py_INCREF(Py_None); __pyx_k17 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":749 */ - __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":751 */ + __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; goto __pyx_L1;} __pyx_k18 = __pyx_5; __pyx_5 = 0; Py_INCREF(Py_None); __pyx_k19 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":770 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":772 */ Py_INCREF(Py_None); __pyx_k20 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":777 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":779 */ Py_INCREF(Py_None); __pyx_k21 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":797 */ - __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":799 */ + __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; goto __pyx_L1;} __pyx_k22 = __pyx_6; __pyx_6 = 0; Py_INCREF(Py_None); __pyx_k23 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":823 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":825 */ Py_INCREF(Py_None); __pyx_k24 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":850 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":852 */ Py_INCREF(Py_None); __pyx_k25 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":886 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":888 */ Py_INCREF(Py_None); __pyx_k26 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":907 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":909 */ Py_INCREF(Py_None); __pyx_k27 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":935 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":937 */ Py_INCREF(Py_None); __pyx_k28 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":942 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":944 */ Py_INCREF(Py_None); __pyx_k29 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":963 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":965 */ Py_INCREF(Py_None); __pyx_k30 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":987 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":989 */ Py_INCREF(Py_None); __pyx_k31 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1008 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1010 */ Py_INCREF(Py_None); __pyx_k32 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1029 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1031 */ Py_INCREF(Py_None); __pyx_k33 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1050 */ - __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1052 */ + __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; 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 = 1050; goto __pyx_L1;} + __pyx_8 = PyFloat_FromDouble(1.0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; goto __pyx_L1;} __pyx_k35 = __pyx_8; __pyx_8 = 0; Py_INCREF(Py_None); __pyx_k36 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1072 */ - __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1072; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1074 */ + __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; 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 = 1072; goto __pyx_L1;} + __pyx_10 = PyFloat_FromDouble(1.0); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} __pyx_k38 = __pyx_10; __pyx_10 = 0; Py_INCREF(Py_None); __pyx_k39 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1094 */ - __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1096 */ + __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; 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 = 1094; goto __pyx_L1;} + __pyx_12 = PyFloat_FromDouble(1.0); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; goto __pyx_L1;} __pyx_k41 = __pyx_12; __pyx_12 = 0; Py_INCREF(Py_None); __pyx_k42 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1116 */ - __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1118 */ + __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; 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 = 1116; goto __pyx_L1;} + __pyx_14 = PyFloat_FromDouble(1.0); if (!__pyx_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} __pyx_k44 = __pyx_14; __pyx_14 = 0; Py_INCREF(Py_None); __pyx_k45 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1145 */ - __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1147 */ + __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; goto __pyx_L1;} __pyx_k46 = __pyx_15; __pyx_15 = 0; Py_INCREF(Py_None); __pyx_k47 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1167 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1169 */ Py_INCREF(Py_None); __pyx_k48 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1195 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1197 */ Py_INCREF(Py_None); __pyx_k49 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1232 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1234 */ Py_INCREF(Py_None); __pyx_k50 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1264 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1266 */ Py_INCREF(Py_None); __pyx_k51 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1299 */ - __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1299; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1301 */ + __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; goto __pyx_L1;} __pyx_k52 = __pyx_16; __pyx_16 = 0; Py_INCREF(Py_None); __pyx_k53 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1319 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1321 */ Py_INCREF(Py_None); __pyx_k54 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1340 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1342 */ Py_INCREF(Py_None); __pyx_k55 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1367 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1369 */ Py_INCREF(Py_None); __pyx_k56 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1412 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1414 */ Py_INCREF(Py_None); __pyx_k57 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1438 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1440 */ Py_INCREF(Py_None); __pyx_k58 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1496 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1498 */ Py_INCREF(Py_None); __pyx_k59 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1546 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1548 */ Py_INCREF(Py_None); __pyx_k60 = Py_None; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1678 */ - __pyx_17 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), 0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; goto __pyx_L1;} - if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1678; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1680 */ + __pyx_17 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), 0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; goto __pyx_L1;} Py_DECREF(__pyx_17); __pyx_17 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1679 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1679; 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 = 1679; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1680 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; 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 = 1680; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1681 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1681 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; 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 = 1681; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1682 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1682 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; 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 = 1682; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1683 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1683 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; 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 = 1683; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1684 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1684 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; 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 = 1684; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1685 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1685 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; 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 = 1685; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1686 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1686 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; 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 = 1686; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1687 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1687 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; 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 = 1687; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1688 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1688 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; 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 = 1688; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1689 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1689 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; 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 = 1689; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1690 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1690 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; 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 = 1690; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1691 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1691 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; 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 = 1691; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1692 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1692 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; 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 = 1692; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1693 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1693 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; 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 = 1693; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1694 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1694 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; 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 = 1694; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1695 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1695 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; 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 = 1695; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1696 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1696 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; 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 = 1696; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1697 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1697 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; 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 = 1697; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1698 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1698 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; 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 = 1698; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1699 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1699 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; 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 = 1699; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1700 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1700 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; 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 = 1700; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1701 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1701 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; 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 = 1701; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1702 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1702 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; 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 = 1702; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_cauchy, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1703 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1703 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; 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 = 1703; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1704 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1704 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; 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 = 1704; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1705 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1705 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; 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 = 1705; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1706 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1706 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; 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 = 1706; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1707 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1707 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; 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 = 1707; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1708 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1708 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; 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 = 1708; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1709 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1709 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; 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 = 1709; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1710 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1710 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; 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 = 1710; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_logistic, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1711 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1711 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; 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 = 1711; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1712 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1712 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; 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 = 1712; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1714 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1713 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; 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 = 1714; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1715 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1714 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; 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 = 1715; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1716 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1716 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; 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 = 1716; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1717 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1717 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; 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 = 1717; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_negative_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1718 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1718 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; 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 = 1718; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_poisson, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1719 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1719 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; 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 = 1719; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_zipf, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1720 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1720 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; 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 = 1720; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_geometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1722 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1721 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; 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 = 1722; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_hypergeometric, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1723 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1722 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; 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 = 1723; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_logseries, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1724 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1724 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_dirichlet); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; 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 = 1724; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_multivariate_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1726 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1725 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; 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 = 1725; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1726 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_dirichlet); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; 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 = 1726; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_dirichlet, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/home/oliphant/numpy/numpy/random/mtrand/mtrand.pyx":1727 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1728 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; 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 = 1727; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_shuffle, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1729 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; 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 = 1729; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; return; __pyx_L1:; Py_XDECREF(__pyx_1); Modified: trunk/numpy/random/mtrand/mtrand.pyx =================================================================== --- trunk/numpy/random/mtrand/mtrand.pyx 2008-04-09 20:05:57 UTC (rev 5006) +++ trunk/numpy/random/mtrand/mtrand.pyx 2008-04-09 20:13:22 UTC (rev 5007) @@ -37,6 +37,7 @@ ctypedef struct rk_state: unsigned long key[624] int pos + int has_gauss ctypedef enum rk_error: RK_NOERR = 0 @@ -552,6 +553,7 @@ raise ValueError("state must be 624 longs") memcpy((self.internal_state.key), (obj.data), 624*sizeof(long)) self.internal_state.pos = pos + self.internal_state.has_gauss = 0 # Pickling support: def __getstate__(self): Modified: trunk/numpy/random/tests/test_random.py =================================================================== --- trunk/numpy/random/tests/test_random.py 2008-04-09 20:05:57 UTC (rev 5006) +++ trunk/numpy/random/tests/test_random.py 2008-04-09 20:13:22 UTC (rev 5007) @@ -15,5 +15,28 @@ assert np.all(-5 <= x) assert np.all(x < -1) + +class TestSetState(NumpyTestCase): + def setUp(self): + self.seed = 1234567890 + self.prng = random.RandomState(self.seed) + self.state = self.prng.get_state() + + def test_basic(self): + old = self.prng.tomaxint(16) + self.prng.set_state(self.state) + new = self.prng.tomaxint(16) + assert np.all(old == new) + + def test_gaussian_reset(self): + """ Make sure the cached every-other-Gaussian is reset. + """ + old = self.prng.standard_normal(size=3) + self.prng.set_state(self.state) + new = self.prng.standard_normal(size=3) + assert np.all(old == new) + + + if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Wed Apr 9 16:30:11 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 15:30:11 -0500 (CDT) Subject: [Numpy-svn] r5008 - in trunk/numpy/random: mtrand tests Message-ID: <20080409203011.A696D39C0EF@new.scipy.org> Author: rkern Date: 2008-04-09 15:30:07 -0500 (Wed, 09 Apr 2008) New Revision: 5008 Modified: trunk/numpy/random/mtrand/mtrand.c trunk/numpy/random/mtrand/mtrand.pyx trunk/numpy/random/tests/test_random.py Log: Add the cached Gaussian to the state tuple. Preserve backwards compatibility with the old state tuple. Modified: trunk/numpy/random/mtrand/mtrand.c =================================================================== --- trunk/numpy/random/mtrand/mtrand.c 2008-04-09 20:13:22 UTC (rev 5007) +++ trunk/numpy/random/mtrand/mtrand.c 2008-04-09 20:30:07 UTC (rev 5008) @@ -1,4 +1,4 @@ -/* Generated by Pyrex 0.9.6.4 on Wed Apr 9 13:10:05 2008 */ +/* Generated by Pyrex 0.9.6.4 on Wed Apr 9 13:25:33 2008 */ #define PY_SSIZE_T_CLEAN #include "Python.h" @@ -243,10 +243,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/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 +254,19 @@ } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":133 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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__sp); 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__sp); 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__sp); 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 +274,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":134 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":135 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":135 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":136 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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); } - /* "/Users/rkern/svn/numpy/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 +319,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/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 +330,19 @@ } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":150 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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__sp); 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__sp); 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__sp); 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 +350,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":151 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":152 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":152 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":153 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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); } - /* "/Users/rkern/svn/numpy/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; @@ -408,56 +408,56 @@ __pyx_v_itera = ((PyArrayIterObject *)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":166 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":167 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":168 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":169 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":169 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":170 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/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) { - /* "/Users/rkern/svn/numpy/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])); - /* "/Users/rkern/svn/numpy/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*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":175 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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__sp); 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__sp); 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__sp); 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))); @@ -465,50 +465,50 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":176 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":177 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/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 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__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_4, 0, __pyx_k61p); - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;} + __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; 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 = 180; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/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) { - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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])); - /* "/Users/rkern/svn/numpy/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:; - /* "/Users/rkern/svn/numpy/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; @@ -543,10 +543,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/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; @@ -554,19 +554,19 @@ } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":197 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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__sp); 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__sp); 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__sp); 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))); @@ -574,18 +574,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":198 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":199 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":199 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":200 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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); } - /* "/Users/rkern/svn/numpy/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; @@ -629,60 +629,60 @@ 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":215 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":216 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":218 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":219 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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) { - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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])); - /* "/Users/rkern/svn/numpy/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*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":225 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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__sp); 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__sp); 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__sp); 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))); @@ -690,56 +690,56 @@ arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":226 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":227 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/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 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__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_5, 0, __pyx_k62p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; goto __pyx_L1;} + __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; 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 = 229; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/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) { - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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])); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":234 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":235 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/Users/rkern/svn/numpy/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:; - /* "/Users/rkern/svn/numpy/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; @@ -774,10 +774,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/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; @@ -785,19 +785,19 @@ } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":249 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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__sp); 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__sp); 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__sp); 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))); @@ -805,18 +805,18 @@ arrayObject = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":250 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":251 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":251 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":252 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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); } - /* "/Users/rkern/svn/numpy/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; @@ -862,63 +862,63 @@ 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":268 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":269 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":271 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":272 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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) { - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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])); - /* "/Users/rkern/svn/numpy/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*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":279 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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__sp); 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__sp); 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__sp); 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))); @@ -926,56 +926,56 @@ arrayObject = ((PyArrayObject *)__pyx_5); Py_DECREF(__pyx_5); __pyx_5 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":280 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":281 */ __pyx_v_array_data = ((double *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/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 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__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_5, 0, __pyx_k63p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;} + __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; 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 = 284; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/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) { - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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])); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":290 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":291 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } } __pyx_L2:; - /* "/Users/rkern/svn/numpy/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; @@ -1013,10 +1013,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/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; @@ -1024,17 +1024,17 @@ } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":302 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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__sp); 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 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__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_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 = 302; goto __pyx_L1;} + __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))); @@ -1042,18 +1042,18 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":303 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":304 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":304 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":305 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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); } - /* "/Users/rkern/svn/numpy/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; @@ -1087,10 +1087,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/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; @@ -1098,17 +1098,17 @@ } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":318 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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__sp); 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 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__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_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 = 318; goto __pyx_L1;} + __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))); @@ -1116,18 +1116,18 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":319 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":320 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":320 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":321 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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); } - /* "/Users/rkern/svn/numpy/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; @@ -1171,58 +1171,58 @@ 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":334 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":335 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":337 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":338 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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) { - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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])); - /* "/Users/rkern/svn/numpy/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*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":344 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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__sp); 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 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__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_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 = 344; goto __pyx_L1;} + __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))); @@ -1230,56 +1230,56 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":345 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":346 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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; - /* "/Users/rkern/svn/numpy/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_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} - __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_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__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_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/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) { - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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)); - /* "/Users/rkern/svn/numpy/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])); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":353 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":354 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); - /* "/Users/rkern/svn/numpy/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:; - /* "/Users/rkern/svn/numpy/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; @@ -1314,10 +1314,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":365 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":366 */ __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_m,__pyx_v_N)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -1325,17 +1325,17 @@ } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":368 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":369 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; 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 = 368; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__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 = 369; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; 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 = 368; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); @@ -1343,18 +1343,18 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":369 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":370 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":370 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":371 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":371 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":372 */ 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":373 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":374 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1400,61 +1400,61 @@ 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":386 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":387 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/rkern/svn/numpy/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":388 */ + __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 = 388; 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":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":389 */ + __pyx_2 = PyArray_SimpleNew(__pyx_v_multi->nd,__pyx_v_multi->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":389 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":390 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":390 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":391 */ __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":391 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":392 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,0)); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":392 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":393 */ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":393 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":394 */ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":394 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":395 */ (__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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":395 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":396 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } goto __pyx_L2; } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":397 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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":398 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; 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 = 397; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__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 = 398; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; 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 = 397; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); @@ -1462,56 +1462,56 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":398 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":399 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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":400 */ + __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 = 400; 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":401 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":402 */ __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 = 402; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__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 = 403; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; 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 = 402; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; 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 = 402; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":403 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":404 */ __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":404 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":405 */ __pyx_v_on_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":405 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":406 */ __pyx_v_om_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,2)); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":406 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":407 */ __pyx_v_oN_data = ((long *)PyArray_MultiIter_DATA(__pyx_v_multi,3)); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":407 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":408 */ (__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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":408 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":409 */ PyArray_MultiIter_NEXT(__pyx_v_multi); } } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":410 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":411 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1547,10 +1547,10 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":418 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":419 */ __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 = 420; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -1558,17 +1558,17 @@ } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":421 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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":422 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; 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 = 421; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__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 = 422; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; 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 = 421; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); @@ -1576,18 +1576,18 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":422 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":423 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":423 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":424 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":424 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":425 */ 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":426 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":427 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1632,54 +1632,54 @@ __pyx_v_multi = ((PyArrayMultiIterObject *)Py_None); Py_INCREF(Py_None); __pyx_v_itera = ((PyArrayIterObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":437 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":438 */ __pyx_1 = __pyx_v_size == Py_None; if (__pyx_1) { - /* "/Users/rkern/svn/numpy/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":439 */ + __pyx_2 = PyArray_SimpleNew(__pyx_v_oa->nd,__pyx_v_oa->dimensions,NPY_LONG); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":439 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":440 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":440 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":441 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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":442 */ + __pyx_2 = PyArray_IterNew(((PyObject *)__pyx_v_oa)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":442 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":443 */ for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_length; ++__pyx_v_i) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":443 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":444 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(((double *)__pyx_v_itera->dataptr)[0])); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":444 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":445 */ PyArray_ITER_NEXT(__pyx_v_itera); } goto __pyx_L2; } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":446 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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":447 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_empty); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; 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 = 446; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__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 = 447; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; 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 = 446; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); @@ -1687,50 +1687,50 @@ arrayObject = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":447 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":448 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/rkern/svn/numpy/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":449 */ + __pyx_3 = PyArray_MultiIterNew(2,((void *)arrayObject),((void *)__pyx_v_oa)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":449 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":450 */ __pyx_1 = (__pyx_v_multi->size != PyArray_SIZE(arrayObject)); if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__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 = 451; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;} Py_INCREF(__pyx_k66p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k66p); - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 450; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; 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 = 450; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":451 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":452 */ __pyx_5 = __pyx_v_multi->size; for (__pyx_v_i = 0; __pyx_v_i < __pyx_5; ++__pyx_v_i) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":452 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":453 */ __pyx_v_oa_data = ((double *)PyArray_MultiIter_DATA(__pyx_v_multi,1)); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":453 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":454 */ (__pyx_v_array_data[__pyx_v_i]) = __pyx_v_func(__pyx_v_state,(__pyx_v_oa_data[0])); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":454 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":455 */ PyArray_MultiIter_NEXTi(__pyx_v_multi,1); } } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":455 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":456 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -1760,29 +1760,29 @@ long __pyx_v_i; double __pyx_r; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":460 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":461 */ __pyx_v_sum = (__pyx_v_darr[0]); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":461 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":462 */ __pyx_v_c = 0.0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":462 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":463 */ for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_n; ++__pyx_v_i) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":463 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":464 */ __pyx_v_y = ((__pyx_v_darr[__pyx_v_i]) - __pyx_v_c); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":464 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":465 */ __pyx_v_t = (__pyx_v_sum + __pyx_v_y); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":465 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":466 */ __pyx_v_c = ((__pyx_v_t - __pyx_v_sum) - __pyx_v_y); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":466 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":467 */ __pyx_v_sum = __pyx_v_t; } - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":467 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":468 */ __pyx_r = __pyx_v_sum; goto __pyx_L0; @@ -1804,15 +1804,15 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_seed); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":490 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":491 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = ((rk_state *)PyMem_Malloc((sizeof(rk_state)))); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":492 */ - __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":493 */ + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_seed); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; 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 = 492; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -1838,10 +1838,10 @@ __pyx_1 = (((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state != NULL); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":496 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":497 */ PyMem_Free(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":497 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":498 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state = NULL; goto __pyx_L2; } @@ -1874,62 +1874,62 @@ arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_iseed = Py_None; Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":511 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":512 */ __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 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;} Py_INCREF(__pyx_v_seed); 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 = 513; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 513; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; 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_5 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; goto __pyx_L1;} + __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_seed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;} rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L2; } - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_integer); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_integer); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; 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 = 515; goto __pyx_L1;} + __pyx_1 = PyObject_IsInstance(__pyx_v_seed,__pyx_4); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":516 */ - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":517 */ + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;} Py_INCREF(__pyx_v_seed); 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 = 516; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; 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_4; __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":517 */ - __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":518 */ + __pyx_5 = PyInt_AsUnsignedLongMask(__pyx_v_iseed); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; goto __pyx_L1;} rk_seed(__pyx_5,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); goto __pyx_L2; } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":519 */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":520 */ + __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_seed,NPY_LONG,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":520 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":521 */ init_by_array(((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state,((unsigned long *)arrayObject_obj->data),(arrayObject_obj->dimensions[0])); } __pyx_L2:; @@ -1957,7 +1957,7 @@ static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static char __pyx_doc_6mtrand_11RandomState_get_state[] = "Return a tuple representing the internal state of the generator.\n\n get_state() -> (\'MT19937\', int key[624], int pos)\n "; +static char __pyx_doc_6mtrand_11RandomState_get_state[] = "Return a tuple representing the internal state of the generator.\n\n get_state() -> (\'MT19937\', int key[624], int pos, int has_gauss, float cached_gaussian)\n "; static PyObject *__pyx_f_6mtrand_11RandomState_get_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyArrayObject *arrayObject_state; PyObject *__pyx_r; @@ -1970,20 +1970,20 @@ Py_INCREF(__pyx_v_self); arrayObject_state = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":529 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":530 */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_empty); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; 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 = 529; goto __pyx_L1;} - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_uint); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(624); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_uint); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; 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 = 529; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; 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 = 529; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); @@ -1991,22 +1991,22 @@ arrayObject_state = ((PyArrayObject *)__pyx_1); Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":530 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":531 */ memcpy(((void *)arrayObject_state->data),((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),(624 * (sizeof(long)))); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":531 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_asarray); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":532 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_asarray); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} - __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_uint32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_uint32); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; 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 = 531; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; 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 = 531; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); @@ -2014,17 +2014,23 @@ arrayObject_state = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":532 */ - __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 = 532; goto __pyx_L1;} - __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":533 */ + __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 = 533; 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 = 534; 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 = 534; goto __pyx_L1;} + __pyx_3 = PyTuple_New(5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; goto __pyx_L1;} Py_INCREF(__pyx_n_MT19937); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_MT19937); + PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_MT19937); Py_INCREF(((PyObject *)arrayObject_state)); - PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)arrayObject_state)); - PyTuple_SET_ITEM(__pyx_2, 2, __pyx_1); + PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)arrayObject_state)); + PyTuple_SET_ITEM(__pyx_3, 2, __pyx_1); + PyTuple_SET_ITEM(__pyx_3, 3, __pyx_2); + PyTuple_SET_ITEM(__pyx_3, 4, __pyx_4); __pyx_1 = 0; - __pyx_r = __pyx_2; __pyx_2 = 0; + __pyx_4 = 0; + __pyx_r = __pyx_3; + __pyx_3 = 0; goto __pyx_L0; __pyx_r = Py_None; Py_INCREF(Py_None); @@ -2051,19 +2057,23 @@ static char __pyx_k70[] = "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[] = "Set the state from a tuple.\n\n state = (\'MT19937\', int key[624], int pos)\n\n set_state(state)\n "; +static char __pyx_doc_6mtrand_11RandomState_set_state[] = "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 set_state(state)\n "; static PyObject *__pyx_f_6mtrand_11RandomState_set_state(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_state = 0; PyArrayObject *arrayObject_obj; int __pyx_v_pos; PyObject *__pyx_v_algorithm_name; PyObject *__pyx_v_key; + PyObject *__pyx_v_has_gauss; + PyObject *__pyx_v_cached_gaussian; PyObject *__pyx_r; PyObject *__pyx_1 = 0; PyObject *__pyx_2 = 0; int __pyx_3; PyObject *__pyx_4 = 0; - PyObject *__pyx_5 = 0; + Py_ssize_t __pyx_5; + PyObject *__pyx_6 = 0; + double __pyx_7; static char *__pyx_argnames[] = {"state",0}; if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_state)) return 0; Py_INCREF(__pyx_v_self); @@ -2071,121 +2081,165 @@ arrayObject_obj = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_algorithm_name = Py_None; Py_INCREF(Py_None); __pyx_v_key = Py_None; Py_INCREF(Py_None); + __pyx_v_has_gauss = Py_None; Py_INCREF(Py_None); + __pyx_v_cached_gaussian = Py_None; Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":543 */ - __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 543; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":550 */ + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_state, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_algorithm_name); __pyx_v_algorithm_name = __pyx_2; __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":544 */ - if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":551 */ + if (PyObject_Cmp(__pyx_v_algorithm_name, __pyx_n_MT19937, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; 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 = 545; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;} Py_INCREF(__pyx_k69p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k69p); - __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 545; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 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 = 545; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 552; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":546 */ - __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} - __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":553 */ + __pyx_1 = PySequence_GetSlice(__pyx_v_state, 1, 3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} + __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_4 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} + __pyx_4 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} Py_DECREF(__pyx_v_key); __pyx_v_key = __pyx_4; __pyx_4 = 0; - __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} - __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} + __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} + __pyx_3 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_v_pos = __pyx_3; - if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; goto __pyx_L1;} + if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":547 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":554 */ + __pyx_5 = PyObject_Length(__pyx_v_state); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; goto __pyx_L1;} + __pyx_3 = (__pyx_5 == 3); + if (__pyx_3) { + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":555 */ + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; goto __pyx_L1;} + Py_DECREF(__pyx_v_has_gauss); + __pyx_v_has_gauss = __pyx_4; + __pyx_4 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":556 */ + __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; goto __pyx_L1;} + Py_DECREF(__pyx_v_cached_gaussian); + __pyx_v_cached_gaussian = __pyx_1; + __pyx_1 = 0; + goto __pyx_L3; + } + /*else*/ { + __pyx_2 = PySequence_GetSlice(__pyx_v_state, 3, 5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;} + __pyx_4 = PyObject_GetIter(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; 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 = 558; goto __pyx_L1;} + Py_DECREF(__pyx_v_has_gauss); + __pyx_v_has_gauss = __pyx_1; + __pyx_1 = 0; + __pyx_2 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;} + Py_DECREF(__pyx_v_cached_gaussian); + __pyx_v_cached_gaussian = __pyx_2; + __pyx_2 = 0; + if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; goto __pyx_L1;} + Py_DECREF(__pyx_4); __pyx_4 = 0; + } + __pyx_L3:; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":559 */ /*try:*/ { - __pyx_4 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_ULONG,1,1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L3;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); + __pyx_1 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_ULONG,1,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L4;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_1))); Py_DECREF(((PyObject *)arrayObject_obj)); - arrayObject_obj = ((PyArrayObject *)__pyx_4); - Py_DECREF(__pyx_4); __pyx_4 = 0; + arrayObject_obj = ((PyArrayObject *)__pyx_1); + Py_DECREF(__pyx_1); __pyx_1 = 0; } - goto __pyx_L4; - __pyx_L3:; - Py_XDECREF(__pyx_1); __pyx_1 = 0; + goto __pyx_L5; + __pyx_L4:; Py_XDECREF(__pyx_2); __pyx_2 = 0; Py_XDECREF(__pyx_4); __pyx_4 = 0; + Py_XDECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":549 */ - __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} - __pyx_3 = PyErr_ExceptionMatches(__pyx_1); - Py_DECREF(__pyx_1); __pyx_1 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":561 */ + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; 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_2, &__pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; goto __pyx_L1;} - __pyx_5 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; goto __pyx_L1;} - Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_5))); + if (__Pyx_GetException(&__pyx_4, &__pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;} + __pyx_6 = PyArray_ContiguousFromObject(__pyx_v_key,NPY_LONG,1,1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; goto __pyx_L1;} + Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_6))); Py_DECREF(((PyObject *)arrayObject_obj)); - arrayObject_obj = ((PyArrayObject *)__pyx_5); - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; + arrayObject_obj = ((PyArrayObject *)__pyx_6); + Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - goto __pyx_L4; + Py_DECREF(__pyx_2); __pyx_2 = 0; + goto __pyx_L5; } goto __pyx_L1; - __pyx_L4:; + __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":552 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":564 */ __pyx_3 = ((arrayObject_obj->dimensions[0]) != 624); if (__pyx_3) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} + __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;} Py_INCREF(__pyx_k70p); - PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k70p); - __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} - Py_DECREF(__pyx_5); __pyx_5 = 0; - Py_DECREF(__pyx_2); __pyx_2 = 0; - __Pyx_Raise(__pyx_4, 0, 0); + PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k70p); + __pyx_1 = PyObject_CallObject(__pyx_6, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;} + Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; goto __pyx_L1;} - goto __pyx_L5; + __Pyx_Raise(__pyx_1, 0, 0); + Py_DECREF(__pyx_1); __pyx_1 = 0; + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; goto __pyx_L1;} + goto __pyx_L6; } - __pyx_L5:; + __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":554 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":566 */ memcpy(((void *)((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->key),((void *)arrayObject_obj->data),(624 * (sizeof(long)))); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":555 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":567 */ ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->pos = __pyx_v_pos; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":556 */ - ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":568 */ + __pyx_3 = PyInt_AsLong(__pyx_v_has_gauss); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; goto __pyx_L1;} + ((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state->has_gauss = __pyx_3; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":569 */ + __pyx_7 = PyFloat_AsDouble(__pyx_v_cached_gaussian); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; 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_2); Py_XDECREF(__pyx_4); - Py_XDECREF(__pyx_5); + Py_XDECREF(__pyx_6); __Pyx_AddTraceback("mtrand.RandomState.set_state"); __pyx_r = 0; __pyx_L0:; Py_DECREF(arrayObject_obj); Py_DECREF(__pyx_v_algorithm_name); Py_DECREF(__pyx_v_key); + Py_DECREF(__pyx_v_has_gauss); + Py_DECREF(__pyx_v_cached_gaussian); Py_DECREF(__pyx_v_self); Py_DECREF(__pyx_v_state); return __pyx_r; @@ -2199,8 +2253,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 = 560; goto __pyx_L1;} - __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; __pyx_r = __pyx_2; __pyx_2 = 0; @@ -2229,11 +2283,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 = 563; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_state); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; 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 = 563; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -2265,16 +2319,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__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_random); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; 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 = 566; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___RandomState_ctor); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; 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 = 566; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;} - __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 566; goto __pyx_L1;} + __pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_get_state); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; 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 = 566; goto __pyx_L1;} + __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; 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); @@ -2310,7 +2364,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 = 574; 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 = 587; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -2338,7 +2392,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 = 581; 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 = 594; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -2388,54 +2442,54 @@ Py_INCREF(__pyx_v_size); arrayObject = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":596 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":609 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":597 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":610 */ __pyx_v_lo = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":598 */ - __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":611 */ + __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; goto __pyx_L1;} __pyx_v_hi = __pyx_2; goto __pyx_L2; } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":600 */ - __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 600; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":613 */ + __pyx_2 = PyInt_AsLong(__pyx_v_low); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; goto __pyx_L1;} __pyx_v_lo = __pyx_2; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":601 */ - __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":614 */ + __pyx_2 = PyInt_AsLong(__pyx_v_high); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 614; goto __pyx_L1;} __pyx_v_hi = __pyx_2; } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":603 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":616 */ __pyx_v_diff = ((__pyx_v_hi - __pyx_v_lo) - 1); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":604 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":617 */ __pyx_1 = (__pyx_v_diff < 0); if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;} Py_INCREF(__pyx_k71p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k71p); - __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 605; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 618; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":607 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":620 */ __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 = 608; 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 = 621; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -2443,17 +2497,17 @@ } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":610 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":623 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_empty); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_size); 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 = 610; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); @@ -2461,18 +2515,18 @@ arrayObject = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":611 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":624 */ __pyx_v_length = PyArray_SIZE(arrayObject); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":612 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":625 */ __pyx_v_array_data = ((long *)arrayObject->data); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":613 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":626 */ 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":615 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":628 */ Py_INCREF(((PyObject *)arrayObject)); __pyx_r = ((PyObject *)arrayObject); goto __pyx_L0; @@ -2509,19 +2563,19 @@ Py_INCREF(__pyx_v_self); __pyx_v_bytestring = Py_None; Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":623 */ - __pyx_1 = PyString_FromStringAndSize(NULL,__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":636 */ + __pyx_1 = PyString_FromStringAndSize(NULL,__pyx_v_length); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; goto __pyx_L1;} Py_DECREF(__pyx_v_bytestring); __pyx_v_bytestring = __pyx_1; __pyx_1 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":624 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":637 */ __pyx_v_bytes = PyString_AS_STRING(__pyx_v_bytestring); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":625 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":638 */ rk_fill(__pyx_v_bytes,__pyx_v_length,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":626 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":639 */ Py_INCREF(__pyx_v_bytestring); __pyx_r = __pyx_v_bytestring; goto __pyx_L0; @@ -2571,16 +2625,16 @@ __pyx_v_odiff = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_temp = Py_None; Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":637 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":650 */ __pyx_v_flow = PyFloat_AsDouble(__pyx_v_low); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":638 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":651 */ __pyx_v_fhigh = PyFloat_AsDouble(__pyx_v_high); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":639 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":652 */ __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 = 640; 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 = 653; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -2588,51 +2642,51 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":641 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":654 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":642 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":655 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_low,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 655; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":643 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":656 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_high,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":644 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":657 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_subtract); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; 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 = 644; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; 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 = 644; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; 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; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":645 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":658 */ Py_INCREF(__pyx_v_temp); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":647 */ - __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":660 */ + __pyx_3 = PyArray_EnsureArray(__pyx_v_temp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 660; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":648 */ - __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 = 648; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":661 */ + __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 = 661; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -2680,11 +2734,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 = 661; goto __pyx_L1;} + __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; 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 = 662; goto __pyx_L1;} - __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 662; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_4; __pyx_4 = 0; @@ -2692,11 +2746,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 = 664; goto __pyx_L1;} - __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} - __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} - if (PyDict_SetItem(__pyx_5, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} - __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_random_sample); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} + __pyx_4 = PyTuple_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} + __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} + if (PyDict_SetItem(__pyx_5, __pyx_n_size, __pyx_v_args) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} + __pyx_6 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_4, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; @@ -2742,11 +2796,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 = 676; goto __pyx_L1;} + __pyx_1 = PyObject_Length(__pyx_v_args); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; 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 = 677; goto __pyx_L1;} - __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_4; __pyx_4 = 0; @@ -2754,11 +2808,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 = 679; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 679; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; 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 = 679; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; __pyx_r = __pyx_5; @@ -2803,17 +2857,17 @@ Py_INCREF(__pyx_v_high); Py_INCREF(__pyx_v_size); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":688 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":701 */ __pyx_1 = __pyx_v_high == Py_None; if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":689 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":702 */ Py_INCREF(__pyx_v_low); Py_DECREF(__pyx_v_high); __pyx_v_high = __pyx_v_low; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":690 */ - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":703 */ + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;} Py_DECREF(__pyx_v_low); __pyx_v_low = __pyx_2; __pyx_2 = 0; @@ -2821,19 +2875,19 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":691 */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;} - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;} - __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":704 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_randint); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;} + __pyx_4 = PyNumber_Add(__pyx_v_high, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; 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 = 691; goto __pyx_L1;} + __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; 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 = 691; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_r = __pyx_4; @@ -2867,7 +2921,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 = 699; 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 = 712; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -2921,35 +2975,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":709 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":722 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":710 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":723 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":711 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":724 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":712 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":725 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; goto __pyx_L1;} Py_INCREF(__pyx_k73p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k73p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 713; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":714 */ - __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 = 714; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":727 */ + __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 = 727; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -2957,64 +3011,64 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":716 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":729 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":718 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":731 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 731; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":719 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":732 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":720 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":733 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; 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 = 720; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; 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 = 720; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; goto __pyx_L1;} Py_INCREF(__pyx_k74p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k74p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 721; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; 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 = 721; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":722 */ - __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 = 722; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":735 */ + __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 = 735; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -3074,52 +3128,52 @@ __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ob = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":732 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":745 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":733 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":746 */ __pyx_v_fb = PyFloat_AsDouble(__pyx_v_b); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":734 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":747 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":735 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":748 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;} Py_INCREF(__pyx_k75p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k75p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 736; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":737 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":750 */ __pyx_1 = (__pyx_v_fb <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; 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 = 738; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 738; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":739 */ - __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 = 739; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":752 */ + __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 = 752; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3127,103 +3181,103 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":741 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":754 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":743 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":756 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":744 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":757 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_b,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_ob)); __pyx_v_ob = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":745 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":758 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; 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 = 745; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; 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 = 745; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;} Py_INCREF(__pyx_k77p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k77p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; 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 = 746; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":747 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":760 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; 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 = 747; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; 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 = 747; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; 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 = 747; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 760; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; goto __pyx_L1;} Py_INCREF(__pyx_k78p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k78p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 748; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":749 */ - __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 = 749; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":762 */ + __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 = 762; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -3275,32 +3329,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":759 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":772 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":760 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":773 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":761 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":774 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} Py_INCREF(__pyx_k79p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k79p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 762; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 775; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":763 */ - __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 = 763; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":776 */ + __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 = 776; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3308,57 +3362,57 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":765 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":778 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":767 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":780 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":768 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":781 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; 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 = 768; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; 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 = 768; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; 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 = 768; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; 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 = 768; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; 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 = 768; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;} Py_INCREF(__pyx_k80p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k80p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 769; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":770 */ - __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 = 770; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":783 */ + __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 = 783; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -3391,7 +3445,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 = 777; 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 = 790; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -3435,32 +3489,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":787 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":800 */ __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":788 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":801 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":789 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":802 */ __pyx_1 = (__pyx_v_fshape <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;} Py_INCREF(__pyx_k81p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k81p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 790; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":791 */ - __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 = 791; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":804 */ + __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 = 804; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3468,57 +3522,57 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":793 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":806 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":794 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":807 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":795 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":808 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 795; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 795; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 795; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 795; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; 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 = 795; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;} Py_INCREF(__pyx_k82p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k82p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 796; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":797 */ - __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 = 797; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":810 */ + __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 = 810; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -3577,52 +3631,52 @@ __pyx_v_oshape = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":807 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":820 */ __pyx_v_fshape = PyFloat_AsDouble(__pyx_v_shape); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":808 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":821 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":809 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":822 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":810 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":823 */ __pyx_1 = (__pyx_v_fshape <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} Py_INCREF(__pyx_k83p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k83p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 811; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":812 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":825 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; 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 = 813; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 813; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":814 */ - __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 = 814; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":827 */ + __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 = 827; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3630,103 +3684,103 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":816 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":829 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":817 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":830 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_shape,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":818 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":831 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":819 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":832 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; 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 = 819; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; 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 = 819; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;} Py_INCREF(__pyx_k85p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k85p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; 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 = 820; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":821 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":834 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 821; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 821; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; 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 = 821; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} Py_INCREF(__pyx_k86p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k86p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 822; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":823 */ - __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 = 823; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":836 */ + __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 = 836; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -3786,52 +3840,52 @@ __pyx_v_odfnum = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":833 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":846 */ __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":834 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":847 */ __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":835 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":848 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":836 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":849 */ __pyx_1 = (__pyx_v_fdfnum <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; goto __pyx_L1;} Py_INCREF(__pyx_k87p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k87p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 837; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 837; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":838 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":851 */ __pyx_1 = (__pyx_v_fdfden <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; 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 = 839; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 839; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 852; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":840 */ - __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 = 840; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":853 */ + __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 = 853; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -3839,103 +3893,103 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":842 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":855 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":844 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":857 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":845 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":858 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; 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":846 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":859 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; 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 = 846; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; 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 = 846; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;} Py_INCREF(__pyx_k89p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k89p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; 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 = 847; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":848 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":861 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; 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 = 848; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; 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 = 848; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; 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 = 848; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} Py_INCREF(__pyx_k90p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k90p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 849; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":850 */ - __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 = 850; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":863 */ + __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 = 863; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -4006,72 +4060,72 @@ __pyx_v_odfden = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":860 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":873 */ __pyx_v_fdfnum = PyFloat_AsDouble(__pyx_v_dfnum); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":861 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":874 */ __pyx_v_fdfden = PyFloat_AsDouble(__pyx_v_dfden); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":862 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":875 */ __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":863 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":876 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":864 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":877 */ __pyx_1 = (__pyx_v_fdfnum <= 1); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; goto __pyx_L1;} Py_INCREF(__pyx_k91p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k91p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 865; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 878; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":866 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":879 */ __pyx_1 = (__pyx_v_fdfden <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; 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 = 867; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 867; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":868 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":881 */ __pyx_1 = (__pyx_v_fnonc < 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; 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 = 869; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 869; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":870 */ - __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 = 870; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":883 */ + __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 = 883; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4079,149 +4133,149 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":873 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":886 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":875 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":888 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_dfnum,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":876 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":889 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_dfden,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; 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":877 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":890 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":879 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":892 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; 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 = 879; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; 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_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; 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 = 879; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 892; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__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_k94p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k94p); - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; 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 = 880; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":881 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":894 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_odfden)); 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 = 881; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; 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 = 881; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; 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 = 881; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 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 = 881; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;} Py_INCREF(__pyx_k95p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k95p); - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 882; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":883 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":896 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; 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 = 883; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_ononc)); 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 = 883; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; 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 = 883; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; 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 = 883; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; 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 = 883; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 896; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;} Py_INCREF(__pyx_k96p); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k96p); - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; 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 = 884; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 897; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":885 */ - __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 = 885; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":898 */ + __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 = 898; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4274,32 +4328,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":896 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":909 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":897 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":910 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":898 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":911 */ __pyx_1 = (__pyx_v_fdf <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;} Py_INCREF(__pyx_k97p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k97p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 899; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":900 */ - __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 = 900; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":913 */ + __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 = 913; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4307,57 +4361,57 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":902 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":915 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":904 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 904; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":917 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 917; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":905 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":918 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; 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 = 905; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; 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 = 905; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; 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 = 905; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; 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 = 905; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; 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 = 905; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;} Py_INCREF(__pyx_k98p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k98p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 906; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 906; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":907 */ - __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 = 907; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":920 */ + __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 = 920; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -4415,52 +4469,52 @@ __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_ononc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":916 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":929 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":917 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":930 */ __pyx_v_fnonc = PyFloat_AsDouble(__pyx_v_nonc); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":918 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":931 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":919 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":932 */ __pyx_1 = (__pyx_v_fdf <= 1); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} Py_INCREF(__pyx_k99p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k99p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 920; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":921 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":934 */ __pyx_1 = (__pyx_v_fnonc <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; 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 = 922; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 922; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":923 */ - __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 = 923; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":936 */ + __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 = 936; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4468,103 +4522,103 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":926 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":939 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":928 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":941 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 941; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":929 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 929; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":942 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_nonc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_ononc)); __pyx_v_ononc = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":930 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":943 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; 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 = 930; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; 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 = 930; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 930; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 943; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;} Py_INCREF(__pyx_k101p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k101p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; 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 = 931; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":932 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":945 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; 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 = 932; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; 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 = 932; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; 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 = 932; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;} Py_INCREF(__pyx_k102p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k102p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 933; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":934 */ - __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 = 934; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":947 */ + __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 = 947; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -4599,7 +4653,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 = 942; 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 = 955; goto __pyx_L1;} __pyx_r = __pyx_1; __pyx_1 = 0; goto __pyx_L0; @@ -4643,32 +4697,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_odf = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":952 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":965 */ __pyx_v_fdf = PyFloat_AsDouble(__pyx_v_df); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":953 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":966 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":954 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":967 */ __pyx_1 = (__pyx_v_fdf <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;} Py_INCREF(__pyx_k103p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k103p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 955; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":956 */ - __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 = 956; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":969 */ + __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 = 969; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4676,57 +4730,57 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":958 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":971 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":960 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":973 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_df,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 973; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":961 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":974 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; 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 = 961; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; 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 = 961; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; 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 = 961; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; 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 = 961; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; 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 = 961; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 974; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; goto __pyx_L1;} Py_INCREF(__pyx_k104p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k104p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 962; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 962; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":963 */ - __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 = 963; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":976 */ + __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 = 976; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -4780,35 +4834,35 @@ __pyx_v_omu = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_okappa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":974 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":987 */ __pyx_v_fmu = PyFloat_AsDouble(__pyx_v_mu); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":975 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":988 */ __pyx_v_fkappa = PyFloat_AsDouble(__pyx_v_kappa); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":976 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":989 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":977 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":990 */ __pyx_1 = (__pyx_v_fkappa < 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; goto __pyx_L1;} Py_INCREF(__pyx_k105p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k105p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 978; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 991; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":979 */ - __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 = 979; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":992 */ + __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 = 992; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4816,64 +4870,64 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":981 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":994 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":983 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 983; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":996 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_mu,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 996; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":984 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":997 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_kappa,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_okappa)); __pyx_v_okappa = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":985 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":998 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; 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 = 985; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; 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 = 985; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 985; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 998; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; goto __pyx_L1;} Py_INCREF(__pyx_k106p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k106p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; 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 = 986; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":987 */ - __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 = 987; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1000 */ + __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 = 1000; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -4924,32 +4978,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":997 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1010 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":998 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1011 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":999 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1012 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;} Py_INCREF(__pyx_k107p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k107p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1000; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1000; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1001 */ - __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 = 1001; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1014 */ + __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 = 1014; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -4957,57 +5011,57 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1003 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1016 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1005 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1018 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1018; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1006 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1019 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; 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 = 1006; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; 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 = 1006; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; 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 = 1006; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; 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 = 1006; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; 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 = 1006; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; goto __pyx_L1;} Py_INCREF(__pyx_k108p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k108p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1007; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1020; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1008 */ - __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 = 1008; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1021 */ + __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 = 1021; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5056,32 +5110,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1018 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1031 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1019 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1032 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1020 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1033 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; goto __pyx_L1;} Py_INCREF(__pyx_k109p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k109p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1021; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1022 */ - __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 = 1022; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1035 */ + __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 = 1035; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5089,57 +5143,57 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1024 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1037 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1026 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1039 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1027 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1040 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; 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 = 1027; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; 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 = 1027; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; 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 = 1027; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; 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 = 1027; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; 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 = 1027; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; goto __pyx_L1;} Py_INCREF(__pyx_k110p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k110p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1028; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1041; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1029 */ - __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 = 1029; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1042 */ + __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 = 1042; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5188,32 +5242,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1039 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1052 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1040 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1053 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1041 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1054 */ __pyx_1 = (__pyx_v_fa <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; goto __pyx_L1;} Py_INCREF(__pyx_k111p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k111p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1042; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1042; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1055; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1043 */ - __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 = 1043; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1056 */ + __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 = 1056; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5221,57 +5275,57 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1045 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1058 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1047 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1060 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1060; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1048 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1061 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; 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 = 1048; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; 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 = 1048; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; 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 = 1048; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; 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 = 1048; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; 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 = 1048; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1061; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; goto __pyx_L1;} Py_INCREF(__pyx_k112p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k112p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1049; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1050 */ - __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 = 1050; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1063 */ + __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 = 1063; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5327,35 +5381,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1060 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1073 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1061 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1074 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1062 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1075 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1063 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1076 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; goto __pyx_L1;} Py_INCREF(__pyx_k113p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k113p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1064; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1064; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1077; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1065 */ - __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 = 1065; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1078 */ + __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 = 1078; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5363,64 +5417,64 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1067 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1080 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1068 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1081 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1081; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1069 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1082 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1082; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1070 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1083 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; 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 = 1070; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; 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 = 1070; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;} Py_INCREF(__pyx_k114p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k114p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1071; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; 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 = 1071; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1072 */ - __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 = 1072; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1085 */ + __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 = 1085; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5478,35 +5532,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1082 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1095 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1083 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1096 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1084 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1097 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1085 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1098 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; goto __pyx_L1;} Py_INCREF(__pyx_k115p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k115p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1086; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1087 */ - __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 = 1087; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1100 */ + __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 = 1100; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5514,64 +5568,64 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1089 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1102 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1090 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1090; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1103 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1091 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1104 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1104; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1092 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1105 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; 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 = 1092; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__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;} Py_INCREF(((PyObject *)__pyx_v_oscale)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_oscale)); 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 = 1092; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; 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 = 1092; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1105; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;} Py_INCREF(__pyx_k116p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k116p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; 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 = 1093; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1094 */ - __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 = 1094; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1107 */ + __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 = 1107; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5629,35 +5683,35 @@ __pyx_v_oloc = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1104 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1117 */ __pyx_v_floc = PyFloat_AsDouble(__pyx_v_loc); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1105 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1118 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1106 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1119 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1107 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1120 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; goto __pyx_L1;} Py_INCREF(__pyx_k117p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k117p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1108; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1108; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1109 */ - __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 = 1109; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1122 */ + __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 = 1122; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5665,64 +5719,64 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1111 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1124 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1112 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1125 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_loc,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oloc)); __pyx_v_oloc = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1113 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1126 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1114 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1127 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; 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 = 1114; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; 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 = 1114; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; goto __pyx_L1;} Py_INCREF(__pyx_k118p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k118p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1115; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; 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 = 1115; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1128; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1116 */ - __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 = 1116; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1129 */ + __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 = 1129; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5780,35 +5834,35 @@ __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_osigma = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1131 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1144 */ __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1132 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1145 */ __pyx_v_fsigma = PyFloat_AsDouble(__pyx_v_sigma); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1134 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1147 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1135 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1148 */ __pyx_1 = (__pyx_v_fsigma <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; goto __pyx_L1;} Py_INCREF(__pyx_k119p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k119p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1136; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1137 */ - __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 = 1137; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1150 */ + __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 = 1150; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5816,64 +5870,64 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1139 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1152 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1141 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1154 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1154; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); __pyx_v_omean = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1142 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1155 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_sigma,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_osigma)); __pyx_v_osigma = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1143 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1156 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; 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 = 1143; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; 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 = 1143; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__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_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1143; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;} Py_INCREF(__pyx_k120p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k120p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; 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 = 1144; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1145 */ - __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 = 1145; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1158 */ + __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 = 1158; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -5925,32 +5979,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1155 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1168 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1157 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1170 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1158 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1171 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; goto __pyx_L1;} Py_INCREF(__pyx_k121p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k121p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1159; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1172; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1160 */ - __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 = 1160; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1173 */ + __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 = 1173; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -5958,57 +6012,57 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1162 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1175 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1164 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1164; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1177 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1165 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1178 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; 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 = 1165; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; 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 = 1165; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; 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 = 1165; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; 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 = 1165; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; 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 = 1165; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;} Py_INCREF(__pyx_k122p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k122p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1166; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1167 */ - __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 = 1167; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1180 */ + __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 = 1180; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -6066,52 +6120,52 @@ __pyx_v_omean = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oscale = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1177 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1190 */ __pyx_v_fmean = PyFloat_AsDouble(__pyx_v_mean); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1178 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1191 */ __pyx_v_fscale = PyFloat_AsDouble(__pyx_v_scale); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1179 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1192 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1180 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1193 */ __pyx_1 = (__pyx_v_fmean <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); 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 = 1194; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; goto __pyx_L1;} Py_INCREF(__pyx_k123p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k123p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1181; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1182 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1195 */ __pyx_1 = (__pyx_v_fscale <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); 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 = 1196; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; 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 = 1183; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1183; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1184 */ - __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 = 1184; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1197 */ + __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 = 1197; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6119,100 +6173,100 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1186 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1199 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1187 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1200 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_mean,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_omean)); __pyx_v_omean = ((PyArrayObject *)__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1188 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; goto __pyx_L1;} - if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1188; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1201 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_scale,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} + if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_6mtrand_ndarray)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1201; goto __pyx_L1;} Py_DECREF(((PyObject *)__pyx_v_oscale)); __pyx_v_oscale = ((PyArrayObject *)__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1189 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1202 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; 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 = 1189; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(0.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; 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_4); __pyx_4 = 0; - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; 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 = 1189; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1202; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__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_k125p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k125p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; 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 = 1190; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1203; goto __pyx_L1;} goto __pyx_L5; } - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(0.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; 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 = 1191; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; 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 = 1191; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; 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 = 1191; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; goto __pyx_L1;} Py_INCREF(__pyx_k126p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k126p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 1192; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1193 */ - __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 = 1193; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1206 */ + __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 = 1206; goto __pyx_L1;} __pyx_r = __pyx_3; __pyx_3 = 0; goto __pyx_L0; @@ -6284,72 +6338,72 @@ __pyx_v_omode = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_oright = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1206 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1219 */ __pyx_v_fleft = PyFloat_AsDouble(__pyx_v_left); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1207 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1220 */ __pyx_v_fright = PyFloat_AsDouble(__pyx_v_right); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1208 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1221 */ __pyx_v_fmode = PyFloat_AsDouble(__pyx_v_mode); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1209 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1222 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1210 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1223 */ __pyx_1 = (__pyx_v_fleft > __pyx_v_fmode); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__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;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} Py_INCREF(__pyx_k127p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k127p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1211; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1212 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1225 */ __pyx_1 = (__pyx_v_fmode > __pyx_v_fright); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; 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 = 1213; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1213; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1214 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1227 */ __pyx_1 = (__pyx_v_fleft == __pyx_v_fright); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; 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 = 1215; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1215; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1216 */ - __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 = 1216; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1229 */ + __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 = 1229; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6357,146 +6411,146 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1219 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1232 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1220 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1220; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1233 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_left,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1221 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1234 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_mode,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; 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":1222 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1235 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_right,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_2))); Py_DECREF(((PyObject *)__pyx_v_oright)); __pyx_v_oright = ((PyArrayObject *)__pyx_2); Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1224 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1237 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; 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 = 1224; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; 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_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; 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 = 1224; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); __pyx_5 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; 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 = 1224; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1237; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;} Py_INCREF(__pyx_k130p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k130p); - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; 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 = 1225; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1226 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1239 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_omode)); PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_omode)); Py_INCREF(((PyObject *)__pyx_v_oright)); 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 = 1226; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; 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 = 1226; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; 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 = 1226; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; 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 = 1226; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;} Py_INCREF(__pyx_k131p); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k131p); - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1227; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; 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 = 1227; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1240; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1228 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1241 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_equal); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_oleft)); PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_oleft)); Py_INCREF(((PyObject *)__pyx_v_oright)); 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 = 1228; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; 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 = 1228; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5); __pyx_5 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; 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 = 1228; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1241; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; goto __pyx_L1;} Py_INCREF(__pyx_k132p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k132p); - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1229; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; 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 = 1229; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1242; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1230 */ - __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 = 1230; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1243 */ + __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 = 1243; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6562,66 +6616,66 @@ __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1243 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1256 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1244 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1257 */ __pyx_v_ln = PyInt_AsLong(__pyx_v_n); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1245 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1258 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1246 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1259 */ __pyx_1 = (__pyx_v_ln <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} Py_INCREF(__pyx_k133p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k133p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1247; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1247; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1248 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1261 */ __pyx_1 = (__pyx_v_fp < 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; 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 = 1249; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1249; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} goto __pyx_L4; } __pyx_1 = (__pyx_v_fp > 1); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; 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 = 1251; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1251; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1252 */ - __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 = 1252; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1265 */ + __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 = 1265; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6629,142 +6683,142 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1254 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1267 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1256 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1269 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1257 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1270 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_op)); __pyx_v_op = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1258 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1271 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; 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 = 1258; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} Py_INCREF(__pyx_v_n); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n); 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 = 1258; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; 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 = 1258; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;} Py_INCREF(__pyx_k136p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k136p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1259; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; 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 = 1259; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1260 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1273 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); 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 = 1260; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; 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 = 1260; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; 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 = 1260; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; 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 = 1260; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;} Py_INCREF(__pyx_k137p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k137p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 1261; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1262 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1275 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p); 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 = 1262; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; 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 = 1262; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; goto __pyx_L1;} Py_INCREF(__pyx_k138p); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k138p); - __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; 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_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1264 */ - __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 = 1264; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1277 */ + __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 = 1277; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; @@ -6828,66 +6882,66 @@ __pyx_v_on = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1276 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1289 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1277 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1290 */ __pyx_v_ln = PyInt_AsLong(__pyx_v_n); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1278 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1291 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1279 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1292 */ __pyx_1 = (__pyx_v_ln <= 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} Py_INCREF(__pyx_k139p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k139p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1280; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1280; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1281 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1294 */ __pyx_1 = (__pyx_v_fp < 0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1282; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; 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 = 1282; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1282; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} goto __pyx_L4; } __pyx_1 = (__pyx_v_fp > 1); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; 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 = 1284; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1284; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1285 */ - __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 = 1285; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1298 */ + __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 = 1298; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -6895,142 +6949,142 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1288 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1301 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1290 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1303 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_n,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1291 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1291; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1304 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_op)); __pyx_v_op = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1292 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1305 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_less_equal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; 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 = 1292; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;} Py_INCREF(__pyx_v_n); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_n); 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 = 1292; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; 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 = 1292; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;} Py_INCREF(__pyx_k142p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k142p); - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1293; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; 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 = 1293; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1294 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1307 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} - __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_p); 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 = 1294; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; 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 = 1294; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; 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 = 1294; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; 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 = 1294; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1307; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;} Py_INCREF(__pyx_k143p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k143p); - __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1295; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 1295; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1296 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1309 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_greater); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} Py_INCREF(__pyx_v_p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_p); 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 = 1296; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; 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 = 1296; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1296; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; goto __pyx_L1;} Py_INCREF(__pyx_k144p); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k144p); - __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1297; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; 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_filename = __pyx_f[0]; __pyx_lineno = 1297; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1298 */ - __pyx_4 = __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_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1311 */ + __pyx_4 = __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_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} __pyx_r = __pyx_4; __pyx_4 = 0; goto __pyx_L0; @@ -7082,35 +7136,35 @@ Py_INCREF(__pyx_v_size); __pyx_v_olam = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1308 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1321 */ __pyx_v_flam = PyFloat_AsDouble(__pyx_v_lam); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1309 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1322 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1310 */ - __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_lam, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1323 */ + __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_lam, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); 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 = 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_k145p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k145p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;} + __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; 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 = 1311; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1324; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1312 */ - __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 = 1312; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1325 */ + __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 = 1325; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7118,57 +7172,57 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1314 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1327 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1316 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1329 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_lam,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_olam)); __pyx_v_olam = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1317 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1330 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); 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__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; 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 = 1317; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(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_olam)); PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_olam)); 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 = 1317; goto __pyx_L1;} + __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 = 1317; goto __pyx_L1;} + __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 = 1317; goto __pyx_L1;} + __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 = 1317; 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_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; 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_k146p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k146p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; goto __pyx_L1;} + __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_4, 0, 0); Py_DECREF(__pyx_4); __pyx_4 = 0; - {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1319 */ - __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 = 1319; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1332 */ + __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 = 1332; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -7217,32 +7271,32 @@ Py_INCREF(__pyx_v_size); __pyx_v_oa = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1329 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1342 */ __pyx_v_fa = PyFloat_AsDouble(__pyx_v_a); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1330 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1343 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1331 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1344 */ __pyx_1 = (__pyx_v_fa <= 1.0); if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; goto __pyx_L1;} Py_INCREF(__pyx_k147p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k147p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1332; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1333 */ - __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 = 1333; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1346 */ + __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 = 1346; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7250,57 +7304,57 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1335 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1348 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1337 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1350 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_a,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1338 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1351 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less_equal); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; 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 = 1338; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(1.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; 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 = 1338; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; 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 = 1338; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; 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 = 1338; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; 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 = 1338; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; goto __pyx_L1;} Py_INCREF(__pyx_k148p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k148p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1339; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1340 */ - __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 = 1340; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1353 */ + __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 = 1353; goto __pyx_L1;} __pyx_r = __pyx_5; __pyx_5 = 0; goto __pyx_L0; @@ -7353,49 +7407,49 @@ Py_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1351 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1364 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1352 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1365 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1353 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1366 */ __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 = 1354; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; goto __pyx_L1;} Py_INCREF(__pyx_k149p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k149p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1354; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1355 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1368 */ __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 = 1356; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1356; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; 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 = 1356; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1356; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1357 */ - __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 = 1357; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1370 */ + __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 = 1370; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7403,96 +7457,96 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1359 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1372 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1362 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1362; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1375 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1363 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1376 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; 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 = 1363; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; 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_3); __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1363; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; 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 = 1363; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; 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 = 1363; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; 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 = 1363; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1376; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;} Py_INCREF(__pyx_k151p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k151p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1364; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1365 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1378 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; 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 = 1365; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; 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 = 1365; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} 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 = 1365; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; goto __pyx_L1;} Py_INCREF(__pyx_k152p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k152p); - __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1366; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; 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_filename = __pyx_f[0]; __pyx_lineno = 1366; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1379; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1367 */ - __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 = 1367; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1380 */ + __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 = 1380; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7566,101 +7620,101 @@ __pyx_v_onbad = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); __pyx_v_onsample = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1382 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1395 */ __pyx_v_lngood = PyInt_AsLong(__pyx_v_ngood); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1383 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1396 */ __pyx_v_lnbad = PyInt_AsLong(__pyx_v_nbad); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1384 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1397 */ __pyx_v_lnsample = PyInt_AsLong(__pyx_v_nsample); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1385 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1398 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1386 */ - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_ngood, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1386; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1399 */ + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_ngood, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; goto __pyx_L1;} Py_INCREF(__pyx_k153p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k153p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1387; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1387; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1388 */ - __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_nbad, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1401 */ + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_nbad, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;} Py_INCREF(__pyx_k154p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k154p); - __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1389; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; 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 = 1389; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1390 */ - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_v_nsample, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1403 */ + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_v_nsample, __pyx_3, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} Py_INCREF(__pyx_k155p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k155p); - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; 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 = 1391; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1392 */ - __pyx_4 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; goto __pyx_L1;} - if (PyObject_Cmp(__pyx_4, __pyx_v_nsample, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1405 */ + __pyx_4 = PyNumber_Add(__pyx_v_ngood, __pyx_v_nbad); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_4, __pyx_v_nsample, &__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} __pyx_1 = __pyx_1 < 0; Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} Py_INCREF(__pyx_k156p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k156p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1393; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1393; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1394 */ - __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 = 1394; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1407 */ + __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 = 1407; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7668,198 +7722,198 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1398 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1411 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1400 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1413 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_ngood,NPY_LONG,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1413; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_3))); Py_DECREF(((PyObject *)__pyx_v_ongood)); __pyx_v_ongood = ((PyArrayObject *)__pyx_3); Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1401 */ - __pyx_4 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1401; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1414 */ + __pyx_4 = PyArray_FROM_OTF(__pyx_v_nbad,NPY_LONG,NPY_ALIGNED); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1414; goto __pyx_L1;} Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_4))); Py_DECREF(((PyObject *)__pyx_v_onbad)); __pyx_v_onbad = ((PyArrayObject *)__pyx_4); Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1402 */ - __pyx_2 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1415 */ + __pyx_2 = PyArray_FROM_OTF(__pyx_v_nsample,NPY_LONG,NPY_ALIGNED); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1403 */ - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1416 */ + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; 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 = 1403; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; 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_2); __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; 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 = 1403; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;} Py_INCREF(__pyx_k157p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k157p); - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; 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 = 1404; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1417; goto __pyx_L1;} goto __pyx_L7; } __pyx_L7:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1405 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1418 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_4, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_onbad)); 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 = 1405; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; 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 = 1405; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; 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 = 1405; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 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 = 1405; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;} Py_INCREF(__pyx_k158p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k158p); - __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 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 = 1406; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;} goto __pyx_L8; } __pyx_L8:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1407 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1420 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1407; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_onsample)); 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 = 1407; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; 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 = 1407; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; 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 = 1407; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; 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 = 1407; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} - __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;} + __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;} Py_INCREF(__pyx_k159p); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k159p); - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; 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 = 1408; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; goto __pyx_L1;} goto __pyx_L9; } __pyx_L9:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1409 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1422 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_any); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_less); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} - __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;} + __pyx_5 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; 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 = 1409; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;} Py_INCREF(((PyObject *)__pyx_v_ongood)); PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_ongood)); Py_INCREF(((PyObject *)__pyx_v_onbad)); 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 = 1409; goto __pyx_L1;} + __pyx_6 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_5, 0, __pyx_6); Py_INCREF(((PyObject *)__pyx_v_onsample)); PyTuple_SET_ITEM(__pyx_5, 1, ((PyObject *)__pyx_v_onsample)); __pyx_6 = 0; - __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; 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 = 1409; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; 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 = 1409; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; goto __pyx_L1;} Py_INCREF(__pyx_k160p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k160p); - __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; 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 = 1410; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1423; goto __pyx_L1;} goto __pyx_L10; } __pyx_L10:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1411 */ - __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 = 1411; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1424 */ + __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 = 1424; goto __pyx_L1;} __pyx_r = __pyx_6; __pyx_6 = 0; goto __pyx_L0; @@ -7917,49 +7971,49 @@ Py_INCREF(__pyx_v_size); __pyx_v_op = ((PyArrayObject *)Py_None); Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1422 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1435 */ __pyx_v_fp = PyFloat_AsDouble(__pyx_v_p); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1423 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1436 */ __pyx_1 = (!PyErr_Occurred()); if (__pyx_1) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1424 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1437 */ __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 = 1425; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; goto __pyx_L1;} Py_INCREF(__pyx_k161p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k161p); - __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1425; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1425; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1438; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1426 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1439 */ __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 = 1427; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1427; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; 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 = 1427; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1427; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1440; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1428 */ - __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 = 1428; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1441 */ + __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 = 1441; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -7967,96 +8021,96 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1430 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1443 */ PyErr_Clear(); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1432 */ - __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1432; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1445 */ + __pyx_3 = PyArray_FROM_OTF(__pyx_v_p,NPY_DOUBLE,NPY_ALIGNED); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1433 */ - __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1446 */ + __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_any); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_3, __pyx_n_less); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; 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 = 1433; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; 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_3); __pyx_3 = 0; - __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1433; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; 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 = 1433; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; 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 = 1433; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; 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 = 1433; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_5); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1446; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; if (__pyx_1) { - __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;} Py_INCREF(__pyx_k163p); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k163p); - __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1434; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 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 = 1434; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1447; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1435 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1448 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_5, __pyx_n_any); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_greater); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; 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 = 1435; goto __pyx_L1;} - __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} + __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; 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_5); __pyx_5 = 0; - __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1435; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; 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 = 1435; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;} 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 = 1435; goto __pyx_L1;} + __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_1) { - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} Py_INCREF(__pyx_k164p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k164p); - __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; 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_filename = __pyx_f[0]; __pyx_lineno = 1436; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1449; goto __pyx_L1;} goto __pyx_L6; } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1437 */ - __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 = 1437; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1450 */ + __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 = 1450; goto __pyx_L1;} __pyx_r = __pyx_2; __pyx_2 = 0; goto __pyx_L0; @@ -8134,38 +8188,38 @@ __pyx_v_s = Py_None; Py_INCREF(Py_None); __pyx_v_v = Py_None; Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1458 */ - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1471 */ + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; 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 = 1458; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; 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 = 1458; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; 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; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1459 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; goto __pyx_L1;} - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1459; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1472 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_array); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; 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 = 1459; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; 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 = 1459; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; 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; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1460 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1473 */ __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 = 1461; goto __pyx_L1;} + __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; goto __pyx_L1;} Py_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_1; __pyx_1 = 0; @@ -8178,98 +8232,98 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1464 */ - __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} - __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1477 */ + __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;} + __pyx_5 = PyObject_Length(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1477; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_4 = (__pyx_5 != 1); if (__pyx_4) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;} - __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} Py_INCREF(__pyx_k165p); PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k165p); - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1465; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1465; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} goto __pyx_L3; } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1466 */ - __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} - __pyx_5 = PyObject_Length(__pyx_2); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1479 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} + __pyx_5 = PyObject_Length(__pyx_2); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_4 = (__pyx_5 != 2); if (!__pyx_4) { - __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} - __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} - __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} - __pyx_6 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} + __pyx_6 = PyObject_GetItem(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; 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 = 1466; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_2, __pyx_6, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} __pyx_4 = __pyx_4 != 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; } if (__pyx_4) { - __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;} Py_INCREF(__pyx_k166p); PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k166p); - __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 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 = 1467; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;} goto __pyx_L4; } __pyx_L4:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1468 */ - __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} - __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} - __pyx_3 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1481 */ + __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; goto __pyx_L1;} + __pyx_3 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; 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 = 1468; goto __pyx_L1;} - __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} - __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_v_cov, __pyx_n_shape); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; goto __pyx_L1;} + __pyx_6 = PyInt_FromLong(0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; goto __pyx_L1;} + __pyx_1 = PyObject_GetItem(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; - if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1468; goto __pyx_L1;} + if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1481; goto __pyx_L1;} __pyx_4 = __pyx_4 != 0; Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; if (__pyx_4) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; goto __pyx_L1;} - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; goto __pyx_L1;} Py_INCREF(__pyx_k167p); PyTuple_SET_ITEM(__pyx_6, 0, __pyx_k167p); - __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; 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 = 1469; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1482; goto __pyx_L1;} goto __pyx_L5; } __pyx_L5:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1471 */ - __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;} - __pyx_4 = PyObject_IsInstance(__pyx_v_shape,__pyx_1); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1484 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; goto __pyx_L1;} + __pyx_4 = PyObject_IsInstance(__pyx_v_shape,__pyx_1); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1484; 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 = 1472; goto __pyx_L1;} + __pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1485; goto __pyx_L1;} Py_INCREF(__pyx_v_shape); PyList_SET_ITEM(__pyx_2, 0, __pyx_v_shape); Py_DECREF(__pyx_v_shape); @@ -8279,174 +8333,174 @@ } __pyx_L6:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1473 */ - __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; 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 = 1473; goto __pyx_L1;} - __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1486 */ + __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_list); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; 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 = 1486; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; 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 = 1473; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; 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; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1474 */ - __pyx_3 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; goto __pyx_L1;} - __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; goto __pyx_L1;} - __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1487 */ + __pyx_3 = PyObject_GetAttr(__pyx_v_final_shape, __pyx_n_append); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; goto __pyx_L1;} + __pyx_6 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_6, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; 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 = 1474; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; 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 = 1474; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1478 */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} - __pyx_6 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1491 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_standard_normal); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} + __pyx_6 = PyObject_GetAttr(__pyx_3, __pyx_n_multiply); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_6, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; 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 = 1478; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} Py_INCREF(__pyx_v_final_shape); 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 = 1478; goto __pyx_L1;} + __pyx_6 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; 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 = 1478; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; 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 = 1478; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_x); __pyx_v_x = __pyx_3; __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1479 */ - __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_6, __pyx_n_multiply); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1492 */ + __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_6, __pyx_n_multiply); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} + __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_reduce); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; 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 = 1479; 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 = 1479; goto __pyx_L1;} - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} + __pyx_5 = PyObject_Length(__pyx_v_final_shape); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; 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 = 1492; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; 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 = 1479; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;} - __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;} - __pyx_6 = PyObject_GetItem(__pyx_3, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1480; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_v_mean, __pyx_n_shape); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; goto __pyx_L1;} + __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; goto __pyx_L1;} + __pyx_6 = PyObject_GetItem(__pyx_3, __pyx_1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1493; 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 = 1479; goto __pyx_L1;} + __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2); PyTuple_SET_ITEM(__pyx_3, 1, __pyx_6); __pyx_2 = 0; __pyx_6 = 0; - if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1479; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1492; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1488 */ - __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1501 */ + __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; goto __pyx_L1;} Py_INCREF(__pyx_n_svd); PyList_SET_ITEM(__pyx_1, 0, __pyx_n_svd); - __pyx_2 = __Pyx_Import(__pyx_k168p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; goto __pyx_L1;} + __pyx_2 = __Pyx_Import(__pyx_k168p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; 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 = 1488; goto __pyx_L1;} + __pyx_6 = PyObject_GetAttr(__pyx_2, __pyx_n_svd); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; goto __pyx_L1;} Py_DECREF(__pyx_v_svd); __pyx_v_svd = __pyx_6; __pyx_6 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1490 */ - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1503 */ + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;} Py_INCREF(__pyx_v_cov); 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 = 1490; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_v_svd, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; 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 = 1490; goto __pyx_L1;} + __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; 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 = 1490; goto __pyx_L1;} + __pyx_6 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;} Py_DECREF(__pyx_v_u); __pyx_v_u = __pyx_6; __pyx_6 = 0; - __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} + __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;} Py_DECREF(__pyx_v_s); __pyx_v_s = __pyx_3; __pyx_3 = 0; - __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} + __pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;} Py_DECREF(__pyx_v_v); __pyx_v_v = __pyx_1; __pyx_1 = 0; - if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; goto __pyx_L1;} + if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1503; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1491 */ - __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_6, __pyx_n_dot); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1504 */ + __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_6, __pyx_n_dot); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_sqrt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1491; goto __pyx_L1;} + __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; 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 = 1491; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_2, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1491; goto __pyx_L1;} + __pyx_2 = PyNumber_Multiply(__pyx_v_x, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; 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 = 1491; goto __pyx_L1;} + __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; 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 = 1491; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_v_x); __pyx_v_x = __pyx_1; __pyx_1 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1494 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1494; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1507 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_add); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; 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 = 1494; goto __pyx_L1;} + __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; goto __pyx_L1;} Py_INCREF(__pyx_v_mean); PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_mean); Py_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_x); Py_INCREF(__pyx_v_x); 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 = 1494; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_6); __pyx_6 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1495 */ - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; goto __pyx_L1;} - __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1508 */ + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; goto __pyx_L1;} + __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; goto __pyx_L1;} Py_INCREF(__pyx_v_final_shape); 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 = 1495; goto __pyx_L1;} + __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; 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 = 1495; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_v_x, __pyx_n_shape, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1508; goto __pyx_L1;} Py_DECREF(__pyx_6); __pyx_6 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1496 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1509 */ Py_INCREF(__pyx_v_x); __pyx_r = __pyx_v_x; goto __pyx_L0; @@ -8516,42 +8570,42 @@ __pyx_v_shape = Py_None; Py_INCREF(Py_None); __pyx_v_multin = Py_None; Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1514 */ - __pyx_1 = PyObject_Length(__pyx_v_pvals); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1527 */ + __pyx_1 = PyObject_Length(__pyx_v_pvals); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; goto __pyx_L1;} __pyx_v_d = __pyx_1; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1515 */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1528 */ + __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_pvals,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1516 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1529 */ __pyx_v_pix = ((double *)arrayObject_parr->data); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1518 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1531 */ __pyx_3 = (__pyx_f_6mtrand_kahan_sum(__pyx_v_pix,(__pyx_v_d - 1)) > (1.0 + 1e-12)); if (__pyx_3) { - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;} Py_INCREF(__pyx_k170p); PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k170p); - __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 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 = 1519; goto __pyx_L1;} + {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;} goto __pyx_L2; } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1521 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1534 */ __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 = 1522; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_shape); @@ -8559,20 +8613,20 @@ __pyx_4 = 0; goto __pyx_L3; } - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_size); - __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; goto __pyx_L1;} Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; 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 = 1524; goto __pyx_L1;} - __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_d); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; goto __pyx_L1;} + __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; 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); @@ -8583,11 +8637,11 @@ goto __pyx_L3; } /*else*/ { - __pyx_5 = PyInt_FromLong(__pyx_v_d); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;} - __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;} + __pyx_5 = PyInt_FromLong(__pyx_v_d); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; 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 = 1526; goto __pyx_L1;} + __pyx_4 = PyNumber_Add(__pyx_v_size, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_4; @@ -8595,56 +8649,56 @@ } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1528 */ - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1541 */ + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_zeros); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; 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 = 1528; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; goto __pyx_L1;} + __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; goto __pyx_L1;} Py_INCREF(__pyx_v_shape); 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 = 1528; goto __pyx_L1;} + __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_5); __pyx_5 = 0; Py_DECREF(__pyx_v_multin); __pyx_v_multin = __pyx_4; __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1529 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1542 */ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_multin))); Py_DECREF(((PyObject *)arrayObject_mnarr)); arrayObject_mnarr = ((PyArrayObject *)__pyx_v_multin); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1530 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1543 */ __pyx_v_mnix = ((long *)arrayObject_mnarr->data); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1531 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1544 */ __pyx_v_i = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1532 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1545 */ while (1) { __pyx_3 = (__pyx_v_i < PyArray_SIZE(arrayObject_mnarr)); if (!__pyx_3) break; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1533 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1546 */ __pyx_v_Sum = 1.0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1534 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1547 */ __pyx_v_dn = __pyx_v_n; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1535 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1548 */ __pyx_6 = (__pyx_v_d - 1); for (__pyx_v_j = 0; __pyx_v_j < __pyx_6; ++__pyx_v_j) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1536 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1549 */ (__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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1537 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1550 */ __pyx_v_dn = (__pyx_v_dn - (__pyx_v_mnix[(__pyx_v_i + __pyx_v_j)])); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1538 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1551 */ __pyx_3 = (__pyx_v_dn <= 0); if (__pyx_3) { goto __pyx_L7; @@ -8652,12 +8706,12 @@ } __pyx_L8:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1540 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1553 */ __pyx_v_Sum = (__pyx_v_Sum - (__pyx_v_pix[__pyx_v_j])); } __pyx_L7:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1541 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1554 */ __pyx_3 = (__pyx_v_dn > 0); if (__pyx_3) { (__pyx_v_mnix[((__pyx_v_i + __pyx_v_d) - 1)]) = __pyx_v_dn; @@ -8665,11 +8719,11 @@ } __pyx_L9:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1544 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1557 */ __pyx_v_i = (__pyx_v_i + __pyx_v_d); } - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1546 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1559 */ Py_INCREF(__pyx_v_multin); __pyx_r = __pyx_v_multin; goto __pyx_L0; @@ -8727,25 +8781,25 @@ __pyx_v_shape = Py_None; Py_INCREF(Py_None); __pyx_v_diric = Py_None; Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1603 */ - __pyx_1 = PyObject_Length(__pyx_v_alpha); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1603; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1616 */ + __pyx_1 = PyObject_Length(__pyx_v_alpha); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; goto __pyx_L1;} __pyx_v_k = __pyx_1; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1604 */ - __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1604; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1617 */ + __pyx_2 = PyArray_ContiguousFromObject(__pyx_v_alpha,NPY_DOUBLE,1,1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1605 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1618 */ __pyx_v_alpha_data = ((double *)__pyx_v_alpha_arr->data); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1607 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1620 */ __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 = 1608; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1621; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_shape); @@ -8753,20 +8807,20 @@ __pyx_4 = 0; goto __pyx_L2; } - __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; goto __pyx_L1;} Py_INCREF(__pyx_v_size); 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 = 1609; goto __pyx_L1;} + __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; 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 = 1609; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1622; 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_4 = PyInt_FromLong(__pyx_v_k); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; goto __pyx_L1;} - __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_k); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1623; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1623; goto __pyx_L1;} Py_INCREF(__pyx_v_size); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_size); PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4); @@ -8777,11 +8831,11 @@ goto __pyx_L2; } /*else*/ { - __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;} - __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; goto __pyx_L1;} + __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; goto __pyx_L1;} PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2); __pyx_2 = 0; - __pyx_5 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1612; goto __pyx_L1;} + __pyx_5 = PyNumber_Add(__pyx_v_size, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1625; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; Py_DECREF(__pyx_v_shape); __pyx_v_shape = __pyx_5; @@ -8789,70 +8843,70 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1614 */ - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; goto __pyx_L1;} - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_zeros); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1627 */ + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_zeros); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_float64); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; goto __pyx_L1;} + __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_5, __pyx_n_float64); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; 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 = 1614; goto __pyx_L1;} + __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; goto __pyx_L1;} Py_INCREF(__pyx_v_shape); PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_shape); PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2); __pyx_2 = 0; - __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1614; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1627; 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_2; __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1615 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1628 */ Py_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_diric))); Py_DECREF(((PyObject *)__pyx_v_val_arr)); __pyx_v_val_arr = ((PyArrayObject *)__pyx_v_diric); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1616 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1629 */ __pyx_v_val_data = ((double *)__pyx_v_val_arr->data); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1618 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1631 */ __pyx_v_i = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1619 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1632 */ __pyx_v_totsize = PyArray_SIZE(__pyx_v_val_arr); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1620 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1633 */ while (1) { __pyx_3 = (__pyx_v_i < __pyx_v_totsize); if (!__pyx_3) break; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1621 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1634 */ __pyx_v_acc = 0.0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1622 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1635 */ for (__pyx_v_j = 0; __pyx_v_j < __pyx_v_k; ++__pyx_v_j) { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1623 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1636 */ (__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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1624 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1637 */ __pyx_v_acc = (__pyx_v_acc + (__pyx_v_val_data[(__pyx_v_i + __pyx_v_j)])); } - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1625 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1638 */ __pyx_v_invacc = (1 / __pyx_v_acc); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1626 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1639 */ 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/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1628 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1641 */ __pyx_v_i = (__pyx_v_i + __pyx_v_k); } - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1630 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1643 */ Py_INCREF(__pyx_v_diric); __pyx_r = __pyx_v_diric; goto __pyx_L0; @@ -8897,16 +8951,16 @@ Py_INCREF(__pyx_v_self); Py_INCREF(__pyx_v_x); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1641 */ - __pyx_1 = PyObject_Length(__pyx_v_x); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1654 */ + __pyx_1 = PyObject_Length(__pyx_v_x); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; goto __pyx_L1;} __pyx_v_i = (__pyx_1 - 1); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1642 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1655 */ /*try:*/ { - __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; goto __pyx_L2;} - __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1643; goto __pyx_L2;} + __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; goto __pyx_L2;} + __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; 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 = 1643; goto __pyx_L2;} + __pyx_1 = PyObject_Length(__pyx_3); if (__pyx_1 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; goto __pyx_L2;} Py_DECREF(__pyx_3); __pyx_3 = 0; __pyx_v_j = __pyx_1; } @@ -8915,10 +8969,10 @@ Py_XDECREF(__pyx_2); __pyx_2 = 0; Py_XDECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1644 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1657 */ /*except:*/ { __Pyx_AddTraceback("mtrand.shuffle"); - if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; goto __pyx_L1;} + if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1657; goto __pyx_L1;} __pyx_v_j = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; @@ -8927,82 +8981,82 @@ } __pyx_L3:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1647 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1660 */ __pyx_5 = (__pyx_v_j == 0); if (__pyx_5) { while (1) { __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1650 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1663 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1651 */ - __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} - __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1664 */ + __pyx_2 = PyInt_FromLong(__pyx_v_j); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + __pyx_3 = PyObject_GetItem(__pyx_v_x, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; 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 = 1651; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; 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 = 1651; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1651; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1652 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1665 */ __pyx_v_i = (__pyx_v_i - 1); } goto __pyx_L4; } /*else*/ { - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1655 */ - __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1655; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1668 */ + __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; 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 = 1655; goto __pyx_L1;} + __pyx_5 = PyObject_HasAttr(__pyx_2,__pyx_n_copy); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; __pyx_v_copy = __pyx_5; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1656 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1669 */ __pyx_5 = __pyx_v_copy; if (__pyx_5) { while (1) { __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1658 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1671 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1659 */ - __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} - __pyx_4 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1672 */ + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;} + __pyx_4 = PyObject_GetItem(__pyx_v_x, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; - __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_copy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_copy); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; 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 = 1659; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} + __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_copy); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; 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 = 1659; goto __pyx_L1;} + __pyx_2 = PyObject_CallObject(__pyx_4, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; 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 = 1659; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_4, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; 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 = 1659; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1660 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1673 */ __pyx_v_i = (__pyx_v_i - 1); } goto __pyx_L7; @@ -9012,30 +9066,30 @@ __pyx_5 = (__pyx_v_i > 0); if (!__pyx_5) break; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1663 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1676 */ __pyx_v_j = rk_interval(__pyx_v_i,((struct __pyx_obj_6mtrand_RandomState *)__pyx_v_self)->internal_state); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1664 */ - __pyx_4 = PyInt_FromLong(__pyx_v_j); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1677 */ + __pyx_4 = PyInt_FromLong(__pyx_v_j); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; 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 = 1664; goto __pyx_L1;} + __pyx_3 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; - __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} - __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + __pyx_4 = PyInt_FromLong(__pyx_v_i); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} + __pyx_2 = PyObject_GetItem(__pyx_v_x, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} Py_DECREF(__pyx_4); __pyx_4 = 0; - __pyx_4 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + __pyx_4 = PySequence_GetSlice(__pyx_2, 0, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; 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 = 1664; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + __pyx_2 = PyInt_FromLong(__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_2, __pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; 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 = 1664; goto __pyx_L1;} - if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1664; goto __pyx_L1;} + __pyx_3 = PyInt_FromLong(__pyx_v_j); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} + if (PyObject_SetItem(__pyx_v_x, __pyx_3, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_4); __pyx_4 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1665 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1678 */ __pyx_v_i = (__pyx_v_i - 1); } } @@ -9075,26 +9129,26 @@ Py_INCREF(__pyx_v_x); __pyx_v_arr = Py_None; Py_INCREF(Py_None); - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1673 */ - __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; goto __pyx_L1;} - __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_integer); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1673; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1686 */ + __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; goto __pyx_L1;} + __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_integer); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; 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 = 1673; goto __pyx_L1;} + __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; 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 = 1673; goto __pyx_L1;} + __pyx_4 = PyObject_IsInstance(__pyx_v_x,__pyx_2); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; if (__pyx_4) { - __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;} - __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;} + __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} + __pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_arange); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; 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 = 1674; goto __pyx_L1;} + __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} Py_INCREF(__pyx_v_x); PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x); - __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; goto __pyx_L1;} + __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} Py_DECREF(__pyx_3); __pyx_3 = 0; Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_v_arr); @@ -9103,13 +9157,13 @@ goto __pyx_L2; } /*else*/ { - __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; goto __pyx_L1;} - __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1676; goto __pyx_L1;} + __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__sp); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; goto __pyx_L1;} + __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_array); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; 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 = 1676; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; goto __pyx_L1;} Py_INCREF(__pyx_v_x); 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 = 1676; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_v_arr); @@ -9118,17 +9172,17 @@ } __pyx_L2:; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1677 */ - __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} - __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1690 */ + __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_shuffle); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; goto __pyx_L1;} + __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; goto __pyx_L1;} Py_INCREF(__pyx_v_arr); 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 = 1677; goto __pyx_L1;} + __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; goto __pyx_L1;} Py_DECREF(__pyx_2); __pyx_2 = 0; Py_DECREF(__pyx_1); __pyx_1 = 0; Py_DECREF(__pyx_3); __pyx_3 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1678 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1691 */ Py_INCREF(__pyx_v_arr); __pyx_r = __pyx_v_arr; goto __pyx_L0; @@ -9584,560 +9638,560 @@ __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 = 470; goto __pyx_L1;} + if (PyObject_SetAttrString(__pyx_m, "RandomState", (PyObject *)&__pyx_type_6mtrand_RandomState) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; goto __pyx_L1;} __pyx_ptype_6mtrand_RandomState = &__pyx_type_6mtrand_RandomState; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":120 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":121 */ import_array(); - /* "/Users/rkern/svn/numpy/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__sp, __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__sp, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;} Py_DECREF(__pyx_1); __pyx_1 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":489 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":490 */ Py_INCREF(Py_None); __pyx_k2 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":499 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":500 */ Py_INCREF(Py_None); __pyx_k3 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":569 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":582 */ Py_INCREF(Py_None); __pyx_k4 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":576 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":589 */ Py_INCREF(Py_None); __pyx_k5 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":583 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":596 */ Py_INCREF(Py_None); __pyx_k6 = Py_None; Py_INCREF(Py_None); __pyx_k7 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":628 */ - __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 628; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":641 */ + __pyx_1 = PyFloat_FromDouble(0.0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; 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 = 628; goto __pyx_L1;} + __pyx_2 = PyFloat_FromDouble(1.0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; goto __pyx_L1;} __pyx_k9 = __pyx_2; __pyx_2 = 0; Py_INCREF(Py_None); __pyx_k10 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":681 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":694 */ Py_INCREF(Py_None); __pyx_k11 = Py_None; Py_INCREF(Py_None); __pyx_k12 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":694 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":707 */ Py_INCREF(Py_None); __pyx_k13 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":701 */ - __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":714 */ + __pyx_3 = PyFloat_FromDouble(0.0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; 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 = 701; goto __pyx_L1;} + __pyx_4 = PyFloat_FromDouble(1.0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; goto __pyx_L1;} __pyx_k15 = __pyx_4; __pyx_4 = 0; Py_INCREF(Py_None); __pyx_k16 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":724 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":737 */ Py_INCREF(Py_None); __pyx_k17 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":751 */ - __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":764 */ + __pyx_5 = PyFloat_FromDouble(1.0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;} __pyx_k18 = __pyx_5; __pyx_5 = 0; Py_INCREF(Py_None); __pyx_k19 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":772 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":785 */ Py_INCREF(Py_None); __pyx_k20 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":779 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":792 */ Py_INCREF(Py_None); __pyx_k21 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":799 */ - __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":812 */ + __pyx_6 = PyFloat_FromDouble(1.0); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;} __pyx_k22 = __pyx_6; __pyx_6 = 0; Py_INCREF(Py_None); __pyx_k23 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":825 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":838 */ Py_INCREF(Py_None); __pyx_k24 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":852 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":865 */ Py_INCREF(Py_None); __pyx_k25 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":888 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":901 */ Py_INCREF(Py_None); __pyx_k26 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":909 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":922 */ Py_INCREF(Py_None); __pyx_k27 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":937 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":950 */ Py_INCREF(Py_None); __pyx_k28 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":944 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":957 */ Py_INCREF(Py_None); __pyx_k29 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":965 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":978 */ Py_INCREF(Py_None); __pyx_k30 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":989 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1002 */ Py_INCREF(Py_None); __pyx_k31 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1010 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1023 */ Py_INCREF(Py_None); __pyx_k32 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1031 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1044 */ Py_INCREF(Py_None); __pyx_k33 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1052 */ - __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1065 */ + __pyx_7 = PyFloat_FromDouble(0.0); if (!__pyx_7) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; 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 = 1052; goto __pyx_L1;} + __pyx_8 = PyFloat_FromDouble(1.0); if (!__pyx_8) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; goto __pyx_L1;} __pyx_k35 = __pyx_8; __pyx_8 = 0; Py_INCREF(Py_None); __pyx_k36 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1074 */ - __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1074; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1087 */ + __pyx_9 = PyFloat_FromDouble(0.0); if (!__pyx_9) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; 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 = 1074; goto __pyx_L1;} + __pyx_10 = PyFloat_FromDouble(1.0); if (!__pyx_10) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; goto __pyx_L1;} __pyx_k38 = __pyx_10; __pyx_10 = 0; Py_INCREF(Py_None); __pyx_k39 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1096 */ - __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1096; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1109 */ + __pyx_11 = PyFloat_FromDouble(0.0); if (!__pyx_11) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; 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 = 1096; goto __pyx_L1;} + __pyx_12 = PyFloat_FromDouble(1.0); if (!__pyx_12) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; goto __pyx_L1;} __pyx_k41 = __pyx_12; __pyx_12 = 0; Py_INCREF(Py_None); __pyx_k42 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1118 */ - __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1131 */ + __pyx_13 = PyFloat_FromDouble(0.0); if (!__pyx_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; 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 = 1118; goto __pyx_L1;} + __pyx_14 = PyFloat_FromDouble(1.0); if (!__pyx_14) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1131; goto __pyx_L1;} __pyx_k44 = __pyx_14; __pyx_14 = 0; Py_INCREF(Py_None); __pyx_k45 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1147 */ - __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1160 */ + __pyx_15 = PyFloat_FromDouble(1.0); if (!__pyx_15) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;} __pyx_k46 = __pyx_15; __pyx_15 = 0; Py_INCREF(Py_None); __pyx_k47 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1169 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1182 */ Py_INCREF(Py_None); __pyx_k48 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1197 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1210 */ Py_INCREF(Py_None); __pyx_k49 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1234 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1247 */ Py_INCREF(Py_None); __pyx_k50 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1266 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1279 */ Py_INCREF(Py_None); __pyx_k51 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1301 */ - __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1314 */ + __pyx_16 = PyFloat_FromDouble(1.0); if (!__pyx_16) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; goto __pyx_L1;} __pyx_k52 = __pyx_16; __pyx_16 = 0; Py_INCREF(Py_None); __pyx_k53 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1321 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1334 */ Py_INCREF(Py_None); __pyx_k54 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1342 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1355 */ Py_INCREF(Py_None); __pyx_k55 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1369 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1382 */ Py_INCREF(Py_None); __pyx_k56 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1414 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1427 */ Py_INCREF(Py_None); __pyx_k57 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1440 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1453 */ Py_INCREF(Py_None); __pyx_k58 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1498 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1511 */ Py_INCREF(Py_None); __pyx_k59 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1548 */ + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1561 */ Py_INCREF(Py_None); __pyx_k60 = Py_None; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1680 */ - __pyx_17 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), 0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; goto __pyx_L1;} - if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; goto __pyx_L1;} - Py_DECREF(__pyx_17); __pyx_17 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1681 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; 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 = 1681; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1682 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1682; 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 = 1682; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1683 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; 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 = 1683; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1684 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; 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 = 1684; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1685 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; 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 = 1685; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1686 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; 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 = 1686; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1687 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; 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 = 1687; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1688 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; 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 = 1688; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1689 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1689; 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 = 1689; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1690 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; 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 = 1690; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1691 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; 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 = 1691; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1692 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; 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 = 1692; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1693 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;} + __pyx_17 = PyObject_CallObject(((PyObject*)__pyx_ptype_6mtrand_RandomState), 0); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n__rand, __pyx_17) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1693; 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 = 1693; goto __pyx_L1;} - Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1694 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_seed); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; 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 = 1694; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_seed, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1694; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1695 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_get_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; 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 = 1695; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_get_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1696 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_set_state); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; 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 = 1696; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_set_state, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1696; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1697 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_sample); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; 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 = 1697; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_random_sample, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1698 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randint); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; 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 = 1698; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_randint, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1699 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_bytes); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; 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 = 1699; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_bytes, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1700 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_uniform); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; 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 = 1700; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_uniform, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1701 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rand); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; 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 = 1701; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_rand, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1702 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_randn); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; 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 = 1702; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_randn, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1703 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_random_integers); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; 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 = 1703; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_random_integers, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1703; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1704 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; 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 = 1704; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1705 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; 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 = 1705; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_normal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1706 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_beta); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; 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 = 1706; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_beta, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1707 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; 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 = 1707; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1708 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_exponential); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; 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 = 1708; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_exponential, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1709 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; 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 = 1709; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1709; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1710 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gamma); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; 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 = 1710; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_gamma, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1711 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; 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 = 1711; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1712 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_f); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; 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 = 1712; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_f, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1713 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; 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 = 1713; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1713; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1714 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_noncentral_chisquare); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; 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 = 1714; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_noncentral_chisquare, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1715 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_cauchy); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1715; 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 = 1715; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1716 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_standard_t); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; 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 = 1716; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_standard_t, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1717 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_vonmises); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; 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 = 1717; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_vonmises, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1717; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1718 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_pareto); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; 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 = 1718; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_pareto, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1718; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1719 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_weibull); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; 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 = 1719; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_weibull, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1719; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1720 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_power); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; 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 = 1720; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_power, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1720; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1721 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_laplace); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; 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 = 1721; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_laplace, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1722 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_gumbel); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; 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 = 1722; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_gumbel, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1722; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1723 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logistic); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1723; 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 = 1723; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1724 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_lognormal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; 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 = 1724; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_lognormal, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1725 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_rayleigh); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; 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 = 1725; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_rayleigh, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1725; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1726 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_dirichlet); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_wald); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; 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 = 1726; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_wald, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; - /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1728 */ - __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; goto __pyx_L1;} + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1727 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_triangular); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; 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 = 1728; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_triangular, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1729 */ __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; goto __pyx_L1;} - __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; 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 = 1729; goto __pyx_L1;} + if (PyObject_SetAttr(__pyx_m, __pyx_n_binomial, __pyx_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1729; goto __pyx_L1;} Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1730 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_negative_binomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1730; 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 = 1730; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1731 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_poisson); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1731; 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 = 1731; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1732 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_zipf); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1732; 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 = 1732; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1733 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_geometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; 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 = 1733; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1734 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_hypergeometric); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; 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 = 1734; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1735 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_logseries); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1735; 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 = 1735; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1737 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multivariate_normal); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; 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 = 1737; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1738 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_multinomial); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; 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 = 1738; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1739 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_dirichlet); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1739; 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 = 1739; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1741 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_shuffle); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; 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 = 1741; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; + + /* "/Users/rkern/svn/numpy/numpy/random/mtrand/mtrand.pyx":1742 */ + __pyx_17 = __Pyx_GetName(__pyx_m, __pyx_n__rand); if (!__pyx_17) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; goto __pyx_L1;} + __pyx_18 = PyObject_GetAttr(__pyx_17, __pyx_n_permutation); if (!__pyx_18) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1742; 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 = 1742; goto __pyx_L1;} + Py_DECREF(__pyx_18); __pyx_18 = 0; return; __pyx_L1:; Py_XDECREF(__pyx_1); Modified: trunk/numpy/random/mtrand/mtrand.pyx =================================================================== --- trunk/numpy/random/mtrand/mtrand.pyx 2008-04-09 20:13:22 UTC (rev 5007) +++ trunk/numpy/random/mtrand/mtrand.pyx 2008-04-09 20:30:07 UTC (rev 5008) @@ -38,6 +38,7 @@ unsigned long key[624] int pos int has_gauss + double gauss ctypedef enum rk_error: RK_NOERR = 0 @@ -523,17 +524,23 @@ def get_state(self): """Return a tuple representing the internal state of the generator. - get_state() -> ('MT19937', int key[624], int pos) + get_state() -> ('MT19937', int key[624], int pos, int has_gauss, float cached_gaussian) """ cdef ndarray state "arrayObject_state" state = _sp.empty(624, _sp.uint) memcpy((state.data), (self.internal_state.key), 624*sizeof(long)) state = _sp.asarray(state, _sp.uint32) - return ('MT19937', state, self.internal_state.pos) + return ('MT19937', state, self.internal_state.pos, + self.internal_state.has_gauss, self.internal_state.gauss) def set_state(self, state): """Set the state from a tuple. + state = ('MT19937', int key[624], int pos, int has_gauss, float cached_gaussian) + + For backwards compatibility, the following form is also accepted + although it is missing some information about the cached Gaussian value. + state = ('MT19937', int key[624], int pos) set_state(state) @@ -543,7 +550,12 @@ algorithm_name = state[0] if algorithm_name != 'MT19937': raise ValueError("algorithm must be 'MT19937'") - key, pos = state[1:] + key, pos = state[1:3] + if len(state) == 3: + has_gauss = 0 + cached_gaussian = 0.0 + else: + has_gauss, cached_gaussian = state[3:5] try: obj = PyArray_ContiguousFromObject(key, NPY_ULONG, 1, 1) except TypeError: @@ -553,7 +565,8 @@ raise ValueError("state must be 624 longs") memcpy((self.internal_state.key), (obj.data), 624*sizeof(long)) self.internal_state.pos = pos - self.internal_state.has_gauss = 0 + self.internal_state.has_gauss = has_gauss + self.internal_state.gauss = cached_gaussian # Pickling support: def __getstate__(self): Modified: trunk/numpy/random/tests/test_random.py =================================================================== --- trunk/numpy/random/tests/test_random.py 2008-04-09 20:13:22 UTC (rev 5007) +++ trunk/numpy/random/tests/test_random.py 2008-04-09 20:30:07 UTC (rev 5008) @@ -36,7 +36,30 @@ new = self.prng.standard_normal(size=3) assert np.all(old == new) + def test_gaussian_reset_in_media_res(self): + """ When the state is saved with a cached Gaussian, make sure the cached + Gaussian is restored. + """ + self.prng.standard_normal() + state = self.prng.get_state() + old = self.prng.standard_normal(size=3) + self.prng.set_state(state) + new = self.prng.standard_normal(size=3) + assert np.all(old == new) + def test_backwards_compatibility(self): + """ Make sure we can accept old state tuples that do not have the cached + Gaussian value. + """ + old_state = self.state[:-2] + x1 = self.prng.standard_normal(size=16) + self.prng.set_state(old_state) + x2 = self.prng.standard_normal(size=16) + self.prng.set_state(self.state) + x3 = self.prng.standard_normal(size=16) + assert np.all(x1 == x2) + assert np.all(x1 == x3) + if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Wed Apr 9 19:52:21 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 9 Apr 2008 18:52:21 -0500 (CDT) Subject: [Numpy-svn] r5009 - trunk/numpy/core/src Message-ID: <20080409235221.5276939C017@new.scipy.org> Author: charris Date: 2008-04-09 18:52:17 -0500 (Wed, 09 Apr 2008) New Revision: 5009 Modified: trunk/numpy/core/src/arrayobject.c Log: Fix bound in error message. Patch from Andrew Straw, fixes ticket 732. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-04-09 20:30:07 UTC (rev 5008) +++ trunk/numpy/core/src/arrayobject.c 2008-04-09 23:52:17 UTC (rev 5009) @@ -3066,7 +3066,7 @@ if ((vals[i] < 0) || (vals[i] >= self->dimensions[i])) { PyErr_Format(PyExc_IndexError, "index (%"INTP_FMT") out of range "\ - "(0<=index<=%"INTP_FMT") in dimension %d", + "(0<=index<%"INTP_FMT") in dimension %d", vals[i], self->dimensions[i], i); return NULL; } @@ -10139,7 +10139,7 @@ if (indval < 0 || indval >= dimsize) { PyErr_Format(PyExc_IndexError, "index (%d) out of range "\ - "(0<=index<=%d) in dimension %d", + "(0<=index<%d) in dimension %d", (int) indval, (int) (dimsize-1), mit->iteraxes[i]); goto fail; From numpy-svn at scipy.org Thu Apr 10 05:15:15 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 10 Apr 2008 04:15:15 -0500 (CDT) Subject: [Numpy-svn] r5010 - trunk/numpy/core/tests Message-ID: <20080410091515.03AF739C03B@new.scipy.org> Author: stefan Date: 2008-04-10 04:15:00 -0500 (Thu, 10 Apr 2008) New Revision: 5010 Modified: trunk/numpy/core/tests/test_regression.py Log: Add check for printing complex dtypes, closes #693. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-09 23:52:17 UTC (rev 5009) +++ trunk/numpy/core/tests/test_regression.py 2008-04-10 09:15:00 UTC (rev 5010) @@ -989,6 +989,16 @@ assert_almost_equal(fdouble, 1.234) assert_almost_equal(flongdouble, 1.234) + def check_complex_dtype_printing(self, level=rlevel): + dt = np.dtype([('top', [('tiles', ('>f4', (64, 64)), (1,)), + ('rtile', '>f4', (64, 36))], (3,)), + ('bottom', [('bleft', ('>f4', (8, 64)), (1,)), + ('bright', '>f4', (8, 36))])]) + assert_equal(str(dt), + "[('top', [('tiles', ('>f4', (64, 64)), (1,)), " + "('rtile', '>f4', (64, 36))], (3,)), " + "('bottom', [('bleft', ('>f4', (8, 64)), (1,)), " + "('bright', '>f4', (8, 36))])]") if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Thu Apr 10 07:05:20 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 10 Apr 2008 06:05:20 -0500 (CDT) Subject: [Numpy-svn] r5011 - trunk/numpy/distutils Message-ID: <20080410110520.9AFF739C03B@new.scipy.org> Author: pearu Date: 2008-04-10 06:05:16 -0500 (Thu, 10 Apr 2008) New Revision: 5011 Modified: trunk/numpy/distutils/interactive.py Log: Fix issue 715. Modified: trunk/numpy/distutils/interactive.py =================================================================== --- trunk/numpy/distutils/interactive.py 2008-04-10 09:15:00 UTC (rev 5010) +++ trunk/numpy/distutils/interactive.py 2008-04-10 11:05:16 UTC (rev 5011) @@ -102,20 +102,21 @@ while 1: show_tasks(argv,c_compiler_name, f_compiler_name) try: - task = raw_input('Choose a task (^D to quit, Enter to continue with setup): ').lower() + task = raw_input('Choose a task (^D to quit, Enter to continue with setup): ') except EOFError: print task = 'quit' + ltask = task.lower() if task=='': break - if task=='quit': sys.exit() - task_func = task_dict.get(task,None) + if ltask=='quit': sys.exit() + task_func = task_dict.get(ltask,None) if task_func is None: - if task[0]=='c': + if ltask[0]=='c': c_compiler_name = task[1:] if c_compiler_name=='none': c_compiler_name = None continue - if task[0]=='f': + if ltask[0]=='f': f_compiler_name = task[1:] if f_compiler_name=='none': f_compiler_name = None From numpy-svn at scipy.org Thu Apr 10 19:58:43 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 10 Apr 2008 18:58:43 -0500 (CDT) Subject: [Numpy-svn] r5012 - trunk/numpy/f2py Message-ID: <20080410235843.D5B3C39C504@new.scipy.org> Author: rkern Date: 2008-04-10 18:58:42 -0500 (Thu, 10 Apr 2008) New Revision: 5012 Modified: trunk/numpy/f2py/crackfortran.py Log: Fix a long-standing typo preventing the build of scipy.stats.mvn. Sorry Stefan, no unittest; the original code is not amenable to unittests without a large refactoring. Modified: trunk/numpy/f2py/crackfortran.py =================================================================== --- trunk/numpy/f2py/crackfortran.py 2008-04-10 11:05:16 UTC (rev 5011) +++ trunk/numpy/f2py/crackfortran.py 2008-04-10 23:58:42 UTC (rev 5012) @@ -864,7 +864,7 @@ name,args,result=_resolvenameargspattern(m.group('after')) if name is not None: if args: - args=rmbadname([x.strip() for x in markoutercomma(args).strip('@,@')]) + args=rmbadname([x.strip() for x in markoutercomma(args).split('@,@')]) else: args=[] assert result is None,`result` groupcache[groupcounter]['entry'][name] = args From numpy-svn at scipy.org Thu Apr 10 21:54:21 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 10 Apr 2008 20:54:21 -0500 (CDT) Subject: [Numpy-svn] r5013 - trunk/numpy/core/src Message-ID: <20080411015421.F3B7539C0B8@new.scipy.org> Author: charris Date: 2008-04-10 20:54:18 -0500 (Thu, 10 Apr 2008) New Revision: 5013 Modified: trunk/numpy/core/src/scalartypes.inc.src Log: Add functions for str instead of defining them to the same as repr. Reduce repr precision of longdouble to 20 and set str precision of longdouble to the same as double. This is a first cut at looking through the formatting used to print numbers. The precisions are now #define FLOATPREC_REPR 8 #define FLOATPREC_STR 6 #define DOUBLEPREC_REPR 17 #define DOUBLEPREC_STR 12 #if SIZEOF_LONGDOUBLE == SIZEOF_DOUBLE #define LONGDOUBLEPREC_REPR DOUBLEPREC_REPR #define LONGDOUBLEPREC_STR DOUBLEPREC_STR #else /* More than probably needed on Intel FP */ #define LONGDOUBLEPREC_REPR 20 #define LONGDOUBLEPREC_STR 12 #endif This line, and those below, will be ignored-- M numpy/core/src/scalartypes.inc.src Modified: trunk/numpy/core/src/scalartypes.inc.src =================================================================== --- trunk/numpy/core/src/scalartypes.inc.src 2008-04-10 23:58:42 UTC (rev 5012) +++ trunk/numpy/core/src/scalartypes.inc.src 2008-04-11 01:54:18 UTC (rev 5013) @@ -610,16 +610,49 @@ /* These values are finfo.precision + 2 */ #define FLOATPREC_REPR 8 +#define FLOATPREC_STR 6 #define DOUBLEPREC_REPR 17 - +#define DOUBLEPREC_STR 12 #if SIZEOF_LONGDOUBLE == SIZEOF_DOUBLE #define LONGDOUBLEPREC_REPR DOUBLEPREC_REPR -#define LONGDOUBLEPREC_STR DOUBLEPREC_REPR +#define LONGDOUBLEPREC_STR DOUBLEPREC_STR #else /* More than probably needed on Intel FP */ -#define LONGDOUBLEPREC_REPR 22 -#define LONGDOUBLEPREC_STR 22 +#define LONGDOUBLEPREC_REPR 20 +#define LONGDOUBLEPREC_STR 12 #endif +/* floattype_str */ +/**begin repeat + +#name=float, double, longdouble# +#Name=Float, Double, LongDouble# +#NAME=FLOAT, DOUBLE, LONGDOUBLE# +*/ +static PyObject * + at name@type_str(PyObject *self) +{ + static char buf[100]; + format_ at name@(buf, sizeof(buf), + ((Py at Name@ScalarObject *)self)->obval, @NAME at PREC_STR); + return PyString_FromString(buf); +} + +static PyObject * +c at name@type_str(PyObject *self) +{ + static char buf1[100]; + static char buf2[100]; + static char buf3[202]; + c at name@ x; + x = ((PyC at Name@ScalarObject *)self)->obval; + format_ at name@(buf1, sizeof(buf1), x.real, @NAME at PREC_STR); + format_ at name@(buf2, sizeof(buf2), x.imag, @NAME at PREC_STR); + + snprintf(buf3, sizeof(buf3), "(%s+%sj)", buf1, buf2); + return PyString_FromString(buf3); +} +/**end repeat**/ + /* floattype_repr */ /**begin repeat @@ -652,14 +685,7 @@ } /**end repeat**/ -/**begin repeat -#name=float, double, longdouble# -*/ -#define @name at type_str @name at type_repr -#define c at name@type_str c at name@type_repr -/**end repeat**/ - /** Could improve this with a PyLong_FromLongDouble(longdouble ldval) but this would need some more work... **/ From numpy-svn at scipy.org Thu Apr 10 22:44:52 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 10 Apr 2008 21:44:52 -0500 (CDT) Subject: [Numpy-svn] r5014 - trunk/numpy/core/src Message-ID: <20080411024452.C3E1439C480@new.scipy.org> Author: charris Date: 2008-04-10 21:44:43 -0500 (Thu, 10 Apr 2008) New Revision: 5014 Modified: trunk/numpy/core/src/scalartypes.inc.src Log: Fix missing format code so longdoubles print with proper precision. Modified: trunk/numpy/core/src/scalartypes.inc.src =================================================================== --- trunk/numpy/core/src/scalartypes.inc.src 2008-04-11 01:54:18 UTC (rev 5013) +++ trunk/numpy/core/src/scalartypes.inc.src 2008-04-11 02:44:43 UTC (rev 5014) @@ -551,7 +551,7 @@ #name=float, double, longdouble# #NAME=FLOAT, DOUBLE, LONGDOUBLE# -#PREFIX=NPY_,NPY_,# +#PREFIX=NPY_,NPY_,NPY_# */ static void format_ at name@(char *buf, size_t buflen, @name@ val, From numpy-svn at scipy.org Thu Apr 10 22:55:57 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 10 Apr 2008 21:55:57 -0500 (CDT) Subject: [Numpy-svn] r5015 - trunk/numpy/core/tests Message-ID: <20080411025557.E84CD39C0C0@new.scipy.org> Author: charris Date: 2008-04-10 21:55:55 -0500 (Thu, 10 Apr 2008) New Revision: 5015 Modified: trunk/numpy/core/tests/test_regression.py Log: Add test for precision of longdouble repr. Need to add tests for all printing precisions. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-11 02:44:43 UTC (rev 5014) +++ trunk/numpy/core/tests/test_regression.py 2008-04-11 02:55:55 UTC (rev 5015) @@ -1000,5 +1000,8 @@ "('bottom', [('bleft', ('>f4', (8, 64)), (1,)), " "('bright', '>f4', (8, 36))])]") + def check_longdouble_repr_precision(self, level=rlevel) : + assert '1.2339999999999999858' == repr(np.longdouble(1.234)) + if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Fri Apr 11 00:20:16 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 10 Apr 2008 23:20:16 -0500 (CDT) Subject: [Numpy-svn] r5016 - trunk/numpy/core/tests Message-ID: <20080411042016.4862039C4D3@new.scipy.org> Author: charris Date: 2008-04-10 23:20:11 -0500 (Thu, 10 Apr 2008) New Revision: 5016 Modified: trunk/numpy/core/tests/test_regression.py Log: Remove test of repr precision for longdouble. This varies between compilers and at some point may vary between architectures when quadprecision gets loose in the wild. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-11 02:55:55 UTC (rev 5015) +++ trunk/numpy/core/tests/test_regression.py 2008-04-11 04:20:11 UTC (rev 5016) @@ -1000,8 +1000,6 @@ "('bottom', [('bleft', ('>f4', (8, 64)), (1,)), " "('bright', '>f4', (8, 36))])]") - def check_longdouble_repr_precision(self, level=rlevel) : - assert '1.2339999999999999858' == repr(np.longdouble(1.234)) if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Fri Apr 11 01:31:26 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 11 Apr 2008 00:31:26 -0500 (CDT) Subject: [Numpy-svn] r5017 - trunk/numpy/core/tests Message-ID: <20080411053126.2F91239C1E0@new.scipy.org> Author: charris Date: 2008-04-11 00:31:21 -0500 (Fri, 11 Apr 2008) New Revision: 5017 Modified: trunk/numpy/core/tests/test_regression.py Log: Debugging test for check_object_casting. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-11 04:20:11 UTC (rev 5016) +++ trunk/numpy/core/tests/test_regression.py 2008-04-11 05:31:21 UTC (rev 5017) @@ -748,6 +748,13 @@ y2 = y[::-1] assert_equal(np.dot(x,z),np.dot(x,y2)) + def check_object_casting_debug(self, level=rlevel): + def rs(): + x = np.ones([484,286], dtype=np.float32) + y = np.zeros([484,286], dtype=np.float32) + x |= y + self.failUnlessRaises(TypeError,rs) + def check_object_casting(self, level=rlevel): def rs(): x = np.ones([484,286]) From numpy-svn at scipy.org Fri Apr 11 02:03:16 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 11 Apr 2008 01:03:16 -0500 (CDT) Subject: [Numpy-svn] r5018 - trunk/numpy/core/tests Message-ID: <20080411060316.E5B7739C372@new.scipy.org> Author: charris Date: 2008-04-11 01:03:14 -0500 (Fri, 11 Apr 2008) New Revision: 5018 Modified: trunk/numpy/core/tests/test_regression.py Log: More object casting debugging. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-11 05:31:21 UTC (rev 5017) +++ trunk/numpy/core/tests/test_regression.py 2008-04-11 06:03:14 UTC (rev 5018) @@ -750,14 +750,13 @@ def check_object_casting_debug(self, level=rlevel): def rs(): - x = np.ones([484,286], dtype=np.float32) - y = np.zeros([484,286], dtype=np.float32) - x |= y + x = 1.0 | 2.0 + rs() self.failUnlessRaises(TypeError,rs) def check_object_casting(self, level=rlevel): def rs(): - x = np.ones([484,286]) + x = 1.0 | 2.0 y = np.zeros([484,286]) x |= y self.failUnlessRaises(TypeError,rs) From numpy-svn at scipy.org Fri Apr 11 02:20:05 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 11 Apr 2008 01:20:05 -0500 (CDT) Subject: [Numpy-svn] r5019 - trunk/numpy/core/tests Message-ID: <20080411062005.4A34139C485@new.scipy.org> Author: charris Date: 2008-04-11 01:20:03 -0500 (Fri, 11 Apr 2008) New Revision: 5019 Modified: trunk/numpy/core/tests/test_regression.py Log: More debugging. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-11 06:03:14 UTC (rev 5018) +++ trunk/numpy/core/tests/test_regression.py 2008-04-11 06:20:03 UTC (rev 5019) @@ -750,7 +750,8 @@ def check_object_casting_debug(self, level=rlevel): def rs(): - x = 1.0 | 2.0 + x = 1.0 + x |= 1.0 rs() self.failUnlessRaises(TypeError,rs) From numpy-svn at scipy.org Fri Apr 11 02:34:25 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 11 Apr 2008 01:34:25 -0500 (CDT) Subject: [Numpy-svn] r5020 - trunk/numpy/core/tests Message-ID: <20080411063425.9B2BC39C100@new.scipy.org> Author: charris Date: 2008-04-11 01:34:20 -0500 (Fri, 11 Apr 2008) New Revision: 5020 Modified: trunk/numpy/core/tests/test_regression.py Log: More debugging. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-11 06:20:03 UTC (rev 5019) +++ trunk/numpy/core/tests/test_regression.py 2008-04-11 06:34:20 UTC (rev 5020) @@ -750,14 +750,15 @@ def check_object_casting_debug(self, level=rlevel): def rs(): - x = 1.0 - x |= 1.0 + x = np.ones([484,286]) + y = np.zeros([484,286]) + x |= y rs() self.failUnlessRaises(TypeError,rs) def check_object_casting(self, level=rlevel): def rs(): - x = 1.0 | 2.0 + x = np.ones([484,286]) y = np.zeros([484,286]) x |= y self.failUnlessRaises(TypeError,rs) From numpy-svn at scipy.org Fri Apr 11 02:53:52 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 11 Apr 2008 01:53:52 -0500 (CDT) Subject: [Numpy-svn] r5021 - in trunk/numpy: core core/tests lib lib/tests Message-ID: <20080411065352.A217539C4BB@new.scipy.org> Author: oliphant Date: 2008-04-11 01:53:49 -0500 (Fri, 11 Apr 2008) New Revision: 5021 Modified: trunk/numpy/core/numerictypes.py trunk/numpy/core/tests/test_numerictypes.py trunk/numpy/lib/index_tricks.py trunk/numpy/lib/tests/test_index_tricks.py Log: Fixed #728 scalar coercion problem with mixed types and r_ Modified: trunk/numpy/core/numerictypes.py =================================================================== --- trunk/numpy/core/numerictypes.py 2008-04-11 06:34:20 UTC (rev 5020) +++ trunk/numpy/core/numerictypes.py 2008-04-11 06:53:49 UTC (rev 5021) @@ -78,7 +78,7 @@ # we add more at the bottom __all__ = ['sctypeDict', 'sctypeNA', 'typeDict', 'typeNA', 'sctypes', 'ScalarType', 'obj2sctype', 'cast', 'nbytes', 'sctype2char', - 'maximum_sctype', 'issctype', 'typecodes'] + 'maximum_sctype', 'issctype', 'typecodes', 'find_common_type'] from numpy.core.multiarray import typeinfo, ndarray, array, empty, dtype import types as _types @@ -566,7 +566,7 @@ del key -typecodes = {'Character':'S1', +typecodes = {'Character':'c', 'Integer':'bhilqp', 'UnsignedInteger':'BHILQP', 'Float':'fdg', @@ -578,3 +578,69 @@ # backwards compatibility --- deprecated name typeDict = sctypeDict typeNA = sctypeNA + +_kind_list = ['b', 'u', 'i', 'f', 'c', 'S', 'U', 'V', 'O'] + +__test_types = typecodes['AllInteger'][:-2]+typecodes['AllFloat']+'O' +__len_test_types = len(__test_types) + +# Keep incrementing until a common type both can be coerced to +# is found. Otherwise, return None +def _find_common_coerce(a, b): + if a > b: + return a + try: + thisind = __test_types.index(a.char) + except ValueError: + return None + while thisind < __len_test_types: + newdtype = dtype(__test_types[thisind]) + if newdtype >= b and newdtype >= a: + return newdtype + thisind += 1 + return None + + +def find_common_type(array_types, scalar_types): + """Determine common type following standard coercion rules + + Parameters + ---------- + array_types : sequence + A list of dtype convertible objects representing arrays + scalar_types : sequence + A list of dtype convertible objects representing scalars + + Returns + ------- + datatype : dtype + The common data-type which is the maximum of the array_types + ignoring the scalar_types unless the maximum of the scalar_types + is of a different kind. + + If the kinds is not understood, then None is returned. + """ + array_types = [dtype(x) for x in array_types] + scalar_types = [dtype(x) for x in scalar_types] + + if len(scalar_types) == 0: + if len(array_types) == 0: + return None + else: + return max(array_types) + if len(array_types) == 0: + return max(scalar_types) + + maxa = max(array_types) + maxsc = max(scalar_types) + + try: + index_a = _kind_list.index(maxa.kind) + index_sc = _kind_list.index(maxsc.kind) + except ValueError: + return None + + if index_sc > index_a: + return _find_common_coerce(maxsc,maxa) + else: + return maxa Modified: trunk/numpy/core/tests/test_numerictypes.py =================================================================== --- trunk/numpy/core/tests/test_numerictypes.py 2008-04-11 06:34:20 UTC (rev 5020) +++ trunk/numpy/core/tests/test_numerictypes.py 2008-04-11 06:53:49 UTC (rev 5021) @@ -338,5 +338,27 @@ assert(a['int'].shape == (5,0)) assert(a['float'].shape == (5,2)) +class TestCommonType(NumpyTestCase): + def check_scalar_loses1(self): + res = numpy.find_common_type(['f4','f4','i4'],['f8']) + assert(res == 'f4') + def check_scalar_loses2(self): + res = numpy.find_common_type(['f4','f4'],['i8']) + assert(res == 'f4') + def check_scalar_wins(self): + res = numpy.find_common_type(['f4','f4','i4'],['c8']) + assert(res == 'c8') + def check_scalar_wins2(self): + res = numpy.find_common_type(['u4','i4','i4'],['f4']) + assert(res == 'f8') + def check_scalar_wins3(self): # doesn't go up to 'f16' on purpose + res = numpy.find_common_type(['u8','i8','i8'],['f8']) + assert(res == 'f8') + + + + + + if __name__ == "__main__": NumpyTest().run() Modified: trunk/numpy/lib/index_tricks.py =================================================================== --- trunk/numpy/lib/index_tricks.py 2008-04-11 06:34:20 UTC (rev 5020) +++ trunk/numpy/lib/index_tricks.py 2008-04-11 06:53:49 UTC (rev 5021) @@ -7,7 +7,8 @@ import sys import numpy.core.numeric as _nx -from numpy.core.numeric import asarray, ScalarType, array +from numpy.core.numeric import asarray, ScalarType, array, dtype +from numpy.core.numerictypes import find_common_type import math import function_base @@ -225,7 +226,8 @@ key = (key,) objs = [] scalars = [] - final_dtypedescr = None + arraytypes = [] + scalartypes = [] for k in range(len(key)): scalar = False if type(key[k]) is slice: @@ -272,6 +274,7 @@ newobj = array(key[k],ndmin=ndmin) scalars.append(k) scalar = True + scalartypes.append(newobj.dtype) else: newobj = key[k] if ndmin > 1: @@ -289,14 +292,15 @@ newobj = newobj.transpose(axes) del tempobj objs.append(newobj) - if isinstance(newobj, _nx.ndarray) and not scalar: - if final_dtypedescr is None: - final_dtypedescr = newobj.dtype - elif newobj.dtype > final_dtypedescr: - final_dtypedescr = newobj.dtype - if final_dtypedescr is not None: + if not scalar and isinstance(newobj, _nx.ndarray): + arraytypes.append(newobj.dtype) + + # Esure that scalars won't up-cast unless warranted + final_dtype = find_common_type(arraytypes, scalartypes) + if final_dtype is not None: for k in scalars: - objs[k] = objs[k].astype(final_dtypedescr) + objs[k] = objs[k].astype(final_dtype) + res = _nx.concatenate(tuple(objs),axis=self.axis) return self._retval(res) Modified: trunk/numpy/lib/tests/test_index_tricks.py =================================================================== --- trunk/numpy/lib/tests/test_index_tricks.py 2008-04-11 06:34:20 UTC (rev 5020) +++ trunk/numpy/lib/tests/test_index_tricks.py 2008-04-11 06:53:49 UTC (rev 5021) @@ -35,6 +35,10 @@ c = r_[b,0,0,b] assert_array_equal(c,[1,1,1,1,1,0,0,1,1,1,1,1]) + def check_mixed_type(self): + g = r_[10.1, 1:10] + assert(g.dtype == 'f8') + def check_2d(self): b = rand(5,5) c = rand(5,5) From numpy-svn at scipy.org Fri Apr 11 02:56:59 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 11 Apr 2008 01:56:59 -0500 (CDT) Subject: [Numpy-svn] r5022 - trunk/numpy/core/tests Message-ID: <20080411065659.E616E39C4D3@new.scipy.org> Author: charris Date: 2008-04-11 01:56:57 -0500 (Fri, 11 Apr 2008) New Revision: 5022 Modified: trunk/numpy/core/tests/test_regression.py Log: Remove debugging. Python 2.6 still raises ValueError for bitwise operations involving floats, as it should. Numpy doesn't. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-11 06:53:49 UTC (rev 5021) +++ trunk/numpy/core/tests/test_regression.py 2008-04-11 06:56:57 UTC (rev 5022) @@ -748,14 +748,6 @@ y2 = y[::-1] assert_equal(np.dot(x,z),np.dot(x,y2)) - def check_object_casting_debug(self, level=rlevel): - def rs(): - x = np.ones([484,286]) - y = np.zeros([484,286]) - x |= y - rs() - self.failUnlessRaises(TypeError,rs) - def check_object_casting(self, level=rlevel): def rs(): x = np.ones([484,286]) From numpy-svn at scipy.org Fri Apr 11 02:59:15 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 11 Apr 2008 01:59:15 -0500 (CDT) Subject: [Numpy-svn] r5023 - trunk/numpy/lib/tests Message-ID: <20080411065915.1ACC739C4C6@new.scipy.org> Author: oliphant Date: 2008-04-11 01:59:11 -0500 (Fri, 11 Apr 2008) New Revision: 5023 Modified: trunk/numpy/lib/tests/test_index_tricks.py Log: Add one more test from ticket #728 Modified: trunk/numpy/lib/tests/test_index_tricks.py =================================================================== --- trunk/numpy/lib/tests/test_index_tricks.py 2008-04-11 06:56:57 UTC (rev 5022) +++ trunk/numpy/lib/tests/test_index_tricks.py 2008-04-11 06:59:11 UTC (rev 5023) @@ -39,6 +39,10 @@ g = r_[10.1, 1:10] assert(g.dtype == 'f8') + def check_more_mixed_type(self): + g = r_[-10.1, array([1]), array([2,3,4]), 10.0] + assert(g.dtype == 'f8') + def check_2d(self): b = rand(5,5) c = rand(5,5) From numpy-svn at scipy.org Fri Apr 11 03:08:24 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 11 Apr 2008 02:08:24 -0500 (CDT) Subject: [Numpy-svn] r5024 - trunk/numpy/lib Message-ID: <20080411070824.6DA9239C4C9@new.scipy.org> Author: oliphant Date: 2008-04-11 02:08:13 -0500 (Fri, 11 Apr 2008) New Revision: 5024 Modified: trunk/numpy/lib/utils.py Log: Add lookfor function from ticket #734 Modified: trunk/numpy/lib/utils.py =================================================================== --- trunk/numpy/lib/utils.py 2008-04-11 06:59:11 UTC (rev 5023) +++ trunk/numpy/lib/utils.py 2008-04-11 07:08:13 UTC (rev 5024) @@ -2,7 +2,10 @@ import os import sys import inspect +import pkgutil import types +import re +import pydoc from numpy.core.numerictypes import obj2sctype, generic from numpy.core.multiarray import dtype as _dtype from numpy.core import product, ndarray @@ -10,7 +13,7 @@ __all__ = ['issubclass_', 'get_numpy_include', 'issubsctype', 'issubdtype', 'deprecate', 'deprecate_with_doc', 'get_numarray_include', - 'get_include', 'info', 'source', 'who', + 'get_include', 'info', 'source', 'who', 'lookfor', 'byte_bounds', 'may_share_memory', 'safe_eval'] def issubclass_(arg1, arg2): @@ -471,6 +474,188 @@ except: print >> output, "Not available for this object." + +# Cache for lookfor: {id(module): {name: (docstring, kind, index), ...}...} +# where kind: "func", "class", "module", "object" +# and index: index in breadth-first namespace traversal +_lookfor_caches = {} + +# regexp whose match indicates that the string may contain a function signature +_function_signature_re = re.compile(r"[a-z_]+\(.*[,=].*\)", re.I) + +def lookfor(what, module=None, import_modules=True, regenerate=False): + """ + Search for objects whose documentation contains all given words. + Shows a summary of matching objects, sorted roughly by relevance. + + Parameters + ---------- + what : str + String containing words to look for. + + module : str, module + Module whose docstrings to go through. + import_modules : bool + Whether to import sub-modules in packages. + Will import only modules in __all__ + regenerate: bool + Re-generate the docstring cache + + """ + # Cache + cache = _lookfor_generate_cache(module, import_modules, regenerate) + + # Search + # XXX: maybe using a real stemming search engine would be better? + found = [] + whats = str(what).lower().split() + if not whats: return + + for name, (docstring, kind, index) in cache.iteritems(): + if kind in ('module', 'object'): + # don't show modules or objects + continue + ok = True + doc = docstring.lower() + for w in whats: + if w not in doc: + ok = False + break + if ok: + found.append(name) + + # Relevance sort + # XXX: this is full Harrison-Stetson heuristics now, + # XXX: it probably could be improved + + kind_relevance = {'func': 1000, 'class': 1000, + 'module': -1000, 'object': -1000} + + def relevance(name, docstr, kind, index): + r = 0 + # do the keywords occur within the start of the docstring? + first_doc = "\n".join(docstr.lower().strip().split("\n")[:3]) + r += sum([200 for w in whats if w in first_doc]) + # do the keywords occur in the function name? + r += sum([30 for w in whats if w in name]) + # is the full name long? + r += -len(name) * 5 + # is the object of bad type? + r += kind_relevance.get(kind, -1000) + # is the object deep in namespace hierarchy? + r += -name.count('.') * 10 + r += max(-index / 100, -100) + return r + + def relevance_sort(a, b): + dr = relevance(b, *cache[b]) - relevance(a, *cache[a]) + if dr != 0: return dr + else: return cmp(a, b) + found.sort(relevance_sort) + + # Pretty-print + s = "Search results for '%s'" % (' '.join(whats)) + help_text = [s, "-"*len(s)] + for name in found: + doc, kind, ix = cache[name] + + doclines = [line.strip() for line in doc.strip().split("\n") + if line.strip()] + + # find a suitable short description + try: + first_doc = doclines[0].strip() + if _function_signature_re.search(first_doc): + first_doc = doclines[1].strip() + except IndexError: + first_doc = "" + help_text.append("%s\n %s" % (name, first_doc)) + + # Output + if len(help_text) > 10: + pager = pydoc.getpager() + pager("\n".join(help_text)) + else: + print "\n".join(help_text) + +def _lookfor_generate_cache(module, import_modules, regenerate): + """ + Generate docstring cache for given module. + + Parameters + ---------- + module : str, None, module + Module for which to generate docstring cache + import_modules : bool + Whether to import sub-modules in packages. + Will import only modules in __all__ + regenerate: bool + Re-generate the docstring cache + + Returns + ------- + cache : dict {obj_full_name: (docstring, kind, index), ...} + Docstring cache for the module, either cached one (regenerate=False) + or newly generated. + + """ + global _lookfor_caches + + if module is None: + module = "numpy" + + if isinstance(module, str): + module = __import__(module) + + if id(module) in _lookfor_caches and not regenerate: + return _lookfor_caches[id(module)] + + # walk items and collect docstrings + cache = {} + _lookfor_caches[id(module)] = cache + seen = {} + index = 0 + stack = [(module.__name__, module)] + while stack: + name, item = stack.pop(0) + if id(item) in seen: continue + seen[id(item)] = True + + index += 1 + kind = "object" + + if inspect.ismodule(item): + kind = "module" + try: + _all = item.__all__ + except AttributeError: + _all = None + # import sub-packages + if import_modules and hasattr(item, '__path__'): + for m in pkgutil.iter_modules(item.__path__): + if _all is not None and m[1] not in _all: + continue + try: + __import__("%s.%s" % (name, m[1])) + except ImportError: + continue + for n, v in inspect.getmembers(item): + if _all is not None and n not in _all: + continue + stack.append(("%s.%s" % (name, n), v)) + elif inspect.isclass(item): + kind = "class" + for n, v in inspect.getmembers(item): + stack.append(("%s.%s" % (name, n), v)) + elif callable(item): + kind = "func" + + doc = inspect.getdoc(item) + if doc is not None: + cache[name] = (doc, kind, index) + + return cache + #----------------------------------------------------------------------------- # The following SafeEval class and company are adapted from Michael Spencer's From numpy-svn at scipy.org Fri Apr 11 23:12:17 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 11 Apr 2008 22:12:17 -0500 (CDT) Subject: [Numpy-svn] r5025 - trunk/numpy/lib/tests Message-ID: <20080412031217.5824439C0B4@new.scipy.org> Author: rkern Date: 2008-04-11 22:12:09 -0500 (Fri, 11 Apr 2008) New Revision: 5025 Modified: trunk/numpy/lib/tests/test_io.py Log: Compare against native-endian types, not endian-specific types. Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2008-04-11 07:08:13 UTC (rev 5024) +++ trunk/numpy/lib/tests/test_io.py 2008-04-12 03:12:09 UTC (rev 5025) @@ -24,7 +24,7 @@ assert(c.readlines(), ['1\n', '2\n', '3\n', '4\n']) def test_record(self): - a = np.array([(1, 2), (3, 4)], dtype=[('x', ' Author: stefan Date: 2008-04-12 18:18:27 -0500 (Sat, 12 Apr 2008) New Revision: 5026 Modified: trunk/numpy/lib/io.py trunk/numpy/lib/tests/test_io.py Log: Fix fromregex, add documentation and tests [patch by Pauli Virtanen]. Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2008-04-12 03:12:09 UTC (rev 5025) +++ trunk/numpy/lib/io.py 2008-04-12 23:18:27 UTC (rev 5026) @@ -362,22 +362,44 @@ X.shape = origShape import re -def fromregex(file, regexp, **kwds): +def fromregex(file, regexp, dtype): """Construct a record array from a text file, using regular-expressions parsing. - Groups in the regular exespression are converted to fields. + Array is constructed from all matches of the regular expression + in the file. Groups in the regular expression are converted to fields. + + Parameters + ---------- + file : str or file + File name or file object to read + regexp : str or regexp + Regular expression to use to parse the file + dtype : dtype or dtype list + Dtype for the record array + + Example + ------- + >>> import numpy as np + >>> f = open('test.dat', 'w') + >>> f.write("1312 foo\n1534 bar\n 444 qux") + >>> f.close() + >>> np.fromregex('test.dat', r"(\d+)\s+(...)", [('num', np.int64), ('key', 'S3')]) + array([(1312L, 'foo'), (1534L, 'bar'), (444L, 'qux')], + dtype=[('num', ' Author: charris Date: 2008-04-13 01:05:28 -0500 (Sun, 13 Apr 2008) New Revision: 5027 Modified: trunk/numpy/core/src/arraytypes.inc.src Log: Reindent. Needs style cleanup too. Small cleanup of MyPyFloat_AsDouble. Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2008-04-12 23:18:27 UTC (rev 5026) +++ trunk/numpy/core/src/arraytypes.inc.src 2008-04-13 06:05:28 UTC (rev 5027) @@ -3,102 +3,102 @@ static longlong -MyPyLong_AsLongLong(PyObject *vv) +MyPyLong_AsLongLong(PyObject *obj) { - longlong ret; + longlong ret; - if (!PyLong_Check(vv)) { - PyObject *mylong; - mylong = PyNumber_Long(vv); - if (mylong == NULL) { - return (longlong) -1; - } - vv = mylong; + if (!PyLong_Check(obj)) { + PyObject *mylong; + mylong = PyNumber_Long(obj); + if (mylong == NULL) { + return (longlong) -1; } - else { - Py_INCREF(vv); - } + obj = mylong; + } + else { + Py_INCREF(obj); + } - ret = PyLong_AsLongLong(vv); - Py_DECREF(vv); - return ret; + ret = PyLong_AsLongLong(obj); + Py_DECREF(obj); + return ret; } static ulong -MyPyLong_AsUnsignedLong(PyObject *vv) +MyPyLong_AsUnsignedLong(PyObject *obj) { - ulong ret; + ulong ret; - if (!PyLong_Check(vv)) { - PyObject *mylong; - mylong = PyNumber_Long(vv); - if (mylong == NULL) { - return (ulong) -1; - } - vv = mylong; + if (!PyLong_Check(obj)) { + PyObject *mylong; + mylong = PyNumber_Long(obj); + if (mylong == NULL) { + return (ulong) -1; } - else { - Py_INCREF(vv); - } + obj = mylong; + } + else { + Py_INCREF(obj); + } - ret = PyLong_AsUnsignedLong(vv); - if (PyErr_Occurred()) { - PyErr_Clear(); - ret = (ulong) PyLong_AsLong(vv); - } - Py_DECREF(vv); - return ret; + ret = PyLong_AsUnsignedLong(obj); + if (PyErr_Occurred()) { + PyErr_Clear(); + ret = (ulong) PyLong_AsLong(obj); + } + Py_DECREF(obj); + return ret; } static ulonglong -MyPyLong_AsUnsignedLongLong(PyObject *vv) +MyPyLong_AsUnsignedLongLong(PyObject *obj) { - ulonglong ret; + ulonglong ret; - if (!PyLong_Check(vv)) { - PyObject *mylong; - mylong = PyNumber_Long(vv); - if (mylong == NULL) { - return (ulonglong) -1; - } - vv = mylong; + if (!PyLong_Check(obj)) { + PyObject *mylong; + mylong = PyNumber_Long(obj); + if (mylong == NULL) { + return (ulonglong) -1; } - else { - Py_INCREF(vv); - } + obj = mylong; + } + else { + Py_INCREF(obj); + } - ret = PyLong_AsUnsignedLongLong(vv); - if (PyErr_Occurred()) { - PyErr_Clear(); - ret = (ulonglong) PyLong_AsLongLong(vv); - } - Py_DECREF(vv); - return ret; + ret = PyLong_AsUnsignedLongLong(obj); + if (PyErr_Occurred()) { + PyErr_Clear(); + ret = (ulonglong) PyLong_AsLongLong(obj); + } + Py_DECREF(obj); + return ret; } static double _getNAN(void) { #ifdef NAN - return NAN; + return NAN; #else - static double nan=0; + static double nan=0; - if (nan == 0) { - double mul = 1e100; - double tmp = 0.0; - double pinf=0; - pinf = mul; - for (;;) { - pinf *= mul; - if (pinf == tmp) break; - tmp = pinf; - } - nan = pinf / pinf; + if (nan == 0) { + double mul = 1e100; + double tmp = 0.0; + double pinf=0; + pinf = mul; + for (;;) { + pinf *= mul; + if (pinf == tmp) break; + tmp = pinf; } - return nan; + nan = pinf / pinf; + } + return nan; #endif } @@ -106,21 +106,20 @@ static double MyPyFloat_AsDouble(PyObject *obj) { - PyObject *tmp; - double d; - if (PyString_Check(obj)) { - tmp = PyFloat_FromString(obj, 0); - if (tmp) { - d = PyFloat_AsDouble(tmp); - Py_DECREF(tmp); - return d; - } - else { - return _getNAN(); - } + if (PyString_Check(obj)) { + PyObject *tmp = PyFloat_FromString(obj, 0); + if (tmp) { + double d = PyFloat_AsDouble(tmp); + Py_DECREF(tmp); + return d; } - if (obj == Py_None) return _getNAN(); - return PyFloat_AsDouble(obj); + else { + return _getNAN(); + } + } + if (obj == Py_None) + return _getNAN(); + return PyFloat_AsDouble(obj); } @@ -138,46 +137,46 @@ static PyObject * @TYP at _getitem(char *ip, PyArrayObject *ap) { - @typ@ t1; + @typ@ t1; - if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) { - t1 = *((@typ@ *)ip); - return @func1@((@typ1@)t1); - } - else { - ap->descr->f->copyswap(&t1, ip, !PyArray_ISNOTSWAPPED(ap), - ap); - return @func1@((@typ1@)t1); - } + if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) { + t1 = *((@typ@ *)ip); + return @func1@((@typ1@)t1); + } + else { + ap->descr->f->copyswap(&t1, ip, !PyArray_ISNOTSWAPPED(ap), + ap); + return @func1@((@typ1@)t1); + } } static int @TYP at _setitem(PyObject *op, char *ov, PyArrayObject *ap) { - @typ@ temp; /* ensures alignment */ + @typ@ temp; /* ensures alignment */ - if (PyArray_IsScalar(op, @kind@)) { - temp = ((Py at kind@ScalarObject *)op)->obval; + if (PyArray_IsScalar(op, @kind@)) { + temp = ((Py at kind@ScalarObject *)op)->obval; + } + else { + temp = (@typ@)@func2@(op); + } + if (PyErr_Occurred()) { + if (PySequence_Check(op)) { + PyErr_Clear(); + PyErr_SetString(PyExc_ValueError, "setting an array" \ + " element with a sequence."); } - else { - temp = (@typ@)@func2@(op); - } - if (PyErr_Occurred()) { - if (PySequence_Check(op)) { - PyErr_Clear(); - PyErr_SetString(PyExc_ValueError, "setting an array" \ - " element with a sequence."); - } - return -1; - } - if (ap == NULL || PyArray_ISBEHAVED(ap)) - *((@typ@ *)ov)=temp; - else { - ap->descr->f->copyswap(ov, &temp, !PyArray_ISNOTSWAPPED(ap), - ap); - } + return -1; + } + if (ap == NULL || PyArray_ISBEHAVED(ap)) + *((@typ@ *)ov)=temp; + else { + ap->descr->f->copyswap(ov, &temp, !PyArray_ISNOTSWAPPED(ap), + ap); + } - return 0; + return 0; } /**end repeat**/ @@ -191,19 +190,19 @@ static PyObject * @TYP at _getitem(char *ip, PyArrayObject *ap) { - @typ@ t1, t2; + @typ@ t1, t2; - if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) { - return PyComplex_FromDoubles((double)((@typ@ *)ip)[0], - (double)((@typ@ *)ip)[1]); - } - else { - int size = sizeof(@typ@); - Bool swap = !PyArray_ISNOTSWAPPED(ap); - copy_and_swap(&t1, ip, size, 1, 0, swap); - copy_and_swap(&t2, ip+size, size, 1, 0, swap); - return PyComplex_FromDoubles((double)t1, (double)t2); - } + if ((ap==NULL) || PyArray_ISBEHAVED_RO(ap)) { + return PyComplex_FromDoubles((double)((@typ@ *)ip)[0], + (double)((@typ@ *)ip)[1]); + } + else { + int size = sizeof(@typ@); + Bool swap = !PyArray_ISNOTSWAPPED(ap); + copy_and_swap(&t1, ip, size, 1, 0, swap); + copy_and_swap(&t2, ip+size, size, 1, 0, swap); + return PyComplex_FromDoubles((double)t1, (double)t2); + } } /**end repeat**/ @@ -216,75 +215,75 @@ static int @TYP at _setitem(PyObject *op, char *ov, PyArrayObject *ap) { - Py_complex oop; - PyObject *op2; - c at typ@ temp; - int rsize; + Py_complex oop; + PyObject *op2; + c at typ@ temp; + int rsize; - if (!(PyArray_IsScalar(op, @kind@))) { - if (PyArray_Check(op) && (PyArray_NDIM(op)==0)) { - op2 = ((PyArrayObject *)op)->descr->f->getitem \ - (((PyArrayObject *)op)->data, - (PyArrayObject *)op); - } - else { - op2 = op; Py_INCREF(op); - } - if (op2 == Py_None) { - oop.real = oop.imag = _getNAN(); - } - else { - oop = PyComplex_AsCComplex (op2); - } - Py_DECREF(op2); - if (PyErr_Occurred()) return -1; - temp.real = (@typ@) oop.real; - temp.imag = (@typ@) oop.imag; + if (!(PyArray_IsScalar(op, @kind@))) { + if (PyArray_Check(op) && (PyArray_NDIM(op)==0)) { + op2 = ((PyArrayObject *)op)->descr->f->getitem \ + (((PyArrayObject *)op)->data, + (PyArrayObject *)op); } else { - temp = ((Py at kind@ScalarObject *)op)->obval; + op2 = op; Py_INCREF(op); } + if (op2 == Py_None) { + oop.real = oop.imag = _getNAN(); + } + else { + oop = PyComplex_AsCComplex (op2); + } + Py_DECREF(op2); + if (PyErr_Occurred()) return -1; + temp.real = (@typ@) oop.real; + temp.imag = (@typ@) oop.imag; + } + else { + temp = ((Py at kind@ScalarObject *)op)->obval; + } - memcpy(ov, &temp, ap->descr->elsize); - if (!PyArray_ISNOTSWAPPED(ap)) - byte_swap_vector(ov, 2, sizeof(@typ@)); + memcpy(ov, &temp, ap->descr->elsize); + if (!PyArray_ISNOTSWAPPED(ap)) + byte_swap_vector(ov, 2, sizeof(@typ@)); - rsize = sizeof(@typ@); - copy_and_swap(ov, &temp, rsize, 2, rsize, !PyArray_ISNOTSWAPPED(ap)); - return 0; + rsize = sizeof(@typ@); + copy_and_swap(ov, &temp, rsize, 2, rsize, !PyArray_ISNOTSWAPPED(ap)); + return 0; } /**end repeat**/ static PyObject * LONGDOUBLE_getitem(char *ip, PyArrayObject *ap) { - return PyArray_Scalar(ip, ap->descr, NULL); + return PyArray_Scalar(ip, ap->descr, NULL); } static int LONGDOUBLE_setitem(PyObject *op, char *ov, PyArrayObject *ap) { - longdouble temp; /* ensures alignment */ + longdouble temp; /* ensures alignment */ - if (PyArray_IsScalar(op, LongDouble)) { - temp = ((PyLongDoubleScalarObject *)op)->obval; - } - else { - temp = (longdouble) MyPyFloat_AsDouble(op); - } - if (PyErr_Occurred()) return -1; - if (ap == NULL || PyArray_ISBEHAVED(ap)) - *((longdouble *)ov)=temp; - else { - copy_and_swap(ov, &temp, ap->descr->elsize, 1, 0, - !PyArray_ISNOTSWAPPED(ap)); - } - return 0; + if (PyArray_IsScalar(op, LongDouble)) { + temp = ((PyLongDoubleScalarObject *)op)->obval; + } + else { + temp = (longdouble) MyPyFloat_AsDouble(op); + } + if (PyErr_Occurred()) return -1; + if (ap == NULL || PyArray_ISBEHAVED(ap)) + *((longdouble *)ov)=temp; + else { + copy_and_swap(ov, &temp, ap->descr->elsize, 1, 0, + !PyArray_ISNOTSWAPPED(ap)); + } + return 0; } static PyObject * CLONGDOUBLE_getitem(char *ip, PyArrayObject *ap) { - return PyArray_Scalar(ip, ap->descr, NULL); + return PyArray_Scalar(ip, ap->descr, NULL); } @@ -292,102 +291,102 @@ static PyObject * UNICODE_getitem(char *ip, PyArrayObject *ap) { - PyObject *obj; - int mysize; - PyArray_UCS4 *dptr; - char *buffer; - int alloc=0; + PyObject *obj; + int mysize; + PyArray_UCS4 *dptr; + char *buffer; + int alloc=0; - mysize = ap->descr->elsize >> 2; - dptr = (PyArray_UCS4 *)ip + mysize-1; - while(mysize > 0 && *dptr-- == 0) mysize--; - if (!PyArray_ISBEHAVED(ap)) { - buffer = _pya_malloc(mysize << 2); - if (buffer == NULL) - return PyErr_NoMemory(); - alloc = 1; - memcpy(buffer, ip, mysize << 2); - if (!PyArray_ISNOTSWAPPED(ap)) { - byte_swap_vector(buffer, mysize, 4); - } + mysize = ap->descr->elsize >> 2; + dptr = (PyArray_UCS4 *)ip + mysize-1; + while(mysize > 0 && *dptr-- == 0) mysize--; + if (!PyArray_ISBEHAVED(ap)) { + buffer = _pya_malloc(mysize << 2); + if (buffer == NULL) + return PyErr_NoMemory(); + alloc = 1; + memcpy(buffer, ip, mysize << 2); + if (!PyArray_ISNOTSWAPPED(ap)) { + byte_swap_vector(buffer, mysize, 4); } - else buffer = ip; + } + else buffer = ip; #ifdef Py_UNICODE_WIDE - obj = PyUnicode_FromUnicode((const Py_UNICODE *)buffer, mysize); + obj = PyUnicode_FromUnicode((const Py_UNICODE *)buffer, mysize); #else - /* create new empty unicode object of length mysize*2 */ - obj = MyPyUnicode_New(mysize*2); - if (obj == NULL) {if (alloc) _pya_free(buffer); return obj;} - mysize = PyUCS2Buffer_FromUCS4(((PyUnicodeObject *)obj)->str, - (PyArray_UCS4 *)buffer, mysize); - /* reset length of unicode object to ucs2size */ - if (MyPyUnicode_Resize((PyUnicodeObject *)obj, mysize) < 0) { - if (alloc) _pya_free(buffer); - Py_DECREF(obj); - return NULL; - } -#endif + /* create new empty unicode object of length mysize*2 */ + obj = MyPyUnicode_New(mysize*2); + if (obj == NULL) {if (alloc) _pya_free(buffer); return obj;} + mysize = PyUCS2Buffer_FromUCS4(((PyUnicodeObject *)obj)->str, + (PyArray_UCS4 *)buffer, mysize); + /* reset length of unicode object to ucs2size */ + if (MyPyUnicode_Resize((PyUnicodeObject *)obj, mysize) < 0) { if (alloc) _pya_free(buffer); + Py_DECREF(obj); + return NULL; + } +#endif + if (alloc) _pya_free(buffer); - return obj; + return obj; } static int UNICODE_setitem(PyObject *op, char *ov, PyArrayObject *ap) { - PyObject *temp; - Py_UNICODE *ptr; - int datalen; + PyObject *temp; + Py_UNICODE *ptr; + int datalen; #ifndef Py_UNICODE_WIDE - char *buffer; + char *buffer; #endif - if (!PyString_Check(op) && !PyUnicode_Check(op) && + if (!PyString_Check(op) && !PyUnicode_Check(op) && PySequence_Check(op) && PySequence_Size(op) > 0) { - PyErr_SetString(PyExc_ValueError, - "setting an array element with a sequence"); - return -1; - } - /* Sequence_Size might have returned an error */ - if (PyErr_Occurred()) PyErr_Clear(); - if ((temp=PyObject_Unicode(op)) == NULL) return -1; - ptr = PyUnicode_AS_UNICODE(temp); - if ((ptr == NULL) || (PyErr_Occurred())) { - Py_DECREF(temp); - return -1; - } - datalen = PyUnicode_GET_DATA_SIZE(temp); + PyErr_SetString(PyExc_ValueError, + "setting an array element with a sequence"); + return -1; + } + /* Sequence_Size might have returned an error */ + if (PyErr_Occurred()) PyErr_Clear(); + if ((temp=PyObject_Unicode(op)) == NULL) return -1; + ptr = PyUnicode_AS_UNICODE(temp); + if ((ptr == NULL) || (PyErr_Occurred())) { + Py_DECREF(temp); + return -1; + } + datalen = PyUnicode_GET_DATA_SIZE(temp); #ifdef Py_UNICODE_WIDE - memcpy(ov, ptr, MIN(ap->descr->elsize, datalen)); + memcpy(ov, ptr, MIN(ap->descr->elsize, datalen)); #else - if (!PyArray_ISALIGNED(ap)) { - buffer = _pya_malloc(ap->descr->elsize); - if (buffer == NULL) { - Py_DECREF(temp); - PyErr_NoMemory(); - return -1; - } + if (!PyArray_ISALIGNED(ap)) { + buffer = _pya_malloc(ap->descr->elsize); + if (buffer == NULL) { + Py_DECREF(temp); + PyErr_NoMemory(); + return -1; } - else buffer = ov; - datalen = PyUCS2Buffer_AsUCS4(ptr, (PyArray_UCS4 *)buffer, - datalen >> 1, - ap->descr->elsize >> 2); - datalen <<= 2; - if (!PyArray_ISALIGNED(ap)) { - memcpy(ov, buffer, datalen); - _pya_free(buffer); - } + } + else buffer = ov; + datalen = PyUCS2Buffer_AsUCS4(ptr, (PyArray_UCS4 *)buffer, + datalen >> 1, + ap->descr->elsize >> 2); + datalen <<= 2; + if (!PyArray_ISALIGNED(ap)) { + memcpy(ov, buffer, datalen); + _pya_free(buffer); + } #endif - /* Fill in the rest of the space with 0 */ - if (ap->descr->elsize > datalen) { - memset(ov + datalen, 0, (ap->descr->elsize - datalen)); - } + /* Fill in the rest of the space with 0 */ + if (ap->descr->elsize > datalen) { + memset(ov + datalen, 0, (ap->descr->elsize - datalen)); + } - if (!PyArray_ISNOTSWAPPED(ap)) - byte_swap_vector(ov, ap->descr->elsize >> 2, 4); - Py_DECREF(temp); - return 0; + if (!PyArray_ISNOTSWAPPED(ap)) + byte_swap_vector(ov, ap->descr->elsize >> 2, 4); + Py_DECREF(temp); + return 0; } /* STRING -- can handle both NULL-terminated and not NULL-terminated cases @@ -396,45 +395,45 @@ static PyObject * STRING_getitem(char *ip, PyArrayObject *ap) { - /* Will eliminate NULLs at the end */ - char *ptr; - int size = ap->descr->elsize; + /* Will eliminate NULLs at the end */ + char *ptr; + int size = ap->descr->elsize; - ptr = ip + size-1; - while (*ptr-- == '\0' && size > 0) size--; - return PyString_FromStringAndSize(ip,size); + ptr = ip + size-1; + while (*ptr-- == '\0' && size > 0) size--; + return PyString_FromStringAndSize(ip,size); } static int STRING_setitem(PyObject *op, char *ov, PyArrayObject *ap) { - char *ptr; - Py_ssize_t len; - PyObject *temp=NULL; + char *ptr; + Py_ssize_t len; + PyObject *temp=NULL; - if (!PyString_Check(op) && !PyUnicode_Check(op) && + if (!PyString_Check(op) && !PyUnicode_Check(op) && PySequence_Check(op) && PySequence_Size(op) > 0) { - PyErr_SetString(PyExc_ValueError, - "setting an array element with a sequence"); - return -1; - } - /* Sequence_Size might have returned an error */ - if (PyErr_Occurred()) PyErr_Clear(); - if ((temp = PyObject_Str(op)) == NULL) return -1; + PyErr_SetString(PyExc_ValueError, + "setting an array element with a sequence"); + return -1; + } + /* Sequence_Size might have returned an error */ + if (PyErr_Occurred()) PyErr_Clear(); + if ((temp = PyObject_Str(op)) == NULL) return -1; - if (PyString_AsStringAndSize(temp, &ptr, &len) == -1) { - Py_DECREF(temp); - return -1; - } - memcpy(ov, ptr, MIN(ap->descr->elsize,len)); - /* If string lenth is smaller than room in array - Then fill the rest of the element size - with NULL */ - if (ap->descr->elsize > len) { - memset(ov + len, 0, (ap->descr->elsize - len)); - } + if (PyString_AsStringAndSize(temp, &ptr, &len) == -1) { Py_DECREF(temp); - return 0; + return -1; + } + memcpy(ov, ptr, MIN(ap->descr->elsize,len)); + /* If string lenth is smaller than room in array + Then fill the rest of the element size + with NULL */ + if (ap->descr->elsize > len) { + memset(ov + len, 0, (ap->descr->elsize - len)); + } + Py_DECREF(temp); + return 0; } /* OBJECT */ @@ -442,38 +441,38 @@ static PyObject * OBJECT_getitem(char *ip, PyArrayObject *ap) { - if (*(PyObject **)ip == NULL) { - Py_INCREF(Py_None); - return Py_None; - } - if (!ap || PyArray_ISALIGNED(ap)) { - Py_INCREF(*(PyObject **)ip); - return *(PyObject **)ip; - } - else { - PyObject **obj; - obj = (PyObject **)ip; - Py_INCREF(*obj); - return *obj; - } + if (*(PyObject **)ip == NULL) { + Py_INCREF(Py_None); + return Py_None; + } + if (!ap || PyArray_ISALIGNED(ap)) { + Py_INCREF(*(PyObject **)ip); + return *(PyObject **)ip; + } + else { + PyObject **obj; + obj = (PyObject **)ip; + Py_INCREF(*obj); + return *obj; + } } static int OBJECT_setitem(PyObject *op, char *ov, PyArrayObject *ap) { - Py_INCREF(op); - if (!ap || PyArray_ISALIGNED(ap)) { - Py_XDECREF(*(PyObject **)ov); - *(PyObject **)ov = op; - } - else { - PyObject **obj; - obj = (PyObject **)ov; - Py_XDECREF(*obj); - memcpy(ov, &op, sizeof(PyObject *)); - } - return PyErr_Occurred() ? -1:0; + Py_INCREF(op); + if (!ap || PyArray_ISALIGNED(ap)) { + Py_XDECREF(*(PyObject **)ov); + *(PyObject **)ov = op; + } + else { + PyObject **obj; + obj = (PyObject **)ov; + Py_XDECREF(*obj); + memcpy(ov, &op, sizeof(PyObject *)); + } + return PyErr_Occurred() ? -1:0; } /* VOID */ @@ -481,98 +480,98 @@ static PyObject * VOID_getitem(char *ip, PyArrayObject *ap) { - PyObject *u=NULL; - PyArray_Descr* descr; - int itemsize; + PyObject *u=NULL; + PyArray_Descr* descr; + int itemsize; - descr = ap->descr; - if (descr->names) { - PyObject *key; - PyObject *names; - int i, n; - PyObject *ret; - PyObject *tup, *title; - PyArray_Descr *new; - int offset; - int savedflags; + descr = ap->descr; + if (descr->names) { + PyObject *key; + PyObject *names; + int i, n; + PyObject *ret; + PyObject *tup, *title; + PyArray_Descr *new; + int offset; + int savedflags; - /* get the names from the fields dictionary*/ - names = descr->names; - if (!names) goto finish; - n = PyTuple_GET_SIZE(names); - ret = PyTuple_New(n); - savedflags = ap->flags; - for (i=0; ifields, key); - if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, - &title)) { - Py_DECREF(ret); - ap->descr = descr; - return NULL; - } - ap->descr = new; - /* update alignment based on offset */ - if ((new->alignment > 1) && \ - ((((intp)(ip+offset)) % new->alignment) != 0)) - ap->flags &= ~ALIGNED; - else - ap->flags |= ALIGNED; - - PyTuple_SET_ITEM(ret, i, \ - new->f->getitem(ip+offset, ap)); - ap->flags = savedflags; - } + /* get the names from the fields dictionary*/ + names = descr->names; + if (!names) goto finish; + n = PyTuple_GET_SIZE(names); + ret = PyTuple_New(n); + savedflags = ap->flags; + for (i=0; ifields, key); + if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, + &title)) { + Py_DECREF(ret); ap->descr = descr; - return ret; + return NULL; + } + ap->descr = new; + /* update alignment based on offset */ + if ((new->alignment > 1) && \ + ((((intp)(ip+offset)) % new->alignment) != 0)) + ap->flags &= ~ALIGNED; + else + ap->flags |= ALIGNED; + + PyTuple_SET_ITEM(ret, i, \ + new->f->getitem(ip+offset, ap)); + ap->flags = savedflags; } + ap->descr = descr; + return ret; + } - if (descr->subarray) { - /* return an array of the basic type */ - PyArray_Dims shape={NULL,-1}; - PyObject *ret; - if (!(PyArray_IntpConverter(descr->subarray->shape, - &shape))) { - PyDimMem_FREE(shape.ptr); - PyErr_SetString(PyExc_ValueError, - "invalid shape in fixed-type tuple."); - return NULL; - } - Py_INCREF(descr->subarray->base); - ret = PyArray_NewFromDescr(&PyArray_Type, - descr->subarray->base, - shape.len, shape.ptr, - NULL, ip, ap->flags, NULL); - PyDimMem_FREE(shape.ptr); - if (!ret) return NULL; - PyArray_BASE(ret) = (PyObject *)ap; - Py_INCREF(ap); - PyArray_UpdateFlags((PyArrayObject *)ret, UPDATE_ALL); - return ret; + if (descr->subarray) { + /* return an array of the basic type */ + PyArray_Dims shape={NULL,-1}; + PyObject *ret; + if (!(PyArray_IntpConverter(descr->subarray->shape, + &shape))) { + PyDimMem_FREE(shape.ptr); + PyErr_SetString(PyExc_ValueError, + "invalid shape in fixed-type tuple."); + return NULL; } + Py_INCREF(descr->subarray->base); + ret = PyArray_NewFromDescr(&PyArray_Type, + descr->subarray->base, + shape.len, shape.ptr, + NULL, ip, ap->flags, NULL); + PyDimMem_FREE(shape.ptr); + if (!ret) return NULL; + PyArray_BASE(ret) = (PyObject *)ap; + Py_INCREF(ap); + PyArray_UpdateFlags((PyArrayObject *)ret, UPDATE_ALL); + return ret; + } - finish: - if (PyDataType_FLAGCHK(descr, NPY_ITEM_HASOBJECT) || +finish: + if (PyDataType_FLAGCHK(descr, NPY_ITEM_HASOBJECT) || PyDataType_FLAGCHK(descr, NPY_ITEM_IS_POINTER)) { - PyErr_SetString(PyExc_ValueError, - "tried to get void-array with object" - " members as buffer."); - return NULL; - } + PyErr_SetString(PyExc_ValueError, + "tried to get void-array with object" + " members as buffer."); + return NULL; + } - itemsize=ap->descr->elsize; - if (PyArray_ISWRITEABLE(ap)) - u = PyBuffer_FromReadWriteMemory(ip, itemsize); - else - u = PyBuffer_FromMemory(ip, itemsize); - if (u==NULL) goto fail; + itemsize=ap->descr->elsize; + if (PyArray_ISWRITEABLE(ap)) + u = PyBuffer_FromReadWriteMemory(ip, itemsize); + else + u = PyBuffer_FromMemory(ip, itemsize); + if (u==NULL) goto fail; - /* default is to return buffer object pointing to current item */ - /* a view of it */ - return u; + /* default is to return buffer object pointing to current item */ + /* a view of it */ + return u; - fail: - return NULL; +fail: + return NULL; } @@ -582,103 +581,103 @@ static int VOID_setitem(PyObject *op, char *ip, PyArrayObject *ap) { - PyArray_Descr* descr; - int itemsize=ap->descr->elsize; - int res; + PyArray_Descr* descr; + int itemsize=ap->descr->elsize; + int res; - descr = ap->descr; - if (descr->names && PyTuple_Check(op)) { - PyObject *key; - PyObject *names; - int i, n; - PyObject *tup, *title; - PyArray_Descr *new; - int offset; - int savedflags; - res = -1; - /* get the names from the fields dictionary*/ - names = descr->names; - n = PyTuple_GET_SIZE(names); - if (PyTuple_GET_SIZE(op) != n) { - PyErr_SetString(PyExc_ValueError, - "size of tuple must match "\ - "number of fields."); - return -1; - } - savedflags = ap->flags; - for (i=0; ifields, key); - if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, - &title)) { - ap->descr = descr; - return -1; - } - ap->descr = new; - /* remember to update alignment flags */ - if ((new->alignment > 1) && \ - ((((intp)(ip+offset)) % new->alignment) != 0)) - ap->flags &= ~ALIGNED; - else - ap->flags |= ALIGNED; - - res = new->f->setitem(PyTuple_GET_ITEM(op, i), - ip+offset, ap); - ap->flags = savedflags; - if (res < 0) break; - } + descr = ap->descr; + if (descr->names && PyTuple_Check(op)) { + PyObject *key; + PyObject *names; + int i, n; + PyObject *tup, *title; + PyArray_Descr *new; + int offset; + int savedflags; + res = -1; + /* get the names from the fields dictionary*/ + names = descr->names; + n = PyTuple_GET_SIZE(names); + if (PyTuple_GET_SIZE(op) != n) { + PyErr_SetString(PyExc_ValueError, + "size of tuple must match "\ + "number of fields."); + return -1; + } + savedflags = ap->flags; + for (i=0; ifields, key); + if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, + &title)) { ap->descr = descr; - return res; + return -1; + } + ap->descr = new; + /* remember to update alignment flags */ + if ((new->alignment > 1) && \ + ((((intp)(ip+offset)) % new->alignment) != 0)) + ap->flags &= ~ALIGNED; + else + ap->flags |= ALIGNED; + + res = new->f->setitem(PyTuple_GET_ITEM(op, i), + ip+offset, ap); + ap->flags = savedflags; + if (res < 0) break; } + ap->descr = descr; + return res; + } - if (descr->subarray) { - /* copy into an array of the same basic type */ - PyArray_Dims shape={NULL,-1}; - PyObject *ret; - if (!(PyArray_IntpConverter(descr->subarray->shape, - &shape))) { - PyDimMem_FREE(shape.ptr); - PyErr_SetString(PyExc_ValueError, - "invalid shape in fixed-type tuple."); - return -1; - } - Py_INCREF(descr->subarray->base); - ret = PyArray_NewFromDescr(&PyArray_Type, - descr->subarray->base, - shape.len, shape.ptr, - NULL, ip, ap->flags, NULL); - PyDimMem_FREE(shape.ptr); - if (!ret) return -1; - PyArray_BASE(ret) = (PyObject *)ap; - Py_INCREF(ap); - PyArray_UpdateFlags((PyArrayObject *)ret, UPDATE_ALL); - res = PyArray_CopyObject((PyArrayObject *)ret, op); - Py_DECREF(ret); - return res; + if (descr->subarray) { + /* copy into an array of the same basic type */ + PyArray_Dims shape={NULL,-1}; + PyObject *ret; + if (!(PyArray_IntpConverter(descr->subarray->shape, + &shape))) { + PyDimMem_FREE(shape.ptr); + PyErr_SetString(PyExc_ValueError, + "invalid shape in fixed-type tuple."); + return -1; } + Py_INCREF(descr->subarray->base); + ret = PyArray_NewFromDescr(&PyArray_Type, + descr->subarray->base, + shape.len, shape.ptr, + NULL, ip, ap->flags, NULL); + PyDimMem_FREE(shape.ptr); + if (!ret) return -1; + PyArray_BASE(ret) = (PyObject *)ap; + Py_INCREF(ap); + PyArray_UpdateFlags((PyArrayObject *)ret, UPDATE_ALL); + res = PyArray_CopyObject((PyArrayObject *)ret, op); + Py_DECREF(ret); + return res; + } - /* Default is to use buffer interface to set item */ - { - const void *buffer; - Py_ssize_t buflen; - if (PyDataType_FLAGCHK(descr, NPY_ITEM_HASOBJECT) || - PyDataType_FLAGCHK(descr, NPY_ITEM_IS_POINTER)) { - PyErr_SetString(PyExc_ValueError, - "tried to set void-array with object" - " members using buffer."); - return -1; - } - res = PyObject_AsReadBuffer(op, &buffer, &buflen); - if (res == -1) goto fail; - memcpy(ip, buffer, NPY_MIN(buflen, itemsize)); - if (itemsize > buflen) { - memset(ip+buflen, 0, (itemsize-buflen)); - } + /* Default is to use buffer interface to set item */ + { + const void *buffer; + Py_ssize_t buflen; + if (PyDataType_FLAGCHK(descr, NPY_ITEM_HASOBJECT) || + PyDataType_FLAGCHK(descr, NPY_ITEM_IS_POINTER)) { + PyErr_SetString(PyExc_ValueError, + "tried to set void-array with object" + " members using buffer."); + return -1; } - return 0; + res = PyObject_AsReadBuffer(op, &buffer, &buflen); + if (res == -1) goto fail; + memcpy(ip, buffer, NPY_MIN(buflen, itemsize)); + if (itemsize > buflen) { + memset(ip+buflen, 0, (itemsize-buflen)); + } + } + return 0; - fail: - return -1; +fail: + return -1; } @@ -698,10 +697,10 @@ @from at _to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n, PyArrayObject *aip, PyArrayObject *aop) { - while (n--) { - *op++ = (@totyp@)*ip; - @incr@; - } + while (n--) { + *op++ = (@totyp@)*ip; + @incr@; + } } /**end repeat**/ @@ -713,9 +712,9 @@ @from at _to_BOOL(register @fromtyp@ *ip, register Bool *op, register intp n, PyArrayObject *aip, PyArrayObject *aop) { - while (n--) { - *op++ = (Bool)(*ip++ != FALSE); - } + while (n--) { + *op++ = (Bool)(*ip++ != FALSE); + } } /**end repeat**/ @@ -727,10 +726,10 @@ @from at _to_BOOL(register @fromtyp@ *ip, register Bool *op, register intp n, PyArrayObject *aip, PyArrayObject *aop) { - while (n--) { - *op = (Bool)(((*ip).real != FALSE) || ((*ip).imag != FALSE)); - op++; ip++; - } + while (n--) { + *op = (Bool)(((*ip).real != FALSE) || ((*ip).imag != FALSE)); + op++; ip++; + } } /**end repeat**/ @@ -742,9 +741,9 @@ BOOL_to_ at to@(register Bool *ip, register @totyp@ *op, register intp n, PyArrayObject *aip, PyArrayObject *aop) { - while (n--) { - *op++ = (@totyp@)(*ip++ != FALSE); - } + while (n--) { + *op++ = (@totyp@)(*ip++ != FALSE); + } } /**end repeat**/ @@ -759,10 +758,10 @@ @from at _to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n, PyArrayObject *aip, PyArrayObject *aop) { - while (n--) { - *op++ = (@totyp@)*ip++; - *op++ = 0.0; - } + while (n--) { + *op++ = (@totyp@)*ip++; + *op++ = 0.0; + } } /**end repeat**/ @@ -778,10 +777,10 @@ @from at _to_@to@(register @fromtyp@ *ip, register @totyp@ *op, register intp n, PyArrayObject *aip, PyArrayObject *aop) { - n <<= 1; - while (n--) { - *op++ = (@totyp@)*ip++; - } + n <<= 1; + while (n--) { + *op++ = (@totyp@)*ip++; + } } /**end repeat**/ @@ -796,12 +795,12 @@ @from at _to_OBJECT(@fromtyp@ *ip, PyObject **op, intp n, PyArrayObject *aip, PyArrayObject *aop) { - register intp i; - int skip=@skip@; - for(i=0;idescr->elsize; - int oskip=@oskip@; - for(i=0; idescr->elsize; + int oskip=@oskip@; + for(i=0; idescr->elsize; - for(i=0; idescr->elsize; + for(i=0; idescr->elsize; - if (dstride == itemsize && sstride == itemsize) { - memcpy(dst, src, itemsize * n); - } - else { - _unaligned_strided_byte_copy(dst, dstride, src, sstride, n, itemsize); - } + if (src != NULL && arr != NULL) { + int itemsize = arr->descr->elsize; + if (dstride == itemsize && sstride == itemsize) { + memcpy(dst, src, itemsize * n); } - return; + else { + _unaligned_strided_byte_copy(dst, dstride, src, sstride, n, itemsize); + } + } + return; } /* */ @@ -1326,95 +1325,95 @@ VOID_copyswapn (char *dst, intp dstride, char *src, intp sstride, intp n, int swap, PyArrayObject *arr) { - if (arr == NULL) return; - if (PyArray_HASFIELDS(arr)) { - PyObject *key, *value, *title=NULL; - PyArray_Descr *new, *descr; - int offset; - Py_ssize_t pos=0; - descr = arr->descr; - while (PyDict_Next(descr->fields, &pos, &key, &value)) { - if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, - &title)) { - arr->descr=descr;return; - } - arr->descr = new; - new->f->copyswapn(dst+offset, dstride, - (src != NULL ? src+offset : NULL), - sstride, n, swap, arr); - } - arr->descr = descr; - return; + if (arr == NULL) return; + if (PyArray_HASFIELDS(arr)) { + PyObject *key, *value, *title=NULL; + PyArray_Descr *new, *descr; + int offset; + Py_ssize_t pos=0; + descr = arr->descr; + while (PyDict_Next(descr->fields, &pos, &key, &value)) { + if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, + &title)) { + arr->descr=descr;return; + } + arr->descr = new; + new->f->copyswapn(dst+offset, dstride, + (src != NULL ? src+offset : NULL), + sstride, n, swap, arr); } - if (swap && arr->descr->subarray != NULL) { - PyArray_Descr *descr, *new; - npy_intp num; - npy_intp i; - int subitemsize; - char *dstptr, *srcptr; - descr = arr->descr; - new = descr->subarray->base; - arr->descr = new; - dstptr = dst; - srcptr = src; - subitemsize = new->elsize; - num = descr->elsize / subitemsize; - for (i=0; if->copyswapn(dstptr, subitemsize, srcptr, - subitemsize, num, swap, arr); - dstptr += dstride; - if (srcptr) srcptr += sstride; - } - arr->descr = descr; - return; + arr->descr = descr; + return; + } + if (swap && arr->descr->subarray != NULL) { + PyArray_Descr *descr, *new; + npy_intp num; + npy_intp i; + int subitemsize; + char *dstptr, *srcptr; + descr = arr->descr; + new = descr->subarray->base; + arr->descr = new; + dstptr = dst; + srcptr = src; + subitemsize = new->elsize; + num = descr->elsize / subitemsize; + for (i=0; if->copyswapn(dstptr, subitemsize, srcptr, + subitemsize, num, swap, arr); + dstptr += dstride; + if (srcptr) srcptr += sstride; } - if (src != NULL) { - memcpy(dst, src, arr->descr->elsize * n); - } + arr->descr = descr; return; + } + if (src != NULL) { + memcpy(dst, src, arr->descr->elsize * n); + } + return; } static void VOID_copyswap (char *dst, char *src, int swap, PyArrayObject *arr) { - if (arr==NULL) return; - if (PyArray_HASFIELDS(arr)) { - PyObject *key, *value, *title=NULL; - PyArray_Descr *new, *descr; - int offset; - Py_ssize_t pos=0; - descr = arr->descr; /* Save it */ - while (PyDict_Next(descr->fields, &pos, &key, &value)) { - if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, - &title)) { - arr->descr=descr;return; - } - arr->descr = new; - new->f->copyswap(dst+offset, - (src != NULL ? src+offset : NULL), - swap, arr); - } - arr->descr = descr; - return; + if (arr==NULL) return; + if (PyArray_HASFIELDS(arr)) { + PyObject *key, *value, *title=NULL; + PyArray_Descr *new, *descr; + int offset; + Py_ssize_t pos=0; + descr = arr->descr; /* Save it */ + while (PyDict_Next(descr->fields, &pos, &key, &value)) { + if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, + &title)) { + arr->descr=descr;return; + } + arr->descr = new; + new->f->copyswap(dst+offset, + (src != NULL ? src+offset : NULL), + swap, arr); } - if (swap && arr->descr->subarray != NULL) { - PyArray_Descr *descr, *new; - npy_intp num; - int itemsize; - descr = arr->descr; - new = descr->subarray->base; - arr->descr = new; - itemsize = new->elsize; - num = descr->elsize / itemsize; - new->f->copyswapn(dst, itemsize, src, - itemsize, num, swap, arr); - arr->descr = descr; - return; - } - if (src != NULL) { - memcpy(dst, src, arr->descr->elsize); - } + arr->descr = descr; return; + } + if (swap && arr->descr->subarray != NULL) { + PyArray_Descr *descr, *new; + npy_intp num; + int itemsize; + descr = arr->descr; + new = descr->subarray->base; + arr->descr = new; + itemsize = new->elsize; + num = descr->elsize / itemsize; + new->f->copyswapn(dst, itemsize, src, + itemsize, num, swap, arr); + arr->descr = descr; + return; + } + if (src != NULL) { + memcpy(dst, src, arr->descr->elsize); + } + return; } @@ -1422,59 +1421,59 @@ UNICODE_copyswapn (char *dst, intp dstride, char *src, intp sstride, intp n, int swap, PyArrayObject *arr) { - int itemsize; - if (arr==NULL) return; - itemsize = arr->descr->elsize; - if (src != NULL) { - if (dstride == itemsize && sstride == itemsize) - memcpy(dst, src, n * itemsize); - else - _unaligned_strided_byte_copy(dst, dstride, src, - sstride, n, itemsize); - } + int itemsize; + if (arr==NULL) return; + itemsize = arr->descr->elsize; + if (src != NULL) { + if (dstride == itemsize && sstride == itemsize) + memcpy(dst, src, n * itemsize); + else + _unaligned_strided_byte_copy(dst, dstride, src, + sstride, n, itemsize); + } - n *= itemsize; - if (swap) { - register char *a, *b, c; - n >>= 2; /* n is the number of unicode characters to swap */ - for (a = (char *)dst; n>0; n--) { - b = a + 3; - c=*a; *a++ = *b; *b-- = c; - c=*a; *a++ = *b; *b-- = c; - a += 2; - } + n *= itemsize; + if (swap) { + register char *a, *b, c; + n >>= 2; /* n is the number of unicode characters to swap */ + for (a = (char *)dst; n>0; n--) { + b = a + 3; + c=*a; *a++ = *b; *b-- = c; + c=*a; *a++ = *b; *b-- = c; + a += 2; } + } } static void STRING_copyswap (char *dst, char *src, int swap, PyArrayObject *arr) { - if (src != NULL && arr != NULL) { - memcpy(dst, src, arr->descr->elsize); - } + if (src != NULL && arr != NULL) { + memcpy(dst, src, arr->descr->elsize); + } } static void UNICODE_copyswap (char *dst, char *src, int swap, PyArrayObject *arr) { - int itemsize; - if (arr == NULL) return; - itemsize = arr->descr->elsize; - if (src != NULL) { - memcpy(dst, src, itemsize); - } + int itemsize; + if (arr == NULL) return; + itemsize = arr->descr->elsize; + if (src != NULL) { + memcpy(dst, src, itemsize); + } - if (swap) { - register char *a, *b, c; - itemsize >>= 2; - for (a = (char *)dst; itemsize>0; itemsize--) { - b = a + 3; - c=*a; *a++ = *b; *b-- = c; - c=*a; *a++ = *b; *b-- = c; - a += 2; - } + if (swap) { + register char *a, *b, c; + itemsize >>= 2; + for (a = (char *)dst; itemsize>0; itemsize--) { + b = a + 3; + c=*a; *a++ = *b; *b-- = c; + c=*a; *a++ = *b; *b-- = c; + a += 2; } + } } @@ -1487,15 +1486,15 @@ static Bool @fname at _nonzero (@type@ *ip, PyArrayObject *ap) { - @type@ t1; - if (ap==NULL || PyArray_ISBEHAVED_RO(ap)) - return (Bool) (*ip != 0); - else { - /* don't worry about swap, since we are just testing - whether or not equal to 0 */ - memcpy(&t1, ip, sizeof(@type@)); - return (Bool) (t1 != 0); - } + @type@ t1; + if (ap==NULL || PyArray_ISBEHAVED_RO(ap)) + return (Bool) (*ip != 0); + else { + /* don't worry about swap, since we are just testing + whether or not equal to 0 */ + memcpy(&t1, ip, sizeof(@type@)); + return (Bool) (t1 != 0); + } } /**end repeat**/ @@ -1506,15 +1505,15 @@ static Bool @fname at _nonzero (@type@ *ip, PyArrayObject *ap) { - @type@ t1; - if (ap==NULL || PyArray_ISBEHAVED_RO(ap)) - return (Bool) ((ip->real != 0) || (ip->imag != 0)); - else { - /* don't worry about swap, since we are just testing - whether or not equal to 0 */ - memcpy(&t1, ip, sizeof(@type@)); - return (Bool) ((t1.real != 0) || (t1.imag != 0)); - } + @type@ t1; + if (ap==NULL || PyArray_ISBEHAVED_RO(ap)) + return (Bool) ((ip->real != 0) || (ip->imag != 0)); + else { + /* don't worry about swap, since we are just testing + whether or not equal to 0 */ + memcpy(&t1, ip, sizeof(@type@)); + return (Bool) ((t1.real != 0) || (t1.imag != 0)); + } } /**end repeat**/ @@ -1525,33 +1524,33 @@ static Bool Py_STRING_ISSPACE(char ch) { - char white[] = WHITESPACE; - int j; - Bool space=FALSE; - for (j=0; jdescr->elsize; - int i; - Bool nonz = FALSE; + int len = ap->descr->elsize; + int i; + Bool nonz = FALSE; - for (i=0; idescr->elsize >> 2; - int i; - Bool nonz = FALSE; - char *buffer=NULL; + int len = ap->descr->elsize >> 2; + int i; + Bool nonz = FALSE; + char *buffer=NULL; - if ((!PyArray_ISNOTSWAPPED(ap)) || \ + if ((!PyArray_ISNOTSWAPPED(ap)) || \ (!PyArray_ISALIGNED(ap))) { - buffer = _pya_malloc(ap->descr->elsize); - if (buffer == NULL) { - return nonz; - } - memcpy(buffer, ip, ap->descr->elsize); - if (!PyArray_ISNOTSWAPPED(ap)) { - byte_swap_vector(buffer, len, 4); - } - ip = (PyArray_UCS4 *)buffer; + buffer = _pya_malloc(ap->descr->elsize); + if (buffer == NULL) { + return nonz; } + memcpy(buffer, ip, ap->descr->elsize); + if (!PyArray_ISNOTSWAPPED(ap)) { + byte_swap_vector(buffer, len, 4); + } + ip = (PyArray_UCS4 *)buffer; + } - for (i=0; idescr; - savedflags = ap->flags; - while (PyDict_Next(descr->fields, &pos, &key, &value)) { - if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, - &title)) {PyErr_Clear(); continue;} - ap->descr = new; - ap->flags = savedflags; - if ((new->alignment > 1) && !__ALIGNED(ip+offset, new->alignment)) - ap->flags &= ~ALIGNED; - else - ap->flags |= ALIGNED; - if (new->f->nonzero(ip+offset, ap)) { - nonz=TRUE; - break; - } - } - ap->descr = descr; - ap->flags = savedflags; - return nonz; + if (PyArray_HASFIELDS(ap)) { + PyArray_Descr *descr, *new; + PyObject *key, *value, *title; + int savedflags, offset; + Py_ssize_t pos=0; + descr = ap->descr; + savedflags = ap->flags; + while (PyDict_Next(descr->fields, &pos, &key, &value)) { + if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, + &title)) {PyErr_Clear(); continue;} + ap->descr = new; + ap->flags = savedflags; + if ((new->alignment > 1) && !__ALIGNED(ip+offset, new->alignment)) + ap->flags &= ~ALIGNED; + else + ap->flags |= ALIGNED; + if (new->f->nonzero(ip+offset, ap)) { + nonz=TRUE; + break; + } } - len = ap->descr->elsize; - for (i=0; idescr = descr; + ap->flags = savedflags; return nonz; + } + len = ap->descr->elsize; + for (i=0; idescr->elsize; - register PyArray_UCS4 c1, c2; + register int itemsize=ap->descr->elsize; + register PyArray_UCS4 c1, c2; - if (itemsize < 0) return 0; + if (itemsize < 0) return 0; - while(itemsize-- > 0) { - c1 = *ip1++; - c2 = *ip2++; + while(itemsize-- > 0) { + c1 = *ip1++; + c2 = *ip2++; - if (c1 != c2) - return (c1 < c2) ? -1 : 1; - } - return 0; + if (c1 != c2) + return (c1 < c2) ? -1 : 1; + } + return 0; } /* If fields are defined, then compare on first field and if equal @@ -1751,63 +1750,63 @@ static int VOID_compare(char *ip1, char *ip2, PyArrayObject *ap) { - PyArray_Descr *descr, *new; - PyObject *names, *key; - PyObject *tup, *title; - char *nip1, *nip2; - int i, offset, res=0; + PyArray_Descr *descr, *new; + PyObject *names, *key; + PyObject *tup, *title; + char *nip1, *nip2; + int i, offset, res=0; - if (!PyArray_HASFIELDS(ap)) - return STRING_compare(ip1, ip2, ap); + if (!PyArray_HASFIELDS(ap)) + return STRING_compare(ip1, ip2, ap); - descr = ap->descr; - /* Compare on the first-field. If equal, then - compare on the second-field, etc. - */ - names = descr->names; - for (i=0; ifields, key); - if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, - &title)) { - goto finish; + descr = ap->descr; + /* Compare on the first-field. If equal, then + compare on the second-field, etc. + */ + names = descr->names; + for (i=0; ifields, key); + if (!PyArg_ParseTuple(tup, "Oi|O", &new, &offset, + &title)) { + goto finish; + } + ap->descr = new; + nip1 = ip1+offset; + nip2 = ip2+offset; + if (new->alignment > 1) { + if (((intp)(nip1) % new->alignment) != 0) { + /* create buffer and copy */ + nip1 = _pya_malloc(new->elsize); + if (nip1 == NULL) goto finish; + memcpy(nip1, ip1+offset, new->elsize); + } + if (((intp)(nip2) % new->alignment) != 0) { + /* copy data to a buffer */ + nip2 = _pya_malloc(new->elsize); + if (nip2 == NULL) { + if (nip1 != ip1+offset) + _pya_free(nip1); + goto finish; } - ap->descr = new; - nip1 = ip1+offset; - nip2 = ip2+offset; - if (new->alignment > 1) { - if (((intp)(nip1) % new->alignment) != 0) { - /* create buffer and copy */ - nip1 = _pya_malloc(new->elsize); - if (nip1 == NULL) goto finish; - memcpy(nip1, ip1+offset, new->elsize); - } - if (((intp)(nip2) % new->alignment) != 0) { - /* copy data to a buffer */ - nip2 = _pya_malloc(new->elsize); - if (nip2 == NULL) { - if (nip1 != ip1+offset) - _pya_free(nip1); - goto finish; - } - memcpy(nip2, ip2+offset, new->elsize); - } - } - res = new->f->compare(nip1, nip2, ap); - if (new->alignment > 1) { - if (nip1 != ip1+offset) { - _pya_free(nip1); - } - if (nip2 != ip2+offset) { - _pya_free(nip2); - } - } - if (res != 0) break; + memcpy(nip2, ip2+offset, new->elsize); + } } + res = new->f->compare(nip1, nip2, ap); + if (new->alignment > 1) { + if (nip1 != ip1+offset) { + _pya_free(nip1); + } + if (nip2 != ip2+offset) { + _pya_free(nip2); + } + } + if (res != 0) break; + } - finish: - ap->descr = descr; - return res; +finish: + ap->descr = descr; + return res; } /****************** argfunc **********************************/ @@ -1822,17 +1821,17 @@ static int @fname at _argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip) { - register intp i; - @type@ mp=*ip; - *max_ind=0; - for (i=1; i mp) { - mp = *ip; - *max_ind = i; - } + register intp i; + @type@ mp=*ip; + *max_ind=0; + for (i=1; i mp) { + mp = *ip; + *max_ind = i; } - return 0; + } + return 0; } /**end repeat**/ @@ -1840,21 +1839,21 @@ static int OBJECT_argmax(PyObject **ip, intp n, intp *max_ind, PyArrayObject *aip) { - register intp i; - PyObject *mp=ip[0]; *max_ind=0; - i = 1; - while(i 0) { + mp = *ip; + *max_ind=i; } - for(; i 0) { - mp = *ip; - *max_ind=i; - } - } - return 0; + } + return 0; } /**begin repeat @@ -1866,22 +1865,22 @@ static int @fname at _argmax(@type@ *ip, intp n, intp *max_ind, PyArrayObject *aip) { - register intp i; - int elsize = aip->descr->elsize; - @type@ *mp = (@type@ *)_pya_malloc(elsize); + register intp i; + int elsize = aip->descr->elsize; + @type@ *mp = (@type@ *)_pya_malloc(elsize); - if (mp==NULL) return 0; - memcpy(mp, ip, elsize); - *max_ind = 0; - for(i=1; i 0) { - memcpy(mp, ip, elsize); - *max_ind=i; - } + if (mp==NULL) return 0; + memcpy(mp, ip, elsize); + *max_ind = 0; + for(i=1; i 0) { + memcpy(mp, ip, elsize); + *max_ind=i; } - _pya_free(mp); - return 0; + } + _pya_free(mp); + return 0; } /**end repeat**/ @@ -1892,15 +1891,15 @@ BOOL_dot(char *ip1, intp is1, char *ip2, intp is2, char *op, intp n, void *ignore) { - register Bool tmp=FALSE; - register intp i; - for(i=0;ireal; - start.imag = buffer->imag; - delta.real = buffer[1].real; - delta.imag = buffer[1].imag; - delta.real -= start.real; - delta.imag -= start.imag; - buffer += 2; - for (i=2; ireal = start.real + i*delta.real; - buffer->imag = start.imag + i*delta.imag; - } + start.real = buffer->real; + start.imag = buffer->imag; + delta.real = buffer[1].real; + delta.imag = buffer[1].imag; + delta.real -= start.real; + delta.imag -= start.imag; + buffer += 2; + for (i=2; ireal = start.real + i*delta.real; + buffer->imag = start.imag + i*delta.imag; + } } /**end repeat**/ @@ -2050,13 +2049,13 @@ static void OBJECT_fillwithscalar(PyObject **buffer, intp length, PyObject **value, void *ignored) { - intp i; - PyObject *val = *value; - for (i=0; i max_val) { - out[i] = max_val; - } - } - return; - } - + if (max == NULL) { for (i = 0; i < ni; i++) { - if (in[i] < min_val) { - out[i] = min_val; - } else if (in[i] > max_val) { - out[i] = max_val; - } + if (in[i] < min_val) { + out[i] = min_val; + } } + return; + } + if (min == NULL) { + for (i = 0; i < ni; i++) { + if (in[i] > max_val) { + out[i] = max_val; + } + } return; + } + + for (i = 0; i < ni; i++) { + if (in[i] < min_val) { + out[i] = min_val; + } else if (in[i] > max_val) { + out[i] = max_val; + } + } + + return; } /**end repeat**/ @@ -2143,43 +2142,43 @@ static void @name at _fastclip(@type@ *in, intp ni, @type@ *min, @type@ *max, @type@ *out) { - register npy_intp i; - @type@ max_val, min_val; - - min_val = *min; - max_val = *max; + register npy_intp i; + @type@ max_val, min_val; - if (max != NULL) - max_val = *max; - if (min != NULL) - min_val = *min; + min_val = *min; + max_val = *max; - if (max == NULL) { - for (i = 0; i < ni; i++) { - if (PyArray_CLT(in[i],min_val)) { - out[i] = min_val; - } - } - return; - } + if (max != NULL) + max_val = *max; + if (min != NULL) + min_val = *min; - if (min == NULL) { - for (i = 0; i < ni; i++) { - if (PyArray_CGT(in[i], max_val)) { - out[i] = max_val; - } - } - return; - } + if (max == NULL) { + for (i = 0; i < ni; i++) { + if (PyArray_CLT(in[i],min_val)) { + out[i] = min_val; + } + } + return; + } + if (min == NULL) { for (i = 0; i < ni; i++) { - if (PyArray_CLT(in[i], min_val)) { - out[i] = min_val; - } else if (PyArray_CGT(in[i], max_val)) { - out[i] = max_val; - } + if (PyArray_CGT(in[i], max_val)) { + out[i] = max_val; + } } return; + } + + for (i = 0; i < ni; i++) { + if (PyArray_CLT(in[i], min_val)) { + out[i] = min_val; + } else if (PyArray_CGT(in[i], max_val)) { + out[i] = max_val; + } + } + return; } /**end repeat**/ @@ -2197,25 +2196,25 @@ static void @name at _fastputmask(@type@ *in, Bool *mask, intp ni, @type@ *vals, intp nv) { - register npy_intp i; - @type@ s_val; + register npy_intp i; + @type@ s_val; - if (nv == 1) { - s_val = *vals; - for (i = 0; i < ni; i++) { - if (mask[i]) { - in[i] = s_val; - } - } + if (nv == 1) { + s_val = *vals; + for (i = 0; i < ni; i++) { + if (mask[i]) { + in[i] = s_val; + } } - else { - for (i = 0; i < ni; i++) { - if (mask[i]) { - in[i] = vals[i%nv]; - } - } + } + else { + for (i = 0; i < ni; i++) { + if (mask[i]) { + in[i] = vals[i%nv]; + } } - return; + } + return; } /**end repeat**/ @@ -2241,67 +2240,67 @@ */ static PyArray_ArrFuncs _Py at NAME@_ArrFuncs = { - { - (PyArray_VectorUnaryFunc*)@from at _to_BOOL, - (PyArray_VectorUnaryFunc*)@from at _to_BYTE, - (PyArray_VectorUnaryFunc*)@from at _to_UBYTE, - (PyArray_VectorUnaryFunc*)@from at _to_SHORT, - (PyArray_VectorUnaryFunc*)@from at _to_USHORT, - (PyArray_VectorUnaryFunc*)@from at _to_INT, - (PyArray_VectorUnaryFunc*)@from at _to_UINT, - (PyArray_VectorUnaryFunc*)@from at _to_LONG, - (PyArray_VectorUnaryFunc*)@from at _to_ULONG, - (PyArray_VectorUnaryFunc*)@from at _to_LONGLONG, - (PyArray_VectorUnaryFunc*)@from at _to_ULONGLONG, - (PyArray_VectorUnaryFunc*)@from at _to_FLOAT, - (PyArray_VectorUnaryFunc*)@from at _to_DOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_LONGDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_CFLOAT, - (PyArray_VectorUnaryFunc*)@from at _to_CDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_CLONGDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_OBJECT, - (PyArray_VectorUnaryFunc*)@from at _to_STRING, - (PyArray_VectorUnaryFunc*)@from at _to_UNICODE, - (PyArray_VectorUnaryFunc*)@from at _to_VOID - }, - (PyArray_GetItemFunc*)@from at _getitem, - (PyArray_SetItemFunc*)@from at _setitem, - (PyArray_CopySwapNFunc*)@from at _copyswapn, - (PyArray_CopySwapFunc*)@from at _copyswap, - (PyArray_CompareFunc*)@from at _compare, - (PyArray_ArgFunc*)@from at _argmax, - (PyArray_DotFunc*)NULL, - (PyArray_ScanFunc*)@from at _scan, - (PyArray_FromStrFunc*)@from at _fromstr, - (PyArray_NonzeroFunc*)@from at _nonzero, - (PyArray_FillFunc*)NULL, - (PyArray_FillWithScalarFunc*)NULL, - { - NULL, NULL, NULL - }, - { - NULL, NULL, NULL - }, - NULL, - (PyArray_ScalarKindFunc*)NULL, - NULL, - NULL, - (PyArray_FastClipFunc *)NULL, - (PyArray_FastPutmaskFunc *)NULL + { + (PyArray_VectorUnaryFunc*)@from at _to_BOOL, + (PyArray_VectorUnaryFunc*)@from at _to_BYTE, + (PyArray_VectorUnaryFunc*)@from at _to_UBYTE, + (PyArray_VectorUnaryFunc*)@from at _to_SHORT, + (PyArray_VectorUnaryFunc*)@from at _to_USHORT, + (PyArray_VectorUnaryFunc*)@from at _to_INT, + (PyArray_VectorUnaryFunc*)@from at _to_UINT, + (PyArray_VectorUnaryFunc*)@from at _to_LONG, + (PyArray_VectorUnaryFunc*)@from at _to_ULONG, + (PyArray_VectorUnaryFunc*)@from at _to_LONGLONG, + (PyArray_VectorUnaryFunc*)@from at _to_ULONGLONG, + (PyArray_VectorUnaryFunc*)@from at _to_FLOAT, + (PyArray_VectorUnaryFunc*)@from at _to_DOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_LONGDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_CFLOAT, + (PyArray_VectorUnaryFunc*)@from at _to_CDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_CLONGDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_OBJECT, + (PyArray_VectorUnaryFunc*)@from at _to_STRING, + (PyArray_VectorUnaryFunc*)@from at _to_UNICODE, + (PyArray_VectorUnaryFunc*)@from at _to_VOID + }, + (PyArray_GetItemFunc*)@from at _getitem, + (PyArray_SetItemFunc*)@from at _setitem, + (PyArray_CopySwapNFunc*)@from at _copyswapn, + (PyArray_CopySwapFunc*)@from at _copyswap, + (PyArray_CompareFunc*)@from at _compare, + (PyArray_ArgFunc*)@from at _argmax, + (PyArray_DotFunc*)NULL, + (PyArray_ScanFunc*)@from at _scan, + (PyArray_FromStrFunc*)@from at _fromstr, + (PyArray_NonzeroFunc*)@from at _nonzero, + (PyArray_FillFunc*)NULL, + (PyArray_FillWithScalarFunc*)NULL, + { + NULL, NULL, NULL + }, + { + NULL, NULL, NULL + }, + NULL, + (PyArray_ScalarKindFunc*)NULL, + NULL, + NULL, + (PyArray_FastClipFunc *)NULL, + (PyArray_FastPutmaskFunc *)NULL }; static PyArray_Descr @from at _Descr = { - PyObject_HEAD_INIT(&PyArrayDescr_Type) + PyObject_HEAD_INIT(&PyArrayDescr_Type) &Py at NAME@ArrType_Type, - PyArray_ at from@LTR, - PyArray_ at from@LTR, - '@endian@', 0, - PyArray_ at from@, 0, - _ALIGN(@align@), - NULL, - NULL, - NULL, - &_Py at NAME@_ArrFuncs, + PyArray_ at from@LTR, + PyArray_ at from@LTR, + '@endian@', 0, + PyArray_ at from@, 0, + _ALIGN(@align@), + NULL, + NULL, + NULL, + &_Py at NAME@_ArrFuncs, }; /**end repeat**/ @@ -2319,68 +2318,68 @@ */ static PyArray_ArrFuncs _Py at NAME@_ArrFuncs = { - { - (PyArray_VectorUnaryFunc*)@from at _to_BOOL, - (PyArray_VectorUnaryFunc*)@from at _to_BYTE, - (PyArray_VectorUnaryFunc*)@from at _to_UBYTE, - (PyArray_VectorUnaryFunc*)@from at _to_SHORT, - (PyArray_VectorUnaryFunc*)@from at _to_USHORT, - (PyArray_VectorUnaryFunc*)@from at _to_INT, - (PyArray_VectorUnaryFunc*)@from at _to_UINT, - (PyArray_VectorUnaryFunc*)@from at _to_LONG, - (PyArray_VectorUnaryFunc*)@from at _to_ULONG, - (PyArray_VectorUnaryFunc*)@from at _to_LONGLONG, - (PyArray_VectorUnaryFunc*)@from at _to_ULONGLONG, - (PyArray_VectorUnaryFunc*)@from at _to_FLOAT, - (PyArray_VectorUnaryFunc*)@from at _to_DOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_LONGDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_CFLOAT, - (PyArray_VectorUnaryFunc*)@from at _to_CDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_CLONGDOUBLE, - (PyArray_VectorUnaryFunc*)@from at _to_OBJECT, - (PyArray_VectorUnaryFunc*)@from at _to_STRING, - (PyArray_VectorUnaryFunc*)@from at _to_UNICODE, - (PyArray_VectorUnaryFunc*)@from at _to_VOID - }, - (PyArray_GetItemFunc*)@from at _getitem, - (PyArray_SetItemFunc*)@from at _setitem, - (PyArray_CopySwapNFunc*)@from at _copyswapn, - (PyArray_CopySwapFunc*)@from at _copyswap, - (PyArray_CompareFunc*)@from at _compare, - (PyArray_ArgFunc*)@from at _argmax, - (PyArray_DotFunc*)@from at _dot, - (PyArray_ScanFunc*)@from at _scan, - (PyArray_FromStrFunc*)@from at _fromstr, - (PyArray_NonzeroFunc*)@from at _nonzero, - (PyArray_FillFunc*)@from at _fill, - (PyArray_FillWithScalarFunc*)@from at _fillwithscalar, - { - NULL, NULL, NULL - }, - { - NULL, NULL, NULL - }, - NULL, - (PyArray_ScalarKindFunc*)NULL, - NULL, - NULL, - (PyArray_FastClipFunc*)@from at _fastclip, - (PyArray_FastPutmaskFunc*)@from at _fastputmask + { + (PyArray_VectorUnaryFunc*)@from at _to_BOOL, + (PyArray_VectorUnaryFunc*)@from at _to_BYTE, + (PyArray_VectorUnaryFunc*)@from at _to_UBYTE, + (PyArray_VectorUnaryFunc*)@from at _to_SHORT, + (PyArray_VectorUnaryFunc*)@from at _to_USHORT, + (PyArray_VectorUnaryFunc*)@from at _to_INT, + (PyArray_VectorUnaryFunc*)@from at _to_UINT, + (PyArray_VectorUnaryFunc*)@from at _to_LONG, + (PyArray_VectorUnaryFunc*)@from at _to_ULONG, + (PyArray_VectorUnaryFunc*)@from at _to_LONGLONG, + (PyArray_VectorUnaryFunc*)@from at _to_ULONGLONG, + (PyArray_VectorUnaryFunc*)@from at _to_FLOAT, + (PyArray_VectorUnaryFunc*)@from at _to_DOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_LONGDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_CFLOAT, + (PyArray_VectorUnaryFunc*)@from at _to_CDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_CLONGDOUBLE, + (PyArray_VectorUnaryFunc*)@from at _to_OBJECT, + (PyArray_VectorUnaryFunc*)@from at _to_STRING, + (PyArray_VectorUnaryFunc*)@from at _to_UNICODE, + (PyArray_VectorUnaryFunc*)@from at _to_VOID + }, + (PyArray_GetItemFunc*)@from at _getitem, + (PyArray_SetItemFunc*)@from at _setitem, + (PyArray_CopySwapNFunc*)@from at _copyswapn, + (PyArray_CopySwapFunc*)@from at _copyswap, + (PyArray_CompareFunc*)@from at _compare, + (PyArray_ArgFunc*)@from at _argmax, + (PyArray_DotFunc*)@from at _dot, + (PyArray_ScanFunc*)@from at _scan, + (PyArray_FromStrFunc*)@from at _fromstr, + (PyArray_NonzeroFunc*)@from at _nonzero, + (PyArray_FillFunc*)@from at _fill, + (PyArray_FillWithScalarFunc*)@from at _fillwithscalar, + { + NULL, NULL, NULL + }, + { + NULL, NULL, NULL + }, + NULL, + (PyArray_ScalarKindFunc*)NULL, + NULL, + NULL, + (PyArray_FastClipFunc*)@from at _fastclip, + (PyArray_FastPutmaskFunc*)@from at _fastputmask }; static PyArray_Descr @from at _Descr = { - PyObject_HEAD_INIT(&PyArrayDescr_Type) + PyObject_HEAD_INIT(&PyArrayDescr_Type) &Py at NAME@ArrType_Type, - PyArray_ at kind@LTR, - PyArray_ at from@LTR, - '@endian@', @isobject@, - PyArray_ at from@, - @num@*sizeof(@fromtyp@), - _ALIGN(@fromtyp@), - NULL, - NULL, - NULL, - &_Py at NAME@_ArrFuncs, + PyArray_ at kind@LTR, + PyArray_ at from@LTR, + '@endian@', @isobject@, + PyArray_ at from@, + @num@*sizeof(@fromtyp@), + _ALIGN(@fromtyp@), + NULL, + NULL, + NULL, + &_Py at NAME@_ArrFuncs, }; /**end repeat**/ @@ -2389,27 +2388,27 @@ static char _letter_to_num[_MAX_LETTER]; static PyArray_Descr *_builtin_descrs[] = { - &BOOL_Descr, - &BYTE_Descr, - &UBYTE_Descr, - &SHORT_Descr, - &USHORT_Descr, - &INT_Descr, - &UINT_Descr, - &LONG_Descr, - &ULONG_Descr, - &LONGLONG_Descr, - &ULONGLONG_Descr, - &FLOAT_Descr, - &DOUBLE_Descr, - &LONGDOUBLE_Descr, - &CFLOAT_Descr, - &CDOUBLE_Descr, - &CLONGDOUBLE_Descr, - &OBJECT_Descr, - &STRING_Descr, - &UNICODE_Descr, - &VOID_Descr, + &BOOL_Descr, + &BYTE_Descr, + &UBYTE_Descr, + &SHORT_Descr, + &USHORT_Descr, + &INT_Descr, + &UINT_Descr, + &LONG_Descr, + &ULONG_Descr, + &LONGLONG_Descr, + &ULONGLONG_Descr, + &FLOAT_Descr, + &DOUBLE_Descr, + &LONGDOUBLE_Descr, + &CFLOAT_Descr, + &CDOUBLE_Descr, + &CLONGDOUBLE_Descr, + &OBJECT_Descr, + &STRING_Descr, + &UNICODE_Descr, + &VOID_Descr, }; /*OBJECT_API @@ -2418,72 +2417,72 @@ static PyArray_Descr * PyArray_DescrFromType(int type) { - PyArray_Descr *ret=NULL; + PyArray_Descr *ret=NULL; - if (type < PyArray_NTYPES) { - ret = _builtin_descrs[type]; - } - else if (type == PyArray_NOTYPE) { - /* This needs to not raise an error so - that PyArray_DescrFromType(PyArray_NOTYPE) - works for backwards-compatible C-API - */ - return NULL; - } - else if ((type == PyArray_CHAR) || \ - (type == PyArray_CHARLTR)) { - ret = PyArray_DescrNew(_builtin_descrs[PyArray_STRING]); - ret->elsize = 1; - ret->type = PyArray_CHARLTR; - return ret; - } - else if PyTypeNum_ISUSERDEF(type) { - ret = userdescrs[type-PyArray_USERDEF]; - } - else { - int num=PyArray_NTYPES; - if (type < _MAX_LETTER) - num = (int) _letter_to_num[type]; - if (num >= PyArray_NTYPES) - ret = NULL; - else - ret = _builtin_descrs[num]; - } - if (ret==NULL) { - PyErr_SetString(PyExc_ValueError, - "Invalid data-type for array"); - } - else Py_INCREF(ret); + if (type < PyArray_NTYPES) { + ret = _builtin_descrs[type]; + } + else if (type == PyArray_NOTYPE) { + /* This needs to not raise an error so + that PyArray_DescrFromType(PyArray_NOTYPE) + works for backwards-compatible C-API + */ + return NULL; + } + else if ((type == PyArray_CHAR) || \ + (type == PyArray_CHARLTR)) { + ret = PyArray_DescrNew(_builtin_descrs[PyArray_STRING]); + ret->elsize = 1; + ret->type = PyArray_CHARLTR; return ret; + } + else if PyTypeNum_ISUSERDEF(type) { + ret = userdescrs[type-PyArray_USERDEF]; + } + else { + int num=PyArray_NTYPES; + if (type < _MAX_LETTER) + num = (int) _letter_to_num[type]; + if (num >= PyArray_NTYPES) + ret = NULL; + else + ret = _builtin_descrs[num]; + } + if (ret==NULL) { + PyErr_SetString(PyExc_ValueError, + "Invalid data-type for array"); + } + else Py_INCREF(ret); + return ret; } static int set_typeinfo(PyObject *dict) { - PyObject *infodict, *s; - int i; + PyObject *infodict, *s; + int i; - for (i=0; i<_MAX_LETTER; i++) { - _letter_to_num[i] = PyArray_NTYPES; - } + for (i=0; i<_MAX_LETTER; i++) { + _letter_to_num[i] = PyArray_NTYPES; + } /**begin repeat #name=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,INTP,UINTP,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT,STRING,UNICODE,VOID# */ - _letter_to_num[PyArray_ at name@LTR] = PyArray_ at name@; + _letter_to_num[PyArray_ at name@LTR] = PyArray_ at name@; /**end repeat**/ - _letter_to_num[PyArray_STRINGLTR2] = PyArray_STRING; + _letter_to_num[PyArray_STRINGLTR2] = PyArray_STRING; /**begin repeat #name=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE,CFLOAT,CDOUBLE,CLONGDOUBLE,OBJECT,STRING,UNICODE,VOID# */ - @name at _Descr.fields = Py_None; + @name at _Descr.fields = Py_None; /**end repeat**/ - /* Set a dictionary with type information */ - infodict = PyDict_New(); - if (infodict == NULL) return -1; + /* Set a dictionary with type information */ + infodict = PyDict_New(); + if (infodict == NULL) return -1; #define BITSOF_INTP CHAR_BIT*SIZEOF_PY_INTPTR_T #define BITSOF_BYTE CHAR_BIT @@ -2499,15 +2498,15 @@ #cx=i*6,N,N,N,l,N,N,N# #cn=i*7,N,i,l,i,N,i# */ - PyDict_SetItemString(infodict, "@name@", - s=Py_BuildValue("ciii at cx@@cn at O", - PyArray_ at name@LTR, - PyArray_ at name@, - BITSOF_ at uname@, - _ALIGN(@type@), - @max@, @min@, - (PyObject *)&Py at Name@ArrType_Type)); - Py_DECREF(s); + PyDict_SetItemString(infodict, "@name@", + s=Py_BuildValue("ciii at cx@@cn at O", + PyArray_ at name@LTR, + PyArray_ at name@, + BITSOF_ at uname@, + _ALIGN(@type@), + @max@, @min@, + (PyObject *)&Py at Name@ArrType_Type)); + Py_DECREF(s); /**end repeat**/ #define BITSOF_CFLOAT 2*BITSOF_FLOAT @@ -2520,51 +2519,51 @@ #name=FLOAT, DOUBLE, LONGDOUBLE, CFLOAT, CDOUBLE, CLONGDOUBLE# #Name=Float,Double,LongDouble,CFloat,CDouble,CLongDouble# */ - PyDict_SetItemString(infodict, "@name@", - s=Py_BuildValue("ciiiO", PyArray_ at name@LTR, - PyArray_ at name@, BITSOF_ at name@, - _ALIGN(@type@), - (PyObject *)\ - &Py at Name@ArrType_Type)); - Py_DECREF(s); -/**end repeat**/ + PyDict_SetItemString(infodict, "@name@", + s=Py_BuildValue("ciiiO", PyArray_ at name@LTR, + PyArray_ at name@, BITSOF_ at name@, + _ALIGN(@type@), + (PyObject *)\ + &Py at Name@ArrType_Type)); + Py_DECREF(s); + /**end repeat**/ - PyDict_SetItemString(infodict, "OBJECT", - s=Py_BuildValue("ciiiO", PyArray_OBJECTLTR, - PyArray_OBJECT, - sizeof(PyObject *)*CHAR_BIT, - _ALIGN(PyObject *), - (PyObject *)\ - &PyObjectArrType_Type)); - Py_DECREF(s); - PyDict_SetItemString(infodict, "STRING", - s=Py_BuildValue("ciiiO", PyArray_STRINGLTR, - PyArray_STRING, 0, - _ALIGN(char), - (PyObject *)\ - &PyStringArrType_Type)); - Py_DECREF(s); - PyDict_SetItemString(infodict, "UNICODE", - s=Py_BuildValue("ciiiO", PyArray_UNICODELTR, - PyArray_UNICODE, 0, - _ALIGN(PyArray_UCS4), - (PyObject *)\ - &PyUnicodeArrType_Type)); - Py_DECREF(s); - PyDict_SetItemString(infodict, "VOID", - s=Py_BuildValue("ciiiO", PyArray_VOIDLTR, - PyArray_VOID, 0, - _ALIGN(char), - (PyObject *)\ - &PyVoidArrType_Type)); - Py_DECREF(s); + PyDict_SetItemString(infodict, "OBJECT", + s=Py_BuildValue("ciiiO", PyArray_OBJECTLTR, + PyArray_OBJECT, + sizeof(PyObject *)*CHAR_BIT, + _ALIGN(PyObject *), + (PyObject *)\ + &PyObjectArrType_Type)); + Py_DECREF(s); + PyDict_SetItemString(infodict, "STRING", + s=Py_BuildValue("ciiiO", PyArray_STRINGLTR, + PyArray_STRING, 0, + _ALIGN(char), + (PyObject *)\ + &PyStringArrType_Type)); + Py_DECREF(s); + PyDict_SetItemString(infodict, "UNICODE", + s=Py_BuildValue("ciiiO", PyArray_UNICODELTR, + PyArray_UNICODE, 0, + _ALIGN(PyArray_UCS4), + (PyObject *)\ + &PyUnicodeArrType_Type)); + Py_DECREF(s); + PyDict_SetItemString(infodict, "VOID", + s=Py_BuildValue("ciiiO", PyArray_VOIDLTR, + PyArray_VOID, 0, + _ALIGN(char), + (PyObject *)\ + &PyVoidArrType_Type)); + Py_DECREF(s); #define SETTYPE(name) \ - Py_INCREF(&Py##name##ArrType_Type); \ - PyDict_SetItemString(infodict, #name, \ - (PyObject *)&Py##name##ArrType_Type); + Py_INCREF(&Py##name##ArrType_Type); \ + PyDict_SetItemString(infodict, #name, \ + (PyObject *)&Py##name##ArrType_Type); - SETTYPE(Generic) + SETTYPE(Generic) SETTYPE(Number) SETTYPE(Integer) SETTYPE(Inexact) @@ -2578,8 +2577,8 @@ #undef SETTYPE PyDict_SetItemString(dict, "typeinfo", infodict); - Py_DECREF(infodict); - return 0; + Py_DECREF(infodict); + return 0; } #undef _MAX_LETTER From numpy-svn at scipy.org Sun Apr 13 06:04:17 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 13 Apr 2008 05:04:17 -0500 (CDT) Subject: [Numpy-svn] r5028 - trunk/numpy/doc Message-ID: <20080413100417.653F639C01A@new.scipy.org> Author: jarrod.millman Date: 2008-04-13 05:04:14 -0500 (Sun, 13 Apr 2008) New Revision: 5028 Modified: trunk/numpy/doc/example.py Log: adding abreviation for pyplot Modified: trunk/numpy/doc/example.py =================================================================== --- trunk/numpy/doc/example.py 2008-04-13 06:05:28 UTC (rev 5027) +++ trunk/numpy/doc/example.py 2008-04-13 10:04:14 UTC (rev 5028) @@ -12,11 +12,12 @@ # auto-generated documentation. __docformat__ = "restructuredtext en" -import os # standard library imports first +import os # standard library imports first -import numpy as np # related third party imports next -import scipy as sp # imports should be at the top of the module -import matplotlib as mpl # imports should usually be on separate lines +import numpy as np # related third party imports next +import scipy as sp # imports should be at the top of the module +import matplotlib as mpl # imports should usually be on separate lines +import matplotlib.pyplot as plt def foo(var1, var2, long_var_name='hi') : """One-line summary or signature. From numpy-svn at scipy.org Sun Apr 13 13:43:33 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 13 Apr 2008 12:43:33 -0500 (CDT) Subject: [Numpy-svn] r5029 - trunk/numpy/core/src Message-ID: <20080413174333.B24DC39C16A@new.scipy.org> Author: charris Date: 2008-04-13 12:43:32 -0500 (Sun, 13 Apr 2008) New Revision: 5029 Modified: trunk/numpy/core/src/arraytypes.inc.src Log: Simplify code in MyPyFloat_AsDouble and MyPyLong_As*. Add MyPyLong_AsLong. Use code generator for repeated code. Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2008-04-13 10:04:14 UTC (rev 5028) +++ trunk/numpy/core/src/arraytypes.inc.src 2008-04-13 17:43:32 UTC (rev 5029) @@ -1,84 +1,6 @@ /* -*- c -*- */ #include "config.h" - -static longlong -MyPyLong_AsLongLong(PyObject *obj) -{ - longlong ret; - - if (!PyLong_Check(obj)) { - PyObject *mylong; - mylong = PyNumber_Long(obj); - if (mylong == NULL) { - return (longlong) -1; - } - obj = mylong; - } - else { - Py_INCREF(obj); - } - - ret = PyLong_AsLongLong(obj); - Py_DECREF(obj); - return ret; -} - - -static ulong -MyPyLong_AsUnsignedLong(PyObject *obj) -{ - ulong ret; - - if (!PyLong_Check(obj)) { - PyObject *mylong; - mylong = PyNumber_Long(obj); - if (mylong == NULL) { - return (ulong) -1; - } - obj = mylong; - } - else { - Py_INCREF(obj); - } - - ret = PyLong_AsUnsignedLong(obj); - if (PyErr_Occurred()) { - PyErr_Clear(); - ret = (ulong) PyLong_AsLong(obj); - } - Py_DECREF(obj); - return ret; -} - - -static ulonglong -MyPyLong_AsUnsignedLongLong(PyObject *obj) -{ - ulonglong ret; - - if (!PyLong_Check(obj)) { - PyObject *mylong; - mylong = PyNumber_Long(obj); - if (mylong == NULL) { - return (ulonglong) -1; - } - obj = mylong; - } - else { - Py_INCREF(obj); - } - - ret = PyLong_AsUnsignedLongLong(obj); - if (PyErr_Occurred()) { - PyErr_Clear(); - ret = (ulonglong) PyLong_AsLongLong(obj); - } - Py_DECREF(obj); - return ret; -} - - static double _getNAN(void) { #ifdef NAN @@ -106,23 +28,59 @@ static double MyPyFloat_AsDouble(PyObject *obj) { - if (PyString_Check(obj)) { - PyObject *tmp = PyFloat_FromString(obj, 0); - if (tmp) { - double d = PyFloat_AsDouble(tmp); - Py_DECREF(tmp); - return d; - } - else { - return _getNAN(); - } - } - if (obj == Py_None) + double ret = 0; + PyObject *num = PyNumber_Float(obj); + + if (num == NULL) { return _getNAN(); - return PyFloat_AsDouble(obj); + } + ret = PyFloat_AsDouble(num); + Py_DECREF(num); + return ret; } +/**begin repeat +#type=long,longlong# +#Type=Long,LongLong# +*/ + +static @type@ +MyPyLong_As at Type@ (PyObject *obj) +{ + @type@ ret; + PyObject *num = PyNumber_Long(obj); + + if (num == NULL) { + return -1; + } + ret = PyLong_As at Type@(num); + Py_DECREF(num); + return ret; +} + + +static u at type@ +MyPyLong_AsUnsigned at Type@ (PyObject *obj) +{ + u at type@ ret; + PyObject *num = PyNumber_Long(obj); + + if (num == NULL) { + return -1; + } + ret = PyLong_AsUnsigned at Type@(num); + if (PyErr_Occurred()) { + PyErr_Clear(); + ret = PyLong_As at Type@(num); + } + Py_DECREF(num); + return ret; +} + +/**end repeat**/ + + /****************** getitem and setitem **********************/ /**begin repeat From numpy-svn at scipy.org Sun Apr 13 13:52:00 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 13 Apr 2008 12:52:00 -0500 (CDT) Subject: [Numpy-svn] r5030 - trunk/numpy/core/src Message-ID: <20080413175200.2D7F039C16A@new.scipy.org> Author: charris Date: 2008-04-13 12:51:58 -0500 (Sun, 13 Apr 2008) New Revision: 5030 Modified: trunk/numpy/core/src/arraytypes.inc.src Log: Make integers smaller than Long convert strings when possible. There is still a problem with the dimensions of the resulting array, but that problem is in the array creation code. Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2008-04-13 17:43:32 UTC (rev 5029) +++ trunk/numpy/core/src/arraytypes.inc.src 2008-04-13 17:51:58 UTC (rev 5030) @@ -87,7 +87,7 @@ #TYP=BOOL,BYTE,UBYTE,SHORT,USHORT,INT,LONG,UINT,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE# #func1=PyBool_FromLong, PyInt_FromLong*6, PyLong_FromUnsignedLong*2, PyLong_FromLongLong, PyLong_FromUnsignedLongLong, PyFloat_FromDouble*2# -#func2=PyObject_IsTrue, PyInt_AsLong*6, MyPyLong_AsUnsignedLong*2, MyPyLong_AsLongLong, MyPyLong_AsUnsignedLongLong, MyPyFloat_AsDouble*2# +#func2=PyObject_IsTrue, MyPyLong_AsLong*6, MyPyLong_AsUnsignedLong*2, MyPyLong_AsLongLong, MyPyLong_AsUnsignedLongLong, MyPyFloat_AsDouble*2# #typ=Bool, byte, ubyte, short, ushort, int, long, uint, ulong, longlong, ulonglong, float, double# #typ1=long*7, ulong*2, longlong, ulonglong, float, double# #kind=Bool, Byte, UByte, Short, UShort, Int, Long, UInt, ULong, LongLong, ULongLong, Float, Double# From numpy-svn at scipy.org Sun Apr 13 17:26:08 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 13 Apr 2008 16:26:08 -0500 (CDT) Subject: [Numpy-svn] r5031 - trunk/numpy/distutils/command Message-ID: <20080413212608.C868039C136@new.scipy.org> Author: cdavid Date: 2008-04-13 16:26:04 -0500 (Sun, 13 Apr 2008) New Revision: 5031 Modified: trunk/numpy/distutils/command/scons.py Log: Add one more level for silent modes in scons command. Modified: trunk/numpy/distutils/command/scons.py =================================================================== --- trunk/numpy/distutils/command/scons.py 2008-04-13 17:51:58 UTC (rev 5030) +++ trunk/numpy/distutils/command/scons.py 2008-04-13 21:26:04 UTC (rev 5031) @@ -185,8 +185,8 @@ "specify number of worker threads when executing scons"), ('scons-tool-path=', None, 'specify additional path '\ '(absolute) to look for scons tools'), - ('silent=', None, 'specify whether scons output should be silent '\ - '(1), super silent (2) or not (0, default)')] + ('silent=', None, 'specify whether scons output should less verbose'\ + '(1), silent (2), super silent (3) or not (0, default)')] def initialize_options(self): old_build_ext.initialize_options(self) @@ -320,10 +320,11 @@ cmd.append('include_bootstrap=%s' % dirl_to_str(get_numpy_include_dirs())) if self.silent: - if int(self.silent) == 1: + if int(self.silent) == 2: cmd.append('-Q') - elif int(self.silent) == 2: + elif int(self.silent) == 3: cmd.append('-s') + cmd.append('silent=%d' % int(self.silent)) cmdstr = ' '.join(cmd) log.info("Executing scons command (pkg is %s): %s ", pkg_name, cmdstr) st = os.system(cmdstr) From numpy-svn at scipy.org Mon Apr 14 12:07:27 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 14 Apr 2008 11:07:27 -0500 (CDT) Subject: [Numpy-svn] r5032 - in trunk/numpy/ma: . tests Message-ID: <20080414160727.6675A39C1DF@new.scipy.org> Author: pierregm Date: 2008-04-14 11:07:22 -0500 (Mon, 14 Apr 2008) New Revision: 5032 Added: trunk/numpy/ma/.RData trunk/numpy/ma/.Rhistory Modified: trunk/numpy/ma/ trunk/numpy/ma/core.py trunk/numpy/ma/extras.py trunk/numpy/ma/mrecords.py trunk/numpy/ma/tests/test_mrecords.py Log: core: fix_invalid : use isfinite & skip setting a mask is there's no invalid data _update_from: force the default hardmask to False (instead of relying on class default) extras: cleanup mrecords: modified to meet new standards (import numpy as np) __array_finalize__ : skip the call to _update_from and directly update __dict__ __setmask__ : allow an update from a valid fieldmask mask : as recognizable property Property changes on: trunk/numpy/ma ___________________________________________________________________ Name: svn:ignore + core_tmp.py ma_old.py Added: trunk/numpy/ma/.RData =================================================================== (Binary files differ) Property changes on: trunk/numpy/ma/.RData ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/numpy/ma/.Rhistory =================================================================== --- trunk/numpy/ma/.Rhistory 2008-04-13 21:26:04 UTC (rev 5031) +++ trunk/numpy/ma/.Rhistory 2008-04-14 16:07:22 UTC (rev 5032) @@ -0,0 +1,41 @@ +winter <- c(NA,NA,4,2,16,26,5,1,5,1,2,3,1) +spring <- c( 4, 3, 5, 3, 2, 7, 3, 1, 1, 2, 3, 5, 3) +cov(winter,spring) +cov(winter,spring,use="complte.obs") +cov(winter,spring,use="complete.obs") +cor(winter,spring,use="complete.obs") +cov2cor(winter,spring,use="complete.obs") +help(cov2cor) +swiss +cor(winter,spring,use="complete.obs") +ccf(winter,spring) +ccf(winter,spring,na.action=pass) +ccf(winter,spring,na.action=na.pass) +ccf(winter,na.action=na.pass) +acf(winter,na.action=na.pass) +cov(winter,spring,use="complete.obs") +cov(winter,use="complete.obs") +cov(winter,winter,use="complete.obs") +winter <- c(NA,NA,4,2,16,26,5,1,5,1,2,3,1) +spring <- c( 4, 3, 5, 3, 2, 7, 3, 1, 1, 2, 3, 5, 3) +summer <- c( 3, 2, 5, 6, 18, 4, 9, 1, 1, NA, 1, 1, NA) +fall <- c(NA, 6, 11, 4, 17,NA, 6, 1, 1, 2, 5, 1, 1] +fall <- c(NA, 6, 11, 4, 17,NA, 6, 1, 1, 2, 5, 1, 1) +cov(winter,summer,use="complete.obs") +cov(winter,fall,use="complete.obs") +anova(winter,spring) +fit<-lm(winter~spring) +anova(fit) +winter +win<-c(0,0,4,2,16,26,5,1,5,1,2,3,1) +spring +fit<-lm(win~spring) +anova(fit) +fit<-lm(spring~win) +anova(fit) +xx +x +x<-c(1,2,3,4,5,6,7,8,9,10) +y<-c(10,9,8,7,6,5,4,4,4,4) +fit<-lm(x~y) +anova(fit) Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-04-13 21:26:04 UTC (rev 5031) +++ trunk/numpy/ma/core.py 2008-04-14 16:07:22 UTC (rev 5032) @@ -330,7 +330,10 @@ """ a = masked_array(a, copy=copy, subok=True) - invalid = (numpy.isnan(a._data) | numpy.isinf(a._data)) + #invalid = (numpy.isnan(a._data) | numpy.isinf(a._data)) + invalid = numpy.logical_not(numpy.isfinite(a._data)) + if not invalid.any(): + return a a._mask |= invalid if fill_value is None: fill_value = a.fill_value @@ -1224,7 +1227,7 @@ def _update_from(self, obj): """Copies some attributes of obj to self. """ - self._hardmask = getattr(obj, '_hardmask', self._defaulthardmask) + self._hardmask = getattr(obj, '_hardmask', False) self._sharedmask = getattr(obj, '_sharedmask', False) if obj is not None: self._baseclass = getattr(obj, '_baseclass', type(obj)) Modified: trunk/numpy/ma/extras.py =================================================================== --- trunk/numpy/ma/extras.py 2008-04-13 21:26:04 UTC (rev 5031) +++ trunk/numpy/ma/extras.py 2008-04-14 16:07:22 UTC (rev 5032) @@ -824,6 +824,3 @@ return result ################################################################################ -testmathworks = fix_invalid([1.165 , 0.6268, 0.0751, 0.3516, -0.6965, - numpy.nan]) -expand_dims(testmathworks.mean(0),0) \ No newline at end of file Modified: trunk/numpy/ma/mrecords.py =================================================================== --- trunk/numpy/ma/mrecords.py 2008-04-13 21:26:04 UTC (rev 5031) +++ trunk/numpy/ma/mrecords.py 2008-04-14 16:07:22 UTC (rev 5032) @@ -18,25 +18,22 @@ import sys import types -import numpy -from numpy import bool_, complex_, float_, int_, str_, object_, dtype -from numpy import array as narray -import numpy.core.numeric as numeric +import numpy as np +from numpy import bool_, complex_, float_, int_, str_, object_, dtype, \ + chararray, ndarray, recarray, record, array as narray import numpy.core.numerictypes as ntypes -from numpy.core.defchararray import chararray -from numpy.core.records import find_duplicate, format_parser, record, recarray -from numpy.core.records import fromarrays as recfromarrays -from numpy.core.records import fromrecords as recfromrecords +from numpy.core.records import find_duplicate, format_parser +from numpy.core.records import fromarrays as recfromarrays, \ + fromrecords as recfromrecords -ndarray = numeric.ndarray -_byteorderconv = numpy.core.records._byteorderconv +_byteorderconv = np.core.records._byteorderconv _typestr = ntypes._typestr -import numpy.ma +import numpy.ma as ma from numpy.ma import MAError, MaskedArray, masked, nomask, masked_array,\ - make_mask, mask_or, getdata, getmask, getmaskarray, filled -from numpy.ma.core import default_fill_value, masked_print_option -_check_fill_value = numpy.ma.core._check_fill_value + make_mask, mask_or, getdata, getmask, getmaskarray, filled, \ + default_fill_value, masked_print_option +_check_fill_value = ma.core._check_fill_value import warnings @@ -53,7 +50,7 @@ formats = '' for obj in data: - obj = numeric.asarray(obj) + obj = np.asarray(obj) # if not isinstance(obj, ndarray): ## if not isinstance(obj, ndarray): # raise ValueError, "item in the array list must be an ndarray." @@ -96,7 +93,7 @@ def _get_fieldmask(self): mdescr = [(n,'|b1') for n in self.dtype.names] - fdmask = numpy.empty(self.shape, dtype=mdescr) + fdmask = np.empty(self.shape, dtype=mdescr) fdmask.flat = tuple([False]*len(mdescr)) return fdmask @@ -130,17 +127,17 @@ # self = self.view(cls) # mdtype = [(k,'|b1') for (k,_) in self.dtype.descr] - if mask is nomask or not numpy.size(mask): + if mask is nomask or not np.size(mask): if not keep_mask: self._fieldmask = tuple([False]*len(mdtype)) else: - mask = narray(mask, copy=copy) + mask = np.array(mask, copy=copy) if mask.shape != self.shape: (nd, nm) = (self.size, mask.size) if nm == 1: - mask = numpy.resize(mask, self.shape) + mask = np.resize(mask, self.shape) elif nm == nd: - mask = numpy.reshape(mask, self.shape) + mask = np.reshape(mask, self.shape) else: msg = "Mask and data not compatible: data size is %i, "+\ "mask size is %i." @@ -153,8 +150,8 @@ if mask.dtype == mdtype: _fieldmask = mask else: - _fieldmask = narray([tuple([m]*len(mdtype)) for m in mask], - dtype=mdtype) + _fieldmask = np.array([tuple([m]*len(mdtype)) for m in mask], + dtype=mdtype) self._fieldmask = _fieldmask return self #...................................................... @@ -165,21 +162,25 @@ mdescr = [(n,'|b1') for (n,_) in self.dtype.descr] _mask = getattr(obj, '_mask', nomask) if _mask is nomask: - _fieldmask = numpy.empty(self.shape, dtype=mdescr).view(recarray) + _fieldmask = np.empty(self.shape, dtype=mdescr).view(recarray) _fieldmask.flat = tuple([False]*len(mdescr)) else: _fieldmask = narray([tuple([m]*len(mdescr)) for m in _mask], dtype=mdescr).view(recarray) # Update some of the attributes + if obj is not None: + _baseclass = getattr(obj,'_baseclass',type(obj)) + else: + _baseclass = recarray attrdict = dict(_fieldmask=_fieldmask, _hardmask=getattr(obj,'_hardmask',False), - _fill_value=getattr(obj,'_fill_value',None)) + _fill_value=getattr(obj,'_fill_value',None), + _sharedmask=getattr(obj,'_sharedmask',False), + _baseclass=_baseclass) self.__dict__.update(attrdict) # Finalize as a regular maskedarray ..... - # Note: we can't call MaskedArray.__array_finalize__, it chokes pickling - self._update_from(obj) # Update special attributes ... - self._basedict = getattr(obj, '_basedict', getattr(obj, '__dict__', None)) + self._basedict = getattr(obj, '_basedict', getattr(obj,'__dict__',None)) if self._basedict is not None: self.__dict__.update(self._basedict) return @@ -193,6 +194,12 @@ "Sets the mask and update the fieldmask." names = self.dtype.names fmask = self.__dict__['_fieldmask'] + # + if isinstance(mask,ndarray) and mask.dtype.names == names: + for n in names: + fmask[n] = mask[n].astype(bool) +# self.__dict__['_fieldmask'] = fmask.view(recarray) + return newmask = make_mask(mask, copy=False) if names is not None: if self._hardmask: @@ -213,7 +220,7 @@ return self._fieldmask.view((bool_, len(self.dtype))).all(1) else: return self._fieldmask.view((bool_, len(self.dtype))).all() - _mask = property(fget=_getmask, fset=_setmask) + mask = _mask = property(fget=_getmask, fset=_setmask) #...................................................... def get_fill_value(self): """Return the filling value. @@ -222,7 +229,7 @@ if self._fill_value is None: ddtype = self.dtype fillval = _check_fill_value(None, ddtype) - self._fill_value = narray(tuple(fillval), dtype=ddtype) + self._fill_value = np.array(tuple(fillval), dtype=ddtype) return self._fill_value def set_fill_value(self, value=None): @@ -233,7 +240,7 @@ """ ddtype = self.dtype fillval = _check_fill_value(value, ddtype) - self._fill_value = narray(tuple(fillval), dtype=ddtype) + self._fill_value = np.array(tuple(fillval), dtype=ddtype) fill_value = property(fget=get_fill_value, fset=set_fill_value, doc="Filling value.") @@ -271,7 +278,7 @@ def __setattr__(self, attr, val): "Sets the attribute attr to the value val." - newattr = attr not in self.__dict__ +# newattr = attr not in self.__dict__ try: # Is attr a generic attribute ? ret = object.__setattr__(self, attr, val) @@ -282,17 +289,20 @@ exctype, value = sys.exc_info()[:2] raise exctype, value else: + if attr in ['_mask','fieldmask']: + self.__setmask__(val) + return # Get the list of names ...... _names = self.dtype.names if _names is None: _names = [] else: _names = list(_names) - _names += ['_mask','mask'] # Check the attribute - if attr not in _names: + self_dict = self.__dict__ + if attr not in _names+list(self_dict): return ret - if newattr: # We just added this one + if attr not in self_dict: # We just added this one try: # or this setattr worked on an internal # attribute. object.__delattr__(self, attr) @@ -300,7 +310,7 @@ return ret # Case #1.: Basic field ............ base_fmask = self._fieldmask - _names = self.dtype.names + _names = self.dtype.names or [] if attr in _names: if val is masked: fval = self.fill_value[attr] @@ -313,17 +323,6 @@ self._data.__setattr__(attr, fval) base_fmask.__setattr__(attr, mval) return - elif attr == '_mask': - #FIXME: We should check for self._harmask over there. -# if self._hardmask: -# val = make_mask(val) -# if val is not nomask: -## mval = getmaskarray(val) -# for k in _names: -# m = mask_or(val, base_fmask.__getattr__(k)) -# base_fmask.__setattr__(k, m) - self.__setmask__(val) - return #............................................ def __getitem__(self, indx): """Returns all the fields sharing the same fieldname base. @@ -369,7 +368,7 @@ m[n][i:j] = mval else: mindx = getmaskarray(self)[i:j] - dval = numeric.asarray(value) + dval = np.asarray(value) valmask = getmask(value) if valmask is nomask: for n in names: @@ -410,7 +409,7 @@ return ndarray.view(self, obj) except TypeError: pass - dtype = numeric.dtype(obj) + dtype = np.dtype(obj) if dtype.fields is None: return self.__array__().view(dtype) return ndarray.view(self, obj) @@ -426,23 +425,22 @@ _localdict = self.__dict__ d = self._data fm = _localdict['_fieldmask'] - if not numeric.asarray(fm, dtype=bool_).any(): + if not np.asarray(fm, dtype=bool_).any(): return d # if fill_value is None: value = _check_fill_value(_localdict['_fill_value'],self.dtype) else: value = fill_value - if numeric.size(value) == 1: + if np.size(value) == 1: value = [value,] * len(self.dtype) # if self is masked: - result = numeric.asanyarray(value) + result = np.asanyarray(value) else: result = d.copy() for (n, v) in zip(d.dtype.names, value): - numpy.putmask(numeric.asarray(result[n]), - numeric.asarray(fm[n]), v) + np.putmask(np.asarray(result[n]), np.asarray(fm[n]), v) return result #...................................................... def harden_mask(self): @@ -506,7 +504,7 @@ (ver, shp, typ, isf, raw, msk, flv) = state ndarray.__setstate__(self, (shp, typ, isf, raw)) mdtype = dtype([(k,bool_) for (k,_) in self.dtype.descr]) - self._fieldmask.__setstate__((shp, mdtype, isf, msk)) + self.__dict__['_fieldmask'].__setstate__((shp, mdtype, isf, msk)) self.fill_value = flv # def __reduce__(self): @@ -639,7 +637,7 @@ mrec.fill_value = fill_value # Now, let's deal w/ the mask if mask is not nomask: - mask = narray(mask, copy=False) + mask = np.array(mask, copy=False) maskrecordlength = len(mask.dtype) if maskrecordlength: mrec._fieldmask.flat = mask @@ -658,7 +656,7 @@ on the first line. An exception is raised if the file is 3D or more. """ vartypes = [] - arr = numeric.asarray(arr) + arr = np.asarray(arr) if len(arr.shape) == 2 : arr = arr[0] elif len(arr.shape) > 2: @@ -676,11 +674,11 @@ except ValueError: vartypes.append(arr.dtype) else: - vartypes.append(complex_) + vartypes.append(complex) else: - vartypes.append(float_) + vartypes.append(float) else: - vartypes.append(int_) + vartypes.append(int) return vartypes def openfile(fname): @@ -741,7 +739,7 @@ if vartypes is None: vartypes = _guessvartypes(_variables[0]) else: - vartypes = [numeric.dtype(v) for v in vartypes] + vartypes = [np.dtype(v) for v in vartypes] if len(vartypes) != nfields: msg = "Attempting to %i dtypes for %i fields!" msg += " Reverting to default." @@ -766,11 +764,10 @@ _mask = mrecord._fieldmask if newfieldname is None or newfieldname in reserved_fields: newfieldname = 'f%i' % len(_data.dtype) - newfield = masked_array(newfield) + newfield = ma.array(newfield) # Get the new data ............ # Create a new empty recarray - newdtype = numeric.dtype(_data.dtype.descr + \ - [(newfieldname, newfield.dtype)]) + newdtype = np.dtype(_data.dtype.descr + [(newfieldname, newfield.dtype)]) newdata = recarray(_data.shape, newdtype) # Add the exisintg field [newdata.setfield(_data.getfield(*f),*f) @@ -780,7 +777,7 @@ newdata = newdata.view(MaskedRecords) # Get the new mask ............. # Create a new empty recarray - newmdtype = numeric.dtype([(n,bool_) for n in newdtype.names]) + newmdtype = np.dtype([(n,bool_) for n in newdtype.names]) newmask = recarray(_data.shape, newmdtype) # Add the old masks [newmask.setfield(_mask.getfield(*f),*f) @@ -793,29 +790,20 @@ ############################################################################### # -#if 1: -# from numpy.ma.testutils import assert_equal -# if 1: -# ilist = [1,2,3,4,5] -# flist = [1.1,2.2,3.3,4.4,5.5] -# slist = ['one','two','three','four','five'] -# ddtype = [('a',int_),('b',float_),('c','|S8')] -# mask = [0,1,0,0,1] -# self_base = masked_array(zip(ilist,flist,slist), mask=mask, dtype=ddtype) -# if 1: -# base = self_base.copy() -# mbase = base.view(mrecarray) -# mbase = mbase.copy() -# mbase.fill_value = (999999,1e20,'N/A') -# -# print mbase.a -# -# # Change the data, the mask should be conserved -# mbase.a._data[:] = 5 -# assert_equal(mbase['a']._data, [5,5,5,5,5]) -# assert_equal(mbase['a']._mask, [0,1,0,0,1]) -# # -# z = mbase.a -# print z.tolist() -# z = base[:2] -# print z.view(mrecarray) \ No newline at end of file +if 1: + import numpy.ma as ma + from numpy.ma.testutils import * + if 1: + ilist = [1,2,3,4,5] + flist = [1.1,2.2,3.3,4.4,5.5] + slist = ['one','two','three','four','five'] + ddtype = [('a',int),('b',float),('c','|S8')] + mask = [0,1,0,0,1] + self_base = ma.array(zip(ilist,flist,slist), mask=mask, dtype=ddtype) + if 1: + mbase = self_base.copy().view(mrecarray) + import cPickle + _ = cPickle.dumps(mbase) + mrec_ = cPickle.loads(_) + + \ No newline at end of file Modified: trunk/numpy/ma/tests/test_mrecords.py =================================================================== --- trunk/numpy/ma/tests/test_mrecords.py 2008-04-13 21:26:04 UTC (rev 5031) +++ trunk/numpy/ma/tests/test_mrecords.py 2008-04-14 16:07:22 UTC (rev 5032) @@ -10,25 +10,19 @@ import types -import numpy as N -from numpy import recarray, bool_, int_, float_ -from numpy import array as narray -from numpy.core.records import fromrecords as recfromrecords -from numpy.core.records import fromarrays as recfromarrays -import numpy.core.fromnumeric as fromnumeric_ -from numpy.testing import NumpyTest, NumpyTestCase -from numpy.testing.utils import build_err_msg +import numpy as np +from numpy import recarray +from numpy.core.records import fromrecords as recfromrecords, \ + fromarrays as recfromarrays import numpy.ma.testutils -from numpy.ma.testutils import assert_equal, assert_equal_records +from numpy.ma.testutils import * -import numpy.ma -from numpy.ma import masked_array, masked, nomask, getdata, getmaskarray +import numpy.ma as ma +from numpy.ma import masked, nomask, getdata, getmaskarray -#import numpy.ma.mrecords -#from numpy.ma.mrecords import mrecarray, fromarrays, fromtextfile, fromrecords - import numpy.ma.mrecords +reload(numpy.ma.mrecords) from numpy.ma.mrecords import MaskedRecords, mrecarray,\ fromarrays, fromtextfile, fromrecords, addfield @@ -44,9 +38,9 @@ ilist = [1,2,3,4,5] flist = [1.1,2.2,3.3,4.4,5.5] slist = ['one','two','three','four','five'] - ddtype = [('a',int_),('b',float_),('c','|S8')] + ddtype = [('a',int),('b',float),('c','|S8')] mask = [0,1,0,0,1] - self.base = masked_array(zip(ilist,flist,slist), mask=mask, dtype=ddtype) + self.base = ma.array(zip(ilist,flist,slist), mask=mask, dtype=ddtype) def test_byview(self): "Test creation by view" @@ -105,19 +99,19 @@ # Change the elements, and the mask will follow mbase.a = 1 assert_equal(mbase['a']._data, [1]*5) - assert_equal(getmaskarray(mbase['a']), [0]*5) + assert_equal(ma.getmaskarray(mbase['a']), [0]*5) assert_equal(mbase._mask, [False]*5) assert_equal(mbase._fieldmask.tolist(), - narray([(0,0,0),(0,1,1),(0,0,0),(0,0,0),(0,1,1)], - dtype=bool_)) + np.array([(0,0,0),(0,1,1),(0,0,0),(0,0,0),(0,1,1)], + dtype=bool)) # Set a field to mask ........................ mbase.c = masked assert_equal(mbase.c.mask, [1]*5) - assert_equal(getmaskarray(mbase['c']), [1]*5) - assert_equal(getdata(mbase['c']), ['N/A']*5) + assert_equal(ma.getmaskarray(mbase['c']), [1]*5) + assert_equal(ma.getdata(mbase['c']), ['N/A']*5) assert_equal(mbase._fieldmask.tolist(), - narray([(0,0,1),(0,1,1),(0,0,1),(0,0,1),(0,1,1)], - dtype=bool_)) + np.array([(0,0,1),(0,1,1),(0,0,1),(0,0,1),(0,1,1)], + dtype=bool)) # Set fields by slices ....................... mbase = base.view(mrecarray).copy() mbase.a[3:] = 5 @@ -132,27 +126,55 @@ mbase = base.view(mrecarray) # Set the mask to True ....................... mbase._mask = masked - assert_equal(getmaskarray(mbase['b']), [1]*5) + assert_equal(ma.getmaskarray(mbase['b']), [1]*5) assert_equal(mbase['a']._mask, mbase['b']._mask) assert_equal(mbase['a']._mask, mbase['c']._mask) assert_equal(mbase._fieldmask.tolist(), - narray([(1,1,1)]*5, - dtype=bool_)) + np.array([(1,1,1)]*5, dtype=bool)) # Delete the mask ............................ mbase._mask = nomask - assert_equal(getmaskarray(mbase['c']), [0]*5) + assert_equal(ma.getmaskarray(mbase['c']), [0]*5) assert_equal(mbase._fieldmask.tolist(), - narray([(0,0,0)]*5, - dtype=bool_)) + np.array([(0,0,0)]*5, dtype=bool)) # + def test_set_mask_fromarray(self): + base = self.base.copy() + mbase = base.view(mrecarray) + # Sets the mask w/ an array + mbase._mask = [1,0,0,0,1] + assert_equal(mbase.a.mask, [1,0,0,0,1]) + assert_equal(mbase.b.mask, [1,0,0,0,1]) + assert_equal(mbase.c.mask, [1,0,0,0,1]) + # Yay, once more ! + mbase.mask = [0,0,0,0,1] + assert_equal(mbase.a.mask, [0,0,0,0,1]) + assert_equal(mbase.b.mask, [0,0,0,0,1]) + assert_equal(mbase.c.mask, [0,0,0,0,1]) + # + def test_set_mask_fromfields(self): + mbase = self.base.copy().view(mrecarray) + # + nmask = np.array([(0,1,0),(0,1,0),(1,0,1),(1,0,1),(0,0,0)], + dtype=[('a',bool),('b',bool),('c',bool)]) + mbase.mask = nmask + assert_equal(mbase.a.mask, [0,0,1,1,0]) + assert_equal(mbase.b.mask, [1,1,0,0,0]) + assert_equal(mbase.c.mask, [0,0,1,1,0]) + # Reinitalizes and redo + mbase.mask = False + mbase.fieldmask = nmask + assert_equal(mbase.a.mask, [0,0,1,1,0]) + assert_equal(mbase.b.mask, [1,1,0,0,0]) + assert_equal(mbase.c.mask, [0,0,1,1,0]) + # def test_set_elements(self): base = self.base.copy() mbase = base.view(mrecarray) # Set an element to mask ..................... mbase[-2] = masked assert_equal(mbase._fieldmask.tolist(), - narray([(0,0,0),(1,1,1),(0,0,0),(1,1,1),(1,1,1)], - dtype=bool_)) + np.array([(0,0,0),(1,1,1),(0,0,0),(1,1,1),(1,1,1)], + dtype=bool)) assert_equal(mbase._mask, [0,1,0,1,1]) # Set slices ................................. mbase = base.view(mrecarray).copy() @@ -214,23 +236,23 @@ # def test_filled(self): "Test filling the array" - _a = masked_array([1,2,3],mask=[0,0,1],dtype=int_) - _b = masked_array([1.1,2.2,3.3],mask=[0,0,1],dtype=float_) - _c = masked_array(['one','two','three'],mask=[0,0,1],dtype='|S8') - ddtype = [('a',int_),('b',float_),('c','|S8')] + _a = ma.array([1,2,3],mask=[0,0,1],dtype=int) + _b = ma.array([1.1,2.2,3.3],mask=[0,0,1],dtype=float) + _c = ma.array(['one','two','three'],mask=[0,0,1],dtype='|S8') + ddtype = [('a',int),('b',float),('c','|S8')] mrec = fromarrays([_a,_b,_c], dtype=ddtype, fill_value=(99999,99999.,'N/A')) mrecfilled = mrec.filled() - assert_equal(mrecfilled['a'], narray((1,2,99999), dtype=int_)) - assert_equal(mrecfilled['b'], narray((1.1,2.2,99999.), dtype=float_)) - assert_equal(mrecfilled['c'], narray(('one','two','N/A'), dtype='|S8')) + assert_equal(mrecfilled['a'], np.array((1,2,99999), dtype=int)) + assert_equal(mrecfilled['b'], np.array((1.1,2.2,99999.), dtype=float)) + assert_equal(mrecfilled['c'], np.array(('one','two','N/A'), dtype='|S8')) # def test_tolist(self): "Test tolist." - _a = masked_array([1,2,3],mask=[0,0,1],dtype=int_) - _b = masked_array([1.1,2.2,3.3],mask=[0,0,1],dtype=float_) - _c = masked_array(['one','two','three'],mask=[1,0,0],dtype='|S8') - ddtype = [('a',int_),('b',float_),('c','|S8')] + _a = ma.array([1,2,3],mask=[0,0,1],dtype=int) + _b = ma.array([1.1,2.2,3.3],mask=[0,0,1],dtype=float) + _c = ma.array(['one','two','three'],mask=[1,0,0],dtype='|S8') + ddtype = [('a',int),('b',float),('c','|S8')] mrec = fromarrays([_a,_b,_c], dtype=ddtype, fill_value=(99999,99999.,'N/A')) # @@ -246,19 +268,19 @@ def setup(self): "Generic setup" - _a = masked_array([1,2,3],mask=[0,0,1],dtype=int_) - _b = masked_array([1.1,2.2,3.3],mask=[0,0,1],dtype=float_) - _c = masked_array(['one','two','three'],mask=[0,0,1],dtype='|S8') - ddtype = [('a',int_),('b',float_),('c','|S8')] + _a = ma.array([1,2,3],mask=[0,0,1],dtype=int) + _b = ma.array([1.1,2.2,3.3],mask=[0,0,1],dtype=float) + _c = ma.array(['one','two','three'],mask=[0,0,1],dtype='|S8') + ddtype = [('a',int),('b',float),('c','|S8')] mrec = fromarrays([_a,_b,_c], dtype=ddtype, fill_value=(99999,99999.,'N/A')) nrec = recfromarrays((_a.data,_b.data,_c.data), dtype=ddtype) self.data = (mrec, nrec, ddtype) def test_fromarrays(self): - _a = masked_array([1,2,3],mask=[0,0,1],dtype=int_) - _b = masked_array([1.1,2.2,3.3],mask=[0,0,1],dtype=float_) - _c = masked_array(['one','two','three'],mask=[0,0,1],dtype='|S8') + _a = ma.array([1,2,3],mask=[0,0,1],dtype=int) + _b = ma.array([1.1,2.2,3.3],mask=[0,0,1],dtype=float) + _c = ma.array(['one','two','three'],mask=[0,0,1],dtype='|S8') (mrec, nrec, _) = self.data for (f,l) in zip(('a','b','c'),(_a,_b,_c)): assert_equal(getattr(mrec,f)._mask, l._mask) @@ -281,7 +303,7 @@ assert_equal(getattr(_mrec, field), getattr(mrec._data, field)) # _mrec = fromrecords(nrec.tolist(), names='c1,c2,c3') - assert_equal(_mrec.dtype, [('c1',int_),('c2',float_),('c3','|S5')]) + assert_equal(_mrec.dtype, [('c1',int),('c2',float),('c3','|S5')]) for (f,n) in zip(('c1','c2','c3'), ('a','b','c')): assert_equal(getattr(_mrec,f), getattr(mrec._data, n)) # @@ -338,7 +360,7 @@ "Tests addfield" (mrec, nrec, ddtype) = self.data (d,m) = ([100,200,300], [1,0,0]) - mrec = addfield(mrec, masked_array(d, mask=m)) + mrec = addfield(mrec, ma.array(d, mask=m)) assert_equal(mrec.f3, d) assert_equal(mrec.f3._mask, m) From numpy-svn at scipy.org Mon Apr 14 16:41:54 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 14 Apr 2008 15:41:54 -0500 (CDT) Subject: [Numpy-svn] r5033 - trunk/numpy/ma Message-ID: <20080414204154.1611139C072@new.scipy.org> Author: oliphant Date: 2008-04-14 15:41:53 -0500 (Mon, 14 Apr 2008) New Revision: 5033 Removed: trunk/numpy/ma/.RData trunk/numpy/ma/.Rhistory Log: Remove R files? Deleted: trunk/numpy/ma/.RData =================================================================== (Binary files differ) Deleted: trunk/numpy/ma/.Rhistory =================================================================== --- trunk/numpy/ma/.Rhistory 2008-04-14 16:07:22 UTC (rev 5032) +++ trunk/numpy/ma/.Rhistory 2008-04-14 20:41:53 UTC (rev 5033) @@ -1,41 +0,0 @@ -winter <- c(NA,NA,4,2,16,26,5,1,5,1,2,3,1) -spring <- c( 4, 3, 5, 3, 2, 7, 3, 1, 1, 2, 3, 5, 3) -cov(winter,spring) -cov(winter,spring,use="complte.obs") -cov(winter,spring,use="complete.obs") -cor(winter,spring,use="complete.obs") -cov2cor(winter,spring,use="complete.obs") -help(cov2cor) -swiss -cor(winter,spring,use="complete.obs") -ccf(winter,spring) -ccf(winter,spring,na.action=pass) -ccf(winter,spring,na.action=na.pass) -ccf(winter,na.action=na.pass) -acf(winter,na.action=na.pass) -cov(winter,spring,use="complete.obs") -cov(winter,use="complete.obs") -cov(winter,winter,use="complete.obs") -winter <- c(NA,NA,4,2,16,26,5,1,5,1,2,3,1) -spring <- c( 4, 3, 5, 3, 2, 7, 3, 1, 1, 2, 3, 5, 3) -summer <- c( 3, 2, 5, 6, 18, 4, 9, 1, 1, NA, 1, 1, NA) -fall <- c(NA, 6, 11, 4, 17,NA, 6, 1, 1, 2, 5, 1, 1] -fall <- c(NA, 6, 11, 4, 17,NA, 6, 1, 1, 2, 5, 1, 1) -cov(winter,summer,use="complete.obs") -cov(winter,fall,use="complete.obs") -anova(winter,spring) -fit<-lm(winter~spring) -anova(fit) -winter -win<-c(0,0,4,2,16,26,5,1,5,1,2,3,1) -spring -fit<-lm(win~spring) -anova(fit) -fit<-lm(spring~win) -anova(fit) -xx -x -x<-c(1,2,3,4,5,6,7,8,9,10) -y<-c(10,9,8,7,6,5,4,4,4,4) -fit<-lm(x~y) -anova(fit) From numpy-svn at scipy.org Mon Apr 14 16:46:56 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 14 Apr 2008 15:46:56 -0500 (CDT) Subject: [Numpy-svn] r5034 - trunk/numpy/core/src Message-ID: <20080414204656.8048B39C041@new.scipy.org> Author: oliphant Date: 2008-04-14 15:46:55 -0500 (Mon, 14 Apr 2008) New Revision: 5034 Modified: trunk/numpy/core/src/arrayobject.c Log: Fix up swap choice for FillWithScalar. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-04-14 20:41:53 UTC (rev 5033) +++ trunk/numpy/core/src/arrayobject.c 2008-04-14 20:46:55 UTC (rev 5034) @@ -5816,7 +5816,7 @@ newarr = PyArray_FromAny(obj, descr, 0,0, ALIGNED, NULL); if (newarr == NULL) return -1; fromptr = PyArray_DATA(newarr); - swap=!PyArray_ISNOTSWAPPED(arr); + swap = (PyArray_ISNOTSWAPPED(arr) != PyArray_ISNOTSWAPPED(newarr)); } size=PyArray_SIZE(arr); copyswap = arr->descr->f->copyswap; From numpy-svn at scipy.org Mon Apr 14 17:47:02 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 14 Apr 2008 16:47:02 -0500 (CDT) Subject: [Numpy-svn] r5035 - trunk/numpy/core/tests Message-ID: <20080414214702.5F7A939C2A3@new.scipy.org> Author: rkern Date: 2008-04-14 16:46:55 -0500 (Mon, 14 Apr 2008) New Revision: 5035 Modified: trunk/numpy/core/tests/test_regression.py Log: Test for r5034. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-14 20:46:55 UTC (rev 5034) +++ trunk/numpy/core/tests/test_regression.py 2008-04-14 21:46:55 UTC (rev 5035) @@ -1000,6 +1000,19 @@ "('bottom', [('bleft', ('>f4', (8, 64)), (1,)), " "('bright', '>f4', (8, 36))])]") + def check_nonnative_endian_fill(self, level=rlevel): + """ Non-native endian arrays were incorrectly filled with scalars before + r5034. + """ + if sys.byteorder == 'little': + dtype = np.dtype('>i4') + else: + dtype = np.dtype(' Author: jarrod.millman Date: 2008-04-15 00:08:04 -0500 (Tue, 15 Apr 2008) New Revision: 5036 Modified: trunk/numpy/version.py Log: bumping version to 1.1.0 to signify the minor API breakage and numerous new features Modified: trunk/numpy/version.py =================================================================== --- trunk/numpy/version.py 2008-04-14 21:46:55 UTC (rev 5035) +++ trunk/numpy/version.py 2008-04-15 05:08:04 UTC (rev 5036) @@ -1,4 +1,4 @@ -version='1.0.5' +version='1.1.0' release=False if not release: From numpy-svn at scipy.org Wed Apr 16 10:28:19 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 16 Apr 2008 09:28:19 -0500 (CDT) Subject: [Numpy-svn] r5037 - in trunk/numpy/lib: . tests Message-ID: <20080416142819.749E239C428@new.scipy.org> Author: dhuard Date: 2008-04-16 09:28:11 -0500 (Wed, 16 Apr 2008) New Revision: 5037 Modified: trunk/numpy/lib/io.py trunk/numpy/lib/tests/test_io.py Log: Added and fixed some tests for loadtxt and savetxt. Cleaned up the docstring of savetxt, added some info on formatting. Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2008-04-15 05:08:04 UTC (rev 5036) +++ trunk/numpy/lib/io.py 2008-04-16 14:28:11 UTC (rev 5037) @@ -323,19 +323,52 @@ Save the data in X to file fname using fmt string to convert the data to strings - fname can be a filename or a file handle. If the filename ends in .gz, - the file is automatically saved in compressed gzip format. The load() - command understands gzipped files transparently. - - Example usage: - - save('test.out', X) # X is an array - save('test1.out', (x,y,z)) # x,y,z equal sized 1D arrays - save('test2.out', x) # x is 1D - save('test3.out', x, fmt='%1.4e') # use exponential notation - - delimiter is used to separate the fields, eg delimiter ',' for - comma-separated values + Parameters + ---------- + fname : filename or a file handle + If the filename ends in .gz, the file is automatically saved in + compressed gzip format. The load() command understands gzipped files + transparently. + X : array or sequence + Data to write to file. + fmt : string + A format string %[flags][width][.precision]specifier. See notes below for + a description of some common flags and specifiers. + delimiter : str + Character separating columns. + + Examples + -------- + >>> savetxt('test.out', x, delimiter=',') # X is an array + >>> savetxt('test.out', (x,y,z)) # x,y,z equal sized 1D arrays + >>> savetxt('test.out', x, fmt='%1.4e') # use exponential notation + + Notes on fmt + ------------ + flags: + - : left justify + + : Forces to preceed result with + or -. + 0 : Left pad the number with zeros instead of space (see width). + width: + Minimum number of characters to be printed. The value is not truncated. + precision: + For integer specifiers (eg. d,i,o,x), the minimum number of digits. + For e, E and f specifiers, the number of digits to print after the decimal + point. + For g and G, the maximum number of significant digits. + For s, the maximum number of characters. + specifiers: + c : character + d or i : signed decimal integer + e or E : scientific notation with e or E. + f : decimal floating point + g,G : use the shorter of e,E or f + o : signed octal + s : string of characters + u : unsigned decimal integer + x,X : unsigned hexadecimal integer + + This is not an exhaustive specification. """ if _string_like(fname): Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2008-04-15 05:08:04 UTC (rev 5036) +++ trunk/numpy/lib/tests/test_io.py 2008-04-16 14:28:11 UTC (rev 5037) @@ -14,25 +14,55 @@ a =np.array( [[1,2],[3,4]], int) c = StringIO.StringIO() - np.savetxt(c, a) + np.savetxt(c, a, fmt='%d') c.seek(0) - assert(c.readlines(), ['1 2\n', '3 4\n']) + assert_equal(c.readlines(), ['1 2\n', '3 4\n']) def test_1D(self): a = np.array([1,2,3,4], int) c = StringIO.StringIO() np.savetxt(c, a, fmt='%d') c.seek(0) - assert(c.readlines(), ['1\n', '2\n', '3\n', '4\n']) + lines = c.readlines() + assert_equal(lines, ['1\n', '2\n', '3\n', '4\n']) def test_record(self): a = np.array([(1, 2), (3, 4)], dtype=[('x', 'i4'), ('y', 'i4')]) c = StringIO.StringIO() np.savetxt(c, a, fmt='%d') c.seek(0) - assert(c.readlines(), ['1 2\n', '3 4\n']) + assert_equal(c.readlines(), ['1 2\n', '3 4\n']) + def test_delimiter(self): + a = np.array([[1., 2.], [3., 4.]]) + c = StringIO.StringIO() + np.savetxt(c, a, delimiter=',', fmt='%d') + c.seek(0) + assert_equal(c.readlines(), ['1,2\n', '3,4\n']) + + +## def test_format(self): +## a = np.array([(1, 2), (3, 4)]) +## c = StringIO.StringIO() +## # Sequence of formats +## np.savetxt(c, a, fmt=['%02d', '%3.1f']) +## c.seek(0) +## assert_equal(c.readlines(), ['01 2.0\n', '03 4.0\n']) +## +## # A single multiformat string +## c = StringIO.StringIO() +## np.savetxt(c, a, fmt='%02d : %3.1f') +## c.seek(0) +## lines = c.readlines() +## assert_equal(lines, ['01 : 2.0\n', '03 : 4.0\n']) +## +## # Specify delimiter, should be overiden +## c = StringIO.StringIO() +## np.savetxt(c, a, fmt='%02d : %3.1f', delimiter=',') +## c.seek(0) +## lines = c.readlines() +## assert_equal(lines, ['01 : 2.0\n', '03 : 4.0\n']) + - class TestLoadTxt(NumpyTestCase): def test_record(self): c = StringIO.StringIO() @@ -45,7 +75,6 @@ d = StringIO.StringIO() d.write('M 64.0 75.0\nF 25.0 60.0') d.seek(0) - mydescriptor = {'names': ('gender','age','weight'), 'formats': ('S1', 'i4', 'f4')} @@ -54,6 +83,7 @@ y = np.loadtxt(d, dtype=mydescriptor) assert_array_equal(y, b) + def test_array(self): c = StringIO.StringIO() c.write('1 2\n3 4') @@ -92,6 +122,48 @@ converters={3:lambda s: int(s or -999)}) a = np.array([1,2,3,-999,5], int) assert_array_equal(x, a) + + def test_comments(self): + c = StringIO.StringIO() + c.write('# comment\n1,2,3,5\n') + c.seek(0) + x = np.loadtxt(c, dtype=int, delimiter=',', \ + comments='#') + a = np.array([1,2,3,5], int) + assert_array_equal(x, a) + + def test_skiprows(self): + c = StringIO.StringIO() + c.write('comment\n1,2,3,5\n') + c.seek(0) + x = np.loadtxt(c, dtype=int, delimiter=',', \ + skiprows=1) + a = np.array([1,2,3,5], int) + assert_array_equal(x, a) + + c = StringIO.StringIO() + c.write('# comment\n1,2,3,5\n') + c.seek(0) + x = np.loadtxt(c, dtype=int, delimiter=',', \ + skiprows=1) + a = np.array([1,2,3,5], int) + assert_array_equal(x, a) + + def test_usecols(self): + a =np.array( [[1,2],[3,4]], float) + c = StringIO.StringIO() + np.savetxt(c, a) + c.seek(0) + x = np.loadtxt(c, dtype=float, usecols=(1,)) + assert_array_equal(x, a[:,1]) + + a =np.array( [[1,2,3],[3,4,5]], float) + c = StringIO.StringIO() + np.savetxt(c, a) + c.seek(0) + x = np.loadtxt(c, dtype=float, usecols=(1,2)) + assert_array_equal(x, a[:,1:]) + class Testfromregex(NumpyTestCase): def test_record(self): From numpy-svn at scipy.org Wed Apr 16 11:21:41 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 16 Apr 2008 10:21:41 -0500 (CDT) Subject: [Numpy-svn] r5038 - trunk Message-ID: <20080416152141.4FFD139C1D6@new.scipy.org> Author: stefan Date: 2008-04-16 10:21:22 -0500 (Wed, 16 Apr 2008) New Revision: 5038 Modified: trunk/README.txt Log: Include "sudo" as part of system-wide installation instructions. Modified: trunk/README.txt =================================================================== --- trunk/README.txt 2008-04-16 14:28:11 UTC (rev 5037) +++ trunk/README.txt 2008-04-16 15:21:22 UTC (rev 5038) @@ -1,20 +1,19 @@ +NumPy is a replacement of Numeric Python that adds the features of numarray. +To install system-wide: -NumPy is a replacement of Numeric Python that adds the features of numarray. -To install: +sudo python setup.py install -python setup.py install - The setup.py script will take advantage of fast BLAS on your system if it can -find it. You can help the process with a site.cfg file. +find it. You can guide the process using a site.cfg file. -If fast BLAS and LAPACK cannot be found, then a slower default version is used. +If fast BLAS and LAPACK cannot be found, then a slower default version is used. -After installation, tests can be run with +After installation, tests can be run (from outside the source +directory) with python -c 'import numpy; numpy.test()' -The most current development version is always available from a -subversion repostiory: +The most current development version is always available from our +subversion repository: -http://svn.scipy.org/svn/numpy/trunk - +http://svn.scipy.org/svn/numpy/trunk From numpy-svn at scipy.org Wed Apr 16 17:04:24 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 16 Apr 2008 16:04:24 -0500 (CDT) Subject: [Numpy-svn] r5039 - trunk/numpy/distutils Message-ID: <20080416210424.D526A39C250@new.scipy.org> Author: stefan Date: 2008-04-16 16:03:41 -0500 (Wed, 16 Apr 2008) New Revision: 5039 Modified: trunk/numpy/distutils/log.py trunk/numpy/distutils/misc_util.py Log: Use the default terminal colour to print out INFO messages in distutils. This prevents visibility problems on backgrounds other than black. Modified: trunk/numpy/distutils/log.py =================================================================== --- trunk/numpy/distutils/log.py 2008-04-16 15:21:22 UTC (rev 5038) +++ trunk/numpy/distutils/log.py 2008-04-16 21:03:41 UTC (rev 5039) @@ -4,7 +4,7 @@ from distutils.log import * from distutils.log import Log as old_Log from distutils.log import _global_log -from misc_util import red_text, yellow_text, cyan_text, green_text, is_sequence, is_string +from misc_util import red_text, default_text, cyan_text, green_text, is_sequence, is_string def _fix_args(args,flag=1): @@ -67,7 +67,7 @@ _global_color_map = { DEBUG:cyan_text, - INFO:yellow_text, + INFO:default_text, WARN:red_text, ERROR:red_text, FATAL:red_text Modified: trunk/numpy/distutils/misc_util.py =================================================================== --- trunk/numpy/distutils/misc_util.py 2008-04-16 15:21:22 UTC (rev 5038) +++ trunk/numpy/distutils/misc_util.py 2008-04-16 21:03:41 UTC (rev 5039) @@ -258,7 +258,7 @@ if terminal_has_colors(): _colour_codes = dict(black=0, red=1, green=2, yellow=3, - blue=4, magenta=5, cyan=6, white=7) + blue=4, magenta=5, cyan=6, white=7, default=9) def colour_text(s, fg=None, bg=None, bold=False): seq = [] if bold: @@ -277,6 +277,8 @@ def colour_text(s, fg=None, bg=None): return s +def default_text(s): + return colour_text(s, 'default') def red_text(s): return colour_text(s, 'red') def green_text(s): From numpy-svn at scipy.org Thu Apr 17 16:16:11 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 17 Apr 2008 15:16:11 -0500 (CDT) Subject: [Numpy-svn] r5040 - in trunk/numpy/lib: . tests Message-ID: <20080417201611.DEA5239C2F3@new.scipy.org> Author: rkern Date: 2008-04-17 15:16:11 -0500 (Thu, 17 Apr 2008) New Revision: 5040 Modified: trunk/numpy/lib/_datasource.py trunk/numpy/lib/io.py trunk/numpy/lib/tests/test__datasource.py Log: Don't require gzip or bz2 until the actual functionality is requested. Modified: trunk/numpy/lib/_datasource.py =================================================================== --- trunk/numpy/lib/_datasource.py 2008-04-16 21:03:41 UTC (rev 5039) +++ trunk/numpy/lib/_datasource.py 2008-04-17 20:16:11 UTC (rev 5040) @@ -34,17 +34,24 @@ __docformat__ = "restructuredtext en" -import bz2 -import gzip import os import tempfile from shutil import rmtree from urllib2 import urlopen, URLError from urlparse import urlparse - # TODO: .zip support, .tar support? -_file_openers = {".gz":gzip.open, ".bz2":bz2.BZ2File, None:file} +_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 def open(path, mode='r', destpath=os.curdir): Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2008-04-16 21:03:41 UTC (rev 5039) +++ trunk/numpy/lib/io.py 2008-04-17 20:16:11 UTC (rev 5040) @@ -8,7 +8,6 @@ import numpy as np import format -import zipfile import cStringIO import tempfile import os @@ -42,6 +41,9 @@ with .files and the ZipFile object itself using .zip """ def __init__(self, fid): + # Import is postponed to here since zipfile depends on gzip, an optional + # component of the so-called standard library. + import zipfile _zip = zipfile.ZipFile(fid) self._files = _zip.namelist() self.files = [] @@ -165,6 +167,10 @@ arr_0, arr_1, etc. """ + # Import is postponed to here since zipfile depends on gzip, an optional + # component of the so-called standard library. + import zipfile + if isinstance(file, str): if not file.endswith('.npz'): file = file + '.npz' Modified: trunk/numpy/lib/tests/test__datasource.py =================================================================== --- trunk/numpy/lib/tests/test__datasource.py 2008-04-16 21:03:41 UTC (rev 5039) +++ trunk/numpy/lib/tests/test__datasource.py 2008-04-17 20:16:11 UTC (rev 5040) @@ -1,6 +1,4 @@ -import bz2 -import gzip import os import sys import struct @@ -90,6 +88,13 @@ self.assertRaises(IOError, self.ds.open, invalid_file) def test_ValidGzipFile(self): + try: + import gzip + except ImportError: + # We don't have the bz2 capabilities to test. + # FIXME: when we start using nose, raise a SkipTest rather than + # passing the test. + return # Test datasource's internal file_opener for Gzip files. filepath = os.path.join(self.tmpdir, 'foobar.txt.gz') fp = gzip.open(filepath, 'w') @@ -101,6 +106,13 @@ self.assertEqual(magic_line, result) def test_ValidBz2File(self): + try: + import bz2 + except ImportError: + # We don't have the bz2 capabilities to test. + # FIXME: when we start using nose, raise a SkipTest rather than + # passing the test. + return # Test datasource's internal file_opener for BZip2 files. filepath = os.path.join(self.tmpdir, 'foobar.txt.bz2') fp = bz2.BZ2File(filepath, 'w') From numpy-svn at scipy.org Thu Apr 17 16:23:31 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 17 Apr 2008 15:23:31 -0500 (CDT) Subject: [Numpy-svn] r5041 - trunk/numpy/core/tests Message-ID: <20080417202331.3F4BB39C24C@new.scipy.org> Author: rkern Date: 2008-04-17 15:23:30 -0500 (Thu, 17 Apr 2008) New Revision: 5041 Modified: trunk/numpy/core/tests/test_multiarray.py Log: De-obfuscate some test code. Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2008-04-17 20:16:11 UTC (rev 5040) +++ trunk/numpy/core/tests/test_multiarray.py 2008-04-17 20:23:30 UTC (rev 5041) @@ -219,31 +219,31 @@ class TestScalarIndexing(NumpyTestCase): def setUp(self): - self.d = array([0,1])[0], + self.d = array([0,1])[0] def check_ellipsis_subscript(self): - a, = self.d + a = self.d self.failUnlessEqual(a[...], 0) self.failUnlessEqual(a[...].shape,()) def check_empty_subscript(self): - a, = self.d + a = self.d self.failUnlessEqual(a[()], 0) self.failUnlessEqual(a[()].shape,()) def check_invalid_subscript(self): - a, = self.d + a = self.d self.failUnlessRaises(IndexError, lambda x: x[0], a) self.failUnlessRaises(IndexError, lambda x: x[array([], int)], a) def check_invalid_subscript_assignment(self): - a, = self.d + a = self.d def assign(x, i, v): x[i] = v self.failUnlessRaises(TypeError, assign, a, 0, 42) def check_newaxis(self): - a, = self.d + a = self.d self.failUnlessEqual(a[newaxis].shape, (1,)) self.failUnlessEqual(a[..., newaxis].shape, (1,)) self.failUnlessEqual(a[newaxis, ...].shape, (1,)) @@ -254,7 +254,7 @@ self.failUnlessEqual(a[(newaxis,)*10].shape, (1,)*10) def check_invalid_newaxis(self): - a, = self.d + a = self.d def subscript(x, i): x[i] self.failUnlessRaises(IndexError, subscript, a, (newaxis, 0)) self.failUnlessRaises(IndexError, subscript, a, (newaxis,)*50) From numpy-svn at scipy.org Thu Apr 17 16:51:03 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 17 Apr 2008 15:51:03 -0500 (CDT) Subject: [Numpy-svn] r5042 - in trunk/numpy/testing: . tests Message-ID: <20080417205103.B2BA739C1E4@new.scipy.org> Author: rkern Date: 2008-04-17 15:51:03 -0500 (Thu, 17 Apr 2008) New Revision: 5042 Modified: trunk/numpy/testing/tests/test_utils.py trunk/numpy/testing/utils.py Log: Correct dependency on missing code. Modified: trunk/numpy/testing/tests/test_utils.py =================================================================== --- trunk/numpy/testing/tests/test_utils.py 2008-04-17 20:23:30 UTC (rev 5041) +++ trunk/numpy/testing/tests/test_utils.py 2008-04-17 20:51:03 UTC (rev 5042) @@ -1,10 +1,10 @@ import numpy as N from numpy.testing.utils import * -class _GenericTest: - def __init__(self, assert_func): - self._assert_func = assert_func +import unittest + +class _GenericTest(object): def _test_equal(self, a, b): self._assert_func(a, b) @@ -47,9 +47,9 @@ self._test_not_equal(a, b) -class TestEqual(_GenericTest): - def __init__(self): - _GenericTest.__init__(self, assert_array_equal) +class TestEqual(_GenericTest, unittest.TestCase): + def setUp(self): + self._assert_func = assert_array_equal def test_generic_rank1(self): """Test rank 1 array for all dtypes.""" @@ -126,6 +126,42 @@ self._test_not_equal(c, b) -class TestAlmostEqual(_GenericTest): - def __init__(self): - _GenericTest.__init__(self, assert_array_almost_equal) +class TestAlmostEqual(_GenericTest, unittest.TestCase): + def setUp(self): + self._assert_func = assert_array_almost_equal + + +class TestRaises(unittest.TestCase): + def setUp(self): + class MyException(Exception): + pass + + self.e = MyException + + def raises_exception(self, e): + raise e + + def does_not_raise_exception(self): + pass + + def test_correct_catch(self): + f = raises(self.e)(self.raises_exception)(self.e) + + def test_wrong_exception(self): + try: + f = raises(self.e)(self.raises_exception)(RuntimeError) + except RuntimeError: + return + else: + raise AssertionError("should have caught RuntimeError") + + def test_catch_no_raise(self): + try: + f = raises(self.e)(self.does_not_raise_exception)() + except AssertionError: + return + else: + raise AssertionError("should have raised an AssertionError") + +if __name__ == '__main__': + unittest.main() Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2008-04-17 20:23:30 UTC (rev 5041) +++ trunk/numpy/testing/utils.py 2008-04-17 20:51:03 UTC (rev 5042) @@ -294,36 +294,33 @@ msg = 'Differences in strings:\n%s' % (''.join(diff_list)).rstrip() assert actual==desired, msg -# Ripped from nose.tools -def raises(*exceptions): - """Test must raise one of expected exceptions to pass. - Example use:: - - @raises(TypeError, ValueError) - def test_raises_type_error(): - raise TypeError("This test passes") - - @raises(Exception): - def test_that_fails_by_passing(): - pass - - If you want to test many assertions about exceptions in a single test, - you may want to use `assert_raises` instead. +def raises(*exceptions): + """ Assert that a test function raises one of the specified exceptions to + pass. """ - valid = ' or '.join([e.__name__ for e in exceptions]) - def decorate(func): - name = func.__name__ - def newfunc(*arg, **kw): + # FIXME: when we transition to nose, just use its implementation. It's + # better. + def deco(function): + def f2(*args, **kwds): try: - func(*arg, **kw) + function(*args, **kwds) except exceptions: pass except: + # Anything else. raise else: - message = "%s() did not raise %s" % (name, valid) - raise AssertionError(message) - newfunc = make_decorator(func)(newfunc) - return newfunc - return decorate + raise AssertionError('%s() did not raise one of (%s)' % + (function.__name__, ', '.join([e.__name__ for e in exceptions]))) + try: + f2.__name__ = function.__name__ + except TypeError: + # Python 2.3 does not permit this. + pass + f2.__dict__ = function.__dict__ + f2.__doc__ = function.__doc__ + f2.__module__ = function.__module__ + return f2 + + return deco From numpy-svn at scipy.org Fri Apr 18 02:42:51 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 18 Apr 2008 01:42:51 -0500 (CDT) Subject: [Numpy-svn] r5043 - trunk/numpy/core Message-ID: <20080418064251.A715539C09B@new.scipy.org> Author: cookedm Date: 2008-04-18 01:42:49 -0500 (Fri, 18 Apr 2008) New Revision: 5043 Modified: trunk/numpy/core/numerictypes.py Log: Add comments to numerictypes.py about what the 'kind' field of dtypes can be (Also see the DtypesKind page on the numpy wiki) Modified: trunk/numpy/core/numerictypes.py =================================================================== --- trunk/numpy/core/numerictypes.py 2008-04-17 20:51:03 UTC (rev 5042) +++ trunk/numpy/core/numerictypes.py 2008-04-18 06:42:49 UTC (rev 5043) @@ -38,8 +38,8 @@ As part of the type-hierarchy: xx -- is bit-width generic - +-> bool_ - +-> number + +-> bool_ (kind=b) + +-> number (kind=i) | integer | signedinteger (intxx) | byte @@ -48,7 +48,7 @@ | intp int0 | int_ | longlong - +-> unsignedinteger (uintxx) + +-> unsignedinteger (uintxx) (kind=u) | ubyte | ushort | uintc @@ -56,23 +56,21 @@ | uint_ | ulonglong +-> inexact - | +-> floating (floatxx) + | +-> floating (floatxx) (kind=f) | | single | | float_ (double) | | longfloat - | \-> complexfloating (complexxx) + | \-> complexfloating (complexxx) (kind=c) | csingle (singlecomplex) | complex_ (cfloat, cdouble) | clongfloat (longcomplex) +-> flexible | character - | str_ (string_) - | unicode_ - | void + | str_ (string_) (kind=S) + | unicode_ (kind=U) + | void (kind=V) | - \-> object_ (not used much) - -$Id: numerictypes.py,v 1.17 2005/09/09 22:20:06 teoliphant Exp $ + \-> object_ (not used much) (kind=O) """ # we add more at the bottom @@ -579,6 +577,15 @@ typeDict = sctypeDict typeNA = sctypeNA +# b -> boolean +# u -> unsigned integer +# i -> signed integer +# f -> floating point +# c -> complex +# S -> string +# U -> Unicode string +# V -> record +# O -> Python object _kind_list = ['b', 'u', 'i', 'f', 'c', 'S', 'U', 'V', 'O'] __test_types = typecodes['AllInteger'][:-2]+typecodes['AllFloat']+'O' From numpy-svn at scipy.org Fri Apr 18 08:44:16 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 18 Apr 2008 07:44:16 -0500 (CDT) Subject: [Numpy-svn] r5044 - in trunk/numpy/core: include/numpy src tests Message-ID: <20080418124416.2771839C01A@new.scipy.org> Author: stefan Date: 2008-04-18 07:43:33 -0500 (Fri, 18 Apr 2008) New Revision: 5044 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/src/arraytypes.inc.src trunk/numpy/core/src/multiarraymodule.c trunk/numpy/core/tests/test_multiarray.py Log: Fast implementation of take [patch by Eric Firing]. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-18 06:42:49 UTC (rev 5043) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-18 12:43:33 UTC (rev 5044) @@ -1052,6 +1052,10 @@ void *max, void *out); typedef void (PyArray_FastPutmaskFunc)(void *in, void *mask, npy_intp n_in, void *values, npy_intp nv); +typedef int (PyArray_FastTakeFunc)(void *dest, void *src, npy_intp *indarray, + npy_intp nindarray, npy_intp n_outer, + npy_intp m_middle, npy_intp nelem, + NPY_CLIPMODE clipmode); typedef struct { npy_intp *ptr; @@ -1130,6 +1134,7 @@ PyArray_FastClipFunc *fastclip; PyArray_FastPutmaskFunc *fastputmask; + PyArray_FastTakeFunc *fasttake; } PyArray_ArrFuncs; #define NPY_ITEM_REFCOUNT 0x01 /* The item must be reference counted @@ -1752,7 +1757,7 @@ /* FIXME: This should check for a flag on the data-type that states whether or not it is variable length. Because the ISFLEXIBLE check is hard-coded to the - built-in data-types. + built-in data-types. */ #define PyArray_ISVARIABLE(obj) PyTypeNum_ISFLEXIBLE(PyArray_TYPE(obj)) Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2008-04-18 06:42:49 UTC (rev 5043) +++ trunk/numpy/core/src/arraytypes.inc.src 2008-04-18 12:43:33 UTC (rev 5044) @@ -2179,6 +2179,89 @@ #define OBJECT_fastputmask NULL + +/************************ + * Fast take functions + *************************/ + +/**begin repeat +#name=BOOL,BYTE, UBYTE, SHORT, USHORT, INT, UINT, LONG, ULONG, LONGLONG, ULONGLONG, FLOAT, DOUBLE, LONGDOUBLE,CFLOAT, CDOUBLE, CLONGDOUBLE# +#type= Bool, byte, ubyte, short, ushort, int, uint, long, ulong, longlong, ulonglong, float, double, longdouble,cfloat, cdouble, clongdouble# +*/ +static int + at name@_fasttake(@type@ *dest, @type@ *src, intp *indarray, + intp nindarray, intp n_outer, + intp m_middle, intp nelem, + NPY_CLIPMODE clipmode) +{ + intp i, j, k, tmp; + + switch(clipmode) { + case NPY_RAISE: + for(i=0; i= nindarray)) { + PyErr_SetString(PyExc_IndexError, + "index out of range "\ + "for array"); + return 1; + } + if (nelem == 1) *dest++ = *(src+tmp); + else { + for(k=0; k= nindarray) + while (tmp >= nindarray) + tmp -= nindarray; + if (nelem == 1) *dest++ = *(src+tmp); + else { + for(k=0; k= nindarray) + tmp = nindarray-1; + if (nelem == 1) *dest++ = *(src+tmp); + else { + for(k=0; kdata; if (maxa != NULL) max_data = maxa->data; - + func(newin->data, PyArray_SIZE(newin), min_data, max_data, newout->data); @@ -3107,10 +3107,10 @@ NPY_BEGIN_THREADS_DEF dtype = PyArray_DescrFromObject((PyObject *)op2, op1->descr); - + /* need ap1 as contiguous array and of right type */ Py_INCREF(dtype); - ap1 = (PyArrayObject *)PyArray_FromAny((PyObject *)op1, dtype, + ap1 = (PyArrayObject *)PyArray_FromAny((PyObject *)op1, dtype, 1, 1, NPY_DEFAULT, NULL); if (ap1 == NULL) { @@ -3746,10 +3746,10 @@ op = ap; } - /* Will get native-byte order contiguous copy. + /* Will get native-byte order contiguous copy. */ ap = (PyArrayObject *)\ - PyArray_ContiguousFromAny((PyObject *)op, + PyArray_ContiguousFromAny((PyObject *)op, op->descr->type_num, 1, 0); Py_DECREF(op); @@ -3824,11 +3824,13 @@ PyArray_TakeFrom(PyArrayObject *self0, PyObject *indices0, int axis, PyArrayObject *ret, NPY_CLIPMODE clipmode) { + PyArray_FastTakeFunc *func; PyArrayObject *self, *indices; - intp nd, i, j, n, m, max_item, tmp, chunk; + intp nd, i, j, n, m, max_item, tmp, chunk, nelem; intp shape[MAX_DIMS]; char *src, *dest; int copyret=0; + int err; indices = NULL; self = (PyAO *)_check_axis(self0, &axis, CARRAY); @@ -3892,10 +3894,14 @@ } max_item = self->dimensions[axis]; + nelem = chunk; chunk = chunk * ret->descr->elsize; src = self->data; dest = ret->data; + func = self->descr->f->fasttake; + if (func == NULL) { + switch(clipmode) { case NPY_RAISE: for(i=0; idata), + max_item, n, m, nelem, clipmode); + if (err) goto fail; + } PyArray_INCREF(ret); @@ -5666,8 +5678,8 @@ Py_XDECREF(type); return NULL; } - + /* fast exit if simple call */ if ((subok && PyArray_Check(op)) || (!subok && PyArray_CheckExact(op))) { @@ -5787,7 +5799,7 @@ return NULL; } -/* This function is needed for supporting Pickles of +/* This function is needed for supporting Pickles of numpy scalar objects. */ static PyObject * @@ -6363,7 +6375,7 @@ */ if ((tmp == NULL) || (nread == 0)) { Py_DECREF(ret); - return PyErr_NoMemory(); + return PyErr_NoMemory(); } ret->data = tmp; PyArray_DIM(ret,0) = nread; @@ -6433,7 +6445,7 @@ if ((elsize=dtype->elsize) == 0) { PyErr_SetString(PyExc_ValueError, "Must specify length "\ "when using variable-size data-type."); - goto done; + goto done; } /* We would need to alter the memory RENEW code to decrement any @@ -7126,7 +7138,7 @@ retobj = (ret ? Py_True : Py_False); Py_INCREF(retobj); - finish: + finish: Py_XDECREF(d1); Py_XDECREF(d2); return retobj; Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2008-04-18 06:42:49 UTC (rev 5043) +++ trunk/numpy/core/tests/test_multiarray.py 2008-04-18 12:43:33 UTC (rev 5044) @@ -699,6 +699,56 @@ ## np.putmask(z,[True,True,True],3) pass +class TestTake(ParametricTestCase): + def tst_basic(self,x): + ind = range(x.shape[0]) + assert_array_equal(x.take(ind, axis=0), x) + + def testip_types(self): + unchecked_types = [str, unicode, np.void, object] + + x = np.random.random(24)*100 + x.shape = 2,3,4 + tests = [] + for types in np.sctypes.itervalues(): + tests.extend([(self.tst_basic,x.copy().astype(T)) + for T in types if T not in unchecked_types]) + return tests + + def test_raise(self): + x = np.random.random(24)*100 + x.shape = 2,3,4 + self.failUnlessRaises(IndexError, x.take, [0,1,2], axis=0) + self.failUnlessRaises(IndexError, x.take, [-3], axis=0) + assert_array_equal(x.take([-1], axis=0)[0], x[1]) + + def test_clip(self): + x = np.random.random(24)*100 + x.shape = 2,3,4 + assert_array_equal(x.take([-1], axis=0, mode='clip')[0], x[0]) + assert_array_equal(x.take([2], axis=0, mode='clip')[0], x[1]) + + def test_wrap(self): + x = np.random.random(24)*100 + x.shape = 2,3,4 + assert_array_equal(x.take([-1], axis=0, mode='wrap')[0], x[1]) + assert_array_equal(x.take([2], axis=0, mode='wrap')[0], x[0]) + assert_array_equal(x.take([3], axis=0, mode='wrap')[0], x[1]) + + def tst_byteorder(self,dtype): + x = np.array([1,2,3],dtype) + assert_array_equal(x.take([0,2,1]),[1,3,2]) + + def testip_byteorder(self): + return [(self.tst_byteorder,dtype) for dtype in ('>i4','f8'), ('z', ' Author: charris Date: 2008-04-18 11:16:05 -0500 (Fri, 18 Apr 2008) New Revision: 5045 Modified: trunk/numpy/core/src/arrayobject.c Log: Cleanup white space, fix a spelling, align some comments. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-04-18 12:43:33 UTC (rev 5044) +++ trunk/numpy/core/src/arrayobject.c 2008-04-18 16:16:05 UTC (rev 5045) @@ -876,7 +876,7 @@ dptr = PyArray_BYTES(dst); elsize = PyArray_ITEMSIZE(dst); nbytes = elsize * PyArray_DIM(src, axis); - + /* Refcount note: src and dst have the same size */ PyArray_INCREF((PyArrayObject *)src); PyArray_XDECREF((PyArrayObject *)dst); @@ -1004,7 +1004,7 @@ PyArray_INCREF(dest); PyArray_XDECREF(src); - + Py_DECREF(multi); return 0; } @@ -1558,7 +1558,7 @@ PyArray_CopySwapFunc *copyswap; char *dstptr = dst; char *srcptr = src; - + copyswap = PyArray_DESCR(arr)->f->copyswap; for (i=0; i= 0x02050000 - (unaryfunc)array_index, /* nb_index */ + (unaryfunc)array_index, /* nb_index */ #endif }; @@ -4131,27 +4131,27 @@ static PySequenceMethods array_as_sequence = { #if PY_VERSION_HEX >= 0x02050000 - (lenfunc)array_length, /*sq_length*/ - (binaryfunc)NULL, /* sq_concat is handled by nb_add*/ + (lenfunc)array_length, /*sq_length*/ + (binaryfunc)NULL, /*sq_concat is handled by nb_add*/ (ssizeargfunc)NULL, (ssizeargfunc)array_item_nice, (ssizessizeargfunc)array_slice, - (ssizeobjargproc)array_ass_item, /*sq_ass_item*/ + (ssizeobjargproc)array_ass_item, /*sq_ass_item*/ (ssizessizeobjargproc)array_ass_slice, /*sq_ass_slice*/ - (objobjproc) array_contains, /* sq_contains */ - (binaryfunc) NULL, /* sg_inplace_concat */ + (objobjproc) array_contains, /*sq_contains */ + (binaryfunc) NULL, /*sg_inplace_concat */ (ssizeargfunc)NULL, #else - (inquiry)array_length, /*sq_length*/ - (binaryfunc)NULL, /* sq_concat is handled by nb_add*/ - (intargfunc)NULL, /* sq_repeat is handled nb_multiply*/ + (inquiry)array_length, /*sq_length*/ + (binaryfunc)NULL, /*sq_concat is handled by nb_add*/ + (intargfunc)NULL, /*sq_repeat is handled nb_multiply*/ (intargfunc)array_item_nice, /*sq_item*/ (intintargfunc)array_slice, /*sq_slice*/ - (intobjargproc)array_ass_item, /*sq_ass_item*/ + (intobjargproc)array_ass_item, /*sq_ass_item*/ (intintobjargproc)array_ass_slice, /*sq_ass_slice*/ - (objobjproc) array_contains, /* sq_contains */ - (binaryfunc) NULL, /* sg_inplace_concat */ - (intargfunc) NULL /* sg_inplace_repeat */ + (objobjproc) array_contains, /*sq_contains */ + (binaryfunc) NULL, /*sg_inplace_concat */ + (intargfunc) NULL /*sg_inplace_repeat */ #endif }; @@ -6807,63 +6807,63 @@ static PyTypeObject PyArray_Type = { PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "numpy.ndarray", /*tp_name*/ - sizeof(PyArrayObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ + 0, /*ob_size*/ + "numpy.ndarray", /*tp_name*/ + sizeof(PyArrayObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ /* methods */ - (destructor)array_dealloc, /*tp_dealloc */ - (printfunc)NULL, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - (cmpfunc)0, /*tp_compare*/ - (reprfunc)array_repr, /*tp_repr*/ - &array_as_number, /*tp_as_number*/ - &array_as_sequence, /*tp_as_sequence*/ - &array_as_mapping, /*tp_as_mapping*/ - (hashfunc)0, /*tp_hash*/ - (ternaryfunc)0, /*tp_call*/ - (reprfunc)array_str, /*tp_str*/ + (destructor)array_dealloc, /*tp_dealloc */ + (printfunc)NULL, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + (cmpfunc)0, /*tp_compare*/ + (reprfunc)array_repr, /*tp_repr*/ + &array_as_number, /*tp_as_number*/ + &array_as_sequence, /*tp_as_sequence*/ + &array_as_mapping, /*tp_as_mapping*/ + (hashfunc)0, /*tp_hash*/ + (ternaryfunc)0, /*tp_call*/ + (reprfunc)array_str, /*tp_str*/ - (getattrofunc)0, /*tp_getattro*/ - (setattrofunc)0, /*tp_setattro*/ - &array_as_buffer, /*tp_as_buffer*/ + (getattrofunc)0, /*tp_getattro*/ + (setattrofunc)0, /*tp_setattro*/ + &array_as_buffer, /*tp_as_buffer*/ (Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE - | Py_TPFLAGS_CHECKTYPES), /*tp_flags*/ + | Py_TPFLAGS_CHECKTYPES), /*tp_flags*/ /*Documentation string */ - 0, /*tp_doc*/ + 0, /*tp_doc*/ - (traverseproc)0, /*tp_traverse */ - (inquiry)0, /*tp_clear */ - (richcmpfunc)array_richcompare, /*tp_richcompare */ - offsetof(PyArrayObject, weakreflist), /*tp_weaklistoffset */ + (traverseproc)0, /*tp_traverse */ + (inquiry)0, /*tp_clear */ + (richcmpfunc)array_richcompare, /*tp_richcompare */ + offsetof(PyArrayObject, weakreflist), /*tp_weaklistoffset */ /* Iterator support (use standard) */ - (getiterfunc)array_iter, /* tp_iter */ - (iternextfunc)0, /* tp_iternext */ + (getiterfunc)array_iter, /* tp_iter */ + (iternextfunc)0, /* tp_iternext */ /* Sub-classing (new-style object) support */ - array_methods, /* tp_methods */ - 0, /* tp_members */ - array_getsetlist, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)0, /* tp_init */ - array_alloc, /* tp_alloc */ - (newfunc)array_new, /* tp_new */ - 0, /* tp_free */ - 0, /* tp_is_gc */ - 0, /* tp_bases */ - 0, /* tp_mro */ - 0, /* tp_cache */ - 0, /* tp_subclasses */ - 0 /* tp_weaklist */ + array_methods, /* tp_methods */ + 0, /* tp_members */ + array_getsetlist, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)0, /* tp_init */ + array_alloc, /* tp_alloc */ + (newfunc)array_new, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0 /* tp_weaklist */ }; /* The rest of this code is to build the right kind of array from a python */ @@ -11040,7 +11040,7 @@ PyObject *new_names; if (self->names == NULL) { PyErr_SetString(PyExc_ValueError, "there are no fields defined"); - return -1; + return -1; } N = PyTuple_GET_SIZE(self->names); @@ -11057,14 +11057,14 @@ valid = PyString_Check(item); Py_DECREF(item); if (!valid) { - PyErr_Format(PyExc_ValueError, - "item #%d of names is of type %s and not string", + PyErr_Format(PyExc_ValueError, + "item #%d of names is of type %s and not string", i, item->ob_type->tp_name); return -1; } } /* Update dictionary keys in fields */ - new_names = PySequence_Tuple(val); + new_names = PySequence_Tuple(val); for (i=0; ifields, key); new_key = PyTuple_GET_ITEM(new_names, i); PyDict_SetItem(self->fields, new_key, item); - PyDict_DelItem(self->fields, key); + PyDict_DelItem(self->fields, key); } /* Replace names */ Py_DECREF(self->names); self->names = new_names; - + return 0; } From numpy-svn at scipy.org Fri Apr 18 15:59:46 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 18 Apr 2008 14:59:46 -0500 (CDT) Subject: [Numpy-svn] r5046 - trunk/numpy/f2py Message-ID: <20080418195946.4348939C01F@new.scipy.org> Author: pearu Date: 2008-04-18 14:59:42 -0500 (Fri, 18 Apr 2008) New Revision: 5046 Modified: trunk/numpy/f2py/crackfortran.py Log: Fix bug in parsing initexpr in 'INTEGER, PARAMETER :: ny = nx + 2' Modified: trunk/numpy/f2py/crackfortran.py =================================================================== --- trunk/numpy/f2py/crackfortran.py 2008-04-18 16:16:05 UTC (rev 5045) +++ trunk/numpy/f2py/crackfortran.py 2008-04-18 19:59:42 UTC (rev 5046) @@ -1202,7 +1202,7 @@ expr2=expr[0] for i in range(1,len(expr)-1): if expr[i]==' ' and \ - ((expr[i+1] in "()[]{}= ") or (expr[i-1] in "()[]{}= ")): continue + ((expr[i+1] in "()[]{}=+-/* ") or (expr[i-1] in "()[]{}=+-/* ")): continue expr2=expr2+expr[i] expr2=expr2+expr[-1] return expr2 From numpy-svn at scipy.org Sat Apr 19 17:45:44 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 19 Apr 2008 16:45:44 -0500 (CDT) Subject: [Numpy-svn] r5047 - in trunk/numpy/lib: . tests Message-ID: <20080419214544.8AE8439C423@new.scipy.org> Author: ptvirtan Date: 2008-04-19 16:45:35 -0500 (Sat, 19 Apr 2008) New Revision: 5047 Modified: trunk/numpy/lib/_datasource.py trunk/numpy/lib/tests/test__datasource.py Log: Fix bug #738 and add corresponding tests. lib._datasource.DataSource.abspath now sanitizes path names more carefully, making sure that all file paths reside in destdir, also on Windows. (Where both '/' and os.sep function as path separators, as far as os.path.join is concerned.) Modified: trunk/numpy/lib/_datasource.py =================================================================== --- trunk/numpy/lib/_datasource.py 2008-04-18 19:59:42 UTC (rev 5046) +++ trunk/numpy/lib/_datasource.py 2008-04-19 21:45:35 UTC (rev 5047) @@ -287,8 +287,23 @@ if len(splitpath) > 1: path = splitpath[1] scheme, netloc, upath, uparams, uquery, ufrag = urlparse(path) - return os.path.join(self._destpath, netloc, upath.strip(os.sep)) + netloc = self._sanitize_relative_path(netloc) + upath = self._sanitize_relative_path(upath) + return os.path.join(self._destpath, netloc, upath) + def _sanitize_relative_path(self, path): + """Return a sanitised relative path for which + os.path.abspath(os.path.join(base, path)).startswith(base) + """ + last = None + path = os.path.normpath(path) + while path != last: + last = path + # Note: os.path.join treats '/' as os.sep + path = path.lstrip(os.sep).lstrip('/') + path = path.lstrip(os.pardir).lstrip('..') + return path + def exists(self, path): """Test if ``path`` exists. Modified: trunk/numpy/lib/tests/test__datasource.py =================================================================== --- trunk/numpy/lib/tests/test__datasource.py 2008-04-18 19:59:42 UTC (rev 5046) +++ trunk/numpy/lib/tests/test__datasource.py 2008-04-19 21:45:35 UTC (rev 5047) @@ -29,6 +29,9 @@ http_fakepath = 'http://fake.abc.web/site/' http_fakefile = 'fake.txt' +malicious_files = ['/etc/shadow', '../../shadow', + '..\\system.dat', 'c:\\windows\\system.dat'] + magic_line = 'three is the magic number' @@ -165,7 +168,8 @@ def test_ValidHTTP(self): scheme, netloc, upath, pms, qry, frg = urlparse(valid_httpurl()) - local_path = os.path.join(self.tmpdir, netloc, upath.strip(os.sep)) + local_path = os.path.join(self.tmpdir, netloc, + upath.strip(os.sep).strip('/')) self.assertEqual(local_path, self.ds.abspath(valid_httpurl())) def test_ValidFile(self): @@ -178,7 +182,8 @@ def test_InvalidHTTP(self): scheme, netloc, upath, pms, qry, frg = urlparse(invalid_httpurl()) - invalidhttp = os.path.join(self.tmpdir, netloc, upath.strip(os.sep)) + invalidhttp = os.path.join(self.tmpdir, netloc, + upath.strip(os.sep).strip('/')) self.assertNotEqual(invalidhttp, self.ds.abspath(valid_httpurl())) def test_InvalidFile(self): @@ -190,8 +195,34 @@ # Test filename with complete path self.assertNotEqual(invalidfile, self.ds.abspath(tmpfile)) + def test_sandboxing(self): + tmpfile = valid_textfile(self.tmpdir) + tmpfilename = os.path.split(tmpfile)[-1] -class TestRespositoryAbspath(NumpyTestCase): + tmp_path = lambda x: os.path.abspath(self.ds.abspath(x)) + + assert tmp_path(valid_httpurl()).startswith(self.tmpdir) + assert tmp_path(invalid_httpurl()).startswith(self.tmpdir) + assert tmp_path(tmpfile).startswith(self.tmpdir) + assert tmp_path(tmpfilename).startswith(self.tmpdir) + for fn in malicious_files: + assert tmp_path(http_path+fn).startswith(self.tmpdir) + assert tmp_path(fn).startswith(self.tmpdir) + + def test_windows_os_sep(self): + orig_os_sep = os.sep + try: + os.sep = '\\' + self.test_ValidHTTP() + self.test_ValidFile() + self.test_InvalidHTTP() + self.test_InvalidFile() + self.test_sandboxing() + finally: + os.sep = orig_os_sep + + +class TestRepositoryAbspath(NumpyTestCase): def setUp(self): self.tmpdir = mkdtemp() self.repos = datasource.Repository(valid_baseurl(), self.tmpdir) @@ -203,11 +234,27 @@ def test_ValidHTTP(self): scheme, netloc, upath, pms, qry, frg = urlparse(valid_httpurl()) local_path = os.path.join(self.repos._destpath, netloc, \ - upath.strip(os.sep)) + upath.strip(os.sep).strip('/')) filepath = self.repos.abspath(valid_httpfile()) self.assertEqual(local_path, filepath) + def test_sandboxing(self): + tmp_path = lambda x: os.path.abspath(self.repos.abspath(x)) + assert tmp_path(valid_httpfile()).startswith(self.tmpdir) + for fn in malicious_files: + assert tmp_path(http_path+fn).startswith(self.tmpdir) + assert tmp_path(fn).startswith(self.tmpdir) + + def test_windows_os_sep(self): + orig_os_sep = os.sep + try: + os.sep = '\\' + self.test_ValidHTTP() + self.test_sandboxing() + finally: + os.sep = orig_os_sep + class TestRepositoryExists(NumpyTestCase): def setUp(self): self.tmpdir = mkdtemp() From numpy-svn at scipy.org Sat Apr 19 18:29:55 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 19 Apr 2008 17:29:55 -0500 (CDT) Subject: [Numpy-svn] r5048 - trunk/numpy/lib Message-ID: <20080419222955.7CB9939C1D6@new.scipy.org> Author: ptvirtan Date: 2008-04-19 17:29:47 -0500 (Sat, 19 Apr 2008) New Revision: 5048 Modified: trunk/numpy/lib/_datasource.py Log: Fixing #738: remember to sanitize away also Windows drive letters Modified: trunk/numpy/lib/_datasource.py =================================================================== --- trunk/numpy/lib/_datasource.py 2008-04-19 21:45:35 UTC (rev 5047) +++ trunk/numpy/lib/_datasource.py 2008-04-19 22:29:47 UTC (rev 5048) @@ -297,9 +297,10 @@ """ last = None path = os.path.normpath(path) + drive, path = os.path.splitdrive(path) # for Windows while path != last: last = path - # Note: os.path.join treats '/' as os.sep + # Note: os.path.join treats '/' as os.sep on Windows path = path.lstrip(os.sep).lstrip('/') path = path.lstrip(os.pardir).lstrip('..') return path From numpy-svn at scipy.org Sat Apr 19 19:28:13 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 19 Apr 2008 18:28:13 -0500 (CDT) Subject: [Numpy-svn] r5049 - in trunk/numpy/lib: . tests Message-ID: <20080419232813.437A439C505@new.scipy.org> Author: ptvirtan Date: 2008-04-19 18:28:05 -0500 (Sat, 19 Apr 2008) New Revision: 5049 Modified: trunk/numpy/lib/_datasource.py trunk/numpy/lib/tests/test__datasource.py Log: Fixing #738: Even more careful drive letter handling. And make the tests actually pass on Windows. Modified: trunk/numpy/lib/_datasource.py =================================================================== --- trunk/numpy/lib/_datasource.py 2008-04-19 22:29:47 UTC (rev 5048) +++ trunk/numpy/lib/_datasource.py 2008-04-19 23:28:05 UTC (rev 5049) @@ -297,12 +297,12 @@ """ last = None path = os.path.normpath(path) - drive, path = os.path.splitdrive(path) # for Windows while path != last: last = path # Note: os.path.join treats '/' as os.sep on Windows path = path.lstrip(os.sep).lstrip('/') path = path.lstrip(os.pardir).lstrip('..') + drive, path = os.path.splitdrive(path) # for Windows return path def exists(self, path): Modified: trunk/numpy/lib/tests/test__datasource.py =================================================================== --- trunk/numpy/lib/tests/test__datasource.py 2008-04-19 22:29:47 UTC (rev 5048) +++ trunk/numpy/lib/tests/test__datasource.py 2008-04-19 23:28:05 UTC (rev 5049) @@ -159,7 +159,7 @@ class TestDataSourceAbspath(NumpyTestCase): def setUp(self): - self.tmpdir = mkdtemp() + self.tmpdir = os.path.abspath(mkdtemp()) self.ds = datasource.DataSource(self.tmpdir) def tearDown(self): @@ -224,7 +224,7 @@ class TestRepositoryAbspath(NumpyTestCase): def setUp(self): - self.tmpdir = mkdtemp() + self.tmpdir = os.path.abspath(mkdtemp()) self.repos = datasource.Repository(valid_baseurl(), self.tmpdir) def tearDown(self): From numpy-svn at scipy.org Sat Apr 19 20:00:02 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 19 Apr 2008 19:00:02 -0500 (CDT) Subject: [Numpy-svn] r5050 - trunk/numpy/core/tests Message-ID: <20080420000002.0FD3B39C4D5@new.scipy.org> Author: charris Date: 2008-04-19 18:59:26 -0500 (Sat, 19 Apr 2008) New Revision: 5050 Modified: trunk/numpy/core/tests/test_ufunc.py Log: Add tests for generic ufunct loops preparatory to some code cleanup. Two tests currently fail and are commented out. PyUFunc_O_O_method -- fails PyUFunc_OO_O_method -- fails Modified: trunk/numpy/core/tests/test_ufunc.py =================================================================== --- trunk/numpy/core/tests/test_ufunc.py 2008-04-19 23:28:05 UTC (rev 5049) +++ trunk/numpy/core/tests/test_ufunc.py 2008-04-19 23:59:26 UTC (rev 5050) @@ -2,12 +2,140 @@ from numpy.testing import * class TestUfunc(NumpyTestCase): - def test_reduceat_shifting_sum(self): + def test_reduceat_shifting_sum(self) : L = 6 x = np.arange(L) idx = np.array(zip(np.arange(L-2), np.arange(L-2)+2)).ravel() assert_array_equal(np.add.reduceat(x,idx)[::2], [1,3,5,7]) + def check_generic_loops(self) : + """Test generic loops. + The loops to be tested are: + + PyUFunc_ff_f_As_dd_d + PyUFunc_ff_f + PyUFunc_dd_d + PyUFunc_gg_g + PyUFunc_FF_F_As_DD_D + PyUFunc_DD_D + PyUFunc_FF_F + PyUFunc_GG_G + PyUFunc_OO_O + PyUFunc_OO_O_method + PyUFunc_f_f_As_d_d + PyUFunc_d_d + PyUFunc_f_f + PyUFunc_g_g + PyUFunc_F_F_As_D_D + PyUFunc_F_F + PyUFunc_D_D + PyUFunc_G_G + PyUFunc_O_O + PyUFunc_O_O_method + PyUFunc_On_Om + + Where: + + f -- float + d -- double + g -- long double + F -- complex float + D -- complex double + G -- complex long double + O -- python object + + It is difficult to assure that each of these loops is entered from the + Python level as the special cased loops are a moving target and the + corresponding types are architecture dependent. We probably need to + define C level testing ufuncs to get at them. For the time being, I've + just looked at the signatures registered in the build directory to find + relevant functions. + + """ + fone = np.exp + ftwo = lambda x,y : x**y + fone_val = 1 + ftwo_val = 1 + # check unary PyUFunc_f_f. + msg = "PyUFunc_f_f" + x = np.zeros(10, dtype=np.single)[0::2] + assert_almost_equal(fone(x), fone_val, err_msg=msg) + # check unary PyUFunc_d_d. + msg = "PyUFunc_d_d" + x = np.zeros(10, dtype=np.double)[0::2] + assert_almost_equal(fone(x), fone_val, err_msg=msg) + # check unary PyUFunc_g_g. + msg = "PyUFunc_g_g" + x = np.zeros(10, dtype=np.longdouble)[0::2] + assert_almost_equal(fone(x), fone_val, err_msg=msg) + # check unary PyUFunc_F_F. + msg = "PyUFunc_F_F" + x = np.zeros(10, dtype=np.csingle)[0::2] + assert_almost_equal(fone(x), fone_val, err_msg=msg) + # check unary PyUFunc_D_D. + msg = "PyUFunc_D_D" + x = np.zeros(10, dtype=np.cdouble)[0::2] + assert_almost_equal(fone(x), fone_val, err_msg=msg) + # check unary PyUFunc_G_G. + msg = "PyUFunc_G_G" + x = np.zeros(10, dtype=np.clongdouble)[0::2] + assert_almost_equal(fone(x), fone_val, err_msg=msg) + + # check binary PyUFunc_ff_f. + msg = "PyUFunc_ff_f" + x = np.ones(10, dtype=np.single)[0::2] + assert_almost_equal(ftwo(x,x), ftwo_val, err_msg=msg) + # check binary PyUFunc_dd_d. + msg = "PyUFunc_dd_d" + x = np.ones(10, dtype=np.double)[0::2] + assert_almost_equal(ftwo(x,x), ftwo_val, err_msg=msg) + # check binary PyUFunc_gg_g. + msg = "PyUFunc_gg_g" + x = np.ones(10, dtype=np.longdouble)[0::2] + assert_almost_equal(ftwo(x,x), ftwo_val, err_msg=msg) + # check binary PyUFunc_FF_F. + msg = "PyUFunc_FF_F" + x = np.ones(10, dtype=np.csingle)[0::2] + assert_almost_equal(ftwo(x,x), ftwo_val, err_msg=msg) + # check binary PyUFunc_DD_D. + msg = "PyUFunc_DD_D" + x = np.ones(10, dtype=np.cdouble)[0::2] + assert_almost_equal(ftwo(x,x), ftwo_val, err_msg=msg) + # check binary PyUFunc_GG_G. + msg = "PyUFunc_GG_G" + x = np.ones(10, dtype=np.clongdouble)[0::2] + assert_almost_equal(ftwo(x,x), ftwo_val, err_msg=msg) + + # class to use in testing object method loops + class foo : + def logical_not(self) : + return np.bool_(1) + def logical_and(self, obj) : + return np.bool_(1) + + # check unary PyUFunc_O_0 + msg = "PyUFunc_O_O" + x = np.ones(10, dtype=np.object)[0::2] + assert np.all(np.abs(x) == 1), msg + # check unary PyUFunc_O_0_method + msg = "PyUFunc_O_O_method" + x = np.zeros(10, dtype=np.object)[0::2] + x[...] = foo() + #assert np.all(np.logical_not(x) == True), msg + + # check binary PyUFunc_OO_0 + msg = "PyUFunc_OO_O" + x = np.ones(10, dtype=np.object)[0::2] + assert np.all(np.add(x,x) == 2), msg + # check binary PyUFunc_OO_0_method + msg = "PyUFunc_OO_O_method" + x = np.zeros(10, dtype=np.object)[0::2] + x[...] = foo() + #assert np.all(np.logical_and(x,x) == 1), msg + + # check PyUFunc_On_Om + # fixme -- I don't know how to do this yet + if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Sat Apr 19 20:45:30 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 19 Apr 2008 19:45:30 -0500 (CDT) Subject: [Numpy-svn] r5051 - trunk/numpy/core/src Message-ID: <20080420004530.1AC9C39C292@new.scipy.org> Author: charris Date: 2008-04-19 19:45:27 -0500 (Sat, 19 Apr 2008) New Revision: 5051 Modified: trunk/numpy/core/src/ufuncobject.c Log: Cleanup code style in generic ufunc loops. Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2008-04-19 23:59:26 UTC (rev 5050) +++ trunk/numpy/core/src/ufuncobject.c 2008-04-20 00:45:27 UTC (rev 5051) @@ -1,30 +1,30 @@ /* - Python Universal Functions Object -- Math for all types, plus fast - arrays math + * Python Universal Functions Object -- Math for all types, plus fast + * arrays math + * + * Full description + * + * This supports mathematical (and Boolean) functions on arrays and other python + * objects. Math on large arrays of basic C types is rather efficient. + * + * Travis E. Oliphant 2005, 2006 oliphant at ee.byu.edu (oliphant.travis at ieee.org) + * Brigham Young University + * + * based on the + * + * Original Implementation: + * Copyright (c) 1995, 1996, 1997 Jim Hugunin, hugunin at mit.edu + * + * with inspiration and code from + * Numarray + * Space Science Telescope Institute + * J. Todd Miller + * Perry Greenfield + * Rick White + * + */ - Full description - This supports mathematical (and Boolean) functions on arrays and other python - objects. Math on large arrays of basic C types is rather efficient. - - Travis E. Oliphant 2005, 2006 oliphant at ee.byu.edu (oliphant.travis at ieee.org) - Brigham Young University - - based on the - - Original Implementation: - Copyright (c) 1995, 1996, 1997 Jim Hugunin, hugunin at mit.edu - - with inspiration and code from - Numarray - Space Science Telescope Institute - J. Todd Miller - Perry Greenfield - Rick White - -*/ - - typedef double (DoubleBinaryFunc)(double x, double y); typedef float (FloatBinaryFunc)(float x, float y); typedef longdouble (LongdoubleBinaryFunc)(longdouble x, longdouble y); @@ -40,12 +40,17 @@ static void PyUFunc_ff_f_As_dd_d(char **args, intp *dimensions, intp *steps, void *func) { - register intp i, n=dimensions[0]; - register intp is1=steps[0],is2=steps[1],os=steps[2]; - char *ip1=args[0], *ip2=args[1], *op=args[2]; + intp n = dimensions[0]; + intp is1 = steps[0]; + intp is2 = steps[1]; + intp os = steps[2]; + char *ip1 = args[0]; + char *ip2 = args[1]; + char *op = args[2]; + intp i; - for(i=0; i Author: charris Date: 2008-04-19 21:42:23 -0500 (Sat, 19 Apr 2008) New Revision: 5052 Modified: trunk/numpy/core/src/ufuncobject.c Log: More clean up the generic object loops. There is a reference counting error in the code that calls these loops. Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2008-04-20 00:45:27 UTC (rev 5051) +++ trunk/numpy/core/src/ufuncobject.c 2008-04-20 02:42:23 UTC (rev 5052) @@ -234,7 +234,7 @@ x1 = *((PyObject **)ip1); x2 = *((PyObject **)ip2); if ((x1 == NULL) || (x2 == NULL)) { - goto done; + return; } if ( (void *) func == (void *) PyNumber_Power) { tmp = ((ternaryfunc)func)(x1, x2, Py_None); @@ -243,13 +243,11 @@ tmp = ((binaryfunc)func)(x1, x2); } if (PyErr_Occurred()) { - goto done; + return; } Py_XDECREF(*((PyObject **)op)); *((PyObject **)op) = tmp; } -done: - return; } /*UFUNC_API*/ @@ -263,33 +261,20 @@ char *ip1 = args[0]; char *ip2 = args[1]; char *op = args[2]; + char *meth = (char *)func; intp i; - PyObject *tmp, *meth, *arglist, *x1, *x2; for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { - x1 = *(PyObject **)ip1; - x2 = *(PyObject **)ip2; - if ((x1 == NULL) || (x2 == NULL)) { + PyObject *in1 = *(PyObject **)ip1; + PyObject *in2 = *(PyObject **)ip2; + PyObject **out = (PyObject **)op; + PyObject *ret = PyObject_CallMethod(in1, meth, "(O)", in2); + + if (ret == NULL) { return; } - meth = PyObject_GetAttrString(x1, (char *)func); - if (meth != NULL) { - arglist = PyTuple_New(1); - if (arglist == NULL) { - Py_DECREF(meth); - return; - } - Py_INCREF(x2); - PyTuple_SET_ITEM(arglist, 0, x2); - tmp = PyEval_CallObject(meth, arglist); - Py_DECREF(arglist); - Py_DECREF(meth); - if ((tmp==NULL) || PyErr_Occurred()) { - return; - } - Py_XDECREF(*((PyObject **)op)); - *((PyObject **)op) = tmp; - } + Py_XDECREF(*out); + *out = ret; } } @@ -487,30 +472,19 @@ intp is2 = steps[1]; char *ip1 = args[0]; char *op = args[1]; + char *meth = (char *)func; intp i; - PyObject *tmp, *meth, *arglist, *x1; for(i = 0; i < n; i++, ip1 += is1, op += is2) { - x1 = *(PyObject **)ip1; - if (x1 == NULL) { + PyObject *in1 = *(PyObject **)ip1; + PyObject **out = (PyObject **)op; + PyObject *ret = PyObject_CallMethod(in1, meth, NULL); + + if (ret == NULL) { return; } - meth = PyObject_GetAttrString(x1, (char *)func); - if (meth != NULL) { - arglist = PyTuple_New(0); - if (arglist == NULL) { - Py_DECREF(meth); - return; - } - tmp = PyEval_CallObject(meth, arglist); - Py_DECREF(arglist); - Py_DECREF(meth); - if ((tmp==NULL) || PyErr_Occurred()) { - return; - } - Py_XDECREF(*((PyObject **)op)); - *((PyObject **)op) = tmp; - } + Py_XDECREF(*out); + *out = ret; } } From numpy-svn at scipy.org Sat Apr 19 22:45:48 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 19 Apr 2008 21:45:48 -0500 (CDT) Subject: [Numpy-svn] r5053 - trunk/numpy/core/tests Message-ID: <20080420024548.57BE339C245@new.scipy.org> Author: charris Date: 2008-04-19 21:45:19 -0500 (Sat, 19 Apr 2008) New Revision: 5053 Modified: trunk/numpy/core/tests/test_ufunc.py Log: Make the object loops tests less susceptiple to reference counting errors. The tests are still counting errors, and I may change these back when they are fixed. Modified: trunk/numpy/core/tests/test_ufunc.py =================================================================== --- trunk/numpy/core/tests/test_ufunc.py 2008-04-20 02:42:23 UTC (rev 5052) +++ trunk/numpy/core/tests/test_ufunc.py 2008-04-20 02:45:19 UTC (rev 5053) @@ -81,7 +81,7 @@ msg = "PyUFunc_G_G" x = np.zeros(10, dtype=np.clongdouble)[0::2] assert_almost_equal(fone(x), fone_val, err_msg=msg) - + # check binary PyUFunc_ff_f. msg = "PyUFunc_ff_f" x = np.ones(10, dtype=np.single)[0::2] @@ -106,14 +106,14 @@ msg = "PyUFunc_GG_G" x = np.ones(10, dtype=np.clongdouble)[0::2] assert_almost_equal(ftwo(x,x), ftwo_val, err_msg=msg) - + # class to use in testing object method loops class foo : def logical_not(self) : return np.bool_(1) def logical_and(self, obj) : return np.bool_(1) - + # check unary PyUFunc_O_0 msg = "PyUFunc_O_O" x = np.ones(10, dtype=np.object)[0::2] @@ -121,9 +121,10 @@ # check unary PyUFunc_O_0_method msg = "PyUFunc_O_O_method" x = np.zeros(10, dtype=np.object)[0::2] - x[...] = foo() + for i in range(len(x)) : + x[i] = foo() #assert np.all(np.logical_not(x) == True), msg - + # check binary PyUFunc_OO_0 msg = "PyUFunc_OO_O" x = np.ones(10, dtype=np.object)[0::2] @@ -131,9 +132,10 @@ # check binary PyUFunc_OO_0_method msg = "PyUFunc_OO_O_method" x = np.zeros(10, dtype=np.object)[0::2] - x[...] = foo() + for i in range(len(x)) : + x[i] = foo() #assert np.all(np.logical_and(x,x) == 1), msg - + # check PyUFunc_On_Om # fixme -- I don't know how to do this yet From numpy-svn at scipy.org Sun Apr 20 07:24:32 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 20 Apr 2008 06:24:32 -0500 (CDT) Subject: [Numpy-svn] r5054 - trunk/numpy/distutils Message-ID: <20080420112432.1A2E239C2B2@new.scipy.org> Author: jarrod.millman Date: 2008-04-20 06:24:30 -0500 (Sun, 20 Apr 2008) New Revision: 5054 Modified: trunk/numpy/distutils/ccompiler.py Log: Reverting r4481, see #723 Modified: trunk/numpy/distutils/ccompiler.py =================================================================== --- trunk/numpy/distutils/ccompiler.py 2008-04-20 02:45:19 UTC (rev 5053) +++ trunk/numpy/distutils/ccompiler.py 2008-04-20 11:24:30 UTC (rev 5054) @@ -398,5 +398,68 @@ return _distutils_gen_preprocess_options(macros, include_dirs) ccompiler.gen_preprocess_options = gen_preprocess_options +##Fix distutils.util.split_quoted: +# NOTE: I removed this fix in revision 4481 (see ticket #619), but it appears +# that removing this fix causes f2py problems on Windows XP (see ticket #723). +# Specifically, on WinXP when gfortran is installed in a directory path, which +# contains spaces, then f2py is unable to find it. +import re +import string +_wordchars_re = re.compile(r'[^\\\'\"%s ]*' % string.whitespace) +_squote_re = re.compile(r"'(?:[^'\\]|\\.)*'") +_dquote_re = re.compile(r'"(?:[^"\\]|\\.)*"') +_has_white_re = re.compile(r'\s') +def split_quoted(s): + s = string.strip(s) + words = [] + pos = 0 + + while s: + m = _wordchars_re.match(s, pos) + end = m.end() + if end == len(s): + words.append(s[:end]) + break + + if s[end] in string.whitespace: # unescaped, unquoted whitespace: now + words.append(s[:end]) # we definitely have a word delimiter + s = string.lstrip(s[end:]) + pos = 0 + + elif s[end] == '\\': # preserve whatever is being escaped; + # will become part of the current word + s = s[:end] + s[end+1:] + pos = end+1 + + else: + if s[end] == "'": # slurp singly-quoted string + m = _squote_re.match(s, end) + elif s[end] == '"': # slurp doubly-quoted string + m = _dquote_re.match(s, end) + else: + raise RuntimeError, \ + "this can't happen (bad char '%c')" % s[end] + + if m is None: + raise ValueError, \ + "bad string (mismatched %s quotes?)" % s[end] + + (beg, end) = m.span() + if _has_white_re.search(s[beg+1:end-1]): + s = s[:beg] + s[beg+1:end-1] + s[end:] + pos = m.end() - 2 + else: + # Keeping quotes when a quoted word does not contain + # white-space. XXX: send a patch to distutils + pos = m.end() + + if pos >= len(s): + words.append(s) + break + + return words +ccompiler.split_quoted = split_quoted +##Fix distutils.util.split_quoted: + # define DISTUTILS_USE_SDK when necessary to workaround distutils/msvccompiler.py bug msvc_on_amd64() From numpy-svn at scipy.org Sun Apr 20 07:49:52 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 20 Apr 2008 06:49:52 -0500 (CDT) Subject: [Numpy-svn] r5055 - in trunk/numpy: . core core/tests distutils doc/newdtype_example lib lib/tests linalg linalg/tests ma ma/tests oldnumeric testing Message-ID: <20080420114952.00B6B39C212@new.scipy.org> Author: jarrod.millman Date: 2008-04-20 06:49:35 -0500 (Sun, 20 Apr 2008) New Revision: 5055 Modified: trunk/numpy/__init__.py trunk/numpy/add_newdocs.py trunk/numpy/core/defmatrix.py trunk/numpy/core/fromnumeric.py trunk/numpy/core/memmap.py trunk/numpy/core/numerictypes.py trunk/numpy/core/tests/test_numerictypes.py trunk/numpy/core/tests/test_regression.py trunk/numpy/core/tests/test_scalarmath.py trunk/numpy/distutils/cpuinfo.py trunk/numpy/doc/newdtype_example/example.py trunk/numpy/doc/newdtype_example/setup.py trunk/numpy/lib/financial.py trunk/numpy/lib/function_base.py trunk/numpy/lib/index_tricks.py trunk/numpy/lib/io.py trunk/numpy/lib/tests/test__datasource.py trunk/numpy/lib/tests/test_function_base.py trunk/numpy/lib/tests/test_io.py trunk/numpy/lib/tests/test_regression.py trunk/numpy/lib/twodim_base.py trunk/numpy/lib/utils.py trunk/numpy/linalg/linalg.py trunk/numpy/linalg/tests/test_regression.py trunk/numpy/ma/core.py trunk/numpy/ma/extras.py trunk/numpy/ma/morestats.py trunk/numpy/ma/mrecords.py trunk/numpy/ma/mstats.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/testutils.py trunk/numpy/oldnumeric/compat.py trunk/numpy/oldnumeric/ma.py trunk/numpy/testing/utils.py Log: ran reindent in preparation for the 1.1 release Modified: trunk/numpy/__init__.py =================================================================== --- trunk/numpy/__init__.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/__init__.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -1,7 +1,7 @@ """ NumPy ========== -Provides +Provides 1) An array object of arbitrary homogeneous items 2) Fast mathematical operations over arrays 3) Linear Algebra, Fourier Transforms, Random Number Generation Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/add_newdocs.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -1314,10 +1314,10 @@ Notes ----- The standard deviation is the square root of the average of the squared - deviations from the mean, i.e. var = sqrt(mean(abs(x - x.mean())**2)). - The computed standard deviation is computed by dividing by the number of - elements, N-ddof. The option ddof defaults to zero, that is, a - biased estimate. Note that for complex numbers std takes the absolute + deviations from the mean, i.e. var = sqrt(mean(abs(x - x.mean())**2)). + The computed standard deviation is computed by dividing by the number of + elements, N-ddof. The option ddof defaults to zero, that is, a + biased estimate. Note that for complex numbers std takes the absolute value before squaring, so that the result is always real and nonnegative. """)) @@ -1503,10 +1503,10 @@ Notes ----- The variance is the average of the squared deviations from the mean, - i.e. var = mean(abs(x - x.mean())**2). The mean is computed by - dividing by N-ddof, where N is the number of elements. The argument - ddof defaults to zero; for an unbiased estimate supply ddof=1. Note - that for complex numbers the absolute value is taken before squaring, + i.e. var = mean(abs(x - x.mean())**2). The mean is computed by + dividing by N-ddof, where N is the number of elements. The argument + ddof defaults to zero; for an unbiased estimate supply ddof=1. Note + that for complex numbers the absolute value is taken before squaring, so that the result is always real and nonnegative. """)) Modified: trunk/numpy/core/defmatrix.py =================================================================== --- trunk/numpy/core/defmatrix.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/core/defmatrix.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -390,11 +390,11 @@ ----- The standard deviation is the square root of the average of the squared deviations from the mean, i.e. var = - sqrt(mean(abs(x - x.mean())**2)). The computed standard - deviation is computed by dividing by the number of elements, - N-ddof. The option ddof defaults to zero, that is, a biased - estimate. Note that for complex numbers std takes the absolute - value before squaring, so that the result is always real + sqrt(mean(abs(x - x.mean())**2)). The computed standard + deviation is computed by dividing by the number of elements, + N-ddof. The option ddof defaults to zero, that is, a biased + estimate. Note that for complex numbers std takes the absolute + value before squaring, so that the result is always real and nonnegative. """ @@ -439,11 +439,11 @@ ----- The variance is the average of the squared deviations from the - mean, i.e. var = mean(abs(x - x.mean())**2). The mean is - computed by dividing by N-ddof, where N is the number of elements. - The argument ddof defaults to zero; for an unbiased estimate - supply ddof=1. Note that for complex numbers the absolute value - is taken before squaring, so that the result is always real + mean, i.e. var = mean(abs(x - x.mean())**2). The mean is + computed by dividing by N-ddof, where N is the number of elements. + The argument ddof defaults to zero; for an unbiased estimate + supply ddof=1. Note that for complex numbers the absolute value + is taken before squaring, so that the result is always real and nonnegative. """ return N.ndarray.var(self, axis, dtype, out)._align(axis) Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/core/fromnumeric.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -1671,10 +1671,10 @@ Notes ----- The standard deviation is the square root of the average of the squared - deviations from the mean, i.e. var = sqrt(mean(abs(x - x.mean())**2)). - The computed standard deviation is computed by dividing by the number of - elements, N-ddof. The option ddof defaults to zero, that is, a - biased estimate. Note that for complex numbers std takes the absolute + deviations from the mean, i.e. var = sqrt(mean(abs(x - x.mean())**2)). + The computed standard deviation is computed by dividing by the number of + elements, N-ddof. The option ddof defaults to zero, that is, a + biased estimate. Note that for complex numbers std takes the absolute value before squaring, so that the result is always real and nonnegative. Examples Modified: trunk/numpy/core/memmap.py =================================================================== --- trunk/numpy/core/memmap.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/core/memmap.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -20,7 +20,7 @@ Memory-mapped files are used for accessing small segments of large files on disk, without reading the entire file into memory. Numpy's memmaps are - array-like objects. This differs from python's mmap module which are + array-like objects. This differs from python's mmap module which are file-like objects. Parameters @@ -250,4 +250,3 @@ # flush any changes to disk, even if it's a view self.flush() self._close() - Modified: trunk/numpy/core/numerictypes.py =================================================================== --- trunk/numpy/core/numerictypes.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/core/numerictypes.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -606,8 +606,8 @@ return newdtype thisind += 1 return None - + def find_common_type(array_types, scalar_types): """Determine common type following standard coercion rules @@ -617,13 +617,13 @@ A list of dtype convertible objects representing arrays scalar_types : sequence A list of dtype convertible objects representing scalars - + Returns ------- datatype : dtype The common data-type which is the maximum of the array_types ignoring the scalar_types unless the maximum of the scalar_types - is of a different kind. + is of a different kind. If the kinds is not understood, then None is returned. """ @@ -646,7 +646,7 @@ index_sc = _kind_list.index(maxsc.kind) except ValueError: return None - + if index_sc > index_a: return _find_common_coerce(maxsc,maxa) else: Modified: trunk/numpy/core/tests/test_numerictypes.py =================================================================== --- trunk/numpy/core/tests/test_numerictypes.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/core/tests/test_numerictypes.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -355,10 +355,10 @@ res = numpy.find_common_type(['u8','i8','i8'],['f8']) assert(res == 'f8') - - - + + + if __name__ == "__main__": NumpyTest().run() Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/core/tests/test_regression.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -818,10 +818,10 @@ np.indices((0,3,4)).T.reshape(-1,3) def check_flat_byteorder(self, level=rlevel): - """Ticket #657""" - x = np.arange(10) - assert_array_equal(x.astype('>i4'),x.astype('i4').flat[:],x.astype('i4'),x.astype('i4').flat[:],x.astype('>> 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 +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. """ @@ -160,19 +160,19 @@ 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) +# (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) def _g_div_gp(r, n, p, x, y, w): t1 = (r+1)**n t2 = (r+1)**(n-1) return (y + t1*x + p*(t1 - 1)*(r*w + 1)/r)/(n*t2*x - p*(t1 - 1)*(r*w + 1)/(r**2) + n*p*t2*(r*w + 1)/r + p*(t1 - 1)*w/r) -# Use Newton's iteration until the change is less than 1e-6 +# Use Newton's iteration until the change is less than 1e-6 # for all values or a maximum of 100 iterations is reached. -# Newton's rule is -# r_{n+1} = r_{n} - g(r_n)/g'(r_n) +# Newton's rule is +# r_{n+1} = r_{n} - g(r_n)/g'(r_n) # where -# g(r) is the formula +# g(r) is the formula # g'(r) is the derivative with respect to r. def rate(nper, pmt, pv, fv, when='end', guess=0.10, tol=1e-6, maxiter=100): """Number of periods found by solving the equation @@ -194,7 +194,7 @@ else: return rn rate.__doc__ += eqstr - + def irr(values): """Internal Rate of Return @@ -212,7 +212,7 @@ if rate.size == 1: rate = rate.item() return rate - + def npv(rate, values): """Net Present Value @@ -223,15 +223,15 @@ def mirr(values, finance_rate, reinvest_rate): """Modified internal rate of return - + Parameters ---------- values: Cash flows (must contain at least one positive and one negative value) or nan is returned. - finance_rate : + finance_rate : Interest rate paid on the cash flows - reinvest_rate : + reinvest_rate : Interest rate received on the cash flows upon reinvestment """ @@ -240,7 +240,7 @@ neg = values < 0 if not (pos.size > 0 and neg.size > 0): return np.nan - + n = pos.size + neg.size numer = -npv(reinvest_rate, values[pos])*((1+reinvest_rate)**n) denom = npv(finance_rate, values[neg])*(1+finance_rate) Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/lib/function_base.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -328,49 +328,49 @@ def average(a, axis=None, weights=None, returned=False): """Return the weighted average of array a over the given axis. - - + + Parameters ---------- a : array_like Data to be averaged. axis : {None, integer}, optional - Axis along which to average a. If None, averaging is done over the - entire array irrespective of its shape. + Axis along which to average a. If None, averaging is done over the + entire array irrespective of its shape. weights : {None, array_like}, optional - The importance each datum has in the computation of the - average. The weights array can either be 1D, in which case its length - must be the size of a along the given axis, or of the same shape as a. - If weights=None, all data are assumed to have weight equal to one. + The importance each datum has in the computation of the + average. The weights array can either be 1D, in which case its length + must be the size of a along the given axis, or of the same shape as a. + If weights=None, all data are assumed to have weight equal to one. returned :{False, boolean}, optional If True, the tuple (average, sum_of_weights) is returned, - otherwise only the average is returmed. Note that if weights=None, then + otherwise only the average is returmed. Note that if weights=None, then the sum of the weights is also the number of elements averaged over. Returns ------- average, [sum_of_weights] : {array_type, double} - Return the average along the specified axis. When returned is True, - return a tuple with the average as the first element and the sum - of the weights as the second element. The return type is Float if a is + Return the average along the specified axis. When returned is True, + return a tuple with the average as the first element and the sum + of the weights as the second element. The return type is Float if a is of integer type, otherwise it is of the same type as a. sum_of_weights is has the same type as the average. - + Example ------- >>> average(range(1,11), weights=range(10,0,-1)) 4.0 - + Exceptions ---------- ZeroDivisionError - Raised when all weights along axis are zero. See numpy.ma.average for a - version robust to this type of error. + Raised when all weights along axis are zero. See numpy.ma.average for a + version robust to this type of error. TypeError - Raised when the length of 1D weights is not the same as the shape of a - along axis. - + Raised when the length of 1D weights is not the same as the shape of a + along axis. + """ if not isinstance(a, np.matrix) : a = np.asarray(a) @@ -390,7 +390,7 @@ raise TypeError, "1D weights expected when shapes of a and weights differ." if wgt.shape[0] != a.shape[axis] : raise ValueError, "Length of weights not compatible with specified axis." - + # setup wgt to broadcast along axis wgt = np.array(wgt, copy=0, ndmin=a.ndim).swapaxes(-1,axis) @@ -681,21 +681,21 @@ def interp(x, xp, fp, left=None, right=None): """Return the value of a piecewise-linear function at each value in x. - The piecewise-linear function, f, is defined by the known data-points - fp=f(xp). The xp points must be sorted in increasing order but this is + The piecewise-linear function, f, is defined by the known data-points + fp=f(xp). The xp points must be sorted in increasing order but this is not checked. - - For values of x < xp[0] return the value given by left. If left is None, + + For values of x < xp[0] return the value given by left. If left is None, then return fp[0]. - For values of x > xp[-1] return the value given by right. If right is + For values of x > xp[-1] return the value given by right. If right is None, then return fp[-1]. """ if isinstance(x, (float, int, number)): return compiled_interp([x], xp, fp, left, right).item() else: return compiled_interp(x, xp, fp, left, right) - + def angle(z, deg=0): """Return the angle of the complex argument z. """ Modified: trunk/numpy/lib/index_tricks.py =================================================================== --- trunk/numpy/lib/index_tricks.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/lib/index_tricks.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -294,7 +294,7 @@ objs.append(newobj) if not scalar and isinstance(newobj, _nx.ndarray): arraytypes.append(newobj.dtype) - + # Esure that scalars won't up-cast unless warranted final_dtype = find_common_type(arraytypes, scalartypes) if final_dtype is not None: Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/lib/io.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -232,37 +232,37 @@ Parameters ---------- - fname : filename or a file handle. + fname : filename or a file handle. Support for gzipped files is automatic, if the filename ends in .gz - dtype : data-type - Data type of the resulting array. If this is a record data-type, the - resulting array will be 1-d and each row will be interpreted as an - element of the array. The number of columns used must match the number + dtype : data-type + Data type of the resulting array. If this is a record data-type, the + resulting array will be 1-d and each row will be interpreted as an + element of the array. The number of columns used must match the number of fields in the data-type in this case. - comments : str + comments : str The character used to indicate the start of a comment in the file. delimiter : str - A string-like character used to separate values in the file. If delimiter + A string-like character used to separate values in the file. If delimiter is unspecified or none, any whitespace string is a separator. converters : {} - A dictionary mapping column number to a function that will convert that - column to a float. Eg, if column 0 is a date string: - converters={0:datestr2num}. Converters can also be used to provide - a default value for missing data: converters={3:lambda s: float(s or 0)}. - + A dictionary mapping column number to a function that will convert that + column to a float. Eg, if column 0 is a date string: + converters={0:datestr2num}. Converters can also be used to provide + a default value for missing data: converters={3:lambda s: float(s or 0)}. + skiprows : int The number of rows from the top to skip. usecols : sequence - A sequence of integer column indexes to extract where 0 is the first + A sequence of integer column indexes to extract where 0 is the first column, eg. usecols=(1,4,5) will extract the 2nd, 5th and 6th columns. unpack : bool - If True, will transpose the matrix allowing you to unpack into named + If True, will transpose the matrix allowing you to unpack into named arguments on the left hand side. Examples @@ -271,8 +271,8 @@ >>> x,y,z = load('somefile.dat', usecols=(3,5,7), unpack=True) >>> r = np.loadtxt('record.dat', dtype={'names':('gender','age','weight'), 'formats': ('S1','i4', 'f4')}) - - SeeAlso: scipy.io.loadmat to read and write matfiles. + + SeeAlso: scipy.io.loadmat to read and write matfiles. """ if _string_like(fname): @@ -332,23 +332,23 @@ Parameters ---------- fname : filename or a file handle - If the filename ends in .gz, the file is automatically saved in - compressed gzip format. The load() command understands gzipped files + If the filename ends in .gz, the file is automatically saved in + compressed gzip format. The load() command understands gzipped files transparently. X : array or sequence Data to write to file. - fmt : string - A format string %[flags][width][.precision]specifier. See notes below for + fmt : string + A format string %[flags][width][.precision]specifier. See notes below for a description of some common flags and specifiers. delimiter : str Character separating columns. - + Examples -------- >>> savetxt('test.out', x, delimiter=',') # X is an array >>> savetxt('test.out', (x,y,z)) # x,y,z equal sized 1D arrays - >>> savetxt('test.out', x, fmt='%1.4e') # use exponential notation - + >>> savetxt('test.out', x, fmt='%1.4e') # use exponential notation + Notes on fmt ------------ flags: @@ -362,19 +362,19 @@ For e, E and f specifiers, the number of digits to print after the decimal point. For g and G, the maximum number of significant digits. - For s, the maximum number of characters. + For s, the maximum number of characters. specifiers: c : character d or i : signed decimal integer - e or E : scientific notation with e or E. + e or E : scientific notation with e or E. f : decimal floating point g,G : use the shorter of e,E or f o : signed octal s : string of characters u : unsigned decimal integer x,X : unsigned hexadecimal integer - - This is not an exhaustive specification. + + This is not an exhaustive specification. """ if _string_like(fname): @@ -403,7 +403,7 @@ import re def fromregex(file, regexp, dtype): """Construct a record array from a text file, using regular-expressions parsing. - + Array is constructed from all matches of the regular expression in the file. Groups in the regular expression are converted to fields. @@ -423,7 +423,7 @@ >>> f.write("1312 foo\n1534 bar\n 444 qux") >>> f.close() >>> np.fromregex('test.dat', r"(\d+)\s+(...)", [('num', np.int64), ('key', 'S3')]) - array([(1312L, 'foo'), (1534L, 'bar'), (444L, 'qux')], + array([(1312L, 'foo'), (1534L, 'bar'), (444L, 'qux')], dtype=[('num', '>> diagflat([[1,2],[3,4]]]) @@ -93,12 +93,12 @@ [0, 2, 0, 0], [0, 0, 3, 0], [0, 0, 0, 4]]) - + >>> diagflat([1,2], 1) array([[0, 1, 0], - [0, 0, 2], + [0, 0, 2], [0, 0, 0]]) - """ + """ try: wrap = v.__array_wrap__ except AttributeError: Modified: trunk/numpy/lib/utils.py =================================================================== --- trunk/numpy/lib/utils.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/lib/utils.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -512,7 +512,7 @@ if not whats: return for name, (docstring, kind, index) in cache.iteritems(): - if kind in ('module', 'object'): + if kind in ('module', 'object'): # don't show modules or objects continue ok = True @@ -528,7 +528,7 @@ # XXX: this is full Harrison-Stetson heuristics now, # XXX: it probably could be improved - kind_relevance = {'func': 1000, 'class': 1000, + kind_relevance = {'func': 1000, 'class': 1000, 'module': -1000, 'object': -1000} def relevance(name, docstr, kind, index): @@ -597,7 +597,7 @@ cache : dict {obj_full_name: (docstring, kind, index), ...} Docstring cache for the module, either cached one (regenerate=False) or newly generated. - + """ global _lookfor_caches @@ -623,7 +623,7 @@ index += 1 kind = "object" - + if inspect.ismodule(item): kind = "module" try: @@ -649,13 +649,13 @@ stack.append(("%s.%s" % (name, n), v)) elif callable(item): kind = "func" - + doc = inspect.getdoc(item) if doc is not None: cache[name] = (doc, kind, index) return cache - + #----------------------------------------------------------------------------- # The following SafeEval class and company are adapted from Michael Spencer's Modified: trunk/numpy/linalg/linalg.py =================================================================== --- trunk/numpy/linalg/linalg.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/linalg/linalg.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -972,8 +972,8 @@ def cond(x,p=None): """Compute the condition number of a matrix. - The condition number of x is the norm of x times the norm - of the inverse of x. The norm can be the usual L2 + The condition number of x is the norm of x times the norm + of the inverse of x. The norm can be the usual L2 (root-of-sum-of-squares) norm or a number of other matrix norms. Parameters @@ -983,16 +983,16 @@ p : {None, 1, -1, 2, -2, inf, -inf, 'fro'} Order of the norm: - p norm for matrices + p norm for matrices ===== ============================ None 2-norm, computed directly using the SVD - 'fro' Frobenius norm - inf max(sum(abs(x), axis=1)) - -inf min(sum(abs(x), axis=1)) - 1 max(sum(abs(x), axis=0)) - -1 min(sum(abs(x), axis=0)) - 2 2-norm (largest sing. value) - -2 smallest singular value + 'fro' Frobenius norm + inf max(sum(abs(x), axis=1)) + -inf min(sum(abs(x), axis=1)) + 1 max(sum(abs(x), axis=0)) + -1 min(sum(abs(x), axis=0)) + 2 2-norm (largest sing. value) + -2 smallest singular value ===== ============================ Returns Modified: trunk/numpy/linalg/tests/test_regression.py =================================================================== --- trunk/numpy/linalg/tests/test_regression.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/linalg/tests/test_regression.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -12,9 +12,9 @@ class TestRegression(NumpyTestCase): def test_eig_build(self, level = rlevel): """Ticket #652""" - rva = [1.03221168e+02 +0.j, + rva = [1.03221168e+02 +0.j, -1.91843603e+01 +0.j, - -6.04004526e-01+15.84422474j, + -6.04004526e-01+15.84422474j, -6.04004526e-01-15.84422474j, -1.13692929e+01 +0.j, -6.57612485e-01+10.41755503j, @@ -24,7 +24,7 @@ 7.80732773e+00 +0.j , -7.65390898e-01 +0.j, 1.51971555e-15 +0.j , - -1.51308713e-15 +0.j] + -1.51308713e-15 +0.j] a = arange(13*13, dtype = float64) a.shape = (13,13) a = a%17 @@ -38,7 +38,7 @@ cov = array([[ 77.70273908, 3.51489954, 15.64602427], [3.51489954, 88.97013878, -1.07431931], [15.64602427, -1.07431931, 98.18223512]]) - + vals, vecs = linalg.eigh(cov) assert_array_almost_equal(vals, rvals) Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/ma/core.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -26,13 +26,13 @@ 'arctanh', 'argmax', 'argmin', 'argsort', 'around', 'array', 'asarray','asanyarray', 'bitwise_and', 'bitwise_or', 'bitwise_xor', - 'ceil', 'choose', 'common_fill_value', 'compress', 'compressed', + 'ceil', 'choose', 'common_fill_value', 'compress', 'compressed', 'concatenate', 'conjugate', 'cos', 'cosh', 'count', 'default_fill_value', 'diagonal', 'divide', 'dump', 'dumps', 'empty', 'empty_like', 'equal', 'exp', 'fabs', 'fmod', 'filled', 'floor', 'floor_divide','fix_invalid', 'frombuffer', 'fromfunction', - 'getdata','getmask', 'getmaskarray', 'greater', 'greater_equal', + 'getdata','getmask', 'getmaskarray', 'greater', 'greater_equal', 'hypot', 'identity', 'ids', 'indices', 'inner', 'innerproduct', 'isMA', 'isMaskedArray', 'is_mask', 'is_masked', 'isarray', @@ -41,16 +41,16 @@ 'make_mask', 'make_mask_none', 'mask_or', 'masked', 'masked_array', 'masked_equal', 'masked_greater', 'masked_greater_equal', 'masked_inside', 'masked_invalid', - 'masked_less','masked_less_equal', 'masked_not_equal', - 'masked_object','masked_outside', 'masked_print_option', - 'masked_singleton','masked_values', 'masked_where', 'max', 'maximum', + 'masked_less','masked_less_equal', 'masked_not_equal', + 'masked_object','masked_outside', 'masked_print_option', + 'masked_singleton','masked_values', 'masked_where', 'max', 'maximum', 'mean', 'min', 'minimum', 'multiply', 'negative', 'nomask', 'nonzero', 'not_equal', 'ones', 'outer', 'outerproduct', 'power', 'product', 'ptp', 'put', 'putmask', 'rank', 'ravel', 'remainder', 'repeat', 'reshape', 'resize', 'right_shift', 'round_', - 'set_fill_value', 'shape', 'sin', 'sinh', 'size', 'sometrue', 'sort', + 'set_fill_value', 'shape', 'sin', 'sinh', 'size', 'sometrue', 'sort', 'sqrt', 'std', 'subtract', 'sum', 'swapaxes', 'take', 'tan', 'tanh', 'transpose', 'true_divide', 'var', 'where', @@ -192,7 +192,7 @@ else: fill_value = default_fill_value(dtype) else: - fill_value = narray(fill_value).tolist() + fill_value = narray(fill_value).tolist() fval = numpy.resize(fill_value, len(descr)) if len(descr) > 1: fill_value = [numpy.asarray(f).astype(d[1]).item() @@ -259,7 +259,7 @@ """ if hasattr(a, 'filled'): return a.filled(value) - elif isinstance(a, ndarray): + elif isinstance(a, ndarray): # Should we check for contiguity ? and a.flags['CONTIGUOUS']: return a elif isinstance(a, dict): @@ -1579,21 +1579,21 @@ if self._mask is not nomask: data = data[numpy.logical_not(ndarray.ravel(self._mask))] return data - - + + def compress(self, condition, axis=None, out=None): """Return a where condition is True. If condition is a MaskedArray, missing values are considered as False. - + Returns ------- A MaskedArray object. - + Notes ----- - Please note the difference with compressed() ! + Please note the difference with compressed() ! The output of compress has a mask, the output of compressed does not. - + """ # Get the basic components (_data, _mask) = (self._data, self._mask) @@ -2169,16 +2169,16 @@ Notes ----- - The value returned is by default a biased estimate of the + The value returned is by default a biased estimate of the true variance, since the mean is computed by dividing by N-ddof. For the (more standard) unbiased estimate, use ddof=1 or. - Note that for complex numbers the absolute value is taken before + Note that for complex numbers the absolute value is taken before squaring, so that the result is always real and nonnegative. """ if self._mask is nomask: # TODO: Do we keep super, or var _data and take a view ? - return super(MaskedArray, self).var(axis=axis, dtype=dtype, + return super(MaskedArray, self).var(axis=axis, dtype=dtype, ddof=ddof) else: cnt = self.count(axis=axis)-ddof @@ -2213,17 +2213,17 @@ Notes ----- - The value returned is by default a biased estimate of the - true standard deviation, since the mean is computed by dividing - by N-ddof. For the more standard unbiased estimate, use ddof=1. - Note that for complex numbers the absolute value is taken before + The value returned is by default a biased estimate of the + true standard deviation, since the mean is computed by dividing + by N-ddof. For the more standard unbiased estimate, use ddof=1. + Note that for complex numbers the absolute value is taken before squaring, so that the result is always real and nonnegative. """ dvar = self.var(axis,dtype,ddof=ddof) if axis is not None or dvar is not masked: dvar = sqrt(dvar) return dvar - + #............................................ def round(self, decimals=0, out=None): result = self._data.round(decimals).view(type(self)) @@ -2564,7 +2564,7 @@ #........................ def tofile(self, fid, sep="", format="%s"): raise NotImplementedError("Not implemented yet, sorry...") - + #-------------------------------------------- # Pickling def __getstate__(self): @@ -2886,7 +2886,7 @@ a = narray(a, copy=True, subok=True) if axis is None: a = a.flatten() - axis = 0 + axis = 0 if fill_value is None: if endwith: filler = minimum_fill_value(a) Modified: trunk/numpy/ma/extras.py =================================================================== --- trunk/numpy/ma/extras.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/ma/extras.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -11,18 +11,18 @@ __revision__ = "$Revision: 3473 $" __date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $' -__all__ = ['apply_along_axis', 'atleast_1d', 'atleast_2d', 'atleast_3d', - 'average', +__all__ = ['apply_along_axis', 'atleast_1d', 'atleast_2d', 'atleast_3d', + 'average', 'column_stack','compress_cols','compress_rowcols', 'compress_rows', 'count_masked', 'dot','dstack', 'expand_dims', - 'flatnotmasked_contiguous','flatnotmasked_edges', - 'hsplit','hstack', + 'flatnotmasked_contiguous','flatnotmasked_edges', + 'hsplit','hstack', 'mask_cols','mask_rowcols','mask_rows','masked_all','masked_all_like', - 'median','mediff1d','mr_', - 'notmasked_contiguous','notmasked_edges', - 'row_stack', + 'median','mediff1d','mr_', + 'notmasked_contiguous','notmasked_edges', + 'row_stack', 'vstack', ] @@ -262,7 +262,7 @@ the size of a along the given axis. If no weights are given, weights are assumed to be 1. returned : bool - Flag indicating whether a tuple (result, sum of weights/counts) + Flag indicating whether a tuple (result, sum of weights/counts) should be returned as output (True), or just the result (False). """ @@ -417,7 +417,7 @@ else: choice = slice(idx-1,idx+1) return data[choice].mean(0) - # + # if overwrite_input: if axis is None: sorted = a.ravel() @@ -432,10 +432,10 @@ else: result = apply_along_axis(_median1D, axis, sorted) return result - + #.............................................................................. def compress_rowcols(x, axis=None): """Suppress the rows and/or columns of a 2D array that contains @@ -445,7 +445,7 @@ - If axis is None, rows and columns are suppressed. - If axis is 0, only rows are suppressed. - If axis is 1 or -1, only columns are suppressed. - + Parameters ---------- axis : int, optional @@ -504,7 +504,7 @@ axis : int, optional Axis along which to perform the operation. If None, applies to a flattened version of the array. - + Returns ------- a *pure* ndarray. @@ -795,7 +795,7 @@ axis : int, optional Axis along which to perform the operation. If None, applies to a flattened version of the array. - + Returns ------- a sorted sequence of slices (start index, end index). Modified: trunk/numpy/ma/morestats.py =================================================================== --- trunk/numpy/ma/morestats.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/ma/morestats.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -59,7 +59,7 @@ Notes ----- The function is restricted to 2D arrays. - + """ def _hd_1D(data,prob,var): "Computes the HD quantiles for a 1D array. Returns nan for invalid data." @@ -114,7 +114,7 @@ Axis along which to compute the quantiles. If None, use a flattened array. var : boolean Whether to return the variance of the estimate. - + """ result = hdquantiles(data,[0.5], axis=axis, var=var) return result.squeeze() @@ -137,7 +137,7 @@ Notes ----- The function is restricted to 2D arrays. - + """ def _hdsd_1D(data,prob): "Computes the std error for 1D arrays." @@ -192,7 +192,7 @@ Confidence level of the intervals. axis : int Axis along which to cut. If None, uses a flattened version of the input. - + """ data = masked_array(data, copy=False) trimmed = trim_both(data, proportiontocut=proportiontocut, axis=axis) @@ -215,7 +215,7 @@ Sequence of quantiles to compute. axis : int Axis along which to compute the quantiles. If None, use a flattened array. - + """ def _mjci_1D(data, p): data = data.compressed() @@ -345,7 +345,7 @@ along the given axis. If some values are tied, their rank is averaged. - If some values are masked, their rank is set to 0 if use_missing is False, + If some values are masked, their rank is set to 0 if use_missing is False, or set to the average rank of the unmasked values if use_missing is True. Parameters @@ -353,8 +353,8 @@ data : sequence Input data. The data is transformed to a masked array axis : integer - Axis along which to perform the ranking. - If None, the array is first flattened. An exception is raised if + Axis along which to perform the ranking. + If None, the array is first flattened. An exception is raised if the axis is specified for arrays with a dimension larger than 2 use_missing : boolean Whether the masked values have a rank of 0 (False) or equal to the Modified: trunk/numpy/ma/mrecords.py =================================================================== --- trunk/numpy/ma/mrecords.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/ma/mrecords.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -142,7 +142,7 @@ msg = "Mask and data not compatible: data size is %i, "+\ "mask size is %i." raise MAError(msg % (nd, nm)) - copy = True + copy = True if not keep_mask: self.__setmask__(mask) self._sharedmask = True @@ -214,7 +214,7 @@ def _getmask(self): """Return the mask of the mrecord. A record is masked when all the fields are masked. - + """ if self.size > 1: return self._fieldmask.view((bool_, len(self.dtype))).all(1) @@ -415,7 +415,7 @@ return ndarray.view(self, obj) #...................................................... def filled(self, fill_value=None): - """Returns an array of the same class as the _data part, where masked + """Returns an array of the same class as the _data part, where masked values are filled with fill_value. If fill_value is None, self.fill_value is used instead. @@ -487,11 +487,11 @@ self._fieldmask.tostring(), self._fill_value, ) - return state + return state # def __setstate__(self, state): - """Restore the internal state of the masked array, for pickling purposes. - ``state`` is typically the output of the ``__getstate__`` output, and is a + """Restore the internal state of the masked array, for pickling purposes. + ``state`` is typically the output of the ``__getstate__`` output, and is a 5-tuple: - class name @@ -570,8 +570,8 @@ """ datalist = [getdata(x) for x in arraylist] masklist = [getmaskarray(x) for x in arraylist] - _array = recfromarrays(datalist, - dtype=dtype, shape=shape, formats=formats, + _array = recfromarrays(datalist, + dtype=dtype, shape=shape, formats=formats, names=names, titles=titles, aligned=aligned, byteorder=byteorder).view(mrecarray) _array._fieldmask[:] = zip(*masklist) @@ -629,8 +629,8 @@ if dtype is None: dtype = reclist.dtype reclist = reclist.tolist() - mrec = recfromrecords(reclist, dtype=dtype, shape=shape, formats=formats, - names=names, titles=titles, + mrec = recfromrecords(reclist, dtype=dtype, shape=shape, formats=formats, + names=names, titles=titles, aligned=aligned, byteorder=byteorder).view(mrecarray) # Set the fill_value if needed if fill_value is not None: @@ -805,5 +805,3 @@ import cPickle _ = cPickle.dumps(mbase) mrec_ = cPickle.loads(_) - - \ No newline at end of file Modified: trunk/numpy/ma/mstats.py =================================================================== --- trunk/numpy/ma/mstats.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/ma/mstats.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -33,9 +33,9 @@ def winsorize(data, alpha=0.2): """Returns a Winsorized version of the input array. - - The (alpha/2.) lowest values are set to the (alpha/2.)th percentile, - and the (alpha/2.) highest values are set to the (1-alpha/2.)th + + The (alpha/2.) lowest values are set to the (alpha/2.)th percentile, + and the (alpha/2.) highest values are set to the (1-alpha/2.)th percentile. Masked values are skipped. @@ -44,7 +44,7 @@ data : ndarray Input data to Winsorize. The data is first flattened. alpha : float - Percentage of total Winsorization: alpha/2. on the left, + Percentage of total Winsorization: alpha/2. on the left, alpha/2. on the right """ @@ -57,8 +57,8 @@ #.............................................................................. def trim_both(data, proportiontocut=0.2, axis=None): - """Trims the data by masking the int(trim*n) smallest and int(trim*n) - largest values of data along the given axis, where n is the number + """Trims the data by masking the int(trim*n) smallest and int(trim*n) + largest values of data along the given axis, where n is the number of unmasked values. Parameters @@ -66,11 +66,11 @@ data : ndarray Data to trim. proportiontocut : float - Percentage of trimming. If n is the number of unmasked values + Percentage of trimming. If n is the number of unmasked values before trimming, the number of values after trimming is: (1-2*trim)*n. axis : int - Axis along which to perform the trimming. + Axis along which to perform the trimming. If None, the input array is first flattened. Notes @@ -99,7 +99,7 @@ #.............................................................................. def trim_tail(data, proportiontocut=0.2, tail='left', axis=None): - """Trims the data by masking int(trim*n) values from ONE tail of the + """Trims the data by masking int(trim*n) values from ONE tail of the data along the given axis, where n is the number of unmasked values. Parameters @@ -107,16 +107,16 @@ data : ndarray Data to trim. proportiontocut : float - Percentage of trimming. If n is the number of unmasked values - before trimming, the number of values after trimming is + Percentage of trimming. If n is the number of unmasked values + before trimming, the number of values after trimming is (1-trim)*n. tail : string - Trimming direction, in ('left', 'right'). - If left, the ``proportiontocut`` lowest values are set to the - corresponding percentile. If right, the ``proportiontocut`` + Trimming direction, in ('left', 'right'). + If left, the ``proportiontocut`` lowest values are set to the + corresponding percentile. If right, the ``proportiontocut`` highest values are used instead. axis : int - Axis along which to perform the trimming. + Axis along which to perform the trimming. If None, the input array is first flattened. Notes @@ -158,7 +158,7 @@ #.............................................................................. def trimmed_mean(data, proportiontocut=0.2, axis=None): - """Returns the trimmed mean of the data along the given axis. + """Returns the trimmed mean of the data along the given axis. Trimming is performed on both ends of the distribution. Parameters @@ -169,7 +169,7 @@ Proportion of the data to cut from each side of the data . As a result, (2*proportiontocut*n) values are actually trimmed. axis : int - Axis along which to perform the trimming. + Axis along which to perform the trimming. If None, the input array is first flattened. """ @@ -188,7 +188,7 @@ Proportion of the data to cut from each side of the data . As a result, (2*proportiontocut*n) values are actually trimmed. axis : int - Axis along which to perform the trimming. + Axis along which to perform the trimming. If None, the input array is first flattened. Notes @@ -222,7 +222,7 @@ data : ndarray Data to trim. axis : int - Axis along which to perform the trimming. + Axis along which to perform the trimming. If None, the input array is first flattened. """ Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/ma/tests/test_core.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -848,9 +848,9 @@ assert_equal(xf.dtype, float_) assert_equal(xs.data, ['A', 'b', 'pi']) assert_equal(xs.dtype, '|S3') - + #............................................................................... class TestUfuncs(NumpyTestCase): Modified: trunk/numpy/ma/tests/test_extras.py =================================================================== --- trunk/numpy/ma/tests/test_extras.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/ma/tests/test_extras.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -324,7 +324,7 @@ return b[1] xa = apply_along_axis(myfunc,2,a) assert_equal(xa,[[1,4],[7,10]]) - + class TestMedian(NumpyTestCase): def __init__(self, *args, **kwds): NumpyTestCase.__init__(self, *args, **kwds) @@ -333,7 +333,7 @@ "Tests median w/ 2D" (n,p) = (101,30) x = masked_array(numpy.linspace(-1.,1.,n),) - x[:10] = x[-10:] = masked + x[:10] = x[-10:] = masked z = masked_array(numpy.empty((n,p), dtype=numpy.float_)) z[:,0] = x[:] idx = numpy.arange(len(x)) @@ -352,9 +352,9 @@ assert_equal(median(x,0),[[99,10],[11,99],[13,14]]) x = numpy.ma.arange(24).reshape(4,3,2) x[x%5==0] = masked - assert_equal(median(x,0), [[12,10],[8,9],[16,17]]) - + assert_equal(median(x,0), [[12,10],[8,9],[16,17]]) + ############################################################################### #------------------------------------------------------------------------------ if __name__ == "__main__": Modified: trunk/numpy/ma/tests/test_mrecords.py =================================================================== --- trunk/numpy/ma/tests/test_mrecords.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/ma/tests/test_mrecords.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -41,7 +41,7 @@ ddtype = [('a',int),('b',float),('c','|S8')] mask = [0,1,0,0,1] self.base = ma.array(zip(ilist,flist,slist), mask=mask, dtype=ddtype) - + def test_byview(self): "Test creation by view" base = self.base @@ -69,7 +69,7 @@ assert_equal(mbase_first.mask, nomask) assert_equal(mbase_first._fieldmask.item(), (False, False, False)) assert_equal(mbase_first['a'], mbase['a'][0]) - mbase_last = mbase[-1] + mbase_last = mbase[-1] assert isinstance(mbase_last, mrecarray) assert_equal(mbase_last.dtype, mbase.dtype) assert_equal(mbase_last.tolist(), (None,None,None)) @@ -87,7 +87,7 @@ assert_equal(getattr(mbase_sl,field), base[:2][field]) def test_set_fields(self): - "Tests setting fields." + "Tests setting fields." base = self.base.copy() mbase = base.view(mrecarray) mbase = mbase.copy() @@ -101,7 +101,7 @@ assert_equal(mbase['a']._data, [1]*5) assert_equal(ma.getmaskarray(mbase['a']), [0]*5) assert_equal(mbase._mask, [False]*5) - assert_equal(mbase._fieldmask.tolist(), + assert_equal(mbase._fieldmask.tolist(), np.array([(0,0,0),(0,1,1),(0,0,0),(0,0,0),(0,1,1)], dtype=bool)) # Set a field to mask ........................ @@ -109,7 +109,7 @@ assert_equal(mbase.c.mask, [1]*5) assert_equal(ma.getmaskarray(mbase['c']), [1]*5) assert_equal(ma.getdata(mbase['c']), ['N/A']*5) - assert_equal(mbase._fieldmask.tolist(), + assert_equal(mbase._fieldmask.tolist(), np.array([(0,0,1),(0,1,1),(0,0,1),(0,0,1),(0,1,1)], dtype=bool)) # Set fields by slices ....................... @@ -129,12 +129,12 @@ assert_equal(ma.getmaskarray(mbase['b']), [1]*5) assert_equal(mbase['a']._mask, mbase['b']._mask) assert_equal(mbase['a']._mask, mbase['c']._mask) - assert_equal(mbase._fieldmask.tolist(), + assert_equal(mbase._fieldmask.tolist(), np.array([(1,1,1)]*5, dtype=bool)) # Delete the mask ............................ mbase._mask = nomask assert_equal(ma.getmaskarray(mbase['c']), [0]*5) - assert_equal(mbase._fieldmask.tolist(), + assert_equal(mbase._fieldmask.tolist(), np.array([(0,0,0)]*5, dtype=bool)) # def test_set_mask_fromarray(self): @@ -154,7 +154,7 @@ def test_set_mask_fromfields(self): mbase = self.base.copy().view(mrecarray) # - nmask = np.array([(0,1,0),(0,1,0),(1,0,1),(1,0,1),(0,0,0)], + nmask = np.array([(0,1,0),(0,1,0),(1,0,1),(1,0,1),(0,0,0)], dtype=[('a',bool),('b',bool),('c',bool)]) mbase.mask = nmask assert_equal(mbase.a.mask, [0,0,1,1,0]) @@ -240,8 +240,8 @@ _b = ma.array([1.1,2.2,3.3],mask=[0,0,1],dtype=float) _c = ma.array(['one','two','three'],mask=[0,0,1],dtype='|S8') ddtype = [('a',int),('b',float),('c','|S8')] - mrec = fromarrays([_a,_b,_c], dtype=ddtype, - fill_value=(99999,99999.,'N/A')) + mrec = fromarrays([_a,_b,_c], dtype=ddtype, + fill_value=(99999,99999.,'N/A')) mrecfilled = mrec.filled() assert_equal(mrecfilled['a'], np.array((1,2,99999), dtype=int)) assert_equal(mrecfilled['b'], np.array((1.1,2.2,99999.), dtype=float)) @@ -253,8 +253,8 @@ _b = ma.array([1.1,2.2,3.3],mask=[0,0,1],dtype=float) _c = ma.array(['one','two','three'],mask=[1,0,0],dtype='|S8') ddtype = [('a',int),('b',float),('c','|S8')] - mrec = fromarrays([_a,_b,_c], dtype=ddtype, - fill_value=(99999,99999.,'N/A')) + mrec = fromarrays([_a,_b,_c], dtype=ddtype, + fill_value=(99999,99999.,'N/A')) # assert_equal(mrec.tolist(), [(1,1.1,None),(2,2.2,'two'),(None,None,'three')]) @@ -272,11 +272,11 @@ _b = ma.array([1.1,2.2,3.3],mask=[0,0,1],dtype=float) _c = ma.array(['one','two','three'],mask=[0,0,1],dtype='|S8') ddtype = [('a',int),('b',float),('c','|S8')] - mrec = fromarrays([_a,_b,_c], dtype=ddtype, - fill_value=(99999,99999.,'N/A')) + mrec = fromarrays([_a,_b,_c], dtype=ddtype, + fill_value=(99999,99999.,'N/A')) nrec = recfromarrays((_a.data,_b.data,_c.data), dtype=ddtype) self.data = (mrec, nrec, ddtype) - + def test_fromarrays(self): _a = ma.array([1,2,3],mask=[0,0,1],dtype=int) _b = ma.array([1.1,2.2,3.3],mask=[0,0,1],dtype=float) @@ -284,8 +284,8 @@ (mrec, nrec, _) = self.data for (f,l) in zip(('a','b','c'),(_a,_b,_c)): assert_equal(getattr(mrec,f)._mask, l._mask) - - + + def test_fromrecords(self): "Test construction from records." (mrec, nrec, ddtype) = self.data @@ -300,7 +300,7 @@ _mrec = fromrecords(nrec) assert_equal(_mrec.dtype, mrec.dtype) for field in _mrec.dtype.names: - assert_equal(getattr(_mrec, field), getattr(mrec._data, field)) + assert_equal(getattr(_mrec, field), getattr(mrec._data, field)) # _mrec = fromrecords(nrec.tolist(), names='c1,c2,c3') assert_equal(_mrec.dtype, [('c1',int),('c2',float),('c3','|S5')]) @@ -311,7 +311,7 @@ assert_equal(_mrec.dtype, mrec.dtype) assert_equal_records(_mrec._data, mrec.filled()) assert_equal_records(_mrec._fieldmask, mrec._fieldmask) - + def test_fromrecords_wmask(self): "Tests construction from records w/ mask." (mrec, nrec, ddtype) = self.data @@ -328,7 +328,7 @@ assert_equal_records(_mrec._data, mrec._data) assert_equal(_mrec._fieldmask.tolist(), mrec._fieldmask.tolist()) # - _mrec = fromrecords(nrec.tolist(), dtype=ddtype, + _mrec = fromrecords(nrec.tolist(), dtype=ddtype, mask=mrec._fieldmask.tolist()) assert_equal_records(_mrec._data, mrec._data) assert_equal(_mrec._fieldmask.tolist(), mrec._fieldmask.tolist()) Modified: trunk/numpy/ma/testutils.py =================================================================== --- trunk/numpy/ma/testutils.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/ma/testutils.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -216,4 +216,4 @@ assert_array_equal(m1, m2) if __name__ == '__main__': - pass \ No newline at end of file + pass Modified: trunk/numpy/oldnumeric/compat.py =================================================================== --- trunk/numpy/oldnumeric/compat.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/oldnumeric/compat.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -88,7 +88,7 @@ dstr = fp.read(sz) m = mu.fromstring(dstr, typeconv.convtypecode(typecode)) m.shape = shape - + if (LittleEndian and endian == 'B') or (not LittleEndian and endian == 'L'): return m.byteswap(True) else: @@ -97,10 +97,10 @@ import pickle, copy class Unpickler(pickle.Unpickler): def load_array(self): - self.stack.append(_LoadArray(self)) + self.stack.append(_LoadArray(self)) dispatch = copy.copy(pickle.Unpickler.dispatch) - dispatch['A'] = load_array + dispatch['A'] = load_array class Pickler(pickle.Pickler): def __init__(self, *args, **kwds): Modified: trunk/numpy/oldnumeric/ma.py =================================================================== --- trunk/numpy/oldnumeric/ma.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/oldnumeric/ma.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -2265,5 +2265,3 @@ def take(a, indices, axis=0): return new_take(a, indices, axis) - - Modified: trunk/numpy/testing/utils.py =================================================================== --- trunk/numpy/testing/utils.py 2008-04-20 11:24:30 UTC (rev 5054) +++ trunk/numpy/testing/utils.py 2008-04-20 11:49:35 UTC (rev 5055) @@ -311,7 +311,7 @@ # Anything else. raise else: - raise AssertionError('%s() did not raise one of (%s)' % + raise AssertionError('%s() did not raise one of (%s)' % (function.__name__, ', '.join([e.__name__ for e in exceptions]))) try: f2.__name__ = function.__name__ From numpy-svn at scipy.org Sun Apr 20 18:58:25 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 20 Apr 2008 17:58:25 -0500 (CDT) Subject: [Numpy-svn] r5056 - in trunk/numpy/ma: . tests Message-ID: <20080420225825.6C1AB39C07A@new.scipy.org> Author: pierregm Date: 2008-04-20 17:58:22 -0500 (Sun, 20 Apr 2008) New Revision: 5056 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/mrecords.py trunk/numpy/ma/tests/test_core.py Log: mrecords: clean-up core: MaskedArray.__setitem__ : when hardmask is False, force the data to be updated before the mask. core: MaskedArray.round_ : fixed to keep the dates on TimeSeries core: round : simplified Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-04-20 11:49:35 UTC (rev 5055) +++ trunk/numpy/ma/core.py 2008-04-20 22:58:22 UTC (rev 5056) @@ -1363,17 +1363,22 @@ return #.... dval = narray(value, copy=False, dtype=self.dtype) - valmask = getmask(value) + valmask = getmask(value) if self._mask is nomask: + # Set the data, then the mask + ndarray.__setitem__(self._data,indx,dval) if valmask is not nomask: self._mask = numpy.zeros(self.shape, dtype=MaskType) self._mask[indx] = valmask elif not self._hardmask: # Unshare the mask if necessary to avoid propagation self.unshare_mask() + # Set the data, then the mask + ndarray.__setitem__(self._data,indx,dval) self._mask[indx] = valmask elif hasattr(indx, 'dtype') and (indx.dtype==bool_): indx = indx * umath.logical_not(self._mask) + ndarray.__setitem__(self._data,indx,dval) else: mindx = mask_or(self._mask[indx], valmask, copy=True) dindx = self._data[indx] @@ -1381,10 +1386,8 @@ dindx[~mindx] = dval elif mindx is nomask: dindx = dval - dval = dindx + ndarray.__setitem__(self._data,indx,dindx) self._mask[indx] = mindx - # Set data .......... - ndarray.__setitem__(self._data,indx,dval) #............................................ def __getslice__(self, i, j): """x.__getslice__(i, j) <==> x[i:j] @@ -2228,6 +2231,7 @@ def round(self, decimals=0, out=None): result = self._data.round(decimals).view(type(self)) result._mask = self._mask + result._update_from(self) if out is None: return result out[:] = result @@ -3174,13 +3178,7 @@ """ if out is None: - result = numpy.round_(getdata(a), decimals, out) - if isinstance(a,MaskedArray): - result = result.view(type(a)) - result._mask = a._mask - else: - result = result.view(MaskedArray) - return result + return numpy.round_(a, decimals, out) else: numpy.round_(getdata(a), decimals, out) if hasattr(out, '_mask'): Modified: trunk/numpy/ma/mrecords.py =================================================================== --- trunk/numpy/ma/mrecords.py 2008-04-20 11:49:35 UTC (rev 5055) +++ trunk/numpy/ma/mrecords.py 2008-04-20 22:58:22 UTC (rev 5056) @@ -789,19 +789,4 @@ return newdata ############################################################################### -# -if 1: - import numpy.ma as ma - from numpy.ma.testutils import * - if 1: - ilist = [1,2,3,4,5] - flist = [1.1,2.2,3.3,4.4,5.5] - slist = ['one','two','three','four','five'] - ddtype = [('a',int),('b',float),('c','|S8')] - mask = [0,1,0,0,1] - self_base = ma.array(zip(ilist,flist,slist), mask=mask, dtype=ddtype) - if 1: - mbase = self_base.copy().view(mrecarray) - import cPickle - _ = cPickle.dumps(mbase) - mrec_ = cPickle.loads(_) + Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-04-20 11:49:35 UTC (rev 5055) +++ trunk/numpy/ma/tests/test_core.py 2008-04-20 22:58:22 UTC (rev 5056) @@ -609,6 +609,14 @@ #........................ def test_oddfeatures_3(self): """Tests some generic features.""" + atest = array([10], mask=True) + btest = array([20]) + idx = atest.mask + atest[idx] = btest[idx] + assert_equal(atest,[20]) + #........................ + def test_oddfeatures_4(self): + """Tests some generic features.""" atest = ones((10,10,10), dtype=float_) btest = zeros(atest.shape, MaskType) ctest = masked_where(btest,atest) From numpy-svn at scipy.org Sun Apr 20 21:53:01 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 20 Apr 2008 20:53:01 -0500 (CDT) Subject: [Numpy-svn] r5057 - trunk/numpy/core/src Message-ID: <20080421015301.D5BFF39C017@new.scipy.org> Author: charris Date: 2008-04-20 20:52:59 -0500 (Sun, 20 Apr 2008) New Revision: 5057 Modified: trunk/numpy/core/src/ufuncobject.c Log: Generic loop cleanup. Cut and pasted from template generated file. Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2008-04-20 22:58:22 UTC (rev 5056) +++ trunk/numpy/core/src/ufuncobject.c 2008-04-21 01:52:59 UTC (rev 5057) @@ -25,33 +25,39 @@ */ -typedef double (DoubleBinaryFunc)(double x, double y); -typedef float (FloatBinaryFunc)(float x, float y); -typedef longdouble (LongdoubleBinaryFunc)(longdouble x, longdouble y); +#define USE_USE_DEFAULTS 1 -typedef void (CdoubleBinaryFunc)(cdouble *x, cdouble *y, cdouble *res); -typedef void (CfloatBinaryFunc)(cfloat *x, cfloat *y, cfloat *res); -typedef void (ClongdoubleBinaryFunc)(clongdouble *x, clongdouble *y, \ - clongdouble *res); -#define USE_USE_DEFAULTS 1 +/****************************************************************************** + * Generic Real Floating Type Loops + *****************************************************************************/ + +typedef double doubleUnaryFunc(double x); +typedef float floatUnaryFunc(float x); +typedef longdouble longdoubleUnaryFunc(longdouble x); +typedef double doubleBinaryFunc(double x, double y); +typedef float floatBinaryFunc(float x, float y); +typedef longdouble longdoubleBinaryFunc(longdouble x, longdouble y); + + /*UFUNC_API*/ static void -PyUFunc_ff_f_As_dd_d(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_f_f(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; - intp is2 = steps[1]; - intp os = steps[2]; + intp os = steps[1]; char *ip1 = args[0]; - char *ip2 = args[1]; - char *op = args[2]; + char *op = args[1]; + floatUnaryFunc *f = (floatUnaryFunc *)func; intp i; - for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { - *(float *)op = (float)((DoubleBinaryFunc *)func) - ((double)*(float *)ip1, (double)*(float *)ip2); + for(i = 0; i < n; i++, ip1 += is1, op += os) { + float *in1 = (float *)ip1; + float *out = (float *)op; + + *out = f(*in1); } } @@ -66,38 +72,41 @@ char *ip1 = args[0]; char *ip2 = args[1]; char *op = args[2]; + floatBinaryFunc *f = (floatBinaryFunc *)func; intp i; + for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { + float *in1 = (float *)ip1; + float *in2 = (float *)ip2; + float *out = (float *)op; - for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { - *(float *)op = ((FloatBinaryFunc *)func)(*(float *)ip1, - *(float *)ip2); + *out = f(*in1, *in2); } } /*UFUNC_API*/ static void -PyUFunc_dd_d(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_d_d(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; - intp is2 = steps[1]; - intp os = steps[2]; + intp os = steps[1]; char *ip1 = args[0]; - char *ip2 = args[1]; - char *op = args[2]; + char *op = args[1]; + doubleUnaryFunc *f = (doubleUnaryFunc *)func; intp i; + for(i = 0; i < n; i++, ip1 += is1, op += os) { + double *in1 = (double *)ip1; + double *out = (double *)op; - for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { - *(double *)op = ((DoubleBinaryFunc *)func) - (*(double *)ip1, *(double *)ip2); + *out = f(*in1); } } /*UFUNC_API*/ static void -PyUFunc_gg_g(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_dd_d(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; @@ -106,44 +115,41 @@ char *ip1 = args[0]; char *ip2 = args[1]; char *op = args[2]; + doubleBinaryFunc *f = (doubleBinaryFunc *)func; intp i; for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { - *(longdouble *)op = - ((LongdoubleBinaryFunc *)func)(*(longdouble *)ip1, - *(longdouble *)ip2); + double *in1 = (double *)ip1; + double *in2 = (double *)ip2; + double *out = (double *)op; + + *out = f(*in1, *in2); } } - /*UFUNC_API*/ static void -PyUFunc_FF_F_As_DD_D(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_g_g(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; - intp is2 = steps[1]; - intp os = steps[2]; + intp os = steps[1]; char *ip1 = args[0]; - char *ip2 = args[1]; - char *op = args[2]; + char *op = args[1]; + longdoubleUnaryFunc *f = (longdoubleUnaryFunc *)func; intp i; - cdouble x, y, r; - for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { - x.real = ((float *)ip1)[0]; - x.imag = ((float *)ip1)[1]; - y.real = ((float *)ip2)[0]; - y.imag = ((float *)ip2)[1]; - ((CdoubleBinaryFunc *)func)(&x, &y, &r); - ((float *)op)[0] = (float)r.real; - ((float *)op)[1] = (float)r.imag; + for(i = 0; i < n; i++, ip1 += is1, op += os) { + longdouble *in1 = (longdouble *)ip1; + longdouble *out = (longdouble *)op; + + *out = f(*in1); } } /*UFUNC_API*/ static void -PyUFunc_DD_D(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_gg_g(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; @@ -152,48 +158,41 @@ char *ip1 = args[0]; char *ip2 = args[1]; char *op = args[2]; + longdoubleBinaryFunc *f = (longdoubleBinaryFunc *)func; intp i; - cdouble x,y,r; for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { - x.real = ((double *)ip1)[0]; - x.imag = ((double *)ip1)[1]; - y.real = ((double *)ip2)[0]; - y.imag = ((double *)ip2)[1]; - ((CdoubleBinaryFunc *)func)(&x, &y, &r); - ((double *)op)[0] = r.real; - ((double *)op)[1] = r.imag; + longdouble *in1 = (longdouble *)ip1; + longdouble *in2 = (longdouble *)ip2; + longdouble *out = (longdouble *)op; + + *out = f(*in1, *in2); } } /*UFUNC_API*/ static void -PyUFunc_FF_F(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_f_f_As_d_d(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; - intp is2 = steps[1]; - intp os = steps[2]; + intp os = steps[1]; char *ip1 = args[0]; - char *ip2 = args[1]; - char *op = args[2]; + char *op = args[1]; + doubleUnaryFunc *f = (doubleUnaryFunc *)func; intp i; - cfloat x,y,r; - for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { - x.real = ((float *)ip1)[0]; - x.imag = ((float *)ip1)[1]; - y.real = ((float *)ip2)[0]; - y.imag = ((float *)ip2)[1]; - ((CfloatBinaryFunc *)func)(&x, &y, &r); - ((float *)op)[0] = r.real; - ((float *)op)[1] = r.imag; + for(i = 0; i < n; i++, ip1 += is1, op += os) { + float *in1 = (float *)ip1; + float *out = (float *)op; + + *out = (float)f((double)*in1); } } /*UFUNC_API*/ static void -PyUFunc_GG_G(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_ff_f_As_dd_d(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; @@ -202,57 +201,60 @@ char *ip1 = args[0]; char *ip2 = args[1]; char *op = args[2]; + doubleBinaryFunc *f = (doubleBinaryFunc *)func; intp i; - clongdouble x,y,r; for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { - x.real = ((longdouble *)ip1)[0]; - x.imag = ((longdouble *)ip1)[1]; - y.real = ((longdouble *)ip2)[0]; - y.imag = ((longdouble *)ip2)[1]; - ((ClongdoubleBinaryFunc *)func)(&x, &y, &r); - ((longdouble *)op)[0] = r.real; - ((longdouble *)op)[1] = r.imag; + float *in1 = (float *)ip1; + float *in2 = (float *)ip2; + float *out = (float *)op; + + *out = (float)f((double)*in1, (double)*in2); } } + +/****************************************************************************** + * Generic Complex Floating Type Loops + *****************************************************************************/ + + +typedef void cdoubleUnaryFunc(cdouble *x, cdouble *r); +typedef void cfloatUnaryFunc(cfloat *x, cfloat *r); +typedef void clongdoubleUnaryFunc(clongdouble *x, clongdouble *r); +typedef void cdoubleBinaryFunc(cdouble *x, cdouble *y, cdouble *r); +typedef void cfloatBinaryFunc(cfloat *x, cfloat *y, cfloat *r); +typedef void clongdoubleBinaryFunc(clongdouble *x, clongdouble *y, + clongdouble *r); + /*UFUNC_API*/ static void -PyUFunc_OO_O(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_F_F(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; - intp is2 = steps[1]; - intp os = steps[2]; + intp os = steps[1]; char *ip1 = args[0]; - char *ip2 = args[1]; - char *op = args[2]; + char *op = args[1]; + cfloatUnaryFunc *f = (cfloatUnaryFunc *)func; intp i; - PyObject *tmp, *x1, *x2; - for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { - x1 = *((PyObject **)ip1); - x2 = *((PyObject **)ip2); - if ((x1 == NULL) || (x2 == NULL)) { - return; - } - if ( (void *) func == (void *) PyNumber_Power) { - tmp = ((ternaryfunc)func)(x1, x2, Py_None); - } - else { - tmp = ((binaryfunc)func)(x1, x2); - } - if (PyErr_Occurred()) { - return; - } - Py_XDECREF(*((PyObject **)op)); - *((PyObject **)op) = tmp; + for(i = 0; i < n; i++, ip1 += is1, op += os) { + float *in1 = (float *)ip1; + float *out = (float *)op; + cfloat x, r; + + x.real = in1[0]; + x.imag = in1[1]; + f(&x, &r); + out[0] = r.real; + out[1] = r.imag; } } /*UFUNC_API*/ static void -PyUFunc_OO_O_method(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_FF_F(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; @@ -261,224 +263,304 @@ char *ip1 = args[0]; char *ip2 = args[1]; char *op = args[2]; - char *meth = (char *)func; + cfloatBinaryFunc *f = (cfloatBinaryFunc *)func; intp i; for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { - PyObject *in1 = *(PyObject **)ip1; - PyObject *in2 = *(PyObject **)ip2; - PyObject **out = (PyObject **)op; - PyObject *ret = PyObject_CallMethod(in1, meth, "(O)", in2); + float *in1 = (float *)ip1; + float *in2 = (float *)ip2; + float *out = (float *)op; + cfloat x,y,r; - if (ret == NULL) { - return; - } - Py_XDECREF(*out); - *out = ret; + x.real = in1[0]; + x.imag = in1[1]; + y.real = in2[0]; + y.imag = in2[1]; + f(&x, &y, &r); + out[0] = r.real; + out[1] = r.imag; } } -typedef double DoubleUnaryFunc(double x); -typedef float FloatUnaryFunc(float x); -typedef longdouble LongdoubleUnaryFunc(longdouble x); -typedef void CdoubleUnaryFunc(cdouble *x, cdouble *res); -typedef void CfloatUnaryFunc(cfloat *x, cfloat *res); -typedef void ClongdoubleUnaryFunc(clongdouble *x, clongdouble *res); - /*UFUNC_API*/ static void -PyUFunc_f_f_As_d_d(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_D_D(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; - intp is2 = steps[1]; + intp os = steps[1]; char *ip1 = args[0]; char *op = args[1]; + cdoubleUnaryFunc *f = (cdoubleUnaryFunc *)func; intp i; - for(i = 0; i < n; i++, ip1 += is1, op += is2) { - *(float *)op = (float)((DoubleUnaryFunc *)func)((double)*(float *)ip1); + for(i = 0; i < n; i++, ip1 += is1, op += os) { + double *in1 = (double *)ip1; + double *out = (double *)op; + cdouble x, r; + + x.real = in1[0]; + x.imag = in1[1]; + f(&x, &r); + out[0] = r.real; + out[1] = r.imag; } } /*UFUNC_API*/ static void -PyUFunc_d_d(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_DD_D(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; intp is2 = steps[1]; + intp os = steps[2]; char *ip1 = args[0]; - char *op = args[1]; + char *ip2 = args[1]; + char *op = args[2]; + cdoubleBinaryFunc *f = (cdoubleBinaryFunc *)func; intp i; - for(i = 0; i < n; i++, ip1 += is1, op += is2) { - *(double *)op = ((DoubleUnaryFunc *)func)(*(double *)ip1); + for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { + double *in1 = (double *)ip1; + double *in2 = (double *)ip2; + double *out = (double *)op; + cdouble x,y,r; + + x.real = in1[0]; + x.imag = in1[1]; + y.real = in2[0]; + y.imag = in2[1]; + f(&x, &y, &r); + out[0] = r.real; + out[1] = r.imag; } } /*UFUNC_API*/ static void -PyUFunc_f_f(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_G_G(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; - intp is2 = steps[1]; + intp os = steps[1]; char *ip1 = args[0]; char *op = args[1]; + clongdoubleUnaryFunc *f = (clongdoubleUnaryFunc *)func; intp i; - for(i = 0; i < n; i++, ip1 += is1, op += is2) { - *(float *)op = ((FloatUnaryFunc *)func)(*(float *)ip1); + for(i = 0; i < n; i++, ip1 += is1, op += os) { + longdouble *in1 = (longdouble *)ip1; + longdouble *out = (longdouble *)op; + clongdouble x, r; + + x.real = in1[0]; + x.imag = in1[1]; + f(&x, &r); + out[0] = r.real; + out[1] = r.imag; } } /*UFUNC_API*/ static void -PyUFunc_g_g(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_GG_G(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; intp is2 = steps[1]; + intp os = steps[2]; char *ip1 = args[0]; - char *op = args[1]; + char *ip2 = args[1]; + char *op = args[2]; + clongdoubleBinaryFunc *f = (clongdoubleBinaryFunc *)func; intp i; - for(i = 0; i < n; i++, ip1 += is1, op += is2) { - *(longdouble *)op = ((LongdoubleUnaryFunc *)func)\ - (*(longdouble *)ip1); + for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { + longdouble *in1 = (longdouble *)ip1; + longdouble *in2 = (longdouble *)ip2; + longdouble *out = (longdouble *)op; + clongdouble x,y,r; + + x.real = in1[0]; + x.imag = in1[1]; + y.real = in2[0]; + y.imag = in2[1]; + f(&x, &y, &r); + out[0] = r.real; + out[1] = r.imag; } } - /*UFUNC_API*/ static void PyUFunc_F_F_As_D_D(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; - intp is2 = steps[1]; + intp os = steps[1]; char *ip1 = args[0]; char *op = args[1]; + cdoubleUnaryFunc *f = (cdoubleUnaryFunc *)func; intp i; - cdouble x, res; - for(i = 0; i < n; i++, ip1 += is1, op += is2) { - x.real = ((float *)ip1)[0]; - x.imag = ((float *)ip1)[1]; - ((CdoubleUnaryFunc *)func)(&x, &res); - ((float *)op)[0] = (float)res.real; - ((float *)op)[1] = (float)res.imag; + for(i = 0; i < n; i++, ip1 += is1, op += os) { + float *in1 = (float *)ip1; + float *out = (float *)op; + cdouble x, r; + + x.real = in1[0]; + x.imag = in1[1]; + f(&x, &r); + out[0] = (float)r.real; + out[1] = (float)r.imag; } } /*UFUNC_API*/ static void -PyUFunc_F_F(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_FF_F_As_DD_D(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; intp is2 = steps[1]; + intp os = steps[2]; char *ip1 = args[0]; - char *op = args[1]; + char *ip2 = args[1]; + char *op = args[2]; + cdoubleBinaryFunc *f = (cdoubleBinaryFunc *)func; intp i; - cfloat x, res; - for(i = 0; i < n; i++, ip1 += is1, op += is2) { - x.real = ((float *)ip1)[0]; - x.imag = ((float *)ip1)[1]; - ((CfloatUnaryFunc *)func)(&x, &res); - ((float *)op)[0] = res.real; - ((float *)op)[1] = res.imag; + for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { + float *in1 = (float *)ip1; + float *in2 = (float *)ip2; + float *out = (float *)op; + cdouble x,y,r; + + x.real = in1[0]; + x.imag = in1[1]; + y.real = in2[0]; + y.imag = in2[1]; + f(&x, &y, &r); + out[0] = (float)r.real; + out[1] = (float)r.imag; } } +/****************************************************************************** + * Generic Object Type Loops + *****************************************************************************/ + /*UFUNC_API*/ static void -PyUFunc_D_D(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_O_O(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; - intp is2 = steps[1]; + intp os = steps[1]; char *ip1 = args[0]; char *op = args[1]; + unaryfunc f = (unaryfunc)func; intp i; - cdouble x, res; - for(i = 0; i < n; i++, ip1 += is1, op += is2) { - x.real = ((double *)ip1)[0]; - x.imag = ((double *)ip1)[1]; - ((CdoubleUnaryFunc *)func)(&x, &res); - ((double *)op)[0] = res.real; - ((double *)op)[1] = res.imag; + for(i = 0; i < n; i++, ip1 += is1, op += os) { + PyObject *in1 = *(PyObject **)ip1; + PyObject **out = (PyObject **)op; + PyObject *ret; + + if (in1 == NULL) { + return; + } + ret = f(in1); + if ((ret == NULL) || PyErr_Occurred()) { + return; + } + Py_XDECREF(*out); + *out = ret; } } - /*UFUNC_API*/ static void -PyUFunc_G_G(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_O_O_method(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; - intp is2 = steps[1]; + intp os = steps[1]; char *ip1 = args[0]; char *op = args[1]; + char *meth = (char *)func; intp i; - clongdouble x, res; - for(i = 0; i < n; i++, ip1 += is1, op += is2) { - x.real = ((longdouble *)ip1)[0]; - x.imag = ((longdouble *)ip1)[1]; - ((ClongdoubleUnaryFunc *)func)(&x, &res); - ((longdouble *)op)[0] = res.real; - ((longdouble *)op)[1] = res.imag; + for(i = 0; i < n; i++, ip1 += is1, op += os) { + PyObject *in1 = *(PyObject **)ip1; + PyObject **out = (PyObject **)op; + PyObject *ret = PyObject_CallMethod(in1, meth, NULL); + + if (ret == NULL) { + return; + } + Py_XDECREF(*out); + *out = ret; } } /*UFUNC_API*/ static void -PyUFunc_O_O(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_OO_O(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; intp is2 = steps[1]; + intp os = steps[2]; char *ip1 = args[0]; - char *op = args[1]; + char *ip2 = args[1]; + char *op = args[2]; intp i; - PyObject *tmp, *x1; - for(i = 0; i < n; i++, ip1 += is1, op += is2) { - x1 = *(PyObject **)ip1; - if (x1 == NULL) { + for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { + PyObject *in1 = *(PyObject **)ip1; + PyObject *in2 = *(PyObject **)ip2; + PyObject **out = (PyObject **)op; + PyObject *ret; + + if ((in1 == NULL) || (in2 == NULL)) { return; } - tmp = ((unaryfunc)func)(x1); - if ((tmp==NULL) || PyErr_Occurred()) { + if ( (void *) func == (void *) PyNumber_Power) { + ret = ((ternaryfunc)func)(in1, in2, Py_None); + } + else { + ret = ((binaryfunc)func)(in1, in2); + } + if (PyErr_Occurred()) { return; } - Py_XDECREF(*((PyObject **)op)); - *((PyObject **)op) = tmp; + Py_XDECREF(*out); + *out = ret; } } /*UFUNC_API*/ static void -PyUFunc_O_O_method(char **args, intp *dimensions, intp *steps, void *func) +PyUFunc_OO_O_method(char **args, intp *dimensions, intp *steps, void *func) { intp n = dimensions[0]; intp is1 = steps[0]; intp is2 = steps[1]; + intp os = steps[2]; char *ip1 = args[0]; - char *op = args[1]; + char *ip2 = args[1]; + char *op = args[2]; char *meth = (char *)func; intp i; - for(i = 0; i < n; i++, ip1 += is1, op += is2) { + for(i = 0; i < n; i++, ip1 += is1, ip2 += is2, op += os) { PyObject *in1 = *(PyObject **)ip1; + PyObject *in2 = *(PyObject **)ip2; PyObject **out = (PyObject **)op; - PyObject *ret = PyObject_CallMethod(in1, meth, NULL); + PyObject *ret = PyObject_CallMethod(in1, meth, "(O)", in2); if (ret == NULL) { return; @@ -488,7 +570,6 @@ } } - /* * A general-purpose ufunc that deals with general-purpose Python callable. * func is a structure with nin, nout, and a Python callable function @@ -498,15 +579,15 @@ static void PyUFunc_On_Om(char **args, intp *dimensions, intp *steps, void *func) { - intp i, j; - intp n=dimensions[0]; + intp n = dimensions[0]; PyUFunc_PyFuncData *data = (PyUFunc_PyFuncData *)func; - int nin = data->nin, nout=data->nout; - int ntot; + int nin = data->nin; + int nout = data->nout; PyObject *tocall = data->callable; char *ptrs[NPY_MAXARGS]; PyObject *arglist, *result; PyObject *in, **op; + intp i, j, ntot; ntot = nin+nout; @@ -558,7 +639,6 @@ - /* ---------------------------------------------------------------- */ From numpy-svn at scipy.org Mon Apr 21 06:14:38 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 21 Apr 2008 05:14:38 -0500 (CDT) Subject: [Numpy-svn] r5058 - trunk/numpy/core Message-ID: <20080421101438.7F3A839C1A4@new.scipy.org> Author: cdavid Date: 2008-04-21 05:14:30 -0500 (Mon, 21 Apr 2008) New Revision: 5058 Modified: trunk/numpy/core/SConstruct Log: Expand tab in core scons script. Modified: trunk/numpy/core/SConstruct =================================================================== --- trunk/numpy/core/SConstruct 2008-04-21 01:52:59 UTC (rev 5057) +++ trunk/numpy/core/SConstruct 2008-04-21 10:14:30 UTC (rev 5058) @@ -1,4 +1,4 @@ -# Last Change: Wed Mar 05 02:00 PM 2008 J +# Last Change: Mon Apr 21 07:00 PM 2008 J # vim:syntax=python import os import sys @@ -123,9 +123,9 @@ if st: st = config.CheckFunc(f, language = 'C') if st: - mfuncs_defined[f] = 1 + mfuncs_defined[f] = 1 else: - mfuncs_defined[f] = 0 + mfuncs_defined[f] = 0 for f in mfuncs: check_func(f) From numpy-svn at scipy.org Mon Apr 21 06:24:54 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 21 Apr 2008 05:24:54 -0500 (CDT) Subject: [Numpy-svn] r5059 - trunk/numpy/core Message-ID: <20080421102454.0043639C607@new.scipy.org> Author: cdavid Date: 2008-04-21 05:24:50 -0500 (Mon, 21 Apr 2008) New Revision: 5059 Modified: trunk/numpy/core/SConstruct Log: Do not specify target names for generated code, because it is not needed. Modified: trunk/numpy/core/SConstruct =================================================================== --- trunk/numpy/core/SConstruct 2008-04-21 10:14:30 UTC (rev 5058) +++ trunk/numpy/core/SConstruct 2008-04-21 10:24:50 UTC (rev 5059) @@ -64,23 +64,29 @@ # We check declaration AND type because that's how distutils does it. if config.CheckDeclaration('PY_LONG_LONG', includes = '#include \n'): - st = config.CheckTypeSize('PY_LONG_LONG', includes = '#include \n') + st = config.CheckTypeSize('PY_LONG_LONG', + includes = '#include \n') assert not st == 0 - numpyconfig_sym.append(('DEFINE_NPY_SIZEOF_LONGLONG', '#define NPY_SIZEOF_LONGLONG %d' % st)) - numpyconfig_sym.append(('DEFINE_NPY_SIZEOF_PY_LONG_LONG', '#define NPY_SIZEOF_PY_LONG_LONG %d' % st)) + numpyconfig_sym.append(('DEFINE_NPY_SIZEOF_LONGLONG', + '#define NPY_SIZEOF_LONGLONG %d' % st)) + numpyconfig_sym.append(('DEFINE_NPY_SIZEOF_PY_LONG_LONG', + '#define NPY_SIZEOF_PY_LONG_LONG %d' % st)) else: numpyconfig_sym.append(('DEFINE_NPY_SIZEOF_LONGLONG', '')) numpyconfig_sym.append(('DEFINE_NPY_SIZEOF_PY_LONG_LONG', '')) if not config.CheckDeclaration('CHAR_BIT', includes= '#include \n'): - raise RuntimeError("Config wo CHAR_BIT is not supported with scons: please contact the maintainer (cdavid)") + raise RuntimeError(\ +"""Config wo CHAR_BIT is not supported with scons: please contact the +maintainer (cdavid)""") #---------------------- # Checking signal stuff #---------------------- if is_npy_no_signal(): numpyconfig_sym.append(('DEFINE_NPY_NO_SIGNAL', '#define NPY_NO_SIGNAL\n')) - config.Define('__NPY_PRIVATE_NO_SIGNAL', comment = "define to 1 to disable SMP support ") + config.Define('__NPY_PRIVATE_NO_SIGNAL', + comment = "define to 1 to disable SMP support ") else: numpyconfig_sym.append(('DEFINE_NPY_NO_SIGNAL', '')) @@ -138,13 +144,16 @@ comment = 'Define to 1 if long double funcs are available') if mfuncs_defined['asinh'] == 1: config.Define('HAVE_INVERSE_HYPERBOLIC', - comment = 'Define to 1 if inverse hyperbolic funcs are available') + comment = 'Define to 1 if inverse hyperbolic funcs are '\ + 'available') if mfuncs_defined['atanhf'] == 1: config.Define('HAVE_INVERSE_HYPERBOLIC_FLOAT', - comment = 'Define to 1 if inverse hyperbolic float funcs are available') + comment = 'Define to 1 if inverse hyperbolic float funcs '\ + 'are available') if mfuncs_defined['atanhl'] == 1: config.Define('HAVE_INVERSE_HYPERBOLIC_LONGDOUBLE', - comment = 'Define to 1 if inverse hyperbolic long double funcs are available') + comment = 'Define to 1 if inverse hyperbolic long double '\ + 'funcs are available') #------------------------------------------------------- # Define the function PyOS_ascii_strod if not available @@ -163,7 +172,8 @@ if sys.platform=='win32' or os.name=='nt': from distutils.msvccompiler import get_build_architecture a = get_build_architecture() - print 'BUILD_ARCHITECTURE: %r, os.name=%r, sys.platform=%r' % (a, os.name, sys.platform) + print 'BUILD_ARCHITECTURE: %r, os.name=%r, sys.platform=%r' % \ + (a, os.name, sys.platform) if a == 'AMD64': distutils_use_sdk = 1 config.Define('DISTUTILS_USE_SDK', distutils_use_sdk, @@ -232,24 +242,15 @@ #------------------------ from os.path import join as pjoin -scalartypes_src = env.GenerateFromTemplate(pjoin('src', 'scalartypes'), - pjoin('src', 'scalartypes.inc.src')) +scalartypes_src = env.GenerateFromTemplate(pjoin('src', 'scalartypes.inc.src')) -arraytypes_src = env.GenerateFromTemplate( - pjoin('src', 'arraytypes'), - pjoin('src', 'arraytypes.inc.src')) +arraytypes_src = env.GenerateFromTemplate(pjoin('src', 'arraytypes.inc.src')) -sortmodule_src = env.GenerateFromTemplate( - pjoin('src', '_sortmodule'), - pjoin('src', '_sortmodule.c.src')) +sortmodule_src = env.GenerateFromTemplate(pjoin('src', '_sortmodule.c.src')) -umathmodule_src = env.GenerateFromTemplate( - pjoin('src', 'umathmodule'), - pjoin('src', 'umathmodule.c.src')) +umathmodule_src = env.GenerateFromTemplate(pjoin('src', 'umathmodule.c.src')) -scalarmathmodule_src = env.GenerateFromTemplate( - pjoin('src', 'scalarmathmodule'), - pjoin('src', 'scalarmathmodule.c.src')) +scalarmathmodule_src = env.GenerateFromTemplate(pjoin('src', 'scalarmathmodule.c.src')) umath = env.GenerateUmath('__umath_generated', pjoin('code_generators', 'generate_umath.py')) From numpy-svn at scipy.org Mon Apr 21 06:54:05 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 21 Apr 2008 05:54:05 -0500 (CDT) Subject: [Numpy-svn] r5060 - trunk/numpy/distutils/command Message-ID: <20080421105405.87B5C39C1A4@new.scipy.org> Author: cdavid Date: 2008-04-21 05:54:01 -0500 (Mon, 21 Apr 2008) New Revision: 5060 Modified: trunk/numpy/distutils/command/scons.py Log: Do not show the whole scons command for silent modes. Modified: trunk/numpy/distutils/command/scons.py =================================================================== --- trunk/numpy/distutils/command/scons.py 2008-04-21 10:24:50 UTC (rev 5059) +++ trunk/numpy/distutils/command/scons.py 2008-04-21 10:54:01 UTC (rev 5060) @@ -326,7 +326,10 @@ cmd.append('-s') cmd.append('silent=%d' % int(self.silent)) cmdstr = ' '.join(cmd) - log.info("Executing scons command (pkg is %s): %s ", pkg_name, cmdstr) + if int(self.silent) < 1: + log.info("Executing scons command (pkg is %s): %s ", pkg_name, cmdstr) + else: + log.info("Executing scons command for pkg %s", pkg_name) st = os.system(cmdstr) if st: print "status is %d" % st From numpy-svn at scipy.org Mon Apr 21 06:57:15 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 21 Apr 2008 05:57:15 -0500 (CDT) Subject: [Numpy-svn] r5061 - trunk/numpy/core Message-ID: <20080421105715.950EC39C612@new.scipy.org> Author: cdavid Date: 2008-04-21 05:57:11 -0500 (Mon, 21 Apr 2008) New Revision: 5061 Modified: trunk/numpy/core/SConstruct trunk/numpy/core/scons_support.py Log: Scons build: put builders creation into scons_support, and add action strings for silent modes. Modified: trunk/numpy/core/SConstruct =================================================================== --- trunk/numpy/core/SConstruct 2008-04-21 10:54:01 UTC (rev 5060) +++ trunk/numpy/core/SConstruct 2008-04-21 10:57:11 UTC (rev 5061) @@ -9,14 +9,13 @@ from numscons import GetNumpyEnvironment from numscons import CheckCBLAS from numscons import write_info -try: - from numscons import distutils_dirs_emitter -except ImportError: - raise ImportError("You need numscons >= 0.5.2") from scons_support import CheckBrokenMathlib, define_no_smp, \ check_mlib, check_mlibs, is_npy_no_signal +from scons_support import array_api_gen_bld, ufunc_api_gen_bld, template_bld, \ + umath_bld + env = GetNumpyEnvironment(ARGUMENTS) env.Append(CPPPATH = [get_python_inc()]) if os.name == 'nt': @@ -212,26 +211,6 @@ #--------------------------- # Builder for generated code #--------------------------- -from scons_support import do_generate_array_api, do_generate_ufunc_api, \ - generate_api_emitter,\ - generate_from_template, generate_from_template_emitter, \ - generate_umath, generate_umath_emitter - -array_api_gen_bld = Builder(action = do_generate_array_api, - emitter = [generate_api_emitter, - distutils_dirs_emitter]) - -ufunc_api_gen_bld = Builder(action = do_generate_ufunc_api, - emitter = [generate_api_emitter, - distutils_dirs_emitter]) - -template_bld = Builder(action = generate_from_template, - emitter = [generate_from_template_emitter, - distutils_dirs_emitter]) - -umath_bld = Builder(action = generate_umath, - emitter = [generate_umath_emitter, distutils_dirs_emitter]) - env.Append(BUILDERS = {'GenerateMultiarrayApi' : array_api_gen_bld, 'GenerateUfuncApi' : ufunc_api_gen_bld, 'GenerateFromTemplate' : template_bld, @@ -240,18 +219,13 @@ #------------------------ # Generate generated code #------------------------ -from os.path import join as pjoin - scalartypes_src = env.GenerateFromTemplate(pjoin('src', 'scalartypes.inc.src')) - arraytypes_src = env.GenerateFromTemplate(pjoin('src', 'arraytypes.inc.src')) - sortmodule_src = env.GenerateFromTemplate(pjoin('src', '_sortmodule.c.src')) - umathmodule_src = env.GenerateFromTemplate(pjoin('src', 'umathmodule.c.src')) +scalarmathmodule_src = env.GenerateFromTemplate( + pjoin('src', 'scalarmathmodule.c.src')) -scalarmathmodule_src = env.GenerateFromTemplate(pjoin('src', 'scalarmathmodule.c.src')) - umath = env.GenerateUmath('__umath_generated', pjoin('code_generators', 'generate_umath.py')) Modified: trunk/numpy/core/scons_support.py =================================================================== --- trunk/numpy/core/scons_support.py 2008-04-21 10:54:01 UTC (rev 5060) +++ trunk/numpy/core/scons_support.py 2008-04-21 10:57:11 UTC (rev 5061) @@ -1,4 +1,4 @@ -#! Last Change: Tue Jan 08 10:00 PM 2008 J +#! Last Change: Mon Apr 21 07:00 PM 2008 J """Code to support special facilities to scons which are only useful for numpy.core, hence not put into numpy.distutils.scons""" @@ -16,9 +16,15 @@ from numscons.numdist import process_c_str as process_str from numscons.core.utils import rsplit, isstring +try: + from numscons import distutils_dirs_emitter +except ImportError: + raise ImportError("You need numscons >= 0.5.2") import SCons.Node import SCons +from SCons.Builder import Builder +from SCons.Action import Action def split_ext(string): sp = rsplit(string, '.', 1) @@ -181,3 +187,18 @@ except KeyError: nosmp = 0 return nosmp == 1 + +array_api_gen_bld = Builder(action = Action(do_generate_array_api, '$ARRAPIGENCOMSTR'), + emitter = [generate_api_emitter, + distutils_dirs_emitter]) + +ufunc_api_gen_bld = Builder(action = Action(do_generate_ufunc_api, '$UFUNCAPIGENCOMSTR'), + emitter = [generate_api_emitter, + distutils_dirs_emitter]) + +template_bld = Builder(action = Action(generate_from_template, '$TEMPLATECOMSTR'), + emitter = [generate_from_template_emitter, + distutils_dirs_emitter]) + +umath_bld = Builder(action = Action(generate_umath, '$UMATHCOMSTR'), + emitter = [generate_umath_emitter, distutils_dirs_emitter]) From numpy-svn at scipy.org Mon Apr 21 23:48:31 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 21 Apr 2008 22:48:31 -0500 (CDT) Subject: [Numpy-svn] r5062 - trunk/numpy/core/code_generators Message-ID: <20080422034831.178EC39C63A@new.scipy.org> Author: charris Date: 2008-04-21 22:48:21 -0500 (Mon, 21 Apr 2008) New Revision: 5062 Modified: trunk/numpy/core/code_generators/generate_umath.py Log: Fix incorrect output types for some ufuncs. This fixes ticket #747. Modified: trunk/numpy/core/code_generators/generate_umath.py =================================================================== --- trunk/numpy/core/code_generators/generate_umath.py 2008-04-21 10:57:11 UTC (rev 5061) +++ trunk/numpy/core/code_generators/generate_umath.py 2008-04-22 03:48:21 UTC (rev 5062) @@ -257,25 +257,25 @@ Ufunc(2, 1, One, 'returns x1 and x2 elementwise.', TD(noobj, out='?'), - TD(M, f='logical_and', out='?'), + TD(M, f='logical_and'), ), 'logical_not' : Ufunc(1, 1, None, 'returns not x elementwise.', TD(noobj, out='?'), - TD(M, f='logical_not', out='?'), + TD(M, f='logical_not'), ), 'logical_or' : Ufunc(2, 1, Zero, 'returns x1 or x2 elementwise.', TD(noobj, out='?'), - TD(M, f='logical_or', out='?'), + TD(M, f='logical_or'), ), 'logical_xor' : Ufunc(2, 1, None, 'returns x1 xor x2 elementwise.', TD(noobj, out='?'), - TD(M, f='logical_xor', out='?'), + TD(M, f='logical_xor'), ), 'maximum' : Ufunc(2, 1, None, From numpy-svn at scipy.org Mon Apr 21 23:50:37 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 21 Apr 2008 22:50:37 -0500 (CDT) Subject: [Numpy-svn] r5063 - trunk/numpy/core/tests Message-ID: <20080422035037.21BE939C66F@new.scipy.org> Author: charris Date: 2008-04-21 22:50:35 -0500 (Mon, 21 Apr 2008) New Revision: 5063 Modified: trunk/numpy/core/tests/test_ufunc.py Log: Uncomment tests for PyUfunc_O_O_method and PyUFunc_OO_O_method. Modified: trunk/numpy/core/tests/test_ufunc.py =================================================================== --- trunk/numpy/core/tests/test_ufunc.py 2008-04-22 03:48:21 UTC (rev 5062) +++ trunk/numpy/core/tests/test_ufunc.py 2008-04-22 03:50:35 UTC (rev 5063) @@ -52,6 +52,14 @@ just looked at the signatures registered in the build directory to find relevant functions. + Fixme, currently untested: + + PyUFunc_ff_f_As_dd_d + PyUFunc_FF_F_As_DD_D + PyUFunc_f_f_As_d_d + PyUFunc_F_F_As_D_D + PyUFunc_On_Om + """ fone = np.exp ftwo = lambda x,y : x**y @@ -123,7 +131,7 @@ x = np.zeros(10, dtype=np.object)[0::2] for i in range(len(x)) : x[i] = foo() - #assert np.all(np.logical_not(x) == True), msg + assert np.all(np.logical_not(x) == True), msg # check binary PyUFunc_OO_0 msg = "PyUFunc_OO_O" @@ -134,7 +142,7 @@ x = np.zeros(10, dtype=np.object)[0::2] for i in range(len(x)) : x[i] = foo() - #assert np.all(np.logical_and(x,x) == 1), msg + assert np.all(np.logical_and(x,x) == 1), msg # check PyUFunc_On_Om # fixme -- I don't know how to do this yet From numpy-svn at scipy.org Tue Apr 22 15:09:08 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 22 Apr 2008 14:09:08 -0500 (CDT) Subject: [Numpy-svn] r5064 - trunk/numpy/core/code_generators Message-ID: <20080422190908.CF07139C536@new.scipy.org> Author: cookedm Date: 2008-04-22 14:09:02 -0500 (Tue, 22 Apr 2008) New Revision: 5064 Modified: trunk/numpy/core/code_generators/generate_umath.py Log: generate_umath.py: move chartoname higher for documentation purposes (i.e., make it easier to answer the question, "what's ? or M mean?") Modified: trunk/numpy/core/code_generators/generate_umath.py =================================================================== --- trunk/numpy/core/code_generators/generate_umath.py 2008-04-22 03:50:35 UTC (rev 5063) +++ trunk/numpy/core/code_generators/generate_umath.py 2008-04-22 19:09:02 UTC (rev 5064) @@ -101,6 +101,29 @@ # output specification (optional) # ] +chartoname = {'?': 'bool', + 'b': 'byte', + 'B': 'ubyte', + 'h': 'short', + 'H': 'ushort', + 'i': 'int', + 'I': 'uint', + 'l': 'long', + 'L': 'ulong', + 'q': 'longlong', + 'Q': 'ulonglong', + 'f': 'float', + 'd': 'double', + 'g': 'longdouble', + 'F': 'cfloat', + 'D': 'cdouble', + 'G': 'clongdouble', + 'O': 'OBJECT', + # M is like O, but calls a method of the object instead + # of a function + 'M': 'OBJECT', + } + all = '?bBhHiIlLqQfdgFDGO' O = 'O' M = 'M' @@ -519,27 +542,6 @@ indented = re.sub(r' +$',r'',indented) return indented -chartoname = {'?': 'bool', - 'b': 'byte', - 'B': 'ubyte', - 'h': 'short', - 'H': 'ushort', - 'i': 'int', - 'I': 'uint', - 'l': 'long', - 'L': 'ulong', - 'q': 'longlong', - 'Q': 'ulonglong', - 'f': 'float', - 'd': 'double', - 'g': 'longdouble', - 'F': 'cfloat', - 'D': 'cdouble', - 'G': 'clongdouble', - 'O': 'OBJECT', - 'M': 'OBJECT', - } - chartotype1 = {'f': 'f_f', 'd': 'd_d', 'g': 'g_g', From numpy-svn at scipy.org Tue Apr 22 20:20:59 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 22 Apr 2008 19:20:59 -0500 (CDT) Subject: [Numpy-svn] r5065 - trunk/numpy/core/src Message-ID: <20080423002059.8F78A39C3D5@new.scipy.org> Author: charris Date: 2008-04-22 19:20:57 -0500 (Tue, 22 Apr 2008) New Revision: 5065 Modified: trunk/numpy/core/src/arraytypes.inc.src Log: Make None be NaN for float types. Modified: trunk/numpy/core/src/arraytypes.inc.src =================================================================== --- trunk/numpy/core/src/arraytypes.inc.src 2008-04-22 19:09:02 UTC (rev 5064) +++ trunk/numpy/core/src/arraytypes.inc.src 2008-04-23 00:20:57 UTC (rev 5065) @@ -29,8 +29,12 @@ MyPyFloat_AsDouble(PyObject *obj) { double ret = 0; - PyObject *num = PyNumber_Float(obj); + PyObject *num; + if (obj == Py_None) { + return _getNAN(); + } + num = PyNumber_Float(obj); if (num == NULL) { return _getNAN(); } From numpy-svn at scipy.org Wed Apr 23 00:57:02 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 22 Apr 2008 23:57:02 -0500 (CDT) Subject: [Numpy-svn] r5066 - trunk/numpy/distutils Message-ID: <20080423045702.609FE39C40F@new.scipy.org> Author: charris Date: 2008-04-22 23:57:00 -0500 (Tue, 22 Apr 2008) New Revision: 5066 Modified: trunk/numpy/distutils/conv_template.py Log: Add nested loops to the template processor. The syntax is to separate the nested loops with lines containing strings like #repeat = 1# #repeat = 2# ... The number doesn't really matter, but it helps document the depth. Example: The file containing /**begin repeat * # a = 1,2,3# * # b = 1,2,3# * # repeat = 1# * # c = 1,2# * # d = 1,2# */ @a@@b@@c@@d@ /**end repeat**/ produces #line 1 "template.c.src" /* ***************************************************************************** ** This file was autogenerated from a template DO NOT EDIT!!!! ** ** Changes should be made to the original source (.src) file ** ***************************************************************************** */ #line 8 1111 #line 8 1122 #line 8 2211 #line 8 2222 #line 8 3311 #line 8 3322 Modified: trunk/numpy/distutils/conv_template.py =================================================================== --- trunk/numpy/distutils/conv_template.py 2008-04-23 00:20:57 UTC (rev 5065) +++ trunk/numpy/distutils/conv_template.py 2008-04-23 04:57:00 UTC (rev 5066) @@ -46,7 +46,7 @@ _special_names = {} template_re = re.compile(r"@([\w]+)@") -named_re = re.compile(r"#([\w]*)=([^#]*?)#") +named_re = re.compile(r"#\s*([\w]*)\s*=\s*([^#]*)#") parenrep = re.compile(r"[(]([^)]*?)[)]\*(\d+)") def paren_repl(obj): @@ -55,15 +55,15 @@ return ','.join([torep]*int(numrep)) plainrep = re.compile(r"([^*]+)\*(\d+)") - def conv(astr): # replaces all occurrences of '(a,b,c)*4' in astr - # with 'a,b,c,a,b,c,a,b,c,a,b,c' + # with 'a,b,c,a,b,c,a,b,c,a,b,c'. The result is + # split at ',' and a list of values returned. astr = parenrep.sub(paren_repl,astr) # replaces occurences of xxx*3 with xxx, xxx, xxx astr = ','.join([plainrep.sub(paren_repl,x.strip()) for x in astr.split(',')]) - return astr + return astr.split(',') def unique_key(adict): # this obtains a unique key given a dictionary @@ -82,52 +82,75 @@ return newkey def expand_sub(substr, namestr, line): - # find all named replacements + # find all named replacements in the various loops. reps = named_re.findall(namestr) + nsubs = None + loops = [] names = {} names.update(_special_names) - numsubs = None for rep in reps: name = rep[0].strip() - thelist = conv(rep[1]) - names[name] = thelist - - # make lists out of string entries in name dictionary - for name in names.keys(): - entry = names[name] - entrylist = entry.split(',') - names[name] = entrylist - num = len(entrylist) - if numsubs is None: - numsubs = num - elif numsubs != num: - print namestr - print substr + vals = conv(rep[1]) + size = len(vals) + if name == "repeat" : + names[None] = nsubs + loops.append(names) + nsubs = None + names = {} + continue + if nsubs is None : + nsubs = size + elif nsubs != size : + print name + print vals raise ValueError, "Mismatch in number to replace" + names[name] = vals + names[None] = nsubs + loops.append(names) - # now replace all keys for each of the lists - mystr = '' - thissub = [None] + # generate list of dictionaries, one for each template iteration + def merge(d1,d2) : + tmp = d1.copy() + tmp.update(d2) + return tmp + + dlist = [{}] + for d in loops : + nsubs = d.pop(None) + tmp = [{} for i in range(nsubs)] + for name, item in d.items() : + for i in range(nsubs) : + tmp[i][name] = item[i] + dlist = [merge(d1,d2) for d1 in dlist for d2 in tmp] + + # now replace all keys for each of the dictionaries def namerepl(match): name = match.group(1) - return names[name][thissub[0]] - for k in range(numsubs): - thissub[0] = k - mystr += ("#line %d\n%s\n\n" - % (line, template_re.sub(namerepl, substr))) + return d[name] + + mystr = [] + header = "#line %d\n"%line + for d in dlist : + code = ''.join((header, template_re.sub(namerepl, substr), '\n')) + mystr.append(code) + return mystr -_head = \ -"""/* This file was autogenerated from a template DO NOT EDIT!!!! - Changes should be made to the original source (.src) file -*/ +header =\ +""" +/* + ***************************************************************************** + ** This file was autogenerated from a template DO NOT EDIT!!!! ** + ** Changes should be made to the original source (.src) file ** + ***************************************************************************** + */ """ def get_line_header(str,beg): extra = [] - ind = beg-1 + ind = beg - 1 char = str[ind] while (ind > 0) and (char != '\n'): extra.insert(0,char) @@ -136,25 +159,24 @@ return ''.join(extra) def process_str(allstr): - newstr = allstr - writestr = _head + code = [header] + struct = parse_structure(allstr) - struct = parse_structure(newstr) # return a (sorted) list of tuples for each begin repeat section # each tuple is the start and end of a region to be template repeated - oldend = 0 for sub in struct: - writestr += newstr[oldend:sub[0]] - expanded = expand_sub(newstr[sub[1]:sub[2]], - newstr[sub[0]:sub[1]], sub[4]) - writestr += expanded + pref = allstr[oldend:sub[0]] + head = allstr[sub[0]:sub[1]] + text = allstr[sub[1]:sub[2]] + line = sub[4] oldend = sub[3] + code.append(pref) + code.extend(expand_sub(text,head,line)) + code.append(allstr[oldend:]) + return ''.join(code) - writestr += newstr[oldend:] - return writestr - include_src_re = re.compile(r"(\n|\A)#include\s*['\"]" r"(?P[\w\d./\\]+[.]src)['\"]", re.I) @@ -184,6 +206,7 @@ return ('#line 1 "%s"\n%s' % (sourcefile, process_str(''.join(lines)))) + if __name__ == "__main__": try: @@ -200,3 +223,4 @@ allstr = fid.read() writestr = process_str(allstr) outfile.write(writestr) + From numpy-svn at scipy.org Wed Apr 23 05:35:20 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 23 Apr 2008 04:35:20 -0500 (CDT) Subject: [Numpy-svn] r5067 - trunk/numpy/distutils/command Message-ID: <20080423093520.5C7FA39C5E7@new.scipy.org> Author: cdavid Date: 2008-04-23 04:35:15 -0500 (Wed, 23 Apr 2008) New Revision: 5067 Modified: trunk/numpy/distutils/command/scons.py Log: Does not replace g++ by c++ compiler name. Modified: trunk/numpy/distutils/command/scons.py =================================================================== --- trunk/numpy/distutils/command/scons.py 2008-04-23 04:57:00 UTC (rev 5066) +++ trunk/numpy/distutils/command/scons.py 2008-04-23 09:35:15 UTC (rev 5067) @@ -92,10 +92,6 @@ def dist2sconscxx(compiler): """This converts the name passed to distutils to scons name convention (C++ compiler). The argument should be a Compiler instance.""" - if compiler.compiler_type == 'gnu': - return 'g++' - else: - return 'c++' return compiler.compiler_cxx[0] def get_compiler_executable(compiler): @@ -329,7 +325,7 @@ if int(self.silent) < 1: log.info("Executing scons command (pkg is %s): %s ", pkg_name, cmdstr) else: - log.info("Executing scons command for pkg %s", pkg_name) + log.info("======== Executing scons command for pkg %s =========", pkg_name) st = os.system(cmdstr) if st: print "status is %d" % st From numpy-svn at scipy.org Wed Apr 23 05:44:31 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 23 Apr 2008 04:44:31 -0500 (CDT) Subject: [Numpy-svn] r5068 - trunk Message-ID: <20080423094431.7E16439C65A@new.scipy.org> Author: cdavid Date: 2008-04-23 04:44:26 -0500 (Wed, 23 Apr 2008) New Revision: 5068 Modified: trunk/MANIFEST.in Log: Add some files in MANIFEST.in which cannot be picked up by distutils. Modified: trunk/MANIFEST.in =================================================================== --- trunk/MANIFEST.in 2008-04-23 09:35:15 UTC (rev 5067) +++ trunk/MANIFEST.in 2008-04-23 09:44:26 UTC (rev 5068) @@ -5,3 +5,10 @@ # include MANIFEST.in include LICENSE.txt +include setupscons.py +include setupegg.py +# Adding scons build relateed files not found by distutils +include numpy/core/code_generators/__init__.py +include numpy/core/include/numpy/numpyconfig.h.in +include numpy/core/include +recursive-include numpy/ SConstruct From numpy-svn at scipy.org Wed Apr 23 05:45:02 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 23 Apr 2008 04:45:02 -0500 (CDT) Subject: [Numpy-svn] r5069 - trunk Message-ID: <20080423094502.BE74C39C498@new.scipy.org> Author: cdavid Date: 2008-04-23 04:44:57 -0500 (Wed, 23 Apr 2008) New Revision: 5069 Modified: trunk/MANIFEST.in Log: Fix double line in MANIFEST.in. Modified: trunk/MANIFEST.in =================================================================== --- trunk/MANIFEST.in 2008-04-23 09:44:26 UTC (rev 5068) +++ trunk/MANIFEST.in 2008-04-23 09:44:57 UTC (rev 5069) @@ -10,5 +10,4 @@ # Adding scons build relateed files not found by distutils include numpy/core/code_generators/__init__.py include numpy/core/include/numpy/numpyconfig.h.in -include numpy/core/include recursive-include numpy/ SConstruct From numpy-svn at scipy.org Wed Apr 23 05:59:21 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 23 Apr 2008 04:59:21 -0500 (CDT) Subject: [Numpy-svn] r5070 - trunk/numpy/core/tests Message-ID: <20080423095921.EDFCE39C685@new.scipy.org> Author: stefan Date: 2008-04-23 04:58:58 -0500 (Wed, 23 Apr 2008) New Revision: 5070 Modified: trunk/numpy/core/tests/test_regression.py Log: Add regression test for changeset #5065. Modified: trunk/numpy/core/tests/test_regression.py =================================================================== --- trunk/numpy/core/tests/test_regression.py 2008-04-23 09:44:57 UTC (rev 5069) +++ trunk/numpy/core/tests/test_regression.py 2008-04-23 09:58:58 UTC (rev 5070) @@ -1012,6 +1012,9 @@ x.fill(1) assert_equal(x, np.array([1], dtype=dtype)) + def check_asfarray_none(self, level=rlevel): + """Test for changeset r5065""" + assert_array_equal(np.array([np.nan]), np.asfarray([None])) if __name__ == "__main__": From numpy-svn at scipy.org Wed Apr 23 10:46:36 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 23 Apr 2008 09:46:36 -0500 (CDT) Subject: [Numpy-svn] r5071 - in trunk/numpy/ma: . tests Message-ID: <20080423144636.0463839C6A8@new.scipy.org> Author: pierregm Date: 2008-04-23 09:46:29 -0500 (Wed, 23 Apr 2008) New Revision: 5071 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/tests/test_core.py trunk/numpy/ma/tests/test_old_ma.py Log: __float__ : raises a TypeError exception for arrays longer than 1 __int__ : raises a TypeError exception for arrays longer than 1 Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-04-23 09:58:58 UTC (rev 5070) +++ trunk/numpy/ma/core.py 2008-04-23 14:46:29 UTC (rev 5071) @@ -1740,14 +1740,20 @@ #............................................ def __float__(self): "Convert to float." - if self._mask is not nomask: + if self.size > 1: + raise TypeError,\ + "Only length-1 arrays can be converted to Python scalars" + elif self._mask: warnings.warn("Warning: converting a masked element to nan.") return numpy.nan return float(self.item()) def __int__(self): "Convert to int." - if self._mask is not nomask: + if self.size > 1: + raise TypeError,\ + "Only length-1 arrays can be converted to Python scalars" + elif self._mask: raise MAError, 'Cannot convert masked element to a Python int.' return int(self.item()) #............................................ @@ -3366,3 +3372,4 @@ indices = numpy.indices ############################################################################### + \ No newline at end of file Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-04-23 09:58:58 UTC (rev 5070) +++ trunk/numpy/ma/tests/test_core.py 2008-04-23 14:46:29 UTC (rev 5071) @@ -702,16 +702,19 @@ assert_equal(1.0, float(array(1))) assert_equal(1, int(array([[[1]]]))) assert_equal(1.0, float(array([[1]]))) - self.failUnlessRaises(ValueError, float, array([1,1])) + self.assertRaises(TypeError, float, array([1,1])) warnings.simplefilter('ignore',UserWarning) assert numpy.isnan(float(array([1],mask=[1]))) warnings.simplefilter('default',UserWarning) -#TODO: Check how bool works... -#TODO: self.failUnless(bool(array([0,1]))) -#TODO: self.failUnless(bool(array([0,0],mask=[0,1]))) -#TODO: self.failIf(bool(array([0,0]))) -#TODO: self.failIf(bool(array([0,0],mask=[0,0]))) + # + a = array([1,2,3],mask=[1,0,0]) + self.assertRaises(TypeError, lambda:float(a)) + assert_equal(float(a[-1]), 3.) + assert(numpy.isnan(float(a[0]))) + self.assertRaises(TypeError, int, a) + assert_equal(int(a[-1]), 3) + self.assertRaises(MAError, lambda:int(a[0])) #........................ def test_arraymethods(self): "Tests some MaskedArray methods." Modified: trunk/numpy/ma/tests/test_old_ma.py =================================================================== --- trunk/numpy/ma/tests/test_old_ma.py 2008-04-23 09:58:58 UTC (rev 5070) +++ trunk/numpy/ma/tests/test_old_ma.py 2008-04-23 14:46:29 UTC (rev 5071) @@ -577,7 +577,7 @@ self.assertEqual(1.0, float(array(1))) self.assertEqual(1, int(array([[[1]]]))) self.assertEqual(1.0, float(array([[1]]))) - self.failUnlessRaises(ValueError, float, array([1,1])) + self.failUnlessRaises(TypeError, float, array([1,1])) self.failUnlessRaises(ValueError, bool, array([0,1])) self.failUnlessRaises(ValueError, bool, array([0,0],mask=[0,1])) From numpy-svn at scipy.org Wed Apr 23 16:32:14 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 23 Apr 2008 15:32:14 -0500 (CDT) Subject: [Numpy-svn] r5072 - in trunk/numpy/core: . tests Message-ID: <20080423203214.909C239C704@new.scipy.org> Author: stefan Date: 2008-04-23 15:32:02 -0500 (Wed, 23 Apr 2008) New Revision: 5072 Modified: trunk/numpy/core/defmatrix.py trunk/numpy/core/tests/test_defmatrix.py Log: Hack to let x[0][0] return a scalar for matrices. Modified: trunk/numpy/core/defmatrix.py =================================================================== --- trunk/numpy/core/defmatrix.py 2008-04-23 14:46:29 UTC (rev 5071) +++ trunk/numpy/core/defmatrix.py 2008-04-23 20:32:02 UTC (rev 5072) @@ -224,6 +224,14 @@ def __getitem__(self, index): self._getitem = True + + # If indexing by scalar, check whether we are indexing into + # a vector, and then return the corresponding element + if N.isscalar(index) and (1 in self.shape): + index = [index,index] + index[list(self.shape).index(1)] = 0 + index = tuple(index) + try: out = N.ndarray.__getitem__(self, index) finally: @@ -254,7 +262,6 @@ if (val > 1): truend += 1 return truend - def __mul__(self, other): if isinstance(other,(N.ndarray, list, tuple)) : # This promotes 1-D vectors to row vectors Modified: trunk/numpy/core/tests/test_defmatrix.py =================================================================== --- trunk/numpy/core/tests/test_defmatrix.py 2008-04-23 14:46:29 UTC (rev 5071) +++ trunk/numpy/core/tests/test_defmatrix.py 2008-04-23 20:32:02 UTC (rev 5072) @@ -179,6 +179,17 @@ x[:,1] = y>0.5 assert_equal(x, [[0,1],[0,0],[0,0]]) + def check_vector_element(self): + x = matrix([[1,2,3],[4,5,6]]) + assert_equal(x[0][0],1) + assert_equal(x[0].shape,(1,3)) + assert_equal(x[:,0].shape,(2,1)) + x = matrix(0) + assert_equal(x[0,0],0) + assert_equal(x[0],0) + assert_equal(x[:,0].shape,x.shape) + + if __name__ == "__main__": NumpyTest().run() From numpy-svn at scipy.org Wed Apr 23 16:49:49 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 23 Apr 2008 15:49:49 -0500 (CDT) Subject: [Numpy-svn] r5073 - trunk/numpy/core/include/numpy Message-ID: <20080423204949.A6A6E39C010@new.scipy.org> Author: rkern Date: 2008-04-23 15:49:48 -0500 (Wed, 23 Apr 2008) New Revision: 5073 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h Log: In C, you shouldn't have trailing commas on the last item in an enum. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-23 20:32:02 UTC (rev 5072) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-23 20:49:48 UTC (rev 5073) @@ -197,14 +197,14 @@ typedef enum { NPY_QUICKSORT=0, NPY_HEAPSORT=1, - NPY_MERGESORT=2, + NPY_MERGESORT=2 } NPY_SORTKIND; #define NPY_NSORTS (NPY_MERGESORT + 1) typedef enum { NPY_SEARCHLEFT=0, - NPY_SEARCHRIGHT=1, + NPY_SEARCHRIGHT=1 } NPY_SEARCHSIDE; #define NPY_NSEARCHSIDES (NPY_SEARCHRIGHT + 1) @@ -216,7 +216,7 @@ NPY_INTNEG_SCALAR, NPY_FLOAT_SCALAR, NPY_COMPLEX_SCALAR, - NPY_OBJECT_SCALAR, + NPY_OBJECT_SCALAR } NPY_SCALARKIND; #define NPY_NSCALARKINDS (NPY_OBJECT_SCALAR + 1) From numpy-svn at scipy.org Wed Apr 23 19:16:55 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 23 Apr 2008 18:16:55 -0500 (CDT) Subject: [Numpy-svn] r5074 - trunk/numpy/distutils Message-ID: <20080423231655.1FE8739C403@new.scipy.org> Author: charris Date: 2008-04-23 18:16:53 -0500 (Wed, 23 Apr 2008) New Revision: 5074 Modified: trunk/numpy/distutils/conv_template.py Log: Add true nesting of loops to the template processing. The previous attempt wasn't very useful. Loops can now be nested within each other using /**begin repeat1 and /**end repeat1**/ and cousins, starting with the current tags for the outermost loops. Modified: trunk/numpy/distutils/conv_template.py =================================================================== --- trunk/numpy/distutils/conv_template.py 2008-04-23 20:49:48 UTC (rev 5073) +++ trunk/numpy/distutils/conv_template.py 2008-04-23 23:16:53 UTC (rev 5074) @@ -1,39 +1,119 @@ #!/usr/bin/python +""" +takes templated file .xxx.src and produces .xxx file where .xxx is +.i or .c or .h, using the following template rules -# takes templated file .xxx.src and produces .xxx file where .xxx is .i or .c or .h -# using the following template rules +/**begin repeat -- on a line by itself marks the start of a repeated code + segment +/**end repeat**/ -- on a line by itself marks it's end -# /**begin repeat on a line by itself marks the beginning of a segment of code to be repeated -# /**end repeat**/ on a line by itself marks it's end +After the /**begin repeat and before the */, all the named templates are placed +these should all have the same number of replacements -# after the /**begin repeat and before the */ -# all the named templates are placed -# these should all have the same number of replacements +Repeat blocks can be nested, with each nested block labeled with its depth, +i.e. +/**begin repeat1 + *.... + */ +/**end repeat1**/ -# in the main body, the names are used. -# Each replace will use one entry from the list of named replacements +In the main body each replace will use one entry from the list of named replacements -# Note that all #..# forms in a block must have the same number of -# comma-separated entries. + Note that all #..# forms in a block must have the same number of + comma-separated entries. +Example: + + An input file containing + + /**begin repeat + * #a = 1,2,3# + * #b = 1,2,3# + */ + + /**begin repeat1 + * #c = ted, jim# + */ + @a@, @b@, @c@ + /**end repeat1**/ + + /**end repeat**/ + + produces + + line 1 "template.c.src" + + /* + ********************************************************************* + ** This file was autogenerated from a template DO NOT EDIT!!** + ** Changes should be made to the original source (.src) file ** + ********************************************************************* + */ + + #line 9 + 1, 1, ted + + #line 9 + 1, 1, jim + + #line 9 + 2, 2, ted + + #line 9 + 2, 2, jim + + #line 9 + 3, 3, ted + + #line 9 + 3, 3, jim + +""" + __all__ = ['process_str', 'process_file'] import os import sys import re -def parse_structure(astr): +# names for replacement that are already global. +global_names = {} + +# header placed at the front of head processed file +header =\ +""" +/* + ***************************************************************************** + ** This file was autogenerated from a template DO NOT EDIT!!!! ** + ** Changes should be made to the original source (.src) file ** + ***************************************************************************** + */ + +""" +# Parse string for repeat loops +def parse_structure(astr, level): + """ + The returned line number is from the beginning of the string, starting + at zero. Returns an empty list if no loops found. + + """ + if level == 0 : + loopbeg = "/**begin repeat" + loopend = "/**end repeat**/" + else : + loopbeg = "/**begin repeat%d" % level + loopend = "/**end repeat%d**/" % level + + ind = 0 + line = 0 spanlist = [] - # subroutines - ind = 0 - line = 1 while 1: - start = astr.find("/**begin repeat", ind) + start = astr.find(loopbeg, ind) if start == -1: break start2 = astr.find("*/",start) start2 = astr.find("\n",start2) - fini1 = astr.find("/**end repeat**/",start2) + fini1 = astr.find(loopend,start2) fini2 = astr.find("\n",fini1) line += astr.count("\n", ind, start2+1) spanlist.append((start, start2+1, fini1, fini2+1, line)) @@ -42,18 +122,13 @@ spanlist.sort() return spanlist -# return n copies of substr with template replacement -_special_names = {} -template_re = re.compile(r"@([\w]+)@") -named_re = re.compile(r"#\s*([\w]*)\s*=\s*([^#]*)#") - -parenrep = re.compile(r"[(]([^)]*?)[)]\*(\d+)") def paren_repl(obj): torep = obj.group(1) numrep = obj.group(2) return ','.join([torep]*int(numrep)) +parenrep = re.compile(r"[(]([^)]*?)[)]\*(\d+)") plainrep = re.compile(r"([^*]+)\*(\d+)") def conv(astr): # replaces all occurrences of '(a,b,c)*4' in astr @@ -65,115 +140,76 @@ for x in astr.split(',')]) return astr.split(',') -def unique_key(adict): - # this obtains a unique key given a dictionary - # currently it works by appending together n of the letters of the - # current keys and increasing n until a unique key is found - # -- not particularly quick - allkeys = adict.keys() - done = False - n = 1 - while not done: - newkey = "".join([x[:n] for x in allkeys]) - if newkey in allkeys: - n += 1 - else: - done = True - return newkey +named_re = re.compile(r"#\s*([\w]*)\s*=\s*([^#]*)#") +def parse_loop_header(loophead) : + """Find all named replacements in the header -def expand_sub(substr, namestr, line): - # find all named replacements in the various loops. - reps = named_re.findall(namestr) - nsubs = None - loops = [] - names = {} - names.update(_special_names) + Returns a list of dictionaries, one for each loop iteration, + where each key is a name to be substituted and the corresponding + value is the replacement string. + + """ + # parse out the names and lists of values + names = [] + reps = named_re.findall(loophead) + nsub = None for rep in reps: name = rep[0].strip() vals = conv(rep[1]) size = len(vals) - if name == "repeat" : - names[None] = nsubs - loops.append(names) - nsubs = None - names = {} - continue - if nsubs is None : - nsubs = size - elif nsubs != size : + if nsub is None : + nsub = size + elif nsub != size : print name print vals raise ValueError, "Mismatch in number to replace" - names[name] = vals - names[None] = nsubs - loops.append(names) + names.append((name,vals)) # generate list of dictionaries, one for each template iteration - def merge(d1,d2) : - tmp = d1.copy() - tmp.update(d2) - return tmp + dlist = [] + for i in range(nsub) : + tmp = {} + for name,vals in names : + tmp[name] = vals[i] + dlist.append(tmp) + return dlist - dlist = [{}] - for d in loops : - nsubs = d.pop(None) - tmp = [{} for i in range(nsubs)] - for name, item in d.items() : - for i in range(nsubs) : - tmp[i][name] = item[i] - dlist = [merge(d1,d2) for d1 in dlist for d2 in tmp] - - # now replace all keys for each of the dictionaries - def namerepl(match): +replace_re = re.compile(r"@([\w]+)@") +def parse_string(astr, env, level, line) : + # local function for string replacement, uses env + def replace(match): name = match.group(1) - return d[name] + return env[name] - mystr = [] - header = "#line %d\n"%line - for d in dlist : - code = ''.join((header, template_re.sub(namerepl, substr), '\n')) - mystr.append(code) + code = [] + struct = parse_structure(astr, level) + if struct : + # recurse over inner loops + oldend = 0 + newlevel = level + 1 + for sub in struct: + pref = astr[oldend:sub[0]] + head = astr[sub[0]:sub[1]] + text = astr[sub[1]:sub[2]] + oldend = sub[3] + newline = line + sub[4] + envlist = parse_loop_header(head) + code.append(pref) + for newenv in envlist : + newenv.update(env) + newcode = parse_string(text, newenv, newlevel, newline) + code.extend(newcode) + code.append(astr[oldend:]) + else : + # replace keys + lineno = "#line %d\n" % line + newcode = replace_re.sub(replace, astr) + code.append(''.join((lineno, newcode , '\n'))) + return code - return mystr - - -header =\ -""" -/* - ***************************************************************************** - ** This file was autogenerated from a template DO NOT EDIT!!!! ** - ** Changes should be made to the original source (.src) file ** - ***************************************************************************** - */ - -""" - -def get_line_header(str,beg): - extra = [] - ind = beg - 1 - char = str[ind] - while (ind > 0) and (char != '\n'): - extra.insert(0,char) - ind = ind - 1 - char = str[ind] - return ''.join(extra) - -def process_str(allstr): +def process_str(astr): code = [header] - struct = parse_structure(allstr) - - # return a (sorted) list of tuples for each begin repeat section - # each tuple is the start and end of a region to be template repeated - oldend = 0 - for sub in struct: - pref = allstr[oldend:sub[0]] - head = allstr[sub[0]:sub[1]] - text = allstr[sub[1]:sub[2]] - line = sub[4] - oldend = sub[3] - code.append(pref) - code.extend(expand_sub(text,head,line)) - code.append(allstr[oldend:]) + code.extend(parse_string(astr, global_names, 0, 1)) return ''.join(code) @@ -203,10 +239,27 @@ def process_file(source): lines = resolve_includes(source) sourcefile = os.path.normcase(source).replace("\\","\\\\") - return ('#line 1 "%s"\n%s' - % (sourcefile, process_str(''.join(lines)))) + code = process_str(''.join(lines)) + return '#line 1 "%s"\n%s' % (sourcefile, code) +def unique_key(adict): + # this obtains a unique key given a dictionary + # currently it works by appending together n of the letters of the + # current keys and increasing n until a unique key is found + # -- not particularly quick + allkeys = adict.keys() + done = False + n = 1 + while not done: + newkey = "".join([x[:n] for x in allkeys]) + if newkey in allkeys: + n += 1 + else: + done = True + return newkey + + if __name__ == "__main__": try: From numpy-svn at scipy.org Wed Apr 23 20:58:40 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 23 Apr 2008 19:58:40 -0500 (CDT) Subject: [Numpy-svn] r5075 - trunk/numpy/core/src Message-ID: <20080424005840.6735C39C7AF@new.scipy.org> Author: charris Date: 2008-04-23 19:58:38 -0500 (Wed, 23 Apr 2008) New Revision: 5075 Modified: trunk/numpy/core/src/umathmodule.c.src Log: Add some section headings to the file. Modified: trunk/numpy/core/src/umathmodule.c.src =================================================================== --- trunk/numpy/core/src/umathmodule.c.src 2008-04-23 23:16:53 UTC (rev 5074) +++ trunk/numpy/core/src/umathmodule.c.src 2008-04-24 00:58:38 UTC (rev 5075) @@ -1,5 +1,10 @@ /* -*- c -*- */ +/* + ***************************************************************************** + ** INCLUDES ** + ***************************************************************************** + */ #include "Python.h" #include "numpy/noprefix.h" #define _UMATHMODULE @@ -8,6 +13,12 @@ #include "config.h" #include +/* + ***************************************************************************** + ** BASIC MATH FUNCTIONS ** + ***************************************************************************** + */ + /* A whole slew of basic math functions are provided originally by Konrad Hinsen. */ @@ -455,6 +466,7 @@ #c=l*17,f*17# #TYPE=LONGDOUBLE*17, FLOAT*17# */ + #ifndef HAVE_ at TYPE@_FUNCS #ifdef @kind@@c@ #undef @kind@@c@ @@ -595,7 +607,13 @@ #endif +/* + ***************************************************************************** + ** COMPLEX FUNCTIONS ** + ***************************************************************************** + */ + /* Don't pass structures between functions (only pointers) because how structures are passed is compiler dependent and could cause segfaults if ufuncobject.c is compiled with a different compiler @@ -976,7 +994,13 @@ /**end repeat**/ +/* + ***************************************************************************** + ** UFUNC LOOPS ** + ***************************************************************************** + */ + /**begin repeat #TYPE=(BOOL, BYTE,UBYTE,SHORT,USHORT,INT,UINT,LONG,ULONG,LONGLONG,ULONGLONG,FLOAT,DOUBLE,LONGDOUBLE)*2# From numpy-svn at scipy.org Thu Apr 24 01:14:44 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 24 Apr 2008 00:14:44 -0500 (CDT) Subject: [Numpy-svn] r5076 - trunk/numpy/distutils Message-ID: <20080424051444.080AE39C0E9@new.scipy.org> Author: charris Date: 2008-04-24 00:14:41 -0500 (Thu, 24 Apr 2008) New Revision: 5076 Modified: trunk/numpy/distutils/conv_template.py Log: Fix conv_template to correctly handle nested loops with surrounding code. Add some template debugging aids. Modified: trunk/numpy/distutils/conv_template.py =================================================================== --- trunk/numpy/distutils/conv_template.py 2008-04-24 00:58:38 UTC (rev 5075) +++ trunk/numpy/distutils/conv_template.py 2008-04-24 05:14:41 UTC (rev 5076) @@ -160,9 +160,8 @@ if nsub is None : nsub = size elif nsub != size : - print name - print vals - raise ValueError, "Mismatch in number to replace" + msg = "Mismatch in number: %s - %s" % (name, vals) + raise ValueError, msg names.append((name,vals)) # generate list of dictionaries, one for each template iteration @@ -176,12 +175,19 @@ replace_re = re.compile(r"@([\w]+)@") def parse_string(astr, env, level, line) : + lineno = "#line %d\n" % line + # local function for string replacement, uses env def replace(match): name = match.group(1) - return env[name] + try : + val = env[name] + except KeyError, e : + msg = '%s: %s'%(lineno, e) + raise KeyError, msg + return val - code = [] + code = [lineno] struct = parse_structure(astr, level) if struct : # recurse over inner loops @@ -193,19 +199,23 @@ text = astr[sub[1]:sub[2]] oldend = sub[3] newline = line + sub[4] - envlist = parse_loop_header(head) - code.append(pref) + code.append(replace_re.sub(replace, pref)) + try : + envlist = parse_loop_header(head) + except ValueError, e : + msg = "%s: %s" % (lineno, e) + raise ValueError, msg for newenv in envlist : newenv.update(env) newcode = parse_string(text, newenv, newlevel, newline) code.extend(newcode) - code.append(astr[oldend:]) + suff = astr[oldend:] + code.append(replace_re.sub(replace, suff)) else : # replace keys - lineno = "#line %d\n" % line - newcode = replace_re.sub(replace, astr) - code.append(''.join((lineno, newcode , '\n'))) - return code + code.append(replace_re.sub(replace, astr)) + code.append('\n') + return ''.join(code) def process_str(astr): code = [header] From numpy-svn at scipy.org Thu Apr 24 02:57:15 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 24 Apr 2008 01:57:15 -0500 (CDT) Subject: [Numpy-svn] r5077 - trunk/numpy/ma Message-ID: <20080424065715.796D539C571@new.scipy.org> Author: pierregm Date: 2008-04-24 01:57:13 -0500 (Thu, 24 Apr 2008) New Revision: 5077 Removed: trunk/numpy/ma/morestats.py trunk/numpy/ma/mstats.py Log: suppressed mstats and morestats: the modules are now part of scipy.stats Deleted: trunk/numpy/ma/morestats.py =================================================================== --- trunk/numpy/ma/morestats.py 2008-04-24 05:14:41 UTC (rev 5076) +++ trunk/numpy/ma/morestats.py 2008-04-24 06:57:13 UTC (rev 5077) @@ -1,424 +0,0 @@ -""" -Generic statistics functions, with support to MA. - -:author: Pierre GF Gerard-Marchant -:contact: pierregm_at_uga_edu -:date: $Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $ -:version: $Id: morestats.py 3473 2007-10-29 15:18:13Z jarrod.millman $ -""" -__author__ = "Pierre GF Gerard-Marchant ($Author: jarrod.millman $)" -__version__ = '1.0' -__revision__ = "$Revision: 3473 $" -__date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $' - - -import numpy -from numpy import bool_, float_, int_, ndarray, \ - sqrt,\ - arange, empty,\ - r_ -from numpy import array as narray -import numpy.core.numeric as numeric -from numpy.core.numeric import concatenate - -import numpy.ma as MA -from numpy.ma.core import masked, nomask, MaskedArray, masked_array -from numpy.ma.extras import apply_along_axis, dot, median -from numpy.ma.mstats import trim_both, trimmed_stde, mquantiles, stde_median - -from scipy.stats.distributions import norm, beta, t, binom -from scipy.stats.morestats import find_repeats - -__all__ = ['hdquantiles', 'hdmedian', 'hdquantiles_sd', - 'trimmed_mean_ci', 'mjci', 'rank_data'] - - -#####-------------------------------------------------------------------------- -#---- --- Quantiles --- -#####-------------------------------------------------------------------------- -def hdquantiles(data, prob=list([.25,.5,.75]), axis=None, var=False,): - """Computes quantile estimates with the Harrell-Davis method, where the estimates -are calculated as a weighted linear combination of order statistics. - -Parameters ----------- - data: ndarray - Data array. - prob: sequence - Sequence of quantiles to compute. - axis : int - Axis along which to compute the quantiles. If None, use a flattened array. - var : boolean - Whether to return the variance of the estimate. - -Returns -------- - A (p,) array of quantiles (if ``var`` is False), or a (2,p) array of quantiles - and variances (if ``var`` is True), where ``p`` is the number of quantiles. - -Notes ------ - The function is restricted to 2D arrays. - - """ - def _hd_1D(data,prob,var): - "Computes the HD quantiles for a 1D array. Returns nan for invalid data." - xsorted = numpy.squeeze(numpy.sort(data.compressed().view(ndarray))) - # Don't use length here, in case we have a numpy scalar - n = xsorted.size - #......... - hd = empty((2,len(prob)), float_) - if n < 2: - hd.flat = numpy.nan - if var: - return hd - return hd[0] - #......... - v = arange(n+1) / float(n) - betacdf = beta.cdf - for (i,p) in enumerate(prob): - _w = betacdf(v, (n+1)*p, (n+1)*(1-p)) - w = _w[1:] - _w[:-1] - hd_mean = dot(w, xsorted) - hd[0,i] = hd_mean - # - hd[1,i] = dot(w, (xsorted-hd_mean)**2) - # - hd[0, prob == 0] = xsorted[0] - hd[0, prob == 1] = xsorted[-1] - if var: - hd[1, prob == 0] = hd[1, prob == 1] = numpy.nan - return hd - return hd[0] - # Initialization & checks --------- - data = masked_array(data, copy=False, dtype=float_) - p = numpy.array(prob, copy=False, ndmin=1) - # Computes quantiles along axis (or globally) - if (axis is None) or (data.ndim == 1): - result = _hd_1D(data, p, var) - else: - assert data.ndim <= 2, "Array should be 2D at most !" - result = apply_along_axis(_hd_1D, axis, data, p, var) - # - return masked_array(result, mask=numpy.isnan(result)) - -#.............................................................................. -def hdmedian(data, axis=-1, var=False): - """Returns the Harrell-Davis estimate of the median along the given axis. - -Parameters ----------- - data: ndarray - Data array. - axis : int - Axis along which to compute the quantiles. If None, use a flattened array. - var : boolean - Whether to return the variance of the estimate. - - """ - result = hdquantiles(data,[0.5], axis=axis, var=var) - return result.squeeze() - - -#.............................................................................. -def hdquantiles_sd(data, prob=list([.25,.5,.75]), axis=None): - """Computes the standard error of the Harrell-Davis quantile estimates by jackknife. - - -Parameters ----------- - data: ndarray - Data array. - prob: sequence - Sequence of quantiles to compute. - axis : int - Axis along which to compute the quantiles. If None, use a flattened array. - -Notes ------ - The function is restricted to 2D arrays. - - """ - def _hdsd_1D(data,prob): - "Computes the std error for 1D arrays." - xsorted = numpy.sort(data.compressed()) - n = len(xsorted) - #......... - hdsd = empty(len(prob), float_) - if n < 2: - hdsd.flat = numpy.nan - #......... - vv = arange(n) / float(n-1) - betacdf = beta.cdf - # - for (i,p) in enumerate(prob): - _w = betacdf(vv, (n+1)*p, (n+1)*(1-p)) - w = _w[1:] - _w[:-1] - mx_ = numpy.fromiter([dot(w,xsorted[r_[range(0,k), - range(k+1,n)].astype(int_)]) - for k in range(n)], dtype=float_) - mx_var = numpy.array(mx_.var(), copy=False, ndmin=1) * n / float(n-1) - hdsd[i] = float(n-1) * sqrt(numpy.diag(mx_var).diagonal() / float(n)) - return hdsd - # Initialization & checks --------- - data = masked_array(data, copy=False, dtype=float_) - p = numpy.array(prob, copy=False, ndmin=1) - # Computes quantiles along axis (or globally) - if (axis is None): - result = _hdsd_1D(data.compressed(), p) - else: - assert data.ndim <= 2, "Array should be 2D at most !" - result = apply_along_axis(_hdsd_1D, axis, data, p) - # - return masked_array(result, mask=numpy.isnan(result)).ravel() - - -#####-------------------------------------------------------------------------- -#---- --- Confidence intervals --- -#####-------------------------------------------------------------------------- - -def trimmed_mean_ci(data, proportiontocut=0.2, alpha=0.05, axis=None): - """Returns the selected confidence interval of the trimmed mean along the -given axis. - -Parameters ----------- - data : sequence - Input data. The data is transformed to a masked array - proportiontocut : float - Proportion of the data to cut from each side of the data . - As a result, (2*proportiontocut*n) values are actually trimmed. - alpha : float - Confidence level of the intervals. - axis : int - Axis along which to cut. If None, uses a flattened version of the input. - - """ - data = masked_array(data, copy=False) - trimmed = trim_both(data, proportiontocut=proportiontocut, axis=axis) - tmean = trimmed.mean(axis) - tstde = trimmed_stde(data, proportiontocut=proportiontocut, axis=axis) - df = trimmed.count(axis) - 1 - tppf = t.ppf(1-alpha/2.,df) - return numpy.array((tmean - tppf*tstde, tmean+tppf*tstde)) - -#.............................................................................. -def mjci(data, prob=[0.25,0.5,0.75], axis=None): - """Returns the Maritz-Jarrett estimators of the standard error of selected -experimental quantiles of the data. - -Parameters ------------ - data: ndarray - Data array. - prob: sequence - Sequence of quantiles to compute. - axis : int - Axis along which to compute the quantiles. If None, use a flattened array. - - """ - def _mjci_1D(data, p): - data = data.compressed() - sorted = numpy.sort(data) - n = data.size - prob = (numpy.array(p) * n + 0.5).astype(int_) - betacdf = beta.cdf - # - mj = empty(len(prob), float_) - x = arange(1,n+1, dtype=float_) / n - y = x - 1./n - for (i,m) in enumerate(prob): - (m1,m2) = (m-1, n-m) - W = betacdf(x,m-1,n-m) - betacdf(y,m-1,n-m) - C1 = numpy.dot(W,sorted) - C2 = numpy.dot(W,sorted**2) - mj[i] = sqrt(C2 - C1**2) - return mj - # - data = masked_array(data, copy=False) - assert data.ndim <= 2, "Array should be 2D at most !" - p = numpy.array(prob, copy=False, ndmin=1) - # Computes quantiles along axis (or globally) - if (axis is None): - return _mjci_1D(data, p) - else: - return apply_along_axis(_mjci_1D, axis, data, p) - -#.............................................................................. -def mquantiles_cimj(data, prob=[0.25,0.50,0.75], alpha=0.05, axis=None): - """Computes the alpha confidence interval for the selected quantiles of the -data, with Maritz-Jarrett estimators. - -Parameters ----------- - data: ndarray - Data array. - prob: sequence - Sequence of quantiles to compute. - alpha : float - Confidence level of the intervals. - axis : integer - Axis along which to compute the quantiles. If None, use a flattened array. - """ - alpha = min(alpha, 1-alpha) - z = norm.ppf(1-alpha/2.) - xq = mquantiles(data, prob, alphap=0, betap=0, axis=axis) - smj = mjci(data, prob, axis=axis) - return (xq - z * smj, xq + z * smj) - - -#............................................................................. -def median_cihs(data, alpha=0.05, axis=None): - """Computes the alpha-level confidence interval for the median of the data, -following the Hettmasperger-Sheather method. - -Parameters ----------- - data : sequence - Input data. Masked values are discarded. The input should be 1D only, or - axis should be set to None. - alpha : float - Confidence level of the intervals. - axis : integer - Axis along which to compute the quantiles. If None, use a flattened array. - """ - def _cihs_1D(data, alpha): - data = numpy.sort(data.compressed()) - n = len(data) - alpha = min(alpha, 1-alpha) - k = int(binom._ppf(alpha/2., n, 0.5)) - gk = binom.cdf(n-k,n,0.5) - binom.cdf(k-1,n,0.5) - if gk < 1-alpha: - k -= 1 - gk = binom.cdf(n-k,n,0.5) - binom.cdf(k-1,n,0.5) - gkk = binom.cdf(n-k-1,n,0.5) - binom.cdf(k,n,0.5) - I = (gk - 1 + alpha)/(gk - gkk) - lambd = (n-k) * I / float(k + (n-2*k)*I) - lims = (lambd*data[k] + (1-lambd)*data[k-1], - lambd*data[n-k-1] + (1-lambd)*data[n-k]) - return lims - data = masked_array(data, copy=False) - # Computes quantiles along axis (or globally) - if (axis is None): - result = _cihs_1D(data.compressed(), p, var) - else: - assert data.ndim <= 2, "Array should be 2D at most !" - result = apply_along_axis(_cihs_1D, axis, data, alpha) - # - return result - -#.............................................................................. -def compare_medians_ms(group_1, group_2, axis=None): - """Compares the medians from two independent groups along the given axis. - -The comparison is performed using the McKean-Schrader estimate of the standard -error of the medians. - -Parameters ----------- - group_1 : {sequence} - First dataset. - group_2 : {sequence} - Second dataset. - axis : {integer} - Axis along which the medians are estimated. If None, the arrays are flattened. - -Returns -------- - A (p,) array of comparison values. - - """ - (med_1, med_2) = (median(group_1, axis=axis), median(group_2, axis=axis)) - (std_1, std_2) = (stde_median(group_1, axis=axis), - stde_median(group_2, axis=axis)) - W = abs(med_1 - med_2) / sqrt(std_1**2 + std_2**2) - return 1 - norm.cdf(W) - - -#####-------------------------------------------------------------------------- -#---- --- Ranking --- -#####-------------------------------------------------------------------------- - -#.............................................................................. -def rank_data(data, axis=None, use_missing=False): - """Returns the rank (also known as order statistics) of each data point - along the given axis. - - If some values are tied, their rank is averaged. - If some values are masked, their rank is set to 0 if use_missing is False, - or set to the average rank of the unmasked values if use_missing is True. - - Parameters - ---------- - data : sequence - Input data. The data is transformed to a masked array - axis : integer - Axis along which to perform the ranking. - If None, the array is first flattened. An exception is raised if - the axis is specified for arrays with a dimension larger than 2 - use_missing : boolean - Whether the masked values have a rank of 0 (False) or equal to the - average rank of the unmasked values (True). - """ - # - def _rank1d(data, use_missing=False): - n = data.count() - rk = numpy.empty(data.size, dtype=float_) - idx = data.argsort() - rk[idx[:n]] = numpy.arange(1,n+1) - # - if use_missing: - rk[idx[n:]] = (n+1)/2. - else: - rk[idx[n:]] = 0 - # - repeats = find_repeats(data) - for r in repeats[0]: - condition = (data==r).filled(False) - rk[condition] = rk[condition].mean() - return rk - # - data = masked_array(data, copy=False) - if axis is None: - if data.ndim > 1: - return _rank1d(data.ravel(), use_missing).reshape(data.shape) - else: - return _rank1d(data, use_missing) - else: - return apply_along_axis(_rank1d, axis, data, use_missing) - -############################################################################### -if __name__ == '__main__': - - if 0: - from numpy.ma.testutils import assert_almost_equal - data = [0.706560797,0.727229578,0.990399276,0.927065621,0.158953014, - 0.887764025,0.239407086,0.349638551,0.972791145,0.149789972, - 0.936947700,0.132359948,0.046041972,0.641675031,0.945530547, - 0.224218684,0.771450991,0.820257774,0.336458052,0.589113496, - 0.509736129,0.696838829,0.491323573,0.622767425,0.775189248, - 0.641461450,0.118455200,0.773029450,0.319280007,0.752229111, - 0.047841438,0.466295911,0.583850781,0.840581845,0.550086491, - 0.466470062,0.504765074,0.226855960,0.362641207,0.891620942, - 0.127898691,0.490094097,0.044882048,0.041441695,0.317976349, - 0.504135618,0.567353033,0.434617473,0.636243375,0.231803616, - 0.230154113,0.160011327,0.819464108,0.854706985,0.438809221, - 0.487427267,0.786907310,0.408367937,0.405534192,0.250444460, - 0.995309248,0.144389588,0.739947527,0.953543606,0.680051621, - 0.388382017,0.863530727,0.006514031,0.118007779,0.924024803, - 0.384236354,0.893687694,0.626534881,0.473051932,0.750134705, - 0.241843555,0.432947602,0.689538104,0.136934797,0.150206859, - 0.474335206,0.907775349,0.525869295,0.189184225,0.854284286, - 0.831089744,0.251637345,0.587038213,0.254475554,0.237781276, - 0.827928620,0.480283781,0.594514455,0.213641488,0.024194386, - 0.536668589,0.699497811,0.892804071,0.093835427,0.731107772] - # - assert_almost_equal(hdquantiles(data,[0., 1.]), - [0.006514031, 0.995309248]) - hdq = hdquantiles(data,[0.25, 0.5, 0.75]) - assert_almost_equal(hdq, [0.253210762, 0.512847491, 0.762232442,]) - hdq = hdquantiles_sd(data,[0.25, 0.5, 0.75]) - assert_almost_equal(hdq, [0.03786954, 0.03805389, 0.03800152,], 4) - # - data = numpy.array(data).reshape(10,10) - hdq = hdquantiles(data,[0.25,0.5,0.75],axis=0) Deleted: trunk/numpy/ma/mstats.py =================================================================== --- trunk/numpy/ma/mstats.py 2008-04-24 05:14:41 UTC (rev 5076) +++ trunk/numpy/ma/mstats.py 2008-04-24 06:57:13 UTC (rev 5077) @@ -1,462 +0,0 @@ -""" -Generic statistics functions, with support to MA. - -:author: Pierre GF Gerard-Marchant -:contact: pierregm_at_uga_edu -:date: $Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $ -:version: $Id: mstats.py 3473 2007-10-29 15:18:13Z jarrod.millman $ -""" -__author__ = "Pierre GF Gerard-Marchant ($Author: jarrod.millman $)" -__version__ = '1.0' -__revision__ = "$Revision: 3473 $" -__date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $' - - -import numpy -from numpy import bool_, float_, int_, ndarray, \ - sqrt -from numpy import array as narray -import numpy.core.numeric as numeric -from numpy.core.numeric import concatenate - -import numpy.ma -from numpy.ma.core import masked, nomask, MaskedArray, masked_array -from numpy.ma.extras import apply_along_axis, dot, median as mmedian - -__all__ = ['cov','meppf','plotting_positions','meppf','mquantiles', - 'stde_median','trim_tail','trim_both','trimmed_mean','trimmed_stde', - 'winsorize'] - -#####-------------------------------------------------------------------------- -#---- -- Trimming --- -#####-------------------------------------------------------------------------- - -def winsorize(data, alpha=0.2): - """Returns a Winsorized version of the input array. - - The (alpha/2.) lowest values are set to the (alpha/2.)th percentile, - and the (alpha/2.) highest values are set to the (1-alpha/2.)th - percentile. - Masked values are skipped. - - Parameters - ---------- - data : ndarray - Input data to Winsorize. The data is first flattened. - alpha : float - Percentage of total Winsorization: alpha/2. on the left, - alpha/2. on the right - - """ - data = masked_array(data, copy=False).ravel() - idxsort = data.argsort() - (nsize, ncounts) = (data.size, data.count()) - ntrim = int(alpha * ncounts) - (xmin,xmax) = data[idxsort[[ntrim, ncounts-nsize-ntrim-1]]] - return masked_array(numpy.clip(data, xmin, xmax), mask=data._mask) - -#.............................................................................. -def trim_both(data, proportiontocut=0.2, axis=None): - """Trims the data by masking the int(trim*n) smallest and int(trim*n) - largest values of data along the given axis, where n is the number - of unmasked values. - - Parameters - ---------- - data : ndarray - Data to trim. - proportiontocut : float - Percentage of trimming. If n is the number of unmasked values - before trimming, the number of values after trimming is: - (1-2*trim)*n. - axis : int - Axis along which to perform the trimming. - If None, the input array is first flattened. - - Notes - ----- - The function works only for arrays up to 2D. - - """ - #................... - def _trim_1D(data, trim): - "Private function: return a trimmed 1D array." - nsize = data.size - ncounts = data.count() - ntrim = int(trim * ncounts) - idxsort = data.argsort() - data[idxsort[:ntrim]] = masked - data[idxsort[ncounts-nsize-ntrim:]] = masked - return data - #................... - data = masked_array(data, copy=False, subok=True) - data.unshare_mask() - if (axis is None): - return _trim_1D(data.ravel(), proportiontocut) - else: - assert data.ndim <= 2, "Array should be 2D at most !" - return apply_along_axis(_trim_1D, axis, data, proportiontocut) - -#.............................................................................. -def trim_tail(data, proportiontocut=0.2, tail='left', axis=None): - """Trims the data by masking int(trim*n) values from ONE tail of the - data along the given axis, where n is the number of unmasked values. - - Parameters - ---------- - data : ndarray - Data to trim. - proportiontocut : float - Percentage of trimming. If n is the number of unmasked values - before trimming, the number of values after trimming is - (1-trim)*n. - tail : string - Trimming direction, in ('left', 'right'). - If left, the ``proportiontocut`` lowest values are set to the - corresponding percentile. If right, the ``proportiontocut`` - highest values are used instead. - axis : int - Axis along which to perform the trimming. - If None, the input array is first flattened. - - Notes - ----- - The function works only for arrays up to 2D. - - """ - #................... - def _trim_1D(data, trim, left): - "Private function: return a trimmed 1D array." - nsize = data.size - ncounts = data.count() - ntrim = int(trim * ncounts) - idxsort = data.argsort() - if left: - data[idxsort[:ntrim]] = masked - else: - data[idxsort[ncounts-nsize-ntrim:]] = masked - return data - #................... - data = masked_array(data, copy=False, subok=True) - data.unshare_mask() - # - if not isinstance(tail, str): - raise TypeError("The tail argument should be in ('left','right')") - tail = tail.lower()[0] - if tail == 'l': - left = True - elif tail == 'r': - left=False - else: - raise ValueError("The tail argument should be in ('left','right')") - # - if (axis is None): - return _trim_1D(data.ravel(), proportiontocut, left) - else: - assert data.ndim <= 2, "Array should be 2D at most !" - return apply_along_axis(_trim_1D, axis, data, proportiontocut, left) - -#.............................................................................. -def trimmed_mean(data, proportiontocut=0.2, axis=None): - """Returns the trimmed mean of the data along the given axis. - Trimming is performed on both ends of the distribution. - - Parameters - ---------- - data : ndarray - Data to trim. - proportiontocut : float - Proportion of the data to cut from each side of the data . - As a result, (2*proportiontocut*n) values are actually trimmed. - axis : int - Axis along which to perform the trimming. - If None, the input array is first flattened. - - """ - return trim_both(data, proportiontocut=proportiontocut, axis=axis).mean(axis=axis) - -#.............................................................................. -def trimmed_stde(data, proportiontocut=0.2, axis=None): - """Returns the standard error of the trimmed mean for the input data, - along the given axis. Trimming is performed on both ends of the distribution. - - Parameters - ---------- - data : ndarray - Data to trim. - proportiontocut : float - Proportion of the data to cut from each side of the data . - As a result, (2*proportiontocut*n) values are actually trimmed. - axis : int - Axis along which to perform the trimming. - If None, the input array is first flattened. - - Notes - ----- - The function worrks with arrays up to 2D. - - """ - #........................ - def _trimmed_stde_1D(data, trim=0.2): - "Returns the standard error of the trimmed mean for a 1D input data." - winsorized = winsorize(data) - nsize = winsorized.count() - winstd = winsorized.std(ddof=1) - return winstd / ((1-2*trim) * numpy.sqrt(nsize)) - #........................ - data = masked_array(data, copy=False, subok=True) - data.unshare_mask() - if (axis is None): - return _trimmed_stde_1D(data.ravel(), proportiontocut) - else: - assert data.ndim <= 2, "Array should be 2D at most !" - return apply_along_axis(_trimmed_stde_1D, axis, data, proportiontocut) - -#............................................................................. -def stde_median(data, axis=None): - """Returns the McKean-Schrader estimate of the standard error of the sample -median along the given axis. - - Parameters - ---------- - data : ndarray - Data to trim. - axis : int - Axis along which to perform the trimming. - If None, the input array is first flattened. - - """ - def _stdemed_1D(data): - sorted = numpy.sort(data.compressed()) - n = len(sorted) - z = 2.5758293035489004 - k = int(round((n+1)/2. - z * sqrt(n/4.),0)) - return ((sorted[n-k] - sorted[k-1])/(2.*z)) - # - data = masked_array(data, copy=False, subok=True) - if (axis is None): - return _stdemed_1D(data) - else: - assert data.ndim <= 2, "Array should be 2D at most !" - return apply_along_axis(_stdemed_1D, axis, data) - - -#####-------------------------------------------------------------------------- -#---- --- Quantiles --- -#####-------------------------------------------------------------------------- - - -def mquantiles(data, prob=list([.25,.5,.75]), alphap=.4, betap=.4, axis=None): - """Computes empirical quantiles for a *1xN* data array. -Samples quantile are defined by: -*Q(p) = (1-g).x[i] +g.x[i+1]* -where *x[j]* is the jth order statistic, -with *i = (floor(n*p+m))*, *m=alpha+p*(1-alpha-beta)* and *g = n*p + m - i)*. - -Typical values of (alpha,beta) are: - - - (0,1) : *p(k) = k/n* : linear interpolation of cdf (R, type 4) - - (.5,.5) : *p(k) = (k+1/2.)/n* : piecewise linear function (R, type 5) - - (0,0) : *p(k) = k/(n+1)* : (R type 6) - - (1,1) : *p(k) = (k-1)/(n-1)*. In this case, p(k) = mode[F(x[k])]. - That's R default (R type 7) - - (1/3,1/3): *p(k) = (k-1/3)/(n+1/3)*. Then p(k) ~ median[F(x[k])]. - The resulting quantile estimates are approximately median-unbiased - regardless of the distribution of x. (R type 8) - - (3/8,3/8): *p(k) = (k-3/8)/(n+1/4)*. Blom. - The resulting quantile estimates are approximately unbiased - if x is normally distributed (R type 9) - - (.4,.4) : approximately quantile unbiased (Cunnane) - - (.35,.35): APL, used with PWM - -Parameters ----------- - x : sequence - Input data, as a sequence or array of dimension at most 2. - prob : sequence - List of quantiles to compute. - alpha : float - Plotting positions parameter. - beta : float - Plotting positions parameter. - axis : int - Axis along which to perform the trimming. If None, the input array is first - flattened. - """ - def _quantiles1D(data,m,p): - x = numpy.sort(data.compressed()) - n = len(x) - if n == 0: - return masked_array(numpy.empty(len(p), dtype=float_), mask=True) - elif n == 1: - return masked_array(numpy.resize(x, p.shape), mask=nomask) - aleph = (n*p + m) - k = numpy.floor(aleph.clip(1, n-1)).astype(int_) - gamma = (aleph-k).clip(0,1) - return (1.-gamma)*x[(k-1).tolist()] + gamma*x[k.tolist()] - - # Initialization & checks --------- - data = masked_array(data, copy=False) - p = narray(prob, copy=False, ndmin=1) - m = alphap + p*(1.-alphap-betap) - # Computes quantiles along axis (or globally) - if (axis is None): - return _quantiles1D(data, m, p) - else: - assert data.ndim <= 2, "Array should be 2D at most !" - return apply_along_axis(_quantiles1D, axis, data, m, p) - - -def plotting_positions(data, alpha=0.4, beta=0.4): - """Returns the plotting positions (or empirical percentile points) for the - data. - Plotting positions are defined as (i-alpha)/(n-alpha-beta), where: - - i is the rank order statistics - - n is the number of unmasked values along the given axis - - alpha and beta are two parameters. - - Typical values for alpha and beta are: - - (0,1) : *p(k) = k/n* : linear interpolation of cdf (R, type 4) - - (.5,.5) : *p(k) = (k-1/2.)/n* : piecewise linear function (R, type 5) - - (0,0) : *p(k) = k/(n+1)* : Weibull (R type 6) - - (1,1) : *p(k) = (k-1)/(n-1)*. In this case, p(k) = mode[F(x[k])]. - That's R default (R type 7) - - (1/3,1/3): *p(k) = (k-1/3)/(n+1/3)*. Then p(k) ~ median[F(x[k])]. - The resulting quantile estimates are approximately median-unbiased - regardless of the distribution of x. (R type 8) - - (3/8,3/8): *p(k) = (k-3/8)/(n+1/4)*. Blom. - The resulting quantile estimates are approximately unbiased - if x is normally distributed (R type 9) - - (.4,.4) : approximately quantile unbiased (Cunnane) - - (.35,.35): APL, used with PWM - -Parameters ----------- - x : sequence - Input data, as a sequence or array of dimension at most 2. - prob : sequence - List of quantiles to compute. - alpha : float - Plotting positions parameter. - beta : float - Plotting positions parameter. - - """ - data = masked_array(data, copy=False).reshape(1,-1) - n = data.count() - plpos = numpy.empty(data.size, dtype=float_) - plpos[n:] = 0 - plpos[data.argsort()[:n]] = (numpy.arange(1,n+1) - alpha)/(n+1-alpha-beta) - return masked_array(plpos, mask=data._mask) - -meppf = plotting_positions - - -def cov(x, y=None, rowvar=True, bias=False, strict=False): - """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. - -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 : ndarray - Optional set of variables. - rowvar : boolean - If rowvar is true, then each row is a variable with obersvations in columns. - If rowvar is False, each column is a variable and the observations are in - the rows. - bias : boolean - Whether to use a biased or unbiased 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) - strict : {boolean} - 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. - """ - X = narray(x, ndmin=2, subok=True, dtype=float) - if X.shape[0] == 1: - rowvar = True - if rowvar: - axis = 0 - tup = (slice(None),None) - else: - axis = 1 - tup = (None, slice(None)) - # - if y is not None: - y = narray(y, copy=False, ndmin=2, subok=True, dtype=float) - X = concatenate((X,y),axis) - # - X -= X.mean(axis=1-axis)[tup] - n = X.count(1-axis) - # - if bias: - fact = n*1.0 - else: - fact = n-1.0 - # - if not rowvar: - return (dot(X.T, X.conj(), strict=False) / fact).squeeze() - else: - return (dot(X, X.T.conj(), strict=False) / fact).squeeze() - - -def idealfourths(data, axis=None): - """Returns an estimate of the interquartile range of the data along the given -axis, as computed with the ideal fourths. - """ - def _idf(data): - x = numpy.sort(data.compressed()) - n = len(x) - (j,h) = divmod(n/4. + 5/12.,1) - qlo = (1-h)*x[j] + h*x[j+1] - k = n - j - qup = (1-h)*x[k] + h*x[k-1] - return qup - qlo - data = masked_array(data, copy=False) - if (axis is None): - return _idf(data) - else: - return apply_along_axis(_idf, axis, data) - - -def rsh(data, points=None): - """Evalutates Rosenblatt's shifted histogram estimators for each point -on the dataset 'data'. - -Parameters - data : sequence - Input data. Masked values are ignored. - points : sequence - Sequence of points where to evaluate Rosenblatt shifted histogram. - If None, use the data. - """ - data = masked_array(data, copy=False) - if points is None: - points = data - else: - points = numpy.array(points, copy=False, ndmin=1) - if data.ndim != 1: - raise AttributeError("The input array should be 1D only !") - n = data.count() - h = 1.2 * idealfourths(data) / n**(1./5) - nhi = (data[:,None] <= points[None,:] + h).sum(0) - nlo = (data[:,None] < points[None,:] - h).sum(0) - return (nhi-nlo) / (2.*n*h) - -################################################################################ -if __name__ == '__main__': - from numpy.ma.testutils import assert_almost_equal - if 1: - a = numpy.ma.arange(1,101) - a[1::2] = masked - b = numpy.ma.resize(a, (100,100)) - assert_almost_equal(mquantiles(b), [25., 50., 75.]) - assert_almost_equal(mquantiles(b, axis=0), numpy.ma.resize(a,(3,100))) - assert_almost_equal(mquantiles(b, axis=1), - numpy.ma.resize([24.9, 50., 75.1], (100,3))) From numpy-svn at scipy.org Thu Apr 24 20:48:35 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 24 Apr 2008 19:48:35 -0500 (CDT) Subject: [Numpy-svn] r5078 - trunk/numpy/ma/tests Message-ID: <20080425004835.92F7139C073@new.scipy.org> Author: pierregm Date: 2008-04-24 19:48:33 -0500 (Thu, 24 Apr 2008) New Revision: 5078 Removed: trunk/numpy/ma/tests/test_morestats.py trunk/numpy/ma/tests/test_mstats.py Log: removed tests/test_mstat and tests/test_morestats (now available in scipy) Deleted: trunk/numpy/ma/tests/test_morestats.py =================================================================== --- trunk/numpy/ma/tests/test_morestats.py 2008-04-24 06:57:13 UTC (rev 5077) +++ trunk/numpy/ma/tests/test_morestats.py 2008-04-25 00:48:33 UTC (rev 5078) @@ -1,114 +0,0 @@ -# pylint: disable-msg=W0611, W0612, W0511,R0201 -"""Tests suite for maskedArray statistics. - -:author: Pierre Gerard-Marchant -:contact: pierregm_at_uga_dot_edu -:version: $Id: test_morestats.py 317 2007-10-04 19:31:14Z backtopop $ -""" -__author__ = "Pierre GF Gerard-Marchant ($Author: backtopop $)" -__version__ = '1.0' -__revision__ = "$Revision: 317 $" -__date__ = '$Date: 2007-10-04 15:31:14 -0400 (Thu, 04 Oct 2007) $' - -import numpy - -import numpy.ma -from numpy.ma import masked, masked_array - -import numpy.ma.mstats -from numpy.ma.mstats import * -import numpy.ma.morestats -from numpy.ma.morestats import * - -import numpy.ma.testutils -from numpy.ma.testutils import * - - -class TestMisc(NumpyTestCase): - # - def __init__(self, *args, **kwargs): - NumpyTestCase.__init__(self, *args, **kwargs) - # - def test_mjci(self): - "Tests the Marits-Jarrett estimator" - data = masked_array([ 77, 87, 88,114,151,210,219,246,253,262, - 296,299,306,376,428,515,666,1310,2611]) - assert_almost_equal(mjci(data),[55.76819,45.84028,198.8788],5) - # - def test_trimmedmeanci(self): - "Tests the confidence intervals of the trimmed mean." - data = masked_array([545,555,558,572,575,576,578,580, - 594,605,635,651,653,661,666]) - assert_almost_equal(trimmed_mean(data,0.2), 596.2, 1) - assert_equal(numpy.round(trimmed_mean_ci(data,0.2),1), [561.8, 630.6]) - -#.............................................................................. -class TestRanking(NumpyTestCase): - # - def __init__(self, *args, **kwargs): - NumpyTestCase.__init__(self, *args, **kwargs) - # - def test_ranking(self): - x = masked_array([0,1,1,1,2,3,4,5,5,6,]) - assert_almost_equal(rank_data(x),[1,3,3,3,5,6,7,8.5,8.5,10]) - x[[3,4]] = masked - assert_almost_equal(rank_data(x),[1,2.5,2.5,0,0,4,5,6.5,6.5,8]) - assert_almost_equal(rank_data(x,use_missing=True), - [1,2.5,2.5,4.5,4.5,4,5,6.5,6.5,8]) - x = masked_array([0,1,5,1,2,4,3,5,1,6,]) - assert_almost_equal(rank_data(x),[1,3,8.5,3,5,7,6,8.5,3,10]) - x = masked_array([[0,1,1,1,2], [3,4,5,5,6,]]) - assert_almost_equal(rank_data(x),[[1,3,3,3,5],[6,7,8.5,8.5,10]]) - assert_almost_equal(rank_data(x,axis=1),[[1,3,3,3,5],[1,2,3.5,3.5,5]]) - assert_almost_equal(rank_data(x,axis=0),[[1,1,1,1,1],[2,2,2,2,2,]]) - -#.............................................................................. -class TestQuantiles(NumpyTestCase): - # - def __init__(self, *args, **kwargs): - NumpyTestCase.__init__(self, *args, **kwargs) - # - def test_hdquantiles(self): - data = [0.706560797,0.727229578,0.990399276,0.927065621,0.158953014, - 0.887764025,0.239407086,0.349638551,0.972791145,0.149789972, - 0.936947700,0.132359948,0.046041972,0.641675031,0.945530547, - 0.224218684,0.771450991,0.820257774,0.336458052,0.589113496, - 0.509736129,0.696838829,0.491323573,0.622767425,0.775189248, - 0.641461450,0.118455200,0.773029450,0.319280007,0.752229111, - 0.047841438,0.466295911,0.583850781,0.840581845,0.550086491, - 0.466470062,0.504765074,0.226855960,0.362641207,0.891620942, - 0.127898691,0.490094097,0.044882048,0.041441695,0.317976349, - 0.504135618,0.567353033,0.434617473,0.636243375,0.231803616, - 0.230154113,0.160011327,0.819464108,0.854706985,0.438809221, - 0.487427267,0.786907310,0.408367937,0.405534192,0.250444460, - 0.995309248,0.144389588,0.739947527,0.953543606,0.680051621, - 0.388382017,0.863530727,0.006514031,0.118007779,0.924024803, - 0.384236354,0.893687694,0.626534881,0.473051932,0.750134705, - 0.241843555,0.432947602,0.689538104,0.136934797,0.150206859, - 0.474335206,0.907775349,0.525869295,0.189184225,0.854284286, - 0.831089744,0.251637345,0.587038213,0.254475554,0.237781276, - 0.827928620,0.480283781,0.594514455,0.213641488,0.024194386, - 0.536668589,0.699497811,0.892804071,0.093835427,0.731107772] - # - assert_almost_equal(hdquantiles(data,[0., 1.]), - [0.006514031, 0.995309248]) - hdq = hdquantiles(data,[0.25, 0.5, 0.75]) - assert_almost_equal(hdq, [0.253210762, 0.512847491, 0.762232442,]) - hdq = hdquantiles_sd(data,[0.25, 0.5, 0.75]) - assert_almost_equal(hdq, [0.03786954, 0.03805389, 0.03800152,], 4) - # - data = numpy.array(data).reshape(10,10) - hdq = hdquantiles(data,[0.25,0.5,0.75],axis=0) - assert_almost_equal(hdq[:,0], hdquantiles(data[:,0],[0.25,0.5,0.75])) - assert_almost_equal(hdq[:,-1], hdquantiles(data[:,-1],[0.25,0.5,0.75])) - hdq = hdquantiles(data,[0.25,0.5,0.75],axis=0,var=True) - assert_almost_equal(hdq[...,0], - hdquantiles(data[:,0],[0.25,0.5,0.75],var=True)) - assert_almost_equal(hdq[...,-1], - hdquantiles(data[:,-1],[0.25,0.5,0.75], var=True)) - - -############################################################################### -#------------------------------------------------------------------------------ -if __name__ == "__main__": - NumpyTest().run() Deleted: trunk/numpy/ma/tests/test_mstats.py =================================================================== --- trunk/numpy/ma/tests/test_mstats.py 2008-04-24 06:57:13 UTC (rev 5077) +++ trunk/numpy/ma/tests/test_mstats.py 2008-04-25 00:48:33 UTC (rev 5078) @@ -1,175 +0,0 @@ -# pylint: disable-msg=W0611, W0612, W0511,R0201 -"""Tests suite for maskedArray statistics. - -:author: Pierre Gerard-Marchant -:contact: pierregm_at_uga_dot_edu -:version: $Id: test_mstats.py 3473 2007-10-29 15:18:13Z jarrod.millman $ -""" -__author__ = "Pierre GF Gerard-Marchant ($Author: jarrod.millman $)" -__version__ = '1.0' -__revision__ = "$Revision: 3473 $" -__date__ = '$Date: 2007-10-29 17:18:13 +0200 (Mon, 29 Oct 2007) $' - -import numpy - -import numpy.ma -from numpy.ma import masked, masked_array - -import numpy.ma.testutils -from numpy.ma.testutils import * - -from numpy.ma.mstats import * -from numpy.ma import median - -#.............................................................................. -class TestQuantiles(NumpyTestCase): - "Base test class for MaskedArrays." - def __init__(self, *args, **kwds): - NumpyTestCase.__init__(self, *args, **kwds) - self.a = numpy.ma.arange(1,101) - # - def test_1d_nomask(self): - "Test quantiles 1D - w/o mask." - a = self.a - assert_almost_equal(mquantiles(a, alphap=1., betap=1.), - [25.75, 50.5, 75.25]) - assert_almost_equal(mquantiles(a, alphap=0, betap=1.), - [25., 50., 75.]) - assert_almost_equal(mquantiles(a, alphap=0.5, betap=0.5), - [25.5, 50.5, 75.5]) - assert_almost_equal(mquantiles(a, alphap=0., betap=0.), - [25.25, 50.5, 75.75]) - assert_almost_equal(mquantiles(a, alphap=1./3, betap=1./3), - [25.41666667, 50.5, 75.5833333]) - assert_almost_equal(mquantiles(a, alphap=3./8, betap=3./8), - [25.4375, 50.5, 75.5625]) - assert_almost_equal(mquantiles(a), [25.45, 50.5, 75.55])# - # - def test_1d_mask(self): - "Test quantiles 1D - w/ mask." - a = self.a - a[1::2] = masked - assert_almost_equal(mquantiles(a, alphap=1., betap=1.), - [25.5, 50.0, 74.5]) - assert_almost_equal(mquantiles(a, alphap=0, betap=1.), - [24., 49., 74.]) - assert_almost_equal(mquantiles(a, alphap=0.5, betap=0.5), - [25., 50., 75.]) - assert_almost_equal(mquantiles(a, alphap=0., betap=0.), - [24.5, 50.0, 75.5]) - assert_almost_equal(mquantiles(a, alphap=1./3, betap=1./3), - [24.833333, 50.0, 75.166666]) - assert_almost_equal(mquantiles(a, alphap=3./8, betap=3./8), - [24.875, 50., 75.125]) - assert_almost_equal(mquantiles(a), [24.9, 50., 75.1]) - # - def test_2d_nomask(self): - "Test quantiles 2D - w/o mask." - a = self.a - b = numpy.ma.resize(a, (100,100)) - assert_almost_equal(mquantiles(b), [25.45, 50.5, 75.55]) - assert_almost_equal(mquantiles(b, axis=0), numpy.ma.resize(a,(3,100))) - assert_almost_equal(mquantiles(b, axis=1), - numpy.ma.resize([25.45, 50.5, 75.55], (100,3))) - # - def test_2d_mask(self): - "Test quantiles 2D - w/ mask." - a = self.a - a[1::2] = masked - b = numpy.ma.resize(a, (100,100)) - assert_almost_equal(mquantiles(b), [25., 50., 75.]) - assert_almost_equal(mquantiles(b, axis=0), numpy.ma.resize(a,(3,100))) - assert_almost_equal(mquantiles(b, axis=1), - numpy.ma.resize([24.9, 50., 75.1], (100,3))) - -class TestMedian(NumpyTestCase): - def __init__(self, *args, **kwds): - NumpyTestCase.__init__(self, *args, **kwds) - - def test_2d(self): - "Tests median w/ 2D" - (n,p) = (101,30) - x = masked_array(numpy.linspace(-1.,1.,n),) - x[:10] = x[-10:] = masked - z = masked_array(numpy.empty((n,p), dtype=numpy.float_)) - z[:,0] = x[:] - idx = numpy.arange(len(x)) - for i in range(1,p): - numpy.random.shuffle(idx) - z[:,i] = x[idx] - assert_equal(median(z[:,0]), 0) - assert_equal(median(z), numpy.zeros((p,))) - - def test_3d(self): - "Tests median w/ 3D" - x = numpy.ma.arange(24).reshape(3,4,2) - x[x%3==0] = masked - assert_equal(median(x,0), [[12,9],[6,15],[12,9],[18,15]]) - x.shape = (4,3,2) - assert_equal(median(x,0),[[99,10],[11,99],[13,14]]) - x = numpy.ma.arange(24).reshape(4,3,2) - x[x%5==0] = masked - assert_equal(median(x,0), [[12,10],[8,9],[16,17]]) - -#.............................................................................. -class TestTrimming(NumpyTestCase): - # - def __init__(self, *args, **kwds): - NumpyTestCase.__init__(self, *args, **kwds) - # - def test_trim(self): - "Tests trimming." - x = numpy.ma.arange(100) - assert_equal(trim_both(x).count(), 60) - assert_equal(trim_tail(x,tail='r').count(), 80) - x[50:70] = masked - trimx = trim_both(x) - assert_equal(trimx.count(), 48) - assert_equal(trimx._mask, [1]*16 + [0]*34 + [1]*20 + [0]*14 + [1]*16) - x._mask = nomask - x.shape = (10,10) - assert_equal(trim_both(x).count(), 60) - assert_equal(trim_tail(x).count(), 80) - # - def test_trimmedmean(self): - "Tests the trimmed mean." - data = masked_array([ 77, 87, 88,114,151,210,219,246,253,262, - 296,299,306,376,428,515,666,1310,2611]) - assert_almost_equal(trimmed_mean(data,0.1), 343, 0) - assert_almost_equal(trimmed_mean(data,0.2), 283, 0) - # - def test_trimmed_stde(self): - "Tests the trimmed mean standard error." - data = masked_array([ 77, 87, 88,114,151,210,219,246,253,262, - 296,299,306,376,428,515,666,1310,2611]) - assert_almost_equal(trimmed_stde(data,0.2), 56.1, 1) - # - def test_winsorization(self): - "Tests the Winsorization of the data." - data = masked_array([ 77, 87, 88,114,151,210,219,246,253,262, - 296,299,306,376,428,515,666,1310,2611]) - assert_almost_equal(winsorize(data).var(ddof=1), 21551.4, 1) - data[5] = masked - winsorized = winsorize(data) - assert_equal(winsorized.mask, data.mask) -#.............................................................................. - -class TestMisc(NumpyTestCase): - def __init__(self, *args, **kwds): - NumpyTestCase.__init__(self, *args, **kwds) - - def check_cov(self): - "Tests the cov function." - x = masked_array([[1,2,3],[4,5,6]], mask=[[1,0,0],[0,0,0]]) - c = cov(x[0]) - assert_equal(c, (x[0].anom()**2).sum()) - c = cov(x[1]) - assert_equal(c, (x[1].anom()**2).sum()/2.) - c = cov(x) - assert_equal(c[1,0], (x[0].anom()*x[1].anom()).sum()) - - -############################################################################### -#------------------------------------------------------------------------------ -if __name__ == "__main__": - NumpyTest().run() From numpy-svn at scipy.org Thu Apr 24 22:23:36 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 24 Apr 2008 21:23:36 -0500 (CDT) Subject: [Numpy-svn] r5079 - trunk/numpy/core/src Message-ID: <20080425022336.C8E2B39C01A@new.scipy.org> Author: charris Date: 2008-04-24 21:23:31 -0500 (Thu, 24 Apr 2008) New Revision: 5079 Modified: trunk/numpy/core/src/arrayobject.c Log: Coding style cleanups. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-04-25 00:48:33 UTC (rev 5078) +++ trunk/numpy/core/src/arrayobject.c 2008-04-25 02:23:31 UTC (rev 5079) @@ -7061,8 +7061,7 @@ } } else if (PyLong_Check(op)) { - /* if integer can fit into a longlong then return that - */ + /* if integer can fit into a longlong then return that*/ if ((PyLong_AsLongLong(op) == -1) && PyErr_Occurred()) { PyErr_Clear(); return PyArray_DescrFromType(PyArray_OBJECT); @@ -7325,8 +7324,10 @@ if (itemsize == 0 && PyTypeNum_ISEXTENDED(type)) { itemsize = PyObject_Length(op); - if (type == PyArray_UNICODE) itemsize *= 4; + if (type == PyArray_UNICODE) { + itemsize *= 4; + } if (itemsize != typecode->elsize) { PyArray_DESCR_REPLACE(typecode); typecode->elsize = itemsize; @@ -7336,7 +7337,9 @@ ret = (PyArrayObject *)PyArray_NewFromDescr(&PyArray_Type, typecode, 0, NULL, NULL, NULL, 0, NULL); - if (ret == NULL) return NULL; + if (ret == NULL) { + return NULL; + } if (ret->nd > 0) { PyErr_SetString(PyExc_ValueError, "shape-mismatch on array construction"); @@ -7345,11 +7348,11 @@ } ret->descr->f->setitem(op, ret->data, ret); - if (PyErr_Occurred()) { Py_DECREF(ret); return NULL; - } else { + } + else { return (PyObject *)ret; } } @@ -7368,28 +7371,47 @@ { intp *newdims, *test_dims; int nd, test_nd; - int i, islist; + int i, islist, istuple; intp size; PyObject *obj; islist = PyList_Check(s); - if (!(islist || PyTuple_Check(s)) || - ((size = PySequence_Size(s)) == 0)) + istuple = PyTuple_Check(s); + if (!(islist || istuple)) { return 0; + } + + size = PySequence_Size(s); + if (size == 0) { + return 0; + } + if (max < 1) { + return 0; + } if (max < 2) { - if (max < 1) return 0; dims[0] = size; return 1; } - newdims = PyDimMem_NEW(2*(max-1)); - test_dims = newdims + (max-1); - if (islist) obj = PyList_GET_ITEM(s, 0); - else obj = PyTuple_GET_ITEM(s, 0); - nd = object_depth_and_dimension(obj, max-1, newdims); - for (i=1; i 0)) { - if (nd==0) + if (nd==0) { return Array_FromPyScalar(s, typecode); + } PyErr_SetString(PyExc_ValueError, "invalid input sequence"); goto fail; @@ -7478,15 +7509,20 @@ goto fail; } - if(discover_dimensions(s,nd,d, check_it) == -1) goto fail; - + if(discover_dimensions(s,nd,d, check_it) == -1) { + goto fail; + } if (typecode->type == PyArray_CHARLTR && nd > 0 && d[nd-1]==1) { nd = nd-1; } if (itemsize == 0 && PyTypeNum_ISEXTENDED(type)) { - if (discover_itemsize(s, nd, &itemsize) == -1) goto fail; - if (type == PyArray_UNICODE) itemsize*=4; + if (discover_itemsize(s, nd, &itemsize) == -1) { + goto fail; + } + if (type == PyArray_UNICODE) { + itemsize*=4; + } } if (itemsize != typecode->elsize) { @@ -7494,12 +7530,14 @@ typecode->elsize = itemsize; } - r=(PyArrayObject*)PyArray_NewFromDescr(&PyArray_Type, typecode, - nd, d, - NULL, NULL, - fortran, NULL); + r = (PyArrayObject*)PyArray_NewFromDescr(&PyArray_Type, typecode, + nd, d, + NULL, NULL, + fortran, NULL); - if(!r) return NULL; + if (!r) { + return NULL; + } if(Assign_Array(r,s) == -1) { Py_DECREF(r); return NULL; @@ -7522,7 +7560,9 @@ int res=TRUE; descr = PyArray_DescrFromType(type); - if (descr==NULL) res = FALSE; + if (descr == NULL) { + res = FALSE; + } Py_DECREF(descr); return res; } @@ -7531,8 +7571,8 @@ /* steals reference to at --- cannot be NULL*/ /*OBJECT_API - Cast an array using typecode structure. -*/ + *Cast an array using typecode structure. + */ static PyObject * PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran) { @@ -7555,15 +7595,20 @@ if (at->elsize == 0) { PyArray_DESCR_REPLACE(at); - if (at == NULL) return NULL; - if (mpd->type_num == PyArray_STRING && \ - at->type_num == PyArray_UNICODE) + if (at == NULL) { + return NULL; + } + if (mpd->type_num == PyArray_STRING && + at->type_num == PyArray_UNICODE) { at->elsize = mpd->elsize << 2; + } if (mpd->type_num == PyArray_UNICODE && - at->type_num == PyArray_STRING) + at->type_num == PyArray_STRING) { at->elsize = mpd->elsize >> 2; - if (at->type_num == PyArray_VOID) + } + if (at->type_num == PyArray_VOID) { at->elsize = mpd->elsize; + } } out = PyArray_NewFromDescr(mp->ob_type, at, @@ -7573,9 +7618,13 @@ fortran, (PyObject *)mp); - if (out == NULL) return NULL; + if (out == NULL) { + return NULL; + } ret = PyArray_CastTo((PyArrayObject *)out, mp); - if (ret != -1) return out; + if (ret != -1) { + return out; + } Py_DECREF(out); return NULL; @@ -7599,6 +7648,7 @@ if (obj && PyDict_Check(obj)) { PyObject *key; PyObject *cobj; + key = PyInt_FromLong(type_num); cobj = PyDict_GetItem(obj, key); Py_DECREF(key); @@ -7606,9 +7656,13 @@ castfunc = PyCObject_AsVoidPtr(cobj); } } - if (castfunc) return castfunc; + if (castfunc) { + return castfunc; + } } - else return castfunc; + else { + return castfunc; + } PyErr_SetString(PyExc_ValueError, "No cast function available."); @@ -7673,10 +7727,12 @@ NPY_BEGIN_THREADS_DEF - delsize = PyArray_ITEMSIZE(out); + delsize = PyArray_ITEMSIZE(out); selsize = PyArray_ITEMSIZE(in); multi = (PyArrayMultiIterObject *)PyArray_MultiIterNew(2, out, in); - if (multi == NULL) return -1; + if (multi == NULL) { + return -1; + } if (multi->size != PyArray_SIZE(out)) { PyErr_SetString(PyExc_ValueError, @@ -7713,15 +7769,17 @@ PyErr_NoMemory(); return -1; } - if (PyDataType_FLAGCHK(out->descr, NPY_NEEDS_INIT)) + if (PyDataType_FLAGCHK(out->descr, NPY_NEEDS_INIT)) { memset(buffers[0], 0, N*delsize); - if (PyDataType_FLAGCHK(in->descr, NPY_NEEDS_INIT)) + } + if (PyDataType_FLAGCHK(in->descr, NPY_NEEDS_INIT)) { memset(buffers[1], 0, N*selsize); + } #if NPY_ALLOW_THREADS if (PyArray_ISNUMBER(in) && PyArray_ISNUMBER(out)) { NPY_BEGIN_THREADS - } + } #endif while(multi->index < multi->size) { @@ -7738,22 +7796,26 @@ #if NPY_ALLOW_THREADS if (PyArray_ISNUMBER(in) && PyArray_ISNUMBER(out)) { NPY_END_THREADS - } + } #endif Py_DECREF(multi); if (PyDataType_REFCHK(in->descr)) { obptr = buffers[1]; - for (i=0; idescr); + } } if (PyDataType_REFCHK(out->descr)) { obptr = buffers[0]; - for (i=0; idescr); + } } _pya_free(buffers[0]); _pya_free(buffers[1]); - if (PyErr_Occurred()) return -1; + if (PyErr_Occurred()) { + return -1; + } return 0; } @@ -7780,7 +7842,9 @@ NPY_BEGIN_THREADS_DEF - if (mpsize == 0) return 0; + if (mpsize == 0) { + return 0; + } if (!PyArray_ISWRITEABLE(out)) { PyErr_SetString(PyExc_ValueError, "output array is not writeable"); @@ -7788,7 +7852,9 @@ } castfunc = PyArray_GetCastFunc(mp->descr, out->descr->type_num); - if (castfunc == NULL) return -1; + if (castfunc == NULL) { + return -1; + } same = PyArray_SAMESHAPE(out, mp); @@ -7799,15 +7865,19 @@ #if NPY_ALLOW_THREADS if (PyArray_ISNUMBER(mp) && PyArray_ISNUMBER(out)) { - NPY_BEGIN_THREADS } + NPY_BEGIN_THREADS + } #endif castfunc(mp->data, out->data, mpsize, mp, out); #if NPY_ALLOW_THREADS if (PyArray_ISNUMBER(mp) && PyArray_ISNUMBER(out)) { - NPY_END_THREADS } + NPY_END_THREADS + } #endif - if (PyErr_Occurred()) return -1; + if (PyErr_Occurred()) { + return -1; + } return 0; } @@ -7990,11 +8060,15 @@ subtype = arr->ob_type; - if (newtype == NULL) {newtype = oldtype; Py_INCREF(oldtype);} + if (newtype == NULL) { + newtype = oldtype; Py_INCREF(oldtype); + } itemsize = newtype->elsize; if (itemsize == 0) { PyArray_DESCR_REPLACE(newtype); - if (newtype == NULL) return NULL; + if (newtype == NULL) { + return NULL; + } newtype->elsize = oldtype->elsize; itemsize = newtype->elsize; } @@ -8039,9 +8113,13 @@ NULL, NULL, flags & FORTRAN, (PyObject *)arr); - if (ret == NULL) return NULL; - if (PyArray_CopyInto(ret, arr) == -1) - {Py_DECREF(ret); return NULL;} + if (ret == NULL) { + return NULL; + } + if (PyArray_CopyInto(ret, arr) == -1) { + Py_DECREF(ret); + return NULL; + } if (flags & UPDATEIFCOPY) { ret->flags |= UPDATEIFCOPY; ret->base = (PyObject *)arr; @@ -8064,7 +8142,9 @@ arr->strides, arr->data, arr->flags,NULL); - if (ret == NULL) return NULL; + if (ret == NULL) { + return NULL; + } ret->base = (PyObject *)arr; } else { @@ -8092,7 +8172,9 @@ NULL, NULL, flags & FORTRAN, (PyObject *)arr); - if (ret == NULL) return NULL; + if (ret == NULL) { + return NULL; + } if (PyArray_CastTo(ret, arr) < 0) { Py_DECREF(ret); return NULL; @@ -8490,19 +8572,28 @@ /* Is input object already an array? */ /* This is where the flags are used */ - if (PyArray_Check(op)) + if (PyArray_Check(op)) { r = PyArray_FromArray((PyArrayObject *)op, newtype, flags); + } else if (PyArray_IsScalar(op, Generic)) { - if (flags & UPDATEIFCOPY) goto err; + if (flags & UPDATEIFCOPY) { + goto err; + } r = PyArray_FromScalar(op, newtype); - } else if (newtype == NULL && + } + else if (newtype == NULL && (newtype = _array_find_python_scalar_type(op))) { - if (flags & UPDATEIFCOPY) goto err; + if (flags & UPDATEIFCOPY) { + goto err; + } r = Array_FromPyScalar(op, newtype); } else if (PyArray_HasArrayInterfaceType(op, newtype, context, r)) { PyObject *new; - if (r == NULL) {Py_XDECREF(newtype); return NULL;} + if (r == NULL) { + Py_XDECREF(newtype); + return NULL; + } if (newtype != NULL || flags != 0) { new = PyArray_FromArray((PyArrayObject *)r, newtype, flags); @@ -8511,8 +8602,11 @@ } } else { - int isobject=0; - if (flags & UPDATEIFCOPY) goto err; + int isobject = 0; + + if (flags & UPDATEIFCOPY) { + goto err; + } if (newtype == NULL) { newtype = _array_find_type(op, NULL, MAX_DIMS); } @@ -8520,18 +8614,21 @@ isobject = 1; } if (PySequence_Check(op)) { - PyObject *thiserr=NULL; + PyObject *thiserr = NULL; + /* necessary but not sufficient */ Py_INCREF(newtype); r = Array_FromSequence(op, newtype, flags & FORTRAN, min_depth, max_depth); if (r == NULL && (thiserr=PyErr_Occurred())) { if (PyErr_GivenExceptionMatches(thiserr, - PyExc_MemoryError)) + PyExc_MemoryError)) { return NULL; - /* If object was explicitly requested, - then try nested list object array creation - */ + } + /* + * If object was explicitly requested, + * then try nested list object array creation + */ PyErr_Clear(); if (isobject) { Py_INCREF(newtype); @@ -8546,12 +8643,15 @@ Py_DECREF(newtype); } } - if (!seq) + if (!seq) { r = Array_FromPyScalar(op, newtype); + } } /* If we didn't succeed return NULL */ - if (r == NULL) return NULL; + if (r == NULL) { + return NULL; + } /* Be sure we succeed here */ From numpy-svn at scipy.org Thu Apr 24 23:01:34 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Thu, 24 Apr 2008 22:01:34 -0500 (CDT) Subject: [Numpy-svn] r5080 - trunk/numpy/core/src Message-ID: <20080425030134.E086B39C11C@new.scipy.org> Author: charris Date: 2008-04-24 22:01:33 -0500 (Thu, 24 Apr 2008) New Revision: 5080 Modified: trunk/numpy/core/src/arrayobject.c Log: Fix ticket #736. Try to cast strings numeric types when numbers needed. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-04-25 02:23:31 UTC (rev 5079) +++ trunk/numpy/core/src/arrayobject.c 2008-04-25 03:01:33 UTC (rev 5080) @@ -7479,11 +7479,8 @@ check_it = (typecode->type != PyArray_CHARLTR); - stop_at_string = ((type == PyArray_OBJECT) || - (type == PyArray_STRING && - typecode->type == PyArray_STRINGLTR) || - (type == PyArray_UNICODE) || - (type == PyArray_VOID)); + stop_at_string = (type != PyArray_STRING) || + (typecode->type == PyArray_STRINGLTR); stop_at_tuple = (type == PyArray_VOID && (typecode->names \ || typecode->subarray)); @@ -8613,7 +8610,7 @@ else if (newtype->type_num == PyArray_OBJECT) { isobject = 1; } - if (PySequence_Check(op)) { + if (!PyString_Check(op) && PySequence_Check(op)) { PyObject *thiserr = NULL; /* necessary but not sufficient */ From numpy-svn at scipy.org Fri Apr 25 02:01:54 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 25 Apr 2008 01:01:54 -0500 (CDT) Subject: [Numpy-svn] r5081 - trunk/numpy/core/src Message-ID: <20080425060154.2660639C122@new.scipy.org> Author: charris Date: 2008-04-25 01:01:52 -0500 (Fri, 25 Apr 2008) New Revision: 5081 Modified: trunk/numpy/core/src/arrayobject.c Log: Some cleanups Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-04-25 03:01:33 UTC (rev 5080) +++ trunk/numpy/core/src/arrayobject.c 2008-04-25 06:01:52 UTC (rev 5081) @@ -4173,36 +4173,44 @@ if (nd == 0) { - if ((op = descr->f->getitem(data, self)) == NULL) return -1; + if ((op = descr->f->getitem(data, self)) == NULL) { + return -1; + } sp = PyObject_Repr(op); - if (sp == NULL) {Py_DECREF(op); return -1;} + if (sp == NULL) { + Py_DECREF(op); + return -1; + } ostring = PyString_AsString(sp); N = PyString_Size(sp)*sizeof(char); *n += N; CHECK_MEMORY - memmove(*string+(*n-N), ostring, N); + memmove(*string + (*n - N), ostring, N); Py_DECREF(sp); Py_DECREF(op); return 0; - } else { + } + else { CHECK_MEMORY (*string)[*n] = '['; *n += 1; - for(i=0; idata, self->nd, self->dimensions, self->strides, self) < 0) { - _pya_free(string); return NULL; + _pya_free(string); + return NULL; } if (repr) { From numpy-svn at scipy.org Fri Apr 25 02:03:19 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 25 Apr 2008 01:03:19 -0500 (CDT) Subject: [Numpy-svn] r5082 - trunk/numpy/core/src Message-ID: <20080425060319.A1E9D39C122@new.scipy.org> Author: charris Date: 2008-04-25 01:03:18 -0500 (Fri, 25 Apr 2008) New Revision: 5082 Modified: trunk/numpy/core/src/scalartypes.inc.src Log: Code style cleanups. Modified: trunk/numpy/core/src/scalartypes.inc.src =================================================================== --- trunk/numpy/core/src/scalartypes.inc.src 2008-04-25 06:01:52 UTC (rev 5081) +++ trunk/numpy/core/src/scalartypes.inc.src 2008-04-25 06:03:18 UTC (rev 5082) @@ -621,75 +621,50 @@ #define LONGDOUBLEPREC_STR 12 #endif -/* floattype_str */ +/* + * float type str and repr + */ /**begin repeat - -#name=float, double, longdouble# -#Name=Float, Double, LongDouble# -#NAME=FLOAT, DOUBLE, LONGDOUBLE# -*/ + * #name=float, double, longdouble# + * #Name=Float, Double, LongDouble# + * #NAME=FLOAT, DOUBLE, LONGDOUBLE# + */ +/**begin repeat1 + * #kind = str, repr# + * #KIND = STR, REPR# + */ static PyObject * - at name@type_str(PyObject *self) + at name@type_ at kind@(PyObject *self) { static char buf[100]; format_ at name@(buf, sizeof(buf), - ((Py at Name@ScalarObject *)self)->obval, @NAME at PREC_STR); + ((Py at Name@ScalarObject *)self)->obval, @NAME at PREC_@KIND@); return PyString_FromString(buf); } static PyObject * -c at name@type_str(PyObject *self) +c at name@type_ at kind@(PyObject *self) { static char buf1[100]; static char buf2[100]; static char buf3[202]; c at name@ x; x = ((PyC at Name@ScalarObject *)self)->obval; - format_ at name@(buf1, sizeof(buf1), x.real, @NAME at PREC_STR); - format_ at name@(buf2, sizeof(buf2), x.imag, @NAME at PREC_STR); + format_ at name@(buf1, sizeof(buf1), x.real, @NAME at PREC_@KIND@); + format_ at name@(buf2, sizeof(buf2), x.imag, @NAME at PREC_@KIND@); snprintf(buf3, sizeof(buf3), "(%s+%sj)", buf1, buf2); return PyString_FromString(buf3); } +/**end repeat1**/ /**end repeat**/ -/* floattype_repr */ -/**begin repeat -#name=float, double, longdouble# -#Name=Float, Double, LongDouble# -#NAME=FLOAT, DOUBLE, LONGDOUBLE# -*/ -static PyObject * - at name@type_repr(PyObject *self) -{ - static char buf[100]; - format_ at name@(buf, sizeof(buf), - ((Py at Name@ScalarObject *)self)->obval, @NAME at PREC_REPR); - return PyString_FromString(buf); -} +/* + * Could improve this with a PyLong_FromLongDouble(longdouble ldval) + * but this would need some more work... + */ -static PyObject * -c at name@type_repr(PyObject *self) -{ - static char buf1[100]; - static char buf2[100]; - static char buf3[202]; - c at name@ x; - x = ((PyC at Name@ScalarObject *)self)->obval; - format_ at name@(buf1, sizeof(buf1), x.real, @NAME at PREC_REPR); - format_ at name@(buf2, sizeof(buf2), x.imag, @NAME at PREC_REPR); - - snprintf(buf3, sizeof(buf3), "(%s+%sj)", buf1, buf2); - return PyString_FromString(buf3); -} -/**end repeat**/ - - -/** Could improve this with a PyLong_FromLongDouble(longdouble ldval) - but this would need some more work... -**/ - /**begin repeat #name=(int, long, hex, oct, float)*2# @@ -2385,7 +2360,7 @@ static PyTypeObject PyObjectArrType_Type = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ - "numpy.object_", /*tp_name*/ + "numpy.object_", /*tp_name*/ sizeof(PyObjectScalarObject), /*tp_basicsize*/ 0, /* tp_itemsize */ (destructor)object_arrtype_dealloc, /* tp_dealloc */ @@ -2400,8 +2375,8 @@ 0, /* tp_hash */ (ternaryfunc)object_arrtype_call, /* tp_call */ 0, /* tp_str */ - (getattrofunc)object_arrtype_getattro, /* tp_getattro */ - (setattrofunc)object_arrtype_setattro, /* tp_setattro */ + (getattrofunc)object_arrtype_getattro, /* tp_getattro */ + (setattrofunc)object_arrtype_setattro, /* tp_setattro */ &object_arrtype_as_buffer, /* tp_as_buffer */ 0, /* tp_flags */ }; @@ -2410,7 +2385,7 @@ static PyObject * add_new_axes_0d(PyArrayObject *, int); -static int +static int count_new_axes_0d(PyObject *); static PyObject * @@ -2418,7 +2393,7 @@ { /* Only [...], [...,], [, ...], is allowed for indexing a scalar - + These return a new N-d array with a copy of the data where N is the number of None's in . @@ -2536,27 +2511,27 @@ #endif static PyTypeObject Py at NAME@ArrType_Type = { PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ - "numpy. at name@" _THIS_SIZE1, /*tp_name*/ - sizeof(Py at NAME@ScalarObject), /*tp_basicsize*/ - 0, /*tp_itemsize*/ - 0, /*tp_dealloc*/ - 0, /*tp_print*/ - 0, /*tp_getattr*/ - 0, /*tp_setattr*/ - 0, /*tp_compare*/ - 0, /*tp_repr*/ - 0, /*tp_as_number*/ - 0, /*tp_as_sequence*/ - 0, /*tp_as_mapping*/ - 0, /*tp_hash */ - 0, /*tp_call*/ - 0, /*tp_str*/ - 0, /*tp_getattro*/ - 0, /*tp_setattro*/ - 0, /*tp_as_buffer*/ - Py_TPFLAGS_DEFAULT, /*tp_flags*/ - "Composed of two " _THIS_SIZE2 " bit floats", /* tp_doc */ + 0, /*ob_size*/ + "numpy. at name@" _THIS_SIZE1, /*tp_name*/ + sizeof(Py at NAME@ScalarObject), /*tp_basicsize*/ + 0, /*tp_itemsize*/ + 0, /*tp_dealloc*/ + 0, /*tp_print*/ + 0, /*tp_getattr*/ + 0, /*tp_setattr*/ + 0, /*tp_compare*/ + 0, /*tp_repr*/ + 0, /*tp_as_number*/ + 0, /*tp_as_sequence*/ + 0, /*tp_as_mapping*/ + 0, /*tp_hash */ + 0, /*tp_call*/ + 0, /*tp_str*/ + 0, /*tp_getattro*/ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT, /*tp_flags*/ + "Composed of two " _THIS_SIZE2 " bit floats", /* tp_doc */ }; #undef _THIS_SIZE1 #undef _THIS_SIZE2 @@ -2649,8 +2624,8 @@ #endif /**begin repeat -#name=repr, str# - */ + *#name = repr, str# + */ PyFloatArrType_Type.tp_ at name@ = floattype_ at name@; PyCFloatArrType_Type.tp_ at name@ = cfloattype_ at name@; From numpy-svn at scipy.org Fri Apr 25 03:24:53 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 25 Apr 2008 02:24:53 -0500 (CDT) Subject: [Numpy-svn] r5083 - trunk/numpy/core/tests Message-ID: <20080425072453.1249139C0EA@new.scipy.org> Author: charris Date: 2008-04-25 02:24:51 -0500 (Fri, 25 Apr 2008) New Revision: 5083 Modified: trunk/numpy/core/tests/test_multiarray.py Log: Add test for numeric type array creation from string values. Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2008-04-25 06:03:18 UTC (rev 5082) +++ trunk/numpy/core/tests/test_multiarray.py 2008-04-25 07:24:51 UTC (rev 5083) @@ -4,6 +4,7 @@ from numpy.testing import * from numpy.core import * + class TestFlags(NumpyTestCase): def setUp(self): self.a = arange(10) @@ -268,6 +269,14 @@ pass self.failUnlessRaises(ValueError, array, x()) + def check_from_string(self) : + types = np.typecodes['AllInteger'] + np.typecodes['Float'] + nstr = ['123','123'] + result = array([123, 123], dtype=int) + for type in types : + msg = 'String conversion for %s' % type + assert_equal(array(nstr, dtype=type), result, err_msg=msg) + class TestBool(NumpyTestCase): def check_test_interning(self): a0 = bool_(0) From numpy-svn at scipy.org Fri Apr 25 13:31:31 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 25 Apr 2008 12:31:31 -0500 (CDT) Subject: [Numpy-svn] r5084 - in trunk/numpy/core: . tests Message-ID: <20080425173131.9B5AB39C4C7@new.scipy.org> Author: stefan Date: 2008-04-25 12:31:19 -0500 (Fri, 25 Apr 2008) New Revision: 5084 Modified: trunk/numpy/core/defmatrix.py trunk/numpy/core/tests/test_defmatrix.py Log: Revert x[0][0] hack. Modified: trunk/numpy/core/defmatrix.py =================================================================== --- trunk/numpy/core/defmatrix.py 2008-04-25 07:24:51 UTC (rev 5083) +++ trunk/numpy/core/defmatrix.py 2008-04-25 17:31:19 UTC (rev 5084) @@ -225,13 +225,6 @@ def __getitem__(self, index): self._getitem = True - # If indexing by scalar, check whether we are indexing into - # a vector, and then return the corresponding element - if N.isscalar(index) and (1 in self.shape): - index = [index,index] - index[list(self.shape).index(1)] = 0 - index = tuple(index) - try: out = N.ndarray.__getitem__(self, index) finally: Modified: trunk/numpy/core/tests/test_defmatrix.py =================================================================== --- trunk/numpy/core/tests/test_defmatrix.py 2008-04-25 07:24:51 UTC (rev 5083) +++ trunk/numpy/core/tests/test_defmatrix.py 2008-04-25 17:31:19 UTC (rev 5084) @@ -179,16 +179,16 @@ x[:,1] = y>0.5 assert_equal(x, [[0,1],[0,0],[0,0]]) - def check_vector_element(self): - x = matrix([[1,2,3],[4,5,6]]) - assert_equal(x[0][0],1) - assert_equal(x[0].shape,(1,3)) - assert_equal(x[:,0].shape,(2,1)) +## def check_vector_element(self): +## x = matrix([[1,2,3],[4,5,6]]) +## assert_equal(x[0][0],1) +## assert_equal(x[0].shape,(1,3)) +## assert_equal(x[:,0].shape,(2,1)) - x = matrix(0) - assert_equal(x[0,0],0) - assert_equal(x[0],0) - assert_equal(x[:,0].shape,x.shape) +## x = matrix(0) +## assert_equal(x[0,0],0) +## assert_equal(x[0],0) +## assert_equal(x[:,0].shape,x.shape) if __name__ == "__main__": From numpy-svn at scipy.org Fri Apr 25 13:41:08 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 25 Apr 2008 12:41:08 -0500 (CDT) Subject: [Numpy-svn] r5085 - in trunk/numpy/lib: . tests Message-ID: <20080425174108.F416739C4E5@new.scipy.org> Author: dhuard Date: 2008-04-25 12:41:04 -0500 (Fri, 25 Apr 2008) New Revision: 5085 Modified: trunk/numpy/lib/function_base.py trunk/numpy/lib/tests/test_function_base.py Log: Modified histogram according to the discussion on the numpy ML. This transitions from the old behavior to the new behavior using the new keyword. Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2008-04-25 17:31:19 UTC (rev 5084) +++ trunk/numpy/lib/function_base.py 2008-04-25 17:41:04 UTC (rev 5085) @@ -11,6 +11,7 @@ 'add_docstring', 'meshgrid', 'delete', 'insert', 'append', 'interp' ] +import warnings import types import numpy.core.numeric as _nx @@ -97,79 +98,174 @@ except: return 0 return 1 -def histogram(a, bins=10, range=None, normed=False): +def histogram(a, bins=10, range=None, normed=False, weights=None, new=False): """Compute the histogram from a set of data. - Parameters: + Parameters + ---------- - a : array - The data to histogram. n-D arrays will be flattened. + a : array + The data to histogram. - bins : int or sequence of floats - If an int, then the number of equal-width bins in the given range. - Otherwise, a sequence of the lower bound of each bin. + bins : int or sequence + If an int, then the number of equal-width bins in the given range. + If new=True, bins can also be the bin edges, allowing for non-constant + bin widths. - range : (float, float) - The lower and upper range of the bins. If not provided, then - (a.min(), a.max()) is used. Values outside of this range are - allocated to the closest bin. + range : (float, float) + The lower and upper range of the bins. If not provided, then + range is simply (a.min(), a.max()). Using new=False, lower than range + are ignored, and values higher than range are tallied in the rightmost + bin. Using new=True, both lower and upper outliers are ignored. - normed : bool - If False, the result array will contain the number of samples in - each bin. If True, the result array is the value of the - probability *density* function at the bin normalized such that the - *integral* over the range is 1. Note that the sum of all of the - histogram values will not usually be 1; it is not a probability - *mass* function. + normed : bool + If False, the result array will contain the number of samples in + each bin. If True, the result array is the value of the + probability *density* function at the bin normalized such that the + *integral* over the range is 1. Note that the sum of all of the + histogram values will not usually be 1; it is not a probability + *mass* function. - Returns: + weights : array + An array of weights, the same shape as a. If normed is False, the + histogram is computed by summing the weights of the values falling into + each bin. If normed is True, the weights are normalized, so that the + integral of the density over the range is 1. This option is only + available with new=True. + + new : bool + Compatibility argument to transition from the old version (v1.1) to + the new version (v1.2). + + + Return + ------ + hist : array + The values of the histogram. See `normed` and `weights` for a + description of the possible semantics. - hist : array - The values of the histogram. See `normed` for a description of the - possible semantics. + bin_edges : float array + With new=False, return the left bin edges (length(hist)). + With new=True, return the bin edges (length(hist)+1). - lower_edges : float array - The lower edges of each bin. - SeeAlso: histogramdd """ - a = asarray(a).ravel() + # Old behavior + if new is 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) + a = asarray(a).ravel() - if (range is not None): - mn, mx = range - if (mn > mx): - raise AttributeError, 'max must be larger than min in range parameter.' + if (range is not None): + mn, mx = range + if (mn > mx): + raise AttributeError, \ + 'max must be larger than min in range parameter.' + + 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 + mx += 0.5 + bins = linspace(mn, mx, bins, endpoint=False) + else: + raise ValueError, 'Use new=True to pass bin edges explicitly.' + + if weights is not None: + raise ValueError, 'weights are only available with new=True.' + + # best block size probably depends on processor cache size + block = 65536 + n = sort(a[:block]).searchsorted(bins) + for i in xrange(block, a.size, block): + n += sort(a[i:i+block]).searchsorted(bins) + n = concatenate([n, [len(a)]]) + n = n[1:]-n[:-1] + + if normed: + db = bins[1] - bins[0] + return 1.0/(a.size*db) * n, bins + else: + return n, bins - if not iterable(bins): - if range is None: - range = (a.min(), a.max()) - mn, mx = [mi+0.0 for mi in range] - if mn == mx: - mn -= 0.5 - mx += 0.5 - bins = linspace(mn, mx, bins, endpoint=False) - else: - bins = asarray(bins) - if (bins[1:]-bins[:-1] < 0).any(): - raise AttributeError, 'bins must increase monotonically.' + + + # New behavior + elif new is True: + a = asarray(a) + if weights is not None: + weights = asarray(weights) + if np.any(weights.shape != a.shape): + raise ValueError, 'weights should have the same shape as a.' + weights = weights.ravel() + a = a.ravel() + + if (range is not None): + mn, mx = range + if (mn > mx): + raise AttributeError, \ + 'max must be larger than min in range parameter.' + + if not iterable(bins): + if range is None: + range = (a.min(), a.max()) + mn, mx = [mi+0.0 for mi in range] + if mn == mx: + mn -= 0.5 + mx += 0.5 + bins = linspace(mn, mx, bins+1, endpoint=True) + else: + bins = asarray(bins) + if (np.diff(bins) < 0).any(): + raise AttributeError, 'bins must increase monotonically.' + + # Histogram is an integer or a float array depending on the weights. + if weights is None: + ntype = int + else: + ntype = weights.dtype + n = np.zeros(bins.shape, ntype) + + block = 65536 + if weights is None: + for i in xrange(0, a.size, block): + sa = sort(a[:block]) + n += np.r_[sa.searchsorted(bins[:-1], 'left'), \ + sa.searchsorted(bins[-1], 'right')] + else: + zero = array(0, dtype=ntype) + for i in xrange(0, a.size, block): + tmp_a = a[:block] + tmp_w = weights[:block] + sorting_index = np.argsort(tmp_a) + sa = tmp_a[sorting_index] + sw = tmp_w[sorting_index] + cw = np.concatenate(([zero,], sw.cumsum())) + bin_index = np.r_[sa.searchsorted(bins[:-1], 'left'), \ + sa.searchsorted(bins[-1], 'right')] + n += cw[bin_index] + + n = np.diff(n) + + if normed is False: + return n, bins + elif normed is True: + db = array(np.diff(bins), float) + return n/(n*db).sum(), bins + - # best block size probably depends on processor cache size - block = 65536 - n = sort(a[:block]).searchsorted(bins) - for i in xrange(block, a.size, block): - n += sort(a[i:i+block]).searchsorted(bins) - n = concatenate([n, [len(a)]]) - n = n[1:]-n[:-1] - - if normed: - db = bins[1] - bins[0] - return 1.0/(a.size*db) * n, bins - else: - return n, bins - def histogramdd(sample, bins=10, range=None, normed=False, weights=None): """histogramdd(sample, bins=10, range=None, normed=False, weights=None) Modified: trunk/numpy/lib/tests/test_function_base.py =================================================================== --- trunk/numpy/lib/tests/test_function_base.py 2008-04-25 17:31:19 UTC (rev 5084) +++ trunk/numpy/lib/tests/test_function_base.py 2008-04-25 17:41:04 UTC (rev 5085) @@ -5,6 +5,7 @@ import numpy.lib;reload(numpy.lib) from numpy.lib import * from numpy.core import * + del sys.path[0] class TestAny(NumpyTestCase): @@ -432,12 +433,102 @@ v=rand(n) (a,b)=histogram(v) #check if the sum of the bins equals the number of samples - assert(sum(a,axis=0)==n) + 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)) - assert(all(a==10)) + assert_array_equal(a, 10) + def check_simple_new(self): + n=100 + v=rand(n) + (a,b)=histogram(v, new=True) + #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) + assert_array_equal(a, 10) + + def check_normed_new(self): + # Check that the integral of the density equals 1. + n = 100 + v = rand(n) + a,b = histogram(v, normed=True, new=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) + area = sum(a*diff(b)) + assert_almost_equal(area, 1) + + + def check_outliers_new(self): + # Check that outliers are not tallied + a = arange(10)+.5 + + # Lower outliers + h,b = histogram(a, range=[0,9], new=True) + assert_equal(h.sum(),9) + + # Upper outliers + h,b = histogram(a, range=[1,10], new=True) + assert_equal(h.sum(),9) + + # Normalization + h,b = histogram(a, range=[1,9], normed=True, new=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) + assert_equal((h*diff(b)).sum(),1) + + h,b = histogram(a, bins=8, range=[1,9], weights=w, new=True) + assert_equal(h, w[1:-1]) + + + def check_type_new(self): + # Check the type of the returned histogram + a = arange(10)+.5 + h,b = histogram(a, new=True) + assert(issubdtype(h.dtype, int)) + + h,b = histogram(a, normed=True, new=True) + assert(issubdtype(h.dtype, float)) + + h,b = histogram(a, weights=ones(10, int), new=True) + assert(issubdtype(h.dtype, int)) + + h,b = histogram(a, weights=ones(10, float), new=True) + assert(issubdtype(h.dtype, float)) + + + def check_weights_new(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) + 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) + 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) + 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) + assert_array_equal(wa, array([4,5,0,1])/10./3.*4) + class TestHistogramdd(NumpyTestCase): def check_simple(self): x = array([[-.5, .5, 1.5], [-.5, 1.5, 2.5], [-.5, 2.5, .5], \ From numpy-svn at scipy.org Fri Apr 25 14:00:12 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 25 Apr 2008 13:00:12 -0500 (CDT) Subject: [Numpy-svn] r5086 - trunk/numpy/lib Message-ID: <20080425180012.F140939C40F@new.scipy.org> Author: dhuard Date: 2008-04-25 13:00:09 -0500 (Fri, 25 Apr 2008) New Revision: 5086 Modified: trunk/numpy/lib/function_base.py Log: Fix to histogram with respect to block updating.a Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2008-04-25 17:41:04 UTC (rev 5085) +++ trunk/numpy/lib/function_base.py 2008-04-25 18:00:09 UTC (rev 5086) @@ -237,18 +237,18 @@ else: ntype = weights.dtype n = np.zeros(bins.shape, ntype) - + block = 65536 if weights is None: - for i in xrange(0, a.size, block): - sa = sort(a[:block]) + for i in arange(0, len(a), block): + sa = sort(a[i:i+block]) n += np.r_[sa.searchsorted(bins[:-1], 'left'), \ sa.searchsorted(bins[-1], 'right')] else: zero = array(0, dtype=ntype) - for i in xrange(0, a.size, block): - tmp_a = a[:block] - tmp_w = weights[:block] + for i in arange(0, len(a), block): + tmp_a = a[i:i+block] + tmp_w = weights[i:i+block] sorting_index = np.argsort(tmp_a) sa = tmp_a[sorting_index] sw = tmp_w[sorting_index] From numpy-svn at scipy.org Fri Apr 25 14:13:50 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 25 Apr 2008 13:13:50 -0500 (CDT) Subject: [Numpy-svn] r5087 - trunk/numpy/lib/tests Message-ID: <20080425181350.6A6A539C42A@new.scipy.org> Author: dhuard Date: 2008-04-25 13:13:46 -0500 (Fri, 25 Apr 2008) New Revision: 5087 Modified: trunk/numpy/lib/tests/test_function_base.py Log: Added an ignore warning in the test to avoid buildbot messages. Modified: trunk/numpy/lib/tests/test_function_base.py =================================================================== --- trunk/numpy/lib/tests/test_function_base.py 2008-04-25 18:00:09 UTC (rev 5086) +++ trunk/numpy/lib/tests/test_function_base.py 2008-04-25 18:13:46 UTC (rev 5087) @@ -428,6 +428,8 @@ assert_array_almost_equal(w,flipud(w),7) class TestHistogram(NumpyTestCase): + import warnings + warnings.simplefilter('ignore', FutureWarning) def check_simple(self): n=100 v=rand(n) From numpy-svn at scipy.org Fri Apr 25 17:04:17 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 25 Apr 2008 16:04:17 -0500 (CDT) Subject: [Numpy-svn] r5088 - trunk/numpy/lib Message-ID: <20080425210417.E95DD39C29B@new.scipy.org> Author: dhuard Date: 2008-04-25 16:04:16 -0500 (Fri, 25 Apr 2008) New Revision: 5088 Modified: trunk/numpy/lib/function_base.py Log: histogram: an error is raised for varying bin widths only if normed=True. Modified: trunk/numpy/lib/function_base.py =================================================================== --- trunk/numpy/lib/function_base.py 2008-04-25 18:13:46 UTC (rev 5087) +++ trunk/numpy/lib/function_base.py 2008-04-25 21:04:16 UTC (rev 5088) @@ -173,16 +173,26 @@ 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) + 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 mx += 0.5 bins = linspace(mn, mx, bins, endpoint=False) else: - raise ValueError, 'Use new=True to pass bin edges explicitly.' + 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) + bins = asarray(bins) + if (np.diff(bins) < 0).any(): + raise AttributeError, 'bins must increase monotonically.' + if weights is not None: raise ValueError, 'weights are only available with new=True.' From numpy-svn at scipy.org Fri Apr 25 23:11:09 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Fri, 25 Apr 2008 22:11:09 -0500 (CDT) Subject: [Numpy-svn] r5089 - trunk/numpy/core/src Message-ID: <20080426031109.BD14539C097@new.scipy.org> Author: charris Date: 2008-04-25 22:11:08 -0500 (Fri, 25 Apr 2008) New Revision: 5089 Modified: trunk/numpy/core/src/arrayobject.c Log: Code style cleanups. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-04-25 21:04:16 UTC (rev 5088) +++ trunk/numpy/core/src/arrayobject.c 2008-04-26 03:11:08 UTC (rev 5089) @@ -112,7 +112,9 @@ int ret, storeflags; PyObject *obj; - if (_check_object_rec(arr->descr) < 0) return NULL; + if (_check_object_rec(arr->descr) < 0) { + return NULL; + } oneval = PyDataMem_NEW(arr->descr->elsize); if (oneval == NULL) { PyErr_SetNone(PyExc_MemoryError); @@ -153,8 +155,9 @@ { PyObject **temp; - if (!PyDataType_REFCHK(descr)) return; - + if (!PyDataType_REFCHK(descr)) { + return; + } if (descr->type_num == PyArray_OBJECT) { temp = (PyObject **)data; Py_XINCREF(*temp); @@ -164,9 +167,12 @@ 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, - &title)) return; + &title)) { + return; + } PyArray_Item_INCREF(data + offset, new); } } @@ -181,7 +187,9 @@ { PyObject **temp; - if (!PyDataType_REFCHK(descr)) return; + if (!PyDataType_REFCHK(descr)) { + return; + } if (descr->type_num == PyArray_OBJECT) { temp = (PyObject **)data; @@ -194,7 +202,9 @@ Py_ssize_t pos=0; while (PyDict_Next(descr->fields, &pos, &key, &value)) { if (!PyArg_ParseTuple(value, "Oi|O", &new, &offset, - &title)) return; + &title)) { + return; + } PyArray_Item_XDECREF(data + offset, new); } } @@ -215,11 +225,14 @@ PyObject **data, **temp; PyArrayIterObject *it; - if (!PyDataType_REFCHK(mp->descr)) return 0; - + if (!PyDataType_REFCHK(mp->descr)) { + return 0; + } if (mp->descr->type_num != PyArray_OBJECT) { it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)mp); - if (it == NULL) return -1; + if (it == NULL) { + return -1; + } while(it->index < it->size) { PyArray_Item_INCREF(it->dataptr, mp->descr); PyArray_ITER_NEXT(it); @@ -232,10 +245,12 @@ data = (PyObject **)mp->data; n = PyArray_SIZE(mp); if (PyArray_ISALIGNED(mp)) { - for(i=0; iindex < it->size) { temp = (PyObject **)it->dataptr; Py_XINCREF(*temp); @@ -266,11 +283,14 @@ PyObject **temp; PyArrayIterObject *it; - if (!PyDataType_REFCHK(mp->descr)) return 0; - + if (!PyDataType_REFCHK(mp->descr)) { + return 0; + } if (mp->descr->type_num != PyArray_OBJECT) { it = (PyArrayIterObject *)PyArray_IterNew((PyObject *)mp); - if (it == NULL) return -1; + if (it == NULL) { + return -1; + } while(it->index < it->size) { PyArray_Item_XDECREF(it->dataptr, mp->descr); PyArray_ITER_NEXT(it); @@ -283,10 +303,10 @@ data = (PyObject **)mp->data; n = PyArray_SIZE(mp); if (PyArray_ISALIGNED(mp)) { - for(i=0; iindex < it->size) { temp = (PyObject **)it->dataptr; Py_XDECREF(*temp); @@ -314,7 +336,7 @@ char *tin = src; #define _FAST_MOVE(_type_) \ - for (i=0; i 0; n--, a += stride-1) { + for(a = (char*)p ; n > 0; n--, a += stride-1) { b = a + 3; c = *a; *a++ = *b; *b-- = c; c = *a; *a = *b; *b = c; } break; case 8: - for (a = (char*)p ; n > 0; n--, a += stride-3) { + for(a = (char*)p ; n > 0; n--, a += stride-3) { b = a + 7; c = *a; *a++ = *b; *b-- = c; c = *a; *a++ = *b; *b-- = c; @@ -447,16 +469,16 @@ } break; case 2: - for (a = (char*)p ; n > 0; n--, a += stride) { + for(a = (char*)p ; n > 0; n--, a += stride) { b = a + 1; c = *a; *a = *b; *b = c; } break; default: m = size / 2; - for (a = (char *)p ; n > 0; n--, a += stride-m) { + for(a = (char *)p ; n > 0; n--, a += stride-m) { b = a + (size-1); - for (j=0; job_type->tp_as_number != NULL && \ o->ob_type->tp_as_number->nb_int != NULL) { obj = o->ob_type->tp_as_number->nb_int(o); - if (obj == NULL) return -1; + if (obj == NULL) { + return -1; + } long_value = (long) PyLong_AsLong(obj); Py_DECREF(obj); } else if (o->ob_type->tp_as_number != NULL && \ o->ob_type->tp_as_number->nb_long != NULL) { obj = o->ob_type->tp_as_number->nb_long(o); - if (obj == NULL) return -1; + if (obj == NULL) { + return -1; + } long_value = (long) PyLong_AsLong(obj); Py_DECREF(obj); } @@ -744,7 +770,9 @@ NPY_BEGIN_THREADS_DEF numcopies = PyArray_SIZE(dest); - if (numcopies < 1) return 0; + if (numcopies < 1) { + return 0; + } nbytes = PyArray_ITEMSIZE(src); if (!PyArray_ISALIGNED(src)) { @@ -798,7 +826,9 @@ int axis=-1; dit = (PyArrayIterObject *)\ PyArray_IterAllButAxis((PyObject *)dest, &axis); - if (dit == NULL) goto finish; + if (dit == NULL) { + goto finish; + } /* Refcount note: src and dest may have different sizes */ PyArray_INCREF(src); PyArray_XDECREF(dest); @@ -819,7 +849,8 @@ Py_DECREF(dit); } retval = 0; - finish: + +finish: if (aligned != NULL) free(aligned); return retval; } @@ -958,7 +989,9 @@ elsize = PyArray_ITEMSIZE(dest); multi = (PyArrayMultiIterObject *)PyArray_MultiIterNew(2, dest, src); - if (multi == NULL) return -1; + if (multi == NULL) { + return -1; + } if (multi->size != PyArray_SIZE(dest)) { PyErr_SetString(PyExc_ValueError, @@ -1141,9 +1174,14 @@ /* Otherwise we have to do an iterator-based copy */ idest = (PyArrayIterObject *)PyArray_IterNew((PyObject *)dest); - if (idest == NULL) return -1; + if (idest == NULL) { + return -1; + } isrc = (PyArrayIterObject *)PyArray_IterNew((PyObject *)src); - if (isrc == NULL) {Py_DECREF(idest); return -1;} + if (isrc == NULL) { + Py_DECREF(idest); + return -1; + } elsize = dest->descr->elsize; /* Refcount note: src and dest have the same size */ PyArray_INCREF(src); @@ -1196,6 +1234,7 @@ int n_new, n_old; char *new_string; PyObject *tmp; + n_new = dest->dimensions[dest->nd-1]; n_old = PyString_Size(src_object); if (n_new > n_old) { @@ -1227,7 +1266,9 @@ FORTRAN_IF(dest), NULL); } - if (src == NULL) return -1; + if (src == NULL) { + return -1; + } ret = PyArray_MoveInto(dest, src); Py_DECREF(src); @@ -1259,7 +1300,7 @@ descr->byteorder = '='; #if SIZEOF_INTP != SIZEOF_INT - for (i=0; itp_alloc(type, itemsize); else obj = type->tp_alloc(type, 0); - if (obj == NULL) return NULL; + if (obj == NULL) { + return NULL; + } if PyTypeNum_ISFLEXIBLE(type_num) { if (type_num == PyArray_STRING) { destptr = PyString_AS_STRING(obj); @@ -1486,15 +1531,16 @@ PyArray_Return(PyArrayObject *mp) { - if (mp == NULL) return NULL; - + if (mp == NULL) { + return NULL; + } if (PyErr_Occurred()) { Py_XDECREF(mp); return NULL; } - - if (!PyArray_Check(mp)) return (PyObject *)mp; - + if (!PyArray_Check(mp)) { + return (PyObject *)mp; + } if (mp->nd == 0) { PyObject *ret; ret = PyArray_ToScalar(mp->data, mp); @@ -1514,7 +1560,8 @@ PyArray_InitArrFuncs(PyArray_ArrFuncs *f) { int i; - for (i=0; icast[i] = NULL; } f->getitem = NULL; @@ -1529,7 +1576,7 @@ f->nonzero = NULL; f->fill = NULL; f->fillwithscalar = NULL; - for (i=0; isort[i] = NULL; f->argsort[i] = NULL; } @@ -1545,7 +1592,9 @@ int elsize = PyArray_ITEMSIZE(arr); char *ptr = ip; while (elsize--) { - if (*ptr++ != 0) return TRUE; + if (*ptr++ != 0) { + return TRUE; + } } return FALSE; } @@ -1561,7 +1610,7 @@ copyswap = PyArray_DESCR(arr)->f->copyswap; - for (i=0; itypeobj->tp_name, str) == 0) return descr->type_num; @@ -1610,7 +1659,7 @@ PyArray_ArrFuncs *f; /* See if this type is already registered */ - for (i=0; itype_num; @@ -1720,7 +1769,7 @@ descr->f->cancastscalarkindto = \ (int **)malloc(PyArray_NSCALARKINDS* \ sizeof(int*)); - for (i=0; if->cancastscalarkindto[i] = NULL; } } @@ -1876,7 +1925,7 @@ sz = self->dimensions[0]; lp = PyList_New(sz); - for (i=0; ind >= self->nd) { PyErr_SetString(PyExc_RuntimeError, @@ -2350,10 +2399,10 @@ and need to be reshaped first by pre-pending ones */ arr = *ret; if (arr->nd != mit->nd) { - for (i=1; i<=arr->nd; i++) { + for(i=1; i<=arr->nd; i++) { permute.ptr[mit->nd-i] = arr->dimensions[arr->nd-i]; } - for (i=0; ind-arr->nd; i++) { + for(i=0; ind-arr->nd; i++) { permute.ptr[i] = 1; } new = PyArray_Newshape(arr, &permute, PyArray_ANYORDER); @@ -2545,7 +2594,7 @@ argument_count = PyTuple_GET_SIZE(tuple); - for (i = 0; i < argument_count; ++i) { + for(i = 0; i < argument_count; ++i) { PyObject *arg = PyTuple_GET_ITEM(tuple, i); if (arg == Py_Ellipsis && !ellipsis_count) ellipsis_count++; else if (arg == Py_None) newaxis_count++; @@ -2572,7 +2621,7 @@ PyArrayObject *other; intp dimensions[MAX_DIMS]; int i; - for (i = 0; i < newaxis_count; ++i) { + for(i = 0; i < newaxis_count; ++i) { dimensions[i] = 1; } Py_INCREF(arr->descr); @@ -2607,7 +2656,7 @@ if (PyTuple_Check(args)) { n = PyTuple_GET_SIZE(args); if (n >= MAX_DIMS) return SOBJ_TOOMANY; - for (i=0; i=MAX_DIMS) return SOBJ_ISFANCY; - for (i=0; i 0) || PyList_Check(obj)) return -1; @@ -2986,7 +3035,7 @@ && (_tuple_of_integers(index, vals, self->nd) >= 0)) { int i; char *item; - for (i=0; ind; i++) { + for(i=0; ind; i++) { if (vals[i] < 0) vals[i] += self->dimensions[i]; if ((vals[i] < 0) || (vals[i] >= self->dimensions[i])) { PyErr_Format(PyExc_IndexError, @@ -3061,7 +3110,7 @@ && (_tuple_of_integers(op, vals, self->nd) >= 0)) { int i; char *item; - for (i=0; ind; i++) { + for(i=0; ind; i++) { if (vals[i] < 0) vals[i] += self->dimensions[i]; if ((vals[i] < 0) || (vals[i] >= self->dimensions[i])) { PyErr_Format(PyExc_IndexError, @@ -4624,7 +4673,9 @@ Py_INCREF(other->descr); new = PyArray_FromAny((PyObject *)self, other->descr, 0, 0, 0, NULL); - if (new == NULL) return NULL; + if (new == NULL) { + return NULL; + } self = (PyArrayObject *)new; } else if (self->descr->type_num == PyArray_UNICODE && \ @@ -4633,7 +4684,9 @@ Py_INCREF(self->descr); new = PyArray_FromAny((PyObject *)other, self->descr, 0, 0, 0, NULL); - if (new == NULL) return NULL; + if (new == NULL) { + return NULL; + } other = (PyArrayObject *)new; } else { @@ -4652,7 +4705,9 @@ mit = (PyArrayMultiIterObject *)PyArray_MultiIterNew(2, self, other); Py_DECREF(self); Py_DECREF(other); - if (mit == NULL) return NULL; + if (mit == NULL) { + return NULL; + } result = PyArray_NewFromDescr(&PyArray_Type, PyArray_DescrFromType(PyArray_BOOL), @@ -4660,7 +4715,9 @@ mit->dimensions, NULL, NULL, 0, NULL); - if (result == NULL) goto finish; + if (result == NULL) { + goto finish; + } if (self->descr->type_num == PyArray_UNICODE) { val = _compare_strings(result, mit, cmp_op, _myunincmp, @@ -4671,7 +4728,9 @@ rstrip); } - if (val < 0) {Py_DECREF(result); result = NULL;} + if (val < 0) { + Py_DECREF(result); result = NULL; + } finish: Py_DECREF(mit); @@ -4695,8 +4754,8 @@ _void_compare(PyArrayObject *self, PyArrayObject *other, int cmp_op) { if (!(cmp_op == Py_EQ || cmp_op == Py_NE)) { - PyErr_SetString(PyExc_ValueError, "Void-arrays can only" \ - "be compared for equality."); + PyErr_SetString(PyExc_ValueError, + "Void-arrays can only be compared for equality."); return NULL; } if (PyArray_HASFIELDS(self)) { @@ -4704,16 +4763,27 @@ PyObject *key, *value, *temp2; PyObject *op; Py_ssize_t pos=0; + op = (cmp_op == Py_EQ ? n_ops.logical_and : n_ops.logical_or); while (PyDict_Next(self->descr->fields, &pos, &key, &value)) { a = PyArray_EnsureAnyArray(array_subscript(self, key)); - if (a==NULL) {Py_XDECREF(res); return NULL;} + if (a==NULL) { + Py_XDECREF(res); + return NULL; + } b = array_subscript(other, key); - if (b==NULL) {Py_XDECREF(res); Py_DECREF(a); return NULL;} + if (b==NULL) { + Py_XDECREF(res); + Py_DECREF(a); + return NULL; + } temp = array_richcompare((PyArrayObject *)a,b,cmp_op); Py_DECREF(a); Py_DECREF(b); - if (temp == NULL) {Py_XDECREF(res); return NULL;} + if (temp == NULL) { + Py_XDECREF(res); + return NULL; + } if (res == NULL) { res = temp; } @@ -4721,7 +4791,9 @@ temp2 = PyObject_CallFunction(op, "OO", res, temp); Py_DECREF(temp); Py_DECREF(res); - if (temp2 == NULL) return NULL; + if (temp2 == NULL) { + return NULL; + } res = temp2; } } @@ -4730,7 +4802,8 @@ } return res; } - else { /* compare as a string */ + else { + /* compare as a string */ /* assumes self and other have same descr->type */ return _strings_richcompare(self, other, cmp_op, 0); } @@ -5047,7 +5120,7 @@ sd = ap->descr->elsize; if (ap->nd == 1) return (ap->dimensions[0] == 1 || \ sd == ap->strides[0]); - for (i = ap->nd-1; i >= 0; --i) { + for(i = ap->nd-1; i >= 0; --i) { dim = ap->dimensions[i]; /* contiguous by definition */ if (dim == 0) return 1; @@ -5070,7 +5143,7 @@ sd = ap->descr->elsize; if (ap->nd == 1) return (ap->dimensions[0] == 1 || \ sd == ap->strides[0]); - for (i=0; i< ap->nd; ++i) { + for(i=0; i< ap->nd; ++i) { dim = ap->dimensions[i]; /* fortran contiguous by definition */ if (dim == 0) return 1; @@ -5095,7 +5168,7 @@ ptr = (intp) ap->data; aligned = (ptr % alignment) == 0; - for (i=0; i nd; i++) + for(i=0; i nd; i++) aligned &= ((ap->strides[i] % alignment) == 0); return aligned != 0; } @@ -5146,7 +5219,7 @@ register int i, N=PyArray_NDIM(arr); register intp *strides = PyArray_STRIDES(arr); - for (i=0; i end)) return FALSE; @@ -5251,7 +5324,7 @@ int i; /* Only make Fortran strides if not contiguous as well */ if ((inflag & FORTRAN) && !(inflag & CONTIGUOUS)) { - for (i=0; i=0;i--) { + for(i=nd-1;i>=0;i--) { strides[i] = itemsize; itemsize *= dims[i] ? dims[i] : 1; } @@ -5340,7 +5413,7 @@ } if (tuple) { - for (i=0; isubarray->shape, i)); } @@ -5360,7 +5433,7 @@ } /* Make new strides -- alwasy C-contiguous */ tempsize = (*des)->elsize; - for (i=numnew-1; i>=0; i--) { + for(i=numnew-1; i>=0; i--) { mystrides[i] = tempsize; tempsize *= mydim[i] ? mydim[i] : 1; } @@ -5436,7 +5509,7 @@ sd = (size_t) descr->elsize; } largest = MAX_INTP / sd; - for (i=0;idescr->elsize; - for (k=0; kdata + oldsize*elsize; n = newsize - oldsize; - for (k=0; kdescr); optr += elsize; } @@ -5781,12 +5854,12 @@ optr = (PyObject **)(arr->data); n = PyArray_SIZE(arr); if (obj == NULL) { - for (i=0; idata; - for (i=0; idescr); optr += arr->descr->elsize; } @@ -6946,7 +7019,7 @@ *itemsize = MAX(*itemsize, n); return 0; } - for (i=0; idescr)) { obptr = buffers[1]; - for (i = 0; i < N; i++, obptr+=selsize) { + for(i = 0; i < N; i++, obptr+=selsize) { PyArray_Item_XDECREF(obptr, out->descr); } } if (PyDataType_REFCHK(out->descr)) { obptr = buffers[0]; - for (i = 0; i < N; i++, obptr+=delsize) { + for(i = 0; i < N; i++, obptr+=delsize) { PyArray_Item_XDECREF(obptr, out->descr); } } @@ -8467,7 +8540,7 @@ goto fail; } n = PyTuple_GET_SIZE(attr); - for (i=0; isize = PyArray_SIZE(ao); it->nd_m1 = nd - 1; it->factors[nd-1] = 1; - for (i=0; i < nd; i++) { + for(i=0; i < nd; i++) { it->dims_m1[i] = ao->dimensions[i] - 1; it->strides[i] = ao->strides[i]; it->backstrides[i] = it->strides[i] * \ @@ -9052,7 +9125,7 @@ if (ao->nd > nd) goto err; compat = 1; diff = j = nd - ao->nd; - for (i=0; ind; i++, j++) { + for(i=0; ind; i++, j++) { if (ao->dimensions[i] == 1) continue; if (ao->dimensions[i] != dims[j]) { compat = 0; @@ -9075,7 +9148,7 @@ it->size = PyArray_MultiplyList(dims, nd); it->nd_m1 = nd - 1; it->factors[nd-1] = 1; - for (i=0; i < nd; i++) { + for(i=0; i < nd; i++) { it->dims_m1[i] = dims[i] - 1; k = i - diff; if ((k < 0) || @@ -9129,7 +9202,7 @@ minstride = PyArray_STRIDE(obj,i); i++; } - for (i=1; i 0 && PyArray_STRIDE(obj, i) < minstride) { minaxis = i; @@ -9174,23 +9247,23 @@ if (multi->nd == 0) return -1; - for (i=0; ind; i++) { + for(i=0; ind; i++) { sumstrides[i] = 0; - for (j=0; jnumiter; j++) { + for(j=0; jnumiter; j++) { sumstrides[i] += multi->iters[j]->strides[i]; } } axis=0; smallest = sumstrides[0]; /* Find longest dimension */ - for (i=1; ind; i++) { + for(i=1; ind; i++) { if (sumstrides[i] < smallest) { axis = i; smallest = sumstrides[i]; } } - for (i=0; inumiter; i++) { + for(i=0; inumiter; i++) { it = multi->iters[i]; it->contiguous = 0; if (it->size != 0) @@ -9840,7 +9913,7 @@ intp val; int i; val = self->index; - for (i=0;icoordinates[i] = val / self->factors[i]; val = val % self->factors[i]; } @@ -9946,14 +10019,14 @@ PyArrayIterObject *it; /* Discover the broadcast number of dimensions */ - for (i=0, nd=0; inumiter; i++) + for(i=0, nd=0; inumiter; i++) nd = MAX(nd, mit->iters[i]->ao->nd); mit->nd = nd; /* Discover the broadcast shape in each dimension */ - for (i=0; idimensions[i] = 1; - for (j=0; jnumiter; j++) { + for(j=0; jnumiter; j++) { it = mit->iters[j]; /* This prepends 1 to shapes not already equal to nd */ @@ -9979,13 +10052,13 @@ tmp = PyArray_MultiplyList(mit->dimensions, mit->nd); mit->size = tmp; - for (i=0; inumiter; i++) { + for(i=0; inumiter; i++) { it = mit->iters[i]; it->nd_m1 = mit->nd - 1; it->size = tmp; nd = it->ao->nd; it->factors[mit->nd-1] = 1; - for (j=0; j < mit->nd; j++) { + for(j=0; j < mit->nd; j++) { it->dims_m1[j] = mit->dimensions[j] - 1; k = j + nd - mit->nd; /* If this dimension was added or shape @@ -10025,7 +10098,7 @@ if (mit->subspace != NULL) { memcpy(coord, mit->bscoord, sizeof(intp)*mit->ait->ao->nd); PyArray_ITER_RESET(mit->subspace); - for (i=0; inumiter; i++) { + for(i=0; inumiter; i++) { it = mit->iters[i]; PyArray_ITER_RESET(it); j = mit->iteraxes[i]; @@ -10038,7 +10111,7 @@ mit->dataptr = mit->subspace->dataptr; } else { - for (i=0; inumiter; i++) { + for(i=0; inumiter; i++) { it = mit->iters[i]; if (it->size != 0) { PyArray_ITER_RESET(it); @@ -10077,7 +10150,7 @@ memcpy(coord, mit->bscoord, sizeof(intp)*mit->ait->ao->nd); PyArray_ITER_RESET(mit->subspace); - for (i=0; inumiter; i++) { + for(i=0; inumiter; i++) { it = mit->iters[i]; PyArray_ITER_NEXT(it); j = mit->iteraxes[i]; @@ -10091,7 +10164,7 @@ mit->dataptr = mit->subspace->dataptr; } else { - for (i=0; inumiter; i++) { + for(i=0; inumiter; i++) { it = mit->iters[i]; PyArray_ITER_NEXT(it); copyswap(coord+i,it->dataptr, @@ -10142,7 +10215,7 @@ /* no subspace iteration needed. Finish up and Return */ if (subnd == 0) { n = arr->nd; - for (i=0; iiteraxes[i] = i; } goto finish; @@ -10172,7 +10245,7 @@ /* Expand dimensions of result */ n = mit->subspace->ao->nd; - for (i=0; idimensions[mit->nd+i] = mit->subspace->ao->dimensions[i]; mit->nd += n; @@ -10189,7 +10262,7 @@ j = 0; noellip = 1; /* Only expand the first ellipsis */ memset(mit->bscoord, 0, sizeof(intp)*arr->nd); - for (i=0; iindexobj, i); @@ -10233,7 +10306,7 @@ goto fail; } - for (i=0; inumiter; i++) { + for(i=0; inumiter; i++) { intp indval; it = mit->iters[i]; PyArray_ITER_RESET(it); @@ -10283,17 +10356,17 @@ CARRAY, NULL); if (ba == NULL) return -1; nd = ba->nd; - for (j=0; jdata; count = 0; /* pre-determine how many nonzero entries there are */ - for (i=0; i=0; j--) { + for(j=nd-1; j>=0; j--) { if (coords[j] < dims_m1[j]) { coords[j]++; break; @@ -10335,7 +10408,7 @@ return nd; fail: - for (j=0; jiters[i] = NULL; mit->index = 0; mit->ait = NULL; @@ -10406,7 +10479,7 @@ Py_DECREF(mit->indexobj); mit->indexobj = PyTuple_New(mit->numiter); if (mit->indexobj == NULL) goto fail; - for (i=0; inumiter; i++) { + for(i=0; inumiter; i++) { PyTuple_SET_ITEM(mit->indexobj, i, PyInt_FromLong(0)); } @@ -10440,7 +10513,7 @@ started = 0; nonindex = 0; j = 0; - for (i=0; iiters + mit->numiter; if ((numiters=_convert_obj(obj, iterp)) < 0) { @@ -10463,7 +10536,7 @@ n2 += numiters - 1; if (_PyTuple_Resize(&new, n2) < 0) goto fail; - for (k=0;kindexobj); Py_XDECREF(mit->ait); Py_XDECREF(mit->subspace); - for (i=0; inumiter; i++) + for(i=0; inumiter; i++) Py_XDECREF(mit->iters[i]); _pya_free(mit); } @@ -10595,12 +10668,12 @@ if (multi == NULL) return PyErr_NoMemory(); PyObject_Init((PyObject *)multi, &PyArrayMultiIter_Type); - for (i=0; iiters[i] = NULL; + for(i=0; iiters[i] = NULL; multi->numiter = n; multi->index = 0; va_start(va, n); - for (i=0; inumiter = n; multi->index = 0; - for (i=0; iiters[i] = NULL; - for (i=0; iiters[i] = NULL; + for(i=0; iiters[i] = \ @@ -10684,7 +10757,7 @@ ret = PyTuple_New(n); if (ret == NULL) return NULL; if (multi->index < multi->size) { - for (i=0; i < n; i++) { + for(i=0; i < n; i++) { PyArrayIterObject *it=multi->iters[i]; PyTuple_SET_ITEM(ret, i, PyArray_ToScalar(it->dataptr, it->ao)); @@ -10701,7 +10774,7 @@ { int i; - for (i=0; inumiter; i++) + for(i=0; inumiter; i++) Py_XDECREF(multi->iters[i]); multi->ob_type->tp_free((PyObject *)multi); } @@ -10746,7 +10819,7 @@ n = self->numiter; res = PyTuple_New(n); if (res == NULL) return res; - for (i=0; iiters[i]); PyTuple_SET_ITEM(res, i, (PyObject *)self->iters[i]); } @@ -11156,7 +11229,7 @@ return -1; } /* Make sure all entries are strings */ - for (i=0; i Author: ptvirtan Date: 2008-04-26 10:30:04 -0500 (Sat, 26 Apr 2008) New Revision: 5090 Modified: trunk/numpy/core/fromnumeric.py Log: Docstring improvements for all, any, alltrue, sometrue, clip, compress + smaller stylistic changes to others. Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2008-04-26 03:11:08 UTC (rev 5089) +++ trunk/numpy/core/fromnumeric.py 2008-04-26 15:30:04 UTC (rev 5090) @@ -102,7 +102,7 @@ ------- reshaped_array : array This will be a new view object if possible; otherwise, it will - return a copy. + be a copy. See Also -------- @@ -194,10 +194,10 @@ See Also -------- ndarray.repeat : equivalent method + tile : tile an array Examples -------- - >>> repeat([0, 1, 2], 2) array([0, 0, 1, 1, 2, 2]) >>> repeat([0, 1, 2], [2, 3, 4]) @@ -222,6 +222,11 @@ Target indices, interpreted as integers. v : array_like Values to place in `a` at target indices. + mode : {'raise', 'wrap', 'clip'}, optional + Specifies how out-of-bounds indices will behave. + 'raise' -- raise an error + 'wrap' -- wrap around + 'clip' -- clip to the range Notes ----- @@ -235,7 +240,6 @@ Examples -------- - >>> x = np.arange(5) >>> np.put(x,[0,2,4],[-1,-2,-3]) >>> print x @@ -246,8 +250,8 @@ def swapaxes(a, axis1, axis2): - """Return array a with axis1 and axis2 interchanged. - + """Return a view of array a with axis1 and axis2 interchanged. + Parameters ---------- a : array_like @@ -259,7 +263,6 @@ Examples -------- - >>> x = np.array([[1,2,3]]) >>> np.swapaxes(x,0,1) array([[1], @@ -360,15 +363,13 @@ order. 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 + =========== ======= ============= ============ ======= All the sort algorithms make temporary copies of the data when the sort is not along the last axis. Consequently, sorts along @@ -705,8 +706,7 @@ dimensions, then the axes specified by axis1 and axis2 are used to determine the 2-d subarray whose trace is returned. The shape of the resulting array can be determined by removing axis1 and axis2 and appending an index - to the right equal to the size of the resulting diagonals. Arrays of integer - type are summed + to the right equal to the size of the resulting diagonals. Parameters ---------- @@ -750,7 +750,7 @@ return asarray(a).trace(offset, axis1, axis2, dtype, out) def ravel(a, order='C'): - """Return a 1d array containing the elements of a. + """Return a 1d array containing the elements of a (copy only if needed). Returns the elements of a as a 1d array. The elements in the new array are taken in the order specified by the order keyword. The new array is @@ -847,10 +847,38 @@ def compress(condition, a, axis=None, out=None): - """Return a where condition is true. + """Return selected slices of an array along given axis. - Equivalent to a[condition]. + Parameters + ---------- + condition : {array} + Boolean 1-d array selecting which entries to return. If len(condition) + is less than the size of a along the axis, then output is truncated + to length of condition array. + a : {array_type} + Array from which to extract a part. + axis : {None, integer} + Axis along which to take slices. If None, work on the flattened array. + out : array, optional + Output array. Its type is preserved and it must be of the right + shape to hold the output. + Returns + ------- + compressed_array : array + A copy of a, without the slices along axis for which condition is false. + + Examples + -------- + >>> a = np.array([[1, 2], [3, 4]]) + >>> np.compress([0, 1], a, axis=0) + array([[3, 4]]) + >>> np.compress([1], a, axis=1) + array([[1], + [3]]) + >>> np.compress([0,1,1], a) + array([2, 3]) + """ try: compress = a.compress @@ -860,11 +888,23 @@ def clip(a, a_min, a_max): - """Limit the values of a to [a_min, a_max]. Equivalent to + """Return an array whose values are limited to [a_min, a_max]. - a[a < a_min] = a_min - a[a > a_max] = a_max + Parameters + ---------- + a : {array_type} + Array containing elements to clip. + a_min + Minimum value + a_max + Maximum value + Returns + ------- + sum_along_axis : {array} + A new array whose elements are same as for a, but values + < a_min are replaced with a_min, and > a_max with a_max. + """ try: clip = a.clip @@ -874,7 +914,7 @@ def sum(a, axis=None, dtype=None, out=None): - """Sum the array over the given axis. + """Return the sum of the array elements over the given axis Parameters ---------- @@ -931,7 +971,7 @@ def product (a, axis=None, dtype=None, out=None): - """Product of the array elements over the given axis. + """Return the product of the array elements over the given axis Parameters ---------- @@ -984,8 +1024,21 @@ def sometrue (a, axis=None, out=None): - """Perform a logical_or over the given axis. + """Check if any of the elements of `a` are true. + Performs a logical_or over the given axis and returns the result + + Parameters + ---------- + a : {array_like} + Array on which to operate + axis : {None, integer} + Axis to perform the operation over. + If None, perform over flattened array. + out : {None, array}, optional + Array into which the product can be placed. Its type is preserved + and it must be of the right shape to hold the output. + See Also -------- ndarray.any : equivalent method @@ -999,12 +1052,23 @@ def alltrue (a, axis=None, out=None): - """Perform a logical_and over the given axis. + """Check if all of the elements of `a` are true. + Performs a logical_and over the given axis and returns the result + + Parameters + ---------- + a : {array_like} + axis : {None, integer} + Axis to perform the operation over. + If None, perform over flattened array. + out : {None, array}, optional + Array into which the product can be placed. Its type is preserved + and it must be of the right shape to hold the output. + See Also -------- ndarray.all : equivalent method - all : equivalent function """ try: @@ -1015,8 +1079,20 @@ def any(a,axis=None, out=None): - """Return true if any elements of x are true. + """Check if any of the elements of `a` are true. + + Performs a logical_or over the given axis and returns the result + Parameters + ---------- + a : {array_like} + axis : {None, integer} + Axis to perform the operation over. + If None, perform over flattened array and return a scalar. + out : {None, array}, optional + Array into which the product can be placed. Its type is preserved + and it must be of the right shape to hold the output. + See Also -------- ndarray.any : equivalent method @@ -1030,12 +1106,23 @@ def all(a,axis=None, out=None): - """Return true if all elements of x are true: + """Check if all of the elements of `a` are true. + + Performs a logical_and over the given axis and returns the result + Parameters + ---------- + a : {array_like} + axis : {None, integer} + Axis to perform the operation over. + If None, perform over flattened array. + out : {None, array}, optional + Array into which the product can be placed. Its type is preserved + and it must be of the right shape to hold the output. + See Also -------- ndarray.all : equivalent method - alltrue : equivalent function """ try: From numpy-svn at scipy.org Sat Apr 26 11:34:45 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 26 Apr 2008 10:34:45 -0500 (CDT) Subject: [Numpy-svn] r5091 - trunk/numpy/core Message-ID: <20080426153445.7477639C0FB@new.scipy.org> Author: ptvirtan Date: 2008-04-26 10:34:37 -0500 (Sat, 26 Apr 2008) New Revision: 5091 Modified: trunk/numpy/core/fromnumeric.py Log: Docstrings in fromnumeric: very small fixes. Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2008-04-26 15:30:04 UTC (rev 5090) +++ trunk/numpy/core/fromnumeric.py 2008-04-26 15:34:37 UTC (rev 5091) @@ -892,7 +892,7 @@ Parameters ---------- - a : {array_type} + a : {array_like} Array containing elements to clip. a_min Minimum value @@ -901,7 +901,7 @@ Returns ------- - sum_along_axis : {array} + clipped_array : {array} A new array whose elements are same as for a, but values < a_min are replaced with a_min, and > a_max with a_max. @@ -1115,7 +1115,7 @@ a : {array_like} axis : {None, integer} Axis to perform the operation over. - If None, perform over flattened array. + If None, perform over flattened array and return a scalar. out : {None, array}, optional Array into which the product can be placed. Its type is preserved and it must be of the right shape to hold the output. From numpy-svn at scipy.org Sat Apr 26 12:41:34 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 26 Apr 2008 11:41:34 -0500 (CDT) Subject: [Numpy-svn] r5092 - trunk/numpy/core Message-ID: <20080426164134.53F6239C409@new.scipy.org> Author: ptvirtan Date: 2008-04-26 11:41:28 -0500 (Sat, 26 Apr 2008) New Revision: 5092 Modified: trunk/numpy/core/fromnumeric.py Log: Docstrings: correct description of `dtype` in prod, cumsum, cumprod (was OK in sum, product) Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2008-04-26 15:34:37 UTC (rev 5091) +++ trunk/numpy/core/fromnumeric.py 2008-04-26 16:41:28 UTC (rev 5092) @@ -728,7 +728,7 @@ precision, then the default integer precision is used. Otherwise, the precision is the same as that of a. out : {None, array}, optional - Array into which the sum can be placed. It's type is preserved and + Array into which the sum can be placed. Its type is preserved and it must be of the right shape to hold the output. Returns @@ -931,14 +931,14 @@ platform integer, then the default platform integer precision is used. Otherwise, the dtype is the same as that of a. out : {None, array}, optional - Array into which the sum can be placed. It's type is preserved and + Array into which the sum can be placed. Its type is preserved and it must be of the right shape to hold the output. Returns ------- sum_along_axis : {array, scalar}, see dtype parameter above. Returns an array whose shape is the same as a with the specified - axis removed. Returns a 0d array when a is 1d or dtype=None. + axis removed. Returns a 0d array when a is 1d or axis=None. Returns a reference to the specified output array if specified. See Also @@ -996,7 +996,7 @@ ------- product_along_axis : {array, scalar}, see dtype parameter above. Returns an array whose shape is the same as a with the specified - axis removed. Returns a 0d array when a is 1d or dtype=None. + axis removed. Returns a 0d array when a is 1d or axis=None. Returns a reference to the specified output array if specified. See Also @@ -1145,11 +1145,12 @@ axis : {None, -1, int}, optional Axis along which the product is computed. The default (``axis``= None) is to compute over the flattened array. - dtype : type, optional - Type to use in computing the cumulative sum. For arrays of - integer type the default is int64 for signed ints and uint64 - for unsigned. For arrays of float types it is the same as the - array type. + dtype : {None, dtype}, optional + Determines the type of the returned array and of the accumulator + where the elements are summed. If dtype has the value None and + the type of a is an integer type of precision less than the default + platform integer, then the default platform integer precision is + used. Otherwise, the dtype is the same as that of a. 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 @@ -1160,8 +1161,6 @@ cumsum : ndarray. A new array holding the result is returned unless ``out`` is specified, in which case a reference to ``out`` is returned. - Return datatype is ``dtype`` if specified, otherwise int64 for - ints, uint64 for uints, or the input datatype otherwise. """ try: @@ -1332,45 +1331,48 @@ def prod(a, axis=None, dtype=None, out=None): - """Return the product of the elements along the given axis. + """Return the product of the array elements over the given axis Parameters ---------- - a : array-like - Input array. - axis : {None, int}, optional - Axis along which the product is computed. By default, ``axis`` - is None and the flattened input is used. - dtype : type, optional - Type to use in computing the product. For arrays of - integer type the default is int64 for signed ints and uint64 - for unsigned. For arrays of float types it is the same as the - array type. - out : ndarray, optional - Alternative output array in which to place the result. It must - have the same shape and buffer length as the expected output - but the type will be cast if necessary. + a : {array_like} + Array containing elements whose product is desired. If a is not an array, a + conversion is attempted. + axis : {None, integer} + Axis over which the product is taken. If None is used, then the + product is over all the array elements. + dtype : {None, dtype}, optional + Determines the type of the returned array and of the accumulator + where the elements are multiplied. If dtype has the value None and + the type of a is an integer type of precision less than the default + platform integer, then the default platform integer precision is + used. Otherwise, the dtype is the same as that of a. + out : {None, array}, optional + Alternative output array in which to place the result. It must have + the same shape as the expected output but the type will be cast if + necessary. Returns ------- - prod : ndarray. - A new array holding the result is returned unless out is - specified, in which case a reference to out is returned. - Return datatype is ``dtype`` if specified, otherwise int64 for - ints, uint64 for uints, or the input datatype otherwise. + product_along_axis : {array, scalar}, see dtype parameter above. + Returns an array whose shape is the same as a with the specified + axis removed. Returns a 0d array when a is 1d or axis=None. + Returns a reference to the specified output array if specified. + See Also + -------- + ndarray.prod : equivalent method + Examples -------- - >>> x = np.arange(4).reshape((2,2)) + 1 - >>> x - array([[1, 2], - [3, 4]]) - >>> np.prod(x) - 24 - >>> np.prod(x,0) - array([3, 8]) - >>> np.prod(x,1) - array([ 2, 12]) + >>> prod([1.,2.]) + 2.0 + >>> prod([1.,2.], dtype=int32) + 2 + >>> prod([[1.,2.],[3.,4.]]) + 24.0 + >>> prod([[1.,2.],[3.,4.]], axis=1) + array([ 2., 12.]) """ try: @@ -1393,11 +1395,12 @@ axis : {None, -1, int}, optional Axis along which the product is computed. The default (``axis``= None) is to compute over the flattened array. - dtype : type, optional - Type to use in computing the cumulative product. For arrays of - integer type the default is int64 for signed ints and uint64 - for unsigned. For arrays of float types it is the same as the - array type. + dtype : {None, dtype}, optional + Determines the type of the returned array and of the accumulator + where the elements are multiplied. If dtype has the value None and + the type of a is an integer type of precision less than the default + platform integer, then the default platform integer precision is + used. Otherwise, the dtype is the same as that of a. out : ndarray, optional Alternative output array in which to place the result. It must have the same shape and buffer length as the expected output @@ -1408,8 +1411,6 @@ cumprod : ndarray. A new array holding the result is returned unless out is specified, in which case a reference to out is returned. - Return datatype is ``dtype`` if specified, otherwise int64 for - ints, uint64 for uints, or the input datatype otherwise. """ try: From numpy-svn at scipy.org Sat Apr 26 14:36:39 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 26 Apr 2008 13:36:39 -0500 (CDT) Subject: [Numpy-svn] r5093 - trunk/numpy/core/include/numpy Message-ID: <20080426183639.3CC4F39C269@new.scipy.org> Author: charris Date: 2008-04-26 13:36:35 -0500 (Sat, 26 Apr 2008) New Revision: 5093 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/include/numpy/ufuncobject.h Log: Sprinkle some do {} while (0) magic around macros with if statements. They should lose the semi-colons too, but I don't want to risk breaking out of tree code. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-26 16:41:28 UTC (rev 5092) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-26 18:36:35 UTC (rev 5093) @@ -1137,25 +1137,22 @@ PyArray_FastTakeFunc *fasttake; } PyArray_ArrFuncs; -#define NPY_ITEM_REFCOUNT 0x01 /* The item must be reference counted - when it is inserted or extracted. */ -#define NPY_ITEM_HASOBJECT 0x01 /* Same as needing REFCOUNT */ - -#define NPY_LIST_PICKLE 0x02 /* Convert to list for pickling */ -#define NPY_ITEM_IS_POINTER 0x04 /* The item is a POINTER */ - -#define NPY_NEEDS_INIT 0x08 /* memory needs to be initialized - for this data-type */ - -#define NPY_NEEDS_PYAPI 0x10 /* operations need Python C-API - so don't give-up thread. */ - -#define NPY_USE_GETITEM 0x20 /* Use f.getitem when extracting elements - of this data-type */ - -#define NPY_USE_SETITEM 0x40 /* Use f.setitem when setting creating - 0-d array from this data-type. - */ +/* The item must be reference counted when it is inserted or extracted. */ +#define NPY_ITEM_REFCOUNT 0x01 +/* Same as needing REFCOUNT */ +#define NPY_ITEM_HASOBJECT 0x01 +/* Convert to list for pickling */ +#define NPY_LIST_PICKLE 0x02 +/* The item is a POINTER */ +#define NPY_ITEM_IS_POINTER 0x04 +/* memory needs to be initialized for this data-type */ +#define NPY_NEEDS_INIT 0x08 +/* operations need Python C-API so don't give-up thread. */ +#define NPY_NEEDS_PYAPI 0x10 +/* Use f.getitem when extracting elements of this data-type */ +#define NPY_USE_GETITEM 0x20 +/* Use f.setitem when setting creating 0-d array from this data-type.*/ +#define NPY_USE_SETITEM 0x40 /* define NPY_IS_COMPLEX */ /* These are inherited for global data-type if any data-types in the field @@ -1372,15 +1369,15 @@ #define NPY_END_ALLOW_THREADS Py_END_ALLOW_THREADS #define NPY_BEGIN_THREADS_DEF PyThreadState *_save=NULL; #define NPY_BEGIN_THREADS _save = PyEval_SaveThread(); -#define NPY_END_THREADS if (_save) PyEval_RestoreThread(_save); +#define NPY_END_THREADS do {if (_save) PyEval_RestoreThread(_save);} while (0); #define NPY_BEGIN_THREADS_DESCR(dtype) \ - if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ - NPY_BEGIN_THREADS + do {if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ + NPY_BEGIN_THREADS;} while (0); #define NPY_END_THREADS_DESCR(dtype) \ - if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ - NPY_END_THREADS + do {if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ + NPY_END_THREADS; } while (0); #define NPY_ALLOW_C_API_DEF PyGILState_STATE __save__; #define NPY_ALLOW_C_API __save__ = PyGILState_Ensure(); Modified: trunk/numpy/core/include/numpy/ufuncobject.h =================================================================== --- trunk/numpy/core/include/numpy/ufuncobject.h 2008-04-26 16:41:28 UTC (rev 5092) +++ trunk/numpy/core/include/numpy/ufuncobject.h 2008-04-26 18:36:35 UTC (rev 5093) @@ -174,8 +174,8 @@ #if NPY_ALLOW_THREADS -#define NPY_LOOP_BEGIN_THREADS if (!(loop->obj)) {_save = PyEval_SaveThread();} -#define NPY_LOOP_END_THREADS if (!(loop->obj)) {PyEval_RestoreThread(_save);} +#define NPY_LOOP_BEGIN_THREADS do {if (!(loop->obj)) _save = PyEval_SaveThread();} while (0) +#define NPY_LOOP_END_THREADS do {if (!(loop->obj)) PyEval_RestoreThread(_save);} while (0) #else #define NPY_LOOP_BEGIN_THREADS #define NPY_LOOP_END_THREADS @@ -213,12 +213,12 @@ #define UFUNC_PYVALS_NAME "UFUNC_PYVALS" #define UFUNC_CHECK_ERROR(arg) \ - if (((arg)->obj && PyErr_Occurred()) || \ + do {if (((arg)->obj && PyErr_Occurred()) || \ ((arg)->errormask && \ PyUFunc_checkfperr((arg)->errormask, \ (arg)->errobj, \ &(arg)->first))) \ - goto fail + goto fail;} while (0) /* This code checks the IEEE status flags in a platform-dependent way */ /* Adapted from Numarray */ From numpy-svn at scipy.org Sat Apr 26 14:57:07 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 26 Apr 2008 13:57:07 -0500 (CDT) Subject: [Numpy-svn] r5094 - trunk/numpy/core/src Message-ID: <20080426185707.D70BD39C409@new.scipy.org> Author: charris Date: 2008-04-26 13:57:06 -0500 (Sat, 26 Apr 2008) New Revision: 5094 Modified: trunk/numpy/core/src/multiarraymodule.c Log: Add semicolons to end of macros. This helps editors and such get the formatting right. Do some small code cleanup. Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2008-04-26 18:36:35 UTC (rev 5093) +++ trunk/numpy/core/src/multiarraymodule.c 2008-04-26 18:57:06 UTC (rev 5094) @@ -2423,14 +2423,15 @@ int elsize; intp astride; PyArray_SortFunc *sort; - BEGIN_THREADS_DEF + BEGIN_THREADS_DEF; it = (PyArrayIterObject *)PyArray_IterAllButAxis((PyObject *)op, &axis); swap = !PyArray_ISNOTSWAPPED(op); - if (it == NULL) return -1; + if (it == NULL) { + return -1; + } - NPY_BEGIN_THREADS_DESCR(op->descr) - + NPY_BEGIN_THREADS_DESCR(op->descr); sort = op->descr->f->sort[which]; size = it->size; N = op->dimensions[axis]; @@ -2446,12 +2447,16 @@ while (size--) { _unaligned_strided_byte_copy(buffer, (intp) elsize, it->dataptr, astride, N, elsize); - if (swap) _strided_byte_swap(buffer, (intp) elsize, N, elsize); + if (swap) { + _strided_byte_swap(buffer, (intp) elsize, N, elsize); + } if (sort(buffer, N, op) < 0) { - PyDataMem_FREE(buffer); goto fail; + PyDataMem_FREE(buffer); + goto fail; } - if (swap) _strided_byte_swap(buffer, (intp) elsize, N, elsize); - + if (swap) { + _strided_byte_swap(buffer, (intp) elsize, N, elsize); + } _unaligned_strided_byte_copy(it->dataptr, astride, buffer, (intp) elsize, N, elsize); PyArray_ITER_NEXT(it); @@ -2460,20 +2465,20 @@ } else { while (size--) { - if (sort(it->dataptr, N, op) < 0) goto fail; + if (sort(it->dataptr, N, op) < 0) { + goto fail; + } PyArray_ITER_NEXT(it); } } - NPY_END_THREADS_DESCR(op->descr) - - Py_DECREF(it); + NPY_END_THREADS_DESCR(op->descr); + Py_DECREF(it); return 0; fail: - END_THREADS - - Py_DECREF(it); + NPY_END_THREADS; + Py_DECREF(it); return 0; } @@ -2489,7 +2494,7 @@ int elsize, swap; intp astride, rstride, *iptr; PyArray_ArgSortFunc *argsort; - BEGIN_THREADS_DEF + BEGIN_THREADS_DEF; ret = PyArray_New(op->ob_type, op->nd, op->dimensions, PyArray_INTP, @@ -2502,7 +2507,7 @@ swap = !PyArray_ISNOTSWAPPED(op); - NPY_BEGIN_THREADS_DESCR(op->descr) + NPY_BEGIN_THREADS_DESCR(op->descr); argsort = op->descr->f->argsort[which]; size = it->size; @@ -2548,17 +2553,17 @@ } } - NPY_END_THREADS_DESCR(op->descr) + NPY_END_THREADS_DESCR(op->descr); - Py_DECREF(it); + Py_DECREF(it); Py_DECREF(rit); return ret; fail: - END_THREADS + NPY_END_THREADS; - Py_DECREF(ret); + Py_DECREF(ret); Py_XDECREF(it); Py_XDECREF(rit); return NULL; @@ -2825,7 +2830,7 @@ int object=0; PyArray_ArgSortFunc *argsort; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; if (!PySequence_Check(sort_keys) || \ ((n=PySequence_Size(sort_keys)) <= 0)) { @@ -2897,7 +2902,9 @@ PyArray_IterAllButAxis((PyObject *)ret, &axis); if (rit == NULL) goto fail; - if (!object) {NPY_BEGIN_THREADS} + if (!object) { + NPY_BEGIN_THREADS; + } size = rit->size; N = mps[0]->dimensions[axis]; @@ -2961,7 +2968,9 @@ } } - if (!object) {NPY_END_THREADS} + if (!object) { + NPY_END_THREADS; + } finish: for (i=0; idescr); /* need ap1 as contiguous array and of right type */ @@ -3139,15 +3147,15 @@ } if (side == NPY_SEARCHLEFT) { - NPY_BEGIN_THREADS_DESCR(ap2->descr) - local_search_left(ap1, ap2, ret); - NPY_END_THREADS_DESCR(ap2->descr) - } + NPY_BEGIN_THREADS_DESCR(ap2->descr); + local_search_left(ap1, ap2, ret); + NPY_END_THREADS_DESCR(ap2->descr); + } else if (side == NPY_SEARCHRIGHT) { - NPY_BEGIN_THREADS_DESCR(ap2->descr) - local_search_right(ap1, ap2, ret); - NPY_END_THREADS_DESCR(ap2->descr) - } + NPY_BEGIN_THREADS_DESCR(ap2->descr); + local_search_right(ap1, ap2, ret); + NPY_END_THREADS_DESCR(ap2->descr); + } Py_DECREF(ap1); Py_DECREF(ap2); return (PyObject *)ret; @@ -3209,7 +3217,7 @@ PyArray_DotFunc *dot; PyArray_Descr *typec; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; typenum = PyArray_ObjectType(op1, 0); typenum = PyArray_ObjectType(op2, typenum); @@ -3274,7 +3282,7 @@ it2 = (PyArrayIterObject *)\ PyArray_IterAllButAxis((PyObject *)ap2, &axis); - NPY_BEGIN_THREADS_DESCR(ap2->descr) + NPY_BEGIN_THREADS_DESCR(ap2->descr); while(1) { while(it2->index < it2->size) { dot(it1->dataptr, is1, it2->dataptr, is2, op, l, ret); @@ -3285,7 +3293,7 @@ if (it1->index >= it1->size) break; PyArray_ITER_RESET(it2); } - NPY_END_THREADS_DESCR(ap2->descr) + NPY_END_THREADS_DESCR(ap2->descr); Py_DECREF(it1); Py_DECREF(it2); @@ -3320,9 +3328,8 @@ intp dimensions[MAX_DIMS]; PyArray_DotFunc *dot; PyArray_Descr *typec; + NPY_BEGIN_THREADS_DEF; - NPY_BEGIN_THREADS_DEF - typenum = PyArray_ObjectType(op1, 0); typenum = PyArray_ObjectType(op2, typenum); @@ -3410,7 +3417,7 @@ it2 = (PyArrayIterObject *)\ PyArray_IterAllButAxis((PyObject *)ap2, &matchDim); - NPY_BEGIN_THREADS_DESCR(ap2->descr) + NPY_BEGIN_THREADS_DESCR(ap2->descr); while(1) { while(it2->index < it2->size) { dot(it1->dataptr, is1, it2->dataptr, is2, op, l, ret); @@ -3421,7 +3428,7 @@ if (it1->index >= it1->size) break; PyArray_ITER_RESET(it2); } - NPY_END_THREADS_DESCR(ap2->descr) + NPY_END_THREADS_DESCR(ap2->descr); Py_DECREF(it1); Py_DECREF(it2); if (PyErr_Occurred()) goto fail; /* only for OBJECT arrays */ @@ -3482,7 +3489,7 @@ return NULL; } /* do 2-d loop */ - NPY_BEGIN_ALLOW_THREADS + NPY_BEGIN_ALLOW_THREADS; optr = PyArray_DATA(ret); str2 = elsize*dims[0]; for (i=0; idescr) + NPY_BEGIN_THREADS_DESCR(ret->descr); is1 = ap1->strides[0]; is2 = ap2->strides[0]; op = ret->data; os = ret->descr->elsize; @@ -3594,7 +3601,7 @@ ip1 += is1; op += os; } - NPY_END_THREADS_DESCR(ret->descr) + NPY_END_THREADS_DESCR(ret->descr); if (PyErr_Occurred()) goto fail; Py_DECREF(ap1); @@ -3722,7 +3729,7 @@ int elsize; int copyret=0; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; if ((ap=(PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL; @@ -3791,14 +3798,14 @@ if (rp != out) copyret = 1; } - NPY_BEGIN_THREADS_DESCR(ap->descr) + NPY_BEGIN_THREADS_DESCR(ap->descr); n = PyArray_SIZE(ap)/m; rptr = (intp *)rp->data; for (ip = ap->data, i=0; idescr) + NPY_END_THREADS_DESCR(ap->descr); Py_DECREF(ap); if (copyret) { @@ -7393,14 +7400,16 @@ if (!PyArg_ParseTuple(args, "|i", &kind)) return NULL; if (kind) { - Py_BEGIN_ALLOW_THREADS - while (a>=0) { - if ((a % 1000 == 0) && - PyOS_InterruptOccurred()) break; - a+=1; + NPY_BEGIN_ALLOW_THREADS; + while (a>=0) { + if ((a % 1000 == 0) && + PyOS_InterruptOccurred()) { + break; } - Py_END_ALLOW_THREADS - } + a+=1; + } + NPY_END_ALLOW_THREADS; + } else { NPY_SIGINT_ON From numpy-svn at scipy.org Sat Apr 26 17:32:04 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 26 Apr 2008 16:32:04 -0500 (CDT) Subject: [Numpy-svn] r5095 - trunk/numpy/core/src Message-ID: <20080426213204.2624E39C071@new.scipy.org> Author: charris Date: 2008-04-26 16:31:54 -0500 (Sat, 26 Apr 2008) New Revision: 5095 Modified: trunk/numpy/core/src/multiarraymodule.c Log: revert to 5092 Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2008-04-26 18:57:06 UTC (rev 5094) +++ trunk/numpy/core/src/multiarraymodule.c 2008-04-26 21:31:54 UTC (rev 5095) @@ -2423,15 +2423,14 @@ int elsize; intp astride; PyArray_SortFunc *sort; - BEGIN_THREADS_DEF; + BEGIN_THREADS_DEF it = (PyArrayIterObject *)PyArray_IterAllButAxis((PyObject *)op, &axis); swap = !PyArray_ISNOTSWAPPED(op); - if (it == NULL) { - return -1; - } + if (it == NULL) return -1; - NPY_BEGIN_THREADS_DESCR(op->descr); + NPY_BEGIN_THREADS_DESCR(op->descr) + sort = op->descr->f->sort[which]; size = it->size; N = op->dimensions[axis]; @@ -2447,16 +2446,12 @@ while (size--) { _unaligned_strided_byte_copy(buffer, (intp) elsize, it->dataptr, astride, N, elsize); - if (swap) { - _strided_byte_swap(buffer, (intp) elsize, N, elsize); - } + if (swap) _strided_byte_swap(buffer, (intp) elsize, N, elsize); if (sort(buffer, N, op) < 0) { - PyDataMem_FREE(buffer); - goto fail; + PyDataMem_FREE(buffer); goto fail; } - if (swap) { - _strided_byte_swap(buffer, (intp) elsize, N, elsize); - } + if (swap) _strided_byte_swap(buffer, (intp) elsize, N, elsize); + _unaligned_strided_byte_copy(it->dataptr, astride, buffer, (intp) elsize, N, elsize); PyArray_ITER_NEXT(it); @@ -2465,20 +2460,20 @@ } else { while (size--) { - if (sort(it->dataptr, N, op) < 0) { - goto fail; - } + if (sort(it->dataptr, N, op) < 0) goto fail; PyArray_ITER_NEXT(it); } } - NPY_END_THREADS_DESCR(op->descr); - Py_DECREF(it); + NPY_END_THREADS_DESCR(op->descr) + + Py_DECREF(it); return 0; fail: - NPY_END_THREADS; - Py_DECREF(it); + END_THREADS + + Py_DECREF(it); return 0; } @@ -2494,7 +2489,7 @@ int elsize, swap; intp astride, rstride, *iptr; PyArray_ArgSortFunc *argsort; - BEGIN_THREADS_DEF; + BEGIN_THREADS_DEF ret = PyArray_New(op->ob_type, op->nd, op->dimensions, PyArray_INTP, @@ -2507,7 +2502,7 @@ swap = !PyArray_ISNOTSWAPPED(op); - NPY_BEGIN_THREADS_DESCR(op->descr); + NPY_BEGIN_THREADS_DESCR(op->descr) argsort = op->descr->f->argsort[which]; size = it->size; @@ -2553,17 +2548,17 @@ } } - NPY_END_THREADS_DESCR(op->descr); + NPY_END_THREADS_DESCR(op->descr) - Py_DECREF(it); + Py_DECREF(it); Py_DECREF(rit); return ret; fail: - NPY_END_THREADS; + END_THREADS - Py_DECREF(ret); + Py_DECREF(ret); Py_XDECREF(it); Py_XDECREF(rit); return NULL; @@ -2830,7 +2825,7 @@ int object=0; PyArray_ArgSortFunc *argsort; - NPY_BEGIN_THREADS_DEF; + NPY_BEGIN_THREADS_DEF if (!PySequence_Check(sort_keys) || \ ((n=PySequence_Size(sort_keys)) <= 0)) { @@ -2902,9 +2897,7 @@ PyArray_IterAllButAxis((PyObject *)ret, &axis); if (rit == NULL) goto fail; - if (!object) { - NPY_BEGIN_THREADS; - } + if (!object) {NPY_BEGIN_THREADS} size = rit->size; N = mps[0]->dimensions[axis]; @@ -2968,9 +2961,7 @@ } } - if (!object) { - NPY_END_THREADS; - } + if (!object) {NPY_END_THREADS} finish: for (i=0; idescr); /* need ap1 as contiguous array and of right type */ @@ -3147,15 +3139,15 @@ } if (side == NPY_SEARCHLEFT) { - NPY_BEGIN_THREADS_DESCR(ap2->descr); - local_search_left(ap1, ap2, ret); - NPY_END_THREADS_DESCR(ap2->descr); - } + NPY_BEGIN_THREADS_DESCR(ap2->descr) + local_search_left(ap1, ap2, ret); + NPY_END_THREADS_DESCR(ap2->descr) + } else if (side == NPY_SEARCHRIGHT) { - NPY_BEGIN_THREADS_DESCR(ap2->descr); - local_search_right(ap1, ap2, ret); - NPY_END_THREADS_DESCR(ap2->descr); - } + NPY_BEGIN_THREADS_DESCR(ap2->descr) + local_search_right(ap1, ap2, ret); + NPY_END_THREADS_DESCR(ap2->descr) + } Py_DECREF(ap1); Py_DECREF(ap2); return (PyObject *)ret; @@ -3217,7 +3209,7 @@ PyArray_DotFunc *dot; PyArray_Descr *typec; - NPY_BEGIN_THREADS_DEF; + NPY_BEGIN_THREADS_DEF typenum = PyArray_ObjectType(op1, 0); typenum = PyArray_ObjectType(op2, typenum); @@ -3282,7 +3274,7 @@ it2 = (PyArrayIterObject *)\ PyArray_IterAllButAxis((PyObject *)ap2, &axis); - NPY_BEGIN_THREADS_DESCR(ap2->descr); + NPY_BEGIN_THREADS_DESCR(ap2->descr) while(1) { while(it2->index < it2->size) { dot(it1->dataptr, is1, it2->dataptr, is2, op, l, ret); @@ -3293,7 +3285,7 @@ if (it1->index >= it1->size) break; PyArray_ITER_RESET(it2); } - NPY_END_THREADS_DESCR(ap2->descr); + NPY_END_THREADS_DESCR(ap2->descr) Py_DECREF(it1); Py_DECREF(it2); @@ -3328,8 +3320,9 @@ intp dimensions[MAX_DIMS]; PyArray_DotFunc *dot; PyArray_Descr *typec; - NPY_BEGIN_THREADS_DEF; + NPY_BEGIN_THREADS_DEF + typenum = PyArray_ObjectType(op1, 0); typenum = PyArray_ObjectType(op2, typenum); @@ -3417,7 +3410,7 @@ it2 = (PyArrayIterObject *)\ PyArray_IterAllButAxis((PyObject *)ap2, &matchDim); - NPY_BEGIN_THREADS_DESCR(ap2->descr); + NPY_BEGIN_THREADS_DESCR(ap2->descr) while(1) { while(it2->index < it2->size) { dot(it1->dataptr, is1, it2->dataptr, is2, op, l, ret); @@ -3428,7 +3421,7 @@ if (it1->index >= it1->size) break; PyArray_ITER_RESET(it2); } - NPY_END_THREADS_DESCR(ap2->descr); + NPY_END_THREADS_DESCR(ap2->descr) Py_DECREF(it1); Py_DECREF(it2); if (PyErr_Occurred()) goto fail; /* only for OBJECT arrays */ @@ -3489,7 +3482,7 @@ return NULL; } /* do 2-d loop */ - NPY_BEGIN_ALLOW_THREADS; + NPY_BEGIN_ALLOW_THREADS optr = PyArray_DATA(ret); str2 = elsize*dims[0]; for (i=0; idescr); + NPY_BEGIN_THREADS_DESCR(ret->descr) is1 = ap1->strides[0]; is2 = ap2->strides[0]; op = ret->data; os = ret->descr->elsize; @@ -3601,7 +3594,7 @@ ip1 += is1; op += os; } - NPY_END_THREADS_DESCR(ret->descr); + NPY_END_THREADS_DESCR(ret->descr) if (PyErr_Occurred()) goto fail; Py_DECREF(ap1); @@ -3729,7 +3722,7 @@ int elsize; int copyret=0; - NPY_BEGIN_THREADS_DEF; + NPY_BEGIN_THREADS_DEF if ((ap=(PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL; @@ -3798,14 +3791,14 @@ if (rp != out) copyret = 1; } - NPY_BEGIN_THREADS_DESCR(ap->descr); + NPY_BEGIN_THREADS_DESCR(ap->descr) n = PyArray_SIZE(ap)/m; rptr = (intp *)rp->data; for (ip = ap->data, i=0; idescr); + NPY_END_THREADS_DESCR(ap->descr) Py_DECREF(ap); if (copyret) { @@ -7400,16 +7393,14 @@ if (!PyArg_ParseTuple(args, "|i", &kind)) return NULL; if (kind) { - NPY_BEGIN_ALLOW_THREADS; - while (a>=0) { - if ((a % 1000 == 0) && - PyOS_InterruptOccurred()) { - break; + Py_BEGIN_ALLOW_THREADS + while (a>=0) { + if ((a % 1000 == 0) && + PyOS_InterruptOccurred()) break; + a+=1; } - a+=1; - } - NPY_END_ALLOW_THREADS; - } + Py_END_ALLOW_THREADS + } else { NPY_SIGINT_ON From numpy-svn at scipy.org Sat Apr 26 17:37:19 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 26 Apr 2008 16:37:19 -0500 (CDT) Subject: [Numpy-svn] r5096 - trunk/numpy Message-ID: <20080426213719.49E2739C071@new.scipy.org> Author: ptvirtan Date: 2008-04-26 16:37:11 -0500 (Sat, 26 Apr 2008) New Revision: 5096 Modified: trunk/numpy/add_newdocs.py Log: Rewrite most ndarray docstrings: RST-reformat old and add new ones. Most of the docstrings are adapted from those of the functions in core.fromnumeric. I edited the ndarray method docstrings to closely match the function docstrings. I didn't yet fix the discrepancy in ndarray.reshape and fromnumeric.reshape docstrings re ValueError raising. Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2008-04-26 21:31:54 UTC (rev 5095) +++ trunk/numpy/add_newdocs.py 2008-04-26 21:37:11 UTC (rev 5096) @@ -1,7 +1,11 @@ -# This is only meant to add docs to -# objects defined in C-extension modules. -# The purpose is to allow easier editing of the -# docstrings without requiring a re-compile. +# This is only meant to add docs to objects defined in C-extension modules. +# The purpose is to allow easier editing of the docstrings without +# requiring a re-compile. + +# NOTE: Many of the methods of ndarray have corresponding functions. +# If you update these docstrings, please keep also the ones in +# core/fromnumeric.py, core/defmatrix.py up-to-date. + from lib import add_newdoc add_newdoc('numpy.core', 'dtype', @@ -74,9 +78,10 @@ "this data-type"), ('num', "Internally-used number for builtin base"), ('newbyteorder', -"""self.newbyteorder() -returns a copy of the dtype object with altered byteorders. -If is not given all byteorders are swapped. +"""self.newbyteorder(endian) + +Returns a copy of the dtype object with altered byteorders. +If `endian` is not given all byteorders are swapped. Otherwise endian can be '>', '<', or '=' to force a particular byteorder. Data-types in all fields are also updated in the new dtype object. @@ -189,7 +194,7 @@ add_newdoc('numpy.core.multiarray','array', """array(object, dtype=None, copy=1,order=None, subok=0,ndmin=0) - Return an array from object with the specified date-type. + Return an array from object with the specified data-type. Parameters ---------- @@ -226,11 +231,20 @@ """) add_newdoc('numpy.core.multiarray','empty', - """empty((d1,...,dn),dtype=float,order='C') + """empty(shape, dtype=float, order='C') - Return a new array of shape (d1,...,dn) and given type with all its - entries uninitialized. This can be faster than zeros. + Return a new array of given shape and type with all entries uninitialized. + This can be faster than zeros. + Parameters + ---------- + shape : tuple of integers + Shape of the new array + dtype : data-type + The desired data-type for the array. + order : {'C', 'F'} + Whether to store multidimensional data in C or Fortran order. + """) @@ -247,11 +261,19 @@ """) add_newdoc('numpy.core.multiarray','zeros', - """zeros((d1,...,dn),dtype=float,order='C') + """zeros(shape, dtype=float, order='C') - Return a new array of shape (d1,...,dn) and type typecode with all - it's entries initialized to zero. + Return a new array of given shape and type, filled zeros. + Parameters + ---------- + shape : tuple of integers + Shape of the new array + dtype : data-type + The desired data-type for the array. + order : {'C', 'F'} + Whether to store multidimensional data in C or Fortran order. + """) add_newdoc('numpy.core.multiarray','set_typeDict', @@ -278,55 +300,80 @@ add_newdoc('numpy.core.multiarray','fromiter', """fromiter(iterable, dtype, count=-1) - Return a new 1d array initialized from iterable. If count is - nonegative, the new array will have count elements, otherwise it's - size is determined by the generator. + Return a new 1d array initialized from iterable. + Parameters + ---------- + iterable + Iterable object from which to obtain data + dtype : data-type + Data type of the returned array. + count : int + Number of items to read. -1 means all data in the iterable. + + Returns + ------- + new_array : ndarray + """) add_newdoc('numpy.core.multiarray','fromfile', - """fromfile(file=, dtype=float, count=-1, sep='') -> array. - + """fromfile(file=, dtype=float, count=-1, sep='') + + Return an array of the given data type from a text or binary file. + + Data written using the tofile() method can be conveniently recovered using + this function. + Parameters ---------- file : file or string - open file object or string containing file name. + Open file object or string containing a file name. dtype : data-type - data type of the returned array + Data type of the returned array. + For binary files, it is also used to determine the size and order of + the items in the file. count : int - number of items to read (-1 mean 'all') + Number of items to read. -1 means all data in the whole file. sep : string - separater between items if file is a text file (default "") + Separator between items if file is a text file. + Empty ("") separator means the file should be treated as binary. - Return an array of the given data type from a text or binary file. The - 'file' argument can be an open file or a string with the name of a file to - read from. If 'count' == -1 the entire file is read, otherwise count is the - number of items of the given type to read in. If 'sep' is "" it means to - read binary data from the file using the specified dtype, otherwise it gives - the separator between elements in a text file. The 'dtype' value is also - used to determine the size and order of the items in binary files. - - Data written using the tofile() method can be conveniently recovered using - this function. - + See also + -------- + loadtxt : load data from text files + + Notes + ----- WARNING: This function should be used sparingly as the binary files are not platform independent. In particular, they contain no endianess or datatype information. Nevertheless it can be useful for reading in simply formatted or binary data quickly. - + """) add_newdoc('numpy.core.multiarray','frombuffer', """frombuffer(buffer=, dtype=float, count=-1, offset=0) - - Returns a 1-d array of data type dtype from buffer. The buffer - argument must be an object that exposes the buffer interface. If - count is -1 then the entire buffer is used, otherwise, count is the - size of the output. If offset is given then jump that far into the - buffer. If the buffer has data that is out not in machine byte-order, - than use a propert data type descriptor. The data will not be + + Returns a 1-d array of data type dtype from buffer. + + Parameters + ---------- + buffer + An object that exposes the buffer interface + dtype : data-type + Data type of the returned array. + count : int + Number of items to read. -1 means all data in the buffer. + offset : int + Number of bytes to jump from the start of the buffer before reading + + Notes + ----- + If the buffer has data that is not in machine byte-order, then + use a proper data type descriptor. The data will not be byteswapped, but the array will manage it in future operations. - + """) add_newdoc('numpy.core.multiarray','concatenate', @@ -448,14 +495,14 @@ a sort on multiple keys. If the keys represented columns of a spreadsheet, for example, this would sort using multiple columns (the last key being used for the primary sort order, the second-to-last key for the secondary - sort order, and so on). The keys argument must be a sequence of things - that can be converted to arrays of the same shape. + sort order, and so on). Parameters ---------- keys : (k,N) array or tuple of (N,) sequences - Array containing values that the returned indices should sort. - + Array containing values that the returned indices should sort, or + a sequence of things that can be converted to arrays of the same shape. + axis : integer Axis to be indirectly sorted. Default is -1 (i.e. last axis). @@ -691,17 +738,17 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('__copy__', - """a.__copy__(|order) -> copy, possibly with different order. + """a.__copy__([order]) Return a copy of the array. Parameters ---------- - order : {'C', 'F', 'A'} + order : {'C', 'F', 'A'}, optional If order is 'C' (False) then the result is contiguous (default). If order is 'Fortran' (True) then the result has fortran order. If order is 'Any' (None) then the result has fortran order - only if m is already in fortran order.; + only if the array already is in fortran order. """)) @@ -741,26 +788,110 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('all', - """ a.all(axis=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 + Parameters + ---------- + axis : {None, integer} + Axis to perform the operation over. + If None, perform over flattened array. + 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. + + See Also + -------- + all : equivalent function + + """)) + + add_newdoc('numpy.core.multiarray', 'ndarray', ('any', - """ a.any(axis=None, out=None) + """a.any(axis=None, out=None) + Check if any of the elements of `a` are true. + + Performs a logical_or over the given axis and returns the result + + Parameters + ---------- + axis : {None, integer} + Axis to perform the operation over. + If None, perform over flattened array and return a scalar. + 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. + + See Also + -------- + any : equivalent function + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('argmax', - """ a.argmax(axis=None, out=None) + """a.argmax(axis=None, out=None) + Returns array of indices of the maximum values along the given axis. + + Parameters + ---------- + axis : {None, integer} + If None, the index is into the flattened array, otherwise along + the specified axis + 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. + + Returns + ------- + index_array : {integer_array} + + Examples + -------- + >>> a = arange(6).reshape(2,3) + >>> a.argmax() + 5 + >>> a.argmax(0) + array([1, 1, 1]) + >>> a.argmax(1) + array([2, 2]) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('argmin', - """ a.argmin(axis=None, out=None) + """a.argmin(axis=None, out=None) + Return array of indices to the minimum values along the given axis. + + Parameters + ---------- + axis : {None, integer} + If None, the index is into the flattened array, otherwise along + the specified axis + 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. + + Returns + ------- + index_array : {integer_array} + + Examples + -------- + >>> a = arange(6).reshape(2,3) + >>> a.argmin() + 0 + >>> a.argmin(0) + array([0, 0, 0]) + >>> a.argmin(1) + array([0, 0]) + """)) @@ -796,23 +927,23 @@ Notes ----- - The various sorts are 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. 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 + ============ ======= ============= ============ ======== - All the sort algorithms make temporary copies of the data when the sort is not - along the last axis. Consequently, sorts along the last axis are faster and use - less space than sorts along other axis. + All the sort algorithms make temporary copies of the data when the + sort is not along the last axis. Consequently, sorts along the + last axis are faster and use less space than sorts along other + axis. """)) @@ -836,67 +967,220 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('choose', - """ a.choose(b0, b1, ..., bn, out=None, mode='raise') + """a.choose(choices, out=None, mode='raise') + a.choose(*choices, out=None, mode='raise') - Return an array that merges the b_i arrays together using 'a' as - the index The b_i arrays and 'a' must all be broadcastable to the - same shape. The output at a particular position is the input - array b_i at that position depending on the value of 'a' at that - position. Therefore, 'a' must be an integer array with entries - from 0 to n+1.; + Use an index array to construct a new array from a set of choices. + Given an array of integers and a set of n choice arrays, this method + will create a new array that merges each of the choice arrays. Where a + value in `a` is i, the new array will have the value that choices[i] + contains in the same place. + + Parameters + ---------- + choices : sequence of arrays + Choice arrays. The index array and all of the choices should be + broadcastable to the same shape. + out : array, optional + If provided, the result will be inserted into this array. It should + be of the appropriate shape and dtype + mode : {'raise', 'wrap', 'clip'}, optional + Specifies how out-of-bounds indices will behave. + 'raise' : raise an error + 'wrap' : wrap around + 'clip' : clip to the range + + Returns + ------- + merged_array : array + + See Also + -------- + choose : equivalent function + + Examples + -------- + >>> choices = [[0, 1, 2, 3], [10, 11, 12, 13], + ... [20, 21, 22, 23], [30, 31, 32, 33]] + >>> a = array([2, 3, 1, 0], dtype=int) + >>> a.choose(choices) + array([20, 31, 12, 3]) + >>> a = array([2, 4, 1, 0], dtype=int) + >>> a.choose(choices, mode='clip') + array([20, 31, 12, 3]) + >>> a.choose(choices, mode='wrap') + array([20, 1, 12, 3]) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('clip', - """a.clip(min=, max=, out=None) + """a.clip(a_min, a_max, out=None) + Return an array whose values are limited to [a_min, a_max]. + + Parameters + ---------- + a_min + Minimum value + a_max + Maximum value + out : {None, array}, optional + Array into which the clipped values can be placed. Its type + is preserved and it must be of the right shape to hold the + output. + + Returns + ------- + clipped_array : array + A new array whose elements are same as for a, but values + < a_min are replaced with a_min, and > a_max with a_max. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('compress', - """a.compress(condition=, axis=None, out=None) + """a.compress(condition, axis=None, out=None) + Return selected slices of an array along given axis. + + Parameters + ---------- + condition : {array} + Boolean 1-d array selecting which entries to return. If len(condition) + is less than the size of a along the axis, then output is truncated + to length of condition array. + axis : {None, integer} + Axis along which to take slices. If None, work on the flattened array. + out : array, optional + Output array. Its type is preserved and it must be of the right + shape to hold the output. + + Returns + ------- + compressed_array : array + A copy of a, without the slices along axis for which condition is false. + + Examples + -------- + >>> a = np.array([[1, 2], [3, 4]]) + >>> a.compress([0, 1], axis=0) + array([[3, 4]]) + >>> a.compress([1], axis=1) + array([[1], + [3]]) + >>> a.compress([0,1,1]) + array([2, 3]) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('conj', """a.conj() + Return an array with all complex-valued elements conjugated. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('conjugate', """a.conjugate() + Return an array with all complex-valued elements conjugated. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('copy', - """a.copy(|order) -> copy, possibly with different order. + """a.copy([order]) Return a copy of the array. Parameters ---------- - order : Order of returned copy (default 'C') + order : {'C', 'F', 'A'}, optional If order is 'C' (False) then the result is contiguous (default). If order is 'Fortran' (True) then the result has fortran order. If order is 'Any' (None) then the result has fortran order - only if m is already in fortran order.; - + only if the array already is in fortran order. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('cumprod', - """a.cumprod(axis=None, dtype=None) + """a.cumprod(axis=None, dtype=None, out=None) + Return the cumulative product of the elements along the given axis. + + The cumulative product is taken over the flattened array by + default, otherwise over the specified axis. + + Parameters + ---------- + axis : {None, -1, int}, optional + Axis along which the product is computed. The default + (``axis``= None) is to compute over the flattened array. + dtype : {None, dtype}, optional + Determines the type of the returned array and of the accumulator + where the elements are multiplied. If dtype has the value None and + the type of a is an integer type of precision less than the default + platform integer, then the default platform integer precision is + used. Otherwise, the dtype is the same as that of a. + out : ndarray, optional + Alternative output array in which to place the result. It must + have the same shape and buffer length as the expected output + but the type will be cast if necessary. + + Returns + ------- + cumprod : ndarray. + A new array holding the result is returned unless out is + specified, in which case a reference to out is returned. + + Notes + ----- + Arithmetic is modular when using integer types, and no error is + raised on overflow. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('cumsum', """a.cumsum(axis=None, dtype=None, out=None) + Return the cumulative sum of the elements along the given axis. + + The cumulative sum is calculated over the flattened array by + default, otherwise over the specified axis. + + Parameters + ---------- + axis : {None, -1, int}, optional + Axis along which the sum is computed. The default + (``axis``= None) is to compute over the flattened array. + dtype : {None, dtype}, optional + Determines the type of the returned array and of the accumulator + where the elements are summed. If dtype has the value None and + the type of a is an integer type of precision less than the default + platform integer, then the default platform integer precision is + used. Otherwise, the dtype is the same as that of a. + out : ndarray, optional + Alternative output array in which to place the result. It must + have the same shape and buffer length as the expected output + but the type will be cast if necessary. + + Returns + ------- + cumsum : ndarray. + A new array holding the result is returned unless ``out`` is + specified, in which case a reference to ``out`` is returned. + + Notes + ----- + Arithmetic is modular when using integer types, and no error is + raised on overflow. + """)) @@ -960,37 +1244,55 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('dump', - """a.dump(file) Dump a pickle of the array to the specified file. - - The array can be read back with pickle.load or numpy.load - - Arguments: - file -- string naming the dump file. - + """a.dump(file) + + Dump a pickle of the array to the specified file. + The array can be read back with pickle.load or numpy.load. + + Parameters + ---------- + file : str + A string naming the dump file. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('dumps', - """a.dumps() returns the pickle of the array as a string. + """a.dumps() + Returns the pickle of the array as a string. pickle.loads or numpy.loads will convert the string back to an array. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('fill', - """a.fill(value) -> None. Fill the array with the scalar value. - + """a.fill(value) + + Fill the array with a scalar value. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('flatten', - """a.flatten([fortran]) return a 1-d array (always copy) - + """a.flatten([order]) + + Return a 1-d array (always copy) + + Parameters + ---------- + order : {'C', 'F'} + Whether to flatten in C or Fortran order. + + Notes + ----- + a.flatten('F') == a.T.flatten('C') + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('getfield', - """a.getfield(dtype, offset) -> field of array as given type. + """a.getfield(dtype, offset) Returns a field of the given array as a certain type. A field is a view of the array data with each itemsize determined by the given type and the @@ -1000,7 +1302,7 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('item', - """a.item() -> copy of first array item as Python scalar. + """a.item() Copy the first element of array to a standard Python scalar and return it. The array must be of size one. @@ -1009,8 +1311,25 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('max', - """a.max(axis=None) + """a.max(axis=None, out=None) + Return the maximum along a given axis. + + Parameters + ---------- + axis : {None, int}, optional + Axis along which to operate. By default, ``axis`` is None and the + flattened input is used. + out : array_like, optional + Alternative output array in which to place the result. Must + be of the same shape and buffer length as the expected output. + + Results + ------- + amax : array_like + New array holding the result. + If ``out`` was specified, ``out`` is returned. + """)) @@ -1054,129 +1373,366 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('min', - """a.min(axis=None) + """a.min(axis=None, out=None) + Return the minimum along a given axis. + + Parameters + ---------- + axis : {None, int}, optional + Axis along which to operate. By default, ``axis`` is None and the + flattened input is used. + out : array_like, optional + Alternative output array in which to place the result. Must + be of the same shape and buffer length as the expected output. + + Results + ------- + amin : array_like + New array holding the result. + If ``out`` was specified, ``out`` is returned. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('newbyteorder', - """a.newbyteorder() is equivalent to - a.view(a.dtype.newbytorder()) + """a.newbyteorder(byteorder) + Equivalent to a.view(a.dtype.newbytorder(byteorder)) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('nonzero', - """a.nonzero() returns a tuple of arrays - - Returns a tuple of arrays, one for each dimension of a, - containing the indices of the non-zero elements in that - dimension. The corresponding non-zero values can be obtained - with + """a.nonzero() + + Returns a tuple of arrays, one for each dimension of a, containing + the indices of the non-zero elements in that dimension. The + corresponding non-zero values can be obtained with:: + a[a.nonzero()]. - To group the indices by element, rather than dimension, use + To group the indices by element, rather than dimension, use:: + transpose(a.nonzero()) + instead. The result of this is always a 2d array, with a row for - each non-zero element.; + each non-zero element. """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('prod', - """a.prod(axis=None, dtype=None) + """a.prod(axis=None, dtype=None, out=None) + Return the product of the array elements over the given axis + + Parameters + ---------- + axis : {None, integer} + Axis over which the product is taken. If None is used, then the + product is over all the array elements. + dtype : {None, dtype}, optional + Determines the type of the returned array and of the accumulator + where the elements are multiplied. If dtype has the value None and + the type of a is an integer type of precision less than the default + platform integer, then the default platform integer precision is + used. Otherwise, the dtype is the same as that of a. + out : {None, array}, optional + Alternative output array in which to place the result. It must have + the same shape as the expected output but the type will be cast if + necessary. + + Returns + ------- + product_along_axis : {array, scalar}, see dtype parameter above. + Returns an array whose shape is the same as a with the specified + axis removed. Returns a 0d array when a is 1d or axis=None. + Returns a reference to the specified output array if specified. + + See Also + -------- + prod : equivalent function + + Examples + -------- + >>> prod([1.,2.]) + 2.0 + >>> prod([1.,2.], dtype=int32) + 2 + >>> prod([[1.,2.],[3.,4.]]) + 24.0 + >>> prod([[1.,2.],[3.,4.]], axis=1) + array([ 2., 12.]) + + Notes + ----- + Arithmetic is modular when using integer types, and no error is + raised on overflow. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('ptp', - """a.ptp(axis=None) a.max(axis)-a.min(axis) - + """a.ptp(axis=None, out=None) + + Return (maximum - minimum) along the the given dimension + (i.e. peak-to-peak value). + + Parameters + ---------- + axis : {None, int}, optional + Axis along which to find the peaks. If None (default) the + flattened array is used. + out : array_like + 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. + + Returns + ------- + ptp : ndarray. + A new array holding the result, unless ``out`` was + specified, in which case a reference to ``out`` is returned. + + Examples + -------- + >>> x = np.arange(4).reshape((2,2)) + >>> x + array([[0, 1], + [2, 3]]) + >>> x.ptp(0) + array([2, 2]) + >>> x.ptp(1) + array([1, 1]) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('put', - """a.put(indices, values, mode) sets a.flat[n] = values[n] for - each n in indices. If values is shorter than indices then it - will repeat. + """a.put(indices, values, mode='raise') + + Set a.flat[n] = values[n] for all n in indices. + If values is shorter than indices, it will repeat. + + Parameters + ---------- + indices : array_like + Target indices, interpreted as integers. + values : array_like + Values to place in `a` at target indices. + mode : {'raise', 'wrap', 'clip'} + Specifies how out-of-bounds indices will behave. + 'raise' -- raise an error + 'wrap' -- wrap around + 'clip' -- clip to the range + + Notes + ----- + If v is shorter than mask it will be repeated as necessary. In particular v + can be a scalar or length 1 array. The routine put is the equivalent of the + following (although the loop is in C for speed): + + ind = array(indices, copy=False) + v = array(values, copy=False).astype(a.dtype) + for i in ind: a.flat[i] = v[i] + + Examples + -------- + >>> x = np.arange(5) + >>> x.put([0,2,4],[-1,-2,-3]) + >>> print x + [-1 1 -2 3 -3] + """)) add_newdoc('numpy.core.multiarray', 'putmask', - """putmask(a, mask, values) sets a.flat[n] = values[n] for each n where - mask.flat[n] is true. If values is not the same size of a and mask then - it will repeat. This gives different behavior than a[mask] = values. + """putmask(a, mask, values) + + Sets a.flat[n] = values[n] for each n where mask.flat[n] is true. + + If values is not the same size as `a` and `mask` then it will repeat. + This gives behavior different from a[mask] = values. + + Parameters + ---------- + a : {array_like} + Array to put data into + mask : {array_like} + Boolean mask array + values : {array_like} + Values to put """) add_newdoc('numpy.core.multiarray', 'ndarray', ('ravel', - """a.ravel([fortran]) return a 1-d array (copy only if needed) + """a.ravel([order]) + Return a 1d array containing the elements of a (copy only if needed). + + The elements in the new array are taken in the order specified by + the order keyword. The new array is a view of a if possible, + otherwise it is a copy. + + Parameters + ---------- + order : {'C','F'}, optional + If order is 'C' the elements are taken in row major order. If order + is 'F' they are taken in column major order. + + Returns + ------- + 1d_array : {array} + + See Also + -------- + ndarray.flat : 1d iterator over the array. + ndarray.flatten : 1d array copy of the elements of a in C order. + + Examples + -------- + >>> x = array([[1,2,3],[4,5,6]]) + >>> x + array([[1, 2, 3], + [4, 5, 6]]) + >>> x.ravel() + array([1, 2, 3, 4, 5, 6]) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('repeat', - """a.repeat(repeats=, axis=none) + """a.repeat(repeats, axis=None) + + Repeat elements of an array. + + Parameters + ---------- + a : {array_like} + Input array. + repeats : {integer, integer_array} + The number of repetitions for each element. If a plain integer, then + it is applied to all elements. If an array, it needs to be of the + same length as the chosen axis. + axis : {None, integer}, optional + The axis along which to repeat values. If None, then this method + will operated on the flattened array `a` and return a similarly flat + result. - copy elements of a, repeats times. the repeats argument must be a sequence - of length a.shape[axis] or a scalar. + Returns + ------- + repeated_array : array + See also + -------- + tile : tile an array + + Examples + -------- + >>> x = array([[1,2],[3,4]]) + >>> x.repeat(2) + array([1, 1, 2, 2, 3, 3, 4, 4]) + >>> x.repeat(3, axis=1) + array([[1, 1, 1, 2, 2, 2], + [3, 3, 3, 4, 4, 4]]) + >>> x.repeat([1, 2], axis=0) + array([[1, 2], + [3, 4], + [3, 4]]) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('reshape', - """a.reshape(d1, d2, ..., dn, order='c') + """a.reshape(shape, order='C') + a.reshape(*shape, order='C') - Return a new array from this one. The new array must have the same number - of elements as self. Also always returns a view or raises a ValueError if - that is impossible. + Returns an array containing the data of a, but with a new shape. + The result is a view to the original array; if this is not possible, + a ValueError is raised. + + Parameters + ---------- + shape : shape tuple or int + The new shape should be compatible with the original shape. If an + integer, then the result will be a 1D array of that length. + order : {'C', 'F'}, optional + Determines whether the array data should be viewed as in C + (row-major) order or FORTRAN (column-major) order. + + Returns + ------- + reshaped_array : array + A new view to the array. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('resize', - """a.resize(new_shape, refcheck=True, order=False) -> None. Change array shape. + """a.resize(new_shape, refcheck=True, order=False) Change size and shape of self inplace. Array must own its own memory and - not be referenced by other arrays. Returns None. + not be referenced by other arrays. Returns None. """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('round', - """a.round(decimals=0, out=None) -> out (new). Rounds to 'decimals' places. + """a.round(decimals=0, out=None) + + Return an array rounded a to the given number of decimals. + The real and imaginary parts of complex numbers are rounded separately. The + result of rounding a float is a float so the type must be cast if integers + are desired. Nothing is done if the input is an integer array and the + decimals parameter has a value >= 0. + Parameters ---------- - decimals : integer - number of decimals to round to. May be negative. - out : existing array to use for output (default new array). + decimals : {0, integer}, optional + Number of decimal places to round to. When decimals is negative it + specifies the number of positions to the left of the decimal point. + out : {None, array}, optional + Alternative output array in which to place the result. It must have + the same shape as the expected output but the type will be cast if + necessary. Returns ------- - Reference to out, where None specifies a new array. + rounded_array : {array} + If out=None, returns a new array of the same type as a containing + the rounded values, otherwise a reference to the output array is + returned. - Round to the specified number of decimals. When 'decimals' is negative it - specifies the number of positions to the left of the decimal point. The - real and imaginary parts of complex numbers are rounded separately. Nothing - is done if the array is not of float type and 'decimals' is >= 0. + See Also + -------- + around : equivalent function - The keyword 'out' may be used to specify a different array to hold the - result rather than the default new array. If the type of the array - specified by 'out' differs from that of 'a', the result is cast to the - new type, otherwise the original type is kept. Floats round to floats - by default. + Notes + ----- + Numpy rounds to even. Thus 1.5 and 2.5 round to 2.0, -0.5 and 0.5 round + to 0.0, etc. Results may also be surprising due to the inexact + representation of decimal fractions in IEEE floating point and the + errors introduced when scaling by powers of ten. - Numpy rounds to even. Thus 1.5 and 2.5 round to 2.0, -0.5 and 0.5 round to - 0.0, etc. Results may also be surprising due to the inexact representation - of decimal fractions in IEEE floating point and the errors introduced in - scaling the numbers when 'decimals' is something other than 0. - + Examples + -------- + >>> x = array([.5, 1.5, 2.5, 3.5, 4.5]) + >>> x.round() + array([ 0., 2., 2., 4., 4.]) + >>> x = array([1,2,3,11]) + >>> x.round(decimals=1) + array([ 1, 2, 3, 11]) + >>> x.round(decimals=-1) + array([ 0, 0, 0, 10]) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('searchsorted', - """a.searchsorted(v, side='left') -> index array. + """a.searchsorted(v, side='left') Find the indices into a sorted array such that if the corresponding keys in v were inserted before the indices the order of a would be preserved. If @@ -1198,8 +1754,8 @@ indices : integer array The returned array has the same shape as v. - SeeAlso - ------- + See also + -------- sort histogram @@ -1207,6 +1763,7 @@ ----- The array a must be 1-d and is assumed to be sorted in ascending order. Searchsorted uses binary search to find the required insertion points. + """)) @@ -1256,13 +1813,13 @@ sort keeps items with the same key in the same relative order. 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 + =========== ======= ============= ============ ======= All the sort algorithms make temporary copies of the data when the sort is not along the last axis. Consequently, sorts along the last axis are faster @@ -1271,13 +1828,23 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('squeeze', - """m.squeeze() eliminate all length-1 dimensions + """m.squeeze() + Remove single-dimensional entries from the shape of a. + + Examples + -------- + >>> x = array([[[1,1,1],[2,2,2],[3,3,3]]]) + >>> x.shape + (1, 3, 3) + >>> x.squeeze().shape + (3, 3) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('std', - """a.std(axis=None, dtype=None, out=None, ddof=0) -> standard deviation. + """a.std(axis=None, dtype=None, out=None, ddof=0) Returns the standard deviation of the array elements, a measure of the spread of a distribution. The standard deviation is computed for the @@ -1324,22 +1891,36 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('sum', - """a.sum(axis=None, dtype=None) -> Sum of array over given axis. + """a.sum(axis=None, dtype=None, out=None) - Sum the array over the given axis. If the axis is None, sum over - all dimensions of the array. + Return the sum of the array elements over the given axis + + Parameters + ---------- + axis : {None, integer} + Axis over which the sum is taken. If None is used, then the sum is + over all the array elements. + dtype : {None, dtype}, optional + Determines the type of the returned array and of the accumulator + where the elements are summed. If dtype has the value None and the + type of a is an integer type of precision less than the default + platform integer, then the default platform integer precision is + used. Otherwise, the dtype is the same as that of a. + out : {None, array}, optional + Array into which the sum can be placed. Its type is preserved and + it must be of the right shape to hold the output. - The optional dtype argument is the data type for the returned - value and intermediate calculations. The default is to upcast - (promote) smaller integer types to the platform-dependent int. - For example, on 32-bit platforms: + Returns + ------- + sum_along_axis : {array, scalar}, see dtype parameter above. + Returns an array whose shape is the same as a with the specified + axis removed. Returns a 0d array when a is 1d or dtype=None. + Returns a reference to the specified output array if specified. - a.dtype default sum dtype - --------------------------------------------------- - bool, int8, int16, int32 int32 + See Also + -------- + sum : equivalent function - Warning: The arithmetic is modular and no error is raised on overflow. - Examples -------- >>> array([0.5, 1.5]).sum() @@ -1352,89 +1933,193 @@ array([1, 5]) >>> ones(128, dtype=int8).sum(dtype=int8) # overflow! -128 + + Notes + ----- + Arithmetic is modular when using integer types, and no error is + raised on overflow. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('swapaxes', - """a.swapaxes(axis1, axis2) -> new view with axes swapped. + """a.swapaxes(axis1, axis2) + Return a view of the array with axis1 and axis2 interchanged. + + Parameters + ---------- + axis1 : int + First axis. + axis2 : int + Second axis. + + Examples + -------- + >>> x = np.array([[1,2,3]]) + >>> x.swapaxes(0,1) + array([[1], + [2], + [3]]) + + >>> x = np.array([[[0,1],[2,3]],[[4,5],[6,7]]]) + >>> x + array([[[0, 1], + [2, 3]], + + [[4, 5], + [6, 7]]]) + >>> x.swapaxes(0,2) + array([[[0, 4], + [2, 6]], + + [[1, 5], + [3, 7]]]) + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('take', - """a.take(indices, axis=None, out=None, mode='raise') -> new array. + """a.take(indices, axis=None, out=None, mode='raise') - The new array is formed from the elements of a indexed by indices along the - given axis. + Return an array formed from the elements of a at the given indices. + This method does the same thing as "fancy" indexing; however, it can + be easier to use if you need to specify a given axis. + + Parameters + ---------- + indices : int array + The indices of the values to extract. + axis : {None, int}, optional + The axis over which to select values. None signifies that the + operation should be performed over the flattened array. + out : {None, array}, optional + If provided, the result will be inserted into this array. It should + be of the appropriate shape and dtype. + mode : {'raise', 'wrap', 'clip'}, optional + Specifies how out-of-bounds indices will behave. + 'raise' -- raise an error + 'wrap' -- wrap around + 'clip' -- clip to the range + + Returns + ------- + subarray : array + The returned array has the same type as a. + + See Also + -------- + take : equivalent function + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('tofile', - """a.tofile(fid, sep="", format="%s") -> None. Write the data to a file. + """a.tofile(fid, sep="", format="%s") + Write the data to a file. + + Data is always written in 'C' order, independently of the order of `a`. + The data produced by this method can be recovered by using the function + fromfile(). + + This is a convenience function for quick storage of array data. + Information on endianess and precision is lost, so this method is not a + good choice for files intended to archive data or transport data + between machines with different endianess. Some of these problems can + be overcome by outputting the data as text files at the expense of + speed and file size. + Parameters ---------- fid : file or string - an open file object or a string containing a filename + An open file object or a string containing a filename. sep : string - separation for text output. Write binary if this is empty. + Separator between array items for text output. + If "" (empty), a binary file is written, equivalenty to + file.write(a.tostring()). format : string - format string for text file output + Format string for text file output. + Each entry in the array is formatted to text by converting it to the + closest Python type, and using "format" % item. - A convenience function for quick storage of array data. Information on - endianess and precision is lost, so this method is not a good choice for - files intended to archive data or transport data between machines with - different endianess. Some of these problems can be overcome by outputting - the data as text files at the expense of speed and file size. - - If 'sep' is empty this method is equivalent to file.write(a.tostring()). If - 'sep' is not empty each data item is converted to the nearest Python type - and formatted using "format"%item. The resulting strings are written to the - file separated by the contents of 'sep'. The data is always written in "C" - (row major) order independent of the order of 'a'. - - The data produced by this method can be recovered by using the function - fromfile(). - """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('tolist', - """a.tolist() -> Array as hierarchical list. + """a.tolist() + + Return the array as nested lists. - Copy the data portion of the array to a hierarchical python list and return + Copy the data portion of the array to a hierarchical Python list and return that list. Data items are converted to the nearest compatible Python type. """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('tostring', - """a.tostring(order='C') -> raw copy of array data as a Python string. - + """a.tostring(order='C') + + Construct a Python string containing the raw data bytes in the array. + Parameters ---------- - order : {'C', 'F', 'A', None} - order of the data item in the copy - - Construct a Python string containing the raw bytes in the array. The order - of the data in arrays with ndim > 1 is specified by the 'order' keyword and - this keyword overrides the order of the array. The - choices are: - - "C" -- C order (row major) - "Fortran" -- Fortran order (column major) - "Any" -- Current order of array. - None -- Same as "Any" - + order : {'C', 'F', None} + Order of the data for multidimensional arrays: + C, Fortran, or the same as for the original array. + """)) add_newdoc('numpy.core.multiarray', 'ndarray', ('trace', """a.trace(offset=0, axis1=0, axis2=1, dtype=None, out=None) - return the sum along the offset diagonal of the array's indicated - axis1 and axis2. + Return the sum along diagonals of the array. + + If a is 2-d, returns the sum along the diagonal of self with the given offset, i.e., the + collection of elements of the form a[i,i+offset]. If a has more than two + dimensions, then the axes specified by axis1 and axis2 are used to determine + the 2-d subarray whose trace is returned. The shape of the resulting + array can be determined by removing axis1 and axis2 and appending an index + to the right equal to the size of the resulting diagonals. + + Parameters + ---------- + offset : {0, integer}, optional + Offset of the diagonal from the main diagonal. Can be both positive + and negative. Defaults to main diagonal. + axis1 : {0, integer}, optional + Axis to be used as the first axis of the 2-d subarrays from which + the diagonals should be taken. Defaults to first axis. + axis2 : {1, integer}, optional + Axis to be used as the second axis of the 2-d subarrays from which + the diagonals should be taken. Defaults to second axis. + dtype : {None, dtype}, optional + Determines the type of the returned array and of the accumulator + where the elements are summed. If dtype has the value None and a is + of integer type of precision less than the default integer + precision, then the default integer precision is used. Otherwise, + the precision is the same as that of a. + out : {None, array}, optional + Array into which the sum can be placed. Its type is preserved and + it must be of the right shape to hold the output. + + Returns + ------- + sum_along_diagonals : array + If a is 2-d, a 0-d array containing the diagonal is + returned. If a has larger dimensions, then an array of + diagonals is returned. + + Examples + -------- + >>> eye(3).trace() + 3.0 + >>> a = arange(8).reshape((2,2,2)) + >>> a.trace() + array([6, 8]) + """)) @@ -1513,10 +2198,15 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('view', - """a.view() -> new view of array with same data. + """a.view(type) - Type can be either a new sub-type object or a data-descriptor object + New view of array with the same data. + Parameters + ---------- + type + Either a new sub-type object or a data-descriptor object + """)) add_newdoc('numpy.core.umath','geterrobj', From numpy-svn at scipy.org Sat Apr 26 17:37:29 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 26 Apr 2008 16:37:29 -0500 (CDT) Subject: [Numpy-svn] r5097 - trunk/numpy/core/include/numpy Message-ID: <20080426213729.8F1E239C333@new.scipy.org> Author: charris Date: 2008-04-26 16:37:27 -0500 (Sat, 26 Apr 2008) New Revision: 5097 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/include/numpy/ufuncobject.h Log: Revert to 5092. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-26 21:37:11 UTC (rev 5096) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-26 21:37:27 UTC (rev 5097) @@ -1137,22 +1137,25 @@ PyArray_FastTakeFunc *fasttake; } PyArray_ArrFuncs; -/* The item must be reference counted when it is inserted or extracted. */ -#define NPY_ITEM_REFCOUNT 0x01 -/* Same as needing REFCOUNT */ -#define NPY_ITEM_HASOBJECT 0x01 -/* Convert to list for pickling */ -#define NPY_LIST_PICKLE 0x02 -/* The item is a POINTER */ -#define NPY_ITEM_IS_POINTER 0x04 -/* memory needs to be initialized for this data-type */ -#define NPY_NEEDS_INIT 0x08 -/* operations need Python C-API so don't give-up thread. */ -#define NPY_NEEDS_PYAPI 0x10 -/* Use f.getitem when extracting elements of this data-type */ -#define NPY_USE_GETITEM 0x20 -/* Use f.setitem when setting creating 0-d array from this data-type.*/ -#define NPY_USE_SETITEM 0x40 +#define NPY_ITEM_REFCOUNT 0x01 /* The item must be reference counted + when it is inserted or extracted. */ +#define NPY_ITEM_HASOBJECT 0x01 /* Same as needing REFCOUNT */ + +#define NPY_LIST_PICKLE 0x02 /* Convert to list for pickling */ +#define NPY_ITEM_IS_POINTER 0x04 /* The item is a POINTER */ + +#define NPY_NEEDS_INIT 0x08 /* memory needs to be initialized + for this data-type */ + +#define NPY_NEEDS_PYAPI 0x10 /* operations need Python C-API + so don't give-up thread. */ + +#define NPY_USE_GETITEM 0x20 /* Use f.getitem when extracting elements + of this data-type */ + +#define NPY_USE_SETITEM 0x40 /* Use f.setitem when setting creating + 0-d array from this data-type. + */ /* define NPY_IS_COMPLEX */ /* These are inherited for global data-type if any data-types in the field @@ -1369,15 +1372,15 @@ #define NPY_END_ALLOW_THREADS Py_END_ALLOW_THREADS #define NPY_BEGIN_THREADS_DEF PyThreadState *_save=NULL; #define NPY_BEGIN_THREADS _save = PyEval_SaveThread(); -#define NPY_END_THREADS do {if (_save) PyEval_RestoreThread(_save);} while (0); +#define NPY_END_THREADS if (_save) PyEval_RestoreThread(_save); #define NPY_BEGIN_THREADS_DESCR(dtype) \ - do {if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ - NPY_BEGIN_THREADS;} while (0); + if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ + NPY_BEGIN_THREADS #define NPY_END_THREADS_DESCR(dtype) \ - do {if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ - NPY_END_THREADS; } while (0); + if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ + NPY_END_THREADS #define NPY_ALLOW_C_API_DEF PyGILState_STATE __save__; #define NPY_ALLOW_C_API __save__ = PyGILState_Ensure(); Modified: trunk/numpy/core/include/numpy/ufuncobject.h =================================================================== --- trunk/numpy/core/include/numpy/ufuncobject.h 2008-04-26 21:37:11 UTC (rev 5096) +++ trunk/numpy/core/include/numpy/ufuncobject.h 2008-04-26 21:37:27 UTC (rev 5097) @@ -174,8 +174,8 @@ #if NPY_ALLOW_THREADS -#define NPY_LOOP_BEGIN_THREADS do {if (!(loop->obj)) _save = PyEval_SaveThread();} while (0) -#define NPY_LOOP_END_THREADS do {if (!(loop->obj)) PyEval_RestoreThread(_save);} while (0) +#define NPY_LOOP_BEGIN_THREADS if (!(loop->obj)) {_save = PyEval_SaveThread();} +#define NPY_LOOP_END_THREADS if (!(loop->obj)) {PyEval_RestoreThread(_save);} #else #define NPY_LOOP_BEGIN_THREADS #define NPY_LOOP_END_THREADS @@ -213,12 +213,12 @@ #define UFUNC_PYVALS_NAME "UFUNC_PYVALS" #define UFUNC_CHECK_ERROR(arg) \ - do {if (((arg)->obj && PyErr_Occurred()) || \ + if (((arg)->obj && PyErr_Occurred()) || \ ((arg)->errormask && \ PyUFunc_checkfperr((arg)->errormask, \ (arg)->errobj, \ &(arg)->first))) \ - goto fail;} while (0) + goto fail /* This code checks the IEEE status flags in a platform-dependent way */ /* Adapted from Numarray */ From numpy-svn at scipy.org Sat Apr 26 18:09:37 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 26 Apr 2008 17:09:37 -0500 (CDT) Subject: [Numpy-svn] r5098 - trunk/numpy Message-ID: <20080426220937.3817439C071@new.scipy.org> Author: ptvirtan Date: 2008-04-26 17:09:30 -0500 (Sat, 26 Apr 2008) New Revision: 5098 Modified: trunk/numpy/add_newdocs.py Log: Fix two typos in ndarray docstrings. Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2008-04-26 21:37:27 UTC (rev 5097) +++ trunk/numpy/add_newdocs.py 2008-04-26 22:09:30 UTC (rev 5098) @@ -1914,7 +1914,7 @@ ------- sum_along_axis : {array, scalar}, see dtype parameter above. Returns an array whose shape is the same as a with the specified - axis removed. Returns a 0d array when a is 1d or dtype=None. + axis removed. Returns a 0d array when a is 1d or axis=None. Returns a reference to the specified output array if specified. See Also @@ -2037,7 +2037,7 @@ An open file object or a string containing a filename. sep : string Separator between array items for text output. - If "" (empty), a binary file is written, equivalenty to + If "" (empty), a binary file is written, equivalently to file.write(a.tostring()). format : string Format string for text file output. From numpy-svn at scipy.org Sat Apr 26 18:14:17 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 26 Apr 2008 17:14:17 -0500 (CDT) Subject: [Numpy-svn] r5099 - trunk/numpy/core Message-ID: <20080426221417.4BB6C39C071@new.scipy.org> Author: ptvirtan Date: 2008-04-26 17:14:10 -0500 (Sat, 26 Apr 2008) New Revision: 5099 Modified: trunk/numpy/core/fromnumeric.py Log: Docstring fixes to fromnumeric, to better mirror ndarray docstrings. Modified: trunk/numpy/core/fromnumeric.py =================================================================== --- trunk/numpy/core/fromnumeric.py 2008-04-26 22:09:30 UTC (rev 5098) +++ trunk/numpy/core/fromnumeric.py 2008-04-26 22:14:10 UTC (rev 5099) @@ -120,11 +120,10 @@ """Use an index array to construct a new array from a set of choices. - Given an array of integers in {0, 1, ..., n-1} and a set of n - choice arrays, this function will create a new array that merges - each of the choice arrays. Where a value in `a` is i, then the - new array will have the value that choices[i] contains in the same - place. + Given an array of integers and a set of n choice arrays, this function + will create a new array that merges each of the choice arrays. Where a + value in `a` is i, then the new array will have the value that + choices[i] contains in the same place. Parameters ---------- @@ -132,8 +131,8 @@ This array must contain integers in [0, n-1], where n is the number of choices. choices : sequence of arrays - Each of the choice arrays should have the same shape as the index - array. + Choice arrays. The index array and all of the choices should be + broadcastable to the same shape. out : array, optional If provided, the result will be inserted into this array. It should be of the appropriate shape and dtype @@ -198,10 +197,16 @@ Examples -------- - >>> repeat([0, 1, 2], 2) - array([0, 0, 1, 1, 2, 2]) - >>> repeat([0, 1, 2], [2, 3, 4]) - array([0, 0, 1, 1, 1, 2, 2, 2, 2]) + >>> x = array([[1,2],[3,4]]) + >>> repeat(x, 2) + array([1, 1, 2, 2, 3, 3, 4, 4]) + >>> repeat(x, 3, axis=1) + array([[1, 1, 1, 2, 2, 2], + [3, 3, 3, 4, 4, 4]]) + >>> repeat(x, [1, 2], axis=0) + array([[1, 2], + [3, 4], + [3, 4]]) """ try: @@ -212,7 +217,8 @@ def put(a, ind, v, mode='raise'): - """Set a[n] = v[n] for all n in ind. + """Set a.flat[n] = v[n] for all n in ind. + If v is shorter than ind, it will repeat. Parameters ---------- @@ -619,10 +625,6 @@ Examples -------- >>> x = array([[[1,1,1],[2,2,2],[3,3,3]]]) - >>> x - array([[[1, 1, 1], - [2, 2, 2], - [3, 3, 3]]]) >>> x.shape (1, 3, 3) >>> squeeze(x).shape @@ -955,7 +957,14 @@ 6 >>> sum([[0, 1], [0, 5]], axis=1) array([1, 5]) + >>> ones(128, dtype=int8).sum(dtype=int8) # overflow! + -128 + Notes + ----- + Arithmetic is modular when using integer types, and no error is + raised on overflow. + """ if isinstance(a, _gentype): res = _sum_(a) @@ -1014,6 +1023,10 @@ >>> product([[1.,2.],[3.,4.]], axis=1) array([ 2., 12.]) + Notes + ----- + Arithmetic is modular when using integer types, and no error is + raised on overflow. """ try: @@ -1143,7 +1156,7 @@ a : array-like Input array or object that can be converted to an array. axis : {None, -1, int}, optional - Axis along which the product is computed. The default + Axis along which the sum is computed. The default (``axis``= None) is to compute over the flattened array. dtype : {None, dtype}, optional Determines the type of the returned array and of the accumulator @@ -1162,6 +1175,11 @@ A new array holding the result is returned unless ``out`` is specified, in which case a reference to ``out`` is returned. + Notes + ----- + Arithmetic is modular when using integer types, and no error is + raised on overflow. + """ try: cumsum = a.cumsum @@ -1374,6 +1392,11 @@ >>> prod([[1.,2.],[3.,4.]], axis=1) array([ 2., 12.]) + Notes + ----- + Arithmetic is modular when using integer types, and no error is + raised on overflow. + """ try: prod = a.prod @@ -1412,6 +1435,11 @@ A new array holding the result is returned unless out is specified, in which case a reference to out is returned. + Notes + ----- + Arithmetic is modular when using integer types, and no error is + raised on overflow. + """ try: cumprod = a.cumprod From numpy-svn at scipy.org Sat Apr 26 19:29:04 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 26 Apr 2008 18:29:04 -0500 (CDT) Subject: [Numpy-svn] r5100 - trunk/numpy/core/src Message-ID: <20080426232904.9D9CB39C0AE@new.scipy.org> Author: charris Date: 2008-04-26 18:29:01 -0500 (Sat, 26 Apr 2008) New Revision: 5100 Modified: trunk/numpy/core/src/arrayobject.c trunk/numpy/core/src/multiarraymodule.c trunk/numpy/core/src/ufuncobject.c Log: Code style cleanups and fix for ticket #743. Lets try this without corrupted merge files. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-04-26 22:14:10 UTC (rev 5099) +++ trunk/numpy/core/src/arrayobject.c 2008-04-26 23:29:01 UTC (rev 5100) @@ -766,9 +766,8 @@ int numcopies, nbytes; void (*myfunc)(char *, intp, char *, intp, intp, int); int retval=-1; + NPY_BEGIN_THREADS_DEF; - NPY_BEGIN_THREADS_DEF - numcopies = PyArray_SIZE(dest); if (numcopies < 1) { return 0; @@ -785,7 +784,9 @@ usecopy = 1; sptr = aligned; } - else sptr = src->data; + else { + sptr = src->data; + } if (PyArray_SAFEALIGNEDCOPY(dest)) { myfunc = _strided_byte_copy; } @@ -809,15 +810,12 @@ /* Refcount note: src and dest may have different sizes */ PyArray_INCREF(src); PyArray_XDECREF(dest); - - NPY_BEGIN_THREADS - + NPY_BEGIN_THREADS; myfunc(dptr, dstride, sptr, 0, numcopies, (int) nbytes); - if (swap) + if (swap) { _strided_byte_swap(dptr, dstride, numcopies, (int) nbytes); - - NPY_END_THREADS - + } + NPY_END_THREADS; PyArray_INCREF(dest); PyArray_XDECREF(src); } @@ -825,25 +823,26 @@ PyArrayIterObject *dit; int axis=-1; dit = (PyArrayIterObject *)\ - PyArray_IterAllButAxis((PyObject *)dest, &axis); + PyArray_IterAllButAxis((PyObject *)dest, &axis); if (dit == NULL) { goto finish; } /* Refcount note: src and dest may have different sizes */ PyArray_INCREF(src); PyArray_XDECREF(dest); - NPY_BEGIN_THREADS - while(dit->index < dit->size) { - myfunc(dit->dataptr, PyArray_STRIDE(dest, axis), - sptr, 0, - PyArray_DIM(dest, axis), nbytes); - if (swap) - _strided_byte_swap(dit->dataptr, - PyArray_STRIDE(dest, axis), - PyArray_DIM(dest, axis), nbytes); - PyArray_ITER_NEXT(dit); + NPY_BEGIN_THREADS; + while(dit->index < dit->size) { + myfunc(dit->dataptr, PyArray_STRIDE(dest, axis), + sptr, 0, + PyArray_DIM(dest, axis), nbytes); + if (swap) { + _strided_byte_swap(dit->dataptr, + PyArray_STRIDE(dest, axis), + PyArray_DIM(dest, axis), nbytes); } - NPY_END_THREADS + PyArray_ITER_NEXT(dit); + } + NPY_END_THREADS; PyArray_INCREF(dest); PyArray_XDECREF(src); Py_DECREF(dit); @@ -851,16 +850,21 @@ retval = 0; finish: - if (aligned != NULL) free(aligned); + if (aligned != NULL) { + free(aligned); + } return retval; } -/* Special-case of PyArray_CopyInto when dst is 1-d - and contiguous (and aligned). - PyArray_CopyInto requires broadcastable arrays while - this one is a flattening operation... -*/ -int _flat_copyinto(PyObject *dst, PyObject *src, NPY_ORDER order) { +/* + * Special-case of PyArray_CopyInto when dst is 1-d + * and contiguous (and aligned). + * PyArray_CopyInto requires broadcastable arrays while + * this one is a flattening operation... + */ +int +_flat_copyinto(PyObject *dst, PyObject *src, NPY_ORDER order) +{ PyArrayIterObject *it; PyObject *orig_src; void (*myfunc)(char *, intp, char *, intp, intp, int); @@ -868,7 +872,7 @@ int axis; int elsize; intp nbytes; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; orig_src = src; @@ -876,25 +880,31 @@ /* Refcount note: src and dst have the same size */ PyArray_INCREF((PyArrayObject *)src); PyArray_XDECREF((PyArrayObject *)dst); - NPY_BEGIN_THREADS + NPY_BEGIN_THREADS; memcpy(PyArray_BYTES(dst), PyArray_BYTES(src), - PyArray_ITEMSIZE(src)); - NPY_END_THREADS + PyArray_ITEMSIZE(src)); + NPY_END_THREADS; return 0; } axis = PyArray_NDIM(src)-1; if (order == PyArray_FORTRANORDER) { - if (PyArray_NDIM(src) <= 2) axis = 0; - /* fall back to a more general method */ - else src = PyArray_Transpose((PyArrayObject *)orig_src, NULL); + if (PyArray_NDIM(src) <= 2) { + axis = 0; + } + /* fall back to a more general method */ + else { + src = PyArray_Transpose((PyArrayObject *)orig_src, NULL); + } } it = (PyArrayIterObject *)PyArray_IterAllButAxis(src, &axis); if (it == NULL) { - if (src != orig_src) {Py_DECREF(src);} - return -1; + if (src != orig_src) { + Py_DECREF(src); + } + return -1; } if (PyArray_SAFEALIGNEDCOPY(src)) { @@ -911,17 +921,19 @@ /* Refcount note: src and dst have the same size */ PyArray_INCREF((PyArrayObject *)src); PyArray_XDECREF((PyArrayObject *)dst); - NPY_BEGIN_THREADS + NPY_BEGIN_THREADS; while(it->index < it->size) { myfunc(dptr, elsize, it->dataptr, - PyArray_STRIDE(src,axis), - PyArray_DIM(src,axis), elsize); + PyArray_STRIDE(src,axis), + PyArray_DIM(src,axis), elsize); dptr += nbytes; PyArray_ITER_NEXT(it); } - NPY_END_THREADS + NPY_END_THREADS; - if (src != orig_src) {Py_DECREF(src);} + if (src != orig_src) { + Py_DECREF(src); + } Py_DECREF(it); return 0; } @@ -935,11 +947,11 @@ int maxaxis=-1, elsize; intp maxdim; PyArrayIterObject *dit, *sit; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; - dit = (PyArrayIterObject *) \ + dit = (PyArrayIterObject *) PyArray_IterAllButAxis((PyObject *)dest, &maxaxis); - sit = (PyArrayIterObject *) \ + sit = (PyArrayIterObject *) PyArray_IterAllButAxis((PyObject *)src, &maxaxis); maxdim = dest->dimensions[maxaxis]; @@ -955,22 +967,22 @@ PyArray_INCREF(src); PyArray_XDECREF(dest); - NPY_BEGIN_THREADS + NPY_BEGIN_THREADS; while(dit->index < dit->size) { /* strided copy of elsize bytes */ myfunc(dit->dataptr, dest->strides[maxaxis], - sit->dataptr, src->strides[maxaxis], - maxdim, elsize); + sit->dataptr, src->strides[maxaxis], + maxdim, elsize); if (swap) { _strided_byte_swap(dit->dataptr, - dest->strides[maxaxis], - dest->dimensions[maxaxis], - elsize); + dest->strides[maxaxis], + dest->dimensions[maxaxis], + elsize); } PyArray_ITER_NEXT(dit); PyArray_ITER_NEXT(sit); } - NPY_END_THREADS + NPY_END_THREADS; Py_DECREF(sit); Py_DECREF(dit); @@ -985,7 +997,7 @@ int elsize; PyArrayMultiIterObject *multi; int maxaxis; intp maxdim; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; elsize = PyArray_ITEMSIZE(dest); multi = (PyArrayMultiIterObject *)PyArray_MultiIterNew(2, dest, src); @@ -995,45 +1007,52 @@ if (multi->size != PyArray_SIZE(dest)) { PyErr_SetString(PyExc_ValueError, - "array dimensions are not "\ - "compatible for copy"); + "array dimensions are not "\ + "compatible for copy"); Py_DECREF(multi); return -1; } maxaxis = PyArray_RemoveSmallest(multi); - if (maxaxis < 0) { /* copy 1 0-d array to another */ - /* Refcount note: src and dst have the same size */ + if (maxaxis < 0) { + /* + * copy 1 0-d array to another + * Refcount note: src and dst have the same size + */ PyArray_INCREF(src); PyArray_XDECREF(dest); memcpy(dest->data, src->data, elsize); - if (swap) byte_swap_vector(dest->data, 1, elsize); + if (swap) { + byte_swap_vector(dest->data, 1, elsize); + } return 0; } maxdim = multi->dimensions[maxaxis]; - /* Increment the source and decrement the destination - reference counts - */ - /* Refcount note: src and dest may have different sizes */ + /* + * Increment the source and decrement the destination + * reference counts + * + * Refcount note: src and dest may have different sizes + */ PyArray_INCREF(src); PyArray_XDECREF(dest); - NPY_BEGIN_THREADS + NPY_BEGIN_THREADS; while(multi->index < multi->size) { myfunc(multi->iters[0]->dataptr, - multi->iters[0]->strides[maxaxis], - multi->iters[1]->dataptr, - multi->iters[1]->strides[maxaxis], - maxdim, elsize); + multi->iters[0]->strides[maxaxis], + multi->iters[1]->dataptr, + multi->iters[1]->strides[maxaxis], + maxdim, elsize); if (swap) { _strided_byte_swap(multi->iters[0]->dataptr, - multi->iters[0]->strides[maxaxis], - maxdim, elsize); + multi->iters[0]->strides[maxaxis], + maxdim, elsize); } PyArray_MultiIter_NEXT(multi); } - NPY_END_THREADS + NPY_END_THREADS; PyArray_INCREF(dest); PyArray_XDECREF(src); @@ -1060,33 +1079,33 @@ void (*myfunc)(char *, intp, char *, intp, intp, int); int simple; int same; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; - if (!PyArray_EquivArrTypes(dest, src)) { - return PyArray_CastTo(dest, src); - } - + if (!PyArray_EquivArrTypes(dest, src)) { + return PyArray_CastTo(dest, src); + } if (!PyArray_ISWRITEABLE(dest)) { PyErr_SetString(PyExc_RuntimeError, - "cannot write to array"); + "cannot write to array"); return -1; } - same = PyArray_SAMESHAPE(dest, src); simple = same && ((PyArray_ISCARRAY_RO(src) && PyArray_ISCARRAY(dest)) || - (PyArray_ISFARRAY_RO(src) && PyArray_ISFARRAY(dest))); + (PyArray_ISFARRAY_RO(src) && PyArray_ISFARRAY(dest))); if (simple) { /* Refcount note: src and dest have the same size */ PyArray_INCREF(src); PyArray_XDECREF(dest); - NPY_BEGIN_THREADS - if (usecopy) + NPY_BEGIN_THREADS; + if (usecopy) { memcpy(dest->data, src->data, PyArray_NBYTES(dest)); - else + } + else { memmove(dest->data, src->data, PyArray_NBYTES(dest)); - NPY_END_THREADS + } + NPY_END_THREADS; return 0; } @@ -1105,10 +1124,10 @@ else { myfunc = _unaligned_strided_byte_move; } - - /* Could combine these because _broadcasted_copy would work as well. - But, same-shape copying is so common we want to speed it up. - */ + /* + * Could combine these because _broadcasted_copy would work as well. + * But, same-shape copying is so common we want to speed it up. + */ if (same) { return _copy_from_same_shape(dest, src, myfunc, swap); } @@ -1118,50 +1137,48 @@ } /*OBJECT_API - Copy an Array into another array -- memory must not overlap - Does not require src and dest to have "broadcastable" shapes - (only the same number of elements). -*/ + * Copy an Array into another array -- memory must not overlap + * Does not require src and dest to have "broadcastable" shapes + * (only the same number of elements). + */ static int PyArray_CopyAnyInto(PyArrayObject *dest, PyArrayObject *src) { int elsize, simple; PyArrayIterObject *idest, *isrc; void (*myfunc)(char *, intp, char *, intp, intp, int); - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; - if (!PyArray_EquivArrTypes(dest, src)) { - return PyArray_CastAnyTo(dest, src); - } - + if (!PyArray_EquivArrTypes(dest, src)) { + return PyArray_CastAnyTo(dest, src); + } if (!PyArray_ISWRITEABLE(dest)) { PyErr_SetString(PyExc_RuntimeError, - "cannot write to array"); + "cannot write to array"); return -1; } - if (PyArray_SIZE(dest) != PyArray_SIZE(src)) { PyErr_SetString(PyExc_ValueError, - "arrays must have the same number of elements" - " for copy"); + "arrays must have the same number of elements" + " for copy"); return -1; } simple = ((PyArray_ISCARRAY_RO(src) && PyArray_ISCARRAY(dest)) || - (PyArray_ISFARRAY_RO(src) && PyArray_ISFARRAY(dest))); - + (PyArray_ISFARRAY_RO(src) && PyArray_ISFARRAY(dest))); if (simple) { /* Refcount note: src and dest have the same size */ PyArray_INCREF(src); PyArray_XDECREF(dest); - NPY_BEGIN_THREADS + NPY_BEGIN_THREADS; memcpy(dest->data, src->data, PyArray_NBYTES(dest)); - NPY_END_THREADS + NPY_END_THREADS; return 0; } if (PyArray_SAMESHAPE(dest, src)) { int swap; + if (PyArray_SAFEALIGNEDCOPY(dest) && PyArray_SAFEALIGNEDCOPY(src)) { myfunc = _strided_byte_copy; } @@ -1186,21 +1203,21 @@ /* Refcount note: src and dest have the same size */ PyArray_INCREF(src); PyArray_XDECREF(dest); - NPY_BEGIN_THREADS - while(idest->index < idest->size) { - memcpy(idest->dataptr, isrc->dataptr, elsize); - PyArray_ITER_NEXT(idest); - PyArray_ITER_NEXT(isrc); - } - NPY_END_THREADS + NPY_BEGIN_THREADS; + while(idest->index < idest->size) { + memcpy(idest->dataptr, isrc->dataptr, elsize); + PyArray_ITER_NEXT(idest); + PyArray_ITER_NEXT(isrc); + } + NPY_END_THREADS; Py_DECREF(idest); Py_DECREF(isrc); return 0; } /*OBJECT_API - Copy an Array into another array -- memory must not overlap. -*/ + * Copy an Array into another array -- memory must not overlap. + */ static int PyArray_CopyInto(PyArrayObject *dest, PyArrayObject *src) { @@ -1209,8 +1226,8 @@ /*OBJECT_API - Move the memory of one array into another. -*/ + * Move the memory of one array into another. + */ static int PyArray_MoveInto(PyArrayObject *dest, PyArrayObject *src) { @@ -1226,9 +1243,10 @@ PyObject *r; int ret; - /* Special code to mimic Numeric behavior for - character arrays. - */ + /* + * Special code to mimic Numeric behavior for + * character arrays. + */ if (dest->descr->type == PyArray_CHARLTR && dest->nd > 0 \ && PyString_Check(src_object)) { int n_new, n_old; @@ -1805,100 +1823,126 @@ PyObject *obj, *strobj, *tupobj; n3 = (sep ? strlen((const char *)sep) : 0); - if (n3 == 0) { /* binary data */ + if (n3 == 0) { + /* binary data */ if (PyDataType_FLAGCHK(self->descr, NPY_LIST_PICKLE)) { PyErr_SetString(PyExc_ValueError, "cannot write " \ - "object arrays to a file in " \ - "binary mode"); + "object arrays to a file in " \ + "binary mode"); return -1; } if (PyArray_ISCONTIGUOUS(self)) { size = PyArray_SIZE(self); - NPY_BEGIN_ALLOW_THREADS - n=fwrite((const void *)self->data, - (size_t) self->descr->elsize, - (size_t) size, fp); - NPY_END_ALLOW_THREADS - if (n < size) { - PyErr_Format(PyExc_ValueError, - "%ld requested and %ld written", - (long) size, (long) n); - return -1; - } + NPY_BEGIN_ALLOW_THREADS; + n = fwrite((const void *)self->data, + (size_t) self->descr->elsize, + (size_t) size, fp); + NPY_END_ALLOW_THREADS; + if (n < size) { + PyErr_Format(PyExc_ValueError, + "%ld requested and %ld written", + (long) size, (long) n); + return -1; + } } else { - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; - it=(PyArrayIterObject *) \ + it = (PyArrayIterObject *) PyArray_IterNew((PyObject *)self); - NPY_BEGIN_THREADS - while(it->index < it->size) { - if (fwrite((const void *)it->dataptr, - (size_t) self->descr->elsize, - 1, fp) < 1) { - NPY_END_THREADS - PyErr_Format(PyExc_IOError, - "problem writing element"\ - " %d to file", - (int)it->index); - Py_DECREF(it); - return -1; - } - PyArray_ITER_NEXT(it); + NPY_BEGIN_THREADS; + while(it->index < it->size) { + if (fwrite((const void *)it->dataptr, + (size_t) self->descr->elsize, + 1, fp) < 1) { + NPY_END_THREADS; + PyErr_Format(PyExc_IOError, + "problem writing element"\ + " %d to file", + (int)it->index); + Py_DECREF(it); + return -1; } - NPY_END_THREADS - Py_DECREF(it); + PyArray_ITER_NEXT(it); + } + NPY_END_THREADS; + Py_DECREF(it); } } - else { /* text data */ + else { + /* + * text data + */ - it=(PyArrayIterObject *) \ + it = (PyArrayIterObject *) PyArray_IterNew((PyObject *)self); n4 = (format ? strlen((const char *)format) : 0); while(it->index < it->size) { obj = self->descr->f->getitem(it->dataptr, self); - if (obj == NULL) {Py_DECREF(it); return -1;} - if (n4 == 0) { /* standard writing */ + if (obj == NULL) { + Py_DECREF(it); + return -1; + } + if (n4 == 0) { + /* + * standard writing + */ strobj = PyObject_Str(obj); Py_DECREF(obj); - if (strobj == NULL) {Py_DECREF(it); return -1;} + if (strobj == NULL) { + Py_DECREF(it); + return -1; + } } - else { /* use format string */ + else { + /* + * use format string + */ tupobj = PyTuple_New(1); - if (tupobj == NULL) {Py_DECREF(it); return -1;} + if (tupobj == NULL) { + Py_DECREF(it); + return -1; + } PyTuple_SET_ITEM(tupobj,0,obj); obj = PyString_FromString((const char *)format); - if (obj == NULL) {Py_DECREF(tupobj); - Py_DECREF(it); return -1;} + if (obj == NULL) { + Py_DECREF(tupobj); + Py_DECREF(it); + return -1; + } strobj = PyString_Format(obj, tupobj); Py_DECREF(obj); Py_DECREF(tupobj); - if (strobj == NULL) {Py_DECREF(it); return -1;} - } - NPY_BEGIN_ALLOW_THREADS - n=fwrite(PyString_AS_STRING(strobj), 1, - n2=PyString_GET_SIZE(strobj), fp); - NPY_END_ALLOW_THREADS - if (n < n2) { - PyErr_Format(PyExc_IOError, - "problem writing element %d"\ - " to file", - (int) it->index); - Py_DECREF(strobj); + if (strobj == NULL) { Py_DECREF(it); return -1; } + } + NPY_BEGIN_ALLOW_THREADS; + n = fwrite(PyString_AS_STRING(strobj), 1, + n2=PyString_GET_SIZE(strobj), fp); + NPY_END_ALLOW_THREADS; + if (n < n2) { + PyErr_Format(PyExc_IOError, + "problem writing element %d"\ + " to file", + (int) it->index); + Py_DECREF(strobj); + Py_DECREF(it); + return -1; + } /* write separator for all but last one */ - if (it->index != it->size-1) + if (it->index != it->size-1) { if (fwrite(sep, 1, n3, fp) < n3) { PyErr_Format(PyExc_IOError, - "problem writing "\ - "separator to file"); + "problem writing "\ + "separator to file"); Py_DECREF(strobj); Py_DECREF(it); return -1; } + } Py_DECREF(strobj); PyArray_ITER_NEXT(it); } @@ -1908,8 +1952,8 @@ } /*OBJECT_API - To List -*/ + * To List + */ static PyObject * PyArray_ToList(PyArrayObject *self) { @@ -1917,15 +1961,16 @@ PyArrayObject *v; intp sz, i; - if (!PyArray_Check(self)) return (PyObject *)self; - - if (self->nd == 0) + if (!PyArray_Check(self)) { + return (PyObject *)self; + } + if (self->nd == 0) { return self->descr->f->getitem(self->data,self); + } sz = self->dimensions[0]; lp = PyList_New(sz); - - for(i=0; ind >= self->nd) { PyErr_SetString(PyExc_RuntimeError, @@ -1938,7 +1983,6 @@ PyList_SetItem(lp, i, PyArray_ToList(v)); Py_DECREF(v); } - return lp; } @@ -7803,9 +7847,8 @@ char *buffers[2]; PyArray_CopySwapNFunc *ocopyfunc, *icopyfunc; char *obptr; + NPY_BEGIN_THREADS_DEF; - NPY_BEGIN_THREADS_DEF - delsize = PyArray_ITEMSIZE(out); selsize = PyArray_ITEMSIZE(in); multi = (PyArrayMultiIterObject *)PyArray_MultiIterNew(2, out, in); @@ -7815,8 +7858,8 @@ if (multi->size != PyArray_SIZE(out)) { PyErr_SetString(PyExc_ValueError, - "array dimensions are not "\ - "compatible for copy"); + "array dimensions are not "\ + "compatible for copy"); Py_DECREF(multi); return -1; } @@ -7824,7 +7867,8 @@ icopyfunc = in->descr->f->copyswapn; ocopyfunc = out->descr->f->copyswapn; maxaxis = PyArray_RemoveSmallest(multi); - if (maxaxis < 0) { /* cast 1 0-d array to another */ + if (maxaxis < 0) { + /* cast 1 0-d array to another */ N = 1; maxdim = 1; ostrides = delsize; @@ -7857,24 +7901,24 @@ #if NPY_ALLOW_THREADS if (PyArray_ISNUMBER(in) && PyArray_ISNUMBER(out)) { - NPY_BEGIN_THREADS + NPY_BEGIN_THREADS; } #endif while(multi->index < multi->size) { _strided_buffered_cast(multi->iters[0]->dataptr, - ostrides, - delsize, oswap, ocopyfunc, - multi->iters[1]->dataptr, - istrides, - selsize, iswap, icopyfunc, - maxdim, buffers, N, - castfunc, out, in); + ostrides, + delsize, oswap, ocopyfunc, + multi->iters[1]->dataptr, + istrides, + selsize, iswap, icopyfunc, + maxdim, buffers, N, + castfunc, out, in); PyArray_MultiIter_NEXT(multi); } #if NPY_ALLOW_THREADS if (PyArray_ISNUMBER(in) && PyArray_ISNUMBER(out)) { - NPY_END_THREADS + NPY_END_THREADS; } #endif Py_DECREF(multi); @@ -7895,38 +7939,38 @@ if (PyErr_Occurred()) { return -1; } + return 0; } -/* Must be broadcastable. - This code is very similar to PyArray_CopyInto/PyArray_MoveInto - except casting is done --- PyArray_BUFSIZE is used - as the size of the casting buffer. -*/ +/* + * Must be broadcastable. + * This code is very similar to PyArray_CopyInto/PyArray_MoveInto + * except casting is done --- PyArray_BUFSIZE is used + * as the size of the casting buffer. + */ /*OBJECT_API - Cast to an already created array. -*/ + * Cast to an already created array. + */ static int PyArray_CastTo(PyArrayObject *out, PyArrayObject *mp) { - int simple; int same; PyArray_VectorUnaryFunc *castfunc=NULL; int mpsize = PyArray_SIZE(mp); int iswap, oswap; + NPY_BEGIN_THREADS_DEF; - NPY_BEGIN_THREADS_DEF - if (mpsize == 0) { return 0; } if (!PyArray_ISWRITEABLE(out)) { PyErr_SetString(PyExc_ValueError, - "output array is not writeable"); + "output array is not writeable"); return -1; } @@ -7935,23 +7979,20 @@ return -1; } - same = PyArray_SAMESHAPE(out, mp); simple = same && ((PyArray_ISCARRAY_RO(mp) && PyArray_ISCARRAY(out)) || - (PyArray_ISFARRAY_RO(mp) && PyArray_ISFARRAY(out))); - + (PyArray_ISFARRAY_RO(mp) && PyArray_ISFARRAY(out))); if (simple) { - #if NPY_ALLOW_THREADS if (PyArray_ISNUMBER(mp) && PyArray_ISNUMBER(out)) { - NPY_BEGIN_THREADS + NPY_BEGIN_THREADS; } #endif castfunc(mp->data, out->data, mpsize, mp, out); #if NPY_ALLOW_THREADS if (PyArray_ISNUMBER(mp) && PyArray_ISNUMBER(out)) { - NPY_END_THREADS + NPY_END_THREADS; } #endif if (PyErr_Occurred()) { @@ -7960,12 +8001,13 @@ return 0; } - /* If the input or output is OBJECT, STRING, UNICODE, or VOID */ - /* then getitem and setitem are used for the cast */ - /* and byteswapping is handled by those methods */ - + /* + * If the input or output is OBJECT, STRING, UNICODE, or VOID + * then getitem and setitem are used for the cast + * and byteswapping is handled by those methods + */ if (PyArray_ISFLEXIBLE(mp) || PyArray_ISOBJECT(mp) || PyArray_ISOBJECT(out) || - PyArray_ISFLEXIBLE(out)) { + PyArray_ISFLEXIBLE(out)) { iswap = oswap = 0; } else { @@ -7999,9 +8041,11 @@ in_csn = in->descr->f->copyswap; out_csn = out->descr->f->copyswap; - /* If the input or output is STRING, UNICODE, or VOID */ - /* then getitem and setitem are used for the cast */ - /* and byteswapping is handled by those methods */ + /* + * If the input or output is STRING, UNICODE, or VOID + * then getitem and setitem are used for the cast + * and byteswapping is handled by those methods + */ inswap = !(PyArray_ISFLEXIBLE(in) || PyArray_ISNOTSWAPPED(in)); Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2008-04-26 22:14:10 UTC (rev 5099) +++ trunk/numpy/core/src/multiarraymodule.c 2008-04-26 23:29:01 UTC (rev 5100) @@ -2423,14 +2423,15 @@ int elsize; intp astride; PyArray_SortFunc *sort; - BEGIN_THREADS_DEF + BEGIN_THREADS_DEF; it = (PyArrayIterObject *)PyArray_IterAllButAxis((PyObject *)op, &axis); swap = !PyArray_ISNOTSWAPPED(op); - if (it == NULL) return -1; + if (it == NULL) { + return -1; + } - NPY_BEGIN_THREADS_DESCR(op->descr) - + NPY_BEGIN_THREADS_DESCR(op->descr); sort = op->descr->f->sort[which]; size = it->size; N = op->dimensions[axis]; @@ -2446,12 +2447,16 @@ while (size--) { _unaligned_strided_byte_copy(buffer, (intp) elsize, it->dataptr, astride, N, elsize); - if (swap) _strided_byte_swap(buffer, (intp) elsize, N, elsize); + if (swap) { + _strided_byte_swap(buffer, (intp) elsize, N, elsize); + } if (sort(buffer, N, op) < 0) { - PyDataMem_FREE(buffer); goto fail; + PyDataMem_FREE(buffer); + goto fail; } - if (swap) _strided_byte_swap(buffer, (intp) elsize, N, elsize); - + if (swap) { + _strided_byte_swap(buffer, (intp) elsize, N, elsize); + } _unaligned_strided_byte_copy(it->dataptr, astride, buffer, (intp) elsize, N, elsize); PyArray_ITER_NEXT(it); @@ -2460,20 +2465,20 @@ } else { while (size--) { - if (sort(it->dataptr, N, op) < 0) goto fail; + if (sort(it->dataptr, N, op) < 0) { + goto fail; + } PyArray_ITER_NEXT(it); } } - NPY_END_THREADS_DESCR(op->descr) - - Py_DECREF(it); + NPY_END_THREADS_DESCR(op->descr); + Py_DECREF(it); return 0; fail: - END_THREADS - - Py_DECREF(it); + NPY_END_THREADS; + Py_DECREF(it); return 0; } @@ -2489,7 +2494,7 @@ int elsize, swap; intp astride, rstride, *iptr; PyArray_ArgSortFunc *argsort; - BEGIN_THREADS_DEF + BEGIN_THREADS_DEF; ret = PyArray_New(op->ob_type, op->nd, op->dimensions, PyArray_INTP, @@ -2502,7 +2507,7 @@ swap = !PyArray_ISNOTSWAPPED(op); - NPY_BEGIN_THREADS_DESCR(op->descr) + NPY_BEGIN_THREADS_DESCR(op->descr); argsort = op->descr->f->argsort[which]; size = it->size; @@ -2548,17 +2553,17 @@ } } - NPY_END_THREADS_DESCR(op->descr) + NPY_END_THREADS_DESCR(op->descr); - Py_DECREF(it); + Py_DECREF(it); Py_DECREF(rit); return ret; fail: - END_THREADS + NPY_END_THREADS; - Py_DECREF(ret); + Py_DECREF(ret); Py_XDECREF(it); Py_XDECREF(rit); return NULL; @@ -2825,7 +2830,7 @@ int object=0; PyArray_ArgSortFunc *argsort; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; if (!PySequence_Check(sort_keys) || \ ((n=PySequence_Size(sort_keys)) <= 0)) { @@ -2897,7 +2902,7 @@ PyArray_IterAllButAxis((PyObject *)ret, &axis); if (rit == NULL) goto fail; - if (!object) {NPY_BEGIN_THREADS} + if (!object) {NPY_BEGIN_THREADS;} size = rit->size; N = mps[0]->dimensions[axis]; @@ -2961,7 +2966,7 @@ } } - if (!object) {NPY_END_THREADS} + if (!object) {NPY_END_THREADS;} finish: for (i=0; idescr); @@ -3139,15 +3144,15 @@ } if (side == NPY_SEARCHLEFT) { - NPY_BEGIN_THREADS_DESCR(ap2->descr) - local_search_left(ap1, ap2, ret); - NPY_END_THREADS_DESCR(ap2->descr) - } + NPY_BEGIN_THREADS_DESCR(ap2->descr); + local_search_left(ap1, ap2, ret); + NPY_END_THREADS_DESCR(ap2->descr); + } else if (side == NPY_SEARCHRIGHT) { - NPY_BEGIN_THREADS_DESCR(ap2->descr) - local_search_right(ap1, ap2, ret); - NPY_END_THREADS_DESCR(ap2->descr) - } + NPY_BEGIN_THREADS_DESCR(ap2->descr); + local_search_right(ap1, ap2, ret); + NPY_END_THREADS_DESCR(ap2->descr); + } Py_DECREF(ap1); Py_DECREF(ap2); return (PyObject *)ret; @@ -3209,7 +3214,7 @@ PyArray_DotFunc *dot; PyArray_Descr *typec; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; typenum = PyArray_ObjectType(op1, 0); typenum = PyArray_ObjectType(op2, typenum); @@ -3274,7 +3279,7 @@ it2 = (PyArrayIterObject *)\ PyArray_IterAllButAxis((PyObject *)ap2, &axis); - NPY_BEGIN_THREADS_DESCR(ap2->descr) + NPY_BEGIN_THREADS_DESCR(ap2->descr); while(1) { while(it2->index < it2->size) { dot(it1->dataptr, is1, it2->dataptr, is2, op, l, ret); @@ -3285,7 +3290,7 @@ if (it1->index >= it1->size) break; PyArray_ITER_RESET(it2); } - NPY_END_THREADS_DESCR(ap2->descr) + NPY_END_THREADS_DESCR(ap2->descr); Py_DECREF(it1); Py_DECREF(it2); @@ -3321,7 +3326,7 @@ PyArray_DotFunc *dot; PyArray_Descr *typec; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; typenum = PyArray_ObjectType(op1, 0); typenum = PyArray_ObjectType(op2, typenum); @@ -3410,7 +3415,7 @@ it2 = (PyArrayIterObject *)\ PyArray_IterAllButAxis((PyObject *)ap2, &matchDim); - NPY_BEGIN_THREADS_DESCR(ap2->descr) + NPY_BEGIN_THREADS_DESCR(ap2->descr); while(1) { while(it2->index < it2->size) { dot(it1->dataptr, is1, it2->dataptr, is2, op, l, ret); @@ -3421,7 +3426,7 @@ if (it1->index >= it1->size) break; PyArray_ITER_RESET(it2); } - NPY_END_THREADS_DESCR(ap2->descr) + NPY_END_THREADS_DESCR(ap2->descr); Py_DECREF(it1); Py_DECREF(it2); if (PyErr_Occurred()) goto fail; /* only for OBJECT arrays */ @@ -3482,7 +3487,7 @@ return NULL; } /* do 2-d loop */ - NPY_BEGIN_ALLOW_THREADS + NPY_BEGIN_ALLOW_THREADS; optr = PyArray_DATA(ret); str2 = elsize*dims[0]; for (i=0; idescr) + NPY_BEGIN_THREADS_DESCR(ret->descr); is1 = ap1->strides[0]; is2 = ap2->strides[0]; op = ret->data; os = ret->descr->elsize; @@ -3594,7 +3599,7 @@ ip1 += is1; op += os; } - NPY_END_THREADS_DESCR(ret->descr) + NPY_END_THREADS_DESCR(ret->descr); if (PyErr_Occurred()) goto fail; Py_DECREF(ap1); @@ -3722,7 +3727,7 @@ int elsize; int copyret=0; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; if ((ap=(PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL; @@ -3791,14 +3796,14 @@ if (rp != out) copyret = 1; } - NPY_BEGIN_THREADS_DESCR(ap->descr) + NPY_BEGIN_THREADS_DESCR(ap->descr); n = PyArray_SIZE(ap)/m; rptr = (intp *)rp->data; for (ip = ap->data, i=0; idescr) + NPY_END_THREADS_DESCR(ap->descr); Py_DECREF(ap); if (copyret) { @@ -7393,13 +7398,13 @@ if (!PyArg_ParseTuple(args, "|i", &kind)) return NULL; if (kind) { - Py_BEGIN_ALLOW_THREADS + Py_BEGIN_ALLOW_THREADS; while (a>=0) { if ((a % 1000 == 0) && PyOS_InterruptOccurred()) break; a+=1; } - Py_END_ALLOW_THREADS + Py_END_ALLOW_THREADS; } else { Modified: trunk/numpy/core/src/ufuncobject.c =================================================================== --- trunk/numpy/core/src/ufuncobject.c 2008-04-26 22:14:10 UTC (rev 5099) +++ trunk/numpy/core/src/ufuncobject.c 2008-04-26 23:29:01 UTC (rev 5100) @@ -591,7 +591,7 @@ ntot = nin+nout; - for (j = 0; j < ntot; j++) { + for(j = 0; j < ntot; j++) { ptrs[j] = args[j]; } for(i = 0; i < n; i++) { @@ -599,7 +599,7 @@ if (arglist == NULL) { return; } - for (j = 0; j < nin; j++) { + for(j = 0; j < nin; j++) { in = *((PyObject **)ptrs[j]); if (in == NULL) { Py_DECREF(arglist); @@ -618,7 +618,7 @@ Py_DECREF(result); return; } - for (j = 0; j < nout; j++) { + for(j = 0; j < nout; j++) { op = (PyObject **)ptrs[j+nin]; Py_XDECREF(*op); *op = PyTuple_GET_ITEM(result, j); @@ -631,7 +631,7 @@ Py_XDECREF(*op); *op = result; } - for (j = 0; j < ntot; j++) { + for(j = 0; j < ntot; j++) { ptrs[j] += steps[j]; } } @@ -843,7 +843,7 @@ int i; funcdata = (PyUFunc_Loop1d *)PyCObject_AsVoidPtr(obj); while (funcdata != NULL) { - for (i=0; iarg_types[i], scalars[i])) @@ -854,7 +854,7 @@ *data = funcdata->data; /* Make sure actual arg_types supported by the loop are used */ - for (i=0; iarg_types[i]; } return 0; @@ -900,7 +900,7 @@ char *thestr; slen = PyString_GET_SIZE(type_tup); thestr = PyString_AS_STRING(type_tup); - for (i=0; i < slen-2; i++) { + for(i=0; i < slen-2; i++) { if (thestr[i] == '-' && thestr[i+1] == '>') break; } @@ -942,7 +942,7 @@ } } else if (PyTuple_Check(type_tup)) { - for (i=0; iarg_types[i]) break; } @@ -991,7 +991,7 @@ if (i == nargs) { *function = funcdata->func; *data = funcdata->data; - for (i=0; iarg_types[i]; } Py_DECREF(obj); @@ -1005,9 +1005,9 @@ /* look for match in self->functions */ - for (j=0; jntypes; j++) { + for(j=0; jntypes; j++) { if (n != 1) { - for (i=0; itypes[j*nargs + i]) break; } @@ -1019,7 +1019,7 @@ if (i == nargs) { *function = self->functions[j]; *data = self->data[j]; - for (i=0; itypes[j*nargs+i]; } goto finish; @@ -1055,7 +1055,7 @@ int userdef_ind=-1; if (self->userloops) { - for (i=0; inin; i++) { + for(i=0; inin; i++) { if (PyTypeNum_ISUSERDEF(arg_types[i])) { userdef = arg_types[i]; userdef_ind = i; @@ -1246,7 +1246,7 @@ PyArray_Descr *ntype; PyArray_Descr *atype; - for (i=0; inin; i++) { + for(i=0; inin; i++) { obj = PyTuple_GET_ITEM(args,i); if (!PyArray_Check(obj) && !PyArray_IsScalar(obj, Generic)) { context = Py_BuildValue("OOi", self, args, i); @@ -1378,7 +1378,7 @@ /* If everything is a scalar, or scalars mixed with arrays of different kinds of lesser types then use normal coercion rules */ if (allscalars || (maxsckind > maxarrkind)) { - for (i=0; inin; i++) { + for(i=0; inin; i++) { scalars[i] = PyArray_NOSCALAR; } } @@ -1409,7 +1409,7 @@ if (_create_copies(loop, arg_types, mps) < 0) return -1; /* Create Iterators for the Inputs */ - for (i=0; inin; i++) { + for(i=0; inin; i++) { loop->iters[i] = (PyArrayIterObject *) \ PyArray_IterNew((PyObject *)mps[i]); if (loop->iters[i] == NULL) return -1; @@ -1421,7 +1421,7 @@ return -1; /* Get any return arguments */ - for (i=self->nin; inin; inin; inargs; i++) { + for(i=self->nin; inargs; i++) { PyArray_Descr *ntype; if (mps[i] == NULL) { @@ -1530,7 +1530,7 @@ if (loop->size == 0) return nargs; - for (i=0; inargs; i++) { + for(i=0; inargs; i++) { loop->needbuffer[i] = 0; if (arg_types[i] != mps[i]->descr->type_num || !PyArray_ISBEHAVED_RO(mps[i])) { @@ -1550,7 +1550,7 @@ /* All correct type and BEHAVED */ /* Check for non-uniform stridedness */ - for (i=0; inargs; i++) { + for(i=0; inargs; i++) { if (!(loop->iters[i]->contiguous)) { /* may still have uniform stride if (broadcated result) <= 1-d */ @@ -1562,7 +1562,7 @@ } } if (loop->meth == ONE_UFUNCLOOP) { - for (i=0; inargs; i++) { + for(i=0; inargs; i++) { loop->bufptr[i] = mps[i]->data; } } @@ -1594,16 +1594,16 @@ smallest but non-zero. */ - for (i=0; ind; i++) { + for(i=0; ind; i++) { stride_sum[i] = 0; - for (j=0; jnumiter; j++) { + for(j=0; jnumiter; j++) { stride_sum[i] += loop->iters[j]->strides[i]; } } ldim = loop->nd - 1; minsum = stride_sum[loop->nd-1]; - for (i=loop->nd - 2; i>=0; i--) { + for(i=loop->nd - 2; i>=0; i--) { if (stride_sum[i] < minsum ) { ldim = i; minsum = stride_sum[i]; @@ -1621,7 +1621,7 @@ (just in the iterators) */ - for (i=0; inumiter; i++) { + for(i=0; inumiter; i++) { it = loop->iters[i]; it->contiguous = 0; it->size /= (it->dims_m1[ldim]+1); @@ -1643,7 +1643,7 @@ if (loop->meth == BUFFER_UFUNCLOOP) { loop->leftover = maxdim % loop->bufsize; loop->ninnerloops = (maxdim / loop->bufsize) + 1; - for (i=0; inargs; i++) { + for(i=0; inargs; i++) { if (loop->needbuffer[i] && loop->steps[i]) { loop->steps[i] = mps[i]->descr->elsize; } @@ -1652,7 +1652,7 @@ } } else { /* uniformly-strided case ONE_UFUNCLOOP */ - for (i=0; inargs; i++) { + for(i=0; inargs; i++) { if (PyArray_SIZE(mps[i]) == 1) loop->steps[i] = 0; else @@ -1679,7 +1679,7 @@ PyArray_Descr *descr; /* compute the element size */ - for (i=0; inargs;i++) { + for(i=0; inargs;i++) { if (!loop->needbuffer[i]) continue; if (arg_types[i] != mps[i]->descr->type_num) { descr = PyArray_DescrFromType(arg_types[i]); @@ -1715,7 +1715,7 @@ castptr = loop->buffer[0] + loop->bufsize*cnt + scbufsize*scnt; bufptr = loop->buffer[0]; loop->objfunc = 0; - for (i=0; inargs; i++) { + for(i=0; inargs; i++) { if (!loop->needbuffer[i]) continue; loop->buffer[i] = bufptr + (last_was_scalar ? scbufsize : \ loop->bufsize)*oldbufsize; @@ -1771,9 +1771,11 @@ int i; if (self->ufunc != NULL) { - for (i=0; iufunc->nargs; i++) + for(i = 0; i < self->ufunc->nargs; i++) Py_XDECREF(self->iters[i]); - if (self->buffer[0]) PyDataMem_FREE(self->buffer[0]); + if (self->buffer[0]) { + PyDataMem_FREE(self->buffer[0]); + } Py_XDECREF(self->errobj); Py_DECREF(self->ufunc); } @@ -1785,8 +1787,8 @@ { PyUFuncLoopObject *loop; int i; - PyObject *typetup=NULL; - PyObject *extobj=NULL; + PyObject *typetup = NULL; + PyObject *extobj = NULL; char *name; if (self == NULL) { @@ -1794,14 +1796,15 @@ return NULL; } if ((loop = _pya_malloc(sizeof(PyUFuncLoopObject)))==NULL) { - PyErr_NoMemory(); return loop; + PyErr_NoMemory(); + return loop; } loop->index = 0; loop->ufunc = self; Py_INCREF(self); loop->buffer[0] = NULL; - for (i=0; inargs; i++) { + for(i = 0; i < self->nargs; i++) { loop->iters[i] = NULL; loop->cast[i] = NULL; } @@ -1843,22 +1846,27 @@ if (extobj == NULL) { if (PyUFunc_GetPyValues(name, &(loop->bufsize), &(loop->errormask), - &(loop->errobj)) < 0) goto fail; + &(loop->errobj)) < 0) { + goto fail; + } } else { if (_extract_pyvals(extobj, name, &(loop->bufsize), &(loop->errormask), - &(loop->errobj)) < 0) goto fail; + &(loop->errobj)) < 0) { + goto fail; + } } /* Setup the arrays */ - if (construct_arrays(loop, args, mps, typetup) < 0) goto fail; + if (construct_arrays(loop, args, mps, typetup) < 0) { + goto fail; + } PyUFunc_clearfperr(); - return loop; - fail: +fail: ufuncloop_dealloc(loop); return NULL; } @@ -1871,7 +1879,7 @@ int i; fprintf(stderr, "Printing byte buffer %d\n", bufnum); - for (i=0; ibufcnt; i++) { + for(i=0; ibufcnt; i++) { fprintf(stderr, " %d\n", *(((byte *)(loop->buffer[bufnum]))+i)); } } @@ -1882,7 +1890,7 @@ int i; fprintf(stderr, "Printing long buffer %d\n", bufnum); - for (i=0; ibufcnt; i++) { + for(i=0; ibufcnt; i++) { fprintf(stderr, " %ld\n", *(((long *)(loop->buffer[bufnum]))+i)); } } @@ -1893,7 +1901,7 @@ int i; fprintf(stderr, "Printing long buffer %d\n", bufnum); - for (i=0; ibufcnt; i++) { + for(i=0; ibufcnt; i++) { fprintf(stderr, " %ld\n", *(((long *)(loop->bufptr[bufnum]))+i)); } } @@ -1906,7 +1914,7 @@ int i; fprintf(stderr, "Printing long buffer %d\n", bufnum); - for (i=0; ibufcnt; i++) { + for(i=0; ibufcnt; i++) { fprintf(stderr, " %ld\n", *(((long *)(loop->castbuf[bufnum]))+i)); } } @@ -1916,21 +1924,23 @@ -/* currently generic ufuncs cannot be built for use on flexible arrays. +/* + * currently generic ufuncs cannot be built for use on flexible arrays. + * + * The cast functions in the generic loop would need to be fixed to pass + * in something besides NULL, NULL. + * + * Also the underlying ufunc loops would not know the element-size unless + * that was passed in as data (which could be arranged). + * + */ - The cast functions in the generic loop would need to be fixed to pass - in something besides NULL, NULL. +/* + * This generic function is called with the ufunc object, the arguments to it, + * and an array of (pointers to) PyArrayObjects which are NULL. The + * arguments are parsed and placed in mps in construct_loop (construct_arrays) + */ - Also the underlying ufunc loops would not know the element-size unless - that was passed in as data (which could be arranged). - -*/ - -/* This generic function is called with the ufunc object, the arguments to it, - and an array of (pointers to) PyArrayObjects which are NULL. The - arguments are parsed and placed in mps in construct_loop (construct_arrays) -*/ - /*UFUNC_API*/ static int PyUFunc_GenericFunction(PyUFuncObject *self, PyObject *args, PyObject *kwds, @@ -1938,275 +1948,301 @@ { PyUFuncLoopObject *loop; int i; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; - if (!(loop = construct_loop(self, args, kwds, mps))) return -1; - if (loop->notimplemented) {ufuncloop_dealloc(loop); return -2;} + if (!(loop = construct_loop(self, args, kwds, mps))) { + return -1; + } + if (loop->notimplemented) { + ufuncloop_dealloc(loop); + return -2; + } - NPY_LOOP_BEGIN_THREADS - - switch(loop->meth) { + NPY_LOOP_BEGIN_THREADS; + switch(loop->meth) { case ONE_UFUNCLOOP: - /* Everything is contiguous, notswapped, aligned, - and of the right type. -- Fastest. - Or if not contiguous, then a single-stride - increment moves through the entire array. - */ + /* + * Everything is contiguous, notswapped, aligned, + * and of the right type. -- Fastest. + * Or if not contiguous, then a single-stride + * increment moves through the entire array. + */ /*fprintf(stderr, "ONE...%d\n", loop->size);*/ loop->function((char **)loop->bufptr, &(loop->size), - loop->steps, loop->funcdata); + loop->steps, loop->funcdata); UFUNC_CHECK_ERROR(loop); break; + case NOBUFFER_UFUNCLOOP: - /* Everything is notswapped, aligned and of the - right type but not contiguous. -- Almost as fast. - */ + /* + * Everything is notswapped, aligned and of the + * right type but not contiguous. -- Almost as fast. + */ /*fprintf(stderr, "NOBUFFER...%d\n", loop->size);*/ while (loop->index < loop->size) { - for (i=0; inargs; i++) + for(i = 0; i < self->nargs; i++) { loop->bufptr[i] = loop->iters[i]->dataptr; - + } loop->function((char **)loop->bufptr, &(loop->bufcnt), - loop->steps, loop->funcdata); + loop->steps, loop->funcdata); UFUNC_CHECK_ERROR(loop); /* Adjust loop pointers */ - - for (i=0; inargs; i++) { + 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; - int *swap=loop->swap; - char **dptr=loop->dptr; - int mpselsize[NPY_MAXARGS]; - intp laststrides[NPY_MAXARGS]; - int fastmemcpy[NPY_MAXARGS]; - int *needbuffer=loop->needbuffer; - intp index=loop->index, size=loop->size; - int bufsize; - intp bufcnt; - int copysizes[NPY_MAXARGS]; - char **bufptr = loop->bufptr; - char **buffer = loop->buffer; - char **castbuf = loop->castbuf; - intp *steps = loop->steps; - char *tptr[NPY_MAXARGS]; - int ninnerloops = loop->ninnerloops; - Bool pyobject[NPY_MAXARGS]; - int datasize[NPY_MAXARGS]; - int j, k, stopcondition; - char *myptr1, *myptr2; + PyArray_CopySwapNFunc *copyswapn[NPY_MAXARGS]; + PyArrayIterObject **iters=loop->iters; + int *swap=loop->swap; + char **dptr=loop->dptr; + int mpselsize[NPY_MAXARGS]; + intp laststrides[NPY_MAXARGS]; + int fastmemcpy[NPY_MAXARGS]; + int *needbuffer=loop->needbuffer; + intp index=loop->index, size=loop->size; + int bufsize; + intp bufcnt; + int copysizes[NPY_MAXARGS]; + char **bufptr = loop->bufptr; + char **buffer = loop->buffer; + char **castbuf = loop->castbuf; + intp *steps = loop->steps; + char *tptr[NPY_MAXARGS]; + int ninnerloops = loop->ninnerloops; + Bool pyobject[NPY_MAXARGS]; + int datasize[NPY_MAXARGS]; + int j, k, stopcondition; + char *myptr1, *myptr2; - - for (i=0; inargs; i++) { - copyswapn[i] = mps[i]->descr->f->copyswapn; - mpselsize[i] = mps[i]->descr->elsize; - pyobject[i] = (loop->obj && \ - (mps[i]->descr->type_num == PyArray_OBJECT)); - laststrides[i] = iters[i]->strides[loop->lastdim]; - if (steps[i] && laststrides[i] != mpselsize[i]) fastmemcpy[i] = 0; - else fastmemcpy[i] = 1; - } - /* Do generic buffered looping here (works for any kind of - arrays -- some need buffers, some don't. - */ - - /* New algorithm: N is the largest dimension. B is the buffer-size. - quotient is loop->ninnerloops-1 - remainder is loop->leftover - - 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-most loop is - replaced with... - - for(i=0; inargs; i++) { + copyswapn[i] = mps[i]->descr->f->copyswapn; + mpselsize[i] = mps[i]->descr->elsize; + pyobject[i] = (loop->obj && \ + (mps[i]->descr->type_num == PyArray_OBJECT)); + laststrides[i] = iters[i]->strides[loop->lastdim]; + if (steps[i] && laststrides[i] != mpselsize[i]) { + fastmemcpy[i] = 0; + } + else { + fastmemcpy[i] = 1; + } } - */ + /* Do generic buffered looping here (works for any kind of + * arrays -- some need buffers, some don't. + * + * + * New algorithm: N is the largest dimension. B is the buffer-size. + * quotient is loop->ninnerloops-1 + * remainder is loop->leftover + * + * 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-most loop is + * replaced with... + * + * for(i=0; isize, - loop->ninnerloops, loop->leftover); - */ - /* - for (i=0; inargs; i++) { - fprintf(stderr, "iters[%d]->dataptr = %p, %p of size %d\n", i, - iters[i], iters[i]->ao->data, PyArray_NBYTES(iters[i]->ao)); - } - */ + /* + * fprintf(stderr, "BUFFER...%d,%d,%d\n", loop->size, + * loop->ninnerloops, loop->leftover); + */ + /* + * for(i=0; inargs; i++) { + * fprintf(stderr, "iters[%d]->dataptr = %p, %p of size %d\n", i, + * iters[i], iters[i]->ao->data, PyArray_NBYTES(iters[i]->ao)); + * } + */ + stopcondition = ninnerloops; + if (loop->leftover == 0) stopcondition--; + while (index < size) { + bufsize=loop->bufsize; + for(i = 0; inargs; i++) { + tptr[i] = loop->iters[i]->dataptr; + if (needbuffer[i]) { + dptr[i] = bufptr[i]; + datasize[i] = (steps[i] ? bufsize : 1); + copysizes[i] = datasize[i] * mpselsize[i]; + } + else { + dptr[i] = tptr[i]; + } + } - stopcondition = ninnerloops; - if (loop->leftover == 0) stopcondition--; - while (index < size) { - bufsize=loop->bufsize; - for (i=0; inargs; i++) { - tptr[i] = loop->iters[i]->dataptr; - if (needbuffer[i]) { - dptr[i] = bufptr[i]; - datasize[i] = (steps[i] ? bufsize : 1); - copysizes[i] = datasize[i] * mpselsize[i]; - } - else { - dptr[i] = tptr[i]; - } - } + /* This is the inner function over the last dimension */ + for(k = 1; k<=stopcondition; k++) { + if (k == ninnerloops) { + bufsize = loop->leftover; + for(i=0; inargs;i++) { + if (!needbuffer[i]) { + continue; + } + datasize[i] = (steps[i] ? bufsize : 1); + copysizes[i] = datasize[i] * mpselsize[i]; + } + } + for(i = 0; i < self->nin; i++) { + if (!needbuffer[i]) { + continue; + } + if (fastmemcpy[i]) { + memcpy(buffer[i], tptr[i], copysizes[i]); + } + else { + myptr1 = buffer[i]; + myptr2 = tptr[i]; + for(j = 0; j < bufsize; j++) { + memcpy(myptr1, myptr2, mpselsize[i]); + myptr1 += mpselsize[i]; + myptr2 += laststrides[i]; + } + } - /* This is the inner function over the last dimension */ - for (k=1; k<=stopcondition; k++) { - if (k==ninnerloops) { - bufsize = loop->leftover; - for (i=0; inargs;i++) { - if (!needbuffer[i]) continue; - datasize[i] = (steps[i] ? bufsize : 1); - copysizes[i] = datasize[i] * mpselsize[i]; - } - } + /* swap the buffer if necessary */ + if (swap[i]) { + /* fprintf(stderr, "swapping...\n");*/ + copyswapn[i](buffer[i], mpselsize[i], NULL, -1, + (intp) datasize[i], 1, + mps[i]); + } + /* cast to the other buffer if necessary */ + if (loop->cast[i]) { + /* fprintf(stderr, "casting... %d, %p %p\n", i, buffer[i]); */ + loop->cast[i](buffer[i], castbuf[i], + (intp) datasize[i], + NULL, NULL); + } + } - for (i=0; inin; i++) { - if (!needbuffer[i]) continue; - if (fastmemcpy[i]) - memcpy(buffer[i], tptr[i], - copysizes[i]); - else { - myptr1 = buffer[i]; - myptr2 = tptr[i]; - for (j=0; jfunction((char **)dptr, &bufcnt, steps, loop->funcdata); + UFUNC_CHECK_ERROR(loop); - /* swap the buffer if necessary */ - if (swap[i]) { - /* fprintf(stderr, "swapping...\n");*/ - copyswapn[i](buffer[i], mpselsize[i], NULL, -1, - (intp) datasize[i], 1, - mps[i]); - } - /* cast to the other buffer if necessary */ - if (loop->cast[i]) { - /* fprintf(stderr, "casting... %d, %p %p\n", i, buffer[i]); */ - loop->cast[i](buffer[i], - castbuf[i], - (intp) datasize[i], - NULL, NULL); - } - } + for(i=self->nin; inargs; i++) { + if (!needbuffer[i]) { + continue; + } + if (loop->cast[i]) { + /* fprintf(stderr, "casting back... %d, %p", i, castbuf[i]); */ + loop->cast[i](castbuf[i], + buffer[i], + (intp) datasize[i], + NULL, NULL); + } + if (swap[i]) { + copyswapn[i](buffer[i], mpselsize[i], NULL, -1, + (intp) datasize[i], 1, + mps[i]); + } + /* + * copy back to output arrays + * decref what's already there for object arrays + */ + if (pyobject[i]) { + myptr1 = tptr[i]; + for(j = 0; j < datasize[i]; j++) { + Py_XDECREF(*((PyObject **)myptr1)); + myptr1 += laststrides[i]; + } + } + if (fastmemcpy[i]) + memcpy(tptr[i], buffer[i], copysizes[i]); + else { + myptr2 = buffer[i]; + myptr1 = tptr[i]; + for(j = 0; j < bufsize; j++) { + memcpy(myptr1, myptr2, + mpselsize[i]); + myptr1 += laststrides[i]; + myptr2 += mpselsize[i]; + } + } + } + if (k == stopcondition) { + continue; + } + for(i = 0; i < self->nargs; i++) { + tptr[i] += bufsize * laststrides[i]; + if (!needbuffer[i]) { + dptr[i] = tptr[i]; + } + } + } + /* end inner function over last dimension */ - bufcnt = (intp) bufsize; - loop->function((char **)dptr, &bufcnt, steps, loop->funcdata); + if (loop->objfunc) { + /* + * DECREF castbuf when underlying function used + * object arrays and casting was needed to get + * to object arrays + */ + for(i = 0; i < self->nargs; i++) { + if (loop->cast[i]) { + if (steps[i] == 0) { + Py_XDECREF(*((PyObject **)castbuf[i])); + } + else { + int size = loop->bufsize; - for (i=self->nin; inargs; i++) { - if (!needbuffer[i]) continue; - if (loop->cast[i]) { - /* fprintf(stderr, "casting back... %d, %p", i, castbuf[i]); */ - loop->cast[i](castbuf[i], - buffer[i], - (intp) datasize[i], - NULL, NULL); - } - if (swap[i]) { - copyswapn[i](buffer[i], mpselsize[i], NULL, -1, - (intp) datasize[i], 1, - mps[i]); - } - /* copy back to output arrays */ - /* decref what's already there for object arrays */ - if (pyobject[i]) { - myptr1 = tptr[i]; - for (j=0; jnargs; i++) { - tptr[i] += bufsize * laststrides[i]; - if (!needbuffer[i]) dptr[i] = tptr[i]; - } - } - /* end inner function over last dimension */ + PyObject **objptr = (PyObject **)castbuf[i]; + /* + * size is loop->bufsize unless there + * was only one loop + */ + if (ninnerloops == 1) { + size = loop->leftover; + } + for(j = 0; j < size; j++) { + Py_XDECREF(*objptr); + *objptr = NULL; + objptr += 1; + } + } + } + } - if (loop->objfunc) { /* DECREF castbuf when underlying function used object arrays - and casting was needed to get to object arrays */ - for (i=0; inargs; i++) { - if (loop->cast[i]) { - if (steps[i] == 0) { - Py_XDECREF(*((PyObject **)castbuf[i])); - } - else { - int size = loop->bufsize; - PyObject **objptr = (PyObject **)castbuf[i]; - /* size is loop->bufsize unless there - was only one loop */ - if (ninnerloops == 1) \ - size = loop->leftover; + } + /* fixme -- probably not needed here*/ + UFUNC_CHECK_ERROR(loop); - for (j=0; jnargs; i++) { + PyArray_ITER_NEXT(loop->iters[i]); + } + index++; + } + } + } - } - - UFUNC_CHECK_ERROR(loop); - - for (i=0; inargs; i++) { - PyArray_ITER_NEXT(loop->iters[i]); - } - index++; - } - } - } - - NPY_LOOP_END_THREADS - - ufuncloop_dealloc(loop); + NPY_LOOP_END_THREADS; + ufuncloop_dealloc(loop); return 0; - fail: - NPY_LOOP_END_THREADS - - if (loop) ufuncloop_dealloc(loop); +fail: + NPY_LOOP_END_THREADS; + if (loop) ufuncloop_dealloc(loop); return -1; } @@ -2244,13 +2280,15 @@ maxsize = PyArray_SIZE(*arr); if (maxsize < loop->bufsize) { - if (!(PyArray_ISBEHAVED_RO(*arr)) || \ + if (!(PyArray_ISBEHAVED_RO(*arr)) || PyArray_TYPE(*arr) != rtype) { ntype = PyArray_DescrFromType(rtype); new = PyArray_FromAny((PyObject *)(*arr), ntype, 0, 0, FORCECAST | ALIGNED, NULL); - if (new == NULL) return -1; + if (new == NULL) { + return -1; + } *arr = (PyArrayObject *)new; loop->decref = new; } @@ -2375,7 +2413,7 @@ flags = NPY_CARRAY | NPY_UPDATEIFCOPY | NPY_FORCECAST; switch(operation) { case UFUNC_REDUCE: - for (j=0, i=0; idimensions[i]; @@ -2529,22 +2567,22 @@ Zero-length and one-length axes-to-be-reduced are handled separately. */ -static PyObject * + static PyObject * PyUFunc_Reduce(PyUFuncObject *self, PyArrayObject *arr, PyArrayObject *out, - int axis, int otype) + int axis, int otype) { PyArrayObject *ret=NULL; PyUFuncReduceObject *loop; intp i, n; char *dptr; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; - /* Construct loop object */ - loop = construct_reduce(self, &arr, out, axis, otype, UFUNC_REDUCE, 0, - "reduce"); + /* Construct loop object */ + loop = construct_reduce(self, &arr, out, axis, otype, UFUNC_REDUCE, 0, + "reduce"); if (!loop) return NULL; - NPY_LOOP_BEGIN_THREADS + NPY_LOOP_BEGIN_THREADS; switch(loop->meth) { case ZERO_EL_REDUCELOOP: /* fprintf(stderr, "ZERO..%d\n", loop->size); */ @@ -2629,7 +2667,7 @@ /* Copy up to loop->bufsize elements to buffer */ dptr = loop->buffer; - for (i=0; ibufsize; i++, n++) { + for(i=0; ibufsize; i++, n++) { if (n == loop->N) break; arr->descr->f->copyswap(dptr, loop->inptr, @@ -2656,17 +2694,17 @@ } } - NPY_LOOP_END_THREADS + NPY_LOOP_END_THREADS; /* Hang on to this reference -- will be decref'd with loop */ if (loop->retbase) ret = (PyArrayObject *)loop->ret->base; else ret = loop->ret; - Py_INCREF(ret); - ufuncreduce_dealloc(loop); - return (PyObject *)ret; + Py_INCREF(ret); + ufuncreduce_dealloc(loop); + return (PyObject *)ret; - fail: - NPY_LOOP_END_THREADS +fail: + NPY_LOOP_END_THREADS; if (loop) ufuncreduce_dealloc(loop); return NULL; @@ -2681,140 +2719,140 @@ PyUFuncReduceObject *loop; intp i, n; char *dptr; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; /* Construct loop object */ loop = construct_reduce(self, &arr, out, axis, otype, UFUNC_ACCUMULATE, 0, "accumulate"); if (!loop) return NULL; - NPY_LOOP_BEGIN_THREADS - switch(loop->meth) { - case ZERO_EL_REDUCELOOP: /* Accumulate */ - /* fprintf(stderr, "ZERO..%d\n", loop->size); */ - for(i=0; isize; i++) { - if (loop->obj) - Py_INCREF(*((PyObject **)loop->idptr)); - memcpy(loop->bufptr[0], loop->idptr, loop->outsize); - loop->bufptr[0] += loop->outsize; - } - break; - case ONE_EL_REDUCELOOP: /* Accumulate */ - /* fprintf(stderr, "ONEDIM..%d\n", loop->size); */ - while(loop->index < loop->size) { - if (loop->obj) - Py_INCREF(*((PyObject **)loop->it->dataptr)); - memcpy(loop->bufptr[0], loop->it->dataptr, + NPY_LOOP_BEGIN_THREADS; + switch(loop->meth) { + case ZERO_EL_REDUCELOOP: /* Accumulate */ + /* fprintf(stderr, "ZERO..%d\n", loop->size); */ + for(i=0; isize; i++) { + if (loop->obj) + Py_INCREF(*((PyObject **)loop->idptr)); + memcpy(loop->bufptr[0], loop->idptr, loop->outsize); + loop->bufptr[0] += loop->outsize; + } + break; + case ONE_EL_REDUCELOOP: /* Accumulate */ + /* fprintf(stderr, "ONEDIM..%d\n", loop->size); */ + while(loop->index < loop->size) { + if (loop->obj) + Py_INCREF(*((PyObject **)loop->it->dataptr)); + memcpy(loop->bufptr[0], loop->it->dataptr, + loop->outsize); + PyArray_ITER_NEXT(loop->it); + loop->bufptr[0] += loop->outsize; + loop->index++; + } + break; + case NOBUFFER_UFUNCLOOP: /* Accumulate */ + /* fprintf(stderr, "NOBUFFER..%d\n", loop->size); */ + while(loop->index < loop->size) { + /* Copy first element to output */ + if (loop->obj) + Py_INCREF(*((PyObject **)loop->it->dataptr)); + memcpy(loop->bufptr[0], loop->it->dataptr, + loop->outsize); + /* Adjust input pointer */ + loop->bufptr[1] = loop->it->dataptr+loop->steps[1]; + loop->function((char **)loop->bufptr, + &(loop->N), + loop->steps, loop->funcdata); + UFUNC_CHECK_ERROR(loop); + + PyArray_ITER_NEXT(loop->it); + PyArray_ITER_NEXT(loop->rit); + loop->bufptr[0] = loop->rit->dataptr; + loop->bufptr[2] = loop->bufptr[0] + loop->steps[0]; + loop->index++; + } + break; + case BUFFER_UFUNCLOOP: /* Accumulate */ + /* use buffer for arr */ + /* + For each row to reduce + 1. copy identity over to output (casting if necessary) + 2. Fill inner buffer + 3. When buffer is filled or end of row + a. Cast input buffers if needed + b. Call inner function. + 4. Repeat 2 until row is done. + */ + /* fprintf(stderr, "BUFFERED..%d %p\n", loop->size, + loop->cast); */ + while(loop->index < loop->size) { + loop->inptr = loop->it->dataptr; + /* Copy (cast) First term over to output */ + if (loop->cast) { + /* A little tricky because we need to + cast it first */ + arr->descr->f->copyswap(loop->buffer, + loop->inptr, + loop->swap, + NULL); + loop->cast(loop->buffer, loop->castbuf, + 1, NULL, NULL); + if (loop->obj) { + Py_XINCREF(*((PyObject **)loop->castbuf)); + } + memcpy(loop->bufptr[0], loop->castbuf, loop->outsize); - PyArray_ITER_NEXT(loop->it); - loop->bufptr[0] += loop->outsize; - loop->index++; } - break; - case NOBUFFER_UFUNCLOOP: /* Accumulate */ - /* fprintf(stderr, "NOBUFFER..%d\n", loop->size); */ - while(loop->index < loop->size) { - /* Copy first element to output */ - if (loop->obj) - Py_INCREF(*((PyObject **)loop->it->dataptr)); - memcpy(loop->bufptr[0], loop->it->dataptr, - loop->outsize); - /* Adjust input pointer */ - loop->bufptr[1] = loop->it->dataptr+loop->steps[1]; - loop->function((char **)loop->bufptr, - &(loop->N), - loop->steps, loop->funcdata); - UFUNC_CHECK_ERROR(loop); - - PyArray_ITER_NEXT(loop->it); - PyArray_ITER_NEXT(loop->rit); - loop->bufptr[0] = loop->rit->dataptr; - loop->bufptr[2] = loop->bufptr[0] + loop->steps[0]; - loop->index++; + else { /* Simple copy */ + arr->descr->f->copyswap(loop->bufptr[0], + loop->inptr, + loop->swap, + NULL); } - break; - case BUFFER_UFUNCLOOP: /* Accumulate */ - /* use buffer for arr */ - /* - For each row to reduce - 1. copy identity over to output (casting if necessary) - 2. Fill inner buffer - 3. When buffer is filled or end of row - a. Cast input buffers if needed - b. Call inner function. - 4. Repeat 2 until row is done. - */ - /* fprintf(stderr, "BUFFERED..%d %p\n", loop->size, - loop->cast); */ - while(loop->index < loop->size) { - loop->inptr = loop->it->dataptr; - /* Copy (cast) First term over to output */ - if (loop->cast) { - /* A little tricky because we need to - cast it first */ - arr->descr->f->copyswap(loop->buffer, + loop->inptr += loop->instrides; + n = 1; + while(n < loop->N) { + /* Copy up to loop->bufsize elements to + buffer */ + dptr = loop->buffer; + for(i=0; ibufsize; i++, n++) { + if (n == loop->N) break; + arr->descr->f->copyswap(dptr, loop->inptr, loop->swap, NULL); - loop->cast(loop->buffer, loop->castbuf, - 1, NULL, NULL); - if (loop->obj) { - Py_XINCREF(*((PyObject **)loop->castbuf)); - } - memcpy(loop->bufptr[0], loop->castbuf, - loop->outsize); + loop->inptr += loop->instrides; + dptr += loop->insize; } - else { /* Simple copy */ - arr->descr->f->copyswap(loop->bufptr[0], - loop->inptr, - loop->swap, - NULL); - } - loop->inptr += loop->instrides; - n = 1; - while(n < loop->N) { - /* Copy up to loop->bufsize elements to - buffer */ - dptr = loop->buffer; - for (i=0; ibufsize; i++, n++) { - if (n == loop->N) break; - arr->descr->f->copyswap(dptr, - loop->inptr, - loop->swap, - NULL); - loop->inptr += loop->instrides; - dptr += loop->insize; - } - if (loop->cast) - loop->cast(loop->buffer, - loop->castbuf, - i, NULL, NULL); - loop->function((char **)loop->bufptr, - &i, - loop->steps, loop->funcdata); - loop->bufptr[0] += loop->steps[0]*i; - loop->bufptr[2] += loop->steps[2]*i; - UFUNC_CHECK_ERROR(loop); - } - PyArray_ITER_NEXT(loop->it); - PyArray_ITER_NEXT(loop->rit); - loop->bufptr[0] = loop->rit->dataptr; - loop->bufptr[2] = loop->bufptr[0] + loop->steps[0]; - loop->index++; + if (loop->cast) + loop->cast(loop->buffer, + loop->castbuf, + i, NULL, NULL); + loop->function((char **)loop->bufptr, + &i, + loop->steps, loop->funcdata); + loop->bufptr[0] += loop->steps[0]*i; + loop->bufptr[2] += loop->steps[2]*i; + UFUNC_CHECK_ERROR(loop); } + PyArray_ITER_NEXT(loop->it); + PyArray_ITER_NEXT(loop->rit); + loop->bufptr[0] = loop->rit->dataptr; + loop->bufptr[2] = loop->bufptr[0] + loop->steps[0]; + loop->index++; } + } - NPY_LOOP_END_THREADS + NPY_LOOP_END_THREADS; - /* Hang on to this reference -- will be decref'd with loop */ - if (loop->retbase) ret = (PyArrayObject *)loop->ret->base; - else ret = loop->ret; + /* Hang on to this reference -- will be decref'd with loop */ + if (loop->retbase) ret = (PyArrayObject *)loop->ret->base; + else ret = loop->ret; Py_INCREF(ret); ufuncreduce_dealloc(loop); return (PyObject *)ret; fail: - NPY_LOOP_END_THREADS + NPY_LOOP_END_THREADS; if (loop) ufuncreduce_dealloc(loop); return NULL; @@ -2850,17 +2888,17 @@ intp mm=arr->dimensions[axis]-1; intp n, i, j; char *dptr; - NPY_BEGIN_THREADS_DEF + NPY_BEGIN_THREADS_DEF; - /* Check for out-of-bounds values in indices array */ - for (i=0; i mm)) { - PyErr_Format(PyExc_IndexError, - "index out-of-bounds (0, %d)", (int) mm); - return NULL; - } - ptr++; + /* Check for out-of-bounds values in indices array */ + for(i=0; i mm)) { + PyErr_Format(PyExc_IndexError, + "index out-of-bounds (0, %d)", (int) mm); + return NULL; } + ptr++; + } ptr = (intp *)ind->data; /* Construct loop object */ @@ -2868,98 +2906,98 @@ "reduceat"); if (!loop) return NULL; - NPY_LOOP_BEGIN_THREADS - switch(loop->meth) { - /* zero-length index -- return array immediately */ - case ZERO_EL_REDUCELOOP: - /* fprintf(stderr, "ZERO..\n"); */ - break; - /* NOBUFFER -- behaved array and same type */ - case NOBUFFER_UFUNCLOOP: /* Reduceat */ - /* fprintf(stderr, "NOBUFFER..%d\n", loop->size); */ - while(loop->index < loop->size) { - ptr = (intp *)ind->data; - for (i=0; ibufptr[1] = loop->it->dataptr + \ - (*ptr)*loop->instrides; - if (loop->obj) { - Py_XINCREF(*((PyObject **)loop->bufptr[1])); - } - memcpy(loop->bufptr[0], loop->bufptr[1], - loop->outsize); - mm = (i==nn-1 ? arr->dimensions[axis]-*ptr : \ - *(ptr+1) - *ptr) - 1; - if (mm > 0) { - loop->bufptr[1] += loop->instrides; - loop->bufptr[2] = loop->bufptr[0]; - loop->function((char **)loop->bufptr, - &mm, loop->steps, - loop->funcdata); - UFUNC_CHECK_ERROR(loop); - } - loop->bufptr[0] += loop->ret->strides[axis]; - ptr++; + NPY_LOOP_BEGIN_THREADS; + switch(loop->meth) { + /* zero-length index -- return array immediately */ + case ZERO_EL_REDUCELOOP: + /* fprintf(stderr, "ZERO..\n"); */ + break; + /* NOBUFFER -- behaved array and same type */ + case NOBUFFER_UFUNCLOOP: /* Reduceat */ + /* fprintf(stderr, "NOBUFFER..%d\n", loop->size); */ + while(loop->index < loop->size) { + ptr = (intp *)ind->data; + for(i=0; ibufptr[1] = loop->it->dataptr + \ + (*ptr)*loop->instrides; + if (loop->obj) { + Py_XINCREF(*((PyObject **)loop->bufptr[1])); } - PyArray_ITER_NEXT(loop->it); - PyArray_ITER_NEXT(loop->rit); - loop->bufptr[0] = loop->rit->dataptr; - loop->index++; + memcpy(loop->bufptr[0], loop->bufptr[1], + loop->outsize); + mm = (i==nn-1 ? arr->dimensions[axis]-*ptr : \ + *(ptr+1) - *ptr) - 1; + if (mm > 0) { + loop->bufptr[1] += loop->instrides; + loop->bufptr[2] = loop->bufptr[0]; + loop->function((char **)loop->bufptr, + &mm, loop->steps, + loop->funcdata); + UFUNC_CHECK_ERROR(loop); + } + loop->bufptr[0] += loop->ret->strides[axis]; + ptr++; } - break; + PyArray_ITER_NEXT(loop->it); + PyArray_ITER_NEXT(loop->rit); + loop->bufptr[0] = loop->rit->dataptr; + loop->index++; + } + break; - /* BUFFER -- misbehaved array or different types */ - case BUFFER_UFUNCLOOP: /* Reduceat */ - /* fprintf(stderr, "BUFFERED..%d\n", loop->size); */ - while(loop->index < loop->size) { - ptr = (intp *)ind->data; - for (i=0; iobj) { - Py_XINCREF(*((PyObject **)loop->idptr)); + /* BUFFER -- misbehaved array or different types */ + case BUFFER_UFUNCLOOP: /* Reduceat */ + /* fprintf(stderr, "BUFFERED..%d\n", loop->size); */ + while(loop->index < loop->size) { + ptr = (intp *)ind->data; + for(i=0; iobj) { + Py_XINCREF(*((PyObject **)loop->idptr)); + } + memcpy(loop->bufptr[0], loop->idptr, + loop->outsize); + n = 0; + mm = (i==nn-1 ? arr->dimensions[axis] - *ptr :\ + *(ptr+1) - *ptr); + if (mm < 1) mm = 1; + loop->inptr = loop->it->dataptr + \ + (*ptr)*loop->instrides; + while (n < mm) { + /* Copy up to loop->bufsize elements + to buffer */ + dptr = loop->buffer; + for(j=0; jbufsize; j++, n++) { + if (n == mm) break; + arr->descr->f->copyswap\ + (dptr, + loop->inptr, + loop->swap, NULL); + loop->inptr += loop->instrides; + dptr += loop->insize; } - memcpy(loop->bufptr[0], loop->idptr, - loop->outsize); - n = 0; - mm = (i==nn-1 ? arr->dimensions[axis] - *ptr :\ - *(ptr+1) - *ptr); - if (mm < 1) mm = 1; - loop->inptr = loop->it->dataptr + \ - (*ptr)*loop->instrides; - while (n < mm) { - /* Copy up to loop->bufsize elements - to buffer */ - dptr = loop->buffer; - for (j=0; jbufsize; j++, n++) { - if (n == mm) break; - arr->descr->f->copyswap\ - (dptr, - loop->inptr, - loop->swap, NULL); - loop->inptr += loop->instrides; - dptr += loop->insize; - } - if (loop->cast) - loop->cast(loop->buffer, - loop->castbuf, - j, NULL, NULL); - loop->bufptr[2] = loop->bufptr[0]; - loop->function((char **)loop->bufptr, - &j, loop->steps, - loop->funcdata); - UFUNC_CHECK_ERROR(loop); - loop->bufptr[0] += j*loop->steps[0]; - } - loop->bufptr[0] += loop->ret->strides[axis]; - ptr++; + if (loop->cast) + loop->cast(loop->buffer, + loop->castbuf, + j, NULL, NULL); + loop->bufptr[2] = loop->bufptr[0]; + loop->function((char **)loop->bufptr, + &j, loop->steps, + loop->funcdata); + UFUNC_CHECK_ERROR(loop); + loop->bufptr[0] += j*loop->steps[0]; } - PyArray_ITER_NEXT(loop->it); - PyArray_ITER_NEXT(loop->rit); - loop->bufptr[0] = loop->rit->dataptr; - loop->index++; + loop->bufptr[0] += loop->ret->strides[axis]; + ptr++; } - break; + PyArray_ITER_NEXT(loop->it); + PyArray_ITER_NEXT(loop->rit); + loop->bufptr[0] = loop->rit->dataptr; + loop->index++; } + break; + } - NPY_LOOP_END_THREADS + NPY_LOOP_END_THREADS; /* Hang on to this reference -- will be decref'd with loop */ if (loop->retbase) ret = (PyArrayObject *)loop->ret->base; @@ -2968,10 +3006,10 @@ ufuncreduce_dealloc(loop); return (PyObject *)ret; - fail: - NPY_LOOP_END_THREADS +fail: + NPY_LOOP_END_THREADS; - if (loop) ufuncreduce_dealloc(loop); + if (loop) ufuncreduce_dealloc(loop); return NULL; } @@ -3169,7 +3207,7 @@ PyObject *obj, *wrap = NULL; nargs = PyTuple_GET_SIZE(args); - for (i=0; inargs; i++) mps[i] = NULL; + /* + * Initialize all array objects to NULL to make cleanup easier + * if something goes wrong. + */ + for(i = 0; i < self->nargs; i++) { + mps[i] = NULL; + } errval = PyUFunc_GenericFunction(self, args, kwds, mps); if (errval < 0) { - for(i=0; inargs; i++) { + for(i = 0; i < self->nargs; i++) { PyArray_XDECREF_ERR(mps[i]); } if (errval == -1) @@ -3285,40 +3326,45 @@ } } - for(i=0; inin; i++) Py_DECREF(mps[i]); + for(i = 0; i < self->nin; i++) { + Py_DECREF(mps[i]); + } - /* Use __array_wrap__ on all outputs - if present on one of the input arguments. - If present for multiple inputs: - use __array_wrap__ of input object with largest - __array_priority__ (default = 0.0) - */ - - /* Exception: we should not wrap outputs for items already - passed in as output-arguments. These items should either - be left unwrapped or wrapped by calling their own __array_wrap__ - routine. - - For each output argument, wrap will be either - NULL --- call PyArray_Return() -- default if no output arguments given - None --- array-object passed in don't call PyArray_Return - method --- the __array_wrap__ method to call. - */ + /* + * Use __array_wrap__ on all outputs + * if present on one of the input arguments. + * If present for multiple inputs: + * use __array_wrap__ of input object with largest + * __array_priority__ (default = 0.0) + * + * Exception: we should not wrap outputs for items already + * passed in as output-arguments. These items should either + * be left unwrapped or wrapped by calling their own __array_wrap__ + * routine. + * + * For each output argument, wrap will be either + * NULL --- call PyArray_Return() -- default if no output arguments given + * None --- array-object passed in don't call PyArray_Return + * method --- the __array_wrap__ method to call. + */ _find_array_wrap(args, wraparr, self->nin, self->nout); /* wrap outputs */ - for (i=0; inout; i++) { + for(i = 0; i < self->nout; i++) { int j=self->nin+i; PyObject *wrap; - /* check to see if any UPDATEIFCOPY flags are set - which meant that a temporary output was generated - */ + + /* + * check to see if any UPDATEIFCOPY flags are set + * which meant that a temporary output was generated + */ if (mps[j]->flags & UPDATEIFCOPY) { PyObject *old = mps[j]->base; - Py_INCREF(old); /* we want to hang on to this */ - Py_DECREF(mps[j]); /* should trigger the copy - back into old */ + /* we want to hang on to this */ + Py_INCREF(old); + /* should trigger the copyback into old */ + Py_DECREF(mps[j]); mps[j] = (PyArrayObject *)old; } wrap = wraparr[i]; @@ -3338,8 +3384,12 @@ NULL); } Py_DECREF(wrap); - if (res == NULL) goto fail; - else if (res == Py_None) Py_DECREF(res); + if (res == NULL) { + goto fail; + } + else if (res == Py_None) { + Py_DECREF(res); + } else { Py_DECREF(mps[j]); retobj[i] = res; @@ -3354,13 +3404,15 @@ return retobj[0]; } else { ret = (PyTupleObject *)PyTuple_New(self->nout); - for(i=0; inout; i++) { + for(i = 0; i < self->nout; i++) { PyTuple_SET_ITEM(ret, i, retobj[i]); } return (PyObject *)ret; } - fail: - for(i=self->nin; inargs; i++) Py_XDECREF(mps[i]); +fail: + for(i = self->nin; i < self->nargs; i++) { + Py_XDECREF(mps[i]); + } return NULL; } @@ -3541,7 +3593,7 @@ self->data[0] = (void *)fdata; self->types = (char *)self->data + sizeof(void *); - for (i=0; inargs; i++) self->types[i] = PyArray_OBJECT; + for(i=0; inargs; i++) self->types[i] = PyArray_OBJECT; str = self->types + offset[1]; memcpy(str, fname, fname_len); @@ -3566,8 +3618,8 @@ int i,j; int res = -1; /* Find the location of the matching signature */ - for (i=0; intypes; i++) { - for (j=0; jnargs; j++) { + for(i=0; intypes; i++) { + for(j=0; jnargs; j++) { if (signature[j] != func->types[i*func->nargs+j]) break; } @@ -3640,7 +3692,7 @@ static int cmp_arg_types(int *arg1, int *arg2, int n) { - for (;n>0; n--, arg1++, arg2++) { + for(;n>0; n--, arg1++, arg2++) { if (PyArray_EquivTypenums(*arg1, *arg2)) continue; if (PyArray_CanCastSafely(*arg1, *arg2)) return -1; @@ -3698,12 +3750,12 @@ newtypes = _pya_malloc(sizeof(int)*ufunc->nargs); if (newtypes == NULL) goto fail; if (arg_types != NULL) { - for (i=0; inargs; i++) { + for(i=0; inargs; i++) { newtypes[i] = arg_types[i]; } } else { - for (i=0; inargs; i++) { + for(i=0; inargs; i++) { newtypes[i] = usertype; } } @@ -3843,13 +3895,13 @@ /* Construct new shape tuple */ shape1 = PyTuple_New(ap1->nd); if (shape1 == NULL) goto fail; - for (i=0; ind; i++) + for(i=0; ind; i++) PyTuple_SET_ITEM(shape1, i, PyLong_FromLongLong((longlong)ap1-> \ dimensions[i])); shape2 = PyTuple_New(ap2->nd); - for (i=0; ind; i++) + for(i=0; ind; i++) PyTuple_SET_ITEM(shape2, i, PyInt_FromLong((long) 1)); if (shape2 == NULL) {Py_DECREF(shape1); goto fail;} newshape = PyNumber_Add(shape1, shape2); @@ -4004,14 +4056,14 @@ if (list == NULL) return NULL; t = _pya_malloc(no+ni+2); n = 0; - for (k=0; ktypes[n]); n++; } t[ni] = '-'; t[ni+1] = '>'; - for (j=0; jtypes[n]); n++; From numpy-svn at scipy.org Sat Apr 26 19:36:58 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sat, 26 Apr 2008 18:36:58 -0500 (CDT) Subject: [Numpy-svn] r5101 - trunk/numpy/core/include/numpy Message-ID: <20080426233658.88ACA39C0AE@new.scipy.org> Author: charris Date: 2008-04-26 18:36:55 -0500 (Sat, 26 Apr 2008) New Revision: 5101 Modified: trunk/numpy/core/include/numpy/ndarrayobject.h trunk/numpy/core/include/numpy/ufuncobject.h Log: Enclose macros with ifs in do {} while (0). Lets try this again with clean files. Modified: trunk/numpy/core/include/numpy/ndarrayobject.h =================================================================== --- trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-26 23:29:01 UTC (rev 5100) +++ trunk/numpy/core/include/numpy/ndarrayobject.h 2008-04-26 23:36:55 UTC (rev 5101) @@ -1137,25 +1137,22 @@ PyArray_FastTakeFunc *fasttake; } PyArray_ArrFuncs; -#define NPY_ITEM_REFCOUNT 0x01 /* The item must be reference counted - when it is inserted or extracted. */ -#define NPY_ITEM_HASOBJECT 0x01 /* Same as needing REFCOUNT */ - -#define NPY_LIST_PICKLE 0x02 /* Convert to list for pickling */ -#define NPY_ITEM_IS_POINTER 0x04 /* The item is a POINTER */ - -#define NPY_NEEDS_INIT 0x08 /* memory needs to be initialized - for this data-type */ - -#define NPY_NEEDS_PYAPI 0x10 /* operations need Python C-API - so don't give-up thread. */ - -#define NPY_USE_GETITEM 0x20 /* Use f.getitem when extracting elements - of this data-type */ - -#define NPY_USE_SETITEM 0x40 /* Use f.setitem when setting creating - 0-d array from this data-type. - */ +/* The item must be reference counted when it is inserted or extracted. */ +#define NPY_ITEM_REFCOUNT 0x01 +/* Same as needing REFCOUNT */ +#define NPY_ITEM_HASOBJECT 0x01 +/* Convert to list for pickling */ +#define NPY_LIST_PICKLE 0x02 +/* The item is a POINTER */ +#define NPY_ITEM_IS_POINTER 0x04 +/* memory needs to be initialized for this data-type */ +#define NPY_NEEDS_INIT 0x08 +/* operations need Python C-API so don't give-up thread. */ +#define NPY_NEEDS_PYAPI 0x10 +/* Use f.getitem when extracting elements of this data-type */ +#define NPY_USE_GETITEM 0x20 +/* Use f.setitem when setting creating 0-d array from this data-type.*/ +#define NPY_USE_SETITEM 0x40 /* define NPY_IS_COMPLEX */ /* These are inherited for global data-type if any data-types in the field @@ -1372,15 +1369,15 @@ #define NPY_END_ALLOW_THREADS Py_END_ALLOW_THREADS #define NPY_BEGIN_THREADS_DEF PyThreadState *_save=NULL; #define NPY_BEGIN_THREADS _save = PyEval_SaveThread(); -#define NPY_END_THREADS if (_save) PyEval_RestoreThread(_save); +#define NPY_END_THREADS do {if (_save) PyEval_RestoreThread(_save);} while (0); #define NPY_BEGIN_THREADS_DESCR(dtype) \ - if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ - NPY_BEGIN_THREADS + do {if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ + NPY_BEGIN_THREADS;} while (0); #define NPY_END_THREADS_DESCR(dtype) \ - if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ - NPY_END_THREADS + do {if (!(PyDataType_FLAGCHK(dtype, NPY_NEEDS_PYAPI))) \ + NPY_END_THREADS; } while (0); #define NPY_ALLOW_C_API_DEF PyGILState_STATE __save__; #define NPY_ALLOW_C_API __save__ = PyGILState_Ensure(); Modified: trunk/numpy/core/include/numpy/ufuncobject.h =================================================================== --- trunk/numpy/core/include/numpy/ufuncobject.h 2008-04-26 23:29:01 UTC (rev 5100) +++ trunk/numpy/core/include/numpy/ufuncobject.h 2008-04-26 23:36:55 UTC (rev 5101) @@ -174,8 +174,8 @@ #if NPY_ALLOW_THREADS -#define NPY_LOOP_BEGIN_THREADS if (!(loop->obj)) {_save = PyEval_SaveThread();} -#define NPY_LOOP_END_THREADS if (!(loop->obj)) {PyEval_RestoreThread(_save);} +#define NPY_LOOP_BEGIN_THREADS do {if (!(loop->obj)) _save = PyEval_SaveThread();} while (0) +#define NPY_LOOP_END_THREADS do {if (!(loop->obj)) PyEval_RestoreThread(_save);} while (0) #else #define NPY_LOOP_BEGIN_THREADS #define NPY_LOOP_END_THREADS @@ -213,12 +213,12 @@ #define UFUNC_PYVALS_NAME "UFUNC_PYVALS" #define UFUNC_CHECK_ERROR(arg) \ - if (((arg)->obj && PyErr_Occurred()) || \ + do {if (((arg)->obj && PyErr_Occurred()) || \ ((arg)->errormask && \ PyUFunc_checkfperr((arg)->errormask, \ (arg)->errobj, \ &(arg)->first))) \ - goto fail + goto fail;} while (0) /* This code checks the IEEE status flags in a platform-dependent way */ /* Adapted from Numarray */ From numpy-svn at scipy.org Sun Apr 27 11:27:32 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 27 Apr 2008 10:27:32 -0500 (CDT) Subject: [Numpy-svn] r5102 - in trunk/numpy/linalg: . tests Message-ID: <20080427152732.25F7CC7C021@new.scipy.org> Author: charris Date: 2008-04-27 10:27:30 -0500 (Sun, 27 Apr 2008) New Revision: 5102 Modified: trunk/numpy/linalg/linalg.py trunk/numpy/linalg/tests/test_linalg.py Log: Make functions in linalg.py accept nestes lists. Use wrap to keep matrix environment intact. Base patch from nmb. Modified: trunk/numpy/linalg/linalg.py =================================================================== --- trunk/numpy/linalg/linalg.py 2008-04-26 23:36:55 UTC (rev 5101) +++ trunk/numpy/linalg/linalg.py 2008-04-27 15:27:30 UTC (rev 5102) @@ -148,10 +148,10 @@ Parameters ---------- - a : array, shape b.shape+Q + a : array-like, shape b.shape+Q Coefficient tensor. Shape Q of the rightmost indices of a must be such that a is 'square', ie., prod(Q) == prod(b.shape). - b : array, any shape + b : array-like, any shape Right-hand tensor. axes : tuple of integers Axes in a to reorder to the right, before inversion. @@ -192,7 +192,7 @@ a = a.reshape(-1, prod) b = b.ravel() - res = solve(a, b) + res = wrap(solve(a, b)) res.shape = oldshape return res @@ -201,8 +201,8 @@ Parameters ---------- - a : array, shape (M, M) - b : array, shape (M,) + a : array-like, shape (M, M) + b : array-like, shape (M,) Returns ------- @@ -211,6 +211,8 @@ Raises LinAlgError if a is singular or not square """ + a, _ = _makearray(a) + b, wrap = _makearray(b) one_eq = len(b.shape) == 1 if one_eq: b = b[:, newaxis] @@ -232,9 +234,9 @@ if results['info'] > 0: raise LinAlgError, 'Singular matrix' if one_eq: - return b.ravel().astype(result_t) + return wrap(b.ravel().astype(result_t)) else: - return b.transpose().astype(result_t) + return wrap(b.transpose().astype(result_t)) def tensorinv(a, ind=2): @@ -250,7 +252,7 @@ Parameters ---------- - a : array + a : array-like Tensor to 'invert'. Its shape must 'square', ie., prod(a.shape[:ind]) == prod(a.shape[ind:]) ind : integer > 0 @@ -340,12 +342,12 @@ Parameters ---------- - a : array, shape (M, M) + a : array-like, shape (M, M) Matrix to be decomposed Returns ------- - L : array, shape (M, M) + L : array-like, shape (M, M) Lower-triangular Cholesky factor of A Raises LinAlgError if decomposition fails @@ -363,6 +365,7 @@ [ 0.+2.j, 5.+0.j]]) """ + a, wrap = _makearray(a) _assertRank2(a) _assertSquareness(a) t, result_t = _commonType(a) @@ -379,8 +382,8 @@ Cholesky decomposition cannot be computed' s = triu(a, k=0).transpose() if (s.dtype != result_t): - return s.astype(result_t) - return s + s = s.astype(result_t) + return wrap(s) # QR decompostion @@ -392,7 +395,7 @@ Parameters ---------- - a : array, shape (M, N) + a : array-like, shape (M, N) Matrix to be decomposed mode : {'full', 'r', 'economic'} Determines what information is to be returned. 'full' is the default. @@ -413,6 +416,8 @@ The diagonal and the upper triangle of A2 contains R, while the rest of the matrix is undefined. + If a is a matrix, so are all the return values. + Raises LinAlgError if decomposition fails Notes @@ -435,6 +440,7 @@ True """ + a, wrap = _makearray(a) _assertRank2(a) m, n = a.shape t, result_t = _commonType(a) @@ -503,7 +509,7 @@ q = _fastCopyAndTranspose(result_t, a[:mn,:]) - return q, r + return wrap(q), wrap(r) # Eigenvalues @@ -514,7 +520,7 @@ Parameters ---------- - a : array, shape (M, M) + a : array-like, shape (M, M) A complex or real matrix whose eigenvalues and eigenvectors will be computed. @@ -525,6 +531,8 @@ They are not necessarily ordered, nor are they necessarily real for real matrices. + If a is a matrix, so is w. + Raises LinAlgError if eigenvalue computation does not converge See Also @@ -545,6 +553,7 @@ determinant and I is the identity matrix. """ + a, wrap = _makearray(a) _assertRank2(a) _assertSquareness(a) _assertFinite(a) @@ -585,7 +594,7 @@ result_t = _complexType(result_t) if results['info'] > 0: raise LinAlgError, 'Eigenvalues did not converge' - return w.astype(result_t) + return wrap(w.astype(result_t)) def eigvalsh(a, UPLO='L'): @@ -593,7 +602,7 @@ Parameters ---------- - a : array, shape (M, M) + a : array-like, shape (M, M) A complex or real matrix whose eigenvalues and eigenvectors will be computed. UPLO : {'L', 'U'} @@ -627,6 +636,7 @@ determinant and I is the identity matrix. """ + a, wrap = _makearray(a) _assertRank2(a) _assertSquareness(a) t, result_t = _commonType(a) @@ -663,7 +673,7 @@ iwork, liwork, 0) if results['info'] > 0: raise LinAlgError, 'Eigenvalues did not converge' - return w.astype(result_t) + return wrap(w.astype(result_t)) def _convertarray(a): t, result_t = _commonType(a) @@ -679,7 +689,7 @@ Parameters ---------- - a : array, shape (M, M) + a : array-like, shape (M, M) A complex or real 2-d array whose eigenvalues and eigenvectors will be computed. @@ -693,6 +703,8 @@ The normalized eigenvector corresponding to the eigenvalue w[i] is the column v[:,i]. + If a is a matrix, so are all the return values. + Raises LinAlgError if eigenvalue computation does not converge See Also @@ -774,7 +786,7 @@ if results['info'] > 0: raise LinAlgError, 'Eigenvalues did not converge' vt = v.transpose().astype(result_t) - return w.astype(result_t), wrap(vt) + return wrap(w.astype(result_t)), wrap(vt) def eigh(a, UPLO='L'): @@ -782,7 +794,7 @@ Parameters ---------- - a : array, shape (M, M) + a : array-like, shape (M, M) A complex Hermitian or symmetric real matrix whose eigenvalues and eigenvectors will be computed. UPLO : {'L', 'U'} @@ -798,6 +810,8 @@ The normalized eigenvector corresponding to the eigenvalue w[i] is the column v[:,i]. + If a is a matrix, then so are the return values. + Raises LinAlgError if eigenvalue computation does not converge See Also @@ -858,7 +872,7 @@ if results['info'] > 0: raise LinAlgError, 'Eigenvalues did not converge' at = a.transpose().astype(result_t) - return w.astype(_realType(result_t)), wrap(at) + return wrap(w.astype(_realType(result_t))), wrap(at) # Singular value decomposition @@ -873,13 +887,13 @@ Parameters ---------- - a : array, shape (M, N) + a : array-like, shape (M, N) Matrix to decompose full_matrices : boolean If true, U, Vh are shaped (M,M), (N,N) If false, the shapes are (M,K), (K,N) where K = min(M,N) compute_uv : boolean - Whether to compute also U, Vh in addition to s + Whether to compute U and Vh in addition to s Returns ------- @@ -889,7 +903,7 @@ K = min(M, N) Vh: array, shape (N,N) or (K,N) depending on full_matrices - For compute_uv = False, only s is returned. + If a is a matrix, so are all the return values. Raises LinAlgError if SVD computation does not converge @@ -965,9 +979,9 @@ if compute_uv: u = u.transpose().astype(result_t) vt = vt.transpose().astype(result_t) - return wrap(u), s, wrap(vt) + return wrap(u), wrap(s), wrap(vt) else: - return s + return wrap(s) def cond(x,p=None): """Compute the condition number of a matrix. @@ -978,7 +992,7 @@ Parameters ---------- - x : array, shape (M, N) + x : array-like, shape (M, N) The matrix whose condition number is sought. p : {None, 1, -1, 2, -2, inf, -inf, 'fro'} Order of the norm: @@ -1017,7 +1031,7 @@ Parameters ---------- - a : array, shape (M, N) + a : array-like, shape (M, N) Matrix to be pseudo-inverted rcond : float Cutoff for 'small' singular values. @@ -1027,6 +1041,7 @@ Returns ------- B : array, shape (N, M) + If a is a matrix, then so is B. Raises LinAlgError if SVD computation does not converge @@ -1053,8 +1068,8 @@ s[i] = 1./s[i] else: s[i] = 0.; - return wrap(dot(transpose(vt), - multiply(s[:, newaxis],transpose(u)))) + res = dot(transpose(vt), multiply(s[:, newaxis],transpose(u))) + return wrap(res) # Determinant @@ -1063,7 +1078,7 @@ Parameters ---------- - a : array, shape (M, M) + a : array-like, shape (M, M) Returns ------- @@ -1104,8 +1119,8 @@ Parameters ---------- - a : array, shape (M, N) - b : array, shape (M,) or (M, K) + a : array-like, shape (M, N) + b : array-like, shape (M,) or (M, K) rcond : float Cutoff for 'small' singular values. Singular values smaller than rcond*largest_singular_value are @@ -1125,6 +1140,10 @@ Rank of matrix a s : array, shape (min(M,N),) Singular values of a + + If b is a matrix, then all results except the rank are also returned as + matrices. + """ import math a = asarray(a) @@ -1188,14 +1207,14 @@ if results['rank'] == n and m > n: resids = sum((transpose(bstar)[n:,:])**2, axis=0).astype(result_t) st = s[:min(n, m)].copy().astype(_realType(result_t)) - return wrap(x), resids, results['rank'], st + return wrap(x), wrap(resids), results['rank'], wrap(st) def norm(x, ord=None): """Matrix or vector norm. Parameters ---------- - x : array, shape (M,) or (M, N) + x : array-like, shape (M,) or (M, N) ord : number, or {None, 1, -1, 2, -2, inf, -inf, 'fro'} Order of the norm: Modified: trunk/numpy/linalg/tests/test_linalg.py =================================================================== --- trunk/numpy/linalg/tests/test_linalg.py 2008-04-26 23:36:55 UTC (rev 5101) +++ trunk/numpy/linalg/tests/test_linalg.py 2008-04-27 15:27:30 UTC (rev 5102) @@ -4,14 +4,14 @@ from numpy.testing import * set_package_path() from numpy import array, single, double, csingle, cdouble, dot, identity, \ - multiply, atleast_2d, inf + multiply, atleast_2d, inf, asarray from numpy import linalg from linalg import matrix_power restore_path() old_assert_almost_equal = assert_almost_equal def assert_almost_equal(a, b, **kw): - if a.dtype.type in (single, csingle): + if asarray(a).dtype.type in (single, csingle): decimal = 6 else: decimal = 12 @@ -47,6 +47,12 @@ except linalg.LinAlgError, e: pass + def check_nonarray(self): + a = [[1,2], [3,4]] + b = [2, 1] + self.do(a,b) + + class TestSolve(LinalgTestCase): def do(self, a, b): x = linalg.solve(a, b) @@ -55,7 +61,7 @@ class TestInv(LinalgTestCase): def do(self, a, b): a_inv = linalg.inv(a) - assert_almost_equal(dot(a, a_inv), identity(a.shape[0])) + assert_almost_equal(dot(a, a_inv), identity(asarray(a).shape[0])) class TestEigvals(LinalgTestCase): def do(self, a, b): @@ -91,15 +97,15 @@ class TestPinv(LinalgTestCase): def do(self, a, b): a_ginv = linalg.pinv(a) - assert_almost_equal(dot(a, a_ginv), identity(a.shape[0])) + assert_almost_equal(dot(a, a_ginv), identity(asarray(a).shape[0])) class TestDet(LinalgTestCase): def do(self, a, b): d = linalg.det(a) - if a.dtype.type in (single, double): - ad = a.astype(double) + if asarray(a).dtype.type in (single, double): + ad = asarray(a).astype(double) else: - ad = a.astype(cdouble) + ad = asarray(a).astype(cdouble) ev = linalg.eigvals(ad) assert_almost_equal(d, multiply.reduce(ev)) @@ -108,7 +114,7 @@ u, s, vt = linalg.svd(a, 0) x, residuals, rank, sv = linalg.lstsq(a, b) assert_almost_equal(b, dot(a, x)) - assert_equal(rank, a.shape[0]) + assert_equal(rank, asarray(a).shape[0]) assert_almost_equal(sv, s) class TestMatrixPower(ParametricTestCase): From numpy-svn at scipy.org Sun Apr 27 14:19:15 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 27 Apr 2008 13:19:15 -0500 (CDT) Subject: [Numpy-svn] r5103 - in trunk/numpy/linalg: . tests Message-ID: <20080427181915.B4A4B39C130@new.scipy.org> Author: charris Date: 2008-04-27 13:19:12 -0500 (Sun, 27 Apr 2008) New Revision: 5103 Modified: trunk/numpy/linalg/linalg.py trunk/numpy/linalg/tests/test_linalg.py Log: Add tests for matrix return types. Fix cond computations for matrices. lstsq is currently broken for matrices, will fix shortly. Modified: trunk/numpy/linalg/linalg.py =================================================================== --- trunk/numpy/linalg/linalg.py 2008-04-27 15:27:30 UTC (rev 5102) +++ trunk/numpy/linalg/linalg.py 2008-04-27 18:19:12 UTC (rev 5103) @@ -27,7 +27,7 @@ isfinite, size from numpy.lib import triu from numpy.linalg import lapack_lite -from numpy.core.defmatrix import matrix_power +from numpy.core.defmatrix import matrix_power, matrix fortran_int = intc @@ -983,7 +983,7 @@ else: return wrap(s) -def cond(x,p=None): +def cond(x, p=None): """Compute the condition number of a matrix. The condition number of x is the norm of x times the norm @@ -1014,6 +1014,7 @@ c : float The condition number of the matrix. May be infinite. """ + x = asarray(x) # in case we have a matrix if p is None: s = svd(x,compute_uv=False) return s[0]/s[-1] @@ -1146,7 +1147,7 @@ """ import math - a = asarray(a) + a = _makearray(a) b, wrap = _makearray(b) one_eq = len(b.shape) == 1 if one_eq: Modified: trunk/numpy/linalg/tests/test_linalg.py =================================================================== --- trunk/numpy/linalg/tests/test_linalg.py 2008-04-27 15:27:30 UTC (rev 5102) +++ trunk/numpy/linalg/tests/test_linalg.py 2008-04-27 18:19:12 UTC (rev 5103) @@ -3,13 +3,19 @@ from numpy.testing import * set_package_path() -from numpy import array, single, double, csingle, cdouble, dot, identity, \ - multiply, atleast_2d, inf, asarray +from numpy import array, single, double, csingle, cdouble, dot, identity +from numpy import multiply, atleast_2d, inf, asarray, matrix from numpy import linalg from linalg import matrix_power restore_path() +def ifthen(a, b): + return not a or b + old_assert_almost_equal = assert_almost_equal +def imply(a, b): + return not a or b + def assert_almost_equal(a, b, **kw): if asarray(a).dtype.type in (single, csingle): decimal = 6 @@ -52,41 +58,63 @@ b = [2, 1] self.do(a,b) + def check_matrix_b_only(self): + """Check that matrix type is preserved.""" + a = array([[1.,2.], [3.,4.]]) + b = matrix([2., 1.]).T + self.do(a, b) + def check_matrix_a_and_b(self): + """Check that matrix type is preserved.""" + a = matrix([[1.,2.], [3.,4.]]) + b = matrix([2., 1.]).T + self.do(a, b) + + class TestSolve(LinalgTestCase): def do(self, a, b): x = linalg.solve(a, b) assert_almost_equal(b, dot(a, x)) + assert imply(isinstance(b, matrix), isinstance(x, matrix)) class TestInv(LinalgTestCase): def do(self, a, b): a_inv = linalg.inv(a) assert_almost_equal(dot(a, a_inv), identity(asarray(a).shape[0])) + assert imply(isinstance(a, matrix), isinstance(a_inv, matrix)) class TestEigvals(LinalgTestCase): def do(self, a, b): ev = linalg.eigvals(a) evalues, evectors = linalg.eig(a) assert_almost_equal(ev, evalues) + assert imply(isinstance(a, matrix), isinstance(ev, matrix)) class TestEig(LinalgTestCase): def do(self, a, b): evalues, evectors = linalg.eig(a) - assert_almost_equal(dot(a, evectors), evectors*evalues) + assert_almost_equal(dot(a, evectors), multiply(evectors, evalues)) + assert imply(isinstance(a, matrix), isinstance(evalues, matrix)) + assert imply(isinstance(a, matrix), isinstance(evectors, matrix)) class TestSVD(LinalgTestCase): def do(self, a, b): u, s, vt = linalg.svd(a, 0) - assert_almost_equal(a, dot(u*s, vt)) + assert_almost_equal(a, dot(multiply(u, s), vt)) + assert imply(isinstance(a, matrix), isinstance(u, matrix)) + assert imply(isinstance(a, matrix), isinstance(s, matrix)) + assert imply(isinstance(a, matrix), isinstance(vt, matrix)) class TestCondSVD(LinalgTestCase): def do(self, a, b): - s = linalg.svd(a, compute_uv=False) + c = asarray(a) # a might be a matrix + s = linalg.svd(c, compute_uv=False) old_assert_almost_equal(s[0]/s[-1], linalg.cond(a), decimal=5) class TestCond2(LinalgTestCase): def do(self, a, b): - s = linalg.svd(a, compute_uv=False) + c = asarray(a) # a might be a matrix + s = linalg.svd(c, compute_uv=False) old_assert_almost_equal(s[0]/s[-1], linalg.cond(a,2), decimal=5) class TestCondInf(NumpyTestCase): @@ -98,6 +126,7 @@ def do(self, a, b): a_ginv = linalg.pinv(a) assert_almost_equal(dot(a, a_ginv), identity(asarray(a).shape[0])) + assert imply(isinstance(a, matrix), isinstance(a_ginv, matrix)) class TestDet(LinalgTestCase): def do(self, a, b): @@ -116,6 +145,9 @@ assert_almost_equal(b, dot(a, x)) assert_equal(rank, asarray(a).shape[0]) assert_almost_equal(sv, s) + assert imply(isinstance(b, matrix), isinstance(x, matrix)) + assert imply(isinstance(b, matrix), isinstance(residuals, matrix)) + assert imply(isinstance(b, matrix), isinstance(sv, matrix)) class TestMatrixPower(ParametricTestCase): R90 = array([[0,1],[-1,0]]) From numpy-svn at scipy.org Sun Apr 27 14:44:49 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Sun, 27 Apr 2008 13:44:49 -0500 (CDT) Subject: [Numpy-svn] r5104 - in trunk/numpy/linalg: . tests Message-ID: <20080427184449.49E1839C14D@new.scipy.org> Author: charris Date: 2008-04-27 13:44:47 -0500 (Sun, 27 Apr 2008) New Revision: 5104 Modified: trunk/numpy/linalg/linalg.py trunk/numpy/linalg/tests/test_linalg.py Log: Fix test of lstsqr to work with matrix tests. Fix lstsq Modified: trunk/numpy/linalg/linalg.py =================================================================== --- trunk/numpy/linalg/linalg.py 2008-04-27 18:19:12 UTC (rev 5103) +++ trunk/numpy/linalg/linalg.py 2008-04-27 18:44:47 UTC (rev 5104) @@ -1147,10 +1147,10 @@ """ import math - a = _makearray(a) + a, _ = _makearray(a) b, wrap = _makearray(b) - one_eq = len(b.shape) == 1 - if one_eq: + is_1d = len(b.shape) == 1 + if is_1d: b = b[:, newaxis] _assertRank2(a, b) m = a.shape[0] @@ -1199,7 +1199,7 @@ if results['info'] > 0: raise LinAlgError, 'SVD did not converge in Linear Least Squares' resids = array([], t) - if one_eq: + if is_1d: x = array(ravel(bstar)[:n], dtype=result_t, copy=True) if results['rank'] == n and m > n: resids = array([sum((ravel(bstar)[n:])**2)], dtype=result_t) Modified: trunk/numpy/linalg/tests/test_linalg.py =================================================================== --- trunk/numpy/linalg/tests/test_linalg.py 2008-04-27 18:19:12 UTC (rev 5103) +++ trunk/numpy/linalg/tests/test_linalg.py 2008-04-27 18:44:47 UTC (rev 5104) @@ -144,7 +144,7 @@ x, residuals, rank, sv = linalg.lstsq(a, b) assert_almost_equal(b, dot(a, x)) assert_equal(rank, asarray(a).shape[0]) - assert_almost_equal(sv, s) + assert_almost_equal(sv, sv.__array_wrap__(s)) assert imply(isinstance(b, matrix), isinstance(x, matrix)) assert imply(isinstance(b, matrix), isinstance(residuals, matrix)) assert imply(isinstance(b, matrix), isinstance(sv, matrix)) From numpy-svn at scipy.org Mon Apr 28 03:36:03 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 28 Apr 2008 02:36:03 -0500 (CDT) Subject: [Numpy-svn] r5105 - trunk Message-ID: <20080428073603.1EF2939C231@new.scipy.org> Author: stefan Date: 2008-04-28 02:35:55 -0500 (Mon, 28 Apr 2008) New Revision: 5105 Modified: trunk/site.cfg.example Log: Site.cfg can still have DEFAULT section (closes #751). Modified: trunk/site.cfg.example =================================================================== --- trunk/site.cfg.example 2008-04-27 18:44:47 UTC (rev 5104) +++ trunk/site.cfg.example 2008-04-28 07:35:55 UTC (rev 5105) @@ -55,7 +55,7 @@ # This is a good place to add general library and include directories like # /usr/local/{lib,include} # -#[ALL] +#[DEFAULT] #library_dirs = /usr/local/lib #include_dirs = /usr/local/include From numpy-svn at scipy.org Mon Apr 28 04:14:18 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 28 Apr 2008 03:14:18 -0500 (CDT) Subject: [Numpy-svn] r5106 - trunk/numpy/linalg Message-ID: <20080428081418.9D69139C4C5@new.scipy.org> Author: stefan Date: 2008-04-28 03:14:06 -0500 (Mon, 28 Apr 2008) New Revision: 5106 Added: trunk/numpy/linalg/python_xerbla.c Removed: trunk/numpy/linalg/pythonxerbla.c Modified: trunk/numpy/linalg/setup.py Log: Rename and reformat pythonxerbla. Copied: trunk/numpy/linalg/python_xerbla.c (from rev 5084, trunk/numpy/linalg/pythonxerbla.c) =================================================================== --- trunk/numpy/linalg/pythonxerbla.c 2008-04-25 17:31:19 UTC (rev 5084) +++ trunk/numpy/linalg/python_xerbla.c 2008-04-28 08:14:06 UTC (rev 5106) @@ -0,0 +1,36 @@ +#include "Python.h" +#include "f2c.h" + +/* + From the original manpage: + -------------------------- + XERBLA is an error handler for the LAPACK routines. + It is called by an LAPACK routine if an input parameter has an invalid value. + A message is printed and execution stops. + + Instead of printing a message and stopping the execution, a + ValueError is raised with the message. + + Parameters: + ----------- + srname: Subroutine name to use in error message, maximum six characters. + Spaces at the end are skipped. + info: Number of the invalid parameter. +*/ + +int xerbla_(char *srname, integer *info) +{ + const char* format = "On entry to %.*s" \ + " parameter number %d had an illegal value"; + char buf[strlen(format) + 6 + 4]; /* 6 for name, 4 for param. num. */ + + int len = 0; /* length of subroutine name*/ + while( len<6 && srname[len]!='\0' ) + len++; + while( len && srname[len-1]==' ' ) + len--; + + snprintf(buf, sizeof(buf), format, len, srname, *info); + PyErr_SetString(PyExc_ValueError, buf); + return 0; +} Deleted: trunk/numpy/linalg/pythonxerbla.c =================================================================== --- trunk/numpy/linalg/pythonxerbla.c 2008-04-28 07:35:55 UTC (rev 5105) +++ trunk/numpy/linalg/pythonxerbla.c 2008-04-28 08:14:06 UTC (rev 5106) @@ -1,33 +0,0 @@ -#include "Python.h" -#include "f2c.h" - -/* - From the original manpage: - XERBLA is an error handler for the LAPACK routines. - It is called by an LAPACK routine if an input parameter has an invalid value. - A message is printed and execution stops. - - Instead of printing a message and stopping the execution, a - ValueError is raised with the message. - - Parameters: - srname: Subroutine name to use in error message, maximum six characters. - Spaces at the end are skipped. - info: Number of the invalid parameter. -*/ - -int xerbla_(char *srname, integer *info) -{ - char format[] = "On entry to %.*s" \ - " parameter number %d had an illegal value"; - char buf[70]; /* 6 for name, 4 for param. num. */ - - int len = 0; /* length of subroutine name*/ - while( len<6 && srname[len]!='\0' ) - len++; - while( len && srname[len-1]==' ' ) - len--; - snprintf(buf, sizeof(buf), format, len, srname, *info); - PyErr_SetString(PyExc_ValueError, buf); - return 0; -} Modified: trunk/numpy/linalg/setup.py =================================================================== --- trunk/numpy/linalg/setup.py 2008-04-28 07:35:55 UTC (rev 5105) +++ trunk/numpy/linalg/setup.py 2008-04-28 08:14:06 UTC (rev 5106) @@ -16,14 +16,14 @@ return ext.depends[:-1] else: if sys.platform=='win32': - print "### Warning: pythonxerbla.c is disabled ###" + print "### Warning: python_xerbla.c is disabled ###" return ext.depends[:1] return ext.depends[:2] config.add_extension('lapack_lite', sources = [get_lapack_lite_sources], depends= ['lapack_litemodule.c', - 'pythonxerbla.c', + 'python_xerbla.c', 'zlapack_lite.c', 'dlapack_lite.c', 'blas_lite.c', 'dlamch.c', 'f2c_lite.c','f2c.h'], From numpy-svn at scipy.org Mon Apr 28 19:07:15 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 28 Apr 2008 18:07:15 -0500 (CDT) Subject: [Numpy-svn] r5107 - trunk/numpy/core/src Message-ID: <20080428230715.BB3AC39C0BA@new.scipy.org> Author: charris Date: 2008-04-28 18:07:12 -0500 (Mon, 28 Apr 2008) New Revision: 5107 Modified: trunk/numpy/core/src/arrayobject.c Log: Code style cleanups. Modified: trunk/numpy/core/src/arrayobject.c =================================================================== --- trunk/numpy/core/src/arrayobject.c 2008-04-28 08:14:06 UTC (rev 5106) +++ trunk/numpy/core/src/arrayobject.c 2008-04-28 23:07:12 UTC (rev 5107) @@ -19,10 +19,11 @@ Space Science Telescope Institute (J. Todd Miller, Perry Greenfield, Rick White) */ +/*#include */ /*OBJECT_API - Get Priority from object -*/ + * Get Priority from object + */ static double PyArray_GetPriority(PyObject *obj, double default_) { @@ -6998,22 +6999,30 @@ static int discover_depth(PyObject *s, int max, int stop_at_string, int stop_at_tuple) { - int d=0; + int d = 0; PyObject *e; - if(max < 1) return -1; - - if(! PySequence_Check(s) || PyInstance_Check(s) || \ - PySequence_Length(s) < 0) { - PyErr_Clear(); return 0; + if(max < 1) { + return -1; } - if (PyArray_Check(s)) + if(!PySequence_Check(s) || PyInstance_Check(s) || + PySequence_Length(s) < 0) { + PyErr_Clear(); + return 0; + } + if (PyArray_Check(s)) { return PyArray_NDIM(s); - if (PyArray_IsScalar(s, Generic)) return 0; - if (PyString_Check(s) || PyBuffer_Check(s) || PyUnicode_Check(s)) + } + if (PyArray_IsScalar(s, Generic)) { + return 0; + } + if (PyString_Check(s) || PyBuffer_Check(s) || PyUnicode_Check(s)) { return stop_at_string ? 0:1; - if (stop_at_tuple && PyTuple_Check(s)) return 0; - if ((e=PyObject_GetAttrString(s, "__array_struct__")) != NULL) { + } + if (stop_at_tuple && PyTuple_Check(s)) { + return 0; + } + if ((e = PyObject_GetAttrString(s, "__array_struct__")) != NULL) { d = -1; if (PyCObject_Check(e)) { PyArrayInterface *inter; @@ -7023,29 +7032,41 @@ } } Py_DECREF(e); - if (d > -1) return d; + if (d > -1) { + return d; + } } - else PyErr_Clear(); + else { + PyErr_Clear(); + } if ((e=PyObject_GetAttrString(s, "__array_interface__")) != NULL) { d = -1; if (PyDict_Check(e)) { PyObject *new; new = PyDict_GetItemString(e, "shape"); - if (new && PyTuple_Check(new)) + if (new && PyTuple_Check(new)) { d = PyTuple_GET_SIZE(new); + } } Py_DECREF(e); - if (d>-1) return d; + if (d>-1) { + return d; + } } else PyErr_Clear(); - if (PySequence_Length(s) == 0) + if (PySequence_Length(s) == 0) { return 1; - if ((e=PySequence_GetItem(s,0)) == NULL) return -1; - if(e!=s) { - d=discover_depth(e, max-1, stop_at_string, stop_at_tuple); - if(d >= 0) d++; } + if ((e=PySequence_GetItem(s,0)) == NULL) { + return -1; + } + if (e != s) { + d = discover_depth(e, max-1, stop_at_string, stop_at_tuple); + if (d >= 0) { + d++; + } + } Py_DECREF(e); return d; } @@ -7058,24 +7079,28 @@ n = PyObject_Length(s); - if ((nd == 0) || PyString_Check(s) || \ - PyUnicode_Check(s) || PyBuffer_Check(s)) { + if ((nd == 0) || PyString_Check(s) || + PyUnicode_Check(s) || PyBuffer_Check(s)) { *itemsize = MAX(*itemsize, n); return 0; } - for(i=0; i n_lower) n_lower = d[1]; + if (d[1] > n_lower) { + n_lower = d[1]; + } } d[1] = n_lower; return 0; } -/* new reference */ -/* doesn't alter refcount of chktype or mintype --- - unless one of them is returned */ +/* + * new reference + * doesn't alter refcount of chktype or mintype --- + * unless one of them is returned + */ static PyArray_Descr * _array_small_type(PyArray_Descr *chktype, PyArray_Descr* mintype) { @@ -7596,6 +7633,7 @@ { PyArrayObject *r; int nd; + int err; intp d[MAX_DIMS]; int stop_at_string; int stop_at_tuple; @@ -7611,43 +7649,41 @@ stop_at_tuple = (type == PyArray_VOID && (typecode->names \ || typecode->subarray)); - if (!((nd=discover_depth(s, MAX_DIMS+1, stop_at_string, - stop_at_tuple)) > 0)) { - if (nd==0) { - return Array_FromPyScalar(s, typecode); - } + nd = discover_depth(s, MAX_DIMS + 1, stop_at_string, stop_at_tuple); + if (nd == 0) { + return Array_FromPyScalar(s, typecode); + } + else if (nd < 0) { PyErr_SetString(PyExc_ValueError, - "invalid input sequence"); + "invalid input sequence"); goto fail; } - if (max_depth && PyTypeNum_ISOBJECT(type) && (nd > max_depth)) { nd = max_depth; } - - if ((max_depth && nd > max_depth) || \ - (min_depth && nd < min_depth)) { + if ((max_depth && nd > max_depth) || (min_depth && nd < min_depth)) { PyErr_SetString(PyExc_ValueError, - "invalid number of dimensions"); + "invalid number of dimensions"); goto fail; } - if(discover_dimensions(s,nd,d, check_it) == -1) { + err = discover_dimensions(s, nd, d, check_it); + if (err == -1) { goto fail; } - if (typecode->type == PyArray_CHARLTR && nd > 0 && d[nd-1]==1) { - nd = nd-1; + if (typecode->type == PyArray_CHARLTR && nd > 0 && d[nd - 1] == 1) { + nd = nd - 1; } if (itemsize == 0 && PyTypeNum_ISEXTENDED(type)) { - if (discover_itemsize(s, nd, &itemsize) == -1) { + err = discover_itemsize(s, nd, &itemsize); + if (err == -1) { goto fail; } if (type == PyArray_UNICODE) { - itemsize*=4; + itemsize *= 4; } } - if (itemsize != typecode->elsize) { PyArray_DESCR_REPLACE(typecode); typecode->elsize = itemsize; @@ -7657,11 +7693,12 @@ nd, d, NULL, NULL, fortran, NULL); - if (!r) { return NULL; } - if(Assign_Array(r,s) == -1) { + + err = Assign_Array(r,s); + if (err == -1) { Py_DECREF(r); return NULL; } From numpy-svn at scipy.org Mon Apr 28 19:27:20 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 28 Apr 2008 18:27:20 -0500 (CDT) Subject: [Numpy-svn] r5108 - in trunk/numpy/lib: . tests Message-ID: <20080428232720.1675F39C04B@new.scipy.org> Author: stefan Date: 2008-04-28 18:27:11 -0500 (Mon, 28 Apr 2008) New Revision: 5108 Modified: trunk/numpy/lib/io.py trunk/numpy/lib/tests/test_io.py Log: Support for multi formatting elements in savetxt [patch by David Huard]. Closes #663. Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2008-04-28 23:07:12 UTC (rev 5107) +++ trunk/numpy/lib/io.py 2008-04-28 23:27:11 UTC (rev 5108) @@ -1,4 +1,3 @@ - __all__ = ['savetxt', 'loadtxt', 'load', 'loads', 'save', 'savez', @@ -322,7 +321,6 @@ else: return X -# adjust so that fmt can change across columns if desired. def savetxt(fname, X, fmt='%.18e',delimiter=' '): """ @@ -332,49 +330,55 @@ Parameters ---------- fname : filename or a file handle - If the filename ends in .gz, the file is automatically saved in - compressed gzip format. The load() command understands gzipped files - transparently. + If the filename ends in .gz, the file is automatically saved in + compressed gzip format. The load() command understands gzipped + files transparently. X : array or sequence - Data to write to file. - fmt : string - A format string %[flags][width][.precision]specifier. See notes below for - a description of some common flags and specifiers. + Data to write to file. + fmt : string or sequence of strings + A single format (%10.5f), a sequence of formats, or a + multi-format string, e.g. 'Iteration %d -- %10.5f', in which + case delimiter is ignored. delimiter : str - Character separating columns. + Character separating columns. Examples -------- - >>> savetxt('test.out', x, delimiter=',') # X is an array - >>> savetxt('test.out', (x,y,z)) # x,y,z equal sized 1D arrays - >>> savetxt('test.out', x, fmt='%1.4e') # use exponential notation + >>> savetxt('test.out', x, delimiter=',') # X is an array + >>> savetxt('test.out', (x,y,z)) # x,y,z equal sized 1D arrays + >>> savetxt('test.out', x, fmt='%1.4e') # use exponential notation Notes on fmt ------------ flags: - - : left justify - + : Forces to preceed result with + or -. - 0 : Left pad the number with zeros instead of space (see width). + - : left justify + + : Forces to preceed result with + or -. + 0 : Left pad the number with zeros instead of space (see width). + width: - Minimum number of characters to be printed. The value is not truncated. + Minimum number of characters to be printed. The value is not truncated. + precision: - For integer specifiers (eg. d,i,o,x), the minimum number of digits. - For e, E and f specifiers, the number of digits to print after the decimal - point. - For g and G, the maximum number of significant digits. - For s, the maximum number of characters. + - For integer specifiers (eg. d,i,o,x), the minimum number of + digits. + - For e, E and f specifiers, the number of digits to print + after the decimal point. + - For g and G, the maximum number of significant digits. + - For s, the maximum number of charac ters. + specifiers: - c : character - d or i : signed decimal integer - e or E : scientific notation with e or E. - f : decimal floating point - g,G : use the shorter of e,E or f - o : signed octal - s : string of characters - u : unsigned decimal integer - x,X : unsigned hexadecimal integer + c : character + d or i : signed decimal integer + e or E : scientific notation with e or E. + f : decimal floating point + g,G : use the shorter of e,E or f + o : signed octal + s : string of characters + u : unsigned decimal integer + x,X : unsigned hexadecimal integer This is not an exhaustive specification. + """ if _string_like(fname): @@ -388,18 +392,34 @@ else: raise ValueError('fname must be a string or file handle') + X = np.asarray(X) + if X.ndim == 1: + if X.dtype.names is None: + X = np.atleast_2d(X).T + ncol = 1 + else: + ncol = len(X.dtype.descr) + else: + ncol = X.shape[1] - X = np.asarray(X) - origShape = None - if len(X.shape)==1 and X.dtype.names is None: - origShape = X.shape - X.shape = len(X), 1 + # Fmt can be a string with multiple insertion points or a list of formats. + # E.g. '%10.5f\t%10d' or ('%10.5f', '$10d') + if type(fmt) in (list, tuple): + if len(fmt) != ncol: + raise AttributeError, 'fmt has wrong shape. '+ str(fmt) + format = delimiter.join(fmt) + elif type(fmt) is str: + if fmt.count('%') == 1: + fmt = [fmt,]*ncol + format = delimiter.join(fmt) + elif fmt.count('%') != ncol: + raise AttributeError, 'fmt has wrong number of % formats. ' + fmt + else: + format = fmt + for row in X: - fh.write(delimiter.join([fmt%val for val in row]) + '\n') + fh.write(format%tuple(row) + '\n') - if origShape is not None: - X.shape = origShape - import re def fromregex(file, regexp, dtype): """Construct a record array from a text file, using regular-expressions parsing. Modified: trunk/numpy/lib/tests/test_io.py =================================================================== --- trunk/numpy/lib/tests/test_io.py 2008-04-28 23:07:12 UTC (rev 5107) +++ trunk/numpy/lib/tests/test_io.py 2008-04-28 23:27:11 UTC (rev 5108) @@ -39,30 +39,29 @@ c.seek(0) assert_equal(c.readlines(), ['1,2\n', '3,4\n']) + def test_format(self): + a = np.array([(1, 2), (3, 4)]) + c = StringIO.StringIO() + # Sequence of formats + np.savetxt(c, a, fmt=['%02d', '%3.1f']) + c.seek(0) + assert_equal(c.readlines(), ['01 2.0\n', '03 4.0\n']) -## def test_format(self): -## a = np.array([(1, 2), (3, 4)]) -## c = StringIO.StringIO() -## # Sequence of formats -## np.savetxt(c, a, fmt=['%02d', '%3.1f']) -## c.seek(0) -## assert_equal(c.readlines(), ['01 2.0\n', '03 4.0\n']) -## -## # A single multiformat string -## c = StringIO.StringIO() -## np.savetxt(c, a, fmt='%02d : %3.1f') -## c.seek(0) -## lines = c.readlines() -## assert_equal(lines, ['01 : 2.0\n', '03 : 4.0\n']) -## -## # Specify delimiter, should be overiden -## c = StringIO.StringIO() -## np.savetxt(c, a, fmt='%02d : %3.1f', delimiter=',') -## c.seek(0) -## lines = c.readlines() -## assert_equal(lines, ['01 : 2.0\n', '03 : 4.0\n']) + # A single multiformat string + c = StringIO.StringIO() + np.savetxt(c, a, fmt='%02d : %3.1f') + c.seek(0) + lines = c.readlines() + assert_equal(lines, ['01 : 2.0\n', '03 : 4.0\n']) + # Specify delimiter, should be overiden + c = StringIO.StringIO() + np.savetxt(c, a, fmt='%02d : %3.1f', delimiter=',') + c.seek(0) + lines = c.readlines() + assert_equal(lines, ['01 : 2.0\n', '03 : 4.0\n']) + class TestLoadTxt(NumpyTestCase): def test_record(self): c = StringIO.StringIO() From numpy-svn at scipy.org Mon Apr 28 19:41:56 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 28 Apr 2008 18:41:56 -0500 (CDT) Subject: [Numpy-svn] r5109 - trunk/numpy/lib Message-ID: <20080428234156.D4B6939C199@new.scipy.org> Author: stefan Date: 2008-04-28 18:41:48 -0500 (Mon, 28 Apr 2008) New Revision: 5109 Modified: trunk/numpy/lib/io.py Log: Add comments to savetxt. Modified: trunk/numpy/lib/io.py =================================================================== --- trunk/numpy/lib/io.py 2008-04-28 23:27:11 UTC (rev 5108) +++ trunk/numpy/lib/io.py 2008-04-28 23:41:48 UTC (rev 5109) @@ -393,32 +393,38 @@ raise ValueError('fname must be a string or file handle') X = np.asarray(X) + + # Handle 1-dimensional arrays if X.ndim == 1: + # Common case -- 1d array of numbers if X.dtype.names is None: X = np.atleast_2d(X).T ncol = 1 + + # Complex dtype -- each field indicates a separate column else: ncol = len(X.dtype.descr) else: ncol = X.shape[1] - # Fmt can be a string with multiple insertion points or a list of formats. + # `fmt` can be a string with multiple insertion points or a list of formats. # E.g. '%10.5f\t%10d' or ('%10.5f', '$10d') if type(fmt) in (list, tuple): if len(fmt) != ncol: - raise AttributeError, 'fmt has wrong shape. '+ str(fmt) + raise AttributeError('fmt has wrong shape. %s' % str(fmt)) format = delimiter.join(fmt) elif type(fmt) is str: if fmt.count('%') == 1: fmt = [fmt,]*ncol format = delimiter.join(fmt) elif fmt.count('%') != ncol: - raise AttributeError, 'fmt has wrong number of % formats. ' + fmt + raise AttributeError('fmt has wrong number of %% formats. %s' + % fmt) else: format = fmt for row in X: - fh.write(format%tuple(row) + '\n') + fh.write(format % tuple(row) + '\n') import re def fromregex(file, regexp, dtype): From numpy-svn at scipy.org Mon Apr 28 20:13:32 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 28 Apr 2008 19:13:32 -0500 (CDT) Subject: [Numpy-svn] r5110 - trunk/numpy/linalg Message-ID: <20080429001332.E8B5839C054@new.scipy.org> Author: stefan Date: 2008-04-28 19:13:25 -0500 (Mon, 28 Apr 2008) New Revision: 5110 Modified: trunk/numpy/linalg/python_xerbla.c Log: Fix python_xerbla for compilers that do not have inline strlen defined. Modified: trunk/numpy/linalg/python_xerbla.c =================================================================== --- trunk/numpy/linalg/python_xerbla.c 2008-04-28 23:41:48 UTC (rev 5109) +++ trunk/numpy/linalg/python_xerbla.c 2008-04-29 00:13:25 UTC (rev 5110) @@ -22,7 +22,8 @@ { const char* format = "On entry to %.*s" \ " parameter number %d had an illegal value"; - char buf[strlen(format) + 6 + 4]; /* 6 for name, 4 for param. num. */ + char buf[57 + 6 + 4]; /* 57 for strlen(format), + 6 for name, 4 for param. num. */ int len = 0; /* length of subroutine name*/ while( len<6 && srname[len]!='\0' ) From numpy-svn at scipy.org Mon Apr 28 23:05:52 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Mon, 28 Apr 2008 22:05:52 -0500 (CDT) Subject: [Numpy-svn] r5111 - in trunk/numpy/linalg: . tests Message-ID: <20080429030552.573FD39C11E@new.scipy.org> Author: charris Date: 2008-04-28 22:05:50 -0500 (Mon, 28 Apr 2008) New Revision: 5111 Modified: trunk/numpy/linalg/linalg.py trunk/numpy/linalg/tests/test_linalg.py Log: Keep singular values and eigenvalues as 1D arrays until the matrix indexing controversy is settled. This will also keep code that uses diag(ev), from breaking. Modified: trunk/numpy/linalg/linalg.py =================================================================== --- trunk/numpy/linalg/linalg.py 2008-04-29 00:13:25 UTC (rev 5110) +++ trunk/numpy/linalg/linalg.py 2008-04-29 03:05:50 UTC (rev 5111) @@ -594,7 +594,7 @@ result_t = _complexType(result_t) if results['info'] > 0: raise LinAlgError, 'Eigenvalues did not converge' - return wrap(w.astype(result_t)) + return w.astype(result_t) def eigvalsh(a, UPLO='L'): @@ -673,7 +673,7 @@ iwork, liwork, 0) if results['info'] > 0: raise LinAlgError, 'Eigenvalues did not converge' - return wrap(w.astype(result_t)) + return w.astype(result_t) def _convertarray(a): t, result_t = _commonType(a) @@ -786,7 +786,7 @@ if results['info'] > 0: raise LinAlgError, 'Eigenvalues did not converge' vt = v.transpose().astype(result_t) - return wrap(w.astype(result_t)), wrap(vt) + return w.astype(result_t), wrap(vt) def eigh(a, UPLO='L'): @@ -872,7 +872,7 @@ if results['info'] > 0: raise LinAlgError, 'Eigenvalues did not converge' at = a.transpose().astype(result_t) - return wrap(w.astype(_realType(result_t))), wrap(at) + return w.astype(_realType(result_t)), wrap(at) # Singular value decomposition @@ -979,9 +979,9 @@ if compute_uv: u = u.transpose().astype(result_t) vt = vt.transpose().astype(result_t) - return wrap(u), wrap(s), wrap(vt) + return wrap(u), s, wrap(vt) else: - return wrap(s) + return s def cond(x, p=None): """Compute the condition number of a matrix. @@ -1208,7 +1208,7 @@ if results['rank'] == n and m > n: resids = sum((transpose(bstar)[n:,:])**2, axis=0).astype(result_t) st = s[:min(n, m)].copy().astype(_realType(result_t)) - return wrap(x), wrap(resids), results['rank'], wrap(st) + return wrap(x), wrap(resids), results['rank'], st def norm(x, ord=None): """Matrix or vector norm. Modified: trunk/numpy/linalg/tests/test_linalg.py =================================================================== --- trunk/numpy/linalg/tests/test_linalg.py 2008-04-29 00:13:25 UTC (rev 5110) +++ trunk/numpy/linalg/tests/test_linalg.py 2008-04-29 03:05:50 UTC (rev 5111) @@ -88,13 +88,11 @@ ev = linalg.eigvals(a) evalues, evectors = linalg.eig(a) assert_almost_equal(ev, evalues) - assert imply(isinstance(a, matrix), isinstance(ev, matrix)) class TestEig(LinalgTestCase): def do(self, a, b): evalues, evectors = linalg.eig(a) assert_almost_equal(dot(a, evectors), multiply(evectors, evalues)) - assert imply(isinstance(a, matrix), isinstance(evalues, matrix)) assert imply(isinstance(a, matrix), isinstance(evectors, matrix)) class TestSVD(LinalgTestCase): @@ -102,7 +100,6 @@ u, s, vt = linalg.svd(a, 0) assert_almost_equal(a, dot(multiply(u, s), vt)) assert imply(isinstance(a, matrix), isinstance(u, matrix)) - assert imply(isinstance(a, matrix), isinstance(s, matrix)) assert imply(isinstance(a, matrix), isinstance(vt, matrix)) class TestCondSVD(LinalgTestCase): @@ -147,7 +144,6 @@ assert_almost_equal(sv, sv.__array_wrap__(s)) assert imply(isinstance(b, matrix), isinstance(x, matrix)) assert imply(isinstance(b, matrix), isinstance(residuals, matrix)) - assert imply(isinstance(b, matrix), isinstance(sv, matrix)) class TestMatrixPower(ParametricTestCase): R90 = array([[0,1],[-1,0]]) From numpy-svn at scipy.org Tue Apr 29 11:39:36 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Tue, 29 Apr 2008 10:39:36 -0500 (CDT) Subject: [Numpy-svn] r5112 - in trunk/numpy/lib: . tests Message-ID: <20080429153936.F40EA39C5A2@new.scipy.org> Author: cdavid Date: 2008-04-29 10:39:23 -0500 (Tue, 29 Apr 2008) New Revision: 5112 Added: trunk/numpy/lib/tests/test_machar.py Modified: trunk/numpy/lib/machar.py Log: Disable underflow warning reporting when testing for arch + test (#759). Modified: trunk/numpy/lib/machar.py =================================================================== --- trunk/numpy/lib/machar.py 2008-04-29 03:05:50 UTC (rev 5111) +++ trunk/numpy/lib/machar.py 2008-04-29 15:39:23 UTC (rev 5112) @@ -8,6 +8,7 @@ __all__ = ['MachAr'] from numpy.core.fromnumeric import any +from numpy.core.numeric import seterr # Need to speed this up...especially for longfloat @@ -58,6 +59,15 @@ float_to_str - convert array float to str title - description of used floating point numbers """ + # We ignore all errors here because we are purposely triggering + # underflow to detect the properties of the runninng arch. + saverrstate = seterr(under='ignore') + try: + self._do_init(float_conv, int_conv, float_to_float, float_to_str, title) + finally: + seterr(**saverrstate) + + def _do_init(self, float_conv, int_conv, float_to_float, float_to_str, title): max_iterN = 10000 msg = "Did not converge after %d tries with %s" one = float_conv(1) Added: trunk/numpy/lib/tests/test_machar.py =================================================================== --- trunk/numpy/lib/tests/test_machar.py 2008-04-29 03:05:50 UTC (rev 5111) +++ trunk/numpy/lib/tests/test_machar.py 2008-04-29 15:39:23 UTC (rev 5112) @@ -0,0 +1,31 @@ +from numpy.testing import NumpyTestCase, NumpyTest + +from numpy.lib.machar import MachAr +import numpy.core.numerictypes as ntypes +from numpy import seterr, array + +class TestMachAr(NumpyTestCase): + def _run_machar_highprec(self): + # Instanciate MachAr instance with high enough precision to cause + # underflow + try: + hiprec = ntypes.float96 + machar = MachAr(lambda v:array([v], hiprec)) + except AttributeError: + print "Skipping test: no nyptes.float96 available on this" \ + " platform." + + def test_underlow(self): + """Regression testing for #759: instanciating MachAr for dtype = + np.float96 raises spurious warning.""" + serrstate = seterr(all='raise') + try: + try: + self._run_machar_highprec() + except FloatingPointError, e: + self.fail("Caught %s exception, should not have been raised." % e) + finally: + seterr(**serrstate) + +if __name__ == "__main__": + NumpyTest().run() From numpy-svn at scipy.org Wed Apr 30 12:01:27 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 30 Apr 2008 11:01:27 -0500 (CDT) Subject: [Numpy-svn] r5113 - trunk/numpy/core/src Message-ID: <20080430160127.C722D39C07C@new.scipy.org> Author: oliphant Date: 2008-04-30 11:01:25 -0500 (Wed, 30 Apr 2008) New Revision: 5113 Modified: trunk/numpy/core/src/multiarraymodule.c Log: Check for error and fix spacing. Modified: trunk/numpy/core/src/multiarraymodule.c =================================================================== --- trunk/numpy/core/src/multiarraymodule.c 2008-04-29 15:39:23 UTC (rev 5112) +++ trunk/numpy/core/src/multiarraymodule.c 2008-04-30 16:01:25 UTC (rev 5113) @@ -3458,6 +3458,7 @@ /* make sure it is well-behaved */ arr = PyArray_FromAny(op, NULL, 0, 0, CARRAY, NULL); + if (arr == NULL) return NULL; nd = PyArray_NDIM(arr); if (nd == 1) { /* we will give in to old behavior */ ret = PyArray_Copy((PyArrayObject *)arr); @@ -3488,7 +3489,7 @@ } /* do 2-d loop */ NPY_BEGIN_ALLOW_THREADS; - optr = PyArray_DATA(ret); + optr = PyArray_DATA(ret); str2 = elsize*dims[0]; for (i=0; i Author: pierregm Date: 2008-04-30 14:36:42 -0500 (Wed, 30 Apr 2008) New Revision: 5114 Modified: trunk/numpy/ma/core.py trunk/numpy/ma/tests/test_core.py trunk/numpy/ma/testutils.py Log: core : fixed a bug w/ array((0,0))/0. testutils : introduced assert_almost_equal/assert_approx_equal: use assert_almost_equal(a,b,decimal) to compare a and b up to decimal places use assert_approx_equal(a,b,decimal) to compare a and b up to b*10.**-decimal Modified: trunk/numpy/ma/core.py =================================================================== --- trunk/numpy/ma/core.py 2008-04-30 16:01:25 UTC (rev 5113) +++ trunk/numpy/ma/core.py 2008-04-30 19:36:42 UTC (rev 5114) @@ -613,9 +613,8 @@ t = narray(self.domain(d1, d2), copy=False) if t.any(None): mb = mask_or(mb, t) - # The following two lines control the domain filling - d2 = d2.copy() - numpy.putmask(d2, t, self.filly) + # The following line controls the domain filling + d2 = numpy.where(t,self.filly,d2) m = mask_or(ma, mb) if (not m.ndim) and m: return masked Modified: trunk/numpy/ma/tests/test_core.py =================================================================== --- trunk/numpy/ma/tests/test_core.py 2008-04-30 16:01:25 UTC (rev 5113) +++ trunk/numpy/ma/tests/test_core.py 2008-04-30 19:36:42 UTC (rev 5114) @@ -257,6 +257,10 @@ x = array(0, mask=0) assert_equal(x.filled().ctypes.data, x.ctypes.data) assert_equal(str(xm), str(masked_print_option)) + # Make sure we don't lose the shape in some circumstances + xm = array((0,0))/0. + assert_equal(xm.shape,(2,)) + assert_equal(xm.mask,[1,1]) #......................... def test_basic_ufuncs (self): "Test various functions such as sin, cos." Modified: trunk/numpy/ma/testutils.py =================================================================== --- trunk/numpy/ma/testutils.py 2008-04-30 16:01:25 UTC (rev 5113) +++ trunk/numpy/ma/testutils.py 2008-04-30 19:36:42 UTC (rev 5114) @@ -40,6 +40,23 @@ y = filled(masked_array(d2, copy=False, mask=m), 1).astype(float_) d = N.less_equal(umath.absolute(x-y), atol + rtol * umath.absolute(y)) return d.ravel() + +def almost(a, b, decimal=6, fill_value=True): + """Returns True if a and b are equal up to decimal places. +If fill_value is True, masked values considered equal. Otherwise, masked values +are considered unequal. + """ + m = mask_or(getmask(a), getmask(b)) + d1 = filled(a) + d2 = filled(b) + if d1.dtype.char == "O" or d2.dtype.char == "O": + return N.equal(d1,d2).ravel() + x = filled(masked_array(d1, copy=False, mask=m), fill_value).astype(float_) + y = filled(masked_array(d2, copy=False, mask=m), 1).astype(float_) + d = N.around(N.abs(x-y),decimal) <= 10.0**(-decimal) + return d.ravel() + + #................................................ def _assert_equal_on_sequences(actual, desired, err_msg=''): "Asserts the equality of two non-array sequences." @@ -191,7 +208,7 @@ assert_array_compare(compare, x, y, err_msg=err_msg, header='Arrays are not equal') #............................ -def assert_array_almost_equal(x, y, decimal=6, err_msg=''): +def assert_array_approx_equal(x, y, decimal=6, err_msg=''): """Checks the elementwise equality of two masked arrays, up to a given number of decimals.""" def compare(x, y): @@ -200,6 +217,15 @@ assert_array_compare(compare, x, y, err_msg=err_msg, header='Arrays are not almost equal') #............................ +def assert_array_almost_equal(x, y, decimal=6, err_msg=''): + """Checks the elementwise equality of two masked arrays, up to a given + number of decimals.""" + def compare(x, y): + "Returns the result of the loose comparison between x and y)." + return almost(x,y,decimal) + assert_array_compare(compare, x, y, err_msg=err_msg, + header='Arrays are not almost equal') +#............................ def assert_array_less(x, y, err_msg=''): "Checks that x is smaller than y elementwise." assert_array_compare(less, x, y, err_msg=err_msg, From numpy-svn at scipy.org Wed Apr 30 18:07:19 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 30 Apr 2008 17:07:19 -0500 (CDT) Subject: [Numpy-svn] r5115 - in trunk/numpy: . core/src core/tests Message-ID: <20080430220719.EFF1339C212@new.scipy.org> Author: stefan Date: 2008-04-30 17:06:41 -0500 (Wed, 30 Apr 2008) New Revision: 5115 Modified: trunk/numpy/add_newdocs.py trunk/numpy/core/src/arraymethods.c trunk/numpy/core/tests/test_multiarray.py Log: For x.view, change dtype into keyword argument. Modified: trunk/numpy/add_newdocs.py =================================================================== --- trunk/numpy/add_newdocs.py 2008-04-30 19:36:42 UTC (rev 5114) +++ trunk/numpy/add_newdocs.py 2008-04-30 22:06:41 UTC (rev 5115) @@ -2198,15 +2198,15 @@ add_newdoc('numpy.core.multiarray', 'ndarray', ('view', - """a.view(type) + """a.view(dtype=None) New view of array with the same data. Parameters ---------- - type - Either a new sub-type object or a data-descriptor object - + dtype : sub-type or data-descriptor + Data-type of the returned view. + """)) add_newdoc('numpy.core.umath','geterrobj', Modified: trunk/numpy/core/src/arraymethods.c =================================================================== --- trunk/numpy/core/src/arraymethods.c 2008-04-30 19:36:42 UTC (rev 5114) +++ trunk/numpy/core/src/arraymethods.c 2008-04-30 22:06:41 UTC (rev 5115) @@ -101,12 +101,14 @@ } static PyObject * -array_view(PyArrayObject *self, PyObject *args) +array_view(PyArrayObject *self, PyObject *args, PyObject *kwds) { PyObject *otype=NULL; PyArray_Descr *type=NULL; - if (!PyArg_ParseTuple(args, "|O", &otype)) return NULL; + static char *kwlist[] = {"dtype", NULL}; + if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O", kwlist, &otype)) + return NULL; if (otype) { if (PyType_Check(otype) && \ @@ -1994,7 +1996,7 @@ {"var", (PyCFunction)array_variance, METH_VARARGS | METH_KEYWORDS, NULL}, {"view", (PyCFunction)array_view, - METH_VARARGS, NULL}, + METH_VARARGS | METH_KEYWORDS, NULL}, {NULL, NULL} /* sentinel */ }; Modified: trunk/numpy/core/tests/test_multiarray.py =================================================================== --- trunk/numpy/core/tests/test_multiarray.py 2008-04-30 19:36:42 UTC (rev 5114) +++ trunk/numpy/core/tests/test_multiarray.py 2008-04-30 22:06:41 UTC (rev 5115) @@ -833,6 +833,16 @@ dt.names = ['p','q'] assert_equal(dt.names,['p','q']) +class TestView(NumpyTestCase): + def test_basic(self): + x = np.array([(1,2,3,4),(5,6,7,8)],dtype=[('r',np.int8),('g',np.int8), + ('b',np.int8),('a',np.int8)]) + y = x.view(dtype=np.int32) + z = x.view(np.int32) + assert_array_equal(y,z) + assert_array_equal(y, [67305985, 134678021]) + + # Import tests without matching module names set_local_path() from test_unicode import * From numpy-svn at scipy.org Wed Apr 30 19:48:04 2008 From: numpy-svn at scipy.org (numpy-svn at scipy.org) Date: Wed, 30 Apr 2008 18:48:04 -0500 (CDT) Subject: [Numpy-svn] r5116 - trunk/numpy/core/src Message-ID: <20080430234804.A08BD39C05F@new.scipy.org> Author: charris Date: 2008-04-30 18:48:02 -0500 (Wed, 30 Apr 2008) New Revision: 5116 Modified: trunk/numpy/core/src/scalartypes.inc.src Log: Small cleanup and whitespace removal. Modified: trunk/numpy/core/src/scalartypes.inc.src =================================================================== --- trunk/numpy/core/src/scalartypes.inc.src 2008-04-30 22:06:41 UTC (rev 5115) +++ trunk/numpy/core/src/scalartypes.inc.src 2008-04-30 23:48:02 UTC (rev 5116) @@ -15,16 +15,15 @@ /**begin repeat -#name=number, integer, signedinteger, unsignedinteger, inexact, floating, complexfloating, flexible, -character# +#name=number, integer, signedinteger, unsignedinteger, inexact, floating, complexfloating, flexible, character# #NAME=Number, Integer, SignedInteger, UnsignedInteger, Inexact, Floating, ComplexFloating, Flexible, Character# */ static PyTypeObject Py at NAME@ArrType_Type = { PyObject_HEAD_INIT(NULL) - 0, /*ob_size*/ + 0, /*ob_size*/ "numpy. at name@", /*tp_name*/ - sizeof(PyObject), /*tp_basicsize*/ + sizeof(PyObject), /*tp_basicsize*/ }; /**end repeat**/ @@ -69,7 +68,7 @@ /* Must be a user-defined type --- check to see which scalar it inherits from. */ - + #define _CHK(cls) (PyObject_IsInstance(scalar, \ (PyObject *)&Py##cls##ArrType_Type)) #define _OBJ(lt) &(((Py##lt##ScalarObject *)scalar)->obval) @@ -112,14 +111,14 @@ if _CHK(Void) return ((PyVoidScalarObject *)scalar)->obval; } else _IFCASE(Object); - + /* Use the alignment flag to figure out where the data begins after a PyObject_HEAD */ memloc = (intp)scalar; memloc += sizeof(PyObject); - /* now round-up to the nearest alignment value + /* now round-up to the nearest alignment value */ align = descr->alignment; if (align > 1) memloc = ((memloc + align - 1)/align)*align; @@ -260,9 +259,9 @@ } goto finish; } - + memptr = scalar_value(scalar, typecode); - + #ifndef Py_UNICODE_WIDE if (typecode->type_num == PyArray_UNICODE) { PyUCS2Buffer_AsUCS4((Py_UNICODE *)memptr, @@ -282,7 +281,7 @@ if (outcode == NULL) return r; if (outcode->type_num == typecode->type_num) { - if (!PyTypeNum_ISEXTENDED(typecode->type_num) || + if (!PyTypeNum_ISEXTENDED(typecode->type_num) || (outcode->elsize == typecode->elsize)) return r; } @@ -797,7 +796,7 @@ if (typecode->type_num == NPY_UNICODE) { elsize >>= 1; } -#endif +#endif ret = PyInt_FromLong((long) elsize); Py_DECREF(typecode); return ret; @@ -1304,7 +1303,7 @@ /* We need to expand the buffer so that we always write UCS4 to disk for pickle of unicode scalars. - This could be in a unicode_reduce function, but + This could be in a unicode_reduce function, but that would require re-factoring. */ int alloc=0; @@ -1727,7 +1726,7 @@ outcode = PyArray_DescrFromScalar(self); if (lenp) { *lenp = outcode->elsize; -#ifndef Py_UNICODE_WIDE +#ifndef Py_UNICODE_WIDE if (outcode->type_num == NPY_UNICODE) { *lenp >>= 1; } @@ -1861,7 +1860,7 @@ else itemsize = 0; obj = type->tp_alloc(type, itemsize); if (obj == NULL) {Py_DECREF(robj); return NULL;} - if (typecode==NULL) + if (typecode==NULL) typecode = PyArray_DescrFromType(PyArray_ at TYPE@); dest = scalar_value(obj, typecode); src = scalar_value(robj, typecode); @@ -2406,12 +2405,12 @@ res = PyArray_FromScalar(self, NULL); } else { - PyErr_SetString(PyExc_IndexError, + PyErr_SetString(PyExc_IndexError, "invalid index to scalar variable."); return NULL; } - if (key == Py_Ellipsis) + if (key == Py_Ellipsis) return res; if (key == Py_None) { @@ -2420,7 +2419,7 @@ return ret; } /* Must be a Tuple */ - + N = count_new_axes_0d(key); if (N < 0) return NULL; ret = add_new_axes_0d((PyArrayObject *)res, N);