[Scipy-svn] r4846 - in branches/refactor_fft: . scipy scipy/cluster scipy/interpolate scipy/io/matlab scipy/io/matlab/tests scipy/ndimage scipy/optimize/tests scipy/sparse scipy/sparse/linalg scipy/sparse/linalg/isolve scipy/sparse/linalg/isolve/tests scipy/sparse/sparsetools scipy/sparse/tests scipy/stats scipy/stats/tests

scipy-svn@scip... scipy-svn@scip...
Sun Oct 26 06:03:13 CDT 2008


Author: cdavid
Date: 2008-10-26 06:02:22 -0500 (Sun, 26 Oct 2008)
New Revision: 4846

Modified:
   branches/refactor_fft/
   branches/refactor_fft/scipy/__init__.py
   branches/refactor_fft/scipy/cluster/distance.py
   branches/refactor_fft/scipy/cluster/hierarchy.py
   branches/refactor_fft/scipy/interpolate/interpolate_wrapper.py
   branches/refactor_fft/scipy/interpolate/setup.py
   branches/refactor_fft/scipy/io/matlab/byteordercodes.py
   branches/refactor_fft/scipy/io/matlab/mio.py
   branches/refactor_fft/scipy/io/matlab/mio5.py
   branches/refactor_fft/scipy/io/matlab/miobase.py
   branches/refactor_fft/scipy/io/matlab/tests/test_byteordercodes.py
   branches/refactor_fft/scipy/io/matlab/tests/test_mio.py
   branches/refactor_fft/scipy/ndimage/filters.py
   branches/refactor_fft/scipy/optimize/tests/test_nnls.py
   branches/refactor_fft/scipy/sparse/base.py
   branches/refactor_fft/scipy/sparse/bsr.py
   branches/refactor_fft/scipy/sparse/compressed.py
   branches/refactor_fft/scipy/sparse/construct.py
   branches/refactor_fft/scipy/sparse/coo.py
   branches/refactor_fft/scipy/sparse/csc.py
   branches/refactor_fft/scipy/sparse/csr.py
   branches/refactor_fft/scipy/sparse/dia.py
   branches/refactor_fft/scipy/sparse/dok.py
   branches/refactor_fft/scipy/sparse/lil.py
   branches/refactor_fft/scipy/sparse/linalg/interface.py
   branches/refactor_fft/scipy/sparse/linalg/isolve/iterative.py
   branches/refactor_fft/scipy/sparse/linalg/isolve/tests/test_iterative.py
   branches/refactor_fft/scipy/sparse/sparsetools/bsr.py
   branches/refactor_fft/scipy/sparse/sparsetools/coo.py
   branches/refactor_fft/scipy/sparse/sparsetools/csc.py
   branches/refactor_fft/scipy/sparse/sparsetools/csr.py
   branches/refactor_fft/scipy/sparse/sparsetools/dia.py
   branches/refactor_fft/scipy/sparse/sputils.py
   branches/refactor_fft/scipy/sparse/tests/test_base.py
   branches/refactor_fft/scipy/sparse/tests/test_sputils.py
   branches/refactor_fft/scipy/stats/distributions.py
   branches/refactor_fft/scipy/stats/stats.py
   branches/refactor_fft/scipy/stats/tests/test_stats.py
Log:
Merged revisions 4828-4845 via svnmerge from 
http://svn.scipy.org/svn/scipy/trunk

........
  r4829 | cdavid | 2008-10-25 16:36:42 +0900 (Sat, 25 Oct 2008) | 1 line
  
  Remove double TestMedian, which shadows some median tests.
........
  r4830 | cdavid | 2008-10-25 18:13:05 +0900 (Sat, 25 Oct 2008) | 1 line
  
  Add old median test to new median test.
........
  r4831 | cdavid | 2008-10-25 18:13:34 +0900 (Sat, 25 Oct 2008) | 1 line
  
  Add regression test for #760.
........
  r4832 | cdavid | 2008-10-25 18:26:32 +0900 (Sat, 25 Oct 2008) | 1 line
  
  BUG: Fix bug 760. median was using old numpy.median behavior wrt axis argument.
........
  r4833 | cdavid | 2008-10-25 19:29:28 +0900 (Sat, 25 Oct 2008) | 1 line
  
  Forgot to add one file for #760 fix.
........
  r4834 | wnbell | 2008-10-26 06:26:45 +0900 (Sun, 26 Oct 2008) | 2 lines
  
  removed sum_duplicates option from coo_matrix.tocsr() and coo_matrix.tocsc()
........
  r4835 | wnbell | 2008-10-26 07:19:48 +0900 (Sun, 26 Oct 2008) | 3 lines
  
  sparse matrices now conform to spmatrix( (M,N) ) -> empty M-by-N matrix
  added tests for invalid shapes in case above
........
  r4836 | wnbell | 2008-10-26 07:34:36 +0900 (Sun, 26 Oct 2008) | 2 lines
  
  cleaned up lil_matrix imports
........
  r4837 | wnbell | 2008-10-26 07:43:44 +0900 (Sun, 26 Oct 2008) | 2 lines
  
  cleaned up dia_matrix imports
........
  r4838 | wnbell | 2008-10-26 08:13:09 +0900 (Sun, 26 Oct 2008) | 2 lines
  
  cleaned up bsr_matrix imports
........
  r4839 | wnbell | 2008-10-26 08:30:38 +0900 (Sun, 26 Oct 2008) | 2 lines
  
  cleaned up coo_matrix imports
........
  r4840 | wnbell | 2008-10-26 10:16:01 +0900 (Sun, 26 Oct 2008) | 3 lines
  
  cleaned up sp_matrix imports
  cleaned up multiplication handlers
........
  r4841 | wnbell | 2008-10-26 10:33:39 +0900 (Sun, 26 Oct 2008) | 2 lines
  
  cleaned up csr_matrix and csc_matrix imports
........
  r4842 | wnbell | 2008-10-26 10:43:51 +0900 (Sun, 26 Oct 2008) | 2 lines
  
  cleaned up imports in construction.py
........
  r4845 | jarrod.millman | 2008-10-26 18:20:24 +0900 (Sun, 26 Oct 2008) | 2 lines
  
  ran reindent
........



Property changes on: branches/refactor_fft
___________________________________________________________________
Name: svnmerge-integrated
   - /branches/build_with_scons:1-3868 /branches/scipy.scons:1-3533 /branches/sparse_build_reduce_mem:1-4005 /branches/testing_cleanup:1-3662 /trunk:1-4827
   + /branches/build_with_scons:1-3868 /branches/scipy.scons:1-3533 /branches/sparse_build_reduce_mem:1-4005 /branches/testing_cleanup:1-3662 /trunk:1-4845

Modified: branches/refactor_fft/scipy/__init__.py
===================================================================
--- branches/refactor_fft/scipy/__init__.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/__init__.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -74,7 +74,7 @@
 # Remove subpackage names from __all__ such that they are not imported via
 # "from scipy import *". This works around a numpy bug present in < 1.2.
 subpackages = """cluster constants fftpack integrate interpolate io lib linalg
-linsolve maxentropy misc ndimage odr optimize signal sparse special 
+linsolve maxentropy misc ndimage odr optimize signal sparse special
 splinalg stats stsci weave""".split()
 for name in subpackages:
     try:

Modified: branches/refactor_fft/scipy/cluster/distance.py
===================================================================
--- branches/refactor_fft/scipy/cluster/distance.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/cluster/distance.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -954,8 +954,8 @@
 
          d(u,v) = \sum_u {|u_i-v_i|}
                          {|u_i|+|v_i|}
-                         
 
+
     12. ``Y = pdist(X, 'braycurtis')``
 
        Computes the Bray-Curtis distance between the points. The
@@ -1285,8 +1285,8 @@
            it is known that ``X - X.T1`` is small and ``diag(X)`` is
            close to zero. These values are ignored any way so they do
            not disrupt the squareform transformation.
-       
 
+
     Calling Conventions
     -------------------
 
@@ -1692,8 +1692,8 @@
 
          d(u,v) = \sum_u {|u_i-v_i|}
                          {|u_i|+|v_i|}
-                         
 
+
     12. ``Y = cdist(X, 'braycurtis')``
 
        Computes the Bray-Curtis distance between the points. The

Modified: branches/refactor_fft/scipy/cluster/hierarchy.py
===================================================================
--- branches/refactor_fft/scipy/cluster/hierarchy.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/cluster/hierarchy.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -345,7 +345,7 @@
 
        Performs centroid/UPGMC linkage on the condensed distance
        matrix ``y``.  See ``linkage`` for more information on the return
-       structure and algorithm. 
+       structure and algorithm.
 
     2. Z = centroid(X)
 
@@ -427,7 +427,7 @@
 
 
 def linkage(y, method='single', metric='euclidean'):
-    """ 
+    """
     Performs hierarchical/agglomerative clustering on the
     condensed distance matrix y. y must be a {n \choose 2} sized
     vector where n is the number of original observations paired
@@ -665,7 +665,7 @@
         The number of leaf nodes (original observations) belonging to
         the cluster node nd. If the target node is a leaf, 1 is
         returned.
-        
+
         :Returns:
 
            c : int
@@ -713,7 +713,7 @@
         the list.
 
         For example, the statement:
-        
+
            ids = root.preOrder(lambda x: x.id)
 
         returns a list of the node ids corresponding to the leaf nodes
@@ -730,7 +730,7 @@
 
         :Returns:
            - L : list
-             The pre-order traversal.                    
+             The pre-order traversal.
         """
 
         # Do a preorder traversal, caching the result. To avoid having to do
@@ -773,7 +773,7 @@
     Converts a hierarchical clustering encoded in the matrix Z (by
     linkage) into an easy-to-use tree object. The reference r to the
     root cnode object is returned.
-    
+
     Each cnode object has a left, right, dist, id, and count
     attribute. The left and right attributes point to cnode objects
     that were combined to generate the cluster. If both are None then
@@ -885,12 +885,12 @@
          hierarchical clustering defined by the linkage matrix ``Z``
          of a set of :math:`$n$` observations in :math:`$m$`
          dimensions. ``Y`` is the condensed distance matrix from which
-         ``Z`` was generated. 
+         ``Z`` was generated.
 
     :Returns:
        - c : ndarray
          The cophentic correlation distance (if ``y`` is passed).
- 
+
        - d : ndarray
          The cophenetic distance matrix in condensed form. The
          :math:`$ij$`th entry is the cophenetic distance between
@@ -964,8 +964,8 @@
            The :math:`$(n-1)$` by 4 matrix encoding the linkage
            (hierarchical clustering).  See ``linkage`` documentation
            for more information on its form.
-       
 
+
     :Returns:
        - R : ndarray
            A :math:`$(n-1)$` by 5 matrix where the ``i``'th row

Modified: branches/refactor_fft/scipy/interpolate/interpolate_wrapper.py
===================================================================
--- branches/refactor_fft/scipy/interpolate/interpolate_wrapper.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/interpolate/interpolate_wrapper.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -119,20 +119,20 @@
     return new_y
 
 def block(x, y, new_x):
-        """ Essentially a step function.
-        
-            For each new_x[i], finds largest j such that
-            x[j] < new_x[j], and returns y[j].
-        """
-        # find index of values in x that preceed values in x
-        # This code is a little strange -- we really want a routine that
-        # returns the index of values where x[j] < x[index]
-        TINY = 1e-10
-        indices = np.searchsorted(x, new_x+TINY)-1
+    """ Essentially a step function.
+    
+        For each new_x[i], finds largest j such that
+        x[j] < new_x[j], and returns y[j].
+    """
+    # find index of values in x that preceed values in x
+    # This code is a little strange -- we really want a routine that
+    # returns the index of values where x[j] < x[index]
+    TINY = 1e-10
+    indices = np.searchsorted(x, new_x+TINY)-1
 
-        # If the value is at the front of the list, it'll have -1.
-        # In this case, we will use the first (0), element in the array.
-        # take requires the index array to be an Int
-        indices = np.atleast_1d(np.clip(indices, 0, np.Inf).astype(np.int))
-        new_y = np.take(y, indices, axis=-1)
-        return new_y
\ No newline at end of file
+    # If the value is at the front of the list, it'll have -1.
+    # In this case, we will use the first (0), element in the array.
+    # take requires the index array to be an Int
+    indices = np.atleast_1d(np.clip(indices, 0, np.Inf).astype(np.int))
+    new_y = np.take(y, indices, axis=-1)
+    return new_y

Modified: branches/refactor_fft/scipy/interpolate/setup.py
===================================================================
--- branches/refactor_fft/scipy/interpolate/setup.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/interpolate/setup.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -22,9 +22,9 @@
                         )
 
     config.add_extension('_interpolate',
-	                 sources=['src/_interpolate.cpp'],
-	                 include_dirs = ['src'],
-	                 depends = ['src/interpolate.h'])
+                         sources=['src/_interpolate.cpp'],
+                         include_dirs = ['src'],
+                         depends = ['src/interpolate.h'])
 
     config.add_data_dir('tests')
 

Modified: branches/refactor_fft/scipy/io/matlab/byteordercodes.py
===================================================================
--- branches/refactor_fft/scipy/io/matlab/byteordercodes.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/io/matlab/byteordercodes.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -18,21 +18,21 @@
            'swapped': ('swapped', 'S')}
 
 def to_numpy_code(code):
-    ''' Convert various order codings to numpy format 
+    ''' Convert various order codings to numpy format
     Parameters
     ----------
     code : {'little','big','l','b','le','be','<','>',
              'native','=',
              'swapped', 's'} string
           code is converted to lower case before parsing
-    
+
     Returns
     -------
     out_code : {'<','>'} string
-             where '<' is the numpy dtype code for little 
+             where '<' is the numpy dtype code for little
              endian, and '>' is the code for big endian
-    
 
+
     Examples
     --------
     >>> import sys
@@ -64,5 +64,3 @@
     else:
         raise ValueError(
             'We cannot handle byte order %s' % code)
-
-

Modified: branches/refactor_fft/scipy/io/matlab/mio.py
===================================================================
--- branches/refactor_fft/scipy/io/matlab/mio.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/io/matlab/mio.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -68,7 +68,7 @@
         raise NotImplementedError('Please use PyTables for matlab v7.3 (HDF) files')
     else:
         raise TypeError('Did not recognize version %s' % mv)
-    
+
 def loadmat(file_name,  mdict=None, appendmat=True, basename='raw', **kwargs):
     ''' Load Matlab(tm) file
 
@@ -96,8 +96,8 @@
                           (implies squeeze_me=False, chars_as_strings=False,
                           mat_dtype=True)
     struct_as_record    - whether to load matlab structs as numpy record arrays, or
-    			  as old-style numpy arrays with dtype=object.
-                          (warns if not set, and defaults to False.  non-recarrays 
+                          as old-style numpy arrays with dtype=object.
+                          (warns if not set, and defaults to False.  non-recarrays
                           cannot be exported via savemat.)
 
     v4 (Level 1.0), v6 and v7.1 matfiles are supported.

Modified: branches/refactor_fft/scipy/io/matlab/mio5.py
===================================================================
--- branches/refactor_fft/scipy/io/matlab/mio5.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/io/matlab/mio5.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -202,7 +202,7 @@
             mod8 = byte_count % 8
             if mod8:
                 self.mat_stream.seek(8 - mod8, 1)
-            
+
         if mdtype in self.codecs: # encoded char data
             codec = self.codecs[mdtype]
             if not codec:
@@ -216,7 +216,7 @@
                             buffer=raw_str)
             if copy:
                 el = el.copy()
-       
+
         return el
 
     def matrix_getter_factory(self):
@@ -428,7 +428,7 @@
         tupdims = tuple(self.header['dims'][::-1])
         length = np.product(tupdims)
         if self.struct_as_record:
-            result = np.empty(length, dtype=[(field_name, object) 
+            result = np.empty(length, dtype=[(field_name, object)
                                              for field_name in field_names])
             for i in range(length):
                 for field_name in field_names:
@@ -442,14 +442,14 @@
                 for name in field_names:
                     item.__dict__[name] = self.read_element()
                 result[i] = item
-        
+
         return result.reshape(tupdims).T
 
 class MatlabObject(object):
     ''' Class to contain read data from matlab objects '''
     def __init__(self, classname, field_names):
         self.__dict__['classname'] = classname
-        self.__dict__['mobj_recarray'] = np.empty((1,1), dtype=[(field_name, object) 
+        self.__dict__['mobj_recarray'] = np.empty((1,1), dtype=[(field_name, object)
                                             for field_name in field_names])
 
     def __getattr__(self, name):
@@ -464,8 +464,8 @@
             self.__dict__['mobj_recarray'][0,0][name] = value
         else:
             self.__dict__[name] = value
-        
 
+
 class Mat5ObjectMatrixGetter(Mat5MatrixGetter):
     def get_array(self):
         '''Matlab ojects are essentially structs, with an extra field, the classname.'''
@@ -495,7 +495,7 @@
 class MatFile5Reader(MatFileReader):
     ''' Reader for Mat 5 mat files
     Adds the following attribute to base class
-    
+
     uint16_codec       - char codec to use for uint16 char arrays
                           (defaults to system default codec)
    '''
@@ -513,9 +513,9 @@
         '''
         mat_stream : file-like
                      object with file API, open for reading
-        byte_order : {None, string} 
+        byte_order : {None, string}
                       specification of byte order, one of:
-		      ('native', '=', 'little', '<', 'BIG', '>')
+                      ('native', '=', 'little', '<', 'BIG', '>')
         mat_dtype : {True, False} boolean
                      If True, return arrays in same dtype as loaded into matlab
                      otherwise return with dtype with which they were saved
@@ -527,7 +527,7 @@
                      If True, returns matrices as would be loaded by matlab
                      (implies squeeze_me=False, chars_as_strings=False
                      mat_dtype=True, struct_as_record=True)
-        struct_as_record : {False, True} boolean 
+        struct_as_record : {False, True} boolean
                      If True, return strutures as numpy records,
                      otherwise, return as custom object (for
                      compatibility with scipy 0.6)
@@ -766,8 +766,8 @@
     def __init__(self, file_stream, arr, name, is_global=False, unicode_strings=False):
         super(Mat5CompositeWriter, self).__init__(file_stream, arr, name, is_global)
         self.unicode_strings = unicode_strings
-        
 
+
 class Mat5CellWriter(Mat5CompositeWriter):
     def write(self):
         self.write_header(mclass=mxCELL_CLASS)
@@ -797,12 +797,12 @@
 class Mat5StructWriter(Mat5CompositeWriter):
     def write(self):
         self.write_header(mclass=mxSTRUCT_CLASS)
-        
+
         # write fieldnames
         fieldnames = [f[0] for f in self.arr.dtype.descr]
         self.write_element(np.array([32], dtype='i4'))
         self.write_element(np.array(fieldnames, dtype='S32'), mdtype=miINT8)
-        
+
         A = np.atleast_2d(self.arr).flatten('F')
         MWG = Mat5WriterGetter(self.file_stream, self.unicode_strings)
         for el in A:
@@ -826,7 +826,7 @@
         fieldnames = [f[0] for f in self.arr.dtype.descr]
         self.write_element(np.array([32], dtype='i4'))
         self.write_element(np.array(fieldnames, dtype='S32'), mdtype=miINT8)
-        
+
         A = np.atleast_2d(self.arr).flatten('F')
         MWG = Mat5WriterGetter(self.file_stream, self.unicode_strings)
         for el in A:
@@ -835,7 +835,7 @@
                 MW.write()
         self.update_matrix_tag()
 
-    
+
 class Mat5WriterGetter(object):
     ''' Wraps stream and options, provides methods for getting Writer objects '''
     def __init__(self, stream, unicode_strings):
@@ -854,12 +854,12 @@
         if spsparse:
             if spsparse.issparse(arr):
                 return Mat5SparseWriter(self.stream, arr, name, is_global)
-            
+
         if isinstance(arr, MatlabFunctionMatrix):
             return Mat5FunctionWriter(self.stream, arr, name, is_global, self.unicode_strings)
         if isinstance(arr, MatlabObject):
             return Mat5ObjectWriter(self.stream, arr, name, is_global, self.unicode_strings)
-        
+
         arr = np.array(arr)
         if arr.dtype.hasobject:
             if arr.dtype.fields == None:

Modified: branches/refactor_fft/scipy/io/matlab/miobase.py
===================================================================
--- branches/refactor_fft/scipy/io/matlab/miobase.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/io/matlab/miobase.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -29,7 +29,7 @@
      #. 0,x -> version 4 format mat files
      #. 1,x -> version 5 format mat files
      #. 2,x -> version 7.3 format mat files (HDF format)
-     
+
     Parameters
     ----------
     fileobj : {file-like}
@@ -54,7 +54,7 @@
     if 0 in mopt_bytes:
         fileobj.seek(0)
         return (0,0)
-    
+
     # For 5 format or 7.3 format we need to read an integer in the
     # header. Bytes 124 through 128 contain a version integer and an
     # endian test string
@@ -144,9 +144,9 @@
         '''
         mat_stream : file-like
                      object with file API, open for reading
-        byte_order : {None, string} 
+        byte_order : {None, string}
                       specification of byte order, one of:
-		      ('native', '=', 'little', '<', 'BIG', '>')
+                      ('native', '=', 'little', '<', 'BIG', '>')
         mat_dtype : {True, False} boolean
                      If True, return arrays in same dtype as loaded into matlab
                      otherwise return with dtype with which they were saved
@@ -158,7 +158,7 @@
                      If True, returns matrices as would be loaded by matlab
                      (implies squeeze_me=False, chars_as_strings=False
                      mat_dtype=True)
- 
+
         '''
         # Initialize stream
         self.mat_stream = mat_stream
@@ -234,7 +234,7 @@
 
     def matrix_getter_factory(self):
         assert False, 'Not implemented'
-    
+
     def file_header(self):
         return {}
 

Modified: branches/refactor_fft/scipy/io/matlab/tests/test_byteordercodes.py
===================================================================
--- branches/refactor_fft/scipy/io/matlab/tests/test_byteordercodes.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/io/matlab/tests/test_byteordercodes.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -11,13 +11,13 @@
 def test_native():
     native_is_le = sys.byteorder == 'little'
     assert sibc.sys_is_le == native_is_le
-    
+
 def test_to_numpy():
     if sys.byteorder == 'little':
         assert sibc.to_numpy_code('native') == '<'
         assert sibc.to_numpy_code('swapped') == '>'
     else:
-        assert sibc.to_numpy_code('native') == '>' 
+        assert sibc.to_numpy_code('native') == '>'
         assert sibc.to_numpy_code('swapped') == '<'
     assert sibc.to_numpy_code('native') == sibc.to_numpy_code('=')
     assert sibc.to_numpy_code('big') == '>'
@@ -26,5 +26,3 @@
     for code in ('big', '>', 'b', 'B', 'be'):
         assert sibc.to_numpy_code(code) == '>'
     assert_raises(ValueError, sibc.to_numpy_code, 'silly string')
-   
-

Modified: branches/refactor_fft/scipy/io/matlab/tests/test_mio.py
===================================================================
--- branches/refactor_fft/scipy/io/matlab/tests/test_mio.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/io/matlab/tests/test_mio.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -70,7 +70,7 @@
             assert k in matdict, "Missing key at %s" % k_label
             _check_level(k_label, expected, matdict[k])
 
-# Round trip tests 
+# Round trip tests
 def _rt_check_case(name, expected, format):
     mat_stream = StringIO()
     savemat(mat_stream, expected, format=format)
@@ -155,7 +155,7 @@
      'expected': {'testsparsefloat': SP.csc_matrix(array([[-1+2j,0,2],[0,-3j,0]]))},
      },
     ]
-st = array([(u'Rats live on no evil star.', array([sqrt(2),exp(1),pi]), (1+1j)*array([sqrt(2),exp(1),pi]))], 
+st = array([(u'Rats live on no evil star.', array([sqrt(2),exp(1),pi]), (1+1j)*array([sqrt(2),exp(1),pi]))],
            dtype=[(n, object) for n in ['stringfield', 'doublefield', 'complexfield']])
 case_table5.append(
     {'name': 'struct',
@@ -253,7 +253,7 @@
     assert_array_almost_equal(actual['x'].todense(),
                               expected['x'].todense())
 
-    
+
 def test_mat73():
     # Check any hdf5 files raise an error
     filenames = glob(

Modified: branches/refactor_fft/scipy/ndimage/filters.py
===================================================================
--- branches/refactor_fft/scipy/ndimage/filters.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/ndimage/filters.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -45,7 +45,7 @@
 def moredoc(*args):
     def decorate(f):
         if f.__doc__ is not None:
-            for a in args: 
+            for a in args:
                 f.__doc__ += a
         return f
     return decorate

Modified: branches/refactor_fft/scipy/optimize/tests/test_nnls.py
===================================================================
--- branches/refactor_fft/scipy/optimize/tests/test_nnls.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/optimize/tests/test_nnls.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -22,6 +22,3 @@
 
 if __name__ == "__main__":
     run_module_suite()
-
-
-

Modified: branches/refactor_fft/scipy/sparse/base.py
===================================================================
--- branches/refactor_fft/scipy/sparse/base.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/base.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -5,9 +5,7 @@
 
 from warnings import warn
 
-import numpy
-from numpy import asarray, asmatrix, asanyarray, ones, deprecate, ravel, \
-        matrix
+import numpy as np
 
 from sputils import isdense, isscalarlike, isintlike
 
@@ -70,7 +68,7 @@
             raise TypeError('invalid shape')
 
         if not (shape[0] >= 1 and shape[1] >= 1):
-            raise TypeError('invalid shape')
+            raise ValueError('invalid shape')
 
         if (self._shape != shape) and (self._shape is not None):
             try:
@@ -100,7 +98,7 @@
             return self
         else:
             for fp_type in fp_types:
-                if self.dtype <= numpy.dtype(fp_type):
+                if self.dtype <= np.dtype(fp_type):
                     return self.astype(fp_type)
 
             raise TypeError,'cannot upcast [%s] to a floating \
@@ -137,15 +135,15 @@
             format = 'und'
         return format
 
-    @deprecate
+    @np.deprecate
     def rowcol(self, num):
         return (None, None)
 
-    @deprecate
+    @np.deprecate
     def getdata(self, num):
         return None
 
-    @deprecate
+    @np.deprecate
     def listprint(self, start, stop):
         """Provides a way to print over a single index.
         """
@@ -212,10 +210,12 @@
         else:
             return getattr(self,'to' + format)()
 
-    # default operations use the CSR format as a base
-    #   and operations return in csr format
-    #  thus, a new sparse matrix format just needs to define
-    #  a tocsr method
+    ###################################################################
+    #  NOTE: All arithmetic operations use csr_matrix by default.
+    # Therefore a new sparse matrix format just needs to define a
+    # .tocsr() method to provide arithmetic support.  Any of these
+    # methods can be overridden for efficiency.
+    ####################################################################
 
     def multiply(self, other):
         """Point-wise multiplication by another matrix
