;ò
*O)@c           @   sl  d  Z  d k Z d k Z d k Z d k Z d k	 Z
 d k Z d k l Z d k Z d k l Z d k l Z l Z d Z d „  Z d „  Z d „  Z e i d ƒ Z e o/ d	 e i f d
 „  ƒ  YZ d „  Z d „  Z n e i Z d k l Z l Z d „  Z d „  Z d f  d „  ƒ  YZ  d f  d „  ƒ  YZ! d e e i f d „  ƒ  YZ" e# d d „ Z$ d „  Z% e% Z& e# d „ Z' e# d „ Z( e# d „ Z) d „  Z* e# d „ Z+ d „  Z, d e# d  „ Z- d! „  Z. d e# d" „ Z/ d# „  Z0 xH e1 e ƒ D]: Z2 e0 e2 e i3 e2 ƒ Z4 e4 e# j	 o e4 e5 ƒ  e2 <qåqåWe6 Z7 e8 Z9 e: Z; e< Z= e> Z? e@ ZA eB ZC eD ZE eF ZG eH ZI d$ „  ZJ d S(%   sá   objects -- This module defines a class and set of functions for
manipulating arrays of Python objects.  It defines functions which
correspond to most of the most of the operators defined in Python's
operator module, and provides names compatible with most of numarray's
universal functions.

>>> a = fromlist(["t","u","w"])
>>> a
ObjectArray(['t', 'u', 'w'])
>>> a+a
ObjectArray(['tt', 'uu', 'ww'])
>>> add(a,a)
ObjectArray(['tt', 'uu', 'ww'])
>>> b=a.copy()
>>> add(a,a,b)
>>> b
ObjectArray(['tt', 'uu', 'ww'])
>>> a
ObjectArray(['t', 'u', 'w'])
>>> a[1:2]+a[2:]
ObjectArray(['uw'])
>>> a = fromlist(["a","b","c"])
>>> add.areduce(a)
ObjectArray('abc')
>>> add.reduce(a)
'abc'
>>> add.reduce(a[1:])
'bc'
>>> add.accumulate(a[1:])
ObjectArray(['b', 'bc'])
>>> b = _gen._broadcast(a, (2,5,3))
>>> add.reduce(b, dim=0)
ObjectArray([['aa', 'bb', 'cc'],
             ['aa', 'bb', 'cc'],
             ['aa', 'bb', 'cc'],
             ['aa', 'bb', 'cc'],
             ['aa', 'bb', 'cc']])
>>> add.areduce(b, dim=0)
ObjectArray([['aa', 'bb', 'cc'],
             ['aa', 'bb', 'cc'],
             ['aa', 'bb', 'cc'],
             ['aa', 'bb', 'cc'],
             ['aa', 'bb', 'cc']])
>>> add.reduce(b, dim=1)
ObjectArray([['aaaaa', 'bbbbb', 'ccccc'],
             ['aaaaa', 'bbbbb', 'ccccc']])
>>> add.areduce(b, dim=1)
ObjectArray([['aaaaa', 'bbbbb', 'ccccc'],
             ['aaaaa', 'bbbbb', 'ccccc']])
>>> add.reduce(b, dim=2)
ObjectArray([['abc', 'abc', 'abc', 'abc', 'abc'],
             ['abc', 'abc', 'abc', 'abc', 'abc']])
>>> add.areduce(b, dim=2)
ObjectArray([['abc', 'abc', 'abc', 'abc', 'abc'],
             ['abc', 'abc', 'abc', 'abc', 'abc']])
>>> _dtp(add.accumulate(b, dim=0))
. ObjectArray([[['a', 'b', 'c'],
.               ['a', 'b', 'c'],
.               ['a', 'b', 'c'],
.               ['a', 'b', 'c'],
.               ['a', 'b', 'c']],
.
.              [['aa', 'bb', 'cc'],
.               ['aa', 'bb', 'cc'],
.               ['aa', 'bb', 'cc'],
.               ['aa', 'bb', 'cc'],
.               ['aa', 'bb', 'cc']]])
>>> _dtp(add.accumulate(b, dim=1))
. ObjectArray([[['a', 'b', 'c'],
.               ['aa', 'bb', 'cc'],
.               ['aaa', 'bbb', 'ccc'],
.               ['aaaa', 'bbbb', 'cccc'],
.               ['aaaaa', 'bbbbb', 'ccccc']],
.
.              [['a', 'b', 'c'],
.               ['aa', 'bb', 'cc'],
.               ['aaa', 'bbb', 'ccc'],
.               ['aaaa', 'bbbb', 'cccc'],
.               ['aaaaa', 'bbbbb', 'ccccc']]])
>>> _dtp(add.accumulate(b, dim=2))
. ObjectArray([[['a', 'ab', 'abc'],
.               ['a', 'ab', 'abc'],
.               ['a', 'ab', 'abc'],
.               ['a', 'ab', 'abc'],
.               ['a', 'ab', 'abc']],
.
.              [['a', 'ab', 'abc'],
.               ['a', 'ab', 'abc'],
.               ['a', 'ab', 'abc'],
.               ['a', 'ab', 'abc'],
.               ['a', 'ab', 'abc']]])