@@ -239,13 +239,34 @@
         return self.tocsr().__rsub__(other)
 
     # old __mul__ interfaces
-    def matvec(self, other):
+    @np.deprecate
+    def matvec(self,other):
         return self * other
-    def matmat(self, other):
+
+    @np.deprecate
+    def matmat(self,other):
         return self * other
+
+    @np.deprecate
     def dot(self, other):
         return self * other
 
+    @np.deprecate
+    def rmatvec(self, other, conjugate=True):
+        """Multiplies the vector 'other' by the sparse matrix, returning a
+        dense vector as a result.
+
+        If 'conjugate' is True:
+            - returns A.transpose().conj() * other
+        Otherwise:
+            - returns A.transpose() * other.
+
+        """
+        if conjugate:
+            return self.conj().transpose() * other
+        else:
+            return self.transpose() * other
+
     def __mul__(self, other):
         """interpret other and call one of the following
 
@@ -268,18 +289,18 @@
             other.shape
         except AttributeError:
             # If it's a list or whatever, treat it like a matrix
-            other = asanyarray(other)
+            other = np.asanyarray(other)
 
-        if isdense(other) and asarray(other).squeeze().ndim <= 1:
+        if isdense(other) and np.asarray(other).squeeze().ndim <= 1:
             ##
             # dense row or column vector
             if other.shape != (N,) and other.shape != (N,1):
                 raise ValueError('dimension mismatch')
 
-            result = self._mul_vector(ravel(other))
+            result = self._mul_vector(np.ravel(other))
 
-            if isinstance(other, matrix):
-                result = asmatrix(result)
+            if isinstance(other, np.matrix):
+                result = np.asmatrix(result)
 
             if other.ndim == 2 and other.shape[1] == 1:
                 # If 'other' was an (nx1) column vector, reshape the result
@@ -294,10 +315,10 @@
             if other.shape[0] != self.shape[1]:
                 raise ValueError('dimension mismatch')
 
-            result = self._mul_dense_matrix(asarray(other))
+            result = self._mul_dense_matrix(np.asarray(other))
 
-            if isinstance(other, matrix):
-                result = asmatrix(result)
+            if isinstance(other, np.matrix):
+                result = np.asmatrix(result)
 
             return result
         else:
@@ -316,9 +337,21 @@
     def _mul_sparse_matrix(self, other):
         return self.tocsr()._mul_sparse_matrix(other)
 
-    def __rmul__(self, other):
-        return self.tocsr().__rmul__(other)
+    def __rmul__(self, other): # other * self
+        if isscalarlike(other):
+            return self.__mul__(other)
+        else:
+            # Don't use asarray unless we have to
+            try:
+                tr = other.transpose()
+            except AttributeError:
+                tr = np.asarray(other).transpose()
+            return (self.transpose() * tr).transpose()
 
+    ####################
+    # Other Arithmetic #
+    ####################
+
     def __truediv__(self, other):
         if isscalarlike(other):
             return self * (1./other)
@@ -349,12 +382,12 @@
 
     def __pow__(self, other):
         if self.shape[0] != self.shape[1]:
-            raise TypeError,'matrix is not square'
+            raise TypeError('matrix is not square')
 
         if isintlike(other):
             other = int(other)
             if other < 0:
-                raise ValueError,'exponent must be >= 0'
+                raise ValueError('exponent must be >= 0')
 
             if other == 0:
                 from construct import identity
@@ -367,7 +400,7 @@
                     result = result*self
                 return result
         elif isscalarlike(other):
-            raise ValueError,'exponent must be an integer'
+            raise ValueError('exponent must be an integer')
         elif isspmatrix(other):
             warn('Using ** for elementwise multiplication is deprecated.'\
                     'Use .multiply() instead', DeprecationWarning)
@@ -460,36 +493,11 @@
         a[0, i] = 1
         return a * self
 
-
-    def rmatvec(self, other, conjugate=True):
-        """Multiplies the vector 'other' by the sparse matrix, returning a
-        dense vector as a result.
-
-        If 'conjugate' is True:
-            - returns A.transpose().conj() * other
-        Otherwise:
-            - returns A.transpose() * other.
-
-        """
-        return self.tocsr().rmatvec(other, conjugate=conjugate)
-
-    #def rmatmat(self, other, conjugate=True):
-    #    """ If 'conjugate' is True:
-    #        returns other * A.transpose().conj(),
-    #    where 'other' is a matrix.  Otherwise:
-    #        returns other * A.transpose().
-    #    """
-    #    other = csc_matrix(other)
-    #    if conjugate:
-    #        return other.matmat(self.transpose()).conj()
-    #    else:
-    #        return other.matmat(self.transpose())
-
     #def __array__(self):
     #    return self.toarray()
 
     def todense(self):
-        return asmatrix(self.toarray())
+        return np.asmatrix(self.toarray())
 
     def toarray(self):
         return self.tocoo().toarray()
@@ -522,13 +530,13 @@
         m, n = self.shape
         if axis == 0:
             # sum over columns
-            return asmatrix(ones((1, m), dtype=self.dtype)) * self
+            return np.asmatrix(np.ones((1, m), dtype=self.dtype)) * self
         elif axis == 1:
             # sum over rows
-            return self * asmatrix(ones((n, 1), dtype=self.dtype))
+            return self * np.asmatrix(np.ones((n, 1), dtype=self.dtype))
         elif axis is None:
             # sum over rows and columns
-            return ( self * asmatrix(ones((n, 1), dtype=self.dtype)) ).sum()
+            return ( self * np.asmatrix(np.ones((n, 1), dtype=self.dtype)) ).sum()
         else:
             raise ValueError, "axis out of bounds"
 

Modified: branches/refactor_fft/scipy/sparse/bsr.py
===================================================================
--- branches/refactor_fft/scipy/sparse/bsr.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/bsr.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -6,8 +6,7 @@
 
 from warnings import warn
 
-from numpy import zeros, intc, array, asarray, arange, diff, tile, rank, \
-                  ravel, empty, empty_like
+import numpy as np
 
 from data import _data_matrix
 from compressed import _cs_matrix
@@ -97,10 +96,10 @@
 
 
         if isspmatrix(arg1):
-            if arg1.format == self.format and copy:
+            if isspmatrix_bsr(arg1) and copy:
                 arg1 = arg1.copy()
             else:
-                arg1 = getattr(arg1,'to' + self.format)(blocksize=blocksize)
+                arg1 = arg1.tobsr(blocksize=blocksize)
             self._set_self( arg1 )
 
         elif isinstance(arg1,tuple):
@@ -113,16 +112,16 @@
                     blocksize = (1,1)
                 else:
                     if not isshape(blocksize):
-                        raise ValueError,'invalid blocksize=%s',blocksize
+                        raise ValueError('invalid blocksize=%s' % blocksize)
                     blocksize = tuple(blocksize)
-                self.data   = zeros( (0,) + blocksize, getdtype(dtype, default=float) )
-                self.indices = zeros( 0, dtype=intc )
+                self.data    = np.zeros( (0,) + blocksize, getdtype(dtype, default=float) )
+                self.indices = np.zeros( 0, dtype=np.intc )
 
                 R,C = blocksize
                 if (M % R) != 0 or (N % C) != 0:
                     raise ValueError, 'shape must be multiple of blocksize'
 
-                self.indptr  = zeros(M/R + 1, dtype=intc )
+                self.indptr  = np.zeros(M/R + 1, dtype=np.intc )
 
             elif len(arg1) == 2:
                 # (data,(row,col)) format
@@ -132,21 +131,20 @@
             elif len(arg1) == 3:
                 # (data,indices,indptr) format
                 (data, indices, indptr) = arg1
-                self.indices = array(indices, copy=copy)
-                self.indptr  = array(indptr,  copy=copy)
-                self.data    = array(data,    copy=copy, \
-                        dtype=getdtype(dtype, data))
+                self.indices = np.array(indices, copy=copy)
+                self.indptr  = np.array(indptr,  copy=copy)
+                self.data    = np.array(data,    copy=copy, dtype=getdtype(dtype, data))
             else:
-                raise ValueError,'unrecognized bsr_matrix constructor usage'
+                raise ValueError('unrecognized bsr_matrix constructor usage')
         else:
             #must be dense
             try:
-                arg1 = asarray(arg1)
+                arg1 = np.asarray(arg1)
             except:
-                raise ValueError, "unrecognized form for" \
-                        " %s_matrix constructor" % self.format
+                raise ValueError("unrecognized form for" \
+                        " %s_matrix constructor" % self.format)
             from coo import coo_matrix
-            arg1 = self.__class__( coo_matrix(arg1), blocksize=blocksize )
+            arg1 = coo_matrix(arg1).tobsr(blocksize=blocksize)
             self._set_self( arg1 )
 
         if shape is not None:
@@ -193,14 +191,14 @@
                     % self.indices.dtype.name )
 
         # only support 32-bit ints for now
-        self.indptr  = asarray(self.indptr,intc)
-        self.indices = asarray(self.indices,intc)
+        self.indptr  = np.asarray(self.indptr, np.intc)
+        self.indices = np.asarray(self.indices, np.intc)
         self.data    = to_native(self.data)
 
         # check array shapes
-        if (rank(self.indices) != 1) or (rank(self.indptr) != 1):
+        if np.rank(self.indices) != 1 or np.rank(self.indptr) != 1:
             raise ValueError,"indices, and indptr should be rank 1"
-        if rank(self.data) != 3:
+        if np.rank(self.data) != 3:
             raise ValueError,"data should be rank 3"
 
         # check index pointer
@@ -260,9 +258,9 @@
         """
         M,N = self.shape
         R,C = self.blocksize
-        y = empty( min(M,N), dtype=upcast(self.dtype) )
+        y = np.empty(min(M,N), dtype=upcast(self.dtype))
         sparsetools.bsr_diagonal(M/R, N/C, R, C, \
-                self.indptr, self.indices, ravel(self.data), y)
+                self.indptr, self.indices, np.ravel(self.data), y)
         return y
 
     ##########################
@@ -292,7 +290,7 @@
         M,N = self.shape
         R,C = self.blocksize
 
-        result = zeros( self.shape[0], dtype=upcast(self.dtype, other.dtype) )
+        result = np.zeros(self.shape[0], dtype=upcast(self.dtype, other.dtype))
 
         bsr_matvec(M/R, N/C, R, C, \
             self.indptr, self.indices, self.data.ravel(),
@@ -305,7 +303,7 @@
         M,N = self.shape
         n_vecs = other.shape[1] #number of column vectors
 
-        result = zeros( (M,n_vecs), dtype=upcast(self.dtype,other.dtype) )
+        result = np.zeros((M,n_vecs), dtype=upcast(self.dtype,other.dtype))
 
         bsr_matvecs(M/R, N/C, n_vecs, R, C, \
                 self.indptr, self.indices, self.data.ravel(), \
@@ -313,17 +311,11 @@
 
         return result
 
-    #def _mul_dense_matrix(self, other):
-    #    # TODO make sparse * dense matrix multiplication more efficient
-    #    # matvec each column of other
-    #    result = hstack( [ self * col.reshape(-1,1) for col in asarray(other).T ] )
-    #    return result
-
     def _mul_sparse_matrix(self, other):
         M, K1 = self.shape
         K2, N = other.shape
 
-        indptr = empty_like( self.indptr )
+        indptr = np.empty_like( self.indptr )
 
         R,n = self.blocksize
 
@@ -336,7 +328,7 @@
         from csr import isspmatrix_csr
 
         if isspmatrix_csr(other) and n == 1:
-            other = other.tobsr(blocksize=(n,C),copy=False) #convert to this format
+            other = other.tobsr(blocksize=(n,C), copy=False) #lightweight conversion
         else:
             other = other.tobsr(blocksize=(n,C))
 
@@ -346,15 +338,16 @@
                 indptr)
 
         bnnz = indptr[-1]
-        indices = empty( bnnz, dtype=intc)
-        data    = empty( R*C*bnnz, dtype=upcast(self.dtype,other.dtype))
+        indices = np.empty(bnnz, dtype=np.intc)
+        data    = np.empty(R*C*bnnz, dtype=upcast(self.dtype,other.dtype))
 
         bsr_matmat_pass2( M/R, N/C, R, C, n, \
-                self.indptr,  self.indices,  ravel(self.data), \
-                other.indptr, other.indices, ravel(other.data), \
+                self.indptr,  self.indices,  np.ravel(self.data), \
+                other.indptr, other.indices, np.ravel(other.data), \
                 indptr,       indices,       data)
 
         data = data.reshape(-1,R,C)
+
         #TODO eliminate zeros
 
         return bsr_matrix((data,indices,indptr),shape=(M,N),blocksize=(R,C))
@@ -391,13 +384,13 @@
         M,N = self.shape
         R,C = self.blocksize
 
-        row  = (R * arange(M/R)).repeat(diff(self.indptr))
+        row  = (R * np.arange(M/R)).repeat(np.diff(self.indptr))
         row  = row.repeat(R*C).reshape(-1,R,C)
-        row += tile( arange(R).reshape(-1,1), (1,C) )
+        row += np.tile(np.arange(R).reshape(-1,1), (1,C))
         row  = row.reshape(-1)
 
         col  = (C * self.indices).repeat(R*C).reshape(-1,R,C)
-        col += tile( arange(C), (R,1) )
+        col += np.tile(np.arange(C), (R,1))
         col  = col.reshape(-1)
 
         data = self.data.reshape(-1)
@@ -406,7 +399,7 @@
             data = data.copy()
 
         from coo import coo_matrix
-        return coo_matrix( (data,(row,col)), shape=self.shape )
+        return coo_matrix((data,(row,col)), shape=self.shape)
 
 
     def transpose(self):
@@ -416,17 +409,17 @@
         NBLK = self.nnz/(R*C)
 
         if self.nnz == 0:
-            return bsr_matrix((N,M),blocksize=(C,R))
+            return bsr_matrix((N,M), blocksize=(C,R))
 
-        indptr  = empty( N/C + 1,    dtype=self.indptr.dtype)
-        indices = empty( NBLK,       dtype=self.indices.dtype)
-        data    = empty( (NBLK,C,R), dtype=self.data.dtype)
+        indptr  = np.empty( N/C + 1,    dtype=self.indptr.dtype)
+        indices = np.empty( NBLK,       dtype=self.indices.dtype)
+        data    = np.empty( (NBLK,C,R), dtype=self.data.dtype)
 
         bsr_transpose(M/R, N/C, R, C, \
                       self.indptr, self.indices, self.data.ravel(), \
                       indptr,      indices,      data.ravel())
 
-        return bsr_matrix( (data,indices,indptr), shape=(N,M) )
+        return bsr_matrix((data,indices,indptr), shape=(N,M))
 
 
     ##############################################################
@@ -510,13 +503,13 @@
         R,C = self.blocksize
 
         max_bnnz = len(self.data) + len(other.data)
-        indptr  = empty_like(self.indptr)
-        indices = empty( max_bnnz, dtype=intc )
-        data    = empty( R*C*max_bnnz, dtype=upcast(self.dtype,other.dtype) )
+        indptr  = np.empty_like(self.indptr)
+        indices = np.empty(max_bnnz, dtype=np.intc)
+        data    = np.empty(R*C*max_bnnz, dtype=upcast(self.dtype,other.dtype))
 
         fn(in_shape[0]/R, in_shape[1]/C, R, C, \
-                self.indptr,  self.indices,  ravel(self.data),
-                other.indptr, other.indices, ravel(other.data),
+                self.indptr,  self.indices,  np.ravel(self.data),
+                other.indptr, other.indices, np.ravel(other.data),
                 indptr,       indices,       data)
 
         actual_bnnz = indptr[-1]

Modified: branches/refactor_fft/scipy/sparse/compressed.py
===================================================================
--- branches/refactor_fft/scipy/sparse/compressed.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/compressed.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -5,8 +5,7 @@
 
 from warnings import warn
 
-from numpy import array, asarray, zeros, rank, intc, empty, isscalar, \
-                  empty_like, where, concatenate, deprecate, diff, multiply
+import numpy as np
 
 from base import spmatrix, isspmatrix, SparseEfficiencyWarning
 from data import _data_matrix
@@ -15,7 +14,6 @@
         isscalarlike, isintlike
 
 
-
 class _cs_matrix(_data_matrix):
     """base matrix class for compressed row and column oriented matrices"""
 
@@ -43,9 +41,9 @@
                 # create empty matrix
                 self.shape = arg1   #spmatrix checks for errors here
                 M, N = self.shape
-                self.data    = zeros(0, getdtype(dtype, default=float))
-                self.indices = zeros(0, intc)
-                self.indptr  = zeros(self._swap((M,N))[0] + 1, dtype=intc)
+                self.data    = np.zeros(0, getdtype(dtype, default=float))
+                self.indices = np.zeros(0, np.intc)
+                self.indptr  = np.zeros(self._swap((M,N))[0] + 1, dtype=np.intc)
             else:
                 if len(arg1) == 2:
                     # (data, ij) format
@@ -55,9 +53,9 @@
                 elif len(arg1) == 3:
                     # (data, indices, indptr) format
                     (data, indices, indptr) = arg1
-                    self.indices = array(indices, copy=copy)
-                    self.indptr  = array(indptr, copy=copy)
-                    self.data    = array(data, copy=copy, dtype=getdtype(dtype, data))
+                    self.indices = np.array(indices, copy=copy)
+                    self.indptr  = np.array(indptr, copy=copy)
+                    self.data    = np.array(data, copy=copy, dtype=getdtype(dtype, data))
                 else:
                     raise ValueError, "unrecognized %s_matrix constructor usage" %\
                             self.format
@@ -65,7 +63,7 @@
         else:
             #must be dense
             try:
-                arg1 = asarray(arg1)
+                arg1 = np.asarray(arg1)
             except:
                 raise ValueError, "unrecognized %s_matrix constructor usage" % \
                         self.format
@@ -128,14 +126,13 @@
                     % self.indices.dtype.name )
 
         # only support 32-bit ints for now
-        self.indptr  = asarray(self.indptr,dtype=intc)
-        self.indices = asarray(self.indices,dtype=intc)
+        self.indptr  = np.asarray(self.indptr,  dtype=np.intc)
+        self.indices = np.asarray(self.indices, dtype=np.intc)
         self.data    = to_native(self.data)
 
         # check array shapes
-        if (rank(self.data) != 1) or (rank(self.indices) != 1) or \
-           (rank(self.indptr) != 1):
-            raise ValueError,"data, indices, and indptr should be rank 1"
+        if np.rank(self.data) != 1 or np.rank(self.indices) != 1 or np.rank(self.indptr) != 1:
+            raise ValueError('data, indices, and indptr should be rank 1')
 
         # check index pointer
         if (len(self.indptr) != major_dim + 1 ):
@@ -164,7 +161,7 @@
                 if self.indices.min() < 0:
                     raise ValueError, "%s index values must be >= 0" % \
                             minor_name
-                if diff(self.indptr).min() < 0:
+                if np.diff(self.indptr).min() < 0:
                     raise ValueError,'index pointer values must form a " \
                                         "non-decreasing sequence'
 
@@ -225,18 +222,6 @@
             raise NotImplementedError
 
 
-    def __rmul__(self, other): # other * self
-        if isscalarlike(other):
-            return self.__mul__(other)
-        else:
-            # Don't use asarray unless we have to
-            try:
-                tr = other.transpose()
-            except AttributeError:
-                tr = asarray(other).transpose()
-            return (self.transpose() * tr).transpose()
-
-
     def __truediv__(self,other):
         if isscalarlike(other):
             return self * (1./other)
@@ -258,7 +243,7 @@
             raise ValueError('inconsistent shapes')
 
         if isdense(other):
-            return multiply(self.todense(),other)
+            return np.multiply(self.todense(),other)
         else:
             other = self.__class__(other)
             return self._binopt(other,'_elmul_')
@@ -272,7 +257,7 @@
         M,N = self.shape
 
         #output array
-        result = zeros( self.shape[0], dtype=upcast(self.dtype,other.dtype) )
+        result = np.zeros( self.shape[0], dtype=upcast(self.dtype,other.dtype) )
 
         # csr_matvec or csc_matvec
         fn = getattr(sparsetools,self.format + '_matvec')
@@ -285,7 +270,7 @@
         M,N = self.shape
         n_vecs = other.shape[1] #number of column vectors
 
-        result = zeros( (M,n_vecs), dtype=upcast(self.dtype,other.dtype) )
+        result = np.zeros( (M,n_vecs), dtype=upcast(self.dtype,other.dtype) )
 
         # csr_matvecs or csc_matvecs
         fn = getattr(sparsetools,self.format + '_matvecs')
@@ -299,7 +284,7 @@
         K2, N = other.shape
 
         major_axis = self._swap((M,N))[0]
-        indptr = empty( major_axis + 1, dtype=intc )
+        indptr = np.empty(major_axis + 1, dtype=np.intc)
 
         other = self.__class__(other) #convert to this format
         fn = getattr(sparsetools, self.format + '_matmat_pass1')
@@ -308,8 +293,8 @@
                   indptr)
 
         nnz = indptr[-1]
-        indices = empty( nnz, dtype=intc)
-        data    = empty( nnz, dtype=upcast(self.dtype,other.dtype))
+        indices = np.empty(nnz, dtype=np.intc)
+        data    = np.empty(nnz, dtype=upcast(self.dtype,other.dtype))
 
         fn = getattr(sparsetools, self.format + '_matmat_pass2')
         fn( M, N, self.indptr, self.indices, self.data, \
@@ -318,125 +303,8 @@
 
         return self.__class__((data,indices,indptr),shape=(M,N))
 
-    def matvec(self,other):
-        return self * other
 
-    def matmat(self,other):
-        return self * other
-
-    #def matmat(self, other):
-    #    if isspmatrix(other):
-    #        M, K1 = self.shape
-    #        K2, N = other.shape
-    #        if (K1 != K2):
-    #            raise ValueError, "shape mismatch error"
-
-    #        #return self._binopt(other,'mu',in_shape=(M,N),out_shape=(M,N))
-
-    #        major_axis = self._swap((M,N))[0]
-    #        indptr = empty( major_axis + 1, dtype=intc )
-
-    #        other = self.__class__(other) #convert to this format
-    #        fn = getattr(sparsetools, self.format + '_matmat_pass1')
-    #        fn( M, N, self.indptr, self.indices, \
-    #                  other.indptr, other.indices, \
-    #                  indptr)
-
-    #        nnz = indptr[-1]
-    #        indices = empty( nnz, dtype=intc)
-    #        data    = empty( nnz, dtype=upcast(self.dtype,other.dtype))
-
-    #        fn = getattr(sparsetools, self.format + '_matmat_pass2')
-    #        fn( M, N, self.indptr, self.indices, self.data, \
-    #                  other.indptr, other.indices, other.data, \
-    #                  indptr, indices, data)
-
-    #        return self.__class__((data,indices,indptr),shape=(M,N))
-
-
-    #    elif isdense(other):
-    #        # TODO make sparse * dense matrix multiplication more efficient
-    #
-    #        # matvec each column of other
-    #        result = hstack( [ self * col.reshape(-1,1) for col in asarray(other).T ] )
-    #        if isinstance(other, matrix):
-    #            result = asmatrix(result)
-    #        return result
-
-    #    else:
-    #        raise TypeError, "need a dense or sparse matrix"
-
-
-    #def matvec(self, other):
-    #    """Sparse matrix vector product (self * other)
-
-    #    'other' may be a rank 1 array of length N or a rank 2 array
-    #    or matrix with shape (N,1).
-
-    #    """
-    #    #If the optional 'output' parameter is defined, it will
-    #    #be used to store the result.  Otherwise, a new vector
-    #    #will be allocated.
-
-    #    if isdense(other):
-    #        M,N = self.shape
-
-    #        if other.shape != (N,) and other.shape != (N,1):
-    #            raise ValueError, "dimension mismatch"
-
-    #        # csrmux, cscmux
-    #        fn = getattr(sparsetools,self.format + '_matvec')
-
-    #        #output array
-    #        y = zeros( self.shape[0], dtype=upcast(self.dtype,other.dtype) )
-
-    #        #if output is None:
-    #        #    y = empty( self.shape[0], dtype=upcast(self.dtype,other.dtype) )
-    #        #else:
-    #        #    if output.shape != (M,) and output.shape != (M,1):
-    #        #        raise ValueError, "output array has improper dimensions"
-    #        #    if not output.flags.c_contiguous:
-    #        #        raise ValueError, "output array must be contiguous"
-    #        #    if output.dtype != upcast(self.dtype,other.dtype):
-    #        #        raise ValueError, "output array has dtype=%s "\
-    #        #                "dtype=%s is required" % \
-    #        #                (output.dtype,upcast(self.dtype,other.dtype))
-    #        #    y = output
-
-    #        fn(self.shape[0], self.shape[1], \
-    #            self.indptr, self.indices, self.data, numpy.ravel(other), y)
-
-    #        if isinstance(other, matrix):
-    #            y = asmatrix(y)
-
-    #        if other.ndim == 2 and other.shape[1] == 1:
-    #            # If 'other' was an (nx1) column vector, reshape the result
-    #            y = y.reshape(-1,1)
-
-    #        return y
-
-    #    elif isspmatrix(other):
-    #        raise TypeError, "use matmat() for sparse * sparse"
-
-    #    else:
-    #        raise TypeError, "need a dense vector"
-
-    def rmatvec(self, other, conjugate=True):
-        """Multiplies the vector 'other' by the sparse matrix, returning a
-        dense vector as a result.
-
-        If 'conjugate' is True:
-            - returns A.transpose().conj() * other
-        Otherwise:
-            - returns A.transpose() * other.
-
-        """
-        if conjugate:
-            return self.transpose().conj().matvec( other )
-        else:
-            return self.transpose().matvec( other )
-
-    @deprecate
+    @np.deprecate
     def getdata(self, ind):
         return self.data[ind]
 
@@ -445,7 +313,7 @@
         """
         #TODO support k-th diagonal
         fn = getattr(sparsetools, self.format + "_diagonal")
-        y = empty( min(self.shape), dtype=upcast(self.dtype) )
+        y = np.empty( min(self.shape), dtype=upcast(self.dtype) )
         fn(self.shape[0], self.shape[1], self.indptr, self.indices, self.data, y)
         return y
 
@@ -506,7 +374,7 @@
 
         start = self.indptr[major_index]
         end   = self.indptr[major_index+1]
-        indxs = where(minor_index == self.indices[start:end])[0]
+        indxs = np.where(minor_index == self.indices[start:end])[0]
 
         num_matches = len(indxs)
 
@@ -539,7 +407,7 @@
 
         index  = self.indices[indices] - start
         data   = self.data[indices]
-        indptr = array([0, len(indices)])
+        indptr = np.array([0, len(indices)])
         return self.__class__((data, index, indptr), shape=shape, \
                               dtype=self.dtype)
 
@@ -563,7 +431,7 @@
 
                 return i0, i1
 
-            elif isscalar( sl ):
+            elif np.isscalar( sl ):
                 if sl < 0:
                     sl += num
 
@@ -612,7 +480,7 @@
 
             start = self.indptr[major_index]
             end   = self.indptr[major_index+1]
-            indxs = where(minor_index == self.indices[start:end])[0]
+            indxs = np.where(minor_index == self.indices[start:end])[0]
 
             num_matches = len(indxs)
 
@@ -627,10 +495,10 @@
                 newindx = self.indices[start:end].searchsorted(minor_index)
                 newindx += start
 
-                val = array([val],dtype=self.data.dtype)
-                minor_index = array([minor_index],dtype=self.indices.dtype)
-                self.data    = concatenate((self.data[:newindx],val,self.data[newindx:]))
-                self.indices = concatenate((self.indices[:newindx],minor_index,self.indices[newindx:]))
+                val = np.array([val],dtype=self.data.dtype)
+                minor_index = np.array([minor_index],dtype=self.indices.dtype)
+                self.data    = np.concatenate((self.data[:newindx],val,self.data[newindx:]))
+                self.indices = np.concatenate((self.indices[:newindx],minor_index,self.indices[newindx:]))
 
                 self.indptr[major_index+1:] += 1
 
@@ -670,7 +538,7 @@
             data = data.copy()
             minor_indices = minor_indices.copy()
 
-        major_indices = empty(len(minor_indices),dtype=intc)
+        major_indices = np.empty(len(minor_indices), dtype=np.intc)
 
         sparsetools.expandptr(major_dim,self.indptr,major_indices)
 
@@ -814,9 +682,9 @@
         fn = getattr(sparsetools, self.format + op + self.format)
 
         maxnnz = self.nnz + other.nnz
-        indptr  = empty_like(self.indptr)
-        indices = empty( maxnnz, dtype=intc )
-        data    = empty( maxnnz, dtype=upcast(self.dtype,other.dtype) )
+        indptr  = np.empty_like(self.indptr)
+        indices = np.empty(maxnnz, dtype=np.intc)
+        data    = np.empty(maxnnz, dtype=upcast(self.dtype,other.dtype))
 
         fn(in_shape[0], in_shape[1], \
                 self.indptr,  self.indices,  self.data,

Modified: branches/refactor_fft/scipy/sparse/construct.py
===================================================================
--- branches/refactor_fft/scipy/sparse/construct.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/construct.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -9,9 +9,7 @@
 
 from warnings import warn
 
-import numpy
-from numpy import ones, arange, intc, asarray, rank, zeros, \
-        cumsum, concatenate, empty
+import numpy as np
 
 from sputils import upcast
 
@@ -84,28 +82,28 @@
     """
 
     if format in ['csr','csc']:
-        indptr  = arange(n+1, dtype=intc)
-        indices = arange(n, dtype=intc)
-        data    = ones(n, dtype=dtype)
+        indptr  = np.arange(n+1, dtype=np.intc)
+        indices = np.arange(n,   dtype=np.intc)
+        data    = np.ones(n,     dtype=dtype)
         cls = eval('%s_matrix' % format)
         return cls((data,indices,indptr),(n,n))
     elif format == 'coo':
-        row  = arange(n, dtype=intc)
-        col  = arange(n, dtype=intc)
-        data = ones(n, dtype=dtype)
+        row  = np.arange(n, dtype=np.intc)
+        col  = np.arange(n, dtype=np.intc)
+        data = np.ones(n, dtype=dtype)
         return coo_matrix((data,(row,col)),(n,n))
     elif format == 'dia':
-        data = ones(n, dtype=dtype)
+        data = np.ones(n, dtype=dtype)
         diags = [0]
-        return dia_matrix( (data,diags), shape=(n,n) )
+        return dia_matrix((data,diags), shape=(n,n))
     else:
-        return identity( n, dtype=dtype, format='csr').asformat(format)
+        return identity(n, dtype=dtype, format='csr').asformat(format)
 
 def eye(m, n, k=0, dtype='d', format=None):
     """eye(m, n) returns a sparse (m x n) matrix where the k-th diagonal
     is all ones and everything else is zeros.
     """
-    diags = ones((1, m), dtype=dtype)
+    diags = np.ones((1, m), dtype=dtype)
     return spdiags(diags, k, m, n).asformat(format)
 
 def kron(A, B, format=None):
@@ -148,7 +146,7 @@
         #B is fairly dense, use BSR
         A = csr_matrix(A,copy=True)
 
-        output_shape = (A.shape[0]*B.shape[0],A.shape[1]*B.shape[1])
+        output_shape = (A.shape[0]*B.shape[0], A.shape[1]*B.shape[1])
 
         if A.nnz == 0 or B.nnz == 0:
             # kronecker product is the zero matrix
@@ -158,11 +156,11 @@
         data = A.data.repeat(B.size).reshape(-1,B.shape[0],B.shape[1])
         data = data * B
 
-        return bsr_matrix((data,A.indices,A.indptr),shape=output_shape)
+        return bsr_matrix((data,A.indices,A.indptr), shape=output_shape)
     else:
         #use COO
         A = coo_matrix(A)
-        output_shape = (A.shape[0]*B.shape[0],A.shape[1]*B.shape[1])
+        output_shape = (A.shape[0]*B.shape[0], A.shape[1]*B.shape[1])
 
         if A.nnz == 0 or B.nnz == 0:
             # kronecker product is the zero matrix
@@ -231,7 +229,7 @@
     return (L+R).asformat(format) #since L + R is not always same format
 
 
-def hstack( blocks, format=None, dtype=None ):
+def hstack(blocks, format=None, dtype=None):
     """Stack sparse matrices horizontally (column wise)
 
     Parameters
@@ -256,7 +254,7 @@
     """
     return bmat([blocks], format=format, dtype=dtype)
 
-def vstack( blocks, format=None, dtype=None ):
+def vstack(blocks, format=None, dtype=None):
     """Stack sparse matrices vertically (row wise)
 
     Parameters
@@ -282,7 +280,7 @@
     """
     return bmat([ [b] for b in blocks ], format=format, dtype=dtype)
 
-def bmat( blocks, format=None, dtype=None ):
+def bmat(blocks, format=None, dtype=None):
     """Build a sparse matrix from sparse sub-blocks
 
     Parameters
@@ -313,16 +311,16 @@
 
     """
 
-    blocks = asarray(blocks, dtype='object')
+    blocks = np.asarray(blocks, dtype='object')
 
-    if rank(blocks) != 2:
+    if np.rank(blocks) != 2:
         raise ValueError('blocks must have rank 2')
 
     M,N = blocks.shape
 
-    block_mask   = zeros( blocks.shape, dtype='bool' )
-    brow_lengths = zeros( blocks.shape[0], dtype=int )
-    bcol_lengths = zeros( blocks.shape[1], dtype=int )
+    block_mask   = np.zeros(blocks.shape,    dtype=np.bool)
+    brow_lengths = np.zeros(blocks.shape[0], dtype=np.intc)
+    bcol_lengths = np.zeros(blocks.shape[1], dtype=np.intc)
 
     # convert everything to COO format
     for i in range(M):
@@ -355,12 +353,12 @@
     if dtype is None:
         dtype = upcast( *tuple([A.dtype for A in blocks[block_mask]]) )
 
-    row_offsets = concatenate(([0],cumsum(brow_lengths)))
-    col_offsets = concatenate(([0],cumsum(bcol_lengths)))
+    row_offsets = np.concatenate(([0], np.cumsum(brow_lengths)))
+    col_offsets = np.concatenate(([0], np.cumsum(bcol_lengths)))
 
-    data = empty(nnz, dtype=dtype)
-    row  = empty(nnz, dtype=intc)
-    col  = empty(nnz, dtype=intc)
+    data = np.empty(nnz, dtype=dtype)
+    row  = np.empty(nnz, dtype=np.intc)
+    col  = np.empty(nnz, dtype=np.intc)
 
     nnz = 0
     for i in range(M):
@@ -376,8 +374,8 @@
 
                 nnz += A.nnz
 
-    shape = (sum(brow_lengths),sum(bcol_lengths))
-    return coo_matrix( (data, (row, col)), shape=shape ).asformat(format)
+    shape = (np.sum(brow_lengths), np.sum(bcol_lengths))
+    return coo_matrix((data, (row, col)), shape=shape).asformat(format)
 
 
 
@@ -387,13 +385,11 @@
 
 __all__ += [ 'speye','spidentity', 'spkron', 'lil_eye', 'lil_diags' ]
 
-from numpy import deprecate
+spkron      = np.deprecate(kron,     oldname='spkron',     newname='scipy.sparse.kron')
+speye       = np.deprecate(eye,      oldname='speye',      newname='scipy.sparse.eye')
+spidentity  = np.deprecate(identity, oldname='spidentity', newname='scipy.sparse.identity')
 
-spkron      = deprecate(kron,     oldname='spkron',     newname='scipy.sparse.kron')
-speye       = deprecate(eye,      oldname='speye',      newname='scipy.sparse.eye')
-spidentity  = deprecate(identity, oldname='spidentity', newname='scipy.sparse.identity')
 
-
 def lil_eye((r,c), k=0, dtype='d'):
     """Generate a lil_matrix of dimensions (r,c) with the k-th
     diagonal set to 1.
@@ -413,13 +409,11 @@
     warn("lil_eye is deprecated." \
             "use scipy.sparse.eye(r, c, k, format='lil') instead", \
             DeprecationWarning)
-    return eye(r,c,k,dtype=dtype,format='lil')
+    return eye(r, c, k, dtype=dtype, format='lil')
 
-from numpy import clip
-from itertools import izip
 
 #TODO remove this function
-def lil_diags(diags,offsets,(m,n),dtype='d'):
+def lil_diags(diags, offsets, (m,n), dtype='d'):
     """Generate a lil_matrix with the given diagonals.
 
     Parameters
@@ -449,7 +443,7 @@
         raise ValueError("Number of diagonals provided should "
                          "agree with offsets.")
 
-    sort_indices = numpy.argsort(offsets_unsorted)
+    sort_indices = np.argsort(offsets_unsorted)
     diags = [diags_unsorted[k] for k in sort_indices]
     offsets = [offsets_unsorted[k] for k in sort_indices]
 
@@ -459,8 +453,10 @@
                              "diagonal %s." % k)
 
     out = lil_matrix((m,n),dtype=dtype)
+
+    from itertools import izip
     for k,diag in izip(offsets,diags):
-        for ix,c in enumerate(xrange(clip(k,0,n),clip(m+k,0,n))):
+        for ix,c in enumerate(xrange(np.clip(k,0,n),np.clip(m+k,0,n))):
             out.rows[c-k].append(c)
             out.data[c-k].append(diag[ix])
     return out

Modified: branches/refactor_fft/scipy/sparse/coo.py
===================================================================
--- branches/refactor_fft/scipy/sparse/coo.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/coo.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -4,11 +4,9 @@
 
 __all__ = ['coo_matrix', 'isspmatrix_coo']
 
-from itertools import izip
 from warnings import warn
 
-from numpy import array, asarray, empty, intc, zeros, unique, searchsorted,\
-                  atleast_2d, rank, deprecate, hstack
+import numpy as np
 
 from sparsetools import coo_tocsr, coo_todense, coo_matvec
 from base import isspmatrix
@@ -108,9 +106,9 @@
             if isshape(arg1):
                 M, N = arg1
                 self.shape = (M,N)
-                self.row  = array([], dtype=intc)
-                self.col  = array([], dtype=intc)
-                self.data = array([], getdtype(dtype, default=float))
+                self.row  = np.array([], dtype=np.intc)
+                self.col  = np.array([], dtype=np.intc)
+                self.data = np.array([], getdtype(dtype, default=float))
             else:
                 try:
                     obj, ij = arg1
@@ -123,9 +121,9 @@
                 except TypeError:
                     raise TypeError('invalid input format')
 
-                self.row  = array(ij[0], copy=copy, dtype=intc)
-                self.col  = array(ij[1], copy=copy, dtype=intc)
-                self.data = array(  obj, copy=copy)
+                self.row  = np.array(ij[0], copy=copy, dtype=np.intc)
+                self.col  = np.array(ij[1], copy=copy, dtype=np.intc)
+                self.data = np.array(  obj, copy=copy)
 
                 if shape is None:
                     if len(self.row) == 0 or len(self.col) == 0:
@@ -145,9 +143,9 @@
             warn('coo_matrix(None, shape=(M,N)) is deprecated, ' \
                     'use coo_matrix( (M,N) ) instead', DeprecationWarning)
             self.shape = shape
-            self.data = array([], getdtype(dtype, default=float))
-            self.row = array([], dtype=intc)
-            self.col = array([], dtype=intc)
+            self.data = np.array([], getdtype(dtype, default=float))
+            self.row  = np.array([], dtype=np.intc)
+            self.col  = np.array([], dtype=np.intc)
         else:
             if isspmatrix(arg1):
                 if isspmatrix_coo(arg1) and copy:
@@ -164,11 +162,11 @@
             else:
                 #dense argument
                 try:
-                    M = atleast_2d(asarray(arg1))
+                    M = np.atleast_2d(np.asarray(arg1))
                 except:
                     raise TypeError('invalid input format')
 
-                if len(M.shape) != 2:
+                if np.rank(M) != 2:
                     raise TypeError('expected rank <= 2 array or matrix')
                 self.shape = M.shape
                 self.row,self.col = (M != 0).nonzero()
@@ -178,10 +176,10 @@
 
     def getnnz(self):
         nnz = len(self.data)
-        if (nnz != len(self.row)) or (nnz != len(self.col)):
+        if nnz != len(self.row) or nnz != len(self.col):
             raise ValueError('row, column, and data array must all be the same length')
 
-        if rank(self.data) != 1 or rank(self.row) != 1 or rank(self.col) != 1:
+        if np.rank(self.data) != 1 or np.rank(self.row) != 1 or np.rank(self.col) != 1:
             raise ValueError('row, column, and data arrays must have rank 1')
 
         return nnz
@@ -200,8 +198,8 @@
                     % self.col.dtype.name )
 
         # only support 32-bit ints for now
-        self.row  = asarray(self.row, dtype=intc)
-        self.col  = asarray(self.col, dtype=intc)
+        self.row  = np.asarray(self.row, dtype=np.intc)
+        self.col  = np.asarray(self.col, dtype=np.intc)
         self.data = to_native(self.data)
 
         if nnz > 0:
@@ -215,73 +213,100 @@
                 raise ValueError('negative column index found')
 
 
-    @deprecate
+    @np.deprecate
     def rowcol(self, num):
         return (self.row[num], self.col[num])
 
-    @deprecate
+    @np.deprecate
     def getdata(self, num):
         return self.data[num]
 
-    def transpose(self,copy=False):
+    def transpose(self, copy=False):
         M,N = self.shape
-        return coo_matrix((self.data,(self.col,self.row)),(N,M),copy=copy)
+        return coo_matrix((self.data, (self.col, self.row)), shape=(N,M), copy=copy)
 
     def toarray(self):
-        B = zeros(self.shape, dtype=self.dtype)
+        B = np.zeros(self.shape, dtype=self.dtype)
         M,N = self.shape
-        coo_todense(M, N, self.nnz, self.row, self.col, self.data, B.ravel() )
+        coo_todense(M, N, self.nnz, self.row, self.col, self.data, B.ravel())
         return B
 
-    def tocsc(self,sum_duplicates=True):
+    def tocsc(self):
         """Return a copy of this matrix in Compressed Sparse Column format
 
-            By default sum_duplicates=True and any duplicate
-            matrix entries are added together.
+        Duplicate entries will be summed together.
 
+        Example
+        -------
+        >>> from numpy import array
+        >>> from scipy.sparse import coo_matrix
+        >>> row  = array([0,0,1,3,1,0,0])
+        >>> col  = array([0,2,1,3,1,0,0])
+        >>> data = array([1,1,1,1,1,1,1])
+        >>> A = coo_matrix( (data,(row,col)), shape=(4,4)).tocsc()
+        >>> A.todense()
+        matrix([[3, 0, 1, 0],
+                [0, 2, 0, 0],
+                [0, 0, 0, 0],
+                [0, 0, 0, 1]])
+
         """
         from csc import csc_matrix
         if self.nnz == 0:
             return csc_matrix(self.shape, dtype=self.dtype)
         else:
-            indptr  = empty(self.shape[1] + 1,dtype=intc)
-            indices = empty(self.nnz, dtype=intc)
-            data    = empty(self.nnz, dtype=upcast(self.dtype))
+            M,N = self.shape
+            indptr  = np.empty(N + 1,    dtype=np.intc)
+            indices = np.empty(self.nnz, dtype=np.intc)
+            data    = np.empty(self.nnz, dtype=upcast(self.dtype))
 