>>> a=fromlist(range(1,5))
>>> subtract(a,a)
ObjectArray([0, 0, 0, 0])
>>> divide(a,a)
ObjectArray([1, 1, 1, 1])
>>> remainder(a,2)
ObjectArray([1, 0, 1, 0])

>>> abs(range(-5,5))
ObjectArray([5, 4, 3, 2, 1, 0, 1, 2, 3, 4])

>>> import numarray as _num
>>> a = _num.zeros((3,2))
>>> b = _num.ones((3,2))
>>> c = fromlist([["x","y"],["z","w"]])
>>> c[a,a]
ObjectArray([['x', 'x'],
             ['x', 'x'],
             ['x', 'x']])
>>> c[a,b]
ObjectArray([['y', 'y'],
             ['y', 'y'],
             ['y', 'y']])
>>> c[b,a]
ObjectArray([['z', 'z'],
             ['z', 'z'],
             ['z', 'z']])
>>> c[b,b]
ObjectArray([['w', 'w'],
             ['w', 'w'],
             ['w', 'w']])
>>> a=fromlist(["x"]*25, shape=(5,5)); a
ObjectArray([['x', 'x', 'x', 'x', 'x'],
             ['x', 'x', 'x', 'x', 'x'],
             ['x', 'x', 'x', 'x', 'x'],
             ['x', 'x', 'x', 'x', 'x'],
             ['x', 'x', 'x', 'x', 'x']])
>>> b=arange(5)
>>> a[b,b]  = 'y'; a
ObjectArray([['y', 'x', 'x', 'x', 'x'],
             ['x', 'y', 'x', 'x', 'x'],
             ['x', 'x', 'y', 'x', 'x'],
             ['x', 'x', 'x', 'y', 'x'],
             ['x', 'x', 'x', 'x', 'y']])
>>> a[b,b]
ObjectArray(['y', 'y', 'y', 'y', 'y'])

True and Floor division

>>> truediv(fromlist(range(10)), 4)
ObjectArray([0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25])
>>> floordiv(fromlist(range(10)), 4)
ObjectArray([0, 0, 0, 0, 1, 1, 1, 1, 2, 2])



Inplace operators

>>> a = fromlist(["a"]*3);  a += "b";   a *= 2;   a
ObjectArray(['abab', 'abab', 'abab'])

Unary operators

>>> -fromlist(range(3))
ObjectArray([0, -1, -2])
>>> +fromlist(range(3))
ObjectArray([0, 1, 2])
>>> ~fromlist(range(3))
ObjectArray([-1, -2, -3])