-            coo_tocsr(self.shape[1], self.shape[0], self.nnz, \
+            coo_tocsr(N, M, self.nnz, \
                       self.col, self.row, self.data, \
                       indptr, indices, data)
 
-            A = csc_matrix((data, indices, indptr), self.shape)
-            if sum_duplicates:
-                A.sum_duplicates()
+            A = csc_matrix((data, indices, indptr), shape=self.shape)
+            A.sum_duplicates()
+
             return A
 
-    def tocsr(self,sum_duplicates=True):
+    def tocsr(self):
         """Return a copy of this matrix in Compressed Sparse Row format
 
-            By default sum_duplicates=True and any duplicate
-            matrix entries are added together.
+        Duplicate entries will be summed together.
 
+        Example
+        -------
+        >>> from numpy import array
+        >>> from scipy.sparse import coo_matrix
+        >>> row  = array([0,0,1,3,1,0,0])
+        >>> col  = array([0,2,1,3,1,0,0])
+        >>> data = array([1,1,1,1,1,1,1])
+        >>> A = coo_matrix( (data,(row,col)), shape=(4,4)).tocsr()
+        >>> A.todense()
+        matrix([[3, 0, 1, 0],
+                [0, 2, 0, 0],
+                [0, 0, 0, 0],
+                [0, 0, 0, 1]])
+
         """
         from csr import csr_matrix
         if self.nnz == 0:
             return csr_matrix(self.shape, dtype=self.dtype)
         else:
-            indptr  = empty(self.shape[0] + 1,dtype=intc)
-            indices = empty(self.nnz, dtype=intc)
-            data    = empty(self.nnz, dtype=upcast(self.dtype))
+            M,N = self.shape
+            indptr  = np.empty(M + 1,    dtype=np.intc)
+            indices = np.empty(self.nnz, dtype=np.intc)
+            data    = np.empty(self.nnz, dtype=upcast(self.dtype))
 
-            coo_tocsr(self.shape[0], self.shape[1], self.nnz, \
+            coo_tocsr(M, N, self.nnz, \
                       self.row, self.col, self.data, \
                       indptr, indices, data)
 
-            A = csr_matrix((data, indices, indptr), self.shape)
-            if sum_duplicates:
-                A.sum_duplicates()
+            A = csr_matrix((data, indices, indptr), shape=self.shape)
+            A.sum_duplicates()
+
             return A
 
-
     def tocoo(self, copy=False):
         if copy:
             return self.copy()
@@ -292,7 +317,7 @@
         from dia import dia_matrix
 
         ks = self.col - self.row  #the diagonal for each nonzero
-        diags = unique(ks)
+        diags = np.unique(ks)
 
         if len(diags) > 100:
             #probably undesired, should we do something?
@@ -300,15 +325,16 @@
             pass
 
         #initialize and fill in data array
-        data = zeros( (len(diags), self.col.max()+1), dtype=self.dtype)
-        data[ searchsorted(diags,ks), self.col ] = self.data
+        data = np.zeros( (len(diags), self.col.max()+1), dtype=self.dtype)
+        data[ np.searchsorted(diags,ks), self.col ] = self.data
 
-        return dia_matrix((data,diags),shape=self.shape)
+        return dia_matrix((data,diags), shape=self.shape)
 
     def todok(self):
+        from itertools import izip
         from dok import dok_matrix
 
-        dok = dok_matrix((self.shape),dtype=self.dtype)
+        dok = dok_matrix((self.shape), dtype=self.dtype)
 
         dok.update( izip(izip(self.row,self.col),self.data) )
 
@@ -334,12 +360,12 @@
 
     def _mul_vector(self, other):
         #output array
-        result = zeros( self.shape[0], dtype=upcast(self.dtype,other.dtype) )
+        result = np.zeros( self.shape[0], dtype=upcast(self.dtype,other.dtype) )
         coo_matvec(self.nnz, self.row, self.col, self.data, other, result)
         return result
 
     def _mul_dense_matrix(self, other):
-        return hstack( [ self._mul_vector(col).reshape(-1,1) for col in other.T ] )
+        return np.hstack( [ self._mul_vector(col).reshape(-1,1) for col in other.T ] )
 
 from sputils import _isinstance
 

Modified: branches/refactor_fft/scipy/sparse/csc.py
===================================================================
--- branches/refactor_fft/scipy/sparse/csc.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/csc.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -6,7 +6,8 @@
 
 from warnings import warn
 
-from numpy import asarray, intc, empty, searchsorted, deprecate
+import numpy as np
+
 from sparsetools import csc_tocsr
 from sputils import upcast, isintlike
 
@@ -96,11 +97,11 @@
         for r in xrange(self.shape[0]):
             yield csr[r,:]
 
-    @deprecate
+    @np.deprecate
     def rowcol(self, ind):
         #TODO remove after 0.7
         row = self.indices[ind]
-        col = searchsorted(self.indptr, ind+1)-1
+        col = np.searchsorted(self.indptr, ind+1) - 1
         return (row, col)
 
     def tocsc(self, copy=False):
@@ -110,16 +111,17 @@
             return self
 
     def tocsr(self):
-        indptr  = empty(self.shape[0] + 1, dtype=intc)
-        indices = empty(self.nnz, dtype=intc)
-        data    = empty(self.nnz, dtype=upcast(self.dtype))
+        M,N = self.shape
+        indptr  = np.empty(M + 1,    dtype=np.intc)
+        indices = np.empty(self.nnz, dtype=np.intc)
+        data    = np.empty(self.nnz, dtype=upcast(self.dtype))
 
-        csc_tocsr(self.shape[0], self.shape[1], \
+        csc_tocsr(M, N, \
                  self.indptr, self.indices, self.data, \
                  indptr, indices, data)
 
         from csr import csr_matrix
-        A = csr_matrix((data, indices, indptr), self.shape)
+        A = csr_matrix((data, indices, indptr), shape=self.shape)
         A.has_sorted_indices = True
         return A
 
@@ -137,8 +139,8 @@
                 if isintlike(col) or isinstance(col,slice):
                     return self.T[col,row].T
                 else:
-                    row = asarray(row, dtype='intc')
-                    col = asarray(col, dtype='intc')
+                    row = np.asarray(row, dtype=np.intc)
+                    col = np.asarray(col, dtype=np.intc)
                     if len(row.shape) == 1:
                         return self.T[col,row]
                     elif len(row.shape) == 2:

Modified: branches/refactor_fft/scipy/sparse/csr.py
===================================================================
--- branches/refactor_fft/scipy/sparse/csr.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/csr.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -7,8 +7,7 @@
 
 from warnings import warn
 
-from numpy import asarray, asmatrix, zeros, intc, empty, isscalar, array, \
-                  searchsorted, where, deprecate, arange, ones, ravel
+import numpy as np
 
 from sparsetools import csr_tocsc, csr_tobsr, csr_count_blocks, \
         get_csr_submatrix
@@ -91,13 +90,13 @@
     def transpose(self, copy=False):
         from csc import csc_matrix
         M,N = self.shape
-        return csc_matrix((self.data,self.indices,self.indptr),(N,M),copy=copy)
+        return csc_matrix((self.data,self.indices,self.indptr), shape=(N,M), copy=copy)
 
-    @deprecate
+    @np.deprecate
     def rowcol(self, ind):
         #TODO remove after 0.7
         col = self.indices[ind]
-        row = searchsorted(self.indptr, ind+1)-1
+        row = np.searchsorted(self.indptr, ind+1)-1
         return (row, col)
 
 
@@ -105,7 +104,7 @@
         from lil import lil_matrix
         lil = lil_matrix(self.shape,dtype=self.dtype)
 
-        self.sort_indices() #lil_matrix needs sorted rows
+        self.sort_indices() #lil_matrix needs sorted column indices
 
         ptr,ind,dat = self.indptr,self.indices,self.data
         rows, data  = lil.rows, lil.data
@@ -125,28 +124,30 @@
             return self
 
     def tocsc(self):
-        indptr  = empty(self.shape[1] + 1, dtype=intc)
-        indices = empty(self.nnz, dtype=intc)
-        data    = empty(self.nnz, dtype=upcast(self.dtype))
+        indptr  = np.empty(self.shape[1] + 1, dtype=np.intc)
+        indices = np.empty(self.nnz, dtype=np.intc)
+        data    = np.empty(self.nnz, dtype=upcast(self.dtype))
 
         csr_tocsc(self.shape[0], self.shape[1], \
                   self.indptr, self.indices, self.data, \
                   indptr, indices, data)
 
         from csc import csc_matrix
-        A = csc_matrix((data, indices, indptr), self.shape)
+        A = csc_matrix((data, indices, indptr), shape=self.shape)
         A.has_sorted_indices = True
         return A
 
-    def tobsr(self,blocksize=None,copy=True):
+    def tobsr(self, blocksize=None, copy=True):
         from bsr import bsr_matrix
 
         if blocksize is None:
             from spfuncs import estimate_blocksize
             return self.tobsr(blocksize=estimate_blocksize(self))
+
         elif blocksize == (1,1):
             arg1 = (self.data.reshape(-1,1,1),self.indices,self.indptr)
-            return bsr_matrix( arg1, shape=self.shape, copy=copy )
+            return bsr_matrix(arg1, shape=self.shape, copy=copy )
+
         else:
             R,C = blocksize
             M,N = self.shape
@@ -156,14 +157,14 @@
 
             blks = csr_count_blocks(M,N,R,C,self.indptr,self.indices)
 
-            indptr  = empty( M/R + 1,    dtype=intc )
-            indices = empty( blks,       dtype=intc )
-            data    = zeros( (blks,R,C), dtype=self.dtype)
+            indptr  = np.empty(M/R + 1,    dtype=np.intc)
+            indices = np.empty(blks,       dtype=np.intc)
+            data    = np.zeros((blks,R,C), dtype=self.dtype)
 
             csr_tobsr(M, N, R, C, self.indptr, self.indices, self.data, \
                     indptr, indices, data.ravel() )
 
-            return bsr_matrix( (data,indices,indptr), shape=self.shape )
+            return bsr_matrix((data,indices,indptr), shape=self.shape)
 
     # these functions are used by the parent class (_cs_matrix)
     # to remove redudancy between csc_matrix and csr_matrix
@@ -176,7 +177,7 @@
     def __getitem__(self, key):
         def asindices(x):
             try:
-                x = asarray(x,dtype='intc')
+                x = np.asarray(x, dtype=np.intc)
             except:
                 raise IndexError('invalid index')
             else:
@@ -201,11 +202,11 @@
                 indices = indices.copy()
                 indices[indices < 0] += N
 
-            indptr  = arange(len(indices) + 1, dtype='intc')
-            data    = ones(len(indices), dtype=self.dtype)
+            indptr  = np.arange(len(indices) + 1, dtype=np.intc)
+            data    = np.ones(len(indices), dtype=self.dtype)
             shape   = (len(indices),N)
 
-            return csr_matrix( (data,indices,indptr), shape=shape)
+            return csr_matrix((data,indices,indptr), shape=shape)
 
 
         if isinstance(key, tuple):
@@ -245,10 +246,10 @@
                         val = []
                         for i,j in zip(row,col):
                             val.append(self._get_single_element(i,j))
-                        return asmatrix(val)
+                        return np.asmatrix(val)
 
                     elif len(row.shape) == 2:
-                        row = ravel(row)                    #[[[1],[2]],[1,2]]
+                        row = np.ravel(row)                   #[[[1],[2]],[1,2]]
                         P = extractor(row, self.shape[0])
                         return (P*self)[:,col]
 
@@ -276,7 +277,7 @@
 
         start = self.indptr[row]
         end   = self.indptr[row+1]
-        indxs = where(col == self.indices[start:end])[0]
+        indxs = np.where(col == self.indices[start:end])[0]
 
         num_matches = len(indxs)
 
@@ -288,7 +289,7 @@
         else:
             raise ValueError('nonzero entry (%d,%d) occurs more than once' % (row,col) )
 
-    def _get_row_slice(self, i, cslice ):
+    def _get_row_slice(self, i, cslice):
         """Returns a copy of row self[i, cslice]
         """
         if i < 0:
@@ -315,7 +316,7 @@
 
         index  = self.indices[indices] - start
         data   = self.data[indices]
-        indptr = array([0, len(indices)])
+        indptr = np.array([0, len(indices)])
         return csr_matrix( (data, index, indptr), shape=(1, stop-start) )
 
     def _get_submatrix( self, row_slice, col_slice ):

Modified: branches/refactor_fft/scipy/sparse/dia.py
===================================================================
--- branches/refactor_fft/scipy/sparse/dia.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/dia.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -2,10 +2,9 @@
 
 __docformat__ = "restructuredtext en"
 
-__all__ = ['dia_matrix','isspmatrix_dia']
+__all__ = ['dia_matrix', 'isspmatrix_dia']
 
-from numpy import asarray, zeros, arange, array, intc, atleast_1d, \
-                  atleast_2d, unique, hstack
+import numpy as np
 
 from base import isspmatrix, _formats
 from data import _data_matrix
@@ -72,9 +71,9 @@
             if isshape(arg1):
                 # It's a tuple of matrix dimensions (M, N)
                 # create empty matrix
-                self.shape = arg1   #spmatrix checks for errors here
-                self.data  = zeros( (0,0), getdtype(dtype, default=float))
-                self.offsets = zeros( (0), dtype=intc)
+                self.shape   = arg1   #spmatrix checks for errors here
+                self.data    = np.zeros( (0,0), getdtype(dtype, default=float))
+                self.offsets = np.zeros( (0), dtype=np.intc)
             else:
                 try:
                     # Try interpreting it as (data, offsets)
@@ -84,16 +83,16 @@
                 else:
                     if shape is None:
                         raise ValueError('expected a shape argument')
-                    self.data    = atleast_2d(array(arg1[0],dtype=dtype,copy=copy))
-                    self.offsets = atleast_1d(array(arg1[1],dtype='i',copy=copy))
+                    self.data    = np.atleast_2d(np.array(arg1[0], dtype=dtype, copy=copy))
+                    self.offsets = np.atleast_1d(np.array(arg1[1], dtype=np.intc, copy=copy))
                     self.shape   = shape
         else:
             #must be dense, convert to COO first, then to DIA
             try:
-                arg1 = asarray(arg1)
+                arg1 = np.asarray(arg1)
             except:
-                raise ValueError, "unrecognized form for" \
-                        " %s_matrix constructor" % self.format
+                raise ValueError("unrecognized form for" \
+                        " %s_matrix constructor" % self.format)
             from coo import coo_matrix
             A = coo_matrix(arg1).todia()
             self.data    = A.data
@@ -113,7 +112,7 @@
                     'does not match the number of offsets (%d)' \
                     % (self.data.shape[0], len(self.offsets)))
 
-        if len(unique(self.offsets)) != len(self.offsets):
+        if len(np.unique(self.offsets)) != len(self.offsets):
             raise ValueError('offset array contains duplicate values')
 
     def __repr__(self):
@@ -143,7 +142,7 @@
     def _mul_vector(self, other):
         x = other
 
-        y = zeros( self.shape[0], dtype=upcast(self.dtype,x.dtype))
+        y = np.zeros( self.shape[0], dtype=upcast(self.dtype,x.dtype))
 
         L = self.data.shape[1]
 
@@ -154,7 +153,7 @@
         return y
 
     def _mul_dense_matrix(self, other):
-        return hstack( [ self._mul_vector(col).reshape(-1,1) for col in other.T ] )
+        return np.hstack( [ self._mul_vector(col).reshape(-1,1) for col in other.T ] )
 
     def todia(self,copy=False):
         if copy:
@@ -164,17 +163,17 @@
 
     def tocsr(self):
         #this could be faster
-        return self.tocoo().tocsr(sum_duplicates=False)
+        return self.tocoo().tocsr()
 
     def tocsc(self):
         #this could be faster
-        return self.tocoo().tocsc(sum_duplicates=False)
+        return self.tocoo().tocsc()
 
     def tocoo(self):
         num_data = len(self.data)
         len_data = self.data.shape[1]
 
-        row = arange(len_data).reshape(1,-1).repeat(num_data,axis=0)
+        row = np.arange(len_data).reshape(1,-1).repeat(num_data,axis=0)
         col = row.copy()
 
         for i,k in enumerate(self.offsets):
@@ -187,10 +186,9 @@
         mask &= (col < self.shape[1])
         mask &= data != 0
         row,col,data = row[mask],col[mask],data[mask]
-        #row,col,data = row.reshape(-1),col.reshape(-1),data.reshape(-1)
 
         from coo import coo_matrix
-        return coo_matrix((data,(row,col)),shape=self.shape)
+        return coo_matrix((data,(row,col)), shape=self.shape)
 
     # needed by _data_matrix
     def _with_data(self, data, copy=True):
@@ -198,7 +196,7 @@
         but with different data.  By default the structure arrays are copied.
         """
         if copy:
-            return dia_matrix( (data,self.offsets.copy()), shape=self.shape)
+            return dia_matrix( (data, self.offsets.copy()), shape=self.shape)
         else:
             return dia_matrix( (data,self.offsets), shape=self.shape)
 

Modified: branches/refactor_fft/scipy/sparse/dok.py
===================================================================
--- branches/refactor_fft/scipy/sparse/dok.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/dok.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -13,9 +13,11 @@
 from sputils import isdense, getdtype, isshape, isintlike, isscalarlike
 
 class dok_matrix(spmatrix, dict):
-    """Dictionary Of Keys based matrix.  This is an efficient
-    structure for constructing sparse matrices incrementally.
+    """Dictionary Of Keys based sparse matrix.
 
+    This is an efficient structure for constructing sparse
+    matrices incrementally.
+
     This can be instatiated in several ways:
         dok_matrix(D)
             with a dense matrix, D
@@ -474,7 +476,7 @@
                     base[newkey] = self[key]
         return base, ext
 
-
+# TODO update these w/ new multiplication handlers
 #    def matvec(self, other):
 #        if isdense(other):
 #            if other.shape[0] != self.shape[1]:

Modified: branches/refactor_fft/scipy/sparse/lil.py
===================================================================
--- branches/refactor_fft/scipy/sparse/lil.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/lil.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -5,34 +5,30 @@
 
 __all__ = ['lil_matrix','isspmatrix_lil']
 
-import copy
 from bisect import bisect_left
 
-import numpy
-from numpy import isscalar, asmatrix, asarray, intc, concatenate, array, \
-        cumsum, zeros, unravel_index
+import numpy as np
 
 from base import spmatrix, isspmatrix
-from sputils import getdtype,isshape,issequence,isscalarlike
+from sputils import getdtype, isshape, issequence, isscalarlike
 
 class lil_matrix(spmatrix):
-    """Row-based linked list matrix
+    """Row-based linked list sparse matrix
 
+    This is an efficient structure for constructing sparse
+    matrices incrementally.
 
     This can be instantiated in several ways:
-        csc_matrix(D)
+        lil_matrix(D)
             with a dense matrix or rank-2 ndarray D
 
-        csc_matrix(S)
+        lil_matrix(S)
             with another sparse matrix S (equivalent to S.tocsc())
 
-        csc_matrix((M, N), [dtype])
+        lil_matrix((M, N), [dtype])
             to construct an empty matrix with shape (M, N)
             dtype is optional, defaulting to dtype='d'.
 
-        csc_matrix((data, ij), [shape=(M, N)])
-            where ``data`` and ``ij`` satisfy ``a[ij[0, k], ij[1, k]] = data[k]``
-
     Notes
     -----
 
@@ -60,54 +56,39 @@
 
     """
 
-    def __init__(self, A=None, shape=None, dtype=None, copy=False):
-        """ Create a new list-of-lists sparse matrix.  An optional
-        argument A is accepted, which initializes the lil_matrix with it.
-        This can be a tuple of dimensions (M, N) or a dense array /
-        matrix to copy, or a sparse matrix.
-        """
+    def __init__(self, arg1, shape=None, dtype=None, copy=False):
         spmatrix.__init__(self)
-        self.dtype = getdtype(dtype, A, default=float)
+        self.dtype = getdtype(dtype, arg1, default=float)
 
         # First get the shape
-        if A is None:
-            if not isshape(shape):
-                raise TypeError("need a valid shape")
-            M, N = shape
-            self.shape = (M,N)
-            self.rows = numpy.empty((M,), dtype=object)
-            self.data = numpy.empty((M,), dtype=object)
-            for i in range(M):
-                self.rows[i] = []
-                self.data[i] = []
-        elif isspmatrix(A):
-            if isspmatrix_lil(A) and copy:
-                A = A.copy()
+        if isspmatrix(arg1):
+            if isspmatrix_lil(arg1) and copy:
+                A = arg1.copy()
             else:
-                A = A.tolil()
+                A = arg1.tolil()
             self.shape = A.shape
             self.dtype = A.dtype
             self.rows  = A.rows
             self.data  = A.data
-        elif isinstance(A,tuple):
-            if isshape(A):
+        elif isinstance(arg1,tuple):
+            if isshape(arg1):
                 if shape is not None:
                     raise ValueError('invalid use of shape parameter')
-                M, N = A
+                M, N = arg1
                 self.shape = (M,N)
-                self.rows = numpy.empty((M,), dtype=object)
-                self.data = numpy.empty((M,), dtype=object)
+                self.rows = np.empty((M,), dtype=object)
+                self.data = np.empty((M,), dtype=object)
                 for i in range(M):
                     self.rows[i] = []
                     self.data[i] = []
             else:
-                raise TypeError,'unrecognized lil_matrix constructor usage'
+                raise TypeError('unrecognized lil_matrix constructor usage')
         else:
             #assume A is dense
             try:
-                A = asmatrix(A)
+                A = np.asmatrix(arg1)
             except TypeError:
-                raise TypeError, "unsupported matrix type"
+                raise TypeError('unsupported matrix type')
             else:
                 from csr import csr_matrix
                 A = csr_matrix(A).tolil()
@@ -177,7 +158,7 @@
             j += self.shape[1]
 
         if j < 0 or j > self.shape[1]:
-            raise IndexError,'column index out of bounds'
+            raise IndexError('column index out of bounds')
 
         pos = bisect_left(row, j)
         if pos != len(data) and row[pos] == j:
@@ -210,10 +191,10 @@
         try:
             i, j = index
         except (AssertionError, TypeError):
-            raise IndexError, "invalid index"
+            raise IndexError('invalid index')
 
-        if isscalar(i):
-            if isscalar(j):
+        if np.isscalar(i):
+            if np.isscalar(j):
                 return self._get1(i, j)
             if isinstance(j, slice):
                 j = self._slicetoseq(j, self.shape[1])
@@ -224,7 +205,7 @@
         elif issequence(i) or isinstance(i, slice):
             if isinstance(i, slice):
                 i = self._slicetoseq(i, self.shape[0])
-            if isscalar(j):
+            if np.isscalar(j):
                 return self.__class__([[self._get1(ii, j)] for ii in i])
             if isinstance(j, slice):
                 j = self._slicetoseq(j, self.shape[1])
@@ -249,7 +230,7 @@
             j += self.shape[1]
 
         if j < 0 or j >= self.shape[1]:
-            raise IndexError,'column index out of bounds'
+            raise IndexError('column index out of bounds')
 
         pos = bisect_left(row, j)
         if x != 0:
@@ -274,22 +255,22 @@
         if issequence(j):
             if isinstance(x, spmatrix):
                 x = x.todense()
-            x = numpy.asarray(x).squeeze()
-            if isscalar(x) or x.size == 1:
+            x = np.asarray(x).squeeze()
+            if np.isscalar(x) or x.size == 1:
                 for jj in j:
                     self._insertat2(row, data, jj, x)
             else:
                 # x must be one D. maybe check these things out
                 for jj, xx in zip(j, x):
                     self._insertat2(row, data, jj, xx)
-        elif isscalar(j):
+        elif np.isscalar(j):
             self._insertat2(row, data, j, x)
         else:
-            raise ValueError, "invalid column value: %s" % str(j)
+            raise ValueError('invalid column value: %s' % str(j))
 
 
     def __setitem__(self, index, x):
-        if isscalar(x):
+        if np.isscalar(x):
             x = self.dtype.type(x)
         elif not isinstance(x, spmatrix):
             x = lil_matrix(x)
@@ -297,7 +278,7 @@
         try:
             i, j = index
         except (ValueError, TypeError):
-            raise IndexError, "invalid index"
+            raise IndexError('invalid index')
 
         if isspmatrix(x):
             if (isinstance(i, slice) and (i == slice(None))) and \
@@ -308,12 +289,12 @@
                 self.data = x.data
                 return
 
-        if isscalar(i):
+        if np.isscalar(i):
             row = self.rows[i]
             data = self.data[i]
             self._insertat3(row, data, j, x)
         elif issequence(i) and issequence(j):
-            if isscalar(x):
+            if np.isscalar(x):
                 for ii, jj in zip(i, j):
                     self._insertat(ii, jj, x)
             else:
@@ -322,32 +303,32 @@
         elif isinstance(i, slice) or issequence(i):
             rows = self.rows[i]
             datas = self.data[i]
-            if isscalar(x):
+            if np.isscalar(x):
                 for row, data in zip(rows, datas):
                     self._insertat3(row, data, j, x)
             else:
                 for row, data, xx in zip(rows, datas, x):
                     self._insertat3(row, data, j, xx)
         else:
-            raise ValueError, "invalid index value: %s" % str((i, j))
+            raise ValueError('invalid index value: %s' % str((i, j)))
 
     def _mul_scalar(self, other):
         if other == 0:
             # Multiply by zero: return the zero matrix
-            new = lil_matrix(shape=self.shape, dtype=self.dtype)
+            new = lil_matrix(self.shape, dtype=self.dtype)
         else:
             new = self.copy()
             # Multiply this scalar by every element.
-            new.data = numpy.array([[val*other for val in rowvals] for
-                                    rowvals in new.data], dtype=object)
+            new.data = np.array([[val*other for val in rowvals] for
+                                  rowvals in new.data], dtype=object)
         return new
 
     def __truediv__(self, other):           # self / other
         if isscalarlike(other):
             new = self.copy()
             # Divide every element by this scalar
-            new.data = numpy.array([[val/other for val in rowvals] for
-                                    rowvals in new.data], dtype=object)
+            new.data = np.array([[val/other for val in rowvals] for
+                                  rowvals in new.data], dtype=object)
             return new
         else:
             return self.tocsr() / other
@@ -357,7 +338,7 @@
 #        """Point-wise multiplication by another lil_matrix.
 #
 #        """
-#        if isscalar(other):
+#        if np.isscalar(other):
 #            return self.__mul__(other)
 #
 #        if isspmatrix_lil(other):
@@ -386,37 +367,23 @@
 #                             "with another lil_matrix.")
 
     def copy(self):
+        from copy import deepcopy
         new = lil_matrix(self.shape, dtype=self.dtype)
-        new.data = copy.deepcopy(self.data)
-        new.rows = copy.deepcopy(self.rows)
+        new.data = deepcopy(self.data)
+        new.rows = deepcopy(self.rows)
         return new
 
     def reshape(self,shape):
-        new = lil_matrix(shape,dtype=self.dtype)
+        new = lil_matrix(shape, dtype=self.dtype)
         j_max = self.shape[1]
         for i,row in enumerate(self.rows):
             for col,j in enumerate(row):
-                new_r,new_c = unravel_index(i*j_max + j,shape)
+                new_r,new_c = np.unravel_index(i*j_max + j,shape)
                 new[new_r,new_c] = self[i,j]
         return new
 
-    def __add__(self, other):
-        if isscalar(other) and other != 0:
-            raise ValueError("Refusing to destroy sparsity. "
-                             "Use x.todense() + c instead.")
-        else:
-            return spmatrix.__add__(self, other)
-
-    def __rmul__(self, other):          # other * self
-        if isscalarlike(other):
-            # Multiplication by a scalar is symmetric
-            return self.__mul__(other)
-        else:
-            return spmatrix.__rmul__(self, other)
-
-
     def toarray(self):
-        d = zeros(self.shape, dtype=self.dtype)
+        d = np.zeros(self.shape, dtype=self.dtype)
         for i, row in enumerate(self.rows):
             for pos, j in enumerate(row):
                 d[i, j] = self.data[i][pos]
@@ -435,20 +402,20 @@
         """ Return Compressed Sparse Row format arrays for this matrix.
         """
 
-        indptr = asarray([len(x) for x in self.rows], dtype=intc)
-        indptr = concatenate( ( array([0],dtype=intc), cumsum(indptr) ) )
+        indptr = np.asarray([len(x) for x in self.rows], dtype=np.intc)
+        indptr = np.concatenate( (np.array([0], dtype=np.intc), np.cumsum(indptr)) )
 
         nnz = indptr[-1]
 
         indices = []
         for x in self.rows:
             indices.extend(x)
-        indices = asarray(indices,dtype=intc)
+        indices = np.asarray(indices, dtype=np.intc)
 
         data = []
         for x in self.data:
             data.extend(x)
-        data = asarray(data,dtype=self.dtype)
+        data = np.asarray(data, dtype=self.dtype)
 
         from csr import csr_matrix
         return csr_matrix((data, indices, indptr), shape=self.shape)

Modified: branches/refactor_fft/scipy/sparse/linalg/interface.py
===================================================================
--- branches/refactor_fft/scipy/sparse/linalg/interface.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/linalg/interface.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -127,8 +127,14 @@
                               matmat=matmat, dtype=A.dtype)
 
     elif isspmatrix(A):
-        return LinearOperator(A.shape, A.matvec, rmatvec=A.rmatvec,
-                              matmat=A.dot, dtype=A.dtype)
+        def matvec(v):
+            return A * v
+        def rmatvec(v):
+            return A.conj().transpose() * v
+        def matmat(V):
+            return A * V
+        return LinearOperator(A.shape, matvec, rmatvec=rmatvec,
+                              matmat=matmat, dtype=A.dtype)
 
     else:
         if hasattr(A,'shape') and hasattr(A,'matvec'):

Modified: branches/refactor_fft/scipy/sparse/linalg/isolve/iterative.py
===================================================================
--- branches/refactor_fft/scipy/sparse/linalg/isolve/iterative.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/linalg/isolve/iterative.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -400,7 +400,7 @@
                b or use xtype='f','d','F',or 'D'
     callback -- an optional user-supplied function to call after each
                 iteration.  It is called as callback(rk), where rk is the
-                the current relative residual 
+                the current relative residual
     """
     A,M,x,b,postprocess = make_system(A,M,x0,b,xtype)
 
@@ -442,7 +442,7 @@
             if resid_ready and callback is not None:
                 callback(resid)
                 resid_ready = False
-            
+
             break
         elif (ijob == 1):
             work[slice2] *= sclr2
@@ -452,7 +452,7 @@
             if not first_pass and old_ijob==3:
                 resid_ready = True
 
-            first_pass = False    
+            first_pass = False
         elif (ijob == 3):
             work[slice2] *= sclr2
             work[slice2] += sclr1*matvec(work[slice1])
@@ -466,7 +466,7 @@
                 info = -1
                 ftflag = False
             bnrm2, resid, info = stoptest(work[slice1], b, bnrm2, tol, info)
-        
+
         old_ijob = ijob
         ijob = 2
 

Modified: branches/refactor_fft/scipy/sparse/linalg/isolve/tests/test_iterative.py
===================================================================
--- branches/refactor_fft/scipy/sparse/linalg/isolve/tests/test_iterative.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/linalg/isolve/tests/test_iterative.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -61,7 +61,7 @@
         #data[1,:] = -1
         #A = spdiags( data, [0,-1], 10, 10, format='csr')
         #self.cases.append( (A,False,True) )
-    
+
     def test_maxiter(self):
         """test whether maxiter is respected"""
 
@@ -76,7 +76,7 @@
                 residuals.append( norm(b - A*x) )
 
             x, info = solver(A, b, x0=x0, tol=1e-8, maxiter=3, callback=callback)
-           
+
             assert(len(residuals) in [2,3])
 
             # TODO enforce this condition instead!
@@ -169,8 +169,8 @@
 
 
 class TestGMRES(TestCase):
-    def test_callback(self):  
-        
+    def test_callback(self):
+
         def store_residual(r, rvec):
             rvec[rvec.nonzero()[0].max()+1] = r
 

Modified: branches/refactor_fft/scipy/sparse/sparsetools/bsr.py
===================================================================
--- branches/refactor_fft/scipy/sparse/sparsetools/bsr.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/sparsetools/bsr.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -51,484 +51,483 @@
 
 
 def bsr_diagonal(*args):
-  """
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        signed char Ax, signed char Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned char Ax, unsigned char Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        short Ax, short Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned short Ax, unsigned short Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        int Ax, int Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned int Ax, unsigned int Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long long Ax, long long Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned long long Ax, unsigned long long Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        float Ax, float Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        double Ax, double Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long double Ax, long double Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cfloat_wrapper Ax, npy_cfloat_wrapper Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cdouble_wrapper Ax, npy_cdouble_wrapper Yx)
-    bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_clongdouble_wrapper Ax, npy_clongdouble_wrapper Yx)
     """
-  return _bsr.bsr_diagonal(*args)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          signed char Ax, signed char Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned char Ax, unsigned char Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          short Ax, short Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned short Ax, unsigned short Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          int Ax, int Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned int Ax, unsigned int Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long long Ax, long long Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned long long Ax, unsigned long long Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          float Ax, float Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          double Ax, double Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long double Ax, long double Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cfloat_wrapper Ax, npy_cfloat_wrapper Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cdouble_wrapper Ax, npy_cdouble_wrapper Yx)
+      bsr_diagonal(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_clongdouble_wrapper Ax, npy_clongdouble_wrapper Yx)
+      """
+    return _bsr.bsr_diagonal(*args)
 
 def bsr_scale_rows(*args):
-  """
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        signed char Ax, signed char Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned char Ax, unsigned char Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        short Ax, short Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned short Ax, unsigned short Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        int Ax, int Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned int Ax, unsigned int Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long long Ax, long long Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned long long Ax, unsigned long long Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        float Ax, float Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        double Ax, double Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long double Ax, long double Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cfloat_wrapper Ax, npy_cfloat_wrapper Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cdouble_wrapper Ax, npy_cdouble_wrapper Xx)
-    bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_clongdouble_wrapper Ax, npy_clongdouble_wrapper Xx)
     """
-  return _bsr.bsr_scale_rows(*args)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          signed char Ax, signed char Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned char Ax, unsigned char Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          short Ax, short Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned short Ax, unsigned short Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          int Ax, int Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned int Ax, unsigned int Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long long Ax, long long Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned long long Ax, unsigned long long Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          float Ax, float Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          double Ax, double Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long double Ax, long double Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cfloat_wrapper Ax, npy_cfloat_wrapper Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cdouble_wrapper Ax, npy_cdouble_wrapper Xx)
+      bsr_scale_rows(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_clongdouble_wrapper Ax, npy_clongdouble_wrapper Xx)
+      """
+    return _bsr.bsr_scale_rows(*args)
 
 def bsr_scale_columns(*args):
-  """
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        signed char Ax, signed char Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned char Ax, unsigned char Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        short Ax, short Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned short Ax, unsigned short Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        int Ax, int Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned int Ax, unsigned int Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long long Ax, long long Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned long long Ax, unsigned long long Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        float Ax, float Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        double Ax, double Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long double Ax, long double Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cfloat_wrapper Ax, npy_cfloat_wrapper Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cdouble_wrapper Ax, npy_cdouble_wrapper Xx)
-    bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_clongdouble_wrapper Ax, npy_clongdouble_wrapper Xx)
     """
-  return _bsr.bsr_scale_columns(*args)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          signed char Ax, signed char Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned char Ax, unsigned char Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          short Ax, short Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned short Ax, unsigned short Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          int Ax, int Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned int Ax, unsigned int Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long long Ax, long long Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned long long Ax, unsigned long long Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          float Ax, float Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          double Ax, double Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long double Ax, long double Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cfloat_wrapper Ax, npy_cfloat_wrapper Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cdouble_wrapper Ax, npy_cdouble_wrapper Xx)
+      bsr_scale_columns(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_clongdouble_wrapper Ax, npy_clongdouble_wrapper Xx)
+      """
+    return _bsr.bsr_scale_columns(*args)
 
 def bsr_transpose(*args):
-  """
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        signed char Ax, int Bp, int Bj, signed char Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned char Ax, int Bp, int Bj, unsigned char Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        short Ax, int Bp, int Bj, short Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned short Ax, int Bp, int Bj, unsigned short Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        int Ax, int Bp, int Bj, int Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned int Ax, int Bp, int Bj, unsigned int Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long long Ax, int Bp, int Bj, long long Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned long long Ax, int Bp, int Bj, unsigned long long Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        float Ax, int Bp, int Bj, float Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        double Ax, int Bp, int Bj, double Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long double Ax, int Bp, int Bj, long double Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx)
-    bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_clongdouble_wrapper Ax, int Bp, int Bj, 
-        npy_clongdouble_wrapper Bx)
     """
-  return _bsr.bsr_transpose(*args)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          signed char Ax, int Bp, int Bj, signed char Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned char Ax, int Bp, int Bj, unsigned char Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          short Ax, int Bp, int Bj, short Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned short Ax, int Bp, int Bj, unsigned short Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          int Ax, int Bp, int Bj, int Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned int Ax, int Bp, int Bj, unsigned int Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long long Ax, int Bp, int Bj, long long Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned long long Ax, int Bp, int Bj, unsigned long long Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          float Ax, int Bp, int Bj, float Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          double Ax, int Bp, int Bj, double Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long double Ax, int Bp, int Bj, long double Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx)
+      bsr_transpose(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_clongdouble_wrapper Ax, int Bp, int Bj,
+          npy_clongdouble_wrapper Bx)
+      """
+    return _bsr.bsr_transpose(*args)
 
 def bsr_matmat_pass2(*args):
-  """
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, signed char Ax, int Bp, int Bj, signed char Bx, 
-        int Cp, int Cj, signed char Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, unsigned char Ax, int Bp, int Bj, unsigned char Bx, 
-        int Cp, int Cj, unsigned char Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, short Ax, int Bp, int Bj, short Bx, 
-        int Cp, int Cj, short Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, unsigned short Ax, int Bp, int Bj, 
-        unsigned short Bx, int Cp, int Cj, unsigned short Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, int Ax, int Bp, int Bj, int Bx, int Cp, 
-        int Cj, int Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, unsigned int Ax, int Bp, int Bj, unsigned int Bx, 
-        int Cp, int Cj, unsigned int Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, long long Ax, int Bp, int Bj, long long Bx, 
-        int Cp, int Cj, long long Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, unsigned long long Ax, int Bp, int Bj, 
-        unsigned long long Bx, int Cp, int Cj, unsigned long long Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, float Ax, int Bp, int Bj, float Bx, 
-        int Cp, int Cj, float Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, double Ax, int Bp, int Bj, double Bx, 
-        int Cp, int Cj, double Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, long double Ax, int Bp, int Bj, long double Bx, 
-        int Cp, int Cj, long double Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, npy_cfloat_wrapper Ax, int Bp, int Bj, 
-        npy_cfloat_wrapper Bx, int Cp, int Cj, npy_cfloat_wrapper Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, npy_cdouble_wrapper Ax, int Bp, int Bj, 
-        npy_cdouble_wrapper Bx, int Cp, int Cj, 
-        npy_cdouble_wrapper Cx)
-    bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap, 
-        int Aj, npy_clongdouble_wrapper Ax, int Bp, 
-        int Bj, npy_clongdouble_wrapper Bx, int Cp, 
-        int Cj, npy_clongdouble_wrapper Cx)
     """
-  return _bsr.bsr_matmat_pass2(*args)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, signed char Ax, int Bp, int Bj, signed char Bx,
+          int Cp, int Cj, signed char Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, unsigned char Ax, int Bp, int Bj, unsigned char Bx,
+          int Cp, int Cj, unsigned char Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, short Ax, int Bp, int Bj, short Bx,
+          int Cp, int Cj, short Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, unsigned short Ax, int Bp, int Bj,
+          unsigned short Bx, int Cp, int Cj, unsigned short Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, int Ax, int Bp, int Bj, int Bx, int Cp,
+          int Cj, int Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, unsigned int Ax, int Bp, int Bj, unsigned int Bx,
+          int Cp, int Cj, unsigned int Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, long long Ax, int Bp, int Bj, long long Bx,
+          int Cp, int Cj, long long Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, unsigned long long Ax, int Bp, int Bj,
+          unsigned long long Bx, int Cp, int Cj, unsigned long long Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, float Ax, int Bp, int Bj, float Bx,
+          int Cp, int Cj, float Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, double Ax, int Bp, int Bj, double Bx,
+          int Cp, int Cj, double Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, long double Ax, int Bp, int Bj, long double Bx,
+          int Cp, int Cj, long double Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, npy_cfloat_wrapper Ax, int Bp, int Bj,
+          npy_cfloat_wrapper Bx, int Cp, int Cj, npy_cfloat_wrapper Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, npy_cdouble_wrapper Ax, int Bp, int Bj,
+          npy_cdouble_wrapper Bx, int Cp, int Cj,
+          npy_cdouble_wrapper Cx)
+      bsr_matmat_pass2(int n_brow, int n_bcol, int R, int C, int N, int Ap,
+          int Aj, npy_clongdouble_wrapper Ax, int Bp,
+          int Bj, npy_clongdouble_wrapper Bx, int Cp,
+          int Cj, npy_clongdouble_wrapper Cx)
+      """
+    return _bsr.bsr_matmat_pass2(*args)
 
 def bsr_matvec(*args):
-  """
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        signed char Ax, signed char Xx, signed char Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned char Ax, unsigned char Xx, unsigned char Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        short Ax, short Xx, short Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned short Ax, unsigned short Xx, unsigned short Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        int Ax, int Xx, int Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned int Ax, unsigned int Xx, unsigned int Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long long Ax, long long Xx, long long Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned long long Ax, unsigned long long Xx, 
-        unsigned long long Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        float Ax, float Xx, float Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        double Ax, double Xx, double Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long double Ax, long double Xx, long double Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cfloat_wrapper Ax, npy_cfloat_wrapper Xx, 
-        npy_cfloat_wrapper Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cdouble_wrapper Ax, npy_cdouble_wrapper Xx, 
-        npy_cdouble_wrapper Yx)
-    bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_clongdouble_wrapper Ax, npy_clongdouble_wrapper Xx, 
-        npy_clongdouble_wrapper Yx)
     """
-  return _bsr.bsr_matvec(*args)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          signed char Ax, signed char Xx, signed char Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned char Ax, unsigned char Xx, unsigned char Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          short Ax, short Xx, short Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned short Ax, unsigned short Xx, unsigned short Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          int Ax, int Xx, int Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned int Ax, unsigned int Xx, unsigned int Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long long Ax, long long Xx, long long Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned long long Ax, unsigned long long Xx,
+          unsigned long long Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          float Ax, float Xx, float Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          double Ax, double Xx, double Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long double Ax, long double Xx, long double Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cfloat_wrapper Ax, npy_cfloat_wrapper Xx,
+          npy_cfloat_wrapper Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cdouble_wrapper Ax, npy_cdouble_wrapper Xx,
+          npy_cdouble_wrapper Yx)
+      bsr_matvec(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_clongdouble_wrapper Ax, npy_clongdouble_wrapper Xx,
+          npy_clongdouble_wrapper Yx)
+      """
+    return _bsr.bsr_matvec(*args)
 
 def bsr_matvecs(*args):
-  """
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, signed char Ax, signed char Xx, 
-        signed char Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, unsigned char Ax, unsigned char Xx, 
-        unsigned char Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, short Ax, short Xx, short Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, unsigned short Ax, unsigned short Xx, 
-        unsigned short Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, int Ax, int Xx, int Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, unsigned int Ax, unsigned int Xx, 
-        unsigned int Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, long long Ax, long long Xx, long long Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, unsigned long long Ax, unsigned long long Xx, 
-        unsigned long long Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, float Ax, float Xx, float Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, double Ax, double Xx, double Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, long double Ax, long double Xx, 
-        long double Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, npy_cfloat_wrapper Ax, npy_cfloat_wrapper Xx, 
-        npy_cfloat_wrapper Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, npy_cdouble_wrapper Ax, npy_cdouble_wrapper Xx, 
-        npy_cdouble_wrapper Yx)
-    bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap, 
-        int Aj, npy_clongdouble_wrapper Ax, npy_clongdouble_wrapper Xx, 
-        npy_clongdouble_wrapper Yx)
     """
-  return _bsr.bsr_matvecs(*args)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, signed char Ax, signed char Xx,
+          signed char Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, unsigned char Ax, unsigned char Xx,
+          unsigned char Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, short Ax, short Xx, short Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, unsigned short Ax, unsigned short Xx,
+          unsigned short Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, int Ax, int Xx, int Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, unsigned int Ax, unsigned int Xx,
+          unsigned int Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, long long Ax, long long Xx, long long Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, unsigned long long Ax, unsigned long long Xx,
+          unsigned long long Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, float Ax, float Xx, float Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, double Ax, double Xx, double Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, long double Ax, long double Xx,
+          long double Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, npy_cfloat_wrapper Ax, npy_cfloat_wrapper Xx,
+          npy_cfloat_wrapper Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, npy_cdouble_wrapper Ax, npy_cdouble_wrapper Xx,
+          npy_cdouble_wrapper Yx)
+      bsr_matvecs(int n_brow, int n_bcol, int n_vecs, int R, int C, int Ap,
+          int Aj, npy_clongdouble_wrapper Ax, npy_clongdouble_wrapper Xx,
+          npy_clongdouble_wrapper Yx)
+      """
+    return _bsr.bsr_matvecs(*args)
 
 def bsr_elmul_bsr(*args):
-  """
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        signed char Ax, int Bp, int Bj, signed char Bx, 
-        int Cp, int Cj, signed char Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned char Ax, int Bp, int Bj, unsigned char Bx, 
-        int Cp, int Cj, unsigned char Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        short Ax, int Bp, int Bj, short Bx, int Cp, 
-        int Cj, short Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned short Ax, int Bp, int Bj, unsigned short Bx, 
-        int Cp, int Cj, unsigned short Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        int Ax, int Bp, int Bj, int Bx, int Cp, int Cj, 
-        int Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned int Ax, int Bp, int Bj, unsigned int Bx, 
-        int Cp, int Cj, unsigned int Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        long long Ax, int Bp, int Bj, long long Bx, 
-        int Cp, int Cj, long long Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned long long Ax, int Bp, int Bj, unsigned long long Bx, 
-        int Cp, int Cj, unsigned long long Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        float Ax, int Bp, int Bj, float Bx, int Cp, 
-        int Cj, float Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        double Ax, int Bp, int Bj, double Bx, int Cp, 
-        int Cj, double Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        long double Ax, int Bp, int Bj, long double Bx, 
-        int Cp, int Cj, long double Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx, 
-        int Cp, int Cj, npy_cfloat_wrapper Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx, 
-        int Cp, int Cj, npy_cdouble_wrapper Cx)
-    bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_clongdouble_wrapper Ax, int Bp, int Bj, 
-        npy_clongdouble_wrapper Bx, int Cp, int Cj, npy_clongdouble_wrapper Cx)
     """
-  return _bsr.bsr_elmul_bsr(*args)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          signed char Ax, int Bp, int Bj, signed char Bx,
+          int Cp, int Cj, signed char Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned char Ax, int Bp, int Bj, unsigned char Bx,
+          int Cp, int Cj, unsigned char Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          short Ax, int Bp, int Bj, short Bx, int Cp,
+          int Cj, short Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned short Ax, int Bp, int Bj, unsigned short Bx,
+          int Cp, int Cj, unsigned short Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          int Ax, int Bp, int Bj, int Bx, int Cp, int Cj,
+          int Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned int Ax, int Bp, int Bj, unsigned int Bx,
+          int Cp, int Cj, unsigned int Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          long long Ax, int Bp, int Bj, long long Bx,
+          int Cp, int Cj, long long Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned long long Ax, int Bp, int Bj, unsigned long long Bx,
+          int Cp, int Cj, unsigned long long Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          float Ax, int Bp, int Bj, float Bx, int Cp,
+          int Cj, float Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          double Ax, int Bp, int Bj, double Bx, int Cp,
+          int Cj, double Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          long double Ax, int Bp, int Bj, long double Bx,
+          int Cp, int Cj, long double Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx,
+          int Cp, int Cj, npy_cfloat_wrapper Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx,
+          int Cp, int Cj, npy_cdouble_wrapper Cx)
+      bsr_elmul_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_clongdouble_wrapper Ax, int Bp, int Bj,
+          npy_clongdouble_wrapper Bx, int Cp, int Cj, npy_clongdouble_wrapper Cx)
+      """
+    return _bsr.bsr_elmul_bsr(*args)
 
 def bsr_eldiv_bsr(*args):
-  """
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        signed char Ax, int Bp, int Bj, signed char Bx, 
-        int Cp, int Cj, signed char Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned char Ax, int Bp, int Bj, unsigned char Bx, 
-        int Cp, int Cj, unsigned char Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        short Ax, int Bp, int Bj, short Bx, int Cp, 
-        int Cj, short Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned short Ax, int Bp, int Bj, unsigned short Bx, 
-        int Cp, int Cj, unsigned short Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        int Ax, int Bp, int Bj, int Bx, int Cp, int Cj, 
-        int Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned int Ax, int Bp, int Bj, unsigned int Bx, 
-        int Cp, int Cj, unsigned int Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        long long Ax, int Bp, int Bj, long long Bx, 
-        int Cp, int Cj, long long Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned long long Ax, int Bp, int Bj, unsigned long long Bx, 
-        int Cp, int Cj, unsigned long long Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        float Ax, int Bp, int Bj, float Bx, int Cp, 
-        int Cj, float Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        double Ax, int Bp, int Bj, double Bx, int Cp, 
-        int Cj, double Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        long double Ax, int Bp, int Bj, long double Bx, 
-        int Cp, int Cj, long double Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx, 
-        int Cp, int Cj, npy_cfloat_wrapper Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx, 
-        int Cp, int Cj, npy_cdouble_wrapper Cx)
-    bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_clongdouble_wrapper Ax, int Bp, int Bj, 
-        npy_clongdouble_wrapper Bx, int Cp, int Cj, npy_clongdouble_wrapper Cx)
     """
-  return _bsr.bsr_eldiv_bsr(*args)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          signed char Ax, int Bp, int Bj, signed char Bx,
+          int Cp, int Cj, signed char Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned char Ax, int Bp, int Bj, unsigned char Bx,
+          int Cp, int Cj, unsigned char Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          short Ax, int Bp, int Bj, short Bx, int Cp,
+          int Cj, short Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned short Ax, int Bp, int Bj, unsigned short Bx,
+          int Cp, int Cj, unsigned short Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          int Ax, int Bp, int Bj, int Bx, int Cp, int Cj,
+          int Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned int Ax, int Bp, int Bj, unsigned int Bx,
+          int Cp, int Cj, unsigned int Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          long long Ax, int Bp, int Bj, long long Bx,
+          int Cp, int Cj, long long Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned long long Ax, int Bp, int Bj, unsigned long long Bx,
+          int Cp, int Cj, unsigned long long Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          float Ax, int Bp, int Bj, float Bx, int Cp,
+          int Cj, float Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          double Ax, int Bp, int Bj, double Bx, int Cp,
+          int Cj, double Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          long double Ax, int Bp, int Bj, long double Bx,
+          int Cp, int Cj, long double Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx,
+          int Cp, int Cj, npy_cfloat_wrapper Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx,
+          int Cp, int Cj, npy_cdouble_wrapper Cx)
+      bsr_eldiv_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_clongdouble_wrapper Ax, int Bp, int Bj,
+          npy_clongdouble_wrapper Bx, int Cp, int Cj, npy_clongdouble_wrapper Cx)
+      """
+    return _bsr.bsr_eldiv_bsr(*args)
 
 def bsr_plus_bsr(*args):
-  """
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        signed char Ax, int Bp, int Bj, signed char Bx, 
-        int Cp, int Cj, signed char Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned char Ax, int Bp, int Bj, unsigned char Bx, 
-        int Cp, int Cj, unsigned char Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        short Ax, int Bp, int Bj, short Bx, int Cp, 
-        int Cj, short Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned short Ax, int Bp, int Bj, unsigned short Bx, 
-        int Cp, int Cj, unsigned short Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        int Ax, int Bp, int Bj, int Bx, int Cp, int Cj, 
-        int Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned int Ax, int Bp, int Bj, unsigned int Bx, 
-        int Cp, int Cj, unsigned int Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        long long Ax, int Bp, int Bj, long long Bx, 
-        int Cp, int Cj, long long Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned long long Ax, int Bp, int Bj, unsigned long long Bx, 
-        int Cp, int Cj, unsigned long long Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        float Ax, int Bp, int Bj, float Bx, int Cp, 
-        int Cj, float Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        double Ax, int Bp, int Bj, double Bx, int Cp, 
-        int Cj, double Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        long double Ax, int Bp, int Bj, long double Bx, 
-        int Cp, int Cj, long double Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx, 
-        int Cp, int Cj, npy_cfloat_wrapper Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx, 
-        int Cp, int Cj, npy_cdouble_wrapper Cx)
-    bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_clongdouble_wrapper Ax, int Bp, int Bj, 
-        npy_clongdouble_wrapper Bx, int Cp, int Cj, npy_clongdouble_wrapper Cx)
     """
-  return _bsr.bsr_plus_bsr(*args)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          signed char Ax, int Bp, int Bj, signed char Bx,
+          int Cp, int Cj, signed char Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned char Ax, int Bp, int Bj, unsigned char Bx,
+          int Cp, int Cj, unsigned char Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          short Ax, int Bp, int Bj, short Bx, int Cp,
+          int Cj, short Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned short Ax, int Bp, int Bj, unsigned short Bx,
+          int Cp, int Cj, unsigned short Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          int Ax, int Bp, int Bj, int Bx, int Cp, int Cj,
+          int Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned int Ax, int Bp, int Bj, unsigned int Bx,
+          int Cp, int Cj, unsigned int Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          long long Ax, int Bp, int Bj, long long Bx,
+          int Cp, int Cj, long long Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned long long Ax, int Bp, int Bj, unsigned long long Bx,
+          int Cp, int Cj, unsigned long long Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          float Ax, int Bp, int Bj, float Bx, int Cp,
+          int Cj, float Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          double Ax, int Bp, int Bj, double Bx, int Cp,
+          int Cj, double Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          long double Ax, int Bp, int Bj, long double Bx,
+          int Cp, int Cj, long double Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx,
+          int Cp, int Cj, npy_cfloat_wrapper Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx,
+          int Cp, int Cj, npy_cdouble_wrapper Cx)
+      bsr_plus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_clongdouble_wrapper Ax, int Bp, int Bj,
+          npy_clongdouble_wrapper Bx, int Cp, int Cj, npy_clongdouble_wrapper Cx)
+      """
+    return _bsr.bsr_plus_bsr(*args)
 
 def bsr_minus_bsr(*args):
-  """
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        signed char Ax, int Bp, int Bj, signed char Bx, 
-        int Cp, int Cj, signed char Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned char Ax, int Bp, int Bj, unsigned char Bx, 
-        int Cp, int Cj, unsigned char Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        short Ax, int Bp, int Bj, short Bx, int Cp, 
-        int Cj, short Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned short Ax, int Bp, int Bj, unsigned short Bx, 
-        int Cp, int Cj, unsigned short Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        int Ax, int Bp, int Bj, int Bx, int Cp, int Cj, 
-        int Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned int Ax, int Bp, int Bj, unsigned int Bx, 
-        int Cp, int Cj, unsigned int Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        long long Ax, int Bp, int Bj, long long Bx, 
-        int Cp, int Cj, long long Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned long long Ax, int Bp, int Bj, unsigned long long Bx, 
-        int Cp, int Cj, unsigned long long Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        float Ax, int Bp, int Bj, float Bx, int Cp, 
-        int Cj, float Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        double Ax, int Bp, int Bj, double Bx, int Cp, 
-        int Cj, double Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        long double Ax, int Bp, int Bj, long double Bx, 
-        int Cp, int Cj, long double Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx, 
-        int Cp, int Cj, npy_cfloat_wrapper Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx, 
-        int Cp, int Cj, npy_cdouble_wrapper Cx)
-    bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_clongdouble_wrapper Ax, int Bp, int Bj, 
-        npy_clongdouble_wrapper Bx, int Cp, int Cj, npy_clongdouble_wrapper Cx)
     """
-  return _bsr.bsr_minus_bsr(*args)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          signed char Ax, int Bp, int Bj, signed char Bx,
+          int Cp, int Cj, signed char Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned char Ax, int Bp, int Bj, unsigned char Bx,
+          int Cp, int Cj, unsigned char Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          short Ax, int Bp, int Bj, short Bx, int Cp,
+          int Cj, short Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned short Ax, int Bp, int Bj, unsigned short Bx,
+          int Cp, int Cj, unsigned short Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          int Ax, int Bp, int Bj, int Bx, int Cp, int Cj,
+          int Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned int Ax, int Bp, int Bj, unsigned int Bx,
+          int Cp, int Cj, unsigned int Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          long long Ax, int Bp, int Bj, long long Bx,
+          int Cp, int Cj, long long Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned long long Ax, int Bp, int Bj, unsigned long long Bx,
+          int Cp, int Cj, unsigned long long Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          float Ax, int Bp, int Bj, float Bx, int Cp,
+          int Cj, float Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          double Ax, int Bp, int Bj, double Bx, int Cp,
+          int Cj, double Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          long double Ax, int Bp, int Bj, long double Bx,
+          int Cp, int Cj, long double Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx,
+          int Cp, int Cj, npy_cfloat_wrapper Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx,
+          int Cp, int Cj, npy_cdouble_wrapper Cx)
+      bsr_minus_bsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_clongdouble_wrapper Ax, int Bp, int Bj,
+          npy_clongdouble_wrapper Bx, int Cp, int Cj, npy_clongdouble_wrapper Cx)
+      """
+    return _bsr.bsr_minus_bsr(*args)
 
 def bsr_sort_indices(*args):
-  """
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        signed char Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned char Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        short Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned short Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        int Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned int Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long long Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        unsigned long long Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        float Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        double Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        long double Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cfloat_wrapper Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_cdouble_wrapper Ax)
-    bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj, 
-        npy_clongdouble_wrapper Ax)
     """
-  return _bsr.bsr_sort_indices(*args)
-
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          signed char Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned char Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          short Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned short Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          int Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned int Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long long Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          unsigned long long Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          float Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          double Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          long double Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cfloat_wrapper Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_cdouble_wrapper Ax)
+      bsr_sort_indices(int n_brow, int n_bcol, int R, int C, int Ap, int Aj,
+          npy_clongdouble_wrapper Ax)
+      """
+    return _bsr.bsr_sort_indices(*args)

Modified: branches/refactor_fft/scipy/sparse/sparsetools/coo.py
===================================================================
--- branches/refactor_fft/scipy/sparse/sparsetools/coo.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/sparsetools/coo.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -50,135 +50,134 @@
 
 
 def coo_count_diagonals(*args):
-  """coo_count_diagonals(int nnz, int Ai, int Aj) -> int"""
-  return _coo.coo_count_diagonals(*args)
+    """coo_count_diagonals(int nnz, int Ai, int Aj) -> int"""
+    return _coo.coo_count_diagonals(*args)
 
 
 def coo_tocsr(*args):
-  """
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, signed char Ax, 
-        int Bp, int Bj, signed char Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned char Ax, 
-        int Bp, int Bj, unsigned char Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, short Ax, 
-        int Bp, int Bj, short Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned short Ax, 
-        int Bp, int Bj, unsigned short Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, int Ax, 
-        int Bp, int Bj, int Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned int Ax, 
-        int Bp, int Bj, unsigned int Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, long long Ax, 
-        int Bp, int Bj, long long Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned long long Ax, 
-        int Bp, int Bj, unsigned long long Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, float Ax, 
-        int Bp, int Bj, float Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, double Ax, 
-        int Bp, int Bj, double Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, long double Ax, 
-        int Bp, int Bj, long double Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cfloat_wrapper Ax, 
-        int Bp, int Bj, npy_cfloat_wrapper Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cdouble_wrapper Ax, 
-        int Bp, int Bj, npy_cdouble_wrapper Bx)
-    coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bj, npy_clongdouble_wrapper Bx)
     """
-  return _coo.coo_tocsr(*args)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, signed char Ax,
+          int Bp, int Bj, signed char Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned char Ax,
+          int Bp, int Bj, unsigned char Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, short Ax,
+          int Bp, int Bj, short Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned short Ax,
+          int Bp, int Bj, unsigned short Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, int Ax,
+          int Bp, int Bj, int Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned int Ax,
+          int Bp, int Bj, unsigned int Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, long long Ax,
+          int Bp, int Bj, long long Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned long long Ax,
+          int Bp, int Bj, unsigned long long Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, float Ax,
+          int Bp, int Bj, float Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, double Ax,
+          int Bp, int Bj, double Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, long double Ax,
+          int Bp, int Bj, long double Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cfloat_wrapper Ax,
+          int Bp, int Bj, npy_cfloat_wrapper Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cdouble_wrapper Ax,
+          int Bp, int Bj, npy_cdouble_wrapper Bx)
+      coo_tocsr(int n_row, int n_col, int nnz, int Ai, int Aj, npy_clongdouble_wrapper Ax,
+          int Bp, int Bj, npy_clongdouble_wrapper Bx)
+      """
+    return _coo.coo_tocsr(*args)
 
 def coo_tocsc(*args):