N(   s   dtp(   s   arange(   s   puts   takei    c         C   sœ   t  |  t t f ƒ oW t  |  d t t f ƒ o. g  } x, |  D] } | i t | ƒ ƒ q= Wn |  } | Sn, t  |  t i	 ƒ o |  i
 i ƒ  Sn |  g Sd S(   s1   _flatten() converts a nested list into a 1D list.i    N(   s
   isinstances   objectss   lists   tuples   ls   os   extends   _flattens   _gens   NDArrays   flats   tolist(   s   objectss   ls   o(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _flatten¶   s      c         C   s[   t  |  t t f ƒ o t |  ƒ g t |  d ƒ Sn# t  |  t i ƒ o |  i Sn g  Sd S(   sH   _shapeFromNestedSequence() determines the shape of a nested
    sequencei    N(	   s
   isinstances   ss   lists   tuples   lens   _shapeFromNestedSequences   _gens   NDArrays   shape(   s   s(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _shapeFromNestedSequenceÈ   s     c         C   sY   t  |  ƒ d j o; t i |  d ƒ g } t |  d ƒ } | i | ƒ | Sn d g Sd S(   sU   _stridesFromShape() computes the strides which correspond to
    the specified shape.i   N(   s   lens   shapes   _gens   products   heads   _stridesFromShapes   tails   extend(   s   shapes   heads   tail(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _stridesFromShapeÔ   s     s   _objarrc           B   s/   t  Z e d „ Z d „  Z d „  Z d „  Z RS(   Nc         C   sW   | t j o t g t i | ƒ } n t i i |  d | d t d d ƒ| |  _	 d  S(   Ns   shapes   buffers   itemsizei   (
   s   objectss   Nones   _gens   products   shapes   NDArrays   __init__s   selfs   _dummyBuffers   _objects(   s   selfs   shapes   objects(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __init__æ   s    "c         C   s   |  i | Sd  S(   N(   s   selfs   _objectss   offset(   s   selfs   offset(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _getitemí   s    c         C   s   | |  i | <d  S(   N(   s   values   selfs   _objectss   offset(   s   selfs   offsets   value(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _setitemð   s    c         C   só   t  |  i ƒ } | | j o | i | |  i | <n¼ | | d j oZ x§ t	 |  i | ƒ D]> } |  i | | | |  i | | | | i | | d ƒ qY WnQ xM t	 |  i | ƒ D]8 } | i | | i | | |  i | |  i | | <q³ Wd S(   sY   _copyObjects() recurively copies from a sequence sequence to
            an array object.i   N(   s   lens   selfs   _shapes   dlens   dims   others   _objectss   ooffsets
   selfoffsets   xranges   is   _copyObjectss   _strides(   s   selfs   others
   selfoffsets   ooffsets   dims   is   dlen(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _copyObjectsó   s      	 (   s   __name__s
   __module__s   Nones   __init__s   _getitems   _setitems   _copyObjects(    (    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _objarrå   s   		c         C   s”   t  | t ƒ o t | i ƒ d j o9 xg t t | ƒ ƒ D] } t |  | | | | ƒ q9 Wn2 x. t t | ƒ ƒ D] } |  | | ƒ | | <qr Wd S(   sq   _applyObjects2() applies function 'f' elementwise to
        inputs 'in1' and 'in2', storing the result in 'out'.i   N(
   s
   isinstances   in1s   ObjectArrays   lens   _shapes   xranges   is   _applyObjects1s   fs   out(   s   fs   in1s   outs   i(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _applyObjects1  s     &   c         C   s¢   t  | t ƒ o t | i ƒ d j o@ xu t t | ƒ ƒ D]% } t |  | | | | | | ƒ q9 Wn9 x5 t t | ƒ ƒ D]! } |  | | | | ƒ | | <qy Wd S(   sq   _applyObjects2() applies function 'f' elementwise to
        inputs 'in1' and 'in2', storing the result in 'out'.i   N(   s
   isinstances   in1s   ObjectArrays   lens   _shapes   xranges   is   _applyObjects2s   fs   in2s   out(   s   fs   in1s   in2s   outs   i(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _applyObjects2  s     & ' (   s   _applyObjects1s   _applyObjects2c         C   s  | i d j o9 xÿ t t | ƒ ƒ D] } t |  | | | | ƒ q# WnÊ | i d j or x¶ t t | ƒ ƒ D]W } | | } | d } x0 t d t | ƒ ƒ D] } |  | | | ƒ } qœ W| | | <ql WnH | d } x0 t d t | ƒ ƒ D] } |  | | | ƒ } që W| | f  <d  S(   Ni   i    (   s   outs   ranks   xranges   lens   is   _reduceObjectss   fs   in1s   in1as   temps   j(   s   fs   in1s   outs   temps   is   js   in1a(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _reduceObjects&  s$       

 
 c         C   s¢   t  | i ƒ d j o9 x… t t  | ƒ ƒ D] } t |  | | | | ƒ q) WnP | d | d <} x: t d t  | ƒ ƒ D]# } |  | | | ƒ } | | | <qw Wd  S(   Ni   i    (	   s   lens   outs   _shapes   xranges   is   _accumulateObjectss   fs   in1s   temp(   s   fs   in1s   outs   temps   i(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _accumulateObjects8  s       s   _UnaryObjectUfuncc           B   s&   t  Z d „  Z d „  Z e d „ Z RS(   Nc         C   s   | |  _  | |  _ d  S(   N(   s   names   selfs   func(   s   selfs   names   func(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __init__D  s    	c         C   s   d t  |  i ƒ d Sd  S(   Ns   _UnaryObjectUfunc<s   >(   s   reprs   selfs   name(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __repr__H  s    c         C   sa   t  | ƒ } | t j o | i | i ƒ } n | } t |  i
 | | ƒ | t j o | Sn d  S(   N(   s   asarrays   inas   in1s   outs   Nones   _clones   _shapes   out1s   _applyObjects1s   selfs   func(   s   selfs   inas   outs   out1s   in1(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __call__K  s    (   s   __name__s
   __module__s   __init__s   __repr__s   Nones   __call__(    (    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _UnaryObjectUfuncC  s   		s   _BinaryObjectUfuncc           B   sS   t  Z d „  Z d „  Z e d „ Z e d d „ Z e d d „ Z e d d „ Z RS(   Nc         C   s   | |  _  | |  _ d  S(   N(   s   names   selfs   func(   s   selfs   names   func(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __init__V  s    	c         C   s   d t  |  i ƒ d Sd  S(   Ns   _BinaryObjectUfunc<s   >(   s   reprs   selfs   name(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __repr__Z  s    c         C   s…   t  | ƒ } t  | ƒ } | i | ƒ \ } } | t j o | i | i	 ƒ } n | } t |  i | | | ƒ | t j o | Sn d  S(   N(   s   asarrays   inas   in1s   inbs   in2s   _dualbroadcasts   outs   Nones   _clones   _shapes   out1s   _applyObjects2s   selfs   func(   s   selfs   inas   inbs   outs   out1s   in1s   in2(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __call__]  s    i    c         C   s  | t | i ƒ d j o
 d } n t | ƒ } | d j o | i d | ƒ n | t j o, | d d f i ƒ  } | i
 | i ƒ } n( | } | d j o | i d | ƒ n t |  i | | ƒ | d j o$ | i d | ƒ | i d | ƒ n | t j o | Sn d  S(   Ni   iÿÿÿÿ.i    (   s   dims   lens   as   _shapes   asarrays   swapaxess   outs   Nones   copys   cols   _clones   out1s   _reduceObjectss   selfs   func(   s   selfs   as   outs   dims   out1s   col(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   areducei  s"    
c         C   sJ   |  i | | | ƒ } | t j o$ | i f  j o | f  SqF | Sn d  S(   N(   s   selfs   areduces   as   outs   dims   results   Nones   _shape(   s   selfs   as   outs   dims   result(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   reduce}  s
    c         C   sÃ   t  | ƒ } | t j o | i | i ƒ } n | } | d j o$ | i d | ƒ | i d | ƒ n t	 |  i | | ƒ | d j o$ | i d | ƒ | i d | ƒ n | t j o | Sn d  S(   Niÿÿÿÿ(   s   asarrays   as   outs   Nones   _clones   _shapes   out1s   dims   swapaxess   _accumulateObjectss   selfs   func(   s   selfs   as   outs   dims   out1(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys
   accumulate…  s    (	   s   __name__s
   __module__s   __init__s   __repr__s   Nones   __call__s   areduces   reduces
   accumulate(    (    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _BinaryObjectUfuncU  s   		s   ObjectArrayc           B   sH  t  Z e e d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z e d
 „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z d  „  Z d! „  Z! d" „  Z" d# „  Z# d$ „  Z$ d% „  Z% d& „  Z& d' „  Z' d( „  Z( d) „  Z) d* „  Z* d+ „  Z+ d, „  Z, d- „  Z- d. „  Z. d/ „  Z/ d0 „  Z0 d1 „  Z1 d2 „  Z2 d3 „  Z3 d4 „  Z4 d5 „  Z5 d6 „  Z6 d7 „  Z7 d8 „  Z8 d9 „  Z9 d: „  Z: d; „  Z; d< „  Z< d= „  Z= d> „  Z> d? „  Z? RS(@   Nc         C   sÑ   | t j	 ob t | ƒ } | t j o
 | } n0 t i | ƒ t i | ƒ j o t d ƒ ‚ n t | ƒ } n | t j o d f } n t	 | t i
 ƒ o
 | f  j o | f  g } n t i |  | | ƒ d S(   s?  
        >>> ObjectArray(shape=(1,))
        ObjectArray([None])
        >>> ObjectArray(objects=['t','u'])
        ObjectArray(['t', 'u'])
        >>> ObjectArray(objects=['t','u'], shape=(3,))
        Traceback (most recent call last):
        ...
        ValueError: object list is not compatible with shape
        s(   object list is not compatible with shapei   N(   s   objectss   Nones   _shapeFromNestedSequences   oshapes   shapes   _gens   products
   ValueErrors   _flattens
   isinstances   NDArrays   _objarrs   __init__s   self(   s   selfs   shapes   objectss   oshape(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __init__—  s    
 
 c         C   s&   t  i i |  ƒ } |  i | _ | Sd S(   sd   view() returns a new array object which refers to the 'data'
        of the original array.
        N(   s   _gens   NDArrays   views   selfs   vs   _objects(   s   selfs   v(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   view´  s     c         C   s*   t  i i |  ƒ } |  i ƒ  | d <| Sd  S(   Ns
   objectlist(   s   _gens   NDArrays   __getstate__s   selfs   states   tolist(   s   selfs   state(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __getstate__¼  s    c         C   s+   | d |  _ | d =t i i |  | ƒ d S(   s    
        >>> a = fromlist(["t","u",1])
        >>> import cPickle; s = cPickle.dumps(a)
        >>> cPickle.loads(s)
        ObjectArray(['t', 'u', 1])
        s
   objectlistN(   s   states   selfs   _objectss   _gens   NDArrays   __setstate__(   s   selfs   state(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __setstate__Á  s     c         C   sS   t  | t ƒ o t | g ƒ } n |  i | ƒ } |  i | |  i | i d ƒ d S(   sõ  _copyFrom copies another array or object into self.

        >>> a = ObjectArray(shape=(2,2)); a[:] = "t"; a
        ObjectArray([['t', 't'],
                     ['t', 't']])
        >>> b = fromlist(['u']); a[:] = b; a
        ObjectArray([['u', 'u'],
                     ['u', 'u']])
        >>> c = ObjectArray(objects=['t', 'u',                                      'w', 'v'], shape=(2,2))
        >>> a._copyFrom(c); a
        ObjectArray([['t', 'u'],
                     ['w', 'v']])
        i    N(	   s
   isinstances   others   ObjectArrays   fromlists   selfs
   _broadcasts   bothers   _copyObjectss   _byteoffset(   s   selfs   others   bother(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys	   _copyFromÌ  s     c         C   s   t  | ƒ Sd  S(   N(   s   reprs   x(   s   selfs   x(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _formatá  s    c         C   s   d Sd  S(   Ni    (    (   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   isbyteswappedä  s    c         C   s'   t  d |  i ƒ } | i |  ƒ | Sd S(   s  copy() returns a copy of 'self' which has it's own object store
        referring to the same objects as 'self'.  Thus, modifications to
        the copy array do not affect the original, but modifications to the
        objects referred to by both arrays affect both arrays.
        s   shapeN(   s   ObjectArrays   selfs   _shapes   cs	   _copyFrom(   s   selfs   c(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   copyç  s     c         C   sN   |  i ƒ  } | | _ t | ƒ | _ d | _ t g t	 i
 | ƒ | _ | Sd S(   sD   returns an empty array identical to 'self' but with 'shape'
        i    N(   s   selfs   views   cs   shapes   _shapes   _stridesFromShapes   _stridess   _byteoffsets   Nones   _gens   products   _objects(   s   selfs   shapes   c(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _cloneò  s     		c         C   sT   | t i j o |  i ƒ  Sn/ t i d t d |  i d | ƒ } | i
 |  ƒ | Sd S(   sx   Convert ObjectArray 'self' to another array of 'type'.
        'type' can be Object, 'O',  or a numerical type.
        s   buffers   shapes   typeN(   s   types   _nts   Objects   selfs   copys   _ncs   NumArrays   Nones   shapes   as   fromlist(   s   selfs   types   a(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   astypeü  s     !c         C   s   t  d ƒ ‚ d  S(   Ns,   Object array resize hasn't been implemented.(   s   NotImplementedError(   s   selfs   size(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   resize  s    c         C   s   t  d ƒ ‚ d  S(   Ns*   Can't convert and ObjectArray to a string.(   s	   TypeError(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   tostring
  s    c         C   s   t  d ƒ ‚ d  S(   Ns%   Can't write an ObjectArray to a file.(   s	   TypeError(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   tofile  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   adds   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __add__  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   subs   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __sub__  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   muls   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __mul__  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   divs   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __div__  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   truedivs   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __truediv__  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   floordivs   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __floordiv__  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   mods   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __mod__  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   or_s   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __or__  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   and_s   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __and__!  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   xors   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __xor__#  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   lshifts   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys
   __lshift__%  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   rshifts   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys
   __rshift__'  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   pows   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __pow__)  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   adds   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __radd__,  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   subs   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __rsub__.  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   muls   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __rmul__0  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   divs   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __rdiv__2  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   truedivs   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __truediv__4  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   floordivs   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __floordiv__6  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   mods   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __rmod__8  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   or_s   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __ror__:  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   and_s   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __rand__<  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   xors   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __rxor__>  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   lshifts   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __rlshift__@  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   rshifts   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __rrshift__B  s    c         C   s   t  | |  ƒ Sd  S(   N(   s   pows   others   self(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __rpow__D  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   adds   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __iadd__H  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   subs   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __isub__J  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   muls   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __imul__L  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   divs   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __idiv__N  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   truedivs   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __itruediv__P  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   floordivs   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __ifloordiv__R  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   mods   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __imod__T  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   pows   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __ipow__V  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   lshifts   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __ilshift__X  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   rshifts   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __irshift__Z  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   and_s   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __iand__\  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   xors   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __ixor__^  s    c         C   s   t  |  | |  ƒ |  Sd  S(   N(   s   or_s   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __ior__`  s    c         C   s   t  |  ƒ Sd  S(   N(   s   negs   self(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __neg__c  s    c         C   s   t  |  ƒ Sd  S(   N(   s   poss   self(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __pos__e  s    c         C   s   t  |  ƒ Sd  S(   N(   s   abss   self(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __abs__g  s    c         C   s   t  |  ƒ Sd  S(   N(   s   inverts   self(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys
   __invert__i  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   lts   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __lt__l  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   les   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __le__n  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   gts   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __gt__p  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   ges   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __ge__r  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   eqs   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __eq__t  s    c         C   s   t  |  | ƒ Sd  S(   N(   s   nes   selfs   other(   s   selfs   other(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   __ne__v  s    c         C   s4   d G|  i GHd G|  i GHd G|  i GHd G|  i GHd  S(   Ns   class:s   shape:s   strides:s   byteoffset:(   s   selfs	   __class__s   _shapes   _stridess   _byteoffset(   s   self(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   infoy  s    (@   s   __name__s
   __module__s   Nones   __init__s   views   __getstate__s   __setstate__s	   _copyFroms   _formats   isbyteswappeds   copys   _clones   astypes   resizes   tostrings   tofiles   __add__s   __sub__s   __mul__s   __div__s   __truediv__s   __floordiv__s   __mod__s   __or__s   __and__s   __xor__s
   __lshift__s
   __rshift__s   __pow__s   __radd__s   __rsub__s   __rmul__s   __rdiv__s   __rmod__s   __ror__s   __rand__s   __rxor__s   __rlshift__s   __rrshift__s   __rpow__s   __iadd__s   __isub__s   __imul__s   __idiv__s   __itruediv__s   __ifloordiv__s   __imod__s   __ipow__s   __ilshift__s   __irshift__s   __iand__s   __ixor__s   __ior__s   __neg__s   __pos__s   __abs__s
   __invert__s   __lt__s   __le__s   __gt__s   __ge__s   __eq__s   __ne__s   info(    (    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   ObjectArray–  s~   								
																																																				s   Oc         C   s.   | d j o t d ƒ ‚ n t |  | ƒ Sd  S(   Ns   Os   typecode must be 'O'(   s   typecodes
   ValueErrors   fromlists   sequences   shape(   s   sequences   shapes   typecode(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   array‚  s    c         C   s*   t  |  t ƒ o t d |  ƒ Sn |  Sd  S(   Ns   objects(   s
   isinstances   objs   ObjectArray(   s   obj(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   asarray‡  s    c         C   s   t  d |  d | ƒ Sd S(   s‘  creates an object array from the objects in l.  If
    no shape is specified, it is implied by list nesting.

    >>> fromlist(["t",1,"u",2.0])
    ObjectArray(['t', 1, 'u', 2.0])
    >>> fromlist(["t","u","w",1], shape=(2,2))
    ObjectArray([['t', 'u'],
                 ['w', 1]])
    >>> fromlist([['t', 'u'],['w', 1]])                
    ObjectArray([['t', 'u'],
                 ['w', 1]])
    s   objectss   shapeN(   s   ObjectArrays   ls   shape(   s   ls   shape(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   fromlist�  s     c         C   s   t  d ƒ ‚ d S(   s   Not supported for ObjectArrays&   ObjectArray can't be read from a file.N(   s	   TypeError(   s   files   shape(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   fromfilež  s     c         C   s   t  d ƒ ‚ d S(   s   Not supported for ObjectArrays.   ObjectArray can't be constructed from a stringN(   s	   TypeError(   s   ss   shape(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys
   fromstring¢  s     c   
      C   s¾   |  i d } t |  i ƒ d j o1 x” t | ƒ D] } | |  | | | | <q0 Wng xc t | ƒ D]U } g  i } | D] } | | | ƒ qu ~ } |  | }	 | | } t |	 | | ƒ qa Wd  S(   Ni    i   (   s   selectors   _shapes   s0s   lens   xranges   is
   populations   outs   appends   _[1]s   ps   newpopss   newsels   newouts   _choose(
   s   selectors
   populations   outs   newouts   is   s0s   _[1]s   ps   newpopss   newsel(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _choose¦  s      +

c         C   s  t  |  t i ƒ o t i |  ƒ }  n t | ƒ } xS t t | ƒ ƒ D]? } | | } t  | t i ƒ o t | | g ƒ | | <qF qF Wt i |  g | ƒ } | d | d f \ }  } | t j o t |  i ƒ } n | } t |  t | ƒ | ƒ | t j o | Sn d S(   s­  choose() picks the elements of the tuple of arrays 'population'
    which are specified by the 'selector' array.  The shape of the
    output array is determined by the broadcasting the selector with
    all of the population arrays.

    >>> choose(_nc.arange(5)%2, ("t", 1))
    ObjectArray(['t', 1, 't', 1, 't'])
    >>> choose(_nc.arange(3, shape=(3,1))%2, (fromlist(["t","u"]), "v"))
    ObjectArray([['t', 'u'],
                 ['v', 'v'],
                 ['t', 'u']])
    >>> a = ObjectArray(shape=(3,2))
    >>> choose(_nc.arange(3, shape=(3,1))%2, (fromlist(["t","u"]), "v"), a); a
    ObjectArray([['t', 'u'],
                 ['v', 'v'],
                 ['t', 'u']])
    i    i   N(   s
   isinstances   selectors   _ncs   NumArrays   fromlists   lists
   populations   xranges   lens   is   ps   _gens   NDArrays   _nWayBroadcasts   inputss   outputs   Nones   ObjectArrays   shapes   output0s   _chooses   tuple(   s   selectors
   populations   outputs   inputss   is   output0s   p(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   choose²  s"      
c         C   s€   t  |  i ƒ d j o3 |  i ƒ  } | i ƒ  t | ƒ } | i	 | ƒ n4 x0 t
 |  i d ƒ D] } t |  | | | ƒ q] Wd  S(   Ni   i    (   s   lens   objectss   _shapes   tolists   ls   sorts   fromlists   os   sorteds	   _copyFroms   xranges   shapes   is   _sort(   s   objectss   sorteds   is   ls   o(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _sortÕ  s    
 iÿÿÿÿc         C   s±   | t j o |  i |  i ƒ } n | } | d j o$ |  i d | ƒ | i d | ƒ n t |  | ƒ | d j o$ |  i d | ƒ | i d | ƒ n | t j o | Sn d S(   sU  sort() sorts 'objects' along 'axis' putting the result in 'output'
    or returning the result if no output is specified.

    >>> a = ObjectArray(shape=(5,5))
    >>> a[:] = range(5,0,-1)
    >>> sort(a)
    ObjectArray([[1, 2, 3, 4, 5],
                 [1, 2, 3, 4, 5],
                 [1, 2, 3, 4, 5],
                 [1, 2, 3, 4, 5],
                 [1, 2, 3, 4, 5]])
    >>> a.transpose()
    >>> sort(a, axis=0)
    ObjectArray([[1, 1, 1, 1, 1],
                 [2, 2, 2, 2, 2],
                 [3, 3, 3, 3, 3],
                 [4, 4, 4, 4, 4],
                 [5, 5, 5, 5, 5]])
    iÿÿÿÿN(	   s   outputs   Nones   objectss   _clones   _shapes   output0s   axiss   swapaxess   _sort(   s   objectss   axiss   outputs   output0(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   sortß  s     c   
      C   sÑ   t  |  i ƒ d j o„ |  i ƒ  } t t  | ƒ ƒ } t | | ƒ }	 |	 i	 ƒ  g  i
 } |	 D] \ } } | | ƒ q[ ~ } t i | ƒ } | i | ƒ n4 x0 t |  i d ƒ D] } t |  | | | ƒ q® Wd  S(   Ni   i    (   s   lens   objectss   _shapes   tolists   los   ranges   lws   zips   zs   sorts   appends   _[1]s   os   ws   sws   _ncs   fromlists   witnesss	   _copyFroms   xranges   is   _argsort(
   s   objectss   witnesss   is   los   sws   _[1]s   lws   os   ws   z(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _argsort  s    
- c         C   s±   | t j o t i |  i ƒ } n | } | d j o$ |  i d | ƒ | i d | ƒ n t	 |  | ƒ | d j o$ |  i d | ƒ | i d | ƒ n | t j o | Sn d S(   s7  argsort() returns the sort order for 'objects' sorted
    along 'axis'.

    >>> a = ObjectArray(shape=(5,5))
    >>> a[:] = ['e','d','c','b','a']
    >>> argsort(a)
    array([[4, 3, 2, 1, 0],
           [4, 3, 2, 1, 0],
           [4, 3, 2, 1, 0],
           [4, 3, 2, 1, 0],
           [4, 3, 2, 1, 0]])
    iÿÿÿÿN(
   s   outputs   Nones   _ncs   zeross   objectss   _shapes   output0s   axiss   swapaxess   _argsort(   s   objectss   axiss   outputs   output0(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   argsort  s     c         C   sô   t  | ƒ t  t i ƒ j o t Sn x‰ d d d g D]x } | } y t | t d g | ƒ ƒ WnJ t	 j
 o> y t | t d g | ƒ ƒ Wq« t	 j
 o
 q4 q« Xn XPq4 W| d j o t
 |  | ƒ Sn# | d j o t |  | ƒ Sn t Sd  S(   Ni   i   i   s   x(   s   types   fs   _ops   adds   Nones   is   argss   applys   tuples	   TypeErrors   _UnaryObjectUfuncs   names   _BinaryObjectUfunc(   s   names   fs   is   args(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   _magicOp,  s$     c          C   s#   d  k  } d  k }  | i |  ƒ Sd  S(   N(   s   doctests   objectss   testmod(   s   objectss   doctest(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   testV  s    (K   s   __doc__s   generics   _gens   memorys   _mems   operators   _ops   numarraycores   _ncs   numerictypess   _nts   _objectarrays   numtests   dtps   _dtps   typess   _typess   aranges   puts   takes
   _PROTOTYPEs   _flattens   _shapeFromNestedSequences   _stridesFromShapes
   new_memorys   _dummyBuffers   NDArrays   _objarrs   _applyObjects1s   _applyObjects2s   _reduceObjectss   _accumulateObjectss   _UnaryObjectUfuncs   _BinaryObjectUfuncs   ObjectArrays   Nones   arrays   asarrays
   inputarrays   fromlists   fromfiles
   fromstrings   _chooses   chooses   _sorts   sorts   _argsorts   argsorts   _magicOps   dirs   names   __dict__s   theUfuncs   globalss   subs   subtracts   muls   multiplys   divs   divides   mods	   remainders   eqs   equals   nes	   not_equals   lts   lesss   gts   greaters   les
   less_equals   ges   greater_equals   test(2   s   fromlists   _accumulateObjectss   divides   lesss   chooses   _dummyBuffers
   inputarrays   _BinaryObjectUfuncs   _shapeFromNestedSequences   arrays   _UnaryObjectUfuncs   _reduceObjectss
   fromstrings   asarrays	   remainders   _objectarrays   _nts   names   multiplys   takes   tests   _ncs   fromfiles   _applyObjects2s   _applyObjects1s   _chooses   sorts
   _PROTOTYPEs   _objarrs   greaters   _magicOps   _gens   theUfuncs   _stridesFromShapes   puts   subtracts   _argsorts   _typess	   not_equals   _ops   _sorts   _dtps   equals   aranges   argsorts   _flattens   _mems   ObjectArrays
   less_equals   greater_equal(    (    sI   /mit/python/arch/i386_rh9/lib/python2.3/site-packages/numarray/objects.pys   ?£   sn   										"				Aì		#	
"		 