-  """
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, signed char Ax, 
-        int Bp, int Bi, signed char Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned char Ax, 
-        int Bp, int Bi, unsigned char Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, short Ax, 
-        int Bp, int Bi, short Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned short Ax, 
-        int Bp, int Bi, unsigned short Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, int Ax, 
-        int Bp, int Bi, int Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned int Ax, 
-        int Bp, int Bi, unsigned int Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, long long Ax, 
-        int Bp, int Bi, long long Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned long long Ax, 
-        int Bp, int Bi, unsigned long long Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, float Ax, 
-        int Bp, int Bi, float Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, double Ax, 
-        int Bp, int Bi, double Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, long double Ax, 
-        int Bp, int Bi, long double Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cfloat_wrapper Ax, 
-        int Bp, int Bi, npy_cfloat_wrapper Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cdouble_wrapper Ax, 
-        int Bp, int Bi, npy_cdouble_wrapper Bx)
-    coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bi, npy_clongdouble_wrapper Bx)
     """
-  return _coo.coo_tocsc(*args)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, signed char Ax,
+          int Bp, int Bi, signed char Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned char Ax,
+          int Bp, int Bi, unsigned char Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, short Ax,
+          int Bp, int Bi, short Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned short Ax,
+          int Bp, int Bi, unsigned short Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, int Ax,
+          int Bp, int Bi, int Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned int Ax,
+          int Bp, int Bi, unsigned int Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, long long Ax,
+          int Bp, int Bi, long long Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned long long Ax,
+          int Bp, int Bi, unsigned long long Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, float Ax,
+          int Bp, int Bi, float Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, double Ax,
+          int Bp, int Bi, double Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, long double Ax,
+          int Bp, int Bi, long double Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cfloat_wrapper Ax,
+          int Bp, int Bi, npy_cfloat_wrapper Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cdouble_wrapper Ax,
+          int Bp, int Bi, npy_cdouble_wrapper Bx)
+      coo_tocsc(int n_row, int n_col, int nnz, int Ai, int Aj, npy_clongdouble_wrapper Ax,
+          int Bp, int Bi, npy_clongdouble_wrapper Bx)
+      """
+    return _coo.coo_tocsc(*args)
 
 def coo_todense(*args):
-  """
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, signed char Ax, 
-        signed char Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned char Ax, 
-        unsigned char Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, short Ax, 
-        short Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned short Ax, 
-        unsigned short Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, int Ax, 
-        int Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned int Ax, 
-        unsigned int Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, long long Ax, 
-        long long Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned long long Ax, 
-        unsigned long long Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, float Ax, 
-        float Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, double Ax, 
-        double Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, long double Ax, 
-        long double Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cfloat_wrapper Ax, 
-        npy_cfloat_wrapper Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cdouble_wrapper Ax, 
-        npy_cdouble_wrapper Bx)
-    coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, npy_clongdouble_wrapper Ax, 
-        npy_clongdouble_wrapper Bx)
     """
-  return _coo.coo_todense(*args)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, signed char Ax,
+          signed char Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned char Ax,
+          unsigned char Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, short Ax,
+          short Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned short Ax,
+          unsigned short Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, int Ax,
+          int Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned int Ax,
+          unsigned int Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, long long Ax,
+          long long Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, unsigned long long Ax,
+          unsigned long long Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, float Ax,
+          float Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, double Ax,
+          double Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, long double Ax,
+          long double Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cfloat_wrapper Ax,
+          npy_cfloat_wrapper Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, npy_cdouble_wrapper Ax,
+          npy_cdouble_wrapper Bx)
+      coo_todense(int n_row, int n_col, int nnz, int Ai, int Aj, npy_clongdouble_wrapper Ax,
+          npy_clongdouble_wrapper Bx)
+      """
+    return _coo.coo_todense(*args)
 
 def coo_matvec(*args):
-  """
-    coo_matvec(int nnz, int Ai, int Aj, signed char Ax, signed char Xx, 
-        signed char Yx)
-    coo_matvec(int nnz, int Ai, int Aj, unsigned char Ax, unsigned char Xx, 
-        unsigned char Yx)
-    coo_matvec(int nnz, int Ai, int Aj, short Ax, short Xx, short Yx)
-    coo_matvec(int nnz, int Ai, int Aj, unsigned short Ax, unsigned short Xx, 
-        unsigned short Yx)
-    coo_matvec(int nnz, int Ai, int Aj, int Ax, int Xx, int Yx)
-    coo_matvec(int nnz, int Ai, int Aj, unsigned int Ax, unsigned int Xx, 
-        unsigned int Yx)
-    coo_matvec(int nnz, int Ai, int Aj, long long Ax, long long Xx, 
-        long long Yx)
-    coo_matvec(int nnz, int Ai, int Aj, unsigned long long Ax, unsigned long long Xx, 
-        unsigned long long Yx)
-    coo_matvec(int nnz, int Ai, int Aj, float Ax, float Xx, float Yx)
-    coo_matvec(int nnz, int Ai, int Aj, double Ax, double Xx, double Yx)
-    coo_matvec(int nnz, int Ai, int Aj, long double Ax, long double Xx, 
-        long double Yx)
-    coo_matvec(int nnz, int Ai, int Aj, npy_cfloat_wrapper Ax, npy_cfloat_wrapper Xx, 
-        npy_cfloat_wrapper Yx)
-    coo_matvec(int nnz, int Ai, int Aj, npy_cdouble_wrapper Ax, npy_cdouble_wrapper Xx, 
-        npy_cdouble_wrapper Yx)
-    coo_matvec(int nnz, int Ai, int Aj, npy_clongdouble_wrapper Ax, 
-        npy_clongdouble_wrapper Xx, npy_clongdouble_wrapper Yx)
     """
-  return _coo.coo_matvec(*args)
-
+      coo_matvec(int nnz, int Ai, int Aj, signed char Ax, signed char Xx,
+          signed char Yx)
+      coo_matvec(int nnz, int Ai, int Aj, unsigned char Ax, unsigned char Xx,
+          unsigned char Yx)
+      coo_matvec(int nnz, int Ai, int Aj, short Ax, short Xx, short Yx)
+      coo_matvec(int nnz, int Ai, int Aj, unsigned short Ax, unsigned short Xx,
+          unsigned short Yx)
+      coo_matvec(int nnz, int Ai, int Aj, int Ax, int Xx, int Yx)
+      coo_matvec(int nnz, int Ai, int Aj, unsigned int Ax, unsigned int Xx,
+          unsigned int Yx)
+      coo_matvec(int nnz, int Ai, int Aj, long long Ax, long long Xx,
+          long long Yx)
+      coo_matvec(int nnz, int Ai, int Aj, unsigned long long Ax, unsigned long long Xx,
+          unsigned long long Yx)
+      coo_matvec(int nnz, int Ai, int Aj, float Ax, float Xx, float Yx)
+      coo_matvec(int nnz, int Ai, int Aj, double Ax, double Xx, double Yx)
+      coo_matvec(int nnz, int Ai, int Aj, long double Ax, long double Xx,
+          long double Yx)
+      coo_matvec(int nnz, int Ai, int Aj, npy_cfloat_wrapper Ax, npy_cfloat_wrapper Xx,
+          npy_cfloat_wrapper Yx)
+      coo_matvec(int nnz, int Ai, int Aj, npy_cdouble_wrapper Ax, npy_cdouble_wrapper Xx,
+          npy_cdouble_wrapper Yx)
+      coo_matvec(int nnz, int Ai, int Aj, npy_clongdouble_wrapper Ax,
+          npy_clongdouble_wrapper Xx, npy_clongdouble_wrapper Yx)
+      """
+    return _coo.coo_matvec(*args)

Modified: branches/refactor_fft/scipy/sparse/sparsetools/csc.py
===================================================================
--- branches/refactor_fft/scipy/sparse/sparsetools/csc.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/sparsetools/csc.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -50,357 +50,356 @@
 
 
 def csc_matmat_pass1(*args):
-  """
-    csc_matmat_pass1(int n_row, int n_col, int Ap, int Ai, int Bp, int Bi, 
-        int Cp)
     """
-  return _csc.csc_matmat_pass1(*args)
+      csc_matmat_pass1(int n_row, int n_col, int Ap, int Ai, int Bp, int Bi,
+          int Cp)
+      """
+    return _csc.csc_matmat_pass1(*args)
 
 
 def csc_diagonal(*args):
-  """
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        signed char Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        unsigned char Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, short Ax, short Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        unsigned short Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, int Ax, int Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        unsigned int Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        long long Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        unsigned long long Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, float Ax, float Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, double Ax, double Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        long double Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        npy_cfloat_wrapper Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        npy_cdouble_wrapper Yx)
-    csc_diagonal(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        npy_clongdouble_wrapper Yx)
     """
-  return _csc.csc_diagonal(*args)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          signed char Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          unsigned char Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, short Ax, short Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          unsigned short Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, int Ax, int Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          unsigned int Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          long long Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          unsigned long long Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, float Ax, float Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, double Ax, double Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          long double Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          npy_cfloat_wrapper Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          npy_cdouble_wrapper Yx)
+      csc_diagonal(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          npy_clongdouble_wrapper Yx)
+      """
+    return _csc.csc_diagonal(*args)
 
 def csc_tocsr(*args):
-  """
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, signed char Ax, 
-        int Bp, int Bj, signed char Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, unsigned char Ax, 
-        int Bp, int Bj, unsigned char Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp, 
-        int Bj, short Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, unsigned short Ax, 
-        int Bp, int Bj, unsigned short Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp, 
-        int Bj, int Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, unsigned int Ax, 
-        int Bp, int Bj, unsigned int Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, long long Ax, 
-        int Bp, int Bj, long long Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax, 
-        int Bp, int Bj, unsigned long long Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, 
-        int Bj, float Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, 
-        int Bj, double Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, long double Ax, 
-        int Bp, int Bj, long double Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, 
-        int Bp, int Bj, npy_cfloat_wrapper Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
-        int Bp, int Bj, npy_cdouble_wrapper Bx)
-    csc_tocsr(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bj, npy_clongdouble_wrapper Bx)
     """
-  return _csc.csc_tocsr(*args)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, signed char Ax,
+          int Bp, int Bj, signed char Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, unsigned char Ax,
+          int Bp, int Bj, unsigned char Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp,
+          int Bj, short Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, unsigned short Ax,
+          int Bp, int Bj, unsigned short Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp,
+          int Bj, int Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, unsigned int Ax,
+          int Bp, int Bj, unsigned int Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, long long Ax,
+          int Bp, int Bj, long long Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax,
+          int Bp, int Bj, unsigned long long Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp,
+          int Bj, float Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp,
+          int Bj, double Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, long double Ax,
+          int Bp, int Bj, long double Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax,
+          int Bp, int Bj, npy_cfloat_wrapper Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax,
+          int Bp, int Bj, npy_cdouble_wrapper Bx)
+      csc_tocsr(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax,
+          int Bp, int Bj, npy_clongdouble_wrapper Bx)
+      """
+    return _csc.csc_tocsr(*args)
 
 def csc_matmat_pass2(*args):
-  """
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, signed char Ax, 
-        int Bp, int Bi, signed char Bx, int Cp, int Ci, 
-        signed char Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, unsigned char Ax, 
-        int Bp, int Bi, unsigned char Bx, int Cp, 
-        int Ci, unsigned char Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp, 
-        int Bi, short Bx, int Cp, int Ci, short Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, unsigned short Ax, 
-        int Bp, int Bi, unsigned short Bx, int Cp, 
-        int Ci, unsigned short Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp, 
-        int Bi, int Bx, int Cp, int Ci, int Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, unsigned int Ax, 
-        int Bp, int Bi, unsigned int Bx, int Cp, 
-        int Ci, unsigned int Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, long long Ax, 
-        int Bp, int Bi, long long Bx, int Cp, int Ci, 
-        long long Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax, 
-        int Bp, int Bi, unsigned long long Bx, 
-        int Cp, int Ci, unsigned long long Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, 
-        int Bi, float Bx, int Cp, int Ci, float Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, 
-        int Bi, double Bx, int Cp, int Ci, double Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, long double Ax, 
-        int Bp, int Bi, long double Bx, int Cp, int Ci, 
-        long double Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, 
-        int Bp, int Bi, npy_cfloat_wrapper Bx, 
-        int Cp, int Ci, npy_cfloat_wrapper Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
-        int Bp, int Bi, npy_cdouble_wrapper Bx, 
-        int Cp, int Ci, npy_cdouble_wrapper Cx)
-    csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bi, npy_clongdouble_wrapper Bx, 
-        int Cp, int Ci, npy_clongdouble_wrapper Cx)
     """
-  return _csc.csc_matmat_pass2(*args)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, signed char Ax,
+          int Bp, int Bi, signed char Bx, int Cp, int Ci,
+          signed char Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, unsigned char Ax,
+          int Bp, int Bi, unsigned char Bx, int Cp,
+          int Ci, unsigned char Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp,
+          int Bi, short Bx, int Cp, int Ci, short Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, unsigned short Ax,
+          int Bp, int Bi, unsigned short Bx, int Cp,
+          int Ci, unsigned short Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp,
+          int Bi, int Bx, int Cp, int Ci, int Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, unsigned int Ax,
+          int Bp, int Bi, unsigned int Bx, int Cp,
+          int Ci, unsigned int Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, long long Ax,
+          int Bp, int Bi, long long Bx, int Cp, int Ci,
+          long long Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax,
+          int Bp, int Bi, unsigned long long Bx,
+          int Cp, int Ci, unsigned long long Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp,
+          int Bi, float Bx, int Cp, int Ci, float Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp,
+          int Bi, double Bx, int Cp, int Ci, double Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, long double Ax,
+          int Bp, int Bi, long double Bx, int Cp, int Ci,
+          long double Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax,
+          int Bp, int Bi, npy_cfloat_wrapper Bx,
+          int Cp, int Ci, npy_cfloat_wrapper Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax,
+          int Bp, int Bi, npy_cdouble_wrapper Bx,
+          int Cp, int Ci, npy_cdouble_wrapper Cx)
+      csc_matmat_pass2(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax,
+          int Bp, int Bi, npy_clongdouble_wrapper Bx,
+          int Cp, int Ci, npy_clongdouble_wrapper Cx)
+      """
+    return _csc.csc_matmat_pass2(*args)
 
 def csc_matvec(*args):
-  """
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, signed char Ax, 
-        signed char Xx, signed char Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, unsigned char Ax, 
-        unsigned char Xx, unsigned char Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, short Ax, short Xx, 
-        short Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, unsigned short Ax, 
-        unsigned short Xx, unsigned short Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, int Ax, int Xx, 
-        int Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, unsigned int Ax, 
-        unsigned int Xx, unsigned int Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, long long Ax, 
-        long long Xx, long long Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax, 
-        unsigned long long Xx, unsigned long long Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, float Ax, float Xx, 
-        float Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, double Ax, double Xx, 
-        double Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, long double Ax, 
-        long double Xx, long double Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, 
-        npy_cfloat_wrapper Xx, npy_cfloat_wrapper Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
-        npy_cdouble_wrapper Xx, npy_cdouble_wrapper Yx)
-    csc_matvec(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax, 
-        npy_clongdouble_wrapper Xx, npy_clongdouble_wrapper Yx)
     """
-  return _csc.csc_matvec(*args)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, signed char Ax,
+          signed char Xx, signed char Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, unsigned char Ax,
+          unsigned char Xx, unsigned char Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, short Ax, short Xx,
+          short Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, unsigned short Ax,
+          unsigned short Xx, unsigned short Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, int Ax, int Xx,
+          int Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, unsigned int Ax,
+          unsigned int Xx, unsigned int Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, long long Ax,
+          long long Xx, long long Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax,
+          unsigned long long Xx, unsigned long long Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, float Ax, float Xx,
+          float Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, double Ax, double Xx,
+          double Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, long double Ax,
+          long double Xx, long double Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax,
+          npy_cfloat_wrapper Xx, npy_cfloat_wrapper Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax,
+          npy_cdouble_wrapper Xx, npy_cdouble_wrapper Yx)
+      csc_matvec(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax,
+          npy_clongdouble_wrapper Xx, npy_clongdouble_wrapper Yx)
+      """
+    return _csc.csc_matvec(*args)
 
 def csc_matvecs(*args):
-  """
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, signed char Ax, 
-        signed char Xx, signed char Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, unsigned char Ax, 
-        unsigned char Xx, unsigned char Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, short Ax, 
-        short Xx, short Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, unsigned short Ax, 
-        unsigned short Xx, unsigned short Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, int Ax, 
-        int Xx, int Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, unsigned int Ax, 
-        unsigned int Xx, unsigned int Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, long long Ax, 
-        long long Xx, long long Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, unsigned long long Ax, 
-        unsigned long long Xx, 
-        unsigned long long Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, float Ax, 
-        float Xx, float Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, double Ax, 
-        double Xx, double Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, long double Ax, 
-        long double Xx, long double Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, npy_cfloat_wrapper Ax, 
-        npy_cfloat_wrapper Xx, 
-        npy_cfloat_wrapper Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, npy_cdouble_wrapper Ax, 
-        npy_cdouble_wrapper Xx, 
-        npy_cdouble_wrapper Yx)
-    csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, npy_clongdouble_wrapper Ax, 
-        npy_clongdouble_wrapper Xx, 
-        npy_clongdouble_wrapper Yx)
     """
-  return _csc.csc_matvecs(*args)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, signed char Ax,
+          signed char Xx, signed char Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, unsigned char Ax,
+          unsigned char Xx, unsigned char Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, short Ax,
+          short Xx, short Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, unsigned short Ax,
+          unsigned short Xx, unsigned short Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, int Ax,
+          int Xx, int Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, unsigned int Ax,
+          unsigned int Xx, unsigned int Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, long long Ax,
+          long long Xx, long long Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, unsigned long long Ax,
+          unsigned long long Xx,
+          unsigned long long Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, float Ax,
+          float Xx, float Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, double Ax,
+          double Xx, double Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, long double Ax,
+          long double Xx, long double Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, npy_cfloat_wrapper Ax,
+          npy_cfloat_wrapper Xx,
+          npy_cfloat_wrapper Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, npy_cdouble_wrapper Ax,
+          npy_cdouble_wrapper Xx,
+          npy_cdouble_wrapper Yx)
+      csc_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Ai, npy_clongdouble_wrapper Ax,
+          npy_clongdouble_wrapper Xx,
+          npy_clongdouble_wrapper Yx)
+      """
+    return _csc.csc_matvecs(*args)
 
 def csc_elmul_csc(*args):
-  """
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, signed char Ax, 
-        int Bp, int Bi, signed char Bx, int Cp, int Ci, 
-        signed char Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, unsigned char Ax, 
-        int Bp, int Bi, unsigned char Bx, int Cp, 
-        int Ci, unsigned char Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp, 
-        int Bi, short Bx, int Cp, int Ci, short Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, unsigned short Ax, 
-        int Bp, int Bi, unsigned short Bx, int Cp, 
-        int Ci, unsigned short Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp, 
-        int Bi, int Bx, int Cp, int Ci, int Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, unsigned int Ax, 
-        int Bp, int Bi, unsigned int Bx, int Cp, 
-        int Ci, unsigned int Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, long long Ax, 
-        int Bp, int Bi, long long Bx, int Cp, int Ci, 
-        long long Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax, 
-        int Bp, int Bi, unsigned long long Bx, 
-        int Cp, int Ci, unsigned long long Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, 
-        int Bi, float Bx, int Cp, int Ci, float Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, 
-        int Bi, double Bx, int Cp, int Ci, double Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, long double Ax, 
-        int Bp, int Bi, long double Bx, int Cp, int Ci, 
-        long double Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, 
-        int Bp, int Bi, npy_cfloat_wrapper Bx, 
-        int Cp, int Ci, npy_cfloat_wrapper Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
-        int Bp, int Bi, npy_cdouble_wrapper Bx, 
-        int Cp, int Ci, npy_cdouble_wrapper Cx)
-    csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bi, npy_clongdouble_wrapper Bx, 
-        int Cp, int Ci, npy_clongdouble_wrapper Cx)
     """
-  return _csc.csc_elmul_csc(*args)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, signed char Ax,
+          int Bp, int Bi, signed char Bx, int Cp, int Ci,
+          signed char Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, unsigned char Ax,
+          int Bp, int Bi, unsigned char Bx, int Cp,
+          int Ci, unsigned char Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp,
+          int Bi, short Bx, int Cp, int Ci, short Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, unsigned short Ax,
+          int Bp, int Bi, unsigned short Bx, int Cp,
+          int Ci, unsigned short Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp,
+          int Bi, int Bx, int Cp, int Ci, int Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, unsigned int Ax,
+          int Bp, int Bi, unsigned int Bx, int Cp,
+          int Ci, unsigned int Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, long long Ax,
+          int Bp, int Bi, long long Bx, int Cp, int Ci,
+          long long Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax,
+          int Bp, int Bi, unsigned long long Bx,
+          int Cp, int Ci, unsigned long long Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp,
+          int Bi, float Bx, int Cp, int Ci, float Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp,
+          int Bi, double Bx, int Cp, int Ci, double Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, long double Ax,
+          int Bp, int Bi, long double Bx, int Cp, int Ci,
+          long double Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax,
+          int Bp, int Bi, npy_cfloat_wrapper Bx,
+          int Cp, int Ci, npy_cfloat_wrapper Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax,
+          int Bp, int Bi, npy_cdouble_wrapper Bx,
+          int Cp, int Ci, npy_cdouble_wrapper Cx)
+      csc_elmul_csc(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax,
+          int Bp, int Bi, npy_clongdouble_wrapper Bx,
+          int Cp, int Ci, npy_clongdouble_wrapper Cx)
+      """
+    return _csc.csc_elmul_csc(*args)
 
 def csc_eldiv_csc(*args):
-  """
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, signed char Ax, 
-        int Bp, int Bi, signed char Bx, int Cp, int Ci, 
-        signed char Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, unsigned char Ax, 
-        int Bp, int Bi, unsigned char Bx, int Cp, 
-        int Ci, unsigned char Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp, 
-        int Bi, short Bx, int Cp, int Ci, short Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, unsigned short Ax, 
-        int Bp, int Bi, unsigned short Bx, int Cp, 
-        int Ci, unsigned short Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp, 
-        int Bi, int Bx, int Cp, int Ci, int Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, unsigned int Ax, 
-        int Bp, int Bi, unsigned int Bx, int Cp, 
-        int Ci, unsigned int Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, long long Ax, 
-        int Bp, int Bi, long long Bx, int Cp, int Ci, 
-        long long Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax, 
-        int Bp, int Bi, unsigned long long Bx, 
-        int Cp, int Ci, unsigned long long Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, 
-        int Bi, float Bx, int Cp, int Ci, float Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, 
-        int Bi, double Bx, int Cp, int Ci, double Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, long double Ax, 
-        int Bp, int Bi, long double Bx, int Cp, int Ci, 
-        long double Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, 
-        int Bp, int Bi, npy_cfloat_wrapper Bx, 
-        int Cp, int Ci, npy_cfloat_wrapper Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
-        int Bp, int Bi, npy_cdouble_wrapper Bx, 
-        int Cp, int Ci, npy_cdouble_wrapper Cx)
-    csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bi, npy_clongdouble_wrapper Bx, 
-        int Cp, int Ci, npy_clongdouble_wrapper Cx)
     """
-  return _csc.csc_eldiv_csc(*args)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, signed char Ax,
+          int Bp, int Bi, signed char Bx, int Cp, int Ci,
+          signed char Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, unsigned char Ax,
+          int Bp, int Bi, unsigned char Bx, int Cp,
+          int Ci, unsigned char Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp,
+          int Bi, short Bx, int Cp, int Ci, short Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, unsigned short Ax,
+          int Bp, int Bi, unsigned short Bx, int Cp,
+          int Ci, unsigned short Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp,
+          int Bi, int Bx, int Cp, int Ci, int Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, unsigned int Ax,
+          int Bp, int Bi, unsigned int Bx, int Cp,
+          int Ci, unsigned int Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, long long Ax,
+          int Bp, int Bi, long long Bx, int Cp, int Ci,
+          long long Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax,
+          int Bp, int Bi, unsigned long long Bx,
+          int Cp, int Ci, unsigned long long Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp,
+          int Bi, float Bx, int Cp, int Ci, float Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp,
+          int Bi, double Bx, int Cp, int Ci, double Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, long double Ax,
+          int Bp, int Bi, long double Bx, int Cp, int Ci,
+          long double Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax,
+          int Bp, int Bi, npy_cfloat_wrapper Bx,
+          int Cp, int Ci, npy_cfloat_wrapper Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax,
+          int Bp, int Bi, npy_cdouble_wrapper Bx,
+          int Cp, int Ci, npy_cdouble_wrapper Cx)
+      csc_eldiv_csc(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax,
+          int Bp, int Bi, npy_clongdouble_wrapper Bx,
+          int Cp, int Ci, npy_clongdouble_wrapper Cx)
+      """
+    return _csc.csc_eldiv_csc(*args)
 
 def csc_plus_csc(*args):
-  """
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, signed char Ax, 
-        int Bp, int Bi, signed char Bx, int Cp, int Ci, 
-        signed char Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, unsigned char Ax, 
-        int Bp, int Bi, unsigned char Bx, int Cp, 
-        int Ci, unsigned char Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp, 
-        int Bi, short Bx, int Cp, int Ci, short Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, unsigned short Ax, 
-        int Bp, int Bi, unsigned short Bx, int Cp, 
-        int Ci, unsigned short Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp, 
-        int Bi, int Bx, int Cp, int Ci, int Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, unsigned int Ax, 
-        int Bp, int Bi, unsigned int Bx, int Cp, 
-        int Ci, unsigned int Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, long long Ax, 
-        int Bp, int Bi, long long Bx, int Cp, int Ci, 
-        long long Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax, 
-        int Bp, int Bi, unsigned long long Bx, 
-        int Cp, int Ci, unsigned long long Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, 
-        int Bi, float Bx, int Cp, int Ci, float Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, 
-        int Bi, double Bx, int Cp, int Ci, double Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, long double Ax, 
-        int Bp, int Bi, long double Bx, int Cp, int Ci, 
-        long double Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, 
-        int Bp, int Bi, npy_cfloat_wrapper Bx, 
-        int Cp, int Ci, npy_cfloat_wrapper Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
-        int Bp, int Bi, npy_cdouble_wrapper Bx, 
-        int Cp, int Ci, npy_cdouble_wrapper Cx)
-    csc_plus_csc(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bi, npy_clongdouble_wrapper Bx, 
-        int Cp, int Ci, npy_clongdouble_wrapper Cx)
     """
-  return _csc.csc_plus_csc(*args)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, signed char Ax,
+          int Bp, int Bi, signed char Bx, int Cp, int Ci,
+          signed char Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, unsigned char Ax,
+          int Bp, int Bi, unsigned char Bx, int Cp,
+          int Ci, unsigned char Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp,
+          int Bi, short Bx, int Cp, int Ci, short Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, unsigned short Ax,
+          int Bp, int Bi, unsigned short Bx, int Cp,
+          int Ci, unsigned short Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp,
+          int Bi, int Bx, int Cp, int Ci, int Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, unsigned int Ax,
+          int Bp, int Bi, unsigned int Bx, int Cp,
+          int Ci, unsigned int Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, long long Ax,
+          int Bp, int Bi, long long Bx, int Cp, int Ci,
+          long long Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax,
+          int Bp, int Bi, unsigned long long Bx,
+          int Cp, int Ci, unsigned long long Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp,
+          int Bi, float Bx, int Cp, int Ci, float Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp,
+          int Bi, double Bx, int Cp, int Ci, double Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, long double Ax,
+          int Bp, int Bi, long double Bx, int Cp, int Ci,
+          long double Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax,
+          int Bp, int Bi, npy_cfloat_wrapper Bx,
+          int Cp, int Ci, npy_cfloat_wrapper Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax,
+          int Bp, int Bi, npy_cdouble_wrapper Bx,
+          int Cp, int Ci, npy_cdouble_wrapper Cx)
+      csc_plus_csc(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax,
+          int Bp, int Bi, npy_clongdouble_wrapper Bx,
+          int Cp, int Ci, npy_clongdouble_wrapper Cx)
+      """
+    return _csc.csc_plus_csc(*args)
 
 def csc_minus_csc(*args):
-  """
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, signed char Ax, 
-        int Bp, int Bi, signed char Bx, int Cp, int Ci, 
-        signed char Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, unsigned char Ax, 
-        int Bp, int Bi, unsigned char Bx, int Cp, 
-        int Ci, unsigned char Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp, 
-        int Bi, short Bx, int Cp, int Ci, short Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, unsigned short Ax, 
-        int Bp, int Bi, unsigned short Bx, int Cp, 
-        int Ci, unsigned short Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp, 
-        int Bi, int Bx, int Cp, int Ci, int Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, unsigned int Ax, 
-        int Bp, int Bi, unsigned int Bx, int Cp, 
-        int Ci, unsigned int Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, long long Ax, 
-        int Bp, int Bi, long long Bx, int Cp, int Ci, 
-        long long Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax, 
-        int Bp, int Bi, unsigned long long Bx, 
-        int Cp, int Ci, unsigned long long Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp, 
-        int Bi, float Bx, int Cp, int Ci, float Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp, 
-        int Bi, double Bx, int Cp, int Ci, double Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, long double Ax, 
-        int Bp, int Bi, long double Bx, int Cp, int Ci, 
-        long double Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax, 
-        int Bp, int Bi, npy_cfloat_wrapper Bx, 
-        int Cp, int Ci, npy_cfloat_wrapper Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax, 
-        int Bp, int Bi, npy_cdouble_wrapper Bx, 
-        int Cp, int Ci, npy_cdouble_wrapper Cx)
-    csc_minus_csc(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bi, npy_clongdouble_wrapper Bx, 
-        int Cp, int Ci, npy_clongdouble_wrapper Cx)
     """
-  return _csc.csc_minus_csc(*args)
-
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, signed char Ax,
+          int Bp, int Bi, signed char Bx, int Cp, int Ci,
+          signed char Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, unsigned char Ax,
+          int Bp, int Bi, unsigned char Bx, int Cp,
+          int Ci, unsigned char Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, short Ax, int Bp,
+          int Bi, short Bx, int Cp, int Ci, short Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, unsigned short Ax,
+          int Bp, int Bi, unsigned short Bx, int Cp,
+          int Ci, unsigned short Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, int Ax, int Bp,
+          int Bi, int Bx, int Cp, int Ci, int Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, unsigned int Ax,
+          int Bp, int Bi, unsigned int Bx, int Cp,
+          int Ci, unsigned int Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, long long Ax,
+          int Bp, int Bi, long long Bx, int Cp, int Ci,
+          long long Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, unsigned long long Ax,
+          int Bp, int Bi, unsigned long long Bx,
+          int Cp, int Ci, unsigned long long Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, float Ax, int Bp,
+          int Bi, float Bx, int Cp, int Ci, float Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, double Ax, int Bp,
+          int Bi, double Bx, int Cp, int Ci, double Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, long double Ax,
+          int Bp, int Bi, long double Bx, int Cp, int Ci,
+          long double Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, npy_cfloat_wrapper Ax,
+          int Bp, int Bi, npy_cfloat_wrapper Bx,
+          int Cp, int Ci, npy_cfloat_wrapper Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, npy_cdouble_wrapper Ax,
+          int Bp, int Bi, npy_cdouble_wrapper Bx,
+          int Cp, int Ci, npy_cdouble_wrapper Cx)
+      csc_minus_csc(int n_row, int n_col, int Ap, int Ai, npy_clongdouble_wrapper Ax,
+          int Bp, int Bi, npy_clongdouble_wrapper Bx,
+          int Cp, int Ci, npy_clongdouble_wrapper Cx)
+      """
+    return _csc.csc_minus_csc(*args)

Modified: branches/refactor_fft/scipy/sparse/sparsetools/csr.py
===================================================================
--- branches/refactor_fft/scipy/sparse/sparsetools/csr.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/sparsetools/csr.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -50,569 +50,568 @@
 
 
 def expandptr(*args):
-  """expandptr(int n_row, int Ap, int Bi)"""
-  return _csr.expandptr(*args)
+    """expandptr(int n_row, int Ap, int Bi)"""
+    return _csr.expandptr(*args)
 
 def csr_matmat_pass1(*args):
-  """
-    csr_matmat_pass1(int n_row, int n_col, int Ap, int Aj, int Bp, int Bj, 
-        int Cp)
     """
-  return _csr.csr_matmat_pass1(*args)
+      csr_matmat_pass1(int n_row, int n_col, int Ap, int Aj, int Bp, int Bj,
+          int Cp)
+      """
+    return _csr.csr_matmat_pass1(*args)
 
 def csr_count_blocks(*args):
-  """csr_count_blocks(int n_row, int n_col, int R, int C, int Ap, int Aj) -> int"""
-  return _csr.csr_count_blocks(*args)
+    """csr_count_blocks(int n_row, int n_col, int R, int C, int Ap, int Aj) -> int"""
+    return _csr.csr_count_blocks(*args)
 
 def csr_has_sorted_indices(*args):
-  """csr_has_sorted_indices(int n_row, int Ap, int Aj) -> bool"""
-  return _csr.csr_has_sorted_indices(*args)
+    """csr_has_sorted_indices(int n_row, int Ap, int Aj) -> bool"""
+    return _csr.csr_has_sorted_indices(*args)
 
 
 def csr_diagonal(*args):
-  """
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        signed char Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        unsigned char Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, short Ax, short Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        unsigned short Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, int Ax, int Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        unsigned int Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        long long Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        unsigned long long Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, float Ax, float Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, double Ax, double Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        long double Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        npy_cfloat_wrapper Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        npy_cdouble_wrapper Yx)
-    csr_diagonal(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        npy_clongdouble_wrapper Yx)
     """
-  return _csr.csr_diagonal(*args)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          signed char Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          unsigned char Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, short Ax, short Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          unsigned short Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, int Ax, int Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          unsigned int Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          long long Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          unsigned long long Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, float Ax, float Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, double Ax, double Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          long double Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          npy_cfloat_wrapper Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          npy_cdouble_wrapper Yx)
+      csr_diagonal(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          npy_clongdouble_wrapper Yx)
+      """
+    return _csr.csr_diagonal(*args)
 
 def csr_scale_rows(*args):
-  """
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        signed char Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        unsigned char Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, short Ax, short Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        unsigned short Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, int Ax, int Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        unsigned int Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        long long Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        unsigned long long Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, float Ax, float Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, double Ax, double Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        long double Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        npy_cfloat_wrapper Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        npy_cdouble_wrapper Xx)
-    csr_scale_rows(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        npy_clongdouble_wrapper Xx)
     """
-  return _csr.csr_scale_rows(*args)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          signed char Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          unsigned char Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, short Ax, short Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          unsigned short Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, int Ax, int Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          unsigned int Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          long long Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          unsigned long long Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, float Ax, float Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, double Ax, double Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          long double Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          npy_cfloat_wrapper Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          npy_cdouble_wrapper Xx)
+      csr_scale_rows(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          npy_clongdouble_wrapper Xx)
+      """
+    return _csr.csr_scale_rows(*args)
 
 def csr_scale_columns(*args):
-  """
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        signed char Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        unsigned char Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, short Ax, short Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        unsigned short Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, int Ax, int Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        unsigned int Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        long long Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        unsigned long long Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, float Ax, float Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, double Ax, double Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        long double Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        npy_cfloat_wrapper Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        npy_cdouble_wrapper Xx)
-    csr_scale_columns(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        npy_clongdouble_wrapper Xx)
     """
-  return _csr.csr_scale_columns(*args)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          signed char Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          unsigned char Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, short Ax, short Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          unsigned short Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, int Ax, int Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          unsigned int Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          long long Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          unsigned long long Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, float Ax, float Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, double Ax, double Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          long double Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          npy_cfloat_wrapper Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          npy_cdouble_wrapper Xx)
+      csr_scale_columns(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          npy_clongdouble_wrapper Xx)
+      """
+    return _csr.csr_scale_columns(*args)
 
 def csr_tocsc(*args):
-  """
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        int Bp, int Bi, signed char Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        int Bp, int Bi, unsigned char Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp, 
-        int Bi, short Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        int Bp, int Bi, unsigned short Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp, 
-        int Bi, int Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        int Bp, int Bi, unsigned int Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        int Bp, int Bi, long long Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        int Bp, int Bi, unsigned long long Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, 
-        int Bi, float Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, 
-        int Bi, double Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        int Bp, int Bi, long double Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        int Bp, int Bi, npy_cfloat_wrapper Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        int Bp, int Bi, npy_cdouble_wrapper Bx)
-    csr_tocsc(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bi, npy_clongdouble_wrapper Bx)
     """
-  return _csr.csr_tocsc(*args)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          int Bp, int Bi, signed char Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          int Bp, int Bi, unsigned char Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp,
+          int Bi, short Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          int Bp, int Bi, unsigned short Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp,
+          int Bi, int Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          int Bp, int Bi, unsigned int Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          int Bp, int Bi, long long Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          int Bp, int Bi, unsigned long long Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp,
+          int Bi, float Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp,
+          int Bi, double Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          int Bp, int Bi, long double Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          int Bp, int Bi, npy_cfloat_wrapper Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          int Bp, int Bi, npy_cdouble_wrapper Bx)
+      csr_tocsc(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          int Bp, int Bi, npy_clongdouble_wrapper Bx)
+      """
+    return _csr.csr_tocsc(*args)
 
 def csr_tobsr(*args):
-  """
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        signed char Ax, int Bp, int Bj, signed char Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned char Ax, int Bp, int Bj, unsigned char Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        short Ax, int Bp, int Bj, short Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned short Ax, int Bp, int Bj, unsigned short Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        int Ax, int Bp, int Bj, int Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned int Ax, int Bp, int Bj, unsigned int Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        long long Ax, int Bp, int Bj, long long Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        unsigned long long Ax, int Bp, int Bj, unsigned long long Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        float Ax, int Bp, int Bj, float Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        double Ax, int Bp, int Bj, double Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        long double Ax, int Bp, int Bj, long double Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx)
-    csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj, 
-        npy_clongdouble_wrapper Ax, int Bp, int Bj, 
-        npy_clongdouble_wrapper Bx)
     """
-  return _csr.csr_tobsr(*args)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          signed char Ax, int Bp, int Bj, signed char Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned char Ax, int Bp, int Bj, unsigned char Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          short Ax, int Bp, int Bj, short Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned short Ax, int Bp, int Bj, unsigned short Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          int Ax, int Bp, int Bj, int Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned int Ax, int Bp, int Bj, unsigned int Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          long long Ax, int Bp, int Bj, long long Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          unsigned long long Ax, int Bp, int Bj, unsigned long long Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          float Ax, int Bp, int Bj, float Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          double Ax, int Bp, int Bj, double Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          long double Ax, int Bp, int Bj, long double Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_cfloat_wrapper Ax, int Bp, int Bj, npy_cfloat_wrapper Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_cdouble_wrapper Ax, int Bp, int Bj, npy_cdouble_wrapper Bx)
+      csr_tobsr(int n_row, int n_col, int R, int C, int Ap, int Aj,
+          npy_clongdouble_wrapper Ax, int Bp, int Bj,
+          npy_clongdouble_wrapper Bx)
+      """
+    return _csr.csr_tobsr(*args)
 
 def csr_matmat_pass2(*args):
-  """
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        int Bp, int Bj, signed char Bx, int Cp, int Cj, 
-        signed char Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        int Bp, int Bj, unsigned char Bx, int Cp, 
-        int Cj, unsigned char Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp, 
-        int Bj, short Bx, int Cp, int Cj, short Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        int Bp, int Bj, unsigned short Bx, int Cp, 
-        int Cj, unsigned short Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp, 
-        int Bj, int Bx, int Cp, int Cj, int Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        int Bp, int Bj, unsigned int Bx, int Cp, 
-        int Cj, unsigned int Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        int Bp, int Bj, long long Bx, int Cp, int Cj, 
-        long long Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        int Bp, int Bj, unsigned long long Bx, 
-        int Cp, int Cj, unsigned long long Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, 
-        int Bj, float Bx, int Cp, int Cj, float Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, 
-        int Bj, double Bx, int Cp, int Cj, double Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        int Bp, int Bj, long double Bx, int Cp, int Cj, 
-        long double Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        int Bp, int Bj, npy_cfloat_wrapper Bx, 
-        int Cp, int Cj, npy_cfloat_wrapper Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        int Bp, int Bj, npy_cdouble_wrapper Bx, 
-        int Cp, int Cj, npy_cdouble_wrapper Cx)
-    csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bj, npy_clongdouble_wrapper Bx, 
-        int Cp, int Cj, npy_clongdouble_wrapper Cx)
     """
-  return _csr.csr_matmat_pass2(*args)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          int Bp, int Bj, signed char Bx, int Cp, int Cj,
+          signed char Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          int Bp, int Bj, unsigned char Bx, int Cp,
+          int Cj, unsigned char Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp,
+          int Bj, short Bx, int Cp, int Cj, short Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          int Bp, int Bj, unsigned short Bx, int Cp,
+          int Cj, unsigned short Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp,
+          int Bj, int Bx, int Cp, int Cj, int Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          int Bp, int Bj, unsigned int Bx, int Cp,
+          int Cj, unsigned int Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          int Bp, int Bj, long long Bx, int Cp, int Cj,
+          long long Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          int Bp, int Bj, unsigned long long Bx,
+          int Cp, int Cj, unsigned long long Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp,
+          int Bj, float Bx, int Cp, int Cj, float Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp,
+          int Bj, double Bx, int Cp, int Cj, double Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          int Bp, int Bj, long double Bx, int Cp, int Cj,
+          long double Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          int Bp, int Bj, npy_cfloat_wrapper Bx,
+          int Cp, int Cj, npy_cfloat_wrapper Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          int Bp, int Bj, npy_cdouble_wrapper Bx,
+          int Cp, int Cj, npy_cdouble_wrapper Cx)
+      csr_matmat_pass2(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          int Bp, int Bj, npy_clongdouble_wrapper Bx,
+          int Cp, int Cj, npy_clongdouble_wrapper Cx)
+      """
+    return _csr.csr_matmat_pass2(*args)
 
 def csr_matvec(*args):
-  """
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        signed char Xx, signed char Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        unsigned char Xx, unsigned char Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, short Ax, short Xx, 
-        short Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        unsigned short Xx, unsigned short Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, int Ax, int Xx, 
-        int Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        unsigned int Xx, unsigned int Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        long long Xx, long long Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        unsigned long long Xx, unsigned long long Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, float Ax, float Xx, 
-        float Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, double Ax, double Xx, 
-        double Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        long double Xx, long double Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        npy_cfloat_wrapper Xx, npy_cfloat_wrapper Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        npy_cdouble_wrapper Xx, npy_cdouble_wrapper Yx)
-    csr_matvec(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        npy_clongdouble_wrapper Xx, npy_clongdouble_wrapper Yx)
     """
-  return _csr.csr_matvec(*args)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          signed char Xx, signed char Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          unsigned char Xx, unsigned char Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, short Ax, short Xx,
+          short Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          unsigned short Xx, unsigned short Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, int Ax, int Xx,
+          int Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          unsigned int Xx, unsigned int Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          long long Xx, long long Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          unsigned long long Xx, unsigned long long Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, float Ax, float Xx,
+          float Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, double Ax, double Xx,
+          double Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          long double Xx, long double Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          npy_cfloat_wrapper Xx, npy_cfloat_wrapper Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          npy_cdouble_wrapper Xx, npy_cdouble_wrapper Yx)
+      csr_matvec(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          npy_clongdouble_wrapper Xx, npy_clongdouble_wrapper Yx)
+      """
+    return _csr.csr_matvec(*args)
 
 def csr_matvecs(*args):
-  """
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, signed char Ax, 
-        signed char Xx, signed char Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, unsigned char Ax, 
-        unsigned char Xx, unsigned char Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, short Ax, 
-        short Xx, short Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, unsigned short Ax, 
-        unsigned short Xx, unsigned short Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, int Ax, 
-        int Xx, int Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, unsigned int Ax, 
-        unsigned int Xx, unsigned int Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, long long Ax, 
-        long long Xx, long long Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, unsigned long long Ax, 
-        unsigned long long Xx, 
-        unsigned long long Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, float Ax, 
-        float Xx, float Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, double Ax, 
-        double Xx, double Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, long double Ax, 
-        long double Xx, long double Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        npy_cfloat_wrapper Xx, 
-        npy_cfloat_wrapper Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        npy_cdouble_wrapper Xx, 
-        npy_cdouble_wrapper Yx)
-    csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        npy_clongdouble_wrapper Xx, 
-        npy_clongdouble_wrapper Yx)
     """
-  return _csr.csr_matvecs(*args)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, signed char Ax,
+          signed char Xx, signed char Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, unsigned char Ax,
+          unsigned char Xx, unsigned char Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, short Ax,
+          short Xx, short Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, unsigned short Ax,
+          unsigned short Xx, unsigned short Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, int Ax,
+          int Xx, int Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, unsigned int Ax,
+          unsigned int Xx, unsigned int Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, long long Ax,
+          long long Xx, long long Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, unsigned long long Ax,
+          unsigned long long Xx,
+          unsigned long long Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, float Ax,
+          float Xx, float Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, double Ax,
+          double Xx, double Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, long double Ax,
+          long double Xx, long double Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          npy_cfloat_wrapper Xx,
+          npy_cfloat_wrapper Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          npy_cdouble_wrapper Xx,
+          npy_cdouble_wrapper Yx)
+      csr_matvecs(int n_row, int n_col, int n_vecs, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          npy_clongdouble_wrapper Xx,
+          npy_clongdouble_wrapper Yx)
+      """
+    return _csr.csr_matvecs(*args)
 
 def csr_elmul_csr(*args):
-  """
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        int Bp, int Bj, signed char Bx, int Cp, int Cj, 
-        signed char Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        int Bp, int Bj, unsigned char Bx, int Cp, 
-        int Cj, unsigned char Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp, 
-        int Bj, short Bx, int Cp, int Cj, short Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        int Bp, int Bj, unsigned short Bx, int Cp, 
-        int Cj, unsigned short Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp, 
-        int Bj, int Bx, int Cp, int Cj, int Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        int Bp, int Bj, unsigned int Bx, int Cp, 
-        int Cj, unsigned int Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        int Bp, int Bj, long long Bx, int Cp, int Cj, 
-        long long Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        int Bp, int Bj, unsigned long long Bx, 
-        int Cp, int Cj, unsigned long long Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, 
-        int Bj, float Bx, int Cp, int Cj, float Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, 
-        int Bj, double Bx, int Cp, int Cj, double Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        int Bp, int Bj, long double Bx, int Cp, int Cj, 
-        long double Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        int Bp, int Bj, npy_cfloat_wrapper Bx, 
-        int Cp, int Cj, npy_cfloat_wrapper Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        int Bp, int Bj, npy_cdouble_wrapper Bx, 
-        int Cp, int Cj, npy_cdouble_wrapper Cx)
-    csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bj, npy_clongdouble_wrapper Bx, 
-        int Cp, int Cj, npy_clongdouble_wrapper Cx)
     """
-  return _csr.csr_elmul_csr(*args)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          int Bp, int Bj, signed char Bx, int Cp, int Cj,
+          signed char Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          int Bp, int Bj, unsigned char Bx, int Cp,
+          int Cj, unsigned char Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp,
+          int Bj, short Bx, int Cp, int Cj, short Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          int Bp, int Bj, unsigned short Bx, int Cp,
+          int Cj, unsigned short Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp,
+          int Bj, int Bx, int Cp, int Cj, int Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          int Bp, int Bj, unsigned int Bx, int Cp,
+          int Cj, unsigned int Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          int Bp, int Bj, long long Bx, int Cp, int Cj,
+          long long Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          int Bp, int Bj, unsigned long long Bx,
+          int Cp, int Cj, unsigned long long Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp,
+          int Bj, float Bx, int Cp, int Cj, float Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp,
+          int Bj, double Bx, int Cp, int Cj, double Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          int Bp, int Bj, long double Bx, int Cp, int Cj,
+          long double Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          int Bp, int Bj, npy_cfloat_wrapper Bx,
+          int Cp, int Cj, npy_cfloat_wrapper Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          int Bp, int Bj, npy_cdouble_wrapper Bx,
+          int Cp, int Cj, npy_cdouble_wrapper Cx)
+      csr_elmul_csr(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          int Bp, int Bj, npy_clongdouble_wrapper Bx,
+          int Cp, int Cj, npy_clongdouble_wrapper Cx)
+      """
+    return _csr.csr_elmul_csr(*args)
 
 def csr_eldiv_csr(*args):
-  """
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        int Bp, int Bj, signed char Bx, int Cp, int Cj, 
-        signed char Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        int Bp, int Bj, unsigned char Bx, int Cp, 
-        int Cj, unsigned char Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp, 
-        int Bj, short Bx, int Cp, int Cj, short Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        int Bp, int Bj, unsigned short Bx, int Cp, 
-        int Cj, unsigned short Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp, 
-        int Bj, int Bx, int Cp, int Cj, int Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        int Bp, int Bj, unsigned int Bx, int Cp, 
-        int Cj, unsigned int Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        int Bp, int Bj, long long Bx, int Cp, int Cj, 
-        long long Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        int Bp, int Bj, unsigned long long Bx, 
-        int Cp, int Cj, unsigned long long Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, 
-        int Bj, float Bx, int Cp, int Cj, float Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, 
-        int Bj, double Bx, int Cp, int Cj, double Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        int Bp, int Bj, long double Bx, int Cp, int Cj, 
-        long double Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        int Bp, int Bj, npy_cfloat_wrapper Bx, 
-        int Cp, int Cj, npy_cfloat_wrapper Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        int Bp, int Bj, npy_cdouble_wrapper Bx, 
-        int Cp, int Cj, npy_cdouble_wrapper Cx)
-    csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bj, npy_clongdouble_wrapper Bx, 
-        int Cp, int Cj, npy_clongdouble_wrapper Cx)
     """
-  return _csr.csr_eldiv_csr(*args)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          int Bp, int Bj, signed char Bx, int Cp, int Cj,
+          signed char Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          int Bp, int Bj, unsigned char Bx, int Cp,
+          int Cj, unsigned char Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp,
+          int Bj, short Bx, int Cp, int Cj, short Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          int Bp, int Bj, unsigned short Bx, int Cp,
+          int Cj, unsigned short Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp,
+          int Bj, int Bx, int Cp, int Cj, int Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          int Bp, int Bj, unsigned int Bx, int Cp,
+          int Cj, unsigned int Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          int Bp, int Bj, long long Bx, int Cp, int Cj,
+          long long Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          int Bp, int Bj, unsigned long long Bx,
+          int Cp, int Cj, unsigned long long Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp,
+          int Bj, float Bx, int Cp, int Cj, float Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp,
+          int Bj, double Bx, int Cp, int Cj, double Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          int Bp, int Bj, long double Bx, int Cp, int Cj,
+          long double Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          int Bp, int Bj, npy_cfloat_wrapper Bx,
+          int Cp, int Cj, npy_cfloat_wrapper Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          int Bp, int Bj, npy_cdouble_wrapper Bx,
+          int Cp, int Cj, npy_cdouble_wrapper Cx)
+      csr_eldiv_csr(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          int Bp, int Bj, npy_clongdouble_wrapper Bx,
+          int Cp, int Cj, npy_clongdouble_wrapper Cx)
+      """
+    return _csr.csr_eldiv_csr(*args)
 
 def csr_plus_csr(*args):
-  """
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        int Bp, int Bj, signed char Bx, int Cp, int Cj, 
-        signed char Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        int Bp, int Bj, unsigned char Bx, int Cp, 
-        int Cj, unsigned char Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp, 
-        int Bj, short Bx, int Cp, int Cj, short Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        int Bp, int Bj, unsigned short Bx, int Cp, 
-        int Cj, unsigned short Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp, 
-        int Bj, int Bx, int Cp, int Cj, int Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        int Bp, int Bj, unsigned int Bx, int Cp, 
-        int Cj, unsigned int Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        int Bp, int Bj, long long Bx, int Cp, int Cj, 
-        long long Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        int Bp, int Bj, unsigned long long Bx, 
-        int Cp, int Cj, unsigned long long Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, 
-        int Bj, float Bx, int Cp, int Cj, float Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, 
-        int Bj, double Bx, int Cp, int Cj, double Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        int Bp, int Bj, long double Bx, int Cp, int Cj, 
-        long double Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        int Bp, int Bj, npy_cfloat_wrapper Bx, 
-        int Cp, int Cj, npy_cfloat_wrapper Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        int Bp, int Bj, npy_cdouble_wrapper Bx, 
-        int Cp, int Cj, npy_cdouble_wrapper Cx)
-    csr_plus_csr(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bj, npy_clongdouble_wrapper Bx, 
-        int Cp, int Cj, npy_clongdouble_wrapper Cx)
     """
-  return _csr.csr_plus_csr(*args)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          int Bp, int Bj, signed char Bx, int Cp, int Cj,
+          signed char Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          int Bp, int Bj, unsigned char Bx, int Cp,
+          int Cj, unsigned char Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp,
+          int Bj, short Bx, int Cp, int Cj, short Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          int Bp, int Bj, unsigned short Bx, int Cp,
+          int Cj, unsigned short Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp,
+          int Bj, int Bx, int Cp, int Cj, int Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          int Bp, int Bj, unsigned int Bx, int Cp,
+          int Cj, unsigned int Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          int Bp, int Bj, long long Bx, int Cp, int Cj,
+          long long Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          int Bp, int Bj, unsigned long long Bx,
+          int Cp, int Cj, unsigned long long Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp,
+          int Bj, float Bx, int Cp, int Cj, float Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp,
+          int Bj, double Bx, int Cp, int Cj, double Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          int Bp, int Bj, long double Bx, int Cp, int Cj,
+          long double Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          int Bp, int Bj, npy_cfloat_wrapper Bx,
+          int Cp, int Cj, npy_cfloat_wrapper Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          int Bp, int Bj, npy_cdouble_wrapper Bx,
+          int Cp, int Cj, npy_cdouble_wrapper Cx)
+      csr_plus_csr(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          int Bp, int Bj, npy_clongdouble_wrapper Bx,
+          int Cp, int Cj, npy_clongdouble_wrapper Cx)
+      """
+    return _csr.csr_plus_csr(*args)
 
 def csr_minus_csr(*args):
-  """
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        int Bp, int Bj, signed char Bx, int Cp, int Cj, 
-        signed char Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        int Bp, int Bj, unsigned char Bx, int Cp, 
-        int Cj, unsigned char Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp, 
-        int Bj, short Bx, int Cp, int Cj, short Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        int Bp, int Bj, unsigned short Bx, int Cp, 
-        int Cj, unsigned short Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp, 
-        int Bj, int Bx, int Cp, int Cj, int Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        int Bp, int Bj, unsigned int Bx, int Cp, 
-        int Cj, unsigned int Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        int Bp, int Bj, long long Bx, int Cp, int Cj, 
-        long long Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        int Bp, int Bj, unsigned long long Bx, 
-        int Cp, int Cj, unsigned long long Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp, 
-        int Bj, float Bx, int Cp, int Cj, float Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp, 
-        int Bj, double Bx, int Cp, int Cj, double Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        int Bp, int Bj, long double Bx, int Cp, int Cj, 
-        long double Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        int Bp, int Bj, npy_cfloat_wrapper Bx, 
-        int Cp, int Cj, npy_cfloat_wrapper Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        int Bp, int Bj, npy_cdouble_wrapper Bx, 
-        int Cp, int Cj, npy_cdouble_wrapper Cx)
-    csr_minus_csr(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        int Bp, int Bj, npy_clongdouble_wrapper Bx, 
-        int Cp, int Cj, npy_clongdouble_wrapper Cx)
     """
-  return _csr.csr_minus_csr(*args)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          int Bp, int Bj, signed char Bx, int Cp, int Cj,
+          signed char Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          int Bp, int Bj, unsigned char Bx, int Cp,
+          int Cj, unsigned char Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, short Ax, int Bp,
+          int Bj, short Bx, int Cp, int Cj, short Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          int Bp, int Bj, unsigned short Bx, int Cp,
+          int Cj, unsigned short Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, int Ax, int Bp,
+          int Bj, int Bx, int Cp, int Cj, int Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          int Bp, int Bj, unsigned int Bx, int Cp,
+          int Cj, unsigned int Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          int Bp, int Bj, long long Bx, int Cp, int Cj,
+          long long Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          int Bp, int Bj, unsigned long long Bx,
+          int Cp, int Cj, unsigned long long Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, float Ax, int Bp,
+          int Bj, float Bx, int Cp, int Cj, float Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, double Ax, int Bp,
+          int Bj, double Bx, int Cp, int Cj, double Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          int Bp, int Bj, long double Bx, int Cp, int Cj,
+          long double Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          int Bp, int Bj, npy_cfloat_wrapper Bx,
+          int Cp, int Cj, npy_cfloat_wrapper Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          int Bp, int Bj, npy_cdouble_wrapper Bx,
+          int Cp, int Cj, npy_cdouble_wrapper Cx)
+      csr_minus_csr(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          int Bp, int Bj, npy_clongdouble_wrapper Bx,
+          int Cp, int Cj, npy_clongdouble_wrapper Cx)
+      """
+    return _csr.csr_minus_csr(*args)
 
 def csr_sort_indices(*args):
-  """
-    csr_sort_indices(int n_row, int Ap, int Aj, signed char Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, unsigned char Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, short Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, unsigned short Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, int Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, unsigned int Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, long long Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, unsigned long long Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, float Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, double Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, long double Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, npy_cfloat_wrapper Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, npy_cdouble_wrapper Ax)
-    csr_sort_indices(int n_row, int Ap, int Aj, npy_clongdouble_wrapper Ax)
     """
-  return _csr.csr_sort_indices(*args)
+      csr_sort_indices(int n_row, int Ap, int Aj, signed char Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, unsigned char Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, short Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, unsigned short Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, int Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, unsigned int Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, long long Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, unsigned long long Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, float Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, double Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, long double Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, npy_cfloat_wrapper Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, npy_cdouble_wrapper Ax)
+      csr_sort_indices(int n_row, int Ap, int Aj, npy_clongdouble_wrapper Ax)
+      """
+    return _csr.csr_sort_indices(*args)
 
 def csr_eliminate_zeros(*args):
-  """
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, signed char Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, unsigned char Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, short Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, unsigned short Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, int Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, unsigned int Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, long long Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, float Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, double Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, long double Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax)
-    csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax)
     """
-  return _csr.csr_eliminate_zeros(*args)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, signed char Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, unsigned char Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, short Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, unsigned short Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, int Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, unsigned int Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, long long Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, float Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, double Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, long double Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax)
+      csr_eliminate_zeros(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax)
+      """
+    return _csr.csr_eliminate_zeros(*args)
 
 def csr_sum_duplicates(*args):
-  """
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, signed char Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, unsigned char Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, short Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, unsigned short Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, int Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, unsigned int Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, long long Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, float Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, double Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, long double Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax)
-    csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax)
     """
-  return _csr.csr_sum_duplicates(*args)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, signed char Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, unsigned char Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, short Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, unsigned short Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, int Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, unsigned int Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, long long Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, float Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, double Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, long double Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax)
+      csr_sum_duplicates(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax)
+      """
+    return _csr.csr_sum_duplicates(*args)
 
 def get_csr_submatrix(*args):
-  """
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, signed char Ax, 
-        int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
-        std::vector<(int)> Bj, std::vector<(signed char)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned char Ax, 
-        int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
-        std::vector<(int)> Bj, std::vector<(unsigned char)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, short Ax, int ir0, 
-        int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
-        std::vector<(int)> Bj, std::vector<(short)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned short Ax, 
-        int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
-        std::vector<(int)> Bj, std::vector<(unsigned short)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, int Ax, int ir0, 
-        int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
-        std::vector<(int)> Bj, std::vector<(int)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned int Ax, 
-        int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
-        std::vector<(int)> Bj, std::vector<(unsigned int)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, long long Ax, 
-        int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
-        std::vector<(int)> Bj, std::vector<(long long)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax, 
-        int ir0, int ir1, int ic0, int ic1, 
-        std::vector<(int)> Bp, std::vector<(int)> Bj, 
-        std::vector<(unsigned long long)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, float Ax, int ir0, 
-        int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
-        std::vector<(int)> Bj, std::vector<(float)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, double Ax, int ir0, 
-        int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
-        std::vector<(int)> Bj, std::vector<(double)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, long double Ax, 
-        int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp, 
-        std::vector<(int)> Bj, std::vector<(long double)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax, 
-        int ir0, int ir1, int ic0, int ic1, 
-        std::vector<(int)> Bp, std::vector<(int)> Bj, 
-        std::vector<(npy_cfloat_wrapper)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax, 
-        int ir0, int ir1, int ic0, int ic1, 
-        std::vector<(int)> Bp, std::vector<(int)> Bj, 
-        std::vector<(npy_cdouble_wrapper)> Bx)
-    get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax, 
-        int ir0, int ir1, int ic0, int ic1, 
-        std::vector<(int)> Bp, std::vector<(int)> Bj, 
-        std::vector<(npy_clongdouble_wrapper)> Bx)
     """
-  return _csr.get_csr_submatrix(*args)
-
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, signed char Ax,
+          int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp,
+          std::vector<(int)> Bj, std::vector<(signed char)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned char Ax,
+          int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp,
+          std::vector<(int)> Bj, std::vector<(unsigned char)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, short Ax, int ir0,
+          int ir1, int ic0, int ic1, std::vector<(int)> Bp,
+          std::vector<(int)> Bj, std::vector<(short)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned short Ax,
+          int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp,
+          std::vector<(int)> Bj, std::vector<(unsigned short)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, int Ax, int ir0,
+          int ir1, int ic0, int ic1, std::vector<(int)> Bp,
+          std::vector<(int)> Bj, std::vector<(int)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned int Ax,
+          int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp,
+          std::vector<(int)> Bj, std::vector<(unsigned int)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, long long Ax,
+          int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp,
+          std::vector<(int)> Bj, std::vector<(long long)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, unsigned long long Ax,
+          int ir0, int ir1, int ic0, int ic1,
+          std::vector<(int)> Bp, std::vector<(int)> Bj,
+          std::vector<(unsigned long long)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, float Ax, int ir0,
+          int ir1, int ic0, int ic1, std::vector<(int)> Bp,
+          std::vector<(int)> Bj, std::vector<(float)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, double Ax, int ir0,
+          int ir1, int ic0, int ic1, std::vector<(int)> Bp,
+          std::vector<(int)> Bj, std::vector<(double)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, long double Ax,
+          int ir0, int ir1, int ic0, int ic1, std::vector<(int)> Bp,
+          std::vector<(int)> Bj, std::vector<(long double)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_cfloat_wrapper Ax,
+          int ir0, int ir1, int ic0, int ic1,
+          std::vector<(int)> Bp, std::vector<(int)> Bj,
+          std::vector<(npy_cfloat_wrapper)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_cdouble_wrapper Ax,
+          int ir0, int ir1, int ic0, int ic1,
+          std::vector<(int)> Bp, std::vector<(int)> Bj,
+          std::vector<(npy_cdouble_wrapper)> Bx)
+      get_csr_submatrix(int n_row, int n_col, int Ap, int Aj, npy_clongdouble_wrapper Ax,
+          int ir0, int ir1, int ic0, int ic1,
+          std::vector<(int)> Bp, std::vector<(int)> Bj,
+          std::vector<(npy_clongdouble_wrapper)> Bx)
+      """
+    return _csr.get_csr_submatrix(*args)

Modified: branches/refactor_fft/scipy/sparse/sparsetools/dia.py
===================================================================
--- branches/refactor_fft/scipy/sparse/sparsetools/dia.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/sparsetools/dia.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -51,40 +51,39 @@
 
 
 def dia_matvec(*args):
-  """
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        signed char diags, signed char Xx, signed char Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        unsigned char diags, unsigned char Xx, unsigned char Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        short diags, short Xx, short Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        unsigned short diags, unsigned short Xx, 
-        unsigned short Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        int diags, int Xx, int Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        unsigned int diags, unsigned int Xx, unsigned int Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        long long diags, long long Xx, long long Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        unsigned long long diags, unsigned long long Xx, 
-        unsigned long long Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        float diags, float Xx, float Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        double diags, double Xx, double Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        long double diags, long double Xx, long double Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        npy_cfloat_wrapper diags, npy_cfloat_wrapper Xx, 
-        npy_cfloat_wrapper Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        npy_cdouble_wrapper diags, npy_cdouble_wrapper Xx, 
-        npy_cdouble_wrapper Yx)
-    dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets, 
-        npy_clongdouble_wrapper diags, npy_clongdouble_wrapper Xx, 
-        npy_clongdouble_wrapper Yx)
     """
-  return _dia.dia_matvec(*args)
-
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          signed char diags, signed char Xx, signed char Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          unsigned char diags, unsigned char Xx, unsigned char Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          short diags, short Xx, short Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          unsigned short diags, unsigned short Xx,
+          unsigned short Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          int diags, int Xx, int Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          unsigned int diags, unsigned int Xx, unsigned int Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          long long diags, long long Xx, long long Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          unsigned long long diags, unsigned long long Xx,
+          unsigned long long Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          float diags, float Xx, float Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          double diags, double Xx, double Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          long double diags, long double Xx, long double Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          npy_cfloat_wrapper diags, npy_cfloat_wrapper Xx,
+          npy_cfloat_wrapper Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          npy_cdouble_wrapper diags, npy_cdouble_wrapper Xx,
+          npy_cdouble_wrapper Yx)
+      dia_matvec(int n_row, int n_col, int n_diags, int L, int offsets,
+          npy_clongdouble_wrapper diags, npy_clongdouble_wrapper Xx,
+          npy_clongdouble_wrapper Yx)
+      """
+    return _dia.dia_matvec(*args)

Modified: branches/refactor_fft/scipy/sparse/sputils.py
===================================================================
--- branches/refactor_fft/scipy/sparse/sputils.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/sputils.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -100,7 +100,7 @@
         # Assume it's a tuple of matrix dimensions (M, N)
         (M, N) = x
         assert isintlike(M) and isintlike(N)   # raises TypeError unless integers
-        assert M > 0 and N > 0
+        #assert M > 0 and N > 0
     except (ValueError, TypeError, AssertionError):
         return False
     else:

Modified: branches/refactor_fft/scipy/sparse/tests/test_base.py
===================================================================
--- branches/refactor_fft/scipy/sparse/tests/test_base.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/tests/test_base.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -34,7 +34,6 @@
 warnings.simplefilter('ignore',SparseEfficiencyWarning)
 
 
-#TODO check that invalid shape in constructor raises exception
 #TODO check that spmatrix( ... , copy=X ) is respected
 #TODO test prune
 #TODO test has_sorted_indices
@@ -45,13 +44,24 @@
         self.dat = matrix([[1,0,0,2],[3,0,1,0],[0,2,0,0]],'d')
         self.datsp = self.spmatrix(self.dat)
 
+    def test_empty(self):
+        """create empty matrices"""
+
+        assert_equal(self.spmatrix((3,3)).todense(), np.zeros((3,3)))
+        assert_equal(self.spmatrix((3,3)).nnz, 0)
+
+    def test_invalid_shapes(self):
+        assert_raises(ValueError, self.spmatrix, (-1,3) )
+        assert_raises(ValueError, self.spmatrix, (3,-1) )
+        assert_raises(ValueError, self.spmatrix, (-1,-1) )
+
     def test_repr(self):
         repr(self.datsp)
 
     def test_str(self):
         str(self.datsp)
 
-    def test_empty(self):
+    def test_empty_arithmetic(self):
         """Test manipulating empty matrices. Fails in SciPy SVN <= r1768
         """
         shape = (5, 5)
@@ -304,17 +314,11 @@
         assert(isinstance( M * array([1,2,3]), ndarray))
         assert(isinstance( M * matrix([1,2,3]).T, matrix))
 
-
         #ensure exception is raised for improper dimensions
         bad_vecs = [array([1,2]), array([1,2,3,4]), array([[1],[2]]),
                     matrix([1,2,3]), matrix([[1],[2]])]
-        caught = 0
         for x in bad_vecs:
-            try:
-                y = M * x
-            except ValueError:
-                caught += 1
-        assert_equal(caught,len(bad_vecs))
+            assert_raises(ValueError, M.__mul__, x)
 
         # Should this be supported or not?!
         #flat = array([1,2,3])
@@ -351,21 +355,18 @@
         csp = bsp.tocsc()
         c = b
         assert_array_almost_equal((asp*csp).todense(), a*c)
-        assert_array_almost_equal((asp.matmat(csp)).todense(), a*c)
         assert_array_almost_equal( asp*c, a*c)
 
         assert_array_almost_equal( a*csp, a*c)
         assert_array_almost_equal( a2*csp, a*c)
         csp = bsp.tocsr()
         assert_array_almost_equal((asp*csp).todense(), a*c)
-        assert_array_almost_equal((asp.matmat(csp)).todense(), a*c)
         assert_array_almost_equal( asp*c, a*c)
 
         assert_array_almost_equal( a*csp, a*c)
         assert_array_almost_equal( a2*csp, a*c)
         csp = bsp.tocoo()
         assert_array_almost_equal((asp*csp).todense(), a*c)
-        assert_array_almost_equal((asp.matmat(csp)).todense(), a*c)
         assert_array_almost_equal( asp*c, a*c)
 
         assert_array_almost_equal( a*csp, a*c)
@@ -522,47 +523,6 @@
         assert_array_equal(self.dat/17.3,a.todense())
 
 
-class _TestMatvecOutput:
-    """test using the matvec() output parameter"""
-    def test_matvec_output(self):
-        pass  #Currently disabled
-
-#        #flat array
-#        x = array([1.25, -6.5, 0.125, -3.75],dtype='d')
-#        y = zeros(3,dtype='d')
-#
-#        self.datsp.matvec(x,y)
-#        assert_array_equal(self.datsp*x,y)
-#
-#        #column vector
-#        x = array([1.25, -6.5, 0.125, -3.75],dtype='d')
-#        x = x.reshape(4,1)
-#        y = zeros((3,1),dtype='d')
-#
-#        self.datsp.matvec(x,y)
-#        assert_array_equal(self.datsp*x,y)
-#
-#        # improper output type
-#        x = array([1.25, -6.5, 0.125, -3.75],dtype='d')
-#        y = zeros(3,dtype='i')
-#
-#        self.assertRaises( ValueError, self.datsp.matvec, x, y )
-#
-#        # improper output shape
-#        x = array([1.25, -6.5, 0.125, -3.75],dtype='d')
-#        y = zeros(2,dtype='d')
-#
-#        self.assertRaises( ValueError, self.datsp.matvec, x, y )
-#
-#        # proper upcast output type
-#        x = array([1.25, -6.5, 0.125, -3.75],dtype='complex64')
-#        x.imag = [1,2,3,4]
-#        y = zeros(3,dtype='complex128')
-#
-#        self.datsp.matvec(x,y)
-#        assert_array_equal(self.datsp*x,y)
-#        assert_equal((self.datsp*x).dtype,y.dtype)
-
 class _TestGetSet:
     def test_setelement(self):
         a = self.spmatrix((3,4))
@@ -889,7 +849,7 @@
 
 
 class TestCSR(_TestCommon, _TestGetSet, _TestSolve,
-        _TestInplaceArithmetic, _TestArithmetic, _TestMatvecOutput,
+        _TestInplaceArithmetic, _TestArithmetic,
         _TestHorizSlicing, _TestVertSlicing, _TestBothSlicing,
         _TestFancyIndexing, TestCase):
     spmatrix = csr_matrix
@@ -986,7 +946,7 @@
 
 
 class TestCSC(_TestCommon, _TestGetSet, _TestSolve,
-        _TestInplaceArithmetic, _TestArithmetic, _TestMatvecOutput,
+        _TestInplaceArithmetic, _TestArithmetic,
         _TestHorizSlicing, _TestVertSlicing, _TestBothSlicing,
         _TestFancyIndexing, TestCase):
     spmatrix = csc_matrix
@@ -1304,10 +1264,10 @@
         assert_array_equal(C.A, D.A)
 
     def test_fancy_indexing(self):
-        M = arange(25).reshape(5,5) 
+        M = arange(25).reshape(5,5)
         A = lil_matrix( M )
 
-        assert_equal(A[array([1,2,3]),2:3].todense(), M[array([1,2,3]),2:3])   
+        assert_equal(A[array([1,2,3]),2:3].todense(), M[array([1,2,3]),2:3])
 
     def test_point_wise_multiply(self):
         l = lil_matrix((4,3))
@@ -1371,8 +1331,8 @@
     def test_constructor4(self):
         """from dense matrix"""
         mat = array([[0,1,0,0],
-                           [7,0,3,0],
-                           [0,4,0,0]])
+                     [7,0,3,0],
+                     [0,4,0,0]])
         coo = coo_matrix(mat)
         assert_array_equal(coo.todense(),mat)
 
@@ -1386,12 +1346,17 @@
     spmatrix = dia_matrix
 
     def test_constructor1(self):
-        pass
-        #TODO add test
+        D = matrix([[1, 0, 3, 0],
+                    [1, 2, 0, 4],
+                    [0, 2, 3, 0],
+                    [0, 0, 3, 4]])
+        data    = np.array([[1,2,3,4]]).repeat(3,axis=0)
+        offsets = np.array([0,-1,2])
+        assert_equal(dia_matrix( (data,offsets), shape=(4,4)).todense(), D)
 
 
-class TestBSR(_TestCommon, _TestArithmetic, _TestInplaceArithmetic,
-        _TestMatvecOutput, TestCase):
+
+class TestBSR(_TestCommon, _TestArithmetic, _TestInplaceArithmetic, TestCase):
     spmatrix = bsr_matrix
 
     def test_constructor1(self):

Modified: branches/refactor_fft/scipy/sparse/tests/test_sputils.py
===================================================================
--- branches/refactor_fft/scipy/sparse/tests/test_sputils.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/sparse/tests/test_sputils.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -47,10 +47,9 @@
         assert_equal(isshape( (1,2) ),True)
         assert_equal(isshape( (5,2) ),True)
 
-        assert_equal(isshape( (-1,4) ),False)
         assert_equal(isshape( (1.5,2) ),False)
-        assert_equal(isshape( (0,4) ),False)
         assert_equal(isshape( (2,2,2) ),False)
+        assert_equal(isshape( ([2],2) ),False)
 
     def test_issequence(self):
         assert_equal(issequence( (1,) ),True)

Modified: branches/refactor_fft/scipy/stats/distributions.py
===================================================================
--- branches/refactor_fft/scipy/stats/distributions.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/stats/distributions.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -542,7 +542,7 @@
         goodargs = argsreduce(cond, *((x,)+args))
         place(output,cond,self._sf(*goodargs))
         if output.ndim == 0:
-            return output[()]        
+            return output[()]
         return output
 
     def ppf(self,q,*args,**kwds):
@@ -573,7 +573,7 @@
         scale, loc, goodargs = goodargs[-2], goodargs[-1], goodargs[:-2]
         place(output,cond,self._ppf(*goodargs)*scale + loc)
         if output.ndim == 0:
-            return output[()]        
+            return output[()]
         return output
 
     def isf(self,q,*args,**kwds):
@@ -3517,7 +3517,7 @@
         goodargs = argsreduce(cond, *((k,)+args))
         place(output,cond,self._pmf(*goodargs))
         if output.ndim == 0:
-            return output[()]        
+            return output[()]
         return output
 
     def cdf(self, k, *args, **kwds):
@@ -3547,7 +3547,7 @@
         goodargs = argsreduce(cond, *((k,)+args))
         place(output,cond,self._cdf(*goodargs))
         if output.ndim == 0:
-            return output[()]        
+            return output[()]
         return output
 
     def sf(self,k,*args,**kwds):
@@ -3577,7 +3577,7 @@
         goodargs = argsreduce(cond, *((k,)+args))
         place(output,cond,self._sf(*goodargs))
         if output.ndim == 0:
-            return output[()]        
+            return output[()]
         return output
 
     def ppf(self,q,*args,**kwds):
@@ -3607,7 +3607,7 @@
         loc, goodargs = goodargs[-1], goodargs[:-1]
         place(output,cond,self._ppf(*goodargs) + loc)
         if output.ndim == 0:
-            return output[()]        
+            return output[()]
         return output
 
     def isf(self,q,*args,**kwds):
@@ -3638,7 +3638,7 @@
         loc, goodargs = goodargs[-1], goodargs[:-1]
         place(output,cond,self._ppf(*goodargs) + loc)
         if output.ndim == 0:
-            return output[()]        
+            return output[()]
         return output
 
     def stats(self, *args, **kwds):

Modified: branches/refactor_fft/scipy/stats/stats.py
===================================================================
--- branches/refactor_fft/scipy/stats/stats.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/stats/stats.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -489,10 +489,7 @@
     - numpy.median has a ddof argument to replace bias in a more general manner.
       scipy.stats.median(a, bias=True) can be replaced by numpy.median(x,
 axis=0, ddof=1).""", DeprecationWarning)
-    a, axis = _chk_asarray(a, axis)
-    if axis != 0:
-        a = np.rollaxis(a, axis, 0)
-    return np.median(a)
+    return np.median(a, axis)
 
 def mode(a, axis=0):
     """Returns an array of the modal (most common) value in the passed array.

Modified: branches/refactor_fft/scipy/stats/tests/test_stats.py
===================================================================
--- branches/refactor_fft/scipy/stats/tests/test_stats.py	2008-10-26 09:20:24 UTC (rev 4845)
+++ branches/refactor_fft/scipy/stats/tests/test_stats.py	2008-10-26 11:02:22 UTC (rev 4846)
@@ -625,15 +625,6 @@
             A += val
         assert_almost_equal(stats.mean(a,axis=None),A/(5*3.0*5))
 
-class TestMedian(TestCase):
-    def test_basic(self):
-        a1 = [3,4,5,10,-3,-5,6]
-        a2 = [3,-6,-2,8,7,4,2,1]
-        a3 = [3.,4,5,10,-3,-5,-6,7.0]
-        assert_equal(stats.median(a1),4)
-        assert_equal(stats.median(a2),2.5)
-        assert_equal(stats.median(a3),3.5)
-
 class TestPercentile(TestCase):
     def setUp(self):
         self.a1 = [3,4,5,10,-3,-5,6]
@@ -694,6 +685,20 @@
         assert_almost_equal(stats.median(data1),2.5)
         assert_almost_equal(stats.median(data2),5)
 
+    def test_basic2(self):
+        a1 = [3,4,5,10,-3,-5,6]
+        a2 = [3,-6,-2,8,7,4,2,1]
+        a3 = [3.,4,5,10,-3,-5,-6,7.0]
+        assert_equal(stats.median(a1),4)
+        assert_equal(stats.median(a2),2.5)
+        assert_equal(stats.median(a3),3.5)
+
+    def test_axis(self):
+        """Regression test for #760."""
+        a1 = np.array([[3,4,5], [10,-3,-5]])
+        assert_equal(stats.median(a1), np.array([6.5, 0.5, 0.]))
+        assert_equal(stats.median(a1, axis=-1), np.array([4., -3]))
+
 class TestMode(TestCase):
     def test_basic(self):
         data1 = [3,5,1,10,23,3,2,6,8,6,10,6]



More information about the Scipy-svn mailing